[Motorola Photon 4G] Th3Bill:
How to modify your framework-res.apk

There are plenty of "How-to's" out there that I've seen for modifying the framework-res.apk. I've tried probably 20 of them...all resulted in getting stuck in a bootloop. Finally figured out a method that works.

Here goes:

THIS IS FOR LINUX BASED USERS

Go to www.jokersax.com and grab my tool.zip under Th3Bill Mods

Extract it in your HOME folder

Inside it you will find 2 versions of apktool. There is a good reason for that, which you will see later.

You also need a good xml editor like Editra (available in most distros packages)

Need an archive manager as well (I recommend File Roller)

[COLOR="green"[B][U]]Initial Setup:[/U][/B][/COLOR][/SIZE]

[SIZE="3"]1) Open your Home folder and select to show hidden files

2) Open your .bashrc file

3) Add the following lines to the bottom of the file

export PATH=${PATH}:~/bin

export PATH=${PATH}:~/tool/reg

export PATH=${PATH}:~/tool/ics

Then save the file

4) Open your .profile file

5) Add the following line to the bottom of the file

PATH="$HOME/tool/ics:$HOME/tool/reg:$PATH"

Then save the file.

Now, on to editing

1) Navigate to the framework folder that your framework-res.apk is in.

2) Open a terminal

3) Type in "reg if framework-res.apk" no quotations and press Enter

4) Type in "reg d framework-res.apk" no quotations and press Enter Now minimize terminal (you'll use it later)

5) You should see in your file manager the folder called framework-res. This is your decompiled framework-res.apk

6) Make your edits. be careful....this file controls a TON of things in your system, and you can make some major problems for yourself if you edit things incorrectly.

7) Once your edits are done, go back to your terminal session

8) Type in the following "ics b framework-res" no quotations (where *username* is your account username) and press Enter.

9) It should recompile correctly. You'll have a framework-res.apk in the /framework-res/dist folder. DO NOT USE THIS ONE WILL CAUSE BOOTLOOPS!!

10) Open it with an archive manager and extract the resources.arsc as well as any files you edited in the xml folder.

11) Go back to your ORIGINAL framework-res.apk and open (not extract) it in your archive program

12) Add in the files you extracted from the edited framework-res.apk, placing them in the appropriate folders

13) You're done! :)

Cheers!

P.S. If you get a recompile error that mentions plurals, you have some work to do. Go to the values folders one at a time and look for the plurals.xml files. You will see a bunch of entries....scroll all the way down till you see a section that looks like this:

<plurals name="matches_found">

<item quantity="other">%d of %d</item>

<item quantity="one">1 match</item>

you need to edit this section to look like this:

<plurals name="matches_found">

<item quantity="other">%1$d of %2$d</item>

<item quantity="one">1 match</item>

This must be done for EACH plural.xml file...placing 1$ behind the first % and 2$ behind the second one. Save each as you go. Then recompile, and you should be good to go.

HOW TO LOGCAT PROPERLY

Here's how to logcat so that a dev can actually help fix your issue

SETUP

1) Download Android SDK from HERE

2) Place it directly in your HOME folder

3) Extract the file there and rename the folder android-sdk

4) Go to the platform-tools folder and double-click android

5) Download at least the tools and platform-tools. You can download other stuff, but that's unnecessary for this exercise.

6) Close SDK when it's done

Now to LOGCAT

1) Navigate to the /platform-tools folder.

2) Open a terminal

3) Type in either A or B depending on your system

A) (works on Ubuntu derivatives)

sudo ./adb kill-server

sudo ./adb start-server

B) (Suse, Fedora, etc)

su

(enter your password)

./adb kill-server

./adb-start-server

Now, the server should be running....leave it open!

4) Plug your phone into the PC (making sure that if it's ON, that you have android debugging enabled...or the proper edit in build.prop listed below)

5) If your phone is OFF(meaning you can't get it to boot from a rom/mod you did), follow A). If your phone is ON (meanint working but has a FC somewhere), follow B)

A) Type into the terminal the following

./adb logcat -C

and press enter. Should say waiting for device. Turn on your phone. When it gets to a section where you see a large amount of red pass by on the screen (like 8-10 lines), go to step 6

B) Be sure to turn off ALL apps that are NOT related to your FC (this makes it nice and neat for us to read the logcat)

Open terminal and type in the following

./adb logcat -C

and press enter. You should see it start to log stuff...it'll be going by really fast...don't worry about that right now.

NOW, do whatever it is that fcs (open the app, process, etc) and wait for it to FC. When it does, go to step 6

6) With the Terminal being your primary window in the PC, Press Ctrl +Z. This will stop the logcat output

7) Search through the logcat for the section with all the red (you'll see a bunch of E's). Don't cut this up on us...we may need some of the other info

8) Select about 30-40 lines ABOVE the red error section through about 10-20 lines AFTER the error section

9) Paste this into Pastebin. Please don't send us this in an e-mail...it just looks a hot mess that way.

10) Link to the Dev.

CHEERS!​