许可:INJECT_EVENTS为Instrumenation到其他应用程序 [英] Permission: INJECT_EVENTS for Instrumenation to other apps
问题描述
我知道,这是不是此权限的第一个线程,但其他的人都没有完成或不帮我。
我需要的是夸大使用仪器的KeyEvent。这个伟大工程,是出奇的比壳(输入的KeyEvent)方法更快。但是,如果我要注入到其他应用程序我赶上一个SecurityException。所以我说这并没有让我感到吃惊得多<使用-权限的Android:名称=android.permission.INJECT_EVENTS/>
我的清单。 Eclipse的停止调试这个告诉我,只有系统的应用程序可以使用此权限。所以我编译使用签名的APK工具,并推动了APK到/系统/应用程序。重新启动,并猜测
W / PackageManager(3499):未授予权限android.permission.INJECT_EVENTS包装COM< ...> (的ProtectionLevel = 2标志= 0x8be45)
该应用程序是针对只有一个特殊的装置。所以我知道所有的规格,它是植根。但苏
注命令采取长期和超级用户是必需的。我很乐意这样做与仪表或者有别的东西,我应该尝试?
固件不是我写的,所以我没有这个平台的关键。
感谢您的帮助!
编辑:拿到了平台密钥(在开发中使用的普通谷歌的),签署并对齐,然后推APK到/系统/应用程序。还增加了安卓sharedUserId =android.uid.system
我的清单。在引导也不再是logcat的消息。然而,当我想要发送的keysync我还是catche的 SecurityException异常
。任何想法?
EDIT2:下面是来自 PS
的摘录。好像没有列为系统封装IST
u0_a108 5241 2399 492044 48968 FFFFFFFF 40113ab0小号com.mypackage
更新
使用位于signtool的此处,然后继续和的在我的博客阅读。好吧,我得到了正确的平台密钥和它的工作原理就像一个魅力吧!我签使用 http://forum.xda-developers.com/showthread.php? T = 1125626 并替换(改名为标志......到密押....)signare文件夹内的testkeys与
signapk-key.platform.x509.pem
signapk-key.platform.pk8
(谷歌为他们)
另外,还要确保zipalign,然后复制到/系统/应用程序。安装apk文件以正常的方式是不会可能的,因为它被标记为系统应用程序。
I know that this is not the first Thread about this permission, however the other ones aren't finished or don't help me.
What I need is to inflate KeyEvents using Instrumentation. That works great and is insanely faster than the shell ("input keyevent ") method. But if I want to inject to other apps I catch a SecurityException. That didn't surprise me to much so I added <uses-permission android:name="android.permission.INJECT_EVENTS" />
to my manifest. Eclipse stops to debug this telling me that only system apps can use this permission. So I compiled using the signed apk tool and pushed that apk to /system/app. Rebooted, and guess what
W/PackageManager( 3499): Not granting permission android.permission.INJECT_EVENTS to package com.<....> (protectionLevel=2 flags=0x8be45)
The app is targeted for only one special device. So I know all the specs and it is rooted. But su
injection-commands take to long and SuperUser is required. I would love to do that with Instrumentation or maybe there is something else I should try?
The firmware is not written by me, so I don't have the platform key.
Thanks for your help!
EDIT: Got the platform keys (The dev used the normal Google ones), signed and aligned, then pushed the apk to /system/app. Also added android:sharedUserId="android.uid.system"
to my manifest. On Boot there is no longer the logcat message. However when I want to send the keysync I still catche the SecurityException
. Any ideas?
EDIT2: Here is an excerpt from ps
. Seems like the package ist not listed as system
u0_a108 5241 2399 492044 48968 ffffffff 40113ab0 S com.mypackage
Update
Use the signtool located here, then go ahead and read on in my blog.Ok, I got the right platform-keys and it works like a charm now! I signed using http://forum.xda-developers.com/showthread.php?t=1125626 and replaced (renamed the sign.... to testkey....) the testkeys inside signare folder with
signapk-key.platform.x509.pem
signapk-key.platform.pk8
(Google for them)
Also make sure to zipalign and then to copy to /system/app. Installing the .apk the normal way is NOT possible as it is flagged as System app.
这篇关于许可:INJECT_EVENTS为Instrumenation到其他应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!