[LG Optimus 2x] civato:
3 WAY REBOOT OPTION TUTORIAL

All info is here so don't ask for further help, if you can't follow these instructions or want to read correctly don't even start.

What is this for?

You want to have the extra reboot options when pressing restart on your LG shutdown menu

Reboot = Normal reboot as you know it.

Hot Boot = Closes every service and app and does a quick reboot = you don't see the LG reboot logo = it jumps straight to the bootanimation = this is very fast reboot.

Recovery = Reboot into recovery mode.

What will we be needing?

(If you need Java , SDK or anything else , I don't know as my system already got that installed, a rom cook/dev will already got that installed and knows what I'm talking about)

Deodexed framework ( You don't know what that is or can't get it well stop here)

Notepad ++

Winrar or 7Zip (I prefer winrar)

Download the "Decompiler-jar_Files-updated" from the attachments.(Tool)

Extract the "Decompiler-jar_Files.zip".

Extract the "android.policy.jar" from your rom /system/framework/

Get to it part 1:

Put the "android.policy.jar" into the extracted "Decompiler-jar_Files-updated" folder.

Click the "1.bat" = you get a classout folder.

Navigate to .....\classout\com\android\internal\policy\impl\GlobalActions.smali

Open GlobalActions.smali with notepad++ and change the following lines

after

that close and save the changes.

Original Lines:

486 new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$3;
487
488 const v2, 0x2020269
489
490 const v3, 0x20b0001
491
492 invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$3;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

New Code:

486 new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$[COLOR=Red]99[/COLOR];
487
488 const v2, 0x2020269
489
490 const v3, 0x20b0001
491
492 invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$[COLOR=Red]99[/COLOR];-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

Get to it part 2:

Navigate to ....\classout\com\android\internal\policy\impl\GlobalActions$SinglePressAction.smali

Open GlobalActions$SinglePressAction.smaliwith notepad++ and add the following lines

after

that close and save the changes.

-Lines to add before line "# instance fields"

# static fields
.field protected static rebootMode:I

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

-Lines to add after line "# 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, "Hot Boot"

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

-It should look like this and the line numbers must be exact the same!(green are the new lines)

19
[COLOR=DarkGreen]20# static fields
21.field protected static rebootMode:I
22
23.field protected static final rebootOptions:[Ljava/lang/String;[/COLOR]
24
25
26# instance fields
27.field private final mIconResId:I
28
29.field private final mMessageResId:I
30
31
32# direct methods
[COLOR=DarkGreen]33.method static constructor <clinit>()V
34 .registers 3
35
36 const/4 v0, 0x3
37
38 new-array v0, v0, [Ljava/lang/String;
39
40 const/4 v1, 0x0
41
42 const-string v2, "Reboot"
43
44 aput-object v2, v0, v1
45
46 const/4 v1, 0x1
47
48 const-string v2, "Hot Boot"
49
50 aput-object v2, v0, v1
51
52 const/4 v1, 0x2
53
54 const-string v2, "Recovery"
55
56 aput-object v2, v0, v1
57
58 sput-object v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
59
60 return-void
61.end method[/COLOR]
62

Get to it part 3:

You download the "99-jar-files.zip" from attachments and extract them.

Now you copy/past the 3 files into ....\classout\com\android\internal\policy\impl\..

After that and you have saved the changes you made you click on "2.bat" that is in the extracted "Decompiler-jar_Files" folder.

Now you get a "classes.dex" in the extracted "Decompiler-jar_Files-updated".

Open your "android.policy.jar" with winrar and drag the new "classes.dex" file into the "android.policy.jar"and replace the original "classes.dex".

Close winrar and replace the "android.policy.jar" in system/framework of your rom with the new one. You can do this with a root explorer or before you build your rom.

Enjoy and don't forget to give proper credit and push thanks.

Thanks:

I would like to thank kahvitahra for the original guide and 99 files.

I had to change some lines in the code and the 99 files to make it work on our LG X2 ICS roms.

Camera ShutterSound off option

​

What is this for?

V30B Germany doesn't got this option but it easy to get it

What will we be needing?

(If you need Java , SDK, a rom cook/dev will already got that installed and knows what I'm talking about)

CameraApp.apk (system/app) , framework-res.apk and lg-res.apk (system/framework) = all deodexed.

Notepad ++

Winrar or 7Zip (I prefer winrar)

APK-MultiTool and install this.

Get to it part 1:

Put the "framework-res.apk" and "lg-res.apk" in the "other" folder.

Rename

the "lg-res.apk" to "com.htc.resources.apk" (If not decompiling will not be succesful. NOTE: also needed if you want to decompile the "SystemUI.apk for battery mods"

Click on the "Setup.bat" and select "2" and then "1" (This will set correct sources)

Again Click on the "Setup.bat" and select "2" and then "3" (This will set correct sources)

Again Click on the "Setup.bat" and select "3"(This will create the folders).

Get to it part 2:

Put the "CameraApp.apk" in the "place-apk-here-for-modding" folder.

Click on the "Script.bat" and Decompile the "CameraApp.apk" with the APK-MultiTool (set project .. = select the apk ...= select .. to decompile). (With my tool it is 25 to select project , 9 to decompile)

In "project" folder of the APK-MultiTool you will find the folder "CameraApp.apk"

Now go to /projects/CameraApp.apk/res/values/arrays.xml

Open "arrays.xml" with the notepad++ and search the following line: "star_camera_shutter_sound_entries" = Line 13258.

Now you will need to add a line just after this line "<string-array name="star_camera_shutter_sound_entries">"

You add the following line "item>@string/off</item>"

Now you will need to add a line just after this line " <string-array name="star_camera_shutter_sound_entryValues">"

You add the following line "<item>off</item>"

So it looks like this:

13258 <string-array name="star_camera_shutter_sound_entries">
13259 <item>@string/off</item>
13260 <item>@string/shutter_sound_1</item>
13261 <item>@string/shutter_sound_2</item>
13262 <item>@string/shutter_sound_3</item>
13263 <item>@string/shutter_sound_4</item>
13264 </string-array>
13265 <string-array name="star_camera_shutter_sound_entryValues">
13266 <item>off</item>
13267 <item>0</item>
13268 <item>1</item>
13269 <item>2</item>
13270 <item>3</item>
13271 </string-array>

Get to it part 3:

Safe the changes.

Now as a "Compile System APK files" (with me it is option 11)

It starts building............

If it asks "Aside from the signatures, would you like to copy......................." you click "y".

Now you get a second question .................................. , before you do anything you go to the newly created "keep" folder and

delete

"resources.arsc"

Return to the cmd and you press any key , it will finish the build if you did everything correct. (Please don't ask me to solve your errors)

Now go to the "place-apk-here-for-modding" and you will find the new "System_CameraApp.apk" (with older tools it is called "unsigned_.....")

Get to it part 4:

Extract the "System_CameraApp.apk" with winrar.

In that extracted folder select everything and create a new "CameraApp.zip" , now before you press the compress button you rename the .zip to .apk so it is like this "CameraApp.apk".

Now you press the compress button but make sure you compress into

store mode

.

Now it is all done and you can replace your old CameraApp.apk in system/app.

If you replace it with a root explorer a reboot and wipe of dalvik cache is needed.

Enjoy and don't forget to say thank you!

​