Importing exported RCS messages causes illegal argument exception
Unfortunately, my device was subject to Google's forced and permanent rollout of RCS. And while importing messages from old backups did work, it appears that backups of RCS-enabled messages don't play very nice. I'm not entirely sure if there were some trailing keys missing upon export, but removing the ones not present in my old backups helped.
I made a backup and tried confirming that it worked by importing it after a wipe, facing the first issue here:
10-06 15:52:24.982 26492 30679 W System.err: java.lang.IllegalArgumentException: The non-sync-callers AND non-blocked-url should not specify DELETED for inserting.
10-06 15:52:24.982 26492 30679 W System.err: at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:172)
10-06 15:52:24.982 26492 30679 W System.err: at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
10-06 15:52:24.982 26492 30679 W System.err: at android.content.ContentProviderProxy.insert(ContentProviderNative.java:599)
10-06 15:52:24.982 26492 30679 W System.err: at android.content.ContentResolver.insert(ContentResolver.java:2212)
10-06 15:52:24.982 26492 30679 W System.err: at android.content.ContentResolver.insert(ContentResolver.java:2173)
10-06 15:52:24.982 26492 30679 W System.err: at H0.x.e(SourceFile:83)
10-06 15:52:24.982 26492 30679 W System.err: at p1.b.c(SourceFile:9)
10-06 15:52:24.982 26492 30679 W System.err: at D1.z.run(SourceFile:117)
10-06 15:52:24.982 26492 30679 W System.err: at B.e.run(SourceFile:363)
10-06 15:52:24.982 26492 30679 W System.err: at K1.j.run(SourceFile:3)
10-06 15:52:24.982 26492 30679 W System.err: at K1.a.run(SourceFile:92)`
Cross-examining the ndjson of my old backups with the new one, I figured that it had to do with additional RCS-related keys that aren't handled by the app.
Following this, I made copy of the new backup where I removed the RCS keys. This altered copy had much of its messages (210/~251) imported without issue. However, one conversation which contained an RCS-sent image appears to have caused the same issue as it had its own keys which I hadn't removed, resulting in it being entirely skipped over.
10-06 16:00:53.761 27394 32591 W System.err: java.lang.IllegalArgumentException: Should not specify NEED_DOWNLOAD in values.
10-06 16:00:53.761 27394 32591 W System.err: at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:172)
10-06 16:00:53.761 27394 32591 W System.err: at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
10-06 16:00:53.761 27394 32591 W System.err: at android.content.ContentProviderProxy.insert(ContentProviderNative.java:599)
10-06 16:00:53.761 27394 32591 W System.err: at android.content.ContentResolver.insert(ContentResolver.java:2212)
10-06 16:00:53.761 27394 32591 W System.err: at android.content.ContentResolver.insert(ContentResolver.java:2173)
10-06 16:00:53.761 27394 32591 W System.err: at H0.x.e(SourceFile:163)
10-06 16:00:53.761 27394 32591 W System.err: at p1.b.c(SourceFile:9)
10-06 16:00:53.761 27394 32591 W System.err: at D1.z.run(SourceFile:117)
10-06 16:00:53.761 27394 32591 W System.err: at B.e.run(SourceFile:363)
10-06 16:00:53.761 27394 32591 W System.err: at K1.j.run(SourceFile:3)
10-06 16:00:53.761 27394 32591 W System.err: at K1.a.run(SourceFile:92)
Closing due to lack of submitter communication.