Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
5 tasks done
n0-1 opened this issue Nov 23, 2024 · 5 comments
Open
5 tasks done

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

n0-1 opened this issue Nov 23, 2024 · 5 comments

Comments

@n0-1
Copy link

n0-1 commented Nov 23, 2024

Guidelines

  • I have read the FAQ and it doesn't cover the issue.
  • I have searched the issue tracker for open and closed issues that are similar to the feature request I want to file, without success.
  • I'm on the latest version.
  • I'm not using a test build (alpha/beta/release-candidate).
  • 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
Copy link
Author

n0-1 commented Nov 27, 2024

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
Copy link
Author

n0-1 commented Dec 3, 2024

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

@don-dolarson
Copy link

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 runnong Oreo 8.1 to LineageOS 20 / A13.

@n0-1
Copy link
Author

n0-1 commented Dec 23, 2024

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.

@swinokur
Copy link

swinokur commented Dec 29, 2024

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!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants