yashsingh1/xdaforums huggingface dataset:
[Android Software Development] fabrim:
Great tool, Thanks.
[Android Software Development] niaboc79:
We can build without public.xml?

I'm trying to add some things in my systemUI who are in an other one. I've manually modified public.xml

If I delete public.xml it will be recreated during the building and it will add for example new images or strings?

Envoyé depuis mon LT26i avec Tapatalk
[Android Software Development] westcrip:
guys any solution about this issue ?

[*] D:\AutoAPKTool2.0.4\_INPUT_APK\Mms.apk
decompiling D:\AutoAPKTool2.0.4\_INPUT_APK\Mms.apk...
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\altan\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
W: Could not decode attr value, using undecoded value instead: ns=android, name=widgetCategory, value=0x00000003
I: Decoding values */* XMLs...
I: Done.
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec: 0x010103c4
at brut.androlib.res.data.ResPackage.getResSpec(ResPackage.java:61)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:57)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:53)
at brut.androlib.res.decoder.ResAttrDecoder.decode(ResAttrDecoder.java:35)
at brut.androlib.res.decoder.AXmlResourceParser.getAttributeValue(AXmlResourceParser.java:313)
at org.xmlpull.v1.wrapper.classic.XmlPullParserDelegate.getAttributeValue(XmlPullParserDelegate.java:69)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.writeStartTag(StaticXmlSerializerWrapper.java:267)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.event(StaticXmlSerializerWrapper.java:211)
at brut.androlib.res.decoder.XmlPullStreamDecoder$1.event(XmlPullStreamDecoder.java:69)
at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(XmlPullStreamDecoder.java:103)
at brut.androlib.res.decoder.ResStreamDecoderContainer.decode(ResStreamDecoderContainer.java:34)
at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:102)
at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:86)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:169)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:119)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:99)
at brut.apktool.Main.cmdDecode(Main.java:135)
at brut.apktool.Main.main(Main.java:70)
[Android Software Development] ÜBER™:
For theme chooser only. When you decompile and apk you always delete that as it gets rebuilt as you compile. If you ever get public errors look at em. I get it sometimes compiling framework and it errors on one line. Delete that line and its all good. Just be mindful. :cool:

Sent from my Sprint Galaxy Nexus
[Android Software Development] niaboc79:
Is there rules when you must add lines in public.xml?

I know that 2 things cannot use the same id but how to add and be certain to choose the correct new id.

Envoyé depuis mon LT26i avec Tapatalk
[Android Software Development] ---blacksoul---:
Ok guys after two months I realized that the error was mine! In fact decompiling and recompiling the original apk (do not know why he first had given me the error and then not) I had no problems, but now another problem arises: where did I go wrong? the only folder that I have changed (almost entirely) is the Res folder inside of the application Settings.apk of CyanogenMod 7 for the HTC TATTOO, but looking at the inside of it I have not found errors, so I decided to post the folder so that some good, very kind and willing user help me to find or may find the error, place also the error that gives me the compiler when I try to compile the apk

Thank you all for the help ---blacksoul---

java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) Client VM (build 23.5-b02, mixed mode, sharing)
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: C:\Users\Utente\Desktop\Programmazione\Capas-pr
oject ROM\Programmi\ApkMultiTools-APK-Multi-Tool-012bda1\other\..\projects\Setti
ngs.apk\res/xml-zh-TW
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, --min-sdk-version, 10, --target-sdk-ver
sion, 10, -F, C:\Users\Utente\AppData\Local\Temp\APKTOOL6511415439066917221.tmp,
-I, C:\Users\Utente\apktool\framework\1.apk, -S, C:\Users\Utente\Desktop\Progra
mmazione\Capas-project ROM\Programmi\ApkMultiTools-APK-Multi-Tool-012bda1\other\
..\projects\Settings.apk\res, -M, C:\Users\Utente\Desktop\Programmazione\Capas-p
roject ROM\Programmi\ApkMultiTools-APK-Multi-Tool-012bda1\other\..\projects\Sett
ings.apk\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, 10, --target-sdk-version, 10, -F, C:\Users\Utente\AppData\Local\Temp\
APKTOOL6511415439066917221.tmp, -I, C:\Users\Utente\apktool\framework\1.apk, -S,
C:\Users\Utente\Desktop\Programmazione\Capas-project ROM\Programmi\ApkMultiTool
s-APK-Multi-Tool-012bda1\other\..\projects\Settings.apk\res, -M, C:\Users\Utente
\Desktop\Programmazione\Capas-project ROM\Programmi\ApkMultiTools-APK-Multi-Tool
-012bda1\other\..\projects\Settings.apk\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:253)
... 6 more
[Android Software Development] car vs driver:
When you build you do not put the .a pk extension on the source directory argument.

Assuming Settings is you source directory, do this ...

C:\Users\Utente\Desktop\Programmazione\Capas-project ROM\Programmi\ApkMultiTools-APK-Multi-Tool-012bda1\place-apk-here-for-modding>apktool b Settings almostdone.apk
[Android Software Development] ---blacksoul---:
It gives me error, however, this

C:\Users\Utente\Desktop\Programmazione\Capas-project ROM\Programmi\ApkMultiTools
-APK-Multi-Tool-012bda1\place-apk-here-for-modding>apktool b Settings almostdone
.apk
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: C:\Users\Utente\Desktop\Programmazione\Capas-pr
oject ROM\Programmi\ApkMultiTools-APK-Multi-Tool-012bda1\place-apk-here-for-modd
ing\Settings\res/xml-zh-TW
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, --min-sdk-version, 10, --target-sdk-ver
sion, 10, -F, C:\Users\Utente\AppData\Local\Temp\APKTOOL5063198269180988503.tmp,
-I, C:\Users\Utente\apktool\framework\1.apk, -S, C:\Users\Utente\Desktop\Progra
mmazione\Capas-project ROM\Programmi\ApkMultiTools-APK-Multi-Tool-012bda1\place-
apk-here-for-modding\Settings\res, -M, C:\Users\Utente\Desktop\Programmazione\Ca
pas-project ROM\Programmi\ApkMultiTools-APK-Multi-Tool-012bda1\place-apk-here-fo
r-modding\Settings\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, 10, --target-sdk-version, 10, -F, C:\Users\Utente\AppData\Local\Temp\
APKTOOL5063198269180988503.tmp, -I, C:\Users\Utente\apktool\framework\1.apk, -S,
C:\Users\Utente\Desktop\Programmazione\Capas-project ROM\Programmi\ApkMultiTool
s-APK-Multi-Tool-012bda1\place-apk-here-for-modding\Settings\res, -M, C:\Users\U
tente\Desktop\Programmazione\Capas-project ROM\Programmi\ApkMultiTools-APK-Multi
-Tool-012bda1\place-apk-here-for-modding\Settings\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:253)
... 6 more

However, the error is in the folder that I edited, if someone wants to help me find it,in my previous post I posted the folder that I changed and all the details, if someone wants to help me I would be eternally grateful because I think alone I would put a lot of time to find the error
[Android Software Development] ferreinf:
Hy guys, could anyone tell me wich file should I edit to change the color on a rom, example on Android 4.xx we have blue, i would like to change the blue to red, green, etc...

Thanks

Sent from my GT-I9300
[Android Software Development] CosmicDan:
This is not a discussion/tutorial on how to theme the Android framework.
[Android Software Development] 1982Strand:
I saw it mentioned that a possible feature for apktool 1.5.1 would be to inject resources.arsc back into the apks automatically.

So, i wanted to ask, what is the pros and cons of doing this, instead of injecting the original androidmanifest and meta-inf folder into the dist apk generated by apktool? :)
[Android Software Development] iBotPeaches:
Its been removed (that feature) until I find a new library or make one myself. I was using Zip4j by Lingala and I couldn't fix one problem that was duplicating every resource inside the APK.

As seen here: http://www.lingala.net/zip4j/forum/index.php?topic=301.0 we tried to figure it out and never did. I've redone the code a few times and still no avail.
[Android Software Development] 1982Strand:
Oh i see.. Tough one :)

But are there any difference between copying the res folder, resources.arsc, classes.dex from the dist apk into the original apk and then copying androidmanifest and meta-inf folder from the original apk and into the dist apk?
[Android Software Development] iBotPeaches:
@Febby

That directory structure is messed up. Look at the folder its complaining about. w400dp is correct, but it has a switch of slashes mid directory. So something is up with that struct. That would be the updated application fault as Apktool wouldn't mess that struct up.
[Android Software Development] zelendel:
This is also a known issue on some apk. The developer makes it so that it can not be decompiled and then compiled and made to work. Handcent is the same way except after fixing it the app will FC and when asked about it the Dev said it was supposed to work that way so no one could mess with it.
[Android Software Development] CosmicDan:
Which is very fair enough. It's technically illegal in most countries to use APKTool on anything other than e.g. AOSP APK's (I think?) and MIUI.
[Android Software Development] evilbarcode:
What is needed to run apktool.jar, I've got the java sdk, jdk and all of the above installed and updated. I've installed and updated the android sdk and updated the tools and platform tools. Yet when i try to open apktool, nothing happens, it kind of loads (light flashing) then nothing. What am I doing wrong?

Cheers for the help,

Evil.
[Android Software Development] bgcngm:
You can't simply open apktool.jar. The tool must be run trough a command line interface, i.e:

java -jar apktool.jar
[Android Software Development] Ticklefish:
Can you run any of the tools that run apktool?
[Android Software Development] evilbarcode:
Oh right ok now I just need a list of the commands haha sorry about that guys. Should have done some more research. I just assumed it had an interface.

Yes I was able to use x10modtool to decompile my androidpolicies.jar, but then when I tried to decompile my framework-res.apk it froze, or it just took a long time not really sure but I just assumed it wasn't working, so I force closed it. How long should it take to decompile a framework-res.apk. Not long I'm guessing?

Cheers for the help,

Evil.
[Android Software Development] BurgerZ:
Hi, iBotPeaches.

I have tested 1.4.8 and found a bug with framework-res (MIUI ICS ROMs).

in decompiled framework-res.apk in res/values/plurals.xml we have:

1. if it was an odexed ROM such as Galaxy Nexus - apktool just fixes <item quantity="other">%d of %d</item> to be <item quantity="other">%1$d of %2$d</item>

2. if you decompile apk from deodexed ROM (originally deodexed) such as Sensation (SGS2 etc.) - apktool makes fixes again but there is no need to fix (plurals are good in these ROMs). And we have <item quantity="other">%1$1$d of %2$2$d</item> instead of <item quantity="other">%1$d of %2$d</item>

----

May be you need to fix public String encodeAsResXmlValueExt() in brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/value/ResScalarValue.java
[Android Software Development] spartanier7:
Hey.. i followed this guide to decompile and recompile an apk..

I wanted to decompile a Settings.apk..

Decompiling worked well. Then i changed something in the Settings-headers.xml and tried to recompile.

Then i got this error.

Any solutions? I also tried to not change anything.. still I get the error at recompiling..

I´ll post the Settings.apk and maybe you can try yourself if it works.. would be nice if someone could help me :P

Heres Settings.apk
[Android Software Development] djdarkknight96:
Looks like your working with an old framework. Get an ICS or jellybean framework-res.apk and in command type " apktool if framework-res.apk" press enter. It should compile then.

DarkJelly Gnex on JellyBean sent this using the app
[Android Software Development] spartanier7:
I did that with the framework-res.apk that was provided in the same ROM that i pulled the Settings.apk out..

Still get the Error.
[Android Software Development] djdarkknight96:
The log is saying your framework doesn't have the resources for those folders. I would still get another framework from a new version if Android that the framework supports those resolutions and install it instead.

DarkJelly Gnex on JellyBean sent this using the app
[Android Software Development] EvanVanVan:
Hey iBotPeaches,

You probably haven't had a chance to look at it yet but I just noticed, SmaliDebugging -d worked with apktool 1.4.1 and stopped working in 1.4.2. Just thought I'd point that out, not sure if it has anything to do with Apktool being updated to API 14 or not.

Thanks
[Android Software Development] 1brainsurgeon:
I have updated java jdk which includes jre. When I open script the cmd window pops up as it should but says "Java was not found, you will not be able to sign apks or use apktool. Any help would be appreciated. TIA
[Android Software Development] magemastrix:
Help please
[Android Software Development] raziel23x:
Huh? What are you referring to
[Android Software Development] 1brainsurgeon:
I guess I need someone to help me with the proper directory. Can't find a good tutorial for path.

Edit: I am trying to figure out the proper directory for apk manager, and am posting in apk tools thread. My apologies :(

Sent from my SPH-L710 using Xparent ICS Tapatalk 2
[Android Software Development] iBotPeaches:
Run this command on the framework-miui-res.apk file.

aapt d resources framework-miui-res.apk | grep '02060008'

Change the 2nd number which is a 2, one by one all the way to 6. Until you get an output. Then post it here.
[Android Software Development] magemastrix:
Original, working framework-miui-res.apk

computer@computer-PC /cygdrive/c/Miuius/rom/system/framework
$ aapt d resources framework-miui-res.apk | grep 0x06060008
spec resource 0x06060008 miui:array/android_config_longPressVibePattern: flags=0x40000000
resource 0x06060008 miui:array/android_config_longPressVibePattern: t=0x01 d=0x01070020 (s=0x0008 r=0x00) (PUBLIC)

Without Micode/patchrom res framework's files

$ aapt d resources framework-miui-res.apk | grep 0x06060008 spec resource 0x06060008 miui:array/android_config_longPressVibePattern: flags=0x40000000
resource 0x06060008 miui:array/android_config_longPressVibePattern: <bag> (PUBLIC)

With

$ aapt d resources framework-miui-res.apk | grep 0x06060008
spec resource 0x06060008 miui:array/android_config_longPressVibePattern: flags=0x40000000
resource 0x06060008 miui:array/android_config_longPressVibePattern: <bag> (PUBLIC)
[Android Software Development] iBotPeaches:
Note about the dummy frameworks. You gotta install them first. So IF all those frameworks. apktool if 1.apk, etc. Then IF ANY framework in that ROM's system/framework folder.

Decompile the framework-miui-res.apk, before you rebuild it. The apktool.yml file should have 1 and 6 as the IDs for the framework. Add 2,3,4 and 5. So it becomes.

- 1

- 2

- 3

- 4

- 5

- 6

Try and trigger a rebuild of that APK. If it works, then re-run the above post command on that framework-miui-res.apk. If it doesn't work. Pastebin the error.
[Android Software Development] magemastrix:
The output with framework was already with - 1 to - 5 on apktool.yml and 1 to 6 installed before decompiling, if I add - 6 I got a lot of this errors

C:\Miuius\output\framework-miui-res\res\values\attrs.xml:3: error: Attribute "sy mmetry" has already been defined
C:\Miuius\output\framework-miui-res\res\values\attrs.xml:4: error: Attribute "sl iding_dot_bar" has already been defined
C:\Miuius\output\framework-miui-res\res\values\attrs.xml:5: error: Attribute "sl iding_shadow_dot_bar" has already been defined
C:\Miuius\output\framework-miui-res\res\values\attrs.xml:6: error: Attribute "sl iding_panel" has already been defined
C:\Miuius\output\framework-miui-res\res\values\attrs.xml:7: error: Attribute "al pha_width" has already been defined
[Android Software Development] jozka.1:
Hi,

I have a problem with compile source :(

I can decompile apk when I remove classes.dex, but I can't compile it.

Log:

I: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\jozka1\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\jozka1\AppData\Local\Temp\APKTOOL1099734901805447217.tmp, -I, C:\Users\jozka1\apktool\framework\1.apk, -S, C:\Users\jozka1\Desktop\rom\other\..\projects\SystemUI.apk\res, -M, C:\Users\jozka1\Desktop\rom\other\..\projects\SystemUI.apk\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\jozka1\AppData\Local\Temp\APKTOOL1099734901805447217.tmp, -I, C:\Users\jozka1\apktool\framework\1.apk, -S, C:\Users\jozka1\Desktop\rom\other\..\projects\SystemUI.apk\res, -M, C:\Users\jozka1\Desktop\rom\other\..\projects\SystemUI.apk\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
... 6 more

I use last aapt and apktool.

The APK is SystemUI from ICS 4.0.3.

Please someone any help?

SystemUI.apk > http://dl.xda-developers.com/attach...0c30bfc33/4fed8792/1/1/6/2/8/7/4/SystemUI.apk

framework > http://www.ulozto.net/x8j9CHE/framework-res-apk
[Android Software Development] iBotPeaches:
You can't just remove the classes.dex and rebuild it. That is not even an APK then. Its missing the java part. If you don't want the classes dex, decompile just resources, and then recompile. Don't touch the classes.dex. It will simply be re-packaged into APK, unmodified (with the exception of whatever resource changes you made)
[Android Software Development] zelendel:
The only ones that are perfectly ok are AOSP based apps. MIUI doesnt fall into that section. They fall with TW and Sense as they are closed sourced.
[Android Software Development] CosmicDan:
Well, they don't mind it. Many users (e.g. Paranoid ROM) have hacked MIUI packages (e.g. LBESEC) to work on non MIUI ROM's, and Xiaomi tweeted it lol. But yes, definitely true about proprietary/vendor APK's, and 90% of apps on the Play Store.
[Android Software Development] Febby:
Thanks for that answer. :) I wonder why protect such free app ha. I was noticing the structure is really messed up. If not to burden, how was the structure fixed on handcent? I use an application you may have heard of or not heard of named lucky patcher to change/remove permissions on the application safely (Which I asumme decompiles the app in a way to edit it). It is successful doing so. Hmmm.
[Android Software Development] zelendel:
Well I truly hope they wouldnt mind seeing as all their coding was taken from CM (main reason they are not respected here) but that is a whole other subject..
[Android Software Development] zelendel:
Yeah I have heard of lucky patcher but wont use it. I had to fix some of the same issues you had with \\ instead of //
[Android Software Development] Febby:
I know it is off topic to ask, but can you point me in the direction towards fixing the structure? Unless it is something again't the rules please don't. :)

I'm looking forward edit the manifest to enabling rotation on the game for my tablet as the developers of this application are really stupid at times and disabled it for no reason.
[Android Software Development] CosmicDan:
Yeah, GB ROM's were CM based. MIUI4 are based on stock ROM's though. But yeah, it sucks that they don't release sourcecode (they do for some apps but not the best parts e.g. core).

Anywho, I digress. As you were.
[Android Software Development] zelendel:
.3.

invalid resource directory name: C:\Users\iFebby\Desktop\apktool\com.papaya.papa yafarm2012-1\res/layout-w600dp

Should look like

invalid resource directory name: C:\Users\iFebby\Desktop\apktool\com.papaya.papa yafarm2012-1\res\layout-w600dp

Handcent was all done in the xmls. Not sure how to get this one to work out. I also dont use the stand alone apktool. I have a custom version of multitool so I dont have to worry about coping the files back to the new apk folder.
[Android Software Development] Febby:
Yeah I noticed that. What xml would typically hold the structure path? I recreated each folder freshly. Most of values and strings file that I see on the decompiled files appear to be XML files. Shall be last question I ask here btw! I don't want to come off all nooby, although I am learning as i progress ha.

Edit: NVM, I think I found the xmls to start editing . :)
[Android Software Development] CosmicDan:
Could you not simply delete the troublesome resources, then recompile (assuming you are only editing resources that can be recompiled), and after the recompilation, add the encrypted/compiled XML's back in? If not (if they are part of arsc), you could simply remove them or dummy them.

Actually, I don't know why you are getting this "unknown resource" error on layout-w600dp, that's a standard resource folder for tablets. And I can recompile them fine. Are you sure you have the latest AAPT binary?
[Android Software Development] Febby:
Yeah I'm using the latest 1.5.0 jar and latest aapt from the OP along with the latest platform tools. I deleted the folder but then I started getting errors on many other files such as below

C:\Users\iFebby\Desktop\apktool - Copy\papaya\res\drawable\tapjoy_buttonstates.xml:4: error: Error: No resource found that matches the given
name (at 'drawable' with value '@drawable/tapjoy_buttonselected').

It seems it is all thoroughly protected I assume as others said before. Unless I'm doing something wrong :P