Resolution: INJECT_EVENTS for Instruenation for other applications

I know that this is not the first topic about this permission, but others are not finished or do not help me.

I need to inflate KeyEvents using Instrumentation. This works great and is insanely faster than the shell ("input keyevent") method. But if I want to add to other applications, I will catch a SecurityException. This did not surprise me, so I added <uses-permission android:name="android.permission.INJECT_EVENTS" /> to my manifest. Eclipse stops debugging this, saying that only system applications can use this permission. So I compiled using the signed apk tool and clicked on apk in / system / app. Reboot and guess what

 W/PackageManager( 3499): Not granting permission android.permission.INJECT_EVENTS to package com.<....> (protectionLevel=2 flags=0x8be45) 

The application is intended for only one special device. Therefore, I know all the specifications and is rooted. But su injection teams are time consuming and SuperUser is required. I would like to do this with Instrumentation or maybe there is something else that I should try?

The firmware is not written by me, so I do not have a platform key.

Thank you for your help!

EDIT: got the platform keys (Dev used regular Google), signed and aligned, and then pushed apk to / system / app. Also added android:sharedUserId="android.uid.system" to my manifest. Boot no longer has a logcat message. However, when I want to send keysync, I still subtract SecurityException . Any ideas?

EDIT2: Here is an excerpt from ps . It looks like the package is missing from the system

 u0_a108 5241 2399 492044 48968 ffffffff 40113ab0 S com.mypackage 
+6
source share
1 answer

Refresh

Use the signtool icon located here , then go and read on my blog.

Ok, I got the right keys for the platform, and now it works like a charm! I signed using http://forum.xda-developers.com/showthread.php?t=1125626 and replaced (renamed the character .... to testkey ....) the test keys inside the signare folder with

 signapk-key.platform.x509.pem signapk-key.platform.pk8 

(Google for them)

Also make sure zipalign and then copy to / system / app. Installing .apk in the usual way is NOT possible, since it is marked as a system application.

+3
source

All Articles