[Guide][HOW TO] Create Xperia 5.0+ themes using Apktool.

Search This thread

session20

Senior Member
Apr 17, 2012
493
959
Hello Friends,

I want to present a simple guide to create your own themes for Xperia running 5.0+. Lets get started.:)



Requirements:
  1. Advanced ApkTool v4.1.0 By BDFreak. Click here to download Advanced ApkTool
  2. Java Installed on your computer.
  3. Text Editor (Notepad++ recommended)
  4. Image Editing Software (Photoshop recommended).

Installing Framework files:
  1. Extract Advanced ApkTool.rar. Copy and Paste the contents of Framework.rar (download from below) in “2-In” folder.
  2. Run Advanced ApkTool.exe file and enter 1, to install framework-res and SemcGenericUxpRes.

2dtq2o2.png


Note: You need not install the framework files, everytime you decompile or recompile. This should be only done once.


Start working with your themes:

i) Decompiling the theme:

1. Copy Stock_lollipop.apk and paste it in “2-In” folder.
2. Run Advanced ApkTool.exe file and enter 2, to decompile the theme file.
3. Once decompiling is finished, you will find all the files in “3-Out” folder.
4. Now to go to 3-Out > Stock_lollipop.apk > assets folder and copy all four zip files from that folder and paste it in “2-In” folder.
5. Now rename all the zips files from .zip to .apk. Decompile all four .apks.

207xl5l.png


ii) Modifying the theme images and colors:

Note: Images must be of same resolution.

1. After decompiling, you will see 5 folders.
2. To modify go to res of each folder and change the images you want to modify and for colors open “Colors.xml” and change the colors. (Only change the last six underlined code, for example #ffffffff)
3 To change the name of the theme, go to Stock_lollipop folder > res > values > strings.xml. Open strings.xml and change the title.
4. Once done modifying, the final step is to recompile the theme.

2u7xdoh.png
nlcx1t.png


iii) Recompiling the theme:

1. Recompile all four .apks excluding the main theme file (here Stock_lollipop.apk).
2. To recompile, Run Advanced ApkTool.exe file and enter 3. Recompile all four apks one by one (select “Recompile and then sign” option).
3. All the recompile files will be in “4-Done” folder.
4. Now rename all four files back to .zip from .apk
5. Next copy all four zip files and paste it is in assets folder of stock_lollipop.apk folder (which is in 3-Out folder).
6. Now open the AndroidManifest.xml (from Stock_lollipop.apk) with text editor and change the underlined name - "com.session.stocklollipop" everytime you create a new theme. If you are updating the theme, then there is no need to change the underlined name.
7. Finally recompile all stock_lollipop.apk and you are done.

I'm not a developer and do not know coding. Any tips from the developers are welcomed, so that this guide can be improved. :) I hope new themers will like this guide.

Error is decompiling:

Fix: Download apktool.jar from below and paste it in "1-BDFreak" Folder. If prompted, overwrite the file.
 

Attachments

  • apktool.jar
    6 MB · Views: 1,583
Last edited:

brianblack

Member
Apr 17, 2015
6
1
i have a problem, decompile file ...

W: Could not decode attr value, using undecoded value instead: ns=android, name=versionCode, value=0x00000001
W: Could not decode attr value, using undecoded value instead: ns=android, name=versionName, value=0x00000012
W: Could not decode attr value, using undecoded value instead: ns=android, name=versionCode, value=0x00000001
W: Could not decode attr value, using undecoded value instead: ns=android, name=versionName, value=0x00000012
Exception in thread "main" java.lang.NullPointerException
at java.io.Writer.write(Unknown Source)
at brut.androlib.res.util.ExtMXSerializer.writeAttributeValue(ExtMXSerializer.java:38)
at org.xmlpull.mxp1_serializer.MXSerializer.attribute(MXSerializer.java:673)
at org.xmlpull.v1.wrapper.classic.XmlSerializerDelegate.attribute(XmlSerializerDelegate.java:106)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.writeStartTag(StaticXmlSerializerWrapper.java:267)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.event(StaticXmlSerializerWrapper.java:211)
at brut.androlib.res.decoder.XmlPullStreamDecoder$1.event(XmlPullStreamDecoder.java:83)
at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(XmlPullStreamDecoder.java:141)
at brut.androlib.res.decoder.XmlPullStreamDecoder.decodeManifest(XmlPullStreamDecoder.java:153)
at brut.androlib.res.decoder.ResFileDecoder.decodeManifest(ResFileDecoder.java:134)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:296)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:131)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:101)
at brut.apktool.Main.cmdDecode(Main.java:165)
at brut.apktool.Main.main(Main.java:81)
 
  • Like
Reactions: dekefake

session20

Senior Member
Apr 17, 2012
493
959
W: Could not decode attr value, using undecoded value instead: ns=android, name=versionCode, value=0x00000001
W: Could not decode attr value, using undecoded value instead: ns=android, name=versionName, value=0x00000012
W: Could not decode attr value, using undecoded value instead: ns=android, name=versionCode, value=0x00000001
W: Could not decode attr value, using undecoded value instead: ns=android, name=versionName, value=0x00000012
Exception in thread "main" java.lang.NullPointerException

Fix added to OP.
 
  • Like
Reactions: alinolaw71

ImAnurag

Senior Member
Aug 10, 2011
1,068
480
New Delhi
GizmoBolt.com
Google Pixel 2 XL
Not very much related to thread:

I have an apk, I am trying to Zip Align it using the tools posted at XDA but whenever I am trying to upload the output zip align file on Play Store, I get the following error:

Upload failed
Your APK cannot be analysed using aapt. Error output:
Failed to run aapt dump badging:
ERROR getting 'android:icon' attribute: attribute is not a string value

Any solution for this error.?
 

session20

Senior Member
Apr 17, 2012
493
959
Not very much related to thread:

I have an apk, I am trying to Zip Align it using the tools posted at XDA but whenever I am trying to upload the output zip align file on Play Store, I get the following error:

Upload failed
Your APK cannot be analysed using aapt. Error output:
Failed to run aapt dump badging:
ERROR getting 'android:icon' attribute: attribute is not a string value

Any solution for this error.?

I'm sorry, I don't much about this error while uploading it to the playstore. However, mostly it looks like the problem is with the AndroidManifest.xml file.

Have you tried searching it in google?
 

Ambor

Senior Member
Feb 10, 2014
1,249
2,251
Warsaw
xperiathemes.com
When it will be possible? I wait it)

Guide
http://xdaforums.com/crossdevice-dev/sony/guide-unlock-add-permission-to-sony-t3089885


Not very much related to thread:

I have an apk, I am trying to Zip Align it using the tools posted at XDA but whenever I am trying to upload the output zip align file on Play Store, I get the following error:

Upload failed
Your APK cannot be analysed using aapt. Error output:
Failed to run aapt dump badging:
ERROR getting 'android:icon' attribute: attribute is not a string value

Any solution for this error.?

I'm sorry, I don't much about this error while uploading it to the playstore. However, mostly it looks like the problem is with the AndroidManifest.xml file.

Have you tried searching it in google?


Hi there

Gentlemen, I am convinced of 99.9999999% I do not have possibilities publication Themes created this method.

The basic principle of publication. YOUR APP MUST BE SIGNED YOUR SIGNATURE.

OTHERWISE WITHIN A FEW DAYS AND SO IS THEME removed from your PLAY STORE
 

Dhelonious

New member
Jun 20, 2015
1
0
Here comes the solution for all the people experiencing problems like syntax errors when compiling:
The path where the advancd apktool lies must not contain spaces!

Anyway, nice tutorial, exactly what I was looking for! :good:

Best regards,
Dhelonious
 

Nu Pakachi

Member
Oct 27, 2012
20
1
Buffalo, NY
I don't know if it's my case only but, following your guide, I decompiled and recompiled the stock lollipop apk without modificating it, and my device was not able to install the apk. Xperia M5 dual E5663, Android 5.1 fyi.
And also, I tried Sony's Theme Creator BETA tool and couldn't get the custom navigation buttons. Anyone got the same problem?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 38
    Hello Friends,

    I want to present a simple guide to create your own themes for Xperia running 5.0+. Lets get started.:)



    Requirements:
    1. Advanced ApkTool v4.1.0 By BDFreak. Click here to download Advanced ApkTool
    2. Java Installed on your computer.
    3. Text Editor (Notepad++ recommended)
    4. Image Editing Software (Photoshop recommended).

    Installing Framework files:
    1. Extract Advanced ApkTool.rar. Copy and Paste the contents of Framework.rar (download from below) in “2-In” folder.
    2. Run Advanced ApkTool.exe file and enter 1, to install framework-res and SemcGenericUxpRes.

    2dtq2o2.png


    Note: You need not install the framework files, everytime you decompile or recompile. This should be only done once.


    Start working with your themes:

    i) Decompiling the theme:

    1. Copy Stock_lollipop.apk and paste it in “2-In” folder.
    2. Run Advanced ApkTool.exe file and enter 2, to decompile the theme file.
    3. Once decompiling is finished, you will find all the files in “3-Out” folder.
    4. Now to go to 3-Out > Stock_lollipop.apk > assets folder and copy all four zip files from that folder and paste it in “2-In” folder.
    5. Now rename all the zips files from .zip to .apk. Decompile all four .apks.

    207xl5l.png


    ii) Modifying the theme images and colors:

    Note: Images must be of same resolution.

    1. After decompiling, you will see 5 folders.
    2. To modify go to res of each folder and change the images you want to modify and for colors open “Colors.xml” and change the colors. (Only change the last six underlined code, for example #ffffffff)
    3 To change the name of the theme, go to Stock_lollipop folder > res > values > strings.xml. Open strings.xml and change the title.
    4. Once done modifying, the final step is to recompile the theme.

    2u7xdoh.png
    nlcx1t.png


    iii) Recompiling the theme:

    1. Recompile all four .apks excluding the main theme file (here Stock_lollipop.apk).
    2. To recompile, Run Advanced ApkTool.exe file and enter 3. Recompile all four apks one by one (select “Recompile and then sign” option).
    3. All the recompile files will be in “4-Done” folder.
    4. Now rename all four files back to .zip from .apk
    5. Next copy all four zip files and paste it is in assets folder of stock_lollipop.apk folder (which is in 3-Out folder).
    6. Now open the AndroidManifest.xml (from Stock_lollipop.apk) with text editor and change the underlined name - "com.session.stocklollipop" everytime you create a new theme. If you are updating the theme, then there is no need to change the underlined name.
    7. Finally recompile all stock_lollipop.apk and you are done.

    I'm not a developer and do not know coding. Any tips from the developers are welcomed, so that this guide can be improved. :) I hope new themers will like this guide.

    Error is decompiling:

    Fix: Download apktool.jar from below and paste it in "1-BDFreak" Folder. If prompted, overwrite the file.
    1
    i have a problem, decompile file ...

    W: Could not decode attr value, using undecoded value instead: ns=android, name=versionCode, value=0x00000001
    W: Could not decode attr value, using undecoded value instead: ns=android, name=versionName, value=0x00000012
    W: Could not decode attr value, using undecoded value instead: ns=android, name=versionCode, value=0x00000001
    W: Could not decode attr value, using undecoded value instead: ns=android, name=versionName, value=0x00000012
    Exception in thread "main" java.lang.NullPointerException
    at java.io.Writer.write(Unknown Source)
    at brut.androlib.res.util.ExtMXSerializer.writeAttributeValue(ExtMXSerializer.java:38)
    at org.xmlpull.mxp1_serializer.MXSerializer.attribute(MXSerializer.java:673)
    at org.xmlpull.v1.wrapper.classic.XmlSerializerDelegate.attribute(XmlSerializerDelegate.java:106)
    at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.writeStartTag(StaticXmlSerializerWrapper.java:267)
    at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.event(StaticXmlSerializerWrapper.java:211)
    at brut.androlib.res.decoder.XmlPullStreamDecoder$1.event(XmlPullStreamDecoder.java:83)
    at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(XmlPullStreamDecoder.java:141)
    at brut.androlib.res.decoder.XmlPullStreamDecoder.decodeManifest(XmlPullStreamDecoder.java:153)
    at brut.androlib.res.decoder.ResFileDecoder.decodeManifest(ResFileDecoder.java:134)
    at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:296)
    at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:131)
    at brut.androlib.ApkDecoder.decode(ApkDecoder.java:101)
    at brut.apktool.Main.cmdDecode(Main.java:165)
    at brut.apktool.Main.main(Main.java:81)
    1
    W: Could not decode attr value, using undecoded value instead: ns=android, name=versionCode, value=0x00000001
    W: Could not decode attr value, using undecoded value instead: ns=android, name=versionName, value=0x00000012
    W: Could not decode attr value, using undecoded value instead: ns=android, name=versionCode, value=0x00000001
    W: Could not decode attr value, using undecoded value instead: ns=android, name=versionName, value=0x00000012
    Exception in thread "main" java.lang.NullPointerException

    Fix added to OP.