Android System / Platform signed privileges for actions like Instrumentation

Attention: Using a high-level signature will not work in every ROM, so it only should be considered if there is absolutely no other way of doing this. Also it shall only be used for dedicated devices. I don't recommend putting it public on Google Play. However it should not violate Googles Developer TOS!

Sometimes you need to dig deeper into Android. Especially if you are an OEM or if you make a custom ROM in which you want to add additional features. 
Personally, I used system-signatures to send Key Syncs to foreign Activities i.e. Activities not developed / signed by me. I used that in the moui control remote app. If you are trying this without valid signatures you will end up in SecurityExceptions. 

 So how do you get rid of them?


  1. Obtain Platform Key (pk8 and x509)
  2. Modify AndroidManifest.xml
  3. Export unsigned
  4. Sign with signtools and platformkey
  5. Put to /system/app
Unfortunately Step #1 is the most problematic one, since typically the platform key is not distributed. However most ROMs use the default Google key which is inside the linked zip file. ROM developers who build Android from scratch will have their key inside one of the build directories.

2. Edit AndroidManifest.xml

<manifest 
xmlns:android="http://schemas.android.com/apk/res/android"

android:shareduserid="android.uid.system"

android:versioncode="1" 
android:versionname="Analog Adam" 
package="com.company.app"> ...

3. Should be clear ;-) 
Unsigned Export

4. Signing with Sign+ (Scroll below)

Just select the right keys (both platform) and drag 'n drop the apk, press sign and everything should be fine. A new apk will be created with the suffix _signed. 

Sign+


5. Put to /system/app

Put it there and check logcat for possible errors. Restarting your device should make the app visible.


Link to the Tool and keys: Click.