yashsingh1/xdaforums huggingface dataset:
[Android Software Development] adulfo:
I constantly get these errors on 1.5 but doing fine with 1.4.10.. Can someone explain to me?

E:\Documents and Settings\ps.avuy.SMART\apktool\SystemUIpan\res\values\public.xm

l:884: error: Public symbol array/shutdown_reboot_options declared here is not d

efined.

Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce

ption: could not exec command: [aapt, p, --min-sdk-version, 15, --target-sdk-ver

sion, 15, -F, E:\DOCUME~1\PSAVUY~1.SMA\LOCALS~1\Temp\APKTOOL2274734316441567101.

tmp, -I, E:\Documents and Settings\ps.avuy.SMART\apktool\framework\1.apk, -S, E:

\Documents and Settings\ps.avuy.SMART\apktool\SystemUIpan\res, -M, E:\Documents

and Settings\ps.avuy.SMART\apktool\SystemUIpan\AndroidManifest.xml]

at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav

a:255)

at brut.androlib.Androlib.buildResourcesFull(Androlib.java:324)

at brut.androlib.Androlib.buildResources(Androlib.java:269)

at brut.androlib.Androlib.build(Androlib.java:192)

at brut.androlib.Androlib.build(Androlib.java:174)

at brut.apktool.Main.cmdBuild(Main.java:188)

at brut.apktool.Main.main(Main.java:70)

Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sd

k-version, 15, --target-sdk-version, 15, -F, E:\DOCUME~1\PSAVUY~1.SMA\LOCALS~1\T

emp\APKTOOL2274734316441567101.tmp, -I, E:\Documents and Settings\ps.avuy.SMART\

apktool\framework\1.apk, -S, E:\Documents and Settings\ps.avuy.SMART\apktool\Sys

temUIpan\res, -M, E:\Documents and Settings\ps.avuy.SMART\apktool\SystemUIpan\An

droidManifest.xml]

at brut.util.OS.exec(OS.java:83)

at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav

a:253)

... 6 more

Thank you
[Android Software Development] CosmicDan:
Are you sure? Double check shutdown_reboot_options in array.xml.
[Android Software Development] GroovyGeek:
Here they are... https://www.dropbox.com/sh/5qu6a3hv8jnxusv/fGFlPGz6oP/apks.zip
[Android Software Development] Deadly:
Y dont u upload to some file sharing site like mediafire and give link here.. many ppl dont want to give mail id... so if u gave link here. Next time he is online he can look at it

hit thanks button! If above post helps you..

Sent from my GT-S6102
[Android Software Development] adulfo:
Yeah sure now... Can you explain to me?... I'm aware of the reboot_options....
[Android Software Development] CosmicDan:
Make sure the array is valid.
[Android Software Development] adulfo:
I think those lines on the array.xml is not being used... Next time I will delete those lines and use 1.5.0 again... Thanks for the reply mate...
[Android Software Development] rlorange:
I've just successfully decompiled and recompiled SecBrowser.apk from GTi9300 XXLIB jelly bean ROM (Samsung ROM). On windows 7

Actually I've succeeded MANY times as I'm trying to fix a typo in the code. So trying to find all references to the misspelled word was tedious but I think I did however the bug this typo caused seems to remain!!

Q: the typo is "download_default_storyage" I originally found in the sharepref XML. Could someone from experience help point me to where reference to it might be hiding? I've found and corrected all the obvious ones.

Q2: could dependencies lie in any other system Apps? Maybe framework itself?
[Android Software Development] Deadly:
Check framework-res.apk and file strings. Xml

hit thanks button! If above post helps you..

Sent from my GT-S6102
[Android Software Development] GroovyGeek:
With the updated aapt it does not barf (see messages below) but it does not work either. The original apk is 2159KB, the recompiled apk is is only 512KB. The original Roise works fine, the recompiled Rosie just force-closes. Argh!

W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
aapt: warning: string 'all_apps_home_button_label' has no default translation in C:\Users\Boyan\Documents\Android\apktool\Rosie\res; found: ca rm tl
aapt: warning: string 'all_apps_tab_all' has no default translation in C:\Users\Boyan\Documents\Android\apktool\Rosie\res; found: ca tl
aapt: warning: string 'cancel_action' has no default translation in C:\Users\Boyan\Documents\Android\apktool\Rosie\res; found: ca rm tl
aapt: warning: string 'delete_zone_label_all_apps' has no default translation in C:\Users\Boyan\Documents\Android\apktool\Rosie\res; found: ca tl
aapt: warning: string 'delete_zone_label_workspace' has no default translation in C:\Users\Boyan\Documents\Android\apktool\Rosie\res; found: ca tl
aapt: warning: string 'group_applications' has no default translation in C:\Users\Boyan\Documents\Android\apktool\Rosie\res; found: ca rm tl
aapt: warning: string 'menu_add' has no default translation in C:\Users\Boyan\Documents\Android\apktool\Rosie\res; found: ca rm tl
aapt: warning: string 'menu_notifications' has no default translation in C:\Users\Boyan\Documents\Android\apktool\Rosie\res; found: ca rm tl
aapt: warning: string 'menu_search' has no default translation in C:\Users\Boyan\Documents\Android\apktool\Rosie\res; found: ca rm tl
aapt: warning: string 'menu_settings' has no default translation in C:\Users\Boyan\Documents\Android\apktool\Rosie\res; found: ca rm tl
aapt: warning: string 'menu_wallpaper' has no default translation in C:\Users\Boyan\Documents\Android\apktool\Rosie\res; found: ca rm tl
aapt: warning: string 'rename_action' has no default translation in C:\Users\Boyan\Documents\Android\apktool\Rosie\res; found: ca rm tl
I: Building apk file...
[Android Software Development] varun.chitre15:
Take out resources.arsc from.apk,and put it back with zero compression
[Android Software Development] neectron:
I can successfully compile and decompile framework-res.apk.But after compilation when I use the recompiled in phone,it causes boot loops,I haven't changed anything,I have set right permissions.

Stock framework-res:14MB

Re-compiled framework-res:8MB,I have set zero compression but still.

Any help?
[Android Software Development] Deadly:
try this.. keep all the apks of your system partition except apps.. resign them with any tool.. or dsixda kitchen... it should work...
[Android Software Development] CosmicDan:
It would be nice if we had a logcat, to see if that's the issue. Something about "signature does not match, ignoring!". If this is your issue, I will repeat something I said a few times in this thread - patch services.jar to ignore signature checks so you can just resign any apk with test-keys without needing to resign every APK.

But I am pretty sure nothing in framework needs to be signed. I know the jar's dont, but framework-res.apk I'm not sure.
[Android Software Development] neectron:
I signed recompiled framework-res.apk by copying meta-inf from stock framework-res.apk.So there shouldn't any signing problems,right?
[Android Software Development] Deadly:
hmm.. ya sorry.. its just that.. i had gone through this same issue once.. so i thought may be it will help him.. not sure thats the case though.. as it might be many other thigs..

thanks for the info.. i didnt know that.. i never did any rom..

but i mod the custom roms for my preferred ideas and my personal use :)
[Android Software Development] CosmicDan:
No problem, the whole signature thing is a common issue that many modders don't know about.

Logcat would really help here! I do port MIUI to the Xperia Play and I am unable to recompile framework-res without getting any errors, but it could be the plurals.xml bug or an issue with multilanguage strings (both already reported and on the to-do list for future APKTool versions) for me. But I am not sure since I have not needed to recompile it since finding out about them bugs (and how to fix them).

To make sure it's not the plurals.xml issue, please see this post. To make sure it's not a multilanguage issue, delete all non-English values-XX folders (if you have them) just to test. Otherwise, please logcat :)

EDIT: The other plurals bug is when a value shows something like "%d of %d" when it needs to be manually edited to show "%1$d of %2$d". For example.
[Android Software Development] neectron:
Attached the logcat:
[Android Software Development] neectron:
I am using apktool 1.5

This what I have done,

Decompiled the framework-res.apk without any errors.Didn't change anything.

Compiled the framework-res.apk without any errors.

Copied resources.arsc from unsignedframework-res.apk to original framework-res.apk.

Installed original framework-res.apk using flashable.zip with correct permissions.

It is causing bootloops.So there must be something wrong with compiled resources.arsc.?
[Android Software Development] CosmicDan:
Sorry, I forgot to reply. I really have no idea, I think you had better wait until 1.5.1. I can't even recompile framework-res.apk on latest MIUI builds, I get invalid resource errors.
[Android Software Development] iBotPeaches:
That means your aapt is out of date and not using the MIUI one. Go to the Op, aapt and download the sub folder of faapt.
[Android Software Development] car vs driver:
I have an oddball issue ... I cann't get the -t flag to work properly. I install my frameworks with tags, then when I use the command to decompile with a specific tag it defaults to 1.apk as the framework.

Any ideas?
[Android Software Development] mattmanwrx:
What are you actually typing? We cannot correct what we don't know... :)
[Android Software Development] car vs driver:
Ok, I did a couple things ... working with the SKY-JB ROM from seanz on my skyrocket.

Here's what I did:

dcmpb:jb carvsdriver$ adb pull /system/framework/framework-res.apk

2438 KB/s (5544088 bytes in 2.220s)

dcmpb:jb carvsdriver$ adb pull /system/framework/twframework-res.apk

2382 KB/s (608684 bytes in 0.249s)

dcmpb:jb carvsdriver$ apktool if twframework-res.apk tw

I: Framework installed to: /Users/carvsdriver/Library/Application Support/apktool/framework/2-tw.apk

dcmpb:jb carvsdriver$ apktool if framework-res.apk fr

I: Framework installed to: /Users/carvsdriver/Library/Application Support/apktool/framework/1-fr.apk

dcmpb:jb carvsdriver$ apktool d -t tw SystemUI.apk

I: Baksmaling...

I: Loading resource table...

I: Loaded.

I: Decoding AndroidManifest.xml with resources...

I: Loading resource table from file: /Users/carvsdriver/Library/Application Support/apktool/framework/1.apk

I: Loaded.

I: Decoding file-resources...

I: Decoding values */* XMLs...

I: Done.

I: Copying assets and libs...

dcmpb:jb carvsdriver$

You'll notice that it defaulted to 1.apk for the framework and decompiles just fine. It also recompiles with no problems at all. The problem that I'm running into (which I think is a result of not using the tw framework) is that when I push the SystemUI.apk back to my phone I lose the upper status bar entirely as well as backgrounds. So, my thought is that the decompile framework is doing something funky.

Also, running this on a MAC and I have the latest apktool and aapt files from the OP.

At the end of the day, I'm just trying to port over the battery icon themes from the SKY-ICS rom. Figure it was a good place to start learning about changing APK files and building flashable zips.
[Android Software Development] varun.chitre15:
Try taking out resources.arsc from SystemUI.apk and put it back with zero compression(Store in case of WinRar) and then push it /system/app

It should work!
[Android Software Development] car vs driver:
Ah ok, so compile the apk ... yank the resources.arsc file and stick it back in uncompressed? Will give that a rip in a bit.

Thank you!
[Android Software Development] iBotPeaches:
Thats wrong.

apktool install-framework framework-res.apk fr

etc
[Android Software Development] car vs driver:
Tried that, still won't use the one I'm specifying ... I'm sure that I'm doing something wrong if everyone else has this working :)

dcmpb:jb carvsdriver$ apktool install-framework twframework-res.apk tw

I: Framework installed to: /Users/carvsdriver/Library/Application Support/apktool/framework/2-tw.apk

dcmpb:jb carvsdriver$ apktool d -t tw SystemUI.apk

I: Baksmaling...

I: Loading resource table...

I: Loaded.

I: Decoding AndroidManifest.xml with resources...

I: Loading resource table from file: /Users/carvsdriver/Library/Application Support/apktool/framework/1.apk

I: Loaded.

I: Decoding file-resources...

I: Decoding values */* XMLs...

I: Done.

I: Copying assets and libs...

dcmpb:jb carvsdriver$
[Android Software Development] iBotPeaches:
install all the frameworks with the tw code. Then decompile using -t tw. Try clearing out the saved apktool cache directory to force yourself to re-install the frameworks.
[Android Software Development] car vs driver:
I did notice that the APK files are different sizes. I found that the META-INF folder is missing, so I copied that in, replaced the resources.arsc file and got the same results after adb push. From what I can tell, the status bar at the top is completely missing after I push it back - my clock widget moves up to the very top of the screen.

BTW, I hope I'm not hijacking this thread - I can move this conversation to PM or something if necessary.

Will remove all the resource files from my library and start over using your recommendation ....

---------- Post added at 03:15 PM ---------- Previous post was at 03:05 PM ----------

Ok, that worked. Now it's using the frameworks I want it to.

Still having the same problem with it not working once on the phone. Even after pushing META-INF and resources.arsc into the rebuilt file. I must be doing something else wrong that I'll take out of this thread, it seems the APKTOOL is doing what it's supposed to.

Thanks guys for the help, if you have any other ideas on what I could be messing up, please let me know.
[Android Software Development] mattmanwrx:
Take your rebuilt and push the new resources etc to the old apk and see if that works...
[Android Software Development] 3DFox:
signed diffrent with the impt APK?

etc. systemui.apk Settings.apk SettingsProvider.apk

and so on~~
[Android Software Development] lreyes:
will i be able to decompile/compile ics apks correctly??
[Android Software Development] car vs driver:
That worked, now I have other n00b problems to figure out.

Thanks again!
[Android Software Development] mikemol:
Hi,

I'm trying to build an apk using apktools. I tried older versions and had an error message and have just tried this one and still get the same error message.

I'm on Windows XP, I copied aapt.exe, apktool.bat and apktool.jar to windows directory (as well as to the folder I'm working in). I have JRE installed.

This is the message I get when trying to build an apk:

Unable to add 'C:\APKTool\rcs\build\apk\classes.dex': Zip add failed

ERROR: unable to process assets while packaging 'C:\APKTool\rcs\dist\rcs.apk'

ERROR: packaging of 'C:\APKTool\rcs\dist\rcs.apk' failed

Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce

ption: could not exec command: [aapt, p, --min-sdk-version, 7, -F, C:\APKTool\rc

s\dist\rcs.apk, -A, C:\APKTool\rcs\assets, C:\APKTool\rcs\build\apk]

at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav

a:255)

at brut.androlib.Androlib.buildApk(Androlib.java:437)

at brut.androlib.Androlib.build(Androlib.java:195)

at brut.androlib.Androlib.build(Androlib.java:174)

at brut.apktool.Main.cmdBuild(Main.java:188)

at brut.apktool.Main.main(Main.java:70)

Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sd

k-version, 7, -F, C:\APKTool\rcs\dist\rcs.apk, -A, C:\APKTool\rcs\assets, C:\APK

Tool\rcs\build\apk]

at brut.util.OS.exec(OS.java:83)

at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav

a:253)

... 5 more

I tried that with an edited apk file and with even just decompiled apk file without doing any edits to it and I get the same results - build fails.

Any idea why it fails?
[Android Software Development] bgcngm:
That seems to be your problem. Check if aapt is on your environment path.
[Android Software Development] iBotPeaches:
That isn't my apktool nor brut.all's. That must be a 3rd party implementation of helper scripts, as thats not normal execution. I would ask the creator of that modification as that isn't an Apktool bug.
[Android Software Development] mikemol:
I have it setup in the CLASSPATH as c:\windows\aapt.exe

as well as in PATH as c:\windows

I still get that error when trying to compile it.

---------- Post added at 07:23 PM ---------- Previous post was at 07:17 PM ----------

I first found one APKTool (no idea whose it was) then I saw a YouTube video on how to edit apk files using APKTool and there was a link there that took me to http://code.google.com/p/android-apktool/ to download the latest version from there which was 1.4.3 and then I found this thread on XDA and I downloaded version 1.5.0 jar file and aapt.exe from the first post. I replaced the old ones that I had with the new ones and I put them both in C:\APKTool and also in C:\Windows (as the old 1.4.3 version had instructions to unpack them into Windows directory).

If the APKTool that I get to run is not yours how can I get yours to run? I did replace them when coping yours into both of the places where I have them. The only file that I have left from the other versions is APKTool.bat as I didn't find it here. I tried running without it and in CMD apktool is not recognized as a valid command.

I have just found what the problem was - I disabled my antivirus (Sophos) and had no problems with recompiling the file.
[Android Software Development] iBotPeaches:
I can't find these errors anywhere in the code.

Unable to add 'C:\APKTool\rcs\build\apk\classes.dex': Zip add failed
ERROR: unable to process assets while packaging 'C:\APKTool\rcs\dist\rcs.apk'
ERROR: packaging of 'C:\APKTool\rcs\dist\rcs.apk' failed

Unless aapt through those, which is entirely possible, then its not apktool. Something 3rd party is interfering.
[Android Software Development] neectron:
@iBotPeaches:Is it possible to compile resources.arsc without any compression?
[Android Software Development] varun.chitre15:
resources.arsc is already compiled without compression

It is packed in apk with compression by Multi-tools which is incorrect.
[Android Software Development] neectron:
I am using apktool 1.5,before compilation resources.arsc was 7.29MB,but after compilation 6.93MB.
[Android Software Development] varun.chitre15:
This is the size when u took out resources.arsc from apk?

Weird!
[Android Software Development] bgcngm:
You need to manually add resources.arsc into the original .apk with store compression method. ;)
[Android Software Development] neectron:
When I took it from framework-res.apk,it was 7.29MB.

Then I decompiled framwork-res.apk,compiled it back,size was 6.93 MB.

I can do that but I want to know why compiled resources.arsc is causing bootloops.

This from my previous post:

I am using apktool 1.5
This what I have done,
[LIST]
[*]Decompiled the framework-res.apk without any errors.Didn't change anything.
[*]Compiled the framework-res.apk without any errors.
[*]Copied resources.arsc from unsignedframework-res.apk to original framework-res.apk.
[*]Installed original framework-res.apk using flashable.zip with correct permissions.
[*]It is causing bootloops.So there must be something wrong with compiled resources.arsc.?
[/LIST]
[Android Software Development] bgcngm:
In this process, have you placed the new resources.arsc onto the original framework-res.apk using store compression method?
[Android Software Development] neectron:
Yes.

Even copied from build folder to original framework-res.apk but still bootloops.
[Android Software Development] bgcngm:
What is the archiver that you're using to add the files onto the .apk? I advise you to use 7-zip.
[Android Software Development] CosmicDan:
Yep. And never do higher than "Normal" compression ( -mx5). Anything higher can cause PackageManager to time-out on parsing the XML.
[Android Software Development] neectron:
I tried it with 7zip,still same.
[Android Software Development] iBotPeaches:
Then you did it wrong.

7za u -r -tzip -mx0
[Android Software Development] Nucleotide:
Whenever I try and use this tool, I get the following:

C:\Android\apktool>apktool if framework-res.apk
I: Framework installed to: C:\Users\Ray\apktool\framework\1.apk

C:\Android\apktool>apktool d Mms.apk
I: Baksmaling...
Exception in thread "main" java.lang.RuntimeException: bad magic value: 64 65 78 0a 30 33 36 00
at org.jf.dexlib.DexFile.<init>(DexFile.java:377)
at org.jf.dexlib.DexFile.<init>(DexFile.java:274)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:44)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:33)
at brut.androlib.Androlib.decodeSourcesSmali(Androlib.java:68)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:85)
at brut.apktool.Main.cmdDecode(Main.java:128)
at brut.apktool.Main.main(Main.java:65)

C:\Android\apktool>

Would anyone be able to help me out? Even just point me in the right direction for a solution. I can't find much on it.

Thank you.
[Android Software Development] gcrutchr:
It looks like you are using a pre-ICS apktool.jar on an ICS apk.

Older versions of apktool.jar will not work with some ICS files.

Try using apktool150.jar - it should work okay. Make sure you also download the associated aapt.exe file.
[Android Software Development] Nucleotide:
You are a life saver. I can't beleive that's all it was. I've been stuffing around with it on and off for days and was about to give up.

Thank you! :good:
[Android Software Development] jucachaves:
I am using latest apktool 1.5.0 and having this erros:

D:\Downloads\APKTOOL>apktool b SemcPhone unchanged/SemcPhone.apk
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
D:\Downloads\APKTOOL\SemcPhone\res\values-pt-rPT\strings.xml:483: error: Multipl
e substitutions specified in non-positional format; did you mean to add the form
atted="false" attribute?
D:\Downloads\APKTOOL\SemcPhone\res\values-pt-rPT\strings.xml:484: error: Unexpec
ted end tag string
D:\Downloads\APKTOOL\SemcPhone\res\values\styles.xml:12: error: Error retrieving
parent for item: No resource found that matches the given name '@*android:style
/Theme.NoDisplay'.
D:\Downloads\APKTOOL\SemcPhone\res\values\styles.xml:47: error: Error retrieving
parent for item: No resource found that matches the given name '@*android:style
/TextAppearance'.
D:\Downloads\APKTOOL\SemcPhone\res\values\styles.xml:52: error: Error retrieving
parent for item: No resource found that matches the given name '@*android:style
/Widget.Button'.
D:\Downloads\APKTOOL\SemcPhone\res\values\styles.xml:61: error: Error retrieving
parent for item: No resource found that matches the given name '@*android:style
/TextAppearance.Widget.Button'.
D:\Downloads\APKTOOL\SemcPhone\res\values\styles.xml:65: error: Error retrieving
parent for item: No resource found that matches the given name '@*android:style
/TextAppearance.Widget.Button'.
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, --min-sdk-version, 15, --target-sdk-ver
sion, 15, -F, C:\Users\thiago\AppData\Local\Temp\APKTOOL2521612828940978713.tmp,
-I, D:\apktool\framework\1-nozomi.apk, -I, D:\apktool\framework\2-nozomi.apk, -
S, D:\Downloads\APKTOOL\SemcPhone\res, -M, D:\Downloads\APKTOOL\SemcPhone\Androi
dManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:255)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:324)
at brut.androlib.Androlib.buildResources(Androlib.java:269)
at brut.androlib.Androlib.build(Androlib.java:192)
at brut.androlib.Androlib.build(Androlib.java:174)
at brut.apktool.Main.cmdBuild(Main.java:188)
at brut.apktool.Main.main(Main.java:70)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sd
k-version, 15, --target-sdk-version, 15, -F, C:\Users\thiago\AppData\Local\Temp\
APKTOOL2521612828940978713.tmp, -I, D:\apktool\framework\1-nozomi.apk, -I, D:\ap
ktool\framework\2-nozomi.apk, -S, D:\Downloads\APKTOOL\SemcPhone\res, -M, D:\Dow
nloads\APKTOOL\SemcPhone\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:253)
... 6 more

D:\Downloads\APKTOOL>

What is wrong??