when I add android.permission.UPDATE_DEVICE_STATS to my app.error occur

岁酱吖の 提交于 2019-12-06 01:39:37
Timmetje

Most importantly to know: A system app can only be run by people who have rooted their device. Meaning you can't test and run your own application if you don't have a rooted device.

You can declare your app to run as a system app by setting the sharedUserId as follows in the AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="[your package name]"
        android:sharedUserId="android.uid.system">

Otherwise you have to sign your application with system key , see this thread How to compile Android Application with system permissions

what can I do to change my app to system app.

Build your own firmware (i.e., ROM mod) and sign your app with the same signing key as you used with that firmware.

Or, since this is a signature-or-system permission, you can root your device and install the APK on the system partition.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!