| 359 | } |
| 360 | |
| 361 | AndroidInstallPermissionCheckResult CheckAndroidServerInstallPermissions(const rdcstr &deviceID, |
| 362 | rdcstr packageName, |
| 363 | int apiVersion) |
| 364 | { |
| 365 | // Permissions check only applicable to API >= 30 |
| 366 | if(apiVersion < 30) |
| 367 | { |
| 368 | return AndroidInstallPermissionCheckResult::Correct; |
| 369 | } |
| 370 | // Command to check that the Android Server is queryable by other APKs (API>=30) |
| 371 | Process::ProcessResult adbCheck = |
| 372 | adbExecCommand(deviceID, "shell dumpsys package queries " + packageName, ".", true); |
| 373 | // parse command output |
| 374 | int32_t sectionStart = adbCheck.strStdout.find("forceQueryable"); |
| 375 | int32_t sectionEnd = adbCheck.strStdout.find("queries via package name", sectionStart); |
| 376 | int32_t isPackageQueryable = adbCheck.strStdout.find(packageName, sectionStart, sectionEnd); |
| 377 | if(isPackageQueryable == -1) |
| 378 | { |
| 379 | RDCERR("Failed to install with 'force queryable' permissions."); |
| 380 | return AndroidInstallPermissionCheckResult::NotQueryable; |
| 381 | } |
| 382 | |
| 383 | return AndroidInstallPermissionCheckResult::Correct; |
| 384 | } |
| 385 | |
| 386 | Process::ProcessResult ListPackages(const rdcstr &deviceID, const rdcstr ¶meters) |
| 387 | { |
no test coverage detected