lundi 27 janvier 2014

[TUT] Complete and Comprehensive Guide for Creating 4.3 Themes topic






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 :)












Aucun commentaire:

Enregistrer un commentaire