Saturday, October 4, 2014

[GUIDE][JB4.2] HOW TO SWIPING POWERTOGLE

HOW TO SWIPING POWERTOGLE, Selamat pagi droiders, udah lumayan lama dari post terakhir ane, ini ada waktu senggang mayan bisa ngepost lagi hehe, kali ini ane mau share tutor HOW TO SWIPING POWERTOGLE. Bagi yang belum tau apa itu swiping powertogle bisa mampir ke treadnya serajr Swiping PowerTogle For Xperia L, tonton aja videonya.


Nahh ane sekarang mau share Guidenya nih, tested di JB 4.2 MTK yah hehe, ok langsung aja :

Bahan-bahan :
  1. APK MULTI TOOLS, APK TOOLS, alat untuk compile/decompile lainnya.
  2. SystemUI.apk
  3. Niat

Langkah-langkahnya :
  • Decompile SystemUI.apk
  • Buka res/layout/status_bar_expanded.xml atau gemini_status_bar_expanded.xml
  • Rubah seluruh line dari seperti ini :
<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" />
    <com.serajr.systemui.navigationdrawer.CustomDrawerLayout android:id="@id/custom_drawer_layout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/close_handle_underlap">
        <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" />
            <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>
        <LinearLayout android:layout_gravity="left" android:orientation="vertical" android:background="@color/custom_drawer_layout_bg" android:layout_width="@dimen/custom_drawer_layout_width" android:layout_height="fill_parent">
            <TextView android:gravity="center" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Power Toggles" />
            <com.serajr.powertoggles.PowerToggles android:id="@id/power_toggles" android:layout_width="fill_parent" android:layout_height="wrap_content" />
        </LinearLayout>
    </com.serajr.systemui.navigationdrawer.CustomDrawerLayout>
</com.android.systemui.statusbar.phone.NotificationPanelView>
#LAYOUT DI ATAS PUNYA MTK, YANG LAIN SESUAIKAN AJA
  • Buka res/values/arrays.xml lalu tambahkan :
<string-array name="power_toggles_available_buttons">
        <item>MeProfile</item>
        <item>SystemSettings</item>
        <item>RecentApps</item>
        <item>BatteryInfo</item>
        <item>Wifi</item>
        <item>WifiAp</item>
        <item>Bluetooth</item>
        <item>GPS</item>
        <item>Flashlight</item>
        <item>Sound</item>
        <item>Brightness</item>
        <item>ScreenTimeout</item>
        <item>StayAwakePlugged</item>
        <item>Sync</item>
        <item>Lockscreen</item>
        <item>LockscreenAction</item>
        <item>AutoRotate</item>
        <item>Airplane</item>
        <item>MobileData</item>
        <item>USBConnectionMode</item>
        <item>USBDebugging</item>
        <item>USBTether</item>
        <item>Reboot</item>
        <item>Shutdown</item>
    </string-array>
    <string-array name="power_toggles_reboot_options">
        <item>@string/power_toggles_reboot</item>
        <item>@string/power_toggles_reboot_recovery</item>
        <item>@string/power_toggles_reboot_bootloader</item>
    </string-array>
    <string-array name="power_toggles_reboot_actions">
        <item>now</item>
        <item>recovery</item>
        <item>bootloader</item>
    </string-array>
    <string-array name="power_toggles_usb_connection_mode_options">
        <item>@string/power_toggles_usb_mtp_mode</item>
        <item>@string/power_toggles_usb_msc_mode</item>
    </string-array>
    <string-array name="power_toggles_usb_connection_mode_actions">
        <item>mtp</item>
        <item>mass_storage</item>
    </string-array>
    <string-array name="power_toggles_battery_info_options">
        <item>@string/power_toggles_battery_info_info</item>
        <item>@string/power_toggles_battery_info_usage</item>
    </string-array>
    <string-array name="power_toggles_battery_info_actions">
        <item>battery_info</item>
        <item>battery_usage</item>
    </string-array>
  • Buka attrs.xml lalu tambahkan :
<attr name="icon" format="reference" />
  • Buka colors.xml, lalu tambahkan :
    <color name="power_toggles_button_icon_color">#ffffffff</color>
    <color name="power_toggles_button_label_color">#ffffffff</color>
    <color name="custom_drawer_layout_bg">#e60e0e0e</color>
    <color name="custom_drawer_layout_scrin">#55ffffff</color>
    <color name="tab_text_color_off">#ffffffff</color>
    <color name="tab_text_color_on">#ff1ac31a</color>
  • Buka dimens.xml, lalu tambahkan :
<dimen name="power_toggles_button_height">107.0dip</dimen>
    <dimen name="sliders_height">100.0dip</dimen>
    <dimen name="custom_drawer_layout_width">272.0dip</dimen>
    <dimen name="power_toggles_grid_width">270.0dip</dimen>
  • Buka ids.xml, lalu tambahkan :
<item type="id" name="statusbar_hr">false</item>
    <item type="id" name="brightness_slider_power_toggle">false</item>
    <item type="id" name="divider">false</item>
    <item type="id" name="drag_handle">false</item>
    <item type="id" name="settings_icon">false</item>
    <item type="id" name="text1">false</item>
    <item type="id" name="checkbox">false</item>
    <item type="id" name="expanded_view_pager">false</item>
    <item type="id" name="expanded_view_pager_tab_strip">false</item>
    <item type="id" name="power_toggles">false</item>
    <item type="id" name="power_toggles_button">false</item>
    <item type="id" name="power_toggles_button_icon">false</item>
    <item type="id" name="power_toggles_button_text">false</item>
    <item type="id" name="power_toggles_button_status">false</item>
    <item type="id" name="power_toggles_me_profile_button">false</item>
    <item type="id" name="sliders_scroll">false</item>
    <item type="id" name="brightness_frame">false</item>
    <item type="id" name="media_volume_frame">false</item>
    <item type="id" name="media_volume_slider">false</item>
    <item type="id" name="ringer_volume_frame">false</item>
    <item type="id" name="ringer_volume_slider">false</item>
    <item type="id" name="alarm_volume_frame">false</item>
    <item type="id" name="alarm_volume_slider">false</item>
    <item type="id" name="voice_call_volume_frame">false</item>
    <item type="id" name="voice_call_volume_slider">false</item>
    <item type="id" name="notifications_volume_frame">false</item>
    <item type="id" name="notifications_volume_slider">false</item>
    <item type="id" name="power_toggles_preference_icon">false</item>
    <item type="id" name="power_toggles_preferences_order_grid">false</item>
    <item type="id" name="recents_inject_custom_view">false</item>
    <item type="id" name="custom_drawer_layout">false</item>
    <item type="id" name="power_toggles_button_camera_surface_holder">false</item>
    <item type="id" name="power_toggles_button_camera_surface_flash_overlay">false</item>
  • Buka integers.xml, lalu tambahkan :
<integer name="power_toggles_grid_layout_columns_count">3</integer>
  • Buka strings.xml, lalu tambahkan :
<string name="quick_settings_driving_label">Driving mode</string>
    <string name="power_toggles_page_title">Power Toggles</string>
    <string name="power_toggles_wifi_text">Wi-Fi</string>
    <string name="power_toggles_mobile_data_text">Data</string>
    <string name="power_toggles_network_text">Network Mode</string>
    <string name="power_toggles_sound_sound_text">Sound</string>
    <string name="power_toggles_sound_sound_vibration_text">Sound Vibration</string>
    <string name="power_toggles_sound_silent_text">Silent</string>
    <string name="power_toggles_sound_vibration_text">Vibration</string>
    <string name="power_toggles_auto_rotate_text">Auto Rotation</string>
    <string name="power_toggles_bluetooth_text">Bluetooth</string>
    <string name="power_toggles_gps_text">GPS</string>
    <string name="power_toggles_sync_text">Auto Sync</string>
    <string name="power_toggles_brightness_text">Brightness</string>
    <string name="power_toggles_screen_timeout_text">Screen Timeout</string>
    <string name="power_toggles_lockscreen_text">Lockscreen</string>
    <string name="power_toggles_airplane_text">Airplane Mode</string>
    <string name="power_toggles_flashlight_text">Flashlight</string>
    <string name="power_toggles_reboot_text">Reboot</string>
    <string name="power_toggles_shutdown_text">Shutdown</string>
    <string name="power_toggles_airplane_mode">In Flight Mode</string>
    <string name="power_toggles_shutdown_confirm">Your phone will shut down.</string>
    <string name="power_toggles_reboot">Reboot</string>
    <string name="power_toggles_reboot_recovery">Recovery</string>
    <string name="power_toggles_reboot_bootloader">Bootloader</string>
    <string name="power_toggles_usb_debugging_text">USB Debugging</string>
    <string name="power_toggles_usb_connection_mode_text">USB Conn. Mode</string>
    <string name="power_toggles_usb_mtp_title">Current mode: MTP</string>
    <string name="power_toggles_usb_msc_title">Current mode: MSC</string>
    <string name="power_toggles_usb_mtp_mode">MTP - Media Transfer</string>
    <string name="power_toggles_usb_msc_mode">MSC - Mass Storage</string>
    <string name="power_toggles_wifi_ap_text">Wi-Fi Hotspot</string>
    <string name="power_toggles_stay_awake_plugged_text">Stay Awake</string>
    <string name="power_toggles_battery_info_text">Battery Info</string>
    <string name="power_toggles_battery_info_info">Battery Information</string>
    <string name="power_toggles_battery_info_usage">Battery Power Usage</string>
    <string name="power_toggles_system_settings_text">System Settings</string>
    <string name="power_toggles_recent_apps_text">Recent Apps</string>
    <string name="power_toggles_me_profile_contact_text">Me</string>
    <string name="power_toggles_stamina_mode_text">STAMINA Mode</string>
    <string name="power_toggles_nfc_text">NFC</string>
    <string name="power_toggles_roaming_text">Roaming</string>
    <string name="power_toggles_throw_text">Throw</string>
    <string name="power_toggles_usb_tether_text">USB Tethering</string>
    <string name="power_toggles_preferences_category_power_toggles">Power Toggles</string>
    <string name="power_toggles_preferences_close_on_toggle_title">Close on Toggle</string>
    <string name="power_toggles_preferences_close_on_toggle_summary">Close the notification pulldown after toggling a button</string>
    <string name="power_toggles_preferences_category_order">Buttons Order</string>
    <string name="power_toggles_preferences_buttons_order_title">Change Order</string>
    <string name="power_toggles_preferences_buttons_order_summary">Change the buttons order (two or more selected selected buttons are needed)</string>
    <string name="power_toggles_preferences_category_buttons">Buttons (Alphabetically Sorted)</string>
    <string name="power_toggles_preferences_category_reset">Reset</string>
    <string name="power_toggles_preferences_reset_title">Reset Buttons</string>
    <string name="power_toggles_preferences_reset_summary">All buttons and default order</string>
    <string name="power_toggles_preferences_reset_message">All buttons will be included with the default order. Continue?</string>
    <string name="power_toggles_preferences_reset_success_message">All buttons and order successfully reseted!</string>
    <string name="power_toggles_preferences_about">About</string>
    <string name="power_toggles_lockscreen_action_text">Go to sleep</string>
    <string name="slider_control_page_title">Slider Controls</string>
    <string name="custom_drawer_layout_header_text">POWER TOGGLES</string>
    <string name="power_toggles_battery_meter_format">@string/status_bar_settings_battery_meter_format</string>
    <string name="preference_statusbar_expanded_apps_layout_title">Applications</string>
    <string name="power_toggles_preferences_buttons_titles_title">Buttons Titles</string>
    <string name="power_toggles_preferences_buttons_titles_summary">Show buttons titles</string>
    <string name="power_toggles_camera_text">Camera</string>
    <string name="notifications_page_title">@string/status_bar_settings_notifications</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>
  • Buka styles.xml, lalu tambahkan :
<style name="TextAppearance.QuickPanel" parent="@style/TextAppearance" />
    <style name="power_toggles_text_appearance" parent="@style/TextAppearance.QuickPanel">
        <item name="android:textSize">10.0sp</item>
        <item name="android:textStyle">normal</item>
        <item name="android:textColor">@color/power_toggles_button_label_color</item>
        <item name="android:ellipsize">marquee</item>
        <item name="android:paddingLeft">6.0dip</item>
        <item name="android:paddingRight">6.0dip</item>
        <item name="android:fadingEdge">horizontal</item>
        <item name="android:maxLines">2</item>
        <item name="android:singleLine">false</item>
        <item name="android:drawablePadding">12.0dip</item>
        <item name="android:textAllCaps">true</item>
    </style>
    <style name="DeviceDefault" parent="@*android:style/Theme.DeviceDefault" />
  • Download Bahan tambahannya disini
  • Ekstrak lalu taroh di tempatnya masing-masing
  • Recompile systemUI, lalu decompile lagi
  • Buka public.xml dan jangan di close
  • Buka com/android/systemui/statusbar/phone/PhoneStatusBar.smali
  • ctrl+f .field mDateTimeView:Landroid/view/View; tambahkan tepat di atasnya :
.field private mCustomDrawerLayout:Lcom/serajr/systemui/navigationdrawer/CustomDrawerLayout;
  • ctrl+f .field private mPreviousConfigFontScale:F tambahkan tepat di atasnya :
.field private mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;

.field private mPowerTogglesLayout:Landroid/view/View;
  • ctrl+f .method public constructor <init>()V lalu lihat code ini invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;-><init>()V (mungkin beda tiap rom) Tambahkan tepat di bawah code tadi line ini :
iput-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;
  • ctrl+f .method private showAlwaysAskOrInternetCall(J)V tambahkan tepat di atasnya :
.method private setupCustomDrawerLayout()V
    .locals 3

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

    const v1, 0x7f090112

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

    move-result-object v0

    check-cast v0, Lcom/serajr/systemui/navigationdrawer/CustomDrawerLayout;

    iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCustomDrawerLayout:Lcom/serajr/systemui/navigationdrawer/CustomDrawerLayout;

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCustomDrawerLayout:Lcom/serajr/systemui/navigationdrawer/CustomDrawerLayout;

    iget-object v1, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    const v2, 0x7f0a0007

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getColor(I)I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/serajr/systemui/navigationdrawer/CustomDrawerLayout;->setScrimColor(I)V

    return-void
.end method

.method private setupPowerToggles()V
    .locals 3

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

    const v1, 0x7f09011c

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

    move-result-object v0

    check-cast v0, Lcom/serajr/powertoggles/PowerToggles;

    iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;

    iget-object v1, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    const v2, 0x7f0e005a

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/serajr/powertoggles/PowerToggles;->gridWidth(I)V

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lcom/serajr/powertoggles/PowerToggles;->buttonShowTitle(Z)V

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lcom/serajr/powertoggles/PowerToggles;->buttonMeProfileCellSpan(I)V

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;

    invoke-virtual {v0}, Lcom/serajr/powertoggles/PowerToggles;->setupPowerToggles()V

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;

    invoke-virtual {v0}, Lcom/serajr/powertoggles/PowerToggles;->updatePowerToggles()V

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;

    new-instance v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$51;

    invoke-direct {v1, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$51;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V

    invoke-virtual {v0, v1}, Lcom/serajr/powertoggles/PowerToggles;->setChangeContentObserverListener(Lcom/serajr/powertoggles/PowerToggles$ChangeObserverCallbackInterface;)V

    return-void
.end method

#GANTI CODE PUBLIC DI ATAS
const v1, 0x7f090112 ganti dengan <public type="id" name="custom_drawer_layout" di public ente
const v2, 0x7f0a0007 ganti dengan <public type="color" name="custom_drawer_layout_scrin" di public ente
const v1, 0x7f09011c  ganti dengan <public type="id" name="power_toggles" di public ente
const v2, 0x7f0e005a ganti dengan <public type="dimen" name="power_toggles_grid_width" di public ente
  • ctrl+f .method public disable(I)V, lalu tambahkan tepat di atasnya :
.method public customDrawerLayoutEnabled(Z)V
    .locals 2
    .parameter "enabled"

    .prologue
    const/4 v0, 0x0

    .local v0, lockMode:I
    if-nez p1, :cond_0

    const/4 v0, 0x1

    :cond_0
    iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCustomDrawerLayout:Lcom/serajr/systemui/navigationdrawer/CustomDrawerLayout;

    invoke-virtual {v1, v0}, Lcom/serajr/systemui/navigationdrawer/CustomDrawerLayout;->setDrawerLockMode(I)V

    return-void
.end method
  • ctrl+f .method makeExpandedInvisibleSoon()V, tambahkan line yang di merahkan :
.method makeExpandedInvisibleSoon()V
    .locals 4

    .prologue
    .line 1887
    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCustomDrawerLayout:Lcom/serajr/systemui/navigationdrawer/CustomDrawerLayout;

    invoke-virtual {v0}, Lcom/serajr/systemui/navigationdrawer/CustomDrawerLayout;->closeDrawers()V

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;

    invoke-virtual {v0}, Lcom/serajr/powertoggles/PowerToggles;->fullScroll()V
  
    iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mHandler:Lcom/android/systemui/statusbar/BaseStatusBar$H;

    new-instance v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$20;

    invoke-direct {v1, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$20;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V

    const-wide/16 v2, 0x32

    invoke-virtual {v0, v1, v2, v3}, Lcom/android/systemui/statusbar/BaseStatusBar$H;->postDelayed(Ljava/lang/Runnable;J)Z

    .line 1888
    return-void
.end method
  • ctrl+f invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->resetUserSetupObserver()V, Lalu tambahkan tepat di bawahnya :
invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setupCustomDrawerLayout()V
  
    invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setupPowerToggles()V

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

    invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->powerTogglesPreferencesButtonsTitlesCallback()V
  • ctrl+f .method public removeIcon(Ljava/lang/String;II)V, lalu tambahkan tepat di atasnya :
.method public powerTogglesEnabledCallback()V
    .locals 3

    .prologue
    const/4 v2, 0x1

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

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

    move-result-object v0

    const-string v1, "power_toggles_enabled"

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

    move-result v0

    if-ne v0, v2, :cond_0

    .line 112
    const-string v0, "powerTogglesEnabledCallback"

    const-string v1, "habilita"

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

    .line 113
    const/4 v0, 0x1

    invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->customDrawerLayoutEnabled(Z)V

    .line 120
    :goto_0
    return-void

    .line 117
    :cond_0
    const-string v0, "powerTogglesEnabledCallback"

    const-string v1, "desabilita"

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

    .line 118
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->customDrawerLayoutEnabled(Z)V

    goto :goto_0
.end method

.method public powerTogglesPreferencesButtonsTitlesCallback()V
    .locals 4

    .prologue
    iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;

    if-eqz v1, :cond_1

    const/4 v0, 0x0

    .local v0, showTitles:Z
    iget-object v1, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;

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

    move-result-object v1

    const-string v2, "power_toggles_preferences_buttons_titles"

    const/4 v3, 0x0

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

    move-result v1

    const/4 v2, 0x1

    if-ne v1, v2, :cond_0

    const/4 v0, 0x1

    :cond_0
    iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;

    invoke-virtual {v1, v0}, Lcom/serajr/powertoggles/PowerToggles;->buttonShowTitle(Z)V

    iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;

    invoke-virtual {v1}, Lcom/serajr/powertoggles/PowerToggles;->setupPowerToggles()V

    iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;

    invoke-virtual {v1}, Lcom/serajr/powertoggles/PowerToggles;->updatePowerToggles()V

    .end local v0           #showTitles:Z
    :cond_1
    return-void
.end method
  • Kalo bingung, bisa compare dengan phonestatusbar ane, Download disini
  • Save, lalu buka android manifest.xml
  • ctrl+f <manifest android:versionCode="17" ubah menjadi <manifest android:sharedUserId="android.uid.system" android:process="system" android:versionCode="17"
  • Lihat line <uses-permission yang paling bawah, lalu tambahkan tepat di bawahnya :
<uses-permission android:name="android.permission.REBOOT" />
    <uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <protected-broadcast android:name="android.permission.SCREENSHOT" />
    <protected-broadcast android:name="android.intent.action.SCREENSHOT" /> 
  • ctrl+f </activity> yang paling bawah, lalu tambahkan tepat di bawahnya :
<activity android:theme="@style/DeviceDefault" android:label="@string/power_toggles_preferences_category_power_toggles" android:icon="@drawable/ic_launcher_settings" android:name="com.serajr.powertoggles.preferences.PowerTogglesPreferencesActivity" android:exported="true" android:configChanges="orientation|screenSize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <action android:name="com.serajr.powertoggles.preferences.intent.PREFERENCES" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:theme="@style/DeviceDefault" android:label="@string/power_toggles_preferences_category_order" android:icon="@drawable/ic_launcher_settings" android:name="com.serajr.powertoggles.preferences.PowerTogglesPreferencesOrderActivity" android:exported="false" android:configChanges="orientation|screenSize">
            <intent-filter>
                <action android:name="com.serajr.powertoggles.preferences.intent.ORDER" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

SS :

Thanks To :
ALLAH SWT
Om No More
Om Muhammad Abdusy Syukur
You

16 komentar

Kalo buat 4.0.4 mt6575 bs gak ya Om? Beberapa kali coba masih gagal. Kalo berkenan, sy ingin uploadkan systemui.apk ny Om (berharap dpt di mod kan :). Mohon maaf jk tidak berkenan Om. Terimakasih.

weh saya blm test um, lagian susah juga kalo ga megang devicenya mah hehe

I: Smaling...
[3700,0] missing END_METHOD_DIRECTIVE at '.method'
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: /storage/sdcard0/apktool/SystemUI_src_src/smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:45)
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:33)
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:66)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:50)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:37)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:257)
at brut.androlib.Androlib.buildSources(Androlib.java:214)
at brut.androlib.Androlib.build(Androlib.java:205)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)


INI kenapa?

om kalo bikin powertogglenya aja bagian yg diubah mana aja y

cek line 3700 um di phonestatusbar.smali, perhatikan guidenya, ada yg terlewat tuh :-)

ambil smali powertogle, tambahkan file yg perlu sama tambahkan line2 di phonestatusbar.smali yg berhubungan dengan powertogle um

Om kalo pengen bikin layoutnya aja tanpa powertoggle , yg dikurangi / diubah bagian mana aja ya om ?

buat jb 4.1.2 bisa gan

gan ane pemula, ada gak tutor masang kode ny di XML yg benar

klo dah pasang view pager nambahin script customdrawerny di fiqih_status_bar_expanded_notifications ato d gemini statusbar expanded

jangan masukin line di smali yg ada kata2 powertogglenya um

wah blm sempet buat um hehe, sibuk kuliah ane juga wkwkw

Um kok di phonestatusbar ane ga ada script ".field private mPreviousConfigFontScale:F" sama ".method private showAlwaysAskOrInternetCall(J)V" solusi dong om

Gan klo fc pas di tarik kira2 kenapa ya gan

Berkomentarlah yang baik, tidak mencela postingan :-) . Gunakan bahasa yang sopan dan mudah di mengerti.

TERIMA KASIH TELAH BERKOMENTAR, karena pengunjung yang baik adalah pengunjung yang berkomentar :-) :v
EmoticonEmoticon