Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,805,363 Members 44,435 Now Online
XDA Developers Android and Mobile Development Forum

[MOD] [GUIDE] [ 4.4.2 ] [ Stock-Flex-Pro2-G3 ] Advanced Power Menu [22.06.2014]

Tip us?
 
pendroz
Old
(Last edited by pendroz; 21st June 2014 at 11:24 PM.)
#1  
pendroz's Avatar
Senior Member - OP
Thanks Meter 4,115
Posts: 1,399
Join Date: Jun 2012
Location: Istanbul

 
DONATE TO ME
Default [MOD] [GUIDE] [ 4.4.2 ] [ Stock-Flex-Pro2-G3 ] Advanced Power Menu [22.06.2014]

3 Way Reboot Option Guide

All information, follow these instructions !



Why do you need ?

* Reboot : Normal Reboot

* 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.

Required tools

* Java
* SDK
* Notepad ++ ( Or another application )
* Deodexed Framework
* Winrar or 7Zip or Winzip
* Baksmali/Smali Manager
* Download the "Required files"
* Extract the "android.policy.jar" from your rom /system/framework/


PART 1

* Put the "\classout\com\android\internal\policy\impl\" into the extracted "Required files" folder.

* Open GlobalActions.smali with notepad++ and change the following lines after that close and save the changes.

- Required line

Code:
1125    .line 339
1126    iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
1127
1128    new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$3;
1129
1130    const v2, 0x202042c
1131
1132    const v3, 0x20b0013
1133
1134    invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$3;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
1135
1136    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
- New Line

Code:
1125    .line 339
1126    iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
1127
1128    new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$99;
1129
1130    const v2, 0x202042c
1131
1132    const v3, 0x20b0013
1133
1134    invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$99;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
1135
1136    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
PART 2

* Navigate to ....\classout\com\android\internal\policy\impl\Glo balActions$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"

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
PART 3

Trick

Quote:
Originally Posted by xdabbeb View Post

Here's a slightly modified version that I've been using for a while. It just removes Download (shutdownthread doesn't support it), uses "setprop ctl.restart zygote" as the shell restart command (better method imo and doesn't require busybox), and renames the options to what I preferred.
* Open GlobalActions$99.smali with notepad++ and add the following lines after that close and save the changes.


Org line

Code:
    const-string v2, "Restart Method"
Modified line

Code:
    const-string v2, "Own Rom Name"
* Compile clasess.dex file ( Baksmali/Smali Tool )

* 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".

* You can do this with a File explorer ( With root permissions or before you build your rom. )

Thanks @kahvitahra and @civato and @_JKay_ and @xdabbeb original guide and Required files
Attached Files
File Type: zip Requiredfiles.zip - [Click for QR Code] (2.9 KB, 215 views)
File Type: zip Baksmali-smali2.0.3.zip - [Click for QR Code] (5.50 MB, 208 views)

Device History

Galaxy S2 Galaxy S3

LG G2 ( D802 )

Project

S2 ( Turkbey Rom Team ) S3 ( Pardus HD RoM™ )

LG G2 Pardus HD RoM™
The Following 16 Users Say Thank You to pendroz For This Useful Post: [ Click to Expand ]
 
pendroz
Old
#2  
pendroz's Avatar
Senior Member - OP
Thanks Meter 4,115
Posts: 1,399
Join Date: Jun 2012
Location: Istanbul

 
DONATE TO ME
Main Thread update big thanks @xdabbeb

* Update Required files and Baksmali Smali Tool

Device History

Galaxy S2 Galaxy S3

LG G2 ( D802 )

Project

S2 ( Turkbey Rom Team ) S3 ( Pardus HD RoM™ )

LG G2 Pardus HD RoM™
The Following 4 Users Say Thank You to pendroz For This Useful Post: [ Click to Expand ]
 
RocketSauce83
Old
#3  
RocketSauce83's Avatar
Senior Member
Thanks Meter 963
Posts: 465
Join Date: Apr 2012

 
DONATE TO ME
Great thanks! This is what i've been waiting for G2
The Following User Says Thank You to RocketSauce83 For This Useful Post: [ Click to Expand ]
 
pendroz
Old
#4  
pendroz's Avatar
Senior Member - OP
Thanks Meter 4,115
Posts: 1,399
Join Date: Jun 2012
Location: Istanbul

 
DONATE TO ME
Update KK

Device History

Galaxy S2 Galaxy S3

LG G2 ( D802 )

Project

S2 ( Turkbey Rom Team ) S3 ( Pardus HD RoM™ )

LG G2 Pardus HD RoM™
The Following 4 Users Say Thank You to pendroz For This Useful Post: [ Click to Expand ]
 
assa51
Old
#5  
assa51's Avatar
Member
Thanks Meter 14
Posts: 56
Join Date: Nov 2013
Location: Istanbul
Quote:
Originally Posted by pendroz View Post
Update KK
do you have a guide also for stock KK (on odexed rom)?

Teşekkürler bunun saf G2 kitkat için olanı varmı acaba odex uzantılılar için?
 
AyDee
Old
(Last edited by AyDee; 23rd March 2014 at 06:03 PM.)
#6  
AyDee's Avatar
Senior Member
Thanks Meter 882
Posts: 1,256
Join Date: Sep 2010
Location: Mobile

 
DONATE TO ME
@pendroz
Is this the same for all carriers' firmwares?
Does only framework.jar need to be deodexed or the whole framework folder?
Do we compile all 3 files in required folder into classes.dex?
Sorry for all of the questions. Cheers & teşekkürler!
 
pendroz
Old
#7  
pendroz's Avatar
Senior Member - OP
Thanks Meter 4,115
Posts: 1,399
Join Date: Jun 2012
Location: Istanbul

 
DONATE TO ME
Quote:
Originally Posted by AyDee View Post
@pendroz
Is this the same for all carriers' firmwares?
Does only framework.jar need to be deodexed or the whole framework folder?
Do we compile all 3 files in required folder into classes.dex?
Sorry for all of the questions. Cheers & teşekkürler!
The same for all variants

Do we compile all 3 files in required folder into classes.dex?

- Yes ( only android.policy jar ) To edit the specified line

Device History

Galaxy S2 Galaxy S3

LG G2 ( D802 )

Project

S2 ( Turkbey Rom Team ) S3 ( Pardus HD RoM™ )

LG G2 Pardus HD RoM™
The Following 3 Users Say Thank You to pendroz For This Useful Post: [ Click to Expand ]
 
AyDee
Old
(Last edited by AyDee; 25th March 2014 at 10:36 PM.)
#8  
AyDee's Avatar
Senior Member
Thanks Meter 882
Posts: 1,256
Join Date: Sep 2010
Location: Mobile

 
DONATE TO ME
Thanks!
(Yes I meant to say android.policy.jar, not framework.jar )

Edit: On CloudyStock 1.2 I found that the lines you need to change in part 1 are a little different-
from:
Code:
    .line 330
    iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;

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

    const v2, 0x202029b

    const v3, 0x20d0011

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

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
to:
Code:
    .line 330
    iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;

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

    const v2, 0x202029b

    const v3, 0x20d0011

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

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
 
AyDee
Old
(Last edited by AyDee; 25th March 2014 at 11:03 PM.)
#9  
AyDee's Avatar
Senior Member
Thanks Meter 882
Posts: 1,256
Join Date: Sep 2010
Location: Mobile

 
DONATE TO ME
Sorry to double post but when I go to compile classes.dex I get this:

Code:
C:\...\G2\jar file decompile and compiler>java -Xmx512M -jar smal
i.jar classout -o classes.dex
classout\com\android\internal\policy\impl\GlobalActions$99$1.smali[41,4] Error f
or input '.param': Invalid directive
classout\com\android\internal\policy\impl\GlobalActions$99$1.smali[42,4] Error f
or input '.param': Invalid directive
classout\com\android\internal\policy\impl\GlobalActions$99$1.smali[41,11] mismat
ched input 'p1' expecting END_METHOD_DIRECTIVE
classout\com\android\internal\policy\impl\GlobalActions$99.smali[0,0] 17039360 c
annot fit into a short
classout\com\android\internal\policy\impl\GlobalActions$99.smali[80,4] mismatche
d tree node: I_STATEMENT_FORMAT11n expecting I_CATCHES
classout\com\android\internal\policy\impl\GlobalActions$99.smali[84,4] mismatche
d tree node: I_STATEMENT_FORMAT11x expecting I_FIELDS
(as I mentioned, I am trying this with the deodexed android.policy.jar from CloudyStock)
Am I doing something wrong?
 
pendroz
Old
#10  
pendroz's Avatar
Senior Member - OP
Thanks Meter 4,115
Posts: 1,399
Join Date: Jun 2012
Location: Istanbul

 
DONATE TO ME
Quote:
Originally Posted by AyDee View Post
Sorry to double post but when I go to compile the jar I get this:

Code:
C:\...\G2\jar file decompile and compiler>java -Xmx512M -jar smal
i.jar classout -o classes.dex
classout\com\android\internal\policy\impl\GlobalActions$99$1.smali[41,4] Error f
or input '.param': Invalid directive
classout\com\android\internal\policy\impl\GlobalActions$99$1.smali[42,4] Error f
or input '.param': Invalid directive
classout\com\android\internal\policy\impl\GlobalActions$99$1.smali[41,11] mismat
ched input 'p1' expecting END_METHOD_DIRECTIVE
classout\com\android\internal\policy\impl\GlobalActions$99.smali[0,0] 17039360 c
annot fit into a short
classout\com\android\internal\policy\impl\GlobalActions$99.smali[80,4] mismatche
d tree node: I_STATEMENT_FORMAT11n expecting I_CATCHES
classout\com\android\internal\policy\impl\GlobalActions$99.smali[84,4] mismatche
d tree node: I_STATEMENT_FORMAT11x expecting I_FIELDS
Am I doing something wrong?
Which version use baksmali/smali tool ?

Device History

Galaxy S2 Galaxy S3

LG G2 ( D802 )

Project

S2 ( Turkbey Rom Team ) S3 ( Pardus HD RoM™ )

LG G2 Pardus HD RoM™

The Following 2 Users Say Thank You to pendroz For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes