• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[MOD/HOWTO] [UCALG1/UCALH1] Extended Power Menu

Search This thread

magn2o

Senior Member
Nov 30, 2011
600
256
I take no credit for this modification, it is not an original idea nor does it contain original code. It's an adaptation of the modification for the GT-I9300 by sphinx02 which can be found here. I simply made a few slight modifications to accomodate the SGH-I747.

That being said, I have not tested this on anything other than a SGH-I747, running a stock, deodexed UCALG1 or UCALH1. Whether you choose to use the CWM package or make the edits manually, please exercise caution on other devices and/or ROMs!

"CWM" HOWTO
  1. Download the appropriate package for your firmware (eg. UCLAG1, UCALH1)
  2. Boot into recovery.
  3. Make a nandroid backup.
  4. Flash package.

"MANUAL" HOWTO
This guide assumes a basic understanding of how to decompile/build jar/apk files. If you're not familiar with this process, proceed no further! Instead, please use the CWM package attached to this post!

  1. Decompile /system/framework/android.policy.jar
  2. Extract the attached archive (GlobalActions.zip) to your smali/com/android/internal/policy/impl/ directory.
  3. Perform the following file edits:

    FILE: smali/com/android/internal/policy/impl/GlobalActions.smali

    FIND:
    Code:
        new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$6;

    REPLACE WITH:
    Code:
        new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$99;

    FIND:
    Code:
        invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$6;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

    REPLACE WITH:
    Code:
        invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$99;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V


    FILE: /smali/com/android/internal/policy/impl/GlobalActions$SinglePressAction.smali

    FIND:
    Code:
     # instance fields
     .field private final mIconResId:I

    REPLACE WITH:
    Code:
     # static fields
     .field protected static rebootMode:I
    
     .field protected static final rebootOptions:[Ljava/lang/String;
    
    
     # instance fields
     .field private final mIconResId:I

    FIND:
    Code:
     # direct methods

    REPLACE WITH:
    Code:
     # direct methods
    .method static constructor <clinit>()V
        .locals 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
  4. Build new android.policy.jar
  5. Upload and replace!
 

Attachments

  • GlobalActions.zip
    2.7 KB · Views: 380
  • UCLAG1_ExtendedPowerMenu_Screenshot.jpg
    UCLAG1_ExtendedPowerMenu_Screenshot.jpg
    20.4 KB · Views: 3,648
  • UCALG1-DEODEX-ExtPowMenu-Rollback.zip
    488.7 KB · Views: 77
  • UCALG1-DEODEX-ExtPowMenu.zip
    499.4 KB · Views: 175
  • UCALH1-DEODEX-ExtPowMenu-Rollback.zip
    508.2 KB · Views: 75
  • UCALH1-DEODEX-ExtPowMenu.zip
    501.6 KB · Views: 226
Last edited:

bravomail

Senior Member
Jan 12, 2011
1,002
351
Detroit
Thanks but

I'm trying to work on old style Android Power Menu with Recovery and Download in the menu.
So far it bootloops after android.policy.jar changes.
But I'm hopeful! ;)
:fingers-crossed:
 

magn2o

Senior Member
Nov 30, 2011
600
256
I'm trying to work on old style Android Power Menu with Recovery and Download in the menu.
So far it bootloops after android.policy.jar changes.
But I'm hopeful! ;)
:fingers-crossed:

Sorry, but what are you trying to do? Are you trying to manually apply the changes yourself? :confused:

* Edit: Ah, you're trying to add "Recovery" and "Download" to the main shutdown popup window, rather than having second "Restart" popup window?
 
Last edited:

magn2o

Senior Member
Nov 30, 2011
600
256
Ok..this time it flashed without any errors. But no options comes up on the power option. Are u sure it will work on the rooted Stock ROM?
Sorry bro..but I aint trying it anymore unless someone says it works. Not sure what it has done to my ROM now :)

You have to hit the Restart option in the power menu. It will then show the options.

You are running a stock DEODEXED ROM, right?

Also, this is just a single file replacement.. its not going to "do" anything to your ROM.

Sent from my Samsung Galaxy S III
 

pwned101

Senior Member
Jul 28, 2012
253
55
36
Pittsburgh
You have to hit the Restart option in the power menu. It will then show the options.

You are running a stock DEODEXED ROM, right?

Also, this is just a single file replacement.. its not going to "do" anything to your ROM.

Sent from my Samsung Galaxy S III

Yes,,,im running a stock DEODEXED ROM. I was hoping it'll come up once i press on the reboot option. However, the default ROM popup comes "THis will reboot the phone"..thats it. It doesnt give any option like Recovery/Download. Can someone else confirm?
 

magn2o

Senior Member
Nov 30, 2011
600
256
Ok. First off, just let me say that I, personally, do not use CWM; I prefer to make all of my file edits manually.

That being said, I installed CWM just to test this package and get it working. The newly attached archive is working, and I confirmed it no less than 3 times. The issue, apparently, was that the previous installer script wasn't removing the existing android.policy.jar before copying the modified one. This means the previous installers didn't actually do anything (nothing was copied and nothing was deleted). This is now rectified.

Sorry for the inconvenience!

Sent from my Samsung Galaxy S III
 

magn2o

Senior Member
Nov 30, 2011
600
256

You're flashing the archive that ends in -2.ZIP, correct?

This is why I don't use CMW. There has to be something else at play here. I'm confident that the CWM archive is working, as I've had 3 people confirm it (not including myself).

At this point, if you want, just copy the android.policy.jar file from the archive manually to your /system/framework using Root Explorer, then reboot. That's all CWM is doing.

Also, you can try reseting your dalvik/cache.
 
Last edited:

magn2o

Senior Member
Nov 30, 2011
600
256
yes your right; i do get a second menu; it says "This device will restart" hit ok, and ..... it restarts. :eek:

Ok. I'm through with CWM, it's not worth the headache. :mad:

The pre-modified android.policy.jar is attached to the OP, along with instructions on using Root Explorer. If someone else wants to make a CWM flashable package, that's their prerogative. :)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 13
    I take no credit for this modification, it is not an original idea nor does it contain original code. It's an adaptation of the modification for the GT-I9300 by sphinx02 which can be found here. I simply made a few slight modifications to accomodate the SGH-I747.

    That being said, I have not tested this on anything other than a SGH-I747, running a stock, deodexed UCALG1 or UCALH1. Whether you choose to use the CWM package or make the edits manually, please exercise caution on other devices and/or ROMs!

    "CWM" HOWTO
    1. Download the appropriate package for your firmware (eg. UCLAG1, UCALH1)
    2. Boot into recovery.
    3. Make a nandroid backup.
    4. Flash package.

    "MANUAL" HOWTO
    This guide assumes a basic understanding of how to decompile/build jar/apk files. If you're not familiar with this process, proceed no further! Instead, please use the CWM package attached to this post!

    1. Decompile /system/framework/android.policy.jar
    2. Extract the attached archive (GlobalActions.zip) to your smali/com/android/internal/policy/impl/ directory.
    3. Perform the following file edits:

      FILE: smali/com/android/internal/policy/impl/GlobalActions.smali

      FIND:
      Code:
          new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$6;

      REPLACE WITH:
      Code:
          new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$99;

      FIND:
      Code:
          invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$6;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

      REPLACE WITH:
      Code:
          invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$99;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V


      FILE: /smali/com/android/internal/policy/impl/GlobalActions$SinglePressAction.smali

      FIND:
      Code:
       # instance fields
       .field private final mIconResId:I

      REPLACE WITH:
      Code:
       # static fields
       .field protected static rebootMode:I
      
       .field protected static final rebootOptions:[Ljava/lang/String;
      
      
       # instance fields
       .field private final mIconResId:I

      FIND:
      Code:
       # direct methods

      REPLACE WITH:
      Code:
       # direct methods
      .method static constructor <clinit>()V
          .locals 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
    4. Build new android.policy.jar
    5. Upload and replace!
    4
    Ported to odexed LH9

    I ported this to LH9. I only made an odexed version that works fine with the odexed LH9. The download is here:

    http://www.mediafire.com/?miz1s41nvaq0112
    3
    Support added for UCALH1.
    2
    Anyone tried this on ATT's newest LK3 JB yet?

    EDIT - Tried it, unfortunately does not boot. Nandroids are cool :)


    EDIT 2 - Not to derail the OP, but here is an alternative one can use on JB until this is updated...

    Install the JB 15 toggle Mod from this link (there are two, one for ATT with 4G icon, and one for other with H+ icon). The reboot toggle has reboot/reboot recovery/fast reboot options.

    http://forum.xda-developers.com/showthread.php?t=1895880
    1
    Use kairi_zeroblade's post and replace the one in the ROM you are creating.

    Worked perfectly.... thanks

    Sent from my SGH-T999 using Tapatalk 2