Monday, October 13, 2014

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

HOW TO SWIPING POWERTOGLE, Selamat sore droiders, udah lumayan lama dari post terakhir ane, ini ada waktu senggang mayan bisa ngepost lagi hehe, setelah sebelumya ane share HOW TO SWIPING POWERTOGLE kali ini ane mau share tutor HOW TO SWIPING POWERTOGLE FOR JB 4.1. 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, ini hanya terdapat beberapa perbedaan dari jb 4.2 yah, tested di jb 4.1.2 a7s ok langsung aja :

Bahan-bahan :
  1. APK MULTI TOOLS, APK TOOLS, alat untuk compile/decompile lainnya.
  2. SystemUI.apk
  3. Niat
Langkah-langkahnya :
  • NOTE : DISINI ANE BASENYA JB 4.1 A7S MT-6577 KALO ADA PERBEDAAN MONGGO DI SESUAIKAN AJA :-)
  • Decompile SystemUI.apk
  • Buka res/layout/status_bar_expanded.xml atau gemini_status_bar_expanded.xml
  • Rubah seluruh line dari seperti ini :
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:id="@id/notification_panel" android:background="@drawable/notification_panel_bg" android:paddingTop="@dimen/notification_panel_padding_top" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginLeft="@dimen/notification_panel_margin_left"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
    <LinearLayout android:gravity="center" android:layout_gravity="bottom" android:orientation="horizontal" android:id="@id/carrier_label_gemini" android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="@dimen/carrier_label_height" android:layout_marginBottom="@dimen/close_handle_height">
        <com.android.systemui.statusbar.phone.CarrierLabelGemini android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network" android:gravity="center" android:layout_gravity="center" android:id="@id/carrier1" android:paddingLeft="12.0dip" android:paddingRight="12.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:singleLine="true" android:layout_weight="1.0" />
        <ImageView android:layout_gravity="center" android:id="@id/carrier_divider" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/gemini_carrier_divider" />
        <com.android.systemui.statusbar.phone.CarrierLabelGemini android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network" android:gravity="center" android:layout_gravity="center" android:id="@id/carrier2" android:paddingLeft="12.0dip" android:paddingRight="12.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:singleLine="true" android:layout_weight="1.0" />
    </LinearLayout>
    <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">
        <FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/close_handle_underlap">
            <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" android:layout_marginTop="48.0dip">
                <include layout="@layout/toolbar_view" />
                <include layout="@layout/toolbar_indicator" />
            </FrameLayout>
            <LinearLayout android:orientation="horizontal" android:background="#ff333333" android:layout_width="fill_parent" android:layout_height="32.0dip" android:layout_marginTop="151.0dip">
                <TextView android:textSize="20.0dip" android:textColor="#ffffffff" android:gravity="center_vertical" android:id="@id/notification_title" android:paddingLeft="16.0dip" android:paddingRight="16.0dip" android:layout_width="0.0dip" android:layout_height="fill_parent" android:text="@string/status_bar_latest_events_title" android:layout_weight="1.0" />
                <LinearLayout android:id="@id/clear_all_button" android:layout_width="60.0dip" android:layout_height="fill_parent">
                    <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/btn_parting_line" />
                    <ImageView android:id="@id/clearButtonImg" android:paddingLeft="29.0dip" android:paddingRight="29.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_notify_clear" android:scaleType="center" android:contentDescription="@string/accessibility_clear_all" />
                </LinearLayout>
            </LinearLayout>
            <ScrollView android:id="@id/scroll" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginTop="@dimen/scroll_view_margin_top" 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 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.CloseDragHandle android:layout_gravity="bottom" android:orientation="vertical" android:id="@id/close" android:layout_width="fill_parent" android:layout_height="@dimen/close_handle_height">
        <ImageView android:layout_gravity="bottom" android:id="@id/closeImg" android:layout_width="fill_parent" android:layout_height="@dimen/close_handle_height" android:src="@drawable/status_bar_close" android:scaleType="fitXY" />
    </com.android.systemui.statusbar.phone.CloseDragHandle>
</FrameLayout>
  • Buka res/values/arrays.xml lalu tambahkan line berikut :
<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>
  • Jika ga ada xmlnya, maka Download arrays.xml ini, taroh di res/values/disini
  • 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" />
  • Lalu download tambahannya disini, ekstrak lalu taroh di tempanya masing-masing.
  • Recompile SystemUI, lalu decompile lagi.
  • Buka publics.xml lalu jangan di close 
  • Buka com/android/systemui/statusbar/phone/PhoneStatusBar.smali
  • Untuk editing smali kalo bingung bisa download PhoneStatusBar.smali ane disini
  • ctrl + f line ini .field mDateView:Lcom/android/systemui/statusbar/policy/DateView; , lalu tambahkan line berikut tepat di atasnya :
.field private mCustomDrawerLayout:Lcom/serajr/systemui/navigationdrawer/CustomDrawerLayout;
  • ctrl+f .field private mPreviousConfigFontScale:F , lalu tambahkan line berikut tepat di atasnya :
.field private mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;
  • ctrl+f .method public constructor <init>()V, lalu perhatikan line berikut invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;-><init>()V (Mungkin Berbeda Tiap Rom) tambahkan tepat di bawah code tadi line ini :
iput-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerToggles:Lcom/serajr/powertoggles/PowerToggles;
  • ctrl+f .method private showAlwaysAskOrInternetCall(J)V, lalu tambahkan line berikut 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, 0x7f0c00ff

    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, 0x7f07000a

    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, 0x7f0c00ea

    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, 0x7f0b004c

    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, 0x2

    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, 0x7f0c00ff ganti dengan <public type="id" name="custom_drawer_layout" di public ente
const v2, 0x7f07000a ganti dengan <public type="color" name="custom_drawer_layout_scrin" di public ente
const v1, 0x7f0c00ea  ganti dengan <public type="id" name="power_toggles" di public ente
const v2, 0x7f0b004c 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 performCollapse()V, lalu perhatikan line di bawah ini (Mungkin berbeda tiap rom)
invoke-interface {v1, v2, v0}, Landroid/view/WindowManager;->updateViewLayout(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V
  • Lalu tambahkan line berikut di atas line tadi :
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
  • ctrl+f line ini
invoke-virtual {v2, v11, v3}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
  • Lalu tambahkan line berikut tepat di bawahnya :
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setupCustomDrawerLayout()V

    invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setupPowerToggles()V

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

    invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->powerTogglesPreferencesButtonsTitlesCallback()V
  • ctrl+f .method prepareTracking(IZ)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
  • Save, lalu buka androidmanifest.xml
  • Lihat line <uses-permission yang paling bawah, lalu tambahkan tepat di bawahnya :
<uses-permission android:name="android.permission.FORCE_STOP_PACKAGES" />
    <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
    <uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
    <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
    <uses-permission android:name="android.permission.WRITE_APN_SETTINGS" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.REBOOT" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.READ_PROFILE" />
    <uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.DELETE_PACKAGES" />
    <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>
  • Save
  • Recompile, lalu sign
  • Down

SS :

Thanks To :
Allah SWT
Um Abdusy
Serajr
You

12 komentar

Om ane error pas recompile errornya di style xml error line 63.. Knp ya mastah..bantu ane mastah.mksh tut nya berguna bgd buat newbie kya ane.

.method private showAlwaysAskOrInternetCall(J)V
.field private mPreviousConfigFontScale:F

gak ada di phonestatusbar.smali ane gan (jb4.1.2 qualcomm)

waahhh line 63 yg mana um ? bisa lebih detile ?? HP kita beda kan hehe

download bahan buat compare, lalu searh .method private showAlwaysAskOrInternetCall(J)V, liat sampe end method

nah liat method bawahnya, nah itu yg ente cari di HH ente, kalo bingung pm ane aja

untuk merubag ukuran profile dimana om

kalo mau di gedein :

buka phonestatusbar.smali yg method powertoggles, cari yg ada kata MeButton nahh ubah jadi 0x2

kalo mau kecilin tinggal ganti jadi 0x1

om kalo resolusi fotonya d.gedein gimana om ?? atau d.ganti dgn app profil lain kek lenox atau ui editor ??

fc gan, ini di systemui nya

[ 11-19 14:05:03.805 2269: 2269 E/AndroidRuntime ]

FATAL EXCEPTION: main

java.lang.VerifyError: com/android/systemui/statusbar/phone/PhoneStatusBar

at java.lang.Class.newInstanceImpl(Native Method)

at java.lang.Class.newInstance(Class.java:1319)

at com.android.systemui.SystemUIService.onCreate(SystemUIService.java:86)

at android.app.ActivityThread.handleCreateService(ActivityThread.java:2371)

at android.app.ActivityThread.access$1600(ActivityThread.java:133)

at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1285)

at android.os.Handler.dispatchMessage(Handler.java:99)

at android.os.Looper.loop(Looper.java:137)

at android.app.ActivityThread.main(ActivityThread.java:4794)

at java.lang.reflect.Method.invokeNative(Native Method)

at java.lang.reflect.Method.invoke(Method.java:511)

at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)

at dalvik.system.NativeStart.main(Native Method)

DAN ini pas ane tap icon powertogle nya

[ 11-19 14:06:36.095 2678: 2678 E/AndroidRuntime ]

FATAL EXCEPTION: main

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.systemui/com.serajr.powertoggles.preferences.PowerTogglesPreferencesActivity}: java.lang.NullPointerException

at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2067)

at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2092)

at android.app.ActivityThread.access$600(ActivityThread.java:133)

at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1203)

at android.os.Handler.dispatchMessage(Handler.java:99)

at android.os.Looper.loop(Looper.java:137)

at android.app.ActivityThread.main(ActivityThread.java:4794)

at java.lang.reflect.Method.invokeNative(Native Method)

at java.lang.reflect.Method.invoke(Method.java:511)

at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)

at dalvik.system.NativeStart.main(Native Method)

Caused by: java.lang.NullPointerException

at com.serajr.powertoggles.utils.ResourceUtils.getXmlResId(ResourceUtils.java:80)

at com.serajr.powertoggles.preferences.PowerTogglesPreferencesActivity.onCreate(PowerTogglesPreferencesActivity.java:53)

at android.app.Activity.performCreate(Activity.java:5008)

at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)

at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2031)

... 11 more

java.lang.NoSuchFieldError: com.android.systemui.statusbar.phone.PhoneStatusBar.mPowerToggles

kalo gini error dimanany gan

I: Smaling...
I: Building resources...
/sdcard/apktool/SystemUI_src/res/values/styles.xml:67: error: Error retrieving parent for item: No resource found that matches the given name '@style/TextAppearance'.
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [/data/data/per.pqy.apktool/lix/aapt, p, --min-sdk-version, 16, --target-sdk-version, 16, -F, /data/data/per.pqy.apktool/APKTOOL5033023144145339354.tmp, -0, arsc, -I, ?/apktool/framework/1.apk, -S, /sdcard/apktool/SystemUI_src/res, -M, /sdcard/apktool/SystemUI_src/AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:358)
at brut.androlib.Androlib.buildResources(Androlib.java:283)
at brut.androlib.Androlib.build(Androlib.java:206)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [/data/data/per.pqy.apktool/lix/aapt, p, --min-sdk-version, 16, --target-sdk-version, 16, -F, /data/data/per.pqy.apktool/APKTOOL5033023144145339354.tmp, -0, arsc, -I, ?/apktool/framework/1.apk, -S, /sdcard/apktool/SystemUI_src/res, -M, /sdcard/apktool/SystemUI_src/AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:357)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:336)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [/data/data/per.pqy.apktool/lix/aapt, p, --min-sdk-version, 16, --target-sdk-version, 16, -F, /data/data/per.pqy.apktool/APKTOOL5033023144145339354.tmp, -0, arsc, -I, ?/apktool/framework/1.apk, -S, /sdcard/apktool/SystemUI_src/res, -M, /sdcard/apktool/SystemUI_src/AndroidManifest.xml]
at brut.util.OS.exec(OS.java:89)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:355)
... 6 more

Kenapa nih?

Ane udh pasang cd jira kira gmn klo cd nya di replace

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