Neo-Backup icon indicating copy to clipboard operation
Neo-Backup copied to clipboard

[Bug] Can't restore Android 9 backup on Android 13

Open n0-1 opened this issue 1 year ago • 8 comments

Guidelines

  • [X] I have read the FAQ and it doesn't cover the issue.
  • [X] I have searched the issue tracker for open and closed issues that are similar to the feature request I want to file, without success.
  • [X] I'm on the latest version.
  • [X] I'm not using a test build (alpha/beta/release-candidate).
  • [X] This issue contains only one bug.

Describe the bug

  1. Install NeoBackup 8.3.8 into Android 9 with Magisk
  2. Backup some apps including data
  3. Copy backup directory to new phone
  4. Install NeoBackup 8.3.8 into Android 13 with Magisk
  5. Try to restore app and data
  6. Experience endlessly running restore process

Expected Behavior

Same behaviour as when backing up, removing and restoring the same app+data on either of the devices.

Neo Backup's Version

8.3.8

Installation Source

Official F-Droid repo

Last Known Working Version

No response

Relevant information

  • Device: Ph-1 -> Fairphone 5
  • Android Version: 9 -> 13
  • ROM: Stock -> Stock

Restore works for app only. Comparing properties files, the only thing that caught my eye was different sourceDir properties. While the Android 9 backup has: "sourceDir": "/data/app/com.fsck.k9-<base64string>==/base.apk" the Android 13 backup has: "sourceDir": "/data/app/~~<base64string?>==/com.fsck.k9-<base64string>==/base.apk"

n0-1 avatar Nov 23 '24 20:11 n0-1

So I just retried and now I got an error: RestoreAppAction$RestoreFailedException: directory '/data/user/0/com.fsck.k9' does not exist Validated via in-app terminal: --- # ls /data/user/0 => ok com.machiav3lli.backup So I hit the back button, see a magisk notification about root permission being granted by magisk to NB, then retry above command in terminal and see a long list. Maybe this is a heisenbug and ls output depends on whether NB just requested root permissions or not, but the restore failure is not.

Assuming the "never ending restore" behaviour is what happens if the missing root permissions issue described above does not happen. I'll therefore attach a log from while restore process is running (and not ending), maybe someone can spot the problem. Apart from that I'd appreciate any hints on how to debug the issue further. NeoBackup.txt

n0-1 avatar Nov 27 '24 00:11 n0-1

Do you support backup/restore between Android 9 and 13 at all?

n0-1 avatar Dec 03 '24 20:12 n0-1

Do you support backup/restore between Android 9 and 13 at all?

I may not be the right person to answer this but I believe it is. Myself I successfully restored apps from OxygenOS running Oreo 8.1 to LineageOS 20 / A13.

don-dolarson avatar Dec 15 '24 23:12 don-dolarson

Thanks for your reply, @don-dolarson - the radio silence from anyone involved in development is not the best sign.

It looks like I found a solution, though: When trying to give version 8.3.10 a try, I hit a dead end on Android 9, got an exception about nsenter command not being found. In order to update from 8.3.9 I had to deinstall the old version first (probably I installed from Github - either way, fdroid installer wasn't happy about the package signature) before installing from fdroid. Then I noticed 8.3.9 isn't available in fdroid to begin with, so I downgraded to 8.3.8 instead. Et voilà, backups created with this version successfully restore in Android 13 (either 8.3.9 or 8.3.10).

I'll leave this one open for anyone involved in the project to confirm or clarify.

n0-1 avatar Dec 23 '24 17:12 n0-1

I've just updated from 8.3.8 to 8.3.10 on Android 9 and I can confirm that there's a nsenter issue -- i can't perform any backup actions (I haven't tried restoring anything).

I imagine that 'sucommand' needs to change on Android 9 to something other than su -c 'nsenter --mount=/proc/1/ns/mnt sh' ?

Edited to add - I went into settings -> advanced and change sucommand from the default to: su --mount-master I did a backup and then had a look with mixplorer and it appears that the backups are intact.

I'm not sure if this is the right way to workaround this issue, it'd be great to see a bug fix that makes current versions fall back to proper sucommand based on their android version... (Please let me know if I should file a separate issue!)

swinokur avatar Dec 29 '24 05:12 swinokur

Also hit by the 'nsenter' thing.

Neo Backup: 8.3.10 Device: Moto G5s Plus sanders ROM: Validus Android: 8.1.0 Root: Magisk Delta (Kitsune) 26.4

Instead of changing the suCommand I decided to see what happens when I toggle off 'LibsuUseRootShell'. That worked. Backups and restores were successful.

So it seems either workaround is valid(?). Still considering downgrading until I learn more about what's going on.

marcdw1289 avatar Jan 10 '25 01:01 marcdw1289

@swinokur, @marcdw1289 and anyone following: Please stop hijacking this ticket! The nsenter issue was merely a side-effect. Please file a dedicated ticket tracking the problem.

n0-1 avatar Jan 15 '25 14:01 n0-1

@swinokur & @marcdw1289 thanks for investigating the nsenter thingy, I'll move the "LibsuUseRootShell" to service and note that it's needed on Android 9.

@n0-1 8.3.9 does indeed include some changes on the backend front (mainly to accomodate for the added logic of plugins/extensions), but am not sure to what extent this would touch upon the restore process specifcally between A9 and A13. In the community group there was multiple conformation that restoring from A8/A9 worked fine on A13/A14/A15. So to me at least it's still a mysterious.

the radio silence from anyone involved in development is not the best sign

It's normal if we have nothing to say or ask. It's just there is/was more pressing and clearer issues. Also, I rotate work on the multiple Neo projects.

machiav3lli avatar Jan 16 '25 09:01 machiav3lli

Late update:

You can install busybox with selinux support and it should contain nsenter applet. meefik's busybox had this since 2018. osmOsis made busybox-ndk which supports systemless installation through magisk also supports it. If you don't want to install/symlink, you can also use command:

su -c '/sdcard/bin/busybox nsenter --mount=/proc/1/ns/mnt sh'

where busybox binary is copied to /sdcard/bin directory

https://github.com/NeoApplications/Neo-Backup/issues/940#issuecomment-3166562827

sheikhmishar avatar Aug 31 '25 14:08 sheikhmishar