MuntashirAkon / AppManager

A full-featured package manager and viewer for Android
https://muntashirakon.github.io/AppManager/
Other
4.36k stars 259 forks source link

Minimise metadata in backups. #618

Open MuntashirAkon opened 2 years ago

MuntashirAkon commented 2 years ago

App Manager uses a metadata file for each backups which contains a lot of information regarding the app. Besides, the folder itself contains metadata info such as package name and the user ID. If encryption is enabled, an adversary cannot modify the metadata file in any way (because it will result in verification failure), but they still can gather a lot of information regarding the apps a user has, even the app list is often considered a valuable metadata. To fix the issues, a novel scheme has been proposed:

The metadata file will be divided into two separate files:

  1. info.json: This unencrypted but verifiable file will contain encryption information and backup flags.
  2. meta.json: This file will contain all the other information and will be encrypted like the other files.

In addition, UUID will be used for folders instead of package names to prevent collection of backed up packages by a potential adversary. Backups will no longer be stored in the sub folders with <user_id>_<backup_name> format. Consequently, a key will be added in the meta.json and the version number will be incremented:

  1. backup_name: Backup name/label. Having the backup name stored as a metadata also has the benefit of using any names.

All in all, the following metadata will be stored in the info.json, which will be visible to everybody:

Backward compatibility As usual, backward compatibility will be provided for old backups. However, there will not be any option to convert them to the new format due to its complexity.