How to Port Lidroid Toggles to JB 4.2 MTK / STOK BASE / NON CM / JB 4.2/ JB 4.3 / KK

Search This thread

Adi Aisiteru Reborn

Senior Member
Apr 3, 2013
1,770
4,830
Bandar Lampung
HOW TO PORT JB 4.2 HORIZONTAL LIDROID TOGGLES
TO MTK / STOK BASE / NON CM / JB 4.2 /JB 4.3 / KK



Oke guys, I am back again here, I want to share how to port Lidroid toggle for Jelly Bean 4.2 up. : MTK / STOK BASE / NON CM / JB 4.2 / JB 4.3 / KK
do not try this on CM Base rom, or you will ended with SystemUI force closes
:eek::laugh::fingers-crossed:


Credit & Thank you very much , to
- lidroid, and Wanam for Guide [MOD][Android 4.1.2] Add Customizable 23 Statusbar Toggles To Samsung Jelly bean Roms,. and Thanks too to peetr_I learn some code from his thread [MOD][JB][ICS] Xperia T/TX/V port of Lidroid power widget,. and also thanks to
XDA.AGM
I learn some code from his thread too [ JB ] [ A.0.400/1.100 ] [ XP-XU ]SystemUI with Lidroid Custom 18 Toggles [version 6], and you must thanks them too :)

- Recognized contributor @BOND1987

- Denny Mbol , Device Lenovo a316i MTK 6572

- CyanogenMod

- and also Thanks to Recognized Developer/themer @serajr for some toggles created by him


- [Unofficial Community] Galaxy Wonder CyanogenMod Indonesia



so we are going to port 21 Lidroid toggles :
( -Lock screen/screen-off action, -Reboot action, -Shutdown action, -Bluetoth, -GPS, -Flashlight, -Lockscreen, -MobileData, -Orientation, -ScreenTimeOut, -Sound, -Sync, -Wi-fi, -Wi-fi Hotspot, Battery info, USB Connection mode, USB Debugging, PlayPause, Next track, Previous track, Network mode 2G/3G )

ok lets go to Guide:
first of all need some requirement for this MOD-GUIDE

REQUIREMENT:
- BRAIN
- Patient
- experience
- Know how to decompile/recompiling Apk file
- Know how to decompile/recompiling jar Apk file
- notepad++
- Tool for decompiling, : apkmanager/apktool/Virtous/apkmultitools/ or else[/B]


STEP - 1
Decompile your SystemUI.apk

- Download attached Merge_to_SystemUI.apk exstract it and merge to your decompiled systemUI.apk

- SystemUI.apk/res/layout/gemini_status_bar_expanded.xml
add the red line
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.NotificationPanelView android:id="@id/notification_panel" android:background="@drawable/notification_panel_bg" android:paddingTop="@dimen/notification_panel_padding_top" android:layout_width="0.0dip" android:layout_height="wrap_content" 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">
    <View android:id="@id/handle" android:background="@drawable/status_bar_close" android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="@dimen/close_handle_height" />
    <include android:layout_gravity="bottom" android:layout_width="fill_parent" android:layout_height="@dimen/carrier_label_height" android:layout_marginBottom="@dimen/close_handle_height" layout="@layout/gemini_carrier_label" />
    <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/close_handle_underlap" android:animateLayoutChanges="false">
        <include android:layout_width="fill_parent" android:layout_height="@dimen/notification_panel_header_height" layout="@layout/status_bar_expanded_header" />
        [COLOR="Red"]<com.adi.systemui.powerwidget.PowerWidget android:id="@id/adi_widget" android:layout_width="fill_parent" android:layout_height="wrap_content" />[/COLOR]
        <FrameLayout android:id="@id/toolBarSwitchPanel" android:background="@drawable/notification_header_bg" android:layout_width="fill_parent" android:layout_height="103.0dip">
            <include layout="@layout/toolbar_view" />
            <include layout="@layout/toolbar_indicator" />
            <include layout="@layout/toolbar_divider" />
        </FrameLayout>
        <FrameLayout android:layout_width="fill_parent" android:layout_height="wrap_content">
            <ViewStub android:id="@id/flip_settings_stub" android:layout="@layout/flip_settings" android:layout_width="fill_parent" android:layout_height="wrap_content" />
            <ScrollView android:id="@id/scroll" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="wrap_content" android:overScrollMode="ifContentScrolls">
                <com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/latestItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/notification_row_min_height" />
            </ScrollView>
        </FrameLayout>
    </LinearLayout>
</com.android.systemui.statusbar.phone.NotificationPanelView>


- SystemUI.apk/res/values/arrays.xml
add the red lines, to end of it before </resources>
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <array name="navbar_search_targets">
        <item>@null</item>
        <item>@*android:drawable/ic_action_assist_generic</item>
        <item>@null</item>
        <item>@null</item>
    </array>
    <array name="navbar_search_target_descriptions">
        <item>@null</item>
        <item>@*android:string/description_target_search</item>
        <item>@null</item>
        <item>@null</item>
    </array>
    <array name="navbar_search_direction_descriptions">
        <item>@null</item>
        <item>@*android:string/description_direction_up</item>
        <item>@null</item>
        <item>@null</item>
    </array>
    [COLOR="Red"]<string-array name="shutdown_reboot_options">
        <item>@string/reboot</item>
        <item>@string/reboot_recovery</item>
        <item>@string/reboot_download</item>
    </string-array>
    <string-array name="shutdown_reboot_actions">
        <item></item>
        <item>recovery</item>
        <item>download</item>
    </string-array>
    <string-array name="usb_connection_mode_options">
        <item>@string/usb_mpt_mode</item>
        <item>@string/usb_msc_mode</item>
    </string-array>
    <string-array name="usb_connection_mode_actions">
        <item>mtp</item>
        <item>mass_storage</item>
    </string-array>
    <string-array name="battery_info_options">
        <item>@string/battery_info_info</item>
        <item>@string/battery_info_usage</item>
    </string-array>
    <string-array name="battery_info_actions">
        <item>battery_info</item>
        <item>battery_usage</item>
    </string-array>[/COLOR]
</resources>

- SystemUI.apk/res/values/ids.xml
add the red lines, to end of it before </resources>
Code:
    <item type="id" name="sim_name">false</item>
    <item type="id" name="sim_switch">false</item>
    <item type="id" name="tool_bar_view">false</item>
    <item type="id" name="close">false</item>
    <item type="id" name="title">false</item>
    <item type="id" name="bottom">false</item>
    <item type="id" name="notification_inspect_item">false</item>
    <item type="id" name="recent_remove_item">false</item>
    <item type="id" name="recent_inspect_item">false</item>
    [COLOR="Red"]<item type="id" name="adi_widget">false</item>
    <item type="id" name="power_widget_button_text">false</item>
    <item type="id" name="power_widget_button_indic">false</item>
    <item type="id" name="power_widget_button">false</item>
    <item type="id" name="power_widget_button_image">false</item>[/COLOR]
</resources>

- SystemUI.apk/res/values/integers.xml
add the red lines, to end of it before </resources>
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <integer name="config_maxNotificationIcons">5</integer>
    <integer name="config_show_search_delay">200</integer>
    <integer name="config_vibration_duration">0</integer>
    <integer name="config_search_panel_view_vibration_duration">20</integer>
    <integer name="one_finger_pop_duration_ms">10</integer>
    <integer name="status_bar_recents_bg_gradient_degrees">90</integer>
    <integer name="navigation_bar_deadzone_hold">333</integer>
    <integer name="navigation_bar_deadzone_decay">333</integer>
    <integer name="config_recent_item_min_alpha">3</integer>
    <integer name="quick_settings_num_columns">3</integer>
    <integer name="quick_settings_user_time_settings_tile_span">1</integer>
    <integer name="quick_settings_brightness_dialog_short_timeout">2000</integer>
    <integer name="quick_settings_brightness_dialog_long_timeout">4000</integer>
    <integer name="blinds_pop_duration_ms">10</integer>
    <integer name="notification_panel_layout_gravity">0x37</integer>
    <integer name="settings_panel_layout_gravity">0x37</integer>
    [COLOR="Red"]<integer name="quickpanel_scroll_threshold_port">5</integer>
    <integer name="quickpanel_scroll_threshold_land">8</integer>[/COLOR]
</resources>

- SystemUI.apk/res/values/strings.xml
add the red lines, to end of it before </resources>
Code:
    <string name="status_bar_help_text">"Access them anytime by swiping down.
Swipe down again for system controls."</string>
    <string name="shutdown_prompt_title">Shutdown</string>
    <string name="shutdown_prompt_message">Low battery and then will be auto shutdown</string>
    <string name="shutdown_prompt_message_before">Low battery ! Your phone will shutdown in</string>
    <string name="shutdown_prompt_message_after">seconds</string>
    [COLOR="Red"]<string name="quickpanel_wifi_text">Wi-Fi</string>
    <string name="quickpanel_dc_text">Data</string>
    <string name="quickpanel_network_mode_text">Network</string>
    <string name="quickpanel_sound_text">Sound</string>
    <string name="quickpanel_sound_vibration_text">Ring.vibrate</string>
    <string name="quickpanel_silent_text">Silent</string>
    <string name="quickpanel_vibration_text">Vibration</string>
    <string name="quickpanel_rotation_text">Rotation</string>
    <string name="quickpanel_bluetooth_text">Bluetooth</string>
    <string name="quickpanel_gps_text">GPS</string>
    <string name="quickpanel_autosync_text">Auto Sync</string>
    <string name="quickpanel_brightness_text">Brightness</string>
    <string name="quickpanel_screen_timeout_text">Timeout</string>
    <string name="quickpanel_lockscreen_text">Lockscreen</string>
    <string name="quickpanel_airplane_text">Flightmode</string>
    <string name="quickpanel_flashlight_text">Flashlight</string>
    <string name="quickpanel_reboot_text">Reboot</string>
    <string name="quickpanel_shutdown_text">Shutdown</string>
    <string name="airplane_mode">In Flight mode</string>
    <string name="shutdown_confirm">Your phone will shut down.</string>
    <string name="screen_timeout_seconds">Screen timeout set to: %d second(s)</string>
    <string name="screen_timeout_minutes">Screen timeout set to: %d minute(s)</string>
    <string name="screen_timeout_hours">Screen timeout set to: %d hour(s)</string>
    <string name="hamster">Phone Options</string>
    <string name="yes">OK</string>
    <string name="no">Cancel</string>
    <string name="reboot">Reboot</string>
    <string name="reboot_recovery">Recovery</string>
    <string name="reboot_download">Download</string>
    <string name="quickpanel_nfc_text">NFC</string>
    <string name="quickpanel_wifi_ap_text">Wifi AP</string>
    <string name="quickpanel_lockscreen_action_text">Sleep</string>
    <string name="quickpanel_androidbeam_text">Android Beam</string>
    <string name="brightness_settings_automatic">AUTO</string>
    <string name="brightness_settings_title" />
    <string name="quickpanel_usb_debugging_text">Debugging</string>
    <string name="quickpanel_usb_connection_mode_text">USB Mode</string>
    <string name="quickpanel_usb_current_mtp_title">Current mode: MPT</string>
    <string name="quickpanel_usb_current_msc_title">Current mode: MSC</string>
    <string name="usb_mpt_mode">MPT - Media Transfer</string>
    <string name="usb_msc_mode">MSC - Mass Storage</string>
    <string name="quickpanel_stay_awake_plugged_text">Stay Awake</string>
    <string name="quickpanel_battery_info_text">Battery</string>
    <string name="battery_info_info">Battery Information</string>
    <string name="battery_info_usage">Battery Power Usage</string>
    <string name="quickpanel_playpause_text">Play-Pause</string>
    <string name="quickpanel_next_text">Next</string>
    <string name="quickpanel_previous_text">Previous</string>
    <string name="quickpanel_screenshots_text">Screenshot</string>[/COLOR]
</resources>

- Done and recompile your systemUI.apk

NOTE :
if you are using Apk Tool 2.0 or newer, and gettings error recompiling in the smali file,. check this explanation by :
- Recognized Themer @lacoursiere18 , here http://xdaforums.com/showpost.php?p=53798727&postcount=34

and by Recognized Themer @Ticklefish, here http://xdaforums.com/showpost.php?p=53824313&postcount=37

Credits and Thanks to them
 

Attachments

  • Merge_to_SystemUI.apk.zip
    166 KB · Views: 2,204
Last edited:

Adi Aisiteru Reborn

Senior Member
Apr 3, 2013
1,770
4,830
Bandar Lampung
STEP - 2

- Decompile the newly Recompiled APK again

Next go to
res/values/public.xml
open it with Notepad++
leave it, but keep it open

- smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali
add the red lines :
Code:
.field private mOldPlmn:Ljava/lang/String;

.field mPixelFormat:I

.field private mPlmnLabel:Landroid/widget/TextView;

.field mPositionTmp:[I

.field mPostCollapseCleanup:Ljava/lang/Runnable;

[COLOR="Red"].field mPowerWidget:Lcom/adi/systemui/powerwidget/PowerWidget;[/COLOR]

.field private mPreviousConfigFontScale:F

.field private mPrevioutConfigOrientation:I

.field mQS:Lcom/android/systemui/statusbar/phone/QuickSettings;

.field mQueueLock:Ljava/lang/Object;

.field private mRecentsClickListener:Landroid/view/View$OnClickListener;


Code:
    .end local v6           #signal:Landroid/view/View;
    .end local v7           #systemIcons:Landroid/view/View;
    :cond_0
    iget-object v8, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mLightsOutAnimation:Landroid/animation/Animator;

    invoke-virtual {v8}, Landroid/animation/Animator;->cancel()V

    .line 2213
    iget-object v8, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mLightsOnAnimation:Landroid/animation/Animator;

    invoke-virtual {v8}, Landroid/animation/Animator;->cancel()V

    .line 2215
    if-eqz p1, :cond_1

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mLightsOutAnimation:Landroid/animation/Animator;

    .line 2216
    .local v0, a:Landroid/animation/Animator;
    :goto_0
    invoke-virtual {v0}, Landroid/animation/Animator;->start()V

    .line 2218
    invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setAreThereNotifications()V

    .line 2219
    return-void

    .line 2215
    .end local v0           #a:Landroid/animation/Animator;
    :cond_1
    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mLightsOnAnimation:Landroid/animation/Animator;

    goto :goto_0
.end method

[COLOR="Red"].method private setupPowerWidget()V
    .locals 2

    .prologue
    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;

    const v1, [COLOR="Blue"]0x7f08012a[/COLOR]

    invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/adi/systemui/powerwidget/PowerWidget;

    iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/adi/systemui/powerwidget/PowerWidget;

    iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/adi/systemui/powerwidget/PowerWidget;

    invoke-virtual {v0}, Lcom/adi/systemui/powerwidget/PowerWidget;->setupWidget()V

    iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/adi/systemui/powerwidget/PowerWidget;

    invoke-virtual {v0}, Lcom/adi/systemui/powerwidget/PowerWidget;->updateWidget()V

    return-void
.end method[/COLOR]

.method private showAlwaysAskOrInternetCall(J)V
    .locals 3
    .parameter "simId"

    .prologue
    const/4 v2, 0x0

    .line 3231
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSimIndicatorIconShow:Z

    .line 3232
    const-wide/16 v0, -0x2

    cmp-long v0, p1, v0

    if-nez v0, :cond_0

    .line 3233
    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSimIndicatorIcon:Landroid/widget/ImageView;

    const v1, 0x7f020137

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setBackgroundResource(I)V

    .line 3239
    :goto_0
    iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAirplaneMode:Z

    if-nez v0, :cond_2

    .line 3240
    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSimIndicatorIcon:Landroid/widget/ImageView;

    invoke-virtual {v0, v2}, Landroid/widget/ImageView;->setVisibility(I)V

    .line 3245
    :goto_1
    return-void

    .line 3234
    :cond_0
    const-wide/16 v0, -0x3

    cmp-long v0, p1, v0

    if-nez v0, :cond_1

    .line 3235
    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSimIndicatorIcon:Landroid/widget/ImageView;

    const v1, 0x7f020136

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setBackgroundResource(I)V

    goto :goto_0

    .line 3237
    :cond_1
    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSimIndicatorIcon:Landroid/widget/ImageView;

    const v1, 0x7f020135

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setBackgroundResource(I)V

    goto :goto_0

change this, 0x7f08012a according to the value you got in your own public.xml
Code:
<public type="id" name="adi_widget" id="0x7f??????" />


search this method
Code:
.method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
scroll down in that method and add the red line
Code:
 move-object/from16 v0, p0

    iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBroadcastReceiver:Landroid/content/BroadcastReceiver;

    invoke-virtual {v11, v1, v12}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    .line 772
    invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->resetUserSetupObserver()V

   [COLOR="Red"] invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setupPowerWidget()V[/COLOR]

    .line 774
    new-instance v20, Landroid/content/IntentFilter;

    invoke-direct/range {v20 .. v20}, Landroid/content/IntentFilter;-><init>()V

    .line 775
    .local v20, simInfoIntentFilter:Landroid/content/IntentFilter;
    const-string v1, "android.intent.action.SIM_SETTING_INFO_CHANGED"


OR
you can put the line here
Code:
   iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mMediaEjectBroadcastReceiver:Landroid/content/BroadcastReceiver;

    invoke-virtual {v11, v1, v15}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    .line 800
    move-object/from16 v0, p0

  [COLOR="Red"] invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setupPowerWidget()V[/COLOR]


    iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

    return-object v1

    .line 440
    .end local v12           #filter:Landroid/content/IntentFilter;
    .end local v14           #indicator:Lcom/android/systemui/statusbar/toolbar/ToolBarIndicator;
    .end local v15           #mediaEjectFilter:Landroid/content/IntentFilter;
    .end local v19           #signalCluster:Lcom/android/systemui/statusbar/SignalClusterViewGemini;
    .end local v20           #simInfoIntentFilter:Landroid/content/IntentFilter;
    .end local v21           #tickerView:Lcom/android/systemui/statusbar/phone/TickerView;
    :cond_d
    const/4 v1, 0x0

    goto/16 :goto_0

NOTE !! if your device / os
Code:
.method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
doesn't have this line
Code:
 move-object/from16 v0, p0

change this
Code:
 invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setupPowerWidget()V
to like this
Code:
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setupPowerWidget()V
 
Last edited:

Adi Aisiteru Reborn

Senior Member
Apr 3, 2013
1,770
4,830
Bandar Lampung
STEP -3

Next : Download attached Powerwidget_public, and open it with Notepad++
so you have two public.xml now which is opened in the Notepad++
1. secondly decompiled public.xml
2. Powerwidget_public.xml

- go to , smali/com/adi/systemui/powerwidget/here...
there are a lot of smalis there

FIND ALL IDS in all that smalis THAT'S STARTED WITH
Code:
0x7fxxxxxx

EXAMPLE :
AutoRotateButton.smali

Code:
.method protected getText()I
    .locals 1

    const v0, [COLOR="Red"]0x7f0b00f9[/COLOR]

    return v0
.end method
find this const v0, 0x7f0b00f9 in PowerWidget_public.xml what is calling for
and we find that is for
Code:
 <public type="[COLOR="Red"]string[/COLOR]" name="[COLOR="Red"]quickpanel_rotation_text[/COLOR]" id="[COLOR="Blue"]0x7f0b00f9[/COLOR]" />

the IDS can be strings, ids, integer, arays, drawable, or layout, so you have to pay attention to this

next go to your own public.xml search for the value you got
Code:
 <public type="[COLOR="Red"]string[/COLOR]" name="[COLOR="Red"]quickpanel_rotation_text[/COLOR]" id="[COLOR="Blue"]0x7f0??????[/COLOR]" />
and change the IDS in the smali with your own value
Code:
.method protected getText()I
    .locals 1

    const v0, [COLOR="Blue"]0x7f0??????[/COLOR]

    return v0
.end method

Do it too, to all
Code:
0x7fxxxxxx
in all smalis in the Powerwidget folder.

 

Attachments

  • PowerWidget_public.zip
    14.5 KB · Views: 1,024
Last edited:

Adi Aisiteru Reborn

Senior Member
Apr 3, 2013
1,770
4,830
Bandar Lampung
STEP - 4


- Disable signature check
here : http://xdaforums.com/showthread.php?t=1698352
or in here : http://xdaforums.com/showpost.php?p=47592101&postcount=3

- AndroidManifest.xml
add the red line
Code:
<manifest [COLOR="Red"]android:sharedUserId="android.uid.system" android:process="system"[/COLOR] android:versionCode="17" android:versionName="4.2.2-eng.njdbuild03.1389868812" package="com.android.systemui" coreApp="true"

Code:
 <uses-permission android:name="android.permission.ACCESS_ALL_DOWNLOADS" />
    <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
    [COLOR="Red"]<uses-permission android:name="android.permission.REBOOT" />
    <uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />[/COLOR]
    <application android:label="@string/app_label" android:icon="@*android:drawable/platlogo" android:allowClearUserData="false" android:persistent="true" android:allowBackup="false">
        <service android:name="SystemUIService" android:exported="true" />
        <service android:name=".screenshot.TakeScreenshotService" android:exported="false" android:process=":screenshot" />

Code:
   <service android:label="@string/jelly_bean_dream_name" android:name=".BeanBagDream" android:enabled="false" android:exported="true">
            <intent-filter>
                <action android:name="android.service.dreams.DreamService" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </service>
        <activity android:theme="@*android:style/Theme.Wallpaper.NoTitleBar" android:label="@string/start_dreams" android:icon="@mipmap/ic_launcher_dreams" android:name=".Somnambulator" android:exported="true" android:excludeFromRecents="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.DESK_DOCK" />
            </intent-filter>
        </activity>
        [COLOR="Red"]<receiver android:name="com.adi.systemui.powerwidget.NetworkModeReceiver" android:process="com.android.phone">
            <intent-filter>
                <action android:name="com.serajr.powertoggles.POWERTOGGLES_CHANGE_NETWORK_MODE" />
                <action android:name="com.serajr.powertoggles.POWERTOGGLES_NEW_NETWORK_MODE" />
            </intent-filter>
        </receiver>[/COLOR]
    </application>
</manifest>

- Done and recompile it , don't forget to sign it,
I ussually use ApkMultitools to decompile/recompile/sign APK
so if you use ApkMultitools, you can use my signer keys
download attached file, exstract it and merge to your ApkMultitools / other / here

- Download Attached Powerwidget.apk and Torch.apk, push it to your system/app/reboot

- edit your build.prop , to make USB connection mode toggle working properly
Code:
ro.sys.usb.storage.type=mtp[COLOR="Red"],mass_storage[/COLOR]




Additional :
- if the Flashlight toggle force closes, try to use this Torch.apk by raffie_archildz http://d-h.st/n99

- But if still force closes try to use this guide


if the Flashlight toggle from the guide doesn't work, try to use this smali http://d-h.st/mgb
- and don't forget to match the IDS too,.
- AndroidManifest.xml
Code:
 <uses-permission android:name="android.permission.ACCESS_ALL_DOWNLOADS" />
    <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
    [COLOR="Red"]<uses-permission android:name="android.permission.CAMERA" />[/COLOR]
    [COLOR="Blue"]<uses-permission android:name="android.permission.REBOOT" />
    <uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />[/COLOR]
    <application android:label="@string/app_label" android:icon="@*android:drawable/platlogo" android:allowClearUserData="false" android:persistent="true" android:allowBackup="false">
        <service android:name="SystemUIService" android:exported="true" />

 

Attachments

  • Signer_CM11-KK.zip
    5.4 KB · Views: 368
  • Torch.apk
    160.7 KB · Views: 688
  • New_PowerWidget.apk
    161 KB · Views: 930
Last edited:

Adi Aisiteru Reborn

Senior Member
Apr 3, 2013
1,770
4,830
Bandar Lampung
Screenshots

picture.php
picture.php
picture.php



picture.php
picture.php
 

Attachments

  • IMG_20140610_113810.jpg
    IMG_20140610_113810.jpg
    10.4 KB · Views: 2,412
  • IMG_20140610_113816.jpg
    IMG_20140610_113816.jpg
    16.3 KB · Views: 2,366
  • IMG_20140610_113821.jpg
    IMG_20140610_113821.jpg
    19.5 KB · Views: 2,055
  • IMG_20140610_113826.jpg
    IMG_20140610_113826.jpg
    19.9 KB · Views: 1,877
  • IMG_20140610_113831.jpg
    IMG_20140610_113831.jpg
    20.6 KB · Views: 1,665
Last edited:

pavan kr

Senior Member
Aug 24, 2013
76
65
Banglore
Thanks a ton !!! Great Guide

got working in 2nd try on my Mediatek mt6577 (LAVA IRIS 405) DEVICE with JB 4.2.2 ...

thanks a lot ....

But if i toggle to 3g mode then no network .

still i need to fix reboot and flashlight rest all working fine i've attached logcat of reboot fc pls have a look, i googled didn't find anything useful

Again thanks a lot for this mod :good:
 

Attachments

  • Screenshot_2014-06-10-19-50-30.png
    Screenshot_2014-06-10-19-50-30.png
    57.3 KB · Views: 194
  • Screenshot_2014-06-10-19-47-59.png
    Screenshot_2014-06-10-19-47-59.png
    43.6 KB · Views: 176
  • Screenshot_2014-06-10-19-47-47.png
    Screenshot_2014-06-10-19-47-47.png
    36.2 KB · Views: 168

Adi Aisiteru Reborn

Senior Member
Apr 3, 2013
1,770
4,830
Bandar Lampung
got working in 2nd try on my Mediatek mt6577 (LAVA IRIS 405) DEVICE with JB 4.2.2 ...

thanks a lot ....

But if i toggle to 3g mode then no network .

still i need to fix reboot and flashlight rest all working fine i've attached logcat of reboot fc pls have a look, i googled didn't find anything useful

Again thanks a lot for this mod :good:

please check again all IDS in your smali got the correct value :)
 

wahyupct

Member
Feb 24, 2011
24
3
ihiirrrrr love it :D ....work like a charm mastah...on imo raptor...:good:
 

Attachments

  • Screenshot_2014-06-11-00-17-47.jpg
    Screenshot_2014-06-11-00-17-47.jpg
    124.1 KB · Views: 158

Gokul HAri

Member
Mar 20, 2014
25
7
Working in my MTK device..

Working in my MTK device.. But pls someone help me to understand the Steps .. Wrongs icons and names and icons merging with the toggle names
 

Top Liked Posts

  • There are no posts matching your filters.
  • 18
    HOW TO PORT JB 4.2 HORIZONTAL LIDROID TOGGLES
    TO MTK / STOK BASE / NON CM / JB 4.2 /JB 4.3 / KK



    Oke guys, I am back again here, I want to share how to port Lidroid toggle for Jelly Bean 4.2 up. : MTK / STOK BASE / NON CM / JB 4.2 / JB 4.3 / KK
    do not try this on CM Base rom, or you will ended with SystemUI force closes
    :eek::laugh::fingers-crossed:


    Credit & Thank you very much , to
    - lidroid, and Wanam for Guide [MOD][Android 4.1.2] Add Customizable 23 Statusbar Toggles To Samsung Jelly bean Roms,. and Thanks too to peetr_I learn some code from his thread [MOD][JB][ICS] Xperia T/TX/V port of Lidroid power widget,. and also thanks to
    XDA.AGM
    I learn some code from his thread too [ JB ] [ A.0.400/1.100 ] [ XP-XU ]SystemUI with Lidroid Custom 18 Toggles [version 6], and you must thanks them too :)

    - Recognized contributor @BOND1987

    - Denny Mbol , Device Lenovo a316i MTK 6572

    - CyanogenMod

    - and also Thanks to Recognized Developer/themer @serajr for some toggles created by him


    - [Unofficial Community] Galaxy Wonder CyanogenMod Indonesia



    so we are going to port 21 Lidroid toggles :
    ( -Lock screen/screen-off action, -Reboot action, -Shutdown action, -Bluetoth, -GPS, -Flashlight, -Lockscreen, -MobileData, -Orientation, -ScreenTimeOut, -Sound, -Sync, -Wi-fi, -Wi-fi Hotspot, Battery info, USB Connection mode, USB Debugging, PlayPause, Next track, Previous track, Network mode 2G/3G )

    ok lets go to Guide:
    first of all need some requirement for this MOD-GUIDE

    REQUIREMENT:
    - BRAIN
    - Patient
    - experience
    - Know how to decompile/recompiling Apk file
    - Know how to decompile/recompiling jar Apk file
    - notepad++
    - Tool for decompiling, : apkmanager/apktool/Virtous/apkmultitools/ or else[/B]


    STEP - 1
    Decompile your SystemUI.apk

    - Download attached Merge_to_SystemUI.apk exstract it and merge to your decompiled systemUI.apk

    - SystemUI.apk/res/layout/gemini_status_bar_expanded.xml
    add the red line
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <com.android.systemui.statusbar.phone.NotificationPanelView android:id="@id/notification_panel" android:background="@drawable/notification_panel_bg" android:paddingTop="@dimen/notification_panel_padding_top" android:layout_width="0.0dip" android:layout_height="wrap_content" 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">
        <View android:id="@id/handle" android:background="@drawable/status_bar_close" android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="@dimen/close_handle_height" />
        <include android:layout_gravity="bottom" android:layout_width="fill_parent" android:layout_height="@dimen/carrier_label_height" android:layout_marginBottom="@dimen/close_handle_height" layout="@layout/gemini_carrier_label" />
        <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/close_handle_underlap" android:animateLayoutChanges="false">
            <include android:layout_width="fill_parent" android:layout_height="@dimen/notification_panel_header_height" layout="@layout/status_bar_expanded_header" />
            [COLOR="Red"]<com.adi.systemui.powerwidget.PowerWidget android:id="@id/adi_widget" android:layout_width="fill_parent" android:layout_height="wrap_content" />[/COLOR]
            <FrameLayout android:id="@id/toolBarSwitchPanel" android:background="@drawable/notification_header_bg" android:layout_width="fill_parent" android:layout_height="103.0dip">
                <include layout="@layout/toolbar_view" />
                <include layout="@layout/toolbar_indicator" />
                <include layout="@layout/toolbar_divider" />
            </FrameLayout>
            <FrameLayout android:layout_width="fill_parent" android:layout_height="wrap_content">
                <ViewStub android:id="@id/flip_settings_stub" android:layout="@layout/flip_settings" android:layout_width="fill_parent" android:layout_height="wrap_content" />
                <ScrollView android:id="@id/scroll" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="wrap_content" android:overScrollMode="ifContentScrolls">
                    <com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/latestItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/notification_row_min_height" />
                </ScrollView>
            </FrameLayout>
        </LinearLayout>
    </com.android.systemui.statusbar.phone.NotificationPanelView>


    - SystemUI.apk/res/values/arrays.xml
    add the red lines, to end of it before </resources>
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <array name="navbar_search_targets">
            <item>@null</item>
            <item>@*android:drawable/ic_action_assist_generic</item>
            <item>@null</item>
            <item>@null</item>
        </array>
        <array name="navbar_search_target_descriptions">
            <item>@null</item>
            <item>@*android:string/description_target_search</item>
            <item>@null</item>
            <item>@null</item>
        </array>
        <array name="navbar_search_direction_descriptions">
            <item>@null</item>
            <item>@*android:string/description_direction_up</item>
            <item>@null</item>
            <item>@null</item>
        </array>
        [COLOR="Red"]<string-array name="shutdown_reboot_options">
            <item>@string/reboot</item>
            <item>@string/reboot_recovery</item>
            <item>@string/reboot_download</item>
        </string-array>
        <string-array name="shutdown_reboot_actions">
            <item></item>
            <item>recovery</item>
            <item>download</item>
        </string-array>
        <string-array name="usb_connection_mode_options">
            <item>@string/usb_mpt_mode</item>
            <item>@string/usb_msc_mode</item>
        </string-array>
        <string-array name="usb_connection_mode_actions">
            <item>mtp</item>
            <item>mass_storage</item>
        </string-array>
        <string-array name="battery_info_options">
            <item>@string/battery_info_info</item>
            <item>@string/battery_info_usage</item>
        </string-array>
        <string-array name="battery_info_actions">
            <item>battery_info</item>
            <item>battery_usage</item>
        </string-array>[/COLOR]
    </resources>

    - SystemUI.apk/res/values/ids.xml
    add the red lines, to end of it before </resources>
    Code:
        <item type="id" name="sim_name">false</item>
        <item type="id" name="sim_switch">false</item>
        <item type="id" name="tool_bar_view">false</item>
        <item type="id" name="close">false</item>
        <item type="id" name="title">false</item>
        <item type="id" name="bottom">false</item>
        <item type="id" name="notification_inspect_item">false</item>
        <item type="id" name="recent_remove_item">false</item>
        <item type="id" name="recent_inspect_item">false</item>
        [COLOR="Red"]<item type="id" name="adi_widget">false</item>
        <item type="id" name="power_widget_button_text">false</item>
        <item type="id" name="power_widget_button_indic">false</item>
        <item type="id" name="power_widget_button">false</item>
        <item type="id" name="power_widget_button_image">false</item>[/COLOR]
    </resources>

    - SystemUI.apk/res/values/integers.xml
    add the red lines, to end of it before </resources>
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <integer name="config_maxNotificationIcons">5</integer>
        <integer name="config_show_search_delay">200</integer>
        <integer name="config_vibration_duration">0</integer>
        <integer name="config_search_panel_view_vibration_duration">20</integer>
        <integer name="one_finger_pop_duration_ms">10</integer>
        <integer name="status_bar_recents_bg_gradient_degrees">90</integer>
        <integer name="navigation_bar_deadzone_hold">333</integer>
        <integer name="navigation_bar_deadzone_decay">333</integer>
        <integer name="config_recent_item_min_alpha">3</integer>
        <integer name="quick_settings_num_columns">3</integer>
        <integer name="quick_settings_user_time_settings_tile_span">1</integer>
        <integer name="quick_settings_brightness_dialog_short_timeout">2000</integer>
        <integer name="quick_settings_brightness_dialog_long_timeout">4000</integer>
        <integer name="blinds_pop_duration_ms">10</integer>
        <integer name="notification_panel_layout_gravity">0x37</integer>
        <integer name="settings_panel_layout_gravity">0x37</integer>
        [COLOR="Red"]<integer name="quickpanel_scroll_threshold_port">5</integer>
        <integer name="quickpanel_scroll_threshold_land">8</integer>[/COLOR]
    </resources>

    - SystemUI.apk/res/values/strings.xml
    add the red lines, to end of it before </resources>
    Code:
        <string name="status_bar_help_text">"Access them anytime by swiping down.
    Swipe down again for system controls."</string>
        <string name="shutdown_prompt_title">Shutdown</string>
        <string name="shutdown_prompt_message">Low battery and then will be auto shutdown</string>
        <string name="shutdown_prompt_message_before">Low battery ! Your phone will shutdown in</string>
        <string name="shutdown_prompt_message_after">seconds</string>
        [COLOR="Red"]<string name="quickpanel_wifi_text">Wi-Fi</string>
        <string name="quickpanel_dc_text">Data</string>
        <string name="quickpanel_network_mode_text">Network</string>
        <string name="quickpanel_sound_text">Sound</string>
        <string name="quickpanel_sound_vibration_text">Ring.vibrate</string>
        <string name="quickpanel_silent_text">Silent</string>
        <string name="quickpanel_vibration_text">Vibration</string>
        <string name="quickpanel_rotation_text">Rotation</string>
        <string name="quickpanel_bluetooth_text">Bluetooth</string>
        <string name="quickpanel_gps_text">GPS</string>
        <string name="quickpanel_autosync_text">Auto Sync</string>
        <string name="quickpanel_brightness_text">Brightness</string>
        <string name="quickpanel_screen_timeout_text">Timeout</string>
        <string name="quickpanel_lockscreen_text">Lockscreen</string>
        <string name="quickpanel_airplane_text">Flightmode</string>
        <string name="quickpanel_flashlight_text">Flashlight</string>
        <string name="quickpanel_reboot_text">Reboot</string>
        <string name="quickpanel_shutdown_text">Shutdown</string>
        <string name="airplane_mode">In Flight mode</string>
        <string name="shutdown_confirm">Your phone will shut down.</string>
        <string name="screen_timeout_seconds">Screen timeout set to: %d second(s)</string>
        <string name="screen_timeout_minutes">Screen timeout set to: %d minute(s)</string>
        <string name="screen_timeout_hours">Screen timeout set to: %d hour(s)</string>
        <string name="hamster">Phone Options</string>
        <string name="yes">OK</string>
        <string name="no">Cancel</string>
        <string name="reboot">Reboot</string>
        <string name="reboot_recovery">Recovery</string>
        <string name="reboot_download">Download</string>
        <string name="quickpanel_nfc_text">NFC</string>
        <string name="quickpanel_wifi_ap_text">Wifi AP</string>
        <string name="quickpanel_lockscreen_action_text">Sleep</string>
        <string name="quickpanel_androidbeam_text">Android Beam</string>
        <string name="brightness_settings_automatic">AUTO</string>
        <string name="brightness_settings_title" />
        <string name="quickpanel_usb_debugging_text">Debugging</string>
        <string name="quickpanel_usb_connection_mode_text">USB Mode</string>
        <string name="quickpanel_usb_current_mtp_title">Current mode: MPT</string>
        <string name="quickpanel_usb_current_msc_title">Current mode: MSC</string>
        <string name="usb_mpt_mode">MPT - Media Transfer</string>
        <string name="usb_msc_mode">MSC - Mass Storage</string>
        <string name="quickpanel_stay_awake_plugged_text">Stay Awake</string>
        <string name="quickpanel_battery_info_text">Battery</string>
        <string name="battery_info_info">Battery Information</string>
        <string name="battery_info_usage">Battery Power Usage</string>
        <string name="quickpanel_playpause_text">Play-Pause</string>
        <string name="quickpanel_next_text">Next</string>
        <string name="quickpanel_previous_text">Previous</string>
        <string name="quickpanel_screenshots_text">Screenshot</string>[/COLOR]
    </resources>

    - Done and recompile your systemUI.apk

    NOTE :
    if you are using Apk Tool 2.0 or newer, and gettings error recompiling in the smali file,. check this explanation by :
    - Recognized Themer @lacoursiere18 , here http://xdaforums.com/showpost.php?p=53798727&postcount=34

    and by Recognized Themer @Ticklefish, here http://xdaforums.com/showpost.php?p=53824313&postcount=37

    Credits and Thanks to them
    13
    STEP - 4


    - Disable signature check
    here : http://xdaforums.com/showthread.php?t=1698352
    or in here : http://xdaforums.com/showpost.php?p=47592101&postcount=3

    - AndroidManifest.xml
    add the red line
    Code:
    <manifest [COLOR="Red"]android:sharedUserId="android.uid.system" android:process="system"[/COLOR] android:versionCode="17" android:versionName="4.2.2-eng.njdbuild03.1389868812" package="com.android.systemui" coreApp="true"

    Code:
     <uses-permission android:name="android.permission.ACCESS_ALL_DOWNLOADS" />
        <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
        [COLOR="Red"]<uses-permission android:name="android.permission.REBOOT" />
        <uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
        <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />[/COLOR]
        <application android:label="@string/app_label" android:icon="@*android:drawable/platlogo" android:allowClearUserData="false" android:persistent="true" android:allowBackup="false">
            <service android:name="SystemUIService" android:exported="true" />
            <service android:name=".screenshot.TakeScreenshotService" android:exported="false" android:process=":screenshot" />

    Code:
       <service android:label="@string/jelly_bean_dream_name" android:name=".BeanBagDream" android:enabled="false" android:exported="true">
                <intent-filter>
                    <action android:name="android.service.dreams.DreamService" />
                    <category android:name="android.intent.category.DEFAULT" />
                </intent-filter>
            </service>
            <activity android:theme="@*android:style/Theme.Wallpaper.NoTitleBar" android:label="@string/start_dreams" android:icon="@mipmap/ic_launcher_dreams" android:name=".Somnambulator" android:exported="true" android:excludeFromRecents="true">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.DEFAULT" />
                    <category android:name="android.intent.category.DESK_DOCK" />
                </intent-filter>
            </activity>
            [COLOR="Red"]<receiver android:name="com.adi.systemui.powerwidget.NetworkModeReceiver" android:process="com.android.phone">
                <intent-filter>
                    <action android:name="com.serajr.powertoggles.POWERTOGGLES_CHANGE_NETWORK_MODE" />
                    <action android:name="com.serajr.powertoggles.POWERTOGGLES_NEW_NETWORK_MODE" />
                </intent-filter>
            </receiver>[/COLOR]
        </application>
    </manifest>

    - Done and recompile it , don't forget to sign it,
    I ussually use ApkMultitools to decompile/recompile/sign APK
    so if you use ApkMultitools, you can use my signer keys
    download attached file, exstract it and merge to your ApkMultitools / other / here

    - Download Attached Powerwidget.apk and Torch.apk, push it to your system/app/reboot

    - edit your build.prop , to make USB connection mode toggle working properly
    Code:
    ro.sys.usb.storage.type=mtp[COLOR="Red"],mass_storage[/COLOR]




    Additional :
    - if the Flashlight toggle force closes, try to use this Torch.apk by raffie_archildz http://d-h.st/n99

    - But if still force closes try to use this guide


    if the Flashlight toggle from the guide doesn't work, try to use this smali http://d-h.st/mgb
    - and don't forget to match the IDS too,.
    - AndroidManifest.xml
    Code:
     <uses-permission android:name="android.permission.ACCESS_ALL_DOWNLOADS" />
        <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
        [COLOR="Red"]<uses-permission android:name="android.permission.CAMERA" />[/COLOR]
        [COLOR="Blue"]<uses-permission android:name="android.permission.REBOOT" />
        <uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
        <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />[/COLOR]
        <application android:label="@string/app_label" android:icon="@*android:drawable/platlogo" android:allowClearUserData="false" android:persistent="true" android:allowBackup="false">
            <service android:name="SystemUIService" android:exported="true" />

    10
    STEP - 2

    - Decompile the newly Recompiled APK again

    Next go to
    res/values/public.xml
    open it with Notepad++
    leave it, but keep it open

    - smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali
    add the red lines :
    Code:
    .field private mOldPlmn:Ljava/lang/String;
    
    .field mPixelFormat:I
    
    .field private mPlmnLabel:Landroid/widget/TextView;
    
    .field mPositionTmp:[I
    
    .field mPostCollapseCleanup:Ljava/lang/Runnable;
    
    [COLOR="Red"].field mPowerWidget:Lcom/adi/systemui/powerwidget/PowerWidget;[/COLOR]
    
    .field private mPreviousConfigFontScale:F
    
    .field private mPrevioutConfigOrientation:I
    
    .field mQS:Lcom/android/systemui/statusbar/phone/QuickSettings;
    
    .field mQueueLock:Ljava/lang/Object;
    
    .field private mRecentsClickListener:Landroid/view/View$OnClickListener;


    Code:
        .end local v6           #signal:Landroid/view/View;
        .end local v7           #systemIcons:Landroid/view/View;
        :cond_0
        iget-object v8, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mLightsOutAnimation:Landroid/animation/Animator;
    
        invoke-virtual {v8}, Landroid/animation/Animator;->cancel()V
    
        .line 2213
        iget-object v8, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mLightsOnAnimation:Landroid/animation/Animator;
    
        invoke-virtual {v8}, Landroid/animation/Animator;->cancel()V
    
        .line 2215
        if-eqz p1, :cond_1
    
        iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mLightsOutAnimation:Landroid/animation/Animator;
    
        .line 2216
        .local v0, a:Landroid/animation/Animator;
        :goto_0
        invoke-virtual {v0}, Landroid/animation/Animator;->start()V
    
        .line 2218
        invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setAreThereNotifications()V
    
        .line 2219
        return-void
    
        .line 2215
        .end local v0           #a:Landroid/animation/Animator;
        :cond_1
        iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mLightsOnAnimation:Landroid/animation/Animator;
    
        goto :goto_0
    .end method
    
    [COLOR="Red"].method private setupPowerWidget()V
        .locals 2
    
        .prologue
        iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
    
        const v1, [COLOR="Blue"]0x7f08012a[/COLOR]
    
        invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
    
        move-result-object v0
    
        check-cast v0, Lcom/adi/systemui/powerwidget/PowerWidget;
    
        iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/adi/systemui/powerwidget/PowerWidget;
    
        iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/adi/systemui/powerwidget/PowerWidget;
    
        invoke-virtual {v0}, Lcom/adi/systemui/powerwidget/PowerWidget;->setupWidget()V
    
        iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/adi/systemui/powerwidget/PowerWidget;
    
        invoke-virtual {v0}, Lcom/adi/systemui/powerwidget/PowerWidget;->updateWidget()V
    
        return-void
    .end method[/COLOR]
    
    .method private showAlwaysAskOrInternetCall(J)V
        .locals 3
        .parameter "simId"
    
        .prologue
        const/4 v2, 0x0
    
        .line 3231
        const/4 v0, 0x1
    
        iput-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSimIndicatorIconShow:Z
    
        .line 3232
        const-wide/16 v0, -0x2
    
        cmp-long v0, p1, v0
    
        if-nez v0, :cond_0
    
        .line 3233
        iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSimIndicatorIcon:Landroid/widget/ImageView;
    
        const v1, 0x7f020137
    
        invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setBackgroundResource(I)V
    
        .line 3239
        :goto_0
        iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAirplaneMode:Z
    
        if-nez v0, :cond_2
    
        .line 3240
        iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSimIndicatorIcon:Landroid/widget/ImageView;
    
        invoke-virtual {v0, v2}, Landroid/widget/ImageView;->setVisibility(I)V
    
        .line 3245
        :goto_1
        return-void
    
        .line 3234
        :cond_0
        const-wide/16 v0, -0x3
    
        cmp-long v0, p1, v0
    
        if-nez v0, :cond_1
    
        .line 3235
        iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSimIndicatorIcon:Landroid/widget/ImageView;
    
        const v1, 0x7f020136
    
        invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setBackgroundResource(I)V
    
        goto :goto_0
    
        .line 3237
        :cond_1
        iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSimIndicatorIcon:Landroid/widget/ImageView;
    
        const v1, 0x7f020135
    
        invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setBackgroundResource(I)V
    
        goto :goto_0

    change this, 0x7f08012a according to the value you got in your own public.xml
    Code:
    <public type="id" name="adi_widget" id="0x7f??????" />


    search this method
    Code:
    .method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
    scroll down in that method and add the red line
    Code:
     move-object/from16 v0, p0
    
        iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBroadcastReceiver:Landroid/content/BroadcastReceiver;
    
        invoke-virtual {v11, v1, v12}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
    
        .line 772
        invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->resetUserSetupObserver()V
    
       [COLOR="Red"] invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setupPowerWidget()V[/COLOR]
    
        .line 774
        new-instance v20, Landroid/content/IntentFilter;
    
        invoke-direct/range {v20 .. v20}, Landroid/content/IntentFilter;-><init>()V
    
        .line 775
        .local v20, simInfoIntentFilter:Landroid/content/IntentFilter;
        const-string v1, "android.intent.action.SIM_SETTING_INFO_CHANGED"


    OR
    you can put the line here
    Code:
       iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mMediaEjectBroadcastReceiver:Landroid/content/BroadcastReceiver;
    
        invoke-virtual {v11, v1, v15}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
    
        .line 800
        move-object/from16 v0, p0
    
      [COLOR="Red"] invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setupPowerWidget()V[/COLOR]
    
    
        iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
    
        return-object v1
    
        .line 440
        .end local v12           #filter:Landroid/content/IntentFilter;
        .end local v14           #indicator:Lcom/android/systemui/statusbar/toolbar/ToolBarIndicator;
        .end local v15           #mediaEjectFilter:Landroid/content/IntentFilter;
        .end local v19           #signalCluster:Lcom/android/systemui/statusbar/SignalClusterViewGemini;
        .end local v20           #simInfoIntentFilter:Landroid/content/IntentFilter;
        .end local v21           #tickerView:Lcom/android/systemui/statusbar/phone/TickerView;
        :cond_d
        const/4 v1, 0x0
    
        goto/16 :goto_0

    NOTE !! if your device / os
    Code:
    .method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
    doesn't have this line
    Code:
     move-object/from16 v0, p0

    change this
    Code:
     invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setupPowerWidget()V
    to like this
    Code:
    invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setupPowerWidget()V
    9
    STEP -3

    Next : Download attached Powerwidget_public, and open it with Notepad++
    so you have two public.xml now which is opened in the Notepad++
    1. secondly decompiled public.xml
    2. Powerwidget_public.xml

    - go to , smali/com/adi/systemui/powerwidget/here...
    there are a lot of smalis there

    FIND ALL IDS in all that smalis THAT'S STARTED WITH
    Code:
    0x7fxxxxxx

    EXAMPLE :
    AutoRotateButton.smali

    Code:
    .method protected getText()I
        .locals 1
    
        const v0, [COLOR="Red"]0x7f0b00f9[/COLOR]
    
        return v0
    .end method
    find this const v0, 0x7f0b00f9 in PowerWidget_public.xml what is calling for
    and we find that is for
    Code:
     <public type="[COLOR="Red"]string[/COLOR]" name="[COLOR="Red"]quickpanel_rotation_text[/COLOR]" id="[COLOR="Blue"]0x7f0b00f9[/COLOR]" />

    the IDS can be strings, ids, integer, arays, drawable, or layout, so you have to pay attention to this

    next go to your own public.xml search for the value you got
    Code:
     <public type="[COLOR="Red"]string[/COLOR]" name="[COLOR="Red"]quickpanel_rotation_text[/COLOR]" id="[COLOR="Blue"]0x7f0??????[/COLOR]" />
    and change the IDS in the smali with your own value
    Code:
    .method protected getText()I
        .locals 1
    
        const v0, [COLOR="Blue"]0x7f0??????[/COLOR]
    
        return v0
    .end method

    Do it too, to all
    Code:
    0x7fxxxxxx
    in all smalis in the Powerwidget folder.