Skip to content

fix: import crashes on miui, #103#236

Merged
tmo1 merged 2 commits intotmo1:masterfrom
askorbinovaya-kislota:master
Mar 20, 2025
Merged

fix: import crashes on miui, #103#236
tmo1 merged 2 commits intotmo1:masterfrom
askorbinovaya-kislota:master

Conversation

@askorbinovaya-kislota
Copy link
Copy Markdown
Contributor

when device has miui, it now removes the "deleted" and "sync_state" fields

i've tested it on my device and it works now

@askorbinovaya-kislota
Copy link
Copy Markdown
Contributor Author

there is a better way to get system properties with reflection, if you don't want to invoke getprop: https://github.com/Aefyr/SAI/blob/55505d231b1390e824d1cc0c8f4fa35fd4677105/app/src/main/java/com/aefyr/sai/utils/Utils.java#L68

and this might be interesting: https://github.com/Aefyr/SAI/blob/master/app/src/main/java/com/aefyr/sai/utils/MiuiUtils.java (uses the same method to detect miui)

@tmo1
Copy link
Copy Markdown
Owner

tmo1 commented Mar 10, 2025

Looks good, but a couple of comments:

  • Is it really necessary to check for MIUI at all, or can we just always drop the two problematic fields on import?
  • The app already has a framework for including and excluding fields on import - the mutable set smsColumns, from which we remove any field that we don't want to import. I think it would be cleaner, and likely more efficient, to just do a one-time removal of the two problematic fields from smsColumns rather than issue two remove calls for each imported message.

@askorbinovaya-kislota
Copy link
Copy Markdown
Contributor Author

Is it really necessary to check for MIUI at all, or can we just always drop the two problematic fields on import?

i didn't know how are those fields used, checked for miui just to be sure nothing changes on other roms

i'll update it based on what you suggested

@tmo1
Copy link
Copy Markdown
Owner

tmo1 commented Mar 11, 2025

i didn't know how are those fields used, checked for miui just to be sure nothing changes on other roms

I've never seen those two fields outside of MIUI exports, so I tentatively assume that they're some kind of MIUI proprietary extension to Android's SMS storage format, but I admit that I'm not really sure.

@tmo1
Copy link
Copy Markdown
Owner

tmo1 commented Mar 17, 2025

Thank you!

Your original commit removed the MIUI fields only from SMS messages, while your subsequent commit removes them from MMS messages as well. Are these fields present in MMS messages?

@askorbinovaya-kislota
Copy link
Copy Markdown
Contributor Author

Are these fields present in MMS messages?

just checked - yes. and import fails with the same error when fields were not deleted

@tmo1 tmo1 merged commit ce18207 into tmo1:master Mar 20, 2025
1 check passed
@tmo1
Copy link
Copy Markdown
Owner

tmo1 commented Mar 20, 2025

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants