[Dev][Modding]TW Lollipop, Torch, 5Way reboot, SystemUI patches [more]

Search This thread

Kamy

Senior Member
Aug 29, 2012
5,335
19,304
263
Beijing
Before everything I am still a noob and this is what I read, dig and somehow have been trying to figure out so please be friendly if you got some of/his so-called guides are not complete or need to be more comprehensive. And as sharing is caring I would like to share some hack or patches to make our devices smarter.

Requirement:
  1. apktool. I have been using Advanced ApkTool but there is some problem on Samsung Lollipop on which some apps cannot be decompiled/recompile correctly. Then, I found an apktool kit which is moddified specially for Samsung Lollipop android version and I repacked Advanced ApkTool with the proper apktool.
    You can download it here. credit @BDFreak
  2. Notepad++ program from here
  3. Willing to learn, patience, sense of try and error and a little brain :p

Content:

  • 5Way Reboot TW lollipop
  • Enable Torch Toggle in Settings
  • Add Internet Speed meter on Statusbar
  • Remove Sfinder and Quick Connect from notification panel:
  • 3Minit Battery
  • Add lockscreen and recent shortcut on Notification panel header
  • Move WiFi and Data icons to left side of statusbar
  • 3minit quick launch for TW Lollipop
  • Center Clock on statusbar
  • How to enable other Samsung lockscreen effects
  • Add Flashlight and Screenshot to Power Menu
  • TW Themeing guides
    1. Remove green and orange banner when dialing/receiving calls
    2. How to make Sun shape AOSP brightness handle on notification panel
    3. How to make AOSP category divider on SETTINGS
 
Last edited:

Kamy

Senior Member
Aug 29, 2012
5,335
19,304
263
Beijing
5Way Reboot TW

Marshmallow

See here


Lollipop

Credit @darkera13 from http://samsungviet.vn/ :good:
And thanks @daxgirl for some hints :good:
I thought here is good place to post and keep some guides for future modifications.

Decompile android.policy.jar and go to smali /com/android/internal/policy/impl/GlobalActions.smali

Search:

Code:
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$[COLOR="SeaGreen"]8[/COLOR];

Change to:

Code:
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$[COLOR="Red"]99[/COLOR];

Search:

Code:
invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$[COLOR="SeaGreen"]8[/COLOR];-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

Change to:

Code:
invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$[COLOR="red"]99[/COLOR];-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V


Save this file and now open smali/com/android/internal/policy/impl/GlobalActions $ SinglePressAction.smali

Search:

Code:
# Instance fields

Add following in red above it

Code:
[COLOR="SeaGreen"].end annotation[/COLOR]


# static fields
[COLOR="Red"].field public static rebootMode:I

.field public static final rebootOptions:[Ljava/lang/String;

.field public static final rebootString:[Ljava/lang/String;[/COLOR]


[COLOR="SeaGreen"]# instance fields
.field public customAction:I[/COLOR]

Search:

Code:
.method protected constructor <init>(II)V

Add entire method above it

Code:
# direct methods
.method static constructor <clinit>()V
    .locals 9

    const/4 v8, 0x5

    const/4 v7, 0x4

    const/4 v6, 0x3

    const/4 v5, 0x2

    const/4 v4, 0x1

    const/4 v3, 0x0

    new-array v0, v8, [Ljava/lang/String;

    const-string v2, "Reboot"

    aput-object v2, v0, v3

    const-string v2, "Hot Reboot"

    aput-object v2, v0, v4

    const-string v2, "Download"

    aput-object v2, v0, v5

    const-string v2, "Recovery"

    aput-object v2, v0, v6

    const-string v2, "Safe Mode"

    aput-object v2, v0, v7

    sput-object v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootString:[Ljava/lang/String;

    new-array v1, v8, [Ljava/lang/String;

    const-string v2, "Reboot"

    aput-object v2, v1, v3

    const-string v2, "Hot Reboot"

    aput-object v2, v1, v4

    const-string v2, "Download"

    aput-object v2, v1, v5

    const-string v2, "Recovery"

    aput-object v2, v1, v6

    const-string v2, "Safe Mode"

    aput-object v2, v1, v7

    sput-object v1, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;

    return-void
.end method

[COLOR="SeaGreen"].method protected constructor <init>(II)V[/COLOR]

Save. Now download attached files and copy them into smali/com/android/internal/policy/impl/here.

Make sure Lcom/android/internal/policy/impl/GlobalActions got the same access$, it's access$500 at my end it might be different in different devices. Compare GlobalActions.smali with GlobalActions$99.smali
There is an id in GlobalActions$99;
Code:
const v2, [COLOR="Red"]0x112000a[/COLOR]
that also needs to be same as in framework>public
Code:
<public type="bool" name="show_ongoing_ime_switcher" id="0x0112000a" />


Recompile and profit.
If you would like to change power menu's title, open GlobalActions$99.smali
Search for
Code:
const-string v2, "[COLOR="Red"]Reboot Options[/COLOR]"
and change it to whatever you wish
 

Attachments

  • Screenshot_2015-01-08-09-12-54.jpg
    Screenshot_2015-01-08-09-12-54.jpg
    124 KB · Views: 34,218
  • smali.zip
    2.9 KB · Views: 6,931
Last edited:

Kamy

Senior Member
Aug 29, 2012
5,335
19,304
263
Beijing
Enable Torch Toggle in Settings



Integrate In Settings

edit 1: Smali's are updated to cover all TW devices thanks @tdunham :good:
edit 2: Smali's are updated for Android MM compatibilty thanks @tdunham @edzamber :good:
Decompile Settings
Download attached torch_materials.zip and paste them accordingly

Go to values folder open arrays.xml and check whether following arrays are availble if not add them

Code:
    <string-array name="torchlight_timeout_entries">
        <item>15 seconds</item>
        <item>30 seconds</item>
        <item>1 minute</item>
        <item>2 minutes</item>
        <item>10 minutes</item>
    </string-array>
    <string-array name="torchlight_timeout_values">
        <item>15000</item>
        <item>30000</item>
        <item>60000</item>
        <item>120000</item>
        <item>600000</item>
    </string-array>

Go to values folder open plurals.xml and check whether you have following plurals if not add them

Code:
    </plurals>
    <plurals name="torchlight_timeout_minutes">
        <item quantity="other">%d minutes</item>
        <item quantity="one">1 minute</item>
    </plurals>
    <plurals name="torchlight_timeout_seconds">
        <item quantity="other">%d seconds</item>
        <item quantity="one">1 second</item>
    </plurals>

Go to values folder open strings.xml and check whether you have following strings if not add them

Code:
    <string name="torchlight_settings">Torch light</string>
    <string name="torchlight_settings_title">Torch light</string>
    <string name="torchlight_summary">Turn on the torch light by pressing and holding the volume up key while the screen is off.</string>
    <string name="torchlight_timeout_title">Torch light time-out</string>
    <string name="torchlight_timeout_summary">After %1$s</string>

Go to xml folder, open device_headers.xml and add following line in red

Code:
   [COLOR="Red"] </header>
    <header android:icon="@drawable/ic_settings_torchlight" android:id="@id/torchlight_settings" android:title="@string/torchlight_settings" android:fragment="com.android.settings.torchlight.TorchlightSettings" />[/COLOR]
    <header android:icon="@drawable/ic_settings_powersaving" android:id="@id/power_saving_mode" android:title="@string/power_saving_mode_title" android:fragment="com.android.settings.powersavingmode.MenuPowerSavingModeSettings" />

add red line below in display_settings_2013.xml.

Code:
    <CheckBoxPreference android:title="@string/intelligent_sleep_title" android:key="smartscreen_stay" android:summary="@string/intelligent_sleep_summary" />
    [COLOR="Red"]<PreferenceScreen android:title="Torchlight" android:key="[COLOR="red"]torchlight[/COLOR]" android:fragment="com.android.settings.torchlight.TorchlightSettings" />[/COLOR]
    <CheckBoxPreference android:title="@string/smart_pause_title" android:key="smartscreen_pause" android:summary="@string/smart_pause_summary" />


Now it's time to create ids, so recompile and rename settings as settings_new to avoid confusion
Now decompile settings_new
Go to TorchlightSettings.smali
Open public.xml too and check what I noted beside every id, match ids accordingly
Recompile and profit >



Integrate in ROM Control (MM)


Code:
      <SwitchPreference 
              android:title="Torchlight" 
              android:key="[COLOR="Red"]torchlight_enable[/COLOR]" 
              android:summary="Turn on the torch light by pressing and holding the volume up key while the screen is off" android:defaultValue="0" />
      <com.[COLOR="Red"]aryamod[/COLOR].romcontrol.prefs.MyListPreference 
              android:entries="@array/torchlight_timeout_entries" 
              android:title="@string/torchlight_timeout_title" 
              android:key="torchlight_timeout" 
              android:dependency="torchlight_enable"
              android:entryValues="@array/torchlight_timeout_values" />





Add Auto Start Management


This mod would let you choose to prevent/allow selected apps of running on system startup.
Download attached zip and drop those files in your settings.
Now go to values open ids.xml and add following

Code:
    <item type="id" name="autostarts_settings">false</item>
    <item type="id" name="appName">false</item>
    <item type="id" name="aryamod">false</item>

open strings.xml and add following:

Code:
    <string name="autostarts_title">Autostarts</string>
    <string name="autostarts_allowed">Has allowed</string>
    <string name="autostarts_prohibited">Has prohibited</string>
    <string name="autostarts_allow_progress_msg">Being restored boot, please wait...</string>
    <string name="autostarts_prohibit_progress_msg">Prohibit boot, please wait...</string>
    <string name="autostarts_empty_msg">No installation boot applications</string>
    <string name="autostarts_optimize_empty_msg">No optimize the startup items</string>
    <string name="autostarts_optimize_btn_title">Optimize the startup items</string>
    <string name="autostarts_all_btn_title">Automatically Start All Applications</string>

You also need to add a header for it, which can be added anywhere in settings depending on your preference, I added in DEVICE tab like below:
Add line below in display_headers.xml.

Code:
    <header android:icon="@drawable/ic_settings_autostarts" android:id="@id/aryamod" android:title="@string/autostarts_title" android:fragment="com.android.settings.autostarts.LewaManageAutostarts" />

Now it's time to produce ID, so recompile modified settings and decompile it again, go to autostart smali materials and check those IDs which I noted (starting with #<public type="...) in those smali, there might be several to check and match with your produced IDs.



How to enable UPSM for Note 3

In this guide we would mod service.jar and secsettings.apk, firstly download UPSM.zip and put EmergencyLauncher, EmergencyModeService and EmergencyProvider in app folder in attached zip.
service.jar

decompile service.jar and go to services\com\android\server
open SystemServer.smali and search for

Code:
.method static final startEmergencyModeService(Landroid/content/Context;)V

and change the entire method with following:

Code:
.method static final startEmergencyModeService(Landroid/content/Context;)V
     .registers 6

     :try_start_0
     invoke-static {p0}, Lcom/sec/android/emergencymode/EmergencyManager;->getInstance(Landroid/content/Context;)Lcom/sec/android/emergencymode/EmergencyManager;

     move-result-object v1

     invoke-virtual {v1}, Lcom/sec/android/emergencymode/EmergencyManager;->readyEmergencyMode()V
     :try_end_7
     .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_7} :catch_8

     :goto_7
     return-void

     :catch_8
     move-exception v0

     const-string v2, "SystemServer"

     new-instance v3, Ljava/lang/StringBuilder;

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

     const-string v4, "Starting emergency service failed: "

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

     move-result-object v3

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

     move-result-object v3

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

     move-result-object v3

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

     goto :goto_7
 .end method
OK now UPSM is enabled but there is a issue that after disabling it some widgets would be removed from the home screen so we need to correct the service

go to services\com\android\server\appwidget
open AppWidgetServiceImpl.smali and search for following method

Code:
.method private deleteProviderLocked(Lcom/android/server/appwidget/AppWidgetServiceImpl$Provider;)V

Now change the entire method the one in zip attached

same smali search for

Code:
.method private queryIntentReceivers(Landroid/content/Intent;I)Ljava/util/List;

change the entire method the one in zip attached

Search for this method

Code:
.method private readProfileStateFromFileLocked(Ljava/io/FileInputStream;ILjava/util/List;)I

change the entire method the one in zip attached


SecSettings.apk


Next we need to enable and access UPSM launcher that depends on you whether you have your own rom customizer or would like to add it in settings, I couldn't find proper smali to enable it as stock but I tired adding it in settings as following
decompile secsettings and add this in id.xml
Code:
    <item type="id" name="aryamod">false</item>

open display_headers.xml and add UPSM header everywhere you would like to be shown like this:

Code:
    <header android:icon="@drawable/ic_settings_powersaving" android:id="@id/aryamod" android:title="@string/powersaving_ultra" android:key="ultra_powersaving" android:fragment="com.android.settings.powersavingmode.PowerSavingModeUltra" />
 

Attachments

  • Screenshot_2015-01-08-21-36-23.jpg
    Screenshot_2015-01-08-21-36-23.jpg
    127.9 KB · Views: 25,212
  • Screenshot_2015-01-08-21-36-43.jpg
    Screenshot_2015-01-08-21-36-43.jpg
    246.5 KB · Views: 25,212
  • Screenshot_2015-01-08-21-36-59.jpg
    Screenshot_2015-01-08-21-36-59.jpg
    194.7 KB · Views: 24,828
  • UPSM.zip
    780.2 KB · Views: 984
  • torchlight_updated.zip
    6.6 KB · Views: 1,217
  • torchlight_MM.zip
    6.8 KB · Views: 456
Last edited:

Kamy

Senior Member
Aug 29, 2012
5,335
19,304
263
Beijing
Add Internet Speed meter on Statusbar


Decompile SystemUI.apk
Go to SystemUI.apk\res\layout open system_icons.xml
Add following line in red
Code:
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" android:paddingStart="2.0dip">
[COLOR="Red"]	<com.android.systemui.statusbar.policy.Traffic android:textAppearance="@style/TextAppearance.StatusBar.Traffic" android:gravity="left|center" android:id="@id/traffic" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />[/COLOR]
        <include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="2.0dip" android:layout_marginEnd="@dimen/rssi_battery_gap" layout="@layout/signal_cluster_view" />

Go to Values folder and add this in styles.xml
Code:
        <style name="TextAppearance.StatusBar.Traffic" parent="@style/TextAppearance.StatusBar.Clock">
        <item name="android:textSize">12.0dip</item>
        <item name="android:textStyle">normal</item>
        <item name="android:textColor">#bfffffff</item>
        <item name="android:textAllCaps">false</item>
    </style>

Open ids.xml and add following line at the bottom of page:
Code:
<item type="id" name="traffic">false</item>

copy the smali files to
smali/com/android/systemui/statusbar/policy/
Recompile and profit.
Additional Step about How to move Internet Speed meter to left side on Statusbar: Read here

[MOD] [GUIDE] Status Bar Network Traffic (Separate In/Out)



Remove Sfinder and Quick Connect from notification panel:



3Minit Battery

How to add 3minit battery as this patch is changed on lollipop
You need to add red line in system_icons.xml, the rest (copying smali part) is same as the guide in main thread

Go to SystemUI.apk\res\layout and open system_icons.xml

Make sure it looks like this:

Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:gravity="center_vertical" android:id="@id/system_icons" android:layout_width="wrap_content" android:layout_height="fill_parent"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <com.android.keyguard.AlphaOptimizedLinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" android:alpha="0.74" />
    <LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" android:paddingStart="2.0dip">
        <include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="2.0dip" android:layout_marginEnd="@dimen/rssi_battery_gap" layout="@layout/signal_cluster_view" />
        <TextView android:textSize="@dimen/battery_text_size" android:textColor="@color/battery_text_color" android:layout_gravity="center" android:id="@id/battery_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:alpha="0.74" android:importantForAccessibility="no" android:fontFamily="sans-serif" android:layout_marginStart="@dimen/battery_text_marginStart" />
       [COLOR="red"] <com.android.systemui.BatteryMeterView android:id="@id/battery" android:layout_width="0.0dip" android:layout_height="0.0dip" android:layout_marginBottom="@dimen/battery_icon_bottom_margin" android:alpha="0.74" android:layout_marginStart="3.0dip" />
        <com.android.systemui.statusbar.policy.MinitBattery android:layout_width="wrap_content" android:layout_height="wrap_content"[/COLOR] />
    </LinearLayout>
</LinearLayout>



Move WiFi and Data icons to left side of statusbar


Decompile SystemUI, go to layout and open system_icons.xml

Search for
Code:
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="2.0dip" android:layout_marginEnd="@dimen/rssi_battery_gap" layout="@layout/signal_cluster_view" />

Change it to
Code:
<include android:id="@id/signal_cluster" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="2.0dip" android:layout_marginEnd="@dimen/rssi_battery_gap" layout="@layout/signal_cluster_view" />

Go to status_bar.xml

Add following line in red

Code:
           <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/operatorLogoIcon_org" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo_org" />          
               [COLOR="Red"]<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginBottom="-5.0dip" android:layout_marginLeft="-5.0dip" layout="@layout/signal_cluster_view" />[/COLOR]
Now download my modified signal_cluster_view.xml and check with yours

Save, recompile.


3minit quick launch for TW Lollipop



Firstly go download 3minit quick launcher smali from main thread
As there are some changes in lollipop which is not same as the guide in the original thread we are going to edit our file as below.
SystemUI.apk\res\layout open quick_connect_layout_zero.xml

Make sure it's like following:
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:orientation="vertical" android:id="@id/sfinder_qconnect_layout" android:background="@drawable/quick_connect_layout_bg" android:layout_width="fill_parent" android:layout_height=[COLOR="red"]"wrap_content"[/COLOR]
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
[COLOR="Red"]    <HorizontalScrollView android:scrollbars="none" android:layout_width="fill_parent" android:layout_height="@dimen/finder_connect_layout_height">
        <com.android.systemui.statusbar.policy.quicklaunch.QuickLaunchContainer android:gravity="center" android:layout_width="wrap_content" android:layout_height="@dimen/finder_connect_layout_height" android:layout_centerHorizontal="true" />
    </HorizontalScrollView>[/COLOR]
    <LinearLayout android:orientation="vertical" android:id="@id/sfinder_qconnect_layout" android:focusable="true" android:descendantFocusability="afterDescendants" android:layout_width="0.0dip" android:layout_height="0.0dip">
        <LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:paddingLeft="@dimen/finder_connect_button_padding_right" android:paddingTop="@dimen/finder_connect_button_padding_top" android:paddingRight="@dimen/finder_connect_button_padding_left" android:paddingBottom="@dimen/finder_connect_button_padding_bottom" android:focusable="true" android:descendantFocusability="afterDescendants" android:layout_width="0.0dip" android:layout_height="0.0dip">
            <RelativeLayout android:id="@id/sfinder_button_layout" android:background="@drawable/ripple_drawable" android:focusable="true" android:nextFocusLeft="@id/quick_connect_button_layout" android:nextFocusRight="@id/quick_connect_button_layout" android:clickable="true" android:layout_width="0.0dip" android:layout_height="@dimen/finder_connect_button_height" android:layout_weight="0.0" android:layout_marginEnd="0.0dip">
                <TextView android:textSize="@dimen/tw_quick_panel_sfinder_qconnect_button_text_size" android:textColor="@drawable/tw_quick_panel_sfinder_qconnect_button_text_color" android:gravity="center" android:id="@id/sfinder_button_big" android:layout_width="0.0dip" android:layout_height="0.0dip" android:text="@string/accessibility_sfinder_button" android:singleLine="true" android:drawableLeft="@drawable/tw_quick_panel_quick_sfinder_button_image" android:drawablePadding="@dimen/tw_quick_panel_sfinder_qconnect_drawable_padding" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:fontFamily="sec-roboto-light" />
            </RelativeLayout>
            <ImageView android:id="@id/expanded_divider_3" android:background="@color/quickpanel_button_divider_color" android:layout_width="0.0dip" android:layout_height="0.0dip" android:layout_marginTop="0.0dip" android:layout_marginBottom="0.0dip" android:alpha="@dimen/quickpanel_button_divider_alpha" android:layout_toStartOf="@id/sfinder_button_layout" />
            <RelativeLayout android:id="@id/quick_connect_button_layout" android:background="@drawable/ripple_drawable" android:focusable="true" android:nextFocusLeft="@id/sfinder_button_layout" android:nextFocusRight="@id/sfinder_button_layout" android:clickable="true" android:layout_width="0.0dip" android:layout_height="0.0dip" android:layout_weight="0.0" android:layout_marginStart="0.0dip">
                <TextView android:textSize="@dimen/tw_quick_panel_sfinder_qconnect_button_text_size" android:textColor="@drawable/tw_quick_panel_sfinder_qconnect_button_text_color" android:gravity="center" android:id="@id/qconnect_button_big" android:layout_width="0.0dip" android:layout_height="0.0dip" android:text="@string/accessibility_qconnect_button" android:singleLine="true" android:drawableLeft="@drawable/tw_quick_panel_quick_qconnect_button_image" android:drawablePadding="@dimen/tw_quick_panel_sfinder_qconnect_drawable_padding" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:fontFamily="sec-roboto-light" />
            </RelativeLayout>
        </LinearLayout>
    </LinearLayout>
</LinearLayout>
As we are removing Sfinder and Quick Connect for better interface all dpi regarding to Sfinder and Quick Connect should be set to 0 so check them all.

Now as 3minit quick launcher is bigger than Sfinder and Quick connect we need to modify that area related to those buttons to fit 3minit launcher
So go to values and open dimens.xml

Search for
Code:
<dimen name="finder_connect_layout_height">[COLOR="red"]57.0dip[/COLOR]</dimen>

Change to

Code:
<dimen name="finder_connect_layout_height">[COLOR="red"]75.0dip[/COLOR]</dimen>


Center Clock on statusbar



How to make a round corner for recent apps window



SystemUI.apk>dimens.xml

Change

Code:
    <dimen name="recents_task_view_rounded_corners_radius">2.0dip</dimen>

to

Code:
    <dimen name="recents_task_view_rounded_corners_radius">20.0dip</dimen>

credit @tkari4
 

Attachments

  • SpeedMeter.rar
    5.6 KB · Views: 3,026
  • home_lock_patch.zip
    1.8 KB · Views: 1,287
  • signal_cluster_view.txt
    4.5 KB · Views: 2,154
Last edited:

Kamy

Senior Member
Aug 29, 2012
5,335
19,304
263
Beijing
Last edited:

Kamy

Senior Member
Aug 29, 2012
5,335
19,304
263
Beijing
Remove green and orange banner when dialing/receiving calls




How to make Sun shape AOSP brightness handle on notification panel




How to make AOSP category divider on SETTINGS




How to change Action bar color:

Look for following in framework\color.xml

Code:
    <color name="material_blue_grey_800">  tab background 
    <color name="material_blue_grey_900"> status bar background

Thanks @Breakcore_Rush for themeing guides
 
Last edited:

the_ape

Senior Member
May 30, 2005
764
295
0
www.nakedcleaner.com
3Minit Battery

In res/layout/system_icons.xml

PHP:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:gravity="center_vertical" android:id="@id/system_icons" android:layout_width="wrap_content" android:layout_height="fill_parent"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <com.android.keyguard.AlphaOptimizedLinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" android:alpha="0.74" />
    <LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" android:paddingStart="2.0dip">
        <include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="2.0dip" android:layout_marginEnd="@dimen/rssi_battery_gap" layout="@layout/signal_cluster_view" />
        <TextView android:textSize="@dimen/battery_text_size" android:textColor="@color/battery_text_color" android:layout_gravity="center" android:id="@id/battery_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:alpha="0.74" android:importantForAccessibility="no" android:fontFamily="sans-serif" android:layout_marginStart="@dimen/battery_text_marginStart" />
        <com.android.systemui.BatteryMeterView android:id="@id/battery" android:layout_width="0.0dip" android:layout_height="0.0dip" android:layout_marginBottom="@dimen/battery_icon_bottom_margin" android:alpha="0.74" android:layout_marginStart="3.0dip" />
        <com.android.systemui.statusbar.policy.MinitBattery android:layout_width="wrap_content" android:layout_height="wrap_content" />
    </LinearLayout>
</LinearLayout>
 

etheryli

Senior Member
Apr 20, 2014
52
33
0
Figuring out AOSP Lollipop icons

Hi, do you guys know how to figure out implementing AOSP Wifi, Data, and Battery vector xmls like on Stock Lollipop? I see that the codes are already there when comparing SystemUI with a 5.0 Nexus 5's ROM, but I don't have time to figure out how it is implemented. Thanks!:)
 

Kamy

Senior Member
Aug 29, 2012
5,335
19,304
263
Beijing
@kmokhtar79
Do I have to sign & zipalign apk after recompiling?

There is no png file in lock_lock_patch.rar
Do NOT use sign for system files. After modification is done open your modded file and original file, drag and drop META-INF and AndroidManifs.xml from original one to modded one without extracting it. Sometimes app signature is corrupted after compilation. This would fix it. There are 2 white png file that you may not notice them just select all in folder they would be highlighted.

Edit: You you are correct, corrected home_lock_patch.zip.
Sent from my SM-N9005 using Tapatalk
 
Last edited:

nasif69

Senior Member
Sep 27, 2012
318
44
58
Dhaka
Do NOT use sign for system files. After modification is done open your modded file and original file, drag and drop META-INF and AndroidManifs.xml from original one to modded one without extracting it. Sometimes app signature is corrupted after compilation. This would fix it. There are 2 white png file that you may not notice them just select all in folder they would be highlighted.

Edit: You you are correct, corrected home_lock_patch.zip.
Sent from my SM-N9005 using Tapatalk

Thanks.

Do I have to recompile & zipalign?

---------- Post added at 12:30 PM ---------- Previous post was at 11:57 AM ----------

@kmokhtar79
It works. But only lock screen & homebutton. No recent apps.
What I have to do for recent apps?
 

Kamy

Senior Member
Aug 29, 2012
5,335
19,304
263
Beijing
Mate can u add only speed network meter for this systemui.apk on this thread by Djimmy please
http://forum.xda-developers.com/showthread.php?t=2982939

Sent from my SM-N9005 using Tapatalk

I am sorry mate, this thread is supposed to be modding thread, you just try following guides any step you got problem just post your problem and me or others would help you. I did it last night according to the same mentioned steps.
 
  • Like
Reactions: not-i

thereassaad

Recognized Contributor
Aug 22, 2013
7,620
9,713
263
Bierut
I am sorry mate, this thread is supposed to be modding thread, you just try following guides any step you got problem just post your problem and me or others would help you. I did it last night according to the same mentioned steps.

Okay thanks btw my don't have laptop for 2 week its on service center thanks i will try to do it by apktool.apk from my phone thanks

Sent from my SM-N9005 using Tapatalk
 

Top Liked Posts

  • There are no posts matching your filters.
  • 90
    Before everything I am still a noob and this is what I read, dig and somehow have been trying to figure out so please be friendly if you got some of/his so-called guides are not complete or need to be more comprehensive. And as sharing is caring I would like to share some hack or patches to make our devices smarter.

    Requirement:
    1. apktool. I have been using Advanced ApkTool but there is some problem on Samsung Lollipop on which some apps cannot be decompiled/recompile correctly. Then, I found an apktool kit which is moddified specially for Samsung Lollipop android version and I repacked Advanced ApkTool with the proper apktool.
      You can download it here. credit @BDFreak
    2. Notepad++ program from here
    3. Willing to learn, patience, sense of try and error and a little brain :p

    Content:

    • 5Way Reboot TW lollipop
    • Enable Torch Toggle in Settings
    • Add Internet Speed meter on Statusbar
    • Remove Sfinder and Quick Connect from notification panel:
    • 3Minit Battery
    • Add lockscreen and recent shortcut on Notification panel header
    • Move WiFi and Data icons to left side of statusbar
    • 3minit quick launch for TW Lollipop
    • Center Clock on statusbar
    • How to enable other Samsung lockscreen effects
    • Add Flashlight and Screenshot to Power Menu
    • TW Themeing guides
      1. Remove green and orange banner when dialing/receiving calls
      2. How to make Sun shape AOSP brightness handle on notification panel
      3. How to make AOSP category divider on SETTINGS
    63
    Advanced ApkToo for Samsung Lollipop

    Regarding to apktool kit which for some users is not possible to decompile/recompile some system apps like contact I found a proper apktool kit and as I had been using Advanced ApkTool which is now not fully compatible with Samsung lollipop apps, I decided to repack it with the modified version of apktool to be using for Samsung lollipop apps without any issue.

    Download: Advanced+ApkTool+v4.1.0+By+BDFreak+Repackecd+By+Kmokhtar79.zip
    MD5: dde13a315a95c28f1cb6721429f42b3f​

    All credit goes to @BDFreak
    54
    Add Internet Speed meter on Statusbar


    Decompile SystemUI.apk
    Go to SystemUI.apk\res\layout open system_icons.xml
    Add following line in red
    Code:
    <LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" android:paddingStart="2.0dip">
    [COLOR="Red"]	<com.android.systemui.statusbar.policy.Traffic android:textAppearance="@style/TextAppearance.StatusBar.Traffic" android:gravity="left|center" android:id="@id/traffic" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />[/COLOR]
            <include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="2.0dip" android:layout_marginEnd="@dimen/rssi_battery_gap" layout="@layout/signal_cluster_view" />

    Go to Values folder and add this in styles.xml
    Code:
            <style name="TextAppearance.StatusBar.Traffic" parent="@style/TextAppearance.StatusBar.Clock">
            <item name="android:textSize">12.0dip</item>
            <item name="android:textStyle">normal</item>
            <item name="android:textColor">#bfffffff</item>
            <item name="android:textAllCaps">false</item>
        </style>

    Open ids.xml and add following line at the bottom of page:
    Code:
    <item type="id" name="traffic">false</item>

    copy the smali files to
    smali/com/android/systemui/statusbar/policy/
    Recompile and profit.
    Additional Step about How to move Internet Speed meter to left side on Statusbar: Read here

    [MOD] [GUIDE] Status Bar Network Traffic (Separate In/Out)



    Remove Sfinder and Quick Connect from notification panel:



    3Minit Battery

    How to add 3minit battery as this patch is changed on lollipop
    You need to add red line in system_icons.xml, the rest (copying smali part) is same as the guide in main thread

    Go to SystemUI.apk\res\layout and open system_icons.xml

    Make sure it looks like this:

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout android:gravity="center_vertical" android:id="@id/system_icons" android:layout_width="wrap_content" android:layout_height="fill_parent"
      xmlns:android="http://schemas.android.com/apk/res/android">
        <com.android.keyguard.AlphaOptimizedLinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" android:alpha="0.74" />
        <LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" android:paddingStart="2.0dip">
            <include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="2.0dip" android:layout_marginEnd="@dimen/rssi_battery_gap" layout="@layout/signal_cluster_view" />
            <TextView android:textSize="@dimen/battery_text_size" android:textColor="@color/battery_text_color" android:layout_gravity="center" android:id="@id/battery_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:alpha="0.74" android:importantForAccessibility="no" android:fontFamily="sans-serif" android:layout_marginStart="@dimen/battery_text_marginStart" />
           [COLOR="red"] <com.android.systemui.BatteryMeterView android:id="@id/battery" android:layout_width="0.0dip" android:layout_height="0.0dip" android:layout_marginBottom="@dimen/battery_icon_bottom_margin" android:alpha="0.74" android:layout_marginStart="3.0dip" />
            <com.android.systemui.statusbar.policy.MinitBattery android:layout_width="wrap_content" android:layout_height="wrap_content"[/COLOR] />
        </LinearLayout>
    </LinearLayout>



    Move WiFi and Data icons to left side of statusbar


    Decompile SystemUI, go to layout and open system_icons.xml

    Search for
    Code:
    <include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="2.0dip" android:layout_marginEnd="@dimen/rssi_battery_gap" layout="@layout/signal_cluster_view" />

    Change it to
    Code:
    <include android:id="@id/signal_cluster" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="2.0dip" android:layout_marginEnd="@dimen/rssi_battery_gap" layout="@layout/signal_cluster_view" />

    Go to status_bar.xml

    Add following line in red

    Code:
               <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/operatorLogoIcon_org" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo_org" />          
                   [COLOR="Red"]<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginBottom="-5.0dip" android:layout_marginLeft="-5.0dip" layout="@layout/signal_cluster_view" />[/COLOR]
    Now download my modified signal_cluster_view.xml and check with yours

    Save, recompile.


    3minit quick launch for TW Lollipop



    Firstly go download 3minit quick launcher smali from main thread
    As there are some changes in lollipop which is not same as the guide in the original thread we are going to edit our file as below.
    SystemUI.apk\res\layout open quick_connect_layout_zero.xml

    Make sure it's like following:
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout android:orientation="vertical" android:id="@id/sfinder_qconnect_layout" android:background="@drawable/quick_connect_layout_bg" android:layout_width="fill_parent" android:layout_height=[COLOR="red"]"wrap_content"[/COLOR]
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
    [COLOR="Red"]    <HorizontalScrollView android:scrollbars="none" android:layout_width="fill_parent" android:layout_height="@dimen/finder_connect_layout_height">
            <com.android.systemui.statusbar.policy.quicklaunch.QuickLaunchContainer android:gravity="center" android:layout_width="wrap_content" android:layout_height="@dimen/finder_connect_layout_height" android:layout_centerHorizontal="true" />
        </HorizontalScrollView>[/COLOR]
        <LinearLayout android:orientation="vertical" android:id="@id/sfinder_qconnect_layout" android:focusable="true" android:descendantFocusability="afterDescendants" android:layout_width="0.0dip" android:layout_height="0.0dip">
            <LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:paddingLeft="@dimen/finder_connect_button_padding_right" android:paddingTop="@dimen/finder_connect_button_padding_top" android:paddingRight="@dimen/finder_connect_button_padding_left" android:paddingBottom="@dimen/finder_connect_button_padding_bottom" android:focusable="true" android:descendantFocusability="afterDescendants" android:layout_width="0.0dip" android:layout_height="0.0dip">
                <RelativeLayout android:id="@id/sfinder_button_layout" android:background="@drawable/ripple_drawable" android:focusable="true" android:nextFocusLeft="@id/quick_connect_button_layout" android:nextFocusRight="@id/quick_connect_button_layout" android:clickable="true" android:layout_width="0.0dip" android:layout_height="@dimen/finder_connect_button_height" android:layout_weight="0.0" android:layout_marginEnd="0.0dip">
                    <TextView android:textSize="@dimen/tw_quick_panel_sfinder_qconnect_button_text_size" android:textColor="@drawable/tw_quick_panel_sfinder_qconnect_button_text_color" android:gravity="center" android:id="@id/sfinder_button_big" android:layout_width="0.0dip" android:layout_height="0.0dip" android:text="@string/accessibility_sfinder_button" android:singleLine="true" android:drawableLeft="@drawable/tw_quick_panel_quick_sfinder_button_image" android:drawablePadding="@dimen/tw_quick_panel_sfinder_qconnect_drawable_padding" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:fontFamily="sec-roboto-light" />
                </RelativeLayout>
                <ImageView android:id="@id/expanded_divider_3" android:background="@color/quickpanel_button_divider_color" android:layout_width="0.0dip" android:layout_height="0.0dip" android:layout_marginTop="0.0dip" android:layout_marginBottom="0.0dip" android:alpha="@dimen/quickpanel_button_divider_alpha" android:layout_toStartOf="@id/sfinder_button_layout" />
                <RelativeLayout android:id="@id/quick_connect_button_layout" android:background="@drawable/ripple_drawable" android:focusable="true" android:nextFocusLeft="@id/sfinder_button_layout" android:nextFocusRight="@id/sfinder_button_layout" android:clickable="true" android:layout_width="0.0dip" android:layout_height="0.0dip" android:layout_weight="0.0" android:layout_marginStart="0.0dip">
                    <TextView android:textSize="@dimen/tw_quick_panel_sfinder_qconnect_button_text_size" android:textColor="@drawable/tw_quick_panel_sfinder_qconnect_button_text_color" android:gravity="center" android:id="@id/qconnect_button_big" android:layout_width="0.0dip" android:layout_height="0.0dip" android:text="@string/accessibility_qconnect_button" android:singleLine="true" android:drawableLeft="@drawable/tw_quick_panel_quick_qconnect_button_image" android:drawablePadding="@dimen/tw_quick_panel_sfinder_qconnect_drawable_padding" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:fontFamily="sec-roboto-light" />
                </RelativeLayout>
            </LinearLayout>
        </LinearLayout>
    </LinearLayout>
    As we are removing Sfinder and Quick Connect for better interface all dpi regarding to Sfinder and Quick Connect should be set to 0 so check them all.

    Now as 3minit quick launcher is bigger than Sfinder and Quick connect we need to modify that area related to those buttons to fit 3minit launcher
    So go to values and open dimens.xml

    Search for
    Code:
    <dimen name="finder_connect_layout_height">[COLOR="red"]57.0dip[/COLOR]</dimen>

    Change to

    Code:
    <dimen name="finder_connect_layout_height">[COLOR="red"]75.0dip[/COLOR]</dimen>


    Center Clock on statusbar



    How to make a round corner for recent apps window



    SystemUI.apk>dimens.xml

    Change

    Code:
        <dimen name="recents_task_view_rounded_corners_radius">2.0dip</dimen>

    to

    Code:
        <dimen name="recents_task_view_rounded_corners_radius">20.0dip</dimen>

    credit @tkari4
    53
    5Way Reboot TW

    Marshmallow

    See here


    Lollipop

    Credit @darkera13 from http://samsungviet.vn/ :good:
    And thanks @daxgirl for some hints :good:
    I thought here is good place to post and keep some guides for future modifications.

    Decompile android.policy.jar and go to smali /com/android/internal/policy/impl/GlobalActions.smali

    Search:

    Code:
    new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$[COLOR="SeaGreen"]8[/COLOR];

    Change to:

    Code:
    new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$[COLOR="Red"]99[/COLOR];

    Search:

    Code:
    invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$[COLOR="SeaGreen"]8[/COLOR];-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

    Change to:

    Code:
    invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$[COLOR="red"]99[/COLOR];-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V


    Save this file and now open smali/com/android/internal/policy/impl/GlobalActions $ SinglePressAction.smali

    Search:

    Code:
    # Instance fields

    Add following in red above it

    Code:
    [COLOR="SeaGreen"].end annotation[/COLOR]
    
    
    # static fields
    [COLOR="Red"].field public static rebootMode:I
    
    .field public static final rebootOptions:[Ljava/lang/String;
    
    .field public static final rebootString:[Ljava/lang/String;[/COLOR]
    
    
    [COLOR="SeaGreen"]# instance fields
    .field public customAction:I[/COLOR]

    Search:

    Code:
    .method protected constructor <init>(II)V

    Add entire method above it

    Code:
    # direct methods
    .method static constructor <clinit>()V
        .locals 9
    
        const/4 v8, 0x5
    
        const/4 v7, 0x4
    
        const/4 v6, 0x3
    
        const/4 v5, 0x2
    
        const/4 v4, 0x1
    
        const/4 v3, 0x0
    
        new-array v0, v8, [Ljava/lang/String;
    
        const-string v2, "Reboot"
    
        aput-object v2, v0, v3
    
        const-string v2, "Hot Reboot"
    
        aput-object v2, v0, v4
    
        const-string v2, "Download"
    
        aput-object v2, v0, v5
    
        const-string v2, "Recovery"
    
        aput-object v2, v0, v6
    
        const-string v2, "Safe Mode"
    
        aput-object v2, v0, v7
    
        sput-object v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootString:[Ljava/lang/String;
    
        new-array v1, v8, [Ljava/lang/String;
    
        const-string v2, "Reboot"
    
        aput-object v2, v1, v3
    
        const-string v2, "Hot Reboot"
    
        aput-object v2, v1, v4
    
        const-string v2, "Download"
    
        aput-object v2, v1, v5
    
        const-string v2, "Recovery"
    
        aput-object v2, v1, v6
    
        const-string v2, "Safe Mode"
    
        aput-object v2, v1, v7
    
        sput-object v1, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
    
        return-void
    .end method
    
    [COLOR="SeaGreen"].method protected constructor <init>(II)V[/COLOR]

    Save. Now download attached files and copy them into smali/com/android/internal/policy/impl/here.

    Make sure Lcom/android/internal/policy/impl/GlobalActions got the same access$, it's access$500 at my end it might be different in different devices. Compare GlobalActions.smali with GlobalActions$99.smali
    There is an id in GlobalActions$99;
    Code:
    const v2, [COLOR="Red"]0x112000a[/COLOR]
    that also needs to be same as in framework>public
    Code:
    <public type="bool" name="show_ongoing_ime_switcher" id="0x0112000a" />


    Recompile and profit.
    If you would like to change power menu's title, open GlobalActions$99.smali
    Search for
    Code:
    const-string v2, "[COLOR="Red"]Reboot Options[/COLOR]"
    and change it to whatever you wish
    52
    Enable Torch Toggle in Settings



    Integrate In Settings

    edit 1: Smali's are updated to cover all TW devices thanks @tdunham :good:
    edit 2: Smali's are updated for Android MM compatibilty thanks @tdunham @edzamber :good:
    Decompile Settings
    Download attached torch_materials.zip and paste them accordingly

    Go to values folder open arrays.xml and check whether following arrays are availble if not add them

    Code:
        <string-array name="torchlight_timeout_entries">
            <item>15 seconds</item>
            <item>30 seconds</item>
            <item>1 minute</item>
            <item>2 minutes</item>
            <item>10 minutes</item>
        </string-array>
        <string-array name="torchlight_timeout_values">
            <item>15000</item>
            <item>30000</item>
            <item>60000</item>
            <item>120000</item>
            <item>600000</item>
        </string-array>

    Go to values folder open plurals.xml and check whether you have following plurals if not add them

    Code:
        </plurals>
        <plurals name="torchlight_timeout_minutes">
            <item quantity="other">%d minutes</item>
            <item quantity="one">1 minute</item>
        </plurals>
        <plurals name="torchlight_timeout_seconds">
            <item quantity="other">%d seconds</item>
            <item quantity="one">1 second</item>
        </plurals>

    Go to values folder open strings.xml and check whether you have following strings if not add them

    Code:
        <string name="torchlight_settings">Torch light</string>
        <string name="torchlight_settings_title">Torch light</string>
        <string name="torchlight_summary">Turn on the torch light by pressing and holding the volume up key while the screen is off.</string>
        <string name="torchlight_timeout_title">Torch light time-out</string>
        <string name="torchlight_timeout_summary">After %1$s</string>

    Go to xml folder, open device_headers.xml and add following line in red

    Code:
       [COLOR="Red"] </header>
        <header android:icon="@drawable/ic_settings_torchlight" android:id="@id/torchlight_settings" android:title="@string/torchlight_settings" android:fragment="com.android.settings.torchlight.TorchlightSettings" />[/COLOR]
        <header android:icon="@drawable/ic_settings_powersaving" android:id="@id/power_saving_mode" android:title="@string/power_saving_mode_title" android:fragment="com.android.settings.powersavingmode.MenuPowerSavingModeSettings" />

    add red line below in display_settings_2013.xml.

    Code:
        <CheckBoxPreference android:title="@string/intelligent_sleep_title" android:key="smartscreen_stay" android:summary="@string/intelligent_sleep_summary" />
        [COLOR="Red"]<PreferenceScreen android:title="Torchlight" android:key="[COLOR="red"]torchlight[/COLOR]" android:fragment="com.android.settings.torchlight.TorchlightSettings" />[/COLOR]
        <CheckBoxPreference android:title="@string/smart_pause_title" android:key="smartscreen_pause" android:summary="@string/smart_pause_summary" />


    Now it's time to create ids, so recompile and rename settings as settings_new to avoid confusion
    Now decompile settings_new
    Go to TorchlightSettings.smali
    Open public.xml too and check what I noted beside every id, match ids accordingly
    Recompile and profit >



    Integrate in ROM Control (MM)


    Code:
          <SwitchPreference 
                  android:title="Torchlight" 
                  android:key="[COLOR="Red"]torchlight_enable[/COLOR]" 
                  android:summary="Turn on the torch light by pressing and holding the volume up key while the screen is off" android:defaultValue="0" />
          <com.[COLOR="Red"]aryamod[/COLOR].romcontrol.prefs.MyListPreference 
                  android:entries="@array/torchlight_timeout_entries" 
                  android:title="@string/torchlight_timeout_title" 
                  android:key="torchlight_timeout" 
                  android:dependency="torchlight_enable"
                  android:entryValues="@array/torchlight_timeout_values" />





    Add Auto Start Management


    This mod would let you choose to prevent/allow selected apps of running on system startup.
    Download attached zip and drop those files in your settings.
    Now go to values open ids.xml and add following

    Code:
        <item type="id" name="autostarts_settings">false</item>
        <item type="id" name="appName">false</item>
        <item type="id" name="aryamod">false</item>

    open strings.xml and add following:

    Code:
        <string name="autostarts_title">Autostarts</string>
        <string name="autostarts_allowed">Has allowed</string>
        <string name="autostarts_prohibited">Has prohibited</string>
        <string name="autostarts_allow_progress_msg">Being restored boot, please wait...</string>
        <string name="autostarts_prohibit_progress_msg">Prohibit boot, please wait...</string>
        <string name="autostarts_empty_msg">No installation boot applications</string>
        <string name="autostarts_optimize_empty_msg">No optimize the startup items</string>
        <string name="autostarts_optimize_btn_title">Optimize the startup items</string>
        <string name="autostarts_all_btn_title">Automatically Start All Applications</string>

    You also need to add a header for it, which can be added anywhere in settings depending on your preference, I added in DEVICE tab like below:
    Add line below in display_headers.xml.

    Code:
        <header android:icon="@drawable/ic_settings_autostarts" android:id="@id/aryamod" android:title="@string/autostarts_title" android:fragment="com.android.settings.autostarts.LewaManageAutostarts" />

    Now it's time to produce ID, so recompile modified settings and decompile it again, go to autostart smali materials and check those IDs which I noted (starting with #<public type="...) in those smali, there might be several to check and match with your produced IDs.



    How to enable UPSM for Note 3

    In this guide we would mod service.jar and secsettings.apk, firstly download UPSM.zip and put EmergencyLauncher, EmergencyModeService and EmergencyProvider in app folder in attached zip.
    service.jar

    decompile service.jar and go to services\com\android\server
    open SystemServer.smali and search for

    Code:
    .method static final startEmergencyModeService(Landroid/content/Context;)V

    and change the entire method with following:

    Code:
    .method static final startEmergencyModeService(Landroid/content/Context;)V
         .registers 6
    
         :try_start_0
         invoke-static {p0}, Lcom/sec/android/emergencymode/EmergencyManager;->getInstance(Landroid/content/Context;)Lcom/sec/android/emergencymode/EmergencyManager;
    
         move-result-object v1
    
         invoke-virtual {v1}, Lcom/sec/android/emergencymode/EmergencyManager;->readyEmergencyMode()V
         :try_end_7
         .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_7} :catch_8
    
         :goto_7
         return-void
    
         :catch_8
         move-exception v0
    
         const-string v2, "SystemServer"
    
         new-instance v3, Ljava/lang/StringBuilder;
    
         invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
    
         const-string v4, "Starting emergency service failed: "
    
         invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    
         move-result-object v3
    
         invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
    
         move-result-object v3
    
         invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    
         move-result-object v3
    
         invoke-static {v2, v3}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I
    
         goto :goto_7
     .end method
    OK now UPSM is enabled but there is a issue that after disabling it some widgets would be removed from the home screen so we need to correct the service

    go to services\com\android\server\appwidget
    open AppWidgetServiceImpl.smali and search for following method

    Code:
    .method private deleteProviderLocked(Lcom/android/server/appwidget/AppWidgetServiceImpl$Provider;)V

    Now change the entire method the one in zip attached

    same smali search for

    Code:
    .method private queryIntentReceivers(Landroid/content/Intent;I)Ljava/util/List;

    change the entire method the one in zip attached

    Search for this method

    Code:
    .method private readProfileStateFromFileLocked(Ljava/io/FileInputStream;ILjava/util/List;)I

    change the entire method the one in zip attached


    SecSettings.apk


    Next we need to enable and access UPSM launcher that depends on you whether you have your own rom customizer or would like to add it in settings, I couldn't find proper smali to enable it as stock but I tired adding it in settings as following
    decompile secsettings and add this in id.xml
    Code:
        <item type="id" name="aryamod">false</item>

    open display_headers.xml and add UPSM header everywhere you would like to be shown like this:

    Code:
        <header android:icon="@drawable/ic_settings_powersaving" android:id="@id/aryamod" android:title="@string/powersaving_ultra" android:key="ultra_powersaving" android:fragment="com.android.settings.powersavingmode.PowerSavingModeUltra" />
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone