Universal-Debloater-Alliance / universal-android-debloater-next-generation

Cross-platform GUI written in Rust using ADB to debloat non-rooted Android devices. Improve your privacy, the security and battery life of your device.
GNU General Public License v3.0
2.28k stars 77 forks source link

bug(scope): Restoring from backup on a reset/modified device results in an error #538

Open qumuq-til opened 3 months ago

qumuq-til commented 3 months ago

Describe the bug

An UAD-ng backup was made just before a factory reset. An attempt was made to restore from this backup after the reset. Due to a certain package missing on the newly-reset device, UAD-ng threw an error and refused to continue.

Expected behavior

UAD-ng should continue restoring the device state even if some packages are missing, possibly with a warning.

You have a solution?

Manually editing the backup's json file to remove the offending package reference allowed the restore to proceed.

Provide logs

ERROR [src/gui/views/settings.rs:173] 2024-07-05_11-03-10 - org.microg.revived.overlay not found for user 0

Acknowledgements

Rudxain commented 3 months ago

It seems the code that logs the error is this: https://github.com/Universal-Debloater-Alliance/universal-android-debloater-next-generation/blob/6c1c530e8e7aa55ef39ffe1922ce14ab50dc9adf/src/core/save.rs#L147-L150

Restoring a pack as "removed" shouldn't error if the pack is already removed, but it should error if we want to enable/install a non-existent pack. I'm unsure if this logic should be handled by apply_pkg_state_commands