Related
So, here we go...
Hi all !
So, I'm doing a small mod, the mod is changing statusbar clock color. If you're intrested how to apply this mod, here's the guide.
Note : The guide doesn't apply to custom ROM user that have customizable statusbar clock color (it's useless :silly: )
Let's start !
Preparations & Requirements :
1. APKTool
2. A mod-able SystemUI (not odexed)
3. Working brain and eyes
The Guide :
1. Decompile the SystemUI
2. Navigate to /res/values/
3. Open styles.xml with your desired text editor
4. Search for this value :
Code:
<style name="TextAppearance.StatusBar.Clock" parent="@*android:style/TextAppearance.StatusBar.Icon">
<item name="android:textSize">16.0dip</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">@color/status_bar_clock_color</item>
</style>
5. Edit the red value :
Code:
<style name="TextAppearance.StatusBar.Clock" parent="@*android:style/TextAppearance.StatusBar.Icon">
<item name="android:textSize">16.0dip</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">[COLOR="Red"]@color/status_bar_clock_color[/COLOR]</item>
</style>
6. You can change it into any color, freely. The format of the color must be Hex. Example :
Code:
#ffffffff : White
#000000 : Black
#00ff00 : Green
7. The value would look like this (I pick white color for example) :
Code:
<style name="TextAppearance.StatusBar.Clock" parent="@*android:style/TextAppearance.StatusBar.Icon">
<item name="android:textSize">16.0dip</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">#ffffffff</item>
</style>
8. Recompile, and Enjoy theming !
Tip : Search Google for Hex Color Picker, so you can easily find the hex value of your desired color.
How to change DateView and ClockView colors
Another guide, how to change expanded DateView and ClockView colors.
Preparations & Requirements is same like post above
The guide :
1. Decompile SystemUI
2. Navigate to /res/values/
3. Open styles.xml with your desired text editor
4. Find these two values :
Code:
<style name="TextAppearance.StatusBar.Expanded.Clock" parent="@style/TextAppearance.StatusBar.Expanded">
<item name="android:textSize">32.0dip</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">#ffffffff</item>
<item name="android:fontFamily">sans-serif-light</item>
</style>
<style name="TextAppearance.StatusBar.Expanded.Date" parent="@style/TextAppearance.StatusBar.Expanded">
<item name="android:textSize">12.0dip</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">#ffcccccc</item>
<item name="android:textAllCaps">true</item>
</style>
5. Edit the red value :
Code:
<style name="TextAppearance.StatusBar.Expanded.Clock" parent="@style/TextAppearance.StatusBar.Expanded">
<item name="android:textSize">32.0dip</item>
<item name="android:textStyle">normal</item>
[COLOR="Red"]<item name="android:textColor">#ffffffff</item>[/COLOR]
<item name="android:fontFamily">sans-serif-light</item>
</style>
<style name="TextAppearance.StatusBar.Expanded.Date" parent="@style/TextAppearance.StatusBar.Expanded">
<item name="android:textSize">12.0dip</item>
<item name="android:textStyle">normal</item>
[COLOR="Red"]<item name="android:textColor">#ffcccccc</item>[/COLOR]
<item name="android:textAllCaps">true</item>
</style>
6. You can edit the color freely !
7. Recompile, and Enjoy !
Note : The Expanded.Clock is the clock that appears when you pulldown statusbar, while the Expanded.Date is the date beside Expanded.Clock
Changing Statusbar Clock Style
Another guide (eh, too much guide today ), this one how to change statusbar clock style (to bold, italic, condensed, etc)
Requirements are same like above guide.
The Guide :
1. Decompile SystemUI
2. Navigate to /res/values/
3. Edit styles.xml
4. Find this value :
Code:
<style name="TextAppearance.StatusBar.Clock" parent="@*android:style/TextAppearance.StatusBar.Icon">
<item name="android:textSize">16.0dip</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">@color/status_bar_clock_color</item>
</style>
5. Edit the red value :
Code:
<style name="TextAppearance.StatusBar.Clock" parent="@*android:style/TextAppearance.StatusBar.Icon">
<item name="android:textSize">16.0dip</item>
[COLOR="Red"] <item name="android:textStyle">normal</item>[/COLOR]
<item name="android:textColor">@color/status_bar_clock_color</item>
</style>
6. You can change it to :
Note : Bolded style requires KitKat ROM or later.
Code:
normal : Normal, regular style
bold : Bold style
italic : Italic style, may not work with ICS ROMs
[B]condensed : Condensed, like in KitKat launcher drawers[/B]
[B]light : Light, thinner than normal style[/B]
[B]thin : Thin, thinner than light[/B]
7. Recompile, and Enjoy Theming !
Decapitalizing DateView
Another one, if you may.
We know that, date view (Expanded.Date if you didn't understand) have capitalized text. I found it annoying, so I decided to edit it.
Requirements are same like guide above.
The Guide :
1. Decompile SystemUI.apk
2. Navigate to /res/values/
3. Edit styles.xml
4. Find this line :
Code:
<style name="TextAppearance.StatusBar.Expanded.Date" parent="@style/TextAppearance.StatusBar.Expanded">
<item name="android:textSize">12.0dip</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">#ffcccccc</item>
<item name="android:textAllCaps">true</item>
</style>
5. Edit the red value :
Code:
<style name="TextAppearance.StatusBar.Expanded.Date" parent="@style/TextAppearance.StatusBar.Expanded">
<item name="android:textSize">12.0dip</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">#ffcccccc</item>
[COLOR="Red"] <item name="android:textAllCaps">true</item>[/COLOR]
</style>
6. Change it to false
7. Recompile, and Enjoy !
Decapitalizing QuickTiles / QuickSettings
So, another one (might add more :silly: ). How to decapitalize QuickSettings / QuickTiles.
Requirements are same like above guide.
The Guide :
1. Decompile SystemUI.apk
2. Navigate to /res/values/
3. Edit styles.xml
4. Find this line :
Code:
<style name="TextAppearance.QuickSettings.TileView" parent="@style/TextAppearance.QuickSettings">
<item name="android:textSize">12.0dip</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">#ffcccccc</item>
<item name="android:textAllCaps">true</item>
<item name="android:paddingStart">6.0dip</item>
<item name="android:paddingEnd">6.0dip</item>
</style>
5. Edit the red line :
Code:
<style name="TextAppearance.QuickSettings.TileView" parent="@style/TextAppearance.QuickSettings">
<item name="android:textSize">12.0dip</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">#ffcccccc</item>
[COLOR="Red"] <item name="android:textAllCaps">true</item>[/COLOR]
<item name="android:paddingStart">6.0dip</item>
<item name="android:paddingEnd">6.0dip</item>
</style>
6. Change it to false
7. Recompile, and enjoy !
Woah!!! You should add one for transparency too! It would complete this super guide
Sent from my Moto G XT1033 using Tapatalk
skyinfo said:
Woah!!! You should add one for transparency too! It would complete this super guide
Sent from my Moto G XT1033 using Tapatalk
Click to expand...
Click to collapse
Thanks, will try to add it.
Transparent Statusbar [4.1 - 4.3.1 Only]
So, as based on request. I'll add how to make transparencies to statusbar.
Here we go !
The guide is based on Adi Aisiteru Reborn's guide. So thank him too !
The Guide :
1. Decompile android.policy.jar
2. Navigate to /com/android/internal/policy/impl
3. Edit PhoneWindowManager.smali
4. Find this line :
Code:
.method public getSystemDecorRectLw(Landroid/graphics/Rect;)I
5. Replace the red line :
Code:
.method public getSystemDecorRectLw(Landroid/graphics/Rect;)I
.registers 3
.parameter "systemRect"
.prologue
.line 3057
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemLeft:I
iput v0, p1, Landroid/graphics/Rect;->left:I
.line 3058
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemTop:I
iput v0, p1, Landroid/graphics/Rect;->top:I
.line 3059
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemRight:I
iput v0, p1, Landroid/graphics/Rect;->right:I
.line 3060
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemBottom:I
iput v0, p1, Landroid/graphics/Rect;->bottom:I
.line 3061
[COLOR="Red"] iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_1b
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
.line 3063
:goto_1a
return v0
.line 3062
:cond_1b
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_26
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
goto :goto_1a
.line 3063
:cond_26
const/4 v0, 0x0
goto :goto_1a
.end method[/COLOR]
with this line :
Code:
const/4 v0, 0x0
return v0
.end method
6. Recompile android.policy.jar
7. Decompile SystemUI.apk
8. Navigate to /res/values/
9. Edit drawables.xml
10. Modify the red lines with your desired transparency value (value at bottom of this post) :
Code:
<item type="drawable" name="notification_number_text_color">#ff000000</item>
<item type="drawable" name="ticker_background_color">#ff1d1d1d</item>
[COLOR="Red"]<item type="drawable" name="status_bar_background">#00000000</item>[/COLOR]
<item type="drawable" name="status_bar_recents_app_thumbnail_background">#88000000</item>
<item type="drawable" name="status_bar_notification_row_background_color">#ff090909</item>
<item type="drawable" name="recents_callout_line">#99ffffff</item>
<item type="drawable" name="notification_item_background_legacy_color">#ffaaaaaa</item>
<item type="drawable" name="intruder_bg_pressed">#ff33b5e5</item>
<item type="drawable" name="notification_header_bg">#ff000000</item>
[COLOR="Red"]<item type="drawable" name="system_bar_background">#88000000</item>
<item type="drawable" name="notification_icon_area_smoke">#88000000</item>[/COLOR]
Code:
Transparency values
#00000000 : 100% Transparent
#88000000 : 80% Transparent
#88000000 : 75% Transparent
#7f000000 : 50% Transparent
#d8000000 : 25 % Transparent
#ff000000 : Solid Black
11. Recompile and enjoy !
cool,another awesome mod with guide from our team,thanx.
TEAM OPTIMA STANDS FOR "CUSTOM"!!!!!!!STAY THEMED AND MODDED
-CALIBAN666- said:
cool,another awesome mod with guide from our team,thanx.
TEAM OPTIMA STANDS FOR "CUSTOM"!!!!!!!STAY THEMED AND MODDED
Click to expand...
Click to collapse
You're welcome !
amazing work dude! could you add some screenshots for the mods?
deleted
Thanks .
Sent from my LG-E610 using XDA Premium 4 mobile app
https://lh4.googleusercontent.com/-...n1B-0Usk/w239-h319-no/2014-05-02-18-18-17.jpg
Could you tell me how to fix this ?
I mean the slash sign, and this "break" where is the brightness slider.
Daniolki said:
https://lh4.googleusercontent.com/-...n1B-0Usk/w239-h319-no/2014-05-02-18-18-17.jpg
Could you tell me how to fix this ?
I mean the slash sign, and this "break" where is the brightness slider.
Click to expand...
Click to collapse
That's related to framework-res somehow.
great guide thanks for sharing!!!
Thanks!
Hey dude, thanks! :laugh:
can u show me how to add brightness slider and setting shortcut to status bar?. the rom is stock 2.3.6 - lg l3. thanks
F4uzan said:
So, as based on request. I'll add how to make transparencies to statusbar.
Here we go !
The guide is based on Adi Aisiteru Reborn's guide. So thank him too !
The Guide :
1. Decompile android.policy.jar
2. Navigate to /com/android/internal/policy/impl
3. Edit PhoneWindowManager.smali
4. Find this line :
Code:
.method public getSystemDecorRectLw(Landroid/graphics/Rect;)I
5. Replace the red line :
Code:
.method public getSystemDecorRectLw(Landroid/graphics/Rect;)I
.registers 3
.parameter "systemRect"
.prologue
.line 3057
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemLeft:I
iput v0, p1, Landroid/graphics/Rect;->left:I
.line 3058
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemTop:I
iput v0, p1, Landroid/graphics/Rect;->top:I
.line 3059
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemRight:I
iput v0, p1, Landroid/graphics/Rect;->right:I
.line 3060
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemBottom:I
iput v0, p1, Landroid/graphics/Rect;->bottom:I
.line 3061
[COLOR="Red"] iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_1b
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
.line 3063
:goto_1a
return v0
.line 3062
:cond_1b
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_26
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
goto :goto_1a
.line 3063
:cond_26
const/4 v0, 0x0
goto :goto_1a
.end method[/COLOR]
with this line :
Code:
const/4 v0, 0x0
return v0
.end method
6. Recompile android.policy.jar
7. Decompile SystemUI.apk
8. Navigate to /res/values/
9. Edit drawables.xml
10. Modify the red lines with your desired transparency value (value at bottom of this post) :
Code:
<item type="drawable" name="notification_number_text_color">#ff000000</item>
<item type="drawable" name="ticker_background_color">#ff1d1d1d</item>
[COLOR="Red"]<item type="drawable" name="status_bar_background">#00000000</item>[/COLOR]
<item type="drawable" name="status_bar_recents_app_thumbnail_background">#88000000</item>
<item type="drawable" name="status_bar_notification_row_background_color">#ff090909</item>
<item type="drawable" name="recents_callout_line">#99ffffff</item>
<item type="drawable" name="notification_item_background_legacy_color">#ffaaaaaa</item>
<item type="drawable" name="intruder_bg_pressed">#ff33b5e5</item>
<item type="drawable" name="notification_header_bg">#ff000000</item>
[COLOR="Red"]<item type="drawable" name="system_bar_background">#88000000</item>
<item type="drawable" name="notification_icon_area_smoke">#88000000</item>[/COLOR]
Code:
Transparency values
#00000000 : 100% Transparent
#88000000 : 80% Transparent
#88000000 : 75% Transparent
#7f000000 : 50% Transparent
#d8000000 : 25 % Transparent
#ff000000 : Solid Black
11. Recompile and enjoy !
Click to expand...
Click to collapse
Sorry, I know this thread is for L3-L7, but you write that works on JB 4.1, so please describe (if you know) what i must change to work with my L7 II P710. I decompile/change egzactly lines you describe/recompile, and result is-no transparency/any visual changes...
Sory for my english, and please help.
maxx_hr said:
Sorry, I know this thread is for L3-L7, but you write that works on JB 4.1, so please describe (if you know) what i must change to work with my L7 II P710. I decompile/change egzactly lines you describe/recompile, and result is-no transparency/any visual changes...
Sory for my english, and please help.
Click to expand...
Click to collapse
On stock it won't work. Somehow stock uses different value and pointer than AOSP.
I'll try to investigate this.
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 :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://forum.xda-developers.com/showpost.php?p=53798727&postcount=34
and by Recognized Themer @Ticklefish, here http://forum.xda-developers.com/showpost.php?p=53824313&postcount=37
Credits and Thanks to them
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
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.
STEP - 4
- Disable signature check
here : http://forum.xda-developers.com/showthread.php?t=1698352
or in here : http://forum.xda-developers.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" />
Screenshots
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
fertamax om :victory: !!
Thread Updated !, please use New_PowerWidget.apk,.
cuz re-order prefrence doesn't work on the old PowerWidget.apk
:laugh:
Finally EPIC mod for Mediatek has come.
Thanx mastah!
Thanks a lot
Thanks a lot SIR for making a guide for MTK Devices ..Will try today .....
Great job!!
Another awesome write up!! Congrats bro!!
And you have used my network mode receiver too... great! :highfive:
thanx...
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:
pavan kr said:
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:
Click to expand...
Click to collapse
please check again all IDS in your smali got the correct value
ihiirrrrr love it ....work like a charm mastah...on imo raptor...:good:
wow
:good:work ...thx teacher
your awesome...another great guides from u... sungkem dulu ama guru... _/|\_
thanks...
Sent from my GT-I9152 using Tapatalk
It's touchwiz 4.2 :good::laugh:
budi78 said:
:good:work ...thx teacher
Click to expand...
Click to collapse
sitifire said:
your awesome...another great guides from u... sungkem dulu ama guru... _/|\_
thanks...View attachment 2791477
Sent from my GT-I9152 using Tapatalk
Click to expand...
Click to collapse
awesome guide suhu sangat sangat Thanks :good:
thanks lord adi...
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
HOW TO ADD SCREENSHOT TOGGLE TO NOTIFICATION PANEL
AOSP / CM / MTK JB 4.2 ++
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Hi guys :victory::laugh::silly:
This mod is actually already in most of Open Source Rom Quicksettings Tiles view, but I change the code little bit to put the toggle on notification panel
Credit & thanks ;
- Carbon Rom, AOKP, cRdroid AOSP , CyanogenMod, BeanStalk
- [Unofficial Community] Galaxy Wonder CyanogenMod Indonesia
Feature :
- On click will take screenshot anywhere
- On long click will delay screenshot in 5 seconds
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
STEP - 1
- Decompile your SystemUI.apk
- Download attached SCREENSHOT-SystemUI.zip exstract it and merge it to your decompiled SystemUI.apk
- SystemUI.apk/res/layout/status_bar_expanded_header.xml
add the red code
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/header" android:background="@drawable/notification_header_bg" android:layout_width="fill_parent" android:layout_height="@dimen/notification_panel_header_height" android:baselineAligned="false"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<RelativeLayout android:enabled="false" android:id="@id/datetime" android:background="@drawable/ic_notify_button_bg" android:paddingLeft="8.0dip" android:paddingRight="8.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Clock" android:id="@id/clock" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="8.0dip" android:singleLine="true" android:layout_centerVertical="true" />
<com.android.systemui.statusbar.policy.DateView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date" android:id="@id/date" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/clock" android:layout_centerVertical="true" />
</RelativeLayout>
[COLOR="Red"]<ImageButton android:id="@id/asteroid_screenshot_button" android:background="@drawable/asteroid_screenshot_button_bg" android:paddingTop="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_asteroid_screenshot" android:layout_toRightOf="@id/date" android:paddingStart="7.0dip" />[/COLOR]
<Space android:layout_width="0.0dip" android:layout_height="0.0dip" android:layout_weight="1.0" />
<TextView android:textSize="11.0dip" android:textStyle="bold" android:textColor="#ff00a040" android:layout_gravity="center_vertical" android:id="@id/header_debug_info" android:padding="2.0dip" android:visibility="invisible" android:layout_width="wrap_content" android:layout_height="wrap_content" android:fontFamily="sans-serif-condensed" />
<ImageView android:id="@id/clear_all_button" android:layout_width="50.0dip" android:layout_height="50.0dip" android:src="@drawable/ic_notify_clear" android:scaleType="center" android:contentDescription="@string/accessibility_clear_all" />
<FrameLayout android:id="@id/settings_button_holder" android:layout_width="50.0dip" android:layout_height="50.0dip" android:layout_marginLeft="12.0dip">
<ImageView android:id="@id/settings_button" android:layout_width="50.0dip" android:layout_height="50.0dip" android:src="@drawable/ic_notify_settings" android:scaleType="center" android:contentDescription="@string/accessibility_desc_quick_settings" />
<ImageView android:id="@id/notification_button" android:visibility="gone" android:layout_width="50.0dip" android:layout_height="50.0dip" android:src="@drawable/ic_notifications" android:scaleType="center" android:contentDescription="@string/accessibility_notifications_button" />
</FrameLayout>
</LinearLayout>
- SystemUI.apk/res/values/strings.xml
add the red line to end of it before </resources>
Code:
<string name="status_bar_help_title">Notifications appear here</string>
<string name="status_bar_help_text">"Access them anytime by swiping down.
Swipe down again for system controls."</string>
[COLOR="Red"]<string name="permdesc_screenshot">Capture screenshot</string>
<string name="permlab_screenshot">Allows the app to cature a screenshot. This is protected by SystemUI.</string>
<string name="screenshot_toast">Screenshot in %1$d seconds</string>[/COLOR]
</resources>
- SystemUI.apk/res/values/ids.xml
add the red line to end of it before </resources>
Code:
<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="asteroid_screenshot_button">false</item>[/COLOR]
</resources>
- Recompile your SystemUI.apk
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 mAnimY:F
.field mAnimating:Z
.field mAnimatingReveal:Z
[COLOR="Red"].field mAsteroidScreenshotButton:Landroid/widget/ImageButton;[/COLOR]
.field mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
.field mBluetoothController:Lcom/android/systemui/statusbar/policy/BluetoothController;
Code:
.field mFlipSettingsViewAnim:Landroid/animation/Animator;
.field mFocusChangeListener:Landroid/view/View$OnFocusChangeListener;
.field private final mGestureRec:Lcom/android/systemui/statusbar/GestureRecorder;
[COLOR="Red"].field public mHandler:Landroid/os/Handler;[/COLOR]
.field private mHasDockBattery:Z
.field mHasFlipSettings:Z
Code:
.field mQS:Lcom/android/systemui/statusbar/phone/QuickSettingsController;
.field mQueueLock:Ljava/lang/Object;
.field private final mRecentsClickListener:Landroid/view/View$OnClickListener;
.field private mRecreating:Z
[COLOR="Red"].field private mRunnable:Ljava/lang/Runnable;[/COLOR]
.field private mScreenWidth:F
.field mScrollView:Landroid/widget/ScrollView;
.field mScrollViewAnim:Landroid/animation/Animator;
- NEXT, Search this method
Code:
.method public constructor <init>()V
and add the red code
Code:
iput v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDisabled:I
iput v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSystemUiVisibility:I
[COLOR="Red"]new-instance v0, Landroid/os/Handler;
invoke-direct {v0}, Landroid/os/Handler;-><init>()V
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHandler:Landroid/os/Handler;[/COLOR]
new-instance v0, Landroid/util/DisplayMetrics;
invoke-direct {v0}, Landroid/util/DisplayMetrics;-><init>()V
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDisplayMetrics:Landroid/util/DisplayMetrics;
iput-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mGestureRec:Lcom/android/systemui/statusbar/GestureRecorder;
iput v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNavigationIconHints:I
- NEXT, still in the same method,
add the red code above return-void
Code:
new-instance v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$32;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$32;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStartTracing:Ljava/lang/Runnable;
new-instance v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$33;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$33;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStopTracing:Ljava/lang/Runnable;
[COLOR="Red"]new-instance v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$AsteroidSrcreenshot5;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$AsteroidSrcreenshot5;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mRunnable:Ljava/lang/Runnable;[/COLOR]
[COLOR="Blue"]return-void[/COLOR]
.end method
.method static synthetic access$000(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;I)V
.locals 0
.parameter "x0"
.parameter "x1"
.prologue
.line 116
invoke-direct {p0, p1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->adjustBrightness(I)V
return-void
.end method
- NEXT, add new access
Code:
return-void
.end method
[COLOR="Red"].method static synthetic access$130000000(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Ljava/lang/Runnable;
.locals 1
.parameter "x0"
.prologue
.line 34
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mRunnable:Ljava/lang/Runnable;
return-object v0
.end method[/COLOR]
.method static synthetic access$000(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;I)V
NEXT
Code:
iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mLightsOnAnimation:Landroid/animation/Animator;
goto :goto_0
.end method
[COLOR="Red"].method private setupAsteroidScreenshotButton()V
.locals 3
.prologue
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v1, [COLOR="Blue"]0x7f0900e5[/COLOR]
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/ImageButton;
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAsteroidScreenshotButton:Landroid/widget/ImageButton;
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAsteroidScreenshotButton:Landroid/widget/ImageButton;
new-instance v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$AsteroidSrcreenshot3;
invoke-direct {v1, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$AsteroidSrcreenshot3;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
invoke-virtual {v0, v1}, Landroid/widget/ImageButton;->setOnClickListener(Landroid/view/View$OnClickListener;)V
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAsteroidScreenshotButton:Landroid/widget/ImageButton;
new-instance v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$AsteroidSrcreenshot4;
invoke-direct {v1, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$AsteroidSrcreenshot4;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
invoke-virtual {v0, v1}, Landroid/widget/ImageButton;->setOnLongClickListener(Landroid/view/View$OnLongClickListener;)V
return-void
.end method[/COLOR]
.method private updateShowSearchHoldoff()V
.locals 2
.prologue
.line 1133
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
const v1, 0x7f0d0001
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getInteger(I)I
move-result v0
iput v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mShowSearchHoldoff:I
.line 1135
return-void
.end method
Change this 0x7f0900e5, according to the value you got in your own public.xml
Code:
<public type="id" name="asteroid_screenshot_button" id="[COLOR="Blue"]0x7f??????[/COLOR]" />
Click to expand...
Click to collapse
NEXT, find this method
Code:
.method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
and add the red code
Code:
const-string v1, "android.intent.action.SCREEN_ON"
invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 775
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBroadcastReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {v4, v1, v0}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
.line 778
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->resetUserSetupObserver()V
[COLOR="Red"] invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setupAsteroidScreenshotButton()V[/COLOR]
.line 780
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/android/systemui/statusbar/powerwidget/PowerWidget;
invoke-virtual {v0}, Lcom/android/systemui/statusbar/powerwidget/PowerWidget;->setupWidget()V
.line 781
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/android/systemui/statusbar/powerwidget/PowerWidget;
invoke-virtual {v0}, Lcom/android/systemui/statusbar/powerwidget/PowerWidget;->updateVisibility()V
.method public static viewInfo(Landroid/view/View;)Ljava/lang/String;
.locals 2
.parameter
OR MEDIATEK DEVICES
Code:
const-string v1, "android.intent.action.ACTION_BOOT_IPO"
invoke-virtual {v12, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 768
const-string v1, "android.provider.Telephony.SPN_STRINGS_UPDATED"
invoke-virtual {v12, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 769
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;->setupAsteroidScreenshotButton()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"
NEXT,
go to,.
- smali/com/android/systemui/statusbar/phone/PhoneStatusBar$AsteroidSrcreenshot4.smali
search for this
Code:
const v4, [COLOR="Blue"]0x7f0a00f8[/COLOR]
Change this 0x7f0a00f8, according to the value you got in your own public.xml
Code:
<public type="string" name="screenshot_toast" id="[COLOR="Blue"]0x7f??????[/COLOR]" />
- NEXT
- Disable signature check
here : http://forum.xda-developers.com/showthread.php?t=1698352
or in here : http://forum.xda-developers.com/showpost.php?p=47592101&postcount=3
- AndroidManifest.xml
Add The RED CODE , and
REMOVE the BLUE CODE
Code:
<uses-permission android:name="android.permission.READ_DREAM_STATE" />
<uses-permission android:name="android.permission.WRITE_DREAM_STATE" />
<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" />
[COLOR="Red"]<protected-broadcast android:name="android.permission.SCREENSHOT" />
<protected-broadcast android:name="android.intent.action.SCREENSHOT" />
<permission android:label="@string/permlab_screenshot" android:name="android.permission.SCREENSHOT" android:protectionLevel="signatureOrSystem" android:description="@string/permdesc_screenshot" />[/COLOR]
<application android:label="@string/app_label" android:icon="@*android:drawable/platlogo" android:allowClearUserData="false" android:persistent="true" android:allowBackup="false" android:hardwareAccelerated="true">
<service android:name="SystemUIService" android:exported="true" />
[COLOR="Red"]<service android:name=".screenshot.TakeScreenshotService" android:permission="android.permission.SCREENSHOT" android:exported="false" android:process=":screenshot">
<intent-filter>
<android name="android.intent.action.SCREENSHOT" />
</intent-filter>
</service>[/COLOR]
[COLOR="Blue"]<service android:name=".screenshot.TakeScreenshotService" android:exported="false" android:process=":screenshot" />[/COLOR]
<service android:name=".LoadAverageService" android:exported="true" />
<service android:name=".ImageWallpaper" android:permission="android.permission.BIND_WALLPAPER" android:exported="true" />
<receiver android:name=".BootReceiver" androidprv:primaryUserOnly="true">
- RECOMPILE YOUR SYSTEMUI.APK and 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
STEP - 3
- Decompile / Baksmali your android.policy.jar
- Download attached PhoneWindowManager$AsteroidScreenshotReceiver.zip, exstract it and merge to your decompiled android.policy.jar
- NEXT,
go to com/android/internal/policy/impl/PhoneWindowManager.smali
add the red line
Code:
[COLOR="Red"]Lcom/android/internal/policy/impl/PhoneWindowManager$AsteroidScreenshotReceiver;,[/COLOR]
Lcom/android/internal/policy/impl/PhoneWindowManager$ScreenLockTimeout;,
Lcom/android/internal/policy/impl/PhoneWindowManager$HideNavInputEventReceiver;,
Lcom/android/internal/policy/impl/PhoneWindowManager$MyOrientationListener;,
Lcom/android/internal/policy/impl/PhoneWindowManager$SettingsObserver;,
Lcom/android/internal/policy/impl/PhoneWindowManager$PolicyHandler;,
Lcom/android/internal/policy/impl/PhoneWindowManager$PointerLocationInputEventReceiver;
Code:
.field mAppLaunchTimeEnabled:Z
.field mAssistKeyLongPressed:Z
[COLOR="Red"].field private mAsteroidScreenshotReceiver:Lcom/android/internal/policy/impl/PhoneWindowManager$AsteroidScreenshotReceiver;[/COLOR]
.field mBootMsgDialog:Landroid/app/ProgressDialog;
.field mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;
Code:
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenLockTimeout:Lcom/android/internal/policy/impl/PhoneWindowManager$ScreenLockTimeout;
return-void
.end method
[COLOR="Red"].method static synthetic access$50000000(Lcom/android/internal/policy/impl/PhoneWindowManager;)Lcom/android/internal/policy/impl/PhoneWindowManager$AsteroidScreenshotReceiver;
.registers 2
.parameter "x0"
.prologue
.line 136
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mAsteroidScreenshotReceiver:Lcom/android/internal/policy/impl/PhoneWindowManager$AsteroidScreenshotReceiver;
return-object v0
.end method
.method static synthetic access$333330000000(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
.registers 1
.parameter "x0"
.prologue
.line 184
invoke-direct {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->takeScreenshot()V
return-void
.end method[/COLOR]
.method static synthetic access$000(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
.registers 1
.parameter "x0"
.prologue
.line 173
invoke-direct {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->enablePointerLocation()V
next find this method
Code:
.method public init(Landroid/content/Context;Landroid/view/IWindowManager;Landroid/view/WindowManagerPolicy$WindowManagerFuncs;)V
scroll down in that method , add the red code above return-void
Code:
const-string v4, "persist.applaunchtime.enable"
invoke-static {v4, v6}, Landroid/os/SystemProperties;->getInt(Ljava/lang/String;I)I
move-result v4
if-ne v5, v4, :cond_216
move v4, v5
:goto_20e
iput-boolean v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mAppLaunchTimeEnabled:Z
[COLOR="Red"]new-instance v4, Lcom/android/internal/policy/impl/PhoneWindowManager$AsteroidScreenshotReceiver;
invoke-direct {v4, p0, p1}, Lcom/android/internal/policy/impl/PhoneWindowManager$AsteroidScreenshotReceiver;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;Landroid/content/Context;)V
iput-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mAsteroidScreenshotReceiver:Lcom/android/internal/policy/impl/PhoneWindowManager$AsteroidScreenshotReceiver;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mAsteroidScreenshotReceiver:Lcom/android/internal/policy/impl/PhoneWindowManager$AsteroidScreenshotReceiver;
#calls: Lcom/android/internal/policy/impl/PhoneWindowManager$AsteroidScreenshotReceiver;->registerSelf()V
invoke-static {v4}, Lcom/android/internal/policy/impl/PhoneWindowManager$AsteroidScreenshotReceiver;->access$700(Lcom/android/internal/policy/impl/PhoneWindowManager$AsteroidScreenshotReceiver;)V
[/COLOR]
[COLOR="Blue"] return-void[/COLOR]
.line 1127
:cond_211
const/4 v4, 0x2
invoke-virtual {p0, v4}, Lcom/android/internal/policy/impl/PhoneWindowManager;->screenTurnedOff(I)V
goto :goto_205
:cond_216
move v4, v6
.line 1130
goto :goto_20e
.line 1030
.end local v0 #filter:Landroid/content/IntentFilter;
- That's it :victory:
reserved 2
reserved 3
pertamax om .... that is added to the power widget in cm10.1 if I can .. I want to add to the power widget in cm10.1 thanks explanation ...
Will try it om
thread Updated,. sorry wrong code for PhoneWindowManager.smali,.in this part :
Code:
[COLOR="Red"] new-instance v4, Lcom/android/internal/policy/impl/PhoneWindowManager$AsteroidScreenshotReceiver;
invoke-direct {v4, p0, p1}, Lcom/android/internal/policy/impl/PhoneWindowManager$AsteroidScreenshotReceiver;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;Landroid/content/Context;)V
iput-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mAsteroidScreenshotReceiver:Lcom/android/internal/policy/impl/PhoneWindowManager$AsteroidScreenshotReceiver;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mAsteroidScreenshotReceiver:Lcom/android/internal/policy/impl/PhoneWindowManager$AsteroidScreenshotReceiver;
#calls: Lcom/android/internal/policy/impl/PhoneWindowManager$AsteroidScreenshotReceiver;->registerSelf()V
invoke-static {v4}, Lcom/android/internal/policy/impl/PhoneWindowManager$AsteroidScreenshotReceiver;->access$700(Lcom/android/internal/policy/impl/PhoneWindowManager$AsteroidScreenshotReceiver;)V[/COLOR]
[COLOR="Blue"] return-void[/COLOR]
Gook work sir @Adi Aisiteru Reborn
Keep it up for wonderfull guide... :good:
Need Help
Sir @Adi Aisiteru Reborn, in step 2, i see that your method ".method public constructor <init>()V" doesn't have code like ".line_318, .line_320, etc", and i have it in my smali in that method. this my smali code
Code:
.line 318
iput v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSystemUiVisibility:I
.line 320
new-instance v0, Landroid/util/DisplayMetrics;
invoke-direct {v0}, Landroid/util/DisplayMetrics;-><init>()V
so my question is, should I put code ".line" above your red code or not?
How to add in ICS Status Bar?
Pocket Fan said:
How to add in ICS Status Bar?
Click to expand...
Click to collapse
See OP title post, it's for JB 4.2++, so not for ICS device
ask OP to make it for ICS, or you can compare it to ICS, may be it work. i haven't try it
blu3m4n said:
Sir @Adi Aisiteru Reborn, in step 2, i see that your method ".method public constructor <init>()V" doesn't have code like ".line_318, .line_320, etc", and i have it in my smali in that method. this my smali code
Code:
.line 318
iput v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSystemUiVisibility:I
.line 320
new-instance v0, Landroid/util/DisplayMetrics;
invoke-direct {v0}, Landroid/util/DisplayMetrics;-><init>()V
so my question is, should I put code ".line" above your red code or not?
Click to expand...
Click to collapse
don't care about the .line xxx
Code:
.line 318
[COLOR="Blue"]iput v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSystemUiVisibility:I[/COLOR]
[COLOR="Red"]JUST ADD MY CODE HEREE ![/COLOR]
.line 320
[COLOR="Blue"]new-instance v0, Landroid/util/DisplayMetrics;
invoke-direct {v0}, Landroid/util/DisplayMetrics;-><init>()V[/COLOR]
Adi Aisiteru Reborn said:
don't care about the .line xxx
Code:
.line 318
[COLOR="Blue"]iput v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSystemUiVisibility:I[/COLOR]
[COLOR="Red"]JUST ADD MY CODE HEREE ![/COLOR]
.line 320
[COLOR="Blue"]new-instance v0, Landroid/util/DisplayMetrics;
invoke-direct {v0}, Landroid/util/DisplayMetrics;-><init>()V[/COLOR]
Click to expand...
Click to collapse
Thanks sir, i've solved the issue before
Greaat work sir, keep it up :good:
About add to ICS. Need help!!
Hi, OP @Adi Aisiteru Reborn
Yestoday I saw your six tab ui for Galaxy W CM9. So I contrast and extract some resource in this ui.
Now I have finished the transplantation of the screenshot button.
But when I press screenshot button, the device will be force reboot...
I think may be the step of android.policy.jar was wrong.
So can you help me to solve it?
This is my PhoneWindowManager.smali, hope you can help me to change it something.
I really appreciate your help.
https://www.dropbox.com/s/eyikfib2r3npww7/PhoneWindowManager.smali
so how to fix it?
yesssssss...
now i can take ss without use my vol(-)+power again...:laugh:
Lollipop work?
another feedback suhu, thanx a lot
Who cant help me? There is an error with it. Shw-m440s (s3-3g) android 4.3, please
In this guide , I will tell "How to add Clock" option in Settings.
Will work only on 4.4
REQUIREMENTS :
1. Brain
2. Apktool (2.0.0)
3. Notepad ++
4. Knowledge on How to Decompile/Recompile the apk
Lets start ,
NOTE : Those are not having the "colorpicker" folder in Settings/smali/net/margaritov/preference and having any other colorpicker in different location then open the "status_bar_clock_style" and edit this line by changing the path of colorpicker in this line.
PHP:
<net.margaritov.preference.colorpicker.ColorPickerPreference android:title="@string/battery_bar_color" android:key="battery_bar_color" android:defaultValue="\#ffffff" alphaSlider="true" />
Those who are not having any color picker , first add that using guide whose link is given below.
http://forum.xda-developers.com/and...r-settings-t3176597/post62282065#post62282065
Settings.apk Modding
1. First Decompile your Settings.apk and merge the files (given below).
2. Now add this line in display_settings.xml or any other xml present in Settings.apk/res/xml.
PHP:
<PreferenceScreen android:title="@string/statusbar_clock" android:key="statusbar_clock" android:summary="@string/statusbar_clock_summary" android:fragment="com.android.settings.gurpreet.statusbarclock.StatusBarClockStyle" />
3. Now open strings.xml and add these lines above </resources>.
PHP:
<string name="statusbar_clock">Clock and Date</string>
<string name="statusbar_clock_summary">Change the clock and date style</string>
<string name="clock_title_enable">Alignment</string>
<string name="clock_enabled">Enabled</string>
<string name="clock_disabled">Disabled</string>
<string name="clock_color_title">Color</string>
<string name="status_bar_clock_style_reset">Reset color</string>
<string name="status_bar_show_clock_title">Show clock and date</string>
<string name="status_bar_am_pm_title">AM/PM</string>
<string name="status_bar_am_pm_info">24-hour clock is enabled</string>
<string name="enable_clock_weekday">Day of the week</string>
<string name="enable_clock_weekday_summary">Abbreviated day of the week before the time</string>
<string name="right_clock">Right clock</string>
<string name="center_clock">Center clock</string>
<string name="left_clock">Left clock</string>
<string name="dont_show">"Don't show"</string>
<string name="clock_date_display">Date</string>
<string name="clock_date_display_summary">Display custom date before the clock</string>
<string name="clock_date_style">Date style</string>
<string name="clock_date_format">Date format</string>
<string name="clock_date_string_edittext_title">Must be in DateFormat eg. MM/dd/yy</string>
<string name="clock_date_string_edittext_summary">Enter string</string>
<string name="am_pm_clock_normal">Normal font size</string>
<string name="am_pm_clock_small">Small font size</string>
<string name="am_pm_clock_none">"Don't show"</string>
<string name="clock_date_display_none">"Don't show"</string>
<string name="clock_date_display_small">Small font size</string>
<string name="clock_date_display_normal">Normal font size</string>
<string name="clock_date_style_normal">Normal</string>
<string name="clock_date_style_lowercase">Lowercase</string>
<string name="clock_date_style_uppercase">Uppercase</string>
<string name="clock_date_format_custom">Custom java format</string>
<string name="status_bar_clock_style_reset_message">Reset clock color?</string>
<string name="clock_font_style_title">Font styles</string>
<string name="clock_font_bold">Bold</string>
<string name="clock_font_condensed">Condensed</string>
<string name="clock_font_light">Light</string>
<string name="clock_font_light_italic">Light italic</string>
<string name="clock_font_normal">Normal</string>
<string name="color_default">Default</string>
<string name="clock_use_second">Enable Seconds</string>
<string name="clock_use_second_summary">Shows the seconds next to the clock</string>
4. Now open array.xml and add these lines above </resources>.
PHP:
<string-array name="clock_style_entries">
<item>@string/right_clock</item>
<item>@string/center_clock</item>
<item>@string/left_clock</item>
</string-array>
<string-array name="clock_style_values">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
<string-array name="entries_status_bar_am_pm">
<item>@string/am_pm_clock_none</item>
<item>@string/am_pm_clock_small</item>
<item>@string/am_pm_clock_normal</item>
</string-array>
<string-array name="values_status_bar_am_pm">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
<string-array name="clock_date_display_entries">
<item>@string/clock_date_display_none</item>
<item>@string/clock_date_display_small</item>
<item>@string/clock_date_display_normal</item>
</string-array>
<string-array name="clock_date_display_values">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
<string-array name="clock_date_style_entries">
<item>@string/clock_date_style_normal</item>
<item>@string/clock_date_style_lowercase</item>
<item>@string/clock_date_style_uppercase</item>
</string-array>
<string-array name="clock_date_style_values">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
<string-array name="clock_date_format_entries_values">
<item>dd/MM/yy</item>
<item>MM/dd/yy</item>
<item>yyyy-MM-dd</item>
<item>yyyy-dd-MM</item>
<item>dd-MM-yyyy</item>
<item>MM-dd-yyyy</item>
<item>MMM dd</item>
<item>MMM dd, yyyy</item>
<item>MMMM dd, yyyy</item>
<item>EEE</item>
<item>EEE dd</item>
<item>EEE dd/MM</item>
<item>EEE MM/dd</item>
<item>EEE dd MMM</item>
<item>EEE MMM dd</item>
<item>EEE MMMM dd</item>
<item>EEEE dd/MM</item>
<item>EEEE MM/dd</item>
<item>@string/clock_date_format_custom</item>
</string-array>
<string-array name="clock_font_style_entries">
<item>@string/clock_font_bold</item>
<item>@string/clock_font_condensed</item>
<item>@string/clock_font_light</item>
<item>@string/clock_font_light_italic</item>
<item>@string/clock_font_normal</item>
</string-array>
<string-array name="clock_font_style_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
</string-array>
5. Now Recompile your Settings.apk , Sign it and again Decompile it.
6. Now open StatusBarClockStyle.smali and replace the ids with the ids present in public.xml of your Settings.apk
0x7f050077
PHP:
<public type="xml" name="status_bar_clock_style"
0x7f0200cd
PHP:
<public type="drawable" name="ic_settings_clock"
0x7f0800a4
PHP:
<public type="string" name="color_default"
0x7f0800cd
PHP:
<public type="string" name="status_bar_am_pm_info"
0x7f0a0078
PHP:
<public type="array" name="clock_date_format_entries_values"
0x7f08007c
PHP:
<public type="string" name="reset"
Do this with other same id.
0x7f0800e3
PHP:
<public type="string" name="status_bar_clock_style_reset_message"
0x7f08007b
PHP:
<public type="string" name="ok"
0x7f08066e
PHP:
<public type="string" name="cancel"
0x7f0200c4
PHP:
<public type="drawable" name="ic_settings_backup"
0x7f0800d7
PHP:
<public type="string" name="clock_date_string_edittext_title"
0x7f0800d8
PHP:
<public type="string" name="clock_date_string_edittext_summary"
0x7f080bcb
PHP:
<public type="string" name="menu_save"
0x7f080bcc
PHP:
<public type="string" name="menu_cancel"
SystemUI.apk Modding
1. First Decompile your SystemUI.apk and merge the files inside it (given below).
2. Now go to SystemUI.apk\res\layout\gemini_status_bar.xml and open it.
Add these lines in the xml. Compare with the "gemini_status_bar.xml" given in the guide.
PHP:
<com.android.systemui.statusbar.policy.ClockLeft android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="left|center" android:id="@id/left_clock" android:paddingLeft="6.0dip" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
PHP:
<com.android.systemui.statusbar.policy.ClockCenter android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:id="@id/center_clock" android:paddingLeft="6.0dip" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
PHP:
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/center_clock_layout" android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.ClockCenter android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:id="@id/center_clock" android:paddingLeft="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
</LinearLayout>
NOTE: To solve the issue of overlapping of other things with clock in statusbar , follow this.
• Find this line ,
PHP:
<LinearLayout android:orientation="horizontal" android:id="@id/notification_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
• Replace with this line ,
PHP:
<LinearLayout android:gravity="left" android:orientation="horizontal" android:id="@id/notification_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
• Now again find this line ,
PHP:
<LinearLayout android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="wrap_content" android:layout_height="fill_parent">
• Replace with this line ,
PHP:
<LinearLayout android:gravity="right" android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
3. Now go to SystemUI.apk\res\values\ids.xml and open it. Now add these above </resources>.
PHP:
<item type="id" name="left_clock">false</item>
<item type="id" name="clock_stock">false</item>
<item type="id" name="center_clock_layout">false</item>
<item type="id" name="center_clock">false</item>
4. Now go to SystemUI.apk\res\values\colors.xml and open it. Now add this above </resources>.
PHP:
<color name="status_bar_clock_color">#ffffffff</color>
5. Now Recompile your SystemUI.apk , Sign it and then again Decompile it.
6. Now go to SystemUI.apk\smali\com\android\systemui\statusbar\phone\PhoneStatusBar.smali
• Add this line ,
HTML:
.field mCenterClockLayout:Landroid/widget/LinearLayout;
Like this ,
HTML:
.field private mCarrierLabelVisible:Z
.field mCenterClockLayout:Landroid/widget/LinearLayout;
.field private final mCheckBarModes:Ljava/lang/Runnable;
• Now again , Add this line
HTML:
.field private mShowClock:Z
Like this ,
HTML:
.field private mShowCarrierInPanel:Z
.field private mShowClock:Z
.field private mShowSearchHoldoff:I
7. Now find this method ,
HTML:
.method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
• Now find these lines in this method ,
HTML:
iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f070052
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarContents:Landroid/widget/LinearLayout;
move-object/from16 v0, p0
• Now copy these lines and paste it below the lines that you have copied , like this
HTML:
iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f070052
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarContents:Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f070052
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarContents:Landroid/widget/LinearLayout;
move-object/from16 v0, p0
• Now replace the second last line of pasted lines with this ,
HTML:
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCenterClockLayout:Landroid/widget/LinearLayout;
• The final will look like this ,
HTML:
iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f070052
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarContents:Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f0?????
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCenterClockLayout:Landroid/widget/LinearLayout;
move-object/from16 v0, p0
8. Now replace this id in "PhoneStatusBar.smali" with the id present in public.xml of your SystemUI.apk
0x7f0?????
PHP:
<public type="id" name="center_clock_layout"
9. Now find this method ,
HTML:
.method public showClock(Z)V
• Now delete whole lines between these ,
HTML:
.method public showClock(Z)V
-
-
-
.end method
• Now copy these lines between these ,
HTML:
.locals 10
.prologue
const/4 v9, -0x2
const/4 v1, 0x1
const/4 v2, 0x0
const/16 v4, 0x8
.line 3874
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
if-nez v0, :cond_1
.line 3894
:cond_0
:goto_0
return-void
.line 3875
:cond_1
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
.line 3876
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v5, 0x7f07005d
invoke-virtual {v0, v5}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v5
.line 3877
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v6, 0x7f0700db
invoke-virtual {v0, v6}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v6
.line 3878
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v7, 0x7f0700d8
invoke-virtual {v0, v7}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v7
.line 3879
const-string v0, "status_bar_clock"
invoke-static {v3, v0, v1, v9}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v0
if-ne v0, v1, :cond_5
move v0, v1
.line 3882
:goto_1
const-string v8, "statusbar_clock_style"
invoke-static {v3, v8, v2, v9}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v8
.line 3885
if-nez v8, :cond_2
if-eqz v5, :cond_2
.line 3886
if-eqz p1, :cond_7
if-eqz v0, :cond_6
move v3, v2
:goto_2
invoke-virtual {v5, v3}, Landroid/view/View;->setVisibility(I)V
.line 3888
:cond_2
if-ne v8, v1, :cond_3
if-eqz v6, :cond_3
.line 3889
if-eqz p1, :cond_9
if-eqz v0, :cond_8
move v1, v2
:goto_3
invoke-virtual {v6, v1}, Landroid/view/View;->setVisibility(I)V
.line 3891
:cond_3
const/4 v1, 0x2
if-ne v8, v1, :cond_0
if-eqz v7, :cond_0
.line 3892
if-eqz p1, :cond_4
if-eqz v0, :cond_4
move v4, v2
:cond_4
invoke-virtual {v7, v4}, Landroid/view/View;->setVisibility(I)V
goto :goto_0
:cond_5
move v0, v2
.line 3879
goto :goto_1
:cond_6
move v3, v4
.line 3886
goto :goto_2
:cond_7
move v3, v4
goto :goto_2
:cond_8
move v1, v4
.line 3889
goto :goto_3
:cond_9
move v1, v4
goto :goto_3
10. Now replace these ids in the above method with the ids present in public.xml of your SystemUI.apk
0x7f07005d
PHP:
<public type="id" name="clock"
0x7f0700db
PHP:
<public type="id" name="center_clock"
0x7f0700d8
PHP:
<public type="id" name="left_clock"
11. Now go to SystemUI.apk\smali\com\android\systemui\statusbar\policy\Clock.smali and open it. Now replace the id with the id present in public.xml of your SystemUI.apk
0x7f080009
PHP:
<public type="color" name="status_bar_clock_color"
12. Done , now Recompile your SystemUI.apk and Sign it.
Important Information :
• In step no. 7 , if in these lines
HTML:
iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f070052
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarContents:Landroid/widget/LinearLayout;
.line 523 <--------- Like This ----------->
move-object/from16 v0, p0
• The line above line "move-object/from16 v0, p0" is having line like this (may be any no.) , then after the copying and replacing (as mentioned in step 7) , it will look like this.
HTML:
iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f070052
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarContents:Landroid/widget/LinearLayout;
.line 523 <--------- 1 ----------->
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f0????? (<public type="id" name="center_clock_layout")
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCenterClockLayout:Landroid/widget/LinearLayout;
.line 523 <--------- 2 ----------->
move-object/from16 v0, p0
• Then in 2nd case , change the line number by adding 1. In this case add 1 to 523 and it will become 524. (If line 524 is already there in smali , then add 2 means 523+2 and so on). the final will look like this ,
HTML:
iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f070052
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarContents:Landroid/widget/LinearLayout;
.line 523 <--------- 1 ----------->
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f0????? (<public type="id" name="center_clock_layout")
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCenterClockLayout:Landroid/widget/LinearLayout;
.line 524 <--------- 2 (Changed here)----------->
move-object/from16 v0, p0
• Now follow the above remaining steps given in guide.
Special Thanks To :
1. DU_Flo ROM (Extracted from this ROM)
2. Vanya Melnechenko
3. MAAaD
4. XDA
5. Raj Shekhar (For testing the guide & screenshots)
Screenshots
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Great!thumbs up Guru
Amazing!! as always @05Gurpreet bro!!
great guides, thanx brother!
Amazing guide..
Nice! I don't need this personally since it's a defacto feature in every custom rom these days, but it's cool to see a well done guide for adding this into roms that don't have it!
remember your cm12 systemUI tweaks?
would you be able to port that to cm12.1???
Atrvscet said:
Great!thumbs up Guru
Click to expand...
Click to collapse
Thanks sir. Its all because of your support.
Thanks all for your support.
i get settings FC when i tried to open clock and date style option
Code:
I/dalvikvm( 1950): Could not find method com.android.settings.gurpreet.statusbarclock.StatusBarClockStyle$1.<init>, referenced from method com.android.settings.gurpreet.statusbarclock.StatusBarClockStyle.onPreferenceChange
W/dalvikvm( 1950): VFY: unable to resolve direct method 11406: Lcom/android/settings/gurpreet/statusbarclock/StatusBarClockStyle$1;.<init> (Lcom/android/settings/gurpreet/statusbarclock/StatusBarClockStyle;Landroid/widget/EditText;)V
D/dalvikvm( 1950): VFY: replacing opcode 0x70 at 0x01a2
D/AndroidRuntime( 1950): Shutting down VM
W/dalvikvm( 1950): threadid=1: thread exiting with uncaught exception (group=0x415abc20)
E/AndroidRuntime( 1950): FATAL EXCEPTION: main
E/AndroidRuntime( 1950): Process: com.android.settings, PID: 1950
E/AndroidRuntime( 1950): android.content.res.Resources$NotFoundException: File Hacer copia de seguridad de configuración from drawable resource ID #0x7f080ae7
E/AndroidRuntime( 1950): at android.content.res.Resources.loadDrawable(Resources.java:2255)
E/AndroidRuntime( 1950): at android.content.res.Resources.getDrawable(Resources.java:733)
E/AndroidRuntime( 1950): at android.content.res.Resources.getDrawable(Resources.java:711)
E/AndroidRuntime( 1950): at com.android.internal.view.menu.MenuItemImpl.getIcon(MenuItemImpl.java:388)
E/AndroidRuntime( 1950): at com.android.internal.view.menu.ActionMenuItemView.initialize(ActionMenuItemView.java:105)
E/AndroidRuntime( 1950): at com.android.internal.view.menu.ActionMenuPresenter.bindItemView(ActionMenuPresenter.java:179)
E/AndroidRuntime( 1950): at com.android.internal.view.menu.BaseMenuPresenter.getItemView(BaseMenuPresenter.java:178)
E/AndroidRuntime( 1950): at com.android.internal.view.menu.ActionMenuPresenter.getItemView(ActionMenuPresenter.java:165)
E/AndroidRuntime( 1950): at com.android.internal.view.menu.ActionMenuPresenter.flagActionItems(ActionMenuPresenter.java:463)
E/AndroidRuntime( 1950): at com.android.internal.view.menu.MenuBuilder.flagActionItems(MenuBuilder.java:1062)
E/AndroidRuntime( 1950): at com.android.internal.view.menu.BaseMenuPresenter.updateMenuView(BaseMenuPresenter.java:87)
E/AndroidRuntime( 1950): at com.android.internal.view.menu.ActionMenuPresenter.updateMenuView(ActionMenuPresenter.java:218)
E/AndroidRuntime( 1950): at com.android.internal.view.menu.MenuBuilder.dispatchPresenterUpdate(MenuBuilder.java:244)
E/AndroidRuntime( 1950): at com.android.internal.view.menu.MenuBuilder.onItemsChanged(MenuBuilder.java:956)
E/AndroidRuntime( 1950): at com.android.internal.view.menu.MenuBuilder.startDispatchingItemsChanged(MenuBuilder.java:979)
E/AndroidRuntime( 1950): at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:532)
E/AndroidRuntime( 1950): at com.android.internal.policy.impl.PhoneWindow.doInvalidatePanelMenu(PhoneWindow.java:853)
E/AndroidRuntime( 1950): at com.android.internal.policy.impl.PhoneWindow$1.run(PhoneWindow.java:273)
E/AndroidRuntime( 1950): at android.os.Handler.handleCallback(Handler.java:733)
E/AndroidRuntime( 1950): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime( 1950): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 1950): at android.app.ActivityThread.main(ActivityThread.java:5179)
E/AndroidRuntime( 1950): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1950): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 1950): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
E/AndroidRuntime( 1950): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
E/AndroidRuntime( 1950): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 1950): Caused by: java.io.FileNotFoundException: Hacer copia de seguridad de configuración
E/AndroidRuntime( 1950): at android.content.res.AssetManager.openNonAssetNative(Native Method)
E/AndroidRuntime( 1950): at android.content.res.AssetManager.openNonAsset(AssetManager.java:427)
E/AndroidRuntime( 1950): at android.content.res.Resources.loadDrawable(Resources.java:2246)
E/AndroidRuntime( 1950): ... 26 more
W/ActivityManager( 728): Force finishing activity com.android.settings/.SubSettings
W/ActivityManager( 728): Force finishing activity com.android.settings/.SubSettings
W/ActivityManager( 728): Activity pause timeout for ActivityRecord{41db0dd8 u0 com.android.settings/.SubSettings t3 f}
I/AudioHardwareMSM72XX( 371): disabling post proc features with mask 0x0000
Amazzzzziiiiinnnnnngggggg.....
05Gurpreet said:
In this guide , I will tell "How to add Clock" option in Settings.
Will work only on 4.4
REQUIREMENTS :
1. Brain
2. Apktool (2.0.0)
3. Notepad ++
4. Knowledge on How to Decompile/Recompile the apk
Lets start ,
NOTE : Those are not having the "colorpicker" folder in Settings/smali/net/margaritov/preference and having any other colorpicker in different location then open the "status_bar_clock_style" and edit this line by changing the path of colorpicker in this line.
PHP:
<net.margaritov.preference.colorpicker.ColorPickerPreference android:title="@string/battery_bar_color" android:key="battery_bar_color" android:defaultValue="\#ffffff" alphaSlider="true" />
Those who are not having any color picker , first add that using guide whose link is given below.
http://forum.xda-developers.com/and...r-settings-t3176597/post62282065#post62282065
Settings.apk Modding
1. First Decompile your Settings.apk and merge the files (given below).
2. Now add this line in display_settings.xml or any other xml present in Settings.apk/res/xml.
PHP:
<PreferenceScreen android:title="@string/statusbar_clock" android:key="statusbar_clock" android:summary="@string/statusbar_clock_summary" android:fragment="com.android.settings.gurpreet.statusbarclock.StatusBarClockStyle" />
3. Now open strings.xml and add these lines above </resources>.
PHP:
<string name="statusbar_clock">Clock and Date</string>
<string name="statusbar_clock_summary">Change the clock and date style</string>
<string name="clock_title_enable">Alignment</string>
<string name="clock_enabled">Enabled</string>
<string name="clock_disabled">Disabled</string>
<string name="clock_color_title">Color</string>
<string name="status_bar_clock_style_reset">Reset color</string>
<string name="status_bar_show_clock_title">Show clock and date</string>
<string name="status_bar_am_pm_title">AM/PM</string>
<string name="status_bar_am_pm_info">24-hour clock is enabled</string>
<string name="enable_clock_weekday">Day of the week</string>
<string name="enable_clock_weekday_summary">Abbreviated day of the week before the time</string>
<string name="right_clock">Right clock</string>
<string name="center_clock">Center clock</string>
<string name="left_clock">Left clock</string>
<string name="dont_show">"Don't show"</string>
<string name="clock_date_display">Date</string>
<string name="clock_date_display_summary">Display custom date before the clock</string>
<string name="clock_date_style">Date style</string>
<string name="clock_date_format">Date format</string>
<string name="clock_date_string_edittext_title">Must be in DateFormat eg. MM/dd/yy</string>
<string name="clock_date_string_edittext_summary">Enter string</string>
<string name="am_pm_clock_normal">Normal font size</string>
<string name="am_pm_clock_small">Small font size</string>
<string name="am_pm_clock_none">"Don't show"</string>
<string name="clock_date_display_none">"Don't show"</string>
<string name="clock_date_display_small">Small font size</string>
<string name="clock_date_display_normal">Normal font size</string>
<string name="clock_date_style_normal">Normal</string>
<string name="clock_date_style_lowercase">Lowercase</string>
<string name="clock_date_style_uppercase">Uppercase</string>
<string name="clock_date_format_custom">Custom java format</string>
<string name="status_bar_clock_style_reset_message">Reset clock color?</string>
<string name="clock_font_style_title">Font styles</string>
<string name="clock_font_bold">Bold</string>
<string name="clock_font_condensed">Condensed</string>
<string name="clock_font_light">Light</string>
<string name="clock_font_light_italic">Light italic</string>
<string name="clock_font_normal">Normal</string>
<string name="color_default">Default</string>
<string name="clock_use_second">Enable Seconds</string>
<string name="clock_use_second_summary">Shows the seconds next to the clock</string>
4. Now open array.xml and add these lines above </resources>.
PHP:
<string-array name="clock_style_entries">
<item>@string/right_clock</item>
<item>@string/center_clock</item>
<item>@string/left_clock</item>
</string-array>
<string-array name="clock_style_values">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
<string-array name="entries_status_bar_am_pm">
<item>@string/am_pm_clock_none</item>
<item>@string/am_pm_clock_small</item>
<item>@string/am_pm_clock_normal</item>
</string-array>
<string-array name="values_status_bar_am_pm">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
<string-array name="clock_date_display_entries">
<item>@string/clock_date_display_none</item>
<item>@string/clock_date_display_small</item>
<item>@string/clock_date_display_normal</item>
</string-array>
<string-array name="clock_date_display_values">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
<string-array name="clock_date_style_entries">
<item>@string/clock_date_style_normal</item>
<item>@string/clock_date_style_lowercase</item>
<item>@string/clock_date_style_uppercase</item>
</string-array>
<string-array name="clock_date_style_values">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
<string-array name="clock_date_format_entries_values">
<item>dd/MM/yy</item>
<item>MM/dd/yy</item>
<item>yyyy-MM-dd</item>
<item>yyyy-dd-MM</item>
<item>dd-MM-yyyy</item>
<item>MM-dd-yyyy</item>
<item>MMM dd</item>
<item>MMM dd, yyyy</item>
<item>MMMM dd, yyyy</item>
<item>EEE</item>
<item>EEE dd</item>
<item>EEE dd/MM</item>
<item>EEE MM/dd</item>
<item>EEE dd MMM</item>
<item>EEE MMM dd</item>
<item>EEE MMMM dd</item>
<item>EEEE dd/MM</item>
<item>EEEE MM/dd</item>
<item>@string/clock_date_format_custom</item>
</string-array>
<string-array name="clock_font_style_entries">
<item>@string/clock_font_bold</item>
<item>@string/clock_font_condensed</item>
<item>@string/clock_font_light</item>
<item>@string/clock_font_light_italic</item>
<item>@string/clock_font_normal</item>
</string-array>
<string-array name="clock_font_style_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
</string-array>
5. Now Recompile your Settings.apk , Sign it and again Decompile it.
6. Now open StatusBarClockStyle.smali and replace the ids with the ids present in public.xml of your Settings.apk
0x7f050077
PHP:
<public type="xml" name="status_bar_clock_style"
0x7f0200cd
PHP:
<public type="drawable" name="ic_settings_clock"
0x7f0800a4
PHP:
<public type="string" name="color_default"
0x7f0800cd
PHP:
<public type="string" name="status_bar_am_pm_info"
0x7f0a0078
PHP:
<public type="array" name="clock_date_format_entries_values"
0x7f08007c
PHP:
<public type="string" name="reset"
Do this with other same id.
0x7f0800e3
PHP:
<public type="string" name="status_bar_clock_style_reset_message"
0x7f08007b
PHP:
<public type="string" name="ok"
0x7f08066e
PHP:
<public type="string" name="cancel"
0x7f0200c4
PHP:
<public type="drawable" name="ic_settings_backup"
0x7f0800d7
PHP:
<public type="string" name="clock_date_string_edittext_title"
0x7f0800d8
PHP:
<public type="string" name="clock_date_string_edittext_summary"
0x7f080bcb
PHP:
<public type="string" name="menu_save"
0x7f080bcc
PHP:
<public type="string" name="menu_cancel"
SystemUI.apk Modding
1. First Decompile your SystemUI.apk and merge the files inside it (given below).
2. Now go to SystemUI.apk\res\layout\gemini_status_bar.xml and open it.
Add these lines in the xml. Compare with the "gemini_status_bar.xml" given in the guide.
PHP:
<com.android.systemui.statusbar.policy.ClockLeft android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="left|center" android:id="@id/left_clock" android:paddingLeft="6.0dip" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
PHP:
<com.android.systemui.statusbar.policy.ClockCenter android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:id="@id/center_clock" android:paddingLeft="6.0dip" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
PHP:
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/center_clock_layout" android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.ClockCenter android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:id="@id/center_clock" android:paddingLeft="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
</LinearLayout>
NOTE: To solve the issue of overlapping of other things with clock in statusbar , follow this.
• Find this line ,
PHP:
<LinearLayout android:orientation="horizontal" android:id="@id/notification_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
• Replace with this line ,
PHP:
<LinearLayout android:gravity="left" android:orientation="horizontal" android:id="@id/notification_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
• Now again find this line ,
PHP:
<LinearLayout android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="wrap_content" android:layout_height="fill_parent">
• Replace with this line ,
PHP:
<LinearLayout android:gravity="right" android:orientation="horizontal" android:id="@id/system_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
3. Now go to SystemUI.apk\res\values\ids.xml and open it. Now add these above </resources>.
PHP:
<item type="id" name="left_clock">false</item>
<item type="id" name="clock_stock">false</item>
<item type="id" name="center_clock_layout">false</item>
<item type="id" name="center_clock">false</item>
4. Now go to SystemUI.apk\res\values\colors.xml and open it. Now add this above </resources>.
PHP:
<color name="status_bar_clock_color">#ffffffff</color>
5. Now Recompile your SystemUI.apk , Sign it and then again Decompile it.
6. Now go to SystemUI.apk\smali\com\android\systemui\statusbar\phone\PhoneStatusBar.smali
• Add this line ,
HTML:
.field mCenterClockLayout:Landroid/widget/LinearLayout;
Like this ,
HTML:
.field private mCarrierLabelVisible:Z
.field mCenterClockLayout:Landroid/widget/LinearLayout;
.field private final mCheckBarModes:Ljava/lang/Runnable;
• Now again , Add this line
HTML:
.field private mShowClock:Z
Like this ,
HTML:
.field private mShowCarrierInPanel:Z
.field private mShowClock:Z
.field private mShowSearchHoldoff:I
7. Now find this method ,
HTML:
.method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
• Now find these lines in this method ,
HTML:
iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f070052
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarContents:Landroid/widget/LinearLayout;
move-object/from16 v0, p0
• Now copy these lines and paste it below the lines that you have copied , like this
HTML:
iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f070052
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarContents:Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f070052
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarContents:Landroid/widget/LinearLayout;
move-object/from16 v0, p0
• Now replace the second last line of pasted lines with this ,
HTML:
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCenterClockLayout:Landroid/widget/LinearLayout;
• The final will look like this ,
HTML:
iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f070052
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarContents:Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f0?????
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCenterClockLayout:Landroid/widget/LinearLayout;
move-object/from16 v0, p0
8. Now replace this id in "PhoneStatusBar.smali" with the id present in public.xml of your SystemUI.apk
0x7f0?????
PHP:
<public type="id" name="center_clock_layout"
9. Now find this method ,
HTML:
.method public showClock(Z)V
• Now delete whole lines between these ,
HTML:
.method public showClock(Z)V
-
-
-
.end method
• Now copy these lines between these ,
HTML:
.locals 10
.prologue
const/4 v9, -0x2
const/4 v1, 0x1
const/4 v2, 0x0
const/16 v4, 0x8
.line 3874
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
if-nez v0, :cond_1
.line 3894
:cond_0
:goto_0
return-void
.line 3875
:cond_1
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
.line 3876
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v5, 0x7f07005d
invoke-virtual {v0, v5}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v5
.line 3877
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v6, 0x7f0700db
invoke-virtual {v0, v6}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v6
.line 3878
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v7, 0x7f0700d8
invoke-virtual {v0, v7}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v7
.line 3879
const-string v0, "status_bar_clock"
invoke-static {v3, v0, v1, v9}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v0
if-ne v0, v1, :cond_5
move v0, v1
.line 3882
:goto_1
const-string v8, "statusbar_clock_style"
invoke-static {v3, v8, v2, v9}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v8
.line 3885
if-nez v8, :cond_2
if-eqz v5, :cond_2
.line 3886
if-eqz p1, :cond_7
if-eqz v0, :cond_6
move v3, v2
:goto_2
invoke-virtual {v5, v3}, Landroid/view/View;->setVisibility(I)V
.line 3888
:cond_2
if-ne v8, v1, :cond_3
if-eqz v6, :cond_3
.line 3889
if-eqz p1, :cond_9
if-eqz v0, :cond_8
move v1, v2
:goto_3
invoke-virtual {v6, v1}, Landroid/view/View;->setVisibility(I)V
.line 3891
:cond_3
const/4 v1, 0x2
if-ne v8, v1, :cond_0
if-eqz v7, :cond_0
.line 3892
if-eqz p1, :cond_4
if-eqz v0, :cond_4
move v4, v2
:cond_4
invoke-virtual {v7, v4}, Landroid/view/View;->setVisibility(I)V
goto :goto_0
:cond_5
move v0, v2
.line 3879
goto :goto_1
:cond_6
move v3, v4
.line 3886
goto :goto_2
:cond_7
move v3, v4
goto :goto_2
:cond_8
move v1, v4
.line 3889
goto :goto_3
:cond_9
move v1, v4
goto :goto_3
10. Now replace these ids in the above method with the ids present in public.xml of your SystemUI.apk
0x7f07005d
PHP:
<public type="id" name="clock"
0x7f0700db
PHP:
<public type="id" name="center_clock"
0x7f0700d8
PHP:
<public type="id" name="left_clock"
11. Now go to SystemUI.apk\smali\com\android\systemui\statusbar\policy\Clock.smali and open it. Now replace the id with the id present in public.xml of your SystemUI.apk
0x7f080009
PHP:
<public type="color" name="status_bar_clock_color"
12. Done , now Recompile your SystemUI.apk and Sign it.
Important Information :
• In step no. 7 , if in these lines
HTML:
iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f070052
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarContents:Landroid/widget/LinearLayout;
.line 523 <--------- Like This ----------->
move-object/from16 v0, p0
• The line above line "move-object/from16 v0, p0" is having line like this (may be any no.) , then after the copying and replacing (as mentioned in step 7) , it will look like this.
HTML:
iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f070052
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarContents:Landroid/widget/LinearLayout;
.line 523 <--------- 1 ----------->
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f0????? (<public type="id" name="center_clock_layout")
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCenterClockLayout:Landroid/widget/LinearLayout;
.line 523 <--------- 2 ----------->
move-object/from16 v0, p0
• Then in 2nd case , change the line number by adding 1. In this case add 1 to 523 and it will become 524. (If line 524 is already there in smali , then add 2 means 523+2 and so on). the final will look like this ,
HTML:
iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f070052
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarContents:Landroid/widget/LinearLayout;
.line 523 <--------- 1 ----------->
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f0????? (<public type="id" name="center_clock_layout")
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/LinearLayout;
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCenterClockLayout:Landroid/widget/LinearLayout;
.line 524 <--------- 2 (Changed here)----------->
move-object/from16 v0, p0
• Now follow the above remaining steps given in guide.
Special Thanks To :
1. DU_Flo ROM (Extracted from this ROM)
2. Vanya Melnechenko
3. MAAaD
4. XDA
5. Raj Shekhar (For testing the guide & screenshots)
Click to expand...
Click to collapse
One more amazing work @05Gurpreet bro..
Still got overlap (center clock)
This will work in lollipop? Plase anyone have the smali files for lollipop?
Enviado desde mi LG-D802 mediante Tapatalk
Thanks for the guide
Do you have/know any other for adding network traffic monitor?
renzo090513 said:
This will work in lollipop? Plase anyone have the smali files for lollipop?
Enviado desde mi LG-D802 mediante Tapatalk
Click to expand...
Click to collapse
Is working on my Galaxy J5 running lollipop 5.1.1. I have used the files from OP.
Thank you @05Gurpreet for these awesome guides.
Not working is android 4.4.2. Error
PICTURE WILL EXPLAIN ALL THIS GUIDE
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
REQUIREMENTS:
1. FRAMEWORK-RES.APK
2. ANDROID.POLICY.JAR
3. FRAMEWORK.JAR
4. DOWNLOAD ATTACHMENT FILE
STEP 1: FRAMEWORK-RES.APK
1. decompile your framework-res.apk
2. download attachment file , exstract it and merge to your decompiled folder
3. open values/ids.xml and add this line below
Code:
<item type="id" name="busy_dlg_animation">false</item>
<item type="id" name="busy_dlg_title">false</item>
4. save and recompile your framework-res.apk
5. decompile the newly recompiled framework-res.apk and go to values/public.xml. open it and leave it, but keep it open (we need this later)
STEP 2: FRAMEWORK.JAR
1. decompile your framework.jar
2. download attachment, exstract it and merge to your decompiled folder
3. open BusyDialog.smali file
4. search for this and change it with the IDS you got earlier
Code:
0x103006f -> <public type="style" name="Theme.Holo.Dialog" id="0xxxxxxxxx" />
0x10900cb -> <public type="layout" name="busy_dlg" id="0xxxxxxxxx" />
0x1020395 -> <public type="id" name="busy_dlg_title" id="0xxxxxxxxx" />
0x1020394 -> <public type="id" name="busy_dlg_animation" id="0xxxxxxxxx" />
5. save it and compile
STEP 3: ANDROID.POLICY.JAR
1. decompile your android.policy.jar
2. download attachment, exstract it and merge to your decompiled folder
3. open PhoneWindowManager.smali
4. delete the red line and replace with the blue
Code:
# instance fields
.
.
.
[COLOR="Red"].field mBootMsgDialog:Landroid/app/ProgressDialog;[/COLOR]
[COLOR="Blue"].field mBootMsgDialog:Landroid/app/BusyDialog;[/COLOR]
5. search again for mBootMsgDialog and replace
Code:
mBootMsgDialog:Landroid/app/ProgressDialog;
with
mBootMsgDialog:Landroid/app/BusyDialog;
6. find this method .method public showBootMessage(Ljava/lang/CharSequence;Z)V and replace all inside the method with
Code:
.method public showBootMessage(Ljava/lang/CharSequence;Z)V
.registers 5
.parameter "msg"
.parameter "always"
.prologue
.line 6033
iget-boolean v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHeadless:Z
if-eqz v0, :cond_5
.line 6071
:goto_4
return-void
.line 6034
:cond_5
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
new-instance v1, Lcom/android/internal/policy/impl/PhoneWindowManager$68;
invoke-direct {v1, p0, p1, p2}, Lcom/android/internal/policy/impl/PhoneWindowManager$68;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;Ljava/lang/CharSequence;Z)V
invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
goto :goto_4
.end method
7. find again .method public hideBootMessages()V and replace the method with
Code:
.method public hideBootMessages()V
.registers 3
.prologue
.line 6075
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
new-instance v1, Lcom/android/internal/policy/impl/PhoneWindowManager$69;
invoke-direct {v1, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$69;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
.line 6083
return-void
.end method
8. find the red line and add the blue code
Code:
[COLOR="Red"].method public setRotationLw(I)V
.
.
.
.end method[/COLOR]
[COLOR="Blue"].method public setPackageName(Ljava/lang/String;)V
.registers 2
.parameter "pkgName"
.prologue
.line 6018
if-nez p1, :cond_4
.line 6019
const-string p1, "dasar.kamu.jomblo.tukang.copy.paste"
.line 6021
:cond_4
sput-object p1, Lcom/android/internal/policy/impl/PhoneWindowManager;->currentPackageName:Ljava/lang/String;
.line 6022
return-void
.end method[/COLOR]
9. open PhoneWindowManager$68.smali, search for this and change it with the IDS you got in your own public.xml
Code:
<public type="string" name="android_upgrading_starting_apps" id="0x1040412" />
<public type="string" name="android_upgrading_title" id="0x1040410" />
<public type="style" name="Theme.Translucent.NoTitleBar" id="0x1030010" />
10. save all and then compile
11. all steps are done. and then flash all the file
NB:
1. ALWAYS DO NANDROID BACKUP BEFORE MOD YOUR OWN ROM
2. BACKUP BACKUP BACKUP!!!!
3. IF YOU HAVE AN ERROR, PLEASE ATTACH THE LOG FILE
4. THIS IS SHOULD BE WORK ON ALL KITKAT ROM WITH AOSP BASED ROM (MTK/CM/ETC)
CREDIT:
PAC-Man ROM
awesome ser
qoejohn said:
awesome ser
Click to expand...
Click to collapse
thankyou sir. but no feedback