* to get rid of global state
* to have a testable architecture
* to allow for authenticated encryption
* to have a backup format version
* to potentially allow for other storage plugins
* With the upcoming changes, and the increasing number of external
libraries being used, plus the usage of Kotlin, it's getting harder
and harder to build this with the AOSP build system.
* It's best to leverage the existing gradle build system instead,
and use the apk that builds.
* Add a script which downloads the apk matching the tag if a tag is
checked out, otherwise downloads the latest.
For the current transport it is important to know when the backup ends,
because it resets its state only then and closes the ZIP file.
The detection was broken,
because some packages didn't have data to back up (LOG_EVENT_ID_NO_DATA_TO_SEND),
so the transport's methods weren't called and the package counter not updated.
The hacky solution is to use the BackupObserver to call back into the
transport at the end of backup.
Ideally, future transports won't need to know when the backup finishes.
We do this as a temporary fix, because our backup methods are not called
which are updating the package counter. So our mechanism to find out
about the end of the backup is broken. Excluding key-value backups fixes
it for now.
This is being done to implement automatic background updates
and not supposed to be part of a release.
The backup key will later be generated and shown to the user instead of
allowing them to choose their own.
Prior to this commit, some of the application data was not included during encryption. This is a breaking change, any backups made prior to this commit can no longer be restored.
1. Encrypt 'full' backup data.
2. Increase number of key generation iterations to 32767.
3. Change cipher to 'AES/CBC/PKCS5Padding'.
1. Add prompt for entering password during backup and restore.
2. Use PBKDF2 to generate a secret key that is used to encrypt backups.
3. Store salt in backup zip file.
4. Fetch salt from backup zip file during restore and use it to decrypt restoration data.