2016-04-23 22 views
1
Instrumentation m_Instrumentation = new Instrumentation();  
m_Instrumentation.sendPointerSync(MotionEvent.obtain(
         SystemClock.uptimeMillis()+555, 
         SystemClock.uptimeMillis()+600, 
         MotionEvent.ACTION_UP,500,1000, 0)); 

我想嘗試開發使用Android Studio的TeamViewer模擬器。雖然顯示的應用程序的UI,我想用sendPointerSync方法而應用程序是在後臺這段代碼工作得很好,它給我的留言:簽署Android Studio項目apk作爲系統應用使用權限INJECT_EVENTS

java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permission 

我添加權限,它給人的消息:

Permissions with the protection level signature or signatureOrSystem are only granted to system apps. If an app is a regular non-system app, it will never be able to use these permissions. 

我該如何將應用程序簽名爲系統應用程序?

回答

0

我該如何將系統應用程序簽名爲系統應用程序?

與Android系統簽有相同的密鑰!如果您的應用和系統具有相同的證書,則您的應用會自動識別爲「系統應用」。

但通常你沒有系統密鑰,只要你沒有自己建立和簽署Android系統。