[UPDATE]Universal Multipurpose AutoAPKTool 2.0.4a

Search This thread

lorjay589

Senior Member
Oct 25, 2010
1,427
2,652
GB
meettomy.site
lol ok one more time, so everyone can get it. I know that to, but its not recompiling the resource with the new edits its making an exact copy of the original in the out folder and its no use to dragging any of the stuff over because its still the same
 

tdunham

Inactive Recognized Contributor
Jun 21, 2008
13,686
36,465
TampaBay
lol ok one more time, so everyone can get it. I know that to, but its not recompiling the resource with the new edits its making an exact copy of the original in the out folder and its no use to dragging any of the stuff over because its still the same
Maybe you can post your original framework so we can take a look at it?
 

jrod091

Senior Member
Feb 13, 2012
337
88
Atlanta, GA
So this is when you're compiling it correct? That window that pops up when you decompile, it says everything is perfect right?
Also, have to tried to compile right away after decompile without making any changes first? Post your mms.apk so I can try it too when you have time. I don't feel up to downloadling the entire rom. :)

This is my mms.apk and my twframework-res.apk, they are ICS 4.0.3 apks
 

Attachments

  • Mms.apk
    1.5 MB · Views: 7
  • twframework-res.apk
    553.2 KB · Views: 5

tdunham

Inactive Recognized Contributor
Jun 21, 2008
13,686
36,465
TampaBay
This is my mms.apk and my twframework-res.apk, they are ICS 4.0.3 apks
Ok, I only loaded your twframework with option 81 since it is the only framework you sent us. It decompiled fine. It appeared to recompile fine also except for this:

[*] G:\Sync\Android\AutoAPKTool2.0.4\_INPUT_APK\Mms
recompiling G:\Sync\Android\AutoAPKTool2.0.4\_INPUT_APK\Mms...
I: Copying classes.dex file...
I: Building resources...
aapt: warning: string 'cc_address_label' has no default translation in G:\Sync\Android\AutoAPKTool2.0.4\_INPUT_APK\Mms\res; found: de fr it ko
I: Building apk file...

I don't know what the cc_address_label is but anyway it compiled fine for me otherwise.

Then I used Apk Manager 5.02 with pretty much the exact same results, the log reflects the same string problem but still compiles fine.

Edit: I don't use the AutoAPKtool for everything so I don't know if it tells you or not but some apk files work with the twframework file but not the framework-res file so maybe that is the only problem. Don't use the framework-res (option 1), just the other (option 81) and try it again.
With APK Manager if I use the wrong framework, APK Manager will tell me if it is the wrong dependency so then I have to try the other framework file (in this case twframework).
 
Last edited:
  • Like
Reactions: jrod091

sleshepic

Inactive Recognized Themer
Oct 18, 2011
3,915
7,030
PA
Yeah don't worry about that translation issue, looks like it compiled fine

Sent from my SPH-D710 using xda premium
 
  • Like
Reactions: tdunham

agat63

Inactive Recognized Developer
Sep 14, 2010
3,987
7,937
Las Vegas, NV
You can disregard that translation warning since the aapt.exe did find them in de (german) fr (french) it (italian) ko (korean).
In general if there are real errors you won't see the last line:
I. Building apk.
If the line is there apk is compiled correctly.
As for framework files.
I always have both installed. framework-res.apk with option 1 and twframework-res.apk with option 81.
This way any app can use dependency it needs and I don't have to worry about it.
 

jrod091

Senior Member
Feb 13, 2012
337
88
Atlanta, GA
Ok, I only loaded your twframework with option 81 since it is the only framework you sent us. It decompiled fine. It appeared to recompile fine also except for this:

[*] G:\Sync\Android\AutoAPKTool2.0.4\_INPUT_APK\Mms
recompiling G:\Sync\Android\AutoAPKTool2.0.4\_INPUT_APK\Mms...
I: Copying classes.dex file...
I: Building resources...
aapt: warning: string 'cc_address_label' has no default translation in G:\Sync\Android\AutoAPKTool2.0.4\_INPUT_APK\Mms\res; found: de fr it ko
I: Building apk file...

I don't know what the cc_address_label is but anyway it compiled fine for me otherwise.

Then I used Apk Manager 5.02 with pretty much the exact same results, the log reflects the same string problem but still compiles fine.

Edit: I don't use the AutoAPKtool for everything so I don't know if it tells you or not but some apk files work with the twframework file but not the framework-res file so maybe that is the only problem. Don't use the framework-res (option 1), just the other (option 81) and try it again.
With APK Manager if I use the wrong framework, APK Manager will tell me if it is the wrong dependency so then I have to try the other framework file (in this case twframework).

Interesting, thanks for all your help, I'll try just the twframework

Only apks I got to decompile correctly so far were both the framework-res apks, weird, lol

Sent from my SGH-I777 using XDA
 

sleshepic

Inactive Recognized Themer
Oct 18, 2011
3,915
7,030
PA
Interesting, thanks for all your help, I'll try just the twframework

Only apks I got to decompile correctly so far were both the framework-res apks, weird, lol

Sent from my SGH-I777 using XDA

If that's the case it sounds like your having issues with the classes.dex? Try pulling out that before you decompile and see what happens. Are you getting errors relating to bad magic values? The reason I say this is because the frameworks don't have a classes.dex file....

Sent from my SPH-D710 using xda premium
 
  • Like
Reactions: jrod091

jrod091

Senior Member
Feb 13, 2012
337
88
Atlanta, GA
Grr...

that didn't help either. I tried twframework-res.apk and framework-res.apk again, and they both decompile and recompile fine, but any other apk I try from this ROM give me the same exact error when I decompile it with option 14...

when I try to decompile an apk from my AOKP ROM, they all decompile fine and recompile fine

In conclusion, I'm utterly lost, lol

---------- Post added at 07:38 PM ---------- Previous post was at 07:35 PM ----------

If that's the case it sounds like your having issues with the classes.dex? Try pulling out that before you decompile and see what happens. Are you getting errors relating to bad magic values? The reason I say this is because the frameworks don't have a classes.dex file....

Sent from my SPH-D710 using xda premium

that's what I'm about to try, I remember reading something about that before

Thank you sir! that worked!! :victory:
 

sleshepic

Inactive Recognized Themer
Oct 18, 2011
3,915
7,030
PA
Grr...

that didn't help either. I tried twframework-res.apk and framework-res.apk again, and they both decompile and recompile fine, but any other apk I try from this ROM give me the same exact error when I decompile it with option 14...

when I try to decompile an apk from my AOKP ROM, they all decompile fine and recompile fine

In conclusion, I'm utterly lost, lol

---------- Post added at 07:38 PM ---------- Previous post was at 07:35 PM ----------



that's what I'm about to try, I remember reading something about that before

Thank you sir! that worked!! :victory:

Or if you know how to use apk manager this one is modded for ics and works on most
http://xdaforums.com/showpost.php?p=23935070&postcount=14

Sent from my SPH-D710 using xda premium
 
  • Like
Reactions: jrod091

agat63

Inactive Recognized Developer
Sep 14, 2010
3,987
7,937
Las Vegas, NV
Just an FYI....this doesn't work with ICS Touchwiz framework-res.apk


Throws res/values/public errors for no apparent reason.

I used this tool to decompile and recompile framework-res.apk for every single ICS leak I made rom for.
All it takes is fixing 1 line in /res/values/public.xml for couple of languages.
Line 79 if memory serves.
It reads something like this
<%d..........%d> and you need to change it to
<%1$d........%2$d>
It's been a wile since last leak so I'm not absolutely positive about syntax.
But you have few /res/values/public.xml files for different languages.
Take a look at line 79 of xml file not listed in error message you will see what i'm talking about.
 
  • Like
Reactions: 12MaNy

12MaNy

Senior Member
Jun 7, 2010
2,427
881
Seattle
I used this tool to decompile and recompile framework-res.apk for every single ICS leak I made rom for.
All it takes is fixing 1 line in /res/values/public.xml for couple of languages.
Line 79 if memory serves.
It reads something like this
<%d..........%d> and you need to change it to
<%1$d........%2$d>
It's been a wile since last leak so I'm not absolutely positive about syntax.
But you have few /res/values/public.xml files for different languages.
Take a look at line 79 of xml file not listed in error message you will see what i'm talking about.



I think you meant res\values\plurals.xml............not res\values\public.xml. Lol

I'm trying to decompile/recompile SGSIII apks, so the plurals.xml error you're talking about isn't present. Thanks though.
 
Last edited:

sleshepic

Inactive Recognized Themer
Oct 18, 2011
3,915
7,030
PA
I've used apktool 1.4.2 to decompile and apktool 1.4.3 to recompile with success where all other methods gave errors. In case it helps.

Sent from my SPH-D710 using xda premium
 
  • Like
Reactions: 12MaNy

12MaNy

Senior Member
Jun 7, 2010
2,427
881
Seattle
I've used apktool 1.4.2 to decompile and apktool 1.4.3 to recompile with success where all other methods gave errors. In case it helps.

Sent from my SPH-D710 using xda premium

Yeah, tried that and still get public.xml errors. I think maybe I might have some corrupted .9's. I'm going to re-download the ROM and start from scratch. God I f****ng miss theming GB. So much easier.
 

sleshepic

Inactive Recognized Themer
Oct 18, 2011
3,915
7,030
PA
Yeah, tried that and still get public.xml errors. I think maybe I might have some corrupted .9's. I'm going to re-download the ROM and start from scratch. God I f****ng miss theming GB. So much easier.

that's one thing I do love about this tool though, when you do get errors its absolutely the easiest to track em down with the generated text doc. Kinda annoying sometimes just from a cmd prompt. And yeah...miss gb for some things for sure.

Sent from my SPH-D710 using xda premium
 
  • Like
Reactions: tdunham

12MaNy

Senior Member
Jun 7, 2010
2,427
881
Seattle
Ok.....I'm good now. Deleted all versions of apktool from my computer, then re-downloaded latest aapt and apktool.jar 1.4.2 & 1.4.3. Now I have no problem recompiling as long as I decompile with 1.4.2 then recompile with 1.4.3.

Must've had some corrupted files. :eek:




You use a different version to decompile and compile? I use 1.4.3 for both with no issues.

No go for me on framework-res and SystemUI. I have to use 1.4.2 and 1.4.3
 
  • Like
Reactions: sleshepic

Top Liked Posts

  • There are no posts matching your filters.
  • 53
    First of all I didn’t create this tool entirely.
    This tool has been created by xavierjohn22 and his thread can be found here:
    http://xdaforums.com/showthread.php?t=1053227
    He deserves most if not all the credit for this amazing tool.

    Credits:

    @Beachon
    @Xavierjohn22, the amazing author of AutoApktool! Visit his thread, click his thanks button, and support his work with donations, and my personal thanks to author for this tool and his permission to modify it and re-post it..
    @Brut_all for Apktool
    @XDA Community

    I did add few more options to the tool to make it AoutAPKTool a universal Tool.

    The Idea was to make this a one stop shop for all app/jar/dex file modifications any dev would like to do.
    With new changes to hex/dex that have been introduced in ICS leaks/roms decompiling an app became a few step process. We had to take classes.dex out of app and save it somewhere. Delete it from app and then decompile it. After mods have been done we had to put that dex file back into app.
    I have added a menu option to decompile ICS app and a script that would do all that all by itself making that process fully automated.
    Also I did add baksmali/smali script and menu options for .dex and .jar files so we don’t have to keep 2 different tools and to be able to do everything we want to do under one roof.

    I’m not gonna type up a tutorial for complete tool.
    You can read about it in thread linked above. Mr. xavierjohn22 knows much more about this subject and his explanations are better than I can do it. You also can read more about how to use this tool here:
    http://xdaforums.com/showthread.php?t=1511755
    I’ll just explain how to use new options in menu I’ve added.
    Download zip file from link provided and extract somewhere on your hard drive. It will create AutoAPKTool2.0.4 folder on your hard drive with all tools and folders you need inside that folder.

    How to:
    1. Decompile ICS app. This has been tested on E4GT apps and it’s working. If you try this tool on apps from other phones ICS builds please let me know if it works and I’ll add that info to description for others to know. Now back to subject. You don’t need to do any extra steps to decompile an ICS app. You would choose option 14 from menu and drag’n’drop app from _INPUT_APK folder into CMD window. The script will take classes.dex out of apk, decompile it and once done with decompiling it will move classes.dex back into xyz.apk file leaving it in its original state. Script will also add classes.dex file to decompiled apk folder so when you recompile it after you done with your modifications the classes.dex will be there. To recompile app use option 15 from menu.

    2. Baksmali/smali classes.dex file. This options will do exactly what they say they would. You put a dex file into _INPUT_APK folder and run baksmali option. It will create clasout folder and put decompiled classes.dex file into it. Do your modifications and run smali. It will recomplile classes.dex and create a new file new-classes.dex in your _INPUT_APK folder. You can rename it to classes.dex and put into apk you took it out from.

    3. Baksmali/smali JAR files. Put a JAR file you want to edit into _Jar_Files folder and run baksmali JAR option from menu. You will be asked to drag’n’drop jar file into CMD window. Do that and hit enter. New folder with filename.dex extension will be created _Jar_Files folder and jar file will be decompiled into that folder. After you done with your modifications choose option Smali JAR file. You will be prompted to drag’n’drop filename.dex folder into CMD window. Do it and hit enter. Jar file will be recompiled and you will find newly created/recompiled jar in filename.dex folder.

    If you see any bags in while using this options please let me know. If you have problems with anything else please contact xavierjohn22 since I don’t know anything about all the other stuff in this tool.
    I’m not a programmer nor am I a code writer and this is my first attempt to put together a tool. Please go easy on me if you discover any bugs. I’ll try to keep up with you and fix bugs as you discover them.

    You can download tool here:
    http://jumbofiles.com/tuwvhbc1ksio/AutoAPKTool2.0.4.zip.html

    Updated tool to aapt.exe from windows-sdk API level 15 (ICS).
    AutoAPKTool2.0.4a

    I'm looking forward to get some feedback about options added.
    5
    Reserved just in case
    4
    reserved as well.
    3
    Im also having recompile issues while trying to recompile SystemUI.apk.
    All I wanted to do was change the clock color in my statusbar on a Samsung Galaxy S2 4.0.4 ROM. I have been searching all around the internet and keep getting all types of "solutions" yet none of them actually work. I keep getting the EXACT SAME errors during recompilation.
    Then I came across this AutoAPKTool during yet another Google search. I love how easy it is to use, yet... ERRRRRRROOOORRRRRRRRS while recompiling. It shouldnt really matter that my phone is not the Epic 4G Touch.

    Im attaching my logs from AutoAPKT. These were generated by decompiling and recompiling a SystemUI.apk that was pre-modded with a 15Toggle mod. I simply decompiled the apk, and immediately recompiled it and the logs will show my results, which seem to be pretty similar to what many others are reporting.

    Please help?

    As mentioned before it's very hard to deal with previously modded apk's.
    When you just swap the png's in any app without proper process (decompile, replace, recompile) app is working but there may be images that left without publck variables attached to them or variables without images.
    App still works but when you try to decompile and recompile you will have a bunch of errors.
    You should try to work with stock (unmodified) app if you wanna avoid errors that are not caused by you and/or your mods.
    In your decompile log it shows one wrong .9.png and believe me one wrong image can trow a lot of errors.
    That png is missing 9. patches and has been rename to png. Now you have more images (at least one) that you have described in your public.xml.
    First you should try to fix that one image and run recompile again to see if it will fix anything.
    Or you can grab the stock SystemUI.apk and decompile it. Use images from that modded app to replace stock images and recompile the stock one again.
    That should work. Just make sure that you using images from decompiled moded app and make sure all 9.png's are correct and have patches.
    Or decompile stock app. Change what ever you want to change and recompile it.
    After that you can swap images using 7z or similar by opening both apps for view.
    Hope this make sense.
    3
    if you are getting plurals.xml errors you have to go to line 79 in each xml that generated the error and add % to the second % on that line:

    for example, change

    <item quantity="other">%d of %d</item>

    to

    <item quantity="other">%d of %%d</item>

    notice the double %% at the end of the line

    Used this for the first time last night, amazing, all in all almost too easy. Thanks Agat63.

    One question though, I'm having issues with framework_helper(to add public.xml entries) and was wondering whether this version of apktool mods the public.xml like apk manager? Or whether I have to manually do it. Trying to add images for pulldown animation, and charging animation. Thanks!

    Edit: Getting this on recompile of fd16 framework-res, also having trouble with fd16 systemui. not sure whats up, doing everything I can think of. Think I have to check syntax in plurals and strings maybe


    [*] C:\Users\Slesh\Desktop\AutoAPKTool2.0.4\_INPUT_APK\framework-res
    recompiling C:\Users\Slesh\Desktop\AutoAPKTool2.0.4\_INPUT_APK\framework-res...
    W: Could not find sources
    I: Building resources...
    aapt: warning: string 'mobileap_notification' has no default translation in C:\Users\Slesh\Desktop\AutoAPKTool2.0.4\_INPUT_APK\framework-res\res; found: es_US
    aapt: warning: string 'policydesc_allow_htmlemail' has no default translation in C:\Users\Slesh\Desktop\AutoAPKTool2.0.4\_INPUT_APK\framework-res\res; found: en_US
    aapt: warning: string 'policylab_allow_htmlemail' has no default translation in C:\Users\Slesh\Desktop\AutoAPKTool2.0.4\_INPUT_APK\framework-res\res; found: en_US
    aapt: warning: string 'wifi_p2p_pbc_go_negotiation_request_message' has no default translation in C:\Users\Slesh\Desktop\AutoAPKTool2.0.4\_INPUT_APK\framework-res\res; found: es
    aapt: warning: string 'wifi_p2p_pin_display_message' has no default translation in C:\Users\Slesh\Desktop\AutoAPKTool2.0.4\_INPUT_APK\framework-res\res; found: es
    aapt: warning: string 'wifi_p2p_pin_go_negotiation_request_message' has no default translation in C:\Users\Slesh\Desktop\AutoAPKTool2.0.4\_INPUT_APK\framework-res\res; found: es
    C:\Users\Slesh\Desktop\AutoAPKTool2.0.4\_INPUT_APK\framework-res\res\values\plurals.xml:79: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
    C:\Users\Slesh\Desktop\AutoAPKTool2.0.4\_INPUT_APK\framework-res\res\values\plurals.xml:79: error: Found tag </item> where </plurals> is expected
    C:\Users\Slesh\Desktop\AutoAPKTool2.0.4\_INPUT_APK\framework-res\res\values-en-rUS\plurals.xml:79: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
    C:\Users\Slesh\Desktop\AutoAPKTool2.0.4\_INPUT_APK\framework-res\res\values-en-rUS\plurals.xml:79: error: Found tag </item> where </plurals> is expected
    C:\Users\Slesh\Desktop\AutoAPKTool2.0.4\_INPUT_APK\framework-res\res\values-es\plurals.xml:79: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
    C:\Users\Slesh\Desktop\AutoAPKTool2.0.4\_INPUT_APK\framework-res\res\values-es\plurals.xml:79: error: Found tag </item> where </plurals> is expected
    Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Slesh\AppData\Local\Temp\APKTOOL4995788418808299772.tmp, -x, -S, C:\Users\Slesh\Desktop\AutoAPKTool2.0.4\_INPUT_APK\framework-res\res, -M, C:\Users\Slesh\Desktop\AutoAPKTool2.0.4\_INPUT_APK\framework-res\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\Slesh\AppData\Local\Temp\APKTOOL4995788418808299772.tmp, -x, -S, C:\Users\Slesh\Desktop\AutoAPKTool2.0.4\_INPUT_APK\framework-res\res, -M, C:\Users\Slesh\Desktop\AutoAPKTool2.0.4\_INPUT_APK\framework-res\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.

    Sent from my SPH-D710 using xda premium