[Android One (First-Generation) Cross-Device Genera] qitaro:
3-way power menu (power off, reboot, recovery)

If u get emoticon in some lines, u can edit manually it with ";" ")" (without the quotes) for ;)

*decompile framework-res.apk

*open \framework-res\res\values\arrays.xml​

looking for <item>power</item> immediately below this line inserted

Code:

<item>reboot</item>

<item>recovery</item>

then immediately open strings.xml and add at the end

Code:

<string name="reboot_recovery">Recovery</string>

same thing in the folder values-in (my country Indonesia or similar for your country)

Code:

<string name="reboot_recovery">Reboot kerecovery</string>

* Put the necessary files and copy to framework-res\res\drawable-hdpi

*Recompile and decompile again (that would be assigned id)

*Open public.xml in framework-res\res\values (we'll be here to watch the assigned id)​

record id (meybe you get different id):

<public type="drawable" name="ic_reboot" id="0x0108075e" />

<public type="string" name="factorytest_reboot" id="0x010403db" />

<public type="drawable" name="ic_recovery" id="0x0108075f" />

<public type="string" name="reboot_recovery" id="0x010406eb" />

*Decompile android.policy.jar​

open GlobalActions.smali (smali/com/android/internal/policy)

paste below this line 20: Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;,

the following:

Code:

Lcom/android/internal/policy/impl/GlobalActions$RebootAction;,

Lcom/android/internal/policy/impl/GlobalActions$RebootRecovery;,

paste below this line 38: .field private static final GLOBAL_ACTION_KEY_POWER:Ljava/lang/String; = "power"

the following:

Code:

.field private static final GLOBAL_ACTION_KEY_REBOOT:Ljava/lang/String; = "reboot"

.field private static final GLOBAL_ACTION_KEY_RECOVERY:Ljava/lang/String; = "recovery"

and delete this

.field private static final GLOBAL_ACTION_KEY_SETTINGS:Ljava/lang/String; = "settings"

Look field line 1030:

const-string v0, "airplane"

and replace the code from .line 275 to .line 276

Code:

:cond_3

const-string v0, "airplane"

invoke-virtual {v0, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v0

if-eqz v0, :cond_4

at

Code:

:cond_3

const-string v0, "reboot"

invoke-virtual {v0, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v0

if-eqz v0, :cond_4

.line 276

iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;

new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$RebootAction;

const/4 v2, 0x0

invoke-direct {v1, p0, v2}, Lcom/android/internal/policy/impl/GlobalActions$RebootAction;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V

invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

goto :goto_3

now find

const-string v0, "settings"

and replace the code from .line 290 to .line 292

Code:

:cond_7

const-string v0, "settings"

invoke-virtual {v0, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v0

if-eqz v0, :cond_8

.line 291

iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;

invoke-direct {p0}, Lcom/android/internal/policy/impl/GlobalActions;->getSettingsAction()Lcom/android/internal/policy/impl/GlobalActions$Action;

move-result-object v1

invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

goto :goto_3

at

Code:

:cond_7

const-string v0, "recovery"

invoke-virtual {v0, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v0

if-eqz v0, :cond_2

.line 291

iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;

new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$RebootRecovery;

const/4 v2, 0x0

invoke-direct {v1, p0, v2}, Lcom/android/internal/policy/impl/GlobalActions$RebootRecovery;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V

invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

goto/16 :goto_3

*put the necessary files and paste to smali/com/android/internal/policy

*Open GlobalActions$RebootAction.smali

Change line 30 and 32 with your id which had been recorded

const v0, 0x0108075e (id ic_reboot)

const v1, 0x010403db (id factorytest_reboot)

*Open GlobalActions$RebootRecovery.smali

Change line 30 and 32 with your id which had been recorded

const v0, 0x0108075f (id ic_recovery)

const v1, 0x010406eb (id reboot_recovery)

*All done..!!!

You can push framework-res.apk and android.policy.jar to system

(flashable zip is recommended)​

:good:Press Thanks if helped:good:

:good:PLACE YOUR CURSOR ON THANKS BUTTON AND CLICK IT:good:​