[TOOLS | LINUX & WIN] ►KAT Kit◄ [Samsung Theme Engine] 》!!! UPDATED 2016-04-11 !!!《

Search This thread

Kdio

Senior Member
Nov 12, 2009
2,165
3,094
Campos dos Goytacazes
[TOOLS | LINUX & WIN] ►KAT Kit◄ [Samsung Theme Engine] 》!!! UPDATED 2016-04-11 !!!《

535c5764536e8.png

f6PKktb.png

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.


Go to Post #2 for a Video Tutorial


Refer to Post #3 for Language Package Subproject



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

5362ddab57a61.png


ROM Zip File: The tool will extract from it

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

BR6DorF.png


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! :D



C - Build, Sign and ZipAlign APKs & JARs

kEtRGZi.png


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

535c5dfbd4e71.png


Input Folder: Where yours files to be Signed & Zipaligned are.

Output Folder: Where yours files already Signed & Zipaligned will be.

Sign Files: Select to activate function

ZipAlign Files: Select to activate function



E - Create Theme ZIP

535c5cab5a29b.png


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

Output Folder: Where Flashable ZIP will be created.

ZIP File Name: Tool will append the .ZIP extension.

Note: Only PNG, JPG, GIF, XML and ARSC extensions will be selected to be flashed by VrTheme.



F - Create Flashable ZIP

5362ddbe44139.png


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

Output Folder: Where Flashable ZIP will be created.

ZIP File Name: Tool will append the .ZIP extension.



Z - Tool Configuration

536c390b92fcc.png


Language: Select the available language of the tool.

Platform: Select the default Platform to be used.


.
.
.

56d1d78fa07a1.png
Samsung Theming Tools


1 - Decompile Theme Package

Samsung theme packages come in the APK format so the tool will decompile all of it.

56da15c913f38.png


Input APK: The Samsung Theme APK you wanna decompile.

Output Folder: Where the project will be saved to.



2 - Rename Project

This tool will:

56da162f24774.png


Project Folder: Where you placed the Theme Package Folder.

Old Name: Which string the tool will be looking for.

New Name: Which string will replace the above one.

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

This will create a directory tree identical to the input one given, containing only QMG, ASTC, ATC and PKM files to be used in conversion tool like picconv (tks to @sorg).

56da168661c49.png


Input Folder: Where the images are stored.

Output Folder: Where the images should be saved to.


4 - Replace QMG

56da16eadfb46.png


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.

Input Folder: Where PNG images are located.

Output Folder: Where the project folder containing QMG, ASTC, ATC or PKM files is located to be replaced.



5 - Build Theme Package

56da1732cac16.png


Compile, Sign and ZipAlign the Samsung Theme Package contained in a folder

Input Folder: Where the sources of the Samsung Theme Package are.

Output Folder: Where the final APK is to be saved.





.
.
.

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.

53790a0a8742a.png


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.

Output Folder: Where processed images will be saved to.

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

Invert Color: Selectable.

GIMP: Colors > Value Invert

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! :D



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

53790a11f38eb.png


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.

Output Folder: Where processed images will be saved to.

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.

53790a18e2971.png


Output Folder: Where the XML file will be saved.

XML Battery: The name of the XML file that will be saved.

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

535c5ff25a519.png


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.

Output Folder: Where processed images will be saved to.



5 - Compile 9.patch Images

535c6011c337c.png


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.

Output Folder: Where processed images will be saved to.



666 - 9.patch Reverse Enginneering

53790a232dc7e.png


Input Folder: Where yours compiled .9.png's images are stored. It only will be read and no modifications applied to it.

Output Folder: Where processed images will be saved to.



7 - Gradient

idDymy7.png


Input Folder: Where the original images are. It only will be read and no modifications applied to it.

Output Folder: Where processed images will be saved to.

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
b3JDxeQ.png

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)

editor.png


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 ...

5378f9877e2c0.png


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



.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. :D


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.​


536300b900311.png

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:

Kdio

Senior Member
Nov 12, 2009
2,165
3,094
Campos dos Goytacazes
Localisation Project

53790a2cefab5.png


We already speak different O.S. languages.

Now is the time to speak the Users ones too​



Language pack files are stored inside plug-ins/KATKit.Resources/locale folder.

At the moment we have the below Translations distributed in the main package: (not yet ... calm down)

Translation Packages:
* Please, continuously click these dudes Thanks button for their Contribution. :good:

English released here by @coldmethod

Português do Brasíl released by me

German released here by @Aaskereija



Creating a Translation Pack (always use Notepad++):

a) Duplicate the English language pack "en.ini" (or any other of your preference) renaming it accordingly to the language you are editing.

b) Edit the newly created file translating the strings

c) You may promptly test your translation as it will automatically appear at the Language options at "Z - Tool Configuration". Only the Menus will require the restart of GIMP to show up.

d) When satisfied with the translation you've made, please post it to get the appropriate Mention and Thanks from yours compatriots.


The editing is very simple. Just don't mess with the "reds" and proceed translating as the example:

en.ini
Code:
[COLOR="Red"][B][language][/B][/COLOR]
[COLOR="Red"][B]name[/B][/COLOR] = English

[COLOR="red"][B][generic][/B][/COLOR]
[B][COLOR="red"]input_folder[/COLOR][/B] = Input Folder
[COLOR="red"][B]output_folder[/B][/COLOR] = Output Folder
[COLOR="red"][B]platform[/B][/COLOR] = Platform
...


pt_BR.ini
Code:
[COLOR="red"][B][language][/B][/COLOR]
[COLOR="Red"][B]name[/B][/COLOR] = Português do Brasíl

[COLOR="red"][B][generic][/B][/COLOR]
[B][COLOR="red"]input_folder[/COLOR][/B] = Pasta de Entrada
[COLOR="red"][B]output_folder[/B][/COLOR] = Pasta de Saída
[COLOR="red"][B]platform[/B][/COLOR] = Plataforma
...


.
 
Last edited:

Kdio

Senior Member
Nov 12, 2009
2,165
3,094
Campos dos Goytacazes
Ready to rock this tool!

Hi D.J.

Thanks for all your support.

Could you please do a "Feature Request" regarding that Nine Patch Resizing you've done here?

I've already placed it by my own but think would be more appropriate to you, as a special contributor to this project, to place it. I will be deleting mine as soon yours is in.

Thanks again dude.

.
 

Kdio

Senior Member
Nov 12, 2009
2,165
3,094
Campos dos Goytacazes
LINUX USERS: New release

Hi @Modding.MyMind and all Linux users.

There is a new release at OP and it is aimed only for your operational system.

+ All Tools tested and running :good:;

+ 3rd party binaries up to date;

+ PNG Optimization is now available for Linux users too with one glitch.

On Windows I can create and run a batch easily but on Linux I would have to chmod the script and I will not start sudo'ing anything.

PNG Optimization will copy all content from Input to Output, create the bash script necessary to do the optimization in the Output folder root and will leave you at your own

Go to Output folder and:
Code:
sudo chmod +x optimize

./optimize

sudo go_grab_a_coffe


EDIT
Please, disregard all this bullblip I've said.

PNG Optimizer has it's normal function and even better that what accomplished on Windows. No terminal window opening.

Nice regards and modding.

.
 
Last edited:
Hi D.J.

Thanks for all your support.

Could you please do a "Feature Request" regarding that Nine Patch Resizing you've done here?

I've already placed it by my own but think would be more appropriate to you, as a special contributor to this project, to place it. I will be deleting mine as soon yours is in.

Thanks again dude.

.

Sure I'll do that now.

OK its done. Hope they get back to us. Would be the icing on the kake lol


Sent from my Nexus 5 using Tapatalk
 
Last edited:

Kdio

Senior Member
Nov 12, 2009
2,165
3,094
Campos dos Goytacazes
Sure I'll do that now.

OK its done. Hope they get back to us. Would be the icing on the kake lol

Hey D.J.

All your apologies dude!!! I've misled you ... I beg your pardon.

I've meant "Feature Requests" from here ... KAT Kit. ...

You've requested me so and as this is a development, there is the place to keep your pertinent request. There will be my reminder to:

Never forget. Never surrender.

Thanks and sorry for my mistake.

Cheers.

.
 
  • Like
Reactions: 4aces
Hey D.J.

All your apologies dude!!! I've misled you ... I beg your pardon.

I've meant "Feature Requests" from here ... KAT Kit. ...

You've requested me so and as this is a development, there is the place to keep your pertinent request. There will be my reminder to:

Never forget. Never surrender.

Thanks and sorry for my mistake.

Cheers.

.

Oh no hahaha, well that happens. So copy my post for this thread... Gotcha

Sent from my Nexus 5 using Tapatalk

---------- Post added at 06:42 PM ---------- Previous post was at 06:41 PM ----------

Built in 9 patch resize like with this tool:
https://code.google.com/p/9patch-resizer/downloads/list

That would finish me off...lol

Sent from my Nexus 5 using Tapatalk
 

Kdio

Senior Member
Nov 12, 2009
2,165
3,094
Campos dos Goytacazes

Good jobs ! Vers tanks for share

Awesome guide and tool....cannot wait to try it.

Guys ... thank you so much for your kind words. Much appreciated. This the exact currency I need to be a rich man :D


I Saw the "666" in the screenshot. Couldn't resist.

I've accomplished the intent :D


please also provide SCREEN SHOTS

Any screenshots of sample theme?

Dudes ... sorry but I expect none theme screenshot to come and anyway, it has 2 days of born, not even opened its eyes yet! :p

See, the Theme per se is a huge effort of (mostly) one man. There is no tool that will build a theme for that man. This tool, most probably, will only make the hard and repetitive parts of theming work for him.

I'm just trying to give devs their time back instead of losing it doing tedious and repetitive jobs.

More free time, more sharing, more satisfaction for all of us :D

Nice regards.

.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 71
    [TOOLS | LINUX & WIN] &#9658;KAT Kit&#9668; [Samsung Theme Engine] &#12299;!!! UPDATED 2016-04-11 !!!&#12298;

    535c5764536e8.png

    f6PKktb.png

    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.


    Go to Post #2 for a Video Tutorial


    Refer to Post #3 for Language Package Subproject



    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

    5362ddab57a61.png


    ROM Zip File: The tool will extract from it

    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

    BR6DorF.png


    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! :D



    C - Build, Sign and ZipAlign APKs & JARs

    kEtRGZi.png


    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

    535c5dfbd4e71.png


    Input Folder: Where yours files to be Signed & Zipaligned are.

    Output Folder: Where yours files already Signed & Zipaligned will be.

    Sign Files: Select to activate function

    ZipAlign Files: Select to activate function



    E - Create Theme ZIP

    535c5cab5a29b.png


    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

    Output Folder: Where Flashable ZIP will be created.

    ZIP File Name: Tool will append the .ZIP extension.

    Note: Only PNG, JPG, GIF, XML and ARSC extensions will be selected to be flashed by VrTheme.



    F - Create Flashable ZIP

    5362ddbe44139.png


    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

    Output Folder: Where Flashable ZIP will be created.

    ZIP File Name: Tool will append the .ZIP extension.



    Z - Tool Configuration

    536c390b92fcc.png


    Language: Select the available language of the tool.

    Platform: Select the default Platform to be used.


    .
    .
    .

    56d1d78fa07a1.png
    Samsung Theming Tools


    1 - Decompile Theme Package

    Samsung theme packages come in the APK format so the tool will decompile all of it.

    56da15c913f38.png


    Input APK: The Samsung Theme APK you wanna decompile.

    Output Folder: Where the project will be saved to.



    2 - Rename Project

    This tool will:

    56da162f24774.png


    Project Folder: Where you placed the Theme Package Folder.

    Old Name: Which string the tool will be looking for.

    New Name: Which string will replace the above one.

    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

    This will create a directory tree identical to the input one given, containing only QMG, ASTC, ATC and PKM files to be used in conversion tool like picconv (tks to @sorg).

    56da168661c49.png


    Input Folder: Where the images are stored.

    Output Folder: Where the images should be saved to.


    4 - Replace QMG

    56da16eadfb46.png


    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.

    Input Folder: Where PNG images are located.

    Output Folder: Where the project folder containing QMG, ASTC, ATC or PKM files is located to be replaced.



    5 - Build Theme Package

    56da1732cac16.png


    Compile, Sign and ZipAlign the Samsung Theme Package contained in a folder

    Input Folder: Where the sources of the Samsung Theme Package are.

    Output Folder: Where the final APK is to be saved.





    .
    .
    .

    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.

    53790a0a8742a.png


    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.

    Output Folder: Where processed images will be saved to.

    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

    Invert Color: Selectable.

    GIMP: Colors > Value Invert

    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! :D



    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

    53790a11f38eb.png


    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.

    Output Folder: Where processed images will be saved to.

    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.

    53790a18e2971.png


    Output Folder: Where the XML file will be saved.

    XML Battery: The name of the XML file that will be saved.

    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

    535c5ff25a519.png


    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.

    Output Folder: Where processed images will be saved to.



    5 - Compile 9.patch Images

    535c6011c337c.png


    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.

    Output Folder: Where processed images will be saved to.



    666 - 9.patch Reverse Enginneering

    53790a232dc7e.png


    Input Folder: Where yours compiled .9.png's images are stored. It only will be read and no modifications applied to it.

    Output Folder: Where processed images will be saved to.



    7 - Gradient

    idDymy7.png


    Input Folder: Where the original images are. It only will be read and no modifications applied to it.

    Output Folder: Where processed images will be saved to.

    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
    b3JDxeQ.png

    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)

    editor.png


    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 ...

    5378f9877e2c0.png


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



    .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. :D


    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.​


    536300b900311.png

    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
    13
    Howto - tutorials

    9
    Localisation Project

    53790a2cefab5.png


    We already speak different O.S. languages.

    Now is the time to speak the Users ones too​



    Language pack files are stored inside plug-ins/KATKit.Resources/locale folder.

    At the moment we have the below Translations distributed in the main package: (not yet ... calm down)

    Translation Packages:
    * Please, continuously click these dudes Thanks button for their Contribution. :good:

    English released here by @coldmethod

    Português do Brasíl released by me

    German released here by @Aaskereija



    Creating a Translation Pack (always use Notepad++):

    a) Duplicate the English language pack "en.ini" (or any other of your preference) renaming it accordingly to the language you are editing.

    b) Edit the newly created file translating the strings

    c) You may promptly test your translation as it will automatically appear at the Language options at "Z - Tool Configuration". Only the Menus will require the restart of GIMP to show up.

    d) When satisfied with the translation you've made, please post it to get the appropriate Mention and Thanks from yours compatriots.


    The editing is very simple. Just don't mess with the "reds" and proceed translating as the example:

    en.ini
    Code:
    [COLOR="Red"][B][language][/B][/COLOR]
    [COLOR="Red"][B]name[/B][/COLOR] = English
    
    [COLOR="red"][B][generic][/B][/COLOR]
    [B][COLOR="red"]input_folder[/COLOR][/B] = Input Folder
    [COLOR="red"][B]output_folder[/B][/COLOR] = Output Folder
    [COLOR="red"][B]platform[/B][/COLOR] = Platform
    ...


    pt_BR.ini
    Code:
    [COLOR="red"][B][language][/B][/COLOR]
    [COLOR="Red"][B]name[/B][/COLOR] = Português do Brasíl
    
    [COLOR="red"][B][generic][/B][/COLOR]
    [B][COLOR="red"]input_folder[/COLOR][/B] = Pasta de Entrada
    [COLOR="red"][B]output_folder[/B][/COLOR] = Pasta de Saída
    [COLOR="red"][B]platform[/B][/COLOR] = Plataforma
    ...


    .
    6

    Good jobs ! Vers tanks for share

    Awesome guide and tool....cannot wait to try it.

    Guys ... thank you so much for your kind words. Much appreciated. This the exact currency I need to be a rich man :D


    I Saw the "666" in the screenshot. Couldn't resist.

    I've accomplished the intent :D


    please also provide SCREEN SHOTS

    Any screenshots of sample theme?

    Dudes ... sorry but I expect none theme screenshot to come and anyway, it has 2 days of born, not even opened its eyes yet! :p

    See, the Theme per se is a huge effort of (mostly) one man. There is no tool that will build a theme for that man. This tool, most probably, will only make the hard and repetitive parts of theming work for him.

    I'm just trying to give devs their time back instead of losing it doing tedious and repetitive jobs.

    More free time, more sharing, more satisfaction for all of us :D

    Nice regards.

    .
    6
    2016-02-27 new version

    @djdarkknight96 , @4aces , @coldmethod , @fhem , @jlmvc , @k4bbe , @pas2001 , @prdog1 , @talkingmonkeys , @xxmrgreenxx , @Aaskereija , @LeftyGR and all faithful KATKit customers

    Just updated OP with a new release of the Tool Set with the following:

    a) Updated apktool to v2.0.3 tks to @iBotPeaches

    b) 5 new tools for Samsung Theme Engine


    Hope you all enjoy.



    Finally command line support for resize

    Hi D.J. ... I've analysed the risize tool and didn't see how KATKit could improve it. ATM will not include ok ?

    Nice regards.

    .