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

Search This thread

ekache

Senior Member
Jan 30, 2009
343
15
44
Jakarta
This is what I'm looking for...great tutorials from a great one who has a kind to share.
Thanks in advance, dear majdinj.

Hope there will be a Rotating TouchWiz tutorial Mod, if it possible.
 
Last edited:

mac231us

Senior Member
Oct 26, 2010
2,434
519
MORE I LOOK AT THIS THREAD...BEST THREAD IN RECENT TIMES..Asides from ROMs

AWESOME ! THANKS most useful general purpose thread I have seen (than repositories etc)...just what I wanted ! THANKS THANKS THANKS !

---------- Post added at 02:41 PM ---------- Previous post was at 02:39 PM ----------

You do not even have a donate to me button unlike some who post other people's work and then say don't donate but will take them anyway...you gave modding details which I so much appreciate ! how do I donate?

You need 8000+ thanks..!
 
Last edited:

mjrifath

Senior Member
May 13, 2012
1,810
956
Colombo
Many thanks for you effort and time giving.

Any idea of removing Message Log from Call Log history..

:laugh:
 

Kamy

Senior Member
Aug 29, 2012
5,335
19,307
Beijing
Thanks. You are the first one providing a comprehensive theme moding tutorials.

Sent from my GT-N7000 using xda app-developers app
 

DefaultBR

Senior Member
Dec 15, 2008
95
4
Im not a dev...but every time i flash a rom i mentaly ask how they do this....thxxx the answers... =) nice job brow

Sent from my GT-N7000 using xda app-developers app
 

rraaka

Senior Member
Sep 8, 2010
2,608
671
cooking and themeing is best left to men coz they do it best

but

im gonna try the battery themeing ......promise :)

airview is easy

keeping a back up of all the info

thanks
 

sarf2k4

Senior Member
Apr 3, 2012
416
78
Samsung Galaxy Note 10+
The guide for 4 way reboot method is what ive been looking for, the 4 way reboot method is to make another reboot selection method appear right?

Good and very simple guide to follow:)

Sent from my GT-N7000 using xda app-developers app
 

Dryblow

Senior Member
Oct 31, 2011
268
35
Agrigento
For compiling Framework-res.apk i select option "11 compile system APK files" or none apk file?

Sorry for my bad english...

Edit: i have problem for compile framework-res.apk, not work on my rom..
 
Last edited:

majdinj

Senior Member
Nov 25, 2006
980
3,442
AlAhsa
For compiling Framewor-res.apk i select option "11 compile system APK files" or none apk file?

Sorry for my bad english...
Each system app should be compiled as system app to retain signature..
So yes (option 11) compile system APK files..
Remember framework-res.apk is essential program in your phone, so set compression level to 0 (in general low compression level but 0 will sure work!!) before compiling.
 
  • Like
Reactions: Naney

Dryblow

Senior Member
Oct 31, 2011
268
35
Agrigento
Each system app should be compiled as system app to retain signature..
So yes (option 11) compile system APK files..
Remember framework-res.apk is essential program in your phone, so set compression level to 0 (in general low compression level but 0 will sure work!!) before compiling.

I compliled with option 11 but not work..(dimension of framework after is less)

frameworkexperimental.png
 
Last edited:

Coder-R

Senior Member
Feb 2, 2012
73
4
Glasvegas ;)
Absolutely amazing! Soo much knowledge :)

I was wondering if you knew how to change DPI values the for the dialler etc? That is something im trying to figure out and not rely on others to release zips:D

Thanks again!

Sent from my GT-N7000 using Tapatalk 2
 

REVERSiN

Senior Member
Mar 4, 2012
834
395
I compliled with option 11 but not work..(dimension of framework after is less)

frameworkexperimental.png

If its not heavily moded try replacing resource.rc and classes.dex inside original with the ones in build folder....

You can use 7zip i personally use it and it fine...

Sent from my GT-N7000 using Tapatalk 2
 
  • Like
Reactions: majdinj

Top Liked Posts

  • There are no posts matching your filters.
  • 206
    Hello buddies..
    From the concept SHARING IS CARING, I am going to share with you how to hack your GT-N7000 JellyBean system apps.
    Keep in mind that there are different modding hacks that I couldn't figure out how it is done until now. So please let me know if you have any modding that I didn't mentione :D
    So let's start!!

    Needed tools:
    1) APK-Multi tool. You can use my repacked one (Nov 2012) from here.
    2) Backsmali/Smali Manager from here
    3) Notepad++ program from here
    4) Willing of learning and some patience and cold nerves!

    • I am not going to teach you how to use these programs because I am assuming that you already know how to use them!
    • You must deodex your app before proceeding.
    • A lot of works are done by various xda members, some are from other sites, some are mine. If you found the guide of your mod here and you haven't been credited, please PM.


    TABLE OF CONTENTS
    Code:
    +----------------------------------------------------------------------------+
    | Post #[URL="http://xdaforums.com/showpost.php?p=35229966&postcount=2"]2[/URL]                                                                    |
    +----------------------------------------------------------------------------+
    |                                                                            |
    | - 4-way Reboot Menu                                                        |
    | - Call record enabling + Disabling ascending ringtone                      |
    | - Smart Rotation enabling                                                  |
    | - SMS hacks: displaying sent Time instead of the received time             |
    | - Unlimited Multiwindow apps                                               |
    | - Home screen wallpaper scrolling                                          |
    | - Changing number of icons in home screen and apps drawer (dpi modding)    |
    | - Camera & Camcorder hacks: Adding "Shutter Sound On/Off" in menu, flash   |
    |   can be used in low battery, hard keys as shutter, increasing camcorder   |
    |   quality..etc                                                             |
    |                                                                            |
    +----------------------------------------------------------------------------+
    | Post #[URL="http://xdaforums.com/showpost.php?p=35229966&postcount=3"]3[/URL]                                                                    |
    +----------------------------------------------------------------------------+
    |                                                                            |
    | - Change default home screen wallpaper and default lock screen wallpaper   |
    | - Battery theming                                                          |
    | - 4 Lockscreen shortcuts enabling                                          |
    | - Toggle to choose AOSP lock screen                                        |
    | - Fixing home button lag                                                   |
    | - Permanent disabling of SMS, MMS & Email log history to be logged in call |
    |   logs                                                                     |
    | - Disabling scrolling cache across OS                                      |
    | - Center clock in status bar                                               |
    |                                                                            |
    +----------------------------------------------------------------------------+
    | Post #[URL="http://xdaforums.com/showpost.php?p=47555368&postcount=4"]4[/URL]                                                                    |
    +----------------------------------------------------------------------------+
    |                                                                            |                                                                            |
    | - SMS hack: SMS 200 recipients, stop SMS to MMS auto-converting, increase  |
    |   SMS hour limit, 1000 slides, group messages, scheduled messages and save |
    |   restore messages                                                         |
    | - 23 toggles notification panel (Lidroid way)                              |
    | - Notification panel lock screen and recent apps                           |
    |                                                                            |
    +----------------------------------------------------------------------------+
    | Post #[URL="http://xdaforums.com/showpost.php?p=47555418&postcount=5"]5[/URL]                                                                    |
    +----------------------------------------------------------------------------+
    |                                                                            |
    | - Extended Power Menu Addons (ScreenShot, Recovery, Download and safe      |
    |   modes) + Toggle Switch On or Off                                         |
    |                                                                            |
    +----------------------------------------------------------------------------+
    | Post #[URL="http://xdaforums.com/showpost.php?p=47555459&postcount=6"]6[/URL]                                                                    |
    +----------------------------------------------------------------------------+
    |                                                                            |
    | - LockScreen Torch                                                         |
    | - Long press menu button to kill app                                       |
    | - Adjust timeout delay across OS                                           |
    |                                                                            |
    +----------------------------------------------------------------------------+
    | Post #[URL="http://xdaforums.com/showpost.php?p=47555227&postcount=7"]7[/URL]                                                                    |
    +----------------------------------------------------------------------------+
    |                                                                            |
    | - Browser Edge Zoom Enabling                                               |
    | - Airview Enabling + Control Panel + S Pen Gesture                         |
    | - Adding Extra About Info to Your ROM to Suit Your Ego                     |
    | - Enable TW Launcher Rotation                                              |
    | - Enable LockScreen Rotation                                               |
    |                                                                            |
    +----------------------------------------------------------------------------+
    | Post #[URL="http://xdaforums.com/showpost.php?p=47555493&postcount=8"]8[/URL]                                                                    |
    +----------------------------------------------------------------------------+
    |                                                                            |
    | - Ink effect enabling                                                      |
    | - Integrating application in settings menu                                 |
    |                                                                            |
    +----------------------------------------------------------------------------+
    | Post #[URL="http://xdaforums.com/showpost.php?p=47555274&postcount=9"]9[/URL]                                                                    |
    +----------------------------------------------------------------------------+
    |                                                                            |
    | - Framed Recent app windows                                                |
    | - Volume Rocker to Skip Sound Track                                        |
    | - CRT TV off effect                                                        |
    | - Permanent Disable of Ongoing Notifications                               |
    | - Remove Mobile Data Toggle off Warning Dialogue                           |
    |                                                                            |
    +----------------------------------------------------------------------------+
    | Post #[URL="http://xdaforums.com/showpost.php?p=47555301&postcount=10"]10[/URL]                                                                   |
    +----------------------------------------------------------------------------+
    |                                                                            |
    | - Control The Full Battery Notification With Toggle Switch On or Off       |
    | - Disable Low Battery Notification                                         |
    | - Remove cloudy overlay and improve ripple lockscreen                      |
    | - Disable Auto Scroll in Statusbar quickpanel toggle                       |
    | - Settings menu extra hidden options                                       |
    |                                                                            |
    +----------------------------------------------------------------------------+
    | Post #[URL="http://xdaforums.com/showpost.php?p=47555600&postcount=11"]11[/URL]                                                                   |
    +----------------------------------------------------------------------------+
    |                                                                            |
    | - Notification panel extra toggles - the original way (Airplane, Torch,    |
    |   and AllShareCast)                                                        |
    | - Create CSC features controller tab in settings menu                      |
    | - Disable TW UI and enable AOSP UI                                         |
    |                                                                            |
    +----------------------------------------------------------------------------+
    | Post #[URL="http://xdaforums.com/showpost.php?p=47555787&postcount=16"]16[/URL] CSC FEATURES                                                      |
    +----------------------------------------------------------------------------+
    |                                                                            |
    | - Adding Call Button to Contacts and Logs                                  |
    | - Call and message block                                                   |
    | - Factory data reset password                                              |
    | - About device extra and hiding displays                                   |
    | - Enabling Folder view in message app                                      |
    | - Enabling Callback number in message app                                  |
    | - Disable Page Rotation in TW Launcher                                     |
    | - Disable Tilt Effect in TW Launcher                                       |
    | - Enable Home Screen Edit Mode in TW Launcher                              |
    | - Change Day Color in SPlanner widget                                      |
    | - Adding Exit button in default web browser                                |
    | - Adding Home button in default web browser                                |
    | - Adding Version info in default web browser                               |
    | - Desktop view by default in default web browser                           |
    | - Enable prompt to exit in default web browser                             |
    | - Enable Camera Shutter Sound menu                                         |
    |                                                                            |
    +----------------------------------------------------------------------------+
    | Post #[URL="http://xdaforums.com/showpost.php?p=47555546&postcount=17"]17[/URL] CSC FEATURES                                                      |
    +----------------------------------------------------------------------------+
    |                                                                            |
    |                                                                            |
    +----------------------------------------------------------------------------+

    .
    111
    Continue moddings!!

    Change default home screen wallpaper and default lock screen wallpaper

    Remember to set compression level to 0 in APK-Multi tool before proceeding in these steps

    1. Decompile framework-res.apk using APK-Multi tool
    2. Go to \res\drawable-xhdpi folder and change the following pics to what you want:

    • default_wallpaper (Home screen wallpaper)
    • keyguard_default_wallpaper (Lock screen wallpaper)
    3. Make sure to rename your wallpaper to the exact name as the one that you will change
    4. Compile framework-res.apk and push it to your phone.

    Here are some pics taken from SGN2: download


    Battery theming

    First download my battery icon packs from here and use it as a resource (of course you can create your own!!).
    1. Decompile SystemUI.apk with APK-Multi tool.
    2. In Battery icon pack folder choose your desired battery theme and copy all png icons ONLY.
    3. Go to \res\drawable-xhdpi folder and paste your icons there.
    4. Now go back to Battery icon pack folder and in your desired battery theme folder, copy the two xml files (stat_sys_battery.xml and stat_sys_battery_charge.xml).
    5. Go to \res\drawable folder and paste them there and accept changes.
    These xml files are encoded with a code that make battery discharging and charging animation; so if you got enough png icons, you can create your own lines in these xml files for better animation effects
    6. Recompile and push it to your phone.


    4 Lockscreen shortcuts enabling

    1- Decompile SecSettings.apk and go to smali/com/android/settings/lockscreenshortcut/LockScreenShortcutSettings.smali
    2- Open this file with notpad++ and change the following line:
    Code:
    # direct methods
    .method static constructor <clinit>()V
        .locals 2
    
        .prologue
        const/4 v1, 0x0
    
        .line 79
        [COLOR="Red"][B]const/4 v0, 0x4[/B][/COLOR]
    
        sput v0, Lcom/android/settings/lockscreenshortcut/LockScreenShortcutSettings;->MAX_SHORTCUT_ICON:I
    to:
    Code:
    # direct methods
    .method static constructor <clinit>()V
        .locals 2
    
        .prologue
        const/4 v1, 0x0
    
        .line 79
        [B][COLOR="Blue"]const/4 v0, 0x3[/COLOR][/B]
    
        sput v0, Lcom/android/settings/lockscreenshortcut/LockScreenShortcutSettings;->MAX_SHORTCUT_ICON:I
    3- Save changes
    4- (The following step is provided by tkari4; thanks man) For some region this feature is disabled like Germany :( ; So navigate to smali/com/android/settings folder and open LockscreenMenuSettings.smali and search for "ro.csc.country_code" and change the following (red to blue):
    Code:
        if-nez v4, :cond_5
    
        const-string v4, "[B][COLOR="Red"]Germany[/COLOR][/B]"
    
        const-string v7, "ro.csc.country_code"
    
        invoke-static {v7}, Landroid/os/SystemProperties;->get(Ljava/lang/String;)Ljava/lang/String;
    to:
    Code:
        if-nez v4, :cond_5
    
        const-string v4, "[B][COLOR="Blue"]none[/COLOR][/B]"
    
        const-string v7, "ro.csc.country_code"
    
        invoke-static {v7}, Landroid/os/SystemProperties;->get(Ljava/lang/String;)Ljava/lang/String;
    3- Save file and recompile and push to your phone.

    Results example:

    screenshot2012113002043.png


    Toggle to choose AOSP lock screen

    This method is originally done by Mirko_ddd, so please go to his thread and thank him
    We need to do our changes to two files; android.policy.jar and SecSettings.apk

    A. android.policy.jar:

    1. Decompile (backsmali) android.policy.jar
    2. Go to classout\com\android\internal\policy\impl and open LockPatternKeyguardView.smali
    3. Search for ".method createLockScreen()Landroid/view/View;" and the following lines (the blue ones):
    Code:
    .method createLockScreen()Landroid/view/View;
        .registers 7
    
        .prologue
        .line 1351
        [B][COLOR="Blue"]iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
    
        invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
    
        move-result-object v0
    
        const-string v1, "aosp_lock"
    
        const/4 v2, 0x0
    
        invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
    
        move-result v0
    
        if-nez v0, :cond_majdi[/COLOR][/B]
    	
        new-instance v0, Lcom/android/internal/policy/impl/sec/CircleLockScreen;
    
        iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
    
        iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;
    
        iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
    
        iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
    
        iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
    
        invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/sec/CircleLockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V
    
        [B][COLOR="Blue"]goto :goto_yes[/COLOR][/B]
    	
        .line 1357
        [B][COLOR="Blue"]:cond_majdi
        new-instance v0, Lcom/android/internal/policy/impl/LockScreen;
    
        iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
    
        iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;
    
        iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
    
        iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
    
        iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
    
        invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/LockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V[/COLOR][/B]
    
        .local v0, lockView:Landroid/view/View;
        [B][COLOR="Blue"]:goto_yes[/COLOR][/B]
        invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->initializeTransportControlView(Landroid/view/View;)V
    
        .line 1358
        return-object v0
    .end method
    4. Save changes and compile (smali) your classout folder

    B. SecSettings.apk:
    1. Decompile SecSettings.apk by APK-Multi-tool
    2. Go to /smali/com/android/settings/ folder and open LockscreenSettings.smali
    3. As Mirko_ddd did we will use an unused code with the form of (checkbox preference). Here it is "mSayCommand"
    4. Since this unused code is actually hidden, so we need to un-hide it first. Search for the following lines and delete them (the red lines only):
    Code:
        if-ge v9, v10, :cond_15
    
        iget-object v9, p0, Lcom/android/settings/LockScreenSettings;-> mSayCommand:Landroid/preference/CheckBoxPreference;
    
        if-eqz v9, :cond_11
    
        [B][COLOR="Red"]invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
    
        move-result-object v9
    
        iget-object v10, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;
    
        invoke-virtual {v9, v10}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z[/COLOR][/B]
    
        :cond_11
        if-eqz v7, :cond_12
    5. Now search and replace all "mSayCommand" with "mAospLock" also search and replace all "wake_up_lock_screen" with "aosp_lock"
    6. Search for "say_your_wakeup" and replace it with "majdi_aosp_lock"
    7. Save changes and exit.
    8. Go to res\values folder and open strings.xml file and add the following strings at the end before </resource>:
    Code:
        <string name="aosp_lock_screen">AOSP Lockscreen</string>
        <string name="aosp_lock_screen_description">Original Jelly Bean Lockscreen</string>
    9. Go to res\xml folder and open lockscreen_settings.xml file and add the following line at the end before </PreferenceScreen> (actually you can put it in a place that you want this mod to be shown in lock screen option menu later on):
    Code:
    <CheckBoxPreference android:title="@string/aosp_lock_screen" android:key="majdi_aosp_lock" android:summary="@string/aosp_lock_screen_description" />
    10. Save all changes and recompile. Push the modified files to your phone.

    Results example:
    screenshot2012122121013.png
    screenshot2012122121014.png

    unnamedcl.jpg



    Fixing home button lag

    This method is originally done by Mirko_ddd, so please go to his thread and thank him
    1. Backsmali android.policy.jar
    2. G to classout\com\android\internal\policy\impl folder and open PhoneWindowManager.smali
    3. Search for ".method public interceptKeyBeforeDispatching" then search for "#statusbar:Lcom/android/internal/statusbar/IStatusBarService;" and go down for the line that has the following iput-boolean … with mHomePressed:Z field and add the following line bellow it (the blue one):
    Code:
        .line 3364
        .end local v38           #statusbar:Lcom/android/internal/statusbar/IStatusBarService;
        :cond_38c
        :goto_38c
        const/16 v46, 0x0
    
        move/from16 v0, v46
    
        move-object/from16 v1, p0
    
        [B][COLOR="Red"]iput-boolean[/COLOR][/B] v0, v1, Lcom/android/internal/policy/impl/PhoneWindowManager;->[B][COLOR="Red"]mHomePressed:Z[/COLOR][/B]
    	
        [B][COLOR="Blue"]invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->goHome()Z[/COLOR][/B]
    4. save changes and recompile (smali) the classout folder.


    Permanent disabling of SMS, MMS & Email log history to be logged in call logs

    1. Backsmali SecMms.apk.
    2. Go to classout\com\android\mms\transaction folder and open MessagingNotification.smali file.
    3. Now what you need to do is to search for any line that contains the following command "Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;", there might be 3 or 4 lines, and delete them all.
    Example (delete the whole red line):
    Code:
        invoke-static {v6}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
    
        move-result-object v6
    
        [COLOR="Red"]invoke-virtual {v5, v6, v7}, [B]Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;[/B][/COLOR]
    
        .line 1348
        add-int/lit8 p2, p2, 0x1
    4. save changes and recompile (smali) the classout folder.


    Disabling scrolling cache across OS

    1. Backsmali framework2.jar.
    2. Navigate to classout\android\widget folder and open AbsListView.smali
    3. Search for ".method private createScrollingCache()V" and change:
    Code:
    const/4 v1, 0x[B][COLOR="Red"]1[/COLOR][/B]
    to:
    Code:
    const/4 v1, 0x[B][COLOR="Blue"]0[/COLOR][/B]
    4. Search for ".method public setScrollingCacheEnabled(Z)V" and change:
    Code:
    .parameter "[B][COLOR="Red"]enabled[/COLOR][/B]"
    to:
    Code:
    .parameter "[B][COLOR="Blue"]disabled[/COLOR][/B]"
    5. Save changes and recompile (smali) your file and push to your phone.


    Center clock in status bar

    This mod was done by raubkatze and all credits go to him.
    1. Decompile SystemUI.apk by Apk-Multi tool
    2. Navigate to /res/layout/ folder and open tw_status_bar.xml
    3. Delete all these lines:
    Code:
        <LinearLayout android:orientation="horizontal" android:id="@id/icons" android:paddingLeft="0.0dip" android:paddingRight="2.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
            <LinearLayout android:orientation="horizontal" android:id="@id/left_icons" android:paddingLeft="4.0dip" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
                <TextView android:textSize="15.0dip" android:gravity="center_vertical" android:id="@id/carrierLabel" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
                <ImageView android:id="@id/operatorLogoIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo" />
                <ImageView android:id="@id/doNotDisturbIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/tw_dnd" android:alpha="0.7" android:scaleX="0.85" android:scaleY="0.85" />
                <com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/stat_notify_more" />
                <com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentLeft="true" />
            </LinearLayout>
            <LinearLayout android:orientation="horizontal" android:id="@id/right_icons" android:paddingRight="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true">
                <LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" />
                <LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent">
                    <include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/tw_signal_cluster_view" />
                    <TextView android:textSize="12.0dip" android:textColor="#ffa6a6a6" android:layout_gravity="center" android:id="@id/battery_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_network_name_separator" />
                    <ImageView android:gravity="center" android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="wrap_content" />
                </LinearLayout>
                <com.android.systemui.statusbar.policy.Clock android:textSize="@dimen/status_bar_clock_text_size" android:textColor="#ff959595" android:ellipsize="none" android:gravity="left|center" android:id="@id/clock" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:includeFontPadding="false" />
            </LinearLayout>
    and substitute with the following:
    Code:
        <LinearLayout android:orientation="horizontal" android:id="@id/icons" android:paddingLeft="1.0dip" android:paddingRight="1.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">
            <LinearLayout android:orientation="horizontal" android:id="@id/left_icons" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
                <TextView android:textSize="15.0dip" android:gravity="center_vertical" android:id="@id/carrierLabel" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
                <ImageView android:id="@id/operatorLogoIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo" />
                <ImageView android:id="@id/doNotDisturbIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/tw_dnd" android:alpha="0.7" android:scaleX="0.85" android:scaleY="0.85" />
                <com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/stat_notify_more" />
                <com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentLeft="true" />
            </LinearLayout>
            <LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent">
                <com.android.systemui.statusbar.policy.Clock android:textSize="@dimen/status_bar_clock_text_size" android:textColor="#[B][COLOR="Red"]ffffffff[/COLOR][/B]" android:gravity="center" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
            </LinearLayout>
            <LinearLayout android:gravity="right|center" android:orientation="horizontal" android:id="@id/right_icons" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:layout_alignParentRight="true">
                <LinearLayout android:gravity="right|center" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" />
                <LinearLayout android:gravity="right|center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent">
                    <include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/tw_signal_cluster_view" />
                    <TextView android:textSize="12.0dip" android:textColor="#ffa6a6a6" android:layout_gravity="center" android:id="@id/battery_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_network_name_separator" />
                    <ImageView android:gravity="center" android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="wrap_content" />
                </LinearLayout>
            </LinearLayout>
    	</LinearLayout>
    4. Save changes, recompile and push to your phone
    N.B: you can put any hex color code for clock text color instead #ffffff above there
    Results:
    8tyil.png

    34
    Continue moddings!!

    Extended Power Menu Addons (ScreenShot, Recovery, Download & Safe modes)

    In this tutorial, we will modify 2 files; the framework-res.apk file and android.policy.jar file...
    Here for the sake of tutorial, I will refer to ScreenShot resources by blue color lines, Recovery resources by green lines, download resources by orange lines and safe resources by pink lines.. Please download these resources first.
    Smali resources credits to Robbie Hood for Screen Capture, tdunham for Download and Recovery smalis, and of course me for Safe mode smali.

    A) framework-res.apk
    1. Decompile framework-res.apk by APK-Multi Tool
    2. Add your desired resources image to res\drawable-xhdpi folder, here they are [tw_ic_lock_screenshot.png], [tw_ic_lock_recovery.png], [tw_ic_lock_download.png] and [tw_ic_lock_safemode.png].
    3. Go to res\values folder and open strings.xml file and add the following lines at the end before </resources>:
    Code:
    [COLOR="Blue"]    <string name="global_action_screenshot_txt">Take screenshot</string>[/COLOR]
    [COLOR="Green"]    <string name="global_action_recovery_txt">Recovery Mode</string>[/COLOR]
    [COLOR="DarkOrange"]    <string name="global_action_download_txt">Download mode</string>[/COLOR]
        [COLOR="Magenta"]<string name="global_action_safemode_txt">Reboot to safe mode</string>[/COLOR]
    4. Now recompile your framework-res.apk THEN decompile it again; so we can have new generated ids in public.xml file in res\values folder.
    5. In your new decompiled framework-res.apk, go to res\values folder and open public.xml file and locate the following lines for the added new image resources:
    Code:
        [COLOR="Blue"]<public type="drawable" name="tw_ic_lock_screenshot" id="0x01080a98" />[/COLOR]
        [COLOR="Green"]<public type="drawable" name="tw_ic_lock_recovery" id="0x01080a9a" />[/COLOR]
        [COLOR="DarkOrange"]<public type="drawable" name="tw_ic_lock_download" id="0x01080a99" />[/COLOR]
        [COLOR="Magenta"]<public type="drawable" name="tw_ic_lock_safemode" id="0x01080a98" />[/COLOR]
    and the following lines for the added new strings resources:
    Code:
        [COLOR="Blue"]<public type="string" name="global_action_screenshot_txt" id="0x01040784" />[/COLOR]
        [COLOR="Green"]<public type="string" name="global_action_recovery_txt" id="0x01040785" />[/COLOR]
        [COLOR="DarkOrange"]<public type="string" name="global_action_download_txt" id="0x01040786" />[/COLOR]
        [COLOR="Magenta"]<public type="string" name="global_action_safemode_txt" id="0x01040785" />[/COLOR]
    N.B: You might have different id values, but don't worry it will be the same principle!!
    6. Leave public.xml file opened and go to the next step..

    B) android.policy.jar
    1. Backsmali android.policy.jar
    2. Navigate to classout\com\android\internal\policy\impl folder and open GlobalActions.smali.
    3. In the [# instance fields] section, add these new lines:
    Code:
    [COLOR="Blue"].field private mScreenCapture:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    [/COLOR]
    [COLOR="Green"].field private mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR]
    
    [COLOR="DarkOrange"].field private mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR]
    
    [COLOR="Magenta"].field private mSafeMode:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR]
    4. Search for "[Lcom/android/internal/policy/impl/GlobalActions$Action;" for power menu arrays and increase the number of arrays (the line above it) to accommodate the total number of new arrays..
    Code:
        .line 418
        const/4 v1, 0x[B][COLOR="Purple"]5     <!--- You need to increase the arrays number here[/COLOR][/B]
    
        new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
    Keep in mind that the maximum arrays that are allowed in Power Menu are only 7 arrays (i.e, since it is 0x5 here, we could only increase it to 0x7 but for the sake of tutorial we will put it 0x9)
    So the line will be:
    Code:
        .line 418
        const/4 v1, 0x[B][COLOR="Purple"]9[/COLOR][/B]
    
        new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
    5. Now we will put listener actions for these added arrays.. so above the newly modified "const/4 v1, 0x9" add these action lines:
    Code:
        new-instance [COLOR="Red"]v1[/COLOR], Lcom/android/internal/policy/impl/GlobalActions$99;
    
        const [COLOR="Red"]v2[/COLOR], 0x10808ad
    
        const [COLOR="Red"]v3[/COLOR], 0x1040193
    
        move-object/from16 [COLOR="Red"]v0, p0[/COLOR]
    
        invoke-direct {[COLOR="Red"]v1, v0, v2, v3[/COLOR]}, Lcom/android/internal/policy/impl/GlobalActions$99;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
        move-object/from16 [COLOR="Red"]v0, p0[/COLOR]
    
        iput-object [COLOR="Red"]v1, v0[/COLOR], Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        .line 416
        invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/GlobalActions;->onAirplaneModeChanged()V
    
        [COLOR="Blue"]new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$ScreenCap;
    
        const v2, 0x1080a98
    
        const v3, 0x1040784
    
        move-object/from16 v0, p0
    
        invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$ScreenCap;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
        move-object/from16 v0, p0
    
        iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenCapture:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR]
    	
    [COLOR="Green"]    new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$Recovery;
    
        const v2, 0x1080a9a
    
        const v3, 0x1040785
    
        move-object/from16 v0, p0
    
        invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$Recovery;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
        move-object/from16 v0, p0
    
        iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    [/COLOR]
    [COLOR="DarkOrange"]    new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$Download;
    
        const v2, 0x1080a99
    
        const v3, 0x1040786
    
        move-object/from16 v0, p0
    
        invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$Download;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
        move-object/from16 v0, p0
    
        iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR]
    
        [COLOR="Magenta"]new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$SafeMode;
    
        const v2, 0x1080a98
    
        const v3, 0x1040785
    
        move-object/from16 v0, p0
    
        invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$SafeMode;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
        move-object/from16 v0, p0
    
        iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mSafeMode:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR]
    
        .line 418
        const/4 v1, 0x9
    As you can see here, the ids for each action are obtained from public.xml file from framework-res.apk. The first id in each action will represent the image resource and the second id will represent the string resource... See public.xml lines above and you will figure it out ;)..
    - Don't forget that, to link ids from framework-res.apk, you should omit the starting 0 value (example 0x01080a98 will be 0x1080a98)
    - Also pay attention to variables and parameters registers, it should be matched (the red v and p)
    6. Now we need to add new arrays to show in Power Menu.. So bellow modified "const/4 v1, 0x9" add new arrays to show after the last array:
    Code:
        .line 418
        const/4 v1, 0x9
    
        new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
    
        const/4 v2, 0x0
    
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAccessiblityShortcut:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2
    ...
    ...
    ...
        const/4 [COLOR="Red"]v2[/COLOR], 0x4
    
        move-object/from16 [COLOR="Red"]v0, p0[/COLOR]
    
        iget-object [COLOR="Red"]v3, v0[/COLOR], Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object [COLOR="Red"]v3, v1, v2[/COLOR]
    
    [COLOR="Blue"]    const/4 v2, 0x5
    	
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenCapture:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2[/COLOR]
    
    [COLOR="Green"]    const/4 v2, 0x6
    	
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2[/COLOR]
    
    [COLOR="DarkOrange"]    const/4 v2, 0x7
    	
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2[/COLOR]
    
        [COLOR="Magenta"]const/4 v2, 0x8
    
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mSafeMode:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2[/COLOR]
    - Again, don't forget that the maximum allowed arrays to show are only 7 arrays starting from 0x0 to 0x6; but we put here to 0x8 for the sake of tutorial.
    - Also pay attention to variables and parameters registers, it should be matched (the red v and p)
    7. Now save changes and exit.
    8. Copy smali resources for ScreenShot, Recovery, Download and Safe modes into classout\com\android\internal\policy\impl folder
    You need to open GlobalActions$ScreenCap$1.smali, GlobalActions$Download.smali, GlobalActions$Recovery.smali and GlobalActions$SafeMode.smali and look for this line:
    Code:
        invoke-static {v2}, Lcom/android/internal/policy/impl/GlobalActions;->access$[B][COLOR="Red"]200[/COLOR][/B](Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
    Here access$200 might differ according to ROM, you need to open GlobalActions.smali and search for "(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;" to locate the exact access$xxx
    Example in my GlobalActions.smali, the access$xxx is:
    Code:
    .method static synthetic access$[B][COLOR="Red"]200[/COLOR][/B](Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
        .locals 1
        .parameter "x0"
    
        .prologue
        .line 111
        iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
    
        return-object v0
    .end method
    9. Smali (recompile) the finished android.policy.jar

    Now push the modified framework-res.apk and android.policy.jar to your phone.. This will be enough for new Power Menu recovery, download and safe modes addons but not for ScreenShot!! You need to push extra file to bin folder in your phone which is screenshot and fix permissions to rwsr-xr-x that is 04755 in updater-script language.

    Results example:

    egrq.png


    Extra Step: Adding Setting Toggle For Power Menu Addons >>>
    I will assume you already add Safe Mode and Screenshot extra power menu addons..
    1) android.policy.jar:

    - Baksmali android.policy.jar
    - Go to classout\com\android\internal\policy\impl folder
    - Open GlobalActions$SafeMode.smali and change the method ".method public showConditional()Z" to:
    Code:
    .method public showConditional()Z
        .registers 5
    
        const/4 v0, 0x1
    
        const/4 v1, 0x0
    
        iget-object v2, p0, Lcom/android/internal/policy/impl/[B][COLOR="Blue"]GlobalActions$SafeMode[/COLOR][/B];->this$0:Lcom/android/internal/policy/impl/GlobalActions;
    
        # getter for: Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
        invoke-static {v2}, Lcom/android/internal/policy/impl/GlobalActions;->access$200(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
    
        move-result-object v2
    
        invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
    
        move-result-object v2
    
        const-string v3, [B][COLOR="Blue"]"pm_safe_mode"[/COLOR][/B]
    
        invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
    
        move-result v2
    
        if-ne v2, v0, :cond_15
    
        :goto_14
        return v0
    
        :cond_15
        move v0, v1
    
        goto :goto_14
    .end method
    
    .method public showDuringKeyguard()Z
        .registers 2
    
        .prologue
        .line 389
        const/4 v0, 0x1
    
        return v0
    .end method
    - Also, open GlobalActions$ScreenCap.smali and change the method ".method public showConditional()Z" to:
    Code:
    .method public showConditional()Z
        .registers 5
    
        const/4 v0, 0x1
    
        const/4 v1, 0x0
    
        iget-object v2, p0, Lcom/android/internal/policy/impl/[B][COLOR="Blue"]GlobalActions$ScreenCap[/COLOR][/B];->this$0:Lcom/android/internal/policy/impl/GlobalActions;
    
        # getter for: Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
        invoke-static {v2}, Lcom/android/internal/policy/impl/GlobalActions;->access$200(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
    
        move-result-object v2
    
        invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
    
        move-result-object v2
    
        const-string v3, [B][COLOR="Blue"]"pm_screenshot"[/COLOR][/B]
    
        invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
    
        move-result v2
    
        if-ne v2, v0, :cond_15
    
        :goto_14
        return v0
    
        :cond_15
        move v0, v1
    
        goto :goto_14
    .end method
    - Save changes .. and that's for android.policy.jar


    2) SecSettings.apk:

    - Decompile SecSettings.apk
    - Go to res\values folder and open strings.xml file and add these new resources at the end before </resources>:
    Code:
    	<string name="PM_Glory_addons">GloryROM Power Menu Addons</string>
    	<string name="pm_safe_mode_title">Safe Mode Reboot</string>
    	<string name="pm_screenshot_title">Take Screenshot</string>
    	<string name="pm_on">Toggle is Enabled</string>
    	<string name="pm_off">Toggle is Disabled</string>
    - Go to res\xml and open display_settings.xml and add these lines on the place you your addon to appear later on on the device:
    Code:
    	<PreferenceCategory android:title="@string/PM_Glory_addons" android:key="PM_Glory_settings" />
    	<CheckBoxPreference android:title="@string/pm_safe_mode_title" android:key="pm_safe_mode" android:defaultValue="true" android:summaryOn="@string/pm_on" android:summaryOff="@string/pm_off" />
    	<CheckBoxPreference android:title="@string/pm_screenshot_title" android:key="pm_screenshot" android:defaultValue="true" android:summaryOn="@string/pm_on" android:summaryOff="@string/pm_off" />
    - Now for the smali source, go to classout\com\android\settings folder and open DisplaySettings.smali.. Also here, I didn't invent new codes, I used mult-windows toggle codes as reference..!! I will use Blue color for Safe Mode toggle codes and Green color for Screenshot toggle codes. Add these lines to [# instance fields] section:
    Code:
    [B][COLOR="Blue"].field private mSafeModePref:Landroid/preference/CheckBoxPreference;[/COLOR]
    
    [COLOR="Green"].field private mScreenShotPref:Landroid/preference/CheckBoxPreference;[/COLOR][/B]
    - In 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, "pm_safe_mode"
    
        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;->mSafeModePref:Landroid/preference/CheckBoxPreference;[/COLOR]
    
        [COLOR="Green"]const-string v11, "pm_screenshot"
    
        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;->mScreenShotPref:Landroid/preference/CheckBoxPreference;[/COLOR][/B]
    - Now search for the method ".method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z" and search for ""multi_window_enabled"" to locate this part at the end:
    Code:
        .line 1021
        :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_1c[/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 :goto_1c
    
        :cond_177
        move v1, v2
    
        goto :goto_172
    .end method
    Add new codes before [.end method] in the previous section, so that section will be like this:
    Code:
        .line 1021
        :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_SafeM[/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 :goto_1c
    
        :cond_177
        move v1, v2
    
        goto :goto_172
    	
        [B][COLOR="Blue"]:cond_SafeM
        iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mSafeModePref:Landroid/preference/CheckBoxPreference;
    
        invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
    
        move-result v0
    
        if-eqz v0, :cond_ScSh
    
        .line 1022
        iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mSafeModePref: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, "pm_safe_mode"
    
        if-eqz v0, :cond_majdiSafe
    
        :goto_njsafe
        invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
    
        goto/16 :goto_1c
    
        :cond_majdiSafe
        move v1, v2
    
        goto :goto_njsafe[/COLOR]
    	
        [B][COLOR="Green"]:cond_ScSh
        iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mScreenShotPref:Landroid/preference/CheckBoxPreference;
    
        invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
    
        move-result v0
    
        if-eqz v0, [COLOR="Red"]:cond_1c[/COLOR]
    
        .line 1022
        iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mScreenShotPref: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, "pm_screenshot"
    
        if-eqz v0, :cond_majdiSS
    
        :goto_njSS
        invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
    
        goto/16 :goto_1c
    
        :cond_majdiSS
        move v1, v2
    
        goto :goto_njSS[/COLOR][/B][/B]
    .end method
    - Pay attention to the red color condition..!!!
    - Now go to the next method ".method public onResume()V" and search for ""multi_window_enabled"" and locate this part:
    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 this modification:
    Code:
        :cond_9d
        sget-boolean v0, Lcom/android/settings/DisplaySettings;->UseMultiWindow:Z
    
        if-eqz v0, [B][COLOR="Blue"]:cond_Safemajdi[/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"].line 1000
        :cond_Safemajdi
        iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mSafeModePref:Landroid/preference/CheckBoxPreference;
    
        if-eqz v0, :cond_NewScSh
    	
        .line 1001
        iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mSafeModePref:Landroid/preference/CheckBoxPreference;
    
        invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
    
        move-result-object v3
    
        const-string v4, "pm_safe_mode"
    
        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_noSafe
    
        const/4 v1, 0x1
    
        goto :goto_yesSafe
    
        :cond_noSafe
        const/4 v1, 0x0
    
        :goto_yesSafe
        invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V[/COLOR]
    
        [COLOR="Green"].line 2000
        :cond_NewScSh
        iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mScreenShotPref:Landroid/preference/CheckBoxPreference;
    
        if-eqz v0, [COLOR="Red"]:cond_c1[/COLOR]
    	
        .line 2001
        iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mScreenShotPref:Landroid/preference/CheckBoxPreference;
    
        invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
    
        move-result-object v3
    
        const-string v4, "pm_screenshot"
    
        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_noShot
    
        const/4 v1, 0x1
    
        goto :goto_yesShot
    
        :cond_noShot
        const/4 v1, 0x0
    
        :goto_yesShot
        invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V[/COLOR][/B]
    
        .line 850
        :cond_c1
        return-void
    
        :cond_c2
        move v0, v2
    - Also pay attention to the red color condition..!!!
    - Save changes.. and that's all


    Result example:

    ayw9.png
    4qwx.png
    2913.png
    b4fp.png

    31
    Continue moddings!!

    4-way Reboot Menu

    1. We will need Backsmali/Smali program for this.
    2. Download the following resources files (GlobalActions$99$1.smali, GlobalActions$99$2.smali, GlobalActions$99.smali) [New: new patched resources for non-working hot reboot option, download newPatchedResources]
    3. Put the android.policy.jar in baksmali folder.
    4. Follow its procedure to baksmali android.policy.jar, if done you will have classout folder.
    5. Open classout folder and go to \com\android\internal\policy\impl and paste the three resource files; (GlobalActions$99$1.smali, GlobalActions$99$2.smali and GlobalActions$99) there.
    6. Open GlobalActions.smali.
    7. In GlobalActions.smali, change GlobalActions$5 to GlobalActions$99 on both lines, and save it.
    >>The Code should look like this:<<
    Code:
    new-instance v0, Lcom/android/internal/policy/impl/[B][COLOR="Blue"]GlobalActions$99[/COLOR][/B];
    
    const v1, 0x108064b
    
    const v2, 0x1040169
    
    invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/[COLOR="Blue"][B]GlobalActions$99[/B][/COLOR];-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
    iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    Some ROMs might have different number on reboot button (i.e, GlobalActions$5). You find right one by tracking mRestart
    8. Now Open GlobalActions$SinglePressAction.smali. Just between line ".end annotation" and "# instance fields" place your cursor and hit enter 2 times to make room (i.e leave 2 lines empty above "# instance fields" and 2 lines bellow ".end annotation") to paste THIS code (Blue one only)
    Code:
    .end annotation
    
    
    [COLOR="Blue"][B]# static fields
    .field protected static rebootMode:I
    
    .field protected static final rebootOptions:[Ljava/lang/String;[/B][/COLOR]
    
    
    # instance fields
    9. Still in GlobalActions$SinglePressAction.smali look for the code "# direct methods". Then paste THIS code bellow it (Blue one only):
    Code:
    # direct methods
    [COLOR="Blue"][B].method static constructor <clinit>()V
        .registers 3
    
        const/4 v0, 0x4
    
        new-array v0, v0, [Ljava/lang/String;
    
        const/4 v1, 0x0
    
        const-string v2, "Reboot"
    
        aput-object v2, v0, v1
    
        const/4 v1, 0x1
    
        const-string v2, "Hot Reboot"
    
        aput-object v2, v0, v1
    
        const/4 v1, 0x2
    
        const-string v2, "Download"
    
        aput-object v2, v0, v1
    
        const/4 v1, 0x3
    
        const-string v2, "Recovery"
    
        aput-object v2, v0, v1
    
        sput-object v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
    
        return-void
    .end method
    [/B][/COLOR]
    .method protected constructor <init>(II)V
    10. Recompile (smali) your jar.

    Additional
    If you want to change "Choose Reboot Method" text on top of that menu then:
    - Open GlobalActions$99.smali.
    - Go to following code and made your change (N.B: if you delete this entire code, you will disable head title of "Choose Reboot Method")
    Code:
    const-string v2, "[COLOR="Blue"][B]Choose Reboot Method[/B][/COLOR]"
    
        invoke-virtual {v1, v2}, Landroid/app/AlertDialog$Builder;->setTitle(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;
    
        move-result-object v1
    If you are porting to other device, please make sure in GlobalActions$99.smali whether Landroid/content/context has the same access$xx as same in GlobalActions.smali or change it to be like the one in GlobalActions.smali
    Also make sure the following ids in GlobalActions$99.smali are pointed to the correct ids in framework-res.apk:
    0x104000a = 0x0104000a = "string" name="ok"
    0x104 = 0x01040000 = "string" name="cancel"
    Lastly, if you are porting to android 4.3, open GlobalAction$99$1.smali and change the 2 lines of:
    Code:
    Lcom/android/server/pm/ShutdownThread
    to:
    Code:
    Lcom/android/server/power/ShutdownThread

    Results example:

    screenshot2012120521215.png


    Call record enabling + Disabling ascending ringtone

    Call record enabling:
    1. Put the SecPhone.apk in baksmali folder.
    2. Follow its procedure to baksmali SecPhone.apk, if done you will have classout folder.
    3. Open classout folder and go to \com\android\phone\PhoneFeature.smali, open it by NotePad++ and search for line makeFeatureForUsa()V and put these lines (Blue color text only) before "return-void" line:
    Code:
    [B]    invoke-static {}, Lcom/android/phone/PhoneFeature;->makeFeatureForUsa()V
    
        .line 899
    [COLOR="Blue"]    sget-object v0, Lcom/android/phone/PhoneFeature;->mFeatureList:Ljava/util/HashMap;
    
        const-string v2, "voice_call_recording"
    
        const/4 v4, 0x1
    
        invoke-static {v4}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
    
        move-result-object v3
    
        invoke-virtual {v0, v2, v3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    [/COLOR]
        return-void[/B]
    4. Save changes.

    Disabling ascending ringtone:
    1. Open classout folder and go to \com\android\phone\Ringer$1.smali.
    2. Search for setStreamVolume. There should be two results. Delete the first one (the whole line):
    Code:
        .line 394
        iget-object v1, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
    
        iget-object v1, v1, Lcom/android/phone/Ringer;->mAudioManager:Landroid/media/AudioManager;
    
       [strike][B]invoke-virtual {v1, v3, v5, v4}, Landroid/media/AudioManager;->setStreamVolume(III)V[/B][/strike]
    3. Now search for nop (usually at the bottom of the file!!), copy it and hit enter twice and paste again (see code bellow, the blue one). "leave one line space in between each line":
    Code:
        goto/16 :goto_b
    
        .line 717
        nop
    
    [B][COLOR="Blue"]    nop[/COLOR][/B]
    
        :pswitch_data_1ca
        .packed-switch 0x1
    4. Save changes and recompile (smali) your SecPhone.apk.

    Results example:

    screenshot2012112617271.png


    Smart Rotation enabling

    1- Decompile SecSettings.apk and go to smali/com/android/settings/DisplaySettings.smali
    2- Open this smali file with a NotePad++ and look for these lines and delete them all:
    Code:
        invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
        
        move-result-object v12
        
        iget-object v13, p0, Lcom/android/settings/DisplaySettings;->mSmartRotation:Landroid/preference/CheckBoxPreference;
        
        invoke-virtual {v12, v13}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
    3. Recompile and push to your phone.

    Results example:

    screenshot2012112522305.png


    SMS hacks: displaying sent Time instead of the received time

    Decompile SecMMS.apk
    1. Go to /smali/com/android/mms/transaction/SMSReceiverService.smali, search for “currentTimeMillis" and change the following values:
    Code:
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
    to:
    Code:
    invoke-virtual {p1}, Landroid/telephony/SmsMessage;->getTimestampMillis()J
    2. Search again for next “currentTimeMillis" and change the following values:
    Code:
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
    to:
    Code:
    invoke-virtual {v0}, Landroid/telephony/gsm/CbMessage;->getTimestampMillis()J
    3. Save changes and compile.
    If it doesn't work, clear the cache, the Dalvik cache, and also clear data for Messaging under Settings->Applications->Manage Applications (it won't delete your messages).

    Unlimited Multiwindow apps

    For this one, we need to play with 2 files (flashbarservice.apk and services.jar)

    A. Flashbarservice.apk:
    1. Decompile the flashbarservice.apk with APK-Multi tool.
    2. Go to \smali\com\sec\android\app\FlashBar Service\FlashBarInfo.smali.
    3. Open the file FlashBarInfo.smali using notepad++.
    4. search for .method public generateFlashBarList()V and change the following code from:
    Code:
    const-string v8, "android.intent.category[COLOR="Blue"].MULTIWINDOW[/COLOR]_LAUNCHER"
    to:
    Code:
    const-string v8, "android.intent.category.LAUNCHER"
    5. Save and recompile and push to your phone.

    B. services.jar:
    1. Decompile services.jar by Backsmali/smali program.
    2. Go to classout\smali\com\android\server\am\MultiWindowManagerService.smali
    3. Open the file using notepad++ and search for following method ".method public isSupportApp(Ljava/lang/String)Z" and change the entire method to:
    Code:
    [COLOR="Blue"][B].method public isSupportApp(Ljava/lang/String;)Z
        .registers 2
    
        .prologue
        const/4 v0, 0x1
    
        return p0
    .end method[/B][/COLOR]
    4. Save file and recompile (Smali).


    Home screen wallpaper scrolling

    1. Decompile SecLauncher2.apk by APK-Multi tool.
    2. Go to \res\values folder and open bools.xml file with Notepad++.
    3. Change the following line:
    Code:
    <bool name="config_fixedWallpaperOffset">[B][COLOR="Blue"]true[/COLOR][/B]</bool>
    to:
    Code:
    <bool name="config_fixedWallpaperOffset">[B][COLOR="Blue"]false[/COLOR][/B]</bool>
    4. Save the file, recompile and push the apk to your phone.


    Changing number of icons in home screen and apps drawer (dpi modding)

    1. Decompile SecLauncher2.apk by APK-Multi tool.
    2. Go to \res\values-sw399dp folder
    3. Here we will do our changes to integers.xml, dimens.xml and and styles.xml files.

    I. integers.xml:
    • Here is where you change the number of icons displayed in X axes "i.e, horizontal" and Y axes "i.e, vertical".
    • You need to apply your changes on the following numbers on the following lines:
    Code:
        <integer name="home_cellCountX">[B][COLOR="Blue"]5[/COLOR][/B]</integer>
        <integer name="home_cellCountY">[B][COLOR="Blue"]5[/COLOR][/B]</integer>
    
        <integer name="menuAppsGrid_cellCountX">[B][COLOR="Blue"]5[/COLOR][/B]</integer>
        <integer name="menuAppsGrid_cellCountY">[B][COLOR="Blue"]5[/COLOR][/B]</integer>
    As you can figure, home_cellCountX is number of icons in home screen in X axes and home_cellCountY is number of icons in home screen in Y axes.
    Whereas; menuAppsGrid_cellCountX is number of icons in apps drawer in X axes and menuAppsGrid_cellCountY is number of icons in apps drawer in Y axes.
    • Do your changes and save.

    II. dimens.xml:
    • Here is where you change icons size displayed in X and Y axes.
    • You need to apply your changes on the following lines for home screen to any number you want (might need several testing):
    Code:
        <dimen name="app_icon_size">[COLOR="Blue"][B]48.0[/B][/COLOR]dip</dimen>
    
        <dimen name="home_cellWidth_port">[B][COLOR="Blue"]80.0[/COLOR][/B]dip</dimen>
        <dimen name="home_cellHeight_port">[B][COLOR="Blue"]100.0[/COLOR][/B]dip</dimen>
        <dimen name="home_cellGapX_port">[B][COLOR="Blue"]0.0[/COLOR][/B]dip</dimen>
        <dimen name="home_cellGapY_port">[B][COLOR="Blue"]0.0[/COLOR][/B]dip</dimen>
    
        <dimen name="home_pageMarginPlusPaddingTop">[B][COLOR="Blue"]2.0[/COLOR][/B]dip</dimen>
    
        <dimen name="home_pageIndicatorTop">[B][COLOR="Blue"]508.0[/COLOR][/B]dip</dimen>
        <dimen name="home_pageIndicatorTopShrunken">[B][COLOR="Blue"]508.0[/COLOR][/B]dip</dimen>
    • Also you need to apply your changes on the following lines for apps drawer to any number you want (might need several testing):
    Code:
        <dimen name="menuAppsGrid_pageMarginPlusPaddingTop">[B][COLOR="Blue"]27.0[/COLOR][/B]dip</dimen>
        <dimen name="menuAppsGrid_cellWidth">[B][COLOR="Blue"]78.0[/COLOR][/B]dip</dimen>
        <dimen name="menuAppsGrid_cellHeight">[B][COLOR="Blue"]94.0[/COLOR][/B]dip</dimen>
        <dimen name="menuAppsGrid_cellGapX">[B][COLOR="Blue"]2.0[/COLOR][/B]dip</dimen>
        <dimen name="menuAppsGrid_cellGapY">[B][COLOR="Blue"]2.0[/COLOR][/B]dip</dimen>
        <dimen name="menu_pageIndicatorGap">[B][COLOR="Blue"]12.0[/COLOR][/B]dip</dimen>
        <dimen name="menu_pageIndicatorTop">[B][COLOR="Blue"]520.0[/COLOR][/B]dip</dimen>
    N.B: actually this is how I did it; you can play with other figures and test it to see the effect!!
    • Do your changes and save.

    III. styles.xml:
    • This is needed if the icon label text becomes truncated!!
    • You need to edit the following lines to any number you want (might need several testing):
    For home screen, edit this number:
    Code:
        <style name="HomeIcon" parent="@style/BaseHomeIcon">
            <item name="android:textSize">[COLOR="Blue"][B]13.0[/B][/COLOR]dip</item>
    For apps drawer, edit this number:
    Code:
        <style name="MenuIcon" parent="@style/BaseMenuIcon">
            <item name="android:textSize">[B][COLOR="Blue"]13.0[/COLOR][/B]dip</item>
    • Do your changes and save.

    4. Recompile and push to your phone.
    5. Now we have to change phone's menus dpi. With any root browser/explorer program, navigate to system folder and open build.prop file as a text file and go to this line:
    Code:
    ro.sf.lcd_density=[B][COLOR="Red"]320[/COLOR][/B]
    just change the red value to which dpi you want; e.g 240, then save changes and reboot your phone.


    Camera & Camcorder hacks: Adding "Shutter Sound On/Off" in menu, flash can be used in low battery, hard keys as shutter, increasing camcorder quality..etc

    Credits to: jobnik, I just explain the procedure!!
    • We need Backsmali/smali program to do this method.
    • Put SamsungCamera.apk in Backsmali folder and follow its guide to have classout folder in the end.
    Adding "Shutter Sound On/Off" option in Camera Menu:
    1. Go to classout\com\sec\android\app\camera\resourcedata\ folder and open CameraSettingsMenuResourceData.smali file.
    2. To locate the lines that we will edit, search for"CscFeature_Camera_ShutterSoundMenu".
    3. Now delete all these 6 lines:
    Code:
    invoke-static {}, Lcom/sec/android/app/CscFeature;->getInstance()Lcom/sec/android/app/CscFeature;
    
    move-result-object v2
    
    const-string v3, "CscFeature_Camera_ShutterSoundMenu"
    
    invoke-virtual {v2, v3}, Lcom/sec/android/app/CscFeature;->getEnableStatus(Ljava/lang/String;)Z
    
    move-result v2
    
    if-eqz v2, :cond_f8

    Camera can be used with flash in low battery state:
    1. Go to classout\com\sec\android\app\camera\ folder and open AbstractCameraActivity.smali file.
    2. Search for ".method protected handleLowBattery(Z)V" and add the following line (the blue line):
    Code:
    .method protected handleLowBattery(Z)V
        .registers 5
        .parameter "temp"
    
        .prologue
        .line 2072
        [COLOR="Blue"][B]return-void[/B][/COLOR]
        const-string v1, "AbstractCameraActivity"
    3. Now save changes and go to classout\ com\sec\android\app\camera\ folder and open Camera.smali file.
    4. Search for ".method private handleBatteryChanged(Landroid/content/Intent;)V" and look for the lines that have "handleLowBattery(Z)V" and "handlePluggedLowBattery(Z)V" after this method and delete the whole lines:
    Code:
    invoke-virtual {p0}, Lcom/sec/android/app/camera/Camera;->handleLowBattery()V
    invoke-direct {p0, v6}, Lcom/sec/android/app/camera/Camera;->handlePluggedLowBattery(Z)V
    
    invoke-direct {p0, v6}, Lcom/sec/android/app/camera/Camera;->handlePluggedLowBattery(Z)V
    As you can see, there are 2 lines with "handlePluggedLowBattery(Z)V" AFTER this method, you have to delete them both

    5. Still in Camera.smali file, search for ".method private handlePluggedLowBattery(Z)V" and add the following line (the blue line):
    Code:
    .method private handlePluggedLowBattery(Z)V
        .registers 7
        .parameter "temp"
    
        .prologue
        const/4 v4, 0x3
    
        const/4 v3, 0x0
    
        .line 6238
        [B][COLOR="Blue"]return-void[/COLOR][/B]
        const-string v1, "Camera"

    Camera focus sound disabled:
    1. Go to classout\com\sec\android\app\camera\ folder and open Camera.smali file.
    2. Search for ".method public playCameraSound(II)V" and add the following line (the blue line):
    Code:
    .method public playCameraSound(II)V
        .registers 12
        .parameter "Sound"
        .parameter "loop"
    
        .prologue
        const/4 v4, 0x0
    
        const/high16 v6, 0x3f80
    
        .line 4870
        [B][COLOR="Blue"]return-void[/COLOR][/B]
        iget-object v0, p0, Lcom/sec/android/app/camera/Camera;->mSoundPool:Landroid/media/SoundPool;

    Camera Volume Up/Down and power buttons as a shutter:
    1. Go to classout\com\sec\android\app\camera\ folder and open Camera.smali file.
    2. Search for ". method public onKeyDown(ILandroid/view/KeyEvent;)Z" and look for ".sparse-switch" at the end of this method.
    3. Here you will see several :sswitch definitions. See the one for 0x17, it is the touch shutter button and is defined as :sswitch_??. So simply we need to make :sswitch that are defined to volume up/down and power buttons to read the same as the one defined to the touch shutter button. Here 0x18 is for volume up; 0x19 is for volume down, and 0x1a is for power button.
    4. So now change these :sswitch for these buttons to read as same as that for the touch shutter button. See example bellow:
    Before:
    Code:
        :sswitch_data_2a0
        .sparse-switch
            0x4 -> :sswitch_95
            [B][COLOR="Blue"]0x17 -> :sswitch_f7[/COLOR][/B]      [COLOR="DarkGreen"]<!-- this is the touch shutter button[/COLOR]
            [B][COLOR="Red"]0x18 -> :sswitch_238[/COLOR][/B]     [COLOR="DarkGreen"]<!-- this is volume up button[/COLOR]
            [B][COLOR="Red"]0x19 -> :sswitch_238[/COLOR][/B]     [COLOR="DarkGreen"]<!-- this is volume down button[/COLOR]
            [B][COLOR="Red"]0x1a -> :sswitch_95[/COLOR][/B]      [COLOR="DarkGreen"]<!-- this is power button[/COLOR]
            0x1b -> :sswitch_f7
            0x42 -> :sswitch_f7
            0x45 -> :sswitch_238
            0x46 -> :sswitch_238
            0x50 -> :sswitch_9b
            0x52 -> :sswitch_93
            0x55 -> :sswitch_98
            0x59 -> :sswitch_98
            0x5a -> :sswitch_98
            0x9c -> :sswitch_238
            0x9d -> :sswitch_238
        .end sparse-switch
    .end method
    After:
    Code:
        :sswitch_data_2a0
        .sparse-switch
            0x4 -> :sswitch_95
            [COLOR="Blue"][B]0x17 -> :sswitch_f7[/B][/COLOR]     [COLOR="DarkGreen"]<!-- this is the touch shutter button[/COLOR]
            [B][COLOR="Red"]0x18 -> :sswitch_f7[/COLOR][/B]     [COLOR="DarkGreen"]<!-- this is volume up button[/COLOR]
            [B][COLOR="Red"]0x19 -> :sswitch_f7[/COLOR][/B]     [COLOR="DarkGreen"]<!-- this is volume down button[/COLOR]
            [B][COLOR="Red"]0x1a -> :sswitch_f7[/COLOR][/B]     [COLOR="DarkGreen"]<!-- this is power button[/COLOR]
            0x1b -> :sswitch_f7
            0x42 -> :sswitch_f7
            0x45 -> :sswitch_238
            0x46 -> :sswitch_238
            0x50 -> :sswitch_9b
            0x52 -> :sswitch_93
            0x55 -> :sswitch_98
            0x59 -> :sswitch_98
            0x5a -> :sswitch_98
            0x9c -> :sswitch_238
            0x9d -> :sswitch_238
        .end sparse-switch
    .end method
    5. Now search for ". method public onKeyUp(ILandroid/view/KeyEvent;)Z" and look for ".sparse-switch" at the end of this method.
    6. Again you will see several :sswitch definitions. See the one for 0x17, it is the touch shutter button and is defined as :sswitch_??. And yes as you can figure out 0x18 is for volume up, 0x19 is for volume down and 0x1a is for power button.
    7. So now change these :sswitch for these buttons to read as same as that for the touch shutter button. See example bellow:
    Before:
    Code:
        .line 2172        
        .sparse-switch
            0x3 -> :sswitch_25f
            0x4 -> :sswitch_60
            [B][COLOR="Blue"]0x17 -> :sswitch_11e[/COLOR][/B]      [COLOR="DarkGreen"]<!-- this is the touch shutter button[/COLOR]
            [B][COLOR="Red"]0x18 -> :sswitch_209[/COLOR][/B]      [COLOR="DarkGreen"]<!-- this is volume up button[/COLOR]
            [B][COLOR="Red"]0x19 -> :sswitch_209[/COLOR][/B]      [COLOR="DarkGreen"]<!-- this is volume down button[/COLOR]
            [B][COLOR="Red"]0x1a -> :sswitch_209[/COLOR][/B]      [COLOR="DarkGreen"]<!-- this is power button[/COLOR]
            0x1b -> :sswitch_11e
            0x42 -> :sswitch_11e
            0x50 -> :sswitch_20c
            0x52 -> :sswitch_e5
        .end sparse-switch
    After:
    Code:
        .line 2172    
        .sparse-switch
            0x3 -> :sswitch_25f
            0x4 -> :sswitch_60
            [B][COLOR="Blue"]0x17 -> :sswitch_11e[/COLOR][/B]      [COLOR="DarkGreen"]<!-- this is the touch shutter button[/COLOR]
            [B][COLOR="Red"]0x18 -> :sswitch_11e[/COLOR][/B]      [COLOR="DarkGreen"]<!-- this is volume up button[/COLOR]
            [B][COLOR="Red"]0x19 -> :sswitch_11e[/COLOR][/B]      [COLOR="DarkGreen"]<!-- this is volume down button[/COLOR]
            [B][COLOR="Red"]0x1a -> :sswitch_11e[/COLOR][/B]      [COLOR="DarkGreen"]<!-- this is power button[/COLOR]
            0x1b -> :sswitch_11e
            0x42 -> :sswitch_11e
            0x50 -> :sswitch_20c
            0x52 -> :sswitch_e5
        .end sparse-switch

    N.B: In power button as a shutter, it will work on long press, so the power menu will popup as well, but it will take a picture!!

    Camcorder can be used with flash in low battery state:
    1. Go to classout\com\sec\android\app\camera\ folder and open Camcorder.smali file.
    2. Search for ".method protected handleLowBattery(Z)V" and add the following line (the blue one):
    Code:
    .method protected handleLowBattery(Z)V
        .registers 4
        .parameter "temp"
    
        .prologue
        .line 3267
        [B][COLOR="Blue"]return-void[/COLOR][/B]
        const-string v0, "Camcorder"
    3. Still in Camcorder.smali file, search for ".method private handleBatteryChanged(Landroid/content/Intent;)V" and look for lines that have "handleLowBattery(Z)V" and "handlePluggedLowBattery(Z)V" after this method and delete the whole lines:
    Code:
    invoke-virtual {p0}, Lcom/sec/android/app/camera/Camcorder;->handleLowBattery(Z)V
    invoke-direct {p0, v7}, Lcom/sec/android/app/camera/Camcorder;->handlePluggedLowBattery(Z)V
    
    invoke-direct {p0, v7}, Lcom/sec/android/app/camera/Camcorder;->handlePluggedLowBattery(Z)V
    As you can see, there are 2 lines with "handlePluggedLowBattery(Z)V" AFTER this method, you have to delete them both

    4. Still in Camcorder.smali file, search for ".method private handlePluggedLowBattery(Z)V" and add the following line (the blue one):
    Code:
    .method private handlePluggedLowBattery(Z)V
        .registers 7
        .parameter "temp"
    
        .prologue
        const/16 v4, 0x67
    
        const/4 v3, 0x0
    
        .line 4351
        [B][COLOR="Blue"]return-void[/COLOR][/B]
        const-string v1, "Camcorder"
    Camcorder Better audio quality and video bitrate:
    VIDEO QUALITY:
    1080p: Normal - 17MBit / Fine - 24MBit / Superfine - 30MBit
    720p: Normal - 9MBit / Fine - 13MBit / Superfine - 17MBit
    SOUND QUALITY:
    192kbit/s, 48000 khz
    1. Go to classout\com\sec\android\app\camera\ folder and open MediaRecorderProfile.smali file.
    2. Modify the first 4 arrays to be exactly like the followings (the blue lines only):
    Code:
        :array_11c
        .array-data 0x4
    [B][COLOR="Blue"]        0x2t 0x0t 0x0t 0x0t
            0x80t 0xc3t 0xc9t 0x1t
            0x0t 0x36t 0x6et 0x1t
            0x40t 0x66t 0x3t 0x1t
            0x1et 0x0t 0x0t 0x0t
            0x2t 0x0t 0x0t 0x0t
            0x3t 0x0t 0x0t 0x0t
            0x0t 0xeet 0x2t 0x0t
            0x2t 0x0t 0x0t 0x0t
            0x80t 0xbbt 0x0t 0x0t[/COLOR][/B]
        .end array-data
    
        :array_134
        .array-data 0x4
    [B][COLOR="Blue"]        0x2t 0x0t 0x0t 0x0t
            0x40t 0x66t 0x3t 0x1t
            0x40t 0x5dt 0xc6t 0x0t
            0x40t 0x54t 0x89t 0x0t
            0x1et 0x0t 0x0t 0x0t
            0x2t 0x0t 0x0t 0x0t
            0x3t 0x0t 0x0t 0x0t
            0x0t 0xeet 0x2t 0x0t
            0x2t 0x0t 0x0t 0x0t
            0x80t 0xbbt 0x0t 0x0t[/COLOR][/B]
        .end array-data
    
        :array_14c
        .array-data 0x4
    [B][COLOR="Blue"]        0x2t 0x0t 0x0t 0x0t
            0xa8t 0xa0t 0x34t 0x0t
            0x50t 0x3et 0x2bt 0x0t
            0x90t 0x10t 0x23t 0x0t
            0x1et 0x0t 0x0t 0x0t
            0x2t 0x0t 0x0t 0x0t
            0x3t 0x0t 0x0t 0x0t
            0x0t 0xeet 0x2t 0x0t
            0x2t 0x0t 0x0t 0x0t
            0x80t 0xbbt 0x0t 0x0t[/COLOR][/B]
        .end array-data
    
        :array_164
        .array-data 0x4
    [B][COLOR="Blue"]        0x2t 0x0t 0x0t 0x0t
            0x70t 0xf7t 0x2et 0x0t
            0xa8t 0xf4t 0x26t 0x0t
            0xb8t 0xcet 0x1et 0x0t
            0x1et 0x0t 0x0t 0x0t
            0x2t 0x0t 0x0t 0x0t
            0x3t 0x0t 0x0t 0x0t
            0x0t 0xeet 0x2t 0x0t
            0x2t 0x0t 0x0t 0x0t
            0x80t 0xbbt 0x0t 0x0t[/COLOR][/B]
        .end array-data

    • Save changes, recompile (smali) your apk. You will get "classes.dex" and with 7-zip, open the archive of the original SamsungCamera.apk. Then drag and drop the classes.dex into SamsungCamera.apk. and push it to your phone.
    30
    Continue moddings!!

    SMS hack: SMS 200 recipients, stop SMS to MMS auto-converting, increase SMS hour limit, 1000 slides, group messages, scheduled messages and save/restore messages

    I. SMS 200 recipients:
    1) Backsmali SecMMs.apk
    2) Navigate to and open classout\com\android\mms\MmsConfig.smali
    3) Search for ".method public static getRecipientLimit()I" and do these changes:
    Code:
    .method public static getRecipientLimit()I
        .registers 1
    
        .prologue
        .line 656
        [B][COLOR="Red"]sget v0, Lcom/android/mms/MmsConfig;->mRecipientLimit:I[/COLOR][/B]
    
        return v0
    .end method
    to:
    Code:
    .method public static getRecipientLimit()I
        .registers 1
    
        .prologue
        .line 656
        [B][COLOR="Blue"]const/16 v0, 0xc8[/COLOR][/B]
    
        return v0
    .end method
    Save changes and recompile (smali) your apk.

    II. Stop SMS to MMS auto-converting:
    1) Backsmali SecMMs.apk
    2) Navigate to and open classout\com\android\mms\MmsConfig.smali
    3) Search for "Lcom/android/mms/MmsConfig;->mMaxImageWidthRestrictedMode:I" and do these changes:
    Code:
        sput v0, Lcom/android/mms/MmsConfig;->mMaxImageWidthRestrictedMode:I
    
        .line 153
        [B][COLOR="Red"]sput v7, Lcom/android/mms/MmsConfig;->mRecipientLimit:I[/COLOR][/B]
    
        .line 154
        [B][COLOR="Red"]const/16 v0, 0xc8[/COLOR][/B]
    
        sput v0, Lcom/android/mms/MmsConfig;->mDefaultSMSMessagesPerThread:I
    to:
    Code:
        sput v0, Lcom/android/mms/MmsConfig;->mMaxImageWidthRestrictedMode:I
    
        .line 153
        [B][COLOR="Blue"]const/16 v0, 0x3e8
    [/COLOR][/B]
        .line 154
        [B][COLOR="Blue"]sput v0, Lcom/android/mms/MmsConfig;->mRecipientLimit:I[/COLOR][/B]
    
        sput v0, Lcom/android/mms/MmsConfig;->mDefaultSMSMessagesPerThread:I
    4) Then search for "Lcom/android/mms/MmsConfig;->mAllowAttachAudio:Z" and do these changes:
    Code:
        .line 161
        sput-boolean v2, Lcom/android/mms/MmsConfig;->mAllowAttachAudio:Z
    
        .line 164
        [B][COLOR="Red"]const/4 v0, 0x4[/COLOR][/B]
    
        sput v0, Lcom/android/mms/MmsConfig;->mSmsToMmsTextThreshold:I
    to:
    Code:
        .line 161
        sput-boolean v2, Lcom/android/mms/MmsConfig;->mAllowAttachAudio:Z
    
        .line 164
        [B][COLOR="Blue"]const/16 v0, 0x3e8[/COLOR][/B]
    
        sput v0, Lcom/android/mms/MmsConfig;->mSmsToMmsTextThreshold:I
    5) Then search for ".method public static getMaxRecipientLength()I" and do these changes:
    Code:
    .method public static getMaxRecipientLength()I
        .registers 1
    
        .prologue
        .line 2259
        [B][COLOR="Red"]sget v0, Lcom/android/mms/MmsConfig;->mMaxRecipientLength:I[/COLOR][/B]
    
        return v0
    .end method
    to:
    Code:
    .method public static getMaxRecipientLength()I
        .registers 1
    
        .prologue
        .line 2259
        [B][COLOR="Blue"]const/16 v0, 0x3e8[/COLOR][/B]
    
        return v0
    .end method
    6) Then search for ".method public static getMmsMaxRecipient()I" and do these changes:
    Code:
    .method public static getMmsMaxRecipient()I
        .registers 1
    
        .prologue
        .line 2498
        [B][COLOR="Red"]sget v0, Lcom/android/mms/MmsConfig;->mMmsRecipientLimit:I[/COLOR][/B]
    
        return v0
    .end method
    to:
    Code:
    .method public static getMmsMaxRecipient()I
        .registers 1
    
        .prologue
        .line 2498
        [B][COLOR="Blue"]const/16 v0, 0x3e8[/COLOR][/B]
    
        return v0
    .end method
    7) Then search for ".method public static getSmsToMmsTextThreshold()I" and do these changes:
    Code:
    .method public static getSmsToMmsTextThreshold()I
        .registers 1
    
        .prologue
        .line 585
        [B][COLOR="Red"]sget v0, Lcom/android/mms/MmsConfig;->mSmsToMmsTextThreshold:I[/COLOR][/B]
    
        return v0
    .end method
    to:
    Code:
    .method public static getSmsToMmsTextThreshold()I
        .registers 1
    
        .prologue
        .line 585
        [B][COLOR="Blue"]const/16 v0, 0x3e8[/COLOR][/B]
    
        return v0
    .end method
    8) Then search for "Lcom/android/mms/MmsConfig;->mMaxRecipientLength:I" and add this line above it (the blue one):
    Code:
        move-result v10
    	
        [B][COLOR="Blue"]const/16 v9, 0x3e8[/COLOR][/B]
    
        sput v10, Lcom/android/mms/MmsConfig;->mMaxRecipientLength:I
    
        .line 1638
        sget v10, Lcom/android/mms/MmsConfig;->mMinRecipientLength:I
    9) Then search for "Lcom/android/mms/MmsConfig;->mSmsToMmsTextThreshold:I" and add this line above it (the blue one):
    Code:
        move-result v1
    	
        [B][COLOR="Blue"]const/16 v1, 0x3e8[/COLOR][/B]
    
        sput v1, Lcom/android/mms/MmsConfig;->mSmsToMmsTextThreshold:I
    
        .line 1817
        const-string v1, "Mms/MmsConfig"
    10) Then search for "Lcom/android/mms/MmsConfig;->mRecipientLimit:I" add this line above it (the blue one):
    Code:
        invoke-interface {v0, v1, v4}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I
    
        move-result v1
    	
        [B][COLOR="Blue"]const/16 v1, 0x3e8[/COLOR][/B]
    
        sput v1, Lcom/android/mms/MmsConfig;->mRecipientLimit:I
    11) Save changes and recompile (smali) your apk.. phewww wow we finished :D
    After pushing your final hacked SecMms.apk to your phone, you might have this message after you wrote 14 sms pages "Message size limit reached the maximum number of characters" that is actually a limitation of your mobile company provider protocol itself.

    III. Increase SMS hour limit:
    1) Backsmali SecMMs.apk
    2) Navigate and open classout\com\android\mms\util\RateController.smali
    3) Look for this line:
    Code:
    .field private static final RATE_LIMIT:I = [B][COLOR="Red"]0x64[/COLOR][/B]
    and change it to:
    Code:
    .field private static final RATE_LIMIT:I = [B][COLOR="Blue"]0x3e8[/COLOR][/B]
    4) Save changes and recompile (smali) your apk
    Why??
    0x64 means 100 in hexadecimal format. So we put 0x3e8 which means 1000 in hexadecimal format

    VI. 1000 slides for MMS:
    - Baksmali SecMms.apk
    - Go to classout\com\android\mms folder and open MmsConfig.smali
    - Now Search for ".method public static getMaxSlideCount()I" and do the following change..
    Before:
    Code:
    .method public static getMaxSlideCount()I
        .registers 1
    
        .prologue
        .line 825
        [B][COLOR="Red"]sget v0, Lcom/android/mms/MmsConfig;->mMaxSlideCount:I[/COLOR][/B]
    
        return v0
    .end method
    After:
    Code:
    .method public static getMaxSlideCount()I
        .registers 1
    
        .prologue
        .line 825
        [B][COLOR="Blue"]const/16 v0, 0x3e8[/COLOR][/B]
    
        return v0
    .end method
    Save changes and smali your SecMms.apk and push it to phone and fix permissions to rw-r--r-- (644)

    V. Group messages, scheduled messages and save/restore messages:
    Already a great tutorial by @jovy23 is here.



    23 toggles notification panel (Lidroid way)

    Special thanks to wanam who modifies Lidroid way to port the 23-toggle to JB ROMs
    1. Decompile SystemUI.apk by APK-Multi-Tool.
    2. Navigate to res\layout folder and open tw_status_bar_expanded.xml and do these changes (delete red lines, add blue lines, and modify the green one to be like it):
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <FrameLayout android:id="@id/notification_panel" android:background="@drawable/notification_panel_bg" android:paddingTop="@dimen/notification_panel_padding_top" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginLeft="@dimen/notification_panel_margin_left"
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
        <FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/tw_close_handle_underlap">
            <include android:layout_width="fill_parent" android:layout_height="@dimen/tw_notification_panel_header_height" layout="@layout/tw_status_bar_expanded_header" />
            <TextView android:gravity="center" android:id="@id/emergency_calls_only" android:paddingBottom="4.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content" />
            <View android:background="#ff091a24" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_marginTop="@dimen/tw_notification_panel_header_height" />
            [B][COLOR="Blue"]<HorizontalScrollView android:id="@id/quicksetting_scroller" android:visibility="gone" android:scrollbars="none" android:layout_width="wrap_content" android:layout_height="@dimen/quick_setting_button_height" android:layout_marginTop="@dimen/tw_notification_panel_header_height">
                <com.android.systemui.statusbar.policy.quicksetting.QuickSettingPanel android:orientation="horizontal" android:id="@id/quicksetting_container" android:layout_width="wrap_content" android:layout_height="wrap_content" android:divider="@drawable/tw_black_bg" android:showDividers="middle" />
            </HorizontalScrollView>
            <com.wanam.systemui.quickpanel.PowerWidget android:id="@id/exp_power_stat" android:layout_width="wrap_content" android:layout_height="@dimen/quick_setting_button_height" android:layout_marginTop="@dimen/tw_notification_panel_header_height" />
            <LinearLayout android:orientation="vertical" android:id="@id/brightness_controller" android:background="#ff000000" android:layout_width="fill_parent" android:layout_height="56.0dip" android:layout_marginTop="@dimen/notification_panel_quicksettingbtn_height">
                <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="55.0dip">
                    <ImageView android:id="@id/brightness_icon" android:clickable="true" android:layout_width="25.0dip" android:layout_height="fill_parent" android:layout_marginLeft="13.0dip" android:src="@drawable/ic_sysbar_brightness" android:contentDescription="@string/accessibility_brightness_icon" />
                    <FrameLayout android:id="@id/brightness_group" android:layout_width="fill_parent" android:layout_height="fill_parent">
                        <com.android.systemui.statusbar.policy.ToggleSlider android:id="@id/brightness" android:layout_width="fill_parent" android:layout_height="fill_parent" systemui:text="@string/status_bar_settings_auto_brightness_label" />
                        <com.android.systemui.statusbar.policy.ToggleSlider android:id="@id/auto_brightness" android:layout_width="fill_parent" android:layout_height="fill_parent" systemui:text="@string/status_bar_settings_auto_brightness_label" />
                    </FrameLayout>
                </LinearLayout>
                <View android:background="#ff091a24" android:layout_width="fill_parent" android:layout_height="1.0dip" />
            </LinearLayout>[/COLOR][/B]
            [B][COLOR="SeaGreen"]<ScrollView android:id="@id/scroll" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginTop="@dimen/notification_panel_notification_top_margin" android:overScrollMode="ifContentScrolls">[/COLOR][/B]
                <LinearLayout android:orientation="vertical" android:id="@id/scrollCart" android:layout_width="fill_parent" android:layout_height="wrap_content">
                    [B][COLOR="Red"]<HorizontalScrollView android:id="@id/quicksetting_scroller" android:scrollbars="none" android:layout_width="wrap_content" android:layout_height="@dimen/quick_setting_button_height">
                        <com.android.systemui.statusbar.policy.quicksetting.QuickSettingPanel android:orientation="horizontal" android:id="@id/quicksetting_container" android:layout_width="wrap_content" android:layout_height="wrap_content" android:divider="@drawable/tw_black_bg" android:showDividers="middle" />
                    </HorizontalScrollView>
                    <LinearLayout android:orientation="vertical" android:id="@id/brightness_controller" android:background="#ff000000" android:layout_width="fill_parent" android:layout_height="56.0dip">
                        <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="55.0dip">
                            <ImageView android:id="@id/brightness_icon" android:clickable="true" android:layout_width="25.0dip" android:layout_height="fill_parent" android:layout_marginLeft="13.0dip" android:src="@drawable/ic_sysbar_brightness" android:contentDescription="@string/accessibility_brightness_icon" />
                            <FrameLayout android:id="@id/brightness_group" android:layout_width="fill_parent" android:layout_height="fill_parent">
                                <com.android.systemui.statusbar.policy.ToggleSlider android:id="@id/brightness" android:layout_width="fill_parent" android:layout_height="fill_parent" systemui:text="@string/status_bar_settings_auto_brightness_label" />
                                <com.android.systemui.statusbar.policy.ToggleSlider android:id="@id/auto_brightness" android:layout_width="fill_parent" android:layout_height="fill_parent" systemui:text="@string/status_bar_settings_auto_brightness_label" />
                            </FrameLayout>
                        </LinearLayout>
                        <View android:background="#ff091a24" android:layout_width="fill_parent" android:layout_height="1.0dip" />
                    </LinearLayout>[/COLOR][/B]
                    <LinearLayout android:orientation="vertical" android:id="@id/noNotificationsTitle" android:focusable="true" android:layout_width="fill_parent" android:layout_height="wrap_content">
                        <TextView android:textSize="@dimen/status_bar_expanded_notification_category_text_size" android:textColor="@color/notification_category_color" android:gravity="left|center" android:id="@id/noNotificationsText" android:paddingLeft="11.0dip" android:layout_width="fill_parent" android:layout_height="@dimen/status_bar_expanded_notification_category_height" android:text="@string/status_bar_no_notifications_title" />
                    </LinearLayout>
                    <LinearLayout android:orientation="vertical" android:id="@id/onGoingCart" android:background="#ff293945" android:focusable="true" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="@dimen/status_bar_expanded_notification_category_height">
                        <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" />
                    <LinearLayout android:orientation="vertical" android:id="@id/notificationCart" android:background="#ff293945" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="@dimen/status_bar_expanded_notification_category_height">
                        <RelativeLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content">
                            <TextView android:textSize="@dimen/status_bar_expanded_notification_category_text_size" android:textColor="@color/notification_category_color" android:gravity="left|center" android:id="@id/latestNotificationText" android:paddingLeft="11.0dip" android:layout_width="180.0dip" android:layout_height="fill_parent" android:text="@string/status_bar_latest_events_title" android:layout_alignParentLeft="true" />
                            <TextView android:textSize="@dimen/status_bar_expanded_notification_clear_button_text_size" android:textColor="@color/tw_status_bar_clear_btn_text" android:gravity="center" android:id="@id/clear_all_button" android:background="@drawable/tw_btn_default_small" android:padding="0.100000024dip" android:focusable="true" android:clickable="true" android:layout_width="@dimen/status_bar_expanded_clear_button_width" android:layout_height="fill_parent" android:layout_marginRight="4.0dip" android:text="@string/status_bar_clear_all_button" android:layout_alignParentRight="true" android:contentDescription="@string/accessibility_clear_all" />
                        </RelativeLayout>
                    </LinearLayout>
                    <com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/notificationItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/tw_notification_row_min_height" />
                    <com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/latestItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/tw_notification_row_min_height" />
                </LinearLayout>
            </ScrollView>
        </FrameLayout>
        <com.android.systemui.statusbar.phone.CloseDragHandle android:layout_gravity="bottom" android:orientation="vertical" android:id="@id/close" android:layout_width="fill_parent" android:layout_height="@dimen/tw_close_handle_height">
            <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
                <ImageView android:layout_gravity="bottom" android:layout_width="fill_parent" android:layout_height="@dimen/tw_close_handle_height" android:src="@drawable/tw_status_bar_close" android:scaleType="fitXY" />
                <TextView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network" android:gravity="center" android:layout_gravity="bottom" android:id="@id/carrier_label" android:layout_width="fill_parent" android:layout_height="@dimen/tw_close_handle_height" android:layout_marginBottom="10.0dip" />
            </RelativeLayout>
        </com.android.systemui.statusbar.phone.CloseDragHandle>
    </FrameLayout>
    To make life easy, you can simply download the modified tw_status_bar_expanded.xml file and paste it over the original one.
    3. Navigate to res\values\ folder and open ids.xml and add the following line at the end before </resources> line:
    Code:
        <item type="id" name="exp_power_stat">false</item>
    Now you need to recompile SystemUI.apk in order to generate new ids in public.xml file for exp_power_stat. Then decompile the new SystemUI.apk (we are going to work on this one for now) and delete the old one to not cause confusion!!
    4. Navigate to and open smali\com\android\systemui\statusbar\phone\PhoneStatusBar.smali file, now search for ".field mPostCollapseCleanup:Ljava/lang/Runnable;" and add this line bellow it (the blue one here):
    Code:
    .field mPostCollapseCleanup:Ljava/lang/Runnable;
    
    [B][COLOR="Blue"].field mPowerWidget:Lcom/wanam/systemui/quickpanel/PowerWidget;[/COLOR][/B]
    
    .field mQueueLock:Ljava/lang/Object;
    5. Still in PhoneStatusBar.smali, search for ".method public addIcon" and add these lines (the blue ones) at the end of this method before the "return-void" line:
    Code:
        invoke-virtual {v1, v0, p3, v2}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;ILandroid/view/ViewGroup$LayoutParams;)V
    
        .line 1170
        [B][COLOR="Blue"]iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/wanam/systemui/quickpanel/PowerWidget;
    
        invoke-virtual {v1}, Lcom/wanam/systemui/quickpanel/PowerWidget;->updateWidget()V[/COLOR][/B]
    
        return-void
    .end method
    6. Still in PhoneStatusBar.smali, search for ".method protected makeStatusBarView", then search for "Landroid/widget/ScrollView;->setVerticalScrollBarEnabled(Z)V" and add these lines (the blue ones) bellow it:
    Code:
        invoke-virtual {v9, v10}, Landroid/widget/ScrollView;->setVerticalScrollBarEnabled(Z)V
    
        [B][COLOR="Blue"]move-object/from16 v0, p0
    
        iget-object v9, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
    
        const v10, [COLOR="Purple"]0x7fxxxxxx[/COLOR]
    
        invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
    
        move-result-object v9
    
        check-cast v9, Lcom/wanam/systemui/quickpanel/PowerWidget;
    
        move-object/from16 v0, p0
    
        iput-object v9, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/wanam/systemui/quickpanel/PowerWidget;[/COLOR][/B]
    
        .line 714
        new-instance v9, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;
    N.B: You should use the newly generated id in public.xml (in res\values folder) for "exp_power_stat" in place of 0x7fxxxxxx
    7. Still in PhoneStatusBar.smali, search for "Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;" and add these lines bellow it (the blue ones):
    Code:
        invoke-virtual {v1, v9, v2}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
    
    [B][COLOR="Blue"]    move-object/from16 v0, p0
    
        iget-object v9, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/wanam/systemui/quickpanel/PowerWidget;
    
        invoke-virtual {v9}, Lcom/wanam/systemui/quickpanel/PowerWidget;->setupWidget()V[/COLOR][/B]
    
        .line 875
        sget-boolean v9, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->useTouchWizGUI:Z
    Now save changes and close.
    8. Now we need to edit the head of AndroidManifest.xml in SystemUI.apk and add system status to the main core (this is important step to make Torch and Reboot toggles work!!).
    Before:
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    [B][COLOR="Red"]<manifest android:versionCode="16" android:versionName="4.1.2-N7000XXLSZ" package="com.android.systemui" coreApp="true"[/COLOR][/B]
      xmlns:android="http://schemas.android.com/apk/res/android">
    After:
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    [B][COLOR="Red"]<manifest android:versionCode="16" android:versionName="4.1.2-N7000XXLSZ" package="com.android.systemui" coreApp="true" [COLOR="Blue"]android:sharedUserId="android.uid.system" android:process="system"[/COLOR][/COLOR][/B]
      xmlns:android="http://schemas.android.com/apk/res/android">
    9. Download the following smalis and add them to smali folder in SystemUI.apk (there are 2 wanam folders, put the correct one inside its corresponding folder inside SystemUI.apk\smali folder).
    10. Now we have finished from modifying SystemUI.apk, Recompile AND SIGN the finished project!!!.
    11. Now since SystemUI.apk is signed, it will not work properly until we disable signature check on "services.jar". So backsmali services.jar file and navigate to classout\com\android\server\pm folder and open PackageManagerService.smali and search for ".method static compareSignatures" and change the entire method to:
    Code:
    .method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
        .registers 9
        .parameter "s1"
        .parameter "s2"
    
        .prologue
        const/4 v6, 0x0
    
        const-string v3, "Wanam: PackageManager"
    
        const-string v4, "Skip signature check."
    
        invoke-static {v3, v4}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I
    
        return v6
    
    .end method
    Save changes and recompile (smali) services.jar file.
    12. Download the following system app and resource (LidroidSettings.apk and lidroid-res.apk)
    13. Push all files to your phone and... look to the results :D

    231o.jpg

    232exk.jpg

    233th.jpg


    N.B:
    For those who want to modify Lidroid-res.apk, you need to install the following dependancies, then decompile it and edit apktool.yml file. You will find this:
    Code:
    isFrameworkApk: true
    usesFramework:
      ids:
      - 1
    sdkInfo:
      minSdkVersion: '16'
      targetSdkVersion: '16'
    Add the 3 frameworks (2,3 and 4):
    Code:
    isFrameworkApk: true
    usesFramework:
      ids:
      - 1
    [B][COLOR="Blue"]  - 2
      - 3
      - 4[/COLOR][/B]
    sdkInfo:
      minSdkVersion: '16'
      targetSdkVersion: '16'
    Now you can make your changes and re-compile.


    Notification panel lock screen and recent apps

    1. Decompile SystemUI.apk by APK-Multi tool
    2. Navigate to res\drawable-xhdpi folder and put these new resource images there.
    3. Navigate to res\layout folder and open tw_status_bar_expanded_header.xml and add the following lines (the blue ones):
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:background="#ff000000" android:layout_width="fill_parent" android:layout_height="39.0dip" android:baselineAligned="false"
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
        <com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Clock" android:textColor="#ffffffff" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4.0dip" android:layout_marginTop="-3.0dip" android:singleLine="true" systemui:ampmSmall="true" />
        <com.android.systemui.statusbar.policy.DateView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date" android:textColor="#ffffffff" android:ellipsize="none" android:id="@id/date" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="8.0dip" android:layout_marginRight="4.0dip" android:maxLines="2" />
        <com.android.systemui.statusbar.RotationToggle android:id="@id/rotation_lock_button" android:visibility="gone" android:clickable="true" android:layout_width="32.0dip" android:layout_height="32.0dip" android:layout_margin="8.0dip" android:button="@drawable/ic_notify_rotation" android:contentDescription="@string/accessibility_rotation_lock_off" />
        <Space android:layout_width="0.0dip" android:layout_height="0.0dip" android:layout_weight="1.0" />
        [B][COLOR="Blue"]<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/recent_apps" android:paddingLeft="2.0dip" android:paddingRight="1.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_recent" android:layout_toLeftOf="@id/back" android:contentDescription="@string/accessibility_recent" systemui:keyCode="187" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
        <com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/back" android:paddingLeft="2.0dip" android:paddingRight="3.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lock" android:layout_toLeftOf="@id/settings_button" android:contentDescription="@string/accessibility_back" systemui:keyCode="26" systemui:glowBackground="@drawable/ic_sysbar_highlight" />[/COLOR][/B]
        <ImageView android:layout_width="1.0dip" android:layout_height="25.0dip" android:layout_marginTop="7.0dip" android:layout_marginBottom="7.0dip" android:src="@drawable/tw_quick_panel_plnm_setting_dv" />
        <RelativeLayout android:id="@id/settings_button" android:background="@drawable/tw_quick_panel_setting_button_bg" android:focusable="true" android:visibility="visible" android:layout_width="@dimen/status_bar_expanded_setting_width" android:layout_height="39.0dip">
            <ImageView android:id="@id/settings_button_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/tw_quickpanel_icon_settings" android:scaleType="center" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:contentDescription="@string/accessibility_settings_button" />
        </RelativeLayout>
    </LinearLayout>
    First blue line is for recent apps icon and the second one is for lock screen icon
    4. Save changes, recompile and push to your phone.

    Results:
    resultsreclocksb.png