The first is unpacking.
Note that the current position of the CMD must be changed to the Apktool directory, or the error will be found that aapt.exe, of course, can also be added to the system path
This step is followed by the modification of the Smali code or the. so file.
After you have changed it.
Apktool B Folder
Then an APK will appear in the folder file.
Then there's the signature problem.
The signature has 3 ways to go, one to use the JDK, one to use Android signapk, and the integration tool
1 Create key, need to use Keytool.exe (in the Jdk1.6.0_24\jre\bin directory), using the generated key to the APK signature is Jarsigner.exe (located in the Jdk1.6.0_24\bin directory), After adding the directory where the two software is located to the environment variable path, open the cmd input
D:\>keytool -genkey -alias demo.keystore -keyalg RSA -validity 40000 -keystore demo.keystore/* Description:-genkey generate key         -alias Demo.keystore alias Demo.keystore         -keyalg RSA uses RSA algorithm to encrypt signature         -validity 40000 expiration 4,000 days         -keystore Demo.keystore */d:\>jarsigner-verbose-keystore Demo.keystore-signedjar demo_signed.apk demo.apk Demo.keystore /* Description:-verbose output Signature details         -keystore demo.keystore keystore location         -signedjar demor_signed.apk demo.apk demo.keystore 正式签名,三个参数中依次为签名后产生的文件demo_signed,要签名的文件demo.apk和密钥库demo.keystore.*/ |
Note: The demo.apk in the bin directory of the Android project is signed by default with the debug user, so you cannot use the above procedure to sign the file again. The correct step should be: In the project right click->anroid tools-export Unsigned Application package exported APK takes the above steps to sign.
Reference http://www.cnblogs.com/qianxudetianxia/archive/2011/04/09/2010468.html
In addition, they encountered a problem in the operation process, there are solutions:
Keytool Error: Java.io.FileNotFoundException:android.keystore (Access denied. )
The main reason is that the JDK installed in the C drive, no write permission, so error
You can change the directory resolution to read as follows
C:\Program Files\java\jdk1.7.0_65\bin>keytool-genkey-alias Andro
Eyalg rsa-validity 30000-keystore D:/keystore/android.keystore
On the D-plate, the perfect solution
2 Android Source code comes with the SIGNAPK tool need to use the certificate
1. Go to <android_source_path>/build/target/product/security and find "Platform.pk8" and "Platform.x509.pem" The System key.
2. Enter <android_source_path>/build/tools/signapk to find Signapk.java, run Javac compile to Signapk.class
3. Execute command Java com.android.signapk.SignApk platform.x509.pem platform.pk8 input.apk output.apk
Source: >
3 is the use of automatic signature tools, such as Androidresedit, the principle is actually the second one, just automated a bit. Of course, the certificate in the signature directory what can be changed
Finally, the 3 methods are can be generated by the name of the APK, of course, Daniel Look on the line, do not spit the groove of our food forcing ...
END
Android Packaging and signing overview process