FORUMS
Remove All Ads from XDA

[TUTORIAL] How to Decompile and Recompile ICS .Apk Files][Easy ONE]

1,849 posts
Thanks Meter: 2,241
 
Post Reply Email Thread
This is an Easy Tutorial, How to Decompile .apk and Recompile .apk Files

If u like this Tutorial, Hit THANKS Button

CREDITS
Memnoc - For Gud Ideas.
Xavierjohn22 - the amazing author of AutoApktool go Here, Hit thanks to Him Too.
Sandy7-For Motivation.

Requirements
  • Java (last version)
  • JDK (last version)
  • JDR (last version, usually included in JDK or Java)
  • Auto_Apktool 2.0.0 (DOWNLOAD THIS ONE NOT OTHERS)


HOW TO DO
NOTE: before start, select Apktool version with option 21, YOU MUST CHOOSE 1.4.1 version
1) Download and simply unpack Auto_ApkTool
2)Click on "autoapktoolmain.bat", prompt will open
3)put the apk you want to EDIT, in "_INPUT_APK"
4) Nw u Should Choose "option 6" for 'decompiling .apk
5) when option 6 is being selected, drag the apk from _INPUT_APK folder into the windows prompt and click enter
6) A Note window will appear, and will show IF the decompiling process has been done properly. Once you close that window, you will see the decompiled folder in _INPUT_APK folder
7) do your edits (xml, smali, or png, WHATEVER)
8) recompile with option 7 (NOTE: this time you MUST drag all the FOLDER, NOT the apk)
9) Once recompiling finished, u will Get a Dcompiled NOTE window that Shows your apk is sucessfully Compiled, Close that Window, Once open the decompiled folder, go to "dist" folder, and here you got your edited apk
10) NOW this is the Last step, since u cannot Sign System app, u will have to Copy the META-INF foldrer frm the Orginal apk to the edited apk, for more Info See the "Screen"
11) Rename the apk if Needed, and push it.
The Following 8 Users Say Thank You to stanlin salu For This Useful Post: [ View ] Gift stanlin salu Ad-Free
26th November 2012, 04:34 AM |#2  
stanlin salu's Avatar
OP Senior Member
Flag New Delhi
Thanks Meter: 2,241
 
Donate to Me
More
Reserved, Tutorial for how to de/re-compile, .jar files.
The Following 3 Users Say Thank You to stanlin salu For This Useful Post: [ View ] Gift stanlin salu Ad-Free
26th November 2012, 04:35 AM |#3  
stanlin salu's Avatar
OP Senior Member
Flag New Delhi
Thanks Meter: 2,241
 
Donate to Me
More
Reserved2, for video tutorial!
The Following 2 Users Say Thank You to stanlin salu For This Useful Post: [ View ] Gift stanlin salu Ad-Free
26th November 2012, 04:35 AM |#4  
stanlin salu's Avatar
OP Senior Member
Flag New Delhi
Thanks Meter: 2,241
 
Donate to Me
More
FAQ's

Why can't we use Apktool???
Well, you can, but it's more difficult, that's it.

Why do you say "must use 1.4.1 apktool version"??
The reason why is that since 1.4.2 version, apktool generate java code while recompiling process is going on, and this lead to errors that 9/10 makes decompile process fail
The Following User Says Thank You to stanlin salu For This Useful Post: [ View ] Gift stanlin salu Ad-Free
18th January 2013, 02:06 PM |#5  
Senior Member
Thanks Meter: 15
 
Donate to Me
More
I got errror
Hello,

I follow this instruction but when I recomoile (option 7 drag with folder), I got error

Log is below:

Code:
[*] "D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\ZPlayer v3.6-AnDrOiD" 
recompiling "D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\ZPlayer v3.6-AnDrOiD"... 
I: Smaling...
I: Building resources...
    (skipping (null) file 'D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\ZPlayer v3.6-AnDrOiD\res\drawable-hdpi\_next.png')
    (skipping (null) file 'D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\ZPlayer v3.6-AnDrOiD\res\drawable-hdpi\_pause.png')
    (skipping (null) file 'D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\ZPlayer v3.6-AnDrOiD\res\drawable-hdpi\_play.png')
    (skipping (null) file 'D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\ZPlayer v3.6-AnDrOiD\res\drawable-hdpi\_previous.png')
D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\ZPlayer v3.6-AnDrOiD\res\values\public.xml:19: error: Public symbol drawable/_next declared here is not defined.
D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\ZPlayer v3.6-AnDrOiD\res\values\public.xml:20: error: Public symbol drawable/_pause declared here is not defined.
D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\ZPlayer v3.6-AnDrOiD\res\values\public.xml:21: error: Public symbol drawable/_play declared here is not defined.
D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\ZPlayer v3.6-AnDrOiD\res\values\public.xml:22: error: Public symbol drawable/_previous declared here is not defined.
D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\ZPlayer v3.6-AnDrOiD\res\values\public.xml:98: error: Public entry identifier 0x7f020050 entry index is larger than available symbols (index 80, total symbols 80).
D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\ZPlayer v3.6-AnDrOiD\res\values\public.xml:98: error: Public symbol drawable/zplayer_2x2 declared here is not defined.
D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\ZPlayer v3.6-AnDrOiD\res\values\public.xml:99: error: Public entry identifier 0x7f020051 entry index is larger than available symbols (index 81, total symbols 80).
D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\ZPlayer v3.6-AnDrOiD\res\values\public.xml:99: error: Public symbol drawable/zplayer_c declared here is not defined.
D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\ZPlayer v3.6-AnDrOiD\res\values\public.xml:100: error: Public entry identifier 0x7f020052 entry index is larger than available symbols (index 82, total symbols 80).
D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\ZPlayer v3.6-AnDrOiD\res\values\public.xml:100: error: Public symbol drawable/zpp declared here is not defined.
D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\ZPlayer v3.6-AnDrOiD\res\values\public.xml:101: error: Public entry identifier 0x7f020053 entry index is larger than available symbols (index 83, total symbols 80).
D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\ZPlayer v3.6-AnDrOiD\res\values\public.xml:101: error: Public symbol drawable/zzzz_ declared here is not defined.
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\MENGLIM\AppData\Local\Temp\APKTOOL3676539834868097954.tmp, -I, C:\Users\MENGLIM\apktool\framework\1.apk, -S, D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\ZPlayer v3.6-AnDrOiD\res, -M, D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\ZPlayer v3.6-AnDrOiD\AndroidManifest.xml]
	at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:193)
	at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
	at brut.androlib.Androlib.buildResources(Androlib.java:248)
	at brut.androlib.Androlib.build(Androlib.java:171)
	at brut.androlib.Androlib.build(Androlib.java:154)
	at brut.apktool.Main.cmdBuild(Main.java:182)
	at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\MENGLIM\AppData\Local\Temp\APKTOOL3676539834868097954.tmp, -I, C:\Users\MENGLIM\apktool\framework\1.apk, -S, D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\ZPlayer v3.6-AnDrOiD\res, -M, D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\ZPlayer v3.6-AnDrOiD\AndroidManifest.xml]
	at brut.util.OS.exec(OS.java:83)
	at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
	... 6 more
The system cannot find the drive specified.
Of course, I install framework which copy from my device framework-res.apk and twframework-res.apk
and installed.

why?

I am using window 7 64bits, International S3, Rom null18.1, LLC
18th January 2013, 02:14 PM |#6  
stanlin salu's Avatar
OP Senior Member
Flag New Delhi
Thanks Meter: 2,241
 
Donate to Me
More
Re: [TUTORIAL] How to Decompile and Recompile ICS .Apk Files][Easy ONE]
Bro u have decompiled it, the errors here r becoz, u have editied u apk in wrong way if u edit it simply jst replacing the strings want it wont recompile poperly !
18th January 2013, 02:18 PM |#7  
Senior Member
Thanks Meter: 15
 
Donate to Me
More
Quote:
Originally Posted by stanlin salu

Bro u have decompiled it, the errors here r becoz, u have editied u apk in wrong way if u edit it simply jst replacing the strings want it wont recompile poperly !

I already decompiled with the option 6 and edit some string after that recompile(option 7). I follow this instruction.

do you mean if I just edit string, it will not compile properly?
18th January 2013, 02:22 PM |#8  
stanlin salu's Avatar
OP Senior Member
Flag New Delhi
Thanks Meter: 2,241
 
Donate to Me
More
Re: [TUTORIAL] How to Decompile and Recompile ICS .Apk Files][Easy ONE]
Quote:
Originally Posted by menglim

I already decompiled with the option 6 and edit some string after that recompile(option 7). I follow this instruction.

Its not the problem with the instruction, its the problem with ur editing, u jst check properly in the error log, it explain where u have made mistake, a single misplace of strings, wont allow to recompile, see the log and correct accordingly !

Sent from my WT19i using xda premium
18th January 2013, 02:28 PM |#9  
Senior Member
Thanks Meter: 15
 
Donate to Me
More
Quote:
Originally Posted by stanlin salu

Its not the problem with the instruction, its the problem with ur editing, u jst check properly in the error log, it explain where u have made mistake, a single misplace of strings, wont allow to recompile, see the log and correct accordingly !

Sent from my WT19i using xda premium

Sorry, could u tell me which line ?

---------- Post added at 04:28 PM ---------- Previous post was at 04:25 PM ----------

even I did not change any source. I just decompile and recompile, still get the error...
18th January 2013, 02:35 PM |#10  
stanlin salu's Avatar
OP Senior Member
Flag New Delhi
Thanks Meter: 2,241
 
Donate to Me
More
Re: [TUTORIAL] How to Decompile and Recompile ICS .Apk Files][Easy ONE]
It can also be becoz of corrupt apk, Bro try to decomplie pure stock unmodified apks and check wether u get the error on them !
The Following 2 Users Say Thank You to stanlin salu For This Useful Post: [ View ] Gift stanlin salu Ad-Free
18th January 2013, 02:50 PM |#11  
Senior Member
Thanks Meter: 15
 
Donate to Me
More
but the apk, which I want to compile, install on the phone properly and work properly.

Now, i am compiling and decompiling framework-res.apk.... (for test)
I will report later

---------- Post added at 04:50 PM ---------- Previous post was at 04:42 PM ----------

Here is the error when I recompile framwork-res.apk

Code:
[*] D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\framework-res 
recompiling D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\framework-res... 
W: Could not find sources
I: Building resources...
aapt: warning: string 'reboot_download' has no default translation in D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\framework-res\res; found: ru
aapt: warning: string 'reboot_recovery' has no default translation in D:\Android\DRCompileAPK\AutoAPKTool2.0.4\_INPUT_APK\framework-res\res; found: ru
I: Building apk file...
The system cannot find the drive specified.
look like miss some string in traslation
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes