[MOD]Quickpanel toggle button at bottom - Samsung Galaxy SL i9003

here is a mod in which quick panel settings button are at bottom
DOWNLOAD LINK
http://www.mediafire.com/?r0ml74kqjc6fc8a

For any rom ???

Nice work bro... does it has 14 toggle icon. or just the stock.

Nice work brother

great job working KPQ stock

Can you tell me how to locate quickpanel at bottom?
want to use for any rom..
thx man

have 14 toggle button???

HOW?
How did You do this? Instructions!!!!?

How to install ?
Sent from my GT-I9003 using xda premium

The "how to..."
I have Xperia Mini and I did bottom quickpanel in the following way (this info for experts - if You don't understand these infos then You probably can't done with success):
Edit StatusBarService.smali in SystemUI.apk - at the end of makeExpandedVisible() method (at line #778 in my case) I changed code to this:
const v6, 0x7f030007
invoke-static {p1, v6, v9}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroupLandroid/view/View;
move-result-object v5
check-cast v5, Lcom/lidroid/systemui/quickpanel/PowerWidget;
.local v5, qsv:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v5}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mCloseView:Lcom/android/systemui/statusbar/CloseDragHandle;
invoke-virtual {v6, v5, v11}, Lcom/android/systemui/statusbar/CloseDragHandle;->addView(Landroid/view/View;I)V
const v6, 0x7f030009
invoke-static {p1, v6, v9}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroupLandroid/view/View;
move-result-object v5
check-cast v5, Lcom/android/systemui/statusbar/quickpanel/BrightnessSettingsView;
.local v5, brs:Lcom/android/systemui/statusbar/quickpanel/BrightnessSettingsView;
invoke-virtual {v5}, Lcom/android/systemui/statusbar/quickpanel/BrightnessSettingsView;->init()V
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mCloseView:Lcom/android/systemui/statusbar/CloseDragHandle;
const/4 v11, 0x1
invoke-virtual {v6, v5, v11}, Lcom/android/systemui/statusbar/CloseDragHandle;->addView(Landroid/view/View;I)V
return-void
Click to expand...
Click to collapse
In original code was mExpandedView & ExpandedView instead of mCloseView & CloseDragHandle.
I spent a half day to figure out WHAT to modify (I did never edited smali before) but worth it! :victory:

Nice
nice one sir :good:

good jobe

Related

[MOD] [GUIDE] AOSP LockScreen with Toggle

Okay, since it seems like I only get about 3 people who actually want to download and use my ROM (actually its more like 4....LOL) I will just try to contribute by releasing some more "How-Too's" for those DEVs who want to use them.
As always feel free to use these MODs with your ROM but since it took a few days to get this coded correctly just give me some thanks and some credit in your thread please.
[Q] What does this MOD do?
[A] It allows you to toggle between TW lock screen or AOSP lock screen.
*****EDIT******
If you experience your lock screen freezing when you turn it to landscape mode, just go to lockscreen options and make sure all settings are UNTICKED......except for AOSP lockscreen that is .
Thanks to jdub251 for the feedback.
Here are the goodies.....
We will be working in two files.
-SecSettings
-android.policy
As always, I will assume you know how to compile/decompile so I will not be providing information how to do that.
Lets begin with the easiest file, Android.policy.jar
Navigate to smali/com/android/internal/policy/imp/LockPatternKeyguardView
Find the following code
Code:
.method createLockScreen()Landroid/view/View;
We are going to replace the whole method with the following code.
Code:
.method createLockScreen()Landroid/view/View;
.locals 6
.prologue
.line 1268
const/4 v0, 0x0
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
invoke-virtual {v5}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v5
const-string v4, "enable_aosp_lock"
invoke-static {v5, v4, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v5
if-nez v5, :cond_0
.line 1044
new-instance v0, Lcom/android/internal/policy/impl/sec/CircleLockScreen;
iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/sec/CircleLockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V
.line 1274
.local v0, lockView:Landroid/view/View;
:goto_0
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->initializeTransportControlView(Landroid/view/View;)V
.line 1275
return-object v0
:cond_0
new-instance v0, Lcom/android/internal/policy/impl/LockScreen;
iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/LockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V
.line 1274
goto :goto_0
.end method
Thats it for android.policy.jar. Recompile and push to /system/app. If you want to Diff out the exact changes feel free.
Now for SecSettings.
Navigate to res/values/strings
Add the following lines somewhere in this file. In the middle or end, it doesnt matter.
Code:
<string name="enable_aosp_lock">Enable AOSP lockscreen</string>
<string name="enable_aosp_lock_text">Enable AOSP lockscreen in place of circle lockscreen</string>
Navigate to res/xml/Lockscreen_Settings.xml
Add the following line below in RED.
Code:
<PreferenceCategory android:title="@string/display_settings" />
[COLOR="red"]<CheckBoxPreference android:title="@string/enable_aosp_lock" android:key="enable_aosp_lock" android:summary="@string/enable_aosp_lock_text" />
[/COLOR] <SwitchPreferenceScreen android:title="@string/lock_screen_shortcut_title" android:key="lock_screen_shortcut" android:summary="@string/lock_screen_shortcut_summary">
Now lets hit some smali.....
Still in SecSettings, lets navigate to smali/com/android/settings/LockScreenSettings
Find the following code
Code:
.field private mWeather:Landroid/preference/SwitchPreferenceScreen;
Add this line below it
Code:
.field private mAospLock:Landroid/preference/CheckBoxPreference;
Find the following code and add the parts in RED
Code:
.method private updateState()V
.locals 9
.prologue
const/4 v5, 0x1
const/4 v6, 0x0
.line 263
[COLOR="Red"]iget-object v7, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v8, "enable_aosp_lock"
invoke-static {v4, v8, v6}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
if-eqz v4, :cond_7
move v4, v5
invoke-virtual {v7, v4}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 265
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
[/COLOR]
iget-object v7, p0, Lcom/android/settings/LockScreenSettings;->mClock:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v8, "show_clock"
Find the following code and add the parts in RED
Code:
iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mClock:Landroid/preference/CheckBoxPreference;
const/4 v10, 0x0
invoke-virtual {v9, v10}, Landroid/preference/CheckBoxPreference;->setPersistent(Z)V
[COLOR="red"]const-string v9, "enable_aosp_lock"
invoke-virtual {p0, v9}, Lcom/android/settings/LockScreenSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v9
check-cast v9, Landroid/preference/CheckBoxPreference;
iput-object v9, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
.line 159
iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
const/4 v10, 0x0
invoke-virtual {v9, v10}, Landroid/preference/CheckBoxPreference;->setPersistent(Z)V
[/COLOR]
.line 161
const-string v9, "weather"
invoke-virtual {p0, v9}, Lcom/android/settings/LockScreenSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v9
Find the following code and add the parts in RED
Code:
:cond_9
iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, [COLOR="red"]:cond_b
[/COLOR]
.line 338
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v5, "wake_up_lock_screen"
iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;
invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v6
if-eqz v6, :cond_a
Find the following code and add the parts in RED
Code:
invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1
:cond_a
move v2, v3
goto :goto_5
[COLOR="red"]:cond_b
iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_0
.line 313
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v5, "enable_aosp_lock"
iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v6
if-eqz v6, :cond_c
:goto_6
invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
.line 314
invoke-direct {p0}, Lcom/android/settings/LockScreenSettings;->updateState()V
.line 340
invoke-super {p0, p1, p2}, Lcom/android/settings/SettingsPreferenceFragment;->onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
move-result v2
return v2
:cond_c
move v2, v3
.line 313
goto :goto_6
[/COLOR]
.line 337
.end method
.method public onResume()V
.locals 0
.prologue
.line 257
invoke-super {p0}, Lcom/android/settings/SettingsPreferenceFragment;->onResume()V
.line 258
invoke-direct {p0}, Lcom/android/settings/LockScreenSettings;->updateState()V
Thats it! Recompile and push to /system/app
You will find your new toggle in lockscreen options.
Enjoy!
The newest version for BLK3 has a few other mods included in it as well. See the installer screen when installing for specifics. This is meant for Stock Deodexed RoMs.If your using a custom ROM this will break the theme and maybe other stuff. Enjoy.
BLK3 AOSP Lockscreen ZIP
Thanks Button!
Awesome work as always bud!!!
Seriously... always a pleasure working with you...
Sent from my SPH-L900 using Xparent ICS Tapatalk 2
Argh I thought this was the answer to my prayers, a zip file. I appreciate the tutorial but it looks Chinese to a dunce like myself. No zip file? I desperately want to keep touch wiz but want aosp lock screen to afraid I'm going to screw my phone up.
dukins said:
Argh I thought this was the answer to my prayers, a zip file. I appreciate the tutorial but it looks Chinese to a dunce like myself. No zip file? I desperately want to keep touch wiz but want aosp lock screen to afraid I'm going to screw my phone up.
Click to expand...
Click to collapse
I also wonder if it's possible to have something more semi-automatic...
Seems very complicated, especially since I flash new ROM's every few days.... Thank you so much for putting the time into such a great tutorial though!! I will definitely try it out soon, because I love the ASOP lockscreen.
Edit: one request - can you post a picture of the ASOP lockscreen we would have? Thank you!
Nightwind Hawk said:
I also wonder if it's possible to have something more semi-automatic...
Seems very complicated, especially since I flash new ROM's every few days.... Thank you so much for putting the time into such a great tutorial though!! I will definitely try it out soon, because I love the ASOP lockscreen.
Edit: one request - can you post a picture of the ASOP lockscreen we would have? Thank you!
Click to expand...
Click to collapse
This would give you AOSP lock with two extra shortcuts......Camera and Google. I am going to post up a tutorial on how to add more shortcuts soon.
Due to popular demand I am going to throw a flashable zip in the opening post. To be honest I didnt test it so nandroid first. This is my upgraded lockscreen with extra shortcuts. Let me know if this installs okay (it should). There may be some misc. other things included because I pulled this right out of my ROM. Enjoy!
Thanks Button!!
I'm gonna give it a shot.
Shh! maybe I'm just paranoid, but I think people are listening....
Just checked out your ROM. I missed it but will be giving it a shot when classes are over tomorrow for break lol
Sent from my SCH-I535 using xda app-developers app
tu3218 said:
Just checked out your ROM. I missed it but will be giving it a shot when classes are over tomorrow for break lol
Sent from my SCH-I535 using xda app-developers app
Click to expand...
Click to collapse
Thanks. I will release another soon with this MOD included.
I just flashed on clean ROM 3.5 an not seeing it in lock screen options.
Sent from my SCH-I535 using xda app-developers app
Didact74 said:
Let me know if this installs okay (it should).
Click to expand...
Click to collapse
Nothing on the flash. No option to enable
Sorry guys, it was my error. I packed the zip wrong. Thats what i get for rushing it.
Should be good now. Let me know.
Didact74 said:
Sorry guys, it was my error. I packed the zip wrong. Thats what i get for rushing it.
Should be good now. Let me know.
Click to expand...
Click to collapse
Fuggin saweeet!
EDIT:
Works perfectly on CleanROM 4.5.
Does it matter base of the ROM and if is deodexed or odexed? I'm in new leak and want to use this zip. When fixed is out of course
Sent from my SCH-I535 using xda premium
The revised zip file worked great on synergy r118. Frackin beautiful! Thanks.
Shh! maybe I'm just paranoid, but I think people are listening....
Works on Jelly Beans Build 3, but de-themes everything. Nandroid'd back, i gotta have my AOSP looks!
Works fine now. CR 4.5
dawiseguy77 said:
Does it matter base of the ROM and if is deodexed or odexed? I'm in new leak and want to use this zip. When fixed is out of course
Sent from my SCH-I535 using xda premium
Click to expand...
Click to collapse
Just needs to be a deodexed rom.
charlieg90 said:
Works on Jelly Beans Build 3, but de-themes everything. Nandroid'd back, i gotta have my AOSP looks!
Click to expand...
Click to collapse
Sorry, maybe your rom dev will pick up the mod so you can retain themes.
If you experience your lock screen freezing when you turn it to landscape mode, just go to lockscreen options and make sure all settings are UNTICKED......except for AOSP lockscreen that is .
Thanks to jdub251 for the feedback.
Glad you guys like it.
Didact74 said:
If you experience your lock screen freezing when you turn it to landscape mode, just go to lockscreen options and make sure all settings are UNTICKED......except for AOSP lockscreen that is .
Thanks to jdub251 for the feedback.
Glad you guys like it.
Click to expand...
Click to collapse
Thanks much appreciated. I havent tested it yet im in the process. If calendar events aren't included on the lockscreen is this something you could incorporate on the lock screen like cm10?
dukins said:
Thanks much appreciated. I havent tested it yet im in the process. If calendar events aren't included on the lockscreen is this something you could incorporate on the lock screen like cm10?
Click to expand...
Click to collapse
Currently working on adding calander and weather options. I will post up when I get it worked out.
Thanks

[MOD][GUIDE] IME Icon visibility w/ toggle + AOSP Lock vibration w/ toggle

Here is a couple simple MODs I worked up. The IME MOD is in my Multi-Mod and the AOSP Vibrate was something AndyBones requested a few days ago. Keep in mind most of these guides from here on out will assume you are using my ROM Control settings. Its much easier to protect from updates and much easier to edit when adding new MODs.
Lets start with SecSettings....
Navigate to res/xml/rom_settings.xml
Add the following code in RED
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/rom_settings"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings.didact">
<PreferenceCategory android:title="@string/rom_settings_section_one_title" />
<ListPreference android:persistent="true" android:entries="@array/lockscreen_entries" android:title="Choose Your LockScreen" android:key="lockscreen_type_key" android:defaultValue="1" android:entryValues="@array/lockscreen_values" />
<CheckBoxPreference android:title="@string/enable_lockscreen_torch" android:key="enable_lockscreen_torch" android:summary="@string/enable_lockscreen_torch_text" />
[COLOR="red"]<CheckBoxPreference android:title="@string/enable_aosp_vibrate" android:key="aosp_vibrate" android:summary="@string/enable_aosp_vibrate_text" />
[/COLOR] <PreferenceCategory android:title="@string/rom_settings_section_two_title" />
<ListPreference android:entries="@array/clock_style_entries" android:title="@string/clock_title_enable" android:key="clock_style" android:entryValues="@array/clock_style_values" />
<ListPreference android:entries="@array/clock_ampm_entries" android:title="@string/title_clock_ampm_entries" android:key="clock_am_pm_style" android:entryValues="@array/clock_ampm_values" />
<ListPreference android:entries="@array/clock_weekday_entries" android:title="@string/enable_clock_weekday" android:key="clock_weekday" android:summary="@string/enable_clock_weekday_summary" android:entryValues="@array/clock_weekday_values" />
<PreferenceCategory android:title="@string/rom_settings_section_three_title" />
<ListPreference android:entries="@array/battery_icon_entries" android:title="@string/battery_icon" android:key="battery_icon_list" android:entryValues="@array/battery_icon_values" />
<PreferenceCategory android:title="@string/rom_settings_section_four_title" />
[COLOR="red"]<CheckBoxPreference android:title="@string/enable_ime_icon" android:key="enable_ime_icon" android:summary="@string/enable_ime_icon_text" />
[/COLOR] <CheckBoxPreference android:persistent="false" android:title="@string/long_press_volume_title" android:key="music_control" android:summary="@string/long_press_volume_summary" />
<CheckBoxPreference android:title="@string/crtanimation_title" android:key="crtanimation_toggle" android:summary="@string/crtanimation_summary" />
</PreferenceScreen>
Navigate to res/values/strings
Add the following code
Code:
<string name="enable_ime_icon">Keyboard icon</string>
<string name="enable_ime_icon_text">Enable IME keyboard icon</string>
<string name="enable_aosp_vibrate">AOSP lockscreen vibration</string>
<string name="enable_aosp_vibrate_text">Enable lockscreen vibration</string>
Navigate to smali/com/android/settings/didact/RomSettings.smali
Add the following code in RED to the # instance Fields
Code:
# instance fields
.field mBatteryIcon:Landroid/preference/ListPreference;
.field mBatteryStyle:Landroid/preference/ListPreference;
.field mClockAmPmstyle:Landroid/preference/ListPreference;
.field mClockStyle:Landroid/preference/ListPreference;
.field mClockWeekday:Landroid/preference/ListPreference;
.field mCrtAnimationPreference:Landroid/preference/CheckBoxPreference;
[COLOR="red"].field mImeIcon:Landroid/preference/CheckBoxPreference;
[/COLOR]
.field mLockScreenStylePref:Landroid/preference/ListPreference;
.field mLockScreenTorch:Landroid/preference/CheckBoxPreference;
.field mMusicControl:Landroid/preference/CheckBoxPreference;
[COLOR="red"].field mAospLockVibration:Landroid/preference/CheckBoxPreference;
[/COLOR]
Locate .method public onCreate(Landroid/os/BundleV
Add the code in RED
Code:
const-string v5, "enable_lockscreen_torch"
invoke-static {v1, v5, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-ne v1, v2, :cond_0
move v1, v2
:goto_0
invoke-virtual {v4, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
[COLOR="red"] const-string v1, "enable_ime_icon"
invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v1
check-cast v1, Landroid/preference/CheckBoxPreference;
iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mImeIcon:Landroid/preference/CheckBoxPreference;
iget-object v4, p0, Lcom/android/settings/didact/RomSettings;->mImeIcon:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v1
invoke-virtual {v1}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v5, "enable_ime_icon"
invoke-static {v1, v5, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-ne v1, v2, :cond_1
move v1, v2
:goto_1
invoke-virtual {v4, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
[/COLOR]
const-string v1, "music_control"
invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v1
check-cast v1, Landroid/preference/CheckBoxPreference;
iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mMusicControl:Landroid/preference/CheckBoxPreference;
iget-object v4, p0, Lcom/android/settings/didact/RomSettings;->mMusicControl:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v1
invoke-virtual {v1}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v5, "music_control"
invoke-static {v1, v5, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-ne v1, v2, :cond_2
move v1, v2
:goto_2
invoke-virtual {v4, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
const-string v1, "crtanimation_toggle"
invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v1
check-cast v1, Landroid/preference/CheckBoxPreference;
iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mCrtAnimationPreference:Landroid/preference/CheckBoxPreference;
iget-object v4, p0, Lcom/android/settings/didact/RomSettings;->mCrtAnimationPreference:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v1
invoke-virtual {v1}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v5, "crtanimation_toggle"
invoke-static {v1, v5, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-ne v1, v2, :cond_3
move v1, v2
:goto_3
invoke-virtual {v4, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
[COLOR="red"]const-string v1, "aosp_vibrate"
invoke-virtual {p0, v1}, Lcom/android/settings/didact/RomSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v1
check-cast v1, Landroid/preference/CheckBoxPreference;
iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mAospLockVibration:Landroid/preference/CheckBoxPreference;
iget-object v4, p0, Lcom/android/settings/didact/RomSettings;->mAospLockVibration:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v1
invoke-virtual {v1}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v5, "aosp_vibrate"
invoke-static {v1, v5, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-ne v1, v2, :cond_4
move v1, v2
:goto_4
invoke-virtual {v4, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
[/COLOR]
return-void
:cond_0
move v1, v3
goto :goto_0
[COLOR="red"]:cond_1
move v1, v3
goto :goto_1
[/COLOR]
:cond_2
move v1, v3
goto :goto_2
:cond_3
move v1, v3
goto :goto_3
[COLOR="red"]:cond_4
move v1, v3
goto :goto_4
[/COLOR].end method
Find .method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/PreferenceZ
Add the following in RED
Code:
.locals 5
const/4 v0, 0x0
const/4 v1, 0x1
iget-object v2, p0, Lcom/android/settings/didact/RomSettings;->mLockScreenTorch:Landroid/preference/CheckBoxPreference;
[COLOR="red"]if-ne p2, v2, :cond_2
[/COLOR]
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v2
invoke-virtual {v2}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "enable_lockscreen_torch"
check-cast p2, Landroid/preference/CheckBoxPreference;
invoke-virtual {p2}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v4
if-eqz v4, :cond_0
move v0, v1
:cond_0
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
:goto_0
return v1
:cond_1
invoke-super {p0, p1, p2}, Lcom/android/settings/SettingsPreferenceFragment;->onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
move-result v1
goto :goto_0
[COLOR="red"]:cond_2
iget-object v2, p0, Lcom/android/settings/didact/RomSettings;->mImeIcon:Landroid/preference/CheckBoxPreference;
if-ne p2, v2, :cond_4
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v2
invoke-virtual {v2}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "enable_ime_icon"
check-cast p2, Landroid/preference/CheckBoxPreference;
invoke-virtual {p2}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v4
if-eqz v4, :cond_3
move v0, v1
:cond_3
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :goto_0[/COLOR]
:cond_4
iget-object v2, p0, Lcom/android/settings/didact/RomSettings;->mMusicControl:Landroid/preference/CheckBoxPreference;
if-ne p2, v2, :cond_6
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v2
invoke-virtual {v2}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "music_control"
check-cast p2, Landroid/preference/CheckBoxPreference;
invoke-virtual {p2}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v4
if-eqz v4, :cond_5
move v0, v1
:cond_5
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :goto_0
:cond_6
iget-object v2, p0, Lcom/android/settings/didact/RomSettings;->mCrtAnimationPreference:Landroid/preference/CheckBoxPreference;
if-ne p2, v2, :cond_8
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v2
invoke-virtual {v2}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "crtanimation_toggle"
check-cast p2, Landroid/preference/CheckBoxPreference;
invoke-virtual {p2}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v4
if-eqz v4, :cond_7
move v0, v1
[COLOR="red"]:cond_7
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :goto_0
:cond_8
iget-object v2, p0, Lcom/android/settings/didact/RomSettings;->mAospLockVibration:Landroid/preference/CheckBoxPreference;
if-ne p2, v2, :cond_1
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v2
invoke-virtual {v2}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "aosp_vibrate"
check-cast p2, Landroid/preference/CheckBoxPreference;
invoke-virtual {p2}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v4
if-eqz v4, :cond_9
move v0, v1
:cond_9
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :goto_0[/COLOR][code][/hide]
Thats all you need for SecSettings. Recompile and push to /system/app and test the toggles. They wont do anything yet but they should be there and should be able to click them on and off.
Next we will add in the logic code forthe IME icon functionality.
Decompile Services.jar
Navigate to smali/com/android/server/InputMethodManagerService.smali
Find .method public setImeWindowStatus(Landroid/os/IBinder;II)V
Add the following in RED
[hide][code]
:try_start_0
move-object/from16 v0, p0
iget-object v12, v0, Lcom/android/server/InputMethodManagerService;->mCurToken:Landroid/os/IBinder;
move-object/from16 v0, p1
[COLOR="red"]move-object/from16 v0, p0
iget-object v12, v0, Lcom/android/server/InputMethodManagerService;->mContext:Landroid/content/Context;
invoke-virtual {v12}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v12
const-string v13, "enable_ime_icon"
const/4 v14, 0x1
invoke-static {v12, v13, v14}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v12
if-nez v12, :cond_1
[/COLOR]
:cond_0
const-string v12, "InputMethodManagerService"
new-instance v13, Ljava/lang/StringBuilder;
invoke-direct {v13}, Ljava/lang/StringBuilder;-><init>()V
const-string v14, "Ignoring setImeWindowStatus of uid "
Thats it for Services.jar. Recompile and push to /system/framework
Now for the last part. The AOSP lockscreen vibration toggle. For this we will need to decompile framework2.jar
Navigate to smali/com/android/internal/widget/multiwaveview/GlowPadView.smali
Find .method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSetV
Add the following code in RED
Code:
const/16 v8, 0x30
invoke-virtual {v0, v7, v8}, Landroid/content/res/TypedArray;->getInt(II)I
move-result v8
iput v8, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mGravity:I
invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V
[COLOR="red"]iget-object v8, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mContext:Landroid/content/Context;
invoke-virtual {v8}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v8
const-string v7, "aosp_vibrate"
invoke-static {v8, v7, v6}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v8
if-eqz v8, :cond_8
[/COLOR]
:goto_0
invoke-virtual {p0, v6}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->setVibrateEnabled(Z)V
invoke-direct {p0}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->assignDefaultsIfNeeded()V
new-instance v6, Lcom/android/internal/widget/multiwaveview/PointCloud;
So thats it. I am also including a flashable ZIP for those who are already using my Multi-Mod. I will include these in my next Multi-Mod update as well. If you are not using my Multi-Mod this flashable zip wont work for you....sorry.
Flashable ZIP Download
Great Work Man!! Can i build this just into my SecSettings without your rom control?
sbreen94 said:
Great Work Man!! Can i build this just into my SecSettings without your rom control?
Click to expand...
Click to collapse
PM me bro that's what I originally wanted it to be, but Didact did all the ground work for us, we just gotta figure out how to put it in settings instead of rom control.
I wouldn't make it a seperate mod either if I were Didact, ROM Control is amazing, and it makes it so much easier to add in MODs like this.
but I do want to figure it out for those that do not use ROM Control.
And Didact thank you so much for this bro!!!
You are the man!
You added in CRT animation??
Sent from my SCH-I535 using xda app-developers app
sbreen94 said:
Great Work Man!! Can i build this just into my SecSettings without your rom control?
Click to expand...
Click to collapse
I can, i just dont have time right now. I can try to work something out for you guys this weekend.
tu3218 said:
You added in CRT animation??
Sent from my SCH-I535 using xda app-developers app
Click to expand...
Click to collapse
LOL....it works with the right kernel, not the stock one unfortunately
Didact74 said:
I can, i just dont have time right now. I can try to work something out for you guys this weekend.
LOL....it works with the right kernel, not the stock one unfortunately
Click to expand...
Click to collapse
Of course. The stock kernel would give that sort of trouble for you devs. Thanks though man. You're a beast. BTW, do you know what kernel is required for such mod?
Sent from my SCH-I535 using xda app-developers app
Didact74 said:
I can, i just dont have time right now. I can try to work something out for you guys this weekend.
LOL....it works with the right kernel, not the stock one unfortunately
Click to expand...
Click to collapse
Its cool man I appreciate your hard work. I think I might be able to figure it out
Sent from my GT-N8013 using xda app-developers app
Code:
E/AndroidRuntime(16346): *** FATAL EXCEPTION IN SYSTEM PROCESS: WindowManagerPolicy
E/AndroidRuntime(16346): java.lang.VerifyError: com/android/internal/widget/multiwaveview/GlowPadView
E/AndroidRuntime(16346): at java.lang.reflect.Constructor.constructNative(Native Method)
E/AndroidRuntime(16346): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
E/AndroidRuntime(16346): at android.view.LayoutInflater.createView(LayoutInflater.java)
E/AndroidRuntime(16346): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java)
E/AndroidRuntime(16346): at android.view.LayoutInflater.rInflate(LayoutInflater.java)
E/AndroidRuntime(16346): at android.view.LayoutInflater.rInflate(LayoutInflater.java)
E/AndroidRuntime(16346): at android.view.LayoutInflater.inflate(LayoutInflater.java)
E/AndroidRuntime(16346): at android.view.LayoutInflater.inflate(LayoutInflater.java)
E/AndroidRuntime(16346): at com.android.internal.policy.impl.LockScreen.<init>(LockScreen.java)
E/AndroidRuntime(16346): at com.android.internal.policy.impl.LockPatternKeyguardView.createLockScreen(LockPatternKeyguardView.java)
E/AndroidRuntime(16346): at com.android.internal.policy.impl.LockPatternKeyguardView.recreateLockScreen(LockPatternKeyguardView.java)
E/AndroidRuntime(16346): at com.android.internal.policy.impl.LockPatternKeyguardView.updateScreen(LockPatternKeyguardView.java)
E/AndroidRuntime(16346): at com.android.internal.policy.impl.LockPatternKeyguardView.<init>(LockPatternKeyguardView.java)
E/AndroidRuntime(16346): at com.android.internal.policy.impl.LockPatternKeyguardViewProperties.createKeyguardView(LockPatternKeyguardViewProperties.java)
E/AndroidRuntime(16346): at com.android.internal.policy.impl.KeyguardViewManager.show(KeyguardViewManager.java)
E/AndroidRuntime(16346): at com.android.internal.policy.impl.KeyguardViewMediator.handleShow(KeyguardViewMediator.java)
E/AndroidRuntime(16346): at com.android.internal.policy.impl.KeyguardViewMediator.access$1400(KeyguardViewMediator.java)
E/AndroidRuntime(16346): at com.android.internal.policy.impl.KeyguardViewMediator$4.handleMessage(KeyguardViewMediator.java)
E/AndroidRuntime(16346): at android.os.Handler.dispatchMessage(Handler.java)
E/AndroidRuntime(16346): at android.os.Looper.loop(Looper.java)
E/AndroidRuntime(16346): at com.android.server.wm.WindowManagerService$PolicyThread.run(WindowManagerService.java)
I get this error regarding the framework2.jar changes (the services.jar works ok, I think).
This is what my smali looks like:
Code:
invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V
[COLOR="Red"]iget v8, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mVibrationDuration:I
if-lez v8, :cond_8[/COLOR]
:goto_0
invoke-virtual {p0, v6}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->setVibrateEnabled(Z)V
invoke-direct {p0}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->assignDefaultsIfNeeded()V
new-instance v6, Lcom/android/internal/widget/multiwaveview/PointCloud;
I'm experimenting with the lines in red, as they differ from yours and they're the only parts that do.
Attach your GlowpadView.smali so I can have a peek.
Cheers
It may be a mess in there as I was playing around trying things, but nothing other than the lines we're using.
did you catch my comments in the transparency thread?
EDIT:
Also, the ime switcher icon toggle works great
Kryten2k35 said:
I get this error regarding the framework2.jar changes (the services.jar works ok, I think).
This is what my smali looks like:
Code:
invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V
[COLOR="Red"]iget v8, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mVibrationDuration:I
if-lez v8, :cond_8[/COLOR]
:goto_0
invoke-virtual {p0, v6}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->setVibrateEnabled(Z)V
invoke-direct {p0}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->assignDefaultsIfNeeded()V
new-instance v6, Lcom/android/internal/widget/multiwaveview/PointCloud;
I'm experimenting with the lines in red, as they differ from yours and they're the only parts that do.
Click to expand...
Click to collapse
Just overwrite those two lines, and change the two variables in blue
Code:
const/16 v8, 0x30
invoke-virtual {v0, v7, v8}, Landroid/content/res/TypedArray;->getInt(II)I
move-result v8
iput v8, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mGravity:I
invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V
[COLOR="Red"]iget-object v8, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mContext:Landroid/content/Context;
invoke-virtual {v8}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v8
const-string [COLOR="Blue"]v4[/COLOR], "aosp_vibrate"
invoke-static {v8, [COLOR="blue"]v4[/COLOR], v6}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v8
if-eqz v8, :cond_8[/COLOR]
:goto_0
invoke-virtual {p0, v6}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->setVibrateEnabled(Z)V
invoke-direct {p0}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->assignDefaultsIfNeeded()V
new-instance v6, Lcom/android/internal/widget/multiwaveview/PointCloud;
Just the two in blue? Not the others?
Cheers I'll give it a whack
EDIT:
That works Cheers loserskater!
By the looks of the changes I'd need to add ROM control ( Not quite advanced enough to port that yet)
hednik said:
By the looks of the changes I'd need to add ROM control ( Not quite advanced enough to port that yet)
Click to expand...
Click to collapse
Yes you would. Unless you know how to port the code directly into one of your settings smali
Sent from my SCH-I535 using xda premium
hednik said:
By the looks of the changes I'd need to add ROM control ( Not quite advanced enough to port that yet)
Click to expand...
Click to collapse
sbreen94 said:
Yes you would. Unless you know how to port the code directly into one of your settings smali
Sent from my SCH-I535 using xda premium
Click to expand...
Click to collapse
Im not saying this just because its what I did, but with a stand alone settings file like my Rom Control it makes adding and removing future code a breeze. Plus you never have to worry about updates changing any of the code.
You ROM control is amazing. On my first rom it was a basic way to add all these awesome mods for a beginner and then customize little things.
Now that I'm trying to add all of these mods in individually on a t-mo port (data was just hit and miss with vzw 4.1.2 on at&t) I don't think in have the knowledge yet to port ROM control over to this new firmware. My head nearly exploded trying to do the on the fly battery mod alone haha.
Still awesome work you do and what you contribute
Sent from my SAMSUNG-SGH-I747 using xda premium
Thanks for the guide first..
ive managed to get the aosp toggle but i wanted to add vibrate so ive decompile framework2.jar
made the edits but when i try to compile back im getting the error "cond_8 not defined"
Thanks for all your help and all these Mod Tuts!!
By the way... if you havent heard this "Originally Posted by My Wife
You spent the last three days on the laptop for what reasn? So you could make the clock on your phone disappear? That's Brilliant sweetie" (taken from didact74's sig) you either arent married or arent a developer
LOVE IT!!!

[MOD][HOW-TO] CRT-Down Animation

With all of the ROMs coming out with CRT animation, I decided to just release the tutorial for devs so they can get it to work on their ROMs should they not have it. I have only tested this on the 2.24.401.1 base, but believe it will work on older bases as well. I have confirmed it to work on the following ROMs:
AxisOne v1.0.2
Renovate Milestone 4
Android Revolution HD 12.1
Let's get on with the tutorial. We'll be working with two files: services.jar and framework-res.apk
PART 1
Decompile services.jar and open up DisplayPowerController.smali in smali/com/android/server/power/
Find the following code:
Code:
:cond_10
:goto_8
iget-object v8, p0, Lcom/android/server/power/DisplayPowerController;->mLightSensor:Landroid/hardware/Sensor;
if-eqz v8, :cond_11
iget-object v8, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;
iget v8, v8, Lcom/android/server/power/DisplayPowerRequest;->screenState:I
invoke-static {v8}, Lcom/android/server/power/DisplayPowerController;->wantScreenOn(I)Z
move-result v8
[COLOR="red"]if-eqz v8, :cond_2a
iget-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOffBecauseOfProximity:Z
if-nez v8, :cond_2a
move v8, v9[/COLOR]
Replace the code in RED with the following:
Code:
if-eqz v8, :cond_2d
iget-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOffBecauseOfProximity:Z
if-nez v8, :cond_2d
const/4 v8, 0x1
Find the following code:
Code:
invoke-virtual {v8, v11}, Lcom/android/server/power/DisplayPowerState;->setElectronBeamLevel(F)V
iget-object v8, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
invoke-virtual {v8}, Lcom/android/server/power/DisplayPowerState;->dismissElectronBeam()V
goto/16 :goto_8
:cond_29
iget-object v8, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;
invoke-virtual {v8}, Landroid/animation/ObjectAnimator;->isStarted()Z
move-result v8
if-nez v8, :cond_10
[COLOR="red"]invoke-direct {p0, v10, v10, v10, v13}, Lcom/android/server/power/DisplayPowerController;->animateScreenBrightness(IIII)V
iget-object v8, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
invoke-virtual {v8, v14}, Lcom/android/server/power/DisplayPowerState;->setElectronBeamLevel(F)V
invoke-direct {p0, v10}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V
goto/16 :goto_8
:cond_2a
move v8, v10[/COLOR]
goto/16 :goto_9
:catchall_1
move-exception v8
:try_start_3
monitor-exit v9
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_1
throw v8
.end method
Replace the code in RED with the following:
Code:
iget-object v8, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;
invoke-virtual {v8}, Landroid/animation/ObjectAnimator;->isStarted()Z
move-result v8
if-nez v8, :cond_10
iget-object v8, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
invoke-virtual {v8}, Lcom/android/server/power/DisplayPowerState;->getElectronBeamLevel()F
move-result v8
const/4 v9, 0x0
cmpl-float v8, v8, v9
if-nez v8, :cond_2a
const/4 v8, 0x0
invoke-direct {p0, v8}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V
goto/16 :goto_8
:cond_2a
iget-object v9, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
iget-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamFadesConfig:Z
if-eqz v8, :cond_2b
const/4 v8, 0x2
:goto_c
invoke-virtual {v9, v8}, Lcom/android/server/power/DisplayPowerState;->prepareElectronBeam(I)Z
move-result v8
if-eqz v8, :cond_2c
iget-object v8, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
invoke-virtual {v8}, Lcom/android/server/power/DisplayPowerState;->isScreenOn()Z
move-result v8
if-eqz v8, :cond_2c
iget-object v8, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;
invoke-virtual {v8}, Landroid/animation/ObjectAnimator;->start()V
goto/16 :goto_8
:cond_2b
const/4 v8, 0x1
goto :goto_c
:cond_2c
iget-object v8, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;
invoke-virtual {v8}, Landroid/animation/ObjectAnimator;->end()V
goto/16 :goto_8
:cond_2d
const/4 v8, 0x0
Recompile services.jar.
PART 2
Decompile framework-res.apk and open up bools.xml in res/values/
Change the following instance:
Code:
<bool name="config_animateScreenLights">[COLOR="Red"]true[/COLOR]</bool>
to
Code:
<bool name="config_animateScreenLights">[COLOR="Red"]false[/COLOR]</bool>
recompile framework-res.apk
You are now done!
Full credit for this mod goes to myself and mwilky.
Reserved for a toggle
tks bro for guide ...
there is a flashable zip file for add CRT ?
tks again
jonata said:
tks bro for guide ...
there is a flashable zip file for add CRT ?
tks again
Click to expand...
Click to collapse
He just told you how to do it! Just edit it recompile it and replace it in /system/framework
Sent from my HTC One using Tapatalk HD
mate,
it not easy for me because haven't tools to decompile etc.etc. .. so ask if there was a flashable zip ...
nothing more ...
jonata said:
mate,
it not easy for me because haven't tools to decompile etc.etc. .. so ask if there was a flashable zip ...
nothing more ...
Click to expand...
Click to collapse
Op said he posted it for devs. if you can't do it yourself, Just wait. Some dev or some advanced user will make flashable sooner or later.
Sent from my HTC One using xda premium
jonata said:
mate,
it not easy for me because haven't tools to decompile etc.etc. .. so ask if there was a flashable zip ...
nothing more ...
Click to expand...
Click to collapse
Just make a backup and try it for yourself Follow this guide for decompiling: http://forum.xda-developers.com/showthread.php?t=2195680
Restore your backup if it goes balls up..
redbull123 said:
Just make a backup and try it for yourself Follow this guide for decompiling: http://forum.xda-developers.com/showthread.php?t=2195680
Restore your backup if it goes balls up..
Click to expand...
Click to collapse
Giggity
Sent from my HTC One using Tapatalk HD
I modified successfully, but one problem : lock screen widget(https://play.google.com/store/apps/details?id=com.droidmania.lockscreenwidget) doesn't work, when I pressed, the screen off but on immediately.
There are some files modfied by me, you can flash into your device (FLASHED AT YOUR OWN RISK! PLEASE BACKUP SYSTEM AT FIRST !)
https://dl.dropboxusercontent.com/u/36136585/hTC MOD/screen_off_CRT_animation.zip
Ok, so I'm trying this.. managed to get everything decompiled but when I open DisplayPowerController.smali with Notepad++ I get '.line' everywhere..
Code:
.line 964
invoke-direct {p0, v10, v10, v10, v13}, Lcom/android/server/power/DisplayPowerController;->animateScreenBrightness(IIII)V
.line 966
iget-object v8, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
invoke-virtual {v8, v14}, Lcom/android/server/power/DisplayPowerState;->setElectronBeamLevel(F)V
.line 967
invoke-direct {p0, v10}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V
goto/16 :goto_148
:cond_2bf
move v8, v10
.line 979
goto/16 :goto_15b
Is this normal? I was expecting it to be the same layout as your post..
I'm a noob with this stuff, but please don't anyone say "wait for someone else to do it" - I want to learn for myself..:good:
redbull123 said:
Ok, so I'm trying this.. managed to get everything decompiled but when I open DisplayPowerController.smali with Notepad++ I get '.line' everywhere..
Code:
.line 964
invoke-direct {p0, v10, v10, v10, v13}, Lcom/android/server/power/DisplayPowerController;->animateScreenBrightness(IIII)V
.line 966
iget-object v8, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
invoke-virtual {v8, v14}, Lcom/android/server/power/DisplayPowerState;->setElectronBeamLevel(F)V
.line 967
invoke-direct {p0, v10}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V
goto/16 :goto_148
:cond_2bf
move v8, v10
.line 979
goto/16 :goto_15b
Is this normal? I was expecting it to be the same layout as your post..
I'm a noob with this stuff, but please don't anyone say "wait for someone else to do it" - I want to learn for myself..:good:
Click to expand...
Click to collapse
Ignore the line, it's used as a reference so not really needed. Most devs remove all the line references to improve performance
HTC One - RenovateROM
mwilky said:
Ignore the line, it's used as a reference so not really needed. Most devs remove all the line references to improve performance
HTC One - RenovateROM
Click to expand...
Click to collapse
Thanks, so can I cut the .lines and paste the new code over them or do I need to keep them in the code?
redbull123 said:
Thanks, so can I cut the .lines and paste the new code over them or do I need to keep them in the code?
Click to expand...
Click to collapse
You can get rid of the lines it won't make a difference
HTC One - RenovateROM
mwilky said:
You can get rid of the lines it won't make a difference
HTC One - RenovateROM
Click to expand...
Click to collapse
Ok mate, one more thing please..
I've done the apk but can't recompile the classes.dex file after editing. I get this:
Code:
C:\Users\BOOTCAMP\Desktop\dex>java -jar smali.jar dex -o new_classes.dex
dex\com\android\server\power\DisplayPowerController.smali[5928,16] Label "cond_1
0" is not defined.
dex\com\android\server\power\DisplayPowerController.smali[5946,13] Label "goto_8
" is not defined.
dex\com\android\server\power\DisplayPowerController.smali[5976,13] Label "goto_8
" is not defined.
dex\com\android\server\power\DisplayPowerController.smali[5988,13] Label "goto_8
" is not defined.
I get the same errors if I use Toolkits, etc. Any ideas?
Is there a way to have CRT off work in conjunction with the Nova launcher? Both my S4 and HTC one have this issue.
redbull123 said:
Ok mate, one more thing please..
I've done the apk but can't recompile the classes.dex file after editing. I get this:
Code:
C:\Users\BOOTCAMP\Desktop\dex>java -jar smali.jar dex -o new_classes.dex
dex\com\android\server\power\DisplayPowerController.smali[5928,16] Label "cond_1
0" is not defined.
dex\com\android\server\power\DisplayPowerController.smali[5946,13] Label "goto_8
" is not defined.
dex\com\android\server\power\DisplayPowerController.smali[5976,13] Label "goto_8
" is not defined.
dex\com\android\server\power\DisplayPowerController.smali[5988,13] Label "goto_8
" is not defined.
I get the same errors if I use Toolkits, etc. Any ideas?
Click to expand...
Click to collapse
Try to remove debug code after decompiling the classes.dex, there is a tool for that or just use VTS and check there to remove it.
Then you wont see the .line bloat etc.
Sorry guys, tried using VTS 2.6.16 but I couldn't find framework-res/res/values folder (while I modded and rebuilt services.jar just fine). What am I doing wrong here?
EDIT: Got it... now building.
I tried replacing stock files with the VTS-modded ones, too bad ROM doesn't boot (stuck on HTC One bootscreen), cleared dalvik&cache but to no avail. Can anybody suggest what to check? I'd really like to do this myself but I think I don't have enough knowledge...
Hi guys,
if someone has the apk for directly install it on THE ONE, it would be nice.
Thanks
NIce !
Just work great on One X with latest APM and services.jar... awesome tutorial and very clear for noob lime me !
:good:

[MOD][Guide] Power Menu Safe Mode Reboot Addon (Toggles guide added - 15/10/2013)

<< Power Menu Safe Mode Reboot Addon >>
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Hi xda mates,,
Have anyone of you heard about the android safe mode and for what it is used?
Well the safe mode does exist in android device to help you to uninstall any third party application that causes lag or trouble in your android OS or even boot loop that prevents you from uninstalling that app which causes the problem by the normal way.. This should be your first attempt to fix your phone before doing a full wipe..!!
To get into Safe Mode, you need to power off your phone then turn it on and then hold volume up and down until it boots completely,, You will find a little black babble in the left lower side of the phone that indicates that you are in safe mode.
To boot into safe mode using adb shell, you can try these commands:
Code:
setprop persist.sys.safemode 1
reboot
The following video will show how is the buttons combination done..
OK, I know the buttons combination could be like a pain in a$$, and because most of manufactures had disabled the long press way to boot into safe mode (thanks Samsung..!!!), so I thought of integrating it into power menu as in above screenshots using the shell commands as a source of my smali codes.. So here we go :laugh:
The Guide:
Needed Tools:
1) APK Tool. You can use APK Multi-Tool from here.
2) Baksmali Tool. You can use my manager from here.
3) Notepad++ for editing xml and smali from here.
4) And of course little amount of patience..!!!
The procedure:
The procedure will not be different from the usual integrating addons into power menu..!!
First of all, download the resources [View attachment PM_SafeMode_Resources.rar].
1) framework-res.apk
- Decompile framework-res.apk
- Go to res\drawable-xhdpi folder and put the image resources there [tw_ic_lock_safemode.png]
- Go to res\values folder and open strings.xml file and add the following line at the end before </resources> and save:
Code:
<string name="global_action_safemode_txt">Reboot to safe mode</string>
- Now Recompile your framework-res.apk to create new ids.. Now DECOMPILE the NEW framework-res.apk and go to res\values and open public.xml file and locate these 2 ids:
Code:
<public type="drawable" name="tw_ic_lock_safemode" id="0x01080a98" />
<public type="string" name="global_action_safemode_txt" id="0x01040785" />
N.B: You might have different id numbers, but don't wary, the principle will be the same..!!
Click to expand...
Click to collapse
Keep the public.xml file opened for the moment and let's go to the next step.
2) android.policy.jar
- Baksmali android.policy.jar
- Go to classout\com\android\internal\policy\impl folder and paste the smali resource there [GlobalActions$SafeMode.smali]
- Now in the same folder find GlobalActions.smali and open it.
- In GlobalActions.smali, find the instance fields section and go to its end and add the following blue line just after ".field private mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;":
Code:
.field private mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[B][COLOR="Blue"].field private mSafeMode:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR][/B]
.field private mRingerModeReceiver:Landroid/content/BroadcastReceiver;
- Now, Search for "[Lcom/android/internal/policy/impl/GlobalActions$Action;" for power menu arrays and increase the number of arrays (the line above it) to accommodate the total number of new arrays:
Code:
.line 418
const/4 v1, 0x[B][COLOR="Red"]5[/COLOR][/B] [B][COLOR="Green"]<!--- You need to increase the arrays number here[/COLOR][/B]
new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
so it will be:
Code:
.line 418
const/4 v1, 0x[B][COLOR="Blue"]6[/COLOR][/B]
new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
- Now, above the newly modified "const/4 v1, 0x6" add these action lines:
Code:
new-instance [B][COLOR="Red"]v1[/COLOR][/B], Lcom/android/internal/policy/impl/GlobalActions$99;
const [B][COLOR="Red"]v2[/COLOR][/B], 0x10808ad
const [B][COLOR="Red"]v3[/COLOR][/B], 0x1040193
move-object/from16 [B][COLOR="Red"]v0, p0[/COLOR][/B]
invoke-direct {[B][COLOR="Red"]v1, v0, v2, v3[/COLOR][/B]}, Lcom/android/internal/policy/impl/GlobalActions$99;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 [B][COLOR="Red"]v0, p0[/COLOR][/B]
iput-object [B][COLOR="Red"]v1, v0[/COLOR][/B], Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[B][COLOR="Blue"]new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$SafeMode;
const v2, [COLOR="SeaGreen"]0x1080a98[/COLOR]
const v3, [COLOR="SeaGreen"]0x1040785[/COLOR]
move-object/from16 v0, p0
invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$SafeMode;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mSafeMode:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR][/B]
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/GlobalActions;->onAirplaneModeChanged()V
.line 418
const/4 v1, 0x6
new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
Here, the ids above are obtained from public.xml file from framework-res.apk. The first id will represent the image resource and the second id will represent the string resource (don't forget to omit the first 0).
Also pay attention to variables and parameters, it should be matched (the red v and p)
- Now we will add new array to show in power menu. So bellow modified "const/4 v1, 0x6" add new arrays to show after the last array:
Code:
.line 418
const/4 v1, 0x6
new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
...
...
const/4 [B][COLOR="Red"]v2[/COLOR][/B], 0x4
move-object/from16 [B][COLOR="Red"]v0, p0[/COLOR][/B]
iget-object [B][COLOR="Red"]v3, v0[/COLOR][/B], Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object [B][COLOR="Red"]v3, v1, v2[/COLOR][/B]
[B][COLOR="Blue"]const/4 v2, 0x5
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mSafeMode:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2[/COLOR][/B]
Again, you should match all variables and parameters (v and p values)
- Save changes.. smali (recompile)
Now push the finished framework-res.apk and android.policy.jar to framework folder in your device, fix permissions to 644 and reboot and viola you made it,,,
Pre-made mod:
You don't have technical skills to do all these complicated things..!! Here you can download the mod and flash it in your GT-N7000 device..
The mod is based on LT9 firmware and I suppose it will work on any LTx firmware increment number.
I have included:
- PM ScreenShot mod
- PM Safe mode reboot mod
- PM Fixed Hot reboot mod
- Volume rocker mod
All in one flashable file,, so what you are waiting for,, backup your phone and give it a try
Download
(md5 sum: 8f764c74e8ec63fc6072015668811fac)
Any ROM's developer can include this mod in his/her ROM without asking for permission, although small credit in the OP will be nice.. :good:
N.B: For toggle on and off of Power Menu addons, see post #3
Cheers,,
This is great
Adding Setting Toggle For Power Menu Addons
<< Adding Setting Toggle For Power Menu Addons >>​​
Let's increase the heat little bit..!! Do you want to add toggle to switch on and off the extra power menu addons like these pictures bellow:
OK let's start this extra step tutorial.. :victory:
I will assume you already add Safe Mode and Screenshot extra power menu addons..
1) android.policy.jar:
- Baksmali android.policy.jar
- Go to classout\com\android\internal\policy\impl folder
- Now, the truth is I didn't invent any new codes here, I traced one toggle-able power menu addon which is "accessibility", the tracing will take you into GlobalActions$3.smali, I opened it and I found this code in ".method public showConditional()Z"
Code:
.method public showConditional()Z
.registers 5
const/4 v0, 0x1
const/4 v1, 0x0
iget-object v2, p0, Lcom/android/internal/policy/impl/[B][COLOR="Red"]GlobalActions$3[/COLOR][/B];->this$0:Lcom/android/internal/policy/impl/GlobalActions;
# getter for: Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-static {v2}, Lcom/android/internal/policy/impl/GlobalActions;->access$200(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
move-result-object v2
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "[B][COLOR="Red"]power_key_hold[/COLOR][/B]"
invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-ne v2, v0, :cond_15
:goto_14
return v0
:cond_15
move v0, v1
goto :goto_14
.end method
- So what you need to do is to open GlobalActions$SafeMode.smali and GlobalActions$ScreenCap.smali and change the method ".method public showConditional()Z" to the previous method mentioned above.
Note:
Don't forget to change GlobalActions$3 to the name of smali you are using (i.e, GlobalActions$SafeMode.smali or GlobalActions$ScreenCap.smali).
You need to put new key for referral in your modified smali instead of "power_key_hold"
Click to expand...
Click to collapse
So by the end, GlobalActions$SafeMode.smali method will be:
Code:
.method public showConditional()Z
.registers 5
const/4 v0, 0x1
const/4 v1, 0x0
iget-object v2, p0, Lcom/android/internal/policy/impl/[B][COLOR="Blue"]GlobalActions$SafeMode[/COLOR][/B];->this$0:Lcom/android/internal/policy/impl/GlobalActions;
# getter for: Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-static {v2}, Lcom/android/internal/policy/impl/GlobalActions;->access$200(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
move-result-object v2
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, [B][COLOR="Blue"]"pm_safe_mode"[/COLOR][/B]
invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-ne v2, v0, :cond_15
:goto_14
return v0
:cond_15
move v0, v1
goto :goto_14
.end method
.method public showDuringKeyguard()Z
.registers 2
.prologue
.line 389
const/4 v0, 0x1
return v0
.end method
And GlobalActions$ScreenCap.smali method will be:
Code:
.method public showConditional()Z
.registers 5
const/4 v0, 0x1
const/4 v1, 0x0
iget-object v2, p0, Lcom/android/internal/policy/impl/[B][COLOR="Blue"]GlobalActions$ScreenCap[/COLOR][/B];->this$0:Lcom/android/internal/policy/impl/GlobalActions;
# getter for: Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-static {v2}, Lcom/android/internal/policy/impl/GlobalActions;->access$200(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
move-result-object v2
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, [B][COLOR="Blue"]"pm_screenshot"[/COLOR][/B]
invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-ne v2, v0, :cond_15
:goto_14
return v0
:cond_15
move v0, v1
goto :goto_14
.end method
- Save changes .. and that's for android.policy.jar
2) SecSettings.apk:
- Decompile SecSettings.apk
- Go to res\values folder and open strings.xml file and add these new resources at the end before </resources>:
Code:
<string name="PM_Glory_addons">GloryROM Power Menu Addons</string>
<string name="pm_safe_mode_title">Safe Mode Reboot</string>
<string name="pm_screenshot_title">Take Screenshot</string>
<string name="pm_on">Toggle is Enabled</string>
<string name="pm_off">Toggle is Disabled</string>
- Go to res\xml and open display_settings.xml and add these lines on the place you your addon to appear later on on the device:
Code:
<PreferenceCategory android:title="@string/PM_Glory_addons" android:key="PM_Glory_settings" />
<CheckBoxPreference android:title="@string/pm_safe_mode_title" android:key="pm_safe_mode" android:defaultValue="true" android:summaryOn="@string/pm_on" android:summaryOff="@string/pm_off" />
<CheckBoxPreference android:title="@string/pm_screenshot_title" android:key="pm_screenshot" android:defaultValue="true" android:summaryOn="@string/pm_on" android:summaryOff="@string/pm_off" />
- Now for the smali source, go to classout\com\android\settings folder and open DisplaySettings.smali.. Also here, I didn't invent new codes, I used mult-windows toggle codes as reference..!! I will use Blue color for Safe Mode toggle codes and Green color for Screenshot toggle codes. Add these lines to [# instance fields] section:
Code:
[B][COLOR="Blue"].field private mSafeModePref:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="Green"].field private mScreenShotPref:Landroid/preference/CheckBoxPreference;[/COLOR][/B]
- Search for ""key_multi_window"" and add these lines:
Code:
.line 570
const-string v11, "key_multi_window"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/CheckBoxPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
[B][COLOR="Blue"]const-string v11, "pm_safe_mode"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/CheckBoxPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mSafeModePref:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="Green"]const-string v11, "pm_screenshot"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/CheckBoxPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mScreenShotPref:Landroid/preference/CheckBoxPreference;[/COLOR][/B]
- Now search for the method ".method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z" and search for ""multi_window_enabled"" to locate this part at the end:
Code:
.line 1021
:cond_15c
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, [B][COLOR="Red"]:cond_1c[/COLOR][/B]
.line 1022
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
.line 1023
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "multi_window_enabled"
if-eqz v0, :cond_177
:goto_172
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1c
:cond_177
move v1, v2
goto :goto_172
.end method
Add new codes before [.end method] in the previous section, so that section will be like this:
Code:
.line 1021
:cond_15c
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, [B][COLOR="Blue"]:cond_SafeM[/COLOR][/B]
.line 1022
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
.line 1023
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "multi_window_enabled"
if-eqz v0, :cond_177
:goto_172
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1c
:cond_177
move v1, v2
goto :goto_172
[B][COLOR="Blue"]:cond_SafeM
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mSafeModePref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_ScSh
.line 1022
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mSafeModePref:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
.line 1023
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "pm_safe_mode"
if-eqz v0, :cond_majdiSafe
:goto_njsafe
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1c
:cond_majdiSafe
move v1, v2
goto :goto_njsafe[/COLOR]
[B][COLOR="Green"]:cond_ScSh
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mScreenShotPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, [COLOR="Red"]:cond_1c[/COLOR]
.line 1022
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mScreenShotPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
.line 1023
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "pm_screenshot"
if-eqz v0, :cond_majdiSS
:goto_njSS
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1c
:cond_majdiSS
move v1, v2
goto :goto_njSS[/COLOR][/B][/B]
.end method
- Pay attention to the red color condition..!!!
- Now go to the next method ".method public onResume()V" and search for ""multi_window_enabled"" and locate this part:
Code:
:cond_9d
sget-boolean v0, Lcom/android/settings/DisplaySettings;->UseMultiWindow:Z
if-eqz v0, [B][COLOR="Red"]:cond_c1[/COLOR][/B]
.line 847
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "multi_window_enabled"
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
if-ne v3, v1, :cond_de
:goto_af
invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 848
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "multi_window_enabled"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowModeObserver:Landroid/database/ContentObserver;
invoke-virtual {v0, v1, v2, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
line 850
:cond_c1
return-void
:cond_c2
move v0, v2
And do this modification:
Code:
:cond_9d
sget-boolean v0, Lcom/android/settings/DisplaySettings;->UseMultiWindow:Z
if-eqz v0, [B][COLOR="Blue"]:cond_Safemajdi[/COLOR][/B]
.line 847
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "multi_window_enabled"
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
if-ne v3, v1, :cond_de
:goto_af
invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 848
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "multi_window_enabled"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowModeObserver:Landroid/database/ContentObserver;
invoke-virtual {v0, v1, v2, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
[B][COLOR="Blue"].line 1000
:cond_Safemajdi
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mSafeModePref:Landroid/preference/CheckBoxPreference;
if-eqz v0, :cond_NewScSh
.line 1001
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mSafeModePref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "pm_safe_mode"
const/4 v1, 0x0
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
if-eqz v3, :cond_noSafe
const/4 v1, 0x1
goto :goto_yesSafe
:cond_noSafe
const/4 v1, 0x0
:goto_yesSafe
invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V[/COLOR]
[COLOR="Green"].line 2000
:cond_NewScSh
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mScreenShotPref:Landroid/preference/CheckBoxPreference;
if-eqz v0, [COLOR="Red"]:cond_c1[/COLOR]
.line 2001
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mScreenShotPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "pm_screenshot"
const/4 v1, 0x0
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
if-eqz v3, :cond_noShot
const/4 v1, 0x1
goto :goto_yesShot
:cond_noShot
const/4 v1, 0x0
:goto_yesShot
invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V[/COLOR][/B]
.line 850
:cond_c1
return-void
:cond_c2
move v0, v2
- Also pay attention to the red color condition..!!!
- Save changes.. and that's all
For DisplaySettings.smali, I will attach the smali before and after, so you could use it to understand well
Also, I will attach the modified GlobalActions$SafeMode.smali and GlobalActions$ScreenCap.smali
Have fun,,, :good:
Another great mod from u brother.
Thanks for your efforr
Sent from my GT-N7000 using xda premium
Thank you!!!!!!!! Very very great Mod! Thanks bro!
mjrifath said:
Another great mod from u brother.
Thanks for your efforr
Sent from my GT-N7000 using xda premium
Click to expand...
Click to collapse
BVB-Fan said:
Thank you!!!!!!!! Very very great Mod! Thanks bro!
Click to expand...
Click to collapse
Thanks for testing mates
Now my phone sometimes reboot is that a bug ?
BVB-Fan said:
Now my phone sometimes reboot is that a bug ?
Click to expand...
Click to collapse
It is fine here,,,
could you tell me how it gets reboot? Is it after opening the power menu, or opening any other application, so I can reproduce it if it is a bug to fix it.
Try wiping cache and dalvik cache in the moment..
This comes when I opened an application then my Note freeze for a moment and it restarts. I wiped the Cache but the same problem.
Now I flashed my Rom (LTA) again and the problem is solved :thumbup:
BVB-Fan said:
This comes when I opened an application then my Note freeze for a moment and it restarts. I wiped the Cache but the same problem.
Now I flashed my Rom (LTA) again and the problem is solved :thumbup:
Click to expand...
Click to collapse
I think the mod is working fine isn't it??
Thanks God,, I didn't sleep well since last time,, you just save me bro,, :good:
thank you majdinj great job (as usual). on xxlta works fine
asmanao said:
thank you majdinj great job (as usual). on xxlta works fine
Click to expand...
Click to collapse
Thanks for testing bro
Toggle on and off of Power Menu addons, see post #3
Yeh! Now I feel bad about using up the 2nd post.
majdinj said:
Toggle on and off of Power Menu addons, see post #3
Click to expand...
Click to collapse
Great work thanks for tutorials. Just one idea, is it possible to get other toggles on power menu like wifi?
Sent from my GT-N7000 using Tapatalk 4
nokiamodeln91 said:
Yeh! Now I feel bad about using up the 2nd post.
Click to expand...
Click to collapse
No Problem mate,, It is good like this,, I have no complain about it since I already have post #3,, I hope it is clear guide (I spent the whole day to do it, a lot of bootloop happened but I got it to work at the end..!!!! and finally it is here :laugh
kmokhtar79 said:
Great work thanks for tutorials. Just one idea, is it possible to get other toggles on power menu like wifi?
Sent from my GT-N7000 using Tapatalk 4
Click to expand...
Click to collapse
If you have smali resource then yes,,, The good thing about safe mode smali is, it is made by shell commands and if you look at power off GlobalAction smali, you will see it is done by shell command too,,, So here is the trick that I used to create safe mode smali.
I don't think the wifi is going to be the same,, but we have already the quick toggle for that (on the moment..!!)... I will see if I can locate the wifi onClick / onPress method
Yes Perfect! as always.
Nice Mod!!!
Is it possible to create an icon on the home screen to invoke power menu instead of long press on power button?
Thank You
can it works backwards?
hi i'm actually stuck on safe mode on mi S3 (i know this isn't the right site for my model) but i think that this may be a solution, is anyway posible that we can disable the safe mode from de ROM itself?
EMSpilot said:
Is it possible to create an icon on the home screen to invoke power menu instead of long press on power button?
Thank You
Click to expand...
Click to collapse
There is a way to add the lock button to the status bar or the pull down menu.. Search for it..

How to fix the do not disturb fc when changing time

For devs
This is a work around fix for the fc that happens when trying to change the time in do not disturb due to the current apktool.
In settings open
SecSettings2\smali\com\android\settings\notification\ZenModeDNDSettings$TimePickerPreference$TimePickerFragment.smali
Search for the blue
Code:
new-instance v0, Lcom/sec/android/touchwiz/app/TwTimePickerDialog;
invoke-virtual {p0}, Lcom/android/settings/notification/ZenModeDNDSettings$TimePickerPreference$TimePickerFragment;->getActivity()Landroid/app/Activity;
move-result-object v1
[B][COLOR="Blue"]const v2, 0x7f0f0227[/COLOR][/B]
invoke-virtual {p0}, Lcom/android/settings/notification/ZenModeDNDSettings$TimePickerPreference$TimePickerFragment;->getActivity()Landroid/app/Activity;
move-result-object v3
invoke-static {v3}, Landroid/text/format/DateFormat;->is24HourFormat(Landroid/content/Context;)Z
And change to red
Code:
new-instance v0, Lcom/sec/android/touchwiz/app/TwTimePickerDialog;
invoke-virtual {p0}, Lcom/android/settings/notification/ZenModeDNDSettings$TimePickerPreference$TimePickerFragment;->getActivity()Landroid/app/Activity;
move-result-object v1
[B][COLOR="Red"]const/4 v2, 0x0[/COLOR][/B]
invoke-virtual {p0}, Lcom/android/settings/notification/ZenModeDNDSettings$TimePickerPreference$TimePickerFragment;->getActivity()Landroid/app/Activity;
move-result-object v3
invoke-static {v3}, Landroid/text/format/DateFormat;->is24HourFormat(Landroid/content/Context;)Z
Done.
Thank to @dwitherell for helping with the fix!
Thanks for openly sharing your fix so nobody had to kang it from your rom.

Categories

Resources