Ubuntu under Android apk decompile and recompile

Source: Internet
Author: User
Tags sha1

1.Anti-compilationAPKFile

The anti-compilation APK needs to use the apktool tool,

Https://bitbucket.org/iBotPeaches/apktool/downloads

http://ibotpeaches.github.io/Apktool/install/

1 , under Installation instructions, right-click to download apktool Script, and then download the latest apktool

2 , Ensure that your system has 32 Bit platform ( relies on Library, if you ubuntu is 13.10 later version, you can try

sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6

3. Rename the downloaded apktool_2.0.0.jar to Apktool.jar

4, copy two files to the /usr/local/bin directory, this step is equivalent to configuring environment variables, can be run in any directory

sudo cp-i apktool.jar/usr/local/-I Apktool/usr/local/bin

5, adding permissions

sudo chmod +

After a few steps have been completed, you can find an APK to decompile the

Command:apktool d (apk path )-o(output folder)

Note: Be sure to add- o This parameter, otherwise the command error

After a successful decompile, a series of directories are generated in the outdir directory, and we can modify the apk by modifying the SMali file code.

It is common practice to obtain an index value for a resource in the res Resource Directory, and then search the smali directory for the . Smali file that contains the index.

0x7f0c004e /home/lionel/outdir/smali/*

The command is to traverse files and subfolders that contain '0x7f0c004e ' files under the specified directory

2. RePack the apk file
Apktool B/home/lionel/outdir

编译指定目录下文件,默认生成的apk在同目录的dist文件夹中

但现在还不能安装在手机里,新生成的apk需要签名

20000

keytool-genkey-v-keystore ( generated key name )-alias ( key alias )-keyalg rsa-validity ( validity )

Jarsigner-verbose-keystore android.keystore-signedjar/home/lionel/outdir/mobilessafe.apk/home/lionel/outdir/ dist/mobilessafe.apk Android

Jarsigner-verbose-keystore (the key name generated above)-signedjar (after the signatureAPKPath)    (before the signatureAPKPath) (secret keyAndroid.keystorethe alias)

Signature after discovery installation still prompts install_parse_failed_no_certificates

Workaround: Add a parameter -digestalg sha1-sigalg md5withrsa

Jarsigner-digestalg Sha1-sigalg Md5withrsa-verbose-keystore android.keystore-signedjar/home/lionel/outdir/ mobilessafe.apk/home/lionel/outdir/dist/mobilessafe.apk Android

Installation is successful!

Ubuntu under Android apk decompile and recompile

Related Article

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.