[MOD][GB][GUIDE] how to added 4 way boot to your rom - Galaxy Y GT-S5360 Android Development

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

Related

[MOD][GUIDE][HOW TO] added 4way boot menu

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$4;" ( some roms might have different number on shutdown button. You find right one by for example tracing shutdown icon id )
-Change number 4 to 99 ( two of them )
Before
Code:
Code:
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$4;
const v3, 0x1080030
const v4, 0x1040121
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$4;->(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 ()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 ()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:
Hot boot is more than faster boot its unlocked on our device soo no need to use terminal emulator to activating this feature
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;->(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
Sent from my GT-S5360 using xda premium
Reserved
Sent from my GT-S5360 using xda premium
there is no knowledge for java needet???because i have in your posts nothing seen from java
Anyway a big thanx for your thread,for me its realy interesting,to know how android works,but with java i have awesome problem to learn how java works,thats makes me weird,lol.:good:
CALIBAN666 said:
there is no knowledge for java needet???because i have in your posts nothing seen from java
Anyway a big thanx for your thread,for me its realy interesting,to know how android works,but with java i have awesome problem to learn how java works,thats makes me weird,lol.:good:
Click to expand...
Click to collapse
No need just the brains
Its just a smali code u can learn it
Sent from my GT-S5360 using xda premium
Sure gonna try this.
------------------------------------------------
Like my work? consider hitting thanks.
b16h22 said:
Sure gonna try this.
------------------------------------------------
Like my work? consider hitting thanks.
Click to expand...
Click to collapse
Ok bro surely would be good stuff
Sent from my GT-S5360 using xda app-developers app
Hey bro..
Can you explain what is hot boot.?
Sent from Phonebooth
fata|i3y said:
Hey bro..
Can you explain what is hot boot.?
Sent from Phonebooth
Click to expand...
Click to collapse
Restarts the OS not the phone, that way its much faster than the conventional reboot method cause it doesnt need to power off the phone
Sent from my GT-S5360 using xda premium
fata|i3y said:
Hey bro..
Can you explain what is hot boot.?
Sent from Phonebooth
Click to expand...
Click to collapse
Already added in first post
Sent from my GT-S5360 using xda premium
NICE share bro.. go EPM! :good::good:
These are the kinds of posts which should be featured in the Android Development Section, aside from the ROMs. I will definitely give it a whirl bro. As always, thank you very much and keep sharing evanlocked. You rawk!
Yes it would be nice to try itits not a hards guides
Sent from my GT-S5360 using xda premium
Can u make flashable zip?
Thanks
Iam noob
Sent from my GT-S5360 using xda premium
bro evan..
i need some help...
can u made 1 for me...
this my android.policy.jar
http://db.tt/r6TFWny8
thanks so much bro evan...
Sent from my IMO S88 using xda premium
How would you go about removing the CWM Recovery options from the power menu? Want to make it safer for kids to use.
Sent from my GT-S5830 using xda app-developers app

[GUIDE][ICS][Easiest][How TO]Add 3-Way Boot to your Power Menu|Easiest Guide

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
First of all i would like to thanks Jimmy Lam for his framework and android.policy.jar from which i learnt by comparing
Requirements
Attached File
Notepad++
Backsmali Manager
Apktool
Patience
Brain Off cource
Click to expand...
Click to collapse
Ok i have divided this Guide in Two Parts to make it easy
In First Part we will edit framework and in second part we will edit android policy.jar
Part-1
Decompile Your framework-res.apk and move to
Code:
framework-res\res\values
Open Strings.xml with notepad++ or any other tool you use
paste the following lines in the end
Code:
<string name="global_action_reboot_now">Restart</string>
<string name="global_action_reboot_recovery">Recovery</string>
{
"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"
}
Close it and recompile.
Then again decompile and move to
Code:
framework-res\res\values
and note the following ids (you may have different)
Here we end our First Part.
Part-2
Decompile your android.policy.jar using backsmali managaer or any other tool
vDownload and extract the attached file to
Code:
android.policy\com\android\internal\policy\impl
Then open GlobalActions.smali
And do how i say
Before
Code:
.line 165
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$2;
const v2, 0x104013c
invoke-direct {v1, p0, v12, v2}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
.line 185
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
After
Just Add the Bold ( For A7/A5 Users just copy paste )
Code:
.line 165
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$2;
const v2, 0x104013a
invoke-direct {v1, p0, v12, v2}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
[B].line 183
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$8;
const v2, [COLOR="Red"]0x104054d[/COLOR]
invoke-direct {v1, p0, v12, v2}, Lcom/android/internal/policy/impl/GlobalActions$8;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
.line 184
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$9;
const v2, [COLOR="Red"]0x104054e[/COLOR]
invoke-direct {v1, p0, v12, v2}, Lcom/android/internal/policy/impl/GlobalActions$9;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z[/B]
.line 185
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
Note: Note Ids must be same as you noted in part 1
Code:
[COLOR="Red"]Only Replace last 7 digits of IDS when renaming in the above step [/COLOR]
Recompile and replace the classes.dex using Z-zip
Yipeee You Now have 3 Way boot:victory:
This Guide is tested by me and is working Fine
I have uploaded the Modded files for A5/A7/A7+ users so they can download and enjoy
Device Tested for this MOD
Karbonn A5
Karbonn A7
Karbonn A7+
Spice Mi355
Walton Primo
......Report yours if it works for you
Click to expand...
Click to collapse
Screenshot
Hit thanks to show your appreciation, it encourages me
reserved
one more reserved just in case
Tried this on a110 didnt get success.
Will try again and let u know.
Its not for touchwiz ROMs right
but how to change the icons of the restart and recovery option?
ahmed.zunaid said:
but how to change the icons of the restart and recovery option?
Click to expand...
Click to collapse
Thats a drawback of this MOD that it uses the icon of power off only
ahmed.zunaid said:
but how to change the icons of the restart and recovery option?
Click to expand...
Click to collapse
Inside framework res APK......Res folder....Hdpi folder....add two PNG and rename them to above names....
Sent from my Micromax A116 using Tapatalk 2
Dark4Droid said:
Inside framework res APK......Res folder....Hdpi folder....add two PNG and rename them to above names....
Sent from my Micromax A116 using Tapatalk 2
Click to expand...
Click to collapse
No need as the MOD uses the png of power off only
Is it only for ICS??
Sent from my Karbonn A9..
Ok.. This guide sparked my interest in getting this to work again - thank you.
So, it is working.. kind of.. But I broke the "Power off" option somehow.
This is what I did (only want Reboot, so I removed the Recovery option lines):
Added the strings and drawables to framework-res.. compiled, decompiled.. got my new public ids.
Added GlobalActions$9.smali to android.policy, and edited my GlobalActions.smali:
Original:
Code:
iget-object v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$2;
const v2, 0x1080030
const v3, 0x1040142
invoke-direct {v1, v10, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
iget-boolean v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->isDeepSleepSupported:Z
if-eqz v0, :cond_51
iget-object v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$3;
const v2, 0x108060d
const v3, 0x1040567
const v4, 0x1040568
invoke-direct {v1, v10, v2, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$3;-><init>(Lcom/android/internal/policy/impl/GlobalActions;III)V
Modded:
Code:
iget-object v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$2;
const v2, 0x1080030
const v3, 0x1040142
invoke-direct {v1, v10, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
[B]iget-object v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$9;
const v2, 0x108064b
const v3, 0x10406aa
invoke-direct {v1, v10, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$9;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z[/B]
iget-boolean v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->isDeepSleepSupported:Z
if-eqz v0, :cond_51
iget-object v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$3;
const v2, 0x108060d
const v3, 0x1040567
const v4, 0x1040568
invoke-direct {v1, v10, v2, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$3;-><init>(Lcom/android/internal/policy/impl/GlobalActions;III)V
So, Reboot works with a new icon.. but it gives me the "Power off" prompts when I hit reboot (but reboots normally). And, the Power off option now gives no prompts and reboots the phone..
Any ideas for a simple fix?
EDIT: Got it working a little better now..
I cross-referenced this thread, and edited my ShutdownThread.smali, copied my existing GlobalActions$2.smali (the one with the Shutdown stuff in it), renamed it to GlobalActions$9 and added that "reboot" bit to it as suggested in the other guide.
Bro not working in jellybean will try and post if working in ICS later(now on jb )
Sent from my Micromax A120 Quadcore HD using xda premium
alteredlikeness said:
Ok.. This guide sparked my interest in getting this to work again - thank you.
So, it is working.. kind of.. But I broke the "Power off" option somehow.
This is what I did (only want Reboot, so I removed the Recovery option lines):
Added the strings and drawables to framework-res.. compiled, decompiled.. got my new public ids.
Added GlobalActions$9.smali to android.policy, and edited my GlobalActions.smali:
Original:
Code:
iget-object v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$2;
const v2, 0x1080030
const v3, 0x1040142
invoke-direct {v1, v10, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
iget-boolean v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->isDeepSleepSupported:Z
if-eqz v0, :cond_51
iget-object v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$3;
const v2, 0x108060d
const v3, 0x1040567
const v4, 0x1040568
invoke-direct {v1, v10, v2, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$3;-><init>(Lcom/android/internal/policy/impl/GlobalActions;III)V
Modded:
Code:
iget-object v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$2;
const v2, 0x1080030
const v3, 0x1040142
invoke-direct {v1, v10, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
[B]iget-object v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$9;
const v2, 0x108064b
const v3, 0x10406aa
invoke-direct {v1, v10, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$9;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z[/B]
iget-boolean v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->isDeepSleepSupported:Z
if-eqz v0, :cond_51
iget-object v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$3;
const v2, 0x108060d
const v3, 0x1040567
const v4, 0x1040568
invoke-direct {v1, v10, v2, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$3;-><init>(Lcom/android/internal/policy/impl/GlobalActions;III)V
So, Reboot works with a new icon.. but it gives me the "Power off" prompts when I hit reboot (but reboots normally). And, the Power off option now gives no prompts and reboots the phone..
Any ideas for a simple fix?
EDIT: Got it working a little better now..
I cross-referenced this thread, and edited my ShutdownThread.smali, copied my existing GlobalActions$2.smali (the one with the Shutdown stuff in it), renamed it to GlobalActions$9 and added that "reboot" bit to it as suggested in the other guide.
Click to expand...
Click to collapse
Yeah actually this MOD uses every resource of Power Off but functions differently like Recovery will also show you power off prompt but will take you to recovery
Coudnt get it working on a110.
If u want to take a look up android.policy.jar tell me
.salil. said:
Coudnt get it working on a110.
If u want to take a look up android.policy.jar tell me
Click to expand...
Click to collapse
i am going to start developing on A110 as my friend has it and he wants a ROM from me so rather making only for him i will release it here also :angel: and i will try if it works on A110
karbonn A18
Hello guneet,
i am closely watching your every step towards success with a5.
can i ask you a favour?
i need this mod for karbonn a18 which runs on stock android 4.0.4
Pritesh.mohan said:
Hello guneet,
i am closely watching your every step towards success with a5.
can i ask you a favour?
i need this mod for karbonn a18 which runs on stock android 4.0.4
Click to expand...
Click to collapse
You can try it out with A18 and report in the thread
I don't find any credits.
is this your own work without reference?
shahulakthar said:
I don't find any credits.
is this your own work without reference?
Click to expand...
Click to collapse
Yeah this is my Own work and i have given thanks aka credits to the person which deserves that
The Droid Master said:
Yeah this is my Own work and i have given thanks aka credits to the person which deserves that
Click to expand...
Click to collapse
I missed 2nd line of ur post. Is there any success with a110? Any method to add them in JB?
shahulakthar said:
I missed 2nd line of ur post. Is there any success with a110? Any method to add them in JB?
Click to expand...
Click to collapse
Hmm bro i have not started my work for A110 as my friend(who has that device) is out of station so i will have to wait for him till then we(my team) is working on our Smart apps

GUIDE

SONY SMALL APPS FOR CM BASED ROM
1-STEP
decompile framework-res.apk
goto res/values/strings.xml and add these lines a the end
Code:
<string name="permlab_externalTaskSwitcher">Start as an external task switcher</string>
<string name="permdesc_externalTaskSwitcher">Allows the application to be an external task switcher replacing the native task switcher</string>
<string name="permlab_smallapp">Small application overlay</string>
<string name="permdesc_smallapp">Allows running movable small applications on top of other applications.</string>
open AndroidManifest.xml
and add the following lines
Code:
<permission android:name="android.permission.SYSTEM_ALERT_WINDOW" android:label="@string/permlab_systemAlertWindow" android:description="@string/permdesc_systemAlertWindow" android:protectionLevel="dangerous" android:permissionGroup="android.permission-group.SYSTEM_TOOLS" />
and
Code:
<permission android:name="com.sony.smallapp.permission.SMALLAPP" android:label="@string/permlab_smallapp" android:description="@string/permdesc_smallapp" android:protectionLevel="dangerous" />
like this shown in the pic..
{
"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"
}
done recompile the framework-res.apk
2-STEP
decompile android.policy.jar
and open comandroidinternalpolicyimplPhoneWindowManager.smal
and add the red marked lines
Code:
.field static final RECENT_APPS_BEHAVIOR_DISMISS_AND_SWITCH:I = 0x3
.field static final RECENT_APPS_BEHAVIOR_EXIT_TOUCH_MODE_AND_SHOW:I = 0x1
.field static final RECENT_APPS_BEHAVIOR_SHOW_OR_DISMISS:I = 0x0
.field static final SHOW_PROCESSES_ON_ALT_MENU:Z = false
.field static final SHOW_STARTING_ANIMATIONS:Z = true
[COLOR="red"].field static final SMALLAPP_LAYER:I = 0x3[/COLOR]
.field public static final SYSTEM_DIALOG_REASON_ASSIST:Ljava/lang/String; = "assist"
.field public static final SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS:Ljava/lang/String; = "globalactions"
.field public static final SYSTEM_DIALOG_REASON_HOME_KEY:Ljava/lang/String; = "homekey"
.field public static final SYSTEM_DIALOG_REASON_KEY:Ljava/lang/String; = "reason"
.field public static final SYSTEM_DIALOG_REASON_RECENT_APPS:Ljava/lang/String; = "recentapps"
and find these lines in the same file.
Code:
[COLOR="Blue"].method public checkAddPermission(Landroid/view/WindowManager$LayoutParams;)I
.locals 4
.parameter "attrs"
.prologue
const/4 v2, 0x0
.line 1588
iget v1, p1, Landroid/view/WindowManager$LayoutParams;->type:I
.line 1590
.local v1, type:I
const/16 v3, 0x7d0
if-lt v1, v3, :cond_0
const/16 v3, 0xbb7
if-le v1, v3, :cond_1
.line 1622
:cond_0
:goto_0
return v2
.line 1594
:cond_1
const/4 v0, 0x0
.line 1595
.local v0, permission:Ljava/lang/String;
sparse-switch v1, :sswitch_data_0
.line 1614
const-string v0, "android.permission.INTERNAL_SYSTEM_WINDOW"
.line 1616
:goto_1
:sswitch_0
if-eqz v0, :cond_0
.line 1617
iget-object v3, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v3, v0}, Landroid/content/Context;->checkCallingOrSelfPermission(Ljava/lang/String;)I
move-result v3
if-eqz v3, :cond_0
.line 1619
const/4 v2, -0x8
goto :goto_0
.line 1611
:sswitch_1
const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"
.line 1612
goto :goto_1
.line 1595
nop
:sswitch_data_0
.sparse-switch
0x7d2 -> :sswitch_1
0x7d3 -> :sswitch_1
0x7d5 -> :sswitch_0
0x7d6 -> :sswitch_1
0x7d7 -> :sswitch_1
0x7da -> :sswitch_1
0x7db -> :sswitch_0
0x7dd -> :sswitch_0
0x7e7 -> :sswitch_0
.end sparse-switch
.end method[/COLOR]
no is the funny part replace all the above blue marked lines with the below red marked lines
Code:
[COLOR="red"].method public checkAddPermission(Landroid/view/WindowManager$LayoutParams;)I
.locals 4
.parameter "attrs"
.prologue
const/4 v2, 0x0
.line 1115
iget v1, p1, Landroid/view/WindowManager$LayoutParams;->type:I
.line 1117
.local v1, type:I
const/16 v3, 0x7d0
if-lt v1, v3, :cond_0
const/16 v3, 0xbb7
if-le v1, v3, :cond_1
.line 1152
:cond_0
:goto_0
return v2
.line 1121
:cond_1
const/4 v0, 0x0
.line 1122
.local v0, permission:Ljava/lang/String;
sparse-switch v1, :sswitch_data_0
.line 1144
const-string v0, "android.permission.INTERNAL_SYSTEM_WINDOW"
.line 1146
:goto_1
:sswitch_0
if-eqz v0, :cond_0
.line 1147
iget-object v3, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v3, v0}, Landroid/content/Context;->checkCallingOrSelfPermission(Ljava/lang/String;)I
move-result v3
if-eqz v3, :cond_0
.line 1149
const/4 v2, -0x8
goto :goto_0
.line 1137
:sswitch_1
const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"
.line 1138
goto :goto_1
.line 1141
:sswitch_2
const-string v0, "com.sony.smallapp.permission.SMALLAPP"
.line 1142
goto :goto_1
.line 1122
:sswitch_data_0
.sparse-switch
0x7d2 -> :sswitch_1
0x7d3 -> :sswitch_1
0x7d5 -> :sswitch_0
0x7d6 -> :sswitch_1
0x7d7 -> :sswitch_1
0x7da -> :sswitch_1
0x7db -> :sswitch_0
0x7dd -> :sswitch_0
0xbb5 -> :sswitch_2
0xbb6 -> :sswitch_2
.end sparse-switch
.end method[/COLOR]
save it..done now recompile the android.policy.jar
3-STEP
decompile framework.jar
add the whole sony folder (provided in the resources.zip attached below ) in classout/com
and recompile framework.jar
4-STEP
now u need to add some files in system/app
system/etc
system/framework
all the files are provided in resources.zip so just take them and add those files in ur flashable zip
5-STEP
once u flash the mod .u need an Slauncher app to launch the small apps...download it from google play
so its done enjoy the smalls on cm based roms..
This method is tested working on most xperia devices and GALAXY SL
CREDITS
c3ma138 (for help , resources , app)
XDA:DevDB Information
[guide] how to port sony small apps for cm based roms, a App for the Samsung Galaxy S III I9300
Contributors
sandy7
Version Information
Status: Stable
Created 2013-09-06
Last Updated 2013-09-06
some screens
will it works on xperia ray cm10 fxp 214??
TheDynamiteGuy said:
will it works on xperia ray cm10 fxp 214??
Click to expand...
Click to collapse
for ray i have made a guide here http://forum.xda-developers.com/showthread.php?t=2122258
I wonder if this method(main idea) will work for touchpizz based firmwares mate,have to check sometime
anyway good work as always :good:
ThilinaC said:
I wonder if this method(main idea) will work for touchpizz based firmwares mate,have to check sometime
anyway good work as always :good:
Click to expand...
Click to collapse
Just a small contribution like u to bring some sony stuff to this forum..
But for touch never tried by me or by other..y not give a try...
Sent from my SK17i using XDA Premium HD app
There's no a tutorial that teaches you to place the Recents Menu Small app's custom?
lukakas said:
There's no a tutorial that teaches you to place the Recents Menu Small app's custom?
Click to expand...
Click to collapse
What?
Sent from my SK17i using XDA Premium HD app
sandy7 said:
What?
Sent from my SK17i using XDA Premium HD app
Click to expand...
Click to collapse
Sorry for my bad english but wanted to say if there a mod for "Recent app" menu like Sony with small app
lukakas said:
Sorry for my bad english but wanted to say if there a mod for "Recent app" menu like Sony with small app
Click to expand...
Click to collapse
Once tried it....but opening the recent apps the phone freezes there...me and other guy are working it..if succesful...ill post the new tut
Sent from my SK17i using XDA Premium HD app
sandy7 said:
Once tried it....but opening the recent apps the phone freezes there...me and other guy are working it..if succesful...ill post the new tut
Sent from my SK17i using XDA Premium HD app
Click to expand...
Click to collapse
This is incredible for working on it ... hope you can successfully do it.
Help
Hi guys,please help me,i followed this guide,decompiled all files,changed and compiled,android-policy.jar and framework.jar are compiled well,but framework-res.apk wont compile,can anyone make it for me please? Thank you.
Here is my framework-res.apk http://d-h.st/Wxv

[Guide] Long press volume rocker to skip song tracks (update 16/6/2013)

Hello xda members,
New day and new mod to learn, isn't it?
Today I will explain to you how to be able to change sound track by long pressing volume up or down while the screen is locked using stock Music Player and Google Play Music programs..
First I would like to say thanks to:
- xperiacle: who firstly port this mod to Galaxy Note.
- grilleld: who helped me by providing android.policy.jar from xperiacle ROM, so I could locate codes for this mod (I did some codes modifications to shortening the modding process , so it will be easy and straight forward).
Click to expand...
Click to collapse
OK let's start..
Needed tools:
1) Backsmali/Smali program (Check the utility I made for that here for windows users)
2) Notepad ++ from here.
The procedure:
- Backsmali android.policy.jar
- Navigate to com/android/internal/policy/impl/ folder and open PhoneWindowManager.smali
- Search for this static field ".field static final LONG_PRESS_POWER_SHUT_OFF:I = 0x2" and add this line bellow it (the blue one):
Code:
.field static final LONG_PRESS_POWER_SHUT_OFF:I = 0x2
[B][COLOR="Blue"].field private static final LONG_PRESS_TIMEOUT:I = 0x190[/COLOR][/B]
.field static final MINI_APP_DIALOG_LAYER:I = 0x5
Here you can set the timeout for long press event of volume rocker, here it is set to 400 millisecond (0x190).
Click to expand...
Click to collapse
- Search for this field ".field private mIsVisibleSPenGestureView:Z" and add these two lines bellow it (the blue ones):
Code:
.field private mIsVisibleSPenGestureView:Z
[B][COLOR="Blue"].field mIsVolumeAction:Z
.field mIsVolumeBlocking:Z[/COLOR][/B]
.field mKeyboardTapVibePattern:[J
- Search for the field ".field private mVolumeDownKeyTriggered:Z" and add this line bellow it (the blue one):
Code:
.field private mVolumeDownKeyTriggered:Z
[B][COLOR="Blue"].field mVolumeDownLongPress:Ljava/lang/Runnable;[/COLOR][/B]
.field private final mVolumeKeyLongPressforOneTouchReport:Ljava/lang/Runnable;
- Search for the field ".field private mVolumeUpKeyTriggered:Z" and add this line bellow it (the blue one):
Code:
.field private mVolumeUpKeyTriggered:Z
[B][COLOR="Blue"].field mVolumeUpLongPress:Ljava/lang/Runnable;[/COLOR][/B]
.field mWindowManager:Landroid/view/IWindowManager;
- Search for the method ".method public constructor <init>()V" and go to the end of this method and add these lines (the blue ones) before "return-void" line:
Code:
.line 7234
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$36;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$36;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenLockTimeout:Ljava/lang/Runnable;
[B][COLOR="Blue"]new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$Skip1;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$Skip1;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$Skip2;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$Skip2;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;[/COLOR][/B]
.line 8132
return-void
.end method
- Search for the method ".method handleVolumeKey(II)V" and add these lines above "invoke-static" line (the blue ones), and add extra condition line (the blue line) above "goto" command:
Code:
.method handleVolumeKey(II)V
.registers 8
.parameter "stream"
.parameter "keycode"
.prologue
.line 5405
[B][COLOR="Blue"]move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-nez v0, :cond_c[/COLOR][/B]
invoke-static {}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getAudioService()Landroid/media/IAudioService;
move-result-object v0
if-nez v0, :cond_d
[B][COLOR="Blue"]:cond_c[/COLOR][/B]
:goto_[B][COLOR="Blue"]c[/COLOR][/B]
return-void
Here we should change :goto_value to same as conditions we added, so it will be :goto_c
Click to expand...
Click to collapse
- Still in the same method, search down for "Landroid/os/PowerManager$WakeLock;->release()V" and change :goto value to the same as the one in the previous:
before:
Code:
iget-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;
invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->release()V
goto :goto_[B][COLOR="Red"]6[/COLOR][/B]
After:
Code:
iget-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;
invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->release()V
goto :goto_[B][COLOR="Blue"]c[/COLOR][/B]
- There is another one..!! Search down again for "Landroid/os/PowerManager$WakeLock;->release()V" and change :goto value to the same as the one in the previous step:
Before:
Code:
iget-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;
invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->release()V
goto :goto_[B][COLOR="Red"]6[/COLOR][/B]
After:
Code:
iget-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;
invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->release()V
goto :goto_[B][COLOR="Blue"]c[/COLOR][/B]
- Now at the end of the previous method ".method handleVolumeKey(II)V" and before the next method ".method public hasNavigationBar()Z", add these two new methods:
Code:
[B][COLOR="Blue"].method handleVolumeLongPress(I)V
.registers 6
const/4 v1, 0x1
move-object/from16 v0, p0
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
const/4 v1, 0x0
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
const/16 v1, 0x18
if-ne p1, v1, :cond_majdi
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
:goto_nj
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
sget v2, Lcom/android/internal/policy/impl/PhoneWindowManager;->LONG_PRESS_TIMEOUT:I
int-to-long v2, v2
invoke-virtual {v1, v0, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
return-void
:cond_majdi
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
goto :goto_nj
.end method
.method handleVolumeLongPressAbort()V
.registers 3
const/4 v1, 0x0
move-object/from16 v0, p0
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
return-void
.end method[/COLOR][/B]
- Now search for the method ".method public interceptKeyBeforeQueueing(Landroid/view/KeyEvent;IZ)I", then search down for "Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;" and add these lines ABOVE it (the blue ones):
Code:
:cond_51c
move-object/from16 v0, p0
[B][COLOR="Blue"]iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenOnEarly:Z
if-nez v0, :cond_dinj
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->isMusicActive()Z
move-result v29
if-eqz p0, :cond_dinj
move-object/from16 v0, p0
move/from16 v15, v19
invoke-virtual {v0, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPress(I)V
:cond_dinj
move-object/from16 v0, p0[/COLOR][/B]
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v29, v0
- Still in the same method, and after adding the previous lines, just go down for few lines and you will see a line starts with a defined condition (:cond_), just add these lines (the blue ones) bellow that defined condition:
Code:
invoke-virtual/range {v29 .. v29}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->start()V
goto/16 :goto_68
:cond_562
[B][COLOR="Blue"]if-nez v5, :cond_newa
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-eqz v0, :cond_newa
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
if-nez v0, :cond_newa
move-object/from16 v0, p0
const/4 v3, 0x0
move/from16 v15, v19
invoke-virtual {v0, v3, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
:cond_newa[/COLOR][/B]
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v29, v0
- Now at the end of the method ".method sendCloseSystemWindows(Ljava/lang/String;)V" and above the method ".method setAttachedWindowFrames(Landroid/view/WindowManagerPolicy$WindowState;IILandroid/view/WindowManagerPolicy$WindowState;ZLandroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;I)V" add this new method:
Code:
[B][COLOR="Blue"].method protected sendMediaButtonEvent(I)V
.registers 15
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v1
new-instance v11, Landroid/content/Intent;
const-string v4, "android.intent.action.MEDIA_BUTTON"
const/4 v5, 0x0
invoke-direct {v11, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
new-instance v0, Landroid/view/KeyEvent;
const/4 v5, 0x0
const/4 v7, 0x0
move-wide v3, v1
move v6, p1
invoke-direct/range {v0 .. v7}, Landroid/view/KeyEvent;-><init>(JJIII)V
const-string v4, "android.intent.extra.KEY_EVENT"
invoke-virtual {v11, v4, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const/4 v5, 0x0
invoke-virtual {v4, v11, v5}, Landroid/content/Context;->sendOrderedBroadcast(Landroid/content/Intent;Ljava/lang/String;)V
new-instance v12, Landroid/content/Intent;
const-string v4, "android.intent.action.MEDIA_BUTTON"
const/4 v5, 0x0
invoke-direct {v12, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
new-instance v3, Landroid/view/KeyEvent;
const/4 v8, 0x1
const/4 v10, 0x0
move-wide v4, v1
move-wide v6, v1
move v9, p1
invoke-direct/range {v3 .. v10}, Landroid/view/KeyEvent;-><init>(JJIII)V
const-string v4, "android.intent.extra.KEY_EVENT"
invoke-virtual {v12, v4, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const/4 v5, 0x0
invoke-virtual {v4, v12, v5}, Landroid/content/Context;->sendOrderedBroadcast(Landroid/content/Intent;Ljava/lang/String;)V
const/4 v8, 0x1
move-object/from16 v9, p0
iput-boolean v8, v9, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
return-void
.end method[/COLOR][/B]
Save changes..
Now add the two extra smalis resources from the attachment in com/android/internal/policy/impl folder and recompile android.policy.jar and push to your phone and fix permissions to chmod 644.
PS: for those who want to compare smalis, I also attached PhoneWindowManager.smali BEFORE and AFTER changes applied.
Click to expand...
Click to collapse
Have fun..
you are 'Mr. Guide'!!! Sharing is caring!!!
Wow, you don't have limits in innovation ^^, great work, will try to implement that on my rom ^^.
Thanks a lot majdinj
Please anybody try to do it on MIUI
Thanks
Just done and tested, it works great ^^, thanks majdinj
eybee1970 said:
you are 'Mr. Guide'!!! Sharing is caring!!!
Click to expand...
Click to collapse
Welcome eybee,,,, :laugh:
ezaechiel said:
Just done and tested, it works great ^^, thanks majdinj
Click to expand...
Click to collapse
thank you for testing
Any chance of adding in a ticker box to enable and disable this mod? Would be nice
maskerwsk said:
Any chance of adding in a ticker box to enable and disable this mod? Would be nice
Click to expand...
Click to collapse
Me too would like to,,, but I need to study more how are these things done,,, In the meanwhile enjoy the mod
Wow another great guide released .Thanks a lot :thumbup:
Sent from my GT-I9082 using Tapatalk 2
majdinj said:
Me too would like to,,, but I need to study more how are these things done,,, In the meanwhile enjoy the mod
Click to expand...
Click to collapse
I guess we'd have to start with secsettings res/xml/XXXXXX and add the ticker to the layout. Then add the corresponding methods to the smali files.
I will have a crack at this aswell as it would be nice to add enable/disable action to most mods
maskerwsk said:
I guess we'd have to start with secsettings res/xml/XXXXXX and add the ticker to the layout. Then add the corresponding methods to the smali files.
I will have a crack at this aswell as it would be nice to add enable/disable action to most mods
Click to expand...
Click to collapse
That would be great
maskerwsk said:
I guess we'd have to start with secsettings res/xml/XXXXXX and add the ticker to the layout. Then add the corresponding methods to the smali files.
I will have a crack at this aswell as it would be nice to add enable/disable action to most mods
Click to expand...
Click to collapse
I will be happy to learn that from you if possible man :laugh:
Code is updated to include timeout delay before long press event to occur..
Hi majdinj
I tried to put 5 seconds delay but it seems it doesn't work. I have same delay if I put 2 or 5 seconds and it less than a second.
Maybe I don't use the good hex format for time.
Could you tell me how to set 2 seconds delay please?
ezaechiel said:
Hi majdinj
I tried to put 5 seconds delay but it seems it doesn't work. I have same delay if I put 2 or 5 seconds and it less than a second.
Maybe I don't use the good hex format for time.
Could you tell me how to set 2 seconds delay please?
Click to expand...
Click to collapse
tbh, I don't know if it support 5 seconds or not,,,
but in general, to convert numbers to hex, grab any converter online; if you use windows PC, then open calculator --> view --> programmer, here put your delay time in millisecond in Dec format then just switch format to hex to get your number.. So for 2 seconds = 2000 milliseconds = 7d0, so you should put 0x7d0 in your script to have 2 seconds delay
majdinj said:
tbh, I don't know if it support 5 seconds or not,,,
but in general, to convert numbers to hex, grab any converter online; if you use windows PC, then open calculator --> view --> programmer, here put your delay time in millisecond in Dec format then just switch format to hex to get your number.. So for 2 seconds = 2000 milliseconds = 7d0, so you should put 0x7d0 in your script to have 2 seconds delay
Click to expand...
Click to collapse
Ok that's what I do but I can't see difference .
Thanks for your answer
EDIT : My bad, I missed a change in your tutorial , it works great now, sorry majdinj
ezaechiel said:
Ok that's what I do but I can't see difference .
Thanks for your answer
EDIT : My bad, I missed a change in your tutorial , it works great now, sorry majdinj
Click to expand...
Click to collapse
My pleasure,,
When i use the tool for uncompress android policy jar file it shows in the endd that it cant find androidpolicy classout folder
what is wrong?
jirka607 said:
When i use the tool for uncompress android policy jar file it shows in the endd that it cant find androidpolicy classout folder
what is wrong?
Click to expand...
Click to collapse
Do you use backsmali? Because you edit 1.bat with the name of android.policity.jar, run 1.bat and you'll see classout folder.
Well i put file into folder called put file here
Load it using 5 into the bat
then i press 1 and in the end there is error when i choose yes

[Guide] Remove Mobile Data Toggle off Warning Dialogue

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 ?

Categories

Resources