简体   繁体   中英

Signing and Android app as root

I want to run an app for testing some specific scenarios in root mode. From the android developer site Android does not provide apps with root privileges except when using FACTORY_TEST permission. From reading online I found that for using the permission, I need to sign it with platform keys that are generated while building the Android source code. If I have access to platform signatures then how to add android.permission.FACTORY_TEST permission?

Every time I add this setting in the manifest.xml, the xml displays an error saying only factory applications can use this. All the online help turned up till now asks me to do the following steps.

  1. Add android:sharedUserId="android.uid.system . Export the apk as unsigned apk from eclipse.
  2. Sign the apk with platform keys.
  3. Install and it and use it.

Since the manifest throws the error, do I need to simply ignore the error and continue?
Are there any detailed steps on how to do it?

om the android developer site Android does not provide apps with root privileges except when using FACTORY_TEST permission. From reading online I found that for using the permission, I need to sign it with platform keys that are generated while building the Android source code.

Where did you read this? As I understand, you cannot use the FACTORY_TEST permission without having access to the key used by the OEM to sign their firmware or otherwise compiling and signing your own modified firmware.

Is this the kind of message you are seeing?

08-05 17:57:46.170: WARN/PackageManager(52): Not granting permission 
android.permission.FACTORY_TEST to package XXXX (protectionLevel=2
flags=0x7e44)

In any case, these permissions (with protectionLevel 2 or 3) can only be used if you're an OEM or building your own custom ROM (to run on a presumably rooted phone).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM