Android generates and built a system App

Built an App into the system catalog
Generate system applications and configurations

The premise of the system signature is to add
android:sharedUserId="android.uid.system" under the manifest tag of the AndroidManifest file .

1. Android system signature, two ways

  • Re-sign Apk.
    libconscrypt_openjdk_jni.dylib is a dynamic library needed for signapk.jar execution. It is the mac environment generated by compiling the Android source code in the Android/aosp/out/host/darwin-x86/lib64/ directory. It is needed for re-signing.

platform.x509.pem and platform.pk8 are rom certificates, secret keys and other information. If they are inconsistent, they will not be installed.

Re-sign the apk using signapk.jar and system signature information:

java -Djava.library.path=. -jar signapk.jar keys/platform.x509.pem keys/platform.pk8 xxx.apk xxx.apk
  • Generate a new system signature.
    Download the tool keytool-importkeypair
    and put the keytool-importkeypair tool, platform.x509.pem, platform.pk8 in the same folder:
    if xxx.jks does not exist before, execute:
keytool-importkeypair -k ./xxx.jks -p android -pk8 platform.pk8 -cert platform.x509.pem -alias platform

He will generate a new signature password of xxx.jks as android and alias as platform.
If there is a signature xxx.jks before, execute:

keytool-importkeypair -k ./xxx.jks -p xxx.jks的密码 -pk8 platform.pk8 -cert platform.x509.pem -alias xxx

Signed before he will import and overwrite pk8 and x509, -alias alias to keep the best and he will be prompted before the agreement: there is an existing entry alias xxx, whether covering [No]:? Input is
prompted to import success
in two ways no difference Larger but completely regenerated ones will not interfere with previous information and are more pure. It is recommended to use regeneration methods.
You can view the signature information with the following command:

keytool -v -list -keystore xxx.jks

2. Need to add under the manifest tag of AndroidManifest file

android:sharedUserId="android.uid.system"
Put the system APP in the system directory
adb shell

Re-hang in the system folder

mount -o rw,remount /system

Move the ordinary installed apk folder to the system folder (mv cp command to view the link at the end of the common command title)

mv  /data/app/com.xxx.xxx-c_6g96hdmjaMzppiPTIPyg\=\=/*  /system/priv-app/XXXAPP

or

cp -r /data/app/com.xxx.xxx-c_6g96hdmjaMzppiPTIPyg\=\=/*  /system/priv-app/XXXAPP

Reboot

adb reboot

Move the application to the system directory

Guess you like

Origin blog.csdn.net/u011148116/article/details/106519089