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
751 stars 40 forks source link

Android 13 support #53

Closed dodancs closed 1 year ago

dodancs commented 1 year ago

Device info

Manufacturer: OnePlus Android version: 13 Custom ROM/rooted: no/no Model: 8 Pro

System info

Available disk space: a lot Operating system: Ubuntu 22.04


I am unable to back up my Android 13 device. Before I begin explaining why, I came across an additional issue where the backup.sh script won't display anything in the console when running via WezTerm:

image

Anyway, back to the actual issue. So I launch the script, connect my phone, pair successfully, tell it to "Backup", then it tries to install the companion app, which gets installed successfully, but after that it wants to grant it some permissions, but they are not applied:

Exception occurred while executing 'grant':
java.lang.SecurityException: grantRuntimePermission: Neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS.
    at android.app.ContextImpl.enforce(ContextImpl.java:2253)
    at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:2281)
    at com.android.server.pm.permission.PermissionManagerServiceImpl.grantRuntimePermissionInternal(PermissionManagerServiceImpl.java:1364)
    at com.android.server.pm.permission.PermissionManagerServiceImpl.grantRuntimePermission(PermissionManagerServiceImpl.java:1346)
    at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:553)
    at android.permission.PermissionManager.grantRuntimePermission(PermissionManager.java:597)
    at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:2591)
    at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:302)
    at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
    at android.os.ShellCommand.exec(ShellCommand.java:38)
    at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onShellCommand(PackageManagerService.java:6341)
    at android.os.Binder.shellCommand(Binder.java:1073)
    at android.os.Binder.onTransact(Binder.java:901)
    at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4313)
    at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onTransact(PackageManagerService.java:6325)
    at android.os.Binder.execTransactInternal(Binder.java:1331)
    at android.os.Binder.execTransact(Binder.java:1268)

Then it asks me to press the "Export Data" button in the companion app that is opened automatically, and that results in: "Storage, SMS or contacts permissions have not been granted". When I first clicked the button, it asked me to give some contact reading permissions to the app and I allowed them. It still spits this error.

But it seems like the rest of the thing goes okay. It started to copy over some app data. I can see the status with PV:

Attempting to uninstall companion app.
Exporting apps.
Backing up app: com.reader.books
27,2MiB 0:00:01 [24,8MiB/s] [    <=>                                                                                                           ]
Backing up app: com.teamspeak.ts3client
35,5MiB 0:00:01 [27,8MiB/s] [    <=>                                                                                                           ]

Then this happened:

Exporting contacts (as vCard) and SMS messages (as CSV).
0,00 B 0:00:00 [0,00 B/s] [<=>                                                                                                                 ]
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
Errors occurred while backing up . - this file (or multiple files) might've been ignored.
mv: cannot stat './backup-tmp/Contacts/SMS_Messages.csv': No such file or directory

Can you please add support for Android 13?

dodancs commented 1 year ago

Screenshot_2023-03-07-15-19-58-14_ab1359306de43320f9557c797b1c4be5.jpg

Screenshot_2023-03-07-15-20-05-81_ab1359306de43320f9557c797b1c4be5.jpg

Here are some screenshots from the settings on the companion app's permissions.

mrrfv commented 1 year ago

This sounds like an issue with the Android skin OnePlus is using on their phones, because searching for the error online brings up this answer/fix on StackExchange that apparently works on Oppo devices (Oppo merged with OnePlus if I remember correctly). Could you try disabling "Check apps installed via USB" as instructed in the answer? Please remember to write back if the fix worked.

OXDBXKXO commented 1 year ago

I'm on Pixel 7 running CalyxOS, I'm having the same issue (Storage access permission not shown). The fix does not work for this issue :/

mrrfv commented 1 year ago

@OXDBXKXO This issue is related to Oppo devices, and I assume that it's been solved because the author hasn't responded. Please report this under #55.

mrrfv commented 1 year ago

Closed due to inactivity