[DEV][MODDING] CRT, Airview, 4-way reboot, ink effect, phone, sms..etc [9/Dec/2013]

Sami Kabir

Senior Member
Oct 3, 2012
2,233
1,406
0
I found them yesterday accidental, but now I know how to make them visible! :D

baksmali SecSettings.apk

open Settings.smali com\android\settings\Settings.smali

look for this lines and delete them:

Code:
    invoke-interface {p1, v0}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    goto/16 :goto_23
Hey mate, the Blocking mode menu is hidden by default on my phone. So I did what you did to make it visible and even though it works perfectly, it causes another problem... For some reason, doing this removes all the linked User Accounts (like Google, Whatsapp, Facebook, Yahoo, etc.) from under "Accounts" section in the Settings app and there is no way to bring them back... The only way to fix that is by putting back the two lines I removed ( defeats the purpose, doesn't it? )

So, do you have any idea why its doing this?
 
Last edited:

tkari4

Senior Member
Jan 24, 2010
2,231
6,982
0
Hey mate, the Blocking mode menu is hidden by default on my phone. So I did what you did to make it visible and even though it works perfectly, it causes another problem... For some reason, doing this removes all the linked User Accounts (like Google, Whatsapp, Facebook, Yahoo, etc.) from under "Accounts" section in the Settings app and there is no way to bring them back... The only way to fix that is by putting back the two lines I removed ( defeats the purpose, doesn't it? )

So, do you have any idea why its doing this?
No I have no idea...

On my Note 3 I'm using this option as enabled CSC feature.

Maybe this isn't the right one because there are more lines like that, but you can try it:

open: Settings.smali

find: CscFeature_Setting_EnableMenuBlockCallMsg

add blue line

Code:
    .line 596
    invoke-static {}, Lcom/sec/android/app/CscFeature;->getInstance()Lcom/sec/android/app/CscFeature;

    move-result-object v3

    const-string v6, "[COLOR="DarkGreen"]CscFeature_Setting_EnableMenuBlockCallMsg[/COLOR]"

    invoke-virtual {v3, v6}, Lcom/sec/android/app/CscFeature;->getEnableStatus(Ljava/lang/String;)Z

    move-result v3

    [COLOR="Blue"]const/4 v3, 0x1[/COLOR]

    if-nez v3, :cond_23
:confused:
 

Sami Kabir

Senior Member
Oct 3, 2012
2,233
1,406
0
No I have no idea...

On my Note 3 I'm using this option as enabled CSC feature.

Maybe this isn't the right one because there are more lines like that, but you can try it:

open: Settings.smali

find: CscFeature_Setting_EnableMenuBlockCallMsg

add blue line

Code:
    .line 596
    invoke-static {}, Lcom/sec/android/app/CscFeature;->getInstance()Lcom/sec/android/app/CscFeature;

    move-result-object v3

    const-string v6, "[COLOR="DarkGreen"]CscFeature_Setting_EnableMenuBlockCallMsg[/COLOR]"

    invoke-virtual {v3, v6}, Lcom/sec/android/app/CscFeature;->getEnableStatus(Ljava/lang/String;)Z

    move-result v3

    [COLOR="Blue"]const/4 v3, 0x1[/COLOR]

    if-nez v3, :cond_23
:confused:
Here are the codes in settings.smali that controls the visibility of Blocking Mode..

HTML:
    .line 808
    :cond_2e
    const v9, 0x7f0b03ff

    if-ne v4, v9, :cond_2

    .line 811
    invoke-interface {p1, v1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    goto/16 :goto_2
So where will I put const/4 v3, 0x1?

Below const v9, 0x7f0b03ff, above goto/16 :goto_2 or below goto/16 :goto_2? And should I remove these 2 lines?

HTML:
    invoke-interface {p1, v1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    goto/16 :goto_2
PS: Is there any other way to toggle its visibility? My friend did it using some other way but sadly he can't remember how he did it...
 
Last edited:
  • Like
Reactions: isaak

cbucz24

Senior Member
Jan 31, 2011
2,757
2,897
0
Central Florida
Here are the codes in settings.smali that controls the visibility of Blocking Mode..

HTML:
    .line 808
    :cond_2e
    const v9, 0x7f0b03ff

    if-ne v4, v9, :cond_2

    .line 811
    invoke-interface {p1, v1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    goto/16 :goto_2
So where will I put const/4 v3, 0x1?

Below const v9, 0x7f0b03ff, above goto/16 :goto_2 or below goto/16 :goto_2? And should I remove these 2 lines?

HTML:
    invoke-interface {p1, v1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    goto/16 :goto_2
PS: Is there any other way to toggle its visibility? My friend did it using some other way but sadly he can't remember how he did it...
Check out this tutorial

http://forum.xda-developers.com/showthread.php?t=2341389

[Tutorial] How to add any App/Option in Settings.apk

Its a bit older but Its all the same principal of adding the toggle switch

Sent from my SM-N900T using Tapatalk 2
 

tkari4

Senior Member
Jan 24, 2010
2,231
6,982
0
Here are the codes in settings.smali that controls the visibility of Blocking Mode..

HTML:
    .line 808
    :cond_2e
    const v9, 0x7f0b03ff

    if-ne v4, v9, :cond_2

    .line 811
    invoke-interface {p1, v1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    goto/16 :goto_2
So where will I put const/4 v3, 0x1?

Below const v9, 0x7f0b03ff, above goto/16 :goto_2 or below goto/16 :goto_2? And should I remove these 2 lines?

HTML:
    invoke-interface {p1, v1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    goto/16 :goto_2
PS: Is there any other way to toggle its visibility? My friend did it using some other way but sadly he can't remember how he did it...
There are three ways to enable it, please don't use them together.

1.)
Deleting the lines

2.)
Enabling the CSC feature in the smali (with const/4 v3, 0x1)

3.)
Enabling it in others.xml
add this line to it: <CscFeature_Setting_EnableMenuBlockCallMsg>TRUE</CscFeature_Setting_EnableMenuBlockCallMsg>
More info here: http://forum.xda-developers.com/showpost.php?p=47555787&postcount=16
 

Sami Kabir

Senior Member
Oct 3, 2012
2,233
1,406
0
There are three ways to enable it, please don't use them together.

1.)
Deleting the lines

2.)
Enabling the CSC feature in the smali (with const/4 v3, 0x1)

3.)
Enabling it in others.xml
add this line to it: <CscFeature_Setting_EnableMenuBlockCallMsg>TRUE</CscFeature_Setting_EnableMenuBlockCallMsg>
More info here: http://forum.xda-developers.com/showpost.php?p=47555787&postcount=16
But this is for Call/Message Block. I already enabled that with no fuss. Now I am trying to enable Blocking Mode (image attached below).. For some reason Samsung decided to hide it for our phone...



So now, all I have to do is add const/4 v3, 0x1 to this code right?
HTML:
    .line 808
    :cond_2e
    const v9, 0x7f0b03ff

    if-ne v4, v9, :cond_2

    .line 811
    invoke-interface {p1, v1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    goto/16 :goto_2
But where should I put it? :eek:
 

tkari4

Senior Member
Jan 24, 2010
2,231
6,982
0
But this is for Call/Message Block. I already enabled that with no fuss. Now I am trying to enable Blocking Mode (image attached below).. For some reason Samsung decided to hide it for our phone...



So now, all I have to do is add const/4 v3, 0x1 to this code right?
HTML:
    .line 808
    :cond_2e
    const v9, 0x7f0b03ff

    if-ne v4, v9, :cond_2

    .line 811
    invoke-interface {p1, v1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    goto/16 :goto_2
But where should I put it? :eek:
Sorry misunderstood..

For Blocking mode I didn't find a CSC feature, so you can't use "const/4 v3, 0x1" I think.

What kind of phone do you have? Android version?

Did you tried it with one other CSC?

In the Settings.smali are some CSCs if you find yours, than try to rename it.
for example: const-string v6, "BST"

Some times they removes options.
 

Jhossell

Member
Apr 26, 2013
15
0
0
excuseme

i`m sorry, hi i`m jhossell and i desperate, i update the kernel of my galaxy note, but i think was broken the pack of the kernenl. my note ​​does not turn on, does not go into recovery, only heats up when I connect, I can do anything?

sorry for the english, i am learning
 

Sami Kabir

Senior Member
Oct 3, 2012
2,233
1,406
0
i`m sorry, hi i`m jhossell and i desperate, i update the kernel of my galaxy note, but i think was broken the pack of the kernenl. my note ​​does not turn on, does not go into recovery, only heats up when I connect, I can do anything?

sorry for the english, i am learning
Can it at least go to Download Mode? (Vol Down + Home + Power) If it can then connect your phone with your PC and flash your stock firmware using Odin.

If it doesn't even turn on then I'm afraid you've hard bricked your phone :/

Sent from my GT-I9070
 

Jhossell

Member
Apr 26, 2013
15
0
0
Can it at least go to Download Mode? (Vol Down + Home + Power) If it can then connect your phone with your PC and flash your stock firmware using Odin.

If it doesn't even turn on then I'm afraid you've hard bricked your phone :/

Sent from my GT-I9070
no, not really 'lights, heated only when I connect to the energy, I lost?
 

pandian8552

Senior Member
Apr 20, 2014
73
27
0
coimbatore
Ink effect enabling

This is handy one :crying:
To do this you will need to play with 2 files (android.policy.jar and SecSettings.apk) and lib folder.
Please download ink effect resources with ALL default colors enabled from here.

A. android.policy.jar file:
1. Copy the contents of “to android.policy.jar” folder.
2. Decompile android.policy.jar by backsmali/smali program.
3. Go to classout\com\android\internal\policy\impl\sec\ folder and paste the content of “to android.policy.jar” folder there and accept overwriting.
4. Now compile (smali), the result will be class.dex file. Open the original android.policy.jar by WinRAR and drag drop class.dex file inside android.policy.jar file




Now push the new modified android.policy.jar to system\framework in your phone

B. SecSettings.apk file:
Decompile SecSettings.apk by APK-Multi tool
I. Image resource
Copy all images in “to res.drawable-xhdpi” folder to res\drawable-xhdpi

II. Adding lines to strings.xml resources
1. Go to res\values and open strings.xml by notepad++
2. You should make sure that the following strings are all there; if some missing, please add before </resources> line at the bottom:
Code:
    <string name="ink_effect">Ink effect</string>
    <string name="inkeffect_help_body">Show ink effect on the lock screen. If a live wallpaper is set on the lock screen, the ink effect will be disabled automatically</string>
    <string name="ink_effect_color_none">None</string>
    <string name="ink_effect_color_pink">Pink</string>
    <string name="ink_effect_color_orange">Orange</string>
    <string name="ink_effect_color_green">Green</string>
    <string name="ink_effect_color_blue">Blue</string>
    <string name="ink_effect_color_navy">Navy</string>
    <string name="ink_effect_color_purple">Purple</string>
    <string name="ink_effect_color_brown">Brown</string>
    <string name="ink_effect_color_lightblue">Light Blue</string>
    <string name="ink_effect_color_red">Red</string>
    <string name="ink_effect_color_black">Black</string>
3. Now save your file.

III. Adding command line to Lockscreen_settings.xml <!-- if it is not there already
1. Go to \res\xml folder and open lockscreen_settings.xml
2. Add these lines bellow ripple effect line (the blue color lines):
Code:
     <CheckBoxPreference android:title="@string/ripple_effect" android:key="ripple_effect" android:summary="@string/ripple_effect_summary" />
[b][color=blue]    <PreferenceScreen android:title="@string/ink_effect" android:key="ink_effect">
        <intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.InkeffectPreview" />
    </PreferenceScreen>[/b][/color]
3. Save changes.



IV. InkeffectPreview.smali
1. Copy the files InkeffectPreview.smali
2. Go to smali\com\android\settings and paste it there and accept changes.
Now this is the tricky part..!!
3. Open it and go to the following section:
Code:
    :array_14
    .array-data 0x4
        0xb7t 0x3t 0x2t 0x7ft
        0xb9t 0x3t 0x2t 0x7ft
        0xcet 0x1t 0x2t 0x7ft
        0xcat 0x1t 0x2t 0x7ft
        0xc6t 0x1t 0x2t 0x7ft
        0xcct 0x1t 0x2t 0x7ft
        0xd0t 0x1t 0x2t 0x7ft
        0xc8t 0x1t 0x2t 0x7ft
        0xb5t 0x3t 0x2t 0x7ft
    .end array-data

    :array_2a
    .array-data 0x4
        0xb8t 0x3t 0x2t 0x7ft
        0xbat 0x3t 0x2t 0x7ft
        0xcft 0x1t 0x2t 0x7ft
        0xcbt 0x1t 0x2t 0x7ft
        0xc7t 0x1t 0x2t 0x7ft
        0xcdt 0x1t 0x2t 0x7ft
        0xd1t 0x1t 0x2t 0x7ft
        0xc9t 0x1t 0x2t 0x7ft
        0xb6t 0x3t 0x2t 0x7ft
    .end array-data
4. You can see here several numbers... these are [ink_ nameofcolor] ids for array_14 and [ink_ nameofcolor _h] ids for array_2a in public.xml.
5. So you have to open public.xml file from res\values folder
6. Search for colors ids you added… for start search for “ink_none” for array_14 section and “ink_none_h” for array_2a section.
We will start with “ink_none
The line will be something like this:
Code:
<public type="drawable" name="ink_none" id="0x7f0203b7" />
And if you noticed the array_14 section in InkeffectPreview.smali the first line will represent the ink_none in public.xml file. So we have to convert public.xml ids to array_14, SO PLEASE match to colors here:
Code:
<public type="drawable" name="ink_none" id="[B][COLOR="DarkOrchid"]0x7f[/COLOR][COLOR="DeepSkyBlue"]02[/COLOR][COLOR="Lime"]03[/COLOR][COLOR="Red"]b7[/COLOR][/B]" />
to in array_14 section:
Code:
[B]0x[COLOR="Red"]b7[/COLOR]t 0x[COLOR="Lime"]03[/COLOR]t 0x[COLOR="DeepSkyBlue"]02[/COLOR]t [COLOR="DarkOrchid"]0x7f[/COLOR]t[/B]
Yes that’s it!! Do the same for “ink_none_h” id in array_2a section.
Code:
<public type="drawable" name="ink_none_h" id="[B][COLOR="DarkOrchid"]0x7f[/COLOR][COLOR="DeepSkyBlue"]02[/COLOR][COLOR="Lime"]03[/COLOR][COLOR="Red"]b8[/COLOR][/B]" />
to in array_2a section:
Code:
[B]0x[COLOR="Red"]b8[/COLOR]t 0x[COLOR="Lime"]03[/COLOR]t 0x[COLOR="DeepSkyBlue"]02[/COLOR]t [COLOR="DarkOrchid"]0x7f[/COLOR]t[/B]
7. Now we have finished editing InkeffectPreview.smali for the two none color ids (ink_none & ink_none_h)
8. Do the same for the rest of colors (the orders of array_14 & array_2a will represent the order of ink colors in your settings menu later on, so it must be in exact order). Also if went down you will see these colors orders as following (None, Pink, Orange, Green, Blue, Navy, Purple, Brown, Light blue, Red, Black) so again you need to keep same order while you are entering ids in array_14 and array_2a... so your arrays should be represented like this (imaginary for learning purpose only):
Code:
    :array_14
    .array-data 0x4
[B]        ink_none
        ink_pink
        ink_orange
        ink_green
        ink_blue
        ink_navy
        ink_purple
        ink_brown
        ink_lightblue
        ink_red
        ink_black[/B]
    .end array-data

    :array_2a
    .array-data 0x4
[B]        ink_none_h
        ink_pink_h
        ink_orange_h
        ink_green_h
        ink_blue_h
        ink_navy_h
        ink_purple_h
        ink_brown_h
        ink_lightblue_h
        ink_red_h
        ink_black_h[/B]
    .end array-data
9. We didn't finish yet, you have to link all ids inside InkeffectPreview.smali to correct ids in public.xml file (very annoying!!). Search for all ids inside InkeffectPreview.smali and change them to their corresponding ones inside public.xml. Here is the correct order of ids inside public.xml:
- inkeffect_preview
- ink_effect_color_none
- ink_effect_color_pink
- ink_effect_color_orange
- ink_effect_color_green
- ink_effect_color_blue
- ink_effect_color_navy
- ink_effect_color_purple
- ink_effect_color_brown
- ink_effect_color_lightblue
- ink_effect_color_red
- ink_effect_color_black
- preview_image
- ink_help
- mode_list
- inkeffect_preview_list_item
- button_layout
- inkeffect_menu
- menu_cancel --> (type="string")
- menu_save
- menu_cancel --> (type="id")
Here is example:
You searched for first id in InkeffectPreview.smali (all ids begin with 0x7f) and it was for example (0x7f090514) and you know this should represent "inkeffect_preview" inside public.xml (according to the order above). So now open public.xml and search for "inkeffect_preview", if you find it, it will have an id like (0x7f040072) copy this id and put it instead of that one inside InkeffectPreview.smali and that is it. Do the same for the rest of ids as well.
Pay attention to "menu_cancel" id, it has two variables inside public.xml, type="string" and type="id". So make sure you use the correct one in public.xml for the correct one in InkeffectPreview.smali !!!
10. Now save changes.


V. LockScreenSettings.smali
1. Copy the files LockScreenSettings.smali
2. Go to smali\com\android\settings and paste it there and accept changes.
3. Open it and go to the following section:
Code:
    :array_10 
    .array-data 0x4
        0x09t 0xft 0x9t 0x7ft
        0x0at 0xft 0x9t 0x7ft
        0x4ft 0xdt 0x9t 0x7ft
        0x50t 0xdt 0x9t 0x7ft
        0x52t 0xdt 0x9t 0x7ft
        0x53t 0xdt 0x9t 0x7ft
        0x54t 0xdt 0x9t 0x7ft
        0x51t 0xdt 0x9t 0x7ft
        0x0bt 0xft 0x9t 0x7ft
    .end array-data
4. You can see here several numbers... these are [ink_effect_color_nameofcolor] ids in public.xml
5. The first line will represent the “ink_effect_color_none” text in public.xml file. So we have to convert public.xml ids to array_10, SO PLEASE match to colors here:
Code:
<public type="string" name="ink_effect_color_none" id="[B][COLOR="DarkOrchid"]0x7f[/COLOR][COLOR="DeepSkyBlue"]09[/COLOR][COLOR="Lime"]0f[/COLOR][COLOR="Red"]09[/COLOR][/B]" />
to in array_10:
Code:
[B]0x[COLOR="Red"]09[/COLOR]t 0x[COLOR="Lime"]0f[/COLOR]t 0x[COLOR="DeepSkyBlue"]09[/COLOR]t [COLOR="DarkOrchid"]0x7f[/COLOR]t[/B]
6. Now we finish editing LockScreenSettings.smali for the none color ids (ink_effect_color_none) this will represent the text color name in settings menu later on, so make color orders as same as order in InkeffectPreview.smali or you will have wrong color to wrong text color name in settings menu!!
7. Do the same for the rest of colors.
8. Again we haven't finished yet, you have to link all ids inside LockScreenSettings.smali to correct ids in public.xml file (very annoying!!). Search for all ids inside LockScreenSettings.smali and change them to their corresponding ones inside public.xml. Here is the correct order of ids inside public.xml:
- lockscreen_settings
- information_ticker_only_weibo_summary
- ripple_effect_summary
- ripple_effect_second_summary
- wakeup_in_lockscreen_summary_nomotion
- information_ticker_weibo_summary
- information_ticker_facebook_summary
- message_network_unavailable
- motion_camera_short_cut_turn_on_motion
- motion_activation
- dlg_ok
- cancel --> (type="string")
Here is example:
You searched for first id in LockScreenSettings.smali (all ids begin with 0x7f) and it was for example (0x7f09071b) and you know this should represent "lockscreen_settings" inside public.xml (according to the order above). So now open public.xml and search for "lockscreen_settings", if you find it, it will have an id like (0x7f07003a) copy this id and put it instead of that one inside LockScreenSettings.smali and that is it. Do the same for the rest of ids as well.
Pay attention to "cancel" id inside public.xml, the one that we want is with type="string" variable. So make sure you use the correct one in public.xml for the one in LockScreenSettings.smali !!!
9. Now save changes.

NOW we finally finish editing SecSettings.apk. Recompile the finished project and push it to your phone.


C. lib folder
Just copy the content of “to lib folder” to lib folder in system\lib in your phone.

Adding new ink colors
You are not satisfied with ink colors you have, so why you don't create your own!!
Let's start:
I. Image resource
Create new images of two forms [ink_nameofnewcolor.png] and [ink_nameofnewcolor_h.png] for the new color that you want to add and put them inside res\drawable-xhdpi folder.

II. Adding lines to strings.xml resources
1. Open strings.xml file and add new line just before </resources>
Code:
    <string name="ink_effect_color_nameofnewcolor">Name of the new color</string>
2. And again you need to recompile your SecSettings.apk to generate new ids in public.xml files automatically!!
THEN decompile the new SecSettings.apk (we will work on this one now, so delete the previous SecSettings.apk project to not cause confusion!!)

III. LockScreenSettings.smali
1. Find the following line:
Code:
const/16 v0, 0x[B]b[/B]
This will represent how many ink colors you have in your ink colors list; here it is b (i.e 11 colors) so we will increase it to c (i.e 12 colors) and the line will be like this:
Code:
const/16 v0, 0x[B]c[/B]
2. Now go to array_10 list and add new array for your new color:
Code:
    :array_10
    .array-data 0x4
        0xact 0x0t 0x9t 0x7ft
        0xact 0x0t 0x9t 0x7ft
        0xact 0x0t 0x9t 0x7ft
        0xact 0x0t 0x9t 0x7ft
        0xact 0x0t 0x9t 0x7ft
        0xact 0x0t 0x9t 0x7ft
        0xact 0x0t 0x9t 0x7ft
        0xact 0x0t 0x9t 0x7ft
        0xact 0x0t 0x9t 0x7ft
        0xact 0x0t 0x9t 0x7ft
        0xact 0x0t 0x9t 0x7ft
        [B][COLOR="Red"]0xact 0x0t 0x9t 0x7ft[/COLOR][/B]     [COLOR="Green"]<!-- New array line[/COLOR]
    .end array-data
.end method
3. And as usual link it to "ink_effect_color_nameofnewcolor" id in public.xml
4. Save changes.

IV. InkeffectPreview.smali
1. Find the following line:
Code:
const/16 v1, 0x[B]b[/B]
This will represent how many ink colors you have in your ink colors list; here it is b (i.e 11 colors) so we will increase it to c (i.e 12 colors) and the line will be like this:
Code:
const/16 v1, 0x[B]c[/B]
2. Now go to array_14 list and array_2a and add new array for your new color:
Code:
    .line 50
    :array_14
    .array-data 0x4
        0xact 0x1t 0x2t 0x7ft
        0xact 0x1t 0x2t 0x7ft
        0xact 0x1t 0x2t 0x7ft
        0xact 0x1t 0x2t 0x7ft
        0xact 0x1t 0x2t 0x7ft
        0xact 0x1t 0x2t 0x7ft
        0xact 0x1t 0x2t 0x7ft
        0xact 0x1t 0x2t 0x7ft
        0xact 0x1t 0x2t 0x7ft
        0xact 0x1t 0x2t 0x7ft
        0xact 0x1t 0x2t 0x7ft
        [B][COLOR="Red"]0xact 0x1t 0x2t 0x7ft[/COLOR][/B]     [COLOR="Green"]<!-- New array line[/COLOR]
    .end array-data

    .line 62
    :array_2a
    .array-data 0x4
        0xadt 0x1t 0x2t 0x7ft
        0xadt 0x1t 0x2t 0x7ft
        0xadt 0x1t 0x2t 0x7ft
        0xadt 0x1t 0x2t 0x7ft
        0xadt 0x1t 0x2t 0x7ft
        0xadt 0x1t 0x2t 0x7ft
        0xadt 0x1t 0x2t 0x7ft
        0xadt 0x1t 0x2t 0x7ft
        0xadt 0x1t 0x2t 0x7ft
        0xadt 0x1t 0x2t 0x7ft
        0xadt 0x1t 0x2t 0x7ft
        [B][COLOR="Red"]0xadt 0x1t 0x2t 0x7ft[/COLOR][/B]     [COLOR="Green"]<!-- New array line[/COLOR]
    .end array-data
.end method
And as usual link the one in array_14 to "ink_nameofnewcolor" id in public.xml and the one in array_2a to "ink_nameofnewcolor_h" id in public.xml
3. Search down for this line:
Code:
const/16 v2, 0x[B]b[/B]
And yes change b to c to be like this:
Code:
const/16 v2, 0x[B]c[/B]
4. Now we need to add the new color to the list, so search for these lines:
Code:
    sget-object v2, Lcom/android/settings/InkeffectPreview;->mInkcolorItem:[Ljava/lang/String;

    const/16 v3, 0x[B][COLOR="Red"]a[/COLOR][/B]

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

    move-result-object v4

    const v5, [B][COLOR="Red"]0x7f090d55[/COLOR][/B]

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

    const-string v4, "[B][COLOR="Red"]Black[/COLOR][/B]"

    aput-object v4, v2, v3
Copy these lines and paste them again bellow them, and change the red color values above to blue ones:
Code:
    sget-object v2, Lcom/android/settings/InkeffectPreview;->mInkcolorItem:[Ljava/lang/String;

    const/16 v3, 0x[B][COLOR="Blue"]b[/COLOR][/B]     [COLOR="Green"]<!-- Next number in the list[/COLOR]

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

    move-result-object v4

    const v5, [B][COLOR="Blue"]0x7f??????[/COLOR][/B]     [COLOR="Green"]<!-- id of "ink_effect_color_nameofnewcolor" in public.xml[/COLOR]

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

    const-string v4, "[B][COLOR="Blue"]Name of the new color[/COLOR][/B]"     [COLOR="Green"]<!-- Name of the new color[/COLOR]

    aput-object v4, v2, v3
5. Save changes.

V. CircleUnlockRippleRenderer.smali
This file is found in android.policy.jar and it determines the RGB value of the color when rendering.
1. Find the following line:
Code:
const/16 v3, 0x[B]b[/B]
And yes change b to c to be like this:
Code:
const/16 v3, 0x[B]c[/B]
2. Find these lines:
Code:
    const/16 v4, 0x[B][COLOR="Red"]a[/COLOR][/B]

    new-array v5, v7, [F

    fill-array-data v5, :array_[B][COLOR="Red"]26a[/COLOR][/B]

    aput-object v5, v3, v4
Copy these lines and paste them again bellow them, and change the red color values above to blue ones:
Code:
const/16 v4, 0x[B][COLOR="Blue"]b[/COLOR][/B]     [COLOR="Green"]<!-- Next number in the list
[/COLOR]
    new-array v5, v7, [F

    fill-array-data v5, :array_[B][COLOR="Blue"]26b[/COLOR][/B]     [COLOR="Green"]<!-- Next number in the list[/COLOR]

    aput-object v5, v3, v4
3. As we have new array_26b, so we have to make RGB hex code for it. Find ".end method" and add array data above it like this:
Code:
    :array_26b     [COLOR="Green"]<!-- Our new array[/COLOR]
    .array-data 0x4
        0x[B][COLOR="Purple"]00[/COLOR][/B]t 0x[B][COLOR="Purple"]00[/COLOR][/B]t 0x[B][COLOR="Purple"]00[/COLOR][/B]t 0x[B][COLOR="Purple"]00[/COLOR][/B]t     [COLOR="Green"]<!-- Red value in hex[/COLOR]
        0x[B][COLOR="Purple"]00[/COLOR][/B]t 0x[B][COLOR="Purple"]00[/COLOR][/B]t 0x[B][COLOR="Purple"]00[/COLOR][/B]t 0x[B][COLOR="Purple"]00[/COLOR][/B]t     [COLOR="Green"]<!-- Green value in hex[/COLOR]
        0x[B][COLOR="Purple"]00[/COLOR][/B]t 0x[B][COLOR="Purple"]00[/COLOR][/B]t 0x[B][COLOR="Purple"]00[/COLOR][/B]t 0x[B][COLOR="Purple"]00[/COLOR][/B]t     [COLOR="Green"]<!-- Blue value in hex[/COLOR]
    .end array-data
.end method
You need to change these values to their RGB Hex, Hex, Hex coding; but how!!
You need first to have RGB in decimal value (0-255) by using photoshop for example; then convert it to float value by dividing your decimal value on 255, then use IEEE floating point calculator (for Windows) to convert the result to hex.

Example:
You open your photoshop and choose this color values (light blue):



Here R=0, G=159, B=180
For R=0, we need to divide it on 255, the result will be 0
For G=159, we need to divide it on 255, the result will be about 0.62353
For B=180, we need to divide it on 255, the result will be about 0.70588

Now open IEEE floating point calculator and enter these numbers to convert them to hex
So..
For R:


For G:


For B:


So if we return back to our array_26b the result will be like this:
Code:
    :array_26b
    .array-data 0x4
        0x[B][COLOR="Purple"]00[/COLOR][/B]t 0x[B][COLOR="Purple"]00[/COLOR][/B]t 0x[B][COLOR="Purple"]00[/COLOR][/B]t 0x[B][COLOR="Purple"]00[/COLOR][/B]t     [COLOR="Green"]<!-- Red value in hex[/COLOR]
        0x[B][COLOR="Purple"]a9[/COLOR][/B]t 0x[B][COLOR="Purple"]9f[/COLOR][/B]t 0x[B][COLOR="Purple"]1f[/COLOR][/B]t 0x[B][COLOR="Purple"]3f[/COLOR][/B]t     [COLOR="Green"]<!-- Green value in hex[/COLOR]
        0x[B][COLOR="Purple"]8d[/COLOR][/B]t 0x[B][COLOR="Purple"]b4[/COLOR][/B]t 0x[B][COLOR="Purple"]34[/COLOR][/B]t 0x[B][COLOR="Purple"]3f[/COLOR][/B]t     [COLOR="Green"]<!-- Blue value in hex[/COLOR]
    .end array-data
.end method
And viola we finished!!
4. Save changes.

Now recompile both SecSettings.apk and android.policy.jar and push them to your device


Integrating application in settings menu

This really handy one.. so take care!!:confused:
In this tutorial, we will add USB-Mode program to Settings menu as an example

On your PC
1) Decompile SecSettings.apk.
2) Decompile the program that you want to add to settings menu (USB-Mode)
3) Go to \res\drawable-xhdpi folder and add icon for your program that you want to add (you can take it from decompiled wanted program (USBMode folder).



4) Go to \res\values folder and open strings.xml by NotePad++ and add these lines just before </resources> for your program
Code:
    <string name="gloryromaddons">GloryROM Addons</string>
    <string name="usbswitcher_text">USB mode switcher</string>
Here change “gloryromaddons” with any thing you want to show as a header in the Settings menu. “usbswitcher_text” is your wanted program
5) Go to \res\xml folder and open settings_headers.xml by NotePad++ and add these lines (the place you put these lines will be the place where added program will be displayed in Settings menu)
Code:
<header android:title="@string/gloryromaddons" />
    <header android:icon="@drawable/usbswitcher" android:title="@string/usbswitcher_text">
        <intent android:targetPackage="in.zatta.USB_switch" android:action="android.intent.action.MAIN" android:targetClass="in.zatta.USB_switch.USB_switcherActivity" />
    </header>
The first line reflect the header title in settings menu (So gloryromaddons will be seen as “GloryROM Addons” in the phone, see strings.xml that we edited and you will figure it out!!)

The 2nd line is for added program:
  • android:[email protected]/name of icon you put in drawable-xhdpi folder (here we put usbswitcher as the icon name inside drawable-xhdpi)
  • android:[email protected]/name of string put for added program in strings.xml (here we put usbswitcher_text as in strings.xml)

The 3rd line is the functionality and is the most difficult one:
  • android:targetPackage=package of wanted program inside its own AndroidManifest.xml (here it is “in.zatta.USB_switch”)
  • android:action=first action of wanted program inside its own AndroidManifest.xml (here it is “android.intent.action.MAIN”)



  • androidtargetClass= android:targetPackage.Activity (we have android:targetPackage from previous step but we need also .Activity how to get it??) This is the tricky one so do the following:
On your phone:
install the program you want to add (USB mode switcher) and ADW launcher from Google play and make ADW launcher as your phone launcher. Find a blank area on your homescreen(s), long press, then select custom shortcut --> pick your activity --> activities --> browse down until you find USB switcher app and expand with the arrow on the left of USB switcher, you will see several activities (some may have only one). The first one in the list is usually its opening class; it is in between the ( )'s. In this example it is .USB_switcherActivity



Go back to your PC:
So now androidtargetClass= android:targetPackage.Activity will be:
androidtargetClass= in.zatta.USB_switch.USB_switcherActivity

6) Now compile SecSettings and push it to your phone.


Additional step:
If you want to hide this app from applications drawer do the followings:
1) Decompile your desired app (here USB-Mode.apk)
2) Go to AndroidManifest.xml file and open it by NotePad++
3) Delete this line :
Code:
<category android:name="android.intent.category.LAUNCHER" />
4) Compile your app as non system apk and sign it then push it to your phone

Results example:

hi majdinj
i want one help from you.
i edited secsettings.apk and i enabled inkeffect as per you told in your post .
i carefully readed your post and copied inkeffect resources and done edited successfully using apk multitool.
but the problem is when i compiled and pushed to my phone and rebooted when opening settings>lockscreen>lockscreen options.
there is no ink effect toggle :crying: then how can i choose ink effect?
but in lockscreen when i unlocked blue ink alone comes.
i can't choose any other color ink because there is no toggle in lockscreen options menu.
i tried editing for about seven times but the result is failure.
please give me some solutions for this problem as soon as possible.
 

Jackwu696

Senior Member
Jan 12, 2014
963
608
0
Jakarta City
@majdinj

Hello, I have been fiddling around with 23 custom toogles. I have followed each step u described including copying wanam's file. My question is, as I recompile, it would ask me to delete the XML and the resources. I deleted tw_status_bar_expanded.xml the first time I recompiled the original SystemUI.apk to get the new system_SystemUI.apk in order to generate new ids in public.xml file for exp_power_stat like you guided. So should I delete the edited AndroidManifest.xml at the end of the final recompiling before signing as your tool asked to? I tried 3 times and get 3 FC's sytemui. luckily backup saves the day. I'm fairly new to this so I'm sorry if my question has been asked as I couldn't find the answer. Thanks
 

Kamy

Senior Member
Aug 29, 2012
5,335
19,303
0
Beijing
@majdinj

Hello, I have been fiddling around with 23 custom toogles. I have followed each step u described including copying wanam's file. My question is, as I recompile, it would ask me to delete the XML and the resources. I deleted tw_status_bar_expanded.xml the first time I recompiled the original SystemUI.apk to get the new system_SystemUI.apk in order to generate new ids in public.xml file for exp_power_stat like you guided. So should I delete the edited AndroidManifest.xml at the end of the final recompiling before signing as your tool asked to? I tried 3 times and get 3 FC's sytemui. luckily backup saves the day. I'm fairly new to this so I'm sorry if my question has been asked as I couldn't find the answer. Thanks
Hey mate, I suggest you using this tool as you are free to deleting modified files. I am using it for Note 1 and 3 working balze.
 
  • Like
Reactions: Jackwu696

tkari4

Senior Member
Jan 24, 2010
2,231
6,982
0
Here are the codes in settings.smali that controls the visibility of Blocking Mode..

HTML:
    .line 808
    :cond_2e
    const v9, 0x7f0b03ff

    if-ne v4, v9, :cond_2

    .line 811
    invoke-interface {p1, v1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    goto/16 :goto_2
So where will I put const/4 v3, 0x1?

Below const v9, 0x7f0b03ff, above goto/16 :goto_2 or below goto/16 :goto_2? And should I remove these 2 lines?

HTML:
    invoke-interface {p1, v1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    goto/16 :goto_2
PS: Is there any other way to toggle its visibility? My friend did it using some other way but sadly he can't remember how he did it...
Good news!

We did it with @H170kR1 !

Solution is easy!

Do not remove the goto line.. :eek:

So, only remove the red line:

Code:
.line 808
    :cond_2e
    const v9, 0x7f0b03ff

    if-ne v4, v9, :cond_2

    .line 811
    [COLOR="Red"]invoke-interface {p1, v1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z[/COLOR]

    goto/16 :goto_2
My fault, some removed goto/16 :goto_2 line kills the smali...

:eek:
 

Sami Kabir

Senior Member
Oct 3, 2012
2,233
1,406
0
Please help me setup a Quicksettings toggle

I'm trying to add a toggle button that will show all the QuickSettings buttons (like what TouchWiz on Android 4.2 and above does).. Bnd after hours of hard work, it did not work :(

My SystemUI keeps force closing and the problem is that I still don't completely understand logcats or smali codes properly so I need your help..

Here's my filtered out logcat:
Code:
06-20 10:44:12.181 10986 11002 E Drive.UninstallOperation: Package still installed com.android.systemui

06-20 10:44:50.538 11423 11423 E AndroidRuntime: java.lang.NoSuchMethodError: com.android.systemui.statusbar.phone.PhoneStatusBar.update_power_button

06-20 10:44:50.538 11423 11423 E AndroidRuntime: 	at com.android.systemui.statusbar.phone.PhoneStatusBar.makeStatusBarView(PhoneStatusBar.java:708)

06-20 10:44:50.538 11423 11423 E AndroidRuntime: 	at com.android.systemui.statusbar.phone.PhoneStatusBar.addStatusBarWindow(PhoneStatusBar.java:3067)

06-20 10:44:50.538 11423 11423 E AndroidRuntime: 	at com.android.systemui.statusbar.phone.PhoneStatusBar.createAndAddWindows(PhoneStatusBar.java:3036)

06-20 10:44:50.538 11423 11423 E AndroidRuntime: 	at com.android.systemui.statusbar.BaseStatusBar.start(BaseStatusBar.java:460)

06-20 10:44:50.538 11423 11423 E AndroidRuntime: 	at com.android.systemui.statusbar.phone.PhoneStatusBar.start(PhoneStatusBar.java:483)

06-20 10:44:50.538 11423 11423 E AndroidRuntime: 	at com.android.systemui.SystemUIService.onCreate(SystemUIService.java:94)

06-20 10:44:57.225 11306 11324 E ActivityManager: App already has crash dialog: ProcessRecord{41cd67a8 11423:com.android.systemui/u0a77}
and here's my PhoneStatusBar.smali file. Please take a look at them if you have the time. Thanks :)

(and I'm sorry if you find this post off-topic, but I am really desperate about this since I wasted a lot of days trying to figure out what's wrong with it..)
 

Attachments