[HTC Butterfly] ZiT777:
Hi,

"Hot Reboot" does not work currently.

I learned from the next person.

His name is "cielavenir "

Learned this command from someone he also.

# setprop ctl.restart zygote

The results similar to "Hot Reboot" By performing the above commands.

Our aim is to incorporate the above command to "APM".

I was able to incorporate it.

The following is a "Hot Reboot" until now.

# virtual methods
.method public onPress()V
.locals 6

invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;

move-result-object v3

[COLOR="Silver"]const/4 v4, 0x4

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

const/4 v4, 0x0

const-string v5, "pkill"

aput-object v5, v0, v4

const/4 v4, 0x1

const-string v5, "-TERM"

aput-object v5, v0, v4

const/4 v4, 0x2

const-string v5, "-f"

aput-object v5, v0, v4

const/4 v4, 0x3

const-string v5, "system_server"

aput-object v5, v0, v4
[/COLOR]
:try_start_0
invoke-virtual {v3, v0}, Ljava/lang/Runtime;->exec([Ljava/lang/String;)Ljava/lang/Process;
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

move-result-object v2

:goto_0
return-void

:catch_0
move-exception v1

invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V

goto :goto_0
.end method

Changed as follows.

# virtual methods
.method public onPress()V
.locals 6

invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;

move-result-object v3

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

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

const/4 v4, 0x0

const-string v5, "setprop"

aput-object v5, v0, v4

const/4 v4, 0x1

const-string v5, "ctl.restart"

aput-object v5, v0, v4

const/4 v4, 0x2

const-string v5, "zygote"

aput-object v5, v0, v4
[/COLOR]
:try_start_0
invoke-virtual {v3, v0}, Ljava/lang/Runtime;->exec([Ljava/lang/String;)Ljava/lang/Process;
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

move-result-object v2

:goto_0
return-void

:catch_0
move-exception v1

invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V

goto :goto_0
.end method

New "Hot Reboot" works normally!!

I also can "Safe Mode" also operate similarly.

The following is a "Safe Mode" until now.

.class Lcom/android/internal/policy/impl/GlobalActions$22;
.super Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.source "GlobalActions.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lcom/android/internal/policy/impl/GlobalActions;->createDialogAdv()Lcom/htc/widget/HtcAlertDialog;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = null
.end annotation

# instance fields
.field final synthetic this$0:Lcom/android/internal/policy/impl/GlobalActions;

# direct methods
.method constructor <init>(Lcom/android/internal/policy/impl/GlobalActions;III)V
.locals 0

iput-object p1, p0, Lcom/android/internal/policy/impl/GlobalActions$22;->this$0:Lcom/android/internal/policy/impl/GlobalActions;

invoke-direct {p0, p2, p3, p4}, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;-><init>(III)V

return-void
.end method

# virtual methods
.method public onPress()V
.locals 3

const-string v0, "ADVANCED POWER MENU"

const-string v1, "Safe mode"

invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions$22;->this$0:Lcom/android/internal/policy/impl/GlobalActions;

invoke-static {v0}, Lcom/android/internal/policy/impl/GlobalActions;->access$1000(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/view/WindowManagerPolicy$WindowManagerFuncs;

move-result-object v0

invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowManagerFuncs;->rebootSafeMode()V

const-string v0, "ADVANCED POWER MENU"

const-string v1, "Safe mode end"

invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

return-void
.end method

.method public showBeforeProvisioning()Z
.locals 1

const/4 v0, 0x1

return v0
.end method

.method public showDuringKeyguard()Z
.locals 1

const/4 v0, 0x1

return v0
.end method

Changed as follows.

.class Lcom/android/internal/policy/impl/GlobalActions$22;
.super Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.source "GlobalActions.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lcom/android/internal/policy/impl/GlobalActions;->createDialogAdv()Lcom/htc/widget/HtcAlertDialog;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = null
.end annotation

# instance fields
.field final synthetic this$0:Lcom/android/internal/policy/impl/GlobalActions;

# direct methods
.method constructor <init>(Lcom/android/internal/policy/impl/GlobalActions;III)V
.locals 0

iput-object p1, p0, Lcom/android/internal/policy/impl/GlobalActions$22;->this$0:Lcom/android/internal/policy/impl/GlobalActions;

invoke-direct {p0, p2, p3, p4}, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;-><init>(III)V

return-void
.end method

# virtual methods
.method public onPress()V
.locals 6

[COLOR="Red"]const-string v2, "persist.sys.safemode"

const-string v3, "1"

invoke-static {v2, v3}, Landroid/os/SystemProperties;->set(Ljava/lang/String;Ljava/lang/String;)V

invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;

move-result-object v3

const/4 v4, 0x3

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

const/4 v4, 0x0

const-string v5, "setprop"

aput-object v5, v0, v4

const/4 v4, 0x1

const-string v5, "ctl.restart"

aput-object v5, v0, v4

const/4 v4, 0x2

const-string v5, "zygote"

aput-object v5, v0, v4[/COLOR]

:try_start_0
invoke-virtual {v3, v0}, Ljava/lang/Runtime;->exec([Ljava/lang/String;)Ljava/lang/Process;
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

move-result-object v2

:goto_0
return-void

:catch_0
move-exception v1

invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V

goto :goto_0
.end method

.method public showBeforeProvisioning()Z
.locals 1

const/4 v0, 0x1

return v0
.end method

.method public showDuringKeyguard()Z
.locals 1

const/4 v0, 0x1

return v0
.end method

You can also use the following command.

Hot Reboot

adb shell su -c setprop ctl.restart zygote

Safe Mode

adb shell su -c setprop persist.sys.safemode 1
adb shell su -c setprop ctl.restart zygote

Thank you!!