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.
Related
i love the modaco custom rom but would like to add the lockscreen from drizzys custom rom. (or any plain android looking lockscreen)
is there a way to extract the files i need and simply replacing them in the MRC? i guess its just an html file or something like that to replace, right?
I guess this is the HTCLockScreen.apk and .odex but since it's a system app, it cannot be installed or unistalled, and overwirting the apk in the system/app folder doesn't do anything.
If someone knows how to do it I will be very interested too.
im not sure if it will work but you can download my rom go to
system/framework
grab com.htc.resource.apk
now adb push com.htc.framework.apk /system/framework/
then reboot!
steps:
adb remount
adb push com.htc.framework.apk /system/framework/
adb shell
reboot
then if your phone loops then it didnt work, but if you go straight to you home screen then it should be fine!
good luck
"im not responsible for any wipes that you will have to do if you phone loops"
piflechien said:
I guess this is the HTCLockScreen.apk and .odex but since it's a system app, it cannot be installed or unistalled, and overwirting the apk in the system/app folder doesn't do anything.
If someone knows how to do it I will be very interested too.
Click to expand...
Click to collapse
its not in the lockscreen!
its in the framework!
Or you could do what I did, pull com.htc.resources.apk from the phone, extract it with 7zip edit the .png files in res/drawable-land-480x320/ and res/drawable-port-480x320/ then zipped it and built the apk using apkbuilder.
Then push it to the phone, as usual make backups.
soulehmoo said:
Or you could do what I did, pull com.htc.resources.apk from the phone, extract it with 7zip edit the .png files in res/drawable-land-480x320/ and res/drawable-port-480x320/ then zipped it and built the apk using apkbuilder.
Then push it to the phone, as usual make backups.
Click to expand...
Click to collapse
Thank you very much.
It works perfectly.
BR. Simemu
Thx it worked perfectly
I just pushed com.htc.resources.apk into the /system/framework folder.
Now is it also possible to change the notification bar with a similar method ?
I love the one from your Rom Drizzy Drake Rogers.
They are in framework-res.apk
A few jpg and png named status* in res/drawable-480x320/
Same method should apply.
As usual, would be smart to back up.
Edit: When I get some time off I may have a day messing with these files see about some different coloured UI's etc.
for me this does not work
what ive done is:
1. get the com.htc.resources.apk
2. extract it with rar
3. changed the mentioned png files
4. then i put them back into the archive (apk file, renamed as a zip file)
5. renamed the zip back to its original name
6. put the file as mentioned to the correct folder
there is no change.. is it a MUST to use apk builder, if yes, how to use that bat?
felikz said:
for me this does not work
what ive done is:
1. get the com.htc.resources.apk
2. extract it with rar
3. changed the mentioned png files
4. then i put them back into the archive (apk file, renamed as a zip file)
5. renamed the zip back to its original name
6. put the file as mentioned to the correct folder
there is no change.. is it a MUST to use apk builder, if yes, how to use that bat?
Click to expand...
Click to collapse
reboot and see if that works!
yes i did that, its not the case..
did you guys do it my way, or did you use adk builder?
Yeah use apk builder. Should work.
Edit: you sure its named right and in the right place?? It should have overwritten your old one.
and how to use apk builder??
okay, i signed the new apk with this http://www.anddev.org/signing_your_apk-application_for_release_keytooljarsigner-t3069.html
but that didnt work (the sign process worked, but then the hero looped)..
can anyone please tell how to sign the apk with apkbuilder??
Did you sign the .apk or the .png ????
Sorry...but i didn´t got a solution...i´m standing in front of the same problem like you
easier method here
http://forum.xda-developers.com/showthread.php?t=536271
no need to bother with apk builder with this method.
boomshaker said:
Did you sign the .apk or the .png ????
Sorry...but i didn´t got a solution...i´m standing in front of the same problem like you
Click to expand...
Click to collapse
signed the apk
soulehmoo said:
easier method here
http://forum.xda-developers.com/showthread.php?t=536271
no need to bother with apk builder with this method.
Click to expand...
Click to collapse
also this does not work for me --> phone loop
any idea, what i could do wrong? i am using windows paint (windows 7) to edit the files.. then i put the edited png files back into archive (thus, overwrite the files there) and push that apk file again back to its path.. after phone reboot the phone goes into endless loop
soulehmoo said:
Or you could do what I did, pull com.htc.resources.apk from the phone, extract it with 7zip edit the .png files in res/drawable-land-480x320/ and res/drawable-port-480x320/ then zipped it and built the apk using apkbuilder.
Then push it to the phone, as usual make backups.
Click to expand...
Click to collapse
I want to change my lockscreen, it all seems to make sense apart from editing the .png files..
What am I supposed to be changing in the files? Maybe I missed something, but that doesn't seem to have been explained
pookie1 said:
I want to change my lockscreen, it all seems to make sense apart from editing the .png files..
What am I supposed to be changing in the files? Maybe I missed something, but that doesn't seem to have been explained
Click to expand...
Click to collapse
tha background image of your lockscreen can be changed easily in the phone settings, but if you wanna change the other parts of the lockscreen, then you need to do it like told here ;-)
felikz said:
also this does not work for me --> phone loop
any idea, what i could do wrong? i am using windows paint (windows 7) to edit the files.. then i put the edited png files back into archive (thus, overwrite the files there) and push that apk file again back to its path.. after phone reboot the phone goes into endless loop
Click to expand...
Click to collapse
common guys, just a feedback!
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 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 trying to remove some transitions from a rom ZIP and perhaps replace them with some taken out of another. Does anyone know where they are located in the .ZIP or some other way to remove/replace them? A little help would be greatly appreciated.
crimeslunk said:
I'm trying to remove some transitions from a rom ZIP and perhaps replace them with some taken out of another. Does anyone know where they are located in the .ZIP or some other way to remove/replace them? A little help would be greatly appreciated.
Click to expand...
Click to collapse
Use 7zip. You need to pull the framework-res.apk from the phone and put it on your computer. Open with 7zip. You'll see a folder called 'res'. Open it. The first folder you see is then 'anim'. That folder contains your animations/transitions. So you would take the animations folder you want, and copy them to the anim folder in your framework-res.apk (replacing the existing). Then push your framework-res.apk to /system/app . That should give you your new animations. That's how I do it, and Myn posted up on how to do that in his thread, teaching us how to do that. Cool.
Sent from my PC36100 using XDA App
Or you can do it with astro file manager. Just copy the apk and take it out of a zip and swap the files. Then copy the updated apk where it would go in the zip.
Sent From My HTC Evo 4G On The Now Network From Sprint Using Tapatalk Pro!
Thanks alot guys I really appreciate it. I'm wondering if I use winrar can I just insert the transitions over the old ones the completely reflash the rom?
Edit: Ok if have found the framework-res.apk but I'm not exactly sure how to open it and look "inside" I'm using Winrar I'm thinking this is the same as 7zip for the purposes of searching through the zip but I'm not seeing compatibility with the .apk.
crimeslunk said:
Thanks alot guys I really appreciate it. I'm wondering if I use winrar can I just insert the transitions over the old ones the completely reflash the rom?
Edit: Ok if have found the framework-res.apk but I'm not exactly sure how to open it and look "inside" I'm using Winrar I'm thinking this is the same as 7zip for the purposes of searching through the zip but I'm not seeing compatibility with the .apk.
Click to expand...
Click to collapse
I can't say, because I don't use winrar. However, I know it works with 7zip, I change animations all the time. I can never decide if I like the flip or the fold animations. Anyways, try 7zip, I don't have a download link, but Google should take care of ya. 7zip allows you to open the .apk, so you can navigate to the 'res' folder, and then find the 'anim' folder. Good luck.
Yeah it worked great thanks. Stupid amon was giving me problems at first about it being signed but I just turned off verification. Btw how do you go about signing something?
Not sure if this is the right spot or should actually go in development or here since I got lectured for putting it in development the last time.
But what I am trying to do is decompile the framework file from the stock rom and change a xml and recompile so as to bypass the tetheringprovison call.
The last time I did this on the HTC One S I ran into the trouble that the recompiled verision didn't work and ended up just opening the recompiled apk as a zip pulling the xml and replacing it in the original apk and load that.
That seemed to do the trick on that phone.
I think the problem is with compression as the output apk I get after recompiling is never even close to the original size.
I am having the same issue when it comes to the file for the gs3.
So far I haven't tested a recompiled one yet since I haven't rooted yet but just working on the file.
That is a job for a little later on my days off where I don't need my phone.
But with this one the file I am looking for once it is decompiled shows in res/values/arrays.xml for this one. How ever if I open either the source file or the recompiled when I don't see those values folders anywhere inside.
I am not sure if they are just hidden in something else or where the other files are.
I am using the newest verision of apk multi tool to recompiling and decompiling with compression values tested at 1 and 0.
both the framework-res.apk and twframework files are loaded into it as well as dependencies.
Any ideas on the best way of changing out this one file?
Or if anyone can recompile one with the following arrays.xml file instead that I have attached.
When it is decompiled it does show the right folder string "\res\values" and the array.xml inside I have just made a change to the xml that would not check the tethering provision on the device to allow the built in tether to work again. and a recompiled verision with that file will bypass any tethering check
any help would be greatly appreciated.
*edited* to include the arrays xml
Anything found in the "values" directory are not going to be visible inside the apk they are files used to build the actual apk that tells the other XML and other files where things are. Compression won't break an apk. What exact file are you editing? Also you are going to have to root if you want to put the modded file back on the device..
Sent from my SGH-T999 using Tapatalk 2
Yeah will be rooton on day off so i dont have to worry about it too much.
But with the arrays file that has a call in it to consult a different program before starting tethering.
I have changed that file so it dont check anymore.
This worked on it before with it just unlocked and a different apn update came and dont work anymore.
I am just confused that why it recompiled before for the one and wouldnt work right.
Based on what i read should be no problem as long as both frameworks are installed to the apk multitool
M9x3mos said:
Yeah will be rooton on day off so i dont have to worry about it too much.
But with the arrays file that has a call in it to consult a different program before starting tethering.
I have changed that file so it dont check anymore.
This worked on it before with it just unlocked and a different apn update came and dont work anymore.
I am just confused that why it recompiled before for the one and wouldnt work right.
Based on what i read should be no problem as long as both frameworks are installed to the apk multitool
Click to expand...
Click to collapse
I decompile framework-res.apk all the time with no issues. What is the exact issue you're having?
Sent from my SGH-T999 using Tapatalk 2
Just that when I decompile the framework-res.apk replace one xml file and recompile it using the multitool (am using the system apk with dependancies and linking the twframework) and then try and load it on the phone it seems to cause it to crash.
M9x3mos said:
Just that when I decompile the framework-res.apk replace one xml file and recompile it using the multitool (am using the system apk with dependancies and linking the twframework) and then try and load it on the phone it seems to cause it to crash.
Click to expand...
Click to collapse
You cannot replace XML files with other XML files. You have to open the XML in notepad++ and edit the actual lines of code then recompile. And I thought you weren't rooted so how are you able to push the app back to the device? Also, are you setting correct permissions for the newly compiled apk?
Sent from my SGH-T999 using Tapatalk 2
Yeah sorry for the late reply.
I am still tinkering with it. I wanted to root just till I had a day off that it wouldn't kill me to have the phone down for a little.
I will be rooting it in the next day or two since I am off.
After recompiling the APK and pulling the XML out of that one and putting in the original was the only way I could get the change to take on the One S.
When I was testing then, and will try the same procedure with the GS3, is after recompiling it with the tool I would put on sd card then using twrp copy to the phone and chmod 644
Out of curiosity what would be the DD command for backing up the recovery to the sd card?
I am having trouble finding that.
I would like to have that to flash back on the phone as I am planning to try this again from within twrp and see what happens.
From my understanding for triangle away to work you need to be on stock recovery right?
Ok
Now I have a new problem I have stumbled upon.
I have modded the file but when I try and push it with ADB from the pc even after system mounted it tells me that permission is denied.
Any ideas why that is happening?
Tried copying over with root explorer and that froze during copy and then resulted I'm a boot loop.
Not sure if that was because of the method or a problem with the file I made.
When decompiling does that need to be done with the twframework dependence or just simple decompile?
Also then after switching the arrays.xml I can just recompile with no compression or do I have to do something with keeping files.
Since the arrays is in something else I'm not sure what it shouldn't keep.
Any ideas would be greatly appreciated.
And I can't find if should either be zipaligned or signed. Some articles say signed some say don't sign system apks
Holy crap... youre allllllllllll over the place one bite at a time.. Quick answers first:
You do not need to backup your recovery. It is flashable via Odin and is much safer to flash via odin then it is using DD. With DD, you could flash the wrong partition by a simple slip of a keystroke. IE you typed '9' instead of '0'
Secondly: You got that 'freeze' issue using Root Explorer because framework-res.apk is constantly in use by the system. The BEST way to apply any system file is by creating a flashable zip file then applying it through recovery.
Thirdly: You do NOT need stock recovery to use Triangle Away, ive used it twice now with CWM as my recovery.
About your issues with decompiling recompiling.. I dont think its necessary to install the twframework... i dont recall if i had to when i was on Frosty, but doing "java -jar apktool.jar if <twframework here>" wouldnt hurt.
Also what exactly are you trying to modify?
Yeah Sorry about that
was just as I was reading other things and playing with it I kept coming across other questions.
Was thinking about that with the recovery so I am just going to skip doing that and flash a custom one then.
Was trying to do it without switching to avoid tripping the counter but seems like that is un neesicary
I am looking to stay on the stock software of the phone but want to edit the arrays file out of the framework so it don't check for tethering provisions.
Previously I was able to tether just by changing the APNs on the device now I can't do that. Says I don't have a tmo tathering plan. But also not with T-Mobile so that is problematic.
M9x3mos said:
Yeah Sorry about that
was just as I was reading other things and playing with it I kept coming across other questions.
Was thinking about that with the recovery so I am just going to skip doing that and flash a custom one then.
Was trying to do it without switching to avoid tripping the counter but seems like that is un neesicary
I am looking to stay on the stock software of the phone but want to edit the arrays file out of the framework so it don't check for tethering provisions.
Previously I was able to tether just by changing the APNs on the device now I can't do that. Says I don't have a tmo tathering plan. But also not with T-Mobile so that is problematic.
Click to expand...
Click to collapse
Quick question, are you running Stock Jellybean? And who is your carrier? There was a hacked apk that enabled tethering.. not sure what its called. just read about it. Never tried/downloaded it.
i got this to work last night for frosty 11.2.1, AllenD87 over at the att forums helped me get it right.
I have the stock jellybean on tmo device and use with simple mobile service
Just checked out the other one hack/mod that was looking like the same kind of mod where made changes to the framework and put it back.
different firmware so I don't that I should try that on mine.
i just decompiled framework-res.apk made the changes and recompiled. put it in the rom and flashed the whole rom.
Trying to keep the absolute stock rom.
I just installed twrp since it has file manager so I don't need to make a flashable zip but just copy over and chmod 0644
first attempt gave me a boot hang so I am going to try compiling with a different tool
Ok found out the problem was the multi tool inwas using
Used the beta instead and everything worked ok