FORUMS
Remove All Ads from XDA

[DEV] [MOD] [HOW-TO] 4-1 Reboot MOD on LG8 Based Sprint ROMS [MOD]

2,863 posts
Thanks Meter: 7,019
 
Post Reply Email Thread
Hey everyone! In response to sudden events i am deciding to make tutorials for all my MODS for interested DEVS. Here is the 4-1 reboot MOD

First decompile the smali in the android.policy.jar file

Download the following zip containing needed smali files for the MOD. Place the files in: \com\android\internal\policy\impl\

Next edit the following smali file: \com\android\internal\policy\impl\GlobalActions$Si nglePressAction.smali

Now edit the following code:

Code:
.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x40a
    name = "SinglePressAction"
.end annotation


++# static fields
.field protected static rebootMode:I

.field protected static final rebootOptions:[Ljava/lang/String;


# instance fields
.field private final mIconResId:I

.field private final mMessageResId:I


# direct methods
++.method static constructor <clinit>()V
    .registers 3

    const/4 v0, 0x3

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

    const/4 v1, 0x0

    const-string v2, "Reboot"

    aput-object v2, v0, v1

    const/4 v1, 0x1

    const-string v2, "Download"

    aput-object v2, v0, v1

    const/4 v1, 0x2

    const-string v2, "Recovery"

    aput-object v2, v0, v1

    sput-object v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;

    return-void
.end method

.method protected constructor <init>(II)V
    .registers 3
    .parameter "iconResId"
    .parameter "messageResId"

Next edit the following smali: \com\android\internal\policy\impl\GlobalActions.sm ali (Removed anything in red and add anything in green)

Code:
    iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    .line 392
--  new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$6;
++  new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$99;
    const v1, 0x10807e1

    const v2, 0x1040169

--  invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$6;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
++  invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$99;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    .line 413
    const/4 v0, 0x6

Recompile the smali and push android.policy.jar back into /system/framework/

Have fun
The Following 26 Users Say Thank You to clark44 For This Useful Post: [ View ] Gift clark44 Ad-Free
 
 
14th July 2012, 05:59 AM |#2  
fergie716's Avatar
Senior Member
Flag Buffalo, NY
Thanks Meter: 3,820
 
More
Thanks for posting this! I knew it was in android.policy not services.jar lol

Sent from my SPH-L710 using xda premium
14th July 2012, 06:06 AM |#3  
clark44's Avatar
OP Senior Member
Flag East Lansing
Thanks Meter: 7,019
 
Donate to Me
More
Quote:
Originally Posted by fergie716

Thanks for posting this! I knew it was in android.policy not services.jar lol

Sent from my SPH-L710 using xda premium

No problem I'm just trying to help the community

Sent from my SPH-L710 using Tapatalk 2
The Following 4 Users Say Thank You to clark44 For This Useful Post: [ View ] Gift clark44 Ad-Free
14th July 2012, 06:11 AM |#4  
dazednconfused's Avatar
Inactive Recognized Developer
Flag Charleston, WV
Thanks Meter: 22,341
 
Donate to Me
More
Thank you so much. I will be hitting the thanks button when I get back on my premium app. Ive been trying to figure out how to do this.
14th July 2012, 07:26 AM |#5  
1brainsurgeon's Avatar
Senior Member
Flag Gig Harbor
Thanks Meter: 6,223
 
Donate to Me
More
Quote:
Originally Posted by dazednconfused

Thank you so much. I will be hitting the thanks button when I get back on my premium app. Ive been trying to figure out how to do this.

The secret's out

Sent from my SPH-L710 using Xparent ICS Tapatalk 2
The Following User Says Thank You to 1brainsurgeon For This Useful Post: [ View ] Gift 1brainsurgeon Ad-Free
15th July 2012, 07:01 PM |#6  
dazednconfused's Avatar
Inactive Recognized Developer
Flag Charleston, WV
Thanks Meter: 22,341
 
Donate to Me
More
Worked perfectly. Thanks for sharing this and look forward to seeing more of your how to's. Thank you.
16th July 2012, 10:03 PM |#7  
Senior Member
Flag Miami
Thanks Meter: 54
 
Donate to Me
More
Question
I gave this MOD a go, and... got stuck at reboot screen. Looks like a straight forward edit. I must be missing something. Do I need to keep the "++" in the code, or is that just a label for "add this line"?

UPDATE: Nevermind. A total brain freeze on my part. I decompiled and recompiled android.policy.jar, not classes.dex inside it... Duh! Anyway, works as advertised. The reboot options appear when you choose "Restart". Thanks, OP. Sweet edit.
21st July 2012, 03:55 PM |#8  
rotnezi's Avatar
Senior Member
Flag new haven,ct
Thanks Meter: 26
 
More
Can some one make this a flashable .zip
pretty PLEASE if it's possbible or a script mayb for script manager

Sent from my SPH-L710 using xda premium
21st July 2012, 11:21 PM |#9  
Senior Member
Flag Miami
Thanks Meter: 54
 
Donate to Me
More
Here's a copy of the modded file. Just rename it to andoid.policy.jar and push it to /system/framework. This file is stock and has no other mods besides Reboot. If the ROM you're running now has any other MODs built into the file, this will overwrite them.
Attached Files
File Type: jar MODDED_android.policy.jar - [Click for QR Code] (288.9 KB, 97 views)
The Following 2 Users Say Thank You to 6uPMAH For This Useful Post: [ View ] Gift 6uPMAH Ad-Free
23rd July 2012, 07:22 AM |#10  
Bizdady's Avatar
Senior Member
Flag 818
Thanks Meter: 580
 
More
Quote:
Originally Posted by 6uPMAH

Here's a copy of the modded file. Just rename it to andoid.policy.jar and push it to /system/framework. This file is stock and has no other mods besides Reboot. If the ROM you're running now has any other MODs built into the file, this will overwrite them.

Thanks! Ill make sure to save this for my stock rom. Im running CM10 at the moment but this will sure come in handy in a few days once the camera bug really annoys me lol
25th July 2012, 05:45 AM |#11  
clark44's Avatar
OP Senior Member
Flag East Lansing
Thanks Meter: 7,019
 
Donate to Me
More
Updated the how-to and removed hot boot since it really doesn't work on our phones.
The Following 2 Users Say Thank You to clark44 For This Useful Post: [ View ] Gift clark44 Ad-Free
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