mrrfv / open-android-backup

Back up your device without vendor lock-ins, using insecure software or root. Supports encryption and compression out of the box. Works cross-platform.
http://openandroidbackup.me/
GNU General Public License v3.0
674 stars 37 forks source link

[Question] Does this backup applications' data too? #70

Closed billy4479 closed 11 months ago

billy4479 commented 11 months ago

I've read that the script backs up apks but it's not clear whether or not it also saves the data associated with the app (something along the lines of what Titanium Backup or NeoBackup do).

If it's not implement yet it would be a nice feature to have :)

mrrfv commented 11 months ago

It's not possible to backup app data without root or having a privileged system app do that for you. This script doesn't need root and never will (primarily because lots of manufacturers are making it very hard to unlock your phone without losing important features), so this won't be changed.

I believe this isn't as bad as it sounds, because most modern apps automatically do cloud syncing, and those that don't let you backup their data locally.

Hooks can be used to add this feature regardless, but no one has attempted doing that yet.

billy4479 commented 11 months ago

I see. Thank you for the explanation, I might try to look into writing one if I find the time. Thanks for your work on this project :)

Victor239 commented 8 months ago

@mrrfv would Shizuku offer sufficient permissions to enable app data backup? A lot of root-only apps I've seen also support that as an alternative now.

mrrfv commented 8 months ago

Hmm, possibly? It looks like it could work. I'll do some experimentation with that next week or so. Thank you for the suggestion.

billy4479 commented 8 months ago

I'm not an android developer but from my understanding it's not possible.

Shizuko works with adb permissions (if I understand correctly) and adb is not able to read /data/data/* so I doubt it will be possible. On the other hand using adb root you are able to read /data/data/* but I suspect this is available to me only because my device is rooted and I don't think adb root is available to the general user.

Again, I'm not an expert but I doubt Shizuko will be enough. I'll be happy to be proven wrong though :)

JordanPlayz158 commented 5 months ago

I just made a hook for this, root is required but it checks for root access (if adb root succeeds) and proceeds if so, just tested backup, restore not tested, I only have the one rooted device and I am not a bash professional so it may not be perfect but it works on my phone but if there are things that can be improved, please let me know and I'll look into them https://github.com/JordanPlayz158/open-android-backup-app-data-hook/blob/master/app-data-root-hook.sh

billy4479 commented 5 months ago

https://github.com/JordanPlayz158/open-android-backup-app-data-hook/blob/master/app-data-root-hook.sh

Very cool! I'm glad somebody put in the effort into writing this, thank you!

I haven't tested it yet, but I think I might have been imprecise in my previous comments (sorry :/): apparently application's data is stored in more than one location and /data/data is only one of them. I found a nice list of these locations in the NeoBackup FAQ with the explanation of what data is inside them. It would be nice to add them to the hook too :)

That's very awesome though :D

JordanPlayz158 commented 5 months ago

Ah, I see, won't be too hard to add a few more get_file and adb push calls, the only thing with external storage like sd cards, I don't believe the location is consistent or? I know mine, rather than being at /sdcard (which seems to be internal weirdly enough), it is actually under /storage/8262-10FC and that name looks more unique than static so may be difficult on that front unless it has a pattern like XXXX-XXAA where X are numbers and A are capital letters A-Z

billy4479 commented 5 months ago

I don't believe the location is consistent or?

Mhh, I don't know about this one.. I don't use a sdcard, we should probably do some tests to figure out the correct path

JordanPlayz158 commented 5 months ago

Oh yeah, also, I tested the restore functionality, must've missed something, the data is in the proper places but the apps don't know they have been run before so their state is not stored so they don't look for existing data

maricn commented 2 months ago

any news on the Shizuku integration, that would be a cool one (probably deserves its own issue)?

Fatih120 commented 1 week ago

Please excuse my ignorance, but doesn't adb backup save application data? I could swear that I have managed to obtain data in this way but maybe I am strongly misinformed on how it works.

https://gist.github.com/AnatomicJC/e773dd55ae60ab0b2d6dd2351eb977c1

That, or we're just avoiding comparisons to adb backup and not trying to replace it with OAB.

billy4479 commented 1 week ago

I'm quite sure adb backup is deprecated and no longer works on modern android versions.