5,605,766 Members 48,363 Now Online
XDA Developers Android and Mobile Development Forum

[TUT] How To Port Colorizable Function [24/10/2013]

Tip us?
 
BDFreak
Old
#1  
BDFreak's Avatar
Recognized Themer - OP
Thanks Meter 1058
Posts: 346
Join Date: Jan 2013
Location: Mymensingh
Tutorial [TUT] How To Port Colorizable Function [24/10/2013]

Hi, guys...

Many user keep PM'ing me how to port colorizable function.
So I decide to do a simple guide for them.
Make sure you have a basic knowledge on how to compile/decompile .jar files.

Here you will find two types of tutorial.
First one is the simplest way and second one is the best way.


The Simplest Way :

 
  • Download Simplest.zip file from attachment
  • Decompile your framework.jar
  • Navigate to [framework.jar]\smali
  • Copy and replace all folders and files from Simplest.zip
  • Recompile your framework.jar



The Best Way :

 
  • Download Best.zip file from attachment
  • Decompile framework.jar
  • Navigate to [framework.jar]\smali\android\graphics\drawable
  • Copy the files from Best.zip
  • Navigate to [framework.jar]\smali\android\graphics\drawable\Drawable.smali
  • Search for new-instance v2, Lorg/xmlpull/v1/XmlPullParserException;
  • Add the red lines only

    .line 863
    .end local v0 #drawable:Landroid/graphics/drawable/Drawable;
    :cond_e
    const-string v2, "colorizable"

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

    move-result v2

    if-eqz v2, :cond_10

    .line 862
    new-instance v0, Landroid/graphics/drawable/ColorizableDrawable;

    invoke-direct {v0}, Landroid/graphics/drawable/ColorizableDrawable;-><init>()V

    .line 863
    .restart local v0 #drawable:Landroid/graphics/drawable/Drawable;
    goto/16 :goto_0

    .line 869
    .end local v0 #drawable:Landroid/graphics/drawable/Drawable;
    :cond_10

    new-instance v2, Lorg/xmlpull/v1/XmlPullParserException;

    new-instance v3, Ljava/lang/StringBuilder;



  • Save the file
  • Navigate to [framework.jar]\smali\com\android\internal\R$styleable.smali
  • Search for .field public static final ColorDrawable_color:I = 0x0
  • Add the red lines only

    .field public static final ColorDrawable_color:I = 0x0

    .field public static final ColorizableDrawable:[I = null

    .field public static final ColorizableDrawable_color:I = 0x1

    .field public static final ColorizableDrawable_drawable:I = 0x0


    .field public static final CompoundButton:[I = null



  • Search for sput-object v0, Lcom/android/internal/R$styleable;->ColorDrawable:[I
  • Add the red lines only

    sput-object v0, Lcom/android/internal/R$styleable;->ColorDrawable:[I

    new-array v0, v4, [I

    fill-array-data v0, :array_9d

    sput-object v0, Lcom/android/internal/R$styleable;->ColorizableDrawable:[I


    .line 30543



  • Search for sput-object v0, Lcom/android/internal/R$styleable;->WindowAnimation:[I
  • Add the red line only

    sput-object v0, Lcom/android/internal/R$styleable;->WindowAnimation:[I

    return-void

    .line 21653
    nop

    :array_0
    .array-data 0x4



  • Search for .method public constructor <init>()V
  • Add the red lines only

    [/I].end array-data

    :array_9d
    .array-data 0x4
    0x99t 0x1t 0x1t 0x1t
    0xa5t 0x1t 0x1t 0x1t
    .end array-data

    .end method

    .method public constructor <init>()V[/I]


  • Save the file
  • Recompile your framework.jar



Please Note :
  • Take backup before doing anything.
  • Use Notepad++ to edit files.
  • Don't forget to save the file after editing.
  • If you use ApkTool to decompile framework.jar then your path will be [framework.jar]\classout instead of [framework.jar]\smali
  • Please read the tutorial properly befor editing files.
Attached Files
File Type: zip Simplest.zip - [Click for QR Code] (30.7 KB, 58 views)
File Type: zip Best.zip - [Click for QR Code] (3.8 KB, 59 views)

- KNOCK KNOCK!
- Whois this?
- EXAM!

If you have lots of apps scattered all over your pc, then Apk File Manage is the solution.

Download : Apk File Manager

Are you having problem in Decompiling/Recompiling framework-res.apk?
Are you facing bootloop after Recompiling framework-res.apk?

Here is the Solution. Try Advanced ApkTool.
Download : Advanced ApkTool
The Following 13 Users Say Thank You to BDFreak For This Useful Post: [ Click to Expand ]
 
BDFreak
Old
(Last edited by BDFreak; 29th January 2014 at 05:25 PM.)
#2  
BDFreak's Avatar
Recognized Themer - OP
Thanks Meter 1058
Posts: 346
Join Date: Jan 2013
Location: Mymensingh
Default [TUT] How To Use Colorizable Function

Here I will teach you how to use this colorizable function.

I will color the power menu tab.
For this we have to edit framework-res.apk, here we go...

  • Decompile your framework-res.apk
  • Navigate to [framework-res.apk]\res\drawable-hdpi
  • Search for tab_selected_holo.9.png, open with any photo editor and change the blue part to white
  • Save tab_selected_holo.9.png as tab_selected_holo_colored.9.png name and put it in [framework-res.apk]\res\drawable-hdpi folder
  • Navigate to [framework-res.apk]\res\drawable
  • Search for silent_mode_indicator.xml and open it in any text editor
  • Change



    to




  • Save the file
  • Creat a file with name silent_mode_indicator_colored.xml and open it in any text editor
  • Copy and paste these line in that file





  • Green marked text is the name of that png file which will be colored.
  • Blue marked text is the color code. That tab_selected_holo_colored.9.png will be colored by this color.
  • #00000000 means it will be colored according to the color of SemcGenericUxpRes.apk. You can put here any other color code of your choice if you don't want to change color according to the color of SemcGenericUxpRes.apk.
  • Save the file and put it in [framework-res.apk]\res\drawable folder
  • Recompile your framework-res.apk


Thanks:
  • @erorcun for transparent color method

- KNOCK KNOCK!
- Whois this?
- EXAM!

If you have lots of apps scattered all over your pc, then Apk File Manage is the solution.

Download : Apk File Manager

Are you having problem in Decompiling/Recompiling framework-res.apk?
Are you facing bootloop after Recompiling framework-res.apk?

Here is the Solution. Try Advanced ApkTool.
Download : Advanced ApkTool
The Following 7 Users Say Thank You to BDFreak For This Useful Post: [ Click to Expand ]
 
BDFreak
Old
#3  
BDFreak's Avatar
Recognized Themer - OP
Thanks Meter 1058
Posts: 346
Join Date: Jan 2013
Location: Mymensingh
If needed...

- KNOCK KNOCK!
- Whois this?
- EXAM!

If you have lots of apps scattered all over your pc, then Apk File Manage is the solution.

Download : Apk File Manager

Are you having problem in Decompiling/Recompiling framework-res.apk?
Are you facing bootloop after Recompiling framework-res.apk?

Here is the Solution. Try Advanced ApkTool.
Download : Advanced ApkTool
The Following 2 Users Say Thank You to BDFreak For This Useful Post: [ Click to Expand ]
 
Saqib Nazm
Old
#4  
Saqib Nazm's Avatar
Forum Moderator / Recognized Themer
Thanks Meter 7080
Posts: 2,672
Join Date: Oct 2012
Location: Dhaka

 
DONATE TO ME
Great bro finally you have posted it it is really helpful
The Following 2 Users Say Thank You to Saqib Nazm For This Useful Post: [ Click to Expand ]
 
alinolaw71
Old
#5  
alinolaw71's Avatar
Senior Member
Thanks Meter 316
Posts: 521
Join Date: Jan 2013
Location: sari
tanks s much bro.
The Following User Says Thank You to alinolaw71 For This Useful Post: [ Click to Expand ]
 
poria1999
Old
#6  
poria1999's Avatar
Senior Member
Thanks Meter 285
Posts: 301
Join Date: Feb 2013
Location: Tehran
Thank u so much...


Sent from my LT18i using Tapatalk 2
Experience The Awesomeness


 
jereMarfil24
Old
#7  
jereMarfil24's Avatar
Senior Member
Thanks Meter 497
Posts: 764
Join Date: Aug 2012
Location: Bacolod
@BDFreak

How about for the Settings.apk? Changing Color of the title according to the theme.
PRESSThanks Button if my Post is Useful

 
My Device: Sony Xperia™ sola [White] [MT27i]

Stock ICS 6.1.1.B.1.54

Bootloader: Unlocked
Rooted
http://forum.xda-developers.com/signaturepics/sigpic4804412_1.gif


Works:

[ROM][4.0.4][All BLs] SXDXPepperZ1 ROM v2.0 (Almost Z1 Style) [11/23]
The Following User Says Thank You to jereMarfil24 For This Useful Post: [ Click to Expand ]
 
xfreakers
Old
#8  
Account currently disabled
Thanks Meter 18
Posts: 31
Join Date: Oct 2013
Location: Jakarta
@BDFreak can you give a tutorial of make animation of checkbox and radiobutton ?[COLOR="Silver"]

---------- Post added at 08:27 AM ---------- Previous post was at 08:27 AM ----------

[/COLOR @BDFreak can you give a tutorial of make animation of checkbox and radiobutton ?
 
BDFreak
Old
#9  
BDFreak's Avatar
Recognized Themer - OP
Thanks Meter 1058
Posts: 346
Join Date: Jan 2013
Location: Mymensingh
Quote:
Originally Posted by jereMarfil24 View Post
@BDFreak

How about for the Settings.apk? Changing Color of the title according to the theme.

If you mean the divider under title then search for devider in framework-res.apk


Quote:
Originally Posted by xfreakers View Post
@BDFreak can you give a tutorial of make animation of checkbox and radiobutton ?
It's not related to colorizable function and need port of z1/zu framework-res.apk.

- KNOCK KNOCK!
- Whois this?
- EXAM!

If you have lots of apps scattered all over your pc, then Apk File Manage is the solution.

Download : Apk File Manager

Are you having problem in Decompiling/Recompiling framework-res.apk?
Are you facing bootloop after Recompiling framework-res.apk?

Here is the Solution. Try Advanced ApkTool.
Download : Advanced ApkTool
 
jereMarfil24
Old
#10  
jereMarfil24's Avatar
Senior Member
Thanks Meter 497
Posts: 764
Join Date: Aug 2012
Location: Bacolod
@BDFreak

I mean the Titles in the Settings App not the divider.

Changing the Color of the Setting App Titles According to the Theme.
PRESSThanks Button if my Post is Useful

 
My Device: Sony Xperia™ sola [White] [MT27i]

Stock ICS 6.1.1.B.1.54

Bootloader: Unlocked
Rooted
http://forum.xda-developers.com/signaturepics/sigpic4804412_1.gif


Works:

[ROM][4.0.4][All BLs] SXDXPepperZ1 ROM v2.0 (Almost Z1 Style) [11/23]

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes