Hello! Need some help with apktool. - Android Software/Hacking General [Developers Only]

Hello! I'm new to the forum and a casual android modder. I've really enjoyed digging into the Android world and have learned a lot from the forum. I was working with apktool and ran into a bit of a problem. I searched and found a post indicating that the environmental variables had to be tweaked which I did but this did not resolve the problem.
Thanks in advance,
-Adam
Environmental variables:
PHP:
C:\>echo %PATH%
C:\DMI\WIN32\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\QuickTime Alternative\QTSystem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\QuickTime Alternative\QTSystem\;C:\Program Files\ZipGenius 6\;C:\PROGRA~1\JPSoft\4dos; C:\Documents and Settings\Owner\My Documents\Downloads\android-sdk_r07-windows\android-sdk-windows\tools
apktool commands (minus a few more lines of errors for length):
PHP:
C:\Documents and Settings\Owner\My Documents\Downloads\android-sdk_r07-windows\android-sdk-windows\tools>apktool d framework-res.apk
I: Loading resource table...
I: Decoding resources...
W: Cant find 9patch chunk in file: "drawable-mdpi/status_bar_header_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-mdpi/statusbar_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-mdpi/status_bar_close_on.9.png". Renaming it to *.png.
I: Copying assets and libs...
C:\Documents and Settings\Owner\My Documents\Downloads\android-sdk_r07-windows\android-sdk-windows\tools>apktool b framework-res
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
libpng error: Read Error
ERROR: Failure processing PNG image C:\Documents and Settings\Owner\My Documents\Downloads\android-sdk_r07-windows\android-sdk-windows\tools\framework-res\res\drawable-mdpi\status_bar_close_on.9.png
libpng error: Read Error
ERROR: Failure processing PNG image C:\Documents and Settings\Owner\My Documents\Downloads\android-sdk_r07-windows\android-sdk-windows\tools\framework-res\res\drawable-mdpi\status_bar_header_background.9.png
libpng error: Read Error
ERROR: Failure processing PNG image C:\Documents and Settings\Owner\My Documents\Downloads\android-sdk_r07-windows\android-sdk-windows\tools\framework-res\res\drawable-mdpi\statusbar_background.9.png
C:\Documents and Settings\Owner\My Documents\Downloads\android-sdk_r07-windows\android-sdk-windows\tools\framework-res\res\values\public.xml:3342: error: Public entry identifier 0x1080252 entry index is larger than available symbols (index 594, total symbols 43).
C:\Documents and Settings\Owner\My Documents\Downloads\android-sdk_r07-windows\android-sdk-windows\tools\framework-res\res\values\public.xml:3342: error: Public symbol drawable/APKTOOL_DUMMY_0252 declared here is not defined.
.
.
.
C:\Documents and Settings\Owner\My Documents\Downloads\android-sdk_r07-windows\android-sdk-windows\tools\framework-res\res\values\public.xml:3340: error: Public symbol drawable/zz_stat_sys_signal_5_cdma declared here is not defined.
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\DOCUME~1\Owner\LOCALS~1\Temp\APKTOOL1107807157838832304.tmp, -x, -S, C:\Documents and Settings\Owner\My Documents\Downloads\android-sdk_r07-windows\android-sdk-windows\tools\framework-res\res, -M, C:\Documents and Settings\Owner\My Documents\Downloads\android-sdk_r07-windows\android-sdk-windows\tools\framework-res\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(Unknown Source)
at brut.androlib.Androlib.buildResourcesFull(Unknown Source)
at brut.androlib.Androlib.buildResources(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.apktool.Main.cmdBuild(Unknown Source)
at brut.apktool.Main.main(Unknown Source)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\DOCUME~1\Owner\LOCALS~1\Temp\APKTOOL1107807157838832304.tmp, -x, -S, C:\Documents and Settings\Owner\My Documents\Downloads\android-sdk_r07-windows\android-sdk-windows\tools\framework-res\res, -M, C:\Documents and Settings\Owner\My Documents\Downloads\android-sdk_r07-windows\android-sdk-windows\tools\framework-res\AndroidManifest.xml]
at brut.util.OS.exec(Unknown Source)
... 7 more

I also need some help with apktool. I'm trying to get into changing xml files on my Droid X. I've been able to successfully use the tool to decode apk files but i've heard that you can use it to decode xml files. Every time I try to do that though I get an error.
Included is a capture of the code I type in and the erros i'm getting with the xml file. I am trying to manipulate the simple eri.xml file that Verizon uses.

@adam-c
Could you upload original apk and zipped dir with decoded app? What is in these drawable-mdpi/status_bar_header_background.9.png, etc. files in decoded app? Are there both status_bar_header_background.9.png and status_bar_header_background.png (without ".9") files, but first one is empty or what?
@homes315
For now you can't decode single xml file - decode whole apk instead.

I have been searching for two days, and have tried everything I could find to figure this out, to no avail.
Could someone please help me get the apktool working on my computer?
when I enter apktool I get:
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/object
From what I can tell I have my CLASSPATH and PATH set up correctly.
Any help would be greatly appreciated.
BTW, I am running Windows 7 64bit

Related

[Q] UoT Kitchen SHTF Error w/log

Decompiling framework-res.apk UOT-01-04-20-00-2
I: Loading resource table...
I: Loaded.
I: Decoding file-resources...
S: Could not decode file, replacing by FALSE value: layout-1999x999/preference_dialog_edittext.xml
S: Could not decode file, replacing by FALSE value: layout-1999x999/textview_hint.xml
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
Decompiling SystemUI.apk UOT-01-04-20-00-2
I: Framework installed to: /root/apktool/framework/1.apk
I: Baksmaling...
I: Loading resource table...
W: Config flags size > 32. Exceeding bytes: 0700000048030000.
W: Invalid config flags detected. Dropping resources: bool-ERR0
I: Loaded.
I: Loading resource table from file: /root/apktool/framework/1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
Compiling framework-res.apk UOT-01-04-20-00-2
W: Could not find sources
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, /tmp/APKTOOL5768030333969371231.tmp, -x, -S, /home/android1/port5/data/working_dir/UOT-01-04-20-00-2/fw_dec/res, -M, /home/android1/port5/data/working_dir/UOT-01-04-20-00-2/fw_dec/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:174)
at brut.apktool.Main.main(Main.java:59)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, /tmp/APKTOOL5768030333969371231.tmp, -x, -S, /home/android1/port5/data/working_dir/UOT-01-04-20-00-2/fw_dec/res, -M, /home/android1/port5/data/working_dir/UOT-01-04-20-00-2/fw_dec/AndroidManifest.xml]
at brut.util.OS.exec(OS.java:87)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
... 6 more
Caused by: java.io.IOException: Cannot run program "aapt": java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at brut.util.OS.exec(OS.java:78)
... 7 more
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 11 more
I'm using A2tude for Huawei M865, which is a slightly modified stock gingerbread rom.
I have been working insane hours and my brain is probably not registering the error message...so if anyone has a solution to this; It would be greatly appreciated.
I am bumping this long lost thread

[Q] How to zip the framework-res

I want to cook a Sense 4 rom and I unpacked the framework-res.apk in a folder with apktool. However, Which confused me is I can't zip the floder in an apk file and apktool shows these words below:"
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: XX\framework-res\res/drawable-sw600dp-hdpi
invalid resource directory name: XX\framework-res\res/layout-sw600dp
invalid resource directory name: XX\framework-res\res/layout-w600dp
invalid resource directory name: XX\framework-res\res/values-h720dp
invalid resource directory name: XX\framework-res\res/values-sw600dp
invalid resource directory name: XX\framework-res\res/values-sw600dp-land
invalid resource directory name: XX\framework-res\res/values-sw600dp-w1024dp
invalid resource directory name: XX\framework-res\res/values-sw600dp-w1280dp
invalid resource directory name: XX\framework-res\res/values-w360dp
invalid resource directory name: XX\framework-res\res/values-w480dp
invalid resource directory name: XX\framework-res\res/values-w500dp
invalid resource directory name: XX\framework-res\res/values-w600dp
invalid resource directory name: XX\framework-res\res/values-w720dp
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, %users%\AppData\Local\Temp\APKTOOL4350327246804464168.tmp, -x, -S, XX\framework-res\res, -M, XX\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, %users%\AppData\Local\Temp\APKTOOL4350327246804464168.tmp, -x, -S, XX\framework-res\res, -M, XX\framework-res\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
... 6 more
Click to expand...
Click to collapse
"
Thanks for any gus who can help me>
is there anyone here?
anyone who can help me?
PLS HELP
I need some one to help me/.
Try Apk manager. I always get problems with apk tool.
Did you run framework.if to load sources?
Sent from my SGH-T989 using xda premium
yes, I have installed them
dillym34 said:
Did you run framework.if to load sources?
Sent from my SGH-T989 using xda premium
Click to expand...
Click to collapse
I have run these in the CMD:"
apktool if framework-res.apk
apktool if com.htc.resources.apk
Click to expand...
Click to collapse
"
and then "1.apk" and "2.apk" show in the floder: %users%/apktool/ ,but it still not work.
dan-fish said:
Try Apk manager. I always get problems with apk tool.
Click to expand...
Click to collapse
thanks, I'll try it.

Auto APK Tool

Hy all it's mee again :/
Today i try to add change ( http://review.cyanogenmod.com/#/c/25391/ ) i found this is in LatinIME.apk file then i download THIS AutoAPKTool and i do like this
1. Open AutoAPKTool.bat
2. Move the apk file whitch i want to edit in _INPUT_APK Folder
3. Press number 6 and drag the link of file in and press enter
4. Edit the Style.xml
5. Then again run the AutoAPKTool.bat
6. Press number 7 and drag the link of edited folder in
7. Then i get this error :/
[*] C:\Users\Nataça\Desktop\xdaAutoAPKTool_V3.0.2\_INP UT_APK\LatinIME
recompiling C:\Users\Nataça\Desktop\xdaAutoAPKTool_V3.0.2\_INP UT_APK\LatinIME...
I: Smaling...
I: Building resources...
invalid resource directory name: C:\Users\Nataša\Desktop\xdaAutoAPKTool_V3.0.2\_INP UT_APK\LatinIME\res/drawable-xhdpi
invalid resource directory name: C:\Users\Nataša\Desktop\xdaAutoAPKTool_V3.0.2\_INP UT_APK\LatinIME\res/values-sw600dp
invalid resource directory name: C:\Users\Nataša\Desktop\xdaAutoAPKTool_V3.0.2\_INP UT_APK\LatinIME\res/values-sw600dp-land
invalid resource directory name: C:\Users\Nataša\Desktop\xdaAutoAPKTool_V3.0.2\_INP UT_APK\LatinIME\res/values-sw768dp
invalid resource directory name: C:\Users\Nataša\Desktop\xdaAutoAPKTool_V3.0.2\_INP UT_APK\LatinIME\res/values-sw768dp-land
invalid resource directory name: C:\Users\Nataša\Desktop\xdaAutoAPKTool_V3.0.2\_INP UT_APK\LatinIME\res/xml-sw600dp
invalid resource directory name: C:\Users\Nataša\Desktop\xdaAutoAPKTool_V3.0.2\_INP UT_APK\LatinIME\res/xml-sw600dp-land
invalid resource directory name: C:\Users\Nataša\Desktop\xdaAutoAPKTool_V3.0.2\_INP UT_APK\LatinIME\res/xml-sw768dp
invalid resource directory name: C:\Users\Nataša\Desktop\xdaAutoAPKTool_V3.0.2\_INP UT_APK\LatinIME\res/xml-sw768dp-land
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\NATAA~1\AppData\Local\Temp\APKTOOL4520095 777156111205.tmp, -I, C:\Users\Nataša\apktool\framework\1.apk, -S, C:\Users\Nataša\Desktop\xdaAutoAPKTool_V3.0.2\_INP UT_APK\LatinIME\res, -M, C:\Users\Nataša\Desktop\xdaAutoAPKTool_V3.0.2\_INP UT_APK\LatinIME\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(An drolibResources.java:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib .java:301)
at brut.androlib.Androlib.buildResources(Androlib.jav a: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\NATAA~1\AppData\Local\Temp\APKTOOL4520095 777156111205.tmp, -I, C:\Users\Nataša\apktool\framework\1.apk, -S, C:\Users\Nataša\Desktop\xdaAutoAPKTool_V3.0.2\_INP UT_APK\LatinIME\res, -M, C:\Users\Nataša\Desktop\xdaAutoAPKTool_V3.0.2\_INP UT_APK\LatinIME\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(An drolibResources.java:191)
... 6 more
Unable to open '_INPUT_APK\LatinIME\dist\LatinIME.apk' as zip archive
Navedenega pogona ni mogoźe najti.
Click to expand...
Click to collapse
Can anyone tell me how to fix this ? :/
You seem to have a typo somewhere as the "_INP UT_APK" folder should not have a blank in it.

[Q] not able to compile systemUI.apk

hey i tried to decompile systemui.apk
it decompiled successfully using apktool
but whenever i tries to recompile it it shows dis error
it is of cyanogen mod 9.1
C:\Users\yo\Downloads\Compressed\New folder (2)>apktool b SystemUI
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: C:\Users\yo\Downloads\Compressed\New folder (2)
\SystemUI\res/drawable-sw600dp-mdpi
invalid resource directory name: C:\Users\yo\Downloads\Compressed\New folder (2)
\SystemUI\res/drawable-sw720dp-mdpi
invalid resource directory name: C:\Users\yo\Downloads\Compressed\New folder (2)
\SystemUI\res/layout-sw600dp
invalid resource directory name: C:\Users\yo\Downloads\Compressed\New folder (2)
\SystemUI\res/values-sw600dp
invalid resource directory name: C:\Users\yo\Downloads\Compressed\New folder (2)
\SystemUI\res/values-sw600dp-port
invalid resource directory name: C:\Users\yo\Downloads\Compressed\New folder (2)
\SystemUI\res/values-sw720dp
invalid resource directory name: C:\Users\yo\Downloads\Compressed\New folder (2)
\SystemUI\res/values-sw720dp-port
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\yo\AppData\Local\Temp\APKT
OOL3042390860033165785.tmp, -I, C:\Users\yo\apktool\framework\1.apk, -S, C:\User
s\yo\Downloads\Compressed\New folder (2)\SystemUI\res, -M, C:\Users\yo\Downloads
\Compressed\New folder (2)\SystemUI\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a: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:\U
sers\yo\AppData\Local\Temp\APKTOOL3042390860033165785.tmp, -I, C:\Users\yo\apkto
ol\framework\1.apk, -S, C:\Users\yo\Downloads\Compressed\New folder (2)\SystemUI
\res, -M, C:\Users\yo\Downloads\Compressed\New folder (2)\SystemUI\AndroidManife
st.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:191)
... 6 more
plz help me
shubhamj596 said:
invalid resource directory name: C:\Users\yo\Downloads\Compressed\New folder (2)
\SystemUI\res/drawable-sw600dp-mdpi
Click to expand...
Click to collapse
I think this is the problem. First try to put the kitchen somewhere in a parth where no spaces occur in the build path. Then try to build the apk. If still you're facing problems. Reply back here.

[Q] No matter what I do I get UOT Kitchen SHTF error

Hello everyone
I'm really at my wit's end with the UOT Kitchen here. I've uploaded 3 different Framework-res.apk and SystemUI.apk from the different ROMS available for my phone (LG Optimus Slider running 2.3.4) and I get the SHTF error each time. I've never had any trouble with UOTK before, granted it was about a year ago that I used it last. Did something change with it?
So I installed Xposed (for Gingerbread) thinking it would work better. Nope. When I try to install the UOT apk it won't install and spits out an error message about "Not being able to parse"
I've never had a problem using the UOTK before. Could somebody please tell me what's going wrong?
Error log: UOT-10-04-19-41-1-SHTF.txt
Decompiling framework-res.apk UOT-10-04-19-41-1
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
Decompiling SystemUI.apk UOT-10-04-19-41-1
I: Framework installed to: /root/apktool/framework/1.apk
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /root/apktool/framework/1.apk
I: Loaded.
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
Compiling framework-res.apk UOT-10-04-19-41-1
W: Could not find sources
I: Building resources...
aapt: /lib/libz.so.1: no version information available (required by aapt)
/home/uotftp/port5/data/working_dir/UOT-10-04-19-41-1/fw_dec/res/values-ko/strings.xml:689: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
/home/uotftp/port5/data/working_dir/UOT-10-04-19-41-1/fw_dec/res/values-ko/strings.xml:691: error: Unexpected end tag string
/home/uotftp/port5/data/working_dir/UOT-10-04-19-41-1/fw_dec/res/values-zh-rCN/strings.xml:689: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
/home/uotftp/port5/data/working_dir/UOT-10-04-19-41-1/fw_dec/res/values-zh-rCN/strings.xml:691: error: Unexpected end tag string
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 10, --target-sdk-version, 10, -F, /tmp/APKTOOL5382109605747588451.tmp, -x, -S, /home/uotftp/port5/data/working_dir/UOT-10-04-19-41-1/fw_dec/res, -M, /home/uotftp/port5/data/working_dir/UOT-10-04-19-41-1/fw_dec/AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:358)
at brut.androlib.Androlib.buildResources(Androlib.java:283)
at brut.androlib.Androlib.build(Androlib.java:206)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 10, --target-sdk-version, 10, -F, /tmp/APKTOOL5382109605747588451.tmp, -x, -S, /home/uotftp/port5/data/working_dir/UOT-10-04-19-41-1/fw_dec/res, -M, /home/uotftp/port5/data/working_dir/UOT-10-04-19-41-1/fw_dec/AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:357)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:336)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 10, --target-sdk-version, 10, -F, /tmp/APKTOOL5382109605747588451.tmp, -x, -S, /home/uotftp/port5/data/working_dir/UOT-10-04-19-41-1/fw_dec/res, -M, /home/uotftp/port5/data/working_dir/UOT-10-04-19-41-1/fw_dec/AndroidManifest.xml]
at brut.util.OS.exec(OS.java:89)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:355)
... 6 more

Categories

Resources