[RESOURCES] - Theming the Atrix 4G: tools, processes, locations, etc.

Search This thread

jimbush3

Senior Member
Mar 11, 2011
294
93
Baton Rouge, LA
I know that there are a good number of Atrix users who are new to android, new to theming with android, or like me - both. It can take hours to find the right information to make the changes that you want to make, only to find out that those types of changes are phone specific and that guide that you finally found after hours of searching doesn't even apply. I ask that all Atrix themers contribute to this thread with their knowledge, processes, and best practices for theming the Atrix. This way, we can share knowledge amongst each other as well as set up some accurate guide for other Atrix themers just getting started.

Contents:

Post 1 of this thread:
  1. apk Manager Guide
  2. Framework Assistant - tool to push/pull framework-res.apk
  3. Editing OR removing the status bar clock color in services.jar
Post 2 of this thread:
  • Setting the notification dropdown shade to transparent

I'll start off with a post that I made yesterday in response to someone's question about apk Manager.


1. apk Manager Atrix Guide

The file I am going to discuss here is /system/framework/framework-res.apk. This file contains most of the elements involved in theming your phone. There are many other smaller locations to edit, but this file contains the bulk.

Before we get started on using apk Manager, we should understand a few things about framework-res apk. This file consists of a few important elements:
  • regular png image files - these are standard png images and can be edited with your image editing program and saved without any problems.
  • draw-9 png image files - these are special types of png images denoted by a .9.png in the filename. The android system reads these filenames and recognizes the image as a stretchable image. The system knows how to stretch the image based on a 1px wide border that the image has. This border contains black dots/lines along each of the four edges that tell the system how to stretch it - if you mess with this border then the way the image stretches will changes and you may not be able to decompile/recompile the apk. The following link provides info on editing draw-9s, but I found it easiest to extract them with apk Manager, edit in gimp without touching the border, and then recompiling with apk M. More info on draw-9 pngs
  • xml files - these files are in binary code in the framework-res.apk. The apk needs to be decompiled in order to return these to human readable code. Also, many of your xml files are hidden within the resources.arsc file in the framework-res.apk and cannot be accessed unless you decompile.

In order to make any changes to the xml files or the draw-9 pngs within framework-res.apk you need to decompile it rather than extract it. Extracting the framework-res.apk with a program like winzip simply unzips the file and does not break the code back down to an editable format. Decompiling the framework-res.apk with a program like apk Manager will actually break down the resources.arsc file into the sepereate xmls folders (values, etc.) and also restore the instructions border to draw-9 pngs.

Draw-9 images not edited correctly will not stretch properly in the system and may cause decompilation/recompilation errors. XML files not edited correctly may also cause recompilation errors. It is very important to pay attention to the log.txt file for any errors that may be occurring during your decompilation/recompilation process.

Download apk Manager

Now here is what I've learned about apk Manager:

  1. put framework-res.apk in the place-apk-here-for-modding folder
  2. run the script
  3. enter 22 to select an apk, then 1 to select your apk
  4. press 9 to decompile the apk
  5. go into the projects/framework-res.apk/res/drawable-hdpi folder and edit your pngs or xmls (maintain the border)
  6. go back to the script once your done editing and enter 11 to compile
  7. when asked if it is a system apk enter y
  8. when asked if you want to extract other files too enter y Do not skip this step, apk Manager will seem to produce a working framework-res.apk if you skip this step but when I did it soft bricked my phone
  9. go into the keep folder that was created and delete any pngs that you changed in the projects folder
  10. if you change any xml files, you will also need to delete the resources.arsc file from the keep folder (this is because mane of the xml files are compiled into this resources.arsc, so to tell apk manager to rebuild it with the new xml, we need to delete the original)
  11. go back to the script and press any key to continue
  12. your recompiled framework-res will be in the place-apk-here-for-modding as unsigned-framework-res.apk
  13. extract unsigned-framework-res.apk using winzip, or similar program (this is being it is compressed incorrectly)
  14. go into the folder where you just unzipped the framework and zip it up with the compression mode set to Store - call it framework-res.apk
  15. you are ready to go with a properly editing framework-res.apk, put it on your phone any way you like

Make sure that you have no errors when de-compiling or re-compiling. It might seem like everything is going ok, but you could end up soft bricking your phone if you don't check the log.txt in the apk Manager main folder. Check the log.txt after every decompile and recompile to ensure that you don't have a damaged framework-res.apk.

The output in log.txt should like like this for a proper decompile:
Code:
-------------------------------------------------------------------------- 
|Sun 05/01/2011 -- 20:11:47.57| 
-------------------------------------------------------------------------- 
java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)
Could Not Find C:\Users\jbush\Documents\Custom Atrix\Programs\apk_manager_4.9\place-apk-here-for-modding\../place-apk-here-for-modding/signedframework-res.apk
I: Loading resource table...
I: Decoding resources...
I: Copying assets and libs...

And like this for a proper recompile:

Code:
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
    (skipping index file 'C:\Users\jbush\Documents\Custom Atrix\Programs\apk_manager_4.9\other\..\projects\framework-res.apk\assets\images\Thumbs.db')
    (skipping index file 'C:\Users\jbush\Documents\Custom Atrix\Programs\apk_manager_4.9\other\..\projects\framework-res.apk\assets\webkit\Thumbs.db')
The system cannot find the file specified.

If you get any errors about your images or xml then you need to fix them before you can recompile.


#framework-assistant2. Framework-res.apk Assistant

Here is a tool which I use regularly to pull the current framework-res.apk from my phone, as well as to push any updated framework-res.apk to my phone. To use this batch program you need to:
  1. Download the View attachment 584667
  2. Extract the zip to whereever you want the program to reside
  3. To pull your current framework-res.apk - run the Framework-Assistant.bat and tell it to pull
  4. To push an updated framework-res.apk - place the updated framework-res.apk in the bin/push folder, run the Framework-Assistant.bat and tell it to push the updated framework-res.apk
  5. It is always a good idea to tell it to back up the current before pushing a new

As with any and all framework-res.apk pushes, this has the ability to soft brick your phone depending on the framework-res.apk you push, or anything else for that matter. Use at your own risk.

Here are my steps to edit framework-res.apk from start to finish which might help those unfamiliar with the process:
  1. Run Framework-Assistant.bat and answer y to pull the current framework-res.apk from the phone, but n to push the latest version (this will simply retrieve the current framework-res.apk from your phone)
  2. Copy that framework-res.apk from the Framework Assistant/bin/pull fodler into the place-apk-here-for-modding folder of apk Manager
  3. rename framework-res.apk to something distinguishable, I add the current time (ex: framework-res-1016.apk). Trust me, things can get messy if you end up making a few passes with different edits, you need to keep your stuff straight.
  4. Run Script.bat in the apk Manager folder, 22 to select which apk to use, then 9 to decompile
  5. Go into the projects/framework-res-1016.apk folder and make any changes you wish. Most png changes will be in drawable-hdpi, xmls are pimarily located in the values and layout folders.
  6. Once I've finished making updates, run Script.bat again, 22 to select the proper apk, then compile with 11 - follow all compilation steps above all the way through zipping it as store.
  7. Place the new framework-res.apk in the Framework Assistant/bin/push folder and run Framework-Assistant.bat
  8. Choose y to both pull and push the framework-res.apk (I find its always a good idea to pull your latest working framework-res.apk from the phone before dropping a new one in)
  9. If you anticipate more edits, go back to apk Manager and paste the new framework-res.apk in the place-apk-here-for-modding fodler of apk Manager and rename it with the current time attached (ex: framework-res-1023.apk)
  10. Delete the unsignedframework-res-1016.apk and the unsignedframework-res.apk fodler (just to keep things clean)
  11. You now have an edited framework-res.apk on your phone and are set to fix this little issues you missed on this pass, just run the apk Manager Script.bat again, enter 22 to access your latest framework-res.apk (framework-res-1023.apk) and repeat the process.
#framework-assistant3. Editing OR removing the status bar clock in services.jar

You will need:
  • Some zip program, I use winrar
  • JDK - Java Development Kit Get the JDK
  • baksmali to decompile and recompile the classes.dex file - View attachment baksmali.zip
  • Notepad++ free editor for code editing (I recommend this program for any/all code editing, apart from hex)

Here is how to change the status bar clock color:
  1. Install the JDK
  2. Extract baksmali to your computer
  3. Retrieve services.jar from the /system/framework folder
  4. Extract services.jar using your zip program (right click on the file and choose to extract)
  5. One of the extracted files is classes.dex, copy it into the baksmali folder
  6. Run decompile.bat in the baksmali folder - this will decompile classes.dex and place the contents in a new folder called classout
  7. Navigate to classout\com\android\server\status

    The next step involves changing clock color:
  8. open StatusBarIcon.smali with Notepadd++ and find this entry
    Code:
    .line 61
        const v6, -0x1
    
        invoke-virtual {v4, v6}, Landroid/widget/TextView;->setTextColor(I)V

    const v6, -0x1 identifies the color of the status bar clock. I changed this value to "const v6, -0xff000000 to set my clock to black. Essentially the last 6 digits of this entry will determine the color of the clock. Set the last six to any html color code (google it) to set your clock color. I have only tried black here as it is all I needed, so I can't personally guarantee that anything else will work.

    The next step involves removing the clock:
  9. open StatusBarPolicy.smali with Notepadd++ and find this entry
    Code:
    invoke-direct {p0}, Lcom/android/server/status/StatusBarPolicy;->updateClock()V

    It should be under ".line 592", now add this line underneath the line just mentioned:
    Code:
    invoke-virtual {p2, v3, v6}, Lcom/android/server/status/StatusBarService;->setIconVisibility(Landroid/os/IBinder;Z)V
  10. Once your done editing, save the file
  11. Navigate back to the baksmali folder and run recompile.bat - this will rename the original classes.dex file to orig-classes.dex, and the recompiled file is saved as classes.dex
  12. Zip up the new classes.dex along with the META-INF folder that was extracted from services.jar as, you guessed it, services.jar Leave the compression setting on Normal
  13. Put services.jar back in your system/framework folder

This is all that I know how to do with servies.jar right now, if anyone has some additional good info please post it to this thread and I will add it on.


Can't believe I forgot to thank all those who have contributed both directly and indirectly to my knowledge thus far: Nottach, NyugenHuu, KennethPenn, riral, tonecreationz, gera4eva, HFHimself, and many random threads I found on the wonderful xda forums.
 
Last edited:

jimbush3

Senior Member
Mar 11, 2011
294
93
Baton Rouge, LA
1. Setting the notification dropdown shade to transparent

Instructions:
  1. Download Baksmali Tool - directions for use are at the end of post 1
  2. Open the services.jar file for example with winzip, 7z, winRar, or whatever. Unzip the classes.dex file into the folder with decompile.bat and recompile.bat from the Baksmali Tool zip.
  3. Run decompile.bat - this will decompile classes.dex into a new folder called classout folder. Browse to classout/com/android/server/status and open the file called StatusBarService.smali with a text editor like notepad.
  4. Search for "const/4 v5, 0x2", it should be under ".line 1629". Just change this to "const/4 v5, -0x3" and save the file.
  5. Run recompile.bat - this will recompile the classout folder into classes.dex and rename the original file to orig-classes.dex
  6. Open again the services.jar file with any zip tool and overwrite the classes.dex file with the one just created.
  7. Now search the drawable-hdpi/status_bar_background.png file in the framework-res.apk and make it transparent.
  8. Push the updated framework-res.apk and services.jar back to the /system/framework/ directory on your phone.
- credit for this info goes to tonecreationz


Much more information is available from The Ultimate Android Themeing Guide By Jairomeo, Manup456, ArmyRanger251, Stericson, Brandenk, SirMez, Beagz, david1171_ - link provided by nottach
 
Last edited:

NguyenHuu

Senior Member
Nov 14, 2007
1,753
128
California
the resources file was never rebuilt after it gets recompiled after I delete it from the keep folder. does yours?
 

jimbush3

Senior Member
Mar 11, 2011
294
93
Baton Rouge, LA
Yes, if your resources.arsc is not being rebuilt then it means that you have errors in your process. Post the contents of your log.txt here.
 

calvin398

Member
Mar 15, 2011
45
1
After I delete the files from the keep folder, they're never replaced w/ my new files when the apk is compiled. What happened??
 

jimbush3

Senior Member
Mar 11, 2011
294
93
Baton Rouge, LA
There is a ton of errors. I think reason could be because of the way the original framework was built? i am using gingerblur as a base. Here is my log: http://conceptvisionz.net/uploader/images/log.txt

Problems start here for you:

Code:
W: Cant find 9patch chunk in file: "drawable-hdpi/statusbar_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/title_bar_portrait.9.png". Renaming it to *.png.
I: Copying assets and libs...
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
libpng error: Read Error
ERROR: Failure processing PNG image C:\Android\tools\apk_manager\other\..\projects\framework-res.apk\res\drawable-hdpi\statusbar_background.9.png
libpng error: Read Error
ERROR: Failure processing PNG image C:\Android\tools\apk_manager\other\..\projects\framework-res.apk\res\drawable-hdpi\title_bar_portrait.9.png

statusbar_background and title_bar_portrait are not proper draw-9 pngs. You will need to fix these before you can recompile. This error will keep apk Manager from using anything in your projects folder when it compiles.

Here are valid pngs for those two images. If you are unable to fix yours, try replacing your with these in the projects/framework-res.apk/res/drawable-hdpi folder and then try to compile again.
statusbar_background.9.png - statusbar_background.9.png
title_bar_portrait.9.png - title_bar_portrait.9.png
 
Last edited:

NguyenHuu

Senior Member
Nov 14, 2007
1,753
128
California
Problems start here for you: statusbar_background and title_bar_portrait are not proper draw-9 pngs. You will need to fix these before you can recompile. This error will keep apk Manager from using anything in your projects folder when it compiles.

Here are valid pngs for those two images. If you are unable to fix yours, try replacing your with these in the projects/framework-res.apk/res/drawable-hdpi folder and then try to compile again.
View attachment 584896 - statusbar_background.9.png
View attachment 584897 - title_bar_portrait.9.png

Thanks, I am still experimenting with it. I manage to recompile fine now. Reading logs really does help. I manage to get my menu to show the color I want. Now just need to work on the secondary menu when when you press more. It is tricky because the main menu popup you can use standard color codes #ff808080 is the gray I used and works fine. But for the secondary menu you cant use color codes, it fails compilation.

EDIT: so i finally got it to work (the secondary menu) but adding in textColor and remove text appearance item.

So for main popup bottom menu, this is the field to edit: TextAppearance.Widget.IconMenu.Item, change the textColor directly to a color of your choice in this format #ffffffff (white), mines is #ff808080 (dark gray).

For the secondary menu for areas that has a "more", find this field: Theme.ExpandedMenu, and just add in a textColor entry. You can copy and paste the one from TextAppearance.Widget.IconMenu.Item. remove the text appearance item.

3 days work finally solved, thanks everyone. Now the theme is a bit more flush with certain third party apps.
 

Attachments

  • device.jpg
    device.jpg
    34.2 KB · Views: 1,461
  • device2.jpg
    device2.jpg
    36.5 KB · Views: 1,246
  • device3.jpg
    device3.jpg
    24.2 KB · Views: 1,177
Last edited:
  • Like
Reactions: jimbush3

jimbush3

Senior Member
Mar 11, 2011
294
93
Baton Rouge, LA
Thanks, I am still experimenting with it. I manage to recompile fine now. Reading logs really does help. I manage to get my menu to show the color I want. Now just need to work on the secondary menu when when you press more. It is tricky because the main menu popup you can use standard color codes #ff808080 is the gray I used and works fine. But for the secondary menu you cant use color codes, it fails compilation.

Nicely done and thanks for the guides, we need more of that.
 
Last edited:
  • Like
Reactions: LightSwitchTTM

jimbush3

Senior Member
Mar 11, 2011
294
93
Baton Rouge, LA
I've been able to track down most of the colors that I want to adjust in the xml files, however I cannot seem to find where the corporate email is getting its color from. The image below shows the white text that I can't find out how to change. Had anyone been able to locate the source for this?

cb2email.jpg
 

jimbush3

Senior Member
Mar 11, 2011
294
93
Baton Rouge, LA
Thanks Nguyen, I had actually decompiled the classes.dex from services.jar a little while back; but without a guide I had absolutely no idea what I was looking at. Its a bit more complicated than framework-res. Once I get in there and make the changes I'll add something about editing services.jar to the first post of this thread.
 

Nottach

Senior Member
Mar 20, 2008
1,587
3,934
New York
Look for the .line 61
The below changes it to green from white

Code:
.line 61
   const v6, -0x1

to

.line 61
    const v6, 0xFF4CFF00
 

jimbush3

Senior Member
Mar 11, 2011
294
93
Baton Rouge, LA
0xFF4CFF00 - wouldn't a straight white be 0xFFFFFFFF?

I'm coming from an html background and through all the xml edits I've done and whatnot, the white color code is FFFFFFFF. So, to go to black my code should be 0xFF000000, right?

**edit, actually I just threw that second code you posted, 4CFF00, into gimp and it gave me a bright green. Maybe you meant the bloew code changes from white to green?
 
Last edited:

Nottach

Senior Member
Mar 20, 2008
1,587
3,934
New York
0xFF4CFF00 - wouldn't a straight white be 0xFFFFFFFF?

I'm coming from an html background and through all the xml edits I've done and whatnot, the white color code is FFFFFFFF. So, to go to black my code should be 0xFF000000, right?

**edit, actually I just threw that second code you posted, 4CFF00, into gimp and it gave me a bright green. Maybe you meant the bloew code changes from white to green?

I worded it weird. Guess I shouldve said from white to green instead of to green from white.
 

NguyenHuu

Senior Member
Nov 14, 2007
1,753
128
California
0xFF4CFF00 - wouldn't a straight white be 0xFFFFFFFF?

I'm coming from an html background and through all the xml edits I've done and whatnot, the white color code is FFFFFFFF. So, to go to black my code should be 0xFF000000, right?

**edit, actually I just threw that second code you posted, 4CFF00, into gimp and it gave me a bright green. Maybe you meant the bloew code changes from white to green?

yeah that would be white all Fs. The first two FFs control alpha, while the ohter 6 are just like html hex colors.
 

jimbush3

Senior Member
Mar 11, 2011
294
93
Baton Rouge, LA
I got in there today and blacked out my clock, thank you both for the help. I've also added the steps and some useful tools to the first post for editing the status bar clock.

I'm so damn close to having my phone the way I want, for this week at least, but I've run into a new snag and don't know where to look yet. I edited the following code in styles.xml:

<item name="windowBackground">@drawable/screen_background_dark</item> under <style name="Theme">

and I changed it to @drawable/menu_bg, which referenced a background image I created and replaces the screen_background_dark which points to the black color in the drawables.xml file. For the most part this works perfectly, as seen here:

cb2.0root.png


The only problem is, and this really is the only one I've found, is my alarm settings screen:

cb2.0alarm.png


If I change that one value back to black then the alarms screen show up perfectly fine, black background, white alarm text, etc. I'm not ever sure where to start to look for the solution to this one. Maybe I should just sleep:

cb2.0notification.png
 

Top Liked Posts

  • There are no posts matching your filters.
  • 17
    I know that there are a good number of Atrix users who are new to android, new to theming with android, or like me - both. It can take hours to find the right information to make the changes that you want to make, only to find out that those types of changes are phone specific and that guide that you finally found after hours of searching doesn't even apply. I ask that all Atrix themers contribute to this thread with their knowledge, processes, and best practices for theming the Atrix. This way, we can share knowledge amongst each other as well as set up some accurate guide for other Atrix themers just getting started.

    Contents:

    Post 1 of this thread:
    1. apk Manager Guide
    2. Framework Assistant - tool to push/pull framework-res.apk
    3. Editing OR removing the status bar clock color in services.jar
    Post 2 of this thread:
    • Setting the notification dropdown shade to transparent

    I'll start off with a post that I made yesterday in response to someone's question about apk Manager.


    1. apk Manager Atrix Guide

    The file I am going to discuss here is /system/framework/framework-res.apk. This file contains most of the elements involved in theming your phone. There are many other smaller locations to edit, but this file contains the bulk.

    Before we get started on using apk Manager, we should understand a few things about framework-res apk. This file consists of a few important elements:
    • regular png image files - these are standard png images and can be edited with your image editing program and saved without any problems.
    • draw-9 png image files - these are special types of png images denoted by a .9.png in the filename. The android system reads these filenames and recognizes the image as a stretchable image. The system knows how to stretch the image based on a 1px wide border that the image has. This border contains black dots/lines along each of the four edges that tell the system how to stretch it - if you mess with this border then the way the image stretches will changes and you may not be able to decompile/recompile the apk. The following link provides info on editing draw-9s, but I found it easiest to extract them with apk Manager, edit in gimp without touching the border, and then recompiling with apk M. More info on draw-9 pngs
    • xml files - these files are in binary code in the framework-res.apk. The apk needs to be decompiled in order to return these to human readable code. Also, many of your xml files are hidden within the resources.arsc file in the framework-res.apk and cannot be accessed unless you decompile.

    In order to make any changes to the xml files or the draw-9 pngs within framework-res.apk you need to decompile it rather than extract it. Extracting the framework-res.apk with a program like winzip simply unzips the file and does not break the code back down to an editable format. Decompiling the framework-res.apk with a program like apk Manager will actually break down the resources.arsc file into the sepereate xmls folders (values, etc.) and also restore the instructions border to draw-9 pngs.

    Draw-9 images not edited correctly will not stretch properly in the system and may cause decompilation/recompilation errors. XML files not edited correctly may also cause recompilation errors. It is very important to pay attention to the log.txt file for any errors that may be occurring during your decompilation/recompilation process.

    Download apk Manager

    Now here is what I've learned about apk Manager:

    1. put framework-res.apk in the place-apk-here-for-modding folder
    2. run the script
    3. enter 22 to select an apk, then 1 to select your apk
    4. press 9 to decompile the apk
    5. go into the projects/framework-res.apk/res/drawable-hdpi folder and edit your pngs or xmls (maintain the border)
    6. go back to the script once your done editing and enter 11 to compile
    7. when asked if it is a system apk enter y
    8. when asked if you want to extract other files too enter y Do not skip this step, apk Manager will seem to produce a working framework-res.apk if you skip this step but when I did it soft bricked my phone
    9. go into the keep folder that was created and delete any pngs that you changed in the projects folder
    10. if you change any xml files, you will also need to delete the resources.arsc file from the keep folder (this is because mane of the xml files are compiled into this resources.arsc, so to tell apk manager to rebuild it with the new xml, we need to delete the original)
    11. go back to the script and press any key to continue
    12. your recompiled framework-res will be in the place-apk-here-for-modding as unsigned-framework-res.apk
    13. extract unsigned-framework-res.apk using winzip, or similar program (this is being it is compressed incorrectly)
    14. go into the folder where you just unzipped the framework and zip it up with the compression mode set to Store - call it framework-res.apk
    15. you are ready to go with a properly editing framework-res.apk, put it on your phone any way you like

    Make sure that you have no errors when de-compiling or re-compiling. It might seem like everything is going ok, but you could end up soft bricking your phone if you don't check the log.txt in the apk Manager main folder. Check the log.txt after every decompile and recompile to ensure that you don't have a damaged framework-res.apk.

    The output in log.txt should like like this for a proper decompile:
    Code:
    -------------------------------------------------------------------------- 
    |Sun 05/01/2011 -- 20:11:47.57| 
    -------------------------------------------------------------------------- 
    java version "1.6.0_25"
    Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
    Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)
    Could Not Find C:\Users\jbush\Documents\Custom Atrix\Programs\apk_manager_4.9\place-apk-here-for-modding\../place-apk-here-for-modding/signedframework-res.apk
    I: Loading resource table...
    I: Decoding resources...
    I: Copying assets and libs...

    And like this for a proper recompile:

    Code:
    W: Could not find sources
    I: Checking whether resources has changed...
    I: Building resources...
    I: Building apk file...
        (skipping index file 'C:\Users\jbush\Documents\Custom Atrix\Programs\apk_manager_4.9\other\..\projects\framework-res.apk\assets\images\Thumbs.db')
        (skipping index file 'C:\Users\jbush\Documents\Custom Atrix\Programs\apk_manager_4.9\other\..\projects\framework-res.apk\assets\webkit\Thumbs.db')
    The system cannot find the file specified.

    If you get any errors about your images or xml then you need to fix them before you can recompile.


    #framework-assistant2. Framework-res.apk Assistant

    Here is a tool which I use regularly to pull the current framework-res.apk from my phone, as well as to push any updated framework-res.apk to my phone. To use this batch program you need to:
    1. Download the View attachment 584667
    2. Extract the zip to whereever you want the program to reside
    3. To pull your current framework-res.apk - run the Framework-Assistant.bat and tell it to pull
    4. To push an updated framework-res.apk - place the updated framework-res.apk in the bin/push folder, run the Framework-Assistant.bat and tell it to push the updated framework-res.apk
    5. It is always a good idea to tell it to back up the current before pushing a new

    As with any and all framework-res.apk pushes, this has the ability to soft brick your phone depending on the framework-res.apk you push, or anything else for that matter. Use at your own risk.

    Here are my steps to edit framework-res.apk from start to finish which might help those unfamiliar with the process:
    1. Run Framework-Assistant.bat and answer y to pull the current framework-res.apk from the phone, but n to push the latest version (this will simply retrieve the current framework-res.apk from your phone)
    2. Copy that framework-res.apk from the Framework Assistant/bin/pull fodler into the place-apk-here-for-modding folder of apk Manager
    3. rename framework-res.apk to something distinguishable, I add the current time (ex: framework-res-1016.apk). Trust me, things can get messy if you end up making a few passes with different edits, you need to keep your stuff straight.
    4. Run Script.bat in the apk Manager folder, 22 to select which apk to use, then 9 to decompile
    5. Go into the projects/framework-res-1016.apk folder and make any changes you wish. Most png changes will be in drawable-hdpi, xmls are pimarily located in the values and layout folders.
    6. Once I've finished making updates, run Script.bat again, 22 to select the proper apk, then compile with 11 - follow all compilation steps above all the way through zipping it as store.
    7. Place the new framework-res.apk in the Framework Assistant/bin/push folder and run Framework-Assistant.bat
    8. Choose y to both pull and push the framework-res.apk (I find its always a good idea to pull your latest working framework-res.apk from the phone before dropping a new one in)
    9. If you anticipate more edits, go back to apk Manager and paste the new framework-res.apk in the place-apk-here-for-modding fodler of apk Manager and rename it with the current time attached (ex: framework-res-1023.apk)
    10. Delete the unsignedframework-res-1016.apk and the unsignedframework-res.apk fodler (just to keep things clean)
    11. You now have an edited framework-res.apk on your phone and are set to fix this little issues you missed on this pass, just run the apk Manager Script.bat again, enter 22 to access your latest framework-res.apk (framework-res-1023.apk) and repeat the process.
    #framework-assistant3. Editing OR removing the status bar clock in services.jar

    You will need:
    • Some zip program, I use winrar
    • JDK - Java Development Kit Get the JDK
    • baksmali to decompile and recompile the classes.dex file - View attachment baksmali.zip
    • Notepad++ free editor for code editing (I recommend this program for any/all code editing, apart from hex)

    Here is how to change the status bar clock color:
    1. Install the JDK
    2. Extract baksmali to your computer
    3. Retrieve services.jar from the /system/framework folder
    4. Extract services.jar using your zip program (right click on the file and choose to extract)
    5. One of the extracted files is classes.dex, copy it into the baksmali folder
    6. Run decompile.bat in the baksmali folder - this will decompile classes.dex and place the contents in a new folder called classout
    7. Navigate to classout\com\android\server\status

      The next step involves changing clock color:
    8. open StatusBarIcon.smali with Notepadd++ and find this entry
      Code:
      .line 61
          const v6, -0x1
      
          invoke-virtual {v4, v6}, Landroid/widget/TextView;->setTextColor(I)V

      const v6, -0x1 identifies the color of the status bar clock. I changed this value to "const v6, -0xff000000 to set my clock to black. Essentially the last 6 digits of this entry will determine the color of the clock. Set the last six to any html color code (google it) to set your clock color. I have only tried black here as it is all I needed, so I can't personally guarantee that anything else will work.

      The next step involves removing the clock:
    9. open StatusBarPolicy.smali with Notepadd++ and find this entry
      Code:
      invoke-direct {p0}, Lcom/android/server/status/StatusBarPolicy;->updateClock()V

      It should be under ".line 592", now add this line underneath the line just mentioned:
      Code:
      invoke-virtual {p2, v3, v6}, Lcom/android/server/status/StatusBarService;->setIconVisibility(Landroid/os/IBinder;Z)V
    10. Once your done editing, save the file
    11. Navigate back to the baksmali folder and run recompile.bat - this will rename the original classes.dex file to orig-classes.dex, and the recompiled file is saved as classes.dex
    12. Zip up the new classes.dex along with the META-INF folder that was extracted from services.jar as, you guessed it, services.jar Leave the compression setting on Normal
    13. Put services.jar back in your system/framework folder

    This is all that I know how to do with servies.jar right now, if anyone has some additional good info please post it to this thread and I will add it on.


    Can't believe I forgot to thank all those who have contributed both directly and indirectly to my knowledge thus far: Nottach, NyugenHuu, KennethPenn, riral, tonecreationz, gera4eva, HFHimself, and many random threads I found on the wonderful xda forums.
    4
    Animated Pull-Down Background

    After reading through this thread I got animated pull-down backgrounds working.
    It's all in the systemui.apk and pretty easy to add to any theme.
    It does cause boot time to be longer, I think this is because it's loading the animation images. I've gone with nine in this example but I think you can use more. Also, it's most likely possible to do this with other images, such as statusbar_close_on.png
    The attached sample is 4.5.91 only and flashable via CWM. It's just the Stock MotoBlur 1% mod with this mod added. To remove flash any theme or regular 1% mod.

    How To:
    1. Decompile SystemUI.apk
    2. In /res/layout/status_bar_tracking.xml change:
    Code:
    <com.android.systemui.statusbar.TrackingView android:orientation="vertical" [COLOR=Red]android:background="@android:color/transparent"[/COLOR] android:paddingLeft="0.0px" android:paddingRight="0.0px" android:paddingBottom="0.0px" android:focusable="true" android:visibility="gone" android:descendantFocusability="afterDescendants"
      xmlns:android="http://schemas.android.com/apk/res/android">
    To:
    Code:
    <com.android.systemui.statusbar.TrackingView android:orientation="vertical" [COLOR=Red]android:background="@drawable/pulldown_anim"[/COLOR] android:paddingLeft="0.0px" android:paddingRight="0.0px" android:paddingBottom="0.0px" android:focusable="true" android:visibility="gone" android:descendantFocusability="afterDescendants"
      xmlns:android="http://schemas.android.com/apk/res/android">
    3. Create pulldown_anim.xml in /res/drawable. This will declare the images and durations for the animation.
    Sample:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <animation-list android:oneshot="false"
      xmlns:android="http://schemas.android.com/apk/res/android">
        <item android:duration="50" android:drawable="@drawable/pulldown_anim0" />
        <item android:duration="50" android:drawable="@drawable/pulldown_anim1" />
        <item android:duration="50" android:drawable="@drawable/pulldown_anim2" />
        <item android:duration="50" android:drawable="@drawable/pulldown_anim3" />
        <item android:duration="50" android:drawable="@drawable/pulldown_anim4" />
        <item android:duration="50" android:drawable="@drawable/pulldown_anim5" />
        <item android:duration="50" android:drawable="@drawable/pulldown_anim6" />
        <item android:duration="50" android:drawable="@drawable/pulldown_anim7" />
        <item android:duration="50" android:drawable="@drawable/pulldown_anim8" />
    </animation-list>
    4. Add your images to /res/drawable-hdpi. These are the images declared in pulldown_anim.xml.
    5. Make /res/drawable-hdpi/shade_bg.png completely transparent.
    6. Recompile SystemUI.apk
    7. Overwrite original with your preferred method.

    NOTES:
    The first time you pull down the shade it won't animate. I don't know why. It will animate every time after.
    You may have to make status_bar_background.png in framework-res.apk transparent as well. I did but didn't check if it was necessary before hand.
    2
    1. Setting the notification dropdown shade to transparent

    Instructions:
    1. Download Baksmali Tool - directions for use are at the end of post 1
    2. Open the services.jar file for example with winzip, 7z, winRar, or whatever. Unzip the classes.dex file into the folder with decompile.bat and recompile.bat from the Baksmali Tool zip.
    3. Run decompile.bat - this will decompile classes.dex into a new folder called classout folder. Browse to classout/com/android/server/status and open the file called StatusBarService.smali with a text editor like notepad.
    4. Search for "const/4 v5, 0x2", it should be under ".line 1629". Just change this to "const/4 v5, -0x3" and save the file.
    5. Run recompile.bat - this will recompile the classout folder into classes.dex and rename the original file to orig-classes.dex
    6. Open again the services.jar file with any zip tool and overwrite the classes.dex file with the one just created.
    7. Now search the drawable-hdpi/status_bar_background.png file in the framework-res.apk and make it transparent.
    8. Push the updated framework-res.apk and services.jar back to the /system/framework/ directory on your phone.
    - credit for this info goes to tonecreationz


    Much more information is available from The Ultimate Android Themeing Guide By Jairomeo, Manup456, ArmyRanger251, Stericson, Brandenk, SirMez, Beagz, david1171_ - link provided by nottach
    1
    Problems start here for you: statusbar_background and title_bar_portrait are not proper draw-9 pngs. You will need to fix these before you can recompile. This error will keep apk Manager from using anything in your projects folder when it compiles.

    Here are valid pngs for those two images. If you are unable to fix yours, try replacing your with these in the projects/framework-res.apk/res/drawable-hdpi folder and then try to compile again.
    View attachment 584896 - statusbar_background.9.png
    View attachment 584897 - title_bar_portrait.9.png

    Thanks, I am still experimenting with it. I manage to recompile fine now. Reading logs really does help. I manage to get my menu to show the color I want. Now just need to work on the secondary menu when when you press more. It is tricky because the main menu popup you can use standard color codes #ff808080 is the gray I used and works fine. But for the secondary menu you cant use color codes, it fails compilation.

    EDIT: so i finally got it to work (the secondary menu) but adding in textColor and remove text appearance item.

    So for main popup bottom menu, this is the field to edit: TextAppearance.Widget.IconMenu.Item, change the textColor directly to a color of your choice in this format #ffffffff (white), mines is #ff808080 (dark gray).

    For the secondary menu for areas that has a "more", find this field: Theme.ExpandedMenu, and just add in a textColor entry. You can copy and paste the one from TextAppearance.Widget.IconMenu.Item. remove the text appearance item.

    3 days work finally solved, thanks everyone. Now the theme is a bit more flush with certain third party apps.
    1
    Help Editing AndroidManifest.xml

    I've been having a hell of a time editing AndroidManifest.xml files. I haven't gotten it to work yet. I'm wondering if I'm doing it wrong or if there's something different from any other file in an apk. Here's what I've tried, please let me know if you can help.

    Method 1:
    Using APKMultiTool - Decompile APK - Make edits to AndroidManifest.xml - Recompile - Delete old AndroidManifest from keep folder - Finish Compiling
    Push apk to phone.
    Gets stuck at boot animation, Does not Boot Loop, just keeps going. No ADB access.

    Method 2:
    Same as above but using APKManager 4.9
    Same results as Method 1.

    Method 3:
    Using apktool - Decompile APK - Make edits to AndroidManifest.xml in out folder - Recompile - Sign
    Push to phone.
    Gets stuck at boot animation, BUT, I can hear the mounting sounds signalling a finished boot, and I have ADB access.

    What am I missing or doing wrong. I can edit any other file without problems but the damn AndroidManifest always gives me trouble.

    I'm trying to enable landscape in BlurHome.apk for 2.3.6 by changing two "nosensor" values to "sensor".

    Ideas?

    EDIT: In a last final effort I resigned all the apks in app and framework and it worked. Wish I didn't have to do that. But so far it seems ok. Just following up for the sake of the thread. I really think this thread should be pinned.