Closed soupslurpr closed 10 months ago
Did some tests, passing file descriptors (and temp_dir which isn't used anywhere just relevant) only works without isolatedProcess.
So I don't think doing this would be practical as it would require rewriting most of the Typst integration to not use file descriptors and instead accept/return Strings and Vec
If anyone knows of some other way or thing I am missing, please comment here.
I'm looking into the solution I proposed...
Never mind, it is possible but that doesn't mean it should be implemented. It would mean that all the files in a folder would have to be loaded into memory twice instead of the current way of loading files as it needs them.
Would be cool if isolated process services could be granted permissions so I could just do that but oh well...
Wait never mind (again lol), it seems it can access file descriptors if I pass a ParcelFileDescriptor and detatch it in the isolatedProcess service before passing the file descriptor to Rust.
This will enhance security.
https://developer.android.com/guide/topics/manifest/service-element#:~:text=element%27s%20icon%20attribute.-,android%3AisolatedProcess,-If%20set%20to
Last time I tried, Typst seemed to need access to /tmp but couldn't (due to being in isolatedProcess I presume) and it failed with a JNA error.