Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(android) Backup channels and payments db #561

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

Conversation

dpad85
Copy link
Member

@dpad85 dpad85 commented May 13, 2024

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.

nfillion21 and others added 8 commits August 23, 2024 14:10
Android 12 has brought additional features to the backup
mechanism and uses a different xml file.

Also, instead of uploading the database files, we will upload
an encrypted file that contains the database. This should be
easier to do than a custom BackupAgent.
When restoring a wallet, the user can now restore a backup
file if one is available to recover the payments history.

This is done manually, by browsing the device's file system
and selecting a file. The file is then decrypted, read, and
the payments database it contains are restored in the phoenix
internal db directory.

This step is optional and can be skipped. If there already
is a payments db in the  internal db directory, this step
is skipped automatically when restoring a wallet (will
typically happen because of the cloud backup mechanism
provided by google drive).
For now we'll keep the backup file local.
@dpad85 dpad85 force-pushed the android-local-backup branch from 9fa1634 to 63835f1 Compare August 23, 2024 12:54
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