HappyZ / dpt-tools

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

Reset does not seem to work after unroot #169

Closed phsamuel closed 4 years ago

phsamuel commented 4 years ago

I dropped my stylus and now it behaves very weirdly. Basically the digital paper senses the stylus tip even when it is still a millimeter away. Actually I can even write through credit cards and it makes it very difficult to write cleanly.

I called Sony Tech support. They asked me to reset DPT with initialize DPT in setting. It does not seem to do anything (my documents are still there after reset). So I tried to unroot. I followed the first three steps in the unroot guide. But reset still does not seem to do anything. My docs are still there.

Honestly, I doubt resetting will help my case. But I am just doing this to make Sony Tech support happy. I am looking for another stylus. But I don't want to fork over $100 for that. Any suggestion is welcome (like any idea of an inexpensive replacement of the stylus). Thanks ahead!

HappyZ commented 4 years ago

I'll have time to check at weekends. I'm not sure what causes FactoryReset.pkg fails as I forgot what it does (the reset uses that pkg).

And right, I would assume it's stylus. I think it's the sensitivity problem. I believe somewhere in the system you should be able to adjust the sensitivity..

phsamuel commented 4 years ago

Thanks ahead! I tried to calibrate several times. But the calibration in the setting does not help.

qq2379466 commented 4 years ago

你好,请问怎么恢复官方固件,我也是卡按照推荐的方法恢复,可是根本无法初始化

HappyZ commented 4 years ago

Sorry, I didn't have time to check this over the weekend. Will have to try next weekend. Stay tuned.

phsamuel commented 4 years ago

No problem. Thanks ahead!

On Mon, May 18, 2020 at 3:39 AM HappyZ notifications@github.com wrote:

Sorry, I didn't have time to check this over the weekend. Will have to try next weekend. Stay tuned.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/HappyZ/dpt-tools/issues/169#issuecomment-630034447, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABH7LAO65NT6LLJP737K6KLRSDX5ZANCNFSM4NA5IOGA .

qq2379466 commented 4 years ago

抱歉,周末我没有时间检查。下周末将不得不尝试。敬请关注。

你好 请问尝试成功了吗?

HappyZ commented 4 years ago

I don't see any issues with factory reset. The command FactoryReset.pkg uses is:

/usr/local/bin/factory_reset.sh --no_epd_init

This is the pkg used by the reset key and the initialization in DPT settings.

If you enter dpt diagnosis mode, and run that command, what does it print? I could probably know better if you send this info.

phsamuel commented 4 years ago

I got the following error message when I run the command under dpt-tools diagnosis.

/usr/local/bin/factory_reset.sh: line 28: DIAG_get_setid: not found
NG
phsamuel commented 4 years ago

As I google the error, I was thinking if dpt-tools could not find the deviceid so I also tried

python dpt-tools.py -id ./deviceid.dat -k ./privatekey.dat

to start the dpt-tools but still got the same error. Any suggestion is helpful. Thanks!

HappyZ commented 4 years ago

I think you should try:

cd /usr/local/bin
./factory_reset.sh --no_epd_init

It has . DIAG_FUNCTIONS (naming might be wrong) which needs path to be correct.

If it doesn't work, use cat /usr/local/bin/factory_reset.sh and see if you can manually run the first line of that script, something looks like . DIAG_FUNCTIONS.

It has nothing to do with your device id. Lmk if it works.

phsamuel commented 4 years ago

I tried but it still returns the same error. btw, I just realize I may have the same issue as 116.

frankli988 suggested to flash 1.6 full mod. "...Flash 1.6 full mod, this pkg can be found in "PKGs I made" wiki section in this repository..."

But I am not sure which one he is really referred to. I tried to flash the original mod I used (1.6.03.09261). The flash was successful. But I got unable to update error 900001.

HappyZ commented 4 years ago

Full mod is removed as it is not sustainable for me to make. I couldn't find the file on my computer any more. Do you have any knowledge to use putty (on windows) or screen (on linux/mac)? Maybe try to use it from there instead of using dpt-tools.py.

HappyZ commented 4 years ago

For mac/linux:

screen /dev/tty.usbmodem01

And password should be 12345 for root user. After login, try it again.

For windows, download putty.exe (PuTTY, search it on the web) Fill in the correct port to connect, and do the same as above to login.

Then press Enter key to show the login process (or if you used diagnosis mode before, it should already be logged in). Now try

cd /usr/local/bin
./factory_reset.sh --no_epd_init
phsamuel commented 4 years ago

I tried screen on a Mac. But still have the same error. btw, I have updated it once. I completely forgot about that. I wonder that is a related problem.

HappyZ commented 4 years ago

Weird. Then I'm not sure what goes wrong.. You can dig into that function and it should be in the file named DIAG_FUNCTIONS something like that in /usr/local/bin. See if you can run it manually.. like line-by-line

phsamuel commented 4 years ago

Yes. There is a line in the script.

shutdown_screen=/usr/local/etc/factory_reset/$(DIAG_get_setid)/$(prefix)_message.bmp

Indeed, DIAG_get_setid is missing and I can't find it anywhere. But I checked the folder /usr/local/etc/factory_reset and there are only 2 folders (2 and 3) and both contain the file $(prefix)_message.bmp. Anyway it appears that the file is only used as a shutdown screen. So I just replaced $(DIAG_get_setid) with 3 instead. factory_reset.sh can run afterward and it turns out to be a simple fix. Thanks much for your guidance and patience!

qq2379466 commented 4 years ago

Yes. There is a line in the script.

shutdown_screen=/usr/local/etc/factory_reset/$(DIAG_get_setid)/$(prefix)_message.bmp

Indeed, DIAG_get_setid is missing and I can't find it anywhere. But I checked the folder /usr/local/etc/factory_reset and there are only 2 folders (2 and 3) and both contain the file $(prefix)_message.bmp. Anyway it appears that the file is only used as a shutdown screen. So I just replaced $(DIAG_get_setid) with 3 instead. factory_reset.sh can run afterward and it turns out to be a simple fix. Thanks much for your guidance and patience!

Can you tell me how to set up from scratch? Thanks, I encountered a problem while modifying $ (DIAG_get_setid) in the last step.

phsamuel commented 4 years ago

When you log into the dpt, you want to check if /usr/local/etc/factory_reset/ has any subfolders.

You can run the following.

ls /usr/local/etc/factory_reset

There are folders 2 and 3 for me. If I run

ls /usr/local/etc/factory_reset/3

there are files c_message.bmp and so on.

If it is the same case for you, simply replace the line

shutdown_screen=/usr/local/etc/factory_reset/$(DIAGget setid)/$(prefix)_message.bmp

by

shutdown_screen=/usr/local/etc/factory_reset/3/$(prefix)_message.bmp .

I use vi to edit. If you are not familiar with vi, you may run

cp factory_reset.sh factory_reset.bak cat factory_reset.bak|sed 's/\$[(]DIAG_get_setid[)]/3/g'|cat > factory_reset.sh

For the last line, you want to change 3 to whatever folder that contains c_message.bmp.

Best, Sam

On Sun, May 31, 2020 at 3:15 PM qq2379466 notifications@github.com wrote:

Yes. There is a line in the script.

shutdown_screen=/usr/local/etc/factory_reset/$(DIAG_get_setid)/$(prefix)_message.bmp

Indeed, DIAG_get_setid is missing and I can't find it anywhere. But I checked the folder /usr/local/etc/factory_reset and there are only 2 folders (2 and 3) and both contain the file $(prefix)_message.bmp. Anyway it appears that the file is only used as a shutdown screen. So I just replaced $(DIAG_get_setid) with 3 instead. factory_reset.sh can run afterward and it turns out to be a simple fix. Thanks much for your guidance and patience!

Can you tell me how to set up from scratch? Thanks, I encountered a problem while modifying $ (DIAG_get_setid) in the last step.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/HappyZ/dpt-tools/issues/169#issuecomment-636522908, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABH7LAPOM6N3XNEJ3KE55JLRUK3E5ANCNFSM4NA5IOGA .

qq2379466 commented 4 years ago

When you log into the dpt, you want to check if /usr/local/etc/factory_reset/ has any subfolders. You can run the following. ls /usr/local/etc/factory_reset There are folders 2 and 3 for me. If I run ls /usr/local/etc/factory_reset/3 there are files c_message.bmp and so on. If it is the same case for you, simply replace the line shutdown_screen=/usr/local/etc/factory_reset/$(DIAGget setid)/$(prefix)_message.bmp by shutdown_screen=/usr/local/etc/factory_reset/3/$(prefix)_message.bmp . I use vi to edit. If you are not familiar with vi, you may run cp factory_reset.sh factory_reset.bak cat factory_reset.bak|sed 's/\$[(]DIAG_get_setid[)]/3/g'|cat > factory_reset.sh For the last line, you want to change 3 to whatever folder that contains c_message.bmp. Best, Sam On Sun, May 31, 2020 at 3:15 PM qq2379466 @.***> wrote: Yes. There is a line in the script. shutdown_screen=/usr/local/etc/factory_reset/$(DIAG_get_setid)/$(prefix)_message.bmp Indeed, DIAG_get_setid is missing and I can't find it anywhere. But I checked the folder /usr/local/etc/factory_reset and there are only 2 folders (2 and 3) and both contain the file $(prefix)_message.bmp. Anyway it appears that the file is only used as a shutdown screen. So I just replaced $(DIAG_get_setid) with 3 instead. factory_reset.sh can run afterward and it turns out to be a simple fix. Thanks much for your guidance and patience! Can you tell me how to set up from scratch? Thanks, I encountered a problem while modifying $ (DIAG_get_setid) in the last step. — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <#169 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABH7LAPOM6N3XNEJ3KE55JLRUK3E5ANCNFSM4NA5IOGA .

Thank you for your guidance, but I am new to VI commands, can you write a command line that can be copied and pasted? Thank you!

phsamuel commented 4 years ago

What do you get when you run ls /user/local/etc/factory_reset?

On Mon, 1 Jun 2020 at 1:18 PM, qq2379466 notifications@github.com wrote:

When you log into the dpt, you want to check if /usr/local/etc/factory_reset/ has any subfolders. You can run the following. ls /usr/local/etc/factory_reset There are folders 2 and 3 for me. If I run ls /usr/local/etc/factory_reset/3 there are files c_message.bmp and so on. If it is the same case for you, simply replace the line shutdown_screen=/usr/local/etc/factory_reset/$(DIAGget setid)/$(prefix)_message.bmp by shutdown_screen=/usr/local/etc/factory_reset/3/$(prefix)_message.bmp . I use vi to edit. If you are not familiar with vi, you may run cp factory_reset.sh factory_reset.bak cat factory_reset.bak|sed 's/$[(]DIAG_get_setid[)]/3/g'|cat > factory_reset.sh For the last line, you want to change 3 to whatever folder that contains c_message.bmp. Best, Sam … <#m289178962810458057> On Sun, May 31, 2020 at 3:15 PM qq2379466 @.***> wrote: Yes. There is a line in the script. shutdown_screen=/usr/local/etc/factory_reset/$(DIAG_get_setid)/$(prefix)_message.bmp Indeed, DIAG_get_setid is missing and I can't find it anywhere. But I checked the folder /usr/local/etc/factory_reset and there are only 2 folders (2 and 3) and both contain the file $(prefix)_message.bmp. Anyway it appears that the file is only used as a shutdown screen. So I just replaced $(DIAG_get_setid) with 3 instead. factory_reset.sh can run afterward and it turns out to be a simple fix. Thanks much for your guidance and patience! Can you tell me how to set up from scratch? Thanks, I encountered a problem while modifying $ (DIAG_get_setid) in the last step. — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <#169 (comment) https://github.com/HappyZ/dpt-tools/issues/169#issuecomment-636522908>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABH7LAPOM6N3XNEJ3KE55JLRUK3E5ANCNFSM4NA5IOGA .

Thank you for your guidance, but I am new to VI commands, can you write a command line that can be copied and pasted? Thank you!

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/HappyZ/dpt-tools/issues/169#issuecomment-637025412, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABH7LAPE3HE4EO2YDRDIBSLRUPWIBANCNFSM4NA5IOGA .

qq2379466 commented 4 years ago

运行ls / user / local / etc / factory_reset会得到什么?

2 3

phsamuel commented 4 years ago

How about

ls /use/local/etc/factory_reset/3

?

On Mon, 1 Jun 2020 at 1:34 PM, qq2379466 notifications@github.com wrote:

运行ls / user / local / etc / factory_reset会得到什么? … <#m_7488574131652037340m-2033883030814135367_>

2 3

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/HappyZ/dpt-tools/issues/169#issuecomment-637032883, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABH7LAP2NIHZTMJ2Y52NEBLRUPYDLANCNFSM4NA5IOGA .

qq2379466 commented 4 years ago

ls / use / local / etc / factory_reset / 3怎么样? 2020年6月1日(星期一)下午1:34,qq2379466 @.***>写道:运行ls /用户/本地/等/ factory_reset会得到什么?…<#m_7488574131651652037340m-2033883030814135367_> 2 3 —您收到此消息是因为您修改了打开/关闭状态。直接回复此电子邮件,在GitHub < #169(评论) >上查看,或退订< https://github.com/notifications/unsubscribe-auth/ABH7LAP2NIHZTMJ2Y52NEBLRUPYDLANCNFSM4NA5IOGA >。

Same as you said, but I won't modify the file, please write a code for me, thank you

phsamuel commented 4 years ago

the code was already included in my earlier post. but you don't seem to understand what i mentioned there. so i just want to make sure you have the same situation as mine. try below 

cd /usr/local/bin; cp -i factory_reset.sh factory_reset.bak; cat factory_reset.bak|sed 's/$[(]DIAG_get_setid[)]/3/g'|cat > factory_reset.sh

the original factory_reset.sh will be stored as factory_reset.bak. DON'T RUN THE ABOVE MORE THAN ONCE. Or it will overwrite the backup file. But it should warn you if you want to overwrite factory_reset.bak when you run it the second time. The above is really a hack. It is relatively safe but I won't guarantee if it doesn't brick anything. Please use it at your own risk.  After running above, try running 

cd /usr/local/bin;./factory_reset.sh --no_epd_init

your dpt should be reset.

qq2379466 commented 4 years ago

该代码已经包含在我以前的文章中。但您似乎不明白我在这里提到的内容。所以我只想确保您和我的情况相同。试试下面 

cd /usr/local/bin; cp -i factory_reset.sh factory_reset.bak; cat factory_reset.bak|sed 's/$[(]DIAG_get_setid[)]/3/g'|cat > factory_reset.sh

原始的factory_reset.sh将存储为factory_reset.bak。不要一次以上运行。否则它将覆盖备份文件。但是,如果您想在第二次运行时覆盖factory_reset.bak,它会警告您。以上确实是一个hack。这是相对安全的,但我不能保证它不会砌任何东西。请自行承担风险。  在上面运行之后,尝试运行 

cd /usr/local/bin;./factory_reset.sh --no_epd_init

您的dpt应该被重置。

Thanks for your help, I have successfully reset it, but the Android settings and APP chart have not disappeared.

phsamuel commented 4 years ago

This is for resetting the device. Not unrooting. You want to check the unroot guide.

On Mon, 1 Jun 2020 at 11:38 PM, qq2379466 notifications@github.com wrote:

该代码已经包含在我以前的文章中。但您似乎不明白我在这里提到的内容。所以我只想确保您和我的情况相同。试试下面

cd /usr/local/bin; cp -i factory_reset.sh factory_reset.bak; cat factory_reset.bak|sed 's/$[(]DIAG_get_setid[)]/3/g'|cat > factory_reset.sh

原始的factory_reset.sh将存储为factory_reset.bak。不要一次以上运行。否则它将覆盖备份文件。但是,如果您想在第二次运行时覆盖factory_reset.bak,它会警告您。以上确实是一个hack。这是相对安全的,但我不能保证它不会砌任何东西。请自行承担风险。 在上面运行之后,尝试运行

cd /usr/local/bin;./factory_reset.sh --no_epd_init

您的dpt应该被重置。

Thanks for your help, I have successfully reset it, but the Android settings and APP chart have not disappeared.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/HappyZ/dpt-tools/issues/169#issuecomment-637267066, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABH7LAJUZ6UV6V5D54HQ2ZTRUR65PANCNFSM4NA5IOGA .

qq2379466 commented 4 years ago

这是用于重置设备。不生根。您要检查unroot指南。 On Mon, 1 Jun 2020 at 11:38 PM, qq2379466 @.***> wrote: 该代码已经包含在我以前的文章中。但您似乎不明白我在这里提到的内容。所以我只想确保您和我的情况相同。试试下面 cd /usr/local/bin; cp -i factory_reset.sh factory_reset.bak; cat factory_reset.bak|sed 's/$[(]DIAG_get_setid[)]/3/g'|cat > factory_reset.sh 原始的factory_reset.sh将存储为factory_reset.bak。不要一次以上运行。否则它将覆盖备份文件。但是,如果您想在第二次运行时覆盖factory_reset.bak,它会警告您。以上确实是一个hack。这是相对安全的,但我不能保证它不会砌任何东西。请自行承担风险。 在上面运行之后,尝试运行 cd /usr/local/bin;./factory_reset.sh --no_epd_init 您的dpt应该被重置。 Thanks for your help, I have successfully reset it, but the Android settings and APP chart have not disappeared. — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <#169 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABH7LAJUZ6UV6V5D54HQ2ZTRUR65PANCNFSM4NA5IOGA .

The problem is solved, thank you for your guidance.