-
Notifications
You must be signed in to change notification settings - Fork 91
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
Opening txt files from "Recent changes" view does not work #816
Comments
Hi, the problem seems to be the URIs Android expects and prefers since SAF introduction. Syncthing does not access files by URIs (nor FileProvider, nor MediaStore) which causes limits to be effective either from Android side or from the security other app developers believe in (according to google developer docs rooted paths should not be used in intents). |
Your answer is cryptic for me unfortunately. (What is SAF? What is FileProvider? What is MediaStore? ... Too many unknowns) Yet I figured out that I can edit intercepted intent in AppManager in such a way that it becomes reasonable for Markor. Data: and also set MIME type to And voilá! Edited intent opens file in Markor. And this seems to me more in line with the way file managers send intents to open text files. Does it seem reasonable to send |
@Self-Perfection we could at least try to add the content:// prefix "in text form" and hope it gets a little better than now. It depends on Android (version, implementation, restrictions) if that will work, but let's try. |
It's also on F-Droid: https://f-droid.org/en/packages/net.gsantner.markor/ |
@Self-Perfection Please report back if https://github.com/Catfriend1/syncthing-android/releases/tag/v1.17.0.0 solves your problem. Thank you :-). |
I'd like to test this fix, but somehow v 1.17.0 has not yet arrived in F-Droid. |
You could use https://github.com/Catfriend1/syncthing-android/releases/download/v1.17.0.0/com.github.catfriend1.syncthingandroid_github_v1.17.0.0_4e4bce31.apk , for the moment. If the change works, I'll do the F-Droid release when I have some spare time again :). |
I've tested F-Droid build v 1.18.0 and txt files opens as expected. Thank you! |
Cool, thanks for the follow up :) |
Description of the issue
Tapping on an item from "Recent changes" view is expected to open corresponding file in relevant app. But this almost does not work for txt files. Most of the apps can not recognize sent intent. For instance https://github.com/gsantner/markor can not open files from such intents.
I've tried to compare intents that sends Syncthing-Fork with intents of file managers that properly opens text files in all available text editors. https://github.com/MuntashirAkon/AppManager
Synthing-Fork:
Data:
/storage/emulated/0/Notes/todo.txt#Intent;type=text/plain;launchFlags=0x3000001;component=io.github.muntashirakon.AppManager/.intercept.ActivityInterceptor;end
URI:
/storage/emulated/0/Notes/todo.txt#Intent;type=text/plain;launchFlags=0x3000001;component=io.github.muntashirakon.AppManager/.intercept.ActivityInterceptor;end
Another app:
Data:
content://com.simplemobiletools.filemanager.pro.provider/external_files/storage/emulated/0/Notes/todo.txt
URI:
intent://com.simplemobiletools.filemanager.pro.provider/external_files/storage/emulated/0/Notes/todo.txt#Intent;scheme=content;type=text/plain;launchFlags=0x3000001;S.real_file_path_2=%2Fstorage%2Femulated%2F0%2FNotes%2Ftodo.txt;end
There is conspicuous difference. I am not familiar with Android ways but it seems to me that Data and URI most likely should not be identical.
Reproduction Steps
See above.
Version Information
Device platform info
Not collected, I believe irrelevant
Android Log
Not collected, I believe irrelevant
The text was updated successfully, but these errors were encountered: