[HOWTO] use Seedvault early to understand Android backup

Actually that doesn’t seem to be the case. I have been working today with official dev R builds, for z3, z3c, and suzuran (all Sony devices). They do have SeedVault enabled, so long as you do a clean install, and don’t try to restore a Q data backup

To me this looks like you maybe didn’t type the command correctly (adb bmgr enabled by any chance?).

adb shell bmgr enabled in a terminal on a PC with working adb connection to the phone should always print either “true” or “false”

Hmm. So I start my FP2 in the recovery mode (TWRP), then I test:
adb devices - which is successful, I get the phone id. So adb works.
Then adb shell bmgr enabled gives me the output /sbin/sh: bmgr: not found
I tried adb bmgr enabled, which brings up adb: usage: unknown command bmgr

Any more ideas?
Thank you!

The subset of ADB commands TWRP chooses to support works. This is not the fully featured ADB you get when Android is running.

Apart from adb sideload, which requires the recovery to be put into ADB sideload mode, only adb backup and adb restore are documented as far as I see here at “HOST SIDE” … https://twrp.me/faq/openrecoveryscript.html

Apparently adb devices works, too, but notice what it displays apart from the device id. From what I’ve seen …
With Android running it displays “unauthorized” until authorized by the user on the phone, from then on it displays “device”.
With the recovery running it may display “recovery”, if the recovery supports it.
With the recovery running in ADB sideload mode, it should display “sideload”.

And I think if you query features this way, it would give you the features of the recovery, not the features of the installed OS anyway.
So, my guess is that if TWRP would even let you adb shell something like this, you would only find out that TWRP doesn’t have Seedvault.

1 Like

There you have it. :wink:

The commands in the first post need to be executed while the normal OS is booted.

2 Likes

Vielen Dank! You made my day! Now it works!

Well, perhaps I couldn’t make it work as it intented.
For the command adb shell am start-activity com.stevesoltys.seedvault/.settings.SettingsActivity
I got this output:

Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.stevesoltys.seedvault/.settings.SettingsActivity }

Exception occurred while executing 'start-activity':
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.stevesoltys.seedvault/.settings.SettingsActivity } from null (pid=20951, uid=2000) requires com.stevesoltys.seedvault.OPEN_SETTINGS
	at com.android.server.wm.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1043)
	at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:999)
	at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:669)
	at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1105)
	at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1077)
	at com.android.server.am.ActivityManagerService.startActivityAsUserWithFeature(ActivityManagerService.java:3670)
	at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:543)
	at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:185)
	at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98)
	at android.os.ShellCommand.exec(ShellCommand.java:44)
	at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:10514)
	at android.os.Binder.shellCommand(Binder.java:929)
	at android.os.Binder.onTransact(Binder.java:813)
	at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:5053)
	at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2875)
	at android.os.Binder.execTransactInternal(Binder.java:1159)
	at android.os.Binder.execTransact(Binder.java:1123)

Am I guessing right that it doesn’t work? Perhaps @petefoth is right that upgrading from Q to R requires a data wipe (which I didn’t do) in order to make seedvauld work?

If you run R, the seedvault settings are accessible via Settings → System → Backup, at least in the dev build I updated to.

(the instructions in the thread head no longer apply for android11 / R seedvault >2.3 builds, see https://github.com/seedvault-app/seedvault/commit/b2cd3c76a3445066846f42fddfa366934b5ef050 - only if it is an App-debug build no permission to open the settings are needed)

I was recently looking at this on three different devices, all running the latest released v0.21-r dev build, and I found that SeedVault was accessible as you describe immediately after a fresh, clean install (i.e. wiping data befoe flashing the ROM). But if you ‘dirty flashed’ the ROM (i.e. install without wiping data), or if you restore a backup from a Q device, then SeedVault was no longer accessible. I didn’t try restoring a backup from an earlier R build because I ran out of time and motivation. My conclusion is that the availability / accessibility of SeedVault in the R UI is a bit random :slight_smile:

I would be interested to know what the availability is supposed to be, but I haven’t yet managed to find any requirements documentation for /e/OS :wink:

1 Like

Perhaps @Manoj could point us in the right direction? Do you know about it?

We still have to resolve some open issues with the Seedvault integration and implementation

1 Like

As far as I know the restore dialog is supposed (by the seedvault developers) to be incorporated into the first-time setup wizard.

That makes a lot of sense. LOS (and Google) ROMs offer the “Restore from backup (or another phone)” during first-time setup wizard (so it would also be offered after a data wipe / factory reset. But it is also possible to access the backup functionality at any time. This didn’t seem to be possible in the /e/ R ROMs I was looking at. I may do some more digging when I have the time

1 Like

I was browsing Calyx Repositories today and saw mid-may work on making D2D backups possible in A12. Once /e/ focuses on the next Android version Seedvault finally can be a complete backup solution for the mere mortals.

5 Likes

Hey,

I’ve just picked up this topic and try to enable SeedVault on my device.
It is a Samsung Galaxy A5 (2017) running /e/ OS Version 1.6-r-20221201239576-dev-a5y17lte.

Background:

As this is a non-rooted device (first time for me in several years), I am looking for an actually usable backup solution. Before I just rooted and used oandbackup or NeoBackup when a new phone had arrived.

This way is blocked now for me so I need another option before my phone needs to be replaced.

Following the HowTo I get an exception at this step:

Is this user error or did I miss something I should have done in advance?

mkamp@steiger ~> adb shell am start-activity com.stevesoltys.seedvault/.settings.SettingsActivity
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.stevesoltys.seedvault/.settings.SettingsActivity }

Exception occurred while executing 'start-activity':
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.stevesoltys.seedvault/.settings.SettingsActivity } from null (pid=27234, uid=2000) requires com.stevesoltys.seedvault.OPEN_SETTINGS
        at com.android.server.wm.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1043)
        at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:999)
        at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:669)
        at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1105)
        at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1077)
        at com.android.server.am.ActivityManagerService.startActivityAsUserWithFeature(ActivityManagerService.java:3670)
        at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:543)
        at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:185)
        at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98)
        at android.os.ShellCommand.exec(ShellCommand.java:44)
        at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:10514)
        at android.os.Binder.shellCommand(Binder.java:929)
        at android.os.Binder.onTransact(Binder.java:813)
        at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:5053)
        at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2875)
        at android.os.Binder.execTransactInternal(Binder.java:1159)
        at android.os.Binder.execTransact(Binder.java:1123)

should be this one a bit up the thread

Only debug versions allow it without root. Isn’t the menu item “Backup” available? If not start from adb root

2 Likes

Thank you for the explanation. I think I have to look more deeply into seedvault and re-read this thread a few times to get it :slight_smile:
On my phone, “Backup” is not visible in the system settings GUI. Can you elaborate what you mean by “start from adb root”?

Can I use seedvault from the adb shell to backup single apks with data to my (linux) pc? I think that would be a viable solution for me, I’ll just have to learn a bit more to get comfortable :smile:

1 Like

let’s bump this thread, now that the d2d-transfer feature is implemented and released in version 14-4.0. The initial 2021 top post links a gitlab issue tracking / explaining what d2d is.

When /e/ gets to Android 14 (or backports to A13) and updates the 3 year old shipped Seedvault apk to or past that, users can have a more complete backup solution without any shell affinity or root privileges.

https://github.com/seedvault-app/seedvault/blob/9c4f9d8a67a8091a571d9805ee4bcfd04344c300/CHANGELOG.md#14-40---2024-01-24

  • Add experimental support for forcing “D2D” transfer backups
  • Pretend to be a device-to-device transfer to allow backing up many apps which prevent backup
3 Likes

That would be great. Than I no longer have to depend to third party backup solutions.

Do you have any idea what would be involved in porting to A13?

Is here any chance that /e/ will work on that, or will they just wait for Android 14? (In the past, issues relating to SeedVault haven’t got a lot of attention from /e/)

1 Like