# How to modify Phone.apk?



## markdmac (Dec 9, 2011)

Wondering if anyone can help me figure out what I am doing wrong. I want to modify the phone dialer images contained in drawable-xhdpi in Phone.apk.

I have modified my images and successfully installed the APK in a Mod I have developed. I can see that my updated APK is on the phone, yet the images in the dialer are still stock.

Thinking maybe I needed to re-sign the APK, I decompiled, optimized images, recompiled, zip aligned and signed the APK and pushed it out again via my mod. Still no joy.

I don't understand where the system is getting the old images from since I replaced those. Can anyone shed some light on this issue?

Thank you.

Mark


----------



## JBirdVegas (Jun 11, 2011)

adb remount
adb push local.apk /system/app/.
adb reboot *may not be required *


----------



## Gunthermic (Nov 3, 2011)

That's because if your trying to change the dialer when you hit your phone app, those dialer images are in contacts.apk. the ones in phone.apk are only when your in a call and hit the little dialer image to conference call or say type in you voicemail access number.

Of note you can't decompile and recompile contacts.apk unless from source code. You can however drag your button images into correct resolution folder via 7zip

Sent from my Nexus 7 using Xparent Blue Tapatalk 2


----------



## markdmac (Dec 9, 2011)

Just want to update people on this. I was 100% successful in decompiling and recompiling both Contacts and Phone apks using apkmanager.

The secret to success for both is to first open the files up with 7zip and export the classes.dex files (save you will need them later) and delete them from the apk. You can now decompile. Add the classes.dex into the root of the decompiled folder so it can be included when you recompile.

For Phone.apk, you will encounter a lot of errors on the recompile thanks to bad XML files in a few languages. The key here is to read the errors and correct them. Essentially there are the following problems with strings:

Strings that were broken onto multiple lines. Make them on one line.
For the above lines, remove the extra double quotes that are on the inside of the ><.
Look for apostrophes and put a \ in front of them.
Lastly there will be a bunch of lines with variable replacement codes in them like %1$d. These are all just text strings for some kind of error messages. Seems to be problems with all the stuff surrounding throttling. I simply removed the codes as I don't really care about such messages. Wish I understood the variables better but again, these were very limited messages and I don't see this as a major issue.
There is a lot to clean up, but don't let anyone tell you that this cannot be done because it most certainly can.


----------

