Jump to content


Photo

[GUIDE \ MOD] Extended Power Menu [Reboot & Recovery]


  • Please log in to reply
11 replies to this topic

#1
tillaz

tillaz

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 5,850 posts
  • Gender:Male
  • Location:R* North
  • Interests:ET Life
  • Devices:Nexus 4

THIS GUIDE IS ONLY FOR STOCK BASED ICS ROMS ON THE G300

(i will provide a flashable.zip for people who don't want to try them self)



PLEASE DO NOT PM ME WITH YOUR PROBLEMS, POST IN THE THREAD WITH YOUR MODIFIED FILES ATTACHED



things you will need from your ROM

framework.jar
framework-res.apk
android.policy.jar


Tools you will need to work with (links provided)

notepad ++ > http://notepad-plus-...nload/v6.3.html
7zip > http://www.7-zip.org/download.html
jar decomplier / recomplier > http://ubuntuone.com...B9DlVRiSPtmmPtM (How To Use)
apk manager > http://ubuntuone.com...iGEQawtXvjzLq�� (How To Use)


FIRST:

adding resources to the framework-res.apk

start by decompling framework-res.apk with apk manager

navigate to
projects\framework-res.apk\res\values\public.xml

using notepad ++ search

<public type="string" name="contact_status_update_attribution" id="0x0104051d" />

below this add the following code

<public type="string" name="reboot_ics" id="0x0104051e" />
<public type="string" name="recovery_ics" id="0x0104051f" />


now search

<public type="drawable" name="stat_sys_upload_done_static" id="0x010805e6" />

below this add the following code

<public type="drawable" name="reboot" id="0x010805e7" />
<public type="drawable" name="recovery" id="0x010805e8" />

save and exit


navigate to
projects\framework-res.apk\res\values\strings.xml

add the following code below <resources>

<string name="reboot_ics">Reboot</string>
<string name="recovery_ics">Recovery</string>

save and exit


download the resorces from the link below and add the two .png images to
projects\framework-res.apk\res\drawable-hdpi
LINK :http://www.solidfile...m/d/43dbd2924d/

now recompile the framework-res.apk DO NOT SIGN IT!


SECOND:

shutdown thread

decompile framework.jar with "jar decompiler / compiler"

navigate to
classout\com\android\internal\app

delete the whole of huawei's shutdown thread, all files that start with > ShutdownThread
it should be the last eight files in the folder

now add my modified shutdown thread, copy all the files in the link below to the folder
classout\com\android\internal\app
LINK: http://www.solidfile...m/d/d0ae175b78/

now we are done with the framework, compile it and add the new classes.dex inside the framework.jar (use 7zip)

delete the classes folder as we are finished with that


THIRD:

global actions

decompile android.policy.jar with "jar decompiler / compiler"

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

open it with notepad ++

use the search function and search > .line 187

delete all code from and including .line 187 up to .line 212 (delete all code shown below)

.line 187
const-string v0, "true"

const-string v1, "ro.config.hw_quickpoweron"

invoke-static {v1}, Landroid/os/SystemProperties;->get(Ljava/lang/String;)Ljava/lang/String;

move-result-object v1

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

move-result v0

if-eqz v0, :cond_5f

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

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

const v4, 0x202000b

move-object v1, p0

move v2, v12

move v3, v12

move v5, v11

move v6, v11

invoke-direct/range {v0 .. v6}, Lcom/android/internal/policy/impl/GlobalActions$3;-><init>(Lcom/android/internal/policy/impl/GlobalActions;IIIII)V

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


now below .line 212 delete

:cond_5f


OK, that's huawei's stuff removed, now we can add my code


add the following code above .line 212

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

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

const v2, 0x10805e7

const v3, 0x104051e

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

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

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

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

const v2, 0x10805e8

const v3, 0x104051f

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

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


save and exit

add the two files in the link below to
classout\com\android\internal\policy\impl\
LINK: http://www.solidfile...m/d/cb277673ef/

now we are done with android.policy, compile it and add the new classes.dex inside the android.policy.jar (use 7zip)

delete the classes folder as we are finished with that


FOURTH:

check your build.prop for this line and change it to false

ro.config.hw_quickpoweron=true


done... add the new files to your ROM

framework.jar
framework-res.apk
android.policy.jar

  • 8

#2
tillaz

tillaz

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 5,850 posts
  • Gender:Male
  • Location:R* North
  • Interests:ET Life
  • Devices:Nexus 4
bare with me, i need to check this over ;)

EDIT: corrected a few things, looks good to go now...

  • 1

#3
Cyda

Cyda

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 1,448 posts
  • Gender:Male
  • Location:Wales
  • Devices:Nexus 4 & 7 running PAC
Big thanks for this, tillaz. I've never looked at adding extended power menu options before so some of this was new to me but that guide was very easy to understand and follow. I now have a power menu recovery option in the dev build of Stock+. Job well done. :)

Edited by Cyda, 01 March 2013 - 02:27 PM.

  • 0

#4
cicki

cicki

    Newbie

  • Members
  • Pip
  • 12 posts
  • Gender:Male
many thanks for share this mod, explains very understandable, has worked at first attempt, again thank you

  • 0

#5
kyan31

kyan31

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 3,868 posts
  • Gender:Male
Thanks, I'm gonna try this in an hour or so :)

  • 0

e2199c4dbb.png823c51b6b0.pngc3f6e04cdb.pngbc36a18046.pngead60d1912.pnge46a22ae54.png

 

Phones: Samsung Galaxy S4 Qualcomm & Huawei Ascend G300

PC: AMD FX 8350 8 CORE 4.2Ghz CPU, 16GB 1600Mhz Kingston HyperX RAM, Gigabyte R9 270X Winforce Edition GPU

Like my work? Hit that +1 button as a thank you! Want to support me? You could consider donating!  :)

Subscribe to my YT Channel: https://www.youtube.com/user/thekyan31


#6
luvvt

luvvt

    Enthusiast

  • Members
  • PipPipPip
  • 180 posts
  • Devices:G300
Your like the energizer battery that keeps on giving.

Cheers and much appreciated ;)

  • 0

#7
kyan31

kyan31

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 3,868 posts
  • Gender:Male
I'm getting 'nginx bad gateway' when trying to download the modified shutdown files. Got a mirror?

  • 0

e2199c4dbb.png823c51b6b0.pngc3f6e04cdb.pngbc36a18046.pngead60d1912.pnge46a22ae54.png

 

Phones: Samsung Galaxy S4 Qualcomm & Huawei Ascend G300

PC: AMD FX 8350 8 CORE 4.2Ghz CPU, 16GB 1600Mhz Kingston HyperX RAM, Gigabyte R9 270X Winforce Edition GPU

Like my work? Hit that +1 button as a thank you! Want to support me? You could consider donating!  :)

Subscribe to my YT Channel: https://www.youtube.com/user/thekyan31


#8
Cyda

Cyda

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 1,448 posts
  • Gender:Male
  • Location:Wales
  • Devices:Nexus 4 & 7 running PAC

I'm getting 'nginx bad gateway' when trying to download the modified shutdown files. Got a mirror?


Here you go mate: http://ubuntuone.com...AJSxGJm5MM6gELB

  • 1

#9
kyan31

kyan31

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 3,868 posts
  • Gender:Male

Here you go mate: http://ubuntuone.com...AJSxGJm5MM6gELB


Ah, thanks Cyda :)

  • 0

e2199c4dbb.png823c51b6b0.pngc3f6e04cdb.pngbc36a18046.pngead60d1912.pnge46a22ae54.png

 

Phones: Samsung Galaxy S4 Qualcomm & Huawei Ascend G300

PC: AMD FX 8350 8 CORE 4.2Ghz CPU, 16GB 1600Mhz Kingston HyperX RAM, Gigabyte R9 270X Winforce Edition GPU

Like my work? Hit that +1 button as a thank you! Want to support me? You could consider donating!  :)

Subscribe to my YT Channel: https://www.youtube.com/user/thekyan31


#10
kyan31

kyan31

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 3,868 posts
  • Gender:Male
Ok, solidfiles is down for now and it's getting late, so I will continue tomorrow. It's actually a lot easier than I thought.

  • 0

e2199c4dbb.png823c51b6b0.pngc3f6e04cdb.pngbc36a18046.pngead60d1912.pnge46a22ae54.png

 

Phones: Samsung Galaxy S4 Qualcomm & Huawei Ascend G300

PC: AMD FX 8350 8 CORE 4.2Ghz CPU, 16GB 1600Mhz Kingston HyperX RAM, Gigabyte R9 270X Winforce Edition GPU

Like my work? Hit that +1 button as a thank you! Want to support me? You could consider donating!  :)

Subscribe to my YT Channel: https://www.youtube.com/user/thekyan31


#11
kyan31

kyan31

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 3,868 posts
  • Gender:Male
Ok, now it's working :)

  • 0

e2199c4dbb.png823c51b6b0.pngc3f6e04cdb.pngbc36a18046.pngead60d1912.pnge46a22ae54.png

 

Phones: Samsung Galaxy S4 Qualcomm & Huawei Ascend G300

PC: AMD FX 8350 8 CORE 4.2Ghz CPU, 16GB 1600Mhz Kingston HyperX RAM, Gigabyte R9 270X Winforce Edition GPU

Like my work? Hit that +1 button as a thank you! Want to support me? You could consider donating!  :)

Subscribe to my YT Channel: https://www.youtube.com/user/thekyan31


#12
kyan31

kyan31

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 3,868 posts
  • Gender:Male
Yay, it worked perfectly! I also added custom settings, :)

Attached File  Screenshot_2013-03-03-01-20-21.png   67.91KB   67 downloadsAttached File  Screenshot_2013-03-03-01-20-29.png   47.06KB   66 downloadsAttached File  Screenshot_2013-03-03-01-20-36.png   64.13KB   62 downloads

Thanks SO much Tillaz, your awesome dude ;) Now lightning ROM has a new boost of energy

Edited by kyan31, 03 March 2013 - 01:25 AM.

  • 0

e2199c4dbb.png823c51b6b0.pngc3f6e04cdb.pngbc36a18046.pngead60d1912.pnge46a22ae54.png

 

Phones: Samsung Galaxy S4 Qualcomm & Huawei Ascend G300

PC: AMD FX 8350 8 CORE 4.2Ghz CPU, 16GB 1600Mhz Kingston HyperX RAM, Gigabyte R9 270X Winforce Edition GPU

Like my work? Hit that +1 button as a thank you! Want to support me? You could consider donating!  :)

Subscribe to my YT Channel: https://www.youtube.com/user/thekyan31


#13
Rashid6156

Rashid6156

    Newbie

  • Members
  • Pip
  • 5 posts
  • Devices:huawei ascend g300
tillaz i love your work....will try this Mod in the morning......i hope it will work on Bruno's SGS3 Rom based on B952.

I don't have paypal, cant get one in Pakistan.....is there any other way to donate....? may be by buying your stuff on Google play

  • 0

#14
Rashid6156

Rashid6156

    Newbie

  • Members
  • Pip
  • 5 posts
  • Devices:huawei ascend g300
i have tried my best...but recompiling of framework-res.apk was killing me....its public.xml that was giving error :-(

i almost gave up when i saw kyan's mod....i got the desired framework files and they did the job....thanks a lot tillaz and kyan :-)

Posted Image

Edited by Rashid6156, 04 March 2013 - 06:44 PM.

  • 0

#15
relvas18

relvas18

    Newbie

  • Members
  • Pip
  • 45 posts
  • Devices:Huawei Ascend G300
I tried but always gave error to compile the apk, cam you please provide me the flashable.zip ?

thanks

  • 0

#16
tillaz

tillaz

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 5,850 posts
  • Gender:Male
  • Location:R* North
  • Interests:ET Life
  • Devices:Nexus 4

I tried but always gave error to compile the apk, cam you please provide me the flashable.zip ?

thanks


send me your log.txt from apk manager

  • 0

#17
relvas18

relvas18

    Newbie

  • Members
  • Pip
  • 45 posts
  • Devices:Huawei Ascend G300
It won't be necessary I already knew what I did wrong, was using the wrong files but thanks anyway

  • 0

#18
BMN1

BMN1

    Newbie

  • Members
  • Pip
  • 5 posts
Hi, great guide, written well. I tried to modify the power menu of my ascend y300 with a stock ROM but I can't find files at the second step

"delete the whole of huawei's shutdown thread, all files that start with > ShutdownThread"

. Is it possible to have an updated guide for ascend y300 or you can send me the files to add? Thank you very much.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users