HappyZ / dpt-tools

dpt systems study and enhancement
MIT License
565 stars 130 forks source link

factory_reset.sh does nothing except echos "NG" #116

Closed frankli998 closed 5 years ago

frankli998 commented 5 years ago

Below is the code of factory_reset.sh, which does nothing except echos "NG" when runned. I am aware of a similar issue https://github.com/HappyZ/dpt-tools/issues/95 ,but the user do not seem to have solved the issue eventually. PS: Suggested launcher-mod is highly likely to cause this issue. My device is hacked using windows10. Tried re-flash 1.6 firmware or downgrade to 1.4, neither worked for me.

root@FPX-1010:/usr/local/bin# cat factory_reset.sh

!/bin/sh

. diag_functions

default_destructor () { echo NG } trap default_destructor 0 2 11 15

shutdown_screen=/usr/local/etc/factoryreset$(rawdata --sku_name).bmp if ! test -f $shutdown_screen; then exit fi

opt=$(getopt -o e --long no_epd_init -- "$@") if test $? -ne 0; then exit fi eval set -- "$opt"

epd_init="gray INIT FULL 0"

while true; do case "$1" in -e | --no_epd_init) unset epd_init ;; --) break ;; *) exit ;; esac shift done

get_format_specs () { cat <<FormatPartitions 14 mkfs.ext4 16 busybox mkfs.vfat 17 format_userdata.sh FormatPartitions }

format_partitions () { get_format_specs | while read part cmd; do devnode=/dev/mmcblk0p$part umount $devnode eval $cmd $devnode done >/dev/null 2>&1 }

set_epd () { epd_fb_test $@ >/dev/null 2>&1 }

clear_epd () { if test -n "$epd_init"; then eval set_epd $epd_init fi set_epd setsdwnscr $shutdown_screen

echo 1 > /sys/devices/platform/epdcfb.0/epdc_display_shutdown_screen }

destructor () { DIAG_disable } trap destructor 0 2 11 15

change_boot_mode.sh normal clear_epd & format_partitions & wait

HappyZ commented 5 years ago

you can try to run it manually and see which part didn't work out and exited

I don't think launcher-mod could cause such issue but you can prove me wrong

you need to bypass the official version check, i.e. use my modded firmware to downgrade. Otherwise it won't flash at all. And after flashing, very likely you need to reset by going into "Settings" > "Initialize DPT"

frankli998 commented 5 years ago

"I don't think launcher-mod could cause such issue but you can prove me wrong" Yes, I guess you are right. I reversed launcher-mod and re-flashed but the problem still exists.

"you need to bypass the official version check, i.e. use my modded firmware to downgrade." I did use your firmware, and it actually downgraded successfully, since the version number changed in settings when I checked.

"You need to reset by going into "Settings" > "Initialize DPT". I have tried both "going into "Settings" > "Initialize DPT" and run factory_reset.sh under diagnosis mode, neither worked. So what do you mean by running it manually?

frankli998 commented 5 years ago

Another question, is there anything different between "fw" in normal mode and "install-pkg" in diagnosis mode?

frankli998 commented 5 years ago

OK, reason found. In 1.6 full-mod, there is an native application named TestMode, I changed my SKU from Japanese to Chinese, and this seems to disturb factory_reset function. Changing the SKU back to Japanese edition solves the problem.

chaoskin10 commented 5 years ago

how to change sku? thx @frankli998

frankli998 commented 5 years ago
  1. Root dpt-rp1
  2. Flash 1.6 full mod, this pkg can be found in "PKGs I made" wiki section in this repository
  3. Open eink-launcher, launch Testmode, a native apk, and you will see the option to change SKU ---原始邮件--- 发件人:"chaoskin10"notifications@github.com 发送时间:2019年7月15日 星期一 上午8:59 收件人:"HappyZ/dpt-tools"dpt-tools@noreply.github.com 抄送:"frankli998"605212980@qq.com;"State change"state_change@noreply.github.com 主题:Re: [HappyZ/dpt-tools] factory_reset.sh does nothing except echos"NG" (#116)

how to change sku? thx

— You are receiving this because you modified the open/close state. Reply to this email directly,view it on GitHub, ormute the thread.

chaoskin10 commented 5 years ago

thx a lot