android: Exclude all data from backup#2160
Conversation
|
@rajveermalviya would you pick up this PR from here, and also the rest of #2158 (i.e. the iOS side)? I believe the only thing this PR needs is manual testing. See the issue's discussion of testing. The easiest way to test is probably this Android Studio feature, new a few months ago: There's also a pair of recipes documented here: |
6c61a63 to
e315ffc
Compare
|
I pushed a revision to fix the deprecation lint error, it updates AndroidManifest.xml and also adds related config files for:
|
|
This should be ready for review now, @gnprice PTAL. |
|
FTR here's the lint error that the previous revision was getting: |
|
To confirm that backup/restore is actually disabled. I used the Android Studio's backup and restore features as documented here: Basically to test the clean state (with backups enabled) on
Then I followed the steps 4 and 5, with the backup disabled. Confirming that the app created the DB from scratch. ––– Just as a sanity check, I also tested the attributes one-by-one ( |
Fixes part of zulip#2158, namely for Android. Android (like iOS) has a feature automatically back up apps' data into the cloud, and a related feature to transfer data directly from one device to another (typically when first setting up a new device). These features have some value when it comes to Zulip, but not a lot: the great bulk of the app's data comes from the user's Zulip server(s) anyway. And conversely, there is some data that shouldn't be backed up, because it shouldn't be duplicated off the device. Right now, that describes the user's API keys: it's convenient not to have to log in again, but also potentially a security risk depending on how the backup is managed. With the new "devices" and "push keys" APIs being introduced for end-to-end encrypted push notifications zulip#1764, this will become a bigger issue: * If a new device restores a backup from an old device that's still online, then the two real devices will compete over what the push key and push token should be for the "device" object. * If a backup includes push keys, then it makes the security of the end-to-end encryption dependent on the security of the backup. So just disable the backup feature entirely. We have a followup issue zulip#2159 to track selectively re-enabling it where appropriate. Upstream Android docs: https://developer.android.com/identity/data/backup https://developer.android.com/identity/data/autobackup#EnablingAutoBackup Co-authored-by: Rajesh Malviya <rmalviya@zulip.com>
|
Thanks for the testing and revision! I added some comments to explain our reasoning; merging. |
Fixes part of #2158, namely for Android.
Android (like iOS) has a feature automatically back up apps' data into the cloud, and a related feature to transfer data directly from one device to another (typically when first setting up a new device).
These features have some value when it comes to Zulip, but not a lot: the great bulk of the app's data comes from the user's Zulip server(s) anyway. And conversely, there is some data that shouldn't be backed up, because it shouldn't be duplicated off the device.
Right now, that describes the user's API keys: it's convenient not to have to log in again, but also potentially a security risk depending on how the backup is managed.
With the new "devices" and "push keys" APIs being introduced for end-to-end encrypted push notifications #1764, this will become a bigger issue:
If a new device restores a backup from an old device that's still online, then the two real devices will compete over what the push key and push token should be for the "device" object.
If a backup includes push keys, then it makes the security of the end-to-end encryption dependent on the security of the backup.
So just disable the backup feature entirely. We have a followup issue #2159 to track selectively re-enabling it where appropriate.
Upstream Android docs:
https://developer.android.com/identity/data/backup
https://developer.android.com/identity/data/autobackup#EnablingAutoBackup