[REL: 02/08][APP] xCharge Reboot Options {NO LONGER SUPPORTED}

Status
Not open for further replies.
Search This thread

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
Hey guys I was able to get a script (now an APP) together to reboot into recovery (xRecovery / FreeXperia Recovery) from within the OS.


firstly i would like to thank Bin4ry & Androxyde for the FlashTool and the option to "reboot into xrecovery from flashtool" as this mod/script is based on that..
and tremendouz and wiedz for inspiration...

DO NOT TRY THIS IF U USE DATA2SD... THIS CANNOT WORK, FOR NOW, ALONG WITH DATA2SD...



new features include:
  1. cleaner layout
  2. new UI
  3. working themes!
  4. and u will be entitled to future upgrades :D


Screenshots:


On X10:

xcharge14x10.png



On Xperia 2011 / Other Androids:

xcharge14sgs2.png



if u like the app please buy the paid app to support our work :)

P.S.: Older versions are available in 2nd post and will be kept for XDA users... :)


FOR OLDER VERSIONS (which will be kept FREE) please refer to this thread:
http://xdaforums.com/showthread.php?t=1085896





<OLD FILES | For Reference ONLY>
 
Last edited:

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
Only for reference

<OLD FILES>

FOLLOWING INFORMATION IS KEPT ONLY FOR REFERENCE
NO NEED TO USE ANY OF THE FOLLOWING UPDATE.ZIPS








[*] UPDATE: links to a few update.zip files which can be flashed via recovery are below. [*]


(UNIVERSAL FOR ALL XPERIA ANROIDS, ANY RECOVERY)
[ADDED]: Universal flashable update.zip for ALL ROMs / ALL Xperia Android devices with ANY Recovery


(THESE ARE FOR X10 ONLY)
[ADDED]: Flashable update.zip for 2.1 ROMs based on SE stock FW with xRecovery 0.3-release
[ADDED]: Flashable update.zip for 2.1 ROMs based on SE stock FW with xRecovery installed through Flashtool v0.2.8
[ADDED]: Flashable update.zip for 2.2 ROMs based on FreeX10-beta4
[ADDED]: Flashable update.zip for 2.3 ROMs based on CM7RC2 v008 to v010a
[ADDED]: Universal flashable update.zip for ALL ROMs with xRecovery installed through Flashtool beta v0.2.9


[USER TESTS]:
Mortyx10 has reported that the flashable update.zip for 2.2 ROMs based on FreeX10-beta4 works on Wolf CM6 V4.4
Xperia84 has reported that the flashable update.zip for 2.2 ROMs based on FreeX10-beta4 works on Wolf CM6.1.3 V4.5.7


PLEASE MAKE A FULL XRECOVERY/NANDROID BACKUP BEFORE TRYING ANY SYSTEM MODIFICATIONS LIKE THIS



[AUTOMATED WAY] (Difficulty: Medium)


Flashable update.zips

(UNIVERSAL FOR ALL XPERIA ANROIDS, ANY RECOVERY)

Universal flashable update.zip for ALL ROMs / ALL Xperia Android devices with ANY Recovery



<OLD FILES>
(ONLY FOR X10)

Flashable update.zip for 2.1 ROMs based on SE stock FW with xRecovery 0.3-release
Flashable update.zip for 2.1 ROMs based on SE stock FW with xRecovery installed through Flashtool v0.2.8
Flashable update.zip for 2.2 ROMs based on FreeX10-beta4 [Thank you JimmyX10 for helping out with testing this]
Flashable update.zip for 2.3 ROMs ROMs based on CM7RC2 v008 to v010a [Thank you bazji, tremendouz, depulle87, lzyllp for helping out with testing this]
Universal flashable update.zip for ALL ROMs with xRecovery installed through Flashtool beta v0.2.9






[OLD INFO] | [USE ONLY IF THE AUTOMATED WAY DOESNT WORK] (Difficulty: Hard)



Additionally please make certain that u can use flashtool to flash a stock FW incase u run into any problems and that the device is fairly charged >50% battery before trying this.

*** I have tested it to be working on:
2.3 (CM7RC2-v010 & CM7RC2-v010a)
2.2 (freex10-beta4)
2.1 (FW 2.1.0.435) [should also work with other 2.1 FW]
***


* warning *
this requires some advanced knowledge on how to modify system files, all step required are mentioned here, though if u are uncomfortable with it i will be attaching some pre-modified file for vanilla roms, which should work with most custom roms. in case they dont work u can just upload the 'chargemon' file located in /system/bin/ here and i will repost it the necessary modifications.



[MANUAL WAY]


[step 1] Modify boot hijack file 'chargemon'
(not required if u are on 2.1 stock se rom and have used Flashtool 0.2.8 to install xrecovery, in which case these modifications will already be in place)
- this file is located in /system/bin/
- make a backup of this file, on the sdcard, before editing
- i would recommend using Root Explorer to navigate to this file, mount the partition as r/w (click "Mount R/W" in upper right hand corner)
- long press on the 'chargemon' file this will bring up a menu and select "Open in Text Editor"
- find the following lines of text
Code:
	if [ -s /dev/keycheck ]
	then

- and modify it to the following
Code:
	if [ -s /dev/keycheck -o -f /data/local/tmp/flashtool ]
	then

	  # remove 'reboot into xrec' file
	  rm -f /data/local/tmp/flashtool

*** ONLY for those who have offline charging enabled in their roms (if u are uncertain about this just check if there is a file named 'charger' in /system/bin/ , most custom roms will have this feature) i have done some additional thing here, i have moved the placement of the command for the offline-charger file 'charger' to the beginning of this script so that even if anyone get stuck up at boot atleast they will be able to charge the device without getting into the OS. also please check for any other occurrence of the command '/system/bin/charger' anywhere else in the file, if there is another then just put a # in front of it like '# /system/bin/charger' ***
*** if u dont have the /system/bin/charger file then dont bother with the following code ***
Code:
       /system/bin/charger

	if [ -s /dev/keycheck -o -f /data/local/tmp/flashtool ]
	then

	  # remove 'reboot into xrec' file
	  rm -f /data/local/tmp/flashtool

- once u finish editing click on menu button and "Save & Exit"

- now u need to check the permissions of the 'chargemon' file. if u using Root Explorer navigate to '/system/bin/' then "mount r/w" and long press on 'chargemon' file and select 'Permissions'... make sure the permissions are as follows:

screenshot48ws.png


- after this i would suggest u restart the device to check if u are able to access xreovery the normal way (repeatedly pressing/tapping 'back' key when u see SE text logo) and if the device boot up into the OS without any issue
- incase everything goes well make a backup of this modified 'chargemon' file too, in case u have any problems put up a post here
* i will also be attaching some pre-modified generic files for vanilla roms, which should work with most custom roms. *



[step 2] the actual Reboot into xRecovery script
- u need to install the following app GScript Lite, our fellow XDA member rogro82 has posted this tool here
- after installing, launch the app, click on menu button, "Add Script"..
- fill up the text boxes as follows:

screenshot44mp.png


- u need to enter some name in the smaller textbox and the following into the large textbox:
Code:
touch /data/local/tmp/flashtool
reboot

* some custom roms are not permitting reboot command if SU rights are not there... u need to make sure that the option "Need SU?" is checked (ticked) else the device wont be able to reboot from the script... *

- now save the script
- u can create a shortcut on the homescreen to GScipt Lite and select the reboot into xrecovery script

screenshot46s.png


- if u try running the script a popup for SU permissions might come up, this will only come the first time its run, select "Allow" and then ur device will reboot into xrecovery...
- thats it! now whenever u want to reboot into xrecovery just launch the shortcut!!!


also if anyone could integrate this into the Reboot options in Power menu it would be great for everyone!!!

may be modders/themers can add this into their reboot options of power menu in their themes...





for specific threads of other Xperia android devices go HERE
 
Last edited:

The Gingerbread Man

Senior Member
Sep 4, 2010
8,096
3,948
Gloucester
Great idea! This would be even better if you could make it into some kind of apk to be able to do the nessesary changes?


Edit

I misunderstood. So for now reboot to recovery through power menu is still not possible? It would be great if it would be possible to make reboot to recovery possible through an apk or a newer modified recovery menu.

Sent from my X10 using XDA Premium App
 
Last edited:
  • Like
Reactions: Patricks_book

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
I can't into the xrecovery and still into system when i run it(J's CM7)

hmm i have tested it with freex10-beta4... hmm ok... which version of CM7 rom r u using?
i am flashing CM7RC2 v010 right now for testing it...


in any case upload ur 'chargemon' file from /system/bin/ here... i will do the necessary changes...
 
Last edited:
  • Like
Reactions: Patricks_book

lzyllp

Senior Member
Dec 30, 2010
601
236
fuzhou
hmm i have tested it with freex10-beta4... hmm ok... which version of CM7 rom r u using?
i am flashing CM7RC2 v010 right now for testing it...

but as far as i can tell it should work on all roms...

in any case upload ur 'chargemon' file from /system/bin/ here... i will do the necessary changes...

010 i use.I think the xrecovery have some change in CM7.
 

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
xrecovery is in /data/tmp on all roms

freex10 recovery (cm7) is in /system/recovery

actually its in /system/bin/ for most roms.. in cm7 its in /system/recovery/ and if u use flashtool 0.2.8 to install xrecovery (on 2.1 roms) its in /system/recovtools/

but the thing is we are not touching xrec at the moment... i have jsut suggested changes to chargemon file, which will later execute commands to extract xrecovery, so only the 'if' condition is changed and one delete (rm) command added...
 

lzyllp

Senior Member
Dec 30, 2010
601
236
fuzhou
actually its in /system/bin/ for most roms.. in cm7 its in /system/recovery/ and if u use flashtool 0.2.8 to install xrecovery (on 2.1 roms) its in /system/recovtools/

but the thing is we are not touching xrec at the moment... i have jsut suggested changes to chargemon file, which will later execute commands to extract xrecovery, so only the 'if' condition is changed and one delete (rm) command added...

you can make it work with CM7?
 

The Gingerbread Man

Senior Member
Sep 4, 2010
8,096
3,948
Gloucester
Would this be easier if you could make a flashable zip of your modded chargemon and have download links for separete versions like 2.1, 2.2 and 2.3?

Sent from my X10 using XDA Premium App
 

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
in CM7RC2 v010... the device seems to get stuck up at the SE text logo...

please do not install this on 2.3 roms... till the problems get rectified...

my sincere apologies... :(
 

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
Would this be easier if you could make a flashable zip of your modded chargemon and have download links for separete versions like 2.1, 2.2 and 2.3?

Sent from my X10 using XDA Premium App

yes steve i am plannin on doing that... right now tested it myself on 2.2 rom... now testing on 2.3 and 2.1...

will put up the update.zip files in a few hrs...
 
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 45
    Hey guys I was able to get a script (now an APP) together to reboot into recovery (xRecovery / FreeXperia Recovery) from within the OS.


    firstly i would like to thank Bin4ry & Androxyde for the FlashTool and the option to "reboot into xrecovery from flashtool" as this mod/script is based on that..
    and tremendouz and wiedz for inspiration...

    DO NOT TRY THIS IF U USE DATA2SD... THIS CANNOT WORK, FOR NOW, ALONG WITH DATA2SD...



    new features include:
    1. cleaner layout
    2. new UI
    3. working themes!
    4. and u will be entitled to future upgrades :D


    Screenshots:


    On X10:

    xcharge14x10.png



    On Xperia 2011 / Other Androids:

    xcharge14sgs2.png



    if u like the app please buy the paid app to support our work :)

    P.S.: Older versions are available in 2nd post and will be kept for XDA users... :)


    FOR OLDER VERSIONS (which will be kept FREE) please refer to this thread:
    http://xdaforums.com/showthread.php?t=1085896





    <OLD FILES | For Reference ONLY>
    14
    [Universal] for ALL ROMs / ALL Xperia Android devices with any Recovery

    [*] THIS IS EXPERIMENTAL [*]

    This should work on ALL ROMs and ALL Xperia Android devices (X10, X8, X10 Mini, X10 Mini Pro) and ANY RECOVERY (xRecovery / FreeXperia)


    PLEASE MAKE A FULL XRECOVERY/NANDROID BACKUP BEFORE TRYING ANY SYSTEM MODIFICATIONS LIKE THIS

    Additionally please make certain that u can use flashtool to flash a stock FW incase u run into any problems and that the device is fairly charged >50% battery before trying this.



    the attached file is an update.zip flashable thru xRecovery/Recovery

    this contains GScript Lite, and it gets installed as a system app... so if u
    already have it installed, i recommend u uninstall it before flashing this...

    it contains 3 scripts:
    • add-on_installer.sh
    • add-on_uninstaller.sh
    • reboot_recovery.sh

    they will be put on the /sdcard/gscript/ folder automatically so that gscript lite can immediately find it...



    Installation Steps:

    [1] flash update.zip thru xRecovery/Recovery

    [2] to install add-on: just launch the app and click on "Load File" and select add-on_installer.sh all the contents will load automatically... u need to make sure that the option "Need SU?" is checked (ticked)... now save and run this script ONLY ONCE... there might be a popup for SU permissions, select "Allow"... u will see the outputs of each step in the installation process...

    [3] to use the reboot option/script: just launch the app and click on "Load File" and select reboot_recovery.sh all the contents will load automatically... u need to make sure that the option "Need SU?" is checked (ticked)... now save... u can now create a shortcut on the homescreen to GScipt Lite and select the reboot_recovery script... if u try running the script a popup for SU permissions might come up, this will only come the first time its run, select "Allow" and then ur device will reboot into recovery...


    thats it! now whenever u want to reboot into recovery just launch the shortcut!!!


    To Uninstall Add-on:
    just launch the app and click on "Load File" and select add-on_uninstaller.sh all the contents will load automatically... u need to make sure that the option "Need SU?" is checked (ticked)... now save and run this script ONLY ONCE... there might be a popup for SU permissions, select "Allow"... u will see the outputs of each step in the installation process...


    if u have any problems please put up a post here


    What this script does? [for the enthusiastic types ;) ]
    1. It remounts system & data partition for modification
    2. It backs up the current chargemon file to /system/bin/chargemon.ori
    3. Works on a temporary copy of chargemon file @ /data/local/tmp/chargemon.tmp
    4. Then it inserts the modifications into the /data/local/tmp/chargemon.tmp file for checking reboot file and some more modifications
    5. Once all modifications are done it copies the /data/local/tmp/chargemon.tmp file back to /system/bin/chargemon
    6. The backup chargemon file is stored @ /system/bin/chargemon.ori for the uninstaller script
    7. The uninstaller script deletes /system/bin/chargemon file and renames /system/bin/chargemon.ori to /system/bin/chargemon


    [APP | WIDGET] >>> xCharge - SE Reboot Options for Xperia <<<



    use the latest file v3: reboot_into_rec_univ_xperia_v3.zip
    3
    [2.2] ROMs based on FreeX10-beta4

    PLEASE MAKE A FULL XRECOVERY/NANDROID BACKUP BEFORE TRYING ANY SYSTEM MODIFICATIONS LIKE THIS

    Additionally please make certain that u can use flashtool to flash a stock FW incase u run into any problems and that the device is fairly charged >50% battery before trying this.


    use the attached file ONLY if the existing chargemon file in /system/bin/ is as follows:

    Code:
    #!/system/bin/busybox sh
    
    	cat /dev/input/event2 > /dev/keycheck&
    	sleep 3
    	kill -9 $!
    	if [ -s /dev/keycheck ]
    	then
    
    	# remount rootfs rw
    	mount -o remount,rw rootfs /
    
    	# Umount MTDs
    	umount -l /data
    	umount -l /cache
    
    	# Extract recovery
    	cd /
    	rm -r /sbin
    	rm -f etc
    	tar -xf /system/bin/xrecovery.tar
    
    	# Umount system
    	umount -l /system
    
    	chroot / /init
    
    	fi
    
    	/system/bin/charger
    
    	# remount rw
    	mount -o remount,rw rootfs /
    
    	cd /
    	rm -r /sdcard
    	rm init*
    	rm logo.rle
    	rm default.prop
    	tar -xf /system/bin/ramdisk.tar
    
    	# zdzihu: hack-fix
    	if [ -e /data/data/com.android.providers.telephony/databases/telephony.db ]; then
    	/system/bin/chroot / /init
    	exit
    	fi
    
    	chroot / /init

    [Thank you JimmyX10 for helping out with testing this]

    the attached file is an update.zip flashable thru xrec

    also this contains the modded chargemon file based on freex10-beta4... i yet have to incorporate the suggestions by Androxyde

    this contains GScript Lite, and it gets installed as a system app... so if u already have it installed, i recommend u uninstall it before flashing this...

    also this file contains the required reboot_xrecovery.sh script... it will be put on the /sdcard/gscript/ folder automatically so that gscript lite can immediately find it... once u reboot back into system after flashing just launch the app and click on "Load File" and select reboot_xrecovery.sh all the contents will load automatically...

    * some custom roms are not permitting reboot command if SU rights are not there... u need to make sure that the option "Need SU?" is checked (ticked) else the device wont be able to reboot from the script... *

    u can now create a shortcut on the homescreen to GScipt Lite and select the reboot into xrecovery script.

    if u try running the script a popup for SU permissions might come up, this will only come the first time its run, select "Allow" and then ur device will reboot into xrecovery...

    thats it! now whenever u want to reboot into xrecovery just launch the shortcut!!!

    if u are using a different 2.2 rom and/or the chargemon file is different than the one shown here please post it here along with the details of the rom u using and i will try n put up a compatible version for u..
    3
    And the app is released to market!!!

    we are finally ready with a new version and its directly released to market!!!

    get it here:

    xCharge Reboot Options [a.k.a. Xperia Reboot Options]


    xchargemarket.qrcode



    its a paid app for 2$

    new features include:
    1. cleaner layout
    2. new UI
    3. working themes!
    4. and u will be entitled to future upgrades :D


    Screenshots:


    On X10:

    xcharge14x10.png



    On Xperia 2011 / Other Androids:

    xcharge14sgs2.png



    if u like the app please buy the paid app to support our work :)


    P.S.: the older versions v1.3.0 & below will NOT be removed! they will still be kept available for XDA users for free :)
    2
    sweet, any idea if its going to be able to be completely universal or need radio buttons or something to choose various scenarios ? something a little like in the attached pic.

    should be a sweet/handy app when its ready.

    I'm looking forward to it :)

    ya we are trying to make it universal (for all Xperia, android devices which use the boothijack file /system/bin/chargemon)

    right now we are calling it "SE Xperia Reboot Options" (may change)

    as for various scenarios we have the following options:
    • Device
    • Recovery
    • Custom BootKit
    the the button can be "Reboot"/"Go"

    it will have both an app drawer application as well as a widget...

    we are also thinking of adding an option to install/uninstall the chargemon add-on (i.e. the app will itself modify the chargemon file, so the user need not use any other update.zips)