2016-04-23 25 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システムを構築して署名していない限り、通常はシステムキーがありません。

関連する問題