[Q] Apktool v1.4.2.269870b "Multiple resources" issue - General Questions and Answers

Hi,
I'm using Apktool v1.4.2.269870b (I'd build it from git source of apktool) to decode gmail.apk of honeycomb, I'm facing the below error
I: Copying raw classes.dex file...
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources:
spec=0x7f0c0036 dimen/account_width, config=-port-v13
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:65)
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:58)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:196)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:165)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:130)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:105)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:82)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:48)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:315)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:50)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:43)
at brut.androlib.Androlib.getResTable(Androlib.java:44)
at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:148)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
at brut.apktool.Main.cmdDecode(Main.java:120)
at brut.apktool.Main.main(Main.java:57)
before posting here I'd searched similar issue, found very similar issue
code.google.com/p/android-apktool/issues/detail?id=148
which is fixed with github.com/fboldog/brut.apktool/commit/1b6d63cb355d4a36274f5edf0383a2c4e6e0f868,
however apktool version I'm using has this fix and doesn't fix my issue,
also, I'd installed framework-res.apk of honeycombs, this also didn't help me.
Could you please help me , please let me know if you need my .apk file.
Thanks,
Ponnada.

Related

[Q] .smali conversion

k after googling a lot i came to apktool for decoding i used sucessful able to get resource files and hell getting .smali file any way around to get .java file from .smali file. i just searched the forum still not sure possible or not

[Q] droid x pulldown text color

Hi,
I have a Droid X and have been trying to change the text color on the pulldown statusbar without any luck so far.
When I open status_bar_latest_event_content.xml in a hex editor, it does not have 08 00 00 1C.
I also tried to decompile and build after editing using apktool but the framework-res.apk fails build and errors out:
Code:
.....
.....
.....
C:\pulldown-text\framework-decoded\res\values\public.xml:3590: error: Public symbol drawable/zz_stat_sys_r_signal_5 declared here is not defined.
C:\pulldown-text\framework-decoded\res\values\public.xml:3591: error: Public symbol drawable/zz_stat_sys_signal_5 declared here is not defined.
C:\pulldown-text\framework-decoded\res\values\public.xml:3592: error: Public symbol drawable/zz_stat_sys_signal_5_cdma declared here is not defined.
C:\pulldown-text\framework-decoded\res\values\public.xml:3593: error: Public symbol drawable/zz_vzw_stat_sys_roaming_cdma_custom3 declared here is not defined.
C:\pulldown-text\framework-decoded\res\values\public.xml:2834: error: Public symbol drawable/zz_vzw_stat_sys_roaming_cdma_custom3_flash declared here is not defined.
C:\pulldown-text\framework-decoded\res\values\public.xml:3594: error: Public symbol drawable/zz_vzw_stat_sys_roaming_cdma_flash_custom3_anim1 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\Work\LOCALS~1\Temp\APKTOOL7897394753294370357.tmp, -x, -S, C:\pulldown-text\framework-decoded\res, -M, C:\pulldown-text\framework-decoded\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\Work\LOCALS~1\Temp\APKTOOL7897394753294370357.tmp, -x, -S, C:\pulldown-text\framework-decoded\res, -M, C:\pulldown-text\framework-decoded\AndroidManifest.xml]
at brut.util.OS.exec(Unknown Source)
... 7 more
I cannot find out how to change this, can someone please advise.
If you attach your framework-res.apk and let me know what color you would like, I can re-do it for you! I have this problem on my desktop (64bit running windows 7).
But on a 32 bit laptop I have no issues.. Haven't been able to figure out the difference...
I have 32-bit too
Hi SysAdmin-X,
I am trying to do it on a windows XP 32bit OS.
Here is my framework-res.apk anyway.
I am trying to edit: /res/layout/status_bar_latest_event_content.xml
The line:
@color/primary_text_light
to
@color/primary_text_dark
Thanks!!!
dgware said:
Hi SysAdmin-X,
I am trying to do it on a windows XP 32bit OS.
Here is my framework-res.apk anyway.
I am trying to edit: /res/layout/status_bar_latest_event_content.xml
The line:
@color/primary_text_light
to
@color/primary_text_dark
Thanks!!!
Click to expand...
Click to collapse
Here you are!
Hope this works! you know how to put the framework back onto your phone?
Thanks!!!
I'd really like to learn how you did it though. Can you please share?
Please share your environment setup for doing this. I've spent the last 2 days trying to figure it out!
Yes, I know how to put it back.
With this, I'm just doing to pull the status_bar_latest_event_content.xml out and put it in an original framework-res.apk just in case something got changed accidentally.
dgware said:
Thanks!!!
I'd really like to learn how you did it though. Can you please share?
Please share your environment setup for doing this. I've spent the last 2 days trying to figure it out!
Yes, I know how to put it back.
With this, I'm just doing to pull the status_bar_latest_event_content.xml out and put it in an original framework-res.apk just in case something got changed accidentally.
Click to expand...
Click to collapse
No problem. I'm not quite sure what you may have done wrong, as I can't get this to work on my 64bit desktop... =(
Anyhow... I have a 32bit laptop running windows 7 ultimate. From there, I downloaded apktool and put the two necessary files for the windows version in C:\Windows.
Then from there, all I do is use the following setup
1) Take the .apk file and create a folder structure such as the following:
C:\frame_build
create 5 folders inside there: decoded, encoded, signed, 9png, and extract.
2) copy the .apk to the C:\frame_build directory
3) Type the following command in a command prompt:
apktool d -f C:\frame_build\framework-res.apk C:\frame_build\decoded\
4) watch for it to say something similiar to "can't find 9patch chunk in file. This is because it does not correctly parse the .9.png files. You will need to find those files in the directory it specifies (in this instance /drawable-hdpi) and cut and paste them in the 9png folder. (you don't have to do it this exact way...this is just my method for simplicity sake)
5) Then you should have a decompile apk in the decoded file. Make your edits to any images/xml files you need.
6) From the command prompt type the following:
apktool b C:\frame_build\decoded C:\frame_build\encoded\framework-res.apk
7) You should now have a compiled apk in the encoded folder.
8) Copy the ORIGINAL .apk file into the extract folder and then use 7zip (or any extraction tool) to unzip the file.
9) Using 7zip, open up the .apk file in the encoded folder.
10) Copy the androidmanifest file and the META-INF folder from the extracted ORIGINAL framework-res.apk and drag it into the open 7zip window. Say yes to any message.
11) Drag the contents of the 9png folder into the open 7zip window under /res/drawable-hdpi or wherever you originally had to pull them from. Say yes to any message.
12) Close 7zip and the .apk in the encoded file is good to go!
This is what I have been doing. I do notice a significant size decrease in recompiled files... For instance, your original was 3.3 mb and the new one is only 2.4
Great, thanks for the prompt replies. I'm doing almost the same thing but still get the errors on XP.
I'm going to try to exactly copy your method and see how that goes. Now I need to find a computer with win7.
I just don't want to have to seek out your help every time I wan to make a change.
Your assistance in this was much appreciated SysAdmin-X
dgware said:
Great, thanks for the prompt replies. I'm doing almost the same thing but still get the errors on XP.
I'm going to try to exactly copy your method and see how that goes. Now I need to find a computer with win7.
I just don't want to have to seek out your help every time I wan to make a change.
Your assistance in this was much appreciated SysAdmin-X
Click to expand...
Click to collapse
No problem at all! If you have more questions, feel free to ask! I'm glad I'm able to help! That's what makes the xda forums great! People have helped me, and I'm more than willing to help others out in return!
If you need more edits, let me know. I can help you out for right now until you get a working environment.
Even better!!!! I found a new tool that may work for you!
http://forum.xda-developers.com/showthread.php?p=10129091#post10129091
I just found this online trying to help figure out a solution to our build environment woes =/
I tested it (sorta) on my framework, and it seems to work really well. You just download the file, extract it, and it runs as an executable. Then you pick your .apk file and you can easily replace images and edit xml files under the content tab of the application!
I'm not sure about re-packaging the apk... but if you can use this, it looks like it decompiles for you... Then you could just double click on the "res" folder under the content portion of the app. It should open a file explorer window to a /temp location with the decompiled apk. Copy all the decompile files/folders to a new directory...Then try recompiling the apk..
Not sure if this will work yet tho... I'm gonna give it a try myself =)
EDIT: Just tried this!!! Super stoked on this tool! I used it to decompile my framework-res.apk...Messed with some xml files...Then opened the temp location....Copied all the files/folders, and then recompiled the apk using apktool from the command line... IT works!!!
Very helpful been looking for this for a long time!
I will try it out.
I don't have any problem decompiling, it's just the recompiling that isn't working for me.
Just created a new windows 7 32 bit environment and tried it again and worked just fine. I can finally re-encode the apks. I'm really just doing it to go from axml to xml and then back to axml after edits.
Just wondering, but is there a way to do this on eclipse?

Problems editing cyanogenmod 7 framework-res.apk

I've searched the forum and found other ppl having problems editing this apk, but I've found no solutions...
Here is my problem: I'm trying to edit a framework-res.apk from a cyanogenmod 7 build for the huawei u8500, more precisely some xmls
I've tried with several methods, including:
1 decompile-edit-recompile-sign -> bootloop
2 decompile-edit-open with 7zip/winrar-merge files -> bootloop
I've tried this at first boot and also after the first, the result it's always the same, bootloop
I'm not doing big changes to xmls, just some height adjustment...
I've heard that in gingerbread I also need to modify systemUI.apk also, is this correct? If so, why apk manager is giving me error while decompiling it?
all the tries were done using apk manager 4.9 and with no errors in log except from when decompiling systemUI...
HELP T_T
No one will help us
C'mon Guys any Tip ?
Thank in Advance!!
how are you pushing the edited files?
I know that the one safe way is via an update.zip , try that.
TuoNonno said:
I've searched the forum and found other ppl having problems editing this apk, but I've found no solutions...
Here is my problem: I'm trying to edit a framework-res.apk from a cyanogenmod 7 build for the huawei u8500, more precisely some xmls
I've tried with several methods, including:
1 decompile-edit-recompile-sign -> bootloop
2 decompile-edit-open with 7zip/winrar-merge files -> bootloop
I've tried this at first boot and also after the first, the result it's always the same, bootloop
I'm not doing big changes to xmls, just some height adjustment...
I've heard that in gingerbread I also need to modify systemUI.apk also, is this correct? If so, why apk manager is giving me error while decompiling it?
all the tries were done using apk manager 4.9 and with no errors in log except from when decompiling systemUI...
HELP T_T
Click to expand...
Click to collapse
can you give more info?
i mean, are you have any error on compiling the framework?
can you post the log file of apk manager?
TuoNonno said:
I've searched the forum and found other ppl having problems editing this apk, but I've found no solutions...
Here is my problem: I'm trying to edit a framework-res.apk from a cyanogenmod 7 build for the huawei u8500, more precisely some xmls
I've tried with several methods, including:
1 decompile-edit-recompile-sign -> bootloop
2 decompile-edit-open with 7zip/winrar-merge files -> bootloop
I've tried this at first boot and also after the first, the result it's always the same, bootloop
I'm not doing big changes to xmls, just some height adjustment...
I've heard that in gingerbread I also need to modify systemUI.apk also, is this correct? If so, why apk manager is giving me error while decompiling it?
all the tries were done using apk manager 4.9 and with no errors in log except from when decompiling systemUI...
HELP T_T
Click to expand...
Click to collapse
I have run into some issues with framework-res.apks, the issue ended up being corrupt images, the dot 9 files. I replaced them with clean images and overwrote them after compile using 7-zip. Hope this helps a little.
Sent from my Inspire 4G using XDA Premium App.
britoso said:
how are you pushing the edited files?
I know that the one safe way is via an update.zip , try that.
Click to expand...
Click to collapse
I tried both with an update.zip and also changing it on the original rom...
tj_style said:
can you give more info?
i mean, are you have any error on compiling the framework?
can you post the log file of apk manager?
Click to expand...
Click to collapse
No errors...
Code:
java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)
"adb" non Š riconosciuto come comando interno o esterno,
un programma eseguibile o un file batch.
Impossibile trovare C:\Users\Nonno\Desktop\New8300\apk_manager_4.9\place-apk-here-for-modding\../place-apk-here-for-modding/signedframework-res.apk
Impossibile trovare C:\Users\Nonno\Desktop\New8300\apk_manager_4.9\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedframework-res.apk
I: Loading resource table...
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...
I: Building apk file...
Yes, "W" is a "warning" - it may be a potential problem or may be not. Most of apks have some code, so its lack may be a sign of an problem. framework-res.apk doesn't have it, so this warning is ok for that file.

[Resolved] Help needed! public.xml drawable symbol declared but not defined...

Hello dear devs
I'm trying for 2 weeks now, without luck, to find a way to decompile, add resources and recompile Erikmm's MIUI v4 :
settings.apk
framework-miui-res.apk
as part of my HebMIUI project.
I downloaded an ICS aimed APKtool and used the original as well.
the original fails to even decompile, the other one fails to recompile, giving public.xml drawable symbol declared but not defined error:
For example for settings.apk I get this
I managed to recompile all the system and framework apps besides settings and framework-miui-res so it's really frustrating to not being able to finish this work.
If someone here has a working environment or some issue pointing I missed, I'd greatly appreciate it if you share it with me.
Thanks.
I fixed the 9.png error at the start of the pastebin, it's not related to this issue. Still getting all those declared but not defined errors.
I get them even if I decompile recompile without changing anything...
I'll try to decompile with dependencies. If that won't work I'll try to remove the declared objects from xml.
sent from me
WARNING: The pastebin link totally had a virus waiting. Sorry itskit2sh.
Not much help at the moment, but apktool is going to receive updates (supposedly)
https://www.xda-developers.com/android/apktool-to-receive-updates-once-again/
For settings try and use the apktool from developer.android. As for how you are recompiling miui uses framework-res and framework-miui-res as dependencies. Lastly the miui_logo thing might be because I added my Darth Vader one for when booting shutting down lol. Ill upload my update today to dropbox and have u try with the newest one
----------------------------------------------
If helped don't be afraid to hit the thanks button it doesn't bite lol
Thanks for your replies guys, unfortunately no luck yet.
I copied aapt ver 1.4.3 to both old apktool and ics apktool.
still I get "bad magic value" on old apktool decompilation
and like gazilion rows "declared but not defined" for public.xml objects on ics apktool compilation.
Also decompilation with dependencies did not quite work as it did not get my depended apk suggestions (framework-miui-res/framework-res/settings).
are there any alternatives to this method ? thanks.
Resolved (!) using these files of the newest WIP apktool files (ver. 1.4.9)
once again thanks for all your help guys !!!

[Q] Can't find strings.xml file, need help please!

hello, I am a beginner in customizing apk files. I'm not that smart, sorry
I have only three Chinese apk files decompiled and all found the strings.xml file. I put the strings.xml in the resOverloader folder in my phone. It does not work b.t.w.
Now I have an apk with from Brazil in the Portuguese language called Minhateca.apk.
It is a cloud app from Brazil.
I have with Android Multitool and Baksmali Manager app decompiled but I can not find a strings.xml.
Can anyone help me to find the stings file?
Download attachment for br.com.minhateca.apk
1walter9 said:
hello, I am a beginner in customizing apk files. I'm not that smart, sorry
I have only three Chinese apk files decompiled and all found the strings.xml file. I put the strings.xml in the resOverloader folder in my phone. It does not work b.t.w.
Now I have an apk with from Brazil in the Portuguese language called Minhateca.apk.
It is a cloud app from Brazil.
I have with Android Multitool and Baksmali Manager app decompiled but I can not find a strings.xml.
Can anyone help me to find the stings file?
Download attachment for br.com.minhateca.apk
Click to expand...
Click to collapse
Use advanced apktool by BDFreak .
Strings.xml might be in the res/values folder .
Regards,
AlfasMP
I've just used the advanced apktool and after decompiling I get the following message, I do not know what I should do, could you help me?
Login For: br.com.minhateca.apk
* Log Type: decompiling
* Sign Recorded At: Thu -22-01-2015- 18: 15: 09.71
* Sign Recorded By: Advanced ApkTool v4.1.0 By BDFreak
-------------------------------------------------- ----
W: Could not decode attr value, using Undecoded value Instead: ns =, name = name, value = 0x00000008
Exception in thread "main" java.lang.NullPointerException
at java.io.Writer.write (Unknown Source)
at brut.androlib.res.util.ExtMXSerializer.writeAttributeValue (ExtMXSerializer.java:38)
at org.xmlpull.mxp1_serializer.MXSerializer.attribute (MXSerializer.java:673)
at org.xmlpull.v1.wrapper.classic.XmlSerializerDelegate.attribute (XmlSerializerDelegate.java:106)
atorg.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.writeStartTag(StaticXmlSerializerWrapper.java:267)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.event (StaticXmlSerializerWrapper.java:211)
brut.androlib.res.decoder.XmlPullStreamDecoder at $ 1.event (XmlPullStreamDecoder.java:83)
at brut.androlib.res.decoder.XmlPullStreamDecoder.decode (XmlPullStreamDecoder.java:141)
at brut.androlib.res.decoder.ResStreamDecoderContainer.decode (ResStreamDecoderContainer.java:33)
at brut.androlib.res.decoder.ResFileDecoder.decode (ResFileDecoder.java:114)
at brut.androlib.res.decoder.ResFileDecoder.decode (ResFileDecoder.java:99)
at brut.androlib.res.AndrolibResources.decode (AndrolibResources.java:323)
at brut.androlib.Androlib.decodeResourcesFull (Androlib.java:131)
at brut.androlib.ApkDecoder.decode (ApkDecoder.java:101)
at brut.apktool.Main.cmdDecode (Main.java:165)
at brut.apktool.Main.main (Main.java:81)
-------------------------------------------------- ----

Categories

Resources