Closed cweiske closed 7 years ago
I cannot tell about Android 7 – but I've just upgraded an device from 5 (CM 12) to 6 (LOS 13) last weekend (and in the past from previous versions as well) and had no issues with the restore. Not that Adebar had any influence at that, as it only creates the script. And I've not heard the syntax of adb restore
had changed with Android 7.
I assume, though you only stated having made the backup, you've also run the restore, right? Have you tried restoring a single backup manually (adb restore file.ab
)?
Yes, I tried restoring several single apps.
On some apps, I don't even get asked the "do you want to restore" question, on some I do. But afterwards - the app is not installed, and if I installed the app manually via f-droid, the data are not there either, and the app behaves as if installed freshly.
Ok, I used adb logcat
to get further info. Here for restoring conversations:
BackupManagerService: Sig + version match; taking data
BackupManagerService: apk present but ACCEPT
BackupManagerService: [discarding file content]
BackupManagerService: Need to launch agent for eu.siacs.conversations
BackupManagerService: Clearing app data preparatory to full restore
ActivityManager: Force stopping eu.siacs.conversations appid=10073 user=0: clear data
ActivityManager: Force stopping eu.siacs.conversations appid=10073 user=-1: clearApplicationUserData
NlpPackageReceiver: Intent received: Intent { act=android.intent.action.PACKAGE_RESTARTED dat=package:eu.siacs.conversations flg=0x10 cmp=com.google.android.gms/org.microg.nlp.PackageReceiver (has extras) }
ActivityManager: Start proc 18444:eu.siacs.conversations/u0a73 for backup android/FullBackupAgent
BackupManagerService: awaiting agent for ApplicationInfo{5f4b349 eu.siacs.conversations}
System : ClassLoader referenced unknown path: /data/app/eu.siacs.conversations-1/lib/arm64
BackupManagerService: agentConnected pkg=eu.siacs.conversations agent=android.os.BinderProxy@6e4aa2f
BackupManagerService: got agent android.app.IBackupAgent$Stub$Proxy@a90f83c
BackupManagerService: Invoking agent to restore file app_KeyStore
VoldConnector: SND -> {16 volume mkdirs /storage/emulated/0/Android/data/eu.siacs.conversations/files/}
VoldConnector: RCV <- {200 16 Command succeeded}
BackupManagerService: Reusing existing agent instance
BackupManagerService: Invoking agent to restore file avatars
BackupManagerService: Reusing existing agent instance
BackupManagerService: Invoking agent to restore file avatars/8f3071ad33c5f4681617824d1c277d65f0260a01
BackupManagerService: Reusing existing agent instance
BackupManagerService: Invoking agent to restore file avatars/1629b317a4564aebb964a8e10aad5bcf1b32bfd8
BackupManagerService: Reusing existing agent instance
BackupManagerService: Invoking agent to restore file avatars/fd7fc65a76e5089f29af7bd04ed528a24002a062
BackupManagerService: Reusing existing agent instance
BackupManagerService: Invoking agent to restore file avatars/7fba3c3172a2b933a11e585632e43be1e28c1e55
BackupManagerService: Reusing existing agent instance
BackupManagerService: Invoking agent to restore file avatars/4a1e0f2eba0ecb876f5e4c99bc51372dca790906
BackupManagerService: Reusing existing agent instance
BackupManagerService: Invoking agent to restore file avatars/9f9e3718a1749a4c9c9f0a0d67649ccc0ac4647f
BackupManagerService: Reusing existing agent instance
BackupManagerService: Invoking agent to restore file avatars/ad22c9ff34efea3f40bf3cef69cf73f02ec5922d
BackupManagerService: Reusing existing agent instance
BackupManagerService: Invoking agent to restore file avatars/ca96d61cad07793c676fd63d931467a6b594cd1a
BackupManagerService: Reusing existing agent instance
BackupManagerService: Invoking agent to restore file history-journal
BackupManagerService: Reusing existing agent instance
BackupManagerService: Invoking agent to restore file history
BackupManagerService: io exception on restore socket read
BackupManagerService: java.io.IOException: read failed: EIO (I/O error)
BackupManagerService: at libcore.io.IoBridge.read(IoBridge.java:481)
BackupManagerService: at java.io.FileInputStream.read(FileInputStream.java:252)
BackupManagerService: at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:243)
BackupManagerService: at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
BackupManagerService: at com.android.server.backup.BackupManagerService$PerformAdbRestoreTask.restoreOneFile(BackupManagerService.java:7056)
BackupManagerService: at com.android.server.backup.BackupManagerService$PerformAdbRestoreTask.run(BackupManagerService.java:6701)
BackupManagerService: at java.lang.Thread.run(Thread.java:761)
BackupManagerService: Caused by: android.system.ErrnoException: read failed: EIO (I/O error)
BackupManagerService: at libcore.io.Posix.readBytes(Native Method)
BackupManagerService: at libcore.io.Posix.read(Posix.java:169)
BackupManagerService: at libcore.io.BlockGuardOs.read(BlockGuardOs.java:231)
BackupManagerService: at libcore.io.IoBridge.read(IoBridge.java:471)
BackupManagerService: ... 6 more
FullBackup: Incomplete read: expected 132843 but got 309525
BackupManagerService: Killing host process
BackupManagerService: Full restore processing complete.
BackupManagerService: Full restore pass complete.
Process : Sending signal. PID: 18444 SIG: 9
lowmemorykiller: Error writing /proc/18444/oom_score_adj; errno=22
ActivityManager: Process eu.siacs.conversations (pid 18444) has died
ActivityManager: cleanUpApplicationRecord -- 18444
This has nothing to do with adebar, so I'm closing this.
Restoring some apps does not even show the restoration confirmation screen on the phone, and nothing happens in the android logs then.
No idea what that should be, and I cannot test it as I have no Android 7. It's also nothing Adebar can fix.
One thought, though: the size of the backup file is looking OK – not 0 or 41 byte files? The latter happens if an app has "opted out" of backups (devs can do that), but I doubt it would affect all your apps.
Also, what happens if you install the app via F-Droid, then back that up again, uninstall it, and try restoring the backup? If that doesn't work either (and the file is not 0 or 41 byte), it might be rather a bug in your ROM. I remember having had that once with a device, where all adb restore
attempts failed. Would need to dig for the solution (it was in the Android 4.1 era, so quite a while ago) – but AFAIR it required to replace the buggy adbd
binary (on the device) which again requires root.
Oh, our edits just crossed – see you found something similar. Looks like that belongs into the LOS issue tracker then. Good luck – and sorry that I could not help more.
I tried what you said: Backing up conversations on Android 7, uninstalling it and restoring it .. and it failed.
BackupManagerService: io exception on restore socket read
BackupManagerService: java.io.EOFException: Unexpected end of ZLIB input stream
BackupManagerService: at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:245)
BackupManagerService: at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
BackupManagerService: at com.android.server.backup.BackupManagerService$PerformAdbRestoreTask.restoreOneFile(BackupManagerService.java:7104)
BackupManagerService: at com.android.server.backup.BackupManagerService$PerformAdbRestoreTask.run(BackupManagerService.java:6701)
BackupManagerService: at java.lang.Thread.run(Thread.java:761)
I'll talk with the LineageOS people -> https://jira.lineageos.org/browse/BUGBASH-1241
OK, that's the final proof of the culprit (after your previous log, I already guessed that). So yes, you best report it to LOS and hope for an update fixing it. I'd be interested to know what they found and what the fix is, though, as it might happen with other ROMs as well (as I wrote, I had it on some stock ROM back then) – so if you'd update this issue then, that'd be great and thanks in advance!
Good luck meanwhile!
@cweiske Now I join you with the problem (different device, though). What's worth, even apps backed up on the very same Android-7 system (if successful) fail to restore. While I've seen you gave up on restoring Android-6 backups: Did you have any success lateron? I hesitate upgrading my Swift (which still runs CyanogenOS as shipped by Wilefox). Searching on the issue turns up several users reporting this for different devices, but no solutions. But for some folks it simply works on Nougat, so there must be some trick.
Still, nothing to do with Adebar; I did the backup/failed-restore manually.
No, I did not try to use adb restore
after I reinstalled my phone.
@cweiske Now you can. In the tools/
directory you'll find a new script named abrestore
which will work around the adb restore
bug.
For some background: logcat
didn't give a clue about what really went wrong. BackupManagerService failed installing the *.apk
file without reporting that. So the trick is to first install that (adb install
), and then restoring the backup. Tested, worked for me (on the X5 Pro; my Swift still runs on MM and doesn't have this issue). So what abrestore
does is extracting the *.apk
from the backup archive, installing it, and then restoring the backup archive. Currently it doesn't delete the *.apk
afterwards; I will add that later when having used it a little longer.
Still wondering why adb backup -apk com.foobar
sometimes fails even if an app allows backups. For one app I saw it worked after I manually started the app on the device. But others report it failing half the time …
LOL… Just checked this again. Looks like the LOS folks just suppressed the error messages now. One from your output I found especially funny:
FullBackup: Incomplete read: expected 132843 but got 309525
So they call it incomplete if they get 3 times the expected size?
Now I'm curious whether that might be solved in LOS 15 …
I upgraded from CyanogenMod 13 (Android 6) to LineageOS 14 (Android 7). Before upgrading, I did a backup of all system and user apps with adebar.
Restoring the apps on Android 7 fails. None of the ~30 applications show their icon in the app menu, even after rebooting.
Is it even possible to restore those apps after such an upgrade? Or is that only possible on the same android version?