Handle failed APK installation and patching

If "adb install" command is used with "-g" flag, we may get java.lang.SecurityException on some devices because granting runtime permissions at installation time is only allowed for system apps (however we can enable it in the device's Developer options menu).
Also, pulling APK from /data/app/ may be restricted. We can workaround by copying the APK to a directory which we can access then try to pull the APK from there.
This commit is contained in:
tabi.katalin
2018-10-15 17:09:16 +02:00
committed by Baldur Karlsson
parent 691c115946
commit 6c39b58d0b
9 changed files with 119 additions and 21 deletions
+34 -1
View File
@@ -1843,7 +1843,11 @@ void MainWindow::switchContext()
statusProgress->setMaximum(0);
});
host->Launch();
ReplayStatus launchStatus = host->Launch();
if(launchStatus != ReplayStatus::Succeeded)
{
showLaunchError(launchStatus);
}
// check if it's running now
host->CheckStatus();
@@ -2800,3 +2804,32 @@ bool MainWindow::LoadLayout(int layout)
return false;
}
void MainWindow::showLaunchError(ReplayStatus status)
{
QString title;
QString message;
switch(status)
{
case ReplayStatus::AndroidGrantPermissionsFailed:
title = tr("Permission is required");
message = tr("Enable RenderDocCmd to access storage on your device.");
break;
case ReplayStatus::AndroidABINotFound:
title = tr("Failed to install RenderDoc server");
message = tr("Couldn't determine supported ABIs.");
break;
case ReplayStatus::AndroidAPKFolderNotFound:
title = tr("Failed to install RenderDoc server");
message = tr("APK folder missing.");
break;
case ReplayStatus::AndroidAPKInstallFailed:
title = tr("Failed to install RenderDoc server");
message = tr("Couldn't find any installed APKs.");
default:
title = tr("Failed to install RenderDoc server");
message = tr("Unknown error.");
break;
}
GUIInvoke::call(this, [this, title, message]() { RDDialog::warning(this, title, message); });
}