NeoApplications / Neo-Backup

backup manager for android
GNU Affero General Public License v3.0
2.37k stars 120 forks source link

[Bug] Fingerprint backup fails on valid filenames #875

Open b02860de585071a2 opened 1 week ago

b02860de585071a2 commented 1 week ago

Description Per AOSP source, data for the fingerprint sensor may be stored in [...]/settings_fingerprint.xml (legacy location), or in a file generated per given sensor, ie [...]/settings_fingerprint_<sensorId>.xml (for my P8P, this happens to be settings_fingerprint_0.xml).

The fingerprint backup function only checks for (hardcoded) settings_fingerprint.xml: https://github.com/NeoApplications/Neo-Backup/blob/672dd22879c674aada640a4618fffd2f070d64a4/app/src/main/java/com/machiav3lli/backup/dbs/entity/SpecialInfo.kt#L168-L179

This results in failure of the backup, because the expected file does not exist.

Steps To Reproduce

  1. Rename settings_fingerprint.xml to settings_fingerprint_<number>.xml in a test environment
  2. Select $ Fingerprints under special backups
  3. Attempt to back up
  4. Error thrown: "BackupAppAction$BackupFailedException: ls: /data/system/users/0/settings_fingerprint.xml: no such file or directory - null"

Expected behavior All possible files should be considered when performing checks. Assuming file existence is being checked with some android shell function like:

if ls <file> 1>/dev/null 2>&1; then
    <some backup action>
else
    <return error>
fi

I believe just globbing settings_fingerprint*.xml would work? kt is not my wheelhouse.

Screenshots N/A

System Information(please complete the following information):