[Tutorial][Linux]Themer's Portal and Guide

Search This thread

qasimzia512

Senior Member
Nov 18, 2008
2,083
1,511
35
Staten Island
There are 2 ways to get rid of all the blue from the contacts.apk

1. U need Ubunto 10.04 with SDK and Java 6, then you need to sync the source (there is a tutorial somewhere), change the values in contacts.apk and build it using the code provided in the tutorial...

2. Since I have everything set up, you can just post the value you wanna change it to and I will do it for you and post the apk back here after I'm done with it :)

Sent from my Galaxy Nexus using XDA
 

artvandelay440

Senior Member
Feb 8, 2011
1,422
1,122
There are 2 ways to get rid of all the blue from the contacts.apk

1. U need Ubunto 10.04 with SDK and Java 6, then you need to sync the source (there is a tutorial somewhere), change the values in contacts.apk and build it using the code provided in the tutorial...

2. Since I have everything set up, you can just post the value you wanna change it to and I will do it for you and post the apk back here after I'm done with it :)

Sent from my Galaxy Nexus using XDA

Awesome there is one XML I'd like changed and I'll pm you after lunch.

Sent from my Galaxy Nexus using xda premium
 

etoy

Senior Member
Dec 21, 2009
1,814
862
There are 2 ways to get rid of all the blue from the contacts.apk

1. U need Ubunto 10.04 with SDK and Java 6, then you need to sync the source (there is a tutorial somewhere), change the values in contacts.apk and build it using the code provided in the tutorial...

2. Since I have everything set up, you can just post the value you wanna change it to and I will do it for you and post the apk back here after I'm done with it :)

Sent from my Galaxy Nexus using XDA

i looked at the tutorial but something went wrong..i guess JDK was removed from canonical repo and couldn't install the whole packages stuff with 1 command. i'll try to set it up in some other way but i'm completely blind on linux.

--

do you have AOKP sync'd? i'd like to have a couple apks compiled, it's just two xml edits (one for each apk)
 

etoy

Senior Member
Dec 21, 2009
1,814
862
i'll keep testing that bastard, in case i have success installing jdk+sdk i'll post some kind of tutorial but no promises at all :)
 
Last edited:

etoy

Senior Member
Dec 21, 2009
1,814
862
no problem, glad that helped!

in case you find it useful, here's attached my apk manager folder.
the script is slightly modified for ICS (decompile w/ apktool 1.4.2 and recompile w/ 1.4.3) and lets me modify most of the apks without problems.

http://www.mediafire.com/download.php?ajc43nt9j4l5vkv

some of them still FC when recompiled (deskclock, camera, contacts, etc) but it's better than nothing.

linux is still the only way :(
 

artvandelay440

Senior Member
Feb 8, 2011
1,422
1,122
There really should be a stickied thread where everyone can discuss compile/theming tools/ etc- what tools work for what job, and where people can exchange working apks for modding purposes.
 

etoy

Senior Member
Dec 21, 2009
1,814
862
we should try to make this one become that thread.
there's (too) many of them in general android theming/modding but in everyone there's something old / missing OP / whatever.
 

artvandelay440

Senior Member
Feb 8, 2011
1,422
1,122
Sure, why not. I'll mod the OP to include my tools and experience, and if anybody wants to contribute, please do :)
 

qasimzia512

Senior Member
Nov 18, 2008
2,083
1,511
35
Staten Island
i looked at the tutorial but something went wrong..i guess JDK was removed from canonical repo and couldn't install the whole packages stuff with 1 command. i'll try to set it up in some other way but i'm completely blind on linux.

--

do you have AOKP sync'd? i'd like to have a couple apks compiled, it's just two xml edits (one for each apk)

I have it synced n i built apks for my themes from it past but when i tried to resync the source last night, i kept getting an error...

Sent from my Galaxy Nexus using XDA
 

varun.chitre15

Inactive Recognized Developer
Oct 23, 2011
3,153
15,403
Sangli
Ok can someone give me contacts.apk?
I can try to make it transparent or any other mod u want.

Sent from my Micromax_A70 using Tapatalk 2 Beta-4
 

etoy

Senior Member
Dec 21, 2009
1,814
862
Ok can someone give me contacts.apk?
I can try to make it transparent or any other mod u want.

Sent from my Micromax_A70 using Tapatalk 2 Beta-4

here's my themed contacts.apk

i'd like to change a value in res\values\colors.xml

exactly this:


Code:
    <color name="quickcontact_list_divider">#ffcdcdcd</color>

to


Code:
    <color name="quickcontact_list_divider">#ff000000</color>

thanks
 

Attachments

  • Contacts.apk
    2.8 MB · Views: 7

Top Liked Posts

  • There are no posts matching your filters.
  • 19
    "If you can't explain something simply, you don't know it well enough" -Albert Einstein

    There are a ton of guides available for theming, but I have always found most to be either a) erroneous b) way over complicated or c) out of date. I'll try to keep this simple, easy to understand, and up to date.

    Introduction

    There are 2 main ways to theme. You can choose the more powerful “zip” style that gives you complete control but is more difficult and time consuming to maintain, or you can choose the “theme chooser” method that is much easier to maintain, but is more limited. A lot of themers will do a theme chooser apk and supplement it with an additional zip file that finishes things the theme chooser cannot. That’s what i do. I recommend Linux for theming since more of the advanced concepts are best done on linux. (Git, source building, etc) For the purpose of this guide, I’ll use my Elegant Dusk as a reference and Ubuntu 12.04 as my distribution of Linux.

    Decompiling

    Without building directly from source, you'll need apktool to decompile apps. We'll use Apkmultitool for this, since it will sign your apps with a debug key so you can actually install them to your device.

    Download this ApkMultiTool, (Choose the "Linux Version 1.0" at the bottom) then extract it to your desktop, then rename the folder ApkMultiTool.

    Once extracted, open a terminal and go to that directory by typing

    cd /Desktop/ApkMultiTool
    Now, we need to make the script executable. From the open terminal, type

    then type ./Script.sh to execute it.

    If you got an error about optipng and sox are not in your path, simply open another terminal and run this:

    sudo apt-get install optipng p7zip-full sox
    You should get a menu like this:

    isINS8fhSe6Dv.png




    Now, we need to patch the aapt to the newest version. In your Android SDK folder, look in the platform-tools folder and grab the aapt file from there and place it in the /other folder in ApkMultiTool. This ensures you have the latest aapt (Android Assets Packaging Tool)



    Minimize that and place ElegantDusk.apk into the place-here-for-modding folder. Then maximize the script and choose option 9 to decompile. You should now have a /out folder with several things in it. This is our project folder to begin theming. Navigate to /out/res and let's begin.

    Working with Images

    First, you'll need an image editor. Since we're using Linux, i recommend the GIMP. Open a terminal (Ctrl + Alt + T) and run this:

    apt-get install gimp
    Once that's done, launch gimp (either from the dash or by typing gimp into a terminal) and we're ready to theme. I can't get into a full GIMP tutorial here, but that will get it installed, and you can either play with it or find some of the zillion gimp tutorials.

    Ok, you've edited an image and are ready to test it on your phone. Let's say you want to change the settings background. That's controlled by frameworks_res_background_holo_dark.png in the drawable-nodpi folder of my theme. Change it however you want. If you're done and ready to compile, refer back to the recompile section above. Or, continue on for more tips.

    What the heck is a .9.png file?

    Android has devised a method of special metadata that can stretch an image in certain ways so it doesn't have to store tons of large image files in it's resources. In other words, it's an optimization technique. We can edit these easily within GIMP, or we can redraw them with a tool that comes with the AndroidSDK called draw9patch.bat. It's in the /tools folder. Let's look at one.

    ab_bottom_solid_light_holo.9.png


    See the 1 pixel black lines around it? The position of that tells android how and where to stretch the image, as well as where content (ie text) can be displayed inside it. The top and left sides tell android where to stretch and the bottom/right tell it where content can be displayed. As we see, content can be displayed everywhere, and the image is stretched in only a small part. For theming, you NEVER want to touch the black lines, so when you change something inside (the gray area), make extremely sure to never alter them in any way. It will cause literally dozens of compile errors with no warning as to which file caused it (a huge pain).

    Working with XML

    XML (eXtensible Markup Language) is the primary code language we'll be dealing with in theming. There are a TON of programs that can edit xml, but since we deal with it a lot, it's good to get one that looks nice and has syntax correction. I recommend Sublime Text 2. Let's install it with these 3 commands. Run them seperate.

    sudo add-apt-repository ppa:webupd8team/sublime-text-2
    sudo apt-get update
    sudo apt-get install sublime-text-2
    Now let's look at a simple XML. Go to /res/values/colors.xml and open it with sublime text. (Right click>open with) You'll see this:

    ikqdkEuzFex0.png


    The values are on the right side listed as #ffffffff or similar. These are hexadecimal ARGB color codes. Each set of 2 letters/numbers represent something. The first two (Alpha) are the transparency. FF means fully opaque and 00 means fully transparent. 50 would be 50% transparent. The next set of two (R) represent the red value, or how much red is in the color shade. Again, FF is fully saturated pure red and 00 is no red at all. The same applies to the next two sets. (Green and Blue) This makes up ARGB, so the example of #ffffffff would be fully opaque and full colors of red, green, and blue, which make white. So the hex for white is #FFFFFFFF.

    ICS Blue is #ff33b5e5, just in case you are wondering.

    Change any values you like, and then simply hit save at the top menu.

    Ok, so what about changing more than just colors that were already there? Read on:

    Let's say you wanted to change an entire style. I'll use MMS as an example. There are tons of "inverted MMS" apps out there, mainly because it is one of the easiest apps to invert. We want to change the light style to a dark style, so how do we do that? There are a handful of edits we need to do, but since we are concentrating on styles, let's start there. Open /res/values/styles.xml and search for theme.holo.light.darkactionbar. Found it? Change it to theme.holo (so, delete the .light.darkactionbar part) we've just told MMS to use the android "holo" style, which is dark with white text. There's a lot more to it, but this is a simple example of redirecting styles within an app.





    Compiling

    This is where it gets fun. There can be a lot of errors at this point so be patient. After you've edited your images and .pngs you need to pack it all up again. Maximize your script.sh again and choose option 10 for compile. If you need, scroll up when it's done to see if it built ok. It should look like this:

    iwBnBpD3MuggE.png


    Odds are you might get some errors at this stage, so copy the log and post it in a pastebin or similar and i'll try to help as time permits. If no errors, you now need to sign it. If you look in the place-here-for-modding folder, there will now be an unsigned apk waiting. After choosing option 11 to sign, it will change to a signed apk, and you can rename it whatever you like and install like a regular app.
    4
    This is from my discussion thread that got lost :p,


    Tools:

    Update your sdk to 4.0
    Latest Apkmanager (5.0.2) (make sure you replace the aapt with the latest one from your 4.0 sdk install)/ Apk Multi-Tool
    Latest Apktool

    Install the framework:

    Code:
    apktool if framework-res.apk

    Framework Compilation Errors:

    You will notice that you get a lot of 'plurals.xml line 79' errors when trying to compile the framework.

    You have to go the line 79 in each xml that gave an error and add a % in front of the 2nd %d.

    For example in values/plurals.xml, change the following:

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

    to:

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

    It will compile ok after that.

    Clock/Carrier/Ticker/Text Highlight colors:

    In framework-res/res/values/colors.xml, change the following to your desired hex color code:

    Code:
    <color name="holo_blue_light"></color>
    <color name="holo_blue_dark"></color>
    <color name="highlighted_text_holo_dark"></color>
    <color name="highlighted_text_holo_light"></color>

    Notifications background color:

    In SystemUI/res/values/drawables.xml, change the following to your desired hex color code:

    Code:
        <item type="drawable" name="notification_item_background_color"></item>
        <item type="drawable" name="notification_item_background_color_pressed"></item>
        <item type="drawable" name="status_bar_notification_row_background_color"></item>
        </item>

    Changing the statusbar image:

    In SystemUI/res/values/drawables.xml, change this one line and change the corresponding image in drawable-hdpi/xhdpi:

    Code:
        <drawable name="status_bar_background">@drawable/status_bar_bg_tile</drawable>
        </item>

    Changing the notification pulldown image:

    In SystemUI/res/layout/status_bar_tracking.xml, add ---android:background="@drawable/pulldown"--- to the first line and add the corresponding image in drawable-hdpi/xhdpi:

    Code:
        <com.android.systemui.statusbar.phone.TrackingView android:orientation="vertical" android:background="@drawable/pulldown" android:paddingLeft="0.0px" android:paddingRight="0.0px" android:paddingBottom="0.0px" android:focusable="true" android:visibility="gone" android:descendantFocusability="afterDescendants"

    Removing the tint that Google inexplicably added to all the notifications:

    In SystemUI/res/values/dimens.xml, change this value to anything you like:

    Code:
        <item type="dimen" name="status_bar_icon_drawing_alpha"></item>
        </item>

    Changing it to 100% will get rid of the tint altogether.
    3
    3
    How to create themes for the Theme Chooser:
    There's a great guide at RootzWiki, and I'll link it when their site goes back up. Meanwhile:
    -Find a template apk to use and decompile it. I recommend a cm9 theme chooser apk, since the older cm7 ones have different package names often. Look at the naming structure in the drawables folder. You'll notice framework images are labeled like this: frameworks_res_imagename.png Essentially, every app's package name is added as a prefix to the beginning of the file to show it where to replace in the system. To begin with, just try replacing existing images, as this requires no additional edits.

    -BEFORE you resign and install, be sure to change the package name, author, app name, etc. in the androidmanifest.xml, and also change styles and strings.xml to reflect the exact same title. Otherwise your package will overwrite whatever you used as a base template.

    -Once you are comfortable replacing images, you can begin to generate new content. Let's say you want to theme the camera from your older zip style theme and incorporate it into the theme chooser apk. take all your old images and rename them according to the naming scheme. For camera this would add the prefix com_android_camera_imagename.png. Once all your images have this prefix, drop them into the drawables folder (xhdpi for the GNexus).
    - Now, you have to generate an xml to redirect the system to those images. The xml should have the same package name. For our camera example, this would be com.android.camera.xml, and it goes in the xml folder.

    As you can see, each image has to be redirected individually. Simple take the line from your existing camera xml (note: anything in the /layout folder will not work) and paste that line into the com_android_camera.xml. Once all your images are properly referenced in the corresponding xml, recompile, sign, and install, then select in the chooser!
    iko1ydVf8OZhY.PNG
    2
    Is there a tutorial somewhere on how to build contacts from source? I'd really really really like to have it in my theme

    Sent from my Galaxy Nexus using xda premium
    The only way to build one apk is, you need to make a full rom build first and then you can do a command for one apk. I was in the same boat and trav posted his contacts source and I told someone what xml's I wanted edited (to get rid of blue text) so that person built me the apk and I handled the images on my end cause I'm able to decompile/recompile contacts without errors (but yes phone F's me) so after compile of apk and my images I just 7zip them into the built one. You guys are more than welcome to kang the contacts/phone apk's (un holo'd) from my themes if it'll help (link in sig).


    good day.