parse adb command output on host

Change-Id: I6b1a0c7612d5ecb0edc0a48ae91b1557b7d6c8e1
This commit is contained in:
Tristan Ritchie
2024-01-10 14:54:53 +00:00
committed by Baldur Karlsson
parent 4effbfaca1
commit 7a22f9579d
+7 -10
View File
@@ -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;