Project Ara Smartphone Will Run Modified Android L with Hot Swapping

Project Ara is a very exciting topic–both for hardware and … more

Streamline Android Theme Customization with Graphic Porter

I dont have a custom theme on my Android phone, and the reason for this is because … more

Boost the Brightness of Your Sony Xperia Z1’s LED

I think the last time anyone has ever used a physical torch to find their earphones, … more

XDA Xposed Tuesday: Modify the Look of Your Volume Control – XDA TV

How many screenshots have you seen with a volume status bar in the … more
Post Reply

TUTORIAL - Swapping out PNG's in .apk

25th December 2011, 07:06 PM   |  #1  
OP Senior Member
Thanks Meter: 225
 
272 posts
Join Date:Joined: Dec 2009
Swapping out PNG's!

**This is for system apk's, not for market ones. To modify apps you've downloaded and installed, you will need a program like the fantastic Apk Manager, since non-system apps are signed and have to be resigned after getting messed with**

*MY TYPICAL DISCLAIMER!*
I AM NOT A DEV! I just like tinkering with this phone because I'm overall an extremely picky and obsessive person. I have no prior android experience (besides a little tinkering with my X10), and am in NO way an expert. But since I know how to mess with my phone a little bit and I've been asked to share, I will =) But follow these instructions at your own risk! I am not responsible for the untimely death of your phone, so please be cautious and careful, and if you have any questions about any step, before you try it, ask me or someone who knows! I don't want the blood of your dead phone on my hands! It's Christmas, after all! =)
These instructions are for Windows computers. Sorry, I'm just not familiar with mac or linux. =(


***Swapping out PNG's***

Okay, so say you have an icon or an image in your phone that you just don't like and would like to swap out with something (or swap out with nothing, so you can't see it at all). Here is what you'll need:

7zip for your computer
Root explorer for your phone
Some kind of image editor. I'm partial towards Paint.net. =) (Only if you're actually going to edit an image. If you're just going to swap it out for something else, you obviously won't need this.)

Here is a good example of something where I really felt like I needed to change some images we can use that I just discovered last night while calling to activate my credit card over the phone. Here is the dialer when you start the phone:



Notice those handy letters next to the numbers =)
Once I started the call to the credit card company, it asked me to verify myself by inputting, using the keypad, the letters of my mother's maiden name. So I opened the dialer, and what did I see?



For whatever STUPID STUPID REASON, they REMOVE the letters next to the numbers on the keypad that opens DURING the call, making it extremely difficult for me to type my mother's maiden name in the time permitted, given that no, I don't off the top of my head know where the letters sit on the dialer. So I felt this needed fixing =)

1.) Copy the apk you want to modify from your phone (using root explorer) and transfer to your computer

In this case, I wanted my Phone.apk, which is in /system/app. The vast majority of system apps are in this folder with the major exception of framework-res.apk, which is the phone’s BIG cajone in /system/framework, and as such, should be handled with utmost care. Messing with framework-res.apk incorrectly is an EASY way to brick your phone in a heartbeat.

2.) Unzip the apk using 7zip and look for your PNG's!

Keep the original, untouched, zipped apk somewhere safe on your computer. You’re going to need one to modify and another copy for safekeeping in case you want to revert back to the stock apk, or something goes wrong. Unzipping the apk just makes searching for the PNG you’re looking for much easier, since you can change the folder view in windows to give you a thumbnail of each of the items. And lookee, lookee, here they are in phone/res/drawable-hdpi, right next to other dial buttons with those handy letters!!



3.) Edit your PNG's however you want.

In this case, the work is pretty much done for us! I just swapped out the PNG's without the letters for copies of the ones with the letters, and just changed the names of the files to the original versions, like so:



4.) Using 7zip, right click on the original, untouched apk, choose 7zip, and open archive. DO NOT EXTRACT.

Open archive will let you explore the apk without having to extract it and lose the proper packaging of the apk.

5.) Select all your newly modified PNG’s and drag and drop them into the correct location in the open archive of the original apk, letting them overwrite the old PNG’s.

6.) Put this newly modified apk back onto your phone. Using root explorer, copy the new apk into the /system folder of your phone.

7.) CHANGE THE PERMISSIONS of the apk to match those of the original apk in /system/app.

In this case, long press on the phone.apk, select permissions, and select the check boxes as follows- Owner: Read, Write; Group: Read; Others: Read. This matches the permissions of phone.apk in /system/app

8.) Move the new apk into /system/app, and let it overwrite the original!

9.) Restart your phone!

Voila! Now when I call my credit card company and have to type in names, I can!

Last edited by itiskonrad; 29th January 2012 at 02:08 PM.
The Following 8 Users Say Thank You to itiskonrad For This Useful Post: [ View ]
29th January 2012, 06:25 AM   |  #2  
stephensonbrady's Avatar
Member
Flag thousand oaks
Thanks Meter: 17
 
88 posts
Join Date:Joined: Sep 2010
More
Just got my nitro yesterday. your mod worked like a charm.
2nd February 2012, 09:57 PM   |  #3  
hyelton's Avatar
Recognized Contributor
Flag Wilmington
Thanks Meter: 2,483
 
5,077 posts
Join Date:Joined: May 2010
Donate to Me
More
Well I cant use it:/ Anything I try I get Access Denied! Using Windows 7. Getting it with 7-zip and Winrar same error just access denied or storage full when trying to copy over a PNG.
14th March 2012, 02:23 AM   |  #4  
PMad's Avatar
Senior Member
Flag Oregon
Thanks Meter: 41
 
146 posts
Join Date:Joined: Sep 2010
More
Quote:
Originally Posted by hyelton

Well I cant use it:/ Anything I try I get Access Denied! Using Windows 7. Getting it with 7-zip and Winrar same error just access denied or storage full when trying to copy over a PNG.

You need to copy the file to your SD card, no other place.. And when using Root Explorer, you have to make sure that when your in the System/app folder, you have to tap the button at the top of the screen that says "Mount R/W" and when you do, the button will change to "Mount R/O", that will allow you to modify things in that folder.

---------- Post added at 06:23 PM ---------- Previous post was at 06:15 PM ----------

Here's my problem:

I follow the instructions to the T, after changing the permissions of the file, i paste it in the System/App folder and immediately the phone app starts force closing, constantly non stop. I have to hold the power button to bring up the menu and mash the force close button as fast as i can until my finger ends up hitting the power off button that is underneath the force close button, than i can hit the ok button and restart. When i do that and the phone boots back up, some phone storage thing force closes a few times, then after a few minutes the phone app itself force closes, and regardless of anything, my modifications are never there!

If i try to call anybody, my phone loads skype and calls, and if i try to call voicemail, i get ANOTHER force close, android.process.acore

Also, my phone is stuck with no signal, probably why skype tries to load..

I'm assuming this is because my phone is completely stock with root? I need to deodex it to do this stuff right?
Last edited by PMad; 14th March 2012 at 02:29 AM.
The Following User Says Thank You to PMad For This Useful Post: [ View ]
14th March 2012, 03:36 AM   |  #5  
PMad's Avatar
Senior Member
Flag Oregon
Thanks Meter: 41
 
146 posts
Join Date:Joined: Sep 2010
More
Ok so I did it again, but this time, instead of making my own custom PNG files, i copied the ones with the letters, renamed them to the names of the ones without the letters, pasted them back, overwrote them, added them to the APK, and put it back on the phone.. Same problems happened, but i noticed something.

When changing the permissions of the file in Root Explorer, they dont stick.. Once i open up the permissions window again they are back to the way they were before, so i can only change the permissions of the file after copying it over and rebooting. I have all the same problems as before, except once i change the permissions of the file and reboot, everything seems to work fine once the phone is fully booted up, and the changes stuck.

So seems there's an issue with something im doing with the new PNG files, or 7zip isnt reconstructing the file 100% back to normal but close, or something... Either way, now im off to one change at a time! ugg...
14th March 2012, 04:59 AM   |  #6  
PMad's Avatar
Senior Member
Flag Oregon
Thanks Meter: 41
 
146 posts
Join Date:Joined: Sep 2010
More
Found my issue! I totally missed step 6 for some reason! Haha all good now
5th April 2012, 08:48 PM   |  #7  
iJimaniac's Avatar
Senior Member
Thanks Meter: 414
 
1,353 posts
Join Date:Joined: Oct 2011
Okay, so nice tutorial! I am just wondering since you say framework-Res.apk is so dangerous, are you saying I could brick my device using this method, or is this method fine? I am not going to mess with the .9 pngs, just regular pngs.
5th April 2012, 10:26 PM   |  #8  
OP Senior Member
Thanks Meter: 225
 
272 posts
Join Date:Joined: Dec 2009
This method is fine, but you have to be very careful to follow the protocol precisely (in particular, the parts about using root explorer and changing permissions properly). If you have any questions, please ask. And as usual, be sure to have both a nandroid and titanium backup of your phone juuust in case of the unexpected...
22nd May 2012, 05:33 PM   |  #9  
Ticklefish's Avatar
Recognized Themer
Flag UK
Thanks Meter: 3,496
 
3,943 posts
Join Date:Joined: Oct 2011
More
Quote:
Originally Posted by iJimaniac

Okay, so nice tutorial! I am just wondering since you say framework-Res.apk is so dangerous, are you saying I could brick my device using this method, or is this method fine? I am not going to mess with the .9 pngs, just regular pngs.

.9 png's aren't that bad, as long as you know what to do with them.

To put in one simple line....don't touch the 1 pixel wide border around the edge!!

That's it really. The border isn't part of the image, it's instructions for stretching the image. As long as you avoid changing it, you can change the actual image itself as much as you like.
22nd August 2012, 02:10 PM   |  #10  
Junior Member
Thanks Meter: 1
 
10 posts
Join Date:Joined: Jun 2012
Hey.....thank u for the tutorial.....
i tried replacing the png's in Framework-res.apk.....there was a change in the size of the apk
and when i copied it in system/framework phone wont boot....but am able to go into recovery.....

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes