[GUIDE] 3-WAY REBOOT / CAMERA Shuttersound OFF option = stock LG ICS roms

civato

Inactive Recognized Contributor
Apr 20, 2011
4,296
19,222
0
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

  1. Reboot = Normal reboot as you know it.
  2. 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.
  3. 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)


  1. Deodexed framework ( You don't know what that is or can't get it well stop here)
  2. Notepad ++
  3. Winrar or 7Zip (I prefer winrar)
  4. Download the "Decompiler-jar_Files-updated" from the attachments.(Tool)
  5. Extract the "Decompiler-jar_Files.zip".
  6. Extract the "android.policy.jar" from your rom /system/framework/

Get to it part 1:

  1. Put the "android.policy.jar" into the extracted "Decompiler-jar_Files-updated" folder.
  2. Click the "1.bat" = you get a classout folder.
  3. Navigate to .....\classout\com\android\internal\policy\impl\GlobalActions.smali
  4. Open GlobalActions.smali with notepad++ and change the following lines after that close and save the changes.
Original Lines:

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

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:

  1. Navigate to ....\classout\com\android\internal\policy\impl\GlobalActions$SinglePressAction.smali
  2. Open GlobalActions$SinglePressAction.smaliwith notepad++ and add the following lines after that close and save the changes.
-Lines to add before line "# instance fields"
Code:
# static fields
.field protected static rebootMode:I

.field protected static final rebootOptions:[Ljava/lang/String;
-Lines to add after line "# direct methods"
Code:
.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)

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


  1. You download the "99-jar-files.zip" from attachments and extract them.
  2. Now you copy/past the 3 files into ....\classout\com\android\internal\policy\impl\..
  3. After that and you have saved the changes you made you click on "2.bat" that is in the extracted "Decompiler-jar_Files" folder.
  4. Now you get a "classes.dex" in the extracted "Decompiler-jar_Files-updated".
  5. 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".
  6. 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.
  7. 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)

  1. CameraApp.apk (system/app) , framework-res.apk and lg-res.apk (system/framework) = all deodexed.
  2. Notepad ++
  3. Winrar or 7Zip (I prefer winrar)
  4. APK-MultiTool and install this.

Get to it part 1:

  1. Put the "framework-res.apk" and "lg-res.apk" in the "other" folder.
  2. 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"
  3. Click on the "Setup.bat" and select "2" and then "1" (This will set correct sources)
  4. Again Click on the "Setup.bat" and select "2" and then "3" (This will set correct sources)
  5. Again Click on the "Setup.bat" and select "3"(This will create the folders).


Get to it part 2:

  1. Put the "CameraApp.apk" in the "place-apk-here-for-modding" folder.
  2. 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)
  3. In "project" folder of the APK-MultiTool you will find the folder "CameraApp.apk"
  4. Now go to /projects/CameraApp.apk/res/values/arrays.xml
  5. Open "arrays.xml" with the notepad++ and search the following line: "star_camera_shutter_sound_entries" = Line 13258.
  6. Now you will need to add a line just after this line "<string-array name="star_camera_shutter_sound_entries">"
  7. You add the following line "item>@string/off</item>"
  8. Now you will need to add a line just after this line " <string-array name="star_camera_shutter_sound_entryValues">"
  9. You add the following line "<item>off</item>"
So it looks like this:
Code:
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:

  1. Safe the changes.
  2. Now as a "Compile System APK files" (with me it is option 11)
  3. It starts building............
  4. If it asks "Aside from the signatures, would you like to copy......................." you click "y".
  5. Now you get a second question .................................. , before you do anything you go to the newly created "keep" folder and delete "resources.arsc"
  6. 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)
  7. 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:

  1. Extract the "System_CameraApp.apk" with winrar.
  2. 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".
  3. Now you press the compress button but make sure you compress into store mode.
  4. Now it is all done and you can replace your old CameraApp.apk in system/app.
  5. 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!

 

Attachments

Last edited:

spyrosk

Senior Member
Jan 4, 2012
457
1,065
0
Athens
Nice guide and really usefull add-on.:good:
But I cannot decompile any of the two android.policy.jar files I tried (one from flex-icer 4.7 and the other from multi-flex 1.1).
I get this error:
Code:
D:\Downloads\Decompiler-jar_Files>1.bat
 
D:\Downloads\Decompiler-jar_Files>java -jar baksmali.jar -x android.policy.jar -
o classout
 
 
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: bad magic value: 64 65 78 0a 30 33 36 00
        at org.jf.dexlib.DexFile.<init>(DexFile.java:377)
        at org.jf.baksmali.main.main(main.java:250)
 
D:\Downloads\Decompiler-jar_Files>
Only the one from multi-flex 1.2 can be decompiled.
Am I doing something wrong?
 

Memhis

Senior Member
Sep 12, 2011
302
162
73
3 WAY REBOOT OPTION TUTORIAL
I have tried this with Django and it works. Thanks for the guide.





Nice guide and really usefull add-on.:good:
But I cannot decompile any of the two android.policy.jar files I tried (one from flex-icer 4.7 and the other from multi-flex 1.1).
I get this error:
Code:
D:\Downloads\Decompiler-jar_Files>1.bat
 
D:\Downloads\Decompiler-jar_Files>java -jar baksmali.jar -x android.policy.jar -
o classout
 
 
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: bad magic value: 64 65 78 0a 30 33 36 00
        at org.jf.dexlib.DexFile.<init>(DexFile.java:377)
        at org.jf.baksmali.main.main(main.java:250)
 
D:\Downloads\Decompiler-jar_Files>
Only the one from multi-flex 1.2 can be decompiled.
Am I doing something wrong?

Tried to decompile the file from both Civato`s rom and it get the job without errors.
But I have not used Decompiler-jar_Files tool to decompile/compile. Just took the smali part from this tutorial and do the job with tool which I use always. So maybe something is wrong with commands or smali version in Decompiler-jar_Files.

Edit:
Tried and have got the same error as you, spyrosk, using the tools from Decompiler-jar_Files, but with other tool which I use no errors, and it compile/decompile without errors.
 
Last edited:
  • Like
Reactions: spyrosk

civato

Inactive Recognized Contributor
Apr 20, 2011
4,296
19,222
0
Nice guide and really usefull add-on.:good:
But I cannot decompile any of the two android.policy.jar files I tried (one from flex-icer 4.7 and the other from multi-flex 1.1).
I get this error:
Code:
D:\Downloads\Decompiler-jar_Files>1.bat
 
D:\Downloads\Decompiler-jar_Files>java -jar baksmali.jar -x android.policy.jar -
o classout
 
 
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: bad magic value: 64 65 78 0a 30 33 36 00
        at org.jf.dexlib.DexFile.<init>(DexFile.java:377)
        at org.jf.baksmali.main.main(main.java:250)
 
D:\Downloads\Decompiler-jar_Files>
Only the one from multi-flex 1.2 can be decompiled.
Am I doing something wrong?
No , my bad , I will upload the fixed tool tomorrow. Got so many tools that I took the wrong one.

EDIT:
Tool is updated
 
Last edited:
  • Like
Reactions: spyrosk

spyrosk

Senior Member
Jan 4, 2012
457
1,065
0
Athens
Edit:
Tried and have got the same error as you, spyrosk, using the tools from Decompiler-jar_Files, but with other tool which I use no errors, and it compile/decompile without errors.
No , my bad , I will upload the fixed tool tomorrow. Got so many tools that I took the wrong one.
No problem.
BTW with apktool they can be decompiled/compiled just fine like Memhis said
 

civato

Inactive Recognized Contributor
Apr 20, 2011
4,296
19,222
0
New Mod Guide

Camera ShutterSound off option



What is this for?
V30B Germany and V30A EU 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)

  1. CameraApp.apk (system/app) , framework-res.apk and lg-res.apk (system/framework) = all deodexed.
  2. Notepad ++
  3. Winrar or 7Zip (I prefer winrar)
  4. APK-MultiTool and install this.

Get to it part 1:

  1. Put the "framework-res.apk" and "lg-res.apk" in the "other" folder.
  2. 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"
  3. Click on the "Setup.bat" and select "2" and then "1" (This will set correct sources)
  4. Again Click on the "Setup.bat" and select "2" and then "3" (This will set correct sources)
  5. Again Click on the "Setup.bat" and select "3"(This will create the folders).


Get to it part 2:

  1. Put the "CameraApp.apk" in the "place-apk-here-for-modding" folder.
  2. 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)
  3. In "project" folder of the APK-MultiTool you will find the folder "CameraApp.apk"
  4. Now go to /projects/CameraApp.apk/res/values/arrays.xml
  5. Open "arrays.xml" with the notepad++ and search the following line: "star_camera_shutter_sound_entries" = Line 13258.
  6. Now you will need to add a line just after this line "<string-array name="star_camera_shutter_sound_entries">"
  7. You add the following line "item>@string/off</item>"
  8. Now you will need to add a line just after this line " <string-array name="star_camera_shutter_sound_entryValues">"
  9. You add the following line "<item>off</item>"
So it looks like this:
Code:
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:

  1. Safe the changes.
  2. Now as a "Compile System APK files" (with me it is option 11)
  3. It starts building............
  4. If it asks "Aside from the signatures, would you like to copy......................." you click "y".
  5. Now you get a second question .................................. , before you do anything you go to the newly created "keep" folder and delete "resources.arsc"
  6. 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)
  7. 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:

  1. Extract the "System_CameraApp.apk" with winrar.
  2. 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".
  3. Now you press the compress button but make sure you compress into store mode.
  4. Now it is all done and you can replace your old CameraApp.apk in system/app.
  5. 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!

ALL INFO ALSO IN OP
 
Last edited:

spyrosk

Senior Member
Jan 4, 2012
457
1,065
0
Athens
Ok after long test and a second test the shuttersound mod dosent work for me...

I do all as in the guide, result same as before no shuttersound off option :(
I made one for the v30A 4.7 Flex-Icer. It doesn't work for me too.
I also tried the already patched from MultiFlex 2.0. It doesn't work on V30A only on Multi-Flex.

Civato,
Is there a possibility that camera app is dependent on another system file that needs patching?
Or maybe something else must be changed in it's files also.
Which camera app have you used as source? the V30B-Germany?

Thanks
 
Last edited:

feav

Senior Member
Nov 7, 2007
269
243
0
I made one for the v30A 4.7 Flex-Icer. It doesn't work for me too.
I also tried the already patched from MultiFlex 2.0. It doesn't work on V30A only on Multi-Flex.

Civato,
Is there a possibility that camera app is dependent on another system file that needs patching?
Or maybe something else must be changed in it's files also.
Which camera app have you used as source? the V30B-Germany?

Thanks
I think you need check necessary libs like in this mod:
www.forum.xda-developers.com/showthread.php?t=2163473. Also this mod already have noshuttersound option.
 
  • Like
Reactions: spyrosk