1, anti-compilation:
Java-jar Apktool_2.0.0.jar D testsmsdemo.apk
Default decompile to Testsmsdemo folder, Apktool download please click here
2, modify the Androidmanifest.xml
<application android:icon= "@drawable/icon" android:label= "@string/app_name" Android:name= ". Videoapplication "Android:theme=" @android: Style/theme.notitlebar.fullscreen "android:uioptions=" Splitactionbarwhennarrow "android:debuggable=" true "> <!--main add debuggable, ready for future debug APK--
3. RePack:
Java-jar Apktool_2.0.0.jar B testsmsdemo(pre-Decompile generated folder name, if out please write out)
The file is repackaged to the Testsmsdemo/dist directory by default
4. Signature:
1) Generate KeyStore. You can use the command line to generate KeyStore, or you can use Eclipse to sign a demo build KeyStore, and remember to save the location as well.
keytool-genkey-v-keystore Mykeystore (can be any name) -alias Linlin (aliases can be arbitrary, but this alias will be used later, so keep it in mind) -keyalg rsa-validity 20000
Then follow the prompts to enter the content you want.
2) Signature APK
jarsigner-verbose-keystore mykeystore-signedjar android_signed.apk (target name) testsmsdemo . apk (apk to be signed) linlin (This place is the alias-alias above to remember, see some examples above this place the string with the "number is wrong, directly write the string is good)
Report:
() inside is the explanatory text, please ignore when using the command
In order to facilitate memory can be-alias and keystore the name of the same. If-alias is inconsistent with KeyStore's name and forgets what to write, you can use Eclipse to view it. The specific method is to package the program, and then select the KeyStore, enter the password will automatically display alias name. As shown in the following:
usage:apktool
-advance,--Advanced Prints advance information.
-version,--Version Prints the version then exits
usage: apktool if|install-framework [options] <framework.apk>
-P,--frame-path <dir> Stores framework files into <dir>.
-T,--tag <tag> tag frameworks using <tag>.
usage: apktool d[ecode] [options] <file_apk>
-F,--Force force Delete destination directory.
-o,--output <dir> The name of folder that gets written. Default is Apk.out
-P,--frame-path <dir> Uses framework files located in <dir>.
-R,--no-res do not decode resources.
-S,--no-src do not decode sources.
-T,--frame-tag <tag> Uses framework files tagged by <tag>.
usage: apktool b[uild] [options] <app_path>
-F,--force-all Skip changes detection and build all files.
-o,--output <dir> The name of the apk that gets written. Default is dist/name.apk
-P,--frame-path <dir> Uses framework files located in <dir>.
for additional info, see:http://code.google.com/p/android-apktool/
for Smali/baksmali info, see:http://code.google.com/p/smali/used for Odex-dex to say this later.
Error
Jarsigner: Could not find the certificate chain for XXX. XXX must reference a valid KeyStore key entry that contains the private key and the corresponding public key certificate chain.
The type hint appears because alias is not filled in correctly.
With the Aiqiyi client test, the re-packaging of the signature works fine.
APK decompile, modify, RePack, sign