Push your own application to system/app and change your app to a system-level app

If you want to put an application in the system folder, you can push it in only when the phone must be rooted. Let me talk about the steps below:

1. Connect the phone to the computer with USB first
. 2. If the computer is configured with adb environment, then directly cmd. If the environment is not configured, find the platform-tools folder under the path of the SDK, and open the command line in this folder. (E:\tool\sdk\platform-tools This is the path to the platform-tools folder of my sdk).
3. $ adb push C:\Users\dgg1\Desktop\Test.apk /sdcard/ (push the apk file that needs to be installed to sdcard)
4. $ adb shell
5. $ su (switch to the root user. If you don’t get Root permission, this step will not succeed.)
6. # mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system (Make the partition writable.)
7. # cat /sdcard/C:\Users\dgg1 \Desktop\Test.apk> /system/app/C:\Users\dgg1\Desktop\Test.apk (Move the apk file in sdcard to system/app)
8. # mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system (Restore partition attributes, read-only)
9. # exit
10.$ exit
11. adb reboot (restart the phone)
12. After restarting, I found that the application Test.apk has been installed.

If you need to push the apk file you wrote to system/app. You need to prepare the following:
1. Go to the android system directory build/target/product/security/ and copy the system signature files: platform.x509.pem, platform.pk8.
2. Android:sharedUserId=”android.uid.system” at the root node of the application manifest.xml file
3. The officially packaged apk file.
4. Download a signature tool of signapk.jar.
Steps:
1. Unzip the signapk.jar tool into a folder.
2. Replace the platform.x509.pem and platform.pk8 files in the signapk.jar folder with the platform.x509.pem and platform.pk8 files just obtained.
3. Open the command line in the folder and enter the following command java -jar signapk.jar platform.x509.pem platform.pk8 old.apk (apk path) new.apk (newly generated apk name).
4. A new apk file will be generated in the folder, which is the apk named in the command line just now.
5. This apk can be installed in system/app.
(It is best to use copy and paste when entering commands, and the spaces need special attention)
If there are errors or omissions, please leave a message to discuss.

Guess you like

Origin blog.csdn.net/qq77485042/article/details/76459632