(android) Backup channels and payments db #561
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a local, on-device backup mechanism for the payments and channels database, for Android. It will allow users to restore their payments history after uninstalling or resetting the wallet.
The channels and payments database are zipped and encrypted on disk in public folder. This backup file will not be erased when the app is uninstalled, and can thus can be restored manually when the user imports their wallet again in the future. It does not require new permissions, since we are using the Mediastore API to write the file, and importing the backup file is done manually by the user, using the Android file browsing framework.
This encrypted file can also be backed up using the auto Google Drive backup system, if available and enabled, which would avoid having to manually restore the local backup file.
This PR and description is a WIP.