Post Reply

[TOOLS | LINUX & WIN | TUTORIAL] ●••►KAT Kit◄••● [Faster is Better] 》2014-06-19《

OP Kdio

Announcement from Kdio: KAT Kit - Kool Android Transmutation Kit will do all your hard work and let you focus on your abilities
27th April 2014, 02:50 AM   |  #1  
Kdio's Avatar
OP Senior Member
Flag Campos dos Goytacazes
Thanks Meter: 2,839
 
1,135 posts
Join Date:Joined: Nov 2009
More


These tools uses Python-Fu GIMP Processor to execute the job and were already tested on Linux and Windows workstation.

Quote:

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.


Quote:

Go to Post #2 for a Video Tutorial


Quote:

Refer to Post #3 for Language Package Subproject



Each tool is explained below.


Installation

Quote:

- You will need Java RunTime Environment (JRE) installed. 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.20140619.zip (5.65Mb) 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:


Quote:

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 32-bit GIMP, do as follow with Notepad++:

Quote:

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=${PATH};${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 1.5.2
- 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

Quote:



Quote:

ROM Zip File: The tool will extract from it

Quote:

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.

Quote:

Output Folder: Where the tool will generate the output of the decompilation process

Quote:

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;

Quote:

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

Quote:



Quote:

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

Quote:

Output Folder: Where the tool will generate the output of the decompilation process

Quote:

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;

Quote:

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.

Quote:

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

Quote:



Quote:

Input Folder: Where yours decompiled apk's are stored. It only will be read and no modifications applied to it.

Quote:

Output Folder: Where the built, signed and zipaligned result apks will be stored.

Quote:

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;

Quote:

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.




D - Sign and ZipAlign APKs, JARs and ZIPs

Quote:



Quote:

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

Quote:

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

Quote:

Sign Files: Select to activate function

Quote:

ZipAlign Files: Select to activate function




E - Create Theme ZIP

Quote:



Quote:

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

Quote:

Output Folder: Where Flashable ZIP will be created.

Quote:

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

Quote:

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




F - Create Flashable ZIP

Quote:



Quote:

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

Quote:

Output Folder: Where Flashable ZIP will be created.

Quote:

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




Z - Tool Configuration

Quote:



Quote:

Language: Select the available language of the tool.

Quote:

Platform: Select the default Platform to be used.




Theming Tools

1 - Theme Batch Processor

Quote:

Over those images extracted in the previous tool or over a set of them, you may apply many transformations in batch mode.



Quote:

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.

Quote:

Output Folder: Where processed images will be saved to.

Quote:

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

Quote:

Rotation Angle: If greater than 0 will be applied a rotation with the specified angle to the images.

GIMP: Layer > Transform

Quote:

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

Quote:

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

Quote:

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

Quote:

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

Quote:

Invert Color: Selectable.

GIMP: Colors > Value Invert

Quote:

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

Quote:

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



Quote:

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.

Quote:

Output Folder: Where processed images will be saved to.

Quote:

Rename Replacing This: If renaming required, provide the string to be replaced.

Quote:

By This: If renaming required, provide the string to replace the above string.

Quote:

New Width and Height: If resizing, provide new widths and heights in pixels.

Quote:

Keep Source Size: If selected, during resizing the image will be cropped to its original dimensions.

Quote:

Sharpness: Amount of Sharpness to be applied to the images. (1st algorithm)

Quote:

Unsharp Radius / Amount / Threshold: Values to be applied in this sharpness process. (1st algorithm)

Quote:

Inject Image: Select an PNG (mind its size) to be injected into all images.

Quote:

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

Quote:

Will create the XML required to reproduce the animation you've created with the images in the previous step.



Quote:

Output Folder: Where the XML file will be saved.

Quote:

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

Quote:

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

Quote:

Animation Steps: How many frames your animation contain for each battery level.

Quote:

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.

Quote:

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

Quote:



Quote:

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.

Quote:

Output Folder: Where processed images will be saved to.




5 - Compile 9.patch Images

Quote:



Quote:

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.

Quote:

Output Folder: Where processed images will be saved to.




666 - 9.patch Reverse Enginneering

Quote:



Quote:

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

Quote:

Output Folder: Where processed images will be saved to.




9 - 9.patch Condom

Quote:

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



Quote:

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

Quote:

Navigate to yours plug-ins/KATKit.Resources folder and just copy KATKit.Config.ini. That's it :D




.9.png's Special Treatment.
Quote:

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

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


Quote:

ATTENTION
This is mainly an Elders Thread

@djdarkknight (41) ...... Kdio (51) ...... @prdog1 (56) ...... and the amazing @fhem (69)

Please kids, take the voice down as some of them are sleeping.

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
Stable Release Date: 2014-06-19

Created 2014-04-27
Last Updated 2014-07-10
Last edited by Kdio; 2nd May 2014 at 01:42 AM.
The Following 69 Users Say Thank You to Kdio For This Useful Post: [ View ]
27th April 2014, 02:50 AM   |  #2  
Kdio's Avatar
OP Senior Member
Flag Campos dos Goytacazes
Thanks Meter: 2,839
 
1,135 posts
Join Date:Joined: Nov 2009
More
Howto - tutorials
Last edited by Kdio; 18th May 2014 at 12:17 AM.
The Following 14 Users Say Thank You to Kdio For This Useful Post: [ View ]
27th April 2014, 02:50 AM   |  #3  
Kdio's Avatar
OP Senior Member
Flag Campos dos Goytacazes
Thanks Meter: 2,839
 
1,135 posts
Join Date:Joined: Nov 2009
More
Localisation Project


Quote:

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)

Quote:

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

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:
[language]
name = English

[generic]
input_folder = Input Folder
output_folder = Output Folder
platform = Platform
...

pt_BR.ini
Code:
[language]
name = Português do Brasíl

[generic]
input_folder = Pasta de Entrada
output_folder = Pasta de Saída
platform = Plataforma
...

.
Last edited by Kdio; 9th July 2014 at 02:55 PM.
The Following 10 Users Say Thank You to Kdio For This Useful Post: [ View ]
27th April 2014, 03:23 AM   |  #4  
kermage's Avatar
Senior Member
Flag Iligan City
Thanks Meter: 155
 
310 posts
Join Date:Joined: Feb 2014
Donate to Me
More
AWESOME!
Great mate..
The Following User Says Thank You to kermage For This Useful Post: [ View ]
27th April 2014, 03:56 AM   |  #5  
pas2001's Avatar
Senior Member
Flag Bangkok
Thanks Meter: 2,245
 
2,045 posts
Join Date:Joined: May 2013
Donate to Me
More
Hi your follower come mate.

Sent from my GT-I9500 using Tapatalk
The Following User Says Thank You to pas2001 For This Useful Post: [ View ]
27th April 2014, 07:25 AM   |  #6  
djdarkknight96's Avatar
Recognized Themer
Flag Springfield
Thanks Meter: 16,783
 
10,349 posts
Join Date:Joined: Nov 2009
Donate to Me
More
Ready to rock this tool!

Sent by my Klearkat Nexus 7

Free TBO Updater App

Status Report
The Following 2 Users Say Thank You to djdarkknight96 For This Useful Post: [ View ]
27th April 2014, 03:17 PM   |  #7  
Kdio's Avatar
OP Senior Member
Flag Campos dos Goytacazes
Thanks Meter: 2,839
 
1,135 posts
Join Date:Joined: Nov 2009
More
Quote:
Originally Posted by djdarkknight96

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.

.
The Following 4 Users Say Thank You to Kdio For This Useful Post: [ View ]
27th April 2014, 05:14 PM   |  #8  
Senior Member
Flag Kingsland
Thanks Meter: 66
 
111 posts
Join Date:Joined: May 2012
More
@Kdio glad ya got it moved and renamed properly. I will be following this also

Sent from my Venomized HTC One Max
27th April 2014, 05:20 PM   |  #9  
Kdio's Avatar
OP Senior Member
Flag Campos dos Goytacazes
Thanks Meter: 2,839
 
1,135 posts
Join Date:Joined: Nov 2009
More
Quote:
Originally Posted by scrappy610

I will be following this also

Tks dude.

I've released yours HTC Decompile/Build support.

Please advise if that's ok for you

(Thanks already depleted .. sorry)

.
The Following 3 Users Say Thank You to Kdio For This Useful Post: [ View ]
27th April 2014, 11:37 PM   |  #10  
Kdio's Avatar
OP Senior Member
Flag Campos dos Goytacazes
Thanks Meter: 2,839
 
1,135 posts
Join Date:Joined: Nov 2009
More
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 ;

+ 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
Quote:

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 by Kdio; 28th April 2014 at 01:21 AM.

The Following 3 Users Say Thank You to Kdio For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Android Software Development by ThreadRank