Related
Hi can anyone suggest an alternative tool for apktool. It just doesn't work for me. Whatever I do either gives compiling errors or just a bootloop. Thanks guys.
It's nice to know I'm not the only one. Anything past extract optimize and zip is useless for me. I have never had it actually compile an .apk without an error.
I'm having serious problems compiling the framework-res from a CM6.1 based ROM. It decompiles fine, but won't recompile I get hundreds of errors about missing referances.
I only wanna edit a few XML's :sad:
Sent from my HTC Hero using Tapatalk
l0st.prophet said:
I'm having serious problems compiling the framework-res from a CM6.1 based ROM. It decompiles fine, but won't recompile I get hundreds of errors about missing referances. I only wanna edit a few XML's :sad: Sent from my HTC Hero using Tapatalk
Click to expand...
Click to collapse
Which xmls do you want to edit, and what are you wanting to change?
dean.d said:
Which xmls do you want to edit, and what are you wanting to change?
Click to expand...
Click to collapse
Thanks for replying, but I worked it out. I had some dodgy .9.png's that were breaking the compile, so I just had to remove them before compiling.
For anyone else having trouble, check the logs after you decompile to see if there are any messages about .9.pngs. If there are, remove them from the decompiled folder, compile when you are finished, then just add the .9.png's back in afterwards with WinRAR.
I was tryna change the color of the text and the border in the bottom popup menu for my Gingerbread theme
l0st.prophet said:
Thanks for replying, but I worked it out. I had some dodgy .9.png's that were breaking the compile, so I just had to remove them before compiling.
For anyone else having trouble, check the logs after you decompile to see if there are any messages about .9.pngs. If there are, remove them from the decompiled folder, compile when you are finished, then just add the .9.png's back in afterwards with WinRAR.
I was tryna change the color of the text and the border in the bottom popup menu for my Gingerbread theme
Click to expand...
Click to collapse
The reason that happens is the original "dev" who themed the framework did not decompile/modify/recompile. He merely dragged and dropped the modified .9.png
Hence when u decompile, apktool cannot find the necessarry data within resources.arsc to decompile the .9.png and hence when u go to recompile, it complains. Ur safest bet is to always decompile an apk as close to stock as possible.
Where do you place your framework-res.apk I placed mine in the platform tools folder but apktool can not find it
so of you have notice and have been asking about this. i decided i would open up my vault and let the secret out for all.
this is brought to you by myself and the rest of ACS.
Me and dreamsforgoten figured this one out together.
Disclaimer: do not decompile a custom framework and expect it to recompile as it will not work and you'll end up with a list of errors. You can not hold me our anyone at ACS for bricking your phone or any damage that may have occurred by doing this
this how-to is written as if you have a half a brain and know what your doing. if you dont know what your doing please read the themeing how to's written by dreamsforgotten.
1. decompile framework-res.apk
2. open up the values folder
3. locate strings.xml and open with notepad++
4. ctrl+f and search for Sprint. it should be under zz_roamingguard_1 or something simliar. make sure just to edit the roaming guard_1 only
5. rename to w/e you would like. this changes the pull down branding, the aosp lock screen branding, and the network in settings
6.recompile apk. if your building a theme make your other xml edits while decompiled
If you use this mod in your custom themes or roms please give me credit
if you feel as you have benefited from this in anyway please buy me a beer in my signature to keep me motivated on finding more tricks, hacks and themes
Not sure if this will work on other phones or carries.
Thanks for posting this. Is there a way to tell if a framework-res is modded already? Or, more specifically, if trying this on dk28, where's the best place to get a "pure" framework to start with?
also, do you use a specific level of compression when compiling your edited framework?
Thk u.
Sent from the future.
decalex said:
Thanks for posting this. Is there a way to tell if a framework-res is modded already? Or, more specifically, if trying this on dk28, where's the best place to get a "pure" framework to start with?
also, do you use a specific level of compression when compiling your edited framework?
Thk u.
Sent from the future.
Click to expand...
Click to collapse
When I mean a modded framework-res.apk it's one that comes from a theme. They don't compile nicely with the new images added.
I'm personally using the dk28 release from ACS as my framework to modify.
A good way to test is as soon as you de compile the framework re compile it. If it re compiles with no errors you then you can go ahead and use that framework.
I haven't changed my compression when compiling any of my work
Sent from my SPH-D700 using Tapatalk
I know in apk manager 4.9 it saves the file as unsigned_filename.apk but when you chose yes to carry over the signature, it is carried over into the new file in tact. You can skip the last step of resigning the apk after compiling if you choose yes as a system file when you compile. it throws you off being named unsigned but if you open it the meta inf folder is in there.
Sent from my SPH-D700 using Tapatalk
Ok
Maybe i am in wrong thread but here goes.
I installed acs dk28 fro-yo version when it was first released
I have an app i use called privacy star,it no longer will let me use the app
I called privacy star they say my carrier is iroot the original branding acs used for the ROM since iroot isn't a phone company i cannot pay for the app at all.
tell me why, and any suggestions how i can change my carrier back to sprint branding, i have a build prop if anyone can help me.
about phone says sprint as my carrier and i didnt see anything odd in buildprop
http://pastebin.com/92hCixde
humdrum2009 said:
Maybe i am in wrong thread but here goes.
I installed acs dk28 fro-yo version when it was first released
I have an app i use called privacy star,it no longer will let me use the app
I called privacy star they say my carrier is iroot the original branding acs used for the ROM since iroot isn't a phone company i cannot pay for the app at all.
tell me why, and any suggestions how i can change my carrier back to sprint branding, i have a build prop if anyone can help me.
about phone says sprint as my carrier and i didnt see anything odd in buildprop
http://pastebin.com/92hCixde
Click to expand...
Click to collapse
you may basically have to reverse the instructions in the OP. do you understand the instructions? browse the how to theme guides by dreams, you wouldnt be doing all the editing of pngs and compiling in eclipse, but you will need apk manager. basically decompile your framework-res.apk, go to values/strings.xml and change iroot back to Sprint in Notepad++, recompile. you could either drop it in /system/framework with root explorer or replace in the ROM zip and reflash.
Ill get on it right now thanks
Nice post.
Hmm.. I'm curious If that works for you, since you're decompiling and recompiling a "modified" framework.
Sent from the future.
decalex said:
Hmm.. I'm curious If that works for you, since you're decompiling and recompiling a "modified" framework.
Sent from the future.
Click to expand...
Click to collapse
Unfortunadamente, it won't. You can however, take a stock framework-res.apk and copy over the drawable-hdpi folder. But you will lose the battery % mod as well, so make sure to change the battery images back to stock before you copy it.
Sent from my Xtremely Syndicated and Emotionless Epic 4G
Thread cleaned. If something like this happens again, infractions will be handed out to everyone involved.
If you have a member that is trolling/flamming, just ignore them and report the post. I will take care of it.
By saying something to them you are going to get yourself in trouble and start a large fight in a thread that does not need it.
decalex said:
Hmm.. I'm curious If that works for you, since you're decompiling and recompiling a "modified" framework.
Sent from the future.
Click to expand...
Click to collapse
you can reverse the order but there will be extra steps involved. when your ready ro re compile you would have to add in all the stock .9.pngs when re compiling.
Sent from my SPH-D700 using Tapatalk
Thx for your help guys I'll edit this post with results.
Cool-- using both of your recommendations (starting with orig ACS DK28 rom's framework-res.apk, I was able to edit the xml(s), recompile, (delete resources.arsc in the created keep folder), then signed, then dropped in drawable pngs. When you want to do the png edits, do you overwrite All of the folders in your signed framework's res folder? (wouldn't that overwrite the xml edit made)? or just the drawable folders
decalex said:
Cool-- using both of your recommendations (starting with orig ACS DK28 rom's framework-res.apk, I was able to edit the xml(s), recompile, (delete resources.arsc in the created keep folder), then signed, then dropped in drawable pngs. When you want to do the png edits, do you overwrite All of the folders in your signed framework's res folder? (wouldn't that overwrite the xml edit made)? or just the drawable folders
Click to expand...
Click to collapse
you will only loose your xml edits if you replace the xmls
Sent from my SPH-D700 using XDA App
hehe.. come on man. gimme a little more credit than that
in compiled state, the strings.xml (for example) is contained in the resources.arsc file (?). Because, decompiled, obviously, the folder structure is different.
so, I could basically just replace the whole res folder, since the resources.arsc is *not* in that folder? I'll play around with it, but I think I'm getting the gist.
decalex said:
hehe.. come on man. gimme a little more credit than that
in compiled state, the strings.xml (for example) is contained in the resources.arsc file (?). Because, decompiled, obviously, the folder structure is different.
so, I could basically just replace the whole res folder, since the resources.arsc is *not* in that folder? I'll play around with it, but I think I'm getting the gist.
Click to expand...
Click to collapse
When editing xmls you delete the xmls you edited in the keep folder. The hidden xmls like strings.xml is not seen when being built. I delete the resources.arcs when ever I edit a xml even if it is a visable xml. You cannot replace the hole res folder cause of the xmls inside. Some xmls makes changes in the public.xml when compiled. The public.xml is also hidden.
Just decompile the custom framework you wanna edit. Make your changes. Replace all the modified .9 images with the stock ones. Recompile the framework. In the keep folder delete resources.arcs and any xml you can see in the build that you edited. Delete the .9s from the keep folder since you replaced them. Once the file is compiled sign it. Open up the old custom framework with 7zip and your newly created framework with 7zip. Drag and drop the .9s.from the custom framework into your framework
Sent from my SPH-D700 using XDA App
update: found all the right tools, needed patch apktool and updated aapt.exe from sdk13 ( HC3.2)
attached at bottom of post.
has anyone managed to decompile any Honeycomb systemui.apk without any errors? I have tried a few, many diff. ways and keep getting error: mulitple resources in dimens.xml and a bunch of java code. looks like it may not have been compiled properly?? Is there a way to force decompile? or maybe someone with linux and apktool latest version 1.4.2?
anyone made a UOT Kitchen theme with honeycomb and systemui.apk yet?
thanks for the help guys.
seeing if UOT kitchen could manage.. this is the saem error I get.
Decompiling framework-res.apk UOT-11-22-22-09-2
I: Loading resource table...
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
Decompiling SystemUI.apk UOT-11-22-22-09-2
I: Framework installed to: /root/apktool/framework/1.apk
I: Baksmaling...
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x7f090009 dimen/status_bar_icon_padding, config=-port-v13at 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)
Compiling framework-res.apk UOT-11-22-22-09-2
W: Could not find sources
I: Building resources...
I: Building apk file...
Compiling SystemUI.apk UOT-11-22-22-09-2
I: Framework installed to: /home/uot/apktool/framework/1.apk
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
at brut.androlib.Androlib.build(Androlib.java:159)
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.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
... 4 more
unzipped .apk and tried axmlprinter2:
It sounds a lot like the systemui.apk resources have malformed or invalid xmls, what rom source are you using exactly?
Try decompiling 506/507 to see if any of those work first, i'm guessing you're using the ones from r6.
yes r6, I though I have tried others even from a stock ROM. I wasnt able to extract system.img as I have in the past (Im on windowze) because I restored my laptop and all my tools are gone.
If you could check when you have time to try to decompile any honeycomb systemui.apk I would be grateful as I have been researching a lot, and Im sure its just a waste, as you say this is malformed or "hack" compiled Im sure.. not saying it was DJ's doing..
and rather that try to extract system .img with windows.. ( ive tried yaffs expert.apk.. no help) and cygwin.dll, with unyaffs.exe, and wunyaffs, both end up with stack trace dump. which tells me this .apk is bad news. I think it said something about a permissions error with unyaffs; My next step was going to fastboot 507/508 system.img and then pull systemui.apk, likely could screw up my ROM. I like R6 though works best for me.
thanks for the help TheManii
would you be able to unpack 506/507 system.img and just send me the .apk I will try to decompile if you are busy or just let me know if youre able to decompile one.. that would be a tremendous help.
this is definetly something we should not be seeing on an official ROM correct??
the system.img inside the 50x pkgs are ext4, not yaffs2, you'll need something that can read ext3/4 partitions to open it.
but i'm getting the same error in decompiling the systemui.apk in 506-wifi, you might want to ask brut about this, afaik the latest apktool can decompile normal HC level apks.
As an aside, I wouldnt expect r6 themes to be compatable with r7+ as r7+ are based on 507, same reason cwm isnt compatable with r6
at the least I think it should just decompile with errors and just display the multiple resources. so you're getting this on an official ROM, thats not good coding is it?
coding is serious business though. I will have to post on bruts google project page.
found this, a few people have same issue.
http://code.google.com/p/android-ap... Type Status Priority Milestone Owner Summary
huh, was it really part of api13? i figured it would have been 11/12
but one of the hc releases (i guess it was 3.2/api13) introduced dpxnn support, if you look at systemui.apk\res\layout-sw600dp or drawable-sw600dp-mdpi they overlap with the normal versions because it provides a more granular approach.
Didnt know apktool still doesnt support it. Regardless all api13+ apps should be doing it this way preferably.
more research finds this..
The "multiple resources" problem occurs when the same resource appears in two configurations in the apk (e.g. two screen sizes), which are not detected by apktool in ResConfigFlags.java. In the two cases above, the problematic resource appears in both the default config and the XLARGE config which apktool does not detect. Therefore, apktool tried to add the same resource to the default config twice rather than creating an XLARGE config space.
Ferenc Boldog's fix in https://github.com/fboldog/brut.apktool/commit/1b6d63cb355d4a36274f5edf0383a2c4e6e0f868 solves that particular problem by adding XLARGE support. Thanks Ferenc!
know how this boldog's file might work on windows?? I emailed brut.all to see if I could get a beta..
If it works without any further mods you can recompile it or wait for the next ver of apktool, i'm guessing that part/fix will be in it.
You'd need at least the jdk to compile it, and depending on file structure, linux
it seems I have found an apktool for sdk13 posted by brut on his page.. I need to get my own SDK13v aapt.exe though, updating my android sdk manager now... installing 4.0 too , this could be a while..
here is the .zip I found for sdkr13 (3.2), give it a shot if you have the latest sdk and aapt, curious if it works.
got it... woo hoo stoked! needed sdk r13 aapt.exe , didnt work with apktool 1.4.1 but did with another apktool for for 3.2
That's good news, as I'll also need to eventually recompile 3.2 apks if i ever get around to adding full langs into chimeradroid
and I got status bar clock themed for my ICS theme... cool..
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums and Read THIS
Moving to General
chrisrotolo said:
got it... woo hoo stoked! needed sdk r13 aapt.exe , didnt work with apktool 1.4.1 but did with another apktool for for 3.2
Click to expand...
Click to collapse
I'm still having a ton of issues with this, could one of you walk me through it? I'm working with the Asus Transformer, but having the same issue. I can now decompile properly with apktool, but compiling just fails miserably...
I have apktool 1.4.2, but apparently the new aapt.exe is needed? Would you be able to give me a link to that?
updated first post. attached .zip of apktool and files that worked for me.
@JDV28, are you decompiling a stock .apk? or themed .apk? and what kind of changes are you making? .xml edits? .9.png's? and what a re the errors? so we can try to help.
chrisrotolo said:
updated first post. attached .zip of apktool and files that worked for me.
@JDV28, are you decompiling a stock .apk? or themed .apk? and what kind of changes are you making? .xml edits? .9.png's? and what a re the errors? so we can try to help.
Click to expand...
Click to collapse
I think I figured out my own issue, I was decompiling and recompiling a themed SystemUI.apk, and if I remember correctly, that doesnt work.
Am I right? If so, why??
Also, I am getting a 9patch error like you said in the pm, any fix for that? that's the only issue now.
Personally I would suggest making any.xml edits , recompiling then dragging .9's and any other .png's and dropping them into the new .apk arhive. You could try xultimate search for it I think its on Droid forums.
Link: http://forum.xda-developers.com/showthread.php?t=700904
There are many guides on how to patch .9 's
I am trying to modify XMLs of Jelly Bean Contacts.apk. Using apktool that has been used for ICS and other Jelly Bean apks, I can decompile and then recomplie it without any error. However, the recompiled Contacts.apk would not work in cell phone, showing a message "Unfortunately, Contacts has stopped!".
To simplify the problem, I simply do decompiling and then recompiling without any modifications. I found that the size of resources.arsc has been changed from 1480 KB to 1525 KB. The new Contacts.apk causes FC!
Note: Files in smali folder can still be modified. After editing, use apktool to recompile and create a new apk. Then use WinRAR or 7zp to drag the newly created classes.dex into the original Contacts.apk. Such a "modified" Contacts.apk works properly. Note here that we did not modify resources.arsc.
This problem is only related to resources.arsc!! XMLs cannot be recompiled!!
Does anybody have the same problem? Do you know how to solve this problem? Any solutions or suggestions are appreciated.
Did anybody try this?
Are you all ok with modifying Contacts.apk?
With the current apktool jar file you can not edit any XML in the contacts apk. It has to be done in source code
Sent from the BatCave
zelendel said:
With the current apktool jar file you can not edit any XML in the contacts apk. It has to be done in source code
Sent from the BatCave
Click to expand...
Click to collapse
Thank you for your reply. The question is why we can edit XML in other apks except Contacts.apk.
Is there any magic?
framework-res.apk, Settings.apk, SystemUI.apk, Phone.apk are all ok without any problem.
iBotPeaches, the author of apktool, wrote: "Looks like we have new resource type. T9Map. Will have to code support for it. Its just loosing it on rebuild."
See discussions at: https://github.com/iBotPeaches/brut.apktool/issues/11
Okay, so here's what I'm doing:
Direct port from Nexus S to SGS. It boots, everything works except signal. Last time I spoke to Andy Thompson over at MIUIAndroid, I needed to change some files in classes.dex, but I have no further instruction.
What I've done:
Take classes.dex out of framework.jar and placed the classes.dex and the baksmali and smali jar files in the same directory.
Then did this:
java -jar baksmali-1.4.0.jar -o classout/ classes.dex
I now have a classout folder with all the smali files in it and such. What needs to be replaced in order to have RIL/Signal working? I imagine the CORRECT files from a Captivate CM10 build or otherwise, but I don't know which files it is.
If anyone could give me some direction I can recompile it.
Spank you all!
happen also with me when I tried to port miui from nexus s (am also using captivate) the error is somewhere in framework-res.apk (according to me)
what I did was I changed the base to i9000
dheeraj (dhlalit11) said:
happen also with me when I tried to port miui from nexus s (am also using captivate) the error is somewhere in framework-res.apk (according to me)
what I did was I changed the base to i9000
Click to expand...
Click to collapse
MIUIAndroid is discontinued for the I9000 now, even for porting. In order to get it to work on the I9000, the same change needed to be made. I need to know what it was.