[Galaxy S6 General] BlackMesa123:
Add Battery toggle in Powermenu

Simply decompile services.jar and go into "smali/com/android/server/policy/GlobalActions.smali", search this method:

.method public static isBatterySafetyChecked()Z
.locals 11

const/4 v8, 0x0

sget-boolean v9, Lcom/android/server/policy/GlobalActions;->mSupportBattSafeCheck:Z

if-nez v9, :cond_1

:cond_0
:goto_0
return v8

:cond_1
new-instance v3, Ljava/io/File;

const-string v9, "/efs/FactoryApp"

const-string v10, "BattType"

invoke-direct {v3, v9, v10}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V

if-eqz v3, :cond_0

invoke-virtual {v3}, Ljava/io/File;->exists()Z

move-result v9

if-eqz v9, :cond_0

const-string v6, "1"

const/4 v4, 0x0

const/4 v0, 0x0

:try_start_0
new-instance v5, Ljava/io/FileInputStream;

invoke-direct {v5, v3}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_4
.catchall {:try_start_0 .. :try_end_0} :catchall_0

:try_start_1
new-instance v1, Ljava/io/BufferedReader;

new-instance v9, Ljava/io/InputStreamReader;

invoke-direct {v9, v5}, Ljava/io/InputStreamReader;-><init>(Ljava/io/InputStream;)V

invoke-direct {v1, v9}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;)V
:try_end_1
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_9
.catchall {:try_start_1 .. :try_end_1} :catchall_1

:cond_2
:try_start_2
invoke-virtual {v1}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;

move-result-object v7

if-eqz v7, :cond_3

invoke-virtual {v7}, Ljava/lang/String;->trim()Ljava/lang/String;

move-result-object v7

const-string v9, "1"

invoke-virtual {v9, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
:try_end_2
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_a
.catchall {:try_start_2 .. :try_end_2} :catchall_2

move-result v9

if-eqz v9, :cond_2

const/4 v8, 0x1

if-eqz v5, :cond_0

:try_start_3
invoke-virtual {v5}, Ljava/io/FileInputStream;->close()V
:try_end_3
.catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_1

:goto_1
:try_start_4
invoke-virtual {v1}, Ljava/io/BufferedReader;->close()V
:try_end_4
.catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_0

goto :goto_0

:catch_0
move-exception v2

const-string v9, "GlobalActions"

const-string v10, "error"

invoke-static {v9, v10, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

goto :goto_0

:catch_1
move-exception v2

const-string v9, "GlobalActions"

const-string v10, "error"

invoke-static {v9, v10, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

goto :goto_1

:cond_3
if-eqz v5, :cond_0

:try_start_5
invoke-virtual {v5}, Ljava/io/FileInputStream;->close()V
:try_end_5
.catch Ljava/lang/Exception; {:try_start_5 .. :try_end_5} :catch_3

:goto_2
:try_start_6
invoke-virtual {v1}, Ljava/io/BufferedReader;->close()V
:try_end_6
.catch Ljava/lang/Exception; {:try_start_6 .. :try_end_6} :catch_2

goto :goto_0

:catch_2
move-exception v2

const-string v9, "GlobalActions"

const-string v10, "error"

invoke-static {v9, v10, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

goto :goto_0

:catch_3
move-exception v2

const-string v9, "GlobalActions"

const-string v10, "error"

invoke-static {v9, v10, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

goto :goto_2

:catch_4
move-exception v2

:goto_3
:try_start_7
const-string v9, "GlobalActions"

const-string v10, "error"

invoke-static {v9, v10, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
:try_end_7
.catchall {:try_start_7 .. :try_end_7} :catchall_0

if-eqz v4, :cond_0

:try_start_8
invoke-virtual {v4}, Ljava/io/FileInputStream;->close()V
:try_end_8
.catch Ljava/lang/Exception; {:try_start_8 .. :try_end_8} :catch_6

:goto_4
:try_start_9
invoke-virtual {v0}, Ljava/io/BufferedReader;->close()V
:try_end_9
.catch Ljava/lang/Exception; {:try_start_9 .. :try_end_9} :catch_5

goto :goto_0

:catch_5
move-exception v2

const-string v9, "GlobalActions"

const-string v10, "error"

invoke-static {v9, v10, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

goto/16 :goto_0

:catch_6
move-exception v2

const-string v9, "GlobalActions"

const-string v10, "error"

invoke-static {v9, v10, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

goto :goto_4

:catchall_0
move-exception v8

:goto_5
if-eqz v4, :cond_4

:try_start_a
invoke-virtual {v4}, Ljava/io/FileInputStream;->close()V
:try_end_a
.catch Ljava/lang/Exception; {:try_start_a .. :try_end_a} :catch_7

:goto_6
:try_start_b
invoke-virtual {v0}, Ljava/io/BufferedReader;->close()V
:try_end_b
.catch Ljava/lang/Exception; {:try_start_b .. :try_end_b} :catch_8

:cond_4
:goto_7
throw v8

:catch_7
move-exception v2

const-string v9, "GlobalActions"

const-string v10, "error"

invoke-static {v9, v10, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

goto :goto_6

:catch_8
move-exception v2

const-string v9, "GlobalActions"

const-string v10, "error"

invoke-static {v9, v10, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

goto :goto_7

:catchall_1
move-exception v8

move-object v4, v5

goto :goto_5

:catchall_2
move-exception v8

move-object v0, v1

move-object v4, v5

goto :goto_5

:catch_9
move-exception v2

move-object v4, v5

goto :goto_3

:catch_a
move-exception v2

move-object v0, v1

move-object v4, v5

goto :goto_3
.end method

Replace with this:

.method public static isBatterySafetyChecked()Z
.locals 1

const v0, 0x1

return v0
.end method

Actually this works only on n7 latest firmwares like bpi7, bpia, bpi4 and others. If you get another toggle you need disable battery check with this method