Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[TUTORIAL] Complete and Comprehensive Guide for Creating 4.3 Themes

OP Ayush Singh

27th January 2014, 10:56 AM   |  #1  
Ayush Singh's Avatar
OP Recognized Themer
Flag Meerut
Thanks Meter: 1,533
 
314 posts
Join Date:Joined: Nov 2012
Donate to Me
More


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




Last edited by Ayush Singh; 27th January 2014 at 08:23 PM.
The Following 59 Users Say Thank You to Ayush Singh For This Useful Post: [ View ]
27th January 2014, 10:56 AM   |  #2  
Ayush Singh's Avatar
OP Recognized Themer
Flag Meerut
Thanks Meter: 1,533
 
314 posts
Join Date:Joined: Nov 2012
Donate to Me
More
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
Last edited by Ayush Singh; 17th March 2014 at 12:09 PM.
The Following 2 Users Say Thank You to Ayush Singh For This Useful Post: [ View ]
27th January 2014, 11:06 AM   |  #3  
CLINTZ9's Avatar
Senior Member
Flag Mangalore,India
Thanks Meter: 78
 
202 posts
Join Date:Joined: Nov 2012
More
Nice one Ayush !
The Following User Says Thank You to CLINTZ9 For This Useful Post: [ View ]
27th January 2014, 11:14 AM   |  #4  
koradiavatsal's Avatar
Senior Member
Flag Mumbai
Thanks Meter: 1,469
 
2,582 posts
Join Date:Joined: Oct 2012
More
Great work man
The Following User Says Thank You to koradiavatsal For This Useful Post: [ View ]
27th January 2014, 11:19 AM   |  #5  
funky0308's Avatar
Recognized Themer
Flag Osijek
Thanks Meter: 5,538
 
6,784 posts
Join Date:Joined: Aug 2012
Donate to Me
More
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: [ View ]
27th January 2014, 11:27 AM   |  #6  
Rajeev's Avatar
Senior Member
Flag Chennai , I N D I A
Thanks Meter: 11,388
 
8,503 posts
Join Date:Joined: Nov 2012
Donate to Me
More
Great work bro.. Nice explanations... Keep it up
The Following User Says Thank You to Rajeev For This Useful Post: [ View ]
27th January 2014, 11:30 AM   |  #7  
funky0308's Avatar
Recognized Themer
Flag Osijek
Thanks Meter: 5,538
 
6,784 posts
Join Date:Joined: Aug 2012
Donate to Me
More
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
Last edited by funky0308; 27th January 2014 at 11:38 AM.
27th January 2014, 11:55 AM   |  #8  
Ayush Singh's Avatar
OP Recognized Themer
Flag Meerut
Thanks Meter: 1,533
 
314 posts
Join Date:Joined: Nov 2012
Donate to Me
More
Quote:
Originally Posted by funky0308

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:	17912
Size:	31.6 KB
ID:	2541996   Click image for larger version

Name:	Screenshot_2014-01-27-16-09-17.png
Views:	17854
Size:	13.9 KB
ID:	2541997  
27th January 2014, 12:15 PM   |  #9  
funky0308's Avatar
Recognized Themer
Flag Osijek
Thanks Meter: 5,538
 
6,784 posts
Join Date:Joined: Aug 2012
Donate to Me
More
Quote:
Originally Posted by Ayush Singh

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
27th January 2014, 12:33 PM   |  #10  
Zippy1's Avatar
Senior Member
Thanks Meter: 17
 
150 posts
Join Date:Joined: 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

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes