[Galaxy S6 General] asc1977:
I have spoke with [MENTION=4507636]edzamber[/MENTION] but he is in holidays so i share here for him the new working guide for S6 that all matches our phone and working

Add Screenshot and Screen Recorder in Power Menu

First decompile framework-res.apk

Copy attached files from framework.zip to decompiled framework-res.apk in same folder

open framework-res/res/values/arrays.xml

find this and add in blue

<string-array name="config_globalActionsList">
<item>power</item>
<item>datamode</item>
<item>airplane</item>
<item>restart</item>
<item>lockdown</item>
<item>bugreport</item>
<item>users</item>
<item>emergencymode</item>
<item>subscreen</item>
[COLOR="blue"]<item>screenshot</item>
<item>screenrec</item>[/COLOR]
</string-array>

open framework-res/res/values/strings.xml

add this two string to the end of file

<string name="global_action_screenshot">Take Screenshot</string>
<string name="screenrec">Screen Recorder</string>

Recompile and after decompile the recompiled framework-res.apk for getting new public ids for:

<public type="drawable" name="tw_ic_lock_screenrec" id="[COLOR="Purple"]0x01080bb3[/COLOR]" /> [COLOR="purple"]#ID can be different[/COLOR]
<public type="drawable" name="tw_ic_lock_screenshot" id="[COLOR="purple"]0x01080bb4[/COLOR]" /> [COLOR="purple"]#ID can be different[/COLOR]
<public type="string" name="global_action_screenshot" id="[COLOR="purple"]0x01040c74[/COLOR]" /> [COLOR="purple"]#ID can be different[/COLOR]
<public type="string" name="screenrec" id="[COLOR="purple"]0x01040c75[/COLOR]" /> [COLOR="purple"]#ID can be different[/COLOR]

Now Recompile framework-res.apk again

Framework-res.apk now is finish

Decompile services.jar

copy attached smali from services.zip to decompiled services.jar on same folder

open services.jar/com/android/server/policy/GlobalActions.smali

find and add blue after it

.field private static final GLOBAL_ACTION_KEY_RESTART:Ljava/lang/String; = "restart"

[COLOR="Blue"].field private static final GLOBAL_ACTION_KEY_SCREENREC:Ljava/lang/String; = "screenrec"[/COLOR]

find and add blue after it

.field private mRingerModeReceiver:Landroid/content/BroadcastReceiver;
[COLOR="blue"]
.field mScreenRec:Lcom/android/server/policy/GlobalActions$SinglePressAction;

.field private mScreenshot:Lcom/android/server/policy/GlobalActions$SinglePressAction;[/COLOR]

find and add blue after it

.method static synthetic access$5000()Z
.registers 1

.prologue
.line 206
sget-boolean v0, Lcom/android/server/policy/GlobalActions;->mProKioskOptionShown:Z

return v0
.end method

[COLOR="Blue"].method static synthetic access$5001(Lcom/android/server/policy/GlobalActions;)V
.registers 1

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

return-void
.end method[/COLOR]

Search for this method

.method private createDialog()Lcom/android/server/policy/GlobalActions$GlobalActionsDialog;

And add this blue lines on method and change red lines to your public id:

....
.....
.....
new-instance v5, Lcom/android/server/policy/GlobalActions$99;

sget-boolean v4, Lcom/android/server/policy/GlobalActions;->mNewFeatureForM:Z

if-eqz v4, :cond_1ee

const v4, 0x1080a48

:goto_11c
const v6, 0x10408d1

move-object/from16 v0, p0

invoke-direct {v5, v0, v4, v6}, Lcom/android/server/policy/GlobalActions$99;-><init>(Lcom/android/server/policy/GlobalActions;II)V

move-object/from16 v0, p0

iput-object v5, v0, Lcom/android/server/policy/GlobalActions;->mRestart:Lcom/android/server/policy/GlobalActions$SinglePressAction;

[COLOR="blue"]new-instance v4, Lcom/android/server/policy/GlobalActions$Screenshot;[/COLOR]

const v5, [COLOR="Red"]0x1080bb4 [/COLOR]# <public type="drawable" name="tw_ic_lock_screenshot" id="0x01080bb4" />

const v6, [COLOR="red"]0x1040c74 [/COLOR]# <public type="string" name="global_action_screenshot" id="0x01040c74" />

[COLOR="Blue"]move-object/from16 v0, p0

invoke-direct {v4, v0, v5, v6}, Lcom/android/server/policy/GlobalActions$Screenshot;-><init>(Lcom/android/server/policy/GlobalActions;II)V

move-object/from16 v0, p0

iput-object v4, v0, Lcom/android/server/policy/GlobalActions;->mScreenshot:Lcom/android/server/policy/GlobalActions$SinglePressAction;

new-instance v4, Lcom/android/server/policy/GlobalActions$98;

[/COLOR] const v5, [COLOR="Red"]0x1080bb3 [/COLOR]# <public type="drawable" name="tw_ic_lock_screenrec" id="0x01080bb3" />

const v6, [COLOR="red"]0x1040c75 [/COLOR]# <public type="string" name="screenrec" id="0x01040c75" />

[COLOR="Blue"] move-object/from16 v0, p0

invoke-direct {v4, v0, v5, v6}, Lcom/android/server/policy/GlobalActions$98;-><init>(Lcom/android/server/policy/GlobalActions;II)V

move-object/from16 v0, p0

iput-object v4, v0, Lcom/android/server/policy/GlobalActions;->mScreenRec:Lcom/android/server/policy/GlobalActions$SinglePressAction;
[/COLOR]
new-instance v4, Ljava/util/ArrayList;

invoke-direct {v4}, Ljava/util/ArrayList;-><init>()V

now add this blue lines too

invoke-direct {v0, v4, v5, v6, v7}, Lcom/android/server/policy/GlobalActions;->addDialogItemsIfEnabled(ILcom/android/server/policy/GlobalActions
$Action;Ljava/util/ArrayList;Z)Z

const/16 v4, 0x100

invoke-direct/range {p0 .. p0}, Lcom/android/server/policy/GlobalActions;->getBugReportAction()Lcom/android/server/policy/GlobalActions$Action;

move-result-object v5

move-object/from16 v0, p0

iget-object v6, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;

const/4 v7, 0x1

move-object/from16 v0, p0

invoke-direct {v0, v4, v5, v6, v7}, Lcom/android/server/policy/GlobalActions;->addDialogItemsIfEnabled(ILcom/android/server/policy/GlobalActions$Action;Ljava/util/ArrayList;Z)Z

[COLOR="Blue"] const/16 v4, 0x200

move-object/from16 v0, p0

iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mScreenshot:Lcom/android/server/policy/GlobalActions$SinglePressAction;

move-object/from16 v0, p0

iget-object v6, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;

const/4 v7, 0x1

move-object/from16 v0, p0

invoke-direct {v0, v4, v5, v6, v7}, Lcom/android/server/policy/GlobalActions;->addDialogItemsIfEnabled(ILcom/android/server/policy/GlobalActions$Action;Ljava/util/ArrayList;Z)Z

const/16 v4, 0x400

move-object/from16 v0, p0

iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mScreenRec:Lcom/android/server/policy/GlobalActions$SinglePressAction;

move-object/from16 v0, p0

iget-object v6, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;

const/4 v7, 0x1

move-object/from16 v0, p0

invoke-direct {v0, v4, v5, v6, v7}, Lcom/android/server/policy/GlobalActions;->addDialogItemsIfEnabled(ILcom/android/server/policy/GlobalActions$Action;Ljava/util/ArrayList;Z)Z[/COLOR]

const-string v4, "content://com.sec.knox.provider2/KnoxCustomManagerService1"

const-string/jumbo v5, "getSealedPowerDialogOptionMode"

move-object/from16 v0, p0

invoke-direct {v0, v4, v5}, Lcom/android/server/policy/GlobalActions;->isIntEDM(Ljava/lang/String;Ljava/lang/String;)I

now add this blue lines too but read carefully and remember red line will be different for you and change red line for your line...

:cond_2cc
const-string/jumbo v4, "emergencymode"

invoke-virtual {v4, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v4

[COLOR="Red"]if-eqz v4, :cond_2e2 [/COLOR][COLOR="Blue"]# change it to if-eqz v4, :cond_315 [/COLOR]

move-object/from16 v0, p0

iget-object v4, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;

move-object/from16 v0, p0

iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mEmergency:Lcom/android/server/policy/GlobalActions$ToggleAction;

invoke-virtual {v4, v5}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

[COLOR="red"]goto/16 :goto_241 [/COLOR] [COLOR="Blue"]# It will be different for you on s6edge it was goto/16 :goto_6 on note 5 goto/16 :goto_7 so just change all red lines to your ...
[/COLOR]
[COLOR="blue"]:cond_315
const-string/jumbo v4, "screenshot"

invoke-virtual {v4, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v4

if-eqz v4, :cond_316

move-object/from16 v0, p0

iget-object v4, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;

move-object/from16 v0, p0

iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mScreenshot:Lcom/android/server/policy/GlobalActions$SinglePressAction;

invoke-virtual {v4, v5}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
[/COLOR]
[COLOR="Red"]goto :goto_241[/COLOR] [COLOR="Blue"]Change to your line![/COLOR]

[COLOR="blue"] :cond_316
const-string/jumbo v4, "screenrec"

invoke-virtual {v4, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v4

if-eqz v4, :cond_317

move-object/from16 v0, p0

iget-object v4, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;

move-object/from16 v0, p0

iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mScreenRec:Lcom/android/server/policy/GlobalActions$SinglePressAction;

invoke-virtual {v4, v5}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
[/COLOR]
[COLOR="Red"]goto :goto_241[/COLOR] [COLOR="Blue"]#change it to your line.[/COLOR]

[COLOR="Red"]:cond_2e2[/COLOR] [COLOR="Blue"] # change it to :cond_317[/COLOR]
const-string/jumbo v4, "silent"

invoke-virtual {v4, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

Add this method to the end of GlobalActions.smali file

[COLOR="Blue"].method private toggleScreenRecord()V
.registers 3

new-instance v0, Landroid/content/Intent;

const-string v1, "com.cyngn.ACTION_START_SCREENCAST"

invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

iget-object v1, p0, Lcom/android/server/policy/GlobalActions;->mContext:Landroid/content/Context;

const-string v2, "android.permission.CAPTURE_SECURE_VIDEO_OUTPUT"

invoke-virtual {v1, v0, v2}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;Ljava/lang/String;)V

return-void
.end method[/COLOR]

Copy screencast.apk from screencast.zip to system/priv-app/ScreenCast

If you want to toggle the both buttons in RomControl app do followed

open com/android/server/policy/GlobalActions$Screenshot

replace complete method

.method public showConditional()Z
.locals 4

const/4 v0, 0x0

const/4 v1, 0x1

iget-object v2, p0, Lcom/android/server/policy/GlobalActions$Screenshot;->this$0:Lcom/android/server/policy/GlobalActions;

# getter for: Lcom/android/server/policy/GlobalActions;->mContext:Landroid/content/Context;
invoke-static {v2}, Lcom/android/server/policy/GlobalActions;->access$500(Lcom/android/server/policy/GlobalActions;)Landroid/content/Context;

move-result-object v2

invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v2

const-string v3, "screenshot"

invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v2

if-ne v2, v0, :cond_0

:goto_0
return v0

:cond_0
move v0, v1

goto :goto_0
.end method

open com/android/server/policy/GlobalActions$46

.method public showConditional()Z
.locals 4

const/4 v0, 0x0

const/4 v1, 0x1

iget-object v2, p0, Lcom/android/server/policy/GlobalActions$46;->this$0:Lcom/android/server/policy/GlobalActions;

# getter for: Lcom/android/server/policy/GlobalActions;->mContext:Landroid/content/Context;
invoke-static {v2}, Lcom/android/server/policy/GlobalActions;->access$500(Lcom/android/server/policy/GlobalActions;)Landroid/content/Context;

move-result-object v2

invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v2

const-string v3, "reboot_recovery"

invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v2

if-ne v2, v0, :cond_0

:goto_0
return v0

:cond_0
move v0, v1

goto :goto_0
.end method

Rom Control

<SwitchPreference android:title="Screencast Mode" android:key="screencast" android:defaultValue="false" android:summaryOn="Emergency mode will be shown" android:summaryOff="Currently removed" />
<SwitchPreference android:title="Screenshot Mode" android:key="screenshot" android:defaultValue="false" android:summaryOn="Emergency mode will be shown" android:summaryOff="Currently removed" />

Thx

[MENTION=5096388]sagitt67[/MENTION] shared guide to how add ScreenRecord and Screenshoot to powermenu with framework changes too

[MENTION=6681786]sheard[/MENTION] for bringing guide to here

[MENTION=4507636]edzamber[/MENTION] for add it to OP

[MENTION=4596062]asc1977[/MENTION] changing icons to look like original