#!/system/bin/b ash -x
i=0
rm /data/no_sd_upgrade
upgrade_check(){
sleep 6
if [ -e /mnt/sdcard/extsd/update.zip ] ; then
echo "---> recovery mode setting ---------------------------------------"
rm /cache/downloadfile*
sync
sync
if [ -e /mnt/sdcard/extsd/update_mark ] ; then
# mv /mnt/sdcard/extsd/update.zip /mnt/sdcard/extsd/update.zip_old
rm /mnt/sdcard/extsd/update.zip
rm /mnt/sdcard/extsd/update_mark
upgrade_check
# else
# mkdir /cache/recovery
# echo '--update_package=/sdcard/update.zip' > /cache/recovery/command
# am start -n com.ntx.msg/.MsgUpgradeActivity
# sync
# sync
# sleep 10
# sync
# sync
# reboot
fi
elif [ -e /mnt/sdcard/extsd/waveform.bin ]; then
echo "---> Programming waveform ----------------------------------------"
busybox dd if=/mnt/sdcard/extsd/waveform.bin of=/dev/mmcblk0 bs=512 seek=14336
sync
sync
mv /mnt/sdcard/extsd/waveform.bin /mnt/sdcard/extsd/waveform.bin_old
sync
sync
am start -n com.ntx.msg/.MsgWaveformActivity
sync
sync
# xiaobo begin of adb_open
# elif [ -e /mnt/sdcard/extsd/adb_open ]; then
# setprop persist.service.adb.enable 1
# sync
# sync
# elif [ -e /mnt/sdcard/extsd/adb_close ]; then
# setprop persist.service.adb.enable 0
# sync
# sync
# xiaobo end of adb open
elif [ -e /mnt/sdcard/extsd/recovery.img ] || [ -e /cache/upgrade/recovery.img ]; then
echo "---> Programming partition RECOVERY ----------------------------------"
busybox dd if=/mnt/sdcard/extsd/recovery.img of=/dev/block/mmcblk0p4 bs=8M
busybox dd if=/cache/upgrade/recovery.img of=/dev/block/mmcblk0p4 bs=8M
sync
sync
e2fsck -dy /dev/block/mmcblk0p4
sync
sync
mv /mnt/sdcard/extsd/recovery.img /mnt/sdcard/extsd/recovery.img_old
rm /cache/upgrade/recovery.img
sync
sync
am start -a android.intent.action.ACTION_REQUEST_SHUTDOWN
elif [ -e /mnt/sdcard/show_info ] || [ -e /mnt/sdcard/extsd/show_info ]; then
echo "---> Programming show info. ----------------------------------"
sync
sync
am start -n com.ntx.msg/.MsgShowInfoActivity
sync
sync
else
if [ "$i" -le 5 ]; then
i=$((i + 1))
upgrade_check
else
busybox touch /data/no_sd_upgrade
fi
fi
}
upgrade_check
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.