Current location - Quotes Website - Signature design - How does android get the read and write permission of system files in the code?
How does android get the read and write permission of system files in the code?
How does android get the read and write permission of system files in the code? I thought there was no way to change the system time at the application level, but I searched online for a long time and knew that this goal could still be achieved.

The first method is simple, but it needs to be compiled with make in the source code environment of Android system:

1. is added to the manifest node in AndroidManifest.xml of the application.

Android: shareduserid = "android.uid.system" attribute.

2. Modify the Android.mk file and add the line LOCAL_CERTIFICATE := platform.

3. Compiled by mm command, the generated apk has the right to modify the system time.

The second method is more troublesome, but you don't have to open the virtual machine and run to the source environment to compile with make:

1. Same as above, add the attribute of Android: shared userid = "android.uid.system".

2. Compile apk file with eclipse, but this apk file can't be used.

3. Open the apk file with compression software and delete the certificate. SF and CERT RSA files in META-INF directory.

4. Re-sign the apk file with the platform key of the target system. This step is more troublesome,

First, find the location of the key file in my Android source directory.

Is "build argetproductsecurity", and the following platforms: pk8 and platform: x509: pem.

Two files.

Then use the Signapk tool provided by Android to sign. The source code of signapk is

Under "building oolssignapk",

The usage is "sign apkplatform.x509.pemplatform.pk8 input.apkoutput.apk",

It is best to use an absolute path to prevent the file name from being found, or you can modify the source code and use it directly.

In this way, the final apk is the same as the first method.

Finally, explain the principle. First, add the attribute of Android: shared userid = "android.uid.system". By sharing the user id, multiple apk with the same user id can be configured to run in the same process. Then match the UID of the program to android.uid.system, that is, let the program run in the system process, so that you have the right to modify the system time.

It is not enough to add UID. If you install APK at this time, you will find that it can't be installed, prompting that the signature doesn't match, because the program needs the platform of the target system to run in the system process.

The key is the two files platform.pk8 and platform.x509.pem mentioned in the second method above. Only after signing with these two keys can apk really enter the system process. Adding LOCAL_CERTIFICATE := platform to the first method is actually signed with these two keys. Another problem is that the program generated in this way can only be used in the original Android system or the system compiled by yourself, because if you can't even install Android made by other companies, you can get two files, platform.pk8 and platform.x509.pem Try to sign with the key in the original Android. The program runs normally on the simulator, but the installation directly prompts "package ... there is no matching signature in the shared user Android." Uid.system ",which also protects the security of the system.

How does android get the read and write permission of system files in the code? The Java code 1 must be an Android system developer, otherwise files such as init.rc cannot be modified. 2. Your application must obtain system rights. In the application layer, if you want to use code to obtain system file permissions, unless your mobile phone is root or you sit on rom yourself. . . . Modify init, rc by yourself

How does Win 10 get permission to modify system files? Methods/steps

1

First, find the folder you want to operate. Take the sound card related folder as an example. Select a folder. Right click on it. Select file properties, security-> advanced.

2

Change the owner as shown in the figure. In Enter Object Name, enter your account name, mine is Microsoft account. Enter and confirm.

three

Go back to the interface just now, and you will see that the owner has changed and become your account. Then confirm to exit and return to the folder. (Before proceeding to the next step, please make sure to exit and return to the file after confirmation. )

four

Return to the previous interface again. All inheritance is forbidden.

five

Add users. Enter the account number. I entered the Microsoft account. Enter and confirm.

How to find system files when a mobile phone gets Root permission? Obtaining root permission through third-party software can access and modify almost all files in the mobile phone operating system, but this operation may affect the stability of the mobile phone, resulting in human failures such as crashing and restarting.

In addition, after obtaining the license, it will generally cause defects to the main components on the motherboard such as memory and CPU. Root belongs to modifying the operating system software, which is not covered by the warranty according to the regulations. In order to improve customer satisfaction, free firmware upgrade service is provided to Root customers. If Root affects the mobile phone hardware and needs to replace the motherboard, the motherboard fee will be charged.

If your machine needs to be restored to the original system version after Root, please send the machine to the service center, and the after-sales engineer will help you check and handle it. You cannot revoke Root privileges by restoring the device to factory settings.

How to restore the default permissions of system files? For files that have obtained all permissions, it is recommended that you restore to the original state. Today, I will share with you how to restore the default permissions of system files. The operating steps of Windows 7 and Windows 8 are the same. Here, take the hosts file that is usually modified most frequently as an example. The following figure shows that all the permissions of the hosts file have been obtained. Restoring the permissions of a hosts file that has obtained all permissions is somewhat similar to the reverse operation. First, click the Administrators group (the blue bar in the above figure), and then click the "Advanced" button below to switch to the "Owners" tab. Advanced Security Settings-Owner In the window above, click the Edit button to open a new window to change the owner. Edit the owner to this point, and you will find that the owner that can be changed is not the TrustedInstaller when it is replaced. What should I do? Don't worry, click "Other Users or Groups" to add it. In the newly opened window, eNTer: NT SERVICE\TrustedInstaller. Note that the previous NT service must be added, otherwise the system will not recognize it. After adding the TrustedInstaller user, click OK to return to the previous window. At this point, you will see the TrustedInstaller user appear. Next, select it, and then confirm to exit all windows. File ownership is restored to the default state.

How to read and write permissions to view files with code? There are canRead, canWrite and canExecute methods in the File class. View original post >>

Please accept it, thank you!

How to delete system files after obtaining root privileges? Use re

Beginners ask for help, how to replace system files after getting TOOR or permission! Take a patient look at a few pages of the post here first, and then read more information. Don't play these contents with root permission as soon as you get started on your mobile phone, which will easily lead to problems, and then more and more problems will occur. . . It is very helpful to suggest that you do these things at least two weeks later. View original post >>

How to get read and write permission of Mac file under iMac win7? For ordinary files, you don't need to open an administrator account, you just need a simple way to be OK! For example, handle the following types of folders.

2

All we have to do is right-click and select "Administrator takes ownership".

three

For some program files, just right-click and select "Run as Administrator", which is also a very convenient way to obtain administrator rights.

end

How to open an administrator account

In Windows 7 system, the administrator account is not opened by default, which requires us to open it manually. It is not very difficult! Right-click the computer icon and select Manage.

After opening the interface, select local users and groups, click users, and select administrator account.

three

After opening the administrator account, just follow the following steps.

four

In this way, the administrator account can appear in the login interface, and you can get the highest authority of the administrator by selecting this account. However, it is recommended not to open this account in general. If this account is destroyed, it is easy to create a new account. Also, you don't need a password to open this account for the first time.

In fact, LBE has solved the problem of how android obtains the folder permission code. 1. In the privacy-protected version of 20 12, the system root will be requested every time it runs, and a boot service libload.so will be created to handle the root request of lbe itself. The rootless version of 2.20 13 automatically gets the system root when it is first run, and the cracked su file is copied to /system/xbin/. Sv, and then give the permission of 6755, which is specially used to handle the root request of lbe itself. The above two schemes are programs that use root management to solve their own root requests. The following code is the principle of scheme 2, with the modified su file attached. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Android Su file, The basic principle is that 1234567 if (PID = db (allowing the program to obtain the blacklist if of root else (PID = db (disable)) returns, and an empty else view "superuser.active" database is returned, with no record. Authorization management pops up the root request window endif to modify the su file 1IF (PID