[TOOLS | LINUX & WIN] ►KAT Kit◄ [Samsung Theme Engine] 》!!! UPDATED 2016-04-11 !!!《
These tools uses Python-Fu GIMP Processor to execute the job and were already tested on Linux and Windows workstation.
Each tool is explained below.
Installation
.
A - Create Workspace from ROM Zip
B - Create Workspace from Folder
C - Build, Sign and ZipAlign APKs & JARs
D - Sign and ZipAlign APKs, JARs and ZIPs
E - Create Theme ZIP
F - Create Flashable ZIP
Z - Tool Configuration
.
.
.
Samsung Theming Tools
1 - Decompile Theme Package
2 - Rename Project
3 - Extract QMG
4 - Replace QMG
5 - Build Theme Package
.
.
.
Theming Tools
1 - Theme Batch Processor
2 - Battery Batch Creator
3 - Battery XML Generator
4 - PNG Optimizer
5 - Compile 9.patch Images
666 - 9.patch Reverse Enginneering
7 - Gradient
8 - 9.Editor
9 - 9.Condom
BackUp User Configuration
.9.png's Special Treatment.
Credits & Thanks:
Please, share your experiences as you will get a LOT OF FREE TIME back.
XDA:DevDB Information
KAT Kit - Kool Android Transmutation Kit, Tool/Utility for the Android General
Contributors
Kdio, coldmethod, JustArchi
Version Information
Status: Stable
Current Stable Version: 1.1
Stable Release Date: 2016-04-08
Created 2014-04-27
Last Updated 2016-05-11
These tools uses Python-Fu GIMP Processor to execute the job and were already tested on Linux and Windows workstation.
Even not being a GIMPer, one can much benefit of this work as no previous knowledge of GIMP or whatever drawing application, is required to use these tools.
Each tool is explained below.
Installation
- You will need Java RunTime Environment (JRE) 1.7.x (nicknamed 7) installed. This is due to ApkTool's environmental build version restrictions (tks to @badowl for detecting and proof solving the issue). Do always give preference to the one that matches your platform (x86 / x64)
- Download GIMP from Partha's Place where you will find most stable releases. If possible, install 64-bit version. Please support GIMP development.
- Extract the contents of KATKit.20160411.zip (13.98Mb) to yours GIMP plugin folder (usually "C:/Users/Your_Name/.gimp-2.8/plug-ins"). (Re)Start GIMP and you will find a new menu as above.
ATM, there is NO need to install Android SDK .
- If riding a Linux work station, you will need to set permissions:
Open terminal and navigate to yours plug-ins folder and run:
Code:sudo chmod +x *.py
Inside that folder, navigate to KATKit.Resources/bin/posix and run:
Code:sudo chmod +x *
- If riding a Windows GIMP, do as follow with Notepad++:
Open your GIMP installation path and edit lib/gimp/2.0/environ/default.env with Notepad++
It should look like this
Code:# Example entry in files like these # FOOPATH=/path/to/foo/stuff PATH=${gimp_installation_dir}/bin;${gimp_installation_dir}/32/bin PYTHONPATH=${gimp_installation_dir}/32/lib/gimp/2.0/python
Just add the red part and save it.
Code:# Example entry in files like these # FOOPATH=/path/to/foo/stuff PATH=[B][COLOR="Red"]${PATH};[/COLOR][/B]${gimp_installation_dir}/bin;${gimp_installation_dir}/32/bin PYTHONPATH=${gimp_installation_dir}/32/lib/gimp/2.0/python
This is necessary and mandatory as the original GIMP PATH does not know where 'java' is installed.
This tool set uses some 3rd party software to accomplish its tasks. You may and should update them as you wish. The binaries are stored at yours plug-ins_dir/KATKit.Resources/bin folder and are:
- apktool.jar 2.1.0 (tks @iBotPeaches)
- sign-apk.jar (?)
- 7za 9.2 (nt/posix)
- aapt 0.2 (nt/posix)
- pngout 2013-02-20 (nt/posix)
- zipalign 2009 (nt/posix)
If riding a Linux, you may delete the plug-ins:KATKit.Resources/bin/nt folder. Windows users may delete plug-ins:KATKit.Resources/bin/posix folder.
Linux binaries distributed are x86 versions. If running 64, you may install x86 binaries compatibility:
Code:sudo apt-get install lib32z1
.
A - Create Workspace from ROM Zip
List of APKs & JARs: Comma separated list of the APKs and JARs you want to work with.
Example: "clock, system, policy" over a KitKat TouchWizard ROM results...
- app/ClockPackage_OSup.apk
- app/DigitalClock.apk
- app/DigitalClock21.apk
- framework/android.policy.jar
- priv-app/SystemUI.apk
You don't need to provide framework files as they will be extracted automatically and left inside output folder for future build correspondence. Only provide if need them decompiled too.
Output Folder: Where the tool will generate the output of the decompilation process
Platform: Select the Platform you are decompiling. Options are:
- AOSP / CM : will install only framework-res.apk;
- HTC Sense : will install framework-res.apk, framework-htc-res.apk and every .apk file that you put into the below folder. Blame HTC, not me.;
- TouchWizard : will install framework-res.apk and twframework-res.apk;
Decompilation Type: Select through 4 levels of decompilation:
- Full (slower)
- Sources Only (faster decompile/build)
- Resources Only (faster decompile/build)
- Drawable Resources Only (will leave only res/drawable/* images)
- DO NOT Decompile (this will only extract the given list and framework)
* com.htc.resources.apk will always receive a '--keep-broken-res' command line argument.
B - Create Workspace from Folder
Input Folder: Should contain all apk's that you wanna decompile. You may provide the same folder structure that is inside the ROM like:
Code:c:/gimpin/system c:/gimp/in/system/app c:/gimp/in/system/app/SecCalculator.apk c:/gimp/in/system/app/SecEmail.apk c:/gimp/in/system/framework c:/gimp/in/system/framework/framework-res.apk c:/gimp/in/system/priv-app c:/gimp/in/system/priv-app/SystemUI.apk
Output Folder: Where the tool will generate the output of the decompilation process
Platform: Select the Platform you are decompiling. Options are:
- AOSP / CM : will install only framework-res.apk;
- HTC Sense : will install framework-res.apk, framework-htc-res.apk and every .apk file that you put into the below folder. Blame HTC, not me.;
- TouchWizard : will install framework-res.apk and twframework-res.apk;
Use Framework: YES | NO . Option to install or not the framework files.
Framework Folder: The folder that contains framework-res.apk and/or twframework-res.apk or framework-htc-res.apk. They should be from the same ROM/firmware correspondent to the apk's you are building. You even can provide the folder inside the input folder (if you intend to decompile the framework too) like:
Code:Framework Folder = C:/gimp/in/system/framework
HTC devs may put into this folder all others APKs you possibly imagine that would be necessary for your successful decompilation.
Decompilation Type: Select through 4 levels of decompilation:
- Full (slower)
- Sources Only (faster decompile/build)
- Resources Only (faster decompile/build)
- Drawable Resources Only (will leave only res/drawable/* images)
* com.htc.resources.apk will always receive a '--keep-broken-res' command line argument.
That's all .. now you have your workspace ready!
C - Build, Sign and ZipAlign APKs & JARs
Input Folder: Where yours decompiled apk's are stored. It only will be read and no modifications applied to it.
Output Folder: Where the built, signed and zipaligned result apks will be stored.
Platform: Select the Platform you are decompiling. Options are:
- AOSP / CM : will install only framework-res.apk;
- HTC Sense : will install framework-res.apk, framework-htc-res.apk and every .apk file that you put into the below folder. Blame HTC, not me.;
- TouchWizard : will install framework-res.apk and twframework-res.apk;
Use Framework: YES | NO . Option to install or not the framework files.
Framework Folder: The folder that contains framework-res.apk and/or twframework-res.apk or framework-htc-res.apk. They should be from the same ROM/firmware correspondent to the apk's you are building.
HTC devs may put into this folder all others APKs you possibly imagine that would be necessary for your successful build.
Sign Option: Select the Type of Signature do you want. Options are:
- Don't Sign : will sign any apk/jar being build;
- Use Original Signature : will use the original signature saved when the apk was decompiled;
- Use New Signature : will normally sign the apk using tools procedure;
D - Sign and ZipAlign APKs, JARs and ZIPs
Output Folder: Where yours files already Signed & Zipaligned will be.
E - Create Theme ZIP
Input Folder: Where your 'system' folder ready to be released work is. Yes, system folder ... you have to provide it with the same directory structure that will be used by VRTheme to flash it.
Tiny Example:
Code:c:/gimp/in/system c:/gimp/in/system/app c:/gimp/in/system/app/SecCalculator.apk c:/gimp/in/system/app/SecCalculator.apk/res c:/gimp/in/system/app/SecCalculator.apk/res/drawable c:/gimp/in/system/app/SecCalculator.apk/res/drawable/background.png c:/gimp/in/system/app/SecEmail.apk c:/gimp/in/system/app/SecEmail.apk/res c:/gimp/in/system/app/SecEmail.apk/res/drawable c:/gimp/in/system/app/SecEmail.apk/res/drawable/background.png c:/gimp/in/system/priv-app/SystemUI.apk c:/gimp/in/system/priv-app/SystemUI.apk/res c:/gimp/in/system/priv-app/SystemUI.apk/res/drawable c:/gimp/in/system/priv-app/SystemUI.apk/res/drawable/background.png
Note: Only PNG, JPG, GIF, XML and ARSC extensions will be selected to be flashed by VrTheme.
F - Create Flashable ZIP
Input Folder: Where your 'system' folder containing all APKs and JARs ready to be released is. Yes, system folder ... you have to provide it with the same directory structure that will be used to push them to the customer device.
Tiny Example:
Code:c:/gimp/in/system c:/gimp/in/system/app c:/gimp/in/system/app/SecCalculator.apk c:/gimp/in/system/app/SecEmail.apk c:/gimp/in/system/priv-app/SystemUI.apk
Z - Tool Configuration
.
.
.
1 - Decompile Theme Package
Samsung theme packages come in the APK format so the tool will decompile all of it.
2 - Rename Project
This tool will:
This tool will:
1st) Rename all file where "Old Name" is found with "New Name"
2sd) Inspect the contents of all files within searching for "Old Name" and replacing with "New Name"
3 - Extract QMG
4 - Replace QMG
Will do the reverse of the above tool. After conversion, with all files in PNG format, this tool will replace them whenever it found a match between folder+file_name from input to the output.
Output Folder: Where the project folder containing QMG, ASTC, ATC or PKM files is located to be replaced.
5 - Build Theme Package
Compile, Sign and ZipAlign the Samsung Theme Package contained in a folder
Input Folder: Where the sources of the Samsung Theme Package are.
.
.
.
Theming Tools
1 - Theme Batch Processor
Over those images extracted in the previous tool or over a set of them, you may apply many transformations in batch mode.
Input Folder: Where images to be processed are stored. It only will be read and no modifications applied to it. Only PNGs and JPGs will be processed. Other file types will be only copied.
ATTENTION: Be careful. If you provide "C:" as "Input Folder" the tool WILL copy every single file within that drive to the output folder ... not good ... MIND WHAT YOU ARE DOING.
Convert to GrayScale: Selectable. Will be done at first. The output image will be always in RGB regardless this option. Indeed, if no option is selected, the tool will process the images just converting all to RGB.
GIMP: Image > Mode > GrayScale
Rotation Angle: If greater than 0 will be applied a rotation with the specified angle to the images.
GIMP: Layer > Transform
Use Colorify: Mark this to enable its usage. Colorify and Hue-Saturation can not be selected at same time to run.
Colorify With: Select the color to be applied to the images.
GIMP: Colors > Colorify
Brightness Value: Select the increase/decrease of Brightness to be applied to the images.
Contrast Value: Select the increase/decrease of Contrast to be applied to the images.
GIMP: Colors > Brightness-Contrast
Gaussian Blur X and Y: Provide the amount of pixels for X and Y axis to be applied a Gaussian Blur to the images.
GIMP: Filters > Blur > Gaussian Blur
Affected Hue: Which basic color (or master) the change of Hue/Lightness/Saturation should apply.
Hue/Lightness/Saturation: Values to be applied to all images.
GIMP: Colors > Hue-Saturation
Opacity: The amount of opacity that will be applied to all images. 100 corresponds to NO Opacity change.
GIMP: Colors > Curves > Alpha Channel
Now run and enjoy!
2 - Battery Batch Creator
This tool will:
(a) Resize images regarding or disregarding its original size;
(b) Rename files to produce animations accordingly;
(c) Apply 2 different sharpness algorithms;
(d) Inject another PNG in all images at foreground or background
Input Folder: Where images to be processed are stored. It only will be read and no modifications applied to it.
ATTENTION: Be careful. If you provide "C:" as "Input Folder" the tool WILL copy every single file within that drive to the output folder ... not good ... MIND WHAT YOU ARE DOING.
Rename Replacing This: If renaming required, provide the string to be replaced.
By This: If renaming required, provide the string to replace the above string.
New Width and Height: If resizing, provide new widths and heights in pixels.
Keep Source Size: If selected, during resizing the image will be cropped to its original dimensions.
Sharpness: Amount of Sharpness to be applied to the images. (1st algorithm)
Unsharp Radius / Amount / Threshold: Values to be applied in this sharpness process. (1st algorithm)
Inject Image: Select an PNG (mind its size) to be injected into all images.
Image Position: The above PNG will be injected into all images in Background or Foreground.
Now just run!
Two examples of its usage can be found here and here
3 - Battery XML Generator
Will create the XML required to reproduce the animation you've created with the images in the previous step.
PNG Name: The PNG name pattern to be used by the tool. Two parameters can be provided as the example below:
PNG Name: stat_sys_battery_<index><level>.png
<index> will be replaced by the ones you will provide below (optional)
<level> corresponds to the battery levels (0 to 100) (required).
Animation Steps: How many frames your animation contain for each battery level.
Indexes: The indexes of each battery level animation step. If provided, the same amount of "Animations Steps" have to be present. If not provided, the animation will be done over battery levels.
Duration (ms): The amount of milliseconds that each step will take. If provided, the same amount of "Animations Steps" have to be present.
An example of its usage can be found here.
4 - PNG Optimizer
Input Folder: Where PNG images to be optimized are stored. It only will be read and no modifications applied to it. .9.PNG's will be compiled and anything else will be simply copied to the destination folder.
ATTENTION: Be careful. If you provide "C:" as "Input Folder" the tool WILL copy every single file within that drive to the output folder ... not good ... MIND WHAT YOU ARE DOING.
5 - Compile 9.patch Images
Input Folder: Where images to be compiled are stored. It only will be read and no modifications applied to it. .9.PNG's will be compiled and anything else will be simply copied to the destination folder.
ATTENTION: Be careful. If you provide "C:" as "Input Folder" the tool WILL copy every single file within that drive to the output folder ... not good ... MIND WHAT YOU ARE DOING.
666 - 9.patch Reverse Enginneering
Input Folder: Where yours compiled .9.png's images are stored. It only will be read and no modifications applied to it.
7 - Gradient
Input Folder: Where the original images are. It only will be read and no modifications applied to it.
Gradient Name: The name of the GIMP Gradient to be used. Refer to the list of gradients you have installed as seen in the below image
Opacity: The amout of opacity of the Gradient to be applied to the images.
8 - 9.Editor
Will open the below amazing Nine.Patch Editor ... All credits to WebLaF - Java Look and Feel for cross-platform Swing applications (unfortunately could not identify the author @ xda)
Differently from Android SDK's Editor, this one lets you set Text and Background colors for the preview image panel.
9 - 9.Condom
Always play safe
It does not have a window and will only be available when a RGB image is opened in GIMP.
When you are editing an 9 patch image, you have only one layer with its contents and guideline all together. That can be dangerous if you are not extra-careful. So, to play safe ...
Select the menu KAT Kit >> Theming >> 9 - 9.patch Condom
You will end up with two layers:
- The "EDIT_HERE" layer where you should do your drawings and;
- A "DONT_TOUCH" layer where the guidelines are.
When you are done, just click File >> Overwrite ...
What this tool does, can also be done through GIMP menus. With the image already open, do as follow:
a) Menu Select > Select All (Ctrl+A);
b) Menu Select > Shrink... > {Enter} (1 pixel should be the default);
c) Menu Edit > Cut (Ctrl+X);
d) Menu Edit > Paste As > New Layer;
BackUp User Configuration
Navigate to yours plug-ins/KATKit.Resources folder and just copy KATKit.Config.ini. That's it
.9.png's Special Treatment.
As you can see in the code, when a .9.png is found, first the tool duplicate the existent layer and then remove the guidelines from it. At the end, the tool reintegrates the guidelines by merging the modified layer to the source one.
Credits & Thanks:
Faster Than Light Theme Flasher Script by Master @JustArchi
.9.png Compile process was inspired on @F4bioo's work at [tool] 9compiler
Wonderful Tool Name Idea by @LeftyGR
Featured at XDA, thanks to @eagleeyetom
Please, share your experiences as you will get a LOT OF FREE TIME back.
ATTENTION
This is mainly an Elders Thread
@djdarkknight (42) ...... Kdio (52) ...... @prdog1 (57) ...... and the amazing @fhem (70)
Please kids, take the voice down as some of them are sleeping ATM.
This thread will be soon moving to Florida.
XDA:DevDB Information
KAT Kit - Kool Android Transmutation Kit, Tool/Utility for the Android General
Contributors
Kdio, coldmethod, JustArchi
Version Information
Status: Stable
Current Stable Version: 1.1
Stable Release Date: 2016-04-08
Created 2014-04-27
Last Updated 2016-05-11
Last edited: