After the APK is unpacked and the file is modified, it is repackaged and signed

1. Unpack the apk

If a client of aaa.apk is unpacked into the following directory

unpacking process

 2. Repackaging

Execute the apktool.bat b aaa command to repack the command

You will find that a dist directory is generated under the aaa directory, which contains the repackaged apk, but this apk is not signed, and needs to be re-signed before it can be installed

Unsigned repackaged clients cannot be installed and an error will be reported

 

3. Signature

1. Generate keystore file

The java environment needs to be installed here, if it is not installed, please install it yourself

Enter cmd in the bin directory of java's jdk

 

 

//网上的参考(这个走不通可以用下面我截图里面的命令)
keytool -genkeypair -alias xxx -keyalg RSA -validity 100 -keystore xxx

#拓展
-genkey 生成秘钥

-alias 别名

-keyalg 秘钥算法

-keysize 秘钥长度

-validity 有效期

-keystore 生成秘钥库的存储路径和名称

-keypass 秘钥口令

-storepass 秘钥库口令

-dname 拥有者信息,CN:姓名;OU:组织单位名称;O:组织名称;L:省/市/自治区名称;C:国家/地区代码
进入jdk的bin目录执行下面的命令
keytool -genkey -alias abc.keystore -keyalg RSA -validity 20000 -keystore abc.keystore

 

The signature file abc.keystore is generated

 

 4. Sign the apk after repackaging

Copy the signature file  abc.keystore and the client App Cloud Suizhou_1.2.3_123  that has modified smail or other files to the apktool directory, and execute the following command

 

//参考一下(不对的话用下面那个)
jarsigner -verbose -keystore 签名的路径及上(app.keystore) -signedjar 最新apk名称.apk 新apk名称.apk 新apk名称
#其中最新apk名称.apk 新apk名称.apk可以一致

jarsigner -verbose -keystore abc.keystore -signedjar yunshangsuizhou_signed.apk 云上随州_1.2.3_123.apk abc.keystore



yunshangsuizhou_signed.apk :新命名的客户端名称,对应签名后的名称
云上随州_1.2.3_123.apk :修改了文件之后重新打包的客户端

 

Ignore this warning, time is enough 

 Successful installation

 

Guess you like

Origin blog.csdn.net/qq_37888591/article/details/128936200