第一步,配置AndroidManifest.xml文件。
首先,加入:android:sharedUserId="android.uid.system"
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.xxxxxx"
android:sharedUserId="android.uid.system"
android:versionCode="1"
android:versionName="1.0" >
通过shareUserId,拥有同一个User id的多个APK就可以配置成运行在同一个进程中,那么把程序的UID配成android.uid.system,也就是要让程序运行在系统进程中,这样就可以拥有系统权限。
升级要记得版本号要比旧版本大!
然后,配置应用需要的权限: