FossifyOrg / Messages

An easy and quick way of managing SMS and MMS messages without ads.
https://www.fossify.org
GNU General Public License v3.0
414 stars 29 forks source link

export messages json is 0 bytes #169

Open QuestioningEspecialy opened 1 month ago

QuestioningEspecialy commented 1 month ago

Checklist

Affected app version

1.0.1

Affected Android/Custom ROM version

Android 14 / GrapheneOS

Affected device model

Google Pixel 6a

How did you install the app?

GitHub releases

Steps to reproduce the bug

  1. open app
  2. gear icon
  3. Export messages
  4. leave name as is and both boxes (Export SMS & MMS) checked
  5. OK
  6. navigate to file from File Manager or desktop
  7. notice its "0 bytes" file size

Expected behavior

should be atleast a kilobyte, but probably over 300MB by now

Actual behavior

its file size ain't even a byte 😐

Screenshots/Screen recordings

No response

Additional information

n/a

Aga-C commented 1 month ago
  1. Just to be sure - have you checked if the file really has no data? Because it can be working, but for a some reason Android reports wrong file size.
  2. Does it work when you check to export only SMS?
  3. When exporting, do you see a toast message informing that the export has been successful?
naveensingh commented 1 month ago

Because it can be working, but for a some reason Android reports wrong file size.

This has happened to me too. The file size was correct when I checked using a file manager but it was 0 bytes only in the document file picker. It could be that the file was still being written, https://github.com/FossifyOrg/General-Discussion/issues/120 will at least clear up the progress issue.

QuestioningEspecialy commented 1 month ago

@Aga-C

  1. is there a quick way to check without temporarily installing a different messenger app? don't want duplicates in my primary messenger 🤷🏿‍♂️
  2. exporting SMS alone does work, but exporting MMS alone doesn't
  3. only when exporting SMS alone

@naveensingh i've only checked with Fossify's File Manager and my desktop Windows Explorer (or whatever the general folder system's called) not sure what the "document file picker" is, but those exports from yesterday are still 0 bytes on my phone

Aga-C commented 1 month ago

 is there a quick way to check without temporarily installing a different messenger app? don't want duplicates in my primary messenger 🤷🏿‍♂️

You could open it as a text file in any file manager app. You can even open it on your desktop in Notepad. I was only interested if there's any data in a file because Android can report file size wrongly.

 but exporting MMS alone doesn't

If there's no data in a file, it sounds like it can be a similar problem as https://github.com/FossifyOrg/Messages/issues/6, but for some reason the app doesn't crash in your case. Maybe the same fix will help. In that issue, the author of the fix uploaded an APK file - you can check if it also addresses your problem.

QuestioningEspecialy commented 1 month ago

@Aga-C the 0 byte json's are empty in HTML Viewer, Vanadium (a browser), and a document viewer i'll try out the fix later

tom93 commented 1 month ago

@QuestioningEspecialy I can't reproduce the new SecurityException (https://github.com/fossifyorg/messages/issues/6#issuecomment-2105940085). Have you tried stock Android, or only GrapheneOS? And which file picker are you using? (I tested in an emulator running Android 14, device definition Pixel 6a, architecture x86_64 because the emulator didn't support arm64-v8a in my setup; command: avdmanager create avd --name pixel_6a -k "system-images;android-34;default;x86_64" -d pixel_6a) I don't think the SecurityException is caused by my patch. Probably the patch is allowing the app to progress further and encounter the SecurityException. If you can get the debug logs it would probably be helpful. Another thing to try (easy but only marginally useful) is to switch back to the official release and export just SMS, and then just MMS; hopefully one of them would be small enough for the export to progress, and either succeed or run into the same SecurityException (the aim is to pinpoint whether the SecurityException is caused by the debug release or something else).

QuestioningEspecialy commented 1 month ago

@tom93 i've only used GrapheneOS and FossifyOrg's File Manager (if i understood you correctly) i might the the debug logs process later 😑

tom93 commented 1 month ago

The file picker is the app that asks you to pick the destination folder. It opens after you tap "OK" in dialog for choosing what to export (SMS/MMS). You should be able to tell by the appearance whether it's a native file manager or Fossify File Manager.

I tested with Fossify File Manager as the file picker on Android (I had to run pm hide com.android.documentsui as root to avoid using the native file manager), but I still didn't get the SecurityException.

I can't find an easy way to run GrapheneOS in an emulator. Speaking for myself (since I'm not on the Fossify team), I think the GrapheneOS team should take a look at this and let us know whether it's a bug in GrapheneOS or the Fossify apps, because it's working fine on Android and I can't find an easy way to test on GrapheneOS. They should be able to reproduce the issue using the official release of Fossify Messages from GitHub or F-Droid; they'll just need to ensure that the export is small, otherwise they'll run into the same issue that you initially ran into (#6).

If you'd like to back up your messages soon, it might be possible to find a temporary workaround (e.g. use Android's sharing API to transfer the exported file to another app such as the file manager).

s1nistr4 commented 19 hours ago

If I had a nickel for every time a FOSS messaging app messed up backup/restore, I'd have two nickels, which isn't a lot but it's weird that it happened twice (the other being QUIK sms)