Skip to content

Commit 74cf013

Browse files
committed
Fixes accidentally ignoring authentication errors when installing AltStore
AltServer will now only ignore DeveloperDiskError's while installing AltStore or directly sideloading .ipa's, which was the intended functionality.
1 parent a19c330 commit 74cf013

1 file changed

Lines changed: 32 additions & 34 deletions

File tree

AltServer/AltServerApp.cpp

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -584,41 +584,39 @@ pplx::task<std::shared_ptr<Application>> AltServerApp::_InstallApplication(std::
584584
*certificate = *tempCertificate;
585585

586586
odslog("Preparing device...");
587-
return this->PrepareDevice(device);
587+
return this->PrepareDevice(device).then([=](pplx::task<void> task) {
588+
try
589+
{
590+
// Don't rethrow error, and instead continue installing app even if we couldn't install Developer disk image.
591+
task.get();
592+
}
593+
catch (Error& error)
594+
{
595+
odslog("Failed to install DeveloperDiskImage.dmg to " << *device << ". " << error.localizedDescription());
596+
}
597+
catch (std::exception& exception)
598+
{
599+
odslog("Failed to install DeveloperDiskImage.dmg to " << *device << ". " << exception.what());
600+
}
601+
602+
if (filepath.has_value())
603+
{
604+
odslog("Importing app...");
605+
606+
return pplx::create_task([filepath] {
607+
return fs::path(*filepath);
608+
});
609+
}
610+
else
611+
{
612+
odslog("Downloading app...");
613+
614+
// Show alert before downloading AltStore.
615+
this->ShowInstallationNotification("AltStore", device->name());
616+
return this->DownloadApp();
617+
}
618+
});
588619
})
589-
.then([=](pplx::task<void> task)
590-
{
591-
try
592-
{
593-
// Don't rethrow error, and instead continue installing app even if we couldn't install Developer disk image.
594-
task.get();
595-
}
596-
catch (Error& error)
597-
{
598-
odslog("Failed to install DeveloperDiskImage.dmg to " << *device << ". " << error.localizedDescription());
599-
}
600-
catch (std::exception& exception)
601-
{
602-
odslog("Failed to install DeveloperDiskImage.dmg to " << *device << ". " << exception.what());
603-
}
604-
605-
if (filepath.has_value())
606-
{
607-
odslog("Importing app...");
608-
609-
return pplx::create_task([filepath] {
610-
return fs::path(*filepath);
611-
});
612-
}
613-
else
614-
{
615-
odslog("Downloading app...");
616-
617-
// Show alert before downloading AltStore.
618-
this->ShowInstallationNotification("AltStore", device->name());
619-
return this->DownloadApp();
620-
}
621-
})
622620
.then([=](fs::path downloadedAppPath)
623621
{
624622
odslog("Downloaded app!");

0 commit comments

Comments
 (0)