Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,812,248 Members 37,839 Now Online
XDA Developers Android and Mobile Development Forum

[TOOL][WINDOWS][LINUX] MoKee OpenSource Theme Fixer v2

Tip us?
 
Ryuinferno
Old
(Last edited by Ryuinferno; 7th January 2014 at 12:43 PM.)
#1  
Ryuinferno's Avatar
Recognized Contributor - OP
Thanks Meter 6,765
Posts: 3,459
Join Date: Apr 2012

 
DONATE TO ME
Cool [TOOL][WINDOWS][LINUX] MoKee OpenSource Theme Fixer v2

If you are a MoKee OpenSource user, you will realise that the theme chooser is borked since MK43. Themes that used to work can't be used anymore, and if applied, the whole system will crash. A few months has passed since then, and now, we are glad to say that the solution is HERE AT LAST!!!
The Problem:
In MK43, we separated some parts of framework-res.apk into mokee-res.apk to ease development. However, this also broke theme chooser. Themes cannot find the resources they want to redirect anymore, but the weird thing is, certain themes could still function normally. So the long journey of debugging started, but no results....till recently, we found this:

https://code.google.com/p/tmobile-th...meEngineDesign

The main point is at:
Quote:
Resources are generated in the 0x0a package scope. This is designed to separate them in the AssetManager's ResTable. The framework currently uses 0x01 while application packages normally use 0x7f. The aapt tool was modified to support assigning arbitrary package scopes and so you must use the aapt tool found in the themes tree for building your own themes.
After decompiling a few problematic themes, res/values/public.xml was found to be populated with 0x02. The T-Mobile Theme Engine originally accepted only 0x0a, but CM made some changes so that others can be accepted as well. However, due to the major changes in MoKee, the changes lost its effect. Therefore, we have to revert to the default 0x0a. To achieve this, we need to recompile the theme APKs with custom made apktool and aapt.
Requirements:
Must install JRE 1.7, you can get it here:

http://www.oracle.com/technetwor ... nloads-1880261.html

Windows users please follow this after installing: http://javarevisited.blogspot.co ... java-windows-7.html
Windows Tutorial:
1. Download mokee-theme-fixer_[version number]-windows.zip and extract the folder named "mokee" in it.


2. Open the "mokee" folder and you will see a few more folders. Place the APKs you want to fix into the folder named "input".


3. Run "mokee.bat" and let the magic happen!


4. If successful, the fixed APKs will be in the "output" folder, now named "done-[original name].apk".
Linux Tutorial:
1. Download mokee-theme-fixer_[version number]-linux.zip and extract the folder named "mokee" in it.

2. Open the "mokee" folder and you will see a few more folders. Place the APKs you want to fix into the folder named "input".

3. Execute "mokee.sh" and let the magic happen! (Remember to cd to that directory if using Terminal)

4. If successful, the fixed APKs will be in the "output" folder, now named "done-[original name].apk".
Note:
1. The Windows version was developed and tested in Windows 8.1.
2. The Linux version was developed and tested in Ubuntu 12.04 LTS.
3. If you cannot execute the Linux version, please chmod 755 mokee/mokee.sh and mokee/tools/aapt.
Credits:
Changelog:
Code:
v1:
- Initial release

v2:
- Fixed aapt not accepting uppercase letters and reduced size with strip and UPX
- Reduced size of Windows executables with strip and UPX
Downloads:
mokee-theme-fixer_v2 (Windows & Linux)


Maintains for:
- CyanogenMod (i9100g)
- AOKP (deb)
- MoKee OpenSource Project (deb, i9100g, i9100)
- SlimRoms (i9100g)
- VanirAOSP (i9100g)
- AOSPA Paranoid Android (i9100g)




My GitHub: https://github.com/Ryuinferno
My works: http://ryuinferno.github.io

MoKee OpenSource Build Status
MoKee OpenSource Server Bandwidth Monitor
(6TB per/mo, extra at USD0.02/GB)

Donate to support MoKee OpenSource development!
The Following 34 Users Say Thank You to Ryuinferno For This Useful Post: [ Click to Expand ]
 
antutu
Old
#2  
Senior Member
Thanks Meter 456
Posts: 707
Join Date: Nov 2012
Got following error when try to convert hue theme, any idea?
Code:
--------------------------------------
MoKee OpenSource Theme Fixer v1
Copyright 2012-2014
--------------------------------------

--> Processing HueWhiteKat_4.4.apk... <--
I: Using Apktool 2.0.0-Beta8 on HueWhiteKat_4.4.apk
I: Loading resource table...
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling...
I: Copying assets and libs...
I: Copying unknown files/dir...
I: Copying original files...
I: Using Apktool 2.0.0-Beta8 on HueWhiteKat_4.4.apk
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
res\xml\com_alensw_PicFolder.xml: Invalid file name: must contain only [a-z0-9_.
]
res\xml\com_alensw_PicFolder.xml: Invalid file name: must contain only [a-z0-9_.
]
res\xml\com_keramidas_TitaniumBackup.xml: Invalid file name: must contain only [
a-z0-9_.]
res\xml\com_keramidas_TitaniumBackup.xml: Invalid file name: must contain only [
a-z0-9_.]
res\xml\com_quoord_tapatalkHD.xml: Invalid file name: must contain only [a-z0-9_
.]
res\xml\com_quoord_tapatalkHD.xml: Invalid file name: must contain only [a-z0-9_
.]
res\xml\vStudio_Android_Camera360.xml: Invalid file name: must contain only [a-z
0-9_.]
res\xml\vStudio_Android_Camera360.xml: Invalid file name: must contain only [a-z
0-9_.]
res\xml\vStudio_Android_Camera360.xml: Invalid file name: must contain only [a-z
0-9_.]
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.Androl
ibException: brut.common.BrutException: could not exec command: [tools\aapt.exe,
 p, --min-sdk-version, 16, --target-sdk-version, 16, --version-code, 31, --versi
on-name, 4.4, -F, C:\Users\XX\AppData\Local\Temp\APKTOOL4753921697499202546.tmp
, -x, 10, -I, framework\1.apk, -S, C:\mokeeThemeFixerv1\tmp\HueWhiteKat_4.4.apk\
res, -M, C:\mokeeThemeFixerv1\tmp\HueWhiteKat_4.4.apk\AndroidManifest.xml]
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:434)
        at brut.androlib.Androlib.buildResources(Androlib.java:362)
        at brut.androlib.Androlib.build(Androlib.java:285)
        at brut.androlib.Androlib.build(Androlib.java:258)
        at brut.apktool.Main.cmdBuild(Main.java:236)
        at brut.apktool.Main.main(Main.java:88)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not
 exec command: [tools\aapt.exe, p, --min-sdk-version, 16, --target-sdk-version,
16, --version-code, 31, --version-name, 4.4, -F, C:\Users\XX\AppData\Local\Temp
\APKTOOL4753921697499202546.tmp, -x, 10, -I, framework\1.apk, -S, C:\mokeeThemeF
ixerv1\tmp\HueWhiteKat_4.4.apk\res, -M, C:\mokeeThemeFixerv1\tmp\HueWhiteKat_4.4
.apk\AndroidManifest.xml]
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:470)
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:415)
        ... 5 more
Caused by: brut.common.BrutException: could not exec command: [tools\aapt.exe, p
, --min-sdk-version, 16, --target-sdk-version, 16, --version-code, 31, --version
-name, 4.4, -F, C:\Users\XX\AppData\Local\Temp\APKTOOL4753921697499202546.tmp,
-x, 10, -I, framework\1.apk, -S, C:\mokeeThemeFixerv1\tmp\HueWhiteKat_4.4.apk\re
s, -M, C:\mokeeThemeFixerv1\tmp\HueWhiteKat_4.4.apk\AndroidManifest.xml]
        at brut.util.OS.exec(OS.java:89)
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:464)
        ... 6 more

Done if no errors above!
Press enter to exit...
Terminate batch job (Y/N)?
 
Ryuinferno
Old
#3  
Ryuinferno's Avatar
Recognized Contributor - OP
Thanks Meter 6,765
Posts: 3,459
Join Date: Apr 2012

 
DONATE TO ME
Quote:
Originally Posted by antutu View Post
Got following error when try to convert hue theme, any idea?
Code:
--------------------------------------
MoKee OpenSource Theme Fixer v1
Copyright 2012-2014
--------------------------------------

--> Processing HueWhiteKat_4.4.apk... <--
I: Using Apktool 2.0.0-Beta8 on HueWhiteKat_4.4.apk
I: Loading resource table...
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling...
I: Copying assets and libs...
I: Copying unknown files/dir...
I: Copying original files...
I: Using Apktool 2.0.0-Beta8 on HueWhiteKat_4.4.apk
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
res\xml\com_alensw_PicFolder.xml: Invalid file name: must contain only [a-z0-9_.
]
res\xml\com_alensw_PicFolder.xml: Invalid file name: must contain only [a-z0-9_.
]
res\xml\com_keramidas_TitaniumBackup.xml: Invalid file name: must contain only [
a-z0-9_.]
res\xml\com_keramidas_TitaniumBackup.xml: Invalid file name: must contain only [
a-z0-9_.]
res\xml\com_quoord_tapatalkHD.xml: Invalid file name: must contain only [a-z0-9_
.]
res\xml\com_quoord_tapatalkHD.xml: Invalid file name: must contain only [a-z0-9_
.]
res\xml\vStudio_Android_Camera360.xml: Invalid file name: must contain only [a-z
0-9_.]
res\xml\vStudio_Android_Camera360.xml: Invalid file name: must contain only [a-z
0-9_.]
res\xml\vStudio_Android_Camera360.xml: Invalid file name: must contain only [a-z
0-9_.]
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.Androl
ibException: brut.common.BrutException: could not exec command: [tools\aapt.exe,
 p, --min-sdk-version, 16, --target-sdk-version, 16, --version-code, 31, --versi
on-name, 4.4, -F, C:\Users\XX\AppData\Local\Temp\APKTOOL4753921697499202546.tmp
, -x, 10, -I, framework\1.apk, -S, C:\mokeeThemeFixerv1\tmp\HueWhiteKat_4.4.apk\
res, -M, C:\mokeeThemeFixerv1\tmp\HueWhiteKat_4.4.apk\AndroidManifest.xml]
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:434)
        at brut.androlib.Androlib.buildResources(Androlib.java:362)
        at brut.androlib.Androlib.build(Androlib.java:285)
        at brut.androlib.Androlib.build(Androlib.java:258)
        at brut.apktool.Main.cmdBuild(Main.java:236)
        at brut.apktool.Main.main(Main.java:88)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not
 exec command: [tools\aapt.exe, p, --min-sdk-version, 16, --target-sdk-version,
16, --version-code, 31, --version-name, 4.4, -F, C:\Users\XX\AppData\Local\Temp
\APKTOOL4753921697499202546.tmp, -x, 10, -I, framework\1.apk, -S, C:\mokeeThemeF
ixerv1\tmp\HueWhiteKat_4.4.apk\res, -M, C:\mokeeThemeFixerv1\tmp\HueWhiteKat_4.4
.apk\AndroidManifest.xml]
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:470)
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:415)
        ... 5 more
Caused by: brut.common.BrutException: could not exec command: [tools\aapt.exe, p
, --min-sdk-version, 16, --target-sdk-version, 16, --version-code, 31, --version
-name, 4.4, -F, C:\Users\XX\AppData\Local\Temp\APKTOOL4753921697499202546.tmp,
-x, 10, -I, framework\1.apk, -S, C:\mokeeThemeFixerv1\tmp\HueWhiteKat_4.4.apk\re
s, -M, C:\mokeeThemeFixerv1\tmp\HueWhiteKat_4.4.apk\AndroidManifest.xml]
        at brut.util.OS.exec(OS.java:89)
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:464)
        ... 6 more

Done if no errors above!
Press enter to exit...
Terminate batch job (Y/N)?
Owh, that's caused by having capital letters in the package name...have to patch aapt for that but haven't found out how...


Maintains for:
- CyanogenMod (i9100g)
- AOKP (deb)
- MoKee OpenSource Project (deb, i9100g, i9100)
- SlimRoms (i9100g)
- VanirAOSP (i9100g)
- AOSPA Paranoid Android (i9100g)




My GitHub: https://github.com/Ryuinferno
My works: http://ryuinferno.github.io

MoKee OpenSource Build Status
MoKee OpenSource Server Bandwidth Monitor
(6TB per/mo, extra at USD0.02/GB)

Donate to support MoKee OpenSource development!
The Following 5 Users Say Thank You to Ryuinferno For This Useful Post: [ Click to Expand ]
 
Fast-Droid
Old
(Last edited by Fast-Droid; 6th January 2014 at 05:22 PM.)
#4  
Fast-Droid's Avatar
Senior Member
Thanks Meter 150
Posts: 194
Join Date: Feb 2011
Location: Manhattan
Worked for (Holo Glass Beta) theme on my Maguro..Thanks!!
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2014-01-06-11-21-20.jpg
Views:	2061
Size:	61.0 KB
ID:	2498393   Click image for larger version

Name:	Screenshot_2014-01-06-11-22-40.jpg
Views:	1945
Size:	90.9 KB
ID:	2498394  


NEXUS-S i9020t...

GALAXY NEXUS i9250m...

NEXUS-5 D820...
The Following User Says Thank You to Fast-Droid For This Useful Post: [ Click to Expand ]
 
Ryuinferno
Old
#5  
Ryuinferno's Avatar
Recognized Contributor - OP
Thanks Meter 6,765
Posts: 3,459
Join Date: Apr 2012

 
DONATE TO ME
Quote:
Originally Posted by antutu View Post
Got following error when try to convert hue theme, any idea?
Fixed aapt and usable now...



So with that, v2 is released! Changelogs and links in first post!


Maintains for:
- CyanogenMod (i9100g)
- AOKP (deb)
- MoKee OpenSource Project (deb, i9100g, i9100)
- SlimRoms (i9100g)
- VanirAOSP (i9100g)
- AOSPA Paranoid Android (i9100g)




My GitHub: https://github.com/Ryuinferno
My works: http://ryuinferno.github.io

MoKee OpenSource Build Status
MoKee OpenSource Server Bandwidth Monitor
(6TB per/mo, extra at USD0.02/GB)

Donate to support MoKee OpenSource development!
The Following 2 Users Say Thank You to Ryuinferno For This Useful Post: [ Click to Expand ]
 
antutu
Old
#6  
Senior Member
Thanks Meter 456
Posts: 707
Join Date: Nov 2012
yes it's working
you just made my day
 
thuva06
Old
#7  
thuva06's Avatar
Senior Member
Thanks Meter 23
Posts: 124
Join Date: Nov 2013
well can some one help me out here ?? pls

i followed each and every step ( theme chooser !!)
downloaded everything converted the file
and yes it was successful

but whats the actual procedure to replace the app??
i tried moving the new system app to /system/app folder it was successful
but when i go to settings and hit theme am getting unfortunately system stopped
also tried several reboots and also tried to delete the system Themechooser.apk
no use now cant even access my theme choose option
the part of converting files is perfect am assuming
bt transfer to mobile is causing me probs
thanks in advance

DEVICE : GALAXY S II I9100G
ROM : MOKEE 4.4.2

SOLUTIONS FOR YOUR ROOTING AND FLASHING
 
Ryuinferno
Old
#8  
Ryuinferno's Avatar
Recognized Contributor - OP
Thanks Meter 6,765
Posts: 3,459
Join Date: Apr 2012

 
DONATE TO ME
*Facepalm*...you are supposed to convert the theme apk you want and install as normal...not Themechooser.apk... don't touch that at all...and don't cross post please...


Maintains for:
- CyanogenMod (i9100g)
- AOKP (deb)
- MoKee OpenSource Project (deb, i9100g, i9100)
- SlimRoms (i9100g)
- VanirAOSP (i9100g)
- AOSPA Paranoid Android (i9100g)




My GitHub: https://github.com/Ryuinferno
My works: http://ryuinferno.github.io

MoKee OpenSource Build Status
MoKee OpenSource Server Bandwidth Monitor
(6TB per/mo, extra at USD0.02/GB)

Donate to support MoKee OpenSource development!
The Following User Says Thank You to Ryuinferno For This Useful Post: [ Click to Expand ]
 
lolo696
Old
#9  
lolo696's Avatar
Member
Thanks Meter 15
Posts: 75
Join Date: Sep 2013
Location: minsk
I have here is off
Attached Thumbnails
Click image for larger version

Name:	??????????.jpg
Views:	639
Size:	147.9 KB
ID:	2584843  
 
Primokorn
Old
#10  
Primokorn's Avatar
Recognized Contributor
Thanks Meter 2,233
Posts: 4,112
Join Date: Nov 2012
Location: Annecy

 
DONATE TO ME
I have several errors during the extracting process of mokee-theme-fixer_v2-windows.zip. I have Win7 64bits.
 
Nexus 5 | Ask any questionDark XDAGetting started on XDA

LGE Nexus 5 | TWRP Recovery | OptiPurity | Uber!!!


Quote:
Searching can take less time than waiting for an answer

Tags
fix, mokee, rom, theme
THREAD CLOSED
Subscribe
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes