Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,804,884 Members 52,569 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE][How-to] Ink Effect Mod 18 Colors for JB

Tip us?
 
tdunham
Old
(Last edited by tdunham; 2nd February 2013 at 02:38 PM.)
#1  
tdunham's Avatar
Recognized Contributor - OP
Thanks Meter 17,839
Posts: 8,129
Join Date: Jun 2008
Location: TampaBay

 
DONATE TO ME
Cool [GUIDE][How-to] Ink Effect Mod 18 Colors for JB

Ink Effect Mod 18 Colors for JB

Ripple effect must already be enabled for this mod to work.
This mod is pretty complex and requires a good deal of tedious work.
Fortunately, I've already done most of the hard stuff but there is still some left to do so let's get on it.
If something is not clear, let me know and I will try to clarify. Tnx - TD

First of all, please download and extract the attached file.

Android.policy.jar smali edits
The android.policy.jar file edits are pretty straightforward. Just copy over the pre-modified smali files, replacing any existing files and recompile.

SecSettings.apk edits

Copy over the ink .png files over to the decompiled SecSettings.apk from the files download.

Add the following code to strings:
res/values/strings.xml

Code:
    <string name="ink_effect_color_none">None</string>
    <string name="ink_effect_color_yellow">Yellow</string>
    <string name="ink_effect_color_lightblue">LightBlue</string>
    <string name="ink_effect_color_pink">Pink</string>
    <string name="ink_effect_color_dark_red">Dark Red</string>
    <string name="ink_effect_color_pure_gold">Gold</string>
    <string name="ink_effect_color_dark_green">Dark Green</string>
    <string name="ink_effect_color_cyan">Cyan</string>
    <string name="ink_effect_color_bright_red">Bright Red</string>
    <string name="ink_effect_color_magenta">Magenta</string>
    <string name="ink_effect_color_silver">Silver</string>
Compile SecSettings.apk and then DECOMPILE the new SecSettings.apk because we need to get the new values from res/public.xml.
Before we start working on the smali code for SecSettings, we now need to fill out the blank worksheet provided in the file below. A sample worksheet has already been included.
Here is an excerpt:

Code:
Color      Ink_effect_color    Ink_color
          LockscreenSettings   InkeffectPreview                                 
None           7f090f48        7f0203ef                             
                                        7f0203f0            
Orange         7f090d67        7f0203f1                           
                                        7f0203f2           
Green          7f090d68        7f0203e9                             
                                        7f0203ea              
Red            7f090d66        7f0203f7                                        
                                        7f0203f8          
Blue           7f090d6a        7f0203e5                            
                                        7f0203e6          
Navy           7f090d6b        7f0203ed                                                                    
                                        7f0203ee          
Purple         7f090d6c        7f0203f5                                                      
                                        7f0203f6           
Light Blue     7f090f4a        7f0203eb                   
                                        7f0203ec          
Pink           7f090f4b        7f0203f3                  
                                        7f0203f4          
Yellow         7f090f49        7f0203f9                    
                                        7f0203fa            
Black          7f090d6d        7f0203e3                                
                                        7f0203e4

Worksheet legend - by category:
Color - 19 colors listed in the order they are programmed in.
- Note: NONE is considered a color since it has an image file and takes up a line of its own in all the arrays.

Ink_effect_color - values associated to the string values.
- For example: ink_effect_color_black - in public.xml value is represented as 7f090d6d

Ink_color - these are the drawable values that represent the .png image files we placed in the drawable-hdpi folder before compiling
- For example: ink_black in public.xml value is represented as 7f0203e3
__________________________________________

Fill out the Worksheet
Now, we are going to fill out the included blank worksheet and this will take a little time so be careful and patient.
Open SecSettings/res/values/public.xml in notepad+.
Also open Ink.template.blank in notepad+ so both files are open at the same time.

Ink_effect_color Category
Search res/values/public.xml for ink_effect_color and copy and paste the 8 character value (without the leading 0X) into the spreadsheet for the corresponding color and keep doing this until all colors have a value in the ink_effect_color category.

Ink_color Category
Search res/values/public.xml for ink_black. We have 2 entries, one for ink_black and one for ink_black_h like so:

Code:
    <public type="drawable" name="ink_black" id="0x7f0203e3" />
    <public type="drawable" name="ink_black_h" id="0x7f0203e4" />
Copy and paste ink_black value directly beneath the ink_color row and copy and paste the ink_black_h value offset as shown in the filled out example worksheet. Keep going through public.xml until you have filled out all the colors as shown in the example worksheet.


Code:
Black          7f090d6d        7f0203e3                                
                                        7f0203e4
Now that the worksheet is completely filled out, we can start editing the arrays.
You can see that the second row on the worksheet shows the file we will be editing for the corresponding values.

SecSettings Smali Edit:
com/android/settings/LockScreenSettings.smali

Before:

Code:
    .line 262
    .local v5, ps:Landroid/preference/PreferenceScreen;
    iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mInkEffect:Landroid/preference/PreferenceScreen;

    invoke-virtual {v5, v9}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
After:

Code:
    .line 262
    .local v5, ps:Landroid/preference/PreferenceScreen;
    iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mInkEffect:Landroid/preference/PreferenceScreen;

    # invoke-virtual {v5, v9}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
Find array_10:

Code:
    :array_10
    .array-data 0x4
        0x48t 0xft 0x9t 0x7ft
        0x67t 0xdt 0x9t 0x7ft
        0x68t 0xdt 0x9t 0x7ft
        0x66t 0xdt 0x9t 0x7ft
        0x6at 0xdt 0x9t 0x7ft
        0x6bt 0xdt 0x9t 0x7ft
        0x6ct 0xdt 0x9t 0x7ft
        0x6dt 0xdt 0x9t 0x7ft
        0x4at 0xft 0x9t 0x7ft
        0x4bt 0xft 0x9t 0x7ft
        0x49t 0xft 0x9t 0x7ft
        0x69t 0xdt 0x9t 0x7ft
        0x4ct 0xft 0x9t 0x7ft
        0x4dt 0xft 0x9t 0x7ft
        0x4et 0xft 0x9t 0x7ft
        0x4ft 0xft 0x9t 0x7ft
        0x50t 0xft 0x9t 0x7ft
        0x51t 0xft 0x9t 0x7ft
        0x52t 0xft 0x9t 0x7ft
    .end array-data
.end method
EVERY ARRAY IS ARRANGED IN THE SAME ORDER AS THE WORKSHEET
This is where it gets interesting. By my example worksheet, we can see that the value for None is 7f090f48, (that is the row in the worksheet we are using for this array).
Let's break down the array. The array has 4 vertical rows. You will notice that nearly all of the vertical rows except for rows #1 and rows #2 have the same values.
The first HORIZONTAL row is the value for NONE. The 7f090f48 is listed BACKWARDS 2 characters at a time. The same values are hightlighted blue in our array above for row 1. 48 is row1, f is row 2 (notice the leading zero drops off for rows 2 & 3), 9 is row 3, 7f is row 4.

Value listed backwards in groups of two, and corresponding first line of the array:

Code:
   48   0f   09    7f    
 0x48t 0xft 0x9t 0x7ft
Now take the values listed in the worksheet you filled out and start putting the values in the array accordingly. The only values you should be inputting into this array are from the ink_effect_color category.
Note: More than likely you will not need to edit vertical rows 3 & 4 at all.

SecSettings Smali Edit:
com/android/settings/InkeffectPreview.smali

Find arrays 14 & 28:

Code:
    .line 50
    :array_14
    .array-data 0x4
        0xeft 0x3t 0x2t 0x7ft
        0xf1t 0x3t 0x2t 0x7ft
        0xe9t 0x3t 0x2t 0x7ft
        0xf7t 0x3t 0x2t 0x7ft
        0xe5t 0x3t 0x2t 0x7ft
        0xedt 0x3t 0x2t 0x7ft
        0xf5t 0x3t 0x2t 0x7ft
        0xe3t 0x3t 0x2t 0x7ft
        0xebt 0x3t 0x2t 0x7ft
        0xf3t 0x3t 0x2t 0x7ft
        0xf9t 0x3t 0x2t 0x7ft
        0xe7t 0x3t 0x2t 0x7ft
        0x01t 0x4t 0x2t 0x7ft
        0x05t 0x4t 0x2t 0x7ft
        0xfft 0x3t 0x2t 0x7ft
        0xfdt 0x3t 0x2t 0x7ft
        0xfbt 0x3t 0x2t 0x7ft
        0x03t 0x4t 0x2t 0x7ft
        0x07t 0x4t 0x2t 0x7ft
    .end array-data

    .line 59
    :array_28
    .array-data 0x4
        0xf0t 0x3t 0x2t 0x7ft
        0xf2t 0x3t 0x2t 0x7ft
        0xeat 0x3t 0x2t 0x7ft
        0xf8t 0x3t 0x2t 0x7ft
        0xe6t 0x3t 0x2t 0x7ft
        0xeet 0x3t 0x2t 0x7ft
        0xf6t 0x3t 0x2t 0x7ft
        0xe4t 0x3t 0x2t 0x7ft
        0xect 0x3t 0x2t 0x7ft
        0xf4t 0x3t 0x2t 0x7ft
        0xfat 0x3t 0x2t 0x7ft
        0xe8t 0x3t 0x2t 0x7ft
        0x02t 0x4t 0x2t 0x7ft
        0x06t 0x4t 0x2t 0x7ft
        0x00t 0x4t 0x2t 0x7ft
        0xfet 0x3t 0x2t 0x7ft
        0xfct 0x3t 0x2t 0x7ft
        0x04t 0x4t 0x2t 0x7ft
        0x08t 0x4t 0x2t 0x7ft
    .end array-data
.end method
We are going to do the same thing we did for the LockScreenSettings array here.
The first array (array_14) is going to get the values directly below the ink_color category.
The second array (array_28) is going to get the values that were offset beneath the same category.
Note: These offset values represent the drawable value of the colors with the _h at the end of their filename. That is the reason we separated them slightly for easier viewing.

Find beginning of color selection menu:

Code:
    .line 81
    sget-object v2, Lcom/android/settings/InkeffectPreview;->mInkcolorItem:[Ljava/lang/String;

    invoke-virtual {p0}, Lcom/android/settings/InkeffectPreview;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    const v4, 0x7f090f48

    invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    const-string v3, "None"

    aput-object v3, v2, v7

    .line 82
    sget-object v2, Lcom/android/settings/InkeffectPreview;->mInkcolorItem:[Ljava/lang/String;

    invoke-virtual {p0}, Lcom/android/settings/InkeffectPreview;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    const v4, 0x7f090d67

    invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    const-string v3, "Orange"

    aput-object v3, v2, v6

    .line 83
    sget-object v2, Lcom/android/settings/InkeffectPreview;->mInkcolorItem:[Ljava/lang/String;

    invoke-virtual {p0}, Lcom/android/settings/InkeffectPreview;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    const v4, 0x7f090d68

    invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    const-string v3, "Green"

    aput-object v3, v2, v8
This edit is pretty straightforward. Go through and replace all 19 matching values in this section (remember NONE is still a color for coding purposes). The values are from our worksheet beneath the category Ink_effect_color.
Attached Files
File Type: zip Ink.effect.source.zip - [Click for QR Code] (6.30 MB, 730 views)
The Following 14 Users Say Thank You to tdunham For This Useful Post: [ Click to Expand ]
 
laotzy
Old
#2  
Senior Member
Thanks Meter 54
Posts: 249
Join Date: Feb 2012
Dear tdunham, I am rather crazy to install InkEffect mod on my Galaxy S2(I9100XWLSD, deodexed) but I seem to be too old to be able going through all the steps you have described here... I did manage to activate the Ripple effect but the Inkey one seems too difficult for me. Is it possible to create an update.zip for my telefone? I will continue reading your post anyway trying to understand it better but my lack of knowledge is very notable...
 
tdunham
Old
#3  
tdunham's Avatar
Recognized Contributor - OP
Thanks Meter 17,839
Posts: 8,129
Join Date: Jun 2008
Location: TampaBay

 
DONATE TO ME
Quote:
Originally Posted by laotzy View Post
Dear tdunham, I am rather crazy to install InkEffect mod on my Galaxy S2(I9100XWLSD, deodexed) but I seem to be too old to be able going through all the steps you have described here... I did manage to activate the Ripple effect but the Inkey one seems too difficult for me. Is it possible to create an update.zip for my telefone? I will continue reading your post anyway trying to understand it better but my lack of knowledge is very notable...
It has already been done for I9100 on many custom roms like this one from Mirko DDD.
http://forum.xda-developers.com/show....php?t=1498017
It is not possible for me to do this for you. It takes a long time to program this mod.
 
hazedabeast
Old
#4  
hazedabeast's Avatar
Senior Member
Thanks Meter 1,568
Posts: 2,124
Join Date: Apr 2011
Location: Kansas City MO

 
DONATE TO ME
Default Re: [GUIDE][How-to] Ink Effect Mod 18 Colors for JB

Would this work for aosp ROMs

Sent from my d710 using xda app-developers app

Phone: Samsung Galaxy S2 Epic 4g Touch
ROM:ROM I Built ReVolt ROM JB 4.2.2

Phone: LG Optimus G Sprint
ROM:ROM I Built ReVolt ROM JB 4.2.2
 
tdunham
Old
#5  
tdunham's Avatar
Recognized Contributor - OP
Thanks Meter 17,839
Posts: 8,129
Join Date: Jun 2008
Location: TampaBay

 
DONATE TO ME
Default Re: [GUIDE][How-to] Ink Effect Mod 18 Colors for JB

Quote:
Originally Posted by hazedabeast View Post
Would this work for aosp ROMs

Sent from my d710 using xda app-developers app
Aosp does not support I'll effect.

Sent from my SPH-D710 using xda premium
The Following User Says Thank You to tdunham For This Useful Post: [ Click to Expand ]
 
laotzy
Old
#6  
Senior Member
Thanks Meter 54
Posts: 249
Join Date: Feb 2012
Quote:
Originally Posted by tdunham View Post
It has already been done for I9100 on many custom roms like this one from Mirko DDD.
http://forum.xda-developers.com/show....php?t=1498017
It is not possible for me to do this for you. It takes a long time to program this mod.
No problem Yestarday I found the InkEffect mod here: http://forum.xda-developers.com/show....php?t=2109284 Thank you for your information, anyway - I will try to make it myself...
 
moparfreak426
Old
#7  
moparfreak426's Avatar
R.I.P.
Thanks Meter 1,197
Posts: 6,538
Join Date: Mar 2012
Location: East/Middle TN

 
DONATE TO ME
Default Re: [GUIDE][How-to] Ink Effect Mod 18 Colors for JB

I wish ripple effect worked on aosp

Sent from an Apple devouring JellyBean
Devices: Verizon Samsung Galaxy S4
ASUS Transformer Infinity
Retired Devices:
Sprint LG G2
Verizon Samsung Galaxy SIII
Sprint Samsung Epic 4G Touch (I MISS THIS DEVICE!!!)
U.S. Cellular Motorola Electrify
U.S. Cellular HTC Touch Pro 2

Carrier: Verizon
ROM: S4 = CM11 nightlies
Transformer = switching between CM11 and AOKP

 
balliboxer
Old
#8  
balliboxer's Avatar
Senior Member
Thanks Meter 5,040
Posts: 1,340
Join Date: May 2012
Location: New Delhi

 
DONATE TO ME
Default Re: [GUIDE][How-to] Ink Effect Mod 18 Colors for JB

Can we have ink effect for galaxy grand gt-i9082 ?
The steps u mention r too complex for me to follow

Sent from my GT-I9082 using Tapatalk 2
SUPPORTED DEVICE

GENNXT ROM PROJECTS

[ROM][GT-I9082][XUBMJ4] ★★★ GENNXT SUPERIOR ROM ★★★Galaxy Grand
[ROM][4.3][C1][SM-G7102][GRAND2] GenNxt Pre-Rooted Stock
[ROM][4.2.2][B3][GT-I9060][GRAND NEO] GenNxt Pre-Rooted Stock
[MODS][GT-P3100]Galaxy Tab 2

U CAN REQUEST TO SUPPORT FOR UR DEVICE
 
balliboxer
Old
(Last edited by balliboxer; 22nd March 2013 at 12:22 AM.)
#9  
balliboxer's Avatar
Senior Member
Thanks Meter 5,040
Posts: 1,340
Join Date: May 2012
Location: New Delhi

 
DONATE TO ME
i managed to make secsettings edit and android.policy.jar smali edit but after port settings in phone system it stuck in bootloop.help!!
SUPPORTED DEVICE

GENNXT ROM PROJECTS

[ROM][GT-I9082][XUBMJ4] ★★★ GENNXT SUPERIOR ROM ★★★Galaxy Grand
[ROM][4.3][C1][SM-G7102][GRAND2] GenNxt Pre-Rooted Stock
[ROM][4.2.2][B3][GT-I9060][GRAND NEO] GenNxt Pre-Rooted Stock
[MODS][GT-P3100]Galaxy Tab 2

U CAN REQUEST TO SUPPORT FOR UR DEVICE
 
darlvince
Old
#10  
Junior Member
Thanks Meter 0
Posts: 2
Join Date: Apr 2013
Default I need

Quote:
Originally Posted by laotzy View Post
Dear tdunham, I am rather crazy to install InkEffect mod on my Galaxy S2(I9100XWLSD, deodexed) but I seem to be too old to be able going through all the steps you have described here... I did manage to activate the Ripple effect but the Inkey one seems too difficult for me. Is it possible to create an update.zip for my telefone? I will continue reading your post anyway trying to understand it better but my lack of knowledge is very notable...
would you please upload the res/values/public.xml?

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes