Related
hello guys im here to share my knowledge since alot off member ask for this mod i mean how to added this option to ur rom
its not hards guide but seems like u must have EPM [extended power menu] first before do this mod go to this threads for futher info how to added EPM to your rom http://forum.xda-developers.com/archive/index.php/t-811532.html or u can experimenting by this mod
here original threads about 4wayboot itself http://forum.xda-developers.com/showthread.php?t=1573032
Requirment:
-Brains
-Patient
-notepad++
-apktool,baksmali.jar or vts(use vts its awesome)
-attached file
ok here we go:
What you need to do is:
-Decompile android.policy.jar of your rom
-Copy attached folder to yours
-Open GlobalActions.smali
-Search line "Lcom/android/internal/policy/impl/GlobalActions$5;" ( some roms might have different number on shutdown button. You find right one by for example tracing shutdown icon id )
-Change number 5 to 99 ( two of them )
Before
Code:
Code:
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$5;
const v3, 0x1080030
const v4, 0x1040121
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$5;->(Lcom/android/internal/policy/impl/GlobalActions;II)V
After
Code:
Code:
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$99;
const v3, 0x1080030
const v4, 0x1040121
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$99;->(Lcom/android/internal/policy/impl/GlobalActions;II)V
-Open GlobalActions$SinglePressAction.smali
-Before line "# instance fields"
paste following code
Code:
Code:
# static fields
.field protected static rebootMode:I
.field protected static final rebootOptions:[Ljava/lang/String;
-Then after line "# direct methods"
paste following code
Code:
Code:
.method static constructor <clinit>()V
.registers 3
const/4 v0, 0x5
new-array v0, v0, [Ljava/lang/String;
const/4 v1, 0x0
const-string v2, "Reboot"
aput-object v2, v0, v1
const/4 v1, 0x1
const-string v2, "Hot Boot"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "Download"
aput-object v2, v0, v1
const/4 v1, 0x3
const-string v2, "Recovery"
aput-object v2, v0, v1
const/4 v1, 0x4
const-string v2, "Shutdown"
aput-object v2, v0, v1
sput-object v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
return-void
.end method
-So your file should look something like this after those changes
Code:
Code:
.class abstract Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.super Ljava/lang/Object;
.source "GlobalActions.java"
# interfaces
.implements Lcom/android/internal/policy/impl/GlobalActions$Action;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/internal/policy/impl/GlobalActions;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x40a
name = "SinglePressAction"
.end annotation
# static fields
.field protected static rebootMode:I
.field protected static final rebootOptions:[Ljava/lang/String;
# instance fields
.field private final mIconResId:I
.field private final mMessageResId:I
# direct methods
.method static constructor <clinit>()V
.registers 3
const/4 v0, 0x5
new-array v0, v0, [Ljava/lang/String;
const/4 v1, 0x0
const-string v2, "Reboot"
aput-object v2, v0, v1
const/4 v1, 0x1
const-string v2, "Hot Boot"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "Download"
aput-object v2, v0, v1
const/4 v1, 0x3
const-string v2, "Recovery"
aput-object v2, v0, v1
const/4 v1, 0x4
const-string v2, "Shutdown"
aput-object v2, v0, v1
sput-object v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
return-void
.end method
.method protected constructor (II)V
.registers 3
.parameter "iconResId"
.........
.........
compile jar and u are done
enjoy ur new mod
ss:
http://img.tapatalk.com/6703df6f-8b96-e620.jpg
enjoy
this is the mod file requireds
http://forum.xda-developers.com/attachment.php?attachmentid=974608&d=1333178584
credit:
untermensch(EPM mod GUide)
kahvitahra(4way boot mod):good::highfive::laugh:
reserved for future mod:
How to change shutdown method popup name to everything u desire
open globalaction$99
it look like this
# virtual methods
.method public onPress()V
.registers 7
const/4 v5, 0x5
new-instance v1, Landroid/app/AlertDialog$Builder;
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions$99;->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$000(Lcom/android/internal/policy/impl/GlobalActionsLandroid/content/Context;
move-result-object v2
invoke-direct {v1, v2}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/ContextV
const-string v2, "shutdown Method" ---------------------------(change this to your desire menu name)
invoke-virtual {v1, v2}, Landroid/app/AlertDialog$Builder;->setTitle(Ljava/lang/CharSequenceLandroid/app/AlertDialog$Builder;
move-result-object v1 bla bla bla.......
Click to expand...
Click to collapse
const-string v2, "shutdown Method" (change this to your desire menu name)
recompile and enjoy
reserved for Q&A
Q: When I press restart/shutdown button I can only see title and "ok" and "cancel" -buttons. See photo
{
"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"
}
A: You have incorrect number of empty lines between lines you pasted in GlobalActions$SinglePressAction.smali. You should have two (2) empty lines to previous "# annotations" and to next "# instance fields" from "# static fields" that you pasted.
Also check that added method have <clinit> at the end. See following screenshot.
Thanks to chudy_85 and mialwe for pointing these to all. [/QUOTE]
reserved for fun
Thank's for create a 4way boot
:thumbup::thumbup:
Sent from my GT-S5360 using xda app-developers app
GREATE GUIDE
work in galaxymini sir ?
For gb only bro
Sent from my GT-S5360 using xda app-developers app
evanlocked said:
reserved for fun
Click to expand...
Click to collapse
One night with 4 cup of coffee to find "id's" on public.xml...... :laugh::laugh:
zalzondabuzz said:
One night with 4 cup of coffee to find "id's" on public.xml...... :laugh::laugh:
Click to expand...
Click to collapse
Monggo brad patient on it
Sent from my GT-S5360 using xda premium
This is definitely a must-try. Thanks for this.
bumslayer said:
This is definitely a must-try. Thanks for this.
Click to expand...
Click to collapse
Yow bro its usefull insteads epm its hards to do,
This method more simple than epm
Sent from my GT-S5360 using xda premium
thanks bro! nice guide! i manage to make it for COD Rom. cheers!:good:
ianczarina said:
thanks bro! nice guide! i manage to make it for COD Rom. cheers!:good:
Click to expand...
Click to collapse
Sure bro just try it
Sent from my GT-S5360 using xda premium
ianczarina said:
thanks bro! nice guide! i manage to make it for COD Rom. cheers!:good:
Click to expand...
Click to collapse
Did you have to do the EPM mod as well in order to make it work. I skipped it because my eyes were getting watery and my head was spinning. However, 4way-boot didn't work for me. I guess evanlocked was right when he said the EPM mod is needed.
bumslayer said:
Did you have to do the EPM mod as well in order to make it work. I skipped it because my eyes were getting watery and my head was spinning. However, 4way-boot didn't work for me. I guess evanlocked was right when he said the EPM mod is needed.
Click to expand...
Click to collapse
No bro u can trick it I think u must tracing ur power off icon I'd first in ur framework then change it
Sent from my GT-S5360 using xda app-developers app
@bumslayers he made it posted for cod rom :good:
Sent from my GT-S5360 using xda app-developers app
Well I managed to make it work without making the very difficult EPM mod, hurray! Thank you so much, evanlocked!
However, download mode does not work on my deodexed DXLF2 ROM. Any ideas?
bumslayer said:
Well I managed to make it work without making the very difficult EPM mod, hurray! Thank you so much, evanlocked!
However, download mode does not work on my deodexed DXLF2 ROM. Any ideas?
Click to expand...
Click to collapse
Post ss here I wanna see bro
Edit:download mode not exactly works its becouse the path of it same like lidroid rom download mode not work properly
Sent from my GT-S5360 using xda app-developers app
EPM is hard.Should invest some time on it.May be this weekend.
sent while doin' some burnouts
b16h22 said:
EPM is hard.Should invest some time on it.May be this weekend.
sent while doin' some burnouts
Click to expand...
Click to collapse
Nope bro u can implement 4way boot by seeking the poweroff icon I'd in ur frameworks like bumslayers did he already implemented it without epm in stock deodexed dxlf2
Sent from my GT-S5360 using xda app-developers app
This mod and functional for all ROM based on CM10 loSconoscuito
For CM10.1 Alpha 6 here
X-GamerZ - Slim Bean - Like S4 and CM10 loSconoscuito
How to make this mod for other device
decompile SystemUI
/res/values/drawable.xml
<drawable name="status_bar_background">#ff000000</drawable>
change #ff000000 original black by values transparency then compile
decompile android.policy.jar
com/android/internal/policy/impl/PhoneWindowManager.smali
in line 7583 found
Code:
.line 2975
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_1b
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
.line 2977
:goto_1a
return v0
.line 2976
:cond_1b
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_26
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
goto :goto_1a
.line 2977
:cond_26
const/4 v0, 0x0
goto :goto_1a
.end method
replace by
Code:
.line 2975
const/4 v0, 0x0
return v0
.end method
com/android/internal/policy/impl/PhoneWindow$DecorView.smali
in line 921 found
Code:
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_7 .. :try_end_a} :catch_17
move-result-object v0
.line 2145
.local v0, ai:Landroid/content/pm/ApplicationInfo;
:goto_b
if-eqz v0, :cond_1a
invoke-virtual {v3, v0}, Landroid/content/pm/PackageManager;->getApplicationLabel(Landroid/content/pm/ApplicationInfo;)Ljava/lang/CharSequence;
move-result-object v4
:goto_11
check-cast v4, Ljava/lang/String;
move-object v1, v4
check-cast v1, Ljava/lang/String;
.line 2147
.local v1, applicationName:Ljava/lang/String;
return-object v1
.line 2142
.end local v0 #ai:Landroid/content/pm/ApplicationInfo;
.end local v1 #applicationName:Ljava/lang/String;
:catch_17
move-exception v2
.line 2143
.local v2, e:Landroid/content/pm/PackageManager$NameNotFoundException;
const/4 v0, 0x0
.restart local v0 #ai:Landroid/content/pm/ApplicationInfo;
goto :goto_b
.line 2145
.end local v2 #e:Landroid/content/pm/PackageManager$NameNotFoundException;
:cond_1a
const/4 v4, 0x0
replace by
Code:
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_7 .. :try_end_a} :catch_14
move-result-object v0
.line 2145
.local v0, ai:Landroid/content/pm/ApplicationInfo;
:goto_b
if-eqz v0, :cond_17
invoke-virtual {v3, v0}, Landroid/content/pm/PackageManager;->getApplicationLabel(Landroid/content/pm/ApplicationInfo;)Ljava/lang/CharSequence;
move-result-object v1
:goto_11
check-cast v1, Ljava/lang/String;
.line 2147
.local v1, applicationName:Ljava/lang/String;
return-object v1
.line 2142
.end local v0 #ai:Landroid/content/pm/ApplicationInfo;
.end local v1 #applicationName:Ljava/lang/String;
:catch_14
move-exception v2
.line 2143
.local v2, e:Landroid/content/pm/PackageManager$NameNotFoundException;
const/4 v0, 0x0
.restart local v0 #ai:Landroid/content/pm/ApplicationInfo;
goto :goto_b
.line 2145
.end local v2 #e:Landroid/content/pm/PackageManager$NameNotFoundException;
:cond_17
const/4 v1, 0x0
0% = #00000000 > 100 transparency
5% = #0d000000 > 95 transparency
10% = #16000000 > 90 transparency
15% = #26000000 > 85 transparency
20% = #32000000 > 80 transparency
25% = #40000000 > 75 transparency
30% = #48000000 > 70 transparency
35% = #59000000 > 65 transparency
40% = #64000000 > 60 transparency
45% = #73000000 > 55 transparency
50% = #80000000 > 50 transparency
55% = #8c000000 > 45 transparency
60% = #96000000 > 40 transparency
65% = #a6000000 > 35 transparency
70% = #11200000 > 30 transparency
75% = #bf000000 > 25 transparency
80% = #d9000000 > 20 transparency
85% = #12800000 > 15 transparency
90% = #14400000 > 10 transparency
95% = #f2000000 > 5 transparency
100% (original black) = #ff000000 > 0 NO transparency
How to install
- Put the zip file on your SD and reboot in recovery
- Choose install zip from sdcard
- Restart
- Enjoy transparency
LoLaTiOn said:
How to install
- Put the zip file on your SD and reboot in recovery
- Choose install zip from sdcard
- Restart
- Enjoy transparency
Click to expand...
Click to collapse
thanks and keep rocking LoLa
Great lola:thumbup:
~radio friendly unit shifter~
work very smoth lola you are realy the best frinde with our low legacy devices ....
thanks
Thanks LoLa, I will test that
Where is 45% ? ^^ Thanks for put this Transparency !
I hope to revive this project to comply with the NEW cm10.1 alpha5
abderrezak said:
I hope to revive this project to comply with the NEW cm10.1 alpha5
Click to expand...
Click to collapse
I was about to ask whether it works with 10.1 or not. Thanks
Dunno why with tickle my android when prepare system app for pushing there is something missing with systemui
Sent from my GT-I9003 using xda premium
Don't flash this on cm10.1 alpha 5 it will boot loop .Would like to see this working,as i find black notification bar to thick and ugly.
TRANSPARENT STATUS BAR FOR CM10.1
1. DECOMPILE android.policy.jar
\com\android\internal\policy\impl\PhoneWindowManager.smali
find this method
.method public getSystemDecorRectLw(Landroid/graphics/RectI
DELETE it until its .end method
Code:
.method public getSystemDecorRectLw(Landroid/graphics/Rect;)I
.registers 3
.parameter "systemRect"
.prologue
.line 3057
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemLeft:I
iput v0, p1, Landroid/graphics/Rect;->left:I
.line 3058
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemTop:I
iput v0, p1, Landroid/graphics/Rect;->top:I
.line 3059
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemRight:I
iput v0, p1, Landroid/graphics/Rect;->right:I
.line 3060
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemBottom:I
iput v0, p1, Landroid/graphics/Rect;->bottom:I
.line 3061
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_1b
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
.line 3063
:goto_1a
return v0
.line 3062
:cond_1b
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_26
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
goto :goto_1a
.line 3063
:cond_26
const/4 v0, 0x0
goto :goto_1a
.end method
and replace with this
Code:
.method public getSystemDecorRectLw(Landroid/graphics/Rect;)I
.registers 3
.parameter "systemRect"
.prologue
.line 3057
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemLeft:I
iput v0, p1, Landroid/graphics/Rect;->left:I
.line 3058
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemTop:I
iput v0, p1, Landroid/graphics/Rect;->top:I
.line 3059
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemRight:I
iput v0, p1, Landroid/graphics/Rect;->right:I
.line 3060
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemBottom:I
iput v0, p1, Landroid/graphics/Rect;->bottom:I
.line 3063
const/4 v0, 0x0
return v0
.end method
DONE & COMPILE
2. DECOMPILE SystemUI.apk
. /res/layout/status_bar_expanded_header.xml
LINE xml 2 , replace with my line
Code:
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/header" android:background="#ff000000" android:layout_width="fill_parent" android:layout_height="@dimen/notification_panel_header_height" android:baselineAligned="false"
/res/values/drawables.xml
100% Transparency
Code:
<item type="drawable" name="status_bar_background">[COLOR="Red"]#00000000[/COLOR]</item>
OR
80% Transparency
Code:
<item type="drawable" name="status_bar_background">[COLOR="Red"]#88000000[/COLOR]</item>
DONE !!, AND COMPILE
Make it for cm10.1 alpha 5 lola
Sent from my GT-I9003 using xda premium
Lola, any chance for flashable version for CM10.1?
Sent from my GT-I9003 using Tapatalk 4 Beta
I will not make tousent
tell me exactly what you want
LoLaTiOn said:
I will not make tousent
tell me exactly what you want
Click to expand...
Click to collapse
65% and 100% if possible.
+1 to 100% and 0% to be able to revert if needed.
make two of 88% and 100% transparent:laugh:
I have 80% transparent for alpha 5,if someone need you can pm me and i will upload
Sent from my GT-I9003 using xda premium
Update!!! Alpha 5
80% transparent
http://db.tt/EVXRifvh
100% soon!
Sent from my GT-I9003 using xda premium
MR.Volkf said:
100% soon!
Click to expand...
Click to collapse
:highfive:
This mod will make you able to have torch flash light while you are on LockScreen by long pressing on the home button...!!!
Actual mod was done by RobbieHood and eybee1970
Needed tools:
1) Backsmali/Smali program from here
2) Notepad++ program from here
3) WinRAR or 7-zip archiver
The procedure:
- Backsmali android.policy.jar
- Navigate to classout/com/android/internal/policy/impl/ folder
- We will be working on 3 smali files:
KeyguardViewMediator$4.smali
- Search for "packed-switch" and add the blue line just above "return-void":
Code:
.line 1255
iget v2, p1, Landroid/os/Message;->what:I
packed-switch v2, :pswitch_data_72
.line 1298
:goto_7
[B][COLOR="Blue"]:pswitch_7[/COLOR][/B]
return-void
.line 1257
- Search for ":catchall" and add these lines above it:
Code:
.line 1295
monitor-exit v1
goto :goto_[B][COLOR="Red"]7[/COLOR][/B]
[B][COLOR="Blue"] :pswitch_6e
iget-object v2, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator$4;->this$0:Lcom/android/internal/policy/impl/KeyguardViewMediator;
iget v3, p1, Landroid/os/Message;->arg1:I
if-eqz v3, :cond_majdi
move v3, v0
:goto_nj
#calls: Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetTorch(Z)V
invoke-static {v2, v3}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->access$2400(Lcom/android/internal/policy/impl/KeyguardViewMediator;Z)V
goto :goto_[COLOR="Red"]7[/COLOR]
:cond_majdi
move v3, v1
goto :goto_nj[/COLOR][/B]
:catchall_7b
move-exception v0
monitor-exit v1
N.B: pay attention to number 7 in goto :goto_7 that could be different in your smali according to your ROM, make sure it is the same as the first one which is just above the new line ":pswitch_6e"
Click to expand...
Click to collapse
- Search for "nop" and another "nop" line bellow it (don't forget to leave empty line in between):
Code:
.line 1255
nop
[B][COLOR="Blue"]nop[/COLOR][/B]
- Now go to the end of smali and add these switches above ".end packed-switch" line:
Code:
:pswitch_data_72
.packed-switch 0x1
:pswitch_8
:pswitch_10
:pswitch_16
:pswitch_1c
:pswitch_22
:pswitch_28
:pswitch_2e
:pswitch_38
:pswitch_40
:pswitch_4c
:pswitch_52
:pswitch_58
:pswitch_64
[B][COLOR="Blue"]:pswitch_7
:pswitch_7
:pswitch_7
:pswitch_7
:pswitch_7
:pswitch_7
:pswitch_6e[/COLOR][/B]
.end packed-switch
.end method
N.B: if your smali has :pswitch_7 and :pswitch_6e by default, then use another :pswitch_value for :pswitch_7 and :pswitch_6e. If you do so, then don't forget to change :pswitch_7 and :pswitch_6e value in added codes from the beginning above as well
Click to expand...
Click to collapse
Save changes...
KeyguardViewMediator.smali
- Search for ".field private static final SET_HIDDEN:I = 0xc" and add this line bellow it (the blue one):
Code:
.field private static final SET_HIDDEN:I = 0xc
[B][COLOR="Blue"].field private static final SET_TORCH:I = 0x14[/COLOR][/B]
.field private static final SHOW:I = 0x2
- Search for ".field private mTelephonyManager:Landroid/telephony/TelephonyManager;" and add thses lines bellow it (the blue ones):
Code:
.field private mTelephonyManager:Landroid/telephony/TelephonyManager;
[B][COLOR="Blue"].field private mTorchEnabled:Z
.field private mTorchStateChanged:Z[/COLOR][/B]
.field private mUnlockSoundId:I
- Search for this method ".method public constructor <init>(Landroid/content/Context;Lcom/android/internal/policy/impl/PhoneWindowManager;Landroid/os/LocalPowerManager;)V" and add these lines (the blue ones):
Code:
.method public constructor <init>(Landroid/content/Context;Lcom/android/internal/policy/impl/PhoneWindowManager;Landroid/os/LocalPowerManager;)V
.registers 15
.parameter "context"
.parameter "callback"
.parameter "powerManager"
.prologue
.line 308
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 188
[B][COLOR="Blue"]const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z[/COLOR][/B]
const/4 v0, 0x1
- Search for "const-string v0, "power"" and add these lines above it (the blue lines):
Code:
.line 311
iput-object p3, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mRealPowerManager:Landroid/os/LocalPowerManager;
.line 312
[B][COLOR="Blue"]const/4 v0, 0x0
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
const/4 v0, 0x0
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z[/COLOR][/B]
const-string v0, "power"
- Search for this method ".method static synthetic access$300(Lcom/android/internal/policy/impl/KeyguardViewMediator;I)V" and add this new method above it:
Code:
.method static synthetic access$2300(Lcom/android/internal/policy/impl/KeyguardViewMediator;Z)V
.registers 2
.parameter "x0"
.parameter "x1"
.prologue
.line 110
invoke-direct {p0, p1}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetHidden(Z)V
return-void
.end method
[B][COLOR="Blue"].method static synthetic access$[COLOR="Red"]2400[/COLOR](Lcom/android/internal/policy/impl/KeyguardViewMediator;Z)V
.registers 2
invoke-direct {p0, p1}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetTorch(Z)V
return-void
.end method[/COLOR][/B]
.method static synthetic access$300(Lcom/android/internal/policy/impl/KeyguardViewMediator;I)V
N.B: pay attention to $2400, that is increment to the method above it
Click to expand...
Click to collapse
- Search for the method ".method private handleHide()V" and add this line at end of this method (the blue one) just after "monitor-exit p0":
Code:
.method private handleHide()V
..
..
..
.line 1449
monitor-exit p0
[B][COLOR="Blue"]invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->resetTorchState()V[/COLOR][/B]
goto :goto_18
:catchall_45
move-exception v0
monitor-exit p0
:try_end_47
.catchall {:try_start_1 .. :try_end_47} :catchall_45
throw v0
.end method
.method private handleKeyguardDone(Z)V
- Search for the method ".method private handleNotifyScreenOff()V" and add this line (the blue one) just above "return-void":
Code:
.method private handleNotifyScreenOff()V
.registers 3
.prologue
.line 1597
monitor-enter p0
.line 1598
:try_start_1
const-string v0, "KeyguardViewMediator"
const-string v1, "handleNotifyScreenOff"
invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 1599
iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mKeyguardViewManager:Lcom/android/internal/policy/impl/KeyguardViewManager;
invoke-virtual {v0}, Lcom/android/internal/policy/impl/KeyguardViewManager;->onScreenTurnedOff()V
.line 1600
monitor-exit p0
.line 1601
[B][COLOR="Blue"]invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->resetTorchState()V[/COLOR][/B]
return-void
- Search for the method ".method private handleSetHidden(Z)V" and add this line (the blue one) above the defined condition in the method:
Code:
.method private handleSetHidden(Z)V
.registers 3
.parameter "isHidden"
.prologue
.line 688
monitor-enter p0
.line 689
:try_start_1
iget-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHidden:Z
if-eq v0, p1, :cond_10
.line 690
iput-boolean p1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHidden:Z
.line 691
invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->updateActivityLockScreenState()V
.line 692
invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->adjustUserActivityLocked()V
.line 693
invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->adjustStatusBarLocked()V
.line 695
[B][COLOR="Blue"]invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->resetTorchState()V[/COLOR][/B]
:cond_10
monitor-exit p0
- Search for the method ".method private handleShow()V" and add the following new method above it:
Code:
[B][COLOR="Blue"].method private handleSetTorch(Z)V
.registers 8
const/4 v5, 0x0
const/4 v4, 0x1
:try_start_2
iget-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
if-nez v1, :cond_majdi
iput-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
const/4 v1, 0x1
iput-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
:cond_[COLOR="Red"]b[/COLOR]
:goto_[COLOR="Red"]b[/COLOR]
return-void
:cond_majdi
iget-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
if-eq v1, p1, :cond_[COLOR="Red"]b[/COLOR]
iput-boolean p1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
new-instance v0, Landroid/content/Intent;
const-string v1, "net.cactii.flash2.TOGGLE_FLASHLIGHT"
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
const-string v1, "net.cactii.flash2.EXTRA_DISABLE_NOTIFICATION"
const/4 v2, 0x1
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mContext:Landroid/content/Context;
invoke-virtual {v1, v0}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V
:try_end_maj
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_maj} :catch_jdi
goto :goto_[COLOR="Red"]b[/COLOR]
:catch_jdi
move-exception v1
goto :goto_[COLOR="Red"]b[/COLOR]
.end method[/COLOR][/B]
.method private handleShow()V
N.B: pay attention to :cond_b and :goto_b that could be differ according to your ROM where b should be the exact the same first condition in this method ".method public isGlanceViewVisible()Z"
Code:
.method public isGlanceViewVisible()Z
.registers 2
.prologue
.line 666
iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mKeyguardViewManager:Lcom/android/internal/policy/impl/KeyguardViewManager;
if-eqz v0, [B][COLOR="Red"]:cond_b[/COLOR][/B]
.line 667
Click to expand...
Click to collapse
- Search for method ".method private handleShow()V", then search bellow for "Landroid/os/PowerManager$WakeLock;->release()V" and add these lines bellow it (the blue ones):
Code:
.method private handleShow()V
.registers 3
.prologue
.line 1400
monitor-enter p0
.line 1401
:try_start_1
const-string v0, "KeyguardViewMediator"
...
...
...
invoke-virtual {v0}, Landroid/os/PowerManager$WakeLock;->release()V
.line 1419
[B][COLOR="Blue"]const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z[/COLOR][/B]
monitor-exit p0
- Search for the method ".method private resetStateLocked()V" and add these lines (the blue ones) at the end before "return-void" line:
Code:
.method private resetStateLocked()V
.registers 4
...
...
invoke-virtual {v1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
.line 809
[B][COLOR="Blue"]return-void
.end method
.method private resetTorchState()V
.registers 2
iget-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
if-eqz v0, :cond_[COLOR="Red"]8[/COLOR]
const/4 v0, 0x0
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetTorch(Z)V
:cond_[COLOR="Red"]8[/COLOR][/COLOR][/B]
return-void
.end method
N.B: pay attention to :cond_8 that could be differ according to your ROM where 8 should be the exact the same first DEFINED condition in this method ".method private playSounds(Z)V"
Code:
.method private playSounds(Z)V
.registers 10
.parameter "locked"
.prologue
const/4 v5, 0x0
const/4 v4, 0x1
.line 1362
iget-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mSuppressNextLockSound:Z
if-eqz v0, :cond_9
.line 1363
iput-boolean v5, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mSuppressNextLockSound:Z
.line 1385
[B][COLOR="Red"]:cond_8[/COLOR][/B]
:goto_8
return-void
Click to expand...
Click to collapse
- Search for the method ".method public verifyUnlock(Landroid/view/WindowManagerPolicy$OnKeyguardExitResult;)V" and add this new method above it (the blue lines):
Code:
[B][COLOR="Blue"].method public setTorch(Z)V
.registers 7
const/16 v4, 0x14
const/4 v3, 0x0
iget-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mScreenOn:Z
if-eqz v1, :cond_newa
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
invoke-virtual {v1, v4}, Landroid/os/Handler;->removeMessages(I)V
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
if-eqz p1, :cond_newb
const/4 v2, 0x1
:goto_[COLOR="Red"]11[/COLOR]
invoke-virtual {v1, v4, v2, v3}, Landroid/os/Handler;->obtainMessage(III)Landroid/os/Message;
move-result-object v0
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
invoke-virtual {v1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
:cond_newa
return-void
:cond_newb
move v2, v3
goto :goto_[COLOR="Red"]11[/COLOR]
.end method[/COLOR][/B]
.method public verifyUnlock(Landroid/view/WindowManagerPolicy$OnKeyguardExitResult;)V
N.B: pay attention to :goto_11 that could be differ according to your ROM where 11 should be the exact the same goto action in this method ".method public isInputRestricted()Z"
Code:
.method public isInputRestricted()Z
.registers 2
..
..
[B][COLOR="Red"]:goto_11[/COLOR][/B]
return v0
:cond_12
const/4 v0, 0x0
goto :goto_11
.end method
Click to expand...
Click to collapse
Save changes..
PhoneWindowManager.smali
All changes here, will be in this method ".method public interceptKeyBeforeDispatching(Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/KeyEvent;I)J"; so it is better to know from which part of smali this method starts and ends in order to not touch other methods!!
- First search for the method ".method public interceptKeyBeforeDispatching(Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/KeyEvent;I)J",
- Search for "Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z" and add these lines bellow it (the blue ones):
Code:
.method public interceptKeyBeforeDispatching(Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/KeyEvent;I)J
.registers 56
...
...
...
...
.line 3364
:cond_2ba
if-nez v15, :cond_[B][COLOR="Red"]38c[/COLOR][/B]
.line 3365
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z
[B][COLOR="Blue"]if-eqz v0, :cond_[COLOR="Red"]38c[/COLOR]
const/16 v3, 0x0[/COLOR][/B]
move/from16 v20, v0
N.B: pay attention to if-eqz v0, :cond_38c where the condition number 38c is the same as IF condition above it
Click to expand...
Click to collapse
- Search for this portion (you can search down for ".catch Landroid/os/RemoteException" to locate this portion) and add this line (the blue one):
Code:
.line 3373
invoke-interface/range {v44 .. v44}, Lcom/android/internal/statusbar/IStatusBarService;->cancelPreloadRecentApps()V
:try_end_2dd
.catch Landroid/os/RemoteException; {:try_start_2d4 .. :try_end_2dd} :catch_329
.line 3381
.end local v44 #statusbar:Lcom/android/internal/statusbar/IStatusBarService;
:cond_2dd
:goto_2dd
const/4 v3, 0x0
move-object/from16 v0, p0
iput-boolean v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z
[B][COLOR="Blue"]invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->launchHomeFromHotKey()V[/COLOR][/B]
.line 3382
if-nez v36, :cond_32c
- Search down for "Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;->setHomeDownEventSent()V" and add this new code after defined condition:
Code:
.line 3470
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomeKeyDoubleClickConcept:Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;
invoke-virtual {v3}, Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;->setHomeDownEventSent()V
.line 3473
:cond_3a6
[B][COLOR="Blue"]new-instance v0, Ljava/io/File;
const-string v1, "/sdcard/Android"
invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V
invoke-virtual {v0}, Ljava/io/File;->exists()Z
move-result v0
if-eqz v0, :cond_majdi
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mKeyguardMediator:Lcom/android/internal/policy/impl/KeyguardViewMediator;
move-object/from16 v3, v0
invoke-virtual/range {v3 .. v3}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->isShowingAndNotHidden()Z
move-result v3
if-eqz v3, :cond_majdi
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mKeyguardMediator:Lcom/android/internal/policy/impl/KeyguardViewMediator;
move-object/from16 v3, v0
move-object/from16 v0, v3
move v1, v15
invoke-virtual {v0, v1}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->setTorch(Z)V
rem-int/lit8 v3, v41, 0xf
if-nez v3, :cond_majdi
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mKeyguardMediator:Lcom/android/internal/policy/impl/KeyguardViewMediator;
move-object/from16 v3, v0
invoke-virtual/range {v3 .. v3}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->pokeWakelock()V
:cond_majdi[/COLOR][/B]
const-wide/16 v3, 0x0
goto/16 :goto_8f
- Search down for "const/16 v3, 0xbb" (v3 may differ according to ROM) and do the following editing:
before:
Code:
.line 3635
:cond_[B][COLOR="Red"]536[/COLOR][/B] [B][COLOR="Green"]<-- we need to copy bellow condition over it[/COLOR][/B]
const/16 v3, 0xbb
move/from16 v0, v32
if-ne v0, v3, :cond_[B][COLOR="Red"]56f[/COLOR][/B] [B][COLOR="Green"]<-- we need to define new condition[/COLOR][/B]
.line 3637
move-object/from16 v0, p0
after:
Code:
.line 3635
:cond_[B][COLOR="Blue"]56f[/COLOR][/B]
const/16 v3, 0xbb
move/from16 v0, v32
if-ne v0, v3, :cond_[B][COLOR="Blue"]nj[/COLOR][/B]
.line 3637
move-object/from16 v0, p0
- Now we need to redefine mentioned cond_56f (it could be differ according to ROM), search UP for ".catch Landroid/content/ActivityNotFoundException;" and modify the IF-NE condition bellow it:
before:
Code:
.catch Landroid/content/ActivityNotFoundException; {:try_start_4fd .. :try_end_506} :catch_705
.line 3839
.end local v43 #shortcutIntent:Landroid/content/Intent;
:cond_506
:goto_506
const-wide/16 v3, -0x1
goto/16 :goto_8f
.line 3621
.end local v31 #kcm:Landroid/view/KeyCharacterMap;
:cond_50a
const/16 v3, 0x54
move/from16 v0, v32
if-ne v0, v3, [B][COLOR="Red"]:cond_536[/COLOR] [COLOR="Green"]<-- redefine this condition[/COLOR][/B]
.line 3622
if-eqz v15, :cond_522
after:
Code:
.catch Landroid/content/ActivityNotFoundException; {:try_start_4fd .. :try_end_506} :catch_705
.line 3839
.end local v43 #shortcutIntent:Landroid/content/Intent;
:cond_506
:goto_506
const-wide/16 v3, -0x1
goto/16 :goto_8f
.line 3621
.end local v31 #kcm:Landroid/view/KeyCharacterMap;
:cond_50a
const/16 v3, 0x54
move/from16 v0, v32
if-ne v0, v3, [B][COLOR="Blue"]:cond_56f[/COLOR][/B]
.line 3622
if-eqz v15, :cond_522
- Search down for "const/16 v3, 0xdb" (v3 may differ according to ROM) and change the condition value above it to the new condition from above mentioned edited code:
before:
Code:
.line 3654
.end local v16 #e:Landroid/os/RemoteException;
[B][COLOR="Red"]:cond_56f[/COLOR] [COLOR="Green"]<-- change it to the new condition[/COLOR][/B]
const/16 v3, 0xdb
move/from16 v0, v32
if-ne v0, v3, :cond_5a4
after:
Code:
.line 3654
.end local v16 #e:Landroid/os/RemoteException;
[B][COLOR="Blue"]:cond_nj[/COLOR][/B]
const/16 v3, 0xdb
move/from16 v0, v32
if-ne v0, v3, :cond_5a4
Save changes...
Now backsmali classsout folder to get new classes.dex file. Now Open android.policy.jar by WinRAR or 7-zip and drag and drop the new classes.dex file inside it; then push it to your device framework folder and fix permissions to chmod 644.
Download Torch.apk from attachment bellow and push it to your device app folder and fix permissions to chmod 644 as well... and viola.. lockscreen the device and do long pressing on home button to have torch flash light..:laugh:
If you could manage to shorten this tutorial by omitting unnecessary steps, then share your experience here please
thanks man
you're awesome
For those who want to make smali comparison, I attached the 3 mentioned smali before and after editing... So it will be easier to locate differences :laugh:
You can find them in the attachment bellow
wow a lot of work, and of course big thanks
your tutorials provide a real value for comunity, I have learned a lot with these.
thanks once again and keep up a great work!
p.s. waiting for someone to qoute op lol
edit: why your tutorials are not sticky threads (wondering)
Sent from my GT-N7000 using xda app-developers app
OMG ...
How you know all this???
You are boss..
Sent from my [email protected]£@×¥
my most loved app from robbie and miui roms. these however look like rocket science to me. therefore i'll leave this rocket science to the geniuses.
thank u. mcuh appreciatrd that everyone can now embed this wonderful feature into more roms.
With the steps that you have done in this mod, does long pressing the home button turn the torch on until the screen locks so that you can take your finger off the home button, or do you need to keep your finger on the home button the whole time for the torch to stay on?
daveyannihilation said:
With the steps that you have done in this mod, does long pressing the home button turn the torch on until the screen locks so that you can take your finger off the home button, or do you need to keep your finger on the home button the whole time for the torch to stay on?
Click to expand...
Click to collapse
press and hold = light on
release button = light off
sent from my G-Note
hara74 said:
press and hold = light on
release button = light off
sent from my G-Note
Click to expand...
Click to collapse
Thanks for the reply.
Is there any way of implementing the mods done in this thread: [MOD] [GUIDE] [JB BLK1] LockScreen Torch with toggle?
This actually keeps the torch on even after you release the home button, but it will turn off when the screen turns off either by timing out or pressing the lock button.
I tried to port it to Galaxy S II but I am not a master dev like majdinj so I couldn't get it to work. I am not too worried about the toggle to turn it on and off, but keeping the torch on after letting go of the home button would be great.
Thanks in advance,
Dave
sorry m8 I don't know,
maybe majdinj knows
sent from my G-Note
daveyannihilation said:
Thanks for the reply.
Is there any way of implementing the mods done in this thread: [MOD] [GUIDE] [JB BLK1] LockScreen Torch with toggle?
This actually keeps the torch on even after you release the home button, but it will turn off when the screen turns off either by timing out or pressing the lock button.
I tried to port it to Galaxy S II but I am not a master dev like majdinj so I couldn't get it to work. I am not too worried about the toggle to turn it on and off, but keeping the torch on after letting go of the home button would be great.
Thanks in advance,
Dave
Click to expand...
Click to collapse
You should pay attention to conditions buddy.. "You will not reach glory until you taste patience".. so try and try and try till you success :good:
majdinj said:
You should pay attention to conditions buddy.. "You will not reach glory until you taste patience".. so try and try and try till you success :good:
Click to expand...
Click to collapse
Thank you majdinj.
So what you're saying is, everywhere that I see a cond_ written in a method, I need to pay attention to where that cond is and what it does? Sorry, but smali code is like Swahili to me!
Thanks for your advice.
All the best,
Dave
Hi!
I'm having problem with PhoneWindowManager.smali. Most of the .line #### is not present. Should I add them? This is for Pristine ROM v4.0.
Sample.
On ".method public interceptKeyBeforeDispatching(Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/KeyEvent;I)J"
I should add a line under;
" .line 3365
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z"
but this codes are not present;
" .line 3364
:cond_2ba
if-nez v15, :cond_38c
.line 3365
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z"
and so on. Any help please? Thanks!
Installed apk on alborak (lt5). Seems not working (even rebooted). Any idea, sir.
Sent from my GT-N7000 using xda premium
ive perfectly followed each step of yours when i push the apk and the jar file
my phone hangs on boot screen ://
im sure ive perfectly edited the files
Hi, installed apk on lt6 sweet v9. No success. This is a useful app, can you pls do something.
Sent from my GT-N7000 using xda premium
dsmas said:
Hi, installed apk on lt6 sweet v9. No success. This is a useful app, can you pls do something.
Sent from my GT-N7000 using xda premium
Click to expand...
Click to collapse
you cannot just install the apk you have to go thru the procedure in OP.
I was searching for this mod for a long time ago.. I just found it in TeamUnion ROM .. I like the ROM but after a while it drain my battery so fast.. so I decide to install one clean Stock ROM like ebyee's ROM and add some little mod like call recording and etc.. was searching for this mod but haven't ever could figure out how it works.. Thanks majdinj for posting it here :good:
Sorry for bumping this thread. I don't entirely understand the tutorial.
I believe I'm on an odex rom (where .apk and .odex are in /system/app), and I'm not sure if it'll work for me.
I've downloaded all the programs (backsmali/smali/notepad++), but I don't understand what the procedure says. What does it mean to backsmali android.policy.jar? Where do I get this android.policy.jar?
rcheung28 said:
Sorry for bumping this thread. I don't entirely understand the tutorial.
I believe I'm on an odex rom (where .apk and .odex are in /system/app), and I'm not sure if it'll work for me.
I've downloaded all the programs (backsmali/smali/notepad++), but I don't understand what the procedure says. What does it mean to backsmali android.policy.jar? Where do I get this android.policy.jar?
Click to expand...
Click to collapse
It's in /system/framework but you will also need android.policy.odex which you will need to deodex to be able to see the smali files.
There is a thread in Samsung Galaxy SII Original Android Development by sicopat here: http://forum.xda-developers.com/showthread.php?t=1208320 which states how to deodex a jar file.
You will also need all of the other jar files from /system/framework to be able to deodex it properly.
If you need a hand or some tips, just ask.
Sent from my GT-I9505 using Tapatalk 4 Beta
Hell xda-er,,
It is me again :silly:
I took my shovel and start digging where could I disable this annoying dialogue when I toggle off mobile data connection from quick toggle panel... see the pictures
{
"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"
}
Now I can toggle off mobile data connection from quick toggle panel without seeing that dialogue anymore
Needed tools:
1) Baksmali tool from here.
2) Notepad++ from here.
The procedure:
- Baksmali SystemUI.apk.
- Go to classout/com/android/systemui/statusbar/policy/quicksetting folder and open MobileDataQuickSettingButton.smali
- Search for this method ".method private setMobileData(Z)V" and then go to its end and add this (goto) blue line:
Code:
.method private setMobileData(Z)V
.registers 6
.param p1, "on" # Z
.prologue
.line 248
iget-object v1, p0, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "quickpanel_mobiledata_checked"
const/4 v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$Secure;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
.line 250
.local v0, "mChecked":I
const-string v1, "STATUSBAR-MobileDataQuickSettingButton"
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
const-string v3, "Mobile data waring checked : "
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
invoke-static {v1, v2}, Landroid/util/Slog;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 252
[B][COLOR="Blue"]goto :cond_2d[/COLOR][/B]
if-nez p1, :cond_2d
if-nez v0, :cond_2d
.line 253
invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->onDisplayMobileDataOffAlert()V
.line 257
:goto_2c
return-void
.line 255
[B][COLOR="Red"]:cond_2d[/COLOR][/B] [B][COLOR="Green"]<!-- Make sure the new blue goto command above has the same cond value as this one[/COLOR][/B]
invoke-direct {p0, p1}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->setMobileDataEnabled(Z)V
goto :goto_2c
.end method
- Make sure of the blue :cond value in the new goto command to be the same as the red :cond value in the code. Here, the red value is :cond_2d so the blue will be :cond_2d as well.
Explanation:
By adding this goto command, we are telling the code to jump over the invoke alert dialogue command to the mobile data boolean directly then jump to void.
Click to expand...
Click to collapse
- Save changes.. smali (recompile).. push to phone.. fix permissions (644) and reboot.
Cheers
Thanks buddy! :good:
Your Guides are useful as always! Thanks for your digging!
Winterlove said:
Thanks buddy! :good:
Your Guides are useful as always! Thanks for your digging!
Click to expand...
Click to collapse
Thank you mate,,
Next time I will dig for gold
Let us know if u find some gold..
Sent from my GT-N7000 using xda premium
@majdinj
Why don't you make a ROM with all of your mods combined ?
M3TALLICA said:
@majdinj
Why don't you make a ROM with all of your mods combined ?
Click to expand...
Click to collapse
Even if was thinking same thing after seeing of your many new guides n mods.
It's time for Glory LTA
Sent from my GT-N7000 using xda premium
M3TALLICA said:
@majdinj
Why don't you make a ROM with all of your mods combined ?
Click to expand...
Click to collapse
That would be awesome!
M3TALLICA said:
@majdinj
Why don't you make a ROM with all of your mods combined ?
Click to expand...
Click to collapse
mjrifath said:
Even if was thinking same thing after seeing of your many new guides n mods.
It's time for Glory LTA
Sent from my GT-N7000 using xda premium
Click to expand...
Click to collapse
kmokhtar79 said:
That would be awesome!
Click to expand...
Click to collapse
Thanks guys for your warm feeling towards me,,, A lot of excellent ROMs are here in our forum, so I think you can stick to one of them since I myself like to discover more about source and resource coding, so I can give a good support to other ROMs.
majdinj said:
Thanks guys for your warm feeling towards me,,, A lot of excellent ROMs are here in our forum, so I think you can stick to one of them since I myself like to discover more about source and resource coding, so I can give a good support to other ROMs.
Click to expand...
Click to collapse
Agreed.. there is many plenty of TW base awesome roms available here. But it's hard to find a rom with complete mods. Example.. extended power menu, torch mod in lock screen, aosp lockscreen... maybe this is not required mods. But people need more customization with latest updates
Sent from my GT-N7000 using xda premium
I would like also to see a Rom with all your mods in. So in case you have enough time I would like to ask you to make one as many of the ROMS in the Android Development menu are out of date
Thank you for your mods.
mjrifath said:
Agreed.. there is many plenty of TW base awesome roms available here. But it's hard to find a rom with complete mods. Example.. extended power menu, torch mod in lock screen, aosp lockscreen... maybe this is not required mods. But people need more customization with latest updates
Sent from my GT-N7000 using xda premium
Click to expand...
Click to collapse
add spell checker and volume rocker to skip tracks.
what about i9305
I've tried this on i9305. It seem like I did all steps but no effect. Any idea? My corrected smalied and baksmalied again looks like this:
Code:
.method private setMobileData(Z)V
.locals 5
.param p1, "on" # Z
.prologue
.line 349
iget-object v1, p0, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "quickpanel_mobiledata_checked"
const/4 v3, 0x0
const/4 v4, -0x2
invoke-static {v1, v2, v3, v4}, Landroid/provider/Settings$Secure;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v0
.line 351
.local v0, "mChecked":I
const-string v1, "STATUSBAR-MobileDataQuickSettingButton"
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
const-string v3, "Mobile data waring checked : "
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
invoke-static {v1, v2}, Landroid/util/secutil/Log;->secD(Ljava/lang/String;Ljava/lang/String;)I
.line 353
goto :goto_39
if-nez p1, :cond_2f
if-nez v0, :cond_2f
.line 354
invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->onDisplayMobileDataOffAlert()V
.line 363
:goto_2e
return-void
.line 356
:cond_2f
if-eqz p1, :cond_39
sget-boolean v1, Lcom/android/systemui/statusbar/Feature;->mUseDataOnConfirmPopup:Z
if-eqz v1, :cond_39
.line 357
invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->onORGDisplayMobileDataOnAlert()V
goto :goto_2e
.line 360
:cond_39
:goto_39
invoke-direct {p0, p1}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->setMobileDataEnabled(Z)V
goto :goto_2e
.end method
does not work with dn4 mod 10
Fix is to make this change:
goto :cond_0 ====> this shud jump to line of setMobileDataEnabled
.line 375
if-nez p1, :cond_0
.line 376
if-nez v0, :cond_0
.line 377
invoke-direct {p0, v4}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->onDisplayMobileDataAlert(I)V
.line 384
:goto_0
return-void
.line 379
:cond_0
invoke-direct {p0, p1}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->setMobileDataEnabled(Z)V
goto :goto_0
.line 381
:cond_1
const/4 v1, 0x1
invoke-direct {p0, v1}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->onDisplayMobileDataAlert(I)V
goto :goto_0
.end method
Hi, I have a problem. I did all steps, changed everything like shown and smali into .apk
When I changed my oryginal systemUI.apk with new one it says that sysyemUI has stopped.
Can you tell me what could went wrong ? Maby my backsmali compiled apk with errors ? Any ideas, help how to fix that ?
1st THIS IS NOT MINE TUTORIAL
I just edit, fix and change the code from N9005 to I9500
Credits go to darkera13 (SAMSUNG Developer) from Samsungviet
Link to orginal thread here
2nd WHAT'D WE HAVE AFTER DOING THIS MOD
{
"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"
}
1. THIS MOD IS ONLY FOR DEODEXED OFFICIAL LOLLIPOP ROM: You'd prepare android.policy.jar and framework-res.apk
2. Decompile the framework-res.apk and open /res/values/arrays.xml with your favorite text editor
Search for:
Code:
[COLOR="SeaGreen"]<string-array name="config_globalActionsList">[/COLOR]
Add like following:
Code:
[COLOR="SeaGreen"]<string-array name="config_globalActionsList">
<item>power</item>
<item>datamode</item>
<item>airplane</item>
<item>restart</item>
<item>lockdown</item>
<item>bugreport</item>
<item>users</item>
<item>emergencymode</item>[/COLOR]
[COLOR="Red"] <item>flashlight</item>
<item>screenshot</item>[/COLOR]
[COLOR="SeaGreen"]</string-array>[/COLOR]
Save and open /res/values/strings.xml
Add to the end of file(EOF):
Code:
[COLOR="Red"] <string name="global_action_screenshot">Take Screenshot</string>
<string name="global_action_flashlight">Flashlight</string>
<string name="global_actions_flashlight_on_status">On</string>
<string name="global_actions_flashlight_off_status">Off</string>[/COLOR]
[COLOR="SeaGreen"]</resources>[/COLOR]
Save
Copy all PNG files in framework-res GlobalMenu_darkera13_samsungviet.vn.zip to /res/drawable-xhdpi and Compile
We'd get an apk: unsignedframework-res.apk
Now keep this file and decompile it. Then open /res/values/public.xml(in modified project unsignedframework-res.apk not framework-res.apk)
Note these lines to use in next big step
Code:
// This is what I got from recompiled [B]framework-res.apk[/B] might be different with your
// Note these lines to other place [B]not[/B] in public.xml because we just care about the number
<public type="string" name="global_action_screenshot" id="0x[B]01040ba5[/B]" /> -> const v4: [B]1040ba5[/B]
<public type="string" name="global_action_flashlight" id="0x[B]01040ba6[/B]" /> -> const v6: [B]1040ba6[/B]
<public type="string" name="global_actions_flashlight_on_status" id="0x0[B]1040ba7[/B]" /> -> const v7: [B]1040ba7[/B]
<public type="string" name="global_actions_flashlight_off_status" id="0x0[B]1040ba8[/B]" /> -> const v8: [B]1040ba8[/B]
<public type="drawable" name="tw_ic_lock_flashlight_on" id="0x0[B]1080b5c[/B]" /> -> const v4: [B]1080b5c[/B]
<public type="drawable" name="tw_ic_lock_flashlight_off" id="0x0[B]1080b5b[/B]" /> -> const v5: [B]1080b5b[/B]
<public type="drawable" name="tw_ic_lock_screenshot" id="0x0[B]1080b5d[/B]" /> -> const v3: [B]1080b5d[/B]
3. Decompile the android.policy.jar and open /com/android/internal/policy/impl/GlobalActions.smali
Search for:
Code:
[COLOR="SeaGreen"].field private mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR]
Add like following:
Code:
[COLOR="SeaGreen"].field private mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR]
[COLOR="Red"].field private mFlashlight:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
.field private mFlashlightState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
.field private mScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR]
Search for:
Code:
[COLOR="SeaGreen"]iput-object v3, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
sget-object v3, Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;->Off:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;[/COLOR]
Add like following:
Code:
[COLOR="SeaGreen"]iput-object v3, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
sget-object v3, Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;->Off:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;[/COLOR]
[COLOR="Red"]iput-object v3, p0, Lcom/android/internal/policy/impl/GlobalActions;->mFlashlightState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
sget-object v3, Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;->Off:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;[/COLOR]
Search for:
Code:
[COLOR="SeaGreen"].method static synthetic access$5000()Ljava/lang/String;[/COLOR]
Add like following:
Code:
[COLOR="SeaGreen"].method static synthetic access$5000()Ljava/lang/String;
.registers 1
.prologue
.line 161
sget-object v0, Lcom/android/internal/policy/impl/GlobalActions;->mScafe:Ljava/lang/String;
return-object v0
.end method[/COLOR]
[COLOR="Red"]
.method static synthetic access$500(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
.registers 2
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
return-object v0
.end method
.method static synthetic access$5000(Lcom/android/internal/policy/impl/GlobalActions;)Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
.registers 2
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mFlashlight:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
return-object v0
.end method
.method static synthetic access$5001(Lcom/android/internal/policy/impl/GlobalActions;)Z
.registers 2
invoke-direct {p0}, Lcom/android/internal/policy/impl/GlobalActions;->getTorchStatus()Z
move-result v0
return v0
.end method
[/COLOR]
Search for:
Code:
[COLOR="SeaGreen"]iput-object v2, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR]
Add like following * Remember sections in bold the the ids from public.xml you'll get when editing the framework-res.apk:
Code:
// This is what I got from recompiled [B]framework-res.apk[/B] might be different with your
// These lines are in other place [B]not[/B] in public.xml
<public type="string" name="global_action_screenshot" id="0x[B]01040ba5[/B]" /> -> const v4: [B]1040ba5[/B]
<public type="string" name="global_action_flashlight" id="0x[B]01040ba6[/B]" /> -> const v6: [B]1040ba6[/B]
<public type="string" name="global_actions_flashlight_on_status" id="0x0[B]1040ba7[/B]" /> -> const v7: [B]1040ba7[/B]
<public type="string" name="global_actions_flashlight_off_status" id="0x0[B]1040ba8[/B]" /> -> const v8: [B]1040ba8[/B]
<public type="drawable" name="tw_ic_lock_flashlight_on" id="0x0[B]1080b5c[/B]" /> -> const v4: [B]1080b5c[/B]
<public type="drawable" name="tw_ic_lock_flashlight_off" id="0x0[B]1080b5b[/B]" /> -> const v5: [B]1080b5b[/B]
<public type="drawable" name="tw_ic_lock_screenshot" id="0x0[B]1080b5d[/B]" /> -> const v3: [B]1080b5d[/B]
Code:
[COLOR="SeaGreen"] iput-object v2, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR]
[COLOR="Red"]
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$Flashlight;
const v4, [B]0x1080b5c[/B]
const v5, [B]0x1080b5b[/B]
const v6, [B]0x1040ba6[/B]
const v7, [B]0x1040ba7[/B]
const v8, [B]0x1040ba8[/B]
move-object/from16 v3, p0
invoke-direct/range {v2 .. v8}, Lcom/android/internal/policy/impl/GlobalActions$Flashlight;-><init>(Lcom/android/internal/policy/impl/GlobalActions;IIIII)V
move-object/from16 v0, p0
iput-object v2, v0, Lcom/android/internal/policy/impl/GlobalActions;->mFlashlight:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$Screenshot;
const v3, [B]0x1080b5d[/B]
const v4, [B]0x1040ba5[/B]
move-object/from16 v0, p0
invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$Screenshot;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v2, v0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR]
Search for:
Code:
[COLOR="SeaGreen"]const/16 v2, 0x100[/COLOR]
Add like following:
Code:
[COLOR="SeaGreen"] const/16 v2, 0x10
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDataModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
const/4 v5, 0x1
move-object/from16 v0, p0
invoke-direct {v0, v2, v3, v4, v5}, Lcom/android/internal/policy/impl/GlobalActions;->addDialogItemsIfEnabled(ILcom/android/internal/policy/impl/GlobalActions$Action;Ljava/util/ArrayList;Z)Z[/COLOR]
[COLOR="Red"] .line 1229
const/16 v2, 0x20
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
const/4 v5, 0x1
move-object/from16 v0, p0
invoke-direct {v0, v2, v3, v4, v5}, Lcom/android/internal/policy/impl/GlobalActions;->addDialogItemsIfEnabled(ILcom/android/internal/policy/impl/GlobalActions$Action;Ljava/util/ArrayList;Z)Z
.line 1230
const/16 v2, 0x40
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
const/4 v5, 0x1
move-object/from16 v0, p0
invoke-direct {v0, v2, v3, v4, v5}, Lcom/android/internal/policy/impl/GlobalActions;->addDialogItemsIfEnabled(ILcom/android/internal/policy/impl/GlobalActions$Action;Ljava/util/ArrayList;Z)Z[/COLOR]
Search for:
Code:
[COLOR="SeaGreen"]const-string v2, "emergencymode"[/COLOR]
Match 2 results, mark the line with:
Code:
:cond_2b6
const-string v2, "emergencymode"
Add like following:
Code:
[COLOR="SeaGreen"]:cond_2b6
const-string v2, "emergencymode"
invoke-virtual {v2, v9}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2[/COLOR]
[COLOR="Red"]if-eqz v2, :cond_315[/COLOR]
[COLOR="SeaGreen"].line 1291
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mEmergency:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v2, v3}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto :goto_24b[/COLOR]
[COLOR="Red"]:cond_315
const-string v2, "flashlight"
invoke-virtual {v2, v9}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_32a
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mFlashlight:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v2, v3}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto :goto_24b
:cond_32a
const-string v2, "screenshot"
invoke-virtual {v2, v9}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_2ca
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
invoke-virtual {v2, v3}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto :goto_24b[/COLOR]
[COLOR="SeaGreen"].line 1292
:cond_2ca
const-string v2, "silent"[/COLOR]
Search for:
Code:
[COLOR="SeaGreen"].method private prepareDialog()V[/COLOR]
Add to bottom like following:
Code:
[COLOR="SeaGreen"].method private prepareDialog()V
.registers 8[/COLOR]
[COLOR="Red"]invoke-direct {p0}, Lcom/android/internal/policy/impl/GlobalActions;->getTorchStatus()Z
move-result v1
if-eqz v1, :cond_20
sget-object v4, Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;->On:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mFlashlightState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
goto :cond_21
:cond_20
sget-object v4, Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;->Off:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mFlashlightState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
goto :cond_21
:cond_21[/COLOR]
Search for:
Code:
[COLOR="SeaGreen"].method private handleShow()V[/COLOR]
Add to above like following:
Code:
[COLOR="Red"].method private getTorchStatus()Z
.registers 7
.prologue
const/4 v0, 0x0
iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "torch_light"
const/4 v3, -0x2
invoke-static {v1, v2, v0, v3}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v1
if-eqz v1, :cond_11
const/4 v0, 0x1
:cond_11
return v0
.end method[/COLOR]
[COLOR="SeaGreen"].method private handleShow()V
.registers 7[/COLOR]
Search for:
Code:
[COLOR="SeaGreen"]const-string v4, "content://com.sec.knox.provider2/KnoxCustomManagerService1"[/COLOR]
Add to above like following:
Code:
[COLOR="Red"] iget-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mFlashlight:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
iget-object v5, p0, Lcom/android/internal/policy/impl/GlobalActions;->mFlashlightState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
invoke-virtual {v4, v5}, Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;->updateState(Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;)V[/COLOR]
[COLOR="SeaGreen"]const-string v4, "content://com.sec.knox.provider2/KnoxCustomManagerService1"[/COLOR]
Copy all smali files in andorid.policy.jar GlobalMenu_darkera13_samsungviet.vn.zip to /smali/com/android/internal/policy/impl and Compile the android.policy.jar4. Now you'd have unsignedframework-res.apk and mod_android.policy.jar. Rename them to framework-res.apk and android.policy.jar. Put it in CWM flashable zip and flash with TWRP or Philz.
Tested on:
LRX22C.I9500XXUHOAA Deodexed: Working
AURORA Lollipop Port Beta 5: Working
InFolder: Mediafire
reserver
Great guide
Great
good job mate :good: :highfive:
You're welcome
Great, thank you.
:good::good:
flash the zip ?
So flashing the zip will enable the toggles in the power menu ?
Can u provide screenshot .? It will be aweasome.
---------- Post added at 03:48 PM ---------- Previous post was at 03:45 PM ----------
Does it have 5way Reboot menu too?
gdskang said:
So flashing the zip will enable the toggles in the power menu ?
Click to expand...
Click to collapse
Of cause, flash the zip compatibles with your stock deodexed rom
HAYLCION said:
Can u provide screenshot .? It will be aweasome.
---------- Post added at 03:48 PM ---------- Previous post was at 03:45 PM ----------
Does it have 5way Reboot menu too?
Click to expand...
Click to collapse
Screenshot above. Definitely it has 5 ways reboot. If not please pm in this thread, I'll continue modding 5 ways reboot for you.
Flashed it and lost my power menu. Any fix for that ?
gdskang said:
Flashed it and lost my power menu. Any fix for that ?
Click to expand...
Click to collapse
What is the rom which you're using? Has it been deodexed yet?
ghoster76 said:
What is the rom which you're using? Has it been deodexed yet?
Click to expand...
Click to collapse
Using prism barebone v14.5
gdskang said:
Using prism barebone v14.5
Click to expand...
Click to collapse
I checked the Prism™ Barebone V14.5 and this rom might use 5 ways reboot mod and some other things, that in my modded OA7 hasn't already included. But luckily I did it for you. You could download modded Prism™ Barebone V14.5 files here
ghoster76 said:
I checked the Prism™ Barebone V14.5 and this rom might use 5 ways reboot mod and some other things, that in my modded OA7 hasn't already included. But luckily I did it for you. You could download modded Prism™ Barebone V14.5 files here
Click to expand...
Click to collapse
You modded the PBB files for the fix ?? Cool man.
ghoster76 said:
You're welcome
Click to expand...
Click to collapse
Btw, u come from samsungviet.vn right?? juz want to know your nick name on this forum [emoji16] [emoji14] [emoji173] [emoji7]
Sent from my SM-N910F
gdskang said:
You modded the PBB files for the fix ?? Cool man.
Click to expand...
Click to collapse
Yeah, I've done
nambavuong said:
Btw, u come from samsungviet.vn right?? juz want to know your nick name on this forum [emoji16] [emoji14] [emoji173] [emoji7]
Sent from my SM-N910F
Click to expand...
Click to collapse
I'm just a Junior Member with few posts. Here is my profile
ghoster76 said:
Yeah, I've done
I'm just a Junior Member with few posts. Here is my profile
Click to expand...
Click to collapse
Still no power menu. Flashed the file and the only the apps optimise. The phone just soft reboots when i hold the power button.
Found a fix yet ?
If you can't find a fix, can you upload the unmodded files ??
Pulling out the battery and rebooting into recovery is a tiresome job you know.
gdskang said:
Found a fix yet ?
If you can't find a fix, can you upload the unmodded files ??
Pulling out the battery and rebooting into recovery is a tiresome job you know.
Click to expand...
Click to collapse
Find your stock files here