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

Status
Not open for further replies.
Search This thread

aHcVolle

Senior Member
Nov 3, 2010
433
251
Stuttgart
yeah!
tried it with cobalt inferno and it did work (linux)!
thanks very much, finally i can use my loved theme again!
 

Brandroid28

Senior Member
Feb 10, 2011
140
21
Iowa
Amazon Fire TV
Google Pixel 5a
Could you tell me what's causing these errors? Thanks.

Edit: Looks like it worked for Black Infinitum, but got the errors with Thyrusholo Black KitKat. W7 x64

Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec:
0x01060085
at brut.androlib.res.data.ResPackage.getResSpec(ResPackage.java:58)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:57)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:53)
at brut.androlib.res.data.value.ResReferenceValue.getReferent(ResReferen
ceValue.java:60)
at brut.androlib.res.data.value.ResReferenceValue.encodeAsResXml(ResRefe
renceValue.java:47)
at brut.androlib.res.data.value.ResScalarValue.encodeAsResXmlValue(ResSc
alarValue.java:57)
at brut.androlib.res.data.value.ResStyleValue.serializeToResValuesXml(Re
sStyleValue.java:65)
at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResour
ces.java:553)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:307
)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:116)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:114)
at brut.apktool.Main.cmdDecode(Main.java:169)
at brut.apktool.Main.main(Main.java:85)
I: Using Apktool 2.0.0-Beta8 on com.template.theme.ThyrusHoloKKDonate-2.apk
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:244)
at brut.androlib.Androlib.build(Androlib.java:268)
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.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:240)
... 4 more
 
Last edited:

ModderHROM

Senior Member
Nov 7, 2013
62
189
Gomel
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".

APK what you need to throw?
 

mcnaught82

Senior Member
Feb 17, 2013
295
186
Valley Springs
I have several errors during the extracting process of mokee-theme-fixer_v2-windows.zip. I have Win7 64bits.
T5v7zFoe


I got the same errors when I used win zip...i installed win rar and it worked
 
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 34
    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!!! :D

    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-themes/wiki/NewGlobalThemeEngineDesign

    The main point is at:
    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.
    4CvJRH4.png


    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".
    rIcg3NA.png


    3. Run "mokee.bat" and let the magic happen! :D
    fuPbJkk.png
    J3SMUKV.png


    4. If successful, the fixed APKs will be in the "output" folder, now named "done-[original name].apk".
    vqUT6mG.png

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

    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:
    [U]v1:[/U]
    - Initial release
    
    [U]v2:[/U]
    - Fixed aapt not accepting uppercase letters and reduced size with strip and UPX
    - Reduced size of Windows executables with strip and UPX

    5
    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...:(
    3
    Good news guys, versions after 14/4/2014 will finally have theme engine fixed! No more converting needed! Wohoo! :D
    2
    Got following error when try to convert hue theme, any idea?

    Fixed aapt and usable now...;)

    tBC2aIC.png


    So with that, v2 is released! Changelogs and links in first post! :D
    1
    thank you for your hard work

    a bit off topic but what do you all think some of the best themes are

    OK, so am on the 20140414 build and themes are working without conversion...will get this thread closed...:)