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