pusher / push-notifications-android

Android SDK for Pusher Beams
https://www.pusher.com/beams
MIT License
21 stars 22 forks source link

Exclude Beams from backing up any content #88

Closed daniellevass closed 4 years ago

daniellevass commented 4 years ago

This should fix issue #86 and prevent the library from creating any backups at all.

daniellevass commented 4 years ago

Have updated this to exclude only the push notifications shared preferences. There's an open question for how we want to handle our jobqueue.

You can test this works for yourself by entering adb shell then running bmgr run and then bmgr fullbackup com.pusher.pushnotifications.sample. Check in the Android Logcat to see what files got backed up.

Before the files being backed up were:

Name: apps/com.pusher.pushnotifications.sample/f/8a070eaa-033f-46d6-bb90-f4c15acc47e1.jobqueue
Name: apps/com.pusher.pushnotifications.sample/db/google_app_measurement_local.db-journal
Name: apps/com.pusher.pushnotifications.sample/db/google_app_measurement_local.db
Name: apps/com.pusher.pushnotifications.sample/sp/com.pusher.pushnotifications.PushNotificationsInstance.xml
Name: apps/com.pusher.pushnotifications.sample/sp/com.google.android.gms.appid.xml
Name: apps/com.pusher.pushnotifications.sample/sp/com.google.android.gms.measurement.prefs.xml

Now the files backed up are:

Name: apps/com.pusher.pushnotifications.sample/f/8a070eaa-033f-46d6-bb90-f4c15acc47e1.jobqueue
Name: apps/com.pusher.pushnotifications.sample/db/google_app_measurement_local.db-journal
Name: apps/com.pusher.pushnotifications.sample/db/google_app_measurement_local.db
Name: apps/com.pusher.pushnotifications.sample/sp/com.google.android.gms.appid.xml
Name: apps/com.pusher.pushnotifications.sample/sp/com.google.android.gms.measurement.prefs.xml

Using this we can now demonstrate that the shared preferences file is no longer included!

daniellevass commented 4 years ago

Added some more logic to move our jobqueue to a directory and exclude that.

Files backed up before:

Name: apps/com.pusher.pushnotifications.sample/f/beams
Name: apps/com.pusher.pushnotifications.sample/f/beams/8a070eaa-033f-46d6-bb90-f4c15acc47e1.jobqueue
Name: apps/com.pusher.pushnotifications.sample/db/google_app_measurement_local.db-journal
Name: apps/com.pusher.pushnotifications.sample/db/google_app_measurement_local.db
Name: apps/com.pusher.pushnotifications.sample/sp/com.google.android.gms.appid.xml
Name: apps/com.pusher.pushnotifications.sample/sp/com.google.android.gms.measurement.prefs.xml

Files backed up after:

Name: apps/com.pusher.pushnotifications.sample/db/google_app_measurement_local.db-journal
Name: apps/com.pusher.pushnotifications.sample/db/google_app_measurement_local.db
Name: apps/com.pusher.pushnotifications.sample/sp/com.google.android.gms.appid.xml
Name: apps/com.pusher.pushnotifications.sample/sp/com.google.android.gms.measurement.prefs.xml