1. 程式人生 > >Android 跨進程調用忽略權限

Android 跨進程調用忽略權限

final ram finally gid override identity stack work 權限

Framework層:

@Override
public StackInfo getStackInfo(int stackId) {
final int callingUid = Binder.getCallingUid(); // 拿到調用者身份
if (callingUid != 0 && callingUid != Process.SYSTEM_UID) {
// TODO
}

long ident = Binder.clearCallingIdentity(); // 轉調用身份為android


try {
// TODO
} finally {
Binder.restoreCallingIdentity(ident);// 做完事之後,恢復調用者身份
}
}

Android 跨進程調用忽略權限