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

32dave

Senior Member
Apr 7, 2011
979
465
93
Woodstock
SOLVED SEE BELOW
Is there a way to make the clock not disappear i have modded my status bar and replaced the clock with the speedometer but it hides when the lock screen is active I have posted this question in Q&A in my devices thread but thought i might have better luck here. Thanks,Dave

You need to change the id on the centre line I have uploaded text documents of modded and non modded now i have the speedometer even when the lock screen is active
 

Attachments

Last edited:

majdinj

Senior Member
Nov 25, 2006
980
3,437
0
AlAhsa
CSC features

<< This post and next post are dedicated to CSC Features that can be enabled in GT-N7000 >>​

★ Enabled CSC Features ★​

General how to:
In your phone, go to /system/csc folder and open others.xml or feature.xml (depending on your firmware) and add the new csc feature line anywhere after <FeatureSet> and before </FeatureSet> then reboot the phone for changes to take effect.

Template example:
Code:
[B][COLOR="Red"]<FeatureSet>[/COLOR][/B]
    <CscFeature_XXX>TRUE</CscFeature_XXX>
[B][COLOR="Red"]</FeatureSet>[/COLOR][/B]
Adding Call Button to Contacts and Logs

Code:
<CscFeature_Contact_EnableCallButtonInList>TRUE</CscFeature_Contact_EnableCallButtonInList>
Results example:




Call and message block

Code:
<CscFeature_Setting_EnableMenuBlockCallMsg>TRUE</CscFeature_Setting_EnableMenuBlockCallMsg>
Results example:




Factory data reset password

Code:
<CscFeature_Setting_EnableFactoryResetPasswordWhenNoSIM>TRUE</CscFeature_Setting_EnableFactoryResetPasswordWhenNoSIM>
Results example:




About device extra and hiding displays

Display installed variant:
Code:
<CscFeature_Common_EnableRegionalDevice>TRUE</CscFeature_Common_EnableRegionalDevice>
Display hardware version:
Code:
<CscFeature_Setting_EnableHwVersionDisplay>TRUE</CscFeature_Setting_EnableHwVersionDisplay>
Hide Update Software option:
Code:
<CscFeature_Setting_DisableMenuSoftwareUpdate>TRUE</CscFeature_Setting_DisableMenuSoftwareUpdate>
Results example:




Enabling Folder view in message app

Code:
<CscFeature_Message_EnableFolderView>TRUE</CscFeature_Message_EnableFolderView>
Results example:




Enabling Callback number in message app

Code:
<CscFeature_Message_EnableSmsCallbackNumber>TRUE</CscFeature_Message_EnableSmsCallbackNumber>
Results example:




Disable Page Rotation in TW Launcher

Code:
<CscFeature_Launcher_DisablePageRotation>TRUE</CscFeature_Launcher_DisablePageRotation>
Results example:




Disable Tilt Effect in TW Launcher

Code:
<CscFeature_Launcher_DisableTiltEffect>TRUE</CscFeature_Launcher_DisableTiltEffect>
Results example:




Enable Home Screen Edit Mode in TW Launcher

Code:
<CscFeature_Launcher_HomeScreenEditMode>TRUE</CscFeature_Launcher_HomeScreenEditMode>
Results example:




Change Day Color in SPlanner widget

Code:
<CscFeature_Calendar_SetColorOfDays>XXXXRBX</CscFeature_Calendar_SetColorOfDays>
N.B:
Here X means no change, R means red and B means blue. The order is same as days of week.
Results example:




Adding Exit button in default web browser

Code:
<CscFeature_Web_AddOptionToTerminate>TRUE</CscFeature_Web_AddOptionToTerminate>
Results example:




Adding Home button in default web browser

Code:
<CscFeature_Web_EnableHomepageOption>TRUE</CscFeature_Web_EnableHomepageOption>
Results example:




Adding Version info in default web browser

Code:
<CscFeature_Web_ShowVersionInSetting>TRUE</CscFeature_Web_ShowVersionInSetting>
Results example:




Desktop view by default in default web browser

Code:
<CscFeature_Web_EnableDesktopSiteAsDefault>TRUE</CscFeature_Web_EnableDesktopSiteAsDefault>
Results example:




Enable prompt to exit in default web browser

Code:
<CscFeature_Web_EnablePromptToExit>TRUE</CscFeature_Web_EnablePromptToExit>
Results example:




Enable Camera Shutter Sound menu

Thanks to @danivancouver for contributing..
Code:
<CscFeature_Camera_ShutterSoundMenu>TRUE</CscFeature_Camera_ShutterSoundMenu>
Results example:

 
Last edited:

majdinj

Senior Member
Nov 25, 2006
980
3,437
0
AlAhsa
Continue moddings

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

N.B: by default, ink will work for both finger and pen as well. If you want it for pen only then inside classout\com\android\internal\policy\impl\sec\ folder open CircleUnlockRippleRenderer.smali and search for "const/16 v2, 0x4002" and change this line:
Code:
const/16 v2, 0x4002

if-ne v[B][COLOR="Red"]2[/COLOR][/B], v2, :cond_94
to
Code:
const/16 v2, 0x4002

if-ne v[B][COLOR="Blue"]1[/COLOR][/B], v2, :cond_94
and save changes.
In CircleUnlockRippleRenderer.smali, find 0x1080618 and replace it to id value of "reflectionmap" in public.xml of framework-res.apk
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.

NOW you need to recompile your SecSettings.apk!! This is important to generate new id in public.xml files automatically!!
NOW decompile the new SecSettings.apk (be alert not to decompile the old one, it will not include the new changes!!)
You can delete the old SecSettings.apk from project folder to not cause confusion.
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]
N.B: After compiling, number 0 in the left side of value will be ignored!
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
Another way to get targetPackage and activity is here; credits to apurvapatel
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:

 
Last edited:

majdinj

Senior Member
Nov 25, 2006
980
3,437
0
AlAhsa
Continue moddings!!

Framed Recent app windows

For this mod, we will modify 2 files; SystemUI.apk and framework-res.apk
First download the resources from here.

A) SystemUI.apk
1. Decompile SystemUI.apk by APK-Multi Tool.
2. Inside Recent_Mod.zip there is three files; status_bar_recent_item.xml and status_bar_recent_panel.xml, copy them to res\layout-port folder for android 4.1 or to res\layout for android 4.2; and nyandroid11.png move it to res\drawable-nodpi folder
3. Go to res\values\bools.xml and change:
Code:
    <bool name="config_recents_thumbnail_image_fits_to_xy">[B][COLOR="Red"]false[/COLOR][/B]</bool>
to:
Code:
    <bool name="config_recents_thumbnail_image_fits_to_xy">[B][COLOR="Blue"]true[/COLOR][/B]</bool>
4. Go to res\values\colors.xml and change:
Code:
    <color name="status_bar_recents_app_label_color">[B][COLOR="Red"]#ffffffff[/COLOR][/B]</color>
to:
Code:
    <color name="status_bar_recents_app_label_color">[B][COLOR="Blue"]#ff555555[/COLOR][/B]</color>
5. Go to res\values\drawables.xml and change:
Code:
    <item type="drawable" name="status_bar_recents_app_thumbnail_background">[B][COLOR="Red"]#88000000[/COLOR][/B]</item>
to:
Code:
    <item type="drawable" name="status_bar_recents_app_thumbnail_background">[B][COLOR="Blue"]#ffe0e0e0[/COLOR][/B]</item>
6. Go to res\values\ids.xml and add these lines if they are not there:
Code:
    <item type="id" name="recents_transition_background">false</item>
    <item type="id" name="recents_transition_placeholder_icon">false</item>
7. Recompile your finished SystemUI.apk

B) framework-res.apk
1. Decompile framework-res.apk by APK-Multi Tool
2. Go to res\values\dimens.xml and change thumbnail height and width size to:
Code:
    <dimen name="thumbnail_height">160.0dip</dimen>
Code:
    <dimen name="thumbnail_width">240.0dip</dimen>
3. Recompile your finished framework-res.apk

N.B: You might change thumbnail height and width to match your device screen resolutions.
Results example:


Volume Rocker to Skip Sound Track

This mod will enable you to change sound track by long pressing volume up or down while the screen is locked using stock Music Player and Google Play Music programs..

Credits to:
- xperiacle: who firstly port this mod to Galaxy Note.
- grilleld: who helped me by providing android.policy.jar from xperiacle ROM, so I could locate codes for this mod (I did some codes modifications to shortening the modding process :p, so it will be easy and straight forward).
- Backsmali android.policy.jar
- Navigate to com/android/internal/policy/impl/ folder and open PhoneWindowManager.smali
- Search for this static field ".field static final LONG_PRESS_POWER_SHUT_OFF:I = 0x2" and add this line bellow it (the blue one):
Code:
.field static final LONG_PRESS_POWER_SHUT_OFF:I = 0x2

[B][COLOR="Blue"].field private static final LONG_PRESS_TIMEOUT:I = 0x190[/COLOR][/B]

.field static final MINI_APP_DIALOG_LAYER:I = 0x5
Here you can set the timeout delay for long press event of volume rocker, here it is set to 400 millisecond (0x190).
- Search for this field ".field private mIsVisibleSPenGestureView:Z" and add these two lines bellow it (the blue ones):
Code:
.field private mIsVisibleSPenGestureView:Z

[B][COLOR="Blue"].field mIsVolumeAction:Z

.field mIsVolumeBlocking:Z[/COLOR][/B]

.field mKeyboardTapVibePattern:[J
- Search for the field ".field private mVolumeDownKeyTriggered:Z" and add this line bellow it (the blue one):
Code:
.field private mVolumeDownKeyTriggered:Z

[B][COLOR="Blue"].field mVolumeDownLongPress:Ljava/lang/Runnable;[/COLOR][/B]

.field private final mVolumeKeyLongPressforOneTouchReport:Ljava/lang/Runnable;
- Search for the field ".field private mVolumeUpKeyTriggered:Z" and add this line bellow it (the blue one):
Code:
.field private mVolumeUpKeyTriggered:Z

[B][COLOR="Blue"].field mVolumeUpLongPress:Ljava/lang/Runnable;[/COLOR][/B]

.field mWindowManager:Landroid/view/IWindowManager;
- Search for the method ".method public constructor <init>()V" and go to the end of this method and add these lines (the blue ones) before "return-void" line:
Code:
    .line 7234
    new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$36;

    invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$36;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V

    iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenLockTimeout:Ljava/lang/Runnable;

    [B][COLOR="Blue"]new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$Skip1;

    invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$Skip1;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V

    iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;

    new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$Skip2;

    invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$Skip2;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V

    iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;[/COLOR][/B]

    .line 8132
    return-void
.end method
- Search for the method ".method handleVolumeKey(II)V" and add these lines above "invoke-static" line (the blue ones), and add extra condition line (the blue line) above "goto" command:
Code:
.method handleVolumeKey(II)V
    .registers 8
    .parameter "stream"
    .parameter "keycode"

    .prologue
    .line 5405
    [B][COLOR="Blue"]move-object/from16 v0, p0

    iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z

    if-nez v0, :cond_c[/COLOR][/B]

    invoke-static {}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getAudioService()Landroid/media/IAudioService;

    move-result-object v0

    if-nez v0, :cond_d

    [B][COLOR="Blue"]:cond_c[/COLOR][/B]
    :goto_[B][COLOR="Blue"]c[/COLOR][/B]
    return-void
Here we should change :goto_value to same as conditions we added, so it will be :goto_c
- Still in the same method, search down for "Landroid/os/PowerManager$WakeLock;->release()V" and change :goto value to the same as the one in the previous:
before:
Code:
    iget-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;

    invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->release()V

    goto :goto_[B][COLOR="Red"]6[/COLOR][/B]
After:
Code:
    iget-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;

    invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->release()V

    goto :goto_[B][COLOR="Blue"]c[/COLOR][/B]
- There is another one..!! Search down again for "Landroid/os/PowerManager$WakeLock;->release()V" and change :goto value to the same as the one in the previous step:
Before:
Code:
    iget-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;

    invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->release()V

    goto :goto_[B][COLOR="Red"]6[/COLOR][/B]
After:
Code:
    iget-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;

    invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->release()V

    goto :goto_[B][COLOR="Blue"]c[/COLOR][/B]
- Now at the end of the previous method ".method handleVolumeKey(II)V" and before the next method ".method public hasNavigationBar()Z", add these two new methods:
Code:
[B][COLOR="Blue"].method handleVolumeLongPress(I)V
    .registers 6

    const/4 v1, 0x1

    move-object/from16 v0, p0

    iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z

    const/4 v1, 0x0

    iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z

    const/16 v1, 0x18

    if-ne p1, v1, :cond_majdi

    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;

    :goto_nj
    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;

    sget v2, Lcom/android/internal/policy/impl/PhoneWindowManager;->LONG_PRESS_TIMEOUT:I

    int-to-long v2, v2

    invoke-virtual {v1, v0, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    return-void

    :cond_majdi
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;

    goto :goto_nj
.end method

.method handleVolumeLongPressAbort()V
    .registers 3

    const/4 v1, 0x0

    move-object/from16 v0, p0

    iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z

    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;

    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V

    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;

    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V

    return-void
.end method[/COLOR][/B]
- Now search for the method ".method public interceptKeyBeforeQueueing(Landroid/view/KeyEvent;IZ)I", then search down for "Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;" and add these lines ABOVE it (the blue ones):
Code:
    :cond_51c
    move-object/from16 v0, p0

    [B][COLOR="Blue"]iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenOnEarly:Z

    if-nez v0, :cond_dinj

    invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->isMusicActive()Z

    move-result v29

    if-eqz p0, :cond_dinj

    move-object/from16 v0, p0

    move/from16 v15, v19

    invoke-virtual {v0, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPress(I)V

    :cond_dinj
    move-object/from16 v0, p0[/COLOR][/B]

    iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;

    move-object/from16 v29, v0
- Still in the same method, and after adding the previous lines, just go down for few lines and you will see a line starts with a defined condition (:cond_), just add these lines (the blue ones) bellow that defined condition:
Code:
    invoke-virtual/range {v29 .. v29}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->start()V

    goto/16 :goto_68

    :cond_562
    [B][COLOR="Blue"]if-nez v5, :cond_newa

    move-object/from16 v0, p0

    iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z

    if-eqz v0, :cond_newa

    invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V

    move-object/from16 v0, p0

    iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z

    if-nez v0, :cond_newa

    move-object/from16 v0, p0

    const/4 v3, 0x0

    move/from16 v15, v19

    invoke-virtual {v0, v3, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V

    :cond_newa[/COLOR][/B]
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;

    move-object/from16 v29, v0
- Now at the end of the method ".method sendCloseSystemWindows(Ljava/lang/String;)V" and above the method ".method setAttachedWindowFrames(Landroid/view/WindowManagerPolicy$WindowState;IILandroid/view/WindowManagerPolicy$WindowState;ZLandroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;I)V" add this new method:
Code:
[B][COLOR="Blue"].method protected sendMediaButtonEvent(I)V
    .registers 15

    invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J

    move-result-wide v1

    new-instance v11, Landroid/content/Intent;

    const-string v4, "android.intent.action.MEDIA_BUTTON"

    const/4 v5, 0x0

    invoke-direct {v11, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

    new-instance v0, Landroid/view/KeyEvent;

    const/4 v5, 0x0

    const/4 v7, 0x0

    move-wide v3, v1

    move v6, p1

    invoke-direct/range {v0 .. v7}, Landroid/view/KeyEvent;-><init>(JJIII)V

    const-string v4, "android.intent.extra.KEY_EVENT"

    invoke-virtual {v11, v4, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;

    iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;

    const/4 v5, 0x0

    invoke-virtual {v4, v11, v5}, Landroid/content/Context;->sendOrderedBroadcast(Landroid/content/Intent;Ljava/lang/String;)V

    new-instance v12, Landroid/content/Intent;

    const-string v4, "android.intent.action.MEDIA_BUTTON"

    const/4 v5, 0x0

    invoke-direct {v12, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

    new-instance v3, Landroid/view/KeyEvent;

    const/4 v8, 0x1

    const/4 v10, 0x0

    move-wide v4, v1

    move-wide v6, v1

    move v9, p1

    invoke-direct/range {v3 .. v10}, Landroid/view/KeyEvent;-><init>(JJIII)V

    const-string v4, "android.intent.extra.KEY_EVENT"

    invoke-virtual {v12, v4, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;

    iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;

    const/4 v5, 0x0

    invoke-virtual {v4, v12, v5}, Landroid/content/Context;->sendOrderedBroadcast(Landroid/content/Intent;Ljava/lang/String;)V

    const/4 v8, 0x1

    move-object/from16 v9, p0

    iput-boolean v8, v9, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z

    return-void
.end method[/COLOR][/B]
Save changes..

Now add the two extra smalis resources in com/android/internal/policy/impl folder and recompile android.policy.jar and push to your phone and fix permissions.


CRT TV off effect
Some custom kernels, works when wifi is on!!
1. We need Backsmali/smali program for this method.
2. Put the service.jar in baksmali folder.
3. Follow its procedure to baksmali service.jar, if done you will have classout folder.
4. Open classout folder and go to \com\android\server folder and open PowerManagerService$ScreenBrightnessAnimator.smali file.
5. In the method ".method private animateInternal(IZI)V", search for "Landroid/os/Handler;->removeMessages(I)V" and add the following code lines (the blue ones only, pay attention to red register number, it could be differ according to your ROM):
Code:
    .line 3064
    .end local v0           #delta:I
    :cond_60
    :goto_60
    iget-object v7, p0, Lcom/android/server/PowerManagerService$ScreenBrightnessAnimator;->this$0:Lcom/android/server/PowerManagerService;

    #getter for: Lcom/android/server/PowerManagerService;->mScreenBrightnessHandler:Landroid/os/Handler;
    invoke-static {v7}, Lcom/android/server/PowerManagerService;->access$7200(Lcom/android/server/PowerManagerService;)Landroid/os/Handler;

    move-result-object [B][COLOR="Red"]v7[/COLOR][/B]

[COLOR="Blue"][B]    if-eqz p2, :cond_maj

    const/16 v9, 0xb

    const/4 v10, 0x0

    const v2, 0x10

    invoke-virtual {v7, v9, v2, v10}, Landroid/os/Handler;->obtainMessage(III)Landroid/os/Message;

    move-result-object v9

    invoke-virtual {v9}, Landroid/os/Message;->sendToTarget()V

    :cond_maj[/B][/COLOR]
    const/16 v9, 0xa

    invoke-virtual {v7, v9}, Landroid/os/Handler;->removeMessages(I)V
6. Save changes.
To disable glitch turning off, please see this post by joosh3 here
7. Recompile (smali) your jar and push to your phone.


Permanent Disable of Ongoing Notifications

★ Disable Ongoing Notifications in Pull-down Menu ★


- Decompile SystemUI.apk.
- Navigate to res/layout folder and open tw_status_bar_expanded.xml file.
- Now, locate this section:
Code:
                <LinearLayout android:orientation="vertical" android:id="@id/onGoingCart" android:background="#ff293945" android:focusable="true" android:visibility="gone" android:layout_width="[B][COLOR="Red"]fill_parent[/COLOR][/B]" android:layout_height="[B][COLOR="Red"]@dimen/status_bar_expanded_notification_category_height[/COLOR][/B]">
                    <TextView android:textSize="@dimen/status_bar_expanded_notification_category_text_size" android:textColor="@color/notification_category_color" android:gravity="left|center" android:id="@id/onGoingNotificationText" android:paddingLeft="11.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="@string/status_bar_ongoing_events_title" />
                </LinearLayout>
                <com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/onGoingItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/tw_notification_row_min_height" />
- Change the red texts in the previous codes to the new green one bellow and add the new blue codes..
Code:
                <LinearLayout android:orientation="vertical" android:id="@id/onGoingCart" android:background="#ff293945" android:focusable="true" android:visibility="gone" android:layout_width="[B][COLOR="Lime"]0.0dip[/COLOR][/B]" android:layout_height="[B][COLOR="Lime"]0.0dip[/COLOR][/B]">
                    <TextView android:textSize="@dimen/status_bar_expanded_notification_category_text_size" android:textColor="@color/notification_category_color" [B][COLOR="Blue"]android:visibility="gone"[/COLOR][/B] android:gravity="left|center" android:id="@id/onGoingNotificationText" android:paddingLeft="11.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="@string/status_bar_ongoing_events_title" />
                </LinearLayout>
                <com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/onGoingItems" [B][COLOR="Blue"]android:visibility="gone"[/COLOR][/B] android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/tw_notification_row_min_height" />
- Save changes, recompile, push to phone, fix permissions (644) and reboot.


★ Disable Built-in Ongoing Notifications in Status Bar ★


Ok, this part is only for built-in ongoing notifications, since market apps ongoing notifications can be disabled from application manager settings..!!!

A. Disable USB Debugging Notification:
This is quiet simple. In your phone, go to /system partition folder and open build.prop file and add this line if it is not there or edit the pre-existent one to be like this one:
Code:
persist.adb.notify=[B][COLOR="Blue"]0[/COLOR][/B]
So.. 0 means disable and 1 means enable.


B. Disable Full Battery Notification:
- Baksmali SystemUI.apk.
- Go to classes/com/android/systemui/power/ folder and open PowerUI.smali.
- Search for this method ".method notifyFullBatteryNotification()V" and just add the following line (the blue line):
Code:
.method notifyFullBatteryNotification()V
    .registers 12

    .prologue
    [B][COLOR="Blue"]return-void[/COLOR][/B]
	
    const/4 v10, 0x0

    .line 827
    iget-object v7, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;

    const-string v8, "notification"
Explanation: the method will return to nothing (exit) as it is just void.
- Save changes.. smali (recompile).. push to phone.. fix permissions (644) and reboot.


C. Disable Keyboard Input Notification:
- Baksmali services.jar.
- Navigate to classout/com/android/server/ folder and open InputMethodManagerService.smali
- Search for this method ".method public setImeWindowStatus(Landroid/os/IBinder;II)V" and just add the following line (the blue line):
Code:
.method public setImeWindowStatus(Landroid/os/IBinder;II)V
    .registers 23
    .param p1, "token"    # Landroid/os/IBinder;
    .param p2, "vis"    # I
    .param p3, "backDisposition"    # I

    .prologue
    [B][COLOR="Blue"]return-void[/COLOR][/B]
	
    .line 1640
    invoke-static {}, Landroid/os/Binder;->getCallingUid()I
Explanation: the method will return to nothing (exit) as it is just void.
- Save changes.. smali (recompile).. push to phone.. fix permissions (644) and reboot.


D. Disable USB Connection Notification:
This method is inspired by this thread here by @Didact74
- Decompile framework-res.apk.
- Go to res/values/ folder and open drawables.xml and add this line at the end before </resources> line:
Code:
<item type="drawable" name="stat_sys_data_usb">false</item>
- Now delete this image resource "stat_sys_data_usb.png" from both res/drawables-hdpi and drawables-xhdpi folders.
- Recompile, push to phone, fix permissions (644) and reboot.


Remove Mobile Data Toggle off Warning Dialogue



- Baksmali SystemUI.apk.
- Go to classout/com/android/systemui/statusbar/policy/quicksetting folder and open MobileDataQuickSettingButton.smali
- Search for this method ".method private setMobileData(Z)V" and then go to its end and add this (goto) blue line:
Code:
.method private setMobileData(Z)V
    .registers 6
    .param p1, "on"    # Z

    .prologue
    .line 248
    iget-object v1, p0, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->mContext:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    const-string v2, "quickpanel_mobiledata_checked"

    const/4 v3, 0x0

    invoke-static {v1, v2, v3}, Landroid/provider/Settings$Secure;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v0

    .line 250
    .local v0, "mChecked":I
    const-string v1, "STATUSBAR-MobileDataQuickSettingButton"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "Mobile data waring checked : "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/util/Slog;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 252
    [B][COLOR="Blue"]goto :cond_2d[/COLOR][/B]
	
    if-nez p1, :cond_2d

    if-nez v0, :cond_2d

    .line 253
    invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->onDisplayMobileDataOffAlert()V

    .line 257
    :goto_2c
    return-void

    .line 255
    [B][COLOR="Red"]:cond_2d[/COLOR][/B]    [B][COLOR="Green"]<!-- Make sure the new blue goto command above has the same cond value as this one[/COLOR][/B]
    invoke-direct {p0, p1}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->setMobileDataEnabled(Z)V

    goto :goto_2c
.end method
- Make sure of the blue :cond value in the new goto command to be the same as the red :cond value in the code. Here, the red value is :cond_2d so the blue will be :cond_2d as well.
Explanation:
By adding this goto command, we are telling the code to jump over the invoke alert dialogue command to the mobile data boolean directly then jump to void.
- Save changes.. smali (recompile).. push to phone.. fix permissions (644) and reboot.
 
Last edited:

majdinj

Senior Member
Nov 25, 2006
980
3,437
0
AlAhsa
Continue moddings!!

Control The Full Battery Notification With Toggle Switch On or Off

After this guide, you will be able to switch on or off the full battery notification after the device is being fully charged..


So here we go..

We will be working with two files, SystemUI.apk and SecSettings.apk

Setting The Toggle Switch >>>
1) SecSettings.apk

- Decompile SecSettings.apk
- Go to res\values folder and open strings.xml and add these new lines:
Code:
	<string name="set_remove_bat">Full Battery Notification</string>
	<string name="notif_on">Notification is Enabled</string>
	<string name="notif_off">Notification is Disabled</string>
- Go to res\xml folder and open display_settings.xml and add these codes where you want to display the toggle check box:
Code:
	<CheckBoxPreference android:title="@string/set_remove_bat" android:key="bat_sbar" android:summaryOn="@string/notif_on" android:summaryOff="@string/notif_off" />
- Now for the smali.. Go to classout\com\android\settings folder and open DisplaySettings.smali.
- Add this line to [# instance fields] section:
Code:
.field private mBatPref:Landroid/preference/CheckBoxPreference;
- On the method ".method public onCreate(Landroid/os/Bundle;)V", search for ""key_multi_window"" and add these lines:
Code:
    .line 570
    const-string v11, "key_multi_window"

    invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v11

    check-cast v11, Landroid/preference/CheckBoxPreference;

    iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    [B][COLOR="Blue"]const-string v11, "bat_sbar"

    invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v11

    check-cast v11, Landroid/preference/CheckBoxPreference;

    iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatPref:Landroid/preference/CheckBoxPreference;[/COLOR][/B]
- Now in the method ".method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z", search for ""multi_window_enabled"" to locate this part at the end:
Code:
    :cond_15c
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, [B][COLOR="Red"]:cond_179[/COLOR][/B]

    .line 1022
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v0

    .line 1023
    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "multi_window_enabled"

    if-eqz v0, :cond_177

    :goto_172
    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16 [B][COLOR="Lime"]:goto_1c[/COLOR][/B]

    :cond_177
    move v1, v2

    goto :goto_172
.end method
Add new codes before [.end method] in the previous section. Pay attention to the red color condition and the green color condition..!!!, so that section will be like this:
Code:
    :cond_15c
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, [B][COLOR="Blue"]:cond_batteryToggle[/COLOR][/B]

    .line 1022
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v0

    .line 1023
    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "multi_window_enabled"

    if-eqz v0, :cond_177

    :goto_172
    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16 [B][COLOR="Lime"]:goto_1c[/COLOR][/B]

    :cond_177
    move v1, v2

    goto :goto_172

    [B][COLOR="Blue"]:cond_batteryToggle
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, [COLOR="Red"]:cond_179[/COLOR]

    .line 1022
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v0

    .line 1023
    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "bat_sbar"

    if-eqz v0, :cond_majdiB

    :goto_njB
    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16 [B][COLOR="Lime"]:goto_1c[/COLOR][/B]

    :cond_majdiB
    move v1, v2

    goto :goto_njB[/COLOR][/B]
.end method
- Now in the method ".method public onResume()V", search for ""multi_window_enabled"" and locate this part, pay attention to the red color condition..!!!:
Code:
    :cond_9d
    sget-boolean v0, Lcom/android/settings/DisplaySettings;->UseMultiWindow:Z

    if-eqz v0, [B][COLOR="Red"]:cond_c1[/COLOR][/B]

    .line 847
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "multi_window_enabled"

    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    if-ne v3, v1, :cond_de

    :goto_af
    invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

    .line 848
    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const-string v1, "multi_window_enabled"

    invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowModeObserver:Landroid/database/ContentObserver;

    invoke-virtual {v0, v1, v2, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V

    line 850
    :cond_c1
    return-void

    :cond_c2
    move v0, v2
And do these modification:
Code:
    :cond_9d
    sget-boolean v0, Lcom/android/settings/DisplaySettings;->UseMultiWindow:Z

    if-eqz v0, [B][COLOR="Blue"]:cond_newBattery[/COLOR][/B]

    .line 847
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "multi_window_enabled"

    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    if-ne v3, v1, :cond_de

    :goto_af
    invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

    .line 848
    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const-string v1, "multi_window_enabled"

    invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowModeObserver:Landroid/database/ContentObserver;

    invoke-virtual {v0, v1, v2, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V

    [B][COLOR="Blue"]:cond_newBattery
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatPref:Landroid/preference/CheckBoxPreference;

    if-eqz v0, [COLOR="Red"]:cond_c1[/COLOR]
	
    .line 3001
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "bat_sbar"

    const/4 v1, 0x0

    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    if-eqz v3, :cond_noShow

    const/4 v1, 0x1

    goto :goto_yesShow

    :cond_noShow
    const/4 v1, 0x0

    :goto_yesShow
    invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V[/COLOR][/B]

     line 850
    :cond_c1
    return-void

    :cond_c2
    move v0, v2
- Save all changes and compile and push to phone and prof working then continue to next step.



Setting The Referral Switch >>>
2) SystemUI.apk

- Baksmali SystemUI.apk.
- Go to classes/com/android/systemui/power/ folder and open PowerUI.smali.
- Search for this method ".method notifyFullBatteryNotification()V" and add the blue lines and delete or comment out the red line:
Code:
.method notifyFullBatteryNotification()V
    .registers 12

    .prologue
    const/4 v10, 0x0

    .line 827
    iget-object v7, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;

    const-string v8, "notification"

    invoke-virtual {v7, v8}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/app/NotificationManager;

    .line 829
    .local v2, "notificationManager":Landroid/app/NotificationManager;
    [B][COLOR="Blue"]move-object v0, p0
	
    iget-object v5, v0, Lcom/android/systemui/power/PowerUI;->mContext:Landroid/content/Context;

    invoke-virtual {v5}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v5

    const-string v6, "bat_sbar"

    const/4 v7, 0x1

    invoke-static {v5, v6, v7}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v5

    if-nez v5, :cond_15	
	
    [COLOR="Red"]#if-nez v2, :cond_15[/COLOR][/COLOR]  [COLOR="Green"]<!--- Put the same condition value in the above new condition[/COLOR][/B]

    .line 830
    const-string v7, "PowerUI"

    const-string v8, "notifyFullBatteryNotification : fail to get NotificationManager reference"

    invoke-static {v7, v8}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 860
    :goto_14
    return-void

    .line 834
    :cond_15
    iget-object v7, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
- Save changes and compile and push to phone...



Disable Low Battery Notification

- Baksmali SystemUI.apk.
- Go to classes/com/android/systemui/power/ folder and open PowerUI.smali.
- Search for this method ".method showLowBatteryWarning()V" and add the blue line:
Code:
.method showLowBatteryWarning()V
    .registers 20

    .prologue
    [B][COLOR="Blue"]return-void[/COLOR][/B]

    .line 433
    const-string v16, "PowerUI"
- Save changes.. smali.. push to device, fix permissions (644) and reboot


Remove cloudy overlay and improve ripple lockscreen - All Samsung Devices

This mod and guide credit goes to @Goldieking and @dazznuts2000..
It is already explained in very excellent and easy way,, so please go ahead to the main thread here and look to the tutorial and give him some thanks respect :good:


Disable Auto Scroll in Statusbar Quickpanel Toggle

This guide credits goes to @mr.harsh. Please go ahead to the main post here.


Settings menu extra hidden options

This one is explained very well by @tkari4 in this post here. Make sure to hit Thanks button for him if that made your day :eek:
 
Last edited:

majdinj

Senior Member
Nov 25, 2006
980
3,437
0
AlAhsa
Notification panel extra toggles - the original way (Airplane, Torch, AllShareCast)



In this tutorial, we will be working with 3 files; SystemUI.apk, SecSettings.apk and SecSettingsProvider.apk
First download the View attachment resources.rar file.

SystemUI.apk:

Here we will put all missing resources for Torch toggle (other resources for Airplane and AllShareCast are already exist).
- Decompile SystemUI.apk
- Go to res\drawable-xhdpi folder and add new image resources [tw_quick_panel_icon_flashlight_off.png] and [tw_quick_panel_icon_flashlight_on.png].
- Go to res\values folder and open strings.xml and add this line resource:
Code:
    <string name="quickpanel_flashlight_text">Torch</string>
- Now compile SystemUI.apk, then decompile the newly compiled SystemUI.apk again (this is to generate new ids from new resources in public.xml).
- In the new decompiled SystemUI.apk, go to res\values and open public.xml and locate these lines:
Code:
    <public type="string" name="quickpanel_flashlight_text" id="0x7f0a01b7" />
    <public type="drawable" name="tw_quick_panel_icon_flashlight_on" id="0x7f02033d" />
    <public type="drawable" name="tw_quick_panel_icon_flashlight_off" id="0x7f02033c" />
You might get different ids, just use what is in your public.xml..!!
- Leave public.xml opened
- Copy FlashlightQuickSettingButton.smali from resource file to smali\com\android\systemui\statusbar\policy\quicksetting folder
- Open FlashlightQuickSettingButton.smali and change the 3 ids that starts with 0x7f?????? with new ids generated in public.xml in the following orders:
Code:
.method public constructor <init>(Landroid/content/Context;)V
    .locals 9

    .prologue
    const/4 v6, 0x0

    .line 35
    const/4 v2, 0x0

    const v3, [B][COLOR="Red"]0x7f0a01b7[/COLOR]    [COLOR="Green"]<!-- id of quickpanel_flashlight_text[/COLOR][/B]

    const v4, [B][COLOR="Red"]0x7f02033d[/COLOR]    [COLOR="Green"]<!-- id of tw_quick_panel_icon_flashlight_on[/COLOR][/B]

    const v5, [B][COLOR="Red"]0x7f02033c[/COLOR]    [COLOR="Green"]<!-- id of tw_quick_panel_icon_flashlight_off[/COLOR][/B]

    move-object v0, p0
- Save changes.. and that's all for SystemUI.apk.. Compile.


SecSettings.apk:

We will also add the missing resources only..!!
- Decompile SecSettings.apk
- Go to res\drawable-xhdpi folder and add new image resources [notification_panel_airplane.png] and [notification_panel_flashlight.png]
- Go to res\values folder and add these line resources to strings.xml:
Code:
	<string name="notification_panel_airplane">Airplane Mode</string>
	<string name="notification_panel_flashlight">Torch</string>
- Go to smali\com\android\settings folder and open NotificationPanel.smali file.
- Search for the method ".method public MakeConvertPanelName()V" and add the blue lines (make sure to match all registers v and p according to your smali):
Code:
.method public MakeConvertPanelName()V
    .registers 4

    .prologue
    .line 119
    iget-object [B][COLOR="Red"]v0, p0[/COLOR][/B], Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;

    const-string [B][COLOR="Red"]v1[/COLOR][/B], "Wifi"

    const-string [B][COLOR="Red"]v2[/COLOR][/B], "notification_panel_wifi"

    invoke-virtual {[B][COLOR="Red"]v0, v1, v2[/COLOR][/B]}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

...
...

    .line 137
    iget-object [B][COLOR="Red"]v0, p0[/COLOR][/B], Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;

    const-string [B][COLOR="Red"]v1[/COLOR][/B], "Sync"

    const-string [B][COLOR="Red"]v2[/COLOR][/B], "notification_panel_sync"

    invoke-virtual {[B][COLOR="Red"]v0, v1, v2[/COLOR][/B]}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
	
   [B][COLOR="RoyalBlue"] # Airplane patch start
	
    iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;

    const-string v1, "AirplaneMode"

    const-string v2, "notification_panel_airplane"

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
	
    # End
	
    # Torch patch start
	
    iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;

    const-string v1, "Flashlight"

    const-string v2, "notification_panel_flashlight"

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
	
    # End[/COLOR][/B]

    .line 138
    iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;

    const-string v1, "Empty"

    const-string v2, "notification_panel_empty"

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 139
    iget-object [B][COLOR="Red"]v0, p0[/COLOR][/B], Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;

    const-string [B][COLOR="Red"]v1[/COLOR][/B], "notification_panel_wifi"

    const-string [B][COLOR="Red"]v2[/COLOR][/B], "Wifi"

    invoke-virtual {[B][COLOR="Red"]v0, v1, v2[/COLOR][/B]}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

...
...

    .line 157
    iget-object [B][COLOR="Red"]v0, p0[/COLOR][/B], Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;

    const-string [B][COLOR="Red"]v1[/COLOR][/B], "notification_panel_sync"

    const-string [B][COLOR="Red"]v2[/COLOR][/B], "Sync"

    invoke-virtual {[B][COLOR="Red"]v0, v1, v2[/COLOR][/B]}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
	
   [B][COLOR="RoyalBlue"] # Airplane patch start
	
    iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;

    const-string v1, "notification_panel_airplane"

    const-string v2, "AirplaneMode"

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
	
    # End
	
    # Torch patch start
	
    iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;

    const-string v1, "notification_panel_flashlight"

    const-string v2, "Flashlight"

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
	
    # End[/COLOR][/B]

    .line 158
    iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;

    const-string v1, "notification_panel_empty"

    const-string v2, "Empty"

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
- Go to smali\com\android\settings folder and open WirelessSettings.smali
- In the method ".method public onCreate(Landroid/os/Bundle;)V", locate this part and delete or comment out the red line:
Code:
    .line 525
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/android/settings/WirelessSettings;->mMediaShareCategory:Landroid/preference/PreferenceCategory;

    move-object/from16 v23, v0

    const-string v24, "allshare_cast_settings"

    move-object/from16 v0, p0

    move-object/from16 v1, v24

    invoke-virtual {v0, v1}, Lcom/android/settings/WirelessSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v24

    [B][COLOR="Red"]invoke-virtual/range {v23 .. v24}, Landroid/preference/PreferenceCategory;->removePreference(Landroid/preference/Preference;)Z[/COLOR][/B]
This will show AllShareCast tab in Settings -> More settings menu under Media share category but it will not functioned yet..!!
- Now we need to add smali resources for AllShareCast.. Go to res\values and open public.xml and keep it opened, we will use it later.
- Now copy the entire folder resource [wfd] in smali\com\android\settings\ folder
- Now the funny part begins, inside [wfd] folder, open WfdHelpActivity.smali, WfdPickerActivity.smali and WfdPickerDialog.smali and change all ids that start with 0x7f with ids in public.xml. To make this easy, I wrote a comment beside each id to which it must be referred to in public.xml, example:
Code:
const v3, 0x7f090392	[B][COLOR="Green"]#wifi_p2p_scan_title[/COLOR][/B]
In this example, you need to see what is the id in public.xml for wifi_p2p_scan_title and then put it instead of 0x7f090392
- Save changes and compile.
- Now open the new compiled SecSettings.apk by WinRAR or 7-zip and go to res folder and drop out the raw folder in your computer then drop it back and set compression method to STORE.. see picture



and that's all for SecSettings.apk.


SecSettingsProvider.apk:

- Decompile SecSettingsProvider.apk
- Go to res\values and open strings.xml and add this new database to this string id (the blue):
Code:
<string name="def_candidate_notification_list_q1">DrivingMode;SmartStay;[B][COLOR="RoyalBlue"]AirplaneMode;Flashlight;AllShareCast;[/COLOR][/B]</string>
- That's all for SecSettingsProvider.apk,,


Finally, push all 3 modified apks and Torch.apk from resource file to your phone,, fix permissions (644) and reboot. After booting complete, open titanium backup --> manipulate data --> wipe data for user & system app --> delete the data of settings storage, then reboot for the new database in settings.db to load.
If you don't have titanium backup, then you need to do full data wipe.!!

Thanks to:
@shoman94 and @jeboo who introduce this mod first.
@tkari4 for doing most of AllShareCast porting from Note 2
@Goldie: for his idea of using titanium backup instead of full wipe to load the new database and for his valuable advices.
 
Last edited:

danivancouver

Senior Member
Nov 10, 2010
611
617
0
hello, another line to other .
Camera shutter sound

<CscFeature_Camera_ShutterSoundMenu>true</CscFeature_Camera_ShutterSoundMenu>



Enviado desde mi GT-N7000 usando Tapatalk 2
 
  • Like
Reactions: majdinj

majdinj

Senior Member
Nov 25, 2006
980
3,437
0
AlAhsa
hello, another line to other .
Camera shutter sound

<CscFeature_Camera_ShutterSoundMenu>true</CscFeature_Camera_ShutterSoundMenu>
I saw this csc but never test it since my SamsungCamers.apk is hard coded to do so through smali. If your SamsungCamers.apk is stock (not modded), then I will post it and give you credits.