mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 09:30:44 +00:00
parse adb command output on host
Change-Id: I6b1a0c7612d5ecb0edc0a48ae91b1557b7d6c8e1
This commit is contained in:
committed by
Baldur Karlsson
parent
4effbfaca1
commit
7a22f9579d
@@ -367,17 +367,14 @@ AndroidInstallPermissionCheckResult CheckAndroidServerInstallPermissions(const r
|
||||
{
|
||||
return AndroidInstallPermissionCheckResult::Correct;
|
||||
}
|
||||
// Command to check that the Android Server is queryable by other APKs (API>30)
|
||||
// for RenderDoc layer discovery.
|
||||
// Command to check that the Android Server is queryable by other APKs (API>=30)
|
||||
Process::ProcessResult adbCheck =
|
||||
adbExecCommand(deviceID,
|
||||
"shell \"dumpsys package queries | sed -n '/forceQueryable/,/queries via "
|
||||
"package name/p' | grep " +
|
||||
packageName + "\"",
|
||||
".", true);
|
||||
|
||||
// Check the output of 'grep' - no output means no match
|
||||
if(adbCheck.strStdout.empty())
|
||||
adbExecCommand(deviceID, "shell dumpsys package queries " + packageName, ".", true);
|
||||
// parse command output
|
||||
int32_t sectionStart = adbCheck.strStdout.find("forceQueryable");
|
||||
int32_t sectionEnd = adbCheck.strStdout.find("queries via package name", sectionStart);
|
||||
int32_t isPackageQueryable = adbCheck.strStdout.find(packageName, sectionStart, sectionEnd);
|
||||
if(isPackageQueryable == -1)
|
||||
{
|
||||
RDCERR("Failed to install with 'force queryable' permissions.");
|
||||
return AndroidInstallPermissionCheckResult::NotQueryable;
|
||||
|
||||
Reference in New Issue
Block a user