diff --git a/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater.pkg b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater.pkg new file mode 100644 index 0000000..a93f5a8 Binary files /dev/null and b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater.pkg differ diff --git a/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/animation.sh b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/animation.sh new file mode 100755 index 0000000..d6de63c --- /dev/null +++ b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/animation.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +epd_cmd() +{ + epd_fb_test $@ >/dev/null 2>&1 +} + +dispClear() +{ + epd_cmd gray DU PART 0 +} + +get_screen_resolution() +{ + head -1 /sys/class/graphics/fb0/modes | sed -e 's/^.*://' -e 's/p.*$//' -e 's/x/ /' +} + +get_screen_width() +{ + set `get_screen_resolution` + echo $1 +} + +get_screen_height() +{ + set `get_screen_resolution` + echo $2 +} + +LOG_FP=$1 + +dispClear + +while [ 1 ] +do + for file in `\find $(dirname ${0})/images -name '*.bmp' | sort`; do + epd_cmd file GC16 PART $file + echo "[anim] displaying $file" >> $LOG_FP + sleep 1 + done +done + +exit 0 diff --git a/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/bluetooth/Bluetooth.apk b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/bluetooth/Bluetooth.apk new file mode 100755 index 0000000..9c77d35 Binary files /dev/null and b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/bluetooth/Bluetooth.apk differ diff --git a/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/bluetooth/Bluetooth.odex b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/bluetooth/Bluetooth.odex new file mode 100755 index 0000000..135ec68 Binary files /dev/null and b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/bluetooth/Bluetooth.odex differ diff --git a/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/eufwupdater.sh b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/eufwupdater.sh new file mode 100755 index 0000000..b0e94f5 --- /dev/null +++ b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/eufwupdater.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +# initialization +UPDATER_BASE=$(dirname ${0}) +ANIM_PID=0 +EPOCH=$(date +%s) +LOG_FP=/root/updater_$EPOCH.log +echo "" > $LOG_FP + +# start animation script +${UPDATER_BASE}/animation.sh $LOG_FP & +ANIM_PID=$! +sleep 2 + +# enable bluetooth hid by replacing the stock bluetooth apk +echo "[updater.sh] run gethid.sh" >> $LOG_FP +${UPDATER_BASE}/gethid.sh $LOG_FP +if [ ! $? -eq 0 ] +then + # shutdown, remove update, error occurs + RET=$? +fi + +sleep 2 + +# stop animation +if [ $ANIM_PID -ne 0 ] +then + kill $ANIM_PID +fi + +# if returned 1, will shutdown +exit $RET diff --git a/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/images/status01.bmp b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/images/status01.bmp new file mode 100755 index 0000000..1353c8b Binary files /dev/null and b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/images/status01.bmp differ diff --git a/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/images/status02.bmp b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/images/status02.bmp new file mode 100755 index 0000000..2b97c2a Binary files /dev/null and b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/images/status02.bmp differ diff --git a/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/images/status03.bmp b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/images/status03.bmp new file mode 100755 index 0000000..3d49761 Binary files /dev/null and b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/images/status03.bmp differ diff --git a/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/images/status04.bmp b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/images/status04.bmp new file mode 100755 index 0000000..81ae252 Binary files /dev/null and b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/images/status04.bmp differ diff --git a/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/images/status05.bmp b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/images/status05.bmp new file mode 100755 index 0000000..052759d Binary files /dev/null and b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/images/status05.bmp differ diff --git a/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/images/status06.bmp b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/images/status06.bmp new file mode 100755 index 0000000..f335ccd Binary files /dev/null and b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/images/status06.bmp differ diff --git a/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/images/status07.bmp b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/images/status07.bmp new file mode 100755 index 0000000..17f2960 Binary files /dev/null and b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/images/status07.bmp differ diff --git a/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/recover.sh b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/recover.sh new file mode 100755 index 0000000..668ac5c --- /dev/null +++ b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/recover.sh @@ -0,0 +1,64 @@ +#!/bin/sh + +# initialization +UPDATER_BASE=$(dirname ${0}) +TAG="[gethid.sh]" +LOG_FP=$1 + +BLU_APK=${UPDATER_BASE}/bluetooth/Bluetooth.apk +BLUE_ODEX=${UPDATER_BASE}/bluetooth/Bluetooth.odex + +SYSTMP=${UPDATER_BASE}/systmp +SYSBLUAPP=${SYSTMP}/app/Bluetooth +BLK09="/dev/mmcblk0p9" + +# funcs +log_print() { + echo $TAG $1 >> $LOG_FP +} + +cp_perm() { + log_print "copy from $4 to $5 w. perm $1.$2 $3" + rm -f $5 + if [ -f "$4" ]; then + cat $4 > $5 + set_perm $1 $2 $3 $5 + fi +} + +set_perm() { + log_print "set perm $1.$2 $3 for $4" + chown $1.$2 $4 + chown $1:$2 $4 + chmod $3 $4 +} + +# check file existence +if ! [ -f $BLU_APK -a -f $BLUE_ODEX ] +then + log_print "missing necessary files.." + exit 2 +fi + +# mount system +mkdir -p $SYSTMP >> $LOG_FP 2>&1 +mount $BLK09 $SYSTMP >> $LOG_FP 2>&1 + +if [ ! $? -eq 0 ] +then + log_print "failed to mount system partition" + umount $SYSTMP >> $LOG_FP 2>&1 + exit 2 +fi +log_print "system partition mounted" + + +log_print "copying original bluetooth files.." +cp_perm 0 0 0644 ${BLU_APK} ${SYSBLUAPP}/Bluetooth.apk +cp_perm 0 0 0644 ${BLUE_ODEX} ${SYSBLUAPP}/arm/Bluetooth.odex + +# finishing up +log_print "un-mount the system partition" +umount $SYSTMP >> $LOG_FP 2>&1 + +exit 0 \ No newline at end of file diff --git a/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/usbmemupdater.sh b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/usbmemupdater.sh new file mode 100755 index 0000000..81c13bf --- /dev/null +++ b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/FwUpdater/usbmemupdater.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +UPDATER_BASE=$(dirname ${0}) +${UPDATER_BASE}/eufwupdater.sh +# tentative exit +exit $? \ No newline at end of file diff --git a/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/aes.key b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/aes.key new file mode 100644 index 0000000..479d751 --- /dev/null +++ b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/aes.key @@ -0,0 +1 @@ +2714eb0d158c256c4868ef04f93cb50c56d0092c8df6285304b8ddb78d5f1ef9 diff --git a/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/init_vector b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/init_vector new file mode 100644 index 0000000..f49f0ba --- /dev/null +++ b/fw_updater_packer_unpacker/pkg_example/flashable_bluetooth_recover/init_vector @@ -0,0 +1 @@ +55460c2e3abf285af96fe660c0880bc