Related
HOW TO PORT LIDROID TOGGLES
TO NON SAMSUNG JELLY BEAN ROM
Oke guys, I want to share how to port Lidroid toggle to all non Samsung Jelly Bean 4.1 rom ,
do not try this on 4.0/4.2/4.3 or you will ended with SystemUI force closes
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
and also thanks to @BOND1987 for testing it on mediatek device
and also Thanks to Recognized themer @serajr for some toggles created by him
so we are going to port 20 Lidroid toggles :
( -Lock screen/screen-off action, -Reboot action, -Shutdown action, -Airplane mode, -Bluetoth, -Brightness, -GPS, -Flashlight, -Lockscreen, -MobileData, -Orientation, -ScreenTimeOut, -Sound, -Sync, -Wi-fi, -Wi-fi Hotspot, Battery info, Stay awake, USB Connection mode, USB Debugging )
NOTE !! for CyanogenMod 10 , do not follow or use this guide,. you can just flash my mod from here http://forum.xda-developers.com/showthread.php?t=2333075
Many users from different device reported work on their devices
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
1. Decompile settings.apk
go to : res/xml/settings_header.xml and add the Blue code :
Code:
<header android:icon="@drawable/ic_settings_cmlauncher" android:id="@id/launcher_settings" android:title="@string/launcher_settings_title" />
<header android:icon="@drawable/ic_settings_lockscreen" android:id="@id/lock_screen_settings" android:title="@string/lock_screen_title" android:fragment="com.android.settings.cyanogenmod.LockscreenInterface" />
<header android:icon="@drawable/ic_settings_themes" android:id="@id/themes_settings" android:title="@string/themes_settings_title">
<intent android:targetPackage="com.tmobile.themechooser" android:action="android.intent.action.MAIN" android:targetClass="com.tmobile.themechooser.ThemeChooser" />
</header>
<header android:icon="@drawable/ic_settings_system" android:id="@id/system_settings" android:title="@string/system_settings_title" android:fragment="com.android.settings.cyanogenmod.SystemSettings" />
[COLOR="Blue"]<header android:icon="@drawable/ic_settings_advanced" android:id="@id/adi_buttons" android:title="@string/adi_buttons_title">
<intent android:targetPackage="com.lidroid.settings" android:action="android.intent.action.MAIN" android:targetClass="com.lidroid.settings.Settings" />
</header>[/COLOR]
<header android:title="@string/header_category_device" />
<header android:icon="@drawable/ic_settings_sound" android:id="@id/sound_settings" android:title="@string/sound_settings" android:fragment="com.android.settings.SoundSettings" />
<header android:icon="@drawable/ic_settings_display" android:id="@id/display_settings" android:title="@string/display_settings" android:fragment="com.android.settings.DisplaySettings" />
- res/values/ids.xml
Code:
[COLOR="Blue"]<item type="id" name="adi_buttons">false</item>[/COLOR]
- res/values/strings.xml
Code:
[COLOR="Blue"]<string name="adi_buttons_title">Power Widget</string>[/COLOR]
- res/values/drawable-hdpi
add this PNG image http://d-h.st/mQp
Done & recompile : push to system/app with right permission
NOTE !!, you can skip steps for editing Settings.apk, but don't use Lidroid_setings.apk bellow,. you must use this Version Lidroid_settings.apk by @akash akya,. go here : http://forum.xda-developers.com/showpost.php?p=44062624&postcount=34
Credit & Thanks to @akash akya
Don't forget to press His THANKS BUTTON
2. Download this Lidroid_Settings.apk push to system/app with right permission
3. Decompile SystemUI.apk, Download this : Sources_Lidroid_SystemUI.apk
exstract it and merge to your decompiled SystemUI.apk
NOTE !!, if your device has arrays.xml in res/values/here
please do check again the Sources_Lidroid_SystemUI.apk and adapt the arrays.xml code in it with yours
4. Add the blue code :
- res/values/ids.xml
Code:
[COLOR="Blue"]<item type="id" name="power_widget_button_text">false</item>
<item type="id" name="power_widget_button_indic">false</item>
<item type="id" name="adi_widget">false</item>
<item type="id" name="automatic">false</item>
<item type="id" name="power_widget_button">false</item>
<item type="id" name="power_widget_button_image">false</item>[/COLOR]
- res/values/strings.xml
Code:
[COLOR="Blue"]
<string name="usb_connected_txt">USB connected</string>
<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">Sound vibration</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">Lock Now</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">USB Debugging</string>
<string name="quickpanel_usb_connection_mode_text">USB Conn. 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 Info</string>
<string name="battery_info_info">Battery Information</string>
<string name="battery_info_usage">Battery Power Usage</string>
[/COLOR]
- res/values/integers.xml
Code:
[COLOR="Blue"]<integer name="quickpanel_scroll_threshold_port">5</integer>
<integer name="quickpanel_scroll_threshold_land">8</integer>[/COLOR]
- smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali
Code:
.field mPixelFormat:I
.field mPositionTmp:[I
.field mPostCollapseCleanup:Ljava/lang/Runnable;
[COLOR="Blue"].field mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;[/COLOR]
.field private mPreviousConfigFontScale:F
.field private mPrevioutConfigOrientation:I
.field mQueueLock:Ljava/lang/Object;
Next find this method
Code:
# virtual methods
.method public addIcon(Ljava/lang/String;IILcom/android/internal/statusbar/StatusBarIcon;)V
and Add the blue code above .return-void
Code:
invoke-virtual {v1, v0, p3, v2}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;ILandroid/view/ViewGroup$LayoutParams;)V
[COLOR="Blue"]iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v1}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->updateWidget()V[/COLOR]
.line 826
return-void
.end method
Next find this method
Code:
.method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
scroll down still in that method ,
find the Green code, and add the blue code above it
Code:
iget-object [COLOR="Red"]v9[/COLOR], p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const [COLOR="Red"]v10[/COLOR], 0x7f0c0044
invoke-virtual {[COLOR="Red"]v9, v10[/COLOR]}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object [COLOR="Red"]v9[/COLOR]
check-cast [COLOR="Red"]v9[/COLOR], Landroid/widget/ScrollView;
iput-object [COLOR="Red"]v9[/COLOR], p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mScrollView:Landroid/widget/ScrollView;
.line 528
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mScrollView:Landroid/widget/ScrollView;
const/4 v10, 0x0
invoke-virtual {v9, v10}, Landroid/widget/ScrollView;->setVerticalScrollBarEnabled(Z)V
[COLOR="Blue"]iget-object [COLOR="Red"]v9[/COLOR], p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
.line 444
const [COLOR="Red"]v10[/COLOR], 0x7f0c00da
invoke-virtual {[COLOR="Red"]v9, v10[/COLOR]}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
.line 445
move-result-object [COLOR="Red"]v9[/COLOR]
check-cast [COLOR="Red"]v9[/COLOR], Lcom/lidroid/systemui/quickpanel/PowerWidget;
iput-object [COLOR="Red"]v9[/COLOR], p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;[/COLOR]
.line 530
[COLOR="Green"]new-instance v9, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;
iget-object v10, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-direct {v9, p0, v1, v10}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/content/Context;Landroid/view/View;)V
iput-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTicker:Lcom/android/systemui/statusbar/phone/Ticker;
[/COLOR]
Pay attentiion on the red code in the part of blue code, it have to be wriiten the same like above/previous part
Next go to post #2
Oke Next
still in that method, scroll down
add the red code
Mediatek device
Code:
const-string v9, "android.intent.action.SIM_INFO_UPDATE"
invoke-virtual {v7, v9}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 607
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSIMInfoReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {v1, v9, v7}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
[COLOR="Red"]iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v1}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V[/COLOR]
Xperia/AOSP
Code:
const-string v7, "android.intent.action.SCREEN_OFF"
invoke-virtual {v1, v7}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 517
iget-object v7, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBroadcastReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {v0, v7, v1}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
.line 518
[COLOR="Red"]iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v1}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V[/COLOR]
go to res/layout/ here
pay attention in this step of layout folder, you must adapt it to your device
below is example from my mod for CM10, where the notification panel is in
status_bar_expanded.xml, so I must put the lidroid toggle in it.
Code:
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/close_handle_underlap">
<include android:layout_width="fill_parent" android:layout_height="@dimen/notification_panel_header_height" layout="@layout/status_bar_expanded_header" />
[COLOR="Red"]<com.lidroid.systemui.quickpanel.PowerWidget android:id="@id/adi_widget" android:layout_width="fill_parent" android:layout_height="wrap_content" />[/COLOR]
<include layout="@layout/adi_brightness" />
<RelativeLayout android:orientation="horizontal" android:background="#ff293945" android:layout_width="fill_parent" android:layout_height="wrap_content">
<TextView android:textSize="15.0dip" android:textStyle="bold" android:textColor="#ffadc1d6" android:gravity="left|center" android:id="@id/latestNotificationText" android:paddingLeft="11.0dip" android:layout_width="fill_parent" android:layout_height="23.0dip" android:text="@string/status_bar_latest_events_title" android:layout_alignParentLeft="true" />
<TextView android:textSize="15.0dip" android:textColor="#ffffffff" android:gravity="center" android:id="@id/clear_all_button" android:background="@drawable/tw_btn_default_small" android:padding="0.100000024dip" android:focusable="true" android:clickable="true" android:layout_width="123.0dip" android:layout_height="24.0dip" android:layout_marginRight="4.0dip" android:text="@string/status_bar_clear_all_button" android:layout_alignParentRight="true" android:contentDescription="@string/accessibility_clear_all" />
</RelativeLayout>
<TextView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network.EmergencyOnly" android:gravity="center" android:id="@id/emergency_calls_only" android:paddingBottom="4.0dip" android:visibility="gone" 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="fill_parent" android:overScrollMode="always">
<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>
</LinearLayout>
Recompile your systemUI.apk and decompile the newly Recompiled APK again
Next go to
res/values/public.xml
open it with Notepad++
leave it, but keep it open
next
- smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali
with Notepad++ , control+F
Code:
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
.line 444
const v10, [COLOR="Red"]0x7f0c00da[/COLOR]
invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
.line 445
move-result-object v9
check-cast v9, Lcom/lidroid/systemui/quickpanel/PowerWidget;
iput-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;
replace the red code 0x7f0c00da
with the new ids from public.xml of the second decompiled systemUI.apk
Code:
<public type="id" name="adi_widget" id="[COLOR="Red"]0x7fXXXXXX[/COLOR]" />
Next go to post#3
Next : Download this : source_public, and open it with Notepad++
so you have two public.xml now which is opened in the Notepad++
1. secod decompiled public.xml
2. source_public.xml
- go to , smali/com/lidroid/systemui/quickpanel/here...
there are a lot of smalis there
FIND ALL IDS in all that smalis THAT'S STARTED WITH
Code:
0x7fxxxxxx
EXAMPLE :
AirplaneButton.smali
find this :
Code:
const v0, [COLOR="Red"]0x7f0900b4[/COLOR]
find 0x7f0900b4 in source_public.xml
Code:
<public type="string" name="quickpanel_lockscreen_text" id="0x7f0900b3" />
<public type="string" name="[COLOR="Green"]quickpanel_airplane_text[/COLOR]" id="[COLOR="Red"]0x7f0900b4[/COLOR]" />
<public type="string" name="quickpanel_flashlight_text" id="0x7f0900b5" />
we find that 0x7f0900b4 is for quickpanel_airplane_text
Next, find quickpanel_airplane_text new ids in your second decompiled SystemUI.apk
Code:
<public type="string" name="quickpanel_airplane_text" id="[COLOR="Red"]0x7f??????[/COLOR]" />
change the ids in AirplaneButton.smali with your new ids from second decompiled systemui.apk.
Do it too, to all
Code:
0x7fxxxxxx
in all smalis in the lidroid folder.
, The last part
open Android.Manifest.xml
Before
Code:
[COLOR="Red"]<manifest android:versionCode="16"[/COLOR] android:versionName="4.1.2-eng.arco.20130605.050149" package="com.android.systemui" coreApp="true"
change it to :
Code:
[COLOR="Red"]<manifest android:sharedUserId="android.uid.system" android:process="system" android:versionCode="16"[/COLOR] android:versionName="4.1.2-eng.arco.20130605.050149" package="com.android.systemui" coreApp="true"
Next, add the red code
Code:
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<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"]<uses-permission android:name="android.permission.CAMERA" />[/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" />
Done & Compile, don't forget to sign it coz we've make change to the android.manifest.xml
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
Done
Thanks @BOND1987 for the screenshot from Mediatek device
Additional Guide
[Porting Guide][CM10/JB] Mod 4.2 Statusbar Quicksettings ( TABS, Slider, Flip Anim )
wow... nice guide om
Do not follow the guide yet "!..
It hasn't finished yet,. Still so many missing part.
Later I'll continue
Sent from my GT-I8150 using xda app-developers app
Congrats buddy!!! :good:
I´m about to release my Power Toggles v2 implementation (built from scratch), so after that u´ll get 28 toggles at all, and with a totally new reorder toggles way (built from scratch too). See it on XZ forum, here.
serajr said:
Congrats buddy!!! :good:
I´m about to release my Power Toggles v2 implementation (built from scratch), so after that u´ll get 28 toggles at all, and with a totally new reorder toggles way (built from scratch too). See it on XZ forum, here.
Click to expand...
Click to collapse
That's cool sir
Oke guys, Guide Done now,.
Please do check again from the beginning of the guide ,.
have a nice modding
Adi Aisiteru Reborn said:
Click to expand...
Click to collapse
Sir Need Assistance, Getting this error.....
Code:
E/AndroidRuntime( 432): FATAL EXCEPTION: main
E/AndroidRuntime( 432): java.lang.NullPointerException
E/AndroidRuntime( 432): at com.lidroid.systemui.quickpanel.PowerButton.updateImageView(PowerButton.java:167)
E/AndroidRuntime( 432): at com.lidroid.systemui.quickpanel.PowerButton.access$000(PowerButton.java:29)
E/AndroidRuntime( 432): at com.lidroid.systemui.quickpanel.PowerButton$1.handleMessage(PowerButton.java:92)
E/AndroidRuntime( 432): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 432): at android.os.Looper.loop(Looper.java:153)
E/AndroidRuntime( 432): at android.app.ActivityThread.main(ActivityThread.java:5086)
E/AndroidRuntime( 432): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 432): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 432): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821)
E/AndroidRuntime( 432): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
E/AndroidRuntime( 432): at dalvik.system.NativeStart.main(Native Method)
Please guide.....
BOND1987 said:
Sir Need Assistance, Getting this error.....
Code:
E/AndroidRuntime( 432): FATAL EXCEPTION: main
E/AndroidRuntime( 432): java.lang.NullPointerException
E/AndroidRuntime( 432): at com.lidroid.systemui.quickpanel.PowerButton.updateImageView(PowerButton.java:167)
E/AndroidRuntime( 432): at com.lidroid.systemui.quickpanel.PowerButton.access$000(PowerButton.java:29)
E/AndroidRuntime( 432): at com.lidroid.systemui.quickpanel.PowerButton$1.handleMessage(PowerButton.java:92)
E/AndroidRuntime( 432): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 432): at android.os.Looper.loop(Looper.java:153)
E/AndroidRuntime( 432): at android.app.ActivityThread.main(ActivityThread.java:5086)
E/AndroidRuntime( 432): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 432): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 432): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821)
E/AndroidRuntime( 432): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
E/AndroidRuntime( 432): at dalvik.system.NativeStart.main(Native Method)
Please guide.....
Click to expand...
Click to collapse
How can you get Fatal error..
Did you apply the guide to stok unmodded apk or trying to combine it with other modded apk
Sent from my GT-I8150 using xda app-developers app
Don't know sir.
But it's not modded SystemUI. It's stock one from my favorite ROM. The errors are pointing towards power button.smali. I checked that too. But not able to understand. Now what to do.
Edit:-
Got the culprit. Rectifying problem. Will let you know if it's resolved. Almost close to solution.
EDIT-1:-
Glad to inform you sir. Issue resolved. No problem in guide. Actually my brain is the problem.
In couple of minutes uploading my new mod's screenshots.
Once again like to thank you sir. But not able to find any post where I haven't thanked yet.
""Hitting Thanks Don't Cost You Anything, then, Why You All Are Getting Bothered in Doing So. Hitting Thanks Increases My Motivation to Work for this Community....""
BOND1987 said:
Don't know sir.
But it's not modded SystemUI. It's stock one from my favorite ROM. The errors are pointing towards power button.smali. I checked that too. But not able to understand. Now what to do.
Edit:-
Got the culprit. Rectifying problem. Will let you know if it's resolved. Almost close to solution.
EDIT-1:-
Glad to inform you sir. Issue resolved. No problem in guide. Actually my brain is the problem.
In couple of minutes uploading my new mod's screenshots.
Once again like to thank you sir. But not able to find any post where I haven't thanked yet.
""Hitting Thanks Don't Cost You Anything, then, Why You All Are Getting Bothered in Doing So. Hitting Thanks Increases My Motivation to Work for this Community....""
Click to expand...
Click to collapse
I don't know Bond, the problem can be from installl wrong framework-res.apk,.
so in this case if you mod that rom, so you must use that rom res.apk too
Good to know
And first thanking the God of this Mod- @Adi Aisiteru Reborn.
Thanks a ton sir.
Presenting my new SystemUI mod.:beer::beer::beer:
Feeling like
""Hitting Thanks Don't Cost You Anything, then, Why You All Are Getting Bothered in Doing So. Hitting Thanks Increases My Motivation to Work for this Community....""
got it working in first try... thanks to adi..
well explained as always... but this one is gold..... :good::good:
my device mt6577
in my res/xml/settings_header.xm don't have this line:
<header android:icon="@drawable/ic_settings_system" android:id="@id/system_settings" android:title="@string/system_settings_title" android:fragment="com.android.settings.cyanogenmod.SystemSettings" />
Click to expand...
Click to collapse
Should I add this too ?
lucky92 said:
in my res/xml/settings_header.xm don't have this line:
Should I add this too ?
Click to expand...
Click to collapse
Paste the line mentioned in op above wireless setting line.
It will work good.
""Hitting Thanks Don't Cost You Anything, then, Why You All Are Getting Bothered in Doing So. Hitting Thanks Increases My Motivation to Work for this Community....""
lucky92 said:
in my res/xml/settings_header.xm don't have this line:
Should I add this too ?
Click to expand...
Click to collapse
you can add it anywhere....
ex... after :
<header android:icon="@drawable/ic_settings_wireless" android:id="@id/wifi_settings" android:title="@string/wifi_settings_title" android:fragment="com.android.settings.wifi.WifiSettings" />
actually its not compulsory, its nothing to do with maintoggles .. as i skipped this part... added shortcut using apex launcher....
Thank you all guys
I cannot press your all thnks , as only permited to 8 thanks
Btw, as additional , yes you can skip the settings.apk steps
I have another alternative
decompile Lidroid_Settings.apk, and make change to its android.manifest.xml
Code:
<activity android:label="@string/app_name" android:name="Settings">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.[COLOR="Red"]DEFAULT[/COLOR]" />
</intent-filter>
</activity>
<activity android:label="@string/app_name" android:name="SettingsActivity" />
This will make the Lidroid settings app show in app drawer
Code:
<category android:name="android.intent.category.[COLOR="Red"]LAUNCHER[/COLOR]" />
I'm sorry but I have a question, when i recompiling Settings.apk, systemui.apk by Apk-multi-tools, it's show: that
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building apk file...
The system cannot find the file specified.
it's normail or i do something wrong ? any idea ?
ICS??
Thank you for the amazing guide. Is there any way of making it work on ICS? I don't have JB on my MTK device, and there's no hope of getting it in the forseeable future..
HOW TO PORT LIDROID TOGGLES
TO NON SAMSUNG ICS ROMS
for JB you can go here : http://forum.xda-developers.com/showthread.php?t=2381290
Credit & Thank you :
- @lidroid
- Recognized themer @serajr for some additional toggles created by him.
and we are going to port 21 Lidroid toggles :
( -Lock screen/screen-off action, -Reboot action, -Shutdown action, -Airplane mode, -Bluetoth, -Brightness, -GPS, -Flashlight, -Lockscreen, -MobileData, -Orientation, -ScreenTimeOut, -Sound, -Sync, -Wi-fi, -Wi-fi Hotspot, Battery info, Stay awake, USB Connection mode, USB Debugging, Network mode )
NOTE !! , for CyanogenMod 9 do not follow this guide, you can just flash my mod for CM9 in here http://forum.xda-developers.com/showthread.php?t=2334200
many users from different devices reported work on their phone
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
- notepad++
- Tool for decompiling, : apkmanager/apktool/Virtous/apkmultitools/ or else
1. Decomple SystemUI.apk
- res/values/ids.xml
add this to the end :
Code:
<item type="id" name="quickpanel_button">false</item>
<item type="id" name="quickpanel_button_image">false</item>
<item type="id" name="quickpanel_button_text">false</item>
<item type="id" name="quickpanel_button_indic">false</item>
<item type="id" name="adi_quickpanel">false</item>
- res/values/strings.xml
add this to the end :
Code:
<string name="quickpanel_wifi_text">WiFi</string>
<string name="quickpanel_dc_text">Data</string>
<string name="quickpanel_network_mode_text">Network</string>
<string name="quickpanel_sound_text">Ring</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">Orientation</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">Airplane</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">CWM recovery</string>
<string name="reboot_download">Download</string>
<string name="quickpanel_usb_debugging_text">USB Debugging</string>
<string name="quickpanel_usb_connection_mode_text">USB Conn. 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 Info</string>
<string name="battery_info_info">Battery Information</string>
<string name="battery_info_usage">Battery Power Usage</string>
<string name="quickpanel_wifi_ap_text">Wifi AP</string>
<string name="quickpanel_lockscreen_action_text">Lock Now</string>
- res/layout/status_bar_expanded.xml
add the red code :
MEDIATEK device
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.ExpandedView android:orientation="vertical" android:focusable="true" android:descendantFocusability="afterDescendants"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<FrameLayout android:id="@id/toolBarSwitchPanel" android:background="@drawable/notification_header_bg" android:layout_width="fill_parent" android:layout_height="103.0dip">
<include layout="@layout/zzz_toolbar_view" />
<include layout="@layout/zzz_toolbar_indicator" />
</FrameLayout>
<View android:background="@drawable/status_bar_hr" android:layout_width="fill_parent" android:layout_height="2.0dip" />
<RelativeLayout android:background="@drawable/notification_header_bg" android:paddingTop="3.0dip" android:paddingRight="3.0dip" android:paddingBottom="5.0dip" android:layout_width="fill_parent" android:layout_height="52.0dip">
<com.android.systemui.statusbar.policy.DateView android:textAppearance="@style/TextAppearance.StatusBar.Date" android:gravity="left|center" android:id="@id/date" android:paddingLeft="16.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_alignParentLeft="true" />
<ImageView android:id="@id/settings_button" android:paddingLeft="8.0dip" android:paddingRight="8.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_notify_quicksettings" android:layout_toRightOf="@id/date" android:contentDescription="@string/accessibility_settings_button" />
<ImageView android:id="@id/clear_all_button" android:paddingLeft="8.0dip" android:paddingRight="8.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_notify_clear" android:layout_alignParentRight="true" android:contentDescription="@string/accessibility_clear_all" />
</RelativeLayout>
[COLOR="Red"]<com.lidroid.systemui.quickpanel.PowerWidget android:id="@id/adi_quickpanel" android:layout_width="fill_parent" android:layout_height="wrap_content" />[/COLOR]
<View android:background="@drawable/status_bar_hr" android:layout_width="fill_parent" android:layout_height="2.0dip" />
<FrameLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1.0">
<TextView android:textAppearance="@*android:style/TextAppearance.Large" android:gravity="left" android:layout_gravity="top" android:id="@id/noNotificationsTitle" android:padding="8.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/status_bar_no_notifications_title" />
<ScrollView android:id="@id/scroll" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="fill_parent" android:overScrollMode="ifContentScrolls">
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
<com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/latestItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/notification_height" />
</LinearLayout>
</ScrollView>
<ImageView android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/title_bar_shadow" android:scaleType="fitXY" />
</FrameLayout>
</com.android.systemui.statusbar.phone.ExpandedView>
AOSP / XPERIA
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.ExpandedView android:orientation="vertical" android:focusable="true" android:descendantFocusability="afterDescendants"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<RelativeLayout android:background="@drawable/notification_header_bg" android:paddingTop="3.0dip" android:paddingRight="3.0dip" android:paddingBottom="5.0dip" android:layout_width="fill_parent" android:layout_height="52.0dip">
<com.android.systemui.statusbar.policy.DateView android:textAppearance="@style/TextAppearance.StatusBar.Date" android:gravity="left|center" android:id="@id/date" android:paddingLeft="16.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_alignParentLeft="true" />
<ImageView android:id="@id/settings_button" android:paddingLeft="8.0dip" android:paddingRight="8.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_notify_quicksettings" android:layout_toRightOf="@id/date" android:contentDescription="@string/accessibility_settings_button" />
<ImageView android:id="@id/clear_all_button" android:paddingLeft="8.0dip" android:paddingRight="8.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_notify_clear" android:layout_alignParentRight="true" android:contentDescription="@string/accessibility_clear_all" />
</RelativeLayout>
[COLOR="Red"]<com.lidroid.systemui.quickpanel.PowerWidget android:id="@id/adi_quickpanel" android:layout_width="fill_parent" android:layout_height="wrap_content" />[/COLOR]
<View android:background="@drawable/status_bar_hr" android:layout_width="fill_parent" android:layout_height="2.0dip" />
<FrameLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1.0">
<TextView android:textAppearance="@*android:style/TextAppearance.Large" android:gravity="left" android:layout_gravity="top" android:id="@id/noNotificationsTitle" android:padding="8.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/status_bar_no_notifications_title" />
<ScrollView android:id="@id/scroll" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="fill_parent" android:overScrollMode="ifContentScrolls">
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
<com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/latestItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/notification_height" />
</LinearLayout>
</ScrollView>
<ImageView android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/title_bar_shadow" android:scaleType="fitXY" />
</FrameLayout>
</com.android.systemui.statusbar.phone.ExpandedView>
- smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali
add the blue code :
Code:
.field mPixelFormat:I
.field mPositionTmp:[I
.field mPostCollapseCleanup:Ljava/lang/Runnable;
[COLOR="Blue"].field mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;[/COLOR]
.field private mPreviousConfigFontScale:F
.field mQueueLock:Ljava/lang/Object;
.field private mRecentTasksLoader:Lcom/android/systemui/recent/RecentTasksLoader;
NEXT still in the same smali
for MEDIATEK devices
find this method
Code:
# virtual methods
.method public addIcon(Ljava/lang/String;IILcom/android/internal/statusbar/StatusBarIcon;)V
scroll down and add the blue code
Code:
invoke-virtual {v1, v0, p3, v2}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;ILandroid/view/ViewGroup$LayoutParams;)V
[COLOR="Blue"]iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v1}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->updateWidget()V[/COLOR]
.line 601
return-void
.end method
next find this method :
Code:
.method protected makeStatusBarView()Landroid/view/View;
scroll down and add the blue code
Code:
const [COLOR="Red"]v11[/COLOR], 0x7f0e0041
invoke-virtual {[COLOR="Red"]v2, v11[/COLOR]}, Lcom/android/systemui/statusbar/phone/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object [COLOR="Red"]v11[/COLOR]
check-cast [COLOR="Red"]v11[/COLOR], Landroid/widget/ScrollView;
iput-object [COLOR="Red"]v11, p0[/COLOR], Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mScrollView:Landroid/widget/ScrollView;
[COLOR="Blue"]const [COLOR="Red"]v11[/COLOR], 0x7f0e0096
invoke-virtual {[COLOR="Red"]v2, v11[/COLOR]}, Lcom/android/systemui/statusbar/phone/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object [COLOR="Red"]v11[/COLOR]
check-cast [COLOR="Red"]v11[/COLOR], Lcom/lidroid/systemui/quickpanel/PowerWidget;
iput-object [COLOR="Red"]v11, p0[/COLOR], Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;[/COLOR]
.line 375
new-instance v11, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;
invoke-direct {v11, p0, v1, v6}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/content/Context;Landroid/view/View;)V
iput-object v11, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTicker:Lcom/android/systemui/statusbar/phone/Ticker;
pay attention on the red code in the part of blue code, it has to be written the same like above it/previous part
and also every mediatek device may be have diferent code,. see my another example in here : http://forum.xda-developers.com/showpost.php?p=44095535&postcount=7
next still in the same method, scroll down , and add the blue code
Code:
const-string v11, "android.intent.action.SIM_INFO_UPDATE"
invoke-virtual {v9, v11}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 450
iget-object v11, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSIMInfoReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {v1, v11, v9}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
[COLOR="Blue"]iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v1}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V[/COLOR]
.line 454
return-object v6
.line 312
.end local v3 #filter:Landroid/content/IntentFilter;
.end local v4 #indicator:Lcom/android/systemui/statusbar/toolbar/ToolBarIndicator;
.end local v6 #sb:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
.end local v8 #signalCluster:Lcom/android/systemui/statusbar/SignalClusterViewGemini;
.end local v9 #simInfoIntentFilter:Landroid/content/IntentFilter;
.end local v10 #tickerView:Lcom/android/systemui/statusbar/phone/TickerView;
Click to expand...
Click to collapse
for AOSP / XPERIA
find this method
Code:
# virtual methods
.method public addIcon(Ljava/lang/String;IILcom/android/internal/statusbar/StatusBarIcon;)V
scroll down and add the blue code
Code:
const-string v8, "android.intent.action.SCREEN_OFF"
invoke-virtual {v2, v8}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 373
iget-object v8, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBroadcastReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {v0, v8, v2}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
[COLOR="Blue"]iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedView:Lcom/android/systemui/statusbar/phone/ExpandedView;
const v6, 0x7f0e0096
invoke-virtual {v5, v6}, Lcom/android/systemui/statusbar/phone/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v5
check-cast v5, Lcom/lidroid/systemui/quickpanel/PowerWidget;
iput-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v6}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V[/COLOR]
.line 375
return-object v4
.line 306
.end local v2 #filter:Landroid/content/IntentFilter;
.end local v6 #signalCluster:Lcom/android/systemui/statusbar/SignalClusterView;
.end local v7 #tickerView:Lcom/android/systemui/statusbar/phone/TickerView;
:catch_0
move-exception v8
goto/16 :goto_0
.end method
Click to expand...
Click to collapse
CONTINUE TO POST #2
2. Download source_ICS_Lidroid_SytemUI.apk
Exstract it and merge to your decompiled SystemUI.apk
NOTE !! if your device has arrays.xml in res/values/here
please do check again the source_ICS_Lidroid_SytemUI.apk and adapt the arrays.xml code in it with yours
done and Recompile your SystemUI.apk
3. Decompile the newly Recompiled APK again and go to
res/values/public.xml
open it with Notepad++
leave it, but keep it open
next
- smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali
with Notepad++ , control+F
MEDIATEK DEVICES
Code:
iput-object v11, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mScrollView:Landroid/widget/ScrollView;
const v11, [COLOR="Red"]0x7f0e0096[/COLOR]
invoke-virtual {v2, v11}, Lcom/android/systemui/statusbar/phone/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v11
check-cast v11, Lcom/lidroid/systemui/quickpanel/PowerWidget;
iput-object v11, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;
.line 375
new-instance v11, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;
Click to expand...
Click to collapse
AOSP/XPERIA
Code:
invoke-virtual {v0, v8, v2}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedView:Lcom/android/systemui/statusbar/phone/ExpandedView;
const v6, [COLOR="Red"]0x7f0e0096[/COLOR]
invoke-virtual {v5, v6}, Lcom/android/systemui/statusbar/phone/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v5
check-cast v5, Lcom/lidroid/systemui/quickpanel/PowerWidget;
iput-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v6}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V
.line 375
return-object v4
Click to expand...
Click to collapse
Replace 0x7f0e0096 with the new ids from second decompiled public.xml
Code:
<public type="id" name="[COLOR="Blue"]adi_quickpanel[/COLOR]" id="[COLOR="Red"]0x7fxxxxxx[/COLOR]" />
NEXT CONTINUE IN POST #3
4. Download ICS_Lidroid_public.xml
and open it with Notepad++
so now you have two public.xml which is opened in the Notepad++
1. second decompiled public.xml
2. ICS_Lidroid_public.xml
- go to , smali/com/lidroid/systemui/quickpanel/here...
there are a lot of smalis there
FIND ALL IDS in all that smalis THAT'S STARTED WITH
Code:
[COLOR="Red"]0x7fxxxxxx[/COLOR]
EXAMPLE :
AirplaneButton.smali
find this :
Code:
const v0, [COLOR="Red"]0x7f080089[/COLOR]
find 0x7f080089 in ICS_Lidroid_public.xml
Code:
<public type="string" name="quickpanel_lockscreen_text" id="0x7f080088" />
<public type="[COLOR="Blue"]string[/COLOR]" name="[COLOR="Green"]quickpanel_airplane_text[/COLOR]" id="[COLOR="Red"]0x7f080089[/COLOR]" />
<public type="string" name="quickpanel_flashlight_text" id="0x7f08008a" />
we find that 0x7f080089 is for string .... quickpanel_airplane_text
Next, find string .... quickpanel_airplane_text new ids in your
public.xml of second decompiled SystemUI.apk
Code:
<public type="[COLOR="Blue"]string[/COLOR]" name="[COLOR="Green"]quickpanel_airplane_text[/COLOR]" id="[COLOR="Red"]0x7fxxxxxx[/COLOR]" />
change the ids in AirplaneButton.smali with your new ids from public.xml of second decompiled systemui.apk.
Do it too, to all
Code:
[COLOR="Red"]0x7fxxxxxx[/COLOR]
in all smalis in the lidroid folder.
6. Download this QuickPanel_Settings.apk and push to system/app with right permission
Done
Additional Guide
[HOWTO] Enable 2G/3G, 2G, 3G Toggle
only for devices that support 3G/HSDPA
Go to this thread [HOWTO] Enable 2G/3G Toggle from Statusbar/Launcher
But don't follow the lidroid step, coz we have it already
or Without patching Phone.apk , but with editing Lidroid and Android.manifest
go here : http://forum.xda-developers.com/showpost.php?p=40971646&postcount=30
[Porting Guide][ICS] Mod 4.2 Statusbar tilesview (TABS, Slider, Flip Anim, Lidroid )
http://forum.xda-developers.com/showthread.php?t=2423398
Guide How to full screen Expanded Pulldown JB style
http://forum.xda-developers.com/showthread.php?p=45130177#post45130177
I think that should be done before step 2 because I have the error code in PhoneStatusBar.smali 0x7f0e0096 in step 1
{
"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"
}
I made 2 previous steps then get the code received from <public type="id" name="adi_quickpanel" id="0x7fxxxxxx" /> instead PhoneStatusBar.smali then recompile and it's ok
My device is Lenovo A390
Sorry for my bad English!
Gửi từ Lenovo A390_ROW của tôi bằng cách sử dụng Tapatalk 2
I get errors while recompiling the apk. Here's the full error http://pastebin.com/EKEVsGQh. I'm attaching my SystemUI and framework-res for reference. Please do not just mod it and give it to me, explain if you can so I can know what exactly is the problem
SystemUI.apk
framework-res.apk
try this @grvrulz
add the blue code, but don't add <-- adi_quickpanel
Code:
[COLOR="Red"]const v13, 0x7f0e0042
invoke-virtual {v3, v13}, Lcom/android/systemui/statusbar/phone/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v13
check-cast v13, Landroid/widget/ScrollView;
move-object/from16 v0, p0
iput-object v13, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mScrollView:Landroid/widget/ScrollView;[/COLOR]
[B]blue lines below is basically a copy from above red lines[/B]
[COLOR="Blue"]const v13, 0x7f0e0042 <-- adi_quickpanel
invoke-virtual {v3, v13}, Lcom/android/systemui/statusbar/phone/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v13
check-cast v13, Lcom/lidroid/systemui/quickpanel/PowerWidget;
move-object/from16 v0, p0
iput-object v13, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;[/COLOR]
dafuqChicken said:
I think that should be done before step 2 because I have the error code in PhoneStatusBar.smali 0x7f0e0096 in step 1
View attachment 2152085
I made 2 previous steps then get the code received from <public type="id" name="adi_quickpanel" id="0x7fxxxxxx" /> instead PhoneStatusBar.smali then recompile and it's ok
View attachment 2152086
My device is Lenovo A390
Sorry for my bad English!
Gửi từ Lenovo A390_ROW của tôi bằng cách sử dụng Tapatalk 2
Click to expand...
Click to collapse
oke , how is the result now ?, is there any I can help
How to Port Lidroid Toggles to CM7
Thanks
x-dira said:
How to Port Lidroid Toggles to CM7
Thanks
Click to expand...
Click to collapse
I cannot experimenting on CM7 , coz we don't have CM7 roms on my device,.
but CM7 is Gingerbread, so I think it will be same guide like for Stok GB too
Still doesn't work
Adi Aisiteru Reborn said:
try this @grvrulz
add the blue code, but don't add <-- adi_quickpanel
Code:
[COLOR="Red"]const v13, 0x7f0e0042
invoke-virtual {v3, v13}, Lcom/android/systemui/statusbar/phone/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v13
check-cast v13, Landroid/widget/ScrollView;
move-object/from16 v0, p0
iput-object v13, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mScrollView:Landroid/widget/ScrollView;[/COLOR]
[B]below is a copied from above[/B]
[COLOR="Blue"]const v13, 0x7f0e0042 <-- adi_quickpanel
invoke-virtual {v3, v13}, Lcom/android/systemui/statusbar/phone/ExpandedView;->findViewById(I)Landroid/view/View;
move-result-object v13
check-cast v13, Lcom/lidroid/systemui/quickpanel/PowerWidget;
move-object/from16 v0, p0
iput-object v13, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;[/COLOR]
Click to expand...
Click to collapse
Thank you. I completed the whole guide with this, but the quickpanel doesn't show up. I tried rebooting a couple of times and placing the quickpanel widget at different points in the layout, but it still doesn't show up. I took a logcat with 'adb logcat -d > logcat2.txt' and I'm attaching it here for reference.
Yeah! I have done!!
Thank you for this mod!
Can you help me remove it?
Gửi từ Lenovo A390_ROW của tôi bằng cách sử dụng Tapatalk 2
grvrulz said:
Thank you. I completed the whole guide with this, but the quickpanel doesn't show up. I tried rebooting a couple of times and placing the quickpanel widget at different points in the layout, but it still doesn't show up. I took a logcat with 'adb logcat -d > logcat2.txt' and I'm attaching it here for reference.
Click to expand...
Click to collapse
can you attach me your modded PhoneStatusBar.smali ?
dafuqChicken said:
Can you help me remove it?
View attachment 2153404
Gửi từ Lenovo A390_ROW của tôi bằng cách sử dụng Tapatalk 2
Click to expand...
Click to collapse
Code:
android:layout_height="[COLOR="Red"]0.0dip[/COLOR]"
Adi Aisiteru Reborn said:
Additional Guide
[HOWTO] Enable 2G/3G, 2G, 3G Toggle
only for devices that support 3G/HSDPA
Go to this thread [HOWTO] Enable 2G/3G Toggle from Statusbar/Launcher
But don't follow the lidroid step, coz we have it already
or Without patching Phone.apk , but with editing Lidroid and Android.manifest
go here : http://forum.xda-developers.com/showpost.php?p=40971646&postcount=30
Click to expand...
Click to collapse
Additional Guide added
Adi Aisiteru Reborn said:
can you attach me your modded PhoneStatusBar.smali ?
Click to expand...
Click to collapse
Here's my Phonestatusbar.smali. It's renamed because xda doesn't accept smali files as attachments(but you probably knew it already )
grvrulz said:
Here's my Phonestatusbar.smali. It's renamed because xda doesn't accept smali files as attachments(but you probably knew it already )
Click to expand...
Click to collapse
Code:
const-string v13, "file"
invoke-virtual {v6, v13}, Landroid/content/IntentFilter;->addDataScheme(Ljava/lang/String;)V
.line 473
move-object/from16 v0, p0
iget-object v13, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mMediaEjectBroadcastReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {v2, v13, v6}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
[COLOR="Blue"]iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v1}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V[/COLOR]
.line 475
return-object v8
.line 320
.end local v4 #filter:Landroid/content/IntentFilter;
.end local v5 #indicator:Lcom/android/systemui/statusbar/toolbar/ToolBarIndicator;
.end local v6 #mediaEjectFilter:Landroid/content/IntentFilter;
.end local v8 #sb:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
.end local v10 #signalCluster:Lcom/android/systemui/statusbar/SignalClusterViewGemini;
.end local v11 #simInfoIntentFilter:Landroid/content/IntentFilter;
.end local v12 #tickerView:Lcom/android/systemui/statusbar/phone/TickerView;
:cond_1
const v13, 0x7f030020
const/4 v14, 0x0
invoke-static {v2, v13, v14}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v8
check-cast v8, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
.restart local v8 #sb:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
goto/16 :goto_0
.line 337
:catch_0
move-exception v13
goto/16 :goto_1
.end method
you havn't add the blue code
Adi Aisiteru Reborn said:
Code:
const-string v13, "file"
invoke-virtual {v6, v13}, Landroid/content/IntentFilter;->addDataScheme(Ljava/lang/String;)V
.line 473
move-object/from16 v0, p0
iget-object v13, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mMediaEjectBroadcastReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {v2, v13, v6}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
[COLOR="Blue"]iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v1}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V[/COLOR]
.line 475
return-object v8
.line 320
.end local v4 #filter:Landroid/content/IntentFilter;
.end local v5 #indicator:Lcom/android/systemui/statusbar/toolbar/ToolBarIndicator;
.end local v6 #mediaEjectFilter:Landroid/content/IntentFilter;
.end local v8 #sb:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
.end local v10 #signalCluster:Lcom/android/systemui/statusbar/SignalClusterViewGemini;
.end local v11 #simInfoIntentFilter:Landroid/content/IntentFilter;
.end local v12 #tickerView:Lcom/android/systemui/statusbar/phone/TickerView;
:cond_1
const v13, 0x7f030020
const/4 v14, 0x0
invoke-static {v2, v13, v14}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v8
check-cast v8, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
.restart local v8 #sb:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
goto/16 :goto_0
.line 337
:catch_0
move-exception v13
goto/16 :goto_1
.end method
you havn't add the blue code
Click to expand...
Click to collapse
After adding this, I get the error
Code:
[8180,1] The register number must be less than v16
I also tried adding
Code:
move-object/from16 v0, p0
just before that line but it's still the same..
grvrulz said:
After adding this, I get the error
Code:
[8180,1] The register number must be less than v16
I also tried adding
Code:
move-object/from16 v0, p0
just before that line but it's still the same..
Click to expand...
Click to collapse
try to use PhoneStatusBar.smali code for AOSP/XPERIA from OP,.
or for Touchwizz in here http://forum.xda-developers.com/showthread.php?t=1725411
but change
Code:
Lcom/wanam/systemui/quickpanel/PowerWidget;
to :
Code:
Lcom/lidroid/systemui/quickpanel/PowerWidget;
Who want 4.2 quick panel
{
"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"
}
Credits :
* 4.2 quickpanel was originally made by RT @SpaceCaker Here without him no-quickpanel
* Wonderful guide for AOSP ROMs about Lidroid... which helped me lot, its by @Adi Aisiteru Reborn his guide here
* @XDA.AGM for this... toggles in panel view was not possible if didnt supported by giving his mod
* Lidroid Toggls for samsung Lidroid & for jb Wanam
* Lidroid Toggls port for non-samsung roms is made by Recognized themer @serajr for grid view
* @bsuhas for new method for quick panel mod
* My friend @BOND1987 is also encouraged me
* My friend @Akhilendra1711 for animate collapse methods
* My friend @khan_frd2002 for helping me in updating thread
* Tested with MTK 4.1.1 must work with AOSP based 4.1.1 roms *
Q : there is already a guide for quickpanel and lidroid, why you made new thread ??
A : well, combining both is different from doing them separately... also lidroid files and quick panel files i have given is different from given in those guides...
more screenshots :
If you have any questions or suggestions feel free to ask... If you get any part working, post back with screenshots and device name
Things needed :
* You MUST know how to decompile & compile .jar files and .apk files
* Text editor
* SystemUI.apk
PART 1 : setup 4.2 quick panel view
if you already followed guide by Spaecaker and got it working, skip this step and follow 2nd step
Step 1 : decompile systemui.apk and open ststus_bar.xml... for MTK devices its gemini_status_bar.xml..... find
Code:
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
add this code below it..
Code:
<com.android.systemui.statusbar.StatusBarServiceLRPull android:layout_width="fill_parent" android:layout_height="wrap_content">
find
Code:
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="2.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
add this code above it..
Code:
</com.android.systemui.statusbar.StatusBarServiceLRPull>
Step 2 : Open status_bar_expanded (for MTK gemini_status_bar_expanded.xml),
Delete this line :
Code:
<include android:layout_width="fill_parent" android:layout_height="@dimen/notification_panel_header_height" layout="@layout/status_bar_expanded_header" />
find
Code:
<FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/close_handle_underlap">
add this line above it..
Code:
<com.spacecaker.SpaceLayOut android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
<include layout="@layout/quickpanel_quick_settings_space" />
</LinearLayout>
find, this
Code:
<ScrollView android:id="@id/scroll" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginTop="115.0dip" android:layout_marginBottom="8.0dip" android:overScrollMode="ifContentScrolls">
<com.android.systemui.statusbar.policy.NotificationRowLayout android:layout_gravity="bottom" android:id="@id/latestItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/notification_row_min_height" />
</ScrollView>
</FrameLayout>
add this lines below it
Code:
</com.spacecaker.SpaceLayOut>
find :
Code:
<com.spacecaker.SpaceLayOut android:layout_width="fill_parent"
add this above it :
Code:
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/close_handle_underlap">
<include android:layout_width="fill_parent" android:layout_height="@dimen/notification_panel_header_height" layout="@layout/status_bar_expanded_header" />
</LinearLayout>
Step 3 :open StatusBar_Expanded_Header.xml search for
Code:
<ImageView android:id="@id/settings_button" android:layout_width="48.0dip" android:layout_height="48.0dip" android:src="@drawable/ic_notify_quicksettings" android:scaleType="center" android:contentDescription="@string/accessibility_settings_button" />
add this below it :
Code:
<com.spacecaker.ButtonBurst android:id="@id/spacebuttonburst" android:layout_width="30.0dip" android:layout_height="30.0dip" android:layout_alignParentRight="true" />
Step 4 : open res/values/ids.xml add these at the end
Code:
<item type="id" name="spacebuttonburst">false</item>
save all and add these files in corresponding folders :
Download files here
Step 5 : compile and decompile compiled systemui.apk , open smali/com/spacecaker/ButtonBurst.smali
find const v3, 0x7f020180 replce with your id found in public.xml, search for <public type="drawable" name="btn_toggles_normal" next to it you will find id..
same way find const v3, 0x7f02017f replace id found in public.xml, search for <public type="drawable" name="btn_tg"
Step 6 : open smali/com/android/systemui/SystemUIService.smali
add this at the end :
Code:
.method public onClickPanelMethod(Landroid/view/View;)V
.locals 11
.parameter "v"
.prologue
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
invoke-virtual {p1}, Landroid/view/View;->getTag()Ljava/lang/Object;
move-result-object v5
check-cast v5, Ljava/lang/String;
:try_start_0
const-string v3, ","
invoke-virtual {v5, v3}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;
move-result-object v6
const/4 v4, 0x0
aget-object v4, v6, v4
const/4 v7, 0x1
aget-object v7, v6, v7
invoke-virtual {v0, v4, v7}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
const/high16 v2, 0x1000
invoke-virtual {v0, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
move-result-object v0
invoke-virtual {p0, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
:goto_0
const-string v1, "statusbar"
invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/StatusBarManager;
invoke-virtual {v0}, Landroid/app/StatusBarManager;->collapse()V
return-void
:catch_0
move-exception v0
.local v0, e:Ljava/lang/Exception;
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
const-string v10, "Failed to execute action :\n"
invoke-virtual {v10, v5}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
move-result-object v5
const/16 v9, 0x7d0
invoke-static {p0, v5, v9}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;
move-result-object v8
invoke-virtual {v8}, Landroid/widget/Toast;->show()V
goto :goto_0
.end method
Step 7 : save and compile.... flash/push test whether its working before adding toggles...
how to add new toggles to launch apps
open quick quickpanel_quick_settings_space.xml
to add toggle to launch app, just add
Code:
<FrameLayout android:id="@id/settings_button" android:tag="[COLOR="Red"]com.android.settings,com.android.settings.Settings$AudioProfileSettingsActivity[/COLOR]" android:background="@drawable/suvi_border_background" android:layout_width="120.0px" android:layout_height="100.0px" android:layout_weight="1.0" android:onClick="onSuviClickGenericFailOver">
note : the red code corresponds to package,activity name...
to get activity and package name, open app you want to add AndroidManifeast.xml you will get package name with package= tag
ex : for settings
Code:
<manifest android:sharedUserId="android.uid.system" android:versionCode="16" android:versionName="4.1.1-eng..1364989609" [COLOR="red"]package="com.android.settings"[/COLOR] coreApp="true"
activity name can be found by searching activity tag ex: for Wifi settings,
Code:
<activity android:label="@string/wifi_settings" [COLOR="red"]android:name="Settings$WifiSettingsActivity"[/COLOR] android:clearTaskOnLaunch="true" android:configChanges="keyboardHidden|orientation|screenSize" android:parentActivityName="Settings">
finally it will look like :
Code:
<FrameLayout android:id="@id/settings_button" android:tag="[COLOR="Red"]com.android.settings,com.android.settings.Settings$WifiSettingsActivity[/COLOR]" android:background="@drawable/[COLOR="Blue"]xyz[/COLOR]" android:layout_width="120.0px" android:layout_height="100.0px" android:layout_weight="1.0" android:onClick="onSuviClickGenericFailOver">
also put corresponding image in drawable here xyz
PART 2 : add lidroid toggles
PART 2 : add Lidroid Toggles to QuickPanel
You must have working Quick panel view before trying this mod... follow first step to add quick panel view
You may also try.... @BOND1987 guide here for them who have already implimented lidroid in normal view thanks to him...
Code:
step 1 : decompile systemUI.apk, merge the files i have given...
goto : res/values/ids.xml add these at the end :
Code:
<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">false</item>
<item type="id" name="automatic">false</item>
<item type="id" name="power_widget_button">false</item>
<item type="id" name="power_widget_button_image">false</item>
goto : res/values/strings.xml add these at the end
Code:
<string name="usb_connected_txt">USB connected</string>
<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">Sound vibration</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">Lock Now</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">USB Debugging</string>
<string name="quickpanel_usb_connection_mode_text">USB Conn. 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 Info</string>
<string name="battery_info_info">Battery Information</string>
<string name="battery_info_usage">Battery Power Usage</string>
step 2 : open smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali
find :
Code:
.field mPostCollapseCleanup:Ljava/lang/Runnable;
add this below it :
Code:
.field mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;
Next find this method
Code:
# virtual methods
.method public addIcon(Ljava/lang/String;IILcom/android/internal/statusbar/StatusBarIcon;)V
and Add the blue code above .return-void
Code:
invoke-virtual {v1, v0, p3, v2}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;ILandroid/view/ViewGroup$LayoutParams;)V
[COLOR="Blue"] iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v1}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->updateWidget()V[/COLOR]
.line 826
return-void
.end method
step 3 : find line similer to these
Code:
new-instance v11, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;
iget-object v12, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-direct {v11, p0, v2, v12}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/content/Context;Landroid/view/View;)V
iput-object v11, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTicker:Lcom/android/systemui/statusbar/phone/Ticker;
above it you will see some thing like this,
Code:
iget-object [COLOR="red"]v11[/COLOR], p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mScrollView:Landroid/widget/ScrollView;
const/4[COLOR="red"] v12[/COLOR], 0x0
invoke-virtual {[COLOR="red"]v11, v12[/COLOR]}, Landroid/widget/ScrollView;->setVerticalScrollBarEnabled(Z)V
red lines may be different i your case..
add blue lines to give it the form , edit red colored variables to match using green line:
Code:
iget-object v11, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mScrollView:Landroid/widget/ScrollView;
const/4 v12, 0x0
[COLOR="SeaGreen"] invoke-virtual {[COLOR="red"]v11, v12[/COLOR]}, Landroid/widget/ScrollView;->setVerticalScrollBarEnabled(Z)V[/COLOR]
[COLOR="Blue"] iget-object [COLOR="red"]v11[/COLOR], p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
.line 444
const[COLOR="red"] v12[/COLOR], 0x7f0c00e9
invoke-virtual {[COLOR="Red"]v11, v12[/COLOR]}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
.line 445
move-result-object [COLOR="red"]v11[/COLOR]
check-cast [COLOR="red"]v11[/COLOR], Lcom/lidroid/systemui/quickpanel/PowerWidget;
iput-object [COLOR="red"]v11[/COLOR], p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;[/COLOR]
.line 530
new-instance v11, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;
iget-object v12, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-direct {v11, p0, v2, v12}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/content/Context;Landroid/view/View;)V
iput-object v11, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTicker:Lcom/android/systemui/statusbar/phone/Ticker;
step 4: find lines similer to this :
Code:
iget-object v11, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDisplayMetrics:Landroid/util/DisplayMetrics;
iget v11, v11, Landroid/util/DisplayMetrics;->heightPixels:I
iget-object v12, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
add these line above
Code:
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v1}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V
step 5: open quickpanel_quick_settings_space.xml
edit it to look like this :
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
[COLOR="Red"] <com.lidroid.systemui.quickpanel.PowerWidget android:layout_marginTop="50.0dip" android:id="@id/power_widget" android:paddingTop="0.0dip" android:paddingBottom="0.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" /> [/COLOR]
<ScrollView android:id="@id/scroll" android:scrollbars="none" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="0.0dip" android:overScrollMode="never">
compile and decompile to get public ids..
Step 6: Open : res/values/public.xml keep it open, then open com/android/systemui/statusbar/phone/PhoneStatusBar.smali
search : 0x7f0c00e9 replece with id you got with <public type="id" name="power_widget"
open all smali found in smali/com/lidroid/systemui/quickpanel/
search for
Code:
0x7f
find the public name using my public.txt given
search for that name in your public.xml replace id in that smali...
step 7: Edit AndroidManifeast.xml to look like this, add red code,
Code:
[COLOR="red"]<manifest android:sharedUserId="android.uid.system" android:process="system"[/COLOR] android:versionCode="16" android:versionName="4.1.1-eng..1364989609" package="com.android.systemui" coreApp="true"
xmlns:android="http://schemas.android.com/apk/res/android">
[COLOR="red"]<uses-permission android:name="android.permission.CAMERA" />[/COLOR]
save all and compile, sign your systemui.apk as you have modified manifeast
Step 8: push/flash new systemui along with idroid_settings.apk given...
PART 3 : ADD VOLUME SLIDER TO QUICK PANEL :
This doesn't depend on Lidroid, any one with quick panel working may try it.... :highfive:
If your smali don't have some lines i mentioned... post your smali
SS :
lets proceed,
step 1 : Open res/values/ids.xml
add these below :
Code:
<item type="id" name="quickpanel_slider_ringer_volume">false</item>
<item type="id" name="quickpanel_slider_notification_volume">false</item>
<item type="id" name="quickpanel_slider_voice_call_volume">false</item>
<item type="id" name="quickpanel_slider_media_volume">false</item>
<item type="id" name="quickpanel_slider_alarm_volume">false</item>
step 2 : Open res/values/strings.xml
add these below :
Code:
<string name="quickpanel_slider_ringer_volume_text">Ringtone & notifications</string>
<string name="quickpanel_slider_notification_volume_text">Notifications</string>
<string name="quickpanel_slider_voice_call_volume_text">Voice calls</string>
<string name="quickpanel_slider_media_volume_text">Music, video, games, & other media</string>
<string name="quickpanel_slider_alarm_volume_text">Alarms</string>
Open styles.xml add these below :
Code:
<style name="TextAppearance" />
<style name="TextAppearance.QuickPanel" parent="@style/TextAppearance" />
<style name="TextAppearance.QuickPanel.TextStyle" parent="@style/TextAppearance.QuickPanel">
<item name="android:textSize">12.0dip</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">#ffcccccc</item>
<item name="android:ellipsize">marquee</item>
<item name="android:paddingLeft">6.0dip</item>
<item name="android:paddingRight">6.0dip</item>
<item name="android:fadingEdge">horizontal</item>
<item name="android:maxLines">2</item>
<item name="android:singleLine">false</item>
<item name="android:drawablePadding">12.0dip</item>
<item name="android:textAllCaps">true</item>
</style>
step 3 : Open res/layout/quickpanel_quick_settings_space.xml
compare your code with mine to get layout as in screenshot...
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
<com.lidroid.systemui.quickpanel.PowerWidget android:id="@id/adi_widget" android:paddingTop="0.0dip" android:paddingBottom="0.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="50.0dip" />
<TextView android:textSize="14.0dip" android:textStyle="bold" android:gravity="center" android:layout_gravity="top|center" android:background="#60000000" android:layout_width="fill_parent" android:layout_height="25.0dip" android:layout_marginTop="10.0dip" android:layout_marginBottom="10.0dip" android:text="Volume Panel" android:singleLine="true" style="@style/TextAppearance.QuickPanel.TextStyle" />
<ScrollView android:id="@id/scroll" android:scrollbars="none" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="0.0dip" android:layout_marginBottom="30.0dip" android:overScrollMode="never">
<LinearLayout android:gravity="left" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="10.0dip">
<FrameLayout android:background="#00ffffff" android:padding="3.0dip" android:layout_width="fill_parent" android:layout_height="65.0dip">
<TextView android:gravity="left" android:layout_gravity="top|left|center" android:layout_width="wrap_content" android:layout_height="15.0dip" android:layout_marginTop="0.0dip" android:layout_marginBottom="10.0dip" android:text="@string/quickpanel_slider_media_volume_text" android:singleLine="true" style="@style/TextAppearance.QuickPanel.TextStyle" />
<LinearLayout android:layout_gravity="bottom|center" android:orientation="horizontal" android:padding="10.0dip" android:focusable="true" android:clickable="true" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="2.0dip">
<ImageView android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@*android:drawable/ic_media_ff" android:scaleType="center" />
<SeekBar android:id="@id/quickpanel_slider_media_volume" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="0.0dip" android:layout_centerVertical="true" />
</LinearLayout>
</FrameLayout>
<FrameLayout android:background="#00ffffff" android:padding="3.0dip" android:layout_width="fill_parent" android:layout_height="65.0dip">
<TextView android:gravity="left" android:layout_gravity="top|left|center" android:layout_width="wrap_content" android:layout_height="15.0dip" android:layout_marginTop="0.0dip" android:layout_marginBottom="10.0dip" android:text="@string/quickpanel_slider_ringer_volume_text" android:singleLine="true" style="@style/TextAppearance.QuickPanel.TextStyle" />
<LinearLayout android:layout_gravity="bottom|center" android:orientation="horizontal" android:padding="10.0dip" android:focusable="true" android:clickable="true" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="2.0dip">
<ImageView android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@*android:drawable/ic_audio_phone" android:scaleType="center" />
<SeekBar android:id="@id/quickpanel_slider_ringer_volume" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="0.0dip" android:layout_centerVertical="true" />
</LinearLayout>
</FrameLayout>
<FrameLayout android:background="#00ffffff" android:padding="3.0dip" android:layout_width="fill_parent" android:layout_height="65.0dip">
<TextView android:gravity="left" android:layout_gravity="top|left|center" android:layout_width="wrap_content" android:layout_height="15.0dip" android:layout_marginTop="0.0dip" android:layout_marginBottom="10.0dip" android:text="@string/quickpanel_slider_alarm_volume_text" android:singleLine="true" style="@style/TextAppearance.QuickPanel.TextStyle" />
<LinearLayout android:layout_gravity="bottom|center" android:orientation="horizontal" android:padding="10.0dip" android:focusable="true" android:clickable="true" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="2.0dip">
<ImageView android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@*android:drawable/ic_audio_alarm" android:scaleType="center" />
<SeekBar android:id="@id/quickpanel_slider_alarm_volume" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="0.0dip" android:layout_centerVertical="true" />
</LinearLayout>
</FrameLayout>
<FrameLayout android:background="#00ffffff" android:padding="3.0dip" android:layout_width="fill_parent" android:layout_height="65.0dip">
<TextView android:gravity="left" android:layout_gravity="top|left|center" android:layout_width="wrap_content" android:layout_height="15.0dip" android:layout_marginTop="0.0dip" android:layout_marginBottom="10.0dip" android:text="@string/quickpanel_slider_voice_call_volume_text" android:singleLine="true" style="@style/TextAppearance.QuickPanel.TextStyle" />
<LinearLayout android:layout_gravity="bottom|center" android:orientation="horizontal" android:padding="10.0dip" android:focusable="true" android:clickable="true" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="2.0dip">
<ImageView android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@*android:drawable/ic_audio_ring_notif" android:scaleType="center" />
<SeekBar android:id="@id/quickpanel_slider_voice_call_volume" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="0.0dip" android:layout_centerVertical="true" />
</LinearLayout>
</FrameLayout>
<FrameLayout android:background="#00ffffff" android:padding="3.0dip" android:layout_width="fill_parent" android:layout_height="65.0dip">
<TextView android:gravity="left" android:layout_gravity="top|left|center" android:layout_width="wrap_content" android:layout_height="15.0dip" android:layout_marginTop="0.0dip" android:layout_marginBottom="10.0dip" android:text="@string/quickpanel_slider_notification_volume_text" android:singleLine="true" style="@style/TextAppearance.QuickPanel.TextStyle" />
<LinearLayout android:layout_gravity="bottom|center" android:orientation="horizontal" android:padding="10.0dip" android:focusable="true" android:clickable="true" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="2.0dip">
<ImageView android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@*android:drawable/ic_audio_notification" android:scaleType="center" />
<SeekBar android:id="@id/quickpanel_slider_notification_volume" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="0.0dip" android:layout_centerVertical="true" />
</LinearLayout>
</FrameLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
</LinearLayout>
step 4 : save, compile and decompile
goto com\android\systemui\statusbar\phone\PhoneStatusBar.smali
find :
Code:
.field private mAnimationRuning:Z
add this below :
Code:
.field private mAudioManager:Landroid/media/AudioManager;
find : ( red code may be different in your case ignore it)
Code:
.method static synthetic access$[COLOR="Red"]200[/COLOR](Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)F
.locals 1
.parameter "x0"
.prologue
.line 118
iget v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSelfExpandVelocityPx:F
return v0
.end method
add this below :
Code:
.method static synthetic access$1101(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Landroid/media/AudioManager;
.locals 1
.parameter
.prologue
.line 23
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAudioManager:Landroid/media/AudioManager;
return-object v0
.end method
.method static synthetic access$1200(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Z
.locals 1
.parameter "x0"
.prologue
.line 97
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedVisible:Z
return v0
.end method
step 5 : Find
Code:
.method private setStatusBarLowProfile(Z)V
and this code above it :
Code:
.method private setQuickPanelVolumeSliders()V
.locals 12
.prologue
const/4 v11, 0x3
const/4 v10, 0x2
const/4 v9, 0x0
const/4 v7, 0x1
.line 54
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
const-string v6, "audio"
invoke-virtual {v5, v6}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v5
check-cast v5, Landroid/media/AudioManager;
iput-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAudioManager:Landroid/media/AudioManager;
.line 57
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v8, 0x7f0c00ec
invoke-virtual {v5, v8}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v3
check-cast v3, Landroid/widget/SeekBar;
.line 58
.local v3, ringSlider:Landroid/widget/SeekBar;
invoke-virtual {v3, v7}, Landroid/widget/SeekBar;->setKeyProgressIncrement(I)V
.line 59
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAudioManager:Landroid/media/AudioManager;
invoke-virtual {v5, v10}, Landroid/media/AudioManager;->getStreamMaxVolume(I)I
move-result v5
invoke-virtual {v3, v5}, Landroid/widget/SeekBar;->setMax(I)V
.line 60
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAudioManager:Landroid/media/AudioManager;
invoke-virtual {v5, v10}, Landroid/media/AudioManager;->getStreamVolume(I)I
move-result v5
invoke-virtual {v3, v5}, Landroid/widget/SeekBar;->setProgress(I)V
.line 61
new-instance v5, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$AkashE;
invoke-direct {v5, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$AkashE;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
invoke-virtual {v3, v5}, Landroid/widget/SeekBar;->setOnSeekBarChangeListener(Landroid/widget/SeekBar$OnSeekBarChangeListener;)V
.line 80
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v8, 0x7f0c00ed
invoke-virtual {v5, v8}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v2
check-cast v2, Landroid/widget/SeekBar;
.line 81
.local v2, notificationSlider:Landroid/widget/SeekBar;
invoke-virtual {v2, v7}, Landroid/widget/SeekBar;->setKeyProgressIncrement(I)V
.line 82
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAudioManager:Landroid/media/AudioManager;
const/4 v6, 0x5
invoke-virtual {v5, v6}, Landroid/media/AudioManager;->getStreamMaxVolume(I)I
move-result v5
invoke-virtual {v2, v5}, Landroid/widget/SeekBar;->setMax(I)V
.line 83
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAudioManager:Landroid/media/AudioManager;
const/4 v6, 0x5
invoke-virtual {v5, v6}, Landroid/media/AudioManager;->getStreamVolume(I)I
move-result v5
invoke-virtual {v2, v5}, Landroid/widget/SeekBar;->setProgress(I)V
.line 84
new-instance v5, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$AkashD;
invoke-direct {v5, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$AkashD;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
invoke-virtual {v2, v5}, Landroid/widget/SeekBar;->setOnSeekBarChangeListener(Landroid/widget/SeekBar$OnSeekBarChangeListener;)V
.line 103
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v8, 0x7f0c00ee
invoke-virtual {v5, v8}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v4
check-cast v4, Landroid/widget/SeekBar;
.line 104
.local v4, voiceCallSlider:Landroid/widget/SeekBar;
invoke-virtual {v4, v7}, Landroid/widget/SeekBar;->setKeyProgressIncrement(I)V
.line 105
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAudioManager:Landroid/media/AudioManager;
invoke-virtual {v5, v9}, Landroid/media/AudioManager;->getStreamMaxVolume(I)I
move-result v5
invoke-virtual {v4, v5}, Landroid/widget/SeekBar;->setMax(I)V
.line 106
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAudioManager:Landroid/media/AudioManager;
invoke-virtual {v5, v9}, Landroid/media/AudioManager;->getStreamVolume(I)I
move-result v5
invoke-virtual {v4, v5}, Landroid/widget/SeekBar;->setProgress(I)V
.line 107
new-instance v5, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$AkashC;
invoke-direct {v5, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$AkashC;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
invoke-virtual {v4, v5}, Landroid/widget/SeekBar;->setOnSeekBarChangeListener(Landroid/widget/SeekBar$OnSeekBarChangeListener;)V
.line 126
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v8, 0x7f0c00ef
invoke-virtual {v5, v8}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/SeekBar;
.line 127
.local v1, mediaSlider:Landroid/widget/SeekBar;
invoke-virtual {v1, v7}, Landroid/widget/SeekBar;->setKeyProgressIncrement(I)V
.line 128
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAudioManager:Landroid/media/AudioManager;
invoke-virtual {v5, v11}, Landroid/media/AudioManager;->getStreamMaxVolume(I)I
move-result v5
invoke-virtual {v1, v5}, Landroid/widget/SeekBar;->setMax(I)V
.line 129
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAudioManager:Landroid/media/AudioManager;
invoke-virtual {v5, v11}, Landroid/media/AudioManager;->getStreamVolume(I)I
move-result v5
invoke-virtual {v1, v5}, Landroid/widget/SeekBar;->setProgress(I)V
.line 130
new-instance v5, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$AkashB;
invoke-direct {v5, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$AkashB;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
invoke-virtual {v1, v5}, Landroid/widget/SeekBar;->setOnSeekBarChangeListener(Landroid/widget/SeekBar$OnSeekBarChangeListener;)V
.line 149
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v8, 0x7f0c00f0
invoke-virtual {v5, v8}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/SeekBar;
.line 150
.local v0, alarmSlider:Landroid/widget/SeekBar;
invoke-virtual {v0, v7}, Landroid/widget/SeekBar;->setKeyProgressIncrement(I)V
.line 151
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAudioManager:Landroid/media/AudioManager;
const/4 v6, 0x4
invoke-virtual {v5, v6}, Landroid/media/AudioManager;->getStreamMaxVolume(I)I
move-result v5
invoke-virtual {v0, v5}, Landroid/widget/SeekBar;->setMax(I)V
.line 152
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAudioManager:Landroid/media/AudioManager;
const/4 v6, 0x4
invoke-virtual {v5, v6}, Landroid/media/AudioManager;->getStreamVolume(I)I
move-result v5
invoke-virtual {v0, v5}, Landroid/widget/SeekBar;->setProgress(I)V
.line 153
new-instance v5, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$AkashA;
invoke-direct {v5, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$AkashA;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
invoke-virtual {v0, v5}, Landroid/widget/SeekBar;->setOnSeekBarChangeListener(Landroid/widget/SeekBar$OnSeekBarChangeListener;)V
.line 170
return-void
.end method
Step 6 : Find these lines : (Red lines may be different)
Code:
new-instance [COLOR="Red"]v11[/COLOR], Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;
iget-object [COLOR="red"]v12[/COLOR], p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-direct {[COLOR="red"]v11, p0, v2, v12[/COLOR]}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/content/Context;Landroid/view/View;)V
iput-object [COLOR="red"]v11[/COLOR], p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTicker:Lcom/android/systemui/statusbar/phone/Ticker;
add this above it :
Code:
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setQuickPanelVolumeSliders()V
Step 7 : Find this line
Code:
.method protected updateRecentsPanel()V
add this above :
Code:
.method public updateQuickPanelVolumeSliders()V
.locals 8
.prologue
.line 176
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v7, 0x7f0c00ec
invoke-virtual {v5, v7}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v3
check-cast v3, Landroid/widget/SeekBar;
.line 177
.local v3, ringSlider:Landroid/widget/SeekBar;
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAudioManager:Landroid/media/AudioManager;
const/4 v6, 0x2
invoke-virtual {v5, v6}, Landroid/media/AudioManager;->getStreamVolume(I)I
move-result v5
invoke-virtual {v3, v5}, Landroid/widget/SeekBar;->setProgress(I)V
.line 180
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v7, 0x7f0c00ed
invoke-virtual {v5, v7}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v2
check-cast v2, Landroid/widget/SeekBar;
.line 181
.local v2, notificationSlider:Landroid/widget/SeekBar;
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAudioManager:Landroid/media/AudioManager;
const/4 v6, 0x5
invoke-virtual {v5, v6}, Landroid/media/AudioManager;->getStreamVolume(I)I
move-result v5
invoke-virtual {v2, v5}, Landroid/widget/SeekBar;->setProgress(I)V
.line 184
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v7, 0x7f0c00ee
invoke-virtual {v5, v7}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v4
check-cast v4, Landroid/widget/SeekBar;
.line 185
.local v4, voiceCallSlider:Landroid/widget/SeekBar;
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAudioManager:Landroid/media/AudioManager;
const/4 v6, 0x0
invoke-virtual {v5, v6}, Landroid/media/AudioManager;->getStreamVolume(I)I
move-result v5
invoke-virtual {v4, v5}, Landroid/widget/SeekBar;->setProgress(I)V
.line 188
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v7, 0x7f0c00ef
invoke-virtual {v5, v7}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/SeekBar;
.line 189
.local v1, mediaSlider:Landroid/widget/SeekBar;
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAudioManager:Landroid/media/AudioManager;
const/4 v6, 0x3
invoke-virtual {v5, v6}, Landroid/media/AudioManager;->getStreamVolume(I)I
move-result v5
invoke-virtual {v1, v5}, Landroid/widget/SeekBar;->setProgress(I)V
.line 192
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v7, 0x7f0c00f0
invoke-virtual {v5, v7}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/SeekBar;
.line 193
.local v0, alarmSlider:Landroid/widget/SeekBar;
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAudioManager:Landroid/media/AudioManager;
const/4 v6, 0x4
invoke-virtual {v5, v6}, Landroid/media/AudioManager;->getStreamVolume(I)I
move-result v5
invoke-virtual {v0, v5}, Landroid/widget/SeekBar;->setProgress(I)V
.line 195
return-void
.end method
Step 8 : Find
Code:
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
add this below value = {
Code:
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$AkashA;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$AkashB;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$AkashC;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$AkashD;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$AkashE;,
Step 9 : Last step : search left code in your public.xml , search right text in your PhoneStatusBar.smali replace id with your value...
Code:
quickpanel_slider_ringer_volume ----- 0x7f0c00ec
quickpanel_slider_notification_volume ------ 0x7f0c00ed
quickpanel_slider_voice_call_volume ------ 0x7f0c00ee
quickpanel_slider_media_volume ------ 0x7f0c00ef
quickpanel_slider_alarm_volume ------ 0x7f0c00f0
Note : dont confuse with string type ie
wrong
Code:
<public type="string" name="quickpanel_slider_ringer_volume_text" id="0x7f0900d5" />
right
Code:
<public type="id" name="quickpanel_slider_ringer_volume" id="0x7f0c00ec" />
Step 10 : Actual last step, Compile push/flash/whateva
FAQ :
Actually brother,
I need some help. I have added the files given by XDA.gm. As Adi Sir told me to follow that thread. So.
No I got the everything working but the slider I got not seem to be working properly. Sorry but before you posted your guide I already started working on it.
Now please help me with the sliders and all.
""Hitting Thanks Don't Cost You Anything, then, Why You All Are Getting Bothered in Doing So. Hitting Thanks Increases My Motivation to Work for this Community....""
BOND1987 said:
Actually brother,
I need some help. I have added the files given by XDA.gm. As Adi Sir told me to follow that thread. So.
No I got the everything working but the slider I got not seem to be working properly. Sorry but before you posted your guide I already started working on it.
Now please help me with the sliders and all.
View attachment 2157379
""Hitting Thanks Don't Cost You Anything, then, Why You All Are Getting Bothered in Doing So. Hitting Thanks Increases My Motivation to Work for this Community....""
Click to expand...
Click to collapse
for sliders you need to fix ids i guess.. i will check once...
woah, i just fried my psu and wasnt able to use my pc for more than a day then when i get back i see you guys doing a lot of stuff already,,,, great work guys. up:good::good::good:
Bro , do u have any solution to this ------>
Code:
C:\Apktool_JB>apktool b SystemUI_og
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
[COLOR="Red"]C:\Apktool_JB\SystemUI_og\res\layout\quickpanel_quick_settings_space.xml:9: erro
r: Error parsing XML: mismatched tag[/COLOR]
aapt: warning: string 'data_connection_datach_timeout_error_msg' has no default
translation in C:\Apktool_JB\SystemUI_og\res; found: de es fr in it ms pt tr vi
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.Androl
ibException: brut.common.BrutException: could not exec command: [aapt, p, --min-
sdk-version, 16, --target-sdk-version, 16, -F, C:\Users\AKHILE~1\AppData\Local\T
emp\APKTOOL6259043626794892065.tmp, -I, C:\Users\Akhilendra\apktool\framework\1.
apk, -S, C:\Apktool_JB\SystemUI_og\res, -M, C:\Apktool_JB\SystemUI_og\AndroidMan
ifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:355)
at brut.androlib.Androlib.buildResources(Androlib.java:280)
at brut.androlib.Androlib.build(Androlib.java:203)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:214)
at brut.apktool.Main.main(Main.java:74)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not
exec command: [aapt, p, --min-sdk-version, 16, --target-sdk-version, 16, -F, C:
\Users\AKHILE~1\AppData\Local\Temp\APKTOOL6259043626794892065.tmp, -I, C:\Users\
Akhilendra\apktool\framework\1.apk, -S, C:\Apktool_JB\SystemUI_og\res, -M, C:\Ap
ktool_JB\SystemUI_og\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:335)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:333)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sd
k-version, 16, --target-sdk-version, 16, -F, C:\Users\AKHILE~1\AppData\Local\Tem
p\APKTOOL6259043626794892065.tmp, -I, C:\Users\Akhilendra\apktool\framework\1.ap
k, -S, C:\Apktool_JB\SystemUI_og\res, -M, C:\Apktool_JB\SystemUI_og\AndroidManif
est.xml]
at brut.util.OS.exec(OS.java:89)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:333)
... 6 more
in quickpanel_quick_settigns.xml it gives an error saying mismatched tag. I am not able to compile your mod with bsuhas's quickpanel code. I tried before in my mod but it didn't work around there too...
BOND1987 said:
Actually brother,
I need some help. I have added the files given by XDA.gm. As Adi Sir told me to follow that thread. So.
No I got the everything working but the slider I got not seem to be working properly. Sorry but before you posted your guide I already started working on it.
Now please help me with the sliders and all.
View attachment 2157379
""Hitting Thanks Don't Cost You Anything, then, Why You All Are Getting Bothered in Doing So. Hitting Thanks Increases My Motivation to Work for this Community....""
Click to expand...
Click to collapse
or may be, there's additional smalis for that,.,.
find additional PhoneStatusBar$xx.smali for that, or / and compare the PhoneStatusBar.smali with XDA.AGM's
Sir,
Your suggestions always help me a lot. Although it takes time but I always get through with good great results.
I'll try this also now.
Edit:- @Akhilendra1711,
Wait buddy,
I'm gonna post a guide for those who already have applied lidroid and 4.2 and want to get these layouts. It will be on this thread only.
""Hitting Thanks Don't Cost You Anything, then, Why You All Are Getting Bothered in Doing So. Hitting Thanks Increases My Motivation to Work for this Community....""
find
Code:
Code:
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="2.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
add this code above it..
Code:
Code:
</com.android.systemui.statusbar.StatusBarServiceLRPull>
corrected now...
Akash Bro I got it after some try.... the setting button doesn't work but the 4.2 button works
and no buttons and clock on 4.2 statubar full black
Edit : I have done till part 1 only and i have already done with lidroid so i have follow part 2 from step 5 only i think so.....
i attach screenshot take a look
khan_frd2002 said:
Akash Bro I got it after some try.... the setting button doesn't work but the 4.2 button works
and no buttons and clock on 4.2 statubar full black
Edit : I have done till part 1 only and i have already done with lidroid so i have follow part 2 from step 5 only i think so.....
i attach screenshot take a look
Click to expand...
Click to collapse
yup follow from step 5 but, replace old files, and re edit ids....
im checking as you should get clock in view....
Akhilendra1711 said:
Bro , do u have any solution to this ------>
in quickpanel_quick_settigns.xml it gives an error saying mismatched tag. I am not able to compile your mod with bsuhas's quickpanel code. I tried before in my mod but it didn't work around there too...
Click to expand...
Click to collapse
Akhilendra Bro You have Get mismatched tag In quickpanel_quick_settigns.xml Because there i a space before <LinearLayout Line 7
khan_frd2002 said:
Akash Bro I got it after some try.... the setting button doesn't work but the 4.2 button works
and no buttons and clock on 4.2 statubar full black
Edit : I have done till part 1 only and i have already done with lidroid so i have follow part 2 from step 5 only i think so.....
i attach screenshot take a look
Click to expand...
Click to collapse
ohh.. i missed small step bro... thanks for your replay... updating thread...
khan_frd2002 said:
Akhilendra Bro You have Get mismatched tag In quickpanel_quick_settigns.xml Because there i a space before <LinearLayout Line 7
Click to expand...
Click to collapse
Bro I adjusted the space too . But still it said mismatch tag.
Sent from my Micromax A110 using XDA Premium HD app
khan_frd2002 said:
Akhilendra Bro You have Get mismatched tag In quickpanel_quick_settigns.xml Because there i a space before <LinearLayout Line 7
Click to expand...
Click to collapse
bro check now :
Delete this line :
Code:
<include android:layout_width="fill_parent" android:layout_height="@dimen/notification_panel_header_height" layout="@layout/status_bar_expanded_header" />
find
Code:
<FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/close_handle_underlap">
add this line above it..
Code:
<com.spacecaker.SpaceLayOut android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
<include layout="@layout/quickpanel_quick_settings_space" />
</LinearLayout>
find, this
Code:
<ScrollView android:id="@id/scroll" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginTop="115.0dip" android:layout_marginBottom="8.0dip" android:overScrollMode="ifContentScrolls">
<com.android.systemui.statusbar.policy.NotificationRowLayout android:layout_gravity="bottom" android:id="@id/latestItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/notification_row_min_height" />
</ScrollView>
</FrameLayout>
add this lines below it
Code:
</com.spacecaker.SpaceLayOut>
find :
Code:
<com.spacecaker.SpaceLayOut android:layout_width="fill_parent"
add this above it :
Code:
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/close_handle_underlap">
<include android:layout_width="fill_parent" android:layout_height="@dimen/notification_panel_header_height" layout="@layout/status_bar_expanded_header" />
</LinearLayout>
also download new files n replace quick_settings_space with new file...
Akhilendra1711 said:
Bro I adjusted the space too . But still it said mismatch tag.
Sent from my Micromax A110 using XDA Premium HD app
Click to expand...
Click to collapse
give me that xml...
Akhilendra1711 said:
Bro I adjusted the space too . But still it said mismatch tag.
Sent from my Micromax A110 using XDA Premium HD app
Click to expand...
Click to collapse
Ok brother,
Upload your quickspace. Xml.
We will look into it and can answer better.
Had any one got the sliders working.
Coz I've done every thing, corrected all id's but still same.
""Hitting Thanks Don't Cost You Anything, then, Why You All Are Getting Bothered in Doing So. Hitting Thanks Increases My Motivation to Work for this Community....""
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
In this guide , I will tell "How to add Battery Bar" option in Settings.
Tested this option on Android 4.2 and 4.4
REQUIREMENTS :
1. Brain
2. Apktool
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 "battery_bar_prefs" 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/battery_bar_title" android:key="battery_bar" android:summary="@string/battery_bar_summary" android:fragment="com.android.settings.gurpreet.batterybar.BatteryBarStyle" />
3. Now open strings.xml and add these lines above </resources>.
PHP:
<string name="battery_bar_title">Battery Bar</string>
<string name="battery_bar_summary">Enable the battery bar option in statusbar</string>
<string name="battery_bar">Battery bar location</string>
<string name="battery_bar_color">Battery bar color</string>
<string name="battery_bar_cat">Battery bar style</string>
<string name="battery_bar_style_title">Battery bar alignment</string>
<string name="battery_bar_thickness_title">Battery bar thickness</string>
<string name="battery_bar_animate_title">Charging animation</string>
<string name="battery_bar_animate_summary">The charging animation may result in a poor user experience. Enable at your own discretion.</string>
4. Now open array.xml and add these lines above </resources>.
PHP:
<string-array name="battery_bar_entries">
<item>Hide</item>
<item>Statusbar</item>
<item>Top of navbar</item>
<item>Bottom of navbar</item>
</string-array>
<string-array name="battery_bar_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
</string-array>
<string-array name="battery_bar_style_entries">
<item>Regular</item>
<item>Center-mirrored</item>
</string-array>
<string-array name="battery_bar_style_values">
<item>0</item>
<item>1</item>
</string-array>
<string-array name="battery_bar_thickness_entries">
<item>1 dp</item>
<item>2 dp</item>
<item>3 dp</item>
<item>4 dp</item>
</string-array>
<string-array name="battery_bar_thickness_values">
<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 BatteryBarStyle.smali and replace the ids with the ids present in public.xml of your Settings.apk
0x7f06005e
PHP:
<public type="xml" name="battery_bar_prefs"
0x7f020103
PHP:
<public type="drawable" name="ic_settings_batterybar"
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. Now Find these lines ,
PHP:
</com.android.systemui.statusbar.phone.TickerView>
</LinearLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
Now add this line between the above lines like this ,
PHP:
<com.android.systemui.statusbar.policy.BatteryBarController android:layout_width="fill_parent" android:layout_height="1.0dip" systemui:viewLocation="1" />
The final will look like this ,
PHP:
</com.android.systemui.statusbar.phone.TickerView>
</LinearLayout>
<com.android.systemui.statusbar.policy.BatteryBarController android:layout_width="fill_parent" android:layout_height="1.0dip" systemui:viewLocation="1" />
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
3. Now go to SystemUI.apk\res\layout\navigation_bar.xml and open it. Find this line ,
PHP:
<FrameLayout android:id="@id/rot0" android:layout_width="fill_parent" android:layout_height="fill_parent">
Now add these lines below the above line ,
PHP:
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentTop="true" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentBottom="true" systemui:viewLocation="3" />
</RelativeLayout>
The final will look like this ,
PHP:
<FrameLayout android:id="@id/rot0" android:layout_width="fill_parent" android:layout_height="fill_parent">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentTop="true" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentBottom="true" systemui:viewLocation="3" />
</RelativeLayout>
Now again find this line ,
PHP:
<FrameLayout android:id="@id/rot90" android:paddingTop="0.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="fill_parent">
Now add these lines below the above line ,
PHP:
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:orientation="vertical" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentLeft="true" android:rotation="180.0" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:orientation="vertical" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true" android:rotation="180.0" systemui:viewLocation="3" />
</RelativeLayout>
The final will look like this ,
PHP:
<FrameLayout android:id="@id/rot90" android:paddingTop="0.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="fill_parent">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:orientation="vertical" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentLeft="true" android:rotation="180.0" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:orientation="vertical" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true" android:rotation="180.0" systemui:viewLocation="3" />
</RelativeLayout>
Do this same with all navigation_bar.xml present in other layout folders.
4. Now go to SystemUI.apk\res\values\attrs.xml and open it. Now add this above </resources>.
PHP:
<attr name="viewLocation" format="integer" />
5. Now go to smali\com\android\systemui\statusbar\policy\Prefs.smali and open that. Then find this method ,
HTML:
.method public static edit(Landroid/content/Context;)Landroid/content/SharedPreferences$Editor;
Now add this method below the above method ,
HTML:
.method public static getLastBatteryLevel(Landroid/content/Context;)I
.locals 3
.param p0, "context" # Landroid/content/Context;
.prologue
.line 48
invoke-static {p0}, Lcom/android/systemui/statusbar/policy/Prefs;->read(Landroid/content/Context;)Landroid/content/SharedPreferences;
move-result-object v0
const-string v1, "last_battery_level"
const/16 v2, 0x32
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I
move-result v0
return v0
.end method
Now again find this method ,
HTML:
.method public static read(Landroid/content/Context;)Landroid/content/SharedPreferences;
Now add this method below the above method ,
HTML:
.method public static setLastBatteryLevel(Landroid/content/Context;I)V
.locals 2
.param p0, "context" # Landroid/content/Context;
.param p1, "level" # I
.prologue
.line 44
invoke-static {p0}, Lcom/android/systemui/statusbar/policy/Prefs;->edit(Landroid/content/Context;)Landroid/content/SharedPreferences$Editor;
move-result-object v0
const-string v1, "last_battery_level"
invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;
move-result-object v0
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z
.line 45
return-void
.end method
6. Now go to smali\com\android\systemui\R$styleable.smali and open that. Then find this line ,
HTML:
# static fields
Now add this line below the above line ,
HTML:
.field public static final BatteryBarController:[I
Now again find these lines ,
HTML:
.method static constructor <clinit>()V
.locals 4
.prologue
const/4 v3, 0x1
const/4 v2, 0x0
Now add these lines below this "const/4 v2, 0x0" line ,
HTML:
new-array v0, v3, [I
const v1, 0x7f01000c
aput v1, v0, v2
sput-object v0, Lcom/android/systemui/R$styleable;->BatteryBarController:[I
The final will look like this ,
HTML:
.method static constructor <clinit>()V
.locals 4
.prologue
const/4 v3, 0x1
const/4 v2, 0x0
new-array v0, v3, [I
const v1, 0x7f01000c
aput v1, v0, v2
sput-object v0, Lcom/android/systemui/R$styleable;->BatteryBarController:[I
7. Now Recompile your SystemUI.apk , sign it and again Decompile it.
8. Now open R$styleable.smali and replace the id with the id present in public.xml of your SystemUI.apk
0x7f01000c
PHP:
<public type="attr" name="viewLocation"
Special Thanks To :
1. DU_Flo ROM (Extracted from this ROM)
2. MAAaD
3. XDA
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"
}
very nice bro . i am going to add .
Great work :good: already added in my rom
for ldpi devices,should we change the hdpi folder in the zip file to ldpi or we should leave it as it is?
05Gurpreet said:
In this guide , I will tell "How to add Battery Bar" option in Settings.
Tested this option on Android 4.2 and 4.4
REQUIREMENTS :
1. Brain
2. Apktool
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 "battery_bar_prefs" 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 and then try this guide.
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/battery_bar_title" android:key="battery_bar" android:summary="@string/battery_bar_summary" android:fragment="com.android.settings.gurpreet.batterybar.BatteryBarStyle" />
3. Now open strings.xml and add these lines above </resources>.
PHP:
<string name="battery_bar_title">Battery Bar</string>
<string name="battery_bar_summary">Enable the battery bar option in statusbar</string>
<string name="battery_bar">Battery bar location</string>
<string name="battery_bar_color">Battery bar color</string>
<string name="battery_bar_cat">Battery bar style</string>
<string name="battery_bar_style_title">Battery bar alignment</string>
<string name="battery_bar_thickness_title">Battery bar thickness</string>
<string name="battery_bar_animate_title">Charging animation</string>
<string name="battery_bar_animate_summary">The charging animation may result in a poor user experience. Enable at your own discretion.</string>
4. Now open array.xml and add these lines above </resources>.
PHP:
<string-array name="battery_bar_entries">
<item>Hide</item>
<item>Statusbar</item>
<item>Top of navbar</item>
<item>Bottom of navbar</item>
</string-array>
<string-array name="battery_bar_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
</string-array>
<string-array name="battery_bar_style_entries">
<item>Regular</item>
<item>Center-mirrored</item>
</string-array>
<string-array name="battery_bar_style_values">
<item>0</item>
<item>1</item>
</string-array>
<string-array name="battery_bar_thickness_entries">
<item>1 dp</item>
<item>2 dp</item>
<item>3 dp</item>
<item>4 dp</item>
</string-array>
<string-array name="battery_bar_thickness_values">
<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 BatteryBarStyle.smali and replace the ids with the ids present in public.xml of your Settings.apk
0x7f06005e
PHP:
<public type="xml" name="battery_bar_prefs"
0x7f020103
PHP:
<public type="drawable" name="ic_settings_batterybar"
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. Now Find these lines ,
PHP:
</com.android.systemui.statusbar.phone.TickerView>
</LinearLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
Now add this line between the above lines like this ,
PHP:
<com.android.systemui.statusbar.policy.BatteryBarController android:layout_width="fill_parent" android:layout_height="1.0dip" systemui:viewLocation="1" />
The final will look like this ,
PHP:
</com.android.systemui.statusbar.phone.TickerView>
</LinearLayout>
<com.android.systemui.statusbar.policy.BatteryBarController android:layout_width="fill_parent" android:layout_height="1.0dip" systemui:viewLocation="1" />
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
3. Now go to SystemUI.apk\res\layout\navigation_bar.xml and open it. Find this line ,
PHP:
<FrameLayout android:id="@id/rot0" android:layout_width="fill_parent" android:layout_height="fill_parent">
Now add these lines below the above line ,
PHP:
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentTop="true" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentBottom="true" systemui:viewLocation="3" />
</RelativeLayout>
The final will look like this ,
PHP:
<FrameLayout android:id="@id/rot0" android:layout_width="fill_parent" android:layout_height="fill_parent">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentTop="true" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentBottom="true" systemui:viewLocation="3" />
</RelativeLayout>
Now again find this line ,
PHP:
<FrameLayout android:id="@id/rot90" android:paddingTop="0.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="fill_parent">
Now add these lines below the above line ,
PHP:
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:orientation="vertical" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentLeft="true" android:rotation="180.0" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:orientation="vertical" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true" android:rotation="180.0" systemui:viewLocation="3" />
</RelativeLayout>
The final will look like this ,
PHP:
<FrameLayout android:id="@id/rot90" android:paddingTop="0.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="fill_parent">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:orientation="vertical" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentLeft="true" android:rotation="180.0" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:orientation="vertical" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true" android:rotation="180.0" systemui:viewLocation="3" />
</RelativeLayout>
Do this same with all navigation_bar.xml present in other layout folders.
4. Now go to SystemUI.apk\res\values\attrs.xml and open it. Now add this above </resources>.
PHP:
<attr name="viewLocation" format="integer" />
5. Now go to smali\com\android\systemui\statusbar\policy\Prefs.smali and open that. Then find this method ,
HTML:
.method public static edit(Landroid/content/Context;)Landroid/content/SharedPreferences$Editor;
Now add this method below the above method ,
HTML:
.method public static getLastBatteryLevel(Landroid/content/Context;)I
.locals 3
.param p0, "context" # Landroid/content/Context;
.prologue
.line 48
invoke-static {p0}, Lcom/android/systemui/statusbar/policy/Prefs;->read(Landroid/content/Context;)Landroid/content/SharedPreferences;
move-result-object v0
const-string v1, "last_battery_level"
const/16 v2, 0x32
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I
move-result v0
return v0
.end method
Now again find this method ,
HTML:
.method public static read(Landroid/content/Context;)Landroid/content/SharedPreferences;
Now add this method below the above method ,
HTML:
.method public static setLastBatteryLevel(Landroid/content/Context;I)V
.locals 2
.param p0, "context" # Landroid/content/Context;
.param p1, "level" # I
.prologue
.line 44
invoke-static {p0}, Lcom/android/systemui/statusbar/policy/Prefs;->edit(Landroid/content/Context;)Landroid/content/SharedPreferences$Editor;
move-result-object v0
const-string v1, "last_battery_level"
invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;
move-result-object v0
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z
.line 45
return-void
.end method
6. Now go to smali\com\android\systemui\R$styleable.smali and open that. Then find this line ,
HTML:
# static fields
Now add this line below the above line ,
HTML:
.field public static final BatteryBarController:[I
Now again find these lines ,
HTML:
.method static constructor <clinit>()V
.locals 4
.prologue
const/4 v3, 0x1
const/4 v2, 0x0
Now add these lines below this "const/4 v2, 0x0" line ,
HTML:
new-array v0, v3, [I
const v1, 0x7f01000c
aput v1, v0, v2
sput-object v0, Lcom/android/systemui/R$styleable;->BatteryBarController:[I
The final will look like this ,
HTML:
.method static constructor <clinit>()V
.locals 4
.prologue
const/4 v3, 0x1
const/4 v2, 0x0
new-array v0, v3, [I
const v1, 0x7f01000c
aput v1, v0, v2
sput-object v0, Lcom/android/systemui/R$styleable;->BatteryBarController:[I
7. Now Recompile your SystemUI.apk , sign it and again Decompile it.
8. Now open R$styleable.smali and replace the id with the id present in public.xml of your SystemUI.apk
0x7f01000c
PHP:
<public type="attr" name="viewLocation"
Special Thanks To :
1. DU_Flo ROM (Extracted from this ROM)
2. MAAaD
3. XDA
Click to expand...
Click to collapse
Awesome Guide Gurpreet Bro!! I request you to please make threads of all your awesom guides! Your all guides are just amazing!!
Regards @dark_optimistic
Vipul Jha
Awesome Guide Bro Thanks
Droidbuster said:
very nice bro . i am going to add .
Click to expand...
Click to collapse
Thanks Brother
itsraj011 said:
Great work :good: already added in my rom
Click to expand...
Click to collapse
Thanks
qromwel said:
for ldpi devices,should we change the hdpi folder in the zip file to ldpi or we should leave it as it is?
Click to expand...
Click to collapse
You have to rezsize the png to Idpi , then add that in drawable-Idpi folder.
dark_optimistic said:
Awesome Guide Gurpreet Bro!! I request you to please make threads of all your awesom guides! Your all guides are just amazing!!
Regards @dark_optimistic
Vipul Jha
Click to expand...
Click to collapse
Thanks brother. About guides , I will try my best.
Rohit Gupta @123 said:
Awesome Guide Bro Thanks
Click to expand...
Click to collapse
Welcome brother.
05Gurpreet said:
Thanks brother. About guides , I will try my best.
Click to expand...
Click to collapse
Thanks bro!! Please post as soon as possible!
I don't have Prefs.smali in SystemUI\smali\com\android\systemui\statusbar\policy on CM11 = SystemUI FC
05Gurpreet said:
In this guide , I will tell "How to add Battery Bar" option in Settings.
Tested this option on Android 4.2 and 4.4
REQUIREMENTS :
1. Brain
2. Apktool
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 "battery_bar_prefs" 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/battery_bar_title" android:key="battery_bar" android:summary="@string/battery_bar_summary" android:fragment="com.android.settings.gurpreet.batterybar.BatteryBarStyle" />
3. Now open strings.xml and add these lines above </resources>.
PHP:
<string name="battery_bar_title">Battery Bar</string>
<string name="battery_bar_summary">Enable the battery bar option in statusbar</string>
<string name="battery_bar">Battery bar location</string>
<string name="battery_bar_color">Battery bar color</string>
<string name="battery_bar_cat">Battery bar style</string>
<string name="battery_bar_style_title">Battery bar alignment</string>
<string name="battery_bar_thickness_title">Battery bar thickness</string>
<string name="battery_bar_animate_title">Charging animation</string>
<string name="battery_bar_animate_summary">The charging animation may result in a poor user experience. Enable at your own discretion.</string>
4. Now open array.xml and add these lines above </resources>.
PHP:
<string-array name="battery_bar_entries">
<item>Hide</item>
<item>Statusbar</item>
<item>Top of navbar</item>
<item>Bottom of navbar</item>
</string-array>
<string-array name="battery_bar_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
</string-array>
<string-array name="battery_bar_style_entries">
<item>Regular</item>
<item>Center-mirrored</item>
</string-array>
<string-array name="battery_bar_style_values">
<item>0</item>
<item>1</item>
</string-array>
<string-array name="battery_bar_thickness_entries">
<item>1 dp</item>
<item>2 dp</item>
<item>3 dp</item>
<item>4 dp</item>
</string-array>
<string-array name="battery_bar_thickness_values">
<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 BatteryBarStyle.smali and replace the ids with the ids present in public.xml of your Settings.apk
0x7f06005e
PHP:
<public type="xml" name="battery_bar_prefs"
0x7f020103
PHP:
<public type="drawable" name="ic_settings_batterybar"
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. Now Find these lines ,
PHP:
</com.android.systemui.statusbar.phone.TickerView>
</LinearLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
Now add this line between the above lines like this ,
PHP:
<com.android.systemui.statusbar.policy.BatteryBarController android:layout_width="fill_parent" android:layout_height="1.0dip" systemui:viewLocation="1" />
The final will look like this ,
PHP:
</com.android.systemui.statusbar.phone.TickerView>
</LinearLayout>
<com.android.systemui.statusbar.policy.BatteryBarController android:layout_width="fill_parent" android:layout_height="1.0dip" systemui:viewLocation="1" />
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
3. Now go to SystemUI.apk\res\layout\navigation_bar.xml and open it. Find this line ,
PHP:
<FrameLayout android:id="@id/rot0" android:layout_width="fill_parent" android:layout_height="fill_parent">
Now add these lines below the above line ,
PHP:
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentTop="true" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentBottom="true" systemui:viewLocation="3" />
</RelativeLayout>
The final will look like this ,
PHP:
<FrameLayout android:id="@id/rot0" android:layout_width="fill_parent" android:layout_height="fill_parent">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentTop="true" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentBottom="true" systemui:viewLocation="3" />
</RelativeLayout>
Now again find this line ,
PHP:
<FrameLayout android:id="@id/rot90" android:paddingTop="0.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="fill_parent">
Now add these lines below the above line ,
PHP:
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:orientation="vertical" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentLeft="true" android:rotation="180.0" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:orientation="vertical" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true" android:rotation="180.0" systemui:viewLocation="3" />
</RelativeLayout>
The final will look like this ,
PHP:
<FrameLayout android:id="@id/rot90" android:paddingTop="0.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="fill_parent">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.BatteryBarController android:orientation="vertical" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentLeft="true" android:rotation="180.0" systemui:viewLocation="2" />
<com.android.systemui.statusbar.policy.BatteryBarController android:orientation="vertical" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true" android:rotation="180.0" systemui:viewLocation="3" />
</RelativeLayout>
Do this same with all navigation_bar.xml present in other layout folders.
4. Now go to SystemUI.apk\res\values\attrs.xml and open it. Now add this above </resources>.
PHP:
<attr name="viewLocation" format="integer" />
5. Now go to smali\com\android\systemui\statusbar\policy\Prefs.smali and open that. Then find this method ,
HTML:
.method public static edit(Landroid/content/Context;)Landroid/content/SharedPreferences$Editor;
Now add this method below the above method ,
HTML:
.method public static getLastBatteryLevel(Landroid/content/Context;)I
.locals 3
.param p0, "context" # Landroid/content/Context;
.prologue
.line 48
invoke-static {p0}, Lcom/android/systemui/statusbar/policy/Prefs;->read(Landroid/content/Context;)Landroid/content/SharedPreferences;
move-result-object v0
const-string v1, "last_battery_level"
const/16 v2, 0x32
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I
move-result v0
return v0
.end method
Now again find this method ,
HTML:
.method public static read(Landroid/content/Context;)Landroid/content/SharedPreferences;
Now add this method below the above method ,
HTML:
.method public static setLastBatteryLevel(Landroid/content/Context;I)V
.locals 2
.param p0, "context" # Landroid/content/Context;
.param p1, "level" # I
.prologue
.line 44
invoke-static {p0}, Lcom/android/systemui/statusbar/policy/Prefs;->edit(Landroid/content/Context;)Landroid/content/SharedPreferences$Editor;
move-result-object v0
const-string v1, "last_battery_level"
invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;
move-result-object v0
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z
.line 45
return-void
.end method
6. Now go to smali\com\android\systemui\R$styleable.smali and open that. Then find this line ,
HTML:
# static fields
Now add this line below the above line ,
HTML:
.field public static final BatteryBarController:[I
Now again find these lines ,
HTML:
.method static constructor <clinit>()V
.locals 4
.prologue
const/4 v3, 0x1
const/4 v2, 0x0
Now add these lines below this "const/4 v2, 0x0" line ,
HTML:
new-array v0, v3, [I
const v1, 0x7f01000c
aput v1, v0, v2
sput-object v0, Lcom/android/systemui/R$styleable;->BatteryBarController:[I
The final will look like this ,
HTML:
.method static constructor <clinit>()V
.locals 4
.prologue
const/4 v3, 0x1
const/4 v2, 0x0
new-array v0, v3, [I
const v1, 0x7f01000c
aput v1, v0, v2
sput-object v0, Lcom/android/systemui/R$styleable;->BatteryBarController:[I
7. Now Recompile your SystemUI.apk , sign it and again Decompile it.
8. Now open R$styleable.smali and replace the id with the id present in public.xml of your SystemUI.apk
0x7f01000c
PHP:
<public type="attr" name="viewLocation"
Special Thanks To :
1. DU_Flo ROM (Extracted from this ROM)
2. MAAaD
3. XDA
Click to expand...
Click to collapse
In top & bottom of nav bars not working..