[XPERIA X10 Android Development] DooMLoRD:
[Universal] for ALL ROMs with xRecovery installed through Flashtool beta v0.2.9

[*] THIS IS EXPERIMENTAL [*]

I have tested this on:

2.3 CM7RC2-v010a

2.2 FreeX10-beta4

2.1 SE Stock FW 2.1.0.435

CM7RC2 v008 to v010a should be able to use the attached file

PLEASE DO NOT USE IT ON ANY OTHER VERSIONS OF THE CM7RC2 ROM

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.

we almost have a universal chargemon file... already discussed it with Androxyde...

Even if u already have recovery installed, for using this universal script, u need to install xRecovery again through Flashtool beta v0.2.9 which will give u the FreeXperia recovery and move the recovery files to /system/recovery/

if u are on 2.3 ROM (CM7RC2) i advise u to keep the update.zip provided here on the sdcard before u install recovery thru ft v0.2.9 cause there is a small bug with it which will not allow u to boot into OS (u will be stuck at SE text logo), but u can get into recovery after which flash the attached update.zip and ur CM7RC2 booting will be fixed

use the attached file ONLY if the existing

chargemon

file in /system/bin/ is as follows:

#!/system/recovery/sh

/system/bin/charger

DEVICE=`cat /system/recovery/model`

case $DEVICE in
X10*)
cat /dev/input/event2 > /dev/keycheck& ;;
E10*)
cat /dev/input/event1 > /dev/keycheck& ;;
U20*)
cat /dev/input/event0 > /dev/keycheck& ;;
E15*)
cat /dev/input/event1 > /dev/keycheck& ;;
esac

sleep 3
kill -9 $!

if [ -s /dev/keycheck -o -f /data/local/tmp/flashtool ]
then
rm -r /data/local/tmp/flashtool
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /cache
umount -l /data
# Mount recovery partition
rm -r /sbin
rm -r /etc
(cd /;tar -xjf /system/recovery/recovery.tar.bz2)
# Umount /system
umount -l /system
# chroot
chroot / /init
else
if test -f /system/bin/ramdisk.tar
then
# 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
/system/bin/chroot / /init
fi
fi

# Continue booting
exit

the attached file is an update.zip flashable thru xrec

also this contains the modded chargemon file based on xRecovery installed through Flashtool beta v0.2.9 for all roms (stock/custom)...

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 have any problems please put up a post here