tmo1 / sms-ie

SMS Import / Export is a simple Android app that imports and exports SMS and MMS messages, call logs, and contacts from and to JSON / NDJSON files.
GNU General Public License v3.0
319 stars 38 forks source link

Crash during import: "java.io.EOFException: End of input" #108

Closed Protofall closed 1 year ago

Protofall commented 1 year ago

I exported all of my SMS and MMS on my old phone with no issues. I tried importing them on my new phone and I consistently encounter this error after 530 SMSes.

I am unable to provide logcat info. I checked the readme and the guides for how to use it, but they don't work. Despite enabling developer mode on my phone, adb devices sees nothing. Google seems to suggest that adb is just horribly broken on Windows/WSL. Would be nice if there was an in-app option to output the logs to a file instead.

tmo1 commented 1 year ago

Thanks for the report!

I exported all of my SMS and MMS on my old phone with no issues. I tried importing them on my new phone and I consistently encounter this error after 530 SMSes.

How many SMSs and MMSs were actually exported / are actually present in the file? If the error is triggered after 530 SMSs, does that mean that no MMSs are imported?

This is the first time I'm encountering java.io.EOFException: End of input in connection to SMS I/E. I don't know what could be causing this error other than some kind of file corruption / truncation. If the error can be reproduced with a minimal export / import, I'd ask you to post a (sanitized) file that demonstrates the error.

Would be nice if there was an in-app option to output the logs to a file instead.

I'll consider implementing that in the future

Protofall commented 1 year ago

I exported 9067 SMSes and 297 MMSes. When I went to import it tries SMSes first, fails, and never attempts MMSes.

I didn't check the exported file before, but now that I look at it, there might actually be an issue with the export instead. I ran this command to see if the json syntax is even valid and got this:

python -mjson.tool "messages-2023-04-16.json"
Expecting object: line 14888 column 1 (char 385023)

And sure enough, the file just ends, seemingly mid-object. Note how the final field in the object should be "display_name" or "resent_im" image

Also I'd like to apologise for my attitude earlier today. I was getting frustrated with everything failing and it got to my head. I understand creating a whole new debug output mode would be a big task and logcat probably does work for 99% of users, I just happened to have an unfortunate combo where it didn't work.

Protofall commented 1 year ago

I just tried a new export from my original phone and this time I get 275675 lines and the syntax is valid. I haven't tried importing it yet, but I think this will work.

I'm not sure why the original JSON file was broken, I only have two theories on it:

Unfortunately I deleted the original export on my old phone, so I can't verify where it messed up.

I'll close the issue now. Thanks for the help and the nice App.

tmo1 commented 1 year ago

Also I'd like to apologise for my attitude earlier today. I was getting frustrated with everything failing and it got to my head. I understand creating a whole new debug output mode would be a big task and logcat probably does work for 99% of users, I just happened to have an unfortunate combo where it didn't work.

No offense taken! Usually (in my experience) online communication worsens tone, but in this case I just read it as a feature request :) As you note, though, it's not a trivial undertaking, so I'm not sure whether I'll actually do it.

Maybe a silent error occurred when I first exported it?

That's possible - see, e.g., issue #85

I'll close the issue now. Thanks for the help and the nice App.

Sure! I'm glad you seem to have gotten it working. Please report any further problems (or successes, if you want).