So I have to reboot the whole OS to play games or stuck in 4.1? PLEASE make this work my admired developers / hackers.
Ok. I've use this script since a month ago and have use it to run nfs mount and directory binding successfully in 4.2.2 stock rom. I found it on the net and only remove a few line from it. All credit goes to the original author.
Requirement:
1. Root
2. Busybox install in /system/xbin
3. Stickmount
4. $cripter (search in Play Store) - this is use to run the script or you can run it manually in terminal without this app.
This is example script to bind FIFA12. All files needed for this game is in external sdcard under FIFA12 directory.
The one that did the job is the last line, so ONLY modify that line to suit your need (the one that start with "adb_send_cmd")
Step:
1. Mount your external media using stickmount
2. Copy all file from game folder to external media
3. Save the script somewhere in internal storage
4. Open $cripter and go to setting to set your script directory
5. After the script appears in $cripter, long press and select edit. Tick run as root and save.
6. Run the said script from $cripter.
Caveat:
If output from $cripter says something about device offline, just try again. That mean adb is not ready yet and nothing got mounted. Also just ignore the file not found line in the $cripter output. That got something to do with multiuser, the script did run. Sometimes stickmount mount the external media to somewhere different than sda1, so check that too.
Edit: if you get too many device offline error, try to set the sleep time longer in the script. Find the line start with sleep and change 2 to 5.
#!/system/bin/sh
adb_status=`getprop init.svc.adbd`
adb_port=`getprop service.adb.tcp.port`
if [ -z "$adb_port" ]; then
adb_port=-1
fi
adb_use_port=$adb_port
adb_connected=0
adb_sysroot=`getprop persist.sys.root_access`
if [ -z "$adb_sysroot" ]; then
$adb_sysroot=''
fi
adb_use_root=$adb_sysroot
adb_rsa_keyed=0
adb_key_at_connect=0
trap "adb_reset" EXIT
adb_send_cmd() {
adb_start_flex
adb -s localhost:"$adb_use_port" shell su -c "$*"
}
adb_start_flex() {
local adb_restart=0
if [ "$adb_use_root" != "3" ]; then
setprop persist.sys.root_access "3"
adb_use_root=3
fi
if ! [ "$adb_use_port" -gt 0 ]; then
adb_use_port=5556
setprop service.adb.tcp.port "$adb_use_port"
adb_restart=1
fi
if [ "$adb_connected" -eq 0 ]; then
if ! [ -f "$ANDROID_DATA/.android/adbkey.pub" ]; then
adb kill-server
HOME="$ANDROID_DATA" adb start-server
fi
grep -Fxq "$(cat $ANDROID_DATA/.android/adbkey.pub)" "$ANDROID_DATA/misc/adb/adb_keys"
if [ "$?" -ne 0 ]; then
cat $ANDROID_DATA/.android/adbkey.pub >> $ANDROID_DATA/misc/adb/adb_keys
adb_rsa_keyed=1
adb_restart=1
fi
if [ "$adb_restart" -eq 1 ]; then
adb kill-server
stop adbd
start adbd
sleep 2
fi
HOME="$ANDROID_DATA" adb connect localhost:$adb_use_port
adb_connected=1
fi
}
adb_reset() {
local adb_restart=0
if [ "$adb_connected" -ne 0 ]; then
adb disconnect localhost:$adb_use_port
adb_connected=0
if [ "$adb_rsa_keyed" -ne 0 ]; then
sed -i "\|$(cat $ANDROID_DATA/.android/adbkey.pub)|d" $ANDROID_DATA/misc/adb/adb_keys
adb_restart=1
fi
if [ "$adb_port" -le 0 ]; then
setprop service.adb.tcp.port "$adb_port"
adb_restart=1
fi
if [ "$adb_restart" -eq 1 ]; then
stop adbd
start adbd
fi
fi
if [ "$adb_use_root" -ne "$adb_sys_root" ]; then
setprop persist.sys.root_access "$adb_sys_root"
fi
if [ "$adb_status" == "stopped" ]; then
adb kill-server
stop adbd
fi
}
adb_send_cmd "/system/xbin/busybox mount -o bind /data/media/0/usbStorage/sda1/FIFA12 /data/media/0/Android/data/com.ea.game.fifa12_row"
exit 0
Example mount:
1. NFS mount/umount
adb_send_cmd "/system/xbin/busybox mount -o nolock server_ipaddr:/path/to/server/nfsvolume /data/media/0/nfsmount
adb_send_cmd "/system/xbin/busybox umount /data/media/0/nfsmount"
2. Dungeon Hunter 4 mount/umount
adb_send_cmd "/system/xbin/busybox mount -o bind /data/media/0/usbStorage/sda1/DungeonHunter4 /data/media/obb/com.gameloft.android.ANMP.GloftD4HM"
adb_send_cmd "/system/xbin/busybox umount /data/media/obb/com.gameloft.android.ANMP.GloftD4HM"
3. Modern Combat: Zero Hour (2 mount point: data and obb in one script)
adb_send_cmd "/system/xbin/busybox mount -o bind /data/media/0/usbStorage/sda1/MC4/obb /data/media/obb/com.gameloft.android.ANMP.GloftM4HM"
adb_send_cmd "/system/xbin/busybox mount -o bind /data/media/0/usbStorage/sda1/MC4/data /data/media/0/Android/data/com.gameloft.android.ANMP.GloftM4HM/files"
Sent from my Nexus 7 using Tapatalk 2