holochain / holochain/android-service-runtime
Consider using AppBundleSource::Path to reference .happ file rather than shared memory and AppBundleSource::Bytes
- Dominant language
- Rust
- Stars
- 4
- Forks
- 2
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 3
Description
See https://github.com/holochain/android-service-runtime/pull/65#discussion_r2030732399
Yes it would be possible to use Path, but I think the implementation ends up slightly more complicated for minimal benefit.
The complication arises from android apps having their own personal storage directories, and referencing files via Content URIs rather than file paths.
The approach would be:
- client app writes happ bytes to a file in their app storage, generates Content URI for that file
- client app grants read permissions for that Content URI to android-service-runtime app
- client app calls installApp on android-service-runtime app via IPC, passing in the Content URI in the parameters
- android-service-runtime app reads file from Content URI
- android-service-runtime constructs actual `AppInstallPayloadFfi` using bytes read from file
The potential benefits of using Path would be:
- Don't need to store .happ again in memory, instead it is stored again on disk
- Explicitly grant permission to *only* the android-service-runtime app to read the .happ bytes, instead of putting them in shared memory where any process could read them
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.