Theme Progress Log / How To

Discussion in 'Android Themes' started by sxtnitehawk, Sep 6, 2010.

  1. sxtnitehawk
    Offline

    sxtnitehawk New Member

    Joined:
    Aug 31, 2010
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    0
    This thread will serve as a general How To and other information for making your own custom themes.

    First off, from my own personal experience, the most sure fire way for your changes to take effect is to use an update.zip file. This one was provided by theBowers and does in fact work. To use it, use 7zip to open it, and put your files inside it in their respective location. Most of what I will be discussing here will all be contained within framework-res.apk which resides in /system/framework/ on your phone (and thus should be as well in your update.zip when you're done)

    http://www.droidforums.net/forum/at...nt-replace-framework-res-apk-theme_update.zip

    First thing I changed was the battery graphics. These, along with 99% of the other graphics for the phone are located in framework-res.apk/res/drawable-hdpi-v4/. They are files stat_sys_battery_0 through stat_sys_battery_100 (unplugged graphics) and files stat_sys_battery_charge_anim0 through stat_sys_battery_charge_anim5. Also there is stat_sys_battery_unknown but the odds of seeing that is slim...

    The top status bar is statusbar_background.9.png and is a stretched gradient. whatever you do with this file will stretch the whole way across...so forget about the nice fancy (yet tiny) designs you can do...cause itll get really distorted.

    When you open the notification menu, the first line where your carrier's name is located, is also a stretched gradient, filename status_bar_header_background.9. This is even smaller than the above file...so it's stretched even a lot more.

    Keep in mind, if you want to make colors dark, you have to change everything else in the top status bar or it will be very hard to see...

    All of my modified graphics can be found here: http://s803.photobucket.com/albums/yy312/mattcresto/MotoDroid ReTheme/?start=all

    How to pull, change, and push the framework from/to your phone:

    Once you've downloaded and installed the Android SDK and 7zip, create a new folder on your computer for your framework. We're going to pull the framework off the phone, extract the files from it (or using APK Manager you can decompile it), and edit some of the images...

    open up a command prompt and navigate to the tools folder in the SDK and run "adb pull /system/framework/framework-res.apk" without quotes. This will pull the framework file off the phone and onto your computer.

    Next, move the apk to your new folder, make a copy of it and rename it framework-res.apk.bak (so you have a backup in case anything happens).

    Using 7zip, open and extract the archive to your new folder (or use APK Manager to decompile it so you can modify the XML files too).

    once extracted, you can play around with the graphics for the framework easily. You can download any of the images I've done so far or make your own. To change the images just overwrite the existing ones in the directory "res/drawable-hdpi". Once you have done that, open the apk again in 7zip and navigate to the folder "res/drawable-hdpi" inside the archive. drag and drop your new images from the extracted folder into the archive to overwrite them. Once done, back out of the archive and open the theme_update.zip archive, go to "system/framework", drag and drop the modified framework-res.apk file into the archive. back out of the archive and close it.

    Now you're ready to upload back to your phone again...

    you can either turn on USB storage and drop the update file onto your sd card or use the sdk and push it onto your sd card using "adb push theme_update.zip /sdcard/theme_update.zip

    Now from there just reboot the phone into recovery, and install the theme_update.zip file. By now you should already be running SPRecovery or Clockworkmod Recovery.

    Reboot your phone and enjoy the changes :)
    Last edited: Sep 8, 2010
  2. JsinLegacy
    Offline

    JsinLegacy Premium Member Theme Developer Premium Member

    Joined:
    Apr 4, 2010
    Messages:
    355
    Likes Received:
    0
    Trophy Points:
    0
  3. sxtnitehawk
    Offline

    sxtnitehawk New Member

    Joined:
    Aug 31, 2010
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    0
    That does have good information, but also incomplete...

    I'll try to fill in the blanks as far as the other graphics and such are.
  4. Schoat333
    Offline

    Schoat333 New Member

    Joined:
    Jul 5, 2010
    Messages:
    120
    Likes Received:
    0
    Trophy Points:
    0
    Can't wait to read more.

    Thanks for taking the time to make this thread.

    I am interested in making my own themes, and have a pretty good understanding of how to do it, but some guide lines for what will work, and what wont would be nice to see.
  5. sxtnitehawk
    Offline

    sxtnitehawk New Member

    Joined:
    Aug 31, 2010
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    0
    Small update....

    Havn't had time to play much the past couple days since i pulled a 15hr and 19hr work days...good for the paycheck...bad for the social life...lol

    ok so I made another small change to the status bar icons... I changed the Status bar to solid black so I put a white border around most of the icons to make them easier to see. Now I just need to find where the color is stored for the date and time...
  6. sxtnitehawk
    Offline

    sxtnitehawk New Member

    Joined:
    Aug 31, 2010
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    0
    I found it...but now I gotta figure out how to change it... There's other things that use the same color (in that...there's a reference to the color in colors.xml in the values folder) so I have to figure out how to change whats in status_bar.xml in the layout folder... This isnt proving to be easy as the section I need to edit is encoded and not plain XML. Every time i've tried decoding and encoding has failed to work so far...

    For the sake of keeping a good log... in status_bar.xml there's this:

    Code:
    <com.android.server.status.DateView  android:textSize="16.0sp" android:textStyle="bold"  android:textColor="?textColorPrimaryInverse" android:gravity="left|center" android:id="@id/date"  android:background="@drawable/statusbar_background" android:paddingLeft="6.0px"  android:paddingRight="6.0px" android:layout_width="wrap_content"  android:layout_height="fill_parent" android:singleLine="true" /> 
    what needs to be changed is "?textColorPrimaryInverse". it can be changed to a specific color code using the typical #AARRGGBB code but the file i have to edit is encrypted.....
    Last edited: Sep 7, 2010
  7. sxtnitehawk
    Offline

    sxtnitehawk New Member

    Joined:
    Aug 31, 2010
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    0
    trying to use apktool to compile the xml back to binary......but not working...

    ugh
  8. kook
    Offline

    kook Premium Member Theme Developer Premium Member

    Joined:
    Dec 29, 2009
    Messages:
    2,041
    Likes Received:
    0
    Trophy Points:
    0
    Try apk manager....it's much easier.
  9. sxtnitehawk
    Offline

    sxtnitehawk New Member

    Joined:
    Aug 31, 2010
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    0
    APKManager uses APKTool...

    The one time i tried to build i got a bunch of errors.

    All I really need is something that can convert single files from XML to binary...that would suit me perfectly since I only edit 1 file at a time...

    If anyone knows of something like this, please, share :)

    I updated some more images and i'm making more tonight. I'll put up a folder on my photobucket so people can see/download them for their own use if they want.
  10. sxtnitehawk
    Offline

    sxtnitehawk New Member

    Joined:
    Aug 31, 2010
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    0
  11. kook
    Offline

    kook Premium Member Theme Developer Premium Member

    Joined:
    Dec 29, 2009
    Messages:
    2,041
    Likes Received:
    0
    Trophy Points:
    0
  12. raidzero
    Offline

    raidzero n00b. Theme Developer Premium Member Developer

    Joined:
    Apr 15, 2010
    Messages:
    1,054
    Likes Received:
    3
    Trophy Points:
    0
    Location:
    Denver, CO
    you will need to hexedit the binary xml files if apktool doenst work, how to do that is in thew ultimate android theming guide
  13. sxtnitehawk
    Offline

    sxtnitehawk New Member

    Joined:
    Aug 31, 2010
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    0
    Updated firsat post with pull/push/install framework directions... sorry I totally forgot to put that in lol
  14. sxtnitehawk
    Offline

    sxtnitehawk New Member

    Joined:
    Aug 31, 2010
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    0
    I went through that already and it doesn't help you if you want to change something that isn't a color code format...
  15. raidzero
    Offline

    raidzero n00b. Theme Developer Premium Member Developer

    Joined:
    Apr 15, 2010
    Messages:
    1,054
    Likes Received:
    3
    Trophy Points:
    0
    Location:
    Denver, CO
    yes it does, that is how I change from say, color_background_light to #ffffffff

    as far as adding lines in xml's go, I use apktool for that. if apktool doesn't work than I suggest using apktool to install a copy of the framework that is used with the apk you are editing and then trying again specifying the framework file
  16. sxtnitehawk
    Offline

    sxtnitehawk New Member

    Joined:
    Aug 31, 2010
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    0
    How can you find it if its in binary and not text... the color codes don't change between binary and XML but text does...otherwise android would have been built with standard XML instead of binary...

    Take the binary /res/layout/status_bar.xml and find the date color string and show it to me cause all I see is binary data...
  17. raidzero
    Offline

    raidzero n00b. Theme Developer Premium Member Developer

    Joined:
    Apr 15, 2010
    Messages:
    1,054
    Likes Received:
    3
    Trophy Points:
    0
    Location:
    Denver, CO
    alright, check it out:

    XML:
    Code:
    <com.android.server.status.DateView android:textSize="16.0sp" android:textStyle="bold" android:textColor="?textColorPrimaryInverse" 
    HEX:
    Code:
     android:textColor="?textColorPrimaryInverse" = 08 00 00 02 39 00 01 01 
    
    (look up the ID in public.xml and you will see 01010039, but in hex the bits are read backwards)
    so for example, to change textColor="?textColorPrimaryInverse" to textColor="#ffffffff"
    all you do is replace
    Code:
    08 00 00 02 39 00 01 01 with 08 00 00 1c ff ff ff ff
    
    this is, I believe, all in the ultimate android theming guide :)
    Last edited: Sep 8, 2010
  18. raidzero
    Offline

    raidzero n00b. Theme Developer Premium Member Developer

    Joined:
    Apr 15, 2010
    Messages:
    1,054
    Likes Received:
    3
    Trophy Points:
    0
    Location:
    Denver, CO
  19. sxtnitehawk
    Offline

    sxtnitehawk New Member

    Joined:
    Aug 31, 2010
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    0
    The source is standard XML but compiled and built into binary... I meant things would be so much easier if the files didn't end up being in binary...

    And my mistake on the I'd thing... I didn't recall seeing that in the guide but thank you for pointing that out... I thought I hit somewhat of a dead end...

    A script or program to build single files would still be awesome though because then you could edit the standard XML and then build it and put just that file back into the Apk... know what I mean?
  20. raidzero
    Offline

    raidzero n00b. Theme Developer Premium Member Developer

    Joined:
    Apr 15, 2010
    Messages:
    1,054
    Likes Received:
    3
    Trophy Points:
    0
    Location:
    Denver, CO
    indeed, but then the dalvik VM wouldn't know what to do with them (ever accidentally put a decompiled xml into an apk lol)

    unfortunately the utility you talk about cannot exist, you have to decompile all or none, and at the same time it has to be decompiled into a format that can be recompiled correclty using the correct ID nomenclature..

    axmlprinter plus hex edit is as good as it gets, unless you use apktool but then sometimes it cannot recompile correctly and you will notice strange happenings on your phone

    anyway, I quite enjoy hex-editing, it makes me feel 31337 :p