[Sony Cross-Device General] sandy7:
Reboot options for jb 4.3

So lets Start

Required

1-apktool

2-notepad++

3-some brains

Before u decompile anything see this Guide by [MENTION=4898631]erorcun[/MENTION] for how to compile a JB framework without bootloop..

http://xdaforums.com/showthread.php?t=2321207

STEP-1

Decompile Framework-res.apk

goto to res/vlaues/arrays.xml

and add these lines at the end

<string-array name="reboot_options">
<item>@string/reboot_normal</item>
<item>@string/reboot_recovery</item>
<item>@string/reboot_bootloader</item>
</string-array>
<string-array name="reboot_actions">
<item>now</item>
<item>recovery</item>
<item>bootloader</item>
</string-array>

now goto res/values/strings

and add these lines at the end

<string name="reboot">Reboot</string>
<string name="reboot_normal">Reboot</string>
<string name="reboot_recovery">Recovery</string>
<string name="reboot_bootloader">Bootloader</string>

goto add the ic_lock_reboot.png which i have i provided in the resources attached below this post to drawablw-hdpi folder

so before compiling the framework-res.apk follow erorcun's guide to properly recompile framework-res.apk

once recompile is done ....decompile again to get the HEX ID's

STEP-2

decompile android.policy.jar

goto classout\com\android\internal\policy\impl

and add the 3 smali's files which i provided in the resources attached below

Now option classout\com\android\internal\policy\impl\GlobalActions.smali

and find these lines and add the red marked lines between them

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

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

const v2, 0x1080030

const v3, 0x10400fa

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

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

[COLOR="Red"] .line 213
move-object/from16 v0, p0

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

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

const v3, 0x1080827

const v4, 0x104060b

move-object/from16 v0, p0

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

invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z[/COLOR]

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

iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;

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

now we need to assign the Hex id's as per ur Public.xml

NOTE: the hex id's might be different from mine and yours so be careful while comparing

new as per the above changes in GlobalActions.xml

assign the id's as below

<public type="drawable" name="ic_lock_reboot" id="0x01080827" />

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

const v3, 0x[COLOR="red"]1080827[/COLOR]

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

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

const v3, 0x1080827

const v4, 0x[COLOR="red"]104060b[/COLOR]

Now option up classout\com\android\internal\policy\impl\GlobalActions$11.smali

find and replace the following

@line 70

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

const v3, 0x[COLOR="red"]104060b[/COLOR]

@line 90

<public type="array" name="reboot_options" id="0x0107003b" />

const v3, 0x[COLOR="red"]107003b[/COLOR]

@line 105

<public type="string" name="ok" id="0x0104000a" />

const v2, 0x[COLOR="red"]104000a[/COLOR]

@line 147

<public type="bool" name="config_sf_slowBlur" id="0x0111000b" />

const v3, 0x[COLOR="red"]111000b[/COLOR]

now open up classout\com\android\internal\policy\impl\GlobalActions$11$2.smali

@line 59

<public type="array" name="reboot_actions" id="0x0107003c" />

const v2, 0x[COLOR="red"]107003c[/COLOR]

save it and recompile android.policy.jar

now push all the files into ut phone...will have the new Advanced reboot options