I have been looking for this png(see attachment) I changed one in HtcContact.apk. I've found several others like it but not the correct one. it's the default contact image for when you don't assign an image to a contact.
anyone?
also, I have been editting png files by pulling the apk with android commander, then editting or replacing a png using 7zip then pushing back using commander.
any harm in this? I haven't seen any yet........
try taking a peak in the framework files. /system/framework/com.htc.resources.apk and /system/framework/framework-res.apk
No harm, just keep a backup of whatever apk you modify. If something goes wrong you will basically just get force closes until you restore the original file
Thanks, found it in /system/framework/com.htc.resources.apk
Echo2Lincoln said:
Thanks, found it in /system/framework/com.htc.resources.apk
Click to expand...
Click to collapse
Pretty cool. How did you do it? What did you modify in the com.htc.resources.apk?
editing spelled correctly
kenlperry said:
Pretty cool. How did you do it? What did you modify in the com.htc.resources.apk?
Click to expand...
Click to collapse
common_icon_default_avatar.png, people_detail_defaultphoto.png
I edited both of those pics using gimp. I'm not sure which one is the actual image for the contact list cause I got impatient and changed them both.
I sorta followed this thread>http://forum.ppcgeeks.com/htc-evo-4g-themes-mods/133616-how-theme-building-sgbz.html
what I actually did was pull com.htc.resources.apk with the program android commander (http://androidcommander.com/), open the archive with
7zip, copied the png to a seperate folder, edited with gimp, copied back to the open archive, closed the archive and then pushed back to phone.
I must tell you, my profession is in auto repair, I really have no clue what I'm doing but I am having fun and learning as I go...
Related
Noob to theme'ing.
Do I have to make an update zip to theme or can I modify the framework apk and just push that to /system/app?
You can just modify and push framework-res.apk to system/framework/
Sent from my ADR6300 using XDA App
Oddity said:
You can just modify and push framework-res.apk to system/framework/
Click to expand...
Click to collapse
system/framework/
sorry i've been at this computer too long lol
My replacement keeps giving me boot loops.
All I changed was: I duplicated the green lockslider and its components and renamed them to replace the other gray locksliders.
then I compressed the framework-res to a zip (using built in mac zip compression, mac user so i can't use winrar) and change zip to apk. adb push to system/framework/
any ideas what is going wrong?
cupcakera said:
My replacement keeps giving me boot loops.
All I changed was: I duplicated the green lockslider and its components and renamed them to replace the other gray locksliders.
then I compressed the framework-res to a zip (using built in mac zip compression, mac user so i can't use winrar) and change zip to apk. adb push to system/framework/
any ideas what is going wrong?
Click to expand...
Click to collapse
Have you tried installing it via a update.zip?
cupcakera said:
My replacement keeps giving me boot loops.
All I changed was: I duplicated the green lockslider and its components and renamed them to replace the other gray locksliders.
then I compressed the framework-res to a zip (using built in mac zip compression, mac user so i can't use winrar) and change zip to apk. adb push to system/framework/
any ideas what is going wrong?
Click to expand...
Click to collapse
Well this gets to be a bit confusing. I will say what i know hopefully others can help out too.
APKs are just zip containers that are signed, that means there is no compression. In your zip program look for a setting under compression labeled store. You would then have to sign that bad boy in order for your phone to work. You can not use the testsign certificate.
With that being said here is a guide...
Modifying?
PNG's -> open the apk up in the zip program, navigate to the res/whatever_folder_had_the_original and drop your files in.
9.PNGs and XML more complicated. You will have to decompile the apk [apktool] then modify them [look for articles on that, i cant get too indepth here]. Compile the apk. Drag the now compiled xml and 9.pngs to the respective folder open in your zip program.
Really the object is not to mess up the signing that comes with the apk. opening up the apk in a zip program, allows you to view, and replace files with not destroying the signature.
This method will not work with all applications. I have still not figured why some programs work with being signed with a testcert and others are not. I have a hunch that all userspace programs can be test signed and all system files need their own [htc?] key.
Also to note is that for some reason the phone when looking at framework-res, services.jar and others does not seem to mind the differences in CRC of the files stored in it, with what is in the manifest. I still can figure out the phones reasoning to allow this to happen on some but not all apps.
I hope this was not very confusing. I am working on video toturials of this same subject. Stay tuned!
That really helps a lot. Thanks.
I'll try that out tonight. Any recommendations for zip programs with a store feature for mac?
cupcakera said:
That really helps a lot. Thanks.
I'll try that out tonight. Any recommendations for zip programs with a store feature for mac?
Click to expand...
Click to collapse
I use BetterZip on my mac..........open the apk with Betterzip, then extract the res folder to your desktop (or wherever you want). Edit the .png files you want.......steer clear ( unless you know how) of editing the 9.png files. Delete the original res folder from the framework folder and insert the res folder you just edited. Then save the framework-res.apk and push back to where it belongs.
I like 7zip better, but this works okay, since there is no 7zip for a mac.
Betterzip worked perfectly! Thanks again.
i decided to make my taskbar and tasktray transparent so i pulled framework-res from my phone, extracted and modified the images, and then made a flashable zip and reflashed it (i used the update-script from a theme i have that replaces the framework-res so i know it works). it flashes and boots fine and doesnt bootloop or anything but any app i open whether it be settings or gmail or root explorer force closes and theres no way to do anything but scroll on my home screen. the only thing that works is the usb connection type picker.
images i modified:
activity_title_bar.9.png
status_bar_background.png
status_bar_close_on.9.png
status_bar_header_background.9.png
status_bar_item_app_background_normal.9.png
status_bar_item_background_focus.9.png
status_bar_item_background_normal.9.png
status_bar_item_background_pressed.9.png
title_bar_portrait.9.png
i have a sneaking suspicion that its either the title_bar_portrait.9.png and/or the activity_title_bar.9.png
or just *.9.png files in general. all are rgb color and between 50% and 75% opacity if it matters
please help
edit- i took out the title_bar_portrait.9.png and the activity_title_bar.9.png and it works now so it was one or both of them. does anyone know why they broke everything and how to make it so they dont?
Id carry this over to the Q & A forum cause u gonna get told lol
Sent from my phone... I think using Tapatalk??
Patch9 files are not normal png files. You may have destroyed the .9 data by editing it. Also, take a clean copy of your original framework-res.apk off your phone and then using 7zip just open the file (don't unzip), and then drag and drop your modified images into the appropriate folders in the apk. Don't try and resign or make a new framework file.
nukedukem said:
Also, take a clean copy of your original framework-res.apk off your phone and then using 7zip just open the file (don't unzip), and then drag and drop your modified images into the appropriate folders in the apk. Don't try and resign or make a new framework file.
Click to expand...
Click to collapse
thats what i did when i broke it but i fixed it doing that too
nukedukem said:
Patch9 files are not normal png files. You may have destroyed the .9 data by editing it.
Click to expand...
Click to collapse
how can i modify them and restore the data? right now though i have the .9 images from above minus activity_title and title_bar modified and the system seems to be working like a charm. all i did was change the opacity in gimp aside from the background which i changed to a digi camo pattern
daktah said:
how can i modify them and restore the data? right now though i have the .9 images from above minus activity_title and title_bar modified and the system seems to be working like a charm. all i did was change the opacity in gimp aside from the background which i changed to a digi camo pattern
Click to expand...
Click to collapse
You could open the images with the 9patch tool in the sdk and double check them. Then save it using the tool.
Sent from your mom's phone.
i never noticed that before
so just open them with it and save them and i should be all good?
You could try just re-saving them. If that doesn't work, you can use the tool to check for problems. Maybe the easiest way to make sure everything is ok would be to open the original 9patch image and look at how the borders are drawn, then make sure you have the same borders in your image. I'm not an expert on 9patch files, but hopefully that will help you.
I unzipped a apk file to change some of the images in the drawable-hdpi folder, how do I zip it back into an apk file to reinstall it on my phone. Or can I flash the zip file? I dunno how that would work...
Sent from my HTC Vision using XDA App
Can you get another copy of the apk?
If you can then the best thing to do is use winRAR or 7zip to open/explore the apk just like with a .zip file. That way you never unzip it and don't run into that issue. Using those allows you to delete and add files. You can also do the same thing on your phone using root explorer or something similar.
As far as correcting what you've done already (assuming you can't get a copy of that apk) I've completely forgotten since I never have to do it. I know if you look on the android sdk's site you can find the answer though.
adamtheindien said:
I unzipped a apk file to change some of the images in the drawable-hdpi folder, how do I zip it back into an apk file to reinstall it on my phone. Or can I flash the zip file? I dunno how that would work...
Sent from my HTC Vision using XDA App
Click to expand...
Click to collapse
An apk is just a zip file with the apk extension, once you zip it up change it from a .zip to a .apk
Sent from my T-Mobile G2 using XDA App
i changed what i wanted and rezipped, changed the extension, tried to install it, says problem parsing the package?
adamtheindien said:
i changed what i wanted and rezipped, changed the extension, tried to install it, says problem parsing the package?
Click to expand...
Click to collapse
It can also depend on which APK (system vs non-system) and which images (.9 images can be tricky to replace if you don't know what you are doing). Sometimes, you also need to re-sign the APK, depending on what you modified (there are tools to re-sign in the SDK or you can use something like APK Manager).
You should try the opening the APK directly in WinRAR/7-zip and replacing the images method. In my experience, if you are just replacing simple images, you usually don't have to re-sign when doing this (it leaves the existing signature intact).
ok i mainly just replaced images and and edited a couple. i dont know how to use all that adbsdkwhatever stuff.... -_- i know i should but im too lazy. so i dunno how to re sign it...
all im trying to do is edit the quick search bar images. maybe i dont have to do this if there is somewhere to find themed search bars?
If you can then the best thing to do is use winRAR or 7zip to open/explore the apk just like with a .zip file.
Click to expand...
Click to collapse
If your using winRAR click and drag stuff works if its one or two files.
If its a lot of images or a large file like framework-res.apk (I'm thinking your search bar might be in there if I'm not mistaken) then you'll want to make a new ZIP archive with "store" compression (uncompressed pretty much).
(also you shouldn't need to resign the framework-res.apk)
I haven't tested 7zips click and drag but the same principals apply. If its bigger files being recompiled Winrar tends to compress it a bit and sometimes it causes bootloops.
That being said, don't forget to nandroid
82_Z28 said:
If your using winRAR click and drag stuff works if its one or two files.
If its a lot of images or a large file like framework-res.apk (I'm thinking your search bar might be in there if I'm not mistaken) then you'll want to make a new ZIP archive with "store" compression (uncompressed pretty much).
(also you shouldn't need to resign the framework-res.apk)
I haven't tested 7zips click and drag but the same principals apply. If its bigger files being recompiled Winrar tends to compress it a bit and sometimes it causes bootloops.
That being said, don't forget to nandroid
Click to expand...
Click to collapse
Well from my experience, 7zip handles the task like a champ. I've taken every image out and put others back in with no issues. The downside is that some apps set certain dependencies in the .xml files so if you delete the wrong things it won't install and if it does, all you get is a fc all day. In that case it helps to know how to convert the xml binary to something readable (unless you're a king a hex editing).
I'm having issues opening xml files in .apk like framework-res.apk. I've extracted the .apk using apk multi-tool and I have access to all the files but when I open it in a browser it's a blank page and if I open it in notepad I get a bunch of random characters. Is there a step I'm missing? Do I need to put these xml files through another filter before I can see/edit their contents?
yoft1 said:
I'm having issues opening xml files in .apk like framework-res.apk. I've extracted the .apk using apk multi-tool and I have access to all the files but when I open it in a browser it's a blank page and if I open it in notepad I get a bunch of random characters. Is there a step I'm missing? Do I need to put these xml files through another filter before I can see/edit their contents?
Click to expand...
Click to collapse
Since u Use apk multi tool, DECOMPILE not extract, and recompile when finished yep, that easy
*edit
Side note, internet explorer and NOTEPAD to edit code? Seriously? Lmao I always use notepad++ xD should check it out.
doug36 said:
Since u Use apk multi tool, DECOMPILE not extract, and recompile when finished yep, that easy
*edit
Side note, internet explorer and NOTEPAD to edit code? Seriously? Lmao I always use notepad++ xD should check it out.
Click to expand...
Click to collapse
Ah thanks a lot! And yeah I'm just starting, I haven't edited xml files before, so far all I've managed to do is make graphical changes by replacing/editing pictures in an .apk so I'm starting to dip into xml editing. I'm sure once I get my footing I'll switch to a dedicated xml editing tool but for now, I just want to see what they look like xD
I am looking to modify my phone.apk to change the color of a few buttons and the android guy that shows up when in a call. I have done this in the past and it seemed like then it was as simple as deleting the files in 7-zip and replacing with the file I wanted. Am I missing something or is it not that simple. Every time I try to move a file or delete it its says "not Implimented" or un supported compression method. I know how to push and pull files through adb so if I could just get the .png images where I want them then I would be all set. I have looked everywhere but cant seem to come up with a solution.
Thanks Jason
PS. the files are from another rom I am simply trying to use them in my current rom so the .png file should not be corrupt or broken.
You can't edit apk's with any zip extractors
Sent from my Incredible using xda premium
Albinoman said:
You can't edit apk's with any zip extractors
Sent from my Incredible using xda premium
Click to expand...
Click to collapse
Not true, regular image files can (should) be able to be draged out, edited, and droped back in an apk using 7-zip.
nighthawklude99 said:
I am looking to modify my phone.apk to change the color of a few buttons and the android guy that shows up when in a call. I have done this in the past and it seemed like then it was as simple as deleting the files in 7-zip and replacing with the file I wanted. Am I missing something or is it not that simple. Every time I try to move a file or delete it its says "not Implimented" or un supported compression method. I know how to push and pull files through adb so if I could just get the .png images where I want them then I would be all set. I have looked everywhere but cant seem to come up with a solution.
Thanks Jason
PS. the files are from another rom I am simply trying to use them in my current rom so the .png file should not be corrupt or broken.
Click to expand...
Click to collapse
My guess would be that the apk was decompiled at some point before, but not recompiled right, or with the right program. Which phone.apk are you having issues with, the one on your phone or the one your pulling the pngs from?
I am having problems with the phone.apk I pull from my phone with adb, with the phone.apk that is in the original rom, and the phone.apk that is in a nanadroid back up. The rom I am running is anthem 3.3. I am starting to think that there is a problem with 7-zip on my computer. Is there a setting I need to change? I have even ran 7-zip as administrator to see if that helped.
nighthawklude99 said:
I am having problems with the phone.apk I pull from my phone with adb, with the phone.apk that is in the original rom, and the phone.apk that is in a nanadroid back up. The rom I am running is anthem 3.3. I am starting to think that there is a problem with 7-zip on my computer. Is there a setting I need to change? I have even ran 7-zip as administrator to see if that helped.
Click to expand...
Click to collapse
Sounds like your install of 7z may be messed up. I just tried it to make sure something didnt change in an update and it works fine for me still with default configuration.