Compile HTC.Resources - Thunderbolt Q&A, Help & Troubleshooting

I am trying to add some .9 files and soem xml files to the drawable, drawable-hpdi folders respectivly, and i get compiles issues. What's the trick to this? I compile all day long with other apk's.
I get a ton of these:
ERROR: Failure processing PNG image D:\APK Manager 4.9\other\..\projects\com.htc.resources.apk\res\drawable-hdpi\appwidget_inner_focus_c.9.png
libpng error: Read Error

i believe you need to add the edited .9 files in after you compile. switch apk to zip and do it that way and then sign. atleast that is how i always have done it. compile with altered .9's always failed on me too.

RafficaX said:
i believe you need to add the edited .9 files in after you compile. switch apk to zip and do it that way and then sign. atleast that is how i always have done it. compile with altered .9's always failed on me too.
Click to expand...
Click to collapse
Thanx for answering.. But a bit fuzzy..
I actually have xml's to add to the drawable-hpdi and standard .png's not .9's to add to the drawable
I tried to just copy them over to the compiled version of the apk..
what do you mean switch apk to zip?

rename it to zip after you compile it, so this way you can open in winrar or 7zip and just drop those png's in the folders they need to be in. then rename name the zip to apk and sign it. the xml's can be in there when you compile it. they wont cause an issue.
like i said every time i made xml and png edits i had to do it this way to work right.

If you use 7zip there is no need to rename the file to .zip
Just right click on the file and choose 7zip - open archive.
Sent from my B.A.M.F. Thunderbolt

okay someone earlier in an email said never sign a htc.resources file.
Seems there could be several ways.
1. Open resources file with 7zip
2. copy png's to drawable folder
3. copy xml's to drawable-hdpi folder
then what?

thats it. bc its still an apk file through 7 zip. load it on your phone. i make sure it copies over the signature when it re compiles though. watch the output to make sure it did.

RafficaX said:
thats it. bc its still an apk file through 7 zip. load it on your phone. i make sure it copies over the signature when it re compiles though. watch the output to make sure it did.
Click to expand...
Click to collapse
Sorry being dense or just not getting it. You said re-compiles. If you are just opening the com.htc.resources with 7zip and copying files into it, how are you re-comiling?
The bits and pieces are confusing. PM me the exact steps to replacing png and xml in the resources file?
Dont you have to Zip align it? Or zip it? So it can be flashed from recovery?

Related

[Q] theme skinning help???

Anyone mind sharing a link or some directions on skinnning themes?
I've had someone give me these instructions:
1) extract/Decompile the .apk file you want to MOD or make changes to. Use m10 editor for this.Select the option "decomplie all"
2) Minimize the m10 editor, and open the folder where you m10 editor is installed. There you would find a folder with the name of the .apk file you just decomplied. Go to folder assests>"base theme name">drawble>shared folder.
3) now select the .png files you want to edit. Install Paint.net, and edit with them, it was easy process for me. Remeber to "flip image vertical" after you are done with editing.
4) now go back to m10 editor, and Save the file.
5) You should have AndroidSDK installed.If not, do it. Then go to the folder where you have installed it. open the "autosign" file. It will open command prompt. There select the option to sign the file manually. Give the path for the file. It will sign it then. Exit from that program.
6) you are done, you can install it now.
I've gotten this far, but i can't find out how to change these 3 things below:
In de-compiled files changes have to b made in three places.
1. Androidmanifest.xml (name of package). how do u change this?
2. Res\values\strings.xml (name of theme). how/where do u change this?
3. Assets\shared(change this to theme name) h0w/where do u change this?
Also everytime I replace the background images, when I recompile it, my background images don't stay.
Any help would be much appreciated...
okay so i hate to tell you to download something else but i use .apk manager and it is a lot more straight forward.
decompile the apk using that.
go into the projects folder, you will see the Androidmanifest.xml
what are you trying to change in there exactly? if its just icons things like that those are easy but if you are trying to change the packageID it will just cause FC's
strings.xml hangs out in the following
projects->*.apk(this will be the name of what you decompiled)->res->values->strings.xml
then go into the xml and it will have a line with the name of the apk that you can change
assets has it's own folder i haven't hung out in there at all i haven't really had a need but it is in the same file tree with the res folder
now the issue upon recompiling, when doing the recompile in apk manager press y and y to the 2 options, it will create a keep folder go into that and delete the classes.dex if you messed with any images in the drawable folders, and the resources.arsc if you changed any of the xmls. then go into the keep directories sub folders and delete the items you changed then finish the compiling
sorry if i am not the best at explaining this
Yes, what exactly do you want to change? Taskbar and other icons are very easy to do, however, I haven't done any M10 files, yet.
In the manifest you need to change the name of the apk to what you are naming it. you will see a line which will have package="com.htc.skin."apkname".
So for my zombie skin example my line says "com.htc.skin.zombie"
Also to that point what ever you name it you need to navigate to the foler that holds the m10 file and change the folder to the same name or the m10 file wont be used.
jkrough0728 said:
In the manifest you need to change the name of the apk to what you are naming it. you will see a line which will have package="com.htc.skin."apkname".
So for my zombie skin example my line says "com.htc.skin.zombie"
Also to that point what ever you name it you need to navigate to the foler that holds the m10 file and change the folder to the same name or the m10 file wont be used.
Click to expand...
Click to collapse
exactly the same, boy did that drive me nutty for a few days!!
jkrough0728 said:
In the manifest you need to change the name of the apk to what you are naming it. you will see a line which will have package="com.htc.skin."apkname".
So for my zombie skin example my line says "com.htc.skin.zombie"
Also to that point what ever you name it you need to navigate to the foler that holds the m10 file and change the folder to the same name or the m10 file wont be used.
Click to expand...
Click to collapse
using apk manager are u guys decompiling using option 9 or 10 and if ur using option 10 what framework are u dragging into it?
keedog said:
using apk manager are u guys decompiling using option 9 or 10 and if ur using option 10 what framework are u dragging into it?
Click to expand...
Click to collapse
I use apktool but if your using manager it would be 9.
sent from my Evo 3D from xda app

Compiling framework res help

Hi i am trying to edit the framework res apk so i can change the text colour and the themed clock colour. I can decompile with apktool and change the colors.xml but after compiling framework res i just get stuck in a bootloop. I have tried just copying the reaources file to my original framework but still bootloops. I have searched google and here and finding it hard to find a solution. One thing i noticed in 7zip it says that for resources the OS is FAT but on the edited one it is UNIX as well as being a smaller file when compressed. If anyone can help that will be great.* Thanks
Sent from my GT-I9100 using XDA App
sign the apk as a system app.
no you shouldn't have to sign it just rename unsigned framework-res.apk to framework-res.apk and reflash to phone it shouldn't bootloop when you compiled did you select yes to system file and yes to copy everything then delete what was in keep file? If its an XML when you delete from keep file you have to delete the file you modified also.
txr33 said:
One thing i noticed in 7zip it says that for resources the OS is FAT but on the edited one it is UNIX as well as being a smaller file when compressed.
Click to expand...
Click to collapse
Did you choose Store as the compression method when adding the Resource file to your original apk?
mattfox27 said:
no you shouldn't have to sign it just rename unsigned framework-res.apk to framework-res.apk and reflash to phone it shouldn't bootloop when you compiled did you select yes to system file and yes to copy everything then delete what was in keep file? If its an XML when you delete from keep file you have to delete the file you modified also.
Click to expand...
Click to collapse
I originally just renamed mine and got a bootloop. Signed it as a system apk and stuck it in an update.zip and flashed it and it worked. Also, as the above post mentions, store must be selected as the compression method.

[Q] nuub question, can an .apk be lightly modified like this?

I am sure this would be a WTF for some people thats why I'm asking in the Q&A section.
I've noticed that .apk files can be renamed to .rar and, once decompressed, we can find files in a normal-structure in their real format (images, sounds, xmls, etc).
So I wonder, let's say, we want to modify one of the images inside the .apk. We would change it for another with the same name/size so no probs with that.
Could we decompress the .apk as a .rar, change the file, recompress it to a .rar and rename it to .apk, or we would **** permissions or something in the way?
Otherwise it needs some compiler or something I guess right? But then I wouldn't understand why it can be plainly decompressed as a .rar..
This should get you started;
To unpack/repack etc .apk use Apk Manager 4.9 - Makes Modifying Ur Apk A Breeze (Windows/Linux)
To modify .xml files, use Notepad++
UpInTheAir said:
This should get you started;
To unpack/repack etc .apk use Apk Manager 4.9 - Makes Modifying Ur Apk A Breeze (Windows/Linux)
To modify .xml files, use Notepad++
Click to expand...
Click to collapse
Thanks a lot mate! Very appreciated

Re-compile framework-res.apk (Custom Rom)

I got this figured out already, sorry about that.
Who ever thanked me, I wasn't posting a guide but a question.
I am trying from a fresh firmware base to learn from scratch but no idea how to get that framework to compile correctly.
did you install framework first?
Code:
apktool if framework-res.apk
Easy
I had problems with the apk tool and recompiling. The way I ended up doing it is:
I didnt decompile the framework-res.apk.
rename the file framework-res.apk.zip
open it with 7zip.
Extract the files you are wanting to work on
Do what ever work on the files you need done
Drag and drop the files back in the directories they go into while file is open in 7zip
Close 7zip
Rename file back to framework-res.apk
push to phone with adb
No decompile or recompile.
Hope this helps
Chadw1985 said:
I had problems with the apk tool and recompiling. The way I ended up doing it is:
I didnt decompile the framework-res.apk.
rename the file framework-res.apk.zip
open it with 7zip.
Extract the files you are wanting to work on
Do what ever work on the files you need done
Drag and drop the files back in the directories they go into while file is open in 7zip
Close 7zip
Rename file back to framework-res.apk
push to phone with adb
No decompile or recompile.
Hope this helps
Click to expand...
Click to collapse
If you just want to modify one of the 'normal' XML files or an image then that approach will work fine. The problem is he wants to edit the bool.xml file and that is contained in the 'resources.asrc' file and you need to decompile it first.
I am in the same situation although someone managed to edit the file for me and recompile it so I got there in the end, just not by doing it myself.
I followed the instructions you describe and the file never recompiled properly - or at least my device never booted with the one I recompiled
Try it like this:
1. Place APK in "place-apk-here-for-modding"
2. Choose "9" to Decompile
3. Grab resource "resources.arsc" from framework-res.apk
4. Do my edit in projects\framework-res.apk\res\values\bools.xml
5. Compile - Yes (system app) - Yes (copy files)
6. Go to "keep" folder and delete "resources.arsc" and the bools.xml file
7. Press any key
8. Either push by ADB or Root Explorer or Flash
nickiberli said:
Try it like this:
1. Place APK in "place-apk-here-for-modding"
2. Choose "9" to Decompile
3. Grab resource "resources.arsc" from framework-res.apk
4. Do my edit in projects\framework-res.apk\res\values\bools.xml
5. Compile - Yes (system app) - Yes (copy files)
6. Go to "keep" folder and delete "resources.arsc" and the bools.xml file
7. Press any key
8. Either push by ADB or Root Explorer or Flash
Click to expand...
Click to collapse
I have tried exactly like this and it didn't work for me. I downloaded lots of different APK tools and tried them all - there were comments about using older versions of apktool.jar etc. I kept getting different sizes of the output file depending on which one I used. I gave up in the end as someone edited the file for me and it was only one specific entry in bool.xmls I wanted changing. As far I could tell we were both doing exactly the same thing.
The last thing I said I was going to do was wipe the PC I was attempting to do this on. I never got round to doing it... I'd be interested to know why I could never get this working though
Andy
Give me the framework and tell me what u want to do.
I will do that for u
Btw is the framework ICS based?
Sent from my Micromax_A70 using Tapatalk 2 Beta-4
You have resigned?
Greets!

[Solved] smali changes not compiling

I don't know if I'm doing something wrong or missing a step but I'm trying to get my status bar transparent following this guide
http://forum.xda-developers.com/showthread.php?t=1523703
I'm using wanams apk manager, I make the changes to the statusbar.smali file and the xml files, I compile and it doesn't work on my phone, so I decompiled the modified apk, and the changes to the xml files went through but the smali files go back to the originals.
when compiling I use yes on Is this a system apk, yes to copy additional files, go to keep, delete resources.arsc and finish.
It happens with any smali file when I compile, I use notepad++ to edit the files.
Solved: So what I ended up doing since my xml files were saving but my smali files weren't, kindof a noob so I didn't realize that when compiling it asks to copy over files and the classes.dex file was overwriting all my changes to the smali files, so I compiled and when it asks to delete files from the keep folder I took the classes.dex from that folder, decompiled it seperatly made the changes to the smali files there. I still deleted my resources.arsc, then I finished making the apk opened the apk and replaced the classes.dex there with my modified one. pushed to my phone and everything works perfectly.
I don't know how it works for other files but try applying the same method somehow; When decompiling and recompiling framework-res.apk, there is a resources.arsc file that is created and placed inside a build folder under the original decompiled folder. Drag that resources.arsc to the NEW apk file you have, and it will work.
I assume you're decompiling a .jar file so maybe it's a classes.dex file. If there is a newly compiled one under some build folder, try placing it into the new .jar file. Make sure the compression method is STORE, or 0 if it's a scale. Try out some combos until it works out.
liinko said:
Solved: So what I ended up doing since my xml files were saving but my smali files weren't, kindof a noob so I didn't realize that when compiling it asks to copy over files and the classes.dex file was overwriting all my changes to the smali files, so I compiled and when it asks to delete files from the keep folder I took the classes.dex from that folder, decompiled it seperatly made the changes to the smali files there. I still deleted my resources.arsc, then I finished making the apk opened the apk and replaced the classes.dex there with my modified one. pushed to my phone and everything works perfectly.
Click to expand...
Click to collapse
Just delete the classes.dex from keep folder and press enter in apk manager menu.. and you're done
?
systemui with smali
in the whole forum not an any solution for compiling with smali

Categories

Resources