[UPDATE]Universal Multipurpose AutoAPKTool 2.0.4a

Search This thread

agat63

Inactive Recognized Developer
Sep 14, 2010
3,987
7,937
Las Vegas, NV
You could be right, maybe I did overlook something, or maybe the program has problems with the file systems of certain roms? It's strange that some people are having the same problems and others aren't...

In any case, thank you very much for your hard work on this program, it definitely saved me a bunch of time. :)

Apparently it created a lot of headache first.:D
But I'm glad it worked out for you.
You see I've tried it with E4GT ICS builds only. May be if used for OS of different phones more should be taken into consideration. As stated in OP I'm not a programmer and was tapping in the dark when trying to make this work.
Hopefully someone more knowledgeble then me can take it from here and make it really universal so it would work with any OS and any phone.
It's far beyond me and over my head.
 

jrod091

Senior Member
Feb 13, 2012
337
88
Atlanta, GA
So I tried decompling and recompiling my Mms.apk and got some errors, so I tried just recompiling my Mms.apk without making and changes and still got the same errors:

Code:
[*] C:\Users\Owner\Downloads\AutoAPKTool2.0.4\_INPUT_APK\Mms 
recompiling C:\Users\Owner\Downloads\AutoAPKTool2.0.4\_INPUT_APK\Mms... 
I: Smaling...
I: Building resources...
invalid resource directory name: C:\Users\Owner\Downloads\AutoAPKTool2.0.4\_INPUT_APK\Mms\res/mipmap-hdpi
invalid resource directory name: C:\Users\Owner\Downloads\AutoAPKTool2.0.4\_INPUT_APK\Mms\res/mipmap-mdpi
invalid resource directory name: C:\Users\Owner\Downloads\AutoAPKTool2.0.4\_INPUT_APK\Mms\res/mipmap-xhdpi
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Owner\AppData\Local\Temp\APKTOOL2980594474901647136.tmp, -I, C:\Users\Owner\apktool\framework\1.apk, -S, C:\Users\Owner\Downloads\AutoAPKTool2.0.4\_INPUT_APK\Mms\res, -M, C:\Users\Owner\Downloads\AutoAPKTool2.0.4\_INPUT_APK\Mms\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\Owner\AppData\Local\Temp\APKTOOL2980594474901647136.tmp, -I, C:\Users\Owner\apktool\framework\1.apk, -S, C:\Users\Owner\Downloads\AutoAPKTool2.0.4\_INPUT_APK\Mms\res, -M, C:\Users\Owner\Downloads\AutoAPKTool2.0.4\_INPUT_APK\Mms\AndroidManifest.xml]
	at brut.util.OS.exec(OS.java:83)
	at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
	... 6 more

any ideas as to what could be going wrong?
 

agat63

Inactive Recognized Developer
Sep 14, 2010
3,987
7,937
Las Vegas, NV
I'm at work and don't have my laptop with me.
I can try to look into it when I get home tonight unless someone bits me to it.
I guess I would have to download tool and try to set it up from scratch just to make sure that uploaded version matches what I have on my laptop.
 

jrod091

Senior Member
Feb 13, 2012
337
88
Atlanta, GA
I'm at work and don't have my laptop with me.
I can try to look into it when I get home tonight unless someone bits me to it.
I guess I would have to download tool and try to set it up from scratch just to make sure that uploaded version matches what I have on my laptop.

So I updated Java just in case and I replace the aapt file, and it works like a charm now :)
 

powwow88

Senior Member
Apr 11, 2012
136
77
Budapest
Hi, I've tried that program with LG Optimus 2X. I want to change some things in framework-res.apk of a cm9 based rom. I used option Decompile ics app, then Recompile ics app gave me plurals.xml error I changed those as it was mentioned in other thread. I pushed it with adb, rebooted but it was stuck at bootanimation then I signed the apk, and booted up but after pin code the launcher crashes and I cant do anything, only battery pull out helped. If I dont change anything only plurals.xml files to be able to recompile it, then I still have this problem. I'm really confused. Any suggestion? :confused:
 

PacerguyDon

Senior Member
Mar 15, 2011
710
221
Boise
Good to know.
May be I should update OP and list java versions I have on my PC since I don't have any problems with the tool.
That should help others in case they run into same problem.

This looks to be a great program, but The Java is really being a big headache.
I'm on a Windows 7 64 bit machine, and have Java Jre6, Jre7, Jre1.6.0_22 installed in C:program Files (x86)/Program Files/Java.

I also have Java Jre7 and Jdk1.7.0_04 installed in C:program Files/Java

I don't know if I have to many different varieties of Java going on or not enough, but I can't get the program to do anything but open to the CMD window with all the options. (running as Admin)

I have the program installed as C:AutoAPKTool2.0.4

Trying to decompile a framework-res.apk I place the framework-res.apk into the INPUT APK folder, then choose option 1, and I get the message that there is no Framework-res.apk in the INPUT APK folder, yet it is in there.
This is as far as I have made it with the program.
I have tried to choose the option of just decompiling the framework-res.apk, but all that does is just sit on the decompiling window and does nothing.
The framework-res.apk has more than likely been modded previously as it is from an AOSP Ics rom that has been modded.

Don't know where I've gone wrong, but I'd really like to be able to use this program.
Any and all suggestions would be greatly welcomed.
 

12MaNy

Senior Member
Jun 7, 2010
2,427
881
Seattle
This looks to be a great program, but The Java is really being a big headache.
I'm on a Windows 7 64 bit machine, and have Java Jre6, Jre7, Jre1.6.0_22 installed in C:program Files (x86)/Program Files/Java.

I also have Java Jre7 and Jdk1.7.0_04 installed in C:program Files/Java

I don't know if I have to many different varieties of Java going on or not enough, but I can't get the program to do anything but open to the CMD window with all the options. (running as Admin)

I have the program installed as C:AutoAPKTool2.0.4

Trying to decompile a framework-res.apk I place the framework-res.apk into the INPUT APK folder, then choose option 1, and I get the message that there is no Framework-res.apk in the INPUT APK folder, yet it is in there.
This is as far as I have made it with the program.
I have tried to choose the option of just decompiling the framework-res.apk, but all that does is just sit on the decompiling window and does nothing.
The framework-res.apk has more than likely been modded previously as it is from an AOSP Ics rom that has been modded.

Don't know where I've gone wrong, but I'd really like to be able to use this program.
Any and all suggestions would be greatly welcomed.


Did you set java path system variables? I'm on Windows 7 64bit as well and thats what I had to do
 

agat63

Inactive Recognized Developer
Sep 14, 2010
3,987
7,937
Las Vegas, NV
This looks to be a great program, but The Java is really being a big headache.
I'm on a Windows 7 64 bit machine, and have Java Jre6, Jre7, Jre1.6.0_22 installed in C:program Files (x86)/Program Files/Java.

I also have Java Jre7 and Jdk1.7.0_04 installed in C:program Files/Java

I don't know if I have to many different varieties of Java going on or not enough, but I can't get the program to do anything but open to the CMD window with all the options. (running as Admin)

I have the program installed as C:AutoAPKTool2.0.4

Trying to decompile a framework-res.apk I place the framework-res.apk into the INPUT APK folder, then choose option 1, and I get the message that there is no Framework-res.apk in the INPUT APK folder, yet it is in there.
This is as far as I have made it with the program.
I have tried to choose the option of just decompiling the framework-res.apk, but all that does is just sit on the decompiling window and does nothing.
The framework-res.apk has more than likely been modded previously as it is from an AOSP Ics rom that has been modded.

Don't know where I've gone wrong, but I'd really like to be able to use this program.
Any and all suggestions would be greatly welcomed.

If you can't make framework-res.apk to install using option 1 in menu try option 81 "install additional framework" menu. You would drug'n'drop framework into cmd window as if you want to decompile it.
But if the problem is in java path tool won't work correctly since it won't be able to find java/bin folders.
 
  • Like
Reactions: PacerguyDon

PacerguyDon

Senior Member
Mar 15, 2011
710
221
Boise
Thanks for the replies.
I'm pretty sure it's something being weird with Java. I haven't done anything since last fall as far as decompling and compiling goes, and was just using apk manager. It worked ok then, but it doesn't work now either.

I'll do a little digging around the java files and see if I can find anything. I may not have the variables set since I have updated the java files.
 
Last edited:

agat63

Inactive Recognized Developer
Sep 14, 2010
3,987
7,937
Las Vegas, NV
The easiest test/check would be to open cmd window and type java in command prompt.
If line returns "java is not recognized as internal or external command" you would know your environmental variables are not set correctly and java/bin folders are not in the PATH.
All you would have to do is add them to the PATH.
 

PacerguyDon

Senior Member
Mar 15, 2011
710
221
Boise
The easiest test/check would be to open cmd window and type java in command prompt.
If line returns "java is not recognized as internal or external command" you would know your environmental variables are not set correctly and java/bin folders are not in the PATH.
All you would have to do is add them to the PATH.
That was it... Java can sure be a pain in the butt :eek:
Thank you for the help. Much appreciated, and thank you for the app.
 

jrod091

Senior Member
Feb 13, 2012
337
88
Atlanta, GA
So I've been using this tool for a few ICS apks now. Successfully modded my mms, gmail, phone, and SystemUI apks. I tried it on my framework-res.apk and I got a problem with my plurals.xml, so I made necessary changes. Now however, my phone keeps FC everything, I can see my changes in the framework, but I keep getting FCs. Any ideas what is going on?

I'm running AOKP on a Samsung Galaxy SII.
 

agat63

Inactive Recognized Developer
Sep 14, 2010
3,987
7,937
Las Vegas, NV
So I've been using this tool for a few ICS apks now. Successfully modded my mms, gmail, phone, and SystemUI apks. I tried it on my framework-res.apk and I got a problem with my plurals.xml, so I made necessary changes. Now however, my phone keeps FC everything, I can see my changes in the framework, but I keep getting FCs. Any ideas what is going on?

I'm running AOKP on a Samsung Galaxy SII.

What kind of edits did you make to framework?
Recompiled not always mean working.
If there are problems with framework many things might FC.
 

jrod091

Senior Member
Feb 13, 2012
337
88
Atlanta, GA
What kind of edits did you make to framework?
Recompiled not always mean working.
If there are problems with framework many things might FC.

changed colors.xml and drawables.xml in values, basically made my fonts blue and my backgrounds black

I read in another thread you talking about using a stock apk, so I will be trying that next, I'll report back
 

12MaNy

Senior Member
Jun 7, 2010
2,427
881
Seattle
Keep getting this when I try to recompile. The part in bold is what is confusing considering all files are edited correctly (I triple checked):


I: Copying classes.dex file...
I: Building resources...
C:\Users\Jason\Desktop\Android Files\AutoAPKTool2.0.4\_INPUT_APK\com.redsynergy.themechooser.theme\res\values\public.xml:3087: error: Public symbol style/RedSynergy declared here is not defined




Here is the line I added to res/values/public.xml:

<public type="style" name="RedSynergy" id="0x02080000" />




Here's my AndroidManifest file (relevant line in bold)...

<?xml version="1.0" encoding="utf-8"?>
<manifest android:hasCode="false" android:versionCode="1" android:versionName="1.0" android:installLocation="internalOnly" package="com.redsynergy.themechooser.theme"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns: pluto="http://www.w3.org/2001/pluto.html">
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="15" />
<application android:label="@string/theme_name" android:icon="@drawable/icon">
<activity android:label="@string/theme_name" android:name="com.tmobile.theme.Foo" />
</application>
<theme pluto:themeId="RedSynergy" pluto:styleId="@style/RedSynergy" pluto:name="@string/theme_name" pluto: preview="@drawable/preview" pluto:author="@string/author" pluto:copyright="@string/copyright" pluto:wallpaperImage="@drawable/wallpaper" pluto:styleName="@string/style_appearance_name" />
</manifest>




As you can see, everything is edited correctly and is defined correctly but that error persists. I'm about ready to punch my goddamn monitor. :mad:
 

agat63

Inactive Recognized Developer
Sep 14, 2010
3,987
7,937
Las Vegas, NV
Are there any icons or png's associated with this?
Is that line you posted line 3087 from your public.xml?
 

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