[Galaxy Note 3 Android Development] yash92duster:
5Way Reboot TW Marshmallow

Although Note 3 may never get MM release I felt this is better place to update the guide for Power Menu options

So the modification is still the same but as you may or not know we global actions are moved to services.jar in MM. So decompile services.jar and do as follow:

go to services.jar\smali\com\android\server\policy\GlobalActions.smali

find below line in .method private createDialog()Lcom/android/server/policy/GlobalActions$GlobalActionsDialog;

new-instance v5, Lcom/android/server/policy/GlobalActions[COLOR="Red"]$9[/COLOR];

and change to

new-instance v5, Lcom/android/server/policy/GlobalActions[COLOR="Blue"]$99[/COLOR];

and

invoke-direct {v5, v0, v4, v6}, Lcom/android/server/policy/GlobalActions[COLOR="Red"]$9[/COLOR];->(Lcom/android/server/policy/GlobalActions;II)V

to

invoke-direct {v5, v0, v4, v6}, Lcom/android/server/policy/GlobalActions[COLOR="Blue"]$99[/COLOR];->(Lcom/android/server/policy/GlobalActions;II)V

in GlobalActions$SinglePressAction add lines in blue

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/server/policy/GlobalActions;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x40a
name = "SinglePressAction"
.end annotation

[COLOR="Blue"]# static fields
.field public static rebootMode:I

.field public static final rebootOptions:[Ljava/lang/String;

.field public static final rebootString:[Ljava/lang/String;[/COLOR]

# instance fields

and also

[COLOR="Blue"]# direct methods
.method static constructor <clinit>()V
.locals 9

const/4 v8, 0x5

const/4 v7, 0x4

const/4 v6, 0x3

const/4 v5, 0x2

const/4 v4, 0x1

const/4 v3, 0x0

new-array v0, v8, [Ljava/lang/String;

const-string/jumbo v2, "Reboot"

aput-object v2, v0, v3

const-string/jumbo v2, "Hot Reboot"

aput-object v2, v0, v4

const-string/jumbo v2, "Download"

aput-object v2, v0, v5

const-string/jumbo v2, "Recovery"

aput-object v2, v0, v6

const-string/jumbo v2, "Safe Mode"

aput-object v2, v0, v7

sput-object v0, Lcom/android/server/policy/GlobalActions$SinglePressAction;->rebootString:[Ljava/lang/String;

new-array v1, v8, [Ljava/lang/String;

const-string v2, "Reboot"

aput-object v2, v1, v3

const-string v2, "Hot Reboot"

aput-object v2, v1, v4

const-string v2, "Download"

aput-object v2, v1, v5

const-string v2, "Recovery"

aput-object v2, v1, v6

const-string v2, "Safe Mode"

aput-object v2, v1, v7

sput-object v1, Lcom/android/server/policy/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;

return-void
.end method[/COLOR]

.method protected constructor[COLOR="Blue"] <init>[/COLOR](II)V

Now download attached smalis and drop it in services.jar\smali\com\android\server\policy folder

To change power menu title it is same as lollipop, find const-string v2, "Reboot Menu" and change to whatever you wish

compile and profit.

PS: If you are using this guide please consider credit in your OP.

It worked fine before

now when i try doing it from scratch i face error

Made changes and Added smalis

but

When I press power button Device restarts and not showing power menu

Without any changes to services.jar when i press button i can see latest power menu, see attachment

I have removed old .direct methods added new .direct methods in GlobalActions$SinglePressAction.smali as per guide

previously also did the same it worked and now something error

GlobalActions$SinglePressAction.smali

# direct methods

.method static constructor <clinit>()V

.registers 9

const/4 v8, 0x5

const/4 v7, 0x4

const/4 v6, 0x3

const/4 v5, 0x2

const/4 v4, 0x1

const/4 v3, 0x0

new-array v0, v8, [Ljava/lang/String;

const-string/jumbo v2, "Reboot"

aput-object v2, v0, v3

const-string/jumbo v2, "Hot Reboot"

aput-object v2, v0, v4

const-string/jumbo v2, "Download"

aput-object v2, v0, v5

const-string/jumbo v2, "Recovery"

aput-object v2, v0, v6

const-string/jumbo v2, "Safe Mode"

aput-object v2, v0, v7

sput-object v0, Lcom/android/server/policy/GlobalActions$SinglePressAction;->rebootString:[Ljava/lang/String;

new-array v1, v8, [Ljava/lang/String;

const-string v2, "Reboot"

aput-object v2, v1, v3

const-string v2, "Hot Reboot"

aput-object v2, v1, v4

const-string v2, "Download"

aput-object v2, v1, v5

const-string v2, "Recovery"

aput-object v2, v1, v6

const-string v2, "Safe Mode"

aput-object v2, v1, v7

sput-object v1, Lcom/android/server/policy/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;

return-void

.end method

.method protected constructor <init>(II)V

.registers 5

.param p1, "iconResId" # I

.param p2, "icon" # Landroid/graphics/drawable/Drawable;

.param p3, "message" # Ljava/lang/CharSequence;

.prologue

const/4 v0, 0x0

.line 3617

invoke-direct {p0}, Ljava/lang/Object;-><init>()V

.line 3593

iput-boolean v0, p0, Lcom/android/server/policy/GlobalActions$SinglePressAction;->isKnoxCustom:Z

.line 3594

iput v0, p0, Lcom/android/server/policy/GlobalActions$SinglePressAction;->customAction:I

.line 3618

iput p1, p0, Lcom/android/server/policy/GlobalActions$SinglePressAction;->mIconResId:I

.line 3619

iput v0, p0, Lcom/android/server/policy/GlobalActions$SinglePressAction;->mMessageResId:I

.line 3620

iput-object p3, p0, Lcom/android/server/policy/GlobalActions$SinglePressAction;->mMessage:Ljava/lang/CharSequence;

.line 3621

iput-object p2, p0, Lcom/android/server/policy/GlobalActions$SinglePressAction;->mIcon:Landroid/graphics/drawable/Drawable;

.line 3623

invoke-direct {p0}, Lcom/android/server/policy/GlobalActions$SinglePressAction;->init()V

.line 3625

return-void

.end method

My Log

--------------------------------------------------

Batch ApkTool : 3.4.5

SMALI : smali-2.1.2.jar

API level : 23

APKTOOL : apktool_2.1.1.jar

build in EXPERT mode : NO

Sign output APKs : NO

--------------------------------------------------

[*] Smaling services...

_INPUT_JAR\services\smali\com\android\server\policy\GlobalActions$SinglePressAction.smali[115,4] Register p3 is larger than the maximum register v4 for this method

[*] ---> Error smaling "services"

DONE with 1 ERRORS.

I have attached GlobalActions$SinglePressAction.smali also

Can someone help

where it has gone wrong

My Device: galaxy S5 G900H Exynos

Os : Stock Deodexed MM 6.0.1