1:系统预制App的提权问题
final ProcessRecord addAppLocked(ApplicationInfo info, boolean isolated,
String abiOverride) {
ProcessRecord app;
...
if ((info.flags & PERSISTENT_MASK) == PERSISTENT_MASK) {
app.persistent = true;
app.maxAdj = ProcessList.PERSISTENT_PROC_ADJ;
}
return app;
}
预制的App只要在manifest中添加一个persistent
属性就可以了。
<application
android:allowBackup=“true"
android:icon="@mipmap/ic_launcher”
android:persistent=“true"
android:label="@string/app_name”
android:roundIcon="@mipmap/ic_launcher_round”
android:supportsRtl=“true"
android:theme="@style/AppTheme">