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

Get rid of FileUtils.getFileDescriptorOwner #2975

Closed
link2xt opened this issue Mar 7, 2024 · 2 comments · Fixed by #2976
Closed

Get rid of FileUtils.getFileDescriptorOwner #2975

link2xt opened this issue Mar 7, 2024 · 2 comments · Fixed by #2976

Comments

@link2xt
Copy link
Contributor

link2xt commented Mar 7, 2024

getFileDescriptorOwner is the last piece of native JNI code taken from Signal. Signal itself does not use it anymore as the last call to it was removed in signalapp/Signal-Android@9bac886
That commit is under GPLv3+ and not AGPL so we can take whatever changes are needed from there.

This getFileDescriptorOwner in jni/utils blocks moving JNI code to a separate package. Once it is done we can revive https://github.com/angelo-fuchs/dc-jni-playground and resolve deltachat-bot/echo#9

Moving JNI code to a separate package will make it possible to upload prebuilds to Maven Central so Android developers and F-Droid will only need to run Gradle to build Delta Chat.

@r10s
Copy link
Member

r10s commented Mar 7, 2024

did some research: the function was introduced in 2016 at signalapp/Signal-Android@f2b81d8 to fix signalapp/Signal-Android#5381

the signal-bug seemed to be introduced shortly before by disallowing file:-uri alltogether.

the fix allows file:-uri unless they are created by the app itself.

tbh, not sure what the idea of that is and if that would affect us at all - we're only creating files in the internal app-space, and there the share-to-delta should not have access at all

@link2xt
Copy link
Contributor Author

link2xt commented Mar 8, 2024

File URLs are probably avoided for security reasons, so other apps cannot "share" to Delta Chat a file URL to its own accounts.toml or other easy-to-guess filename. Smart Voice Recorder is some app that passes file URLs to Signal and they wanted to support it so allowed file URLs as long as they don't point to internal files of the app itself.

we're only creating files in the internal app-space, and there the share-to-delta should not have access at all

The other app does not need to have access to Delta Chat files such as accounts.toml to guess the URL and pass it to Delta Chat.

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

Successfully merging a pull request may close this issue.

2 participants