Merge "Package checks for resloving recovery tokens should be user sensitive." into klp-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
cdb9ea79a5
@@ -2167,15 +2167,20 @@ public class AccountManagerService
|
|||||||
* this can be very bad when those apps are in the system like
|
* this can be very bad when those apps are in the system like
|
||||||
* the System Settings.
|
* the System Settings.
|
||||||
*/
|
*/
|
||||||
PackageManager pm = mContext.getPackageManager();
|
|
||||||
ResolveInfo resolveInfo = pm.resolveActivity(intent, 0);
|
|
||||||
int targetUid = resolveInfo.activityInfo.applicationInfo.uid;
|
|
||||||
int authenticatorUid = Binder.getCallingUid();
|
int authenticatorUid = Binder.getCallingUid();
|
||||||
if (PackageManager.SIGNATURE_MATCH !=
|
long bid = Binder.clearCallingIdentity();
|
||||||
pm.checkSignatures(authenticatorUid, targetUid)) {
|
try {
|
||||||
throw new SecurityException(
|
PackageManager pm = mContext.getPackageManager();
|
||||||
"Activity to be started with KEY_INTENT must " +
|
ResolveInfo resolveInfo = pm.resolveActivityAsUser(intent, 0, mAccounts.userId);
|
||||||
"share Authenticator's signatures");
|
int targetUid = resolveInfo.activityInfo.applicationInfo.uid;
|
||||||
|
if (PackageManager.SIGNATURE_MATCH !=
|
||||||
|
pm.checkSignatures(authenticatorUid, targetUid)) {
|
||||||
|
throw new SecurityException(
|
||||||
|
"Activity to be started with KEY_INTENT must " +
|
||||||
|
"share Authenticator's signatures");
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
Binder.restoreCallingIdentity(bid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (result != null
|
if (result != null
|
||||||
|
|||||||
Reference in New Issue
Block a user