[WIN][SCRIPT] ThemeMachine 1.0 - Theming never was that easy [13.02.2013]

Search This thread

luxxx123

Senior Member
Jun 26, 2012
223
325
bildfr.png

About
The ThemeMachine is a theming tool, which makes it easier to port a theme.
Its writen in batch and executeable on every Windows since XP.
What it does is told easy but wasn´t that easy to implement.
It copies all PNG-files (this includes .9.png) from one APK into another one, preconditioned the file exists in the destination APK.
You´re interested in the complete process of the tool? Take a look in the attached flowchart or click here.



Preparation
  1. Be aware you have cmd and powershell on your PC (which are both components of every Windows since XP)
  2. Download the attached file or click here and extract it to any place you want. E.g. like this:
    entpackenj.png
  3. Get a BASE and a THEME APK. Both have to be deodexed.
    BASE: Its an APK that you want to theme with the contents of the THEME apk. That could be the framework-res.apk that you currently use.
    THEME: Its an APK that contains the theme that you want to copy. That could be the framework-res.apk of CM7.2 for Motorola defy.​



Using it the right way
Navigate to the folder where you´ve extracted the archive. Enter the folder and you´ll see a foldercontent like this:
ordnererklrung.png

Double click on "start.cmd" to execute the batch script.
Drag&drop the first file, the BASE apk, into the window.
Exactly do the same with the second file, the THEME apk.
Now the script will do its best to get a good theme out of it.
You also get some infos in the window. For example the info how much files got copied (see picture below)
skripterklrung.png

At the end of the script when it shows "Press any key to get into folder that contains the new file"
press a any key on your keyboard then the explorer will opens the folder with your new themed APK.



Example / Result
I´m using MotoSwitchUI 2.0 on my Motorola XT615 (a.k.a Motoluxe) with Gingerbread on it.
Sadly we don´t have more options like using CM because of locked bootloader.
In my opinion you can´t make a GUI more ugly then the MotoSwitchUI :laugh:
So i thought.. well i can´t make it worser.. so i decided to theme it with the AOSP/CM-Style.
First i´ve downloaded CM7.2 for Motorola Defy. So i remain on the same API-Level, which means more compatible filenames.
Further i have the same imagesizes in this szenario: HDPI.
Files i´ve used: Framework-res.apk, SystemUI.apk, Browser.apk, Settings.apk, DeskClock.apk, DownloadProviderUI.apk, Email.apk, Mms.apk, Music.apk, Phone.apk, SettingsProvider.apk
As BASE i´ve used my stock files from MotoSwitchUI and as THEME the files out of CM7.2 for defy.
After theming them with ThemeMachine + about 10 .xmls edits + using launcher of CM7.2 (which suprisingly works fine) i reached the following result.
And gess me thats not all ;) You should see the rest!
homescreenx.png




Tips
  • APKs share their PNGs with other APKs. Most used: framework-res.apk.
    To get a good copy of a theme its a must to theme it too.
  • As theme-APK you should use a APK with the same API-level as the base-APK.
    Reason for this: APKs with the same API-Level most likely have the same PNG-filenames.
  • As theme-APK you should use a APK with the same Android image size (xdpi, hdpi,...)



Credits
  • Igor Pawlow: 7zip is a mighty tool and used for extracting and adding contents
  • pieh-ejdsch/bastla (@administrator.de): For helping me to find the right command for comparing contents
  • jevan24 (@xda-developers.com): For excessive testing and reporting
  • imageshack.us: For hosting my images
  • gliffy.com: Used for creating flowcharts. Realy good service.

 

Attachments

  • flowchart.jpg
    flowchart.jpg
    131.3 KB · Views: 1,681
  • ThemeMachine-1.0.zip
    378.4 KB · Views: 716
Last edited:
B

B.PUNEETH

Guest
Re: [WIN][SCRIPT] ThemeMachine 1.0 - Theming was never that easy

Great Work man !! .

Sent from my GT-S5830i using xda app-developers app
 

dels07

Senior Member
Nov 1, 2012
422
153
Jakarta
1. is this only work with deodexed apk?
2. how about port theme from touchwiz based rom to aosp/cm or vice versa? is this supported?
 
Last edited:

JONES2311

Member
Oct 24, 2012
14
3
Hey man this is wonderful! You made my life much easier! The bad thing is that now I realize that I've wasted hours.... Well thank you sooooooo much!

---------- Post added at 01:07 PM ---------- Previous post was at 01:00 PM ----------

1. is this only work with deodexed apk?
2. do we must use same resolution (mdpi/hdpi/xhdpi) for base and theme apk?
3. how about port theme from touchwiz based rom to aosp/cm or vice versa?

+1
well I think that you Will need a deodexed Rom.
You MUST use same resolution, unless you will need to resize images
And you can port what theme you want. But porting from a stock rom maybe will not create a perfect theme because stock rom often have anoter xxx-res.apk file in framework folder - for example, on a stock lg rom you find lge-res.apk in /system/framework, and in there there is a lot of lg UI. But you can try. (I don't know for other phones. I read that this branded file usually exsist, but I'm sure of this only on gingerbread and froyo).
 

luxxx123

Senior Member
Jun 26, 2012
223
325
First i want to thank you all for your interest in using ThemeMachine :)

Ability to theme stock roms?
-Rik[Rittik]
In example i´ve discriped in the startpost i´ve used a stock rom.
So.. yes you´re also able to theme stock roms.
But producer may take other filenames, which could bring some "incompatibility".
That don´t means, the ThemeMachine messes up your phone its just not able to replace the file its meant for.
It worked perfectly on my motorola so maybe you can tell me how it worked on other phones :)

1. is this only work with deodexed apk?
2. how about port theme from touchwiz based rom to aosp/cm or vice versa? is this supported?
1. Oh.. yeah.. it only works with deodexed apks. I always kept this fakt in mind, but somehow i forgot to mention it.
Thanks you. I´ll at it to startpost :)
2. The only thing i know in touchwiz based roms is that there exists a "TwWallpaperChooser.apk" which contains some parts of the framework-res.apk. Please correct me if i´m wrong! But i guess it should work, like on my phone ;) Just take a look at the number of replaced files in the process. The closer number the better theme ;) So you´ll easily see if its gettin a good theme ;)
Is it useable with MIUI? I mean, may I port miui ui to CM using this tool?
I´m not that familar to MIUI. But i know that MIUI is based on CM so they shoud.. no they must use the same filenames, which means they should have a high compatibility.

Hope i was able to help you :)
 
  • Like
Reactions: enox.co

luxxx123

Senior Member
Jun 26, 2012
223
325
i have a question ... this tool replaces simple png's only? what about .9.png's and edits xml?

The tool copies all pngs.. yes.
Better said all files with .png extension.
Example: blaTest.9.png
filename: blaTest9
extension: .png​
.9.png is not an extension. ".9" it part of the file name.
-> the tool copies .9.png files too ;)

And now we come to the point where the script ends: XML.
I know editing XML files is a necessary step in doing prefessional theming.
But i don´t even know how i should start beginning to implement this.
And i don´t think its able to write this in batch xD
Maybe i got luck but it just took about 10 XML edits in my example to get it close to the original.
And when you use the forum search and google a bit you´ll easily master this ;)
Good bless there are guides like yours who tell/help the people to do this :)
 
  • Like
Reactions: enox.co

Mr Impossible

Senior Member
Dec 11, 2012
810
1,204
305
Re: [WIN][SCRIPT] ThemeMachine 1.0 - Theming was never that easy

The tool copies all pngs.. yes.
Better said all files with .png extension.
Example: blaTest.9.png
filename: blaTest9
extension: .png​
.9.png is not an extension. ".9" it part of the file name.
-> the tool copies .9.png files too ;)

And now we come to the point where the script ends: XML.
I know editing XML files is a necessary step in doing prefessional theming.
But i don´t even know how i should start beginning to implement this.
And i don´t think its able to write this in batch xD
Maybe i got luck but it just took about 10 XML edits in my example to get it close to the original.
And when you use the forum search and google a bit you´ll easily master this ;)
Good bless there are guides like yours who tell/help the people to do this :)

Just to clarify that it only changes the .png if it exists in the same dir correct. So if there was a new .png added it won't get copied correct. Then you have the 1% battery mod that can exist in either the res/drawable-hdpi or res/drawable-xhdpi is there an option to select and copy files to a different dir. I'm downloading the app now to test but a few questions/suggestions. Maybe an advanced option to over ride stock settings.
Thanks for your work


Sent from my SGH-T889 using Tapatalk 2
 

DirtyDroidX

Senior Member
Jan 7, 2011
343
257
Pittsburgh
Re: [WIN][SCRIPT] ThemeMachine 1.0 - Theming was never that easy

Whoa sweet this is clutch! Now there will be all kind of kanging going on lmao

Tapped from my Spyder ,Vanquish, d2vzw,Grouper, or Tenderloin
 

Top Liked Posts

  • There are no posts matching your filters.
  • 23
    bildfr.png

    About
    The ThemeMachine is a theming tool, which makes it easier to port a theme.
    Its writen in batch and executeable on every Windows since XP.
    What it does is told easy but wasn´t that easy to implement.
    It copies all PNG-files (this includes .9.png) from one APK into another one, preconditioned the file exists in the destination APK.
    You´re interested in the complete process of the tool? Take a look in the attached flowchart or click here.



    Preparation
    1. Be aware you have cmd and powershell on your PC (which are both components of every Windows since XP)
    2. Download the attached file or click here and extract it to any place you want. E.g. like this:
      entpackenj.png
    3. Get a BASE and a THEME APK. Both have to be deodexed.
      BASE: Its an APK that you want to theme with the contents of the THEME apk. That could be the framework-res.apk that you currently use.
      THEME: Its an APK that contains the theme that you want to copy. That could be the framework-res.apk of CM7.2 for Motorola defy.​



    Using it the right way
    Navigate to the folder where you´ve extracted the archive. Enter the folder and you´ll see a foldercontent like this:
    ordnererklrung.png

    Double click on "start.cmd" to execute the batch script.
    Drag&drop the first file, the BASE apk, into the window.
    Exactly do the same with the second file, the THEME apk.
    Now the script will do its best to get a good theme out of it.
    You also get some infos in the window. For example the info how much files got copied (see picture below)
    skripterklrung.png

    At the end of the script when it shows "Press any key to get into folder that contains the new file"
    press a any key on your keyboard then the explorer will opens the folder with your new themed APK.



    Example / Result
    I´m using MotoSwitchUI 2.0 on my Motorola XT615 (a.k.a Motoluxe) with Gingerbread on it.
    Sadly we don´t have more options like using CM because of locked bootloader.
    In my opinion you can´t make a GUI more ugly then the MotoSwitchUI :laugh:
    So i thought.. well i can´t make it worser.. so i decided to theme it with the AOSP/CM-Style.
    First i´ve downloaded CM7.2 for Motorola Defy. So i remain on the same API-Level, which means more compatible filenames.
    Further i have the same imagesizes in this szenario: HDPI.
    Files i´ve used: Framework-res.apk, SystemUI.apk, Browser.apk, Settings.apk, DeskClock.apk, DownloadProviderUI.apk, Email.apk, Mms.apk, Music.apk, Phone.apk, SettingsProvider.apk
    As BASE i´ve used my stock files from MotoSwitchUI and as THEME the files out of CM7.2 for defy.
    After theming them with ThemeMachine + about 10 .xmls edits + using launcher of CM7.2 (which suprisingly works fine) i reached the following result.
    And gess me thats not all ;) You should see the rest!
    homescreenx.png




    Tips
    • APKs share their PNGs with other APKs. Most used: framework-res.apk.
      To get a good copy of a theme its a must to theme it too.
    • As theme-APK you should use a APK with the same API-level as the base-APK.
      Reason for this: APKs with the same API-Level most likely have the same PNG-filenames.
    • As theme-APK you should use a APK with the same Android image size (xdpi, hdpi,...)



    Credits
    • Igor Pawlow: 7zip is a mighty tool and used for extracting and adding contents
    • pieh-ejdsch/bastla (@administrator.de): For helping me to find the right command for comparing contents
    • jevan24 (@xda-developers.com): For excessive testing and reporting
    • imageshack.us: For hosting my images
    • gliffy.com: Used for creating flowcharts. Realy good service.

    3
    Question: after finishing the new apk..will i sign it or not?
    Answer: No you don´t have to sign it.
    3
    Re: [WIN][SCRIPT] ThemeMachine 1.0 - Theming was never that easy

    Great work man! Trying!

    Sent from my awesome fridge
    2
    Theme Machine v2 [beta]

    Hey guys,

    i´m currently learning the programming language C#.

    So i´ve created a GUI-Version of the Theme Machine!

    Currently its doing the same job, as the batch-version,
    but its more customizable and easier to use because of graphical interface.

    Its only a beta yet, because i want to know if it works for you, too.

    Your interested? Extract the attached zip.
    As preparation you only have to copy the 7za.exe to "C:\Windows".

    Open the "Theme Machine.exe" to start.. and enjoy ;)

    Please report any errors or successfull themings to me, so i can fix and optimize the project ;)