FORUMS
Remove All Ads from XDA

[HOWTO] New Hot Reboot Command!!!!

57 posts
Thanks Meter: 19
 
By ZiT777, Member on 15th June 2013, 06:08 PM
Post Reply Email Thread
Hi,

"Hot Reboot" does not work currently.

I learned from the next person.

His name is "cielavenir "

Learned this command from someone he also.

Code:
# 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.

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

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

    move-result-object v3

    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

    :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.

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

    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

    :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.

Code:
.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.

Code:
.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

    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

    :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
Code:
adb shell su -c setprop ctl.restart zygote
Safe Mode
Code:
adb shell su -c setprop persist.sys.safemode 1
adb shell su -c setprop ctl.restart zygote

Thank you!!
Attached Files
File Type: zip New_Hot_Reboot.zip - [Click for QR Code] (3.3 KB, 475 views)
The Following 7 Users Say Thank You to ZiT777 For This Useful Post: [ View ] Gift ZiT777 Ad-Free
 
 
15th June 2013, 07:30 PM |#2  
Junior Member
Thanks Meter: 1
 
More
pertamax..

good job.. broo..
15th June 2013, 10:17 PM |#3  
Account currently disabled
Flag nassau
Thanks Meter: 676
 
Donate to Me
More
Quote:
Originally Posted by belantara

pertamax..

good job.. broo..

So flash this and we will be able to hot reboot when shutting the phone

Sent from my HTC Butterfly using xda premium
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes