FORUMS
Remove All Ads from XDA

[Question] give my application root access

3 posts
Thanks Meter: 1
 
By abujbr, Junior Member on 27th June 2017, 08:21 AM
Post Reply Email Thread
Hi everyone

I created android application with service (mouse cursor),
I was able to move the cursor and click within the application by injecting using “Instrumentation.sendPointerSync(MotionEvent.obtai n(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), MotionEvent.ACTION_DOWN, x, y , 0)); “
, but when I click outside the application (try to open google chrome), the application crashed and give me this

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

I Already add <uses-permission android:name="android.permission.INJECT_EVENTS"/> but still same error.

After googling and searching, I understand that I need to add root permission to my application, to do so I need to sign my application with private key form my android device and then install the application using this command “adb install YourApp-signed.apk “.

And to sign the application I need platform.x509.pem and platform.pk8, where can I find those files, and how to create the Keystore ?! and what is aligned apk ?! I feel LOST.

Thank you in advance
 
 
27th June 2017, 11:16 PM |#2  
Quote:
Originally Posted by abujbr

Hi everyone

I created android application with service (mouse cursor),
I was able to move the cursor and click within the application by injecting using “Instrumentation.sendPointerSync(MotionEvent.obtai n(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), MotionEvent.ACTION_DOWN, x, y , 0)); “
, but when I click outside the application (try to open google chrome), the application crashed and give me this

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

I Already add <uses-permission android:name="android.permission.INJECT_EVENTS"/> but still same error.

After googling and searching, I understand that I need to add root permission to my application, to do so I need to sign my application with private key form my android device and then install the application using this command “adb install YourApp-signed.apk “.

And to sign the application I need platform.x509.pem and platform.pk8, where can I find those files, and how to create the Keystore ?! and what is aligned apk ?! I feel LOST.

Thank you in advance

You can find those files here: https://sourceforge.net/p/android-x8...duct/security/

There's information about creating a keystore here: https://www.google.co.uk/search?q=cr...obile&ie=UTF-8

As for your aligned APK, if you mean a zipaligned APK, you can find all the information you need here: https://developer.android.com/studio.../zipalign.html

However, I don't think this is the information you're looking for. Signing an APK and installing it won't make it ask for root permission. All that signing and installing an app does is..well..sign and install it.
I'm not a developer, I don't know how to make an app ask for root permission from the user, but I suggest you need to do some more research.

Sent from my Sony Xperia XA1 using XDA Labs
27th June 2017, 11:25 PM |#3  
OP Junior Member
Thanks Meter: 1
 
More
Thank you

I will give it a try

Thanks
The Following User Says Thank You to abujbr For This Useful Post: [ View ] Gift abujbr Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes