I need t开发者_如何学Co gain level 2 permissions for an android application, e.g.
android.permission.DEVICE_POWER or android.permission.REBOOT
Now I know that I need to have the firmware's signing key to be able to do this, but I'd like to be able to try it out on the emulator first. I'm unable to find any mention of a signing key for a system image for emulators.
Do I have to build an image from scratch (i.e. compile from the source) or is there any way I can get my hands on the signing key?
Did you try setting them in AndroidManifest? e.g
<uses-permission android:name="android.permission.REBOOT" />
See signatureOrSystem permissions on custom ROM. Basically unless the app is signed by the system platform signature these permissions can not be granted. Andriod 4.4 introduces the ability to put apps in /system/priv-app as an alternative. This later process requires a custom boot loader and/or root access to install.
精彩评论