(ဘီလူးကၽြန္းသားေလး) နည္းပညာ

Sunday, October 12, 2014

ApkTool v4.6 armel/armhf for Android

Decompile/Recompile APK files from your Android Device - APKTOOL FOR ANDROID PLATFORM

Recently, I found apktool that works on Android Platform. It took much time for me to find because it is very un-popular (maybe because it's recently made available - since last year maybe) and it is from any Chinese developer (I suspect) as all the links of this apktool re-directed me to chinese sites.

The work of making apktool compatible with Android platform is done by pqy330 (as seen at Github).

I've tested latest release of apktool (v4.6) and it works great (decompiled, edited, recompiled and installed recompiled apk file and it works) in my Galaxy 5 (ARMv6) and my MediaTek MT6577 Tablet (ARMv7). It's much faster in ARMv7 (maybe because there are some optimisations for ARMv7 which are included in armhf version of apktool) compared to ARMv6. For ARMv6 (atleast for my galaxy5), armhf version doesn't work (errors out while importing framework), you'll have to use armel version. I'm still not sure of the difference b/w these two versions.

PRE-REQUISITES:

Rooted OR Non-Rooted Android Device (NOTE: I haven't tested on Non-rooted device).
Free space of around 90-100 MB in sdcard (for apktool data).
An idea about: What's apktool (Yes, original Windows Apktool) and What's the work of apktool (Again, original Windows Apktool). If you wanna know about apktool, search for apktool in Google and you'll see thousands of guides (even noob-friendly) all over the web to use apktool (Windows Version).
How to Use it to Decompile/Recompile APK files?

Setting up apktool in your android device:

Download apktool-armhf.zip OR apktool-armel.zip as mentioned above.
Unzip the downloaded zip file (using any app) at the root of sdcard (not in any folder).
After unzipping, you'll see a folder: apktool in your sdcard, open that folder and install ApktoolX.Y.apk (X.Y=version number) from there.
Now Go to /system/framework (using any file explorer) and copy Framework-res.apk to the apktool folder on your sdcard.
Now open Apktool application that you installed (It'll ask for SU permission if you're rooted, grant it) and navigate to apktool folder in sdcard and tap on Framework-res.apk (that you'll find in apktool folder). Select Import as Framework, let the process complete (may take 4-5 minutes on slower devices).
Now you're done setting up your apktool.

Using it:

You'll be using it (almost) the same way you use Windows version of APKTOOL. Main difference b/w the two is, you won't have to deal with Comand line here (unlike in Windows apktool). I'll be mentioning some basic steps below.
Open apktool app.
Navigate to the .apk file you want to decompile and tap on it.
Select decompile All/decompile Resources/Decompile dex as you wish.
The contents (as you choose) of apk file will be decompiled in a folder [Name-of-apk-file]_src*.
Make changes as required. XML files can be edited using XML editors available for Android at Play Store. And .smali files can be edited using any simple Text Editor.
To Recompile the app, tap on the folder: [Name-of-apk-file]_src and select Recompile.
After recompiling, this app will make an apk file (named: [Name-of-apk-file]_src.apk) in the previous directory of [Name-of-apk-file]_src folder. Moreover, there'll be a folder named 'apk' here: '/[Name-of-apk-file]_src/build/' which will contain compiled elements of modified (by you) source of APK file.
You'll have to sign the [Name-of-apk-file]_src.apk file (made  recompiling) if you want to install it on your device. For that just tap afteron that apk file and select "SIGN".
There are many other handy options in this apktool app like: zipalign, dex2jar,..

 Download via Excellence 

null
Posted via Blogaway

No comments: