[Epic 4G Android Development] MysteryEmotionz:
How-To Reboot Mod

Brought To You By MysteryEmotionz​

I would like to say thank you to all my supporters and the people that have donated.

If you would like to donate don’t hesitate and buy me a beer by clicking any of my donation links or buy me a beer in my sig.

(Donation Link)

DISCLAIMER:

We at ACSyndicate are in no way, shape, or form responsible for bricking your device. You're flashing this product at your own risk. Always back up your device. If you point your finger and try to blame us we will laugh and enjoy our beer.

Credits:

untermensch for his reference thread.

Raiderep for bring this to DI18.

Mammon for DK28.

What You'll Need:

Android SDK

Apkmanager 4.9

Smali / Basmali

Image Editor

Notepad++

7Zip

Framework-res.apk

Android.policy.jar

Instructions:

1. Decompile Framework-res.apk using apk manager

2. Navigate to framework-res.apk/res/values

3. Open up public.xml using Notepad++

4. Add this line at the end of the strings section

<public type="string" name="reboot" id="0x010404cf" />

5. Add this line at the end of the drawable section

<public type="drawable" name="reboot" id="0x01080422" />

6. Save the xml

7. Still in framework-res.apk/res/values open up strings.xml and add this at the end

<string name="reboot">Reboot</string>

8. Create a reboot icons and save it has reboot.png

9. Drag that image into framework-res.apk/res/drawable

10. Compile the framework-res.apk

Thats if for framework-res.apk no to smali :cool:

1. Open up Android.policy.jar using 7Zip and pull out classes.dex and place it where you have smali and basmali

2. run this in your command prompt (where you have adb)

java -jar baksmali.jar -o out/classes/ classes.dex

3. Navigate to out/dex/com/android/internal/policy/impl

4. Copy GlobalActions$3.smali

5. Paste the copy of GlobalAction$3.smali and rename to GlobalAction$8.smali

6. Delete Everything in side and add using Notepad++

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

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lcom/android/internal/policy/impl/GlobalActions;->createDialog()Landroid/app/AlertDialog;
.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;II)V
.registers 4
.parameter
.parameter "x0"
.parameter "x1"

.prologue
.line 243
iput-object p1, p0, Lcom/android/internal/policy/impl/GlobalActions$8;->this$0:Lcom/android/internal/policy/impl/GlobalActions;

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

return-void
.end method

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

const-string v0, "Reboot Now"

invoke-static {v0}, Landroid/os/Power;->reboot(Ljava/lang/String;)V

return-void
.end method

.method public showBeforeProvisioning()Z
.registers 2

.prologue
.line 244
const/4 v0, 0x1

return v0
.end method

.method public showDuringKeyguard()Z
.registers 2

.prologue
.line 240
const/4 v0, 0x1

return v0
.end method

7. Save

8. Now open up GlobalActions.smali and add this at line 506

aput-object v2, v0, v1

const/4 v1, 0x4

new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$8;

const v3, 0x1080422

const v4, 0x10404cf

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

9. Save

10. In you command prompt run

java -Xmx512M -jar smali.jar out/classes/ classes.dex

11.Zip up both the framework-res.apk and andoid.policy.jar in a flashable zip and flash away

If you see any errors please let me know and ill adjust the instructions. Feel free to ask for help if also need.

Please give me a nod if you include this in any of your themes or roms

Check Out Our New Home​

​

http://www.acsyndicate.net/