Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,786,599 Members 38,476 Now Online
XDA Developers Android and Mobile Development Forum

[TUTORIAL] Complete and Comprehensive Guide for Creating 4.3 Themes

Tip us?
 
Ayush Singh
Old
(Last edited by Ayush Singh; 27th January 2014 at 07:23 PM.)
#1  
Ayush Singh's Avatar
Recognized Themer - OP
Thanks Meter 1,475
Posts: 307
Join Date: Nov 2012
Location: Meerut

 
DONATE TO ME
Default [TUTORIAL] Complete and Comprehensive Guide for Creating 4.3 Themes



Comprehensive Guide for Beginners to Create 4.3 Xperia Themes


Quote:

Hello Friends!

As we all know Android 4.3 brought for us the capability to customise our Xperias with soothing themes and adding custom flavor to it
I am creating this tutorial to teach you how to create your own themes


Quote:

Pre Requisites--

NotePad++
7Zip/Winrar or equivalent zip manager
Apktool or Virtuous Ten Studio or equivalent apk decompiler
Paint.net tool for editing pngs or equivalent editor
Java JDK installed
Sign++ for signing themes (only applicable if you use other than vts)
Basic windows knowledge
A creative Mind
So lets start!


STEP 1 - DECOMPILING AND SETUP

 

Download this 4.3 theme apk and decompile it using apktool
(Dont worry, visit this thread if you dont know how to decompile apks)





STEP 2 - ADDING WALLPAPERS

 

Go to res/values/drawable-xxhdpi folder



Here you will find the images which are the default wallpapers for lockscreen and launcher
Also change the preview of your theme as desired
Replace them according to your desired theme

Repeat the same for res/values/drawable-sw720dp-hdpi folder (these are wallpapers for tablet theme users)



STEP 3 - CHANGING THE NAME

 

Open the AndroidManifest.xml

Here you will find this in 2nd line

Code:
<manifest android:versionCode="1" android:versionName="1.0" package="somc.theme.xxx.xxxx"
Change the package name as desired



Now go to res/values/strings.xml using Notepad++

And edit the theme name as desired

Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="semc_theme_title">Xperia Example™</string>
</resources>



STEP 4 - ADDING/REMOVING/CREATING ASSETS

-> What are assets?

 

Well they are the resources (pngs, xmls and other things which make your themes beautiful)
These can be found in assets folder in zip format




-> How to create assets?

 

Assets are basically the apks itself

To create assets I am giving you an example for Settings.apk

1. First decompile your Settings.apk
2. Go to res folder inside decompiled Settings and delete all the folders except the drawable-xxhdpi and values folder (as icon pngs are present in it)
3. Delete the smali and assets folder inside the decompiled Settings
4. Go to drawable-xxhdpi folder and delete the unwanted pngs which you do not wish to theme
5. Edit the pngs as desired using Paint.net or equivalent advanced png editor
6. Now go to values folder and and delete all the xml files except public.xml
7. Now open the public.xml in Notepad++ and paste the following code-

Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>
8. Now open the AndroidManifest.xml of the Settings
Select all and paste the following code-

Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest android:versionCode="1" android:versionName="1.0" package="com.sonymobile.dummy"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <application android:label="None" />
</manifest>
9. Now recompile the Settings folder
10. Open the recompiled apk and delete the MATA-INF folder (if present)
11. Now rename the recompiled Settings.apk to its package name i.e. com.android.settings.zip
12. Now paste the com.android.settings.zip to assets folder of the theme
13. Scroll down to learn how to add your newly created asset in the theme



The above steps can be used for any of the apk you wish to create assets for



-> How to add the assets?

 

I recommend you to add more and more custom assets to make your theme unique
For example you wish to add Settings.apk assets

1. Create the asset zip as explained above
2. Open the AndroidManifest.xml of the theme

and add this code-

Code:
        <asset path="com.android.settings.zip" target="com.android.settings">
            <laf-version-filter from="1" to="1" />
        </asset>
between these tags

Code:
    <runtime-skin version="1">
....
....
....
    </runtime-skin>
So new code will look like this





-> How to remove specific app assets?

 

You need to do this when you do not wish any resource to be modified
For example if you do not want the modifications to statusbar in your theme
Then go to assets folder and delete the com.android.systemui.zip

Then open the AndroidManifest.xml of the theme

and find this code-

Code:
    <runtime-skin version="1">
        <asset path="com.sonyericsson.uxp.zip" target="com.sonyericsson.uxp">
            <laf-version-filter from="1" to="1" />
        </asset>
        <asset path="com.android.systemui.zip" target="com.android.systemui"> 
            <laf-version-filter from="1" to="1" />
        </asset>
        <asset path="com.sonyericsson.home.zip" target="com.sonyericsson.home">
            <laf-version-filter from="1" to="1" />
        </asset>
    </runtime-skin>
Delete the highlighted code ONLY

So new code will look like this





STEP 5 - MODIFYING THE EXISTING (DEFAULT) ASSETS OF THEME

In my example theme I have 4 basic assets (SystemUI, Android, Home and SemcGeneric Accent)
So I am explaining one by one



1. The SystemUI and Home assets

 

Firstly go to assets folder of theme and copy the asset zip to main folder from where you can decompile it
Rename the com.sonyericsson.home.zip to com.sonyericsson.home.apk
Then decompile it using apktool or vts
Modify the decompiled folder pngs as desired using Paint.net or other and recompile it
Open the recompiled apk with winzip, 7z and delete the META-INF folder if present
Now rename the com.sonyericsson.home.apk to com.sonyericsson.home.zip
Paste it to assets folder of the decompiled theme

The above procedure can be repeated for systemui asset too



2. The Android assets

 

These are the most important assets of the theme
These decide the most of the UI as they are framework-res resources

To modify these-

Firstly go to assets folder of theme and copy the asset zip to main folder from where you can decompile it
Rename the android.zip to android.apk
Then decompile it using apktool or vts
Modify the decompiled folder pngs as desired using Paint.net or other and recompile it
Open the recompiled apk with winzip, 7z and delete the META-INF folder if present
Now rename the android.apk to android.zip
Paste it to assets folder of the decompiled theme



3. The Theme Accent assets

 

These decide the theme accent of the Sony Apps

To change the theme accent-

-> Firstly go to assets folder of theme and copy the asset zip to main folder from where you can decompile it
-> Rename the com.sonyericsson.uxp.zip to com.sonyericsson.uxp.apk
-> Then decompile it using apktool or vts
-> Go to res/values/colors.xml

And modify the highlighted hex code ONLY!

Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="somc_theme_accent_color_dark">#ff4038ff</color>
    <color name="somc_theme_accent_color_light">#ff4038ff</color>
    <color name="somc_accent_color_neutral">#ff4038ff</color>
</resources>
I recommend you to keep the hex code according to theme wallpapers and framework-res assets color
To know the hex codes of the different colors visit ColorHexa website
More information about hex codes of colors

-> After finishing this edit recompile the asset
-> Open the recompiled apk with winzip, 7z and delete the META-INF folder if present
-> Now rename the com.sonyericsson.uxp.apk to com.sonyericsson.uxp.zip
-> Paste it to assets folder of the decompiled theme



STEP 6 - RECOMPILE THE THEME APK

 

Recompile the theme apk and sign it using Sign++





STEP 7 - TEST ON YOUR PHONE

 

Install your theme apk like normal app or push it to system/app
Make sure you have SuperUser Mod installed!
Enjoy and do share your themes with us







The Following 56 Users Say Thank You to Ayush Singh For This Useful Post: [ Click to Expand ]
 
Ayush Singh
Old
(Last edited by Ayush Singh; 17th March 2014 at 11:09 AM.)
#2  
Ayush Singh's Avatar
Recognized Themer - OP
Thanks Meter 1,475
Posts: 307
Join Date: Nov 2012
Location: Meerut

 
DONATE TO ME
Thanks to @funky0308 for his Guides- This and This

And @saqib nazm



FAQ Soon!

Press thanks and rate my thread 5 stars if you liked it



The Following 2 Users Say Thank You to Ayush Singh For This Useful Post: [ Click to Expand ]
 
CLINTZ9
Old
#3  
CLINTZ9's Avatar
Senior Member
Thanks Meter 75
Posts: 191
Join Date: Nov 2012
Location: Mangalore,India
Nice one Ayush !
#Longliveandroid
The Following User Says Thank You to CLINTZ9 For This Useful Post: [ Click to Expand ]
 
koradiavatsal
Old
#4  
koradiavatsal's Avatar
Senior Member
Thanks Meter 1,457
Posts: 2,539
Join Date: Oct 2012
Location: Mumbai
Great work man

PAC- Paranoid Android+CM+AOKP
The Following User Says Thank You to koradiavatsal For This Useful Post: [ Click to Expand ]
 
funky0308
Old
#5  
funky0308's Avatar
Recognized Themer
Thanks Meter 5,076
Posts: 6,260
Join Date: Aug 2012
Location: Osijek

 
DONATE TO ME
Very nice mate...

I thought you will repeat stuff we already said but you did awesome job.

Great new things - very nice.

One thing only, it's not necessary to rename assets for decompiling.
Apk and Zip files are similar packages and you can easily decompile and recompile zip files.

But that's not important, it'll work in both ways.

One question, have you tried to add that line I was talking about in mine thread in systemUI asset?

I found one line in drawable.xml and we could easily add status bar transparency through whole OS.

I'll have more free time today to try again, I tried yesterday and got some errors in decompiling systemUI so couldn't check that.

My plan was to edit systemUI for all guys who can't use custom theme but want to have transparent status bar.

Sent from my C6903 using Tapatalk
The Following User Says Thank You to funky0308 For This Useful Post: [ Click to Expand ]
 
Rajeev
Old
#6  
Rajeev's Avatar
Senior Member
Thanks Meter 8,045
Posts: 7,221
Join Date: Nov 2012
Location: Chennai , I N D I A

 
DONATE TO ME
Great work bro.. Nice explanations... Keep it up
If You Like My Work Please Consider A Small Donation

For Donating Click Below

 
Please Do The Following:
Sign In To Your PayPal Account Page
Go To 'Send Payment'
Enter My Email ID "dipesh.febrius@gmail.com"
Option "Personal Payment" Doesn't Work For India, So Kindly Set "Online Purchases". And Check Goods or Service (Preferably Service)
Make The Payment of The Desired Amount of Donation You Want To Send.
Thank You For Your Kind Donations!
The Following User Says Thank You to Rajeev For This Useful Post: [ Click to Expand ]
 
funky0308
Old
(Last edited by funky0308; 27th January 2014 at 10:38 AM.)
#7  
funky0308's Avatar
Recognized Themer
Thanks Meter 5,076
Posts: 6,260
Join Date: Aug 2012
Location: Osijek

 
DONATE TO ME
Quote:
I think I could add transparency to whole status bar (in all apps) but can't decompile systemui.zip.

I found line in systemUI\res\values\drawables.xml line #ff000000>/item>

I think if we change ff00000 to #00000000 we could get transparency in all apps.
(#00000000 is for 100% transparency,
50% transparency is #80000000 and full opaque is #ff00000000)
But as I just said - can't decompile properly.
We should try to make this...

I'm at work now but if you have time, PM me and we could talk (maybe to join and create our little group on hangouts) and work on some projects together...

We could build nice things for everyone...

Or you try that...
If you delete that line drom systemUI and add it in drawable.xml in systemUI assets it could work in themes as well...

Sent from my C6903 using Tapatalk
 
Ayush Singh
Old
#8  
Ayush Singh's Avatar
Recognized Themer - OP
Thanks Meter 1,475
Posts: 307
Join Date: Nov 2012
Location: Meerut

 
DONATE TO ME
Quote:
Originally Posted by funky0308 View Post
We should try to make this...

I'm at work now but if you have time, PM me and we could talk (maybe to join and create our little group on hangouts) and work on some projects together...

We could build nice things for everyone...

Or you try that...
If you delete that line drom systemUI and add it in drawable.xml in systemUI assets it could work in themes as well...

Sent from my C6903 using Tapatalk

Yes I had tried this once

But the results arent good

It appeared like this for a second



and then again goes back to its normal state




I have exams at my school, will carry on this later, I will try to add kitkat like systemui gradient soon!
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2014-01-27-16-06-07.png
Views:	10827
Size:	31.6 KB
ID:	2541996   Click image for larger version

Name:	Screenshot_2014-01-27-16-09-17.png
Views:	10786
Size:	13.9 KB
ID:	2541997  



 
funky0308
Old
#9  
funky0308's Avatar
Recognized Themer
Thanks Meter 5,076
Posts: 6,260
Join Date: Aug 2012
Location: Osijek

 
DONATE TO ME
Quote:
Originally Posted by Ayush Singh View Post
Yes I had tried this once

But the results arent good

It appeared like this for a second



and then again goes back to its normal state




I have exams at my school, will carry on this later, I will try to add kitkat like systemui gradient soon!
Are you sure you had deleted that line from systemUI?
SystemUI have advantage over themes and it probably change color back.

If you got transparency for a sec, that's it.

Sent from my C6903 using Tapatalk
 
Zippy1
Old
#10  
Zippy1's Avatar
Senior Member
Thanks Meter 17
Posts: 150
Join Date: Jul 2013
Could I carry out step one using a theme apk of my own? ( some of it is already how I want it so it would mean less work ) could I get apk using romtool box and then move it to my pc?

Sent from my C6903 using Tapatalk

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes