[Miscellaneous Android Development] dully79:
Using the script and porting.

Instuctions:

Download the zip.

Downloads can be found in the "Download" tab above.

Or if your browsing via mobile you can use this mirror: CMX beta v3

Unzip the "CMX" folder to a directory containing no spaces or rename the folder.

Any spaces within the containing folder will result in the jar files not being able to run.

BAD= C:/Users/My name/desktop/CMX beta T1000

GOOD= C:/Users/My_name/desktop/CMX_beta_T1000

I've also included Jarsigner.exe in the download. Move it to your "Java\bin" folder if you do not have it installed, otherwise you can delete it.

Start ".RunMe.bat".

Your now presented with 2 main options with regards to porting.

Automatic.

Manual.

I've covered automatic above in "What is CMX" so i'll explain manual.

Basically all the options in the manual menu (other than options 0 and 1) are what the automatic mode cycles through in the same order. This can be useful if you receive any errors and want to carry on from where automatic failed.

The options are self explanatory but I'll give basic details:

[IMG="Manual"]http://i58.tinypic.com/317f61x.jpg[/IMG]

Choose apk. Can be used to override the automatic built in selection. Useful if you have a number of apks in the "CMThemeIn" folder, although it is recommended to just keep one apk to prevent possible bugs.

Decompile apk. Decompiles the chosen apk for assets extraction.

Create main redirections.xml. Creates the main redirection xml containing all the package redirections.THIS MUST RUN BEFORE 4+5.

Configure CM11 xml's. Configures and ports CM11 xml's to work with X/HKTheme.

Configure CM11 png's.Create package (app) redirections.xml's and copies all the images to the appropriate folders in XThemeBase.apk inc. theme icon and wallpaper.

Set package and strings.xml name. Asks the user to declare the new package name in AndroidManifest.xml. Ideally use the same as the theme but with an "X" prefixing. e.g "com.mac.theme.gem" becomes "Xcom.mac.theme.gem". Also asks the user to to set the new app, theme, porter and original author name.

Compile. Compiles XThemeBase.apk into the ported theme apk.

Sign and zipalign. Signs and zipaligns the newly compiled apk ready for installation. The key used is market compatible generated by me.

Return to main menu. Returns to the initial screen.

When porting a theme try to name it so it is easy to differentiate from the original.

Example.

Original package and app name:

com.mac.theme.gem

Gem Flat

Ported with png's only:

X.com.mac.theme.gem

X Gem Flat

Ported with xml's:

X.com.mac.theme.gem.inc

X Gem Flat inc

How to port the custom launcher icons?

To use the new custom icon porter option, you will find it under option 2 (Manual) and 9. Two pre-requisites must be met:

You must have decompiled the apk in CMThemeIn prior to choosing this option.

Set the AndroidManifest name or strings. If you have not, or closed the tool since porting the main theme, you can define them using option 2 (Manual) and 6.

If the theme you are porting doesnt support a certain density, you can use this jar tool to create them:

https://github.com/redwarp/9-Patch-Resizer/releases

ONLY CREATE DENSITIES LOWER THAN THE INPUT!.

Porting themes? Then read this: