[How-To] Theming for Chameleon OS - Theme Structure - Android Themes

There are alot of great resources here to get started theming, so I won't go into the basics here. This thread is a how-to structure a .ctz theme for Chameleon OS, a new ROM that uses a theme engine similar to MIUI. Theming for ChaOS is easy compared to the theme chooser, no xml mapping or any of that. It is very straight-forward.
So I will do my best not to overcomplicate it.
Someone is usually available for support on IRC Freenode #chameleonos
Theme structure
The Chameleon OS theme is made up of 3 components
1. Individual app or icon archives containing a res folder and a theme_values.xml
2. A description.xml that contains the basic info like theme name and author
3. Folders for Media
Archives
The Chameleon OS theme archives are for individual apps and an icon archive. They are labeled by app, for example, com.android.systemui, framework-res, com.android.settings, and so on.
The app archives contain a res folder and a theme_values.xml(if you are changing any values). The res folder will have subfolders for each resolution you are theming,i.e., drawable-hdpi, drawable-xhdpi, drawable-mdpi, drawable-nodpi and so on, your decompiled apk will show you what images go in which folder.
In addition: you can override framework images on a per-app basis. Simply include the framework images you want to override in the appropriate drawable-folder. This comes in handy for fixing text/background issues in individual apps, without having to re-theme the app. Simply add the backgrounds(or whatever) you want to change to the proper drawable folder and *BAM* its fixed. You have this option with theme-values also. Another way this comes in handy is because of the theme mixing feature, certain drawables are taken from framework for each app. Example: when someone mixes a dark status bar with a light framework, the proper notification backgrounds will show if you include them with the systemui archive.
The icons archive just contains the res folder and drawable subfolders containing the icons you are using with your theme.
Description xml
The description.xml is a xml file containing basic info that the Theme Manager uses. Here is an example:
Code:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<ChaOS-Theme><title>*</title><themer>*</themer><author>*</author><version>*</version><uiVersion>2</uiVersion></ChaOS-Theme>
Where you see * is where you enter the info for your theme, title, themer, author, version
Other folders for media(previews, ringtones, wallpaper, boot animation)
previews folder - contains screenshots that show up in the theme manager. Images are labeled as follows: preview_0.png, preview_1.png, ect. Also, you can specify an image for each category: preview_launcher_0.png, preview_statusbar_0.png, preview_contact_0.png, preview_icons_0.png, preview_mms_0.png.
You can have as many images as you want, just change the number at the end from 0 to 1,2,3, etc.
wallpaper folder - contains your default wallpaper labeled default_wallpaper.jpg or .png
ringtones folder - you can include a ringtone and a notification tone that can be applied with theme manager they should be mp3 format and are labeled as follows: notification.mp3, ringtone.mp3
boots folder - contains the bootanimation.zip you want to use with your theme
Theme_values
The Chameleon OS theme engine allows for the changing of many of the things found in the values folder of your decompiled apk: arrays, attrs, bools, colors, dimens, and strings.
Mostly themers just use colors to fix text readability issues, but all are available for your themes. In addition, the theme engine allows you to override framework values on a per-app basis. this allows you to correct text issues within a single apk, without impacting other apks that use the same value.
Example: Say I wanted to change the color value holo_blue_light to an orange color, in an apk.
File name - theme_values.xml
Code:
<?xml version="1.0" encoding="utf-8" ?>
<ChaOS_Theme_Values>
<color name="holo_blue_light">#ffff8800</color>
</ChaOS_Theme_Values>
You can include as many values as you like in between the <ChaOS_Theme_Values> and </ChaOS_Theme_Values>
This file goes with the res folder for your apk when making the archive.
Archiving the theme
This is important if you want your theme to work. I am using windows and winrar(zip format not rar) to archive. If you are on Mac or linux it may differ slightly
Select the res folder and theme_values.xml together, right-click->Add to archive. Name the archive appropriately, i.e. com.android.systemui
Repeat for each apk that you are theming.
Put all of your archives with the media folders and the description.xml and select all, right-click->Add to archive
Name your archive themename.ctz
Push to your device and apply then go back and do it 50 more times until it looks the way you want

Related

Theme Porting Guide

Well Im not great at directions so this is the best i can do.
Summary
There are 2 ways that I know to port a theme to your device.
1. Using the metamorph app if its a metamorph theme.
2. Using 7zip ect.. if its a flashable theme. (most common)
Metamorph Instructions
1. First things first is to download the theme that you want to port.
2. Your theme will be a zip file containing only image files from apk's
3. Put the zip file on your sd card
4. Make sure your device is set to 320x480 resolution or metamorph app will not work.
5. Open metamorph app and start a new project.
6. Locate your zip file and let all the apks load up.
7. Install each apk one at a time. Do not install any jar files as they will cause your phone not to boot.
8. Reboot and your Theme should be working on your phone.
Flashable Theme Porting Instructions
Its not that difficult, once you get the hang of how 7zip works it will be your best freind. Its just a process of dragging and dropping images from one apk to another all within 7zip.
What the metamorph app does is takes themed images and places them into the correct apks res\drawable folders in your system.
Knowing what metamorph does as an app, you can do this manually using 7zip.
1. Download the theme that you want to port. It will be a system folder with an app,framework, and font folder inside of it.
2. Open up that system folder with 7zip
3. Make a copy of the system folder of your current rom and open up that system with 7zip as well. You should now have 2 different 7zips open. Make sure to keep track of witch is witch.
4. Open up the app folder of the themed system and open up the first apk thats in there.
5. Go into the res\drawable folder in the apk in both your system and the themed system.
6. highlight and drag and drop only the images from that folder to the same folder in the other base apk. Make sure to NOT highlight any xmls.
7. Do the same for any images in any other drawable folders the are mdpi.
8. If there are only hdpi folders and no mdpi folders than you will have to convert those images to mdpi size before using them. If there are both, than only use the mdpi images.
9. When finished overwriting those images in that first apk, go back to the other apks in the app folder and do the same thing. You can do all of this from with in 7zip. No need to exit 7zip in this entire process.
10. Open up the themed framework folder and you will see a framework-res.apk file. Open up that file, you will see the same res\drawable folders.
11. Also open up the framework-res.apk from the base theme in the other 7zip as well. And overwrite the images just like the other apks making sure not to overwrite any xmls.
12. Back out of that back into the framework folder itself, if there is a services.jar in the theme than you will want to use overwrite that file as well.
13. Back out of the framework folder, If there is a fonts folder in the theme, You will want to overwrite those files as well.
14. Now you are done modifying your base theme with all the images from the theme.
15. You can now close the themed 7zip that you downloaded and leave open the 7zip containing you newly modified apks. Create a folder on your desktop called "system". Inside that, create a folder called "app", "framework", and "fonts"
16. Move only the modified apks that you replaced images in into the correct folders in your new system folder.
17. Make an androidupdate.tar with 7zip out of your new system folder and you are ready to flash it using nomorootfs method.
Tips:
Using the shift button to highlight mutiple images saves time.
Using the ctrl button to highlight images with xmls between them aaves time.
Switching views to have all images at the top and xmls at the bottom saves time.
If i forgot steps, I appologize.
Excellent guide.
The only thing I would mention is that most of the time services.jar is specific to a particular rom and as such may not work correctly with the target rom. As services.jar really only contains themed elements for the titlebar, you are better off using colorChanger's, apkTool or a hex editior to manually change the titlebar colors.
Also, in some cases (Like ProLauncher) the apk's must be signed. I prefer to use the test keys and this handy context menu here.
simple direct and effective. thanks again for all you do sir.
myn said:
Excellent guide.
The only thing I would mention is that most of the time services.jar is specific to a particular rom and as such may not work correctly with the target rom. As services.jar really only contains themed elements for the titlebar, you are better off using colorChanger's, apkTool or a hex editior to manually change the titlebar colors.
Also, in some cases (Like ProLauncher) the apk's must be signed. I prefer to use the test keys and this handy context menu here.
Click to expand...
Click to collapse
Thanks for the info man.
BTW, HAPPY BIRTHDAY MYN
Dzo Odex sample with standard theme
Thanks for this info. This will help a million. Could you also put light on how to odex it?
Eg: Dzo's odexed sample of donut has plastic theme, can it be changed to a standard android theme using the steps above and then odex it to create a androidinstall.tar?
Nice guide.
Thanks for making this.
Ill probably start trying to theme when i finish school in 2 weeks or so.
how to convert hdpi to mdpi

[GUIDE][UPDATED 5/5/2013]Ultimate Guide to Android Misc. Editing

Ultimate Editing and Theming Guide​
Preliminary Requirements:-
PC with Windows(Please avoid Windows Vista)
Java JRE or JDK
APK Multitool
framework-res.apk, SystemUI.apk, twframework-res.apk, com.htc.resources for installing
7-zip
Notepad++
Android Device for testing
Photoshop or equivalent image editing software
android-sdk(for 9 png editing)
Lots and lots of patience and mind
What this guide includes:-
1. Easiest Decompiling and Recompiling Guide *Must Read before continuing*
2. Explanation of 9 pngs and how to edit or make them
3. How to Batch edit pngs (Not 9 pngs) (Changing color, etc)
4. APK png resources(General Location of General pngs)
First Step:
Decompiling: [MUST READ]
We are assuming that you have installed JAVA, Android SDK and apk-multitool without any problems
1. Copy your mobile's framework-res.apk, SystemUI.apk and twframework-res.apk in others folder in directory where you have extracted apk-multiool
2. Open Setup.bat. Choose 2 :- Installing Framework-res
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Setup.bat​
Choose 1 (framework-res.apk)
Choose 2 (twframework-res.apk) [similarly install OEM specific files such as com.htc.resources , etc]
Choose 4 (SystemUI.apk)
Window will close each time you choose an option
You will have to restart Setup.bat each time
3. Now place the apk you want to edit in place-apk-here-for-modding
4. Now open script.bat. (If you see any error, either you haven't installed JAVA and SDK[adb] or they aren't implented, Please install them properly before continuing). Click any key to continue
APK-Multitool Window​
5. You will see the above window. Now, make sure you have installed all frameworks and Compression level is set to 9.
6. Now, we will choose our project. Click 24. A list of files present in place-apk-here-for-modding will be in front of you. Choose any file
7. Click on 9. Now decompiling will be in process.
8. After it is complete, go to projects folder, you will see a folder with the name of apk you decompiled
Decompiled apk example​
If it is decompiled properly, then there will be apktool.yml file in it
9. Do your modifications. Now, you can edit .9.png files (they will be discussed later) and xml files which were uneditable first
You will notice that there will be many new folders which weren't present in compiled form of apk. These all folders are generated from a file called resources.arsc present in compiled form which is absent in decompiled form
Such an example is of values folder which contains crucial xml files like styles.xml, strings.xml, ids.xml, etc
Always open xml files with Notepad++, it will mark commands and syntax making it look aligned and making it easy to understand
Example of decompiled xml file ​
Also, you can edit 9 patch files also which will be changed from now on
Example:-
We will discuss 9 png in detail later on
10. After you have done your modifications and you are ready to recompile the app, choose 11 (Compile System APK) if you are editing System App or 12(Compile Non-System App) if you are editing other than System App
11. a) If System App:-
After some time it will ask that if you want to copy additional files other than signatures to ensure less amount of errors, then choose y
After extracting some files, it will ask you to delete files from keep folder
Simply go to keep folder,
If you edited any pngs and there are many and you are lazy enough to delete one by one, then delete the whole folder in which you edited pngs
If you edited any xml file, then delete that xml file AND ALSO DELETE RESOURCES.ARSC
Why? Because we told that values and several other folders are generated from resources.arsc while decompiling
Now, if we don't delete resources.arsc, the modification we did in values folder will be reverted to original state
After doing this, go to script.bat again and press any key to continue
11. b)If its not system app:
Just recompile it and sign it man through the menu in apk multitool man.
It is easy as hell. Tutorial of non-system app has been ended here
12. Now, you will get another apk name System_ apkname.apk
Open both apks as archives by 7-zip
13. Last and most important step:-
Just drop the files you edited from new apk to old apk in correct folders. By now, you may have understood that resouces.arsc INCLUDES your edited xmls
14. Now, the final apk is not System_apkname.apk but apkname.apk (the original file you started with). Push it and enjoy
9 PNG Discussion
These are special types of pngs that can be stretched to fit the need of program or different scenarios or cases. It contains 1 pixel lines on each border of different lengths for different things
As told above, we can't edit 9 png in compiled form as it will lose these lines which define its properties. So, we first need to decompile apk in order to edit 9 pngs
So, after decompiling apk, open 9 png in Photoshop and select the part inside that 1 px border and edit anything you want (Hue, Saturation, Bevel, Emboss, ANYTHING)
Now save it (save it as a normal png and then rename it as .9.png because photoshop doesn't recognise 9 png extension and image will loose its RGB format)
Explanation of 9 png:-
You can read this for more information
If you have doubt that you have gone wrong somewhere or you have made a new png from scratch and want to test if it is correct or not:
(Check all 9 png files you edit as they can cause Force Closes or bootloops)
Go to folder where you extracted android-sdk and go to tools folder and open draw9patch.bat
A window like this will open up:-
Drop you 9 png here
A new window will open with you 9 png on it
Tick on show bad patches
If you see red rectangles, you have a bad 9 patch image. You will need to delete or add those lines in png to remove all red boxes. If you want to delete, press Shift and start moving cursor over lines you want to delete. You can choose method of hit and trial to remove all rectangles and move the lower scale to see how your image size is adjusted
Or you can do what I do:
1. Remove all lines
2. Add single dot on top centre and left centre border of image (That can be taken as stretchable area)
3. Add lines on right and bottom of image where you want to fill content. Now, click on Show Content
The purple area you see in image is the content area (Text will be filled there. Eg:- Popup Menu)
4. Now, you can adjust these lines acoording to your need that what you want for stretchable area and content area until an unless there comes an red triangle
5. When it is done. Save the file. DONE
Easy, isn't it?
That's what theming is
Batch Editing pngs in Photoshop
Well the scenario is you have 200 pngs and you want to change their color, hue, add effect to them, etc. Definitely not worth the time you will spent doing this one by one. So, here, I will cover how to batch apply same edits on to your infinite pngs. Here, I am taking example of changing color of battery png from green to purple, you can apply any attribute to your image in the same way. I repeat it is not for .9.png files. Read above guide for reference
Let's start
1. First copy all your pngs you need to edit in a separate folder. I have made a folder named Battery Base and pasted my all pngs of battery there.
Now create another folder where your edited pngs will be saved. For eg:- Battery Done. (Don't create it inside Battery Base folder)
2. Open Adobe Photoshop and Choose Window>Actions or Alt+F9
3. Click on the note like file (Create new Action)
Rename it to anything you want . I have chosen Battery_color
Then click on Record. Now, you will see that red circle is enabled and now everything you do on image will be recorded and will be applied on each image.
4. Now, do this very carefully, don't miss any step.
We will do every thing that we want Photoshop to do with each file we want to edit.
a) So, first we want Photoshop to open the image. So , click on Open and choose any png from Battery Base folder (Choose a file with more color so that you know what color exactly your file will be after editing. That is why I chose 90 percent battery here).
b) Now, after opening, we want to change Color of png from green to purple. So, choose Image>Adjustment>Hue and Saturation or Ctrl+U
A dialog box with 3 sliders will appear. Move upper slider to change color. You can move other slider to change saturation and brightness if you want. Now, if you got it right, click on OK.
Every step of yours is being recorded, so don't do unnecessary stuff you don't want to do on other images. Nonetheless, if you have done it, then Drop down the Battery Base Action in action palette and you will see your every action there, If you want to delete any action , you can delete it from there. You can also add any action before pre completed action by clicking above that action and performing it.
Now, you can do anything you want to be done on your rest of pngs.
c) Now, we want Photoshop to save this png to carry on working on others. So, Go to File>Save as... and save it as a png in Battery Done folder. Photoshop will ask you to choose, so choose smallest compression and no interlace.
d) Image is saved but we also want Photoshop to close the png so that it does not open 200 tabs for editing 200 pngs. So, click on close (Small cross on title bar of png). If, it asks that do you want to save changes to png . Say no, because if you say yes, the png in Battery Base will be changes and when batch processing is done, that png in Battery Done will be of different color that all others.And also, your all green pngs in Battery Base folder will turn purple too. But we want purple images in Battery Done and green in Battery Base.
5. Now, we hae done what we want, so, we will stop recording the Action. Click on that square in Actions Palette.
6. Fun Starts. Now we will do the batch processing.
Go to File>Automate>Batch
In the dialog box, Choose the action to be Battery_Color (or obiviously any action you created)
Source folder: Battery Base
Destination Folder: Battery Done
Tick both Override Action 'Open' commands and Override Action 'Save as' commands
Click on OK. Sit back for 3 to 5 minutes(204 pngs) and TADA
You can apply any action in same way. Such as bevel, glossy, pale, etc to innumerous amount of pngs
General APK png Resources
Here I will tell you where to find some pngs to theme your Phone
Note: Here I will tell location of pngs but that may differ based on modification done to your ROM by OEMs or devs. These pngs are found after decompiling or extracting the apk files. For more reference, read this.
In this part, there is only brief information, but for a very good guide, please go here. I haven't covered it all up as d3cka himself has done a marvellous job in making that guide. All the things present in that guide should solve all your queries.
General location of apks:
SystemUI.apk - /system/app/
framework-res.apk - /system/framework/
twframework-res.apk - /system/framework
framework.jar - /system/framework/
lidroid-res.apk - /system/framework/
Click to expand...
Click to collapse
Variable list:
I have referred to some locations as drawable-xdpi. X here stands for
X: m, l, h, xh
Meaning pngs can be in drawable-mdpi, drawable-hdpi, drawable-ldpi, drawable-xhdpi depending on resolution of your phone
In some places, I have just added * in order to fill spaces that are not common in each png
[?] means maybe only for GB or Samsung
Click to expand...
Click to collapse
Battery Icons -
(i)Ice Cream Sandwich/Jelly Bean: SystemUI.apk/res/drawable-xdpi/stat_sys_battery**.png
(ii)Gingerbread: framework-res.apk/res/drawable-xdpi/stat_sys_battery**.png
Status Bar icons - SystemUI.apk/res/drawable-xdpi/
Note, some, however very few status bar icons are also present in framework-res.apk
Platlogo - framework-res.apk/res/drawable-nodpi/platlogo*.jpg
(image that pops up when repeatedly clicked on Android Version)
In Gingerbrad, its a single file but in ICS and JB, they are many images.
Default Wallpaper - framework-res/res/drawable-xdpi/default_wallpaper.jpg
Default Lockscreen Wallpaper[?] - framework-res.apk/res/drawable-xdpi/zzzzzzzz_default_lockscreenw.jpg
Spinners[GB] - framework-res.apk/res/drawable-xdpi/spinner_****_**.png
(The loading circles)
Menu Icons - framework-res.apk/res/drawable-xdpi/ic_menu_**.png
These icons may also be present in twframework-res.apk for Samsung Touchwiz ROMs
Notification Toggles
(i)With lidroid 15 toggles : lidroid-res.apk/res/drawable-xdpi/
(ii)Without lidroid mod : SystemUI.apk/res/drawable-xdpi
These were some general pngs of system apps that may be used to theme the phone. You can find respective pngs to theme in their apks.
Will add more soon...
This is a work in progress.
Will add more things soon
Don't hesitate to ask any questions about anything
Credits:
@d3cka for teaching best about 9 pngs
@deathnotice01 for helping me
Miscellaneous Google and xda posts
Reserved
great
Great Guide Areeb...I THINK THIS SHOULD BE DISPLAYED AGAIN IN PORTAL
reserved
puneeth.007 said:
Great Guide Areeb...I THINK THIS SHOULD BE DISPLAYED AGAIN IN PORTAL
reserved
Click to expand...
Click to collapse
Not Now
It's incomplete
It'll ruin this guide then!
RE
+1 Thanks for this great guide
highly detailed guide, with of course nice pictorial representation!
:good:
This guide is awesome !
Unfortunately I don't know how to use photoshop correctly I still have not learned it , first by myself , and 2nd on school. I am just 13 2/3 YO . Anyway , i didn't have such knowledge about .9 png-s. Thanks
I had always got errors while editing compiled 9.png files. Hope this guide, help me to figure it out that...
Sent from my GT-S5830i using xda app-developers app
Added Batch editing in Photoshop
Sniper Killer said:
This guide is awesome !
Unfortunately I don't know how to use photoshop correctly I still have not learned it , first by myself , and 2nd on school. I am just 13 2/3 YO . Anyway , i didn't have such knowledge about .9 png-s. Thanks
Click to expand...
Click to collapse
I have covered Photshop Now. Hope it helps you
And added path thickness changing guide too
iamareebjamal said:
1. Easiest Decompiling and Recompiling Guide
Click to expand...
Click to collapse
It's not bad. :silly: Bookmarked ready to be added to mine, but could you please include tw somewhere in the thread title as it will be easier for People browsing mine looking for help for tw files.

Add new themed applications in an apk theme

Hi
I modified Kroz's Asul theme (OK) but now I'd like to add new themed apps like Chrome to start with an example.
I extract the apk file on my PC then I modify the .png and .9.png files.
I copy/paste the files in the right directories.
But now it seems that I have to create an .xml file in res/xml folder:
1/ How to know which name I have to use for the new .xml file?
2/ Which redirections I have to enter to apply the themed pictures?
Thanks in advance.
EDIT
Answers:
1/ How to know which name I have to use for the new .xml file? Check "package" in AndroidManifest.xml of themed app
2/ Which redirections I have to enter to apply the themed pictures? one line for each same file nam without extension. Example: one line for drawable folders and one other for mipmap folders.

[TUTORIAL] Become a Themer

Become a Themer Tutorial By Rock-Star
First rule before to start how to learn to theme your device :
Always make a backup of the files you are about to edit or do a nandroid backup.
If anything goes wrong you will get a bootloop.
If you are modding an apk and you are seeing a textAppearance,color,background
or similar => If the value starts with
"@android:" then you will find the source
in the framework-res.apk of the same rom.
☺ TOOLS you must have ☺
1. APKTOOL [http://code.google.com/p/
android-apktool/]
This tool will allow you to decompile and
compile all apk's
When you decompile an apk, you can now
edit the xml's with a source code editor
like Notepad++
2. NOTEPAD++ [http://notepad-plus-
plus.org/]
This tool will allow you to edit the xml's
decompiled from the apk's
Written on C++ and using Win32API, you
will be able to easily change, copy, trace,
find all the codes you will find in this
guide.
3. ADB [http://developer.android.com/
guide/developing/tools/adb.html]
Android Debug Bridge (adb) is a versatile
command line tool that lets you
communicate with an emulator instance or
connected Android-powered device. You
will be able to push, replace, delete,
overwrite files directly from your
computer to your android device.
4. SMALI/BAKSMALI [http://
code.google.com/p/smali/]
An assembler/disassembler for Android's
dex format.
5. 7-ZIP [http://www.7-zip.org/]
An open source file archiver with a high
compression ratio.
6. PAINT.NET [http://www.paint.net/]
or any other Graphics editor you like to
use as Photoshop or Gimp.
Now let's play with your theme and for that, the very first thing you will need is
to locate :
framework-res.apk
SystemUI.apk
Keep always a safe copy for both of them as you may experiment some issues during
the compile phase, which means that you
did something wrong ( even a small space
or letter ) and you will must come back to
the previous "working" modded version of
your apk.
Don't try to go too fast
Start with one step at once until you feel
experimented enough to edit more things at the time
A good tip to double check if anything goes wrong : your apk must decompile and compile without errors !
Test and flash via Recovery when you are done : if it is working, then you can start from your new framework-res/systemUI
apk's to go further.
1. Status bar
1.1. Clock, Date and notification ticker
It's now much easier to modify the clock in
the status bar as it is now located within a .xml-file.
Files to edit:
/system/app/ SystemUI.apk
DECOMPILED_DIR/res/layout/
status_bar.xml
1.1.1. Clock
Search for a line that begins with
"<com.android.systemui.statusbar.Clock" .
You now have two ways for changing the
font-style and color:
Adding
android:textColor="TEXTCOLOR"
and/or
android:textStyle="TEXTSTYLE"
where TEXTCOLOR can be a HTML color
(#TTRRGGBB - TT means transparency)
and TEXTSTYLE can be "bold", "bold|
italic", "italic" or "" Changing the style of
android:textAppearance.
This can be easier but keep in mind that
this style could be used somewhere else.
A possible new line could be:
<com.android.systemui.statusba
android:textColor="#ffff0000
android:textStyle="italic"
android:textAppearance="@and
TextAppearance.StatusBar.Icon"
android:gravity="left|
center"
androidaddingRight="6.0dip"
android:layout_width="wrap_co
android:layout_height="fill_pa
androidingleLine="true" />
With this you would get an
italic, red clock.
1.1.2. Date
The date which you can see in the status
bar can be modified by editing the line
beginning with
"<com.android.systemui.statusbar.DateView".
As with the clock, you can either add
textColor and textStyle or change the
android:textAppearance
1.1.3. Notification ticker
Search for the line containing "@id/
tickerText" .
It is followed by two other lines which
contain
"android:textAppearance="@androidtyle/
TextAppearance.StatusBar.Ticker"" .
As with the clock, you can either add
textColor and textStyle or change the
android:textAppearance
2. Carrier, Ongoing-Title, Notifications-
Title, Clear-Button, noNotificationsTitle
Files to edit:
/system/app/ SystemUI.apk
DECOMPILED_DIR/res/layout/
status_bar_expanded.xml
2.1. Carrier
Search for the line beginning with
"<com.android.systemui.statusbar.CarrierLabe
This line contains the text for the carrier
and its appearance.
The background for the carrier label can
be changed one line above using the
"android:background" attribute.
It can be a pre-defined color value
(@color/NAME_OF_COLOR ), a html color
value (#TTRRGGBB ) or even a graphics
file ( @drawable/NAME_OF_GRAPHIC ).
2.2. Ongoing-Title
Search for android:id="@id/
ongoingTitle" .
This is the Ongoing-Title.
As with other texts you can add/change
"android:textAppearance",
"android:textColor" and
"android:textStyle"
The background is defined in the
"android:background" attribute.
2.3. Notifications-Title
Search for android:id="@id/latestTitle" .
This is the Notifications-Title.
As with other texts you can add/change
"android:textAppearance",
"android:textColor" and
"android:textStyle"
The background is defined in the
"android:background" attribute.
2.4. noNotificationsTitle
Search for android:id="@id/
noNotificationsTitle" .
This is the text when no notification is
displayed.
As with other texts you can add/change
"android:textAppearance",
"android:textColor" and
"android:textStyle"
The background is defined in the
"android:background" attribute.
2.5. Clear-Button
Search for android:id="@id/
clear_all_button" .
This is the text of the Clear-Button
________________________________________
3. Notifications
Files to edit:
/system/frameworks/ framework-res.apk
DECOMPILED_DIR/res/layout/
status_bar_latest_event_content.xml
In this file you find the texts for :
the title of the notification: Search
for android:id="@id/title" .
Textcolor and textstyle are editable via
style or directly in the xml (see point
1.1.1.)
the description of the notification:
Search for android:id="@id/text"
the time of the notification: Search
for android:id="@id/time"
________________________________________
4. Color of the progress bars and seek bars
4.1. progress bars
Files to edit:
/system/framework/ framework-res.apk
DECOMPILED_DIR/res/drawable/
progress_horizontal.xml
The progress bar uses gradients to set the
color which goes from top to bottom.
You have to set three colors: start (top of
the bar), end (bottom of the bar) and
middle.
<item android:id="@id/background">
is for the unused part of the progress
bar.
<item android:id="@id/progress"> is
for the used part of the progress bar.
4.2. seek bars
Files to edit:
/system/framework/ framework-res.apk
DECOMPILED_DIR/res/values/ styles.xml
Seek bars are progress bar like components
which enables you to change a value within
a range (you will see some in the sound
settings (Settings -> Sound -> Volume) or
when changing the brightness of the
display).
By default, the seek bars are using the
color settings of the progress bar to
display the current position (so it should
be possible to use different ones by using
another .xml than the progress bars).
To modify it, open the styles.xml
Search for <style name="Widget.SeekBar"
parent="@style/Widget"> .
Here you can change :
the height (<item name="maxHeight"> and
<item name="minHeight"> ),
the appearance (<item
name="indeterminateDrawable"> and <item
name="progressDrawable"> )
the graphic of the thumb ( <item
name="thumb"> , res/drawable/
seek_thumb.xml ).
The thumb itself comes in three files,
located in res/drawable-hdpi:
seek_thumb_normal.png
seek_thumb_pressed.png
seek_thumb_selected.png
________________________________________
5. Color of selected text within text fields
Files to edit:
/system/framework/ framework-res.apk
DECOMPILED_DIR/res/values/ styles.xml
Search for <style
name="TextAppearance"> in the
styles.xml.
The color for the selected text is the node
textColorHighlight
________________________________________
6. Transparency
6.1. notification drawer
If you use a ROM that doesn't have a
transparent notification drawer by
default, then you have to do this:
Decompile your SystemUI.apk using
apktool.jar (or just decompile the
classes.dex using baksmali). Browse to the
folder smali/com/android/systemui/
statusbar/ (or com/android/systemui/
statusbar/ if you have just decompiled
classes.dex).
Edit the file StatusBarService.smali.
Search for the following line:
invoke-direct/range {v0 .. v5}, Landroid/
view/WindowManager$LayoutParams;-
><init>(IIIII)V
above that line you must have
const/4 v5, 0x2
change this to
const/4 v5, -0x3
After recompiling SystemUI.apk and
pushing it to the phone you can get
something like this :
6.2. Status bar
If you use a ROM that doesn't have a
transparent status bar by default, then
you have to do this:
Decompile your SystemUI.apk using
apktool.jar (or just decompile the
classes.dex using baksmali).
Browse to the folder smali/com/android/
systemui/statusbar/ (or com/android/
systemui/statusbar/ if you have just
decompiled classes.dex).
Edit the file StatusBarService.smali.
Search for the following line:
invoke-direct/range {v0 .. v5}, Landroid/
view/WindowManager$LayoutParams;-
><init>(IIIII)V
directly above it you will find
const/4 v5, 0x2
change this to
const/4 v5, -0x3
Recompiling SystemUI.apk and pushing it to
the phone (I tested it with the emulator).
__________________
______________________
7. Graphics
After you have decompiled your .apk files
you will end up with a lot of graphic files
in :
res/ drawable-hdpi (or res/drawable-
hdpi-v4 depending on your apktool.jar
version).
This is the right place to edit notification
icons, the notification bar and drawer,
menu item background (list, grid, etc.),
buttons, etc.
Some files will have .9.png . These are
Nine-Patch-files.
You will find more information on those
files :
http://developer.android.com/guide/
topics/resources/drawable-
resource.html#NinePatch
http://developer.android.com/guide/
topics/graphics/2d-
graphics.html#nine-patch
Let's begin with the status bar and
notification drawer:
7.1. Status Bar
To get a new status bar background, you
have to edit the file :
statusbar_background.
You find it in the SystemUI.apk . Can be
.png or .9.png
7.2. Notification Drawer
(The notification drawer constists of
several files.)
7.2.1 Carrier/Provider area
To change the background for the Carrier/
Provider area you have to edit the file :
status_bar_header_background
You find it in the SystemUI.apk . Can be
.png or .9.png
7.2.2 Ongoing and Notifications
To change the background for the Ongoing
and Notifications area you have to edit
the file :
title_bar_portrait
You find it in the SystemUI.apk . Can be
.png or .9.png
7.2.3 Notifications
To change the background for the
notification area you have to edit the file
:
status_bar_item_background_normal
You find it in the framework-res.apk .
This will be the background if you're just
look at the notifications.
When focusing a notification it will be the
file :
status_bar_item_background_focus
when you push/press it you have to edit
the file :
status_bar_item_background_pressed
The notifications are divided by the file
divider_horizontal_bright. Can be .png or
.9.png
7.2.4 Unused area
The area where no notification is displayed
is set in the file :
SystemUI.apk/res/layout/
status_bar_tracking.xml .
You have to change the attribute
android:background of the View-node.
It can be a color-value, a predefined color
or a graphics file.
Depending on your ROM it will even display
transparency. Can be .png or .9.png
7.2.5 Bottom
The bottom part of the expanded drawer is
status_bar_close_on .
You find it in the SystemUI.apk . This will
use transparency too. Can be .png or .9.png
7.3. Animated notification icons
7.3.1 Battery (uncharging)
Depending on your ROM there will be more
or less files for the battery gauge.
They begin with stat_sys_battery_
followed by a number.
The order how they are get displayed is
configured in the file :
res/drawable/ stat_sys_battery.xml .
You find it in the framework-res.apk .
7.3.2 Battery (charging)
Depending on your ROM there will be more
or less files for the battery charging
gauge.
They begin with
stat_sys_battery_charge_anim followed
by a number.
The order how they are get displayed is
configured in the file :
res/drawable/
stat_sys_battery_charge_anim.xml .
You find it in the framework-res.apk .
7.3.3 Download and upload animation
The files for the upload and download
animation begin with
stat_sys_download_anim and
stat_sys_upload_anim followed by a
number.
The order how they are get displayed is
configured in the files :
res/drawable/
stat_sys_download_anim.xml
res/drawable/
stat_sys_upload_anim.xml .
You find it in the framework-res.apk .
8.4. Other files
8.4.1 Title for detailed view in call history
You will find the background for this in
the file title_bar_tall. You find it in the
framework-res.apk .
8.4.2 Title for contacts
You will find the background for this in
the file title_bar_medium. You find it in
the framework-res.apk .
8.4.3 Background for the grid menu
The grid menu is the one when you press
the menu button within an application.
The following files are used and you find
them in the framework-res.apk :
menu_background: This the background
for one grid element.
menu_background_fill_parent_width:
the whole grid
To change the text color you have to set
the color for the style
TextAppearance.Widget.IconMenu.Item in
the file res/values/ styles.xml
After pressing "More" you will find
another menu. The text colors for this
menu can be found in the style
Theme.ExpandedMenu.
________________________________________
9. Applications
9.1. Ongoing downloads
You should have noticed that the text color
of ongoing downloads in the notification
area doesn't look like the text colors for
normal notifications.
To change this color you have to change
the file /system/app/
DownloadProvider.apk .
You'll find the color values in res/layout/
status_bar_ongoing_event_progress_bar.xml .
It uses the same names as the one in the
framework-res.apk. After you have
recompiled it you can flash it to your
phone. You should see the new colors at the
next download.
9.1. Notifications of music player
If you are using the default music player
(/system/app/Music.apk) then you can
change the colors it uses for notifications
as well.
After you have decompiled it, open res/
layout/ statusbar.xml and edit the values :
@id/artistalbum
@id/trackname
Thanks for your time and your attention
Have Fun ☼
#PLEASE PRESS THANKS#
For Any Android Help Message me on WHATSApp- 8889197172

Building Your Own LG Themes

Introduction
This is going to be a long post! A few weeks ago I started thinking about making my own themes for my LG G5. I had installed some custom roms previously and used substratum a bit but I have always ended up going back to xpirt's Fulmics rom, which doesn't allow this. I started to think how I could do this and have today got to the first stage of being able to change the colours of my phone to precisely what I want, not only for the settings but in some of the stock apps. I thought I would share this with the community and provide some step by step instructions so you can try it yourself. This should work on LG G6, V10, V20 & V30 if you use an app made for these phones but I have no way of testing this so don't hold me to it. This has taken me about 5 full days to work this out and there is still more that I need to do.
I am not in anyway a developer or coder and have very little knowledge of Java so if anything goes wrong here it is likely that I will not be able to help you. I absolutely am a noob at this and do this only for a hobby, using just my common sense and our friend Google to overcome the problems I have come across. Saying that, I will try to offer assistance if I can.
I managed to make my theme from reverse engineering a free LG theme app that was readily available. If you do this method though please consider getting approval from the app developer first. There is a template on here posted by Raafat here. While this was helpful it was only basic and I could not work out exactly what to do. Reverse engineering an app was much easier. Here is how I did it with step by step instructions:
******DISCLAIMER******
I am in not responsible for what you do to your phone. If you decide to try and theme your phone make a backup first or be prepared to do a full reset if anything goes wrong. You do this at your own risk.
1. Programmes
The programmes/software needed for theming are:
• Notepad++
• Apktool
• Android Studio (I used version 2.3 as I was getting an error on re-signing with 3.0)
2. Installing Frameworks Using Apktool:
• Firstly, delete the files in your local temp directory. To do this open ‘Search’ and type in %temp% and delete all files in this folder. You may not be able to delete some of the files. This does not matter
• Next, extract the framework files from your rom/custom rom. For Fulmics 5.5 this was:
Frameworks-res.apk
lge-res.apk
• At a guess I would say that any rom will have these files named exactly as they are above, but I am not sure if these have been altered by xpirt for his rom so you may not be able to use them across other roms.
• Open a command prompt and navigate to the folder where the framework files are kept. This is easiest in a folder called C:/apktool so create a folder in your C:/ drive and place them there. You can of course name the folder or locate it where you want though.
• Use apktool to install the frameworks using this command in the command prompt in C:\apktool
apktool if framework-res.apk
apktool if lge-res.apk
• Once this is done you should find the following files Installed here: C:\Users\[your username]\AppData\Local\apktool\Framework
1.apk
2.apk
• If, like me, you get an error with apktool that says it cannot write to C:\Users\[your username]\AppData\Local\apktool\Framework and instead has placed them in the temp folder then go into the Local folder using the pathway above and create a folder called 'apktool' and then a subfolder called 'framework'. Try the commands again and it should then work.
• You should also find the following files in the C:\apktool folder (if that is the folder you are using). If they are not here you may have to copy and paste them from the apktool github download.
apktool.jar
apktool.bat
• If you have found these files then you are set to go with decoding the theme/app you have chosen as a basis to amend.
3. Decoding APKs Using Apktool
• Download the apk/app you want to use. I used Backup and Restore app from Play to get the app I wanted to use onto my PC. Once you have this on your PC place the main APK/app in the same folder as the apktool.bat and the apktool.jar (for me this this was C:\apktool)
• Point the command prompt at this place and type the following:
apktool d [app name]
• A folder with the name of the app you just decoded will appear in the directory that you use (in this case C:\apktool)
• In this folder you should find another folder called assets. There may be more sub APKs here in subfolders. This subfolder will likely be assets>overlays
• All the sub APKs in here will have to be decoded otherwise you will have different signing keys and the app, once compiled again, will not work. Decode all the sub APKs in this same folder. You will have to copy the following files to the folder you are decoding the sub APKs in. These are:
apktool.jar
apktool.bat
• Decode every sub apk using the command apktool d [sub_apkname]
• You should now have the same number of folders in the drive as the number of sub APKs, if you decoded them all.
4. Changing the Colours and other Themes from the Decoded APKs Using Notepad++
• Many theme APKs will have internal APKs, such as common, settings, phone, systemui, calendar etc, etc. This is what I have worked out so far:
Common: Changes the switches, brightness bar and the text headings in settings, changes swipe left panels in apps such as gallery, changes background, message icon & phone icon colour in contact/phone app, statusbar background, separating lines in settings (some themes do not have these), background bar of setting title (i.e. wireless network, device etc), settings text colour, secondary text (i.e. the text you see under Wifi and Bluetooth which shows you what you are connected to), the headings in apps such as clock where it shows 'Alarm' 'World Clock' 'Timer' etc
System UI: Changes the quick settings tiles & text and the non-heading text in settings
• To change the colour of these you have to amend the colors.xml located in one of the folders in the assets>overlays and then the folder of the overlay you want to change. I used Notepad++ to do this. Navigate to 'res' folder and then usually something like 'values-xxxhdpi-v4'. There is sometimes more than one color.xml file so you may need to look in more than one folder and amend all the color.xml files. The colours are at the end of the lines of text and will be standard Android colour coding, such as ffffffff (white) or 00000000 (black) or any other colours.
5. Building APKs & Signing with Android Studio
• If you are building the sub APKs from an app (these are the ones inside an APK such as common, systemui, phone etc) I found it best to use a different folder. For this I used C:\apktool builder
• Copy and paste the folder from the decoded APK (e.g. the [appname].LGE.common folder) that is in the asset>overlays folder to the apktool builder folder above
• Once you have made the colour amendments it is time to build the amended themes. To do this you will need Android Studio
• Open the splash screen of Android Studio and instead of the 'Open' command use the 'Import Project' command and navigate to the folder you want to import
• When opening Android Studio you have to configure the frameworks otherwise you will not be able to sign the app. This warning should come up automatically. THIS MUST BE DONE FOR IT TO WORK
• Navigate and find your APK in apktool builder and import it. If you do this more than once you will be prompted to overwrite the settings a few times.
• Go to ‘Build’ along the top and choose ‘Generate Signed APK’. If this is the first time it will ask for the Key Store Path. You will need to choose ‘Create New’. Select a place to store this key (I chose C:\apktool Builder) and input the passwords and the other data in the boxes. You must put a two-digit country code in the last box, for example US, UK etc). For ease I kept most of these very simple. For example, password was 'asdfgh'
• Once this has been completed and if there are no errors (warnings are ok) then it will generate a signed sub APK and save it to the location you are in (in this case C:\apktool builder). Copy and paste that sub APK over the one in the C:\apktool folder where the original sub APK was kept.
• Once you have done this then you need to sign the main app APK. Do the same as above and build in Android Studio. If there are no errors it will save it to your directory (in my case C:\apktool\[app name].
• Copy and paste this APK into your phone, apply the theme and it should work.
Everytime you amend a sub apk you will have to re-sign it through Android studio and then re-sign the main app apk. Once you get the hang of it though it is fairly straight forward.
6. Other Things
Nothing else in the app will change at this point. The name, wallpaper jpegs, screenshots and icons will all be the same. I am working on this at the moment but they don't actually need changing that much. The difficult thing for me is how to change the 9.png icon files and still get them to work. Once I have worked this out I will be able to finish it off.
7. Screenshots
Attached are some screenshots of how my phone now looks. I have made a few different apk's with different colours so I can now change this daily if I want a change (see post 2 for updated screenshots).
8. Thanks/Credits
@xpirt - Made it easy to get the framework files I needed for apktool and for a great custom rom!
@Raafat - for giving me the idea and the initial information
@iBotPeaches - for developing apktool.
.
Building Your Own LG Theme
I've been able to fine tune the themes over the past few weeks and have been able to colour the settings icons on the main settings page as well as putting a background behind it. I've also been able to theme the switches initially getting over a problem of the 'off' switch not showing. Here is some updated screenshots of a green/grey&blue theme.
I've also attached the updated blue & red theme from the initial post. I've not fully completed this yet though as I started to concentrate on the green/grey&blue theme as I preferred that.
Could someone make a stock theme just dark? I found one on play store but is not the best thing (it changes system sounds and other things that i don't like) I'd like a full stock theme but dark. Thanks in advance
Help
Can you help me? I tried changing package names in .json file and added new icons in the theme. I don't understand why it is failing on apply. It was running properly with only color change before doing this.
[email protected] said:
Can you help me? I tried changing package names in .json file and added new icons in the theme. I don't understand why it is failing on apply. It was running properly with only color change before doing this.
Click to expand...
Click to collapse
Here is the apk.
I probably won't be able to get round to this until the weekend due to work commitments but will have a look and let you know.
strikerman10 said:
I probably won't be able to get round to this until the weekend due to work commitments but will have a look and let you know.
Click to expand...
Click to collapse
Take your time, and thanks. ?
[email protected] said:
Take your time, and thanks. ?
Click to expand...
Click to collapse
In case you haven't checked the apk I provided earlier, I have found and fixed some package name errors but the result is still same. It get stuck at 90% and then fails. I have changed icons too, is there anything needed to do in public.xml ? New apk is attached below.
strikerman10 said:
I probably won't be able to get round to this until the weekend due to work commitments but will have a look and let you know.
Click to expand...
Click to collapse
Did you took a look at it?

Categories

Resources