[Q] framework compile error - Android Q&A, Help & Troubleshooting

i have a problem to decompile an apk, it's the framework-miui-res.apk, when i try to decompile with apktool it give me a warning (W: Cant find 9patch chunk in file: "drawable-hdpi/popup_item_single_normal.9.png". Renaming it to *.png. ) anyways it decompile all the files and i can edit it, but whan i try to compile it's a completly mess, give me a lot of errors
i was googling it , and i found that the error is because there are two files with the same name in xml files, i try to replace it, rename it, using different tools and version of apktool, making "apktool if", but i just can't make it compile. any ideas?

Huncriter said:
i have a problem to decompile an apk, it's the framework-miui-res.apk, when i try to decompile with apktool it give me a warning (W: Cant find 9patch chunk in file: "drawable-hdpi/popup_item_single_normal.9.png". Renaming it to *.png. ) anyways it decompile all the files and i can edit it, but whan i try to compile it's a completly mess, give me a lot of errors
i was googling it , and i found that the error is because there are two files with the same name in xml files, i try to replace it, rename it, using different tools and version of apktool, making "apktool if", but i just can't make it compile. any ideas?
Click to expand...
Click to collapse
Your problem was stated on the decompile. The .9 issue will throw up errors on everything when it is the only thing wrong. Might want to ask on the MIUI site

already did that, but there's no answer

Huncriter said:
already did that, but there's no answer
Click to expand...
Click to collapse
Have you tried fixing the .9 png ?

yeap, it creates two files when decompile, one is 9.png but is trash(0kb) and the other is the .png file, i try to rename the png (with 9.png) delete the 9.png file but it didn't work.
also i decompile another framework-miui-res.apk from another rom(without error) , extrac the 9.png replace in my rom and still no work.

Huncriter said:
yeap, it creates two files when decompile, one is 9.png but is trash(0kb) and the other is the .png file, i try to rename the png (with 9.png) delete the 9.png file but it didn't work.
also i decompile another framework-miui-res.apk from another rom(without error) , extrac the 9.png replace in my rom and still no work.
Click to expand...
Click to collapse
Ok just renaming the png to a .9 will not work. .9 pngs are special made pngs with a special border system. Can you decompile and recompile the apk without the error?

zelendel said:
Ok just renaming the png to a .9 will not work. .9 pngs are special made pngs with a special border system. Can you decompile and recompile the apk without the error?
Click to expand...
Click to collapse
no, that's the problem, but i can decompile the framework-res-miui from another rom and extract the 9.png
can you try it? i let the framework at top

Huncriter said:
no, that's the problem, but i can decompile the framework-res-miui from another rom and extract the 9.png
can you try it? i let the framework at top
Click to expand...
Click to collapse
Sorry I don't touch anything from MIUI. There are a few threads around. Search for an MIUI themeing thread and they should be able to help you.

zelendel said:
Sorry I don't touch anything from MIUI. There are a few threads around. Search for an MIUI themeing thread and they should be able to help you.
Click to expand...
Click to collapse
, thanks, and no there's no thread with the solution for this, and i think the problem is not only in miui roms, and have other apps that i cant compile
i wonder if there is another way to compile wthout using apktool

Huncriter said:
, thanks, and no there's no thread with the solution for this, and i think the problem is not only in miui roms, and have other apps that i cant compile
i wonder if there is another way to compile wthout using apktool
Click to expand...
Click to collapse
The only two choices are using apktool or compiling it from the source code and making your changes and using apktool. What version of android is it for? ICS needs 2 versions. One to decompile and one to compile. I have themed every OS version I have used and with the right searching and some trial and error it has always worked. Including ics

it's based on android 2.3.7, and try that also(using 1.4.2 to decompile and 1.4.3 to compile)

Related

[tutorial] decompiling and recompiling framework-res for ics

greetings
this is a basic tutorial on decompiling and recompiling framework-res for ics.
thanks to this thread here which posted the latest aapt and the idea to use two versions of apktool. more is needed though and there are some unnecessary actions so i am adding to this for the rezound.
download this file which contains two versions of apktool and the latest aapt
apktools
add the contents to your apktool folder. rename apktool 1.4.2 to just apktool
install your ics framework
apktool if framework-res.apk
apktool if com.htc.resourses.apk
you will see flag errors but disregard.
decompile framework-res
apktool d framework-res.apk <out>
again you will see flag errors but disregard.you will also see errors in values-hdpi and values- xdpi pointing to the drawables xml. i deleted both xmls to mod the battery percentage.
to recompile. rename apktool to apktool 1.4.2. rename apktool 1.4.3 to just apktool.
this is rather strange but this is what has worked. go to res/values/anims
change this
<anim name="htc_ime_decelerate_interpolator">@anim/zzz_htc_ime_decelerate_interpolator</anim>
to
<item type="anim" name="htc_ime_decelerate_interpolator">@anim/zzz_htc_ime_decelerate_interpolator</item>
then recompile.
apktool b <out>
the anims xml is rebuilt as before which is the strange part.
please post any questions or issues
dude ty so much for this.... u are the king of theme
you are then man bro. thanks for this. now off to mess with stuff.....
Thank you kind sir.. On to the fun
EDIT: I have not tackled the framework yet but it fixed the problem I have been having with SystemUI. I finally get a consistent decompile and re-compile of it.
Thanks
NilsP said:
Thank you kind sir.. On to the fun
EDIT: I have not tackled the framework yet but it fixed the problem I have been having with SystemUI. I finally get a consistent decompile and re-compile of it.
Thanks
Click to expand...
Click to collapse
How because I cant get SysUI?
scrosler said:
How because I cant get SysUI?
Click to expand...
Click to collapse
I just set it up this way and de-compiled with 1.4.2 and re-compiled with 1.4.3 and it only gave me warnings. I actually think the aapt is the answer since that was where I was getting the "could not execute error" after it could not do resources.
It is not 100% because the SystemUI flashed over a live ROM fine but I lost the notification bar on a full wipe. Not sure yet if it is apktool or me.
did you guys get sysUI decompiled yet? i olny get a smali folder and nothing else.
racinwarrior said:
did you guys get sysUI decompiled yet? i olny get a smali folder and nothing else.
Click to expand...
Click to collapse
i didnt have an issue with systemui with the newer aapt. i decompiled, modded and recompiled with apktool 1.4.3
NilsP said:
I just set it up this way and de-compiled with 1.4.2 and re-compiled with 1.4.3 and it only gave me warnings. I actually think the aapt is the answer since that was where I was getting the "could not execute error" after it could not do resources.
It is not 100% because the SystemUI flashed over a live ROM fine but I lost the notification bar on a full wipe. Not sure yet if it is apktool or me.
Click to expand...
Click to collapse
I recompiled my SystemUI last night with a few Smali edits to see if I could get data working. Did a full factory wipe(still no good on the data) but it didn't hose anything else.
fernando sor said:
i didnt have an issue with systemui with the newer aapt. i decompiled, modded and recompiled with apktool 1.4.3
Click to expand...
Click to collapse
MrSmith317 said:
I recompiled my SystemUI last night with a few Smali edits to see if I could get data working. Did a full factory wipe(still no good on the data) but it didn't hose anything else.
Click to expand...
Click to collapse
I finally got a good compile of SystemUI with the new aapt and 1.4.2 apktools. Then I redid it with 1.4.3 and it worked fine. So they key is the aapt fernando provided.
By the way, de-compile with 1.4.2 and re-compile with 1.4.3 was the way I got a failure of the apk with losing the notifications bar.
NilsP said:
I finally got a good compile of SystemUI with the new aapt and 1.4.2 apktools. Then I redid it with 1.4.3 and it worked fine. So they key is the aapt fernando provided.
By the way, de-compile with 1.4.2 and re-compile with 1.4.3 was the way I got a failure of the apk with losing the notifications bar.
Click to expand...
Click to collapse
yes the guide for decompiling was for framework not systemui
fernando sor said:
yes the guide for decompiling was for framework not systemui
Click to expand...
Click to collapse
Yup, figured that and that is wky I went with 1 version for both directions.
Thanks
Well, got the SystemUI working the way I want and moved on to my next project.
Easy one, transparent app drawer right. Well, I get what looks like a good compile but no home screens after an install.
I will keep plodding away.
@NilsP - can you post what worked for you for the systemUI?
@fernando - I dont meant to thread jack but what about turning this thread into a how to for the major apks?
Did anyone elses framework drop by 4MB without even making any changes? When viewing the apks in 7zip is shows that the resoure.arsc file is a different "packed" size than original. Just want to confirm before I flash this with mods done.
bad4u6669 said:
@NilsP - can you post what worked for you for the systemUI?
@fernando - I dont meant to thread jack but what about turning this thread into a how to for the major apks?
Did anyone elses framework drop by 4MB without even making any changes? When viewing the apks in 7zip is shows that the resoure.arsc file is a different "packed" size than original. Just want to confirm before I flash this with mods done.
Click to expand...
Click to collapse
apktool compresses the apk. your fine

Apktool for ICS APK files

I am unable to edit ICS apks using the apktool I have tried. Some times I get error while compiling and other times the compiled apk never work on phone.
I have tried compiling without changing any thing even then they don't work.
If some body can upload the apktool he/she is using to edit ICS apks I will be very grateful.
Thanks
singh_dd93 said:
I am unable to edit ICS apks using the apktool I have tried. Some times I get error while compiling and other times the compiled apk never work on phone.
I have tried compiling without changing any thing even then they don't work.
If some body can upload the apktool he/she is using to edit ICS apks I will be very grateful.
Thanks
Click to expand...
Click to collapse
If you are not going to touch the smali files, then no need to use apktool at all. For normal xml editing and PNG editing, I will prefer to use 7zip to open the apk package, and replace the files, without decompressing at all.
I had heard about the latest version of Apktool being released recently, I will search and share, in case someone doesn't do it before me.
Thanks,
Rick
Sent from my SK17i using XDA
thanks for help
I would have searched myself but I am having very slow internet in these hills.
I am unable to edit xml files without decompiling.
singh_dd93 said:
thanks for help
I would have searched myself but I am having very slow internet in these hills.
I am unable to edit xml files without decompiling.
Click to expand...
Click to collapse
Okay. So I tried to edit an ICS only apk using aptool version 1.4.3, and it could not recomplie. It threw in lots of errors.
It seems that you will need to use another version of apktool, which has some ICS APIs so that it becomes possible to successfully decompile and compile ICS apks.
Check this thread: http://forum.xda-developers.com/showthread.php?t=1558171.
The author of the post made it easier for newbies by making an apktool installer which has all the required forles to run ICS files already in it.
Thanks,
Rick
Sent from my SK17i using XDA
I am unable to decompile using ICS apktool from the link you mentioned.
When I used decompiled folder to compile using this apktool but got same errors.
There were no changes in any file.
singh_dd93 said:
I am unable to decompile using ICS apktool from the link you mentioned.
When I used decompiled folder to compile using this apktool but got same errors.
There were no changes in any file.
Click to expand...
Click to collapse
Dude, What app did u try? you know some lines was removed during decompile, so you may need to see error. like here when u try to compile Home.apk it'll gave error.
You need to :
<style name="Layout.ButtonContainer" for <style name="Layout.ButtonContainer" parent="@android:style/Theme.Wallpaper.NoTitleBar">
at \res\values\styles.xml and compile...
Click to expand...
Click to collapse
also, I use apktool_1.4.1.jar for doing de/compiling jobs.
Anyway, may you show the log?
nonake kh said:
Dude, What app did u try? you know some lines was removed during decompile, so you may need to see error. like here when u try to compile Home.apk it'll gave error.
You need to :
also, I use apktool_1.4.1.jar for doing de/compiling jobs.
Anyway, may you show the log?
Click to expand...
Click to collapse
well i had already replaced the thing in string.xml
but still have error
screen shot attached
singh_dd93 said:
well i had already replaced the thing in string.xml
but still have error
screen shot attached
Click to expand...
Click to collapse
:\
No: replace the string <style name="Layout.ButtonContainer" for <style name="Layout.ButtonContainer" parent="@android:style/Theme.Wallpaper.NoTitleBar">
at \res\values\styles.xml and compile..replace the string <style name="Layout.ButtonContainer" for <style name="Layout.ButtonContainer" parent="@android:style/Theme.Wallpaper.NoTitleBar">
at \res\values\styles.xml not string.xml
.
I am not pretty sure if it cause by resource problem. did u installed framework-res.apk yet?
Me I use Apkmanager 4.9
No problem at all.
yes i replaced these lines in styles.xml and have also installed framework-res.apk and SemcGenericUxpRes.apk
I am able to edit GB apks if i use GB framework files but not able to do in case of ICS(installed ICS framework files)
I am sorry i wrote string.xml by chance
singh_dd93 said:
yes i replaced these lines in styles.xml and have also installed framework-res.apk and SemcGenericUxpRes.apk
I am able to edit GB apks if i use GB framework files but not able to do in case of ICS(installed ICS framework files)
I am sorry i wrote string.xml by chance
Click to expand...
Click to collapse
Well, first try this, go to UOT kitchen, upload framework-res.apk then just mod battery icon,. cook it. u'll get new framework. use it and installed then try to decompile/compile maybe can help/.
---------- Post added at 07:56 PM ---------- Previous post was at 07:25 PM ----------
singh_dd93 said:
yes i replaced these lines in styles.xml and have also installed framework-res.apk and SemcGenericUxpRes.apk
I am able to edit GB apks if i use GB framework files but not able to do in case of ICS(installed ICS framework files)
I am sorry i wrote string.xml by chance
Click to expand...
Click to collapse
Well, first try this, go to UOT kitchen, upload framework-res.apk then just mod battery icon,. cook it. u'll get new framework. use it and installed then try to decompile/compile maybe can help/.

[Q] apktool

Hey guys just wondering if you guys can point me in the right direction to a apktool that is working on the s3.
I've attempted to extract and set the framework.apk and decompile systemui.apk, which worked fine but when compiling the modded file I'm getting errors..
Wont compile with out any modifications either..
Any tips and comments will be appreciated... excuse my grammer as I'm writing this on my phone.
I managed to recompile framework-res.apk with apk tool however it boot looped so not convinced.
Do you have to decompile with dependencies with samsung frameworks?
Sent from my GT-I9300 using Tapatalk 2
rootSU said:
I managed to recompile framework-res.apk with apk tool however it boot looped so not convinced.
Do you have to decompile with dependencies with samsung frameworks?
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
I'm not sure to be honest... hopefully someone can clear this up for us !
https://docs.google.com/open?id=0Bx7xmGB4IFU7bHNSdUtaWjFTOVMtN1VjZnJBcUFWUQ
framework-res.apk won't compile with samsung based roms...i don't know why but in most cases it doesn't.
Make sure to press the thanks button.!!!!
Thanks for the tip, although not being able to recompile SystemUI.apk is a different issue all together..
Iv tried setting framework.apk & twframework-res.apk from the stock firmware which came with my phone.. attempted to compile.. fails.
Iv got a feeling this is going to be something silly..
EDIT: Something has come to mind, iv only ever been able to decompile systemUI for CM9 based roms.. forgot were working with stock Samsung.. last time I had this issue I hit a brick wall pretty much apktool couldnt decompile sammy systemUI .. this may have changed.
rohan999 said:
https://docs.google.com/open?id=0Bx7xmGB4IFU7bHNSdUtaWjFTOVMtN1VjZnJBcUFWUQ
framework-res.apk won't compile with samsung based roms...i don't know why but in most cases it doesn't.
Make sure to press the thanks button.!!!!
Click to expand...
Click to collapse
There was a way of doing it where there was one apktool.jar for decompile and another for recompile. It seemed to work for me but it was not successful.
I'll create my own thread.
I need some help on this too. APKTOOL is not taking if apktool framework-res.apk in CMD. Any ideas? I'm just trying to decompile SystemUI.apk, lol. It shouldn't be this hard.
I have a big problem.
When i use untouched original framework-res and systemui, i can decompile and compile but only when i made no changes.
when i got the framework-res and systemui from my checkrom to mod some xmls ican decompile. but i can not compile
I`ve a look to my pathes but there correct.
My phone SGS3 with checkromV4
AndroidGraphix said:
I need some help on this too. APKTOOL is not taking if apktool framework-res.apk in CMD. Any ideas? I'm just trying to decompile SystemUI.apk, lol. It shouldn't be this hard.
Click to expand...
Click to collapse
apktool work fine here!
i guess you should mount twframework-res.apk in apktool
Code:
apktool if twframework-res.apk
apktool if framework-res.apk
I've managed to compile both SystemUI and framework-res using APK manager for ICS.
Sometimes when you try to use a FW res or system ui from a custom or themed rom you will get errors because of the customizations they made to them. That's why a lot of time they will tell you to start with a stock fw or systemui.
For example, when I tried to recompile a themed FW res (JB domination) I got errors, when I used a stock "virgin" copy it was fine.

[ HELP ] Decompiling and recompiling stock ICS framework-res

Hallo, I tried a lot of apktools and aapts but I am unable to recompile framework-res Every time resources have diferent size than stock framework-res and I have no idea how to hack them. If some one allready hacked them please help here! Seems Sony using an totally new aapt tool which is not public? I tried to recompile framework-res without modifying them but every time I getting boot loop.
munjeni said:
Hallo, I tried a lot of apktools and aapts but I am unable to recompile framework-res Every time resources have diferent size than stock framework-res and I have no idea how to hack them. If some one allready hacked them please help here! Seems Sony using an totally new aapt tool which is not public? I tried to recompile framework-res without modifying them but every time I getting boot loop.
Click to expand...
Click to collapse
framework from stock???
Yes
Note: mean about modifying xml files, not drag and drop from the one to the another... ! I have resigned all apks (including framework-res) and have no boot loop but framework-res can not be recompiled and signed, only signed! Allso drag and drop not working if xml files is modified! Hope you understand what I mean?
munjeni said:
Yes
Note: mean about modifying xml files, not drag and drop from the one to the another... ! I have resigned all apks (including framework-res) and have no boot loop but framework-res can not be recompiled and signed, only signed! Allso drag and drop not working if xml files is modified! Hope you understand what I mean?
Click to expand...
Click to collapse
Have U tried to drag 'n drop AndroidManifest.xml and META-INF folder from stock to modified framework-res and overwrite everything ( of course using archive manager )??
I needed to do this in my MIUI port ( CyanogenMod10 based ) for X8, because after every recompile I needed to copy them to not get bootloop
NeveHanter said:
Have U tried to drag 'n drop AndroidManifest.xml and META-INF folder from stock to modified framework-res and overwrite everything ( of course using archive manager )??
I needed to do this in my MIUI port ( CyanogenMod10 based ) for X8, because after every recompile I needed to copy them to not get bootloop
Click to expand...
Click to collapse
No, I have success in resigning unmodified stock framework-res, so META-INF have no sense because new META-INF is signed by new key and its working! There is problem with "format" ...seems Sony have his own aapt and apktool which making totaly diferent "format" than apktool and aapt that we using. I tried many of the aapt | apktool but .arsc have totaly diferent size (allso png files is with totaly diferent size)... !
Have u used the apk manager by diamondback??
http://forum.xda-developers.com/showthread.php?t=1619473
I am working in Linux machine!
munjeni said:
I am working in Linux machine!
Click to expand...
Click to collapse
have you figured out the problem yet??
and one thing I wanted a favour........
I wanted to change the rotation fix for your MIUI to back to its original state..... decompiled the framework-res.apk from the MIUI and changed the some values in framework-res/res/values/bools.xml and then recompiled it and when I replaced it with the default one I was getting the status bar of different width from the original..... it was almost double..... I also tried by just replacing some images just for test and the same thing happened........
Can you tell me whats the problem is????
Hey bro,
Even I was stuck with this issue for a while I think it was Spaun_Studio who found out how to fix this issue Its basically to do with apktool not bundling the required nxt drawables as needed Anyway, Here's the fix :
1) After decompiling, go to apktool.iml and delete the following lines :
usesFramework:
ids:
- 2
Click to expand...
Click to collapse
2) Go to res/values and open styles.xml. There, delete all references to sonyericcson.uxp:drawable (Delete the entire line)
Then, compile and it will work
Credits to Spaun_Studio and not me for the idea
Cheers
@[email protected] said:
have you figured out the problem yet??
and one thing I wanted a favour........
I wanted to change the rotation fix for your MIUI to back to its original state..... decompiled the framework-res.apk from the MIUI and changed the some values in framework-res/res/values/bools.xml and then recompiled it and when I replaced it with the default one I was getting the status bar of different width from the original..... it was almost double..... I also tried by just replacing some images just for test and the same thing happened........
Can you tell me whats the problem is????
Click to expand...
Click to collapse
Seems you missing something!
Min3r said:
Hey bro,
Even I was stuck with this issue for a while I think it was Spaun_Studio who found out how to fix this issue Its basically to do with apktool not bundling the required nxt drawables as needed Anyway, Here's the fix :
1) After decompiling, go to apktool.iml and delete the following lines :
2) Go to res/values and open styles.xml. There, delete all references to sonyericcson.uxp:drawable (Delete the entire line)
Then, compile and it will work
Credits to Spaun_Studio and not me for the idea
Cheers
Click to expand...
Click to collapse
Thanks mate for info, I will try soon! Its looking like problem you mentioned!
munjeni said:
Thanks mate for info, I will try soon! Its looking like problem you mentioned!
Click to expand...
Click to collapse
If you can help with the steps it would be great....... IF you are free then please help........ Thanks....

twframework-res.apk

Hi everybody
I've used apktool V2.0.3 for decompiling and compiling my
framework-res.apk
SystemUI.apk
SecSettings.apk
ClockPackage_Osup.apk
MultiWindowTrayService.apk
SecContacts_Phone_OSup.apk
SecMms_Candy.apk
SamsungMusic_20.apk
without any problem.
But now I want to make afew changes to "twframework-res.apk" and I'm getting a huge list of error while compiling this apk ( I posted the error log at end of the post)
I use twframework-res of two different rom but still getting the same error
I think it can not locate or read the Values folder when compiling because all those resource that Apktool claimed not there is actually there (all those value are present at "Colors" and "drawables" at "values" folder)
when I enter the hex color directly at "color" folder files, the error for colors at compiling disappeared but there are too much error at drawable for fixing manually
when I remove (( forced-package-id: '2' )) line from the "apktool.yml" file, apk compile ok with just a few error in "Style" but when I use this compiled apk on my phone it won't boot
does anybody have any idea how I can fix this issue because I really need to modify this apk file
My phone is Samsung Galaxy Note 3 SM-N900 on Lollipop 5.0 (Deodexed Rom)
Log.txt:
http://s000.tinyupload.com/download.php?file_id=22857363641838387918&t=2285736364183838791824181
Go here....http://forum.xda-developers.com/showthread.php?t=1633333
I cant remember exactly, but you decompile with one apktool.jar and compile with a different one. There are like 5 different apktool.jar.
Try searching that thread.
The Sickness said:
Go here....http://forum.xda-developers.com/showthread.php?t=1633333
I cant remember exactly, but you decompile with one apktool.jar and compile with a different one. There are like 5 different apktool.jar.
Try searching that thread.
Click to expand...
Click to collapse
Thanks alot
It really worked
Thank you so much for your help
I use Apktool V2.0.3 for decompile the apk and Apktool V2.0.0rc2 for compile it
again thank you:good::good::good::good:
badboy_6120 said:
Thanks alot
It really worked
Thank you so much for your help
I use Apktool V2.0.3 for decompile the apk and Apktool V2.0.0rc2 for compile it
again thank you:good::good::good::good:
Click to expand...
Click to collapse
what framework did you use I can decompile it with 2.1.1 only but wont recompile with Apktool V2.0.0rc2 or any other one I have tried

Categories

Resources