APK decompile, modify, RePack, sign

Source: Internet
Author: User

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.

    • To build using the command line:

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.

    • Needless to say, using eclipse-born achievements is to use the signature apk and remember to generate the KeyStore save location. Simple.

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.