[GUIDE] Compiling framework-res without bootloop

Search This thread

erorcun

Senior Member
Oct 14, 2012
901
3,559
Hi XZ owners!

I made this for XU / XSOLA JB port actually and currently they uses this method but later I discovered other JB Xperia's have this problem too.

Thanks to XperienceD for improving guide.

Workaround:

Firstly decompile your framework.jar, framework-res.apk and SemcGenericUxpRes.apk files, then download and extract this: framework-fix.zip

1- Copy the ColorizableDrawable.smali to "framework.jar/android/graphics/drawable".

2- Remove these lines from "framework.jar/android/graphics/drawable/Drawable.smali":

Code:
    const-string v3, "com.sonymobile"

    invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_109

3- In the drawable folder of your framework-res you need to find and change a number of xmls and the easiest way to do this is with Notepad++. Download and open it first, then in the drawable folder highlight all 150 xmls prefixed with semc_, and drop them into Notepad++ (You may want to do so many at a time depending on your Computers specs). Using the search and replace feature, replace...

Code:
somc:colorizable

for...

Code:
colorizable

...using the Replace All in All Opened Documents button...

20qetk2.png


...then you need to Replace this whole line...

Code:
android:color="@com.sonyericsson.uxp:color/semc_theme_accent_color" xmlns:somc="com.sonymobile"

...using the same method with...

Code:
android:color="#00000000"

2vvwapz.png


I moved theme color part to smali, so "#00000000" is just a placholder in here and won't affect anything.

4- Open styles.xml in the values folder with Notepad++ and search for...

Code:
@com.sonyericsson.uxp:drawable/semc_bg

...there should be two, that one and then one with _bright, replace that line with...

Code:
@drawable/semc_bg

...and replace the other with...

Code:
@drawable/semc_bg_bright

Then copy from your drawable-hdpi and drawable-xhdpi folders in your decompiled SemcGenericUxpRes folder, semc_bg_bright.xml, semc_bg.xml, semc_bg_bright_tile.png and semc_bg_tile.png into the same folders in your decompiled framework folders.

Normally app backgrounds doesn't change with 2013 xperia themes in anyway but theme system still has this ability, if you want to keep this I fixed it too, search for "@com.sonyericsson.uxp:drawable/semc_bg" and change with "@drawable/semc_bg_new" then put semc_bg_new.xml to drawable folder from downloaded file and don't forget adding semc_bg_new to public.xml.

5- In your decompiled framework folder open apktool.yml with Notepad++ and remove the "-2" from the "usedFrameworks" code...

2w7n2bm.png


...then recompile your framework.jar and framework-res.apk, add the signatures in the usual manner, copy both files to the Phone, change permissions, reboot, and you should finally have a success boot. :)

This method is currently working on all JB Xperia's.

Enjoy!
 
Last edited:

erorcun

Senior Member
Oct 14, 2012
901
3,559
@XperienceD

There is no drawable folder in framework.jar? And yeah you have to look each file which has semc_ prefix (I forgot to write that) on drawable folder unfortunately.
 

SXUsr

Senior Member
Jul 11, 2010
8,161
2,877
Here =)
@XperienceD

There is no drawable folder in framework.jar?
Schoolboy error there. :eek:
And yeah you have to look each file which has semc_ prefix (I forgot to write that) on drawable folder unfortunately.
A search in Virtuous found 59 files in total, so what I've done is open all 150 SEMC files in Notepad++ and searched and replaced somc:colorizable for colorizable, and the same again for the android:color. :)
 

erorcun

Senior Member
Oct 14, 2012
901
3,559
Schoolboy error there. :eek:

A search in Virtuous found 59 files in total, so what I've done is open all 150 SEMC files in Notepad++ and searched and replaced somc:colorizable for colorizable, and the same again for the android:color. :)

Yep but don't forget xmlns:somc tag at the end, you must delete it. And don't forget to put old signatures back.
 

erorcun

Senior Member
Oct 14, 2012
901
3,559
@XperienceD

I don't have time to fix it but I can't even decompile your framework-res file.
Also I noticed preloaded-classes and META-INF are missing in framework.jar.
 
  • Like
Reactions: SXUsr

erorcun

Senior Member
Oct 14, 2012
901
3,559
@XperienceD

I think there is something wrong about framework-res too. Did you try removing 'used frameworks' part in apktool.yml? It seems I forgot to say that, sorry.
 
  • Like
Reactions: SXUsr

erorcun

Senior Member
Oct 14, 2012
901
3,559
I'm sure it will work with XZ. I will wait feedback from you tonight, thanks in advance.
 

SXUsr

Senior Member
Jul 11, 2010
8,161
2,877
Here =)
Thanks. =) Which things needs rewriting?

Like this :)...

Workaround:

Firstly decompile your framework.jar, framework-res.apk and SemcGenericUxpRes.apk files, then download and extract this: framework-fix.zip

1- Copy the ColorizableDrawable.smali to "framework.jar/android/graphics/drawable".

2- Remove these lines from "framework.jar/android/graphics/drawable/Drawable.smali":

Code:
    const-string v3, "com.sonymobile"

    invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_109

3- In the drawable folder of your framework-res you need to find and change a number of xmls and the easiest way to do this is with Notepad++. Download and open it first, then in the drawable folder highlight all 150 xmls prefixed with semc_, and drop them into Notepad++ (You may want to do so many at a time depending on your Computers specs). Using the search and replace feature, replace...

Code:
somc:colorizable

for...

Code:
colorizable

...using the Replace All in All Opened Documents button...

20qetk2.png


...then you need to Replace this whole line...

Code:
android:color="@com.sonyericsson.uxp:color/semc_theme_accent_color" xmlns:somc="com.sonymobile"

...using the same method with...

Code:
android:color="#00000000"

2vvwapz.png


I moved theme color part to smali, so "#00000000" is just a placholder in here and won't affect anything.

4- Open styles.xml in the values folder with Notepad++ and search for...

Code:
@com.sonyericsson.uxp:drawable/semc_bg

...there should be two, that one and then one with _bright, replace that line with...

Code:
@drawable/semc_bg

...and replace the other with...

Code:
@drawable/semc_bg_bright

Then copy from your drawable-hdpi and drawable-xhdpi folders in your decompiled SemcGenericUxpRes folder, semc_bg_bright.xml, semc_bg.xml, semc_bg_bright_tile.png and semc_bg_tile.png into the same folders in your decompiled framework folders.

Normally app backgrounds doesn't change with 2013 xperia themes in anyway but theme system still has this ability, if you want to keep this I fixed it too, search for "@com.sonyericsson.uxp:drawable/semc_bg" and change with "@drawable/semc_bg_new" then put semc_bg_new.xml to drawable folder from downloaded file and don't forget adding semc_bg_new to public.xml.)[/COLOR][/I]

5- In your decompiled framework folder open apktool.yml with Notepad++ and remove the "-2" from the "usedFrameworks" code...

2w7n2bm.png


...then recompile your framework.jar and framework-res.apk, add the signatures in the usual manner, copy both files to the Phone, change permissions, reboot, and you should finally have a success boot. :)

This is tested on SP (Not S, P), U and Sola and works on the Z too.

Enjoy!
 
Last edited:

erorcun

Senior Member
Oct 14, 2012
901
3,559
@XperienceD

Thanks, I'm adding it to OP. I can't write guide that detailed my english isn't very good.

But I will be happy if you give link to this topic on other topic.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 47
    Hi XZ owners!

    I made this for XU / XSOLA JB port actually and currently they uses this method but later I discovered other JB Xperia's have this problem too.

    Thanks to XperienceD for improving guide.

    Workaround:

    Firstly decompile your framework.jar, framework-res.apk and SemcGenericUxpRes.apk files, then download and extract this: framework-fix.zip

    1- Copy the ColorizableDrawable.smali to "framework.jar/android/graphics/drawable".

    2- Remove these lines from "framework.jar/android/graphics/drawable/Drawable.smali":

    Code:
        const-string v3, "com.sonymobile"
    
        invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
    
        move-result v3
    
        if-eqz v3, :cond_109

    3- In the drawable folder of your framework-res you need to find and change a number of xmls and the easiest way to do this is with Notepad++. Download and open it first, then in the drawable folder highlight all 150 xmls prefixed with semc_, and drop them into Notepad++ (You may want to do so many at a time depending on your Computers specs). Using the search and replace feature, replace...

    Code:
    somc:colorizable

    for...

    Code:
    colorizable

    ...using the Replace All in All Opened Documents button...

    20qetk2.png


    ...then you need to Replace this whole line...

    Code:
    android:color="@com.sonyericsson.uxp:color/semc_theme_accent_color" xmlns:somc="com.sonymobile"

    ...using the same method with...

    Code:
    android:color="#00000000"

    2vvwapz.png


    I moved theme color part to smali, so "#00000000" is just a placholder in here and won't affect anything.

    4- Open styles.xml in the values folder with Notepad++ and search for...

    Code:
    @com.sonyericsson.uxp:drawable/semc_bg

    ...there should be two, that one and then one with _bright, replace that line with...

    Code:
    @drawable/semc_bg

    ...and replace the other with...

    Code:
    @drawable/semc_bg_bright

    Then copy from your drawable-hdpi and drawable-xhdpi folders in your decompiled SemcGenericUxpRes folder, semc_bg_bright.xml, semc_bg.xml, semc_bg_bright_tile.png and semc_bg_tile.png into the same folders in your decompiled framework folders.

    Normally app backgrounds doesn't change with 2013 xperia themes in anyway but theme system still has this ability, if you want to keep this I fixed it too, search for "@com.sonyericsson.uxp:drawable/semc_bg" and change with "@drawable/semc_bg_new" then put semc_bg_new.xml to drawable folder from downloaded file and don't forget adding semc_bg_new to public.xml.

    5- In your decompiled framework folder open apktool.yml with Notepad++ and remove the "-2" from the "usedFrameworks" code...

    2w7n2bm.png


    ...then recompile your framework.jar and framework-res.apk, add the signatures in the usual manner, copy both files to the Phone, change permissions, reboot, and you should finally have a success boot. :)

    This method is currently working on all JB Xperia's.

    Enjoy!
    3
    Thanks. =) Which things needs rewriting?

    Like this :)...

    Workaround:

    Firstly decompile your framework.jar, framework-res.apk and SemcGenericUxpRes.apk files, then download and extract this: framework-fix.zip

    1- Copy the ColorizableDrawable.smali to "framework.jar/android/graphics/drawable".

    2- Remove these lines from "framework.jar/android/graphics/drawable/Drawable.smali":

    Code:
        const-string v3, "com.sonymobile"
    
        invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
    
        move-result v3
    
        if-eqz v3, :cond_109

    3- In the drawable folder of your framework-res you need to find and change a number of xmls and the easiest way to do this is with Notepad++. Download and open it first, then in the drawable folder highlight all 150 xmls prefixed with semc_, and drop them into Notepad++ (You may want to do so many at a time depending on your Computers specs). Using the search and replace feature, replace...

    Code:
    somc:colorizable

    for...

    Code:
    colorizable

    ...using the Replace All in All Opened Documents button...

    20qetk2.png


    ...then you need to Replace this whole line...

    Code:
    android:color="@com.sonyericsson.uxp:color/semc_theme_accent_color" xmlns:somc="com.sonymobile"

    ...using the same method with...

    Code:
    android:color="#00000000"

    2vvwapz.png


    I moved theme color part to smali, so "#00000000" is just a placholder in here and won't affect anything.

    4- Open styles.xml in the values folder with Notepad++ and search for...

    Code:
    @com.sonyericsson.uxp:drawable/semc_bg

    ...there should be two, that one and then one with _bright, replace that line with...

    Code:
    @drawable/semc_bg

    ...and replace the other with...

    Code:
    @drawable/semc_bg_bright

    Then copy from your drawable-hdpi and drawable-xhdpi folders in your decompiled SemcGenericUxpRes folder, semc_bg_bright.xml, semc_bg.xml, semc_bg_bright_tile.png and semc_bg_tile.png into the same folders in your decompiled framework folders.

    Normally app backgrounds doesn't change with 2013 xperia themes in anyway but theme system still has this ability, if you want to keep this I fixed it too, search for "@com.sonyericsson.uxp:drawable/semc_bg" and change with "@drawable/semc_bg_new" then put semc_bg_new.xml to drawable folder from downloaded file and don't forget adding semc_bg_new to public.xml.)[/COLOR][/I]

    5- In your decompiled framework folder open apktool.yml with Notepad++ and remove the "-2" from the "usedFrameworks" code...

    2w7n2bm.png


    ...then recompile your framework.jar and framework-res.apk, add the signatures in the usual manner, copy both files to the Phone, change permissions, reboot, and you should finally have a success boot. :)

    This is tested on SP (Not S, P), U and Sola and works on the Z too.

    Enjoy!
    1
    @XperienceD

    OP is okay and there's nothing wrong. You're doing something wrong. xmlns:somc part is already on OP.
    1
    @XperienceD

    Could you send your edited files?
    1
    @XperienceD

    I don't have time to fix it but I can't even decompile your framework-res file.
    Also I noticed preloaded-classes and META-INF are missing in framework.jar.