Article 3 Superuser customization-Permission silent interception (the simplest solution for a long time), Article 3 superuser

Source: Internet
Author: User

Article 3 Superuser customization-Permission silent interception (the simplest solution for a long time), Article 3 superuser
I recently studied Supersuser in the evening. Apk permission control software. Of course, your own ideas and needs are simple:
1. can intercept any software permission requests
2. allow our own programs to have permissions. Other programs secretly request permissions and KIll them without responding.
At first, the request is a c-Layer Code because of the su super permission. When the application uses the following code to request the su

String cmd = String. format ("echo % s> % s \ n", arg, mSwitchUsbFileTextEdit. getText (). toString (); try {Process exeEcho = runtime.getruntime(.exe c ("su"); exeEcho. getOutputStream (). write (cmd. getBytes (); exeEcho. getOutputStream (). flush ();} catch (IOException e) {showMessage ("Excute exception:" + e. when getMessage ();} is used, su first checks whether Supersuser.apk is installed, if su is installed, a query database in sqlite3.c is called to check whether the application requesting the permission is permitted. After confirmation, the user ID of the application is sent to Supersuser through am to display the authorization interface.
That is, su ----------> Activity.
The previous idea was to modify su. c adds a sqlite3 database insertion method, but it is not very convenient to be unfamiliar with the c syntax and call and debugging between JNI, so it has been stranded.
This morning, I suddenly thought of adding an intermediate Service as an intermediate Service. The service is the background interface, so we can silently process the interception.
Specifically, if you need superuser.apk, You can synchronize the source code and compile it yourself. And NDK compilation su. c. Su and Superuser are well-known for their one-to-one correspondence.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.