Decompile apK files using apkTool:

Jar d xxx.apkCopy the code

Repackage as APK files using apkTool:

Java-jar apkTool_2.1.1. jar b XXX (XXX is the decomcompiled directory)Copy the code

D2j-dex2jar classes.dex convert the classes.dex file to a jar package. Use jd-gui to open the jar file and view the source code

Use the keystore to sign the apk file :(the jarsigner path is in the JDK /bin directory)

Jarsigner -verbose -keystore debug.keystore -signedjar Signed apK unsigned APKaliasThe aliasCopy the code

Sign apK files using.pem,.pk8 files:

Java -jar signapk.jar platform.x509. Pem platform.pk8 Unsigned APK Signed APKCopy the code

To view key information:

keytool -v -list -keystore debug.keystore/key.jks
Copy the code

Use the. Pk8 and. Pem signatures to generate. Keystore signatures to download the OpenSSL tool

openssl pkcs8 -inform DER -nocrypt -in key.pk8 -out key.pem
openssl pkcs12 -export -in certificate.pem -inkey key.pem -out platform.p12 -password pass:android -name mykey
keytool -importkeystore -deststorepass password -destkeystore mykey.store -srckeystore platform.p12 -srcstoretype  PKCS12 -srcstorepass android
keytool -list -v -keystore mykey.keystore
Copy the code