celzero / rethink-app

DNS over HTTPS / DNS over Tor / DNSCrypt client, WireGuard proxifier, firewall, and connection tracker for Android.
https://rethinkfirewall.com/
Apache License 2.0
3.01k stars 154 forks source link

Restore from prior backup loses settings after an app is reinstalled #1407

Open issuex opened 6 months ago

issuex commented 6 months ago

In v0.5.5h backup & restore still broken i lost all config after restore, stil not understand why you rely on uid. i just test the app by

Backup > remove some app and reinstall it > Restore

uid of the app was change, seem like it make restore rule to wrong app, some config lost.

if you use it in real life, and one day you change mobile, you will know why Backup&Restore so importance.

ignoramous commented 6 months ago

Thanks, we will take a look.

why you rely on uid.

Rethink doesn't rely on "uid" anymore for restores.

issuex commented 6 months ago
ignoramous commented 6 months ago

why i still see uid link to domain rule and ip rule in backup file.

Those are not prescriptive. If you're technical enough, review: https://github.com/celzero/rethink-app/blob/7df385354b7a16ce1ac5e651ad59521372d4fdd0/app/src/main/java/com/celzero/bravedns/database/RefreshDatabase.kt#L116-L204

the backup after restore the previous backup, in db file CustomDomain table was gone, CustomIp table was gone.

Sounds like it was a botched migration (this is something we don't control and is implemented by "Room", a library by Google). Does retrying restoring from the same backup work?

have some app in work profile , can cause restore fail ?

May be. We don't test Rethink with Work Profiles, and so, are unaware of what bugs lurk (though, we do encourage bug reports on Rethink + Work Profile): #150

Are the Work Profile apps the only ones that did not restore? If you're comfortable, can you email the backup file to me: mz at celzero dot com (no pressure)?