jensstein / oandbackup

backup manager for android
Other
545 stars 199 forks source link

Restore fails silently when downgrading #264

Open mvglasow opened 5 years ago

mvglasow commented 5 years ago

Steps to reproduce

  1. Make a backup of an app.
  2. Update that app (i.e. to a version with a newer version code in the manifest)
  3. Try to restore the backup of that app, and check the app

Expected behavior

The old version of the app is back

Actual behavior

oandbackup reports success, but the updated version of the app is still around

Versions affected

oandbackup 0.3.5-universal (from F-Droid), LineageOS 15.1

Further information

Without having looked at the internals of oandbackup: the package manager prevents downgrades and I am not sure if the Android API exposes a way around that. With root and shell access, it is possible to achieve that by doing:

pm install -r -d base.apk

which will replace existing packages (-r) and accept downgrades (-d). Maybe it would help to use pm install for all APK restore operations.