[GUIDE][How-to] New Power Menu JB - With Screenshot

Search This thread

tdunham

Recognized Contributor
Jun 21, 2008
13,686
36,462
TampaBay
This is based off of FL16/GB08 JB 4.1.2.

A touchwiz 4.3 guide has been posted here:

[Guide How-to/MOD] New Power Menu with Screenshot TW 4.3

This will allow you to have Recovery and Bootloader (download mode) right in the Power Menu selections. I grew tired of the extended restart menu so I wrote this.

This is not a flashable mod, it is a guide only.
The attached zip file are support files only that are necessary to create this modification.

Power Menu Guide

Code:
[U][B]Framework-res.apk changes[/B]:[/U]

Add these lines to res/values/strings.xml

[CODE]    <string name="download">Bootloader</string>
    <string name="recovery">Recovery</string>

Add the two png files in the attachment to:
res/drawable-hdpi

Recompile framework-res.apk.
Decompile the new framework-res.apk and open res/values/public.xml.
We need to write down these values because we need them later. Yours will probably be different. Leave off the leading zero:

Code:
    <public type="drawable" name="tw_ic_download" id="0x0[COLOR="Red"]1080ad6[/COLOR]" />
    <public type="drawable" name="tw_ic_recovery" id="0x0[COLOR="Red"]1080ad7[/COLOR]" />
    <public type="string" name="download" id="0x0[COLOR="Red"]1040843[/COLOR]" />
    <public type="string" name="recovery" id="0x0[COLOR="Red"]1040844[/COLOR]" />

Android.policy.jar changes:
Add the two smali files in the attachment to com\android\internal\policy\impl

Smali edit:
com\android\internal\policy\impl\GlobalActions.smali

New line before:

Code:
.field private mDialog:Landroid/app/AlertDialog;

.field private mHandler:Landroid/os/Handler;

After:

Code:
.field private mDialog:Landroid/app/AlertDialog;

[COLOR="Red"].field private mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

[/COLOR].field private mHandler:Landroid/os/Handler;



New line before:

Code:
.field private mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

.field private mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

After:

Code:
.field private mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

[COLOR="Red"].field private mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

[/COLOR].field private mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

Find around line 1075:

Code:
    .line 372
    new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$4;

    const v2, 0x10808ee

    const v3, 0x1040192

    move-object/from16 v0, p0

    invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$4;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

    move-object/from16 v0, p0

    iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    .line 399

Add new lines after this section:
***NOTE THE LINES IN BLUE, THESE MUST MATCH THE VALUES WE GOT FROM FRAMEWORK (without the leading zero)***

Code:
    .line 372
    new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$4;

    const v2, 0x10808ee

    const v3, 0x1040192

    move-object/from16 v0, p0

    invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$4;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

    move-object/from16 v0, p0

    iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    .line 399
[COLOR="Red"]    new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$Download;

    const v2, 0x[COLOR="Blue"]1080ad6[/COLOR]

    const v3, 0x[COLOR="Blue"]1040843[/COLOR]

    move-object/from16 v0, p0

    invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$Download;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

    move-object/from16 v0, p0

    iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    .line 400
    new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$Recovery;

    const v2, 0x[COLOR="Blue"]1080ad7[/COLOR]

    const v3, 0x[COLOR="Blue"]1040844[/COLOR]

    move-object/from16 v0, p0

    invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$Recovery;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

    move-object/from16 v0, p0

    iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    .line 401
[/COLOR]    new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$5;

Now we are going to expand the existing array to include 2 more entries.

Around line 1138:

Before:

Code:
    .line 428
    const/4 v1, 0x5

After:

Code:
    .line 428
    [COLOR="Red"]const/4 v1, 0x7[/COLOR]

Find around line 1137:

Code:
    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;

    aput-object v3, v1, v2

    const/4 v2, 0x4

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    aput-object v3, v1, v2

    invoke-static {v1}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;

Replace with:

Code:
    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;

    aput-object v3, v1, v2

    const/4 v2, 0x4

    move-object/from16 v0, p0

[COLOR="Red"]    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    aput-object v3, v1, v2

    const/4 v2, 0x5

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    aput-object v3, v1, v2

    const/4 v2, 0x6

    move-object/from16 v0, p0[/COLOR]

    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    aput-object v3, v1, v2

    invoke-static {v1}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;



How to remove menu items:

Smali edit:
com\android\internal\policy\impl\GlobalActions.smali


We need to reconfigure the array that displays the options.

Before:

Code:
.line 428
    const/4 v1, 0x7

    new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;

    const/4 v2, 0x0

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAccessiblityShortcut:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    aput-object v3, v1, v2

    const/4 v2, 0x1

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    aput-object v3, v1, v2

    const/4 v2, 0x2

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDataModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;

    aput-object v3, v1, v2

    const/4 v2, 0x3

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;

    aput-object v3, v1, v2

    const/4 v2, 0x4

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    aput-object v3, v1, v2

    const/4 v2, 0x5

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    aput-object v3, v1, v2

    const/4 v2, 0x6

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    aput-object v3, v1, v2

    invoke-static {v1}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;

    move-result-object v1

    move-object/from16 v0, p0

    iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;

We need to split up the array so that we can easily see the different sections.
It will make it easier to modify the line you want to remove.

Code:
    .line 428
    const/4 v1, 0x7

    new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;

    #	

    const/4 v2, 0x0

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAccessiblityShortcut:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    aput-object v3, v1, v2

    #

    const/4 v2, 0x1

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    aput-object v3, v1, v2

    #

    const/4 v2, 0x2

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDataModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;

    aput-object v3, v1, v2

    #

    const/4 v2, 0x3

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;

    aput-object v3, v1, v2

    #

    const/4 v2, 0x4

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    aput-object v3, v1, v2

    #

    const/4 v2, 0x5

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    aput-object v3, v1, v2

    #

    const/4 v2, 0x6

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    aput-object v3, v1, v2

    #

    invoke-static {v1}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;

    move-result-object v1

    move-object/from16 v0, p0

    iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;


Now we will remove the Data Network Mode and Airplane Mode choices from the menu. We need to shrink the array by 2 and also renumber the remaining options. Please note the changes in red.

Code:
    .line 428
[COLOR="Red"]    const/4 v1, 0x5[/COLOR]

    new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;

    #	

    const/4 v2, 0x0

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAccessiblityShortcut:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    aput-object v3, v1, v2

    #

    const/4 v2, 0x1

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    aput-object v3, v1, v2

    #

[COLOR="Red"]    # const/4 v2, 0x2

    # move-object/from16 v0, p0

    # iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDataModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;

    # aput-object v3, v1, v2
[/COLOR]
    #

[COLOR="Red"]    # const/4 v2, 0x3

    # move-object/from16 v0, p0

    # iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;

    # aput-object v3, v1, v2[/COLOR]

    #

[COLOR="Red"]    const/4 v2, 0x2[/COLOR]

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    aput-object v3, v1, v2

    #

[COLOR="Red"]    const/4 v2, 0x3
[/COLOR]
    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    aput-object v3, v1, v2

    #

[COLOR="Red"]    const/4 v2, 0x4
[/COLOR]
    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    aput-object v3, v1, v2

    #

    invoke-static {v1}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;

    move-result-object v1

    move-object/from16 v0, p0

    iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;

Note: Use of the # symbol is not necessary. I use it simply for clarification and to separate out the sections for easier viewing while editing. Additionally, any lines edited with the # symbol will be ignored when recompiling.


Addendum - Adding Screenshot to Power Menu
(This is an addon to the original Power Menu Guide posted above).
Framework-res.apk changes:

Add these lines to res/values/strings.xml

Code:
    <string name="global_action_screenshot_txt">Screenshot</string>

Add png file in the screenshot attachment to:
res/drawable-hdpi

Recompile framework-res.apk.
Decompile the new framework-res.apk and open res/values/public.xml.
We need to write down these values because we need them later. Yours will probably be different. Leave off the leading zero:

Code:
<public type="string" name="global_action_screenshot_txt" id="0x01040845" />
<public type="drawable" name="tw_ic_screenshot" id="0x01080ad8" />

Android.policy.jar changes:
Add the two smali files in the attachment to com\android\internal\policy\impl

Smali edit:
com\android\internal\policy\impl\GlobalActions.smali

New line before:
Code:
.field private mRingerModeReceiver:Landroid/content/BroadcastReceiver;

.field private mSilentModeAction:Lcom/android/internal/policy/impl/GlobalActions$SilentModeAction;

After:
Code:
.field private mRingerModeReceiver:Landroid/content/BroadcastReceiver;

[COLOR="Red"].field private mScreenCapture:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR]

.field private mSilentModeAction:Lcom/android/internal/policy/impl/GlobalActions$SilentModeAction;

New Section Before:
Code:
    .line 372
    new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$4;

    const v2, 0x10808ee

    const v3, 0x1040192

    move-object/from16 v0, p0

    invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$4;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

    move-object/from16 v0, p0

    iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    .line 399
    new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$Download;

    const v2, 0x1080ad6

    const v3, 0x1040843

    move-object/from16 v0, p0

    invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$Download;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

    move-object/from16 v0, p0

    iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

After:
***NOTE THE LINES IN BLUE, THESE MUST MATCH THE VALUES WE GOT FROM FRAMEWORK (without the leading zero)***
Code:
    .line 372
    new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$4;

    const v2, 0x10808ee

    const v3, 0x1040192

    move-object/from16 v0, p0

    invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$4;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

    move-object/from16 v0, p0

    iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

[COLOR="Red"]    .line 388
    new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$16;

    const v2, 0x[COLOR="Blue"]1080ad8[/COLOR]

    const v3, 0x[COLOR="Blue"]1040845[/COLOR]

    move-object/from16 v0, p0

    invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$16;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

    move-object/from16 v0, p0

    iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenCapture:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[/COLOR]
    .line 399
    new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$Download;

    const v2, 0x1080ad6

    const v3, 0x1040843

    move-object/from16 v0, p0

    invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$Download;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

    move-object/from16 v0, p0

    iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;


Now to edit the array and add ScreenShot
NOTE: FYI, here we are removing replacing DataToggle with Airplane Mode to keep menu from overlapping the screen.
Find around line 1180:
Code:
    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDataModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;

    aput-object v3, v1, v2

    const/4 v2, 0x3

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;

    aput-object v3, v1, v2

    const/4 v2, 0x4

    move-object/from16 v0, p0

Replace with:
Code:
   [COLOR="Red"] iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;[/COLOR]    
    aput-object v3, v1, v2

    const/4 v2, 0x3

    move-object/from16 v0, p0

    [COLOR="Red"]iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenCapture:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR]

    aput-object v3, v1, v2

    const/4 v2, 0x4

    move-object/from16 v0, p0


If porting this to another phone
Important update info for Screenshot mod
:

You may have to possibly change this value in GlobalActions$16$1.smali which is one of the addon files to match your code.
Code:
invoke-static {v2}, Lcom/android/internal/policy/impl/GlobalActions;->[COLOR="Red"]access$200[/COLOR](Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;

Here is my access$200 in GlobalActions.smali, just search for the line in red. If it is different access$xxx in your smali, also change access$xxx to match in GlobalActions$16$1.smali:
Code:
.method static synthetic access$200(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
    .registers 2
    .parameter "x0"

    .prologue
    .line 88
    [COLOR="Red"]iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;[/COLOR]

    return-object v0
.end method


Credits to Mirko DDD for the ScreenShot method!!!
 

Attachments

  • ScreenShot_Files.zip
    7 KB · Views: 1,746
Last edited:

PanchoPlanet

Senior Member
Oct 15, 2011
3,896
984
Crooklyn
Re: [GUIDE][How-to] New Power Menu JB

So those the zip replace all the script changes in the op?
:confused:
Not sure, changes to script+zip - or just zip to get new power menu?

Pp.:):beer:

sent from a jellybean filled epic touch.
 

tdunham

Recognized Contributor
Jun 21, 2008
13,686
36,462
TampaBay
Re: [GUIDE][How-to] New Power Menu JB

So those the zip replace all the script changes in the op?
:confused:
Not sure, changes to script+zip - or just zip to get new power menu?

Pp.:):beer:

sent from a jellybean filled epic touch.

The zip contains extra support files that need to be added to the classes.dex file before it gets recompiled. So yes, the last part of what you said.
And also a couple files for the framework edit are in the zip too.
Sent from my SPH-D710 using xda premium
 

Samsung Fanboy

Senior Member
Dec 15, 2012
126
44
Re: [GUIDE][How-to] New Power Menu JB

This thread got mentioned on Google+, keep up the good work!

hezebupa.jpg


Sent from my SPH-D710 using Xparent Skyblue Tapatalk 2
 

PanchoPlanet

Senior Member
Oct 15, 2011
3,896
984
Crooklyn
Re: [GUIDE][How-to] New Power Menu JB

Congrats Td on the write-up and recognition. :thumbup::beer::beer::beer::D

Keep up the great work and contributions to the community.

Pp.:):):):beer::beer::beer:

sent from a jellybean filled epic touch.
 

Dr.Acula

Senior Member
Jan 4, 2013
389
193
Hi @tdunham
I have been trying to add recovery option using or guide.
It goes well with framework-res.apk but stuck at android. policy.jar
While editing global action.smali I can't find any thing u specified.
Have appached the file
 

Attachments

  • GlobalActions.smali.zip
    6.9 KB · Views: 21

tdunham

Recognized Contributor
Jun 21, 2008
13,686
36,462
TampaBay
Hi @tdunham
I have been trying to add recovery option using or guide.
It goes well with framework-res.apk but stuck at android. policy.jar
While editing global action.smali I can't find any thing u specified.
Have appached the file
This doesn't look like it came from a touchwiz rom. What rom did you pull it from?
 

tdunham

Recognized Contributor
Jun 21, 2008
13,686
36,462
TampaBay
Uh its not touchwiz:(
Is there a way to get through:confused:
The method is very different and I do not see too many similarities on how they created power menu in this one. I am only familiar with Touchwiz, maybe someone more familiar with the platform you are using could help using same principle but it would require a much different approach.
 
  • Like
Reactions: HighlanderZA

Dr.Acula

Senior Member
Jan 4, 2013
389
193
Re: [GUIDE][How-to] New Power Menu JB

The method is very different and I do not see too many similarities on how they created power menu in this one. I am only familiar with Touchwiz, maybe someone more familiar with the platform you are using could help using same principle but it would require a much different approach.

Kk
Thanks anyway.


Sent from
my bullet proof revolver™ //"="" ````°.
 

crawrj

Senior Member
Nov 2, 2007
3,557
3,865
I didn't see a post for this anywhere and didn't want to make a separate one since this is all TD's work. Here is the Power Mod for stock GB27. TD you can post this in the OP or do whatever you want with it. Your guide was excellent and I thank you for putting that together for us.

Download: GB27 Power Mod Deodexed http://tinyw.in/yMcu
MD5: 2df0540be214e3d85bac3eedea0c794d

GB27 Power Mod Odexed http://tinyw.in/9DXd
MD5: 4eddf84ad1cc6b50d36e281ae5be05bf
 
  • Like
Reactions: tdunham

JonSCSL

Senior Member
Jan 27, 2012
770
362
Annapolis Maryland
I didn't see a post for this anywhere and didn't want to make a separate one since this is all TD's work. Here is the Power Mod for stock GB27. TD you can post this in the OP or do whatever you want with it. Your guide was excellent and I thank you for putting that together for us.

Download: GB27 Power Mod Deodexed http://tinyw.in/yMcu
MD5: 2df0540be214e3d85bac3eedea0c794d

GB27 Power Mod Odexed http://tinyw.in/9DXd
MD5: 4eddf84ad1cc6b50d36e281ae5be05bf

Just curious is there a screen shot of this? Wondering what options are in the power menu?

Sent from my SPH-D710 using Tapatalk 2
 

Top Liked Posts

  • There are no posts matching your filters.
  • 64
    This is based off of FL16/GB08 JB 4.1.2.

    A touchwiz 4.3 guide has been posted here:

    [Guide How-to/MOD] New Power Menu with Screenshot TW 4.3

    This will allow you to have Recovery and Bootloader (download mode) right in the Power Menu selections. I grew tired of the extended restart menu so I wrote this.

    This is not a flashable mod, it is a guide only.
    The attached zip file are support files only that are necessary to create this modification.

    Power Menu Guide

    Code:
    [U][B]Framework-res.apk changes[/B]:[/U]
    
    Add these lines to res/values/strings.xml
    
    [CODE]    <string name="download">Bootloader</string>
        <string name="recovery">Recovery</string>

    Add the two png files in the attachment to:
    res/drawable-hdpi

    Recompile framework-res.apk.
    Decompile the new framework-res.apk and open res/values/public.xml.
    We need to write down these values because we need them later. Yours will probably be different. Leave off the leading zero:

    Code:
        <public type="drawable" name="tw_ic_download" id="0x0[COLOR="Red"]1080ad6[/COLOR]" />
        <public type="drawable" name="tw_ic_recovery" id="0x0[COLOR="Red"]1080ad7[/COLOR]" />
        <public type="string" name="download" id="0x0[COLOR="Red"]1040843[/COLOR]" />
        <public type="string" name="recovery" id="0x0[COLOR="Red"]1040844[/COLOR]" />

    Android.policy.jar changes:
    Add the two smali files in the attachment to com\android\internal\policy\impl

    Smali edit:
    com\android\internal\policy\impl\GlobalActions.smali

    New line before:

    Code:
    .field private mDialog:Landroid/app/AlertDialog;
    
    .field private mHandler:Landroid/os/Handler;

    After:

    Code:
    .field private mDialog:Landroid/app/AlertDialog;
    
    [COLOR="Red"].field private mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
    [/COLOR].field private mHandler:Landroid/os/Handler;



    New line before:

    Code:
    .field private mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
    .field private mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    After:

    Code:
    .field private mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
    [COLOR="Red"].field private mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
    [/COLOR].field private mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    Find around line 1075:

    Code:
        .line 372
        new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$4;
    
        const v2, 0x10808ee
    
        const v3, 0x1040192
    
        move-object/from16 v0, p0
    
        invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$4;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
        move-object/from16 v0, p0
    
        iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
        .line 399

    Add new lines after this section:
    ***NOTE THE LINES IN BLUE, THESE MUST MATCH THE VALUES WE GOT FROM FRAMEWORK (without the leading zero)***

    Code:
        .line 372
        new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$4;
    
        const v2, 0x10808ee
    
        const v3, 0x1040192
    
        move-object/from16 v0, p0
    
        invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$4;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
        move-object/from16 v0, p0
    
        iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        .line 399
    [COLOR="Red"]    new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$Download;
    
        const v2, 0x[COLOR="Blue"]1080ad6[/COLOR]
    
        const v3, 0x[COLOR="Blue"]1040843[/COLOR]
    
        move-object/from16 v0, p0
    
        invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$Download;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
        move-object/from16 v0, p0
    
        iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        .line 400
        new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$Recovery;
    
        const v2, 0x[COLOR="Blue"]1080ad7[/COLOR]
    
        const v3, 0x[COLOR="Blue"]1040844[/COLOR]
    
        move-object/from16 v0, p0
    
        invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$Recovery;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
        move-object/from16 v0, p0
    
        iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        .line 401
    [/COLOR]    new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$5;

    Now we are going to expand the existing array to include 2 more entries.

    Around line 1138:

    Before:

    Code:
        .line 428
        const/4 v1, 0x5

    After:

    Code:
        .line 428
        [COLOR="Red"]const/4 v1, 0x7[/COLOR]

    Find around line 1137:

    Code:
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
    
        aput-object v3, v1, v2
    
        const/4 v2, 0x4
    
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2
    
        invoke-static {v1}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;

    Replace with:

    Code:
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
    
        aput-object v3, v1, v2
    
        const/4 v2, 0x4
    
        move-object/from16 v0, p0
    
    [COLOR="Red"]    iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2
    
        const/4 v2, 0x5
    
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2
    
        const/4 v2, 0x6
    
        move-object/from16 v0, p0[/COLOR]
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2
    
        invoke-static {v1}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;



    How to remove menu items:

    Smali edit:
    com\android\internal\policy\impl\GlobalActions.smali


    We need to reconfigure the array that displays the options.

    Before:

    Code:
    .line 428
        const/4 v1, 0x7
    
        new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
    
        const/4 v2, 0x0
    
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAccessiblityShortcut:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2
    
        const/4 v2, 0x1
    
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2
    
        const/4 v2, 0x2
    
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDataModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
    
        aput-object v3, v1, v2
    
        const/4 v2, 0x3
    
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
    
        aput-object v3, v1, v2
    
        const/4 v2, 0x4
    
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2
    
        const/4 v2, 0x5
    
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2
    
        const/4 v2, 0x6
    
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2
    
        invoke-static {v1}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;
    
        move-result-object v1
    
        move-object/from16 v0, p0
    
        iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;

    We need to split up the array so that we can easily see the different sections.
    It will make it easier to modify the line you want to remove.

    Code:
        .line 428
        const/4 v1, 0x7
    
        new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
    
        #	
    
        const/4 v2, 0x0
    
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAccessiblityShortcut:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2
    
        #
    
        const/4 v2, 0x1
    
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2
    
        #
    
        const/4 v2, 0x2
    
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDataModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
    
        aput-object v3, v1, v2
    
        #
    
        const/4 v2, 0x3
    
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
    
        aput-object v3, v1, v2
    
        #
    
        const/4 v2, 0x4
    
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2
    
        #
    
        const/4 v2, 0x5
    
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2
    
        #
    
        const/4 v2, 0x6
    
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2
    
        #
    
        invoke-static {v1}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;
    
        move-result-object v1
    
        move-object/from16 v0, p0
    
        iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;


    Now we will remove the Data Network Mode and Airplane Mode choices from the menu. We need to shrink the array by 2 and also renumber the remaining options. Please note the changes in red.

    Code:
        .line 428
    [COLOR="Red"]    const/4 v1, 0x5[/COLOR]
    
        new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
    
        #	
    
        const/4 v2, 0x0
    
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAccessiblityShortcut:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2
    
        #
    
        const/4 v2, 0x1
    
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2
    
        #
    
    [COLOR="Red"]    # const/4 v2, 0x2
    
        # move-object/from16 v0, p0
    
        # iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDataModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
    
        # aput-object v3, v1, v2
    [/COLOR]
        #
    
    [COLOR="Red"]    # const/4 v2, 0x3
    
        # move-object/from16 v0, p0
    
        # iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
    
        # aput-object v3, v1, v2[/COLOR]
    
        #
    
    [COLOR="Red"]    const/4 v2, 0x2[/COLOR]
    
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2
    
        #
    
    [COLOR="Red"]    const/4 v2, 0x3
    [/COLOR]
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2
    
        #
    
    [COLOR="Red"]    const/4 v2, 0x4
    [/COLOR]
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
        aput-object v3, v1, v2
    
        #
    
        invoke-static {v1}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;
    
        move-result-object v1
    
        move-object/from16 v0, p0
    
        iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;

    Note: Use of the # symbol is not necessary. I use it simply for clarification and to separate out the sections for easier viewing while editing. Additionally, any lines edited with the # symbol will be ignored when recompiling.


    Addendum - Adding Screenshot to Power Menu
    (This is an addon to the original Power Menu Guide posted above).
    Framework-res.apk changes:

    Add these lines to res/values/strings.xml

    Code:
        <string name="global_action_screenshot_txt">Screenshot</string>

    Add png file in the screenshot attachment to:
    res/drawable-hdpi

    Recompile framework-res.apk.
    Decompile the new framework-res.apk and open res/values/public.xml.
    We need to write down these values because we need them later. Yours will probably be different. Leave off the leading zero:

    Code:
    <public type="string" name="global_action_screenshot_txt" id="0x01040845" />
    <public type="drawable" name="tw_ic_screenshot" id="0x01080ad8" />

    Android.policy.jar changes:
    Add the two smali files in the attachment to com\android\internal\policy\impl

    Smali edit:
    com\android\internal\policy\impl\GlobalActions.smali

    New line before:
    Code:
    .field private mRingerModeReceiver:Landroid/content/BroadcastReceiver;
    
    .field private mSilentModeAction:Lcom/android/internal/policy/impl/GlobalActions$SilentModeAction;

    After:
    Code:
    .field private mRingerModeReceiver:Landroid/content/BroadcastReceiver;
    
    [COLOR="Red"].field private mScreenCapture:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR]
    
    .field private mSilentModeAction:Lcom/android/internal/policy/impl/GlobalActions$SilentModeAction;

    New Section Before:
    Code:
        .line 372
        new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$4;
    
        const v2, 0x10808ee
    
        const v3, 0x1040192
    
        move-object/from16 v0, p0
    
        invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$4;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
        move-object/from16 v0, p0
    
        iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
        .line 399
        new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$Download;
    
        const v2, 0x1080ad6
    
        const v3, 0x1040843
    
        move-object/from16 v0, p0
    
        invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$Download;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
        move-object/from16 v0, p0
    
        iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    After:
    ***NOTE THE LINES IN BLUE, THESE MUST MATCH THE VALUES WE GOT FROM FRAMEWORK (without the leading zero)***
    Code:
        .line 372
        new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$4;
    
        const v2, 0x10808ee
    
        const v3, 0x1040192
    
        move-object/from16 v0, p0
    
        invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$4;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
        move-object/from16 v0, p0
    
        iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    
    [COLOR="Red"]    .line 388
        new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$16;
    
        const v2, 0x[COLOR="Blue"]1080ad8[/COLOR]
    
        const v3, 0x[COLOR="Blue"]1040845[/COLOR]
    
        move-object/from16 v0, p0
    
        invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$16;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
        move-object/from16 v0, p0
    
        iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenCapture:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
    [/COLOR]
        .line 399
        new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$Download;
    
        const v2, 0x1080ad6
    
        const v3, 0x1040843
    
        move-object/from16 v0, p0
    
        invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$Download;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
        move-object/from16 v0, p0
    
        iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;


    Now to edit the array and add ScreenShot
    NOTE: FYI, here we are removing replacing DataToggle with Airplane Mode to keep menu from overlapping the screen.
    Find around line 1180:
    Code:
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDataModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
    
        aput-object v3, v1, v2
    
        const/4 v2, 0x3
    
        move-object/from16 v0, p0
    
        iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
    
        aput-object v3, v1, v2
    
        const/4 v2, 0x4
    
        move-object/from16 v0, p0

    Replace with:
    Code:
       [COLOR="Red"] iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;[/COLOR]    
        aput-object v3, v1, v2
    
        const/4 v2, 0x3
    
        move-object/from16 v0, p0
    
        [COLOR="Red"]iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenCapture:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR]
    
        aput-object v3, v1, v2
    
        const/4 v2, 0x4
    
        move-object/from16 v0, p0


    If porting this to another phone
    Important update info for Screenshot mod
    :

    You may have to possibly change this value in GlobalActions$16$1.smali which is one of the addon files to match your code.
    Code:
    invoke-static {v2}, Lcom/android/internal/policy/impl/GlobalActions;->[COLOR="Red"]access$200[/COLOR](Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;

    Here is my access$200 in GlobalActions.smali, just search for the line in red. If it is different access$xxx in your smali, also change access$xxx to match in GlobalActions$16$1.smali:
    Code:
    .method static synthetic access$200(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
        .registers 2
        .parameter "x0"
    
        .prologue
        .line 88
        [COLOR="Red"]iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;[/COLOR]
    
        return-object v0
    .end method


    Credits to Mirko DDD for the ScreenShot method!!!
    9
    OP updated with new section.
    How to remove options from Power Menu. Screenshot attached with modification.
    4
    Re: [GUIDE][How-to] New Power Menu JB

    So those the zip replace all the script changes in the op?
    :confused:
    Not sure, changes to script+zip - or just zip to get new power menu?

    Pp.:):beer:

    sent from a jellybean filled epic touch.

    The zip contains extra support files that need to be added to the classes.dex file before it gets recompiled. So yes, the last part of what you said.
    And also a couple files for the framework edit are in the zip too.
    Sent from my SPH-D710 using xda premium
    3
    Re: [GUIDE][How-to] New Power Menu JB

    This thread got mentioned on Google+, keep up the good work!

    hezebupa.jpg


    Sent from my SPH-D710 using Xparent Skyblue Tapatalk 2
    3
    Screenshot Guide

    Screenshot Guide added to the OP as an addon to the original power menu.
    Don't forget to download the extra attachment for screenshot support files.

    If you have any issue with the addendum, let me know as I don't have time to test it from scratch.
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone