[MOD][HOW-TO] CRT-Down Animation - One (M7) Android Development

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:

Related

[MOD]Quickpanel toggle button at bottom

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

[GUIDE][HOW-TO] Add 6 lockscreens Mod + Lockscreen Gestures (of Cyanogen)

Well, this a very simple guide on adding 6 lockscreen mod to your rom.
Files To be downloaded :
1. android.policy.zip
2. Lidroid-res.apk
3. Lidroid-Parts
Files to be Affected :
1. android.policy.jar
2. systemui.apk (only if you have added 14 status bar toggles before)
Steps :
-Pullout android.policy.jar from '/system/framework' (Must be Deodexed)
-Decompile it (Please dont expect a guide on how to decompile)
-Extract the android.policy.zip file
-copy the smali folder to directory where you decompiled your android.policy.jar
-Now open this file android.policy.jar.out\smali\com\android\internal\policy\impl\KeyguardUpdateMonitor.smali and make the following changes :
-At the begining after '#annonations' search for this line "Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$AirplaneModeChangeCallback;"
after that add this line
Code:
Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;,
-Now find this line ".field private mLockscreenWallpaperDrawable:Landroid/graphics/drawable/Drawable;"
-Below it paste this line
Code:
.field private mMediaCallbacks:Ljava/util/ArrayList;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/ArrayList",
"<",
"Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;",
">;"
}
.end annotation
.end field
-Find this line ".field private mWallpaperModeValue:I"
and jus below paste this
Code:
.field private timezone:Ljava/lang/String;
-Now find this method ".method private handleSimStateChange(Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$SimArgsV"
and above it paste this :
Code:
.method private handleMediaUpdate(IILandroid/net/Uri;)V
.locals 5
.parameter "isPlaying"
.parameter "isStop"
.parameter "mediaUri"
.prologue
const/4 v4, 0x0
const/4 v3, 0x1
.line 467
if-ne p1, v3, :cond_0
move v0, v3
.line 468
.local v0, bIsPlaying:Z
:goto_0
if-ne p2, v3, :cond_1
move v1, v3
.line 470
.local v1, bIsStop:Z
:goto_1
const/4 v2, 0x0
.local v2, i:I
:goto_2
iget-object v3, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mMediaCallbacks:Ljava/util/ArrayList;
invoke-virtual {v3}, Ljava/util/ArrayList;->size()I
move-result v3
if-ge v2, v3, :cond_2
.line 471
iget-object v3, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mMediaCallbacks:Ljava/util/ArrayList;
invoke-virtual {v3, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v3
check-cast v3, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;
invoke-interface {v3, v0, v1, p3}, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;->onMediaUpdated(ZZLandroid/net/Uri;)V
.line 470
add-int/lit8 v2, v2, 0x1
goto :goto_2
.end local v0 #bIsPlaying:Z
.end local v1 #bIsStop:Z
.end local v2 #i:I
:cond_0
move v0, v4
.line 467
goto :goto_0
.restart local v0 #bIsPlaying:Z
:cond_1
move v1, v4
.line 468
goto :goto_1
.line 473
.restart local v1 #bIsStop:Z
.restart local v2 #i:I
:cond_2
return-void
.end method
-Now find this line ".method public getFailedAttempts()I"
above it again paste this :
Code:
.method public getChangedTimeZone()Ljava/lang/String;
.locals 1
.prologue
.line 1131
iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->timezone:Ljava/lang/String;
return-object v0
.end method
this one's last for this file , search for ".method public isDevicePluggedIn()Z"
and above it paste :
Code:
.method public isDeviceCharged()Z
.locals 2
.prologue
.line 866
iget v0, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mBatteryLevel:I
const/16 v1, 0x64
if-lt v0, v1, :cond_0
const/4 v0, 0x1
:goto_0
return v0
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
-Now close this file and open "\smali\com\android\internal\policy\impl\LockPatternKeyguardView"
-Search for this method now ".method createLockScreen()Landroid/view/View;"
Find this (Jus one line below)
Code:
.prologue
.line 868
below it paste this :
Code:
const/4 v2, 0x0
const/4 v0, 0x0
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "lockscreen_style_pref"
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
const/4 v2, 0x1
if-eq v2, v0, :cond_3
const/4 v2, 0x2
if-eq v2, v0, :cond_3
const/4 v2, 0x3
if-eq v2, v0, :cond_3
const/4 v2, 0x4
if-eq v2, v0, :cond_3
const/4 v2, 0x5
if-eq v2, v0, :cond_3
if-eqz v0, :cond_0
.line 869
const/4 v2, 0x0
const/4 v0, 0x0
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "lockscreen_style_pref"
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
const/4 v2, 0x6
if-eq v2, v0, :cond_2
const/4 v2, 0x7
if-eq v2, v0, :cond_1
: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
goto :goto_0
:cond_1
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
goto :goto_0
:cond_2
after ':cond_2' there will be your default lockscreen so dont leave any line between them.
After the end of your default lockscreen , it might be like this
" invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/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/KeyguardScreenCallbackV
"
paste this
Code:
:goto_0
then on the next line after "return-object v0"
paste this
Code:
:cond_3
new-instance v0, Lcom/android/internal/policy/impl/CyanogenLockScreen;
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/CyanogenLockScreen;-><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
goto :goto_0
Now you may save and close the file.
Now recompile the android.policy.jar and push it to /system/framework with lidroid-res.apk .
Also Push the Lidroid-Parts.apk to '/system/app'
In case If you already have 14 toggles in the status bar adding this may affect it resulting in force closes . So to fix it follow this :
*Prooceed here only if you have 14 status bar toggles mod in your rom*
1.Decompile SystemUI.apk
2.Delete these two folders (if present) : /smali/com/lidroid & /smali/lidroid
3.Download Status_bar_fix from attachments below.
4.Extract it and copy the smali folder to your decompiled SystemUI.apk
5.Recompile and push the SystemUI.apk back to /system/app
Credits
Lidroid - This Mod Isnt Possible without him.
Regarding any help please prefer commenting on this thread rather than sending PM's.
nice guide :good:
Cool... Great guide... Thanks Aryan ^_^
Does the 6 lockscreen include ICS lockscreen? And do I have to download lidroid res? I already had it in my current rom ...
Sent from my GT-S5360 using xda app-developers app
advance user :|
I can't wait for the update.
Please update soon sir
:good::good::good:
ocoot said:
advance user :|
Click to expand...
Click to collapse
its actually quite easy. .
AvijitGhosh82 said:
Does the 6 lockscreen include ICS lockscreen? And do I have to download lidroid res? I already had it in my current rom ...
Sent from my GT-S5360 using xda app-developers app
Click to expand...
Click to collapse
Yes...the new res file contains resources for cyanogen lockscreens..
Waiting for 14 toggle fix!!
Sent from my GT-S5360 using XDA
Good one thanks pratyush
If my status bar is themed, what happens when I add lidroid res apk? Does the theme stay or go away? Thanks.
Sent from my GT-S5360 using xda app-developers app
awesome guide siirrr...:good: but my Status bar FC :laugh:
Creed when are u going to put d 14 toggle fix??
Sent from my GT-S6102 using xda premium
Bhocan said:
awesome guide siirrr...:good: but my Status bar FC :laugh:
Click to expand...
Click to collapse
Was busy for a bit...will put up the status bar fix today !!
pratyush.creed said:
Was busy for a bit...will put up the status bar fix today !!
Click to expand...
Click to collapse
Ohkz.. Gr8.. Eagerly w8ing!!!.
Dude 1 more qs?? Dude u hav put d code for only 6 lockscreens.. But actually there are 9 rite??
Sent from my GT-S6102 using xda premium
Only 6 in this...
Means u knoe how to make only 6 work or in this post there are 6 only?? Coz in ur Rom its 8 and in cyanogen 9...
Sent from my GT-S6102 using xda premium
Status Bar fix added to the guide ... Do not forget to sign your apps after applying it
pratyush.creed said:
Status Bar fix added to the guide ... Do not forget to sign your apps after applying it
Click to expand...
Click to collapse
putting modded classes.dex and res in original systemUI.apk will not work?
The fix you've added....do we have to use it AFTER the lockscreen adding part? Or is it a separate part?
Sent from my GT-S5360 using xda app-developers app
Creed can u add 2 more lockscreens??
Sent from my GT-S6102 using xda premium

[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] Real Time Statusbar Transparency Settings

Happy Easter!​
What does this MOD do?
It will allow you to change the status bar transparency settings without the need to reboot.
This will also be included as part of the Multi-Mod update coming shortly.
The attached zip is not flashable, its a file that's needed for the mod. A flashable zip will be added soon in the form of a link, not an attachment.
We will be working with two files:
SecSettings
SystemUI
As usual, I will assume you are using Rom Control for you settings controls. If not, you can port this to whichever settings header you prefer but I will not be going over how to do that here. I created Rom Control to eliminate the time needed to do all that.
There will be a zip included with a file that needs to be added to SystemUI. This is not a flashable zip. The file will need to be dropped in:
smali/com/android/systemui/statusbar/phone
Lets begin 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" />
<CheckBoxPreference android:title="@string/enable_aosp_vibrate" android:key="aosp_vibrate" android:summary="@string/enable_aosp_vibrate_text" />
<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" />
<CheckBoxPreference android:title="@string/enable_ime_icon" android:key="enable_ime_icon" android:summary="@string/enable_ime_icon_text" />
<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" />
[COLOR="red"]<ListPreference android:entries="@array/entries_status_bar_transparency" android:title="@string/status_bar_transparency_title" android:key="status_bar_transparency" android:summary="@string/status_bar_transparency_summary" android:defaultValue="0" android:entryValues="@array/values_status_bar_transparency" />
</PreferenceScreen>[/COLOR]
Navigate to res/values/arrays..
Add the following code
Code:
<string-array name="entries_status_bar_transparency">
<item>0%</item>
<item>50%</item>
<item>100%</item>
</string-array>
<string-array name="values_status_bar_transparency">
<item>100</item>
<item>75</item>
<item>50</item>
</string-array>
Navigate to res/values/strings...
Add the following code...
Code:
<string name="status_bar_transparency_title">Statusbar Transparency</string>
<string name="status_bar_transparency_summary">Adjust statusbar transparency</string>
Navigate to smali/com/android/settings/didact/RomSettings.smali
Add the following code in RED
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;
.field mImeIcon:Landroid/preference/CheckBoxPreference;
.field mLockScreenStylePref:Landroid/preference/ListPreference;
.field mLockScreenTorch:Landroid/preference/CheckBoxPreference;
.field mMusicControl:Landroid/preference/CheckBoxPreference;
.field mAospLockVibration:Landroid/preference/CheckBoxPreference;
[COLOR="red"].field mStatusbarTransparency:Landroid/preference/ListPreference;
[/COLOR]
Find method "onCreate(Landroid/os/BundleV"
Add the following code in RED
Code:
const-string v5, "lockscreen_type_key"
invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
invoke-static {v4}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;
move-result-object v4
invoke-virtual {v1, v4}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
[COLOR="red"]const-string v1, "status_bar_transparency"
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/ListPreference;
iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mStatusbarTransparency:Landroid/preference/ListPreference;
iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mStatusbarTransparency:Landroid/preference/ListPreference;
invoke-virtual {v1, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
iget-object v1, p0, Lcom/android/settings/didact/RomSettings;->mStatusbarTransparency:Landroid/preference/ListPreference;
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v4
invoke-virtual {v4}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v5, "status_bar_transparency"
invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
invoke-static {v4}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;
move-result-object v4
invoke-virtual {v1, v4}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
[/COLOR]
const-string v1, "enable_lockscreen_torch"
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;
Find method "onPreferenceChange(Landroid/preference/Preference;Ljava/lang/ObjectZ"
Add the following code in RED
Code:
:cond_4
iget-object v5, p0, Lcom/android/settings/didact/RomSettings;->mLockScreenStylePref:Landroid/preference/ListPreference;
if-ne p1, v5, [COLOR="red"]:cond_6[/COLOR]
check-cast p2, Ljava/lang/String;
invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result v4
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v5
invoke-virtual {v5}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v5
if-eqz v5, :cond_5
const-string v6, "lockscreen_ripple_effect"
const/4 v2, 0x0
invoke-static {v5, v6, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
const-string v6, "lockscreen_type_key"
invoke-static {v5, v6, v4}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :goto_0
:cond_5
const-string v6, "lockscreen_type_key"
invoke-static {v5, v6, v4}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
const/4 v2, 0x1
const-string v6, "lockscreen_ripple_effect"
invoke-static {v5, v6, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :goto_0
[COLOR="red"]:cond_6
iget-object v5, p0, Lcom/android/settings/didact/RomSettings;->mStatusbarTransparency:Landroid/preference/ListPreference;
if-ne p1, v5, :cond_0
check-cast p2, Ljava/lang/String;
invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result v4
invoke-virtual {p0}, Lcom/android/settings/didact/RomSettings;->getActivity()Landroid/app/Activity;
move-result-object v5
invoke-virtual {v5}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v5
const-string v6, "status_bar_transparency"
invoke-static {v5, v6, v4}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
move-result v2
goto :goto_0
[/COLOR].end method
That's it for SecSettings. Compile and push to /system/app. Test out your new options, they wont work yet but they should be selectable.
Lets move on to SystemUI...
Open the attached zip and drop the observer file in smali/com/android/systemui/statusbar/phone if you have not already done so.
Navigate to smali/com/android/systemui/statusbar/BaseStatusbar.smali
Find the following method "setAreThereNotifications()V"
Add the following complete method directly after...
Code:
.method protected setStatusBarParams(Landroid/view/View;)V
.locals 4
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "status_bar_transparency"
const/16 v3, 0x64
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
invoke-virtual {p1}, Landroid/view/View;->getBackground()Landroid/graphics/drawable/Drawable;
move-result-object v1
mul-int/lit16 v2, v0, 0xff
div-int/lit8 v2, v2, 0x64
int-to-float v2, v2
invoke-static {v2}, Ljava/lang/Math;->round(F)I
move-result v2
invoke-virtual {v1, v2}, Landroid/graphics/drawable/Drawable;->setAlpha(I)V
return-void
.end method
Navigate to smali/com/android/systemui/statusbar/phone/PhoneStatusbar.smali
Add the following code in RED
Code:
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BrightnessEnableObserver;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BatteryTextObserver;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$FastColorDrawable;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;,
[COLOR="red"]Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;,[/COLOR]
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$NotificationClicker;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$H;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$ExpandedDialog;
Find method "makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;"
Towards the end of this method, add the following code in RED
Code:
invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/policy/NotificationRowLayout;->setLongPressListener(Landroid/view/View$OnLongClickListener;)V
iget-object v9, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mPile:Lcom/android/systemui/statusbar/policy/NotificationRowLayout;
iput-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedContents:Landroid/view/View;
[COLOR="red"]new-instance v9, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;
new-instance v10, Landroid/os/Handler;
invoke-direct {v10}, Landroid/os/Handler;-><init>()V
invoke-direct {v9, p0, v10}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/os/Handler;)V
invoke-virtual {v9}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->observe()V
[/COLOR]
goto/16 :goto_5
:cond_f
const/16 v9, 0x8
goto/16 :goto_6
Find method "public start()V"
Towards the end of that method add the following code in RED
Code:
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mWindowManager:Landroid/view/IWindowManager;
invoke-super {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->start()V
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->addNavigationBar()V
[COLOR="red"]new-instance v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHandler:Lcom/android/systemui/statusbar/BaseStatusBar$H;
invoke-direct {v0, p0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/os/Handler;)V
invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->observe()V
[/COLOR]
new-instance v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;
iget-object v1, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
invoke-direct {v0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;-><init>(Landroid/content/Context;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mIconPolicy:Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;
return-void
.end method
That's it! Compile and push to /system/app and enjoy your new MOD!
Multi-Mod Flashable Add-On
I will be adding this MOD to the new Multi-Mod update shortly.
I will add a flashable zip to this thread that will allow you to add this to my Multi-Mod if you are currently running it.
Hit the thanks....buy me a coke!
Another one!!!? Such a boss! Thanks as always for sharing!!
Great Work as always Didact, and happy Easter!
Thanks, Are you the XDA Easter Bunny?!!
Sent from my SCH-I535 using XDA Premium HD app
Making stock roms just as customizable as AOSP roms.... thanks!
Im liking this and a lot of your other roms. But what is Rom control for settings controls. What do i need, i would like to port this over to my Sprint GS3.
Didact74 said:
Find method "makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;"
Towards the end of this method, add the following code in RED
Code:
invoke-virtual/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->getNotificationLongClicker()Landroid/view/View$OnLongClickListener;
move-result-object v14
invoke-virtual {v13, v14}, Lcom/android/systemui/statusbar/policy/NotificationRowLayout;->setLongPressListener(Landroid/view/View$OnLongClickListener;)V
[COLOR="red"]move-object/from16 v0, p0[/COLOR]
iget-object v[COLOR="red"]13[/COLOR], v0, Lcom/android/systemui/statusbar/BaseStatusBar;->mPile:Lcom/android/systemui/statusbar/policy/NotificationRowLayout;
move-object/from16 v0, p0
iput-object v[COLOR="red"]13[/COLOR], v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedContents:Landroid/view/View;
new-instance v[COLOR="red"]13[/COLOR], Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;
new-instance v[COLOR="red"]14[/COLOR], Landroid/os/Handler;
invoke-direct {v[COLOR="red"]14[/COLOR]}, Landroid/os/Handler;-><init>()V
[COLOR="Red"]invoke-direct {v13, [COLOR="Blue"]v0[/COLOR], v14}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/os/Handler;)V[/COLOR]
invoke-virtual {v[COLOR="Red"]13[/COLOR]}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->observe()V
goto/16 :goto_5
:cond_e
const/16 v13, 0x8
goto/16 :goto_6
Click to expand...
Click to collapse
On the SGS3 International GT-i9300 it becomes the above
Thanks Didact74
EDIT:
You're missing:
Code:
.method static synthetic access$3400(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
.locals 1
invoke-direct {p0, p1, p2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->loadAnim(ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
move-result-object v0
return-object v0
.end method
[COLOR="Red"].method static synthetic access$3401(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/view/View;)V
.locals 0
invoke-virtual {p0, p1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setStatusBarParams(Landroid/view/View;)V
return-void
.end method[/COLOR]
.method static synthetic access$3500(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
.locals 0
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->playTraySound()V
return-void
.end method
and
Code:
invoke-virtual {v0, v3}, Landroid/content/Context;->getText(I)Ljava/lang/CharSequence;
move-result-object v3
invoke-virtual {v2, v3}, Landroid/view/View;->setContentDescription(Ljava/lang/CharSequence;)V
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->loadDimens()V
[COLOR="red"]iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-virtual {p0, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setStatusBarParams(Landroid/view/View;)V[/COLOR]
return-void
.end method
.method protected updateSearchPanel()V
.locals 2
Adding to PhoneStatusBar.smali
And
Code:
.method public setMaxBrightness(I)V
.locals 0
return-void
.end method
[COLOR="red"].method protected setStatusBarParams(Landroid/view/View;)V
.locals 4
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "status_bar_transparency"
const/16 v3, 0x64
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
invoke-virtual {p1}, Landroid/view/View;->getBackground()Landroid/graphics/drawable/Drawable;
move-result-object v1
mul-int/lit16 v2, v0, 0xff
div-int/lit8 v2, v2, 0x64
int-to-float v2, v2
invoke-static {v2}, Ljava/lang/Math;->round(F)I
move-result v2
invoke-virtual {v1, v2}, Landroid/graphics/drawable/Drawable;->setAlpha(I)V
return-void
.end method[/COLOR]
to BaseStatusBar.smali
Or maybe those things are missing on the GT-i9300. I dunno
EDIT 2:
And, just in case:
Code:
<string-array name="entries_status_bar_transparency">
<item>0%</item>
<item>10%</item>
<item>20%</item>
<item>30%</item>
<item>40%</item>
<item>50%</item>
<item>60%</item>
<item>70%</item>
<item>80%</item>
<item>90%</item>
<item>100%</item>
</string-array>
<string-array name="values_status_bar_transparency">
<item>100</item>
<item>95</item>
<item>90</item>
<item>85</item>
<item>80</item>
<item>75</item>
<item>70</item>
<item>65</item>
<item>60</item>
<item>55</item>
<item>50</item>
</string-array>
For 0 to 100%
Though, I'm not sure I understand... why is 50 "0% "transparency and 100% is "100%"?
For the colour codes edits in drawables, you change the first colour code number hex value base don 0 to 255... so 255 = ff, 0 = 00... 50% therefore being 127 (255/2), or 7F in hexadecimal.
I added color selection to this mod.
http://forum.xda-developers.com/showthread.php?p=40250902
loserskater said:
I added color selection to this mod.
http://forum.xda-developers.com/showthread.php?p=40250902
Click to expand...
Click to collapse
Ha, you stinker......I was getting ready to do that. :silly:
Didact74 said:
Ha, you stinker......I was getting ready to do that. :silly:
Click to expand...
Click to collapse
Haha, my bad. I was wondering if you were going to. Just got too excited!
Kryten2k35 said:
On the SGS3 International GT-i9300 it becomes the above
Thanks Didact74
EDIT:
You're missing:
Adding to PhoneStatusBar.smali
And
to BaseStatusBar.smali
Or maybe those things are missing on the GT-i9300. I dunno
Click to expand...
Click to collapse
I can confirm the added edits for PhoneStatusBar.smali and BaseStatusBar.smali are required. Thanks!
Kryten2k35 said:
EDIT 2:
Though, I'm not sure I understand... why is 50 "0% "transparency and 100% is "100%"?
For the colour codes edits in drawables, you change the first colour code number hex value base don 0 to 255... so 255 = ff, 0 = 00... 50% therefore being 127 (255/2), or 7F in hexadecimal.
Click to expand...
Click to collapse
The transparency values don't make sense because the ones in the OP are actually for 0%, 25%, and 50%.
Change this...
Code:
<string-array name="entries_status_bar_transparency">
<item>0%</item>
<item>50%</item>
<item>100%</item>
</string-array>
<string-array name="values_status_bar_transparency">
<item>[COLOR="Red"]100[/COLOR]</item>
<item>[COLOR="Red"]75[/COLOR]</item>
<item>[COLOR="Red"]50[/COLOR]</item>
</string-array>
...to this for 0%, 50%, and 100% transparency.
Code:
<string-array name="entries_status_bar_transparency">
<item>0%</item>
<item>50%</item>
<item>100%</item>
</string-array>
<string-array name="values_status_bar_transparency">
<item>[COLOR="Red"]100[/COLOR]</item>
<item>[COLOR="Red"]50[/COLOR]</item>
<item>[COLOR="Red"]0[/COLOR]</item>
</string-array>
Im running stock 4.1.2 with your multi mod and when i get to the last 2 sets of smali code where it says
Find method "makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;" and
Find method "public start()V" I can't find any of that code at all. Im still searching in smali/com/android/systemui/statusbar/phone/PhoneStatusbar.smal am I in the wrong spot Everything else was fine no problems finding or adding just those last 2.
mikeman45 said:
Im running stock 4.1.2 with your multi mod and when i get to the last 2 sets of smali code where it says
Find method "makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;" and
Find method "public start()V" I can't find any of that code at all. Im still searching in smali/com/android/systemui/statusbar/phone/PhoneStatusbar.smal am I in the wrong spot Everything else was fine no problems finding or adding just those last 2.
Click to expand...
Click to collapse
Find method "makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;"
PhoneStatusBarView.smali ..
not PhoneStatusbar.smali
andybones said:
Find method "makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;"
PhoneStatusBarView.smali ..
not PhoneStatusbar.smali
Click to expand...
Click to collapse
Thank you i was in the wrong smali but even going to the right one i get no occurence found when i search those 2 methods
mikeman45 said:
Thank you i was in the wrong smali but even going to the right one i get no occurence found when i search those 2 methods
Click to expand...
Click to collapse
Oh that's weird sorry about that.
Thanks! Does this status bar mod look proper in landscape mode for launchers that allow it?
Any chance this guide will work on universal guide? Or on sensation xe? I wanted to try it out
great mod, thanks!!
i want this to try out on my note2 (N7100)
could someone explain this to me?
@SecSettings
since we dont have didacts multi mod on N7100 im planning to make the changes at display_settings.xml file and DisplaySettings.smali
Code:
onst-string v1, "status_bar_transparency"
invoke-virtual {p0, v1}, Lcom/android[COLOR="red"]/settings/didact/RomSettings;-[/COLOR]>findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v1
check-cast v1, Landroid/preference/ListPreference;
iput-object v1, p0, Lcom/android[COLOR="red"]/settings/didact/RomSettings;-[/COLOR]>mStatusbarTransparency:Landroid/preference/ListPreference;
iget-object v1, p0, Lcom/android/[COLOR="red"]settings/didact/RomSettings;-[/COLOR]>mStatusbarTransparency:Landroid/preference/ListPreference;
invoke-virtual {v1, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
iget-object v1, p0, Lcom/android[COLOR="Red"]/settings/didact/RomSettings;[/COLOR]->mStatusbarTransparency:Landroid/preference/ListPreference;
invoke-virtual {p0}, Lcom/android/settings/[COLOR="red"]didact/RomSettings[/COLOR];->getActivity()Landroid/app/Activity;
move-result-object v4
invoke-virtual {v4}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v5, "status_bar_transparency"
invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
invoke-static {v4}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;
move-result-object v4
invoke-virtual {v1, v4}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
AskinSavascisi said:
great mod, thanks!!
i want this to try out on my note2 (N7100)
could someone explain this to me?
@SecSettings
since we dont have didacts multi mod on N7100 im planning to make the changes at display_settings.xml file and DisplaySettings.smali
Code:
onst-string v1, "status_bar_transparency"
invoke-virtual {p0, v1}, Lcom/android[COLOR="red"]/settings/didact/RomSettings;-[/COLOR]>findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v1
check-cast v1, Landroid/preference/ListPreference;
iput-object v1, p0, Lcom/android[COLOR="red"]/settings/didact/RomSettings;-[/COLOR]>mStatusbarTransparency:Landroid/preference/ListPreference;
iget-object v1, p0, Lcom/android/[COLOR="red"]settings/didact/RomSettings;-[/COLOR]>mStatusbarTransparency:Landroid/preference/ListPreference;
invoke-virtual {v1, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
iget-object v1, p0, Lcom/android[COLOR="Red"]/settings/didact/RomSettings;[/COLOR]->mStatusbarTransparency:Landroid/preference/ListPreference;
invoke-virtual {p0}, Lcom/android/settings/[COLOR="red"]didact/RomSettings[/COLOR];->getActivity()Landroid/app/Activity;
move-result-object v4
invoke-virtual {v4}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v5, "status_bar_transparency"
invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
invoke-static {v4}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;
move-result-object v4
invoke-virtual {v1, v4}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
Click to expand...
Click to collapse
You could always port his multimod over

[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..

Categories

Resources