Merge "Prevent system reset staged installer bypass flag unexpactly" into rvc-dev am: 809bf93563
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12106109 Change-Id: I1a84ce3d8e8d50136455162e6d01c8a594289b2d
This commit is contained in:
@@ -589,12 +589,12 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mBypassNextStagedInstallerCheck) {
|
if (params.isStaged && !isCalledBySystemOrShell(callingUid)) {
|
||||||
mBypassNextStagedInstallerCheck = false;
|
if (mBypassNextStagedInstallerCheck) {
|
||||||
} else if (params.isStaged
|
mBypassNextStagedInstallerCheck = false;
|
||||||
&& !isCalledBySystemOrShell(callingUid)
|
} else if (!isStagedInstallerAllowed(requestedInstallerPackageName)) {
|
||||||
&& !isWhitelistedStagedInstaller(requestedInstallerPackageName)) {
|
throw new SecurityException("Installer not allowed to commit staged install");
|
||||||
throw new SecurityException("Installer not allowed to commit staged install");
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!params.isMultiPackage) {
|
if (!params.isMultiPackage) {
|
||||||
@@ -725,7 +725,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
|
|||||||
|| callingUid == Process.SHELL_UID;
|
|| callingUid == Process.SHELL_UID;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isWhitelistedStagedInstaller(String installerName) {
|
private boolean isStagedInstallerAllowed(String installerName) {
|
||||||
return SystemConfig.getInstance().getWhitelistedStagedInstallers().contains(installerName);
|
return SystemConfig.getInstance().getWhitelistedStagedInstallers().contains(installerName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user