[REF] How to add Reboot to power menu (updated 10/21/2010)

Search This thread

iwillkillyou

Senior Member
Aug 13, 2010
622
48
Would this method work for the screenshot in the power menu? ICS and gingerbread roms have it. I miss that feature greatly.

Sent from my SGH-T959 using XDA
 

pvyParts

Inactive Recognized Developer
Oct 11, 2010
1,858
2,341
35
Would this method work for the screenshot in the power menu? ICS and gingerbread roms have it. I miss that feature greatly.

Sent from my SGH-T959 using XDA

Sortof. You need different commands in the smali but the principal is the same

Pvy


Sent from my TEAM powered Arc S
 

Rookie407

Senior Member
Dec 7, 2011
200
34
Clinton
trying to get this to work on a samsung galaxy precedent AOSP ROM. having an issue with step 2 in the shutdownthread.smali. more specificaly this part

Code:
:reboot
	
const-string v4, "now"
	
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V

return-void
	
:rebootRecovery
	
const-string v4, "recovery"
	
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V

return-void
	
:rebootDownload
	
const-string v4, "download"
	
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V

return-void

should i change the parts where it says (exp. :rebootDownload) to the string id? and if i do i get this error when compiling (mismatched input '0x010404bd' expecting END_METHOD_DIRECTIVE)

if i try to change the corrisponding parts from the code inserted above it i get this error


(AutoSmali_In\com\android\internal\app\ShutdownThread.smali[2337,18] no viable alternative at input '0x010404bd'
AutoSmali_In\com\android\internal\app\ShutdownThread.smali[2341,18] no viable alternative at input '0x010404bb'
AutoSmali_In\com\android\internal\app\ShutdownThread.smali[2345,18] no viable alternative at input '0x010404bc'
AutoSmali_In\com\android\internal\app\ShutdownThread.smali[2352,4] mismatched input '0x010404bd' expecting END_METHOD_DIRECTIVE)

any clue on a fix?
 

pvyParts

Inactive Recognized Developer
Oct 11, 2010
1,858
2,341
35
trying to get this to work on a samsung galaxy precedent AOSP ROM. having an issue with step 2 in the shutdownthread.smali. more specificaly this part

Code:
:reboot
	
const-string v4, "now"
	
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V

return-void
	
:rebootRecovery
	
const-string v4, "recovery"
	
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V

return-void
	
:rebootDownload
	
const-string v4, "download"
	
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V

return-void

should i change the parts where it says (exp. :rebootDownload) to the string id? and if i do i get this error when compiling (mismatched input '0x010404bd' expecting END_METHOD_DIRECTIVE)

if i try to change the corrisponding parts from the code inserted above it i get this error


(AutoSmali_In\com\android\internal\app\ShutdownThread.smali[2337,18] no viable alternative at input '0x010404bd'
AutoSmali_In\com\android\internal\app\ShutdownThread.smali[2341,18] no viable alternative at input '0x010404bb'
AutoSmali_In\com\android\internal\app\ShutdownThread.smali[2345,18] no viable alternative at input '0x010404bc'
AutoSmali_In\com\android\internal\app\ShutdownThread.smali[2352,4] mismatched input '0x010404bd' expecting END_METHOD_DIRECTIVE)

any clue on a fix?


reread the TUt, specifically step 3 you don't put the resID's there they go in the globalActions ;)

Pvy.
 

pvyParts

Inactive Recognized Developer
Oct 11, 2010
1,858
2,341
35
i got that part... i was just wondering if it would be diff cus its a diff phone. i know with LG phones you dont have to edit the shutdownthread.smali at all and it works just fine.

If you follow the tut it will work. If the stuff is already there don't re add it.

But you were editing the wrong area. The IDs don't go where you put them.

Pvy.

Sent from my LT18i using xda premium
 

Rookie407

Senior Member
Dec 7, 2011
200
34
Clinton
If you follow the tut it will work. If the stuff is already there don't re add it.

But you were editing the wrong area. The IDs don't go where you put them.

Pvy.

Sent from my LT18i using xda premium

if the stuff was there i wouldnt be doing this... and if it worked i wouldnt be posting... like i said before this is the sammy precedent im working n 100% AOSP. would u like the logcat errors?
 

pvyParts

Inactive Recognized Developer
Oct 11, 2010
1,858
2,341
35
if the stuff was there i wouldnt be doing this... and if it worked i wouldnt be posting... like i said before this is the sammy precedent im working n 100% AOSP. would u like the logcat errors?

sure go for it it may shed more light as to what the problem was :) i have a feeeling we are on 2 different pages...

100% AOSP as in your are compiling it first? then decompiling it to add mods? O_O

Pvy.
 

Rookie407

Senior Member
Dec 7, 2011
200
34
Clinton
sure go for it it may shed more light as to what the problem was :) i have a feeeling we are on 2 different pages...

100% AOSP as in your are compiling it first? then decompiling it to add mods? O_O

Pvy.

yes it was compiled by our main dev now im working to get the reboot options there. i have it showing up in the power menu it just does what can only be described as the FC vibrations...


Code:
I/StatusBarPolicy( 3033): BAT. status:2 health:2
I/StatusBarPolicy( 3033): BAT. status:2 health:2
I/StatusBarPolicy( 3033): BAT. status:2 health:2
I/WindowManager( 2978): interceptKeyBeforeDispatching
W/KeyCharacterMap( 3055): No keyboard for id 0
W/KeyCharacterMap( 3055): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
W/dalvikvm( 2978): VFY: unable to resolve static field 47 (mReboot) in Lcom/android/internal/app/ShutdownThread;

W/dalvikvm( 2978): VFY: unable to resolve static field 47 (mReboot) in Lcom/android/internal/app/ShutdownThread;

W/dalvikvm( 2978): VFY: unable to resolve static field 47 (mReboot) in Lcom/android/internal/app/ShutdownThread;

I/WindowManager( 2978): interceptKeyBeforeDispatching
I/WindowManager( 2978): interceptKeyBeforeDispatching
I/WindowManager( 2978): interceptKeyBeforeDispatching
W/KeyCharacterMap( 2978): No keyboard for id 0
W/KeyCharacterMap( 2978): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
I/WindowManager( 2978): interceptKeyBeforeDispatching
W/dalvikvm( 2978): threadid=21: thread exiting with uncaught exception (group=0x40020560)
V/AudioPolicyManager( 2967): getDeviceForStrategy() from cache strategy 0, device 2
V/AudioPolicyManager( 2967): getOutput() stream 3, samplingRate 0, format 0, channels c, flags 0
E/AndroidRuntime( 2978): *** FATAL EXCEPTION IN SYSTEM PROCESS: WindowManagerPolicy
E/AndroidRuntime( 2978): java.lang.IllegalAccessError: tried to access field com.android.internal.app.ShutdownTh
read.mReboot from class com.android.internal.policy.impl.GlobalActions$8
E/AndroidRuntime( 2978):        at com.android.internal.policy.impl.GlobalActions$8.onPress(GlobalActions.java:2
09)
E/AndroidRuntime( 2978):        at com.android.internal.policy.impl.GlobalActions.onClick(GlobalActions.java:272
)
E/AndroidRuntime( 2978):        at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertContr
oller.java:873)
E/AndroidRuntime( 2978):        at android.widget.AdapterView.performItemClick(AdapterView.java:284)
E/AndroidRuntime( 2978):        at android.widget.ListView.performItemClick(ListView.java:3513)
E/AndroidRuntime( 2978):        at android.widget.AbsListView$PerformClick.run(AbsListView.java:1812)
E/AndroidRuntime( 2978):        at android.os.Handler.handleCallback(Handler.java:587)
E/AndroidRuntime( 2978):        at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 2978):        at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime( 2978):        at com.android.server.WindowManagerService$PolicyThread.run(WindowManagerService
.java:611)
V/AudioPolicyManager( 2967): startOutput() output 1, stream 3, session 3
V/AudioPolicyManager( 2967): changeRefCount() stream 3, count 1
V/AudioPolicyManager( 2967): getDeviceForStrategy() from cache strategy 0, device 2
V/AudioPolicyManager( 2967): getNewDevice() selected device 2
V/AudioPolicyManager( 2967): setOutputDevice() output 1 device 2 delayMs 0
V/AudioPolicyManager( 2967): setOutputDevice() setting same device 2 or null device for output 1
V/AudioHardwareMSM72XX( 2967): open driver
V/AudioHardwareMSM72XX( 2967): get config
V/AudioHardwareMSM72XX( 2967): set config
V/AudioHardwareMSM72XX( 2967): buffer_size: 4800
V/AudioHardwareMSM72XX( 2967): buffer_count: 2
V/AudioHardwareMSM72XX( 2967): channel_count: 2
V/AudioHardwareMSM72XX( 2967): sample_rate: 44100
W/AudioFlinger( 2967): write blocked for 164 msecs, 1 delayed writes, thread 0xcea8
V/AudioPolicyManager( 2967): stopOutput() output 1, stream 3, session 3
V/AudioPolicyManager( 2967): changeRefCount() stream 3, count 0
V/AudioPolicyManager( 2967): getNewDevice() selected device 0
V/AudioPolicyManager( 2967): setOutputDevice() output 1 device 0 delayMs 0
V/AudioPolicyManager( 2967): setOutputDevice() setting same device 0 or null device for output 1
D/VoldCmdListener(   85): asec list
I/StatusBarPolicy( 3033): BAT. status:2 health:2
I/StatusBarPolicy( 3033): BAT. status:2 health:2

keep in mind globalactions8 is pointing at the recovery. but all three options do the same thing with the same error.
 
Last edited:

lingfude

Senior Member
Jun 22, 2011
591
569
Aveiro
dmec-reviews.blogspot.pt
Hi Rookie407,

I remember when I made this mod in my rom I had some errors at the first few times I tested this.
The errors were because I add the resources idds in the "public.xml" but I forgot to add the reboot and recovery images in the resource file.
open "values\public.xml" and assign our strings resource id's

scroll until you get to the end of the "<public type="string"" id list
note the id of the last string, in this example it is "10403c2" sometimes
the id's are out of order so search for "10403c2 + 1" or "10403c3"
if the next id is unused then we can start assigning id's to the strings
we added.

Code:
<public type="string" name="reboot_recovery" id="0x010403c3" />
<public type="string" name="reboot_download" id="0x010403c4" />
<public type="string" name="reboot" id="0x010403c5" />

now is a good time to add the image resources so add your icons to
"res\drawable-hdpi"
and assign id's to them the same way we did for the strings
in this example, using the example icons in the zip file I had

Code:
<public type="drawable" name="reboot" id="0x010803aa" />
<public type="drawable" name="recovery" id="0x010803ab" />
<public type="drawable" name="download" id="0x010803ac" />

save and close

Don't know if this is your case but...
 

Rookie407

Senior Member
Dec 7, 2011
200
34
Clinton
thats deff not the case. the images and the lines come up just fine after i push the power button but it does a FC vibration thingy when i click to select an option other then the original 3...


why do i sound like a broken record here. =\
 

pvyParts

Inactive Recognized Developer
Oct 11, 2010
1,858
2,341
35
thats deff not the case. the images and the lines come up just fine after i push the power button but it does a FC vibration thingy when i click to select an option other then the original 3...


why do i sound like a broken record here. =\

can you post the smali from the shutdownThread file too :)

Pvy.
 

pvyParts

Inactive Recognized Developer
Oct 11, 2010
1,858
2,341
35
Open the file in notepad xda is returning a 404 on it ;)

Pvy

Sent from my LT18i using xda premium
 

pvyParts

Inactive Recognized Developer
Oct 11, 2010
1,858
2,341
35
Try This!

its gotta be yall i dl'd it just fine just tested it... xda wont let me upload it as a txt it keeps failing.

downloading now. xda does that sometimes :D

will update soon if i find somehting

Edit 1
you have two variables with the same name.

Code:
.field public static mReboot:I

.field private static mReboot:Z

Edit 2

Ok my 2 cents worth.

Change
".field public static mReboot:I"
to
".field public static mRebootInt:I"
in these places (red parts)

shutdown thread
line 29
Code:
[B]".field public static[COLOR="Red"] mRebootInt:I[/COLOR]"[/B]
line 2332
Code:
    sget v1, Lcom/android/internal/app/ShutdownThread;->[COLOR="red"][B]mRebootInt:I[/B][/COLOR]

then in the global action files that you made as well in this step (copy pasted from the OP

next add the code that runs when the menu item is pressed

copy GlobalActions$3.smali and name it GlobalActions$7.smali
open GlobalActions$7 and replace all instances of GlobalActions$3
with GlobalActions$7 then add this code to line 52 before
"invoke-static {v0, v1}, Lcom/android/internal/app/ShutdownThread;->shutdown(Landroid/content/Context;Z)V"
Code:
Code:
const/4 v2, 0x1
	
sput v2, Lcom/android/internal/app/ShutdownThread;->[B][COLOR="red"]mRebootInt:I[/COLOR][/B]
save and close

copy GlobalActions$3.smali and name it GlobalActions$8.smali
open GlobalActions$8 and replace all instances of GlobalActions$3
with GlobalActions$8 then add this code to line 52 before
"invoke-static {v0, v1}, Lcom/android/internal/app/ShutdownThread;->shutdown(Landroid/content/Context;Z)V"
Code:
Code:
const/4 v2, 0x2
	
sput v2, Lcom/android/internal/app/ShutdownThread;->[B][COLOR="red"]mRebootInt:I[/COLOR][/B]
save and close

copy GlobalActions$3.smali and name it GlobalActions$9.smali
open GlobalActions$9 and replace all instances of GlobalActions$3
with GlobalActions$9 then add this code to line 52 before
"invoke-static {v0, v1}, Lcom/android/internal/app/ShutdownThread;->shutdown(Landroid/content/Context;Z)V"
Code:
Code:
const/4 v2, 0x3
	
sput v2, Lcom/android/internal/app/ShutdownThread;->[B][COLOR="Red"]mRebootInt:I[/COLOR][/B]
save and close

compile android.policy

see how that goes. if you do all that and it still don't work link the new crash log and all the shutdownthread and globalactions files (zip them together and i will look at just them) ;) dont need the entire frameworks

Pvy
 
Last edited:
  • Like
Reactions: Rookie407

Rookie407

Senior Member
Dec 7, 2011
200
34
Clinton
downloading now. xda does that sometimes :D

will update soon if i find somehting

Edit 1
you have two variables with the same name.

Code:
.field public static mReboot:I

.field private static mReboot:Z

Edit 2

Ok my 2 cents worth.

Change
".field public static mReboot:I"
to
".field public static mRebootInt:I"
in these places (red parts)

shutdown thread
line 29
Code:
[B]".field public static[COLOR="Red"] mRebootInt:I[/COLOR]"[/B]
line 2332
Code:
    sget v1, Lcom/android/internal/app/ShutdownThread;->[COLOR="red"][B]mRebootInt:I[/B][/COLOR]

then in the global action files that you made as well in this step (copy pasted from the OP



see how that goes. if you do all that and it still don't work link the new crash log and all the shutdownthread and globalactions files (zip them together and i will look at just them) ;) dont need the entire frameworks

Pvy


works perfect man thanks for all your help!!! ill be sure your added into the credits of our rom. =)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 70
    this is the final method that will add reboot,recovery and download options
    to the power menu updated 10/21/2010

    ============================================================
    Step 1.

    the first thing we need to do is add string and image resources to framwork-res
    for this example I am using a stock JI6 ROM your resource id's will be different
    if on another ROM

    use apk_manager to decompile framework-res

    open "values\strings.xml" and add our string resources
    Code:
    <string name="reboot_recovery">Recovery</string>
    <string name="reboot_download">Download</string>
    <string name="reboot">Reboot</string>
    save and close

    open "values\public.xml" and assign our strings resource id's

    scroll until you get to the end of the "<public type="string"" id list
    note the id of the last string, in this example it is "10403c2" sometimes
    the id's are out of order so search for "10403c2 + 1" or "10403c3"
    if the next id is unused then we can start assigning id's to the strings
    we added.
    Code:
    <public type="string" name="reboot_recovery" id="0x010403c3" />
    <public type="string" name="reboot_download" id="0x010403c4" />
    <public type="string" name="reboot" id="0x010403c5" />
    now is a good time to add the image resources so add your icons to
    "res\drawable-hdpi"
    and assign id's to them the same way we did for the strings
    in this example, using the example icons in the zip file I had
    Code:
    <public type="drawable" name="reboot" id="0x010803aa" />
    <public type="drawable" name="recovery" id="0x010803ab" />
    <public type="drawable" name="download" id="0x010803ac" />
    save and close

    now framework-res has the resources needed for this mod use
    apk_manager to compile.

    ============================================================
    Step 2.

    next we need to modify Samsung's shutdown method to accept 3 more options
    so decompile framework and open "com\android\internal\app\ShutdownThread.smali"

    since we are going to pass an integer to ShutdownThread and then evaluate
    that integer when the code runs we have to have a spot for the integer so
    add this to line 37
    Code:
    .field public static mReboot:I
    then in method run at line 1463 add this code before "invoke-static {}, Landroid/os/Power;->shutdown()V"
    Code:
    sget v1, Lcom/android/internal/app/ShutdownThread;->mReboot:I
    	
    const/4 v2, 0x1
    	
    if-eq v1, v2, :reboot
    	
    const/4 v2, 0x2
    	
    if-eq v1, v2, :rebootRecovery
    	
    const/4 v2, 0x3
    	
    if-eq v1, v2, :rebootDownload

    then after this code on about line 1477
    Code:
    .line 531
    invoke-static {}, Landroid/os/Power;->shutdown()V
    
    .line 532
    return-void
    add this code
    Code:
    :reboot
    	
    const-string v4, "now"
    	
    invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V
    
    return-void
    	
    :rebootRecovery
    	
    const-string v4, "recovery"
    	
    invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V
    
    return-void
    	
    :rebootDownload
    	
    const-string v4, "download"
    	
    invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V
    
    return-void
    save and close

    compile framework

    ============================================================
    Step 3.

    now we are going to add the extra options to the power menu

    decompile android.policy

    open "com\android\internal\policy\impl\GlobalActions.smali"

    the first thing that we need to do is increase the array length by 3
    so in method createDialog on line 431 change this
    Code:
    const/4 v0, 0x3
    
    new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;
    to this
    Code:
    const/4 v0, 0x6
    
    new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;
    now add the new menu items this is where the resource id's that we added
    to framework-res com into play so on line 457 after "aput-object v2, v0, v1"
    add this code
    Code:
        const/4 v1, 0x3
    
        new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$7;
    
        const v3, 0x10803aa # reboot icon resource id
    
        const v4, 0x10403c5 # reboot string resource id 
    
        invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
        aput-object v2, v0, v1
    
        const/4 v1, 0x4
    
        new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$8;
    
        const v3, 0x10803ab # recovery icon resource id
    
        const v4, 0x10403c3 # recovery string resource id
    
        invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$8;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
        aput-object v2, v0, v1
    
        const/4 v1, 0x5
    
        new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$9;
    
        const v3, 0x10803ac # download icon resource id
    
        const v4, 0x10403c4 # download string resource id
    
        invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$9;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
        aput-object v2, v0, v1

    make sure to change the resource id's to match what you added to to framework-res

    save and close

    next add the code that runs when the menu item is pressed

    copy GlobalActions$3.smali and name it GlobalActions$7.smali
    open GlobalActions$7 and replace all instances of GlobalActions$3
    with GlobalActions$7 then add this code to line 52 before
    "invoke-static {v0, v1}, Lcom/android/internal/app/ShutdownThread;->shutdown(Landroid/content/Context;Z)V"
    Code:
    const/4 v2, 0x1
    	
    sput v2, Lcom/android/internal/app/ShutdownThread;->mReboot:I
    save and close

    copy GlobalActions$3.smali and name it GlobalActions$8.smali
    open GlobalActions$8 and replace all instances of GlobalActions$3
    with GlobalActions$8 then add this code to line 52 before
    "invoke-static {v0, v1}, Lcom/android/internal/app/ShutdownThread;->shutdown(Landroid/content/Context;Z)V"
    Code:
    const/4 v2, 0x2
    	
    sput v2, Lcom/android/internal/app/ShutdownThread;->mReboot:I
    save and close

    copy GlobalActions$3.smali and name it GlobalActions$9.smali
    open GlobalActions$9 and replace all instances of GlobalActions$3
    with GlobalActions$9 then add this code to line 52 before
    "invoke-static {v0, v1}, Lcom/android/internal/app/ShutdownThread;->shutdown(Landroid/content/Context;Z)V"
    Code:
    const/4 v2, 0x3
    	
    sput v2, Lcom/android/internal/app/ShutdownThread;->mReboot:I
    save and close

    compile android.policy

    done test on the phone.

    flash the attached update.zip with the stock updater.
    5
    someone asked for this so here it is.

    decompile android.policy

    make a copy of GlobalActions$3.smali and name it to GlobalActions$7.smali open GlobalActions$7.smali

    and replace all instances of GlobalActions$3 with GlobalActions$7

    replace method onPress with this

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

    save and close

    now open GlobalActions.smali

    and in method createDialog

    the first thing that we need to do is increase the array length by 1 so find this
    Code:
    const/4 v0, 0x3
    
    new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;
    and change to
    Code:
    const/4 v0, 0x4
    
    new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;
    next we add the new menu item so on line 457 we add this next bit of code after "aput-object v2, v0, v1"
    Code:
    const/4 v1, 0x3 # position in the menu array
    
    new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$7;
    
    const v3, 0x1080030  # power icon
    
    const v4, 0x10402af  # reboot string
    
    invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
    aput-object v2, v0, v1
    framework-res already has a string for reboot so no modifications are needed to framework-res

    save and close then compile android.policy

    Hi,

    Thanks so much for this, absolutely fantastic work like always!

    For anyone that doesn't know how to decompile/compile apk files search for either APK Manager, or smali/baksmali tutorial/help/etc., it should help you out greatly.

    And for those that want a flashable .zip, well, here you go, BUT, I'm lazy, so it requires some conditions:

    1) You use a rom based on JI6 that's fully deodexed
    2) you have previously flashed (or your custom rom included) the epic/puzzle lockscreen mod (also from untermensch)
    3) You disable voodoo (if you use it) prior to flashing since this zip attempts to wipe your dalvik-cache


    That said, zip should flash fine from clockwork, and all it does is replace your android.policy.jar with one pre-modded for lockscreen & reboot option support, and it wipes your dalvik-cache since that's the safest thing to do after applying any mod, period.

    Cheers, =)
    2
    Hate to be the one to burst your bubble. This tutorial hasn't applied to any firmware after GingerBread. From ICS and up, the google code changed, and these steps won't work. Sorry, wish I had better news for you.

    Edit - Come to think of it, these exact steps didn't work on GB either, eclipse and froyo with a TWIZ interface they did, but since then a lot of the code has changed.

    Give a man a fish and he will eat for a day, teach that same man to use Google Search, and he can answer his own questions for the rest of his life.
    2
    The 4 Way Reboot mod is a lot easier. A lot easier.The only modification for 4Way is to androidpolicy.jar. No edits or modifications to framework-res.apk at all. Told you it was easy. Lol. My 2¢ cent.

    http://xdaforums.com/showthread.php?p=24235582
    18d2487c-47df-0324.jpg
    18d2487c-47e8-1e3e.jpg


    Sent from my SAMSUNG-SGH-I717 using Tapatalk 2
    2
    no no no ,,

    check android policy ,,, totally different

    Code from OP
    Code:
    const/4 v1, 0x3
    
        new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$7;
    
        const v3, 0x10803aa # reboot icon resource id
    
        const v4, 0x10403c5 # reboot string resource id 
    
        invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
        aput-object v2, v0, v1
    
        const/4 v1, 0x4
    
        new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$8;
    
        const v3, 0x10803ab # recovery icon resource id
    
        const v4, 0x10403c3 # recovery string resource id
    
        invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$8;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
        aput-object v2, v0, v1
    
        const/4 v1, 0x5
    
        new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$9;
    
        const v3, 0x10803ac # download icon resource id
    
        const v4, 0x10403c4 # download string resource id
    
        invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$9;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
        aput-object v2, v0, v1

    Code I used in Gingerbread

    Code:
        const/4 v1, 0x4
    
        new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$8;
    
        const v3, 0x1080434
    
        const v4, 0x1040488
    
        invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$8;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
        aput-object v2, v0, v1
    
        const/4 v1, 0x5
    
        new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$9;
    
        const v3, 0x1080435
    
        const v4, 0x1040486
    
        invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$9;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
        aput-object v2, v0, v1
    
        const/4 v1, 0x6
    
        new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$10;
    
        const v3, 0x1080436
    
        const v4, 0x1040487
    
        invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$10;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
    
        aput-object v2, v0, v1

    Everything shifted up one because there is an additional GlobalActions smali.