Import/Export encryption and progress notification
NOTE : This is a work in progress. It is working, but some cleanup is needed, and I need to test it with a great amount of data.
Since exporting messages saves them into a json. It would be easy to grep a bunch of phone number, messages and mms, so I thought of adding this. It is completely based on FairEmail implementation.
- It won't affect older backup, and new backup can be created w/o a password.
To encrypt the backup, simply input a password on the export dialog. Extension will be changed to .json to .sec by default. To decrypt, put the same password you provided at first.
@tibbi okay, strings are done. I'm starting java and Kotlin, so I have trouble understanding how onProgress.invoke() in MessagesImporter().importMessages() is processed (is it actually?). I was wondering if I could use it to set an import progress bar or progress count...
it was @KryptKode doing it, onProgress isnt doing anything now. Guess it was some preparation for showing a progress bar, but we can remove it until it gets actually used.
Okay, I think it's ready. I did some test, and it worked well. I could test with a backup size up to 150MB. I didn't remove the OnProgress Unit, it could be really useful since backups tends to take some time to restore, but I have no clue on how to link it to a Dialog function...
Okay so I documented myself a bit on Unit in Kotlin, and here is a progress notification system for importing/exporting :)
Heu @tibbi, is it possible to merge, or you don't want the feature? I can update it if you want
I dont know, havent tested it properly yet, will take a look at it soon