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 authored and Baldur Karlsson committed 2018-11-13 11:38:44 +00:00
1 parent 691c115946
commit 6c39b58d0b
9 files changed
+119 -21

No files matched your search

+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); });
}