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

Backup and Restore apps fail on Android 10 GSI with it's root system. #1214

Closed
fourofspades opened this issue Mar 30, 2020 · 4 comments
Closed

Comments

@fourofspades
Copy link

SwiftBackup fails to restore any application, regardless of it it's APK or Split APK
Titanium hangs (but carries on if you install APK manually) when it comes across Split APKs.

Other root solutions work correctly, Titanium isn't suppored anymore, and Swift Backup blame the root solution in the GSI, and say "just use Magisk, it works...".

here is the error code from Swift Backup, which may (or may not) help:

29/03/2020 12:32:44.085/AppRestoreTask: <Error: failed to write; fstat failed: EACCES (Permission denied),Failure [INSTALL_PARSE_FAILED_NOT_APK: Failed to parse /data/app/vmdl696138929.tmp/base]>
29/03/2020 12:32:44.100/AppRestoreManager: Performing post-restore tasks
29/03/2020 12:32:44.525/TaskService: Complete
29/03/2020 12:32:44.528/TaskNotificationHelper: <1 app(s) failed to restore

phhusson added a commit to phhusson/device_phh_treble that referenced this issue Mar 30, 2020
@phhusson
Copy link
Owner

phhusson commented Mar 30, 2020

In my opinion, if they tell you to handle that yourself, you shouldn't be paying for their solution.
Also, the behaviour of their app is extremely shitty. I would almost say malware-ish.. It opens 4 SU connections without needing it, and does a lot of shit on it.

Looking at a strace, the command that fails is:
cat /storage/emulated/0/SwiftBackup/accounts/xxx/yyy/.....app | pm install-write -S $APK_SIZE SESSION base

This is honestly ridiculous, and shows they don't know what they're doing.
they should be doing pm install-write ... /data/media/0/SwiftBackup/.... and things would just work smoothly

But since they don't know much about Android, they used /storage/emulated, which system_server isn't allowed to access.
But hey, they tricked the system by using a cat and a pipe instead, so the issue is about reading from a phhsu_daemon pipe, so that's something actually wrong on my side too.

Way to reproduce this issue:
cd /storage/emulated/0; cat base.apk | pm install -S $(stat -c '%s' base.apk) -- -

Way to circumvent the issue:
echo '(allow system_server phhsu_daemon (fifo_file (getattr)))' >> /system/etc/selinux/plat_sepolicy.cil

Also I commited an untested fix (though i'm pretty confident about it)

@fourofspades
Copy link
Author

I got a full refund :-) they were fine about it, but yes, the "support" response was very self righteous, it wasn't a problem with their product, someone elses problem...

@fourofspades
Copy link
Author

Tested the change and restore of APK now works correctly. Thanks for looking into this. Being able to backup and restore data quickly and reliably allows me to switch to newer builds and try out other fixes and such.

@fourofspades
Copy link
Author

Confirmed working in v215

sooti pushed a commit to aosp-tissot/device_phh_treble that referenced this issue Jul 4, 2020
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

2 participants