登录

Use keytool to generate the keystore signature file and configure the system signature in android st

Android
0 45

First download the keytool tool address

    https://github.com/getfatday/keytool-importkeypair

Take the windows system as an example.

    Step:

            1. First download the keytool-importkeypair tool. After downloading I put it on the desktop. 

    Pasted Graphic

        2. Since this tool needs to run in Linux but I don't have that environment so use MinGW instead.

            Open msys.bat in the D:\MinGW\msys\1.0 directory and enter the environment (similar to cmd in win).

            Then enter the command to enter the key tool importkeypair directory.

    Pasted Graphic 1

        Note: The file directory in this command uses a backslash instead of a slash. If you use a slash you will not be able to enter the directory in the MinGW     environment. There will be no such files or directories. 

Pasted Graphic 2

Pasted Graphic 3

    As shown in the figure below you entered keytool - importkeypair-host.

Pasted Graphic 4

Then copy platform.x509.pem and platform.pk8 to keytool-importkeypair-master (platform.x509.pem and platform.pk8 are the files in the security folder when compiling the system need to be provided by the manufacturer)

Pasted Graphic 5

Pasted Graphic 6

At this point the preparation is complete and the keystore file can be generated.

Execute commands in MinGW.

Pasted Graphic 7

-k indicates the name of the keystore file to be generated here named platform.keystore

-p indicates the password of the keystore to be generated here is android

-pk8 indicates the platform.pk8 file to be imported

-cert indicates the platform.x509.pem to be imported

-alias means to give the generated platform.keystore an alias which is named platform

Pasted Graphic 8

Then the platform.keystore file is generated.

Pasted Graphic 9

This file is the signature file required by android studio and will be configured later in build.gradle.

I put the platform.keystore file in the C:\ test directory. So the storeFile file is C:\ test \ platform.keystore.

Pasted Graphic 10

Then you need to configure buildTypes in the project structure so that the app is installed with the signature after running the app.

Pasted Graphic 11

Set the signature of debug in buildTypes to debug and the signature of release to release.

Pasted Graphic 12

Pasted Graphic 13

This way you don't have to compile the APK every time you use it and then use signapk.jar to generate the APK with system signature.

Finally remember to add android:sharedUserId = "android.uid.system" to the corresponding location in the AndroidManifest.xml file.

Pasted Graphic 14

This is an APK with system level permissions.

本网站所收集的部分公开资料来源于互联网,转载的目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。本站部分作品是由网友自主投稿和发布、编辑整理上传,对此类作品本站仅提供交流平台,不为其版权负责。如果您发现网站上有侵犯您的知识产权的作品,请与我们取得联系,我们会及时修改或删除。 本网站所提供的信息,只供参考之用。本网站不保证信息的准确性、有效性、及时性和完整性。本网站及其雇员一概毋须以任何方式就任何信息传递或传送的失误、不准确或错误,对用户或任何其他人士负任何直接或间接责任。在法律允许的范围内,本网站在此声明,不承担用户或任何人士就使用或未能使用本网站所提供的信息或任何链接所引致的任何直接、间接、附带、从属、特殊、惩罚性或惩戒性的损害赔偿

发表评论

0 个回复