orgro
orgro copied to clipboard
Orgro appears as handler for non-Org files/links on Android
The program tries to open EPS files. It opens them as text files. For example, Gmail could show these files in emails, but after installations of ORGRO the files are opened by ORGRO as text files. It would be fine if ORGRO could show EPS files, but if it can not, it would be better not to try to.
Thanks for the report. Can you tell me what OS you're using? Because there are various limitations and workarounds I've had to put in on both Android and iOS.
For context.. Orgro supports text files only. But it comes as an option in the "Open with" window of the system, no matter what type of file it is.
https://user-images.githubusercontent.com/58824912/160250727-0c8bbdcd-17bc-4335-901b-ee4362363adb.mp4
Edit: I'm on OneUI 4.0, Android 12, Samsung. But I'm very sure that this used to happen on my old xiaomi as well so this issue must not be device dependent.
I never heard back from @YuriySharlai, but I will assume this is Android-specific.
The reason Orgro shows up as a handler for lots of things is because it seems that otherwise it will not show up at all when trying to open files from the file browser.
The relevant code was introduced in https://github.com/amake/orgro/commit/24d125c73cb66c29c9996ac93f0988f9c0b78994; it was based on this information.
Reading other, newer answers on that StackOverflow question, it seems that not much has changed in the meantime.
If there is a way to prevent Orgro from showing up when not appropriate, while still showing up when appropriate, then I would love to do that. But at the moment I don't know how.
Hey I managed to get something working.
I replaced a line in one of the intent filters in the manifest file.
I changed it to this:
<data android:mimeType="application/org" />
I tested the modified debug one and the normal f-droid release. The file manager all-file-showing-up problem is gone in the debug one. You may want to test this change.
Org files do not have a widely recognized MIME type. The official web site claims text/org
, which shared-mime-info agrees with, but that's not officially registered, so it should be text/x-org
. It should probably not be application/org
.
Regardless, Android (and other OSes, as far as I know) does not automatically understand .org files to be any particular MIME type, and it seems there's no way to teach the OS about it.
I have two <intent-filter>
blocks that specify mimeType
:
-
This one: If I change this to
text/org
,text/x-org
, or eventext/*
, I break opening .org files from the built-in Files app or Google Drive, .org attachments in Gmail, etc. - This one: This is supposedly only for apps that set a zero-length MIME type in their intent. Changing this doesn't seem to have any effect on anything, even ES File Manager which is called out by name as such an app (things must have changed).
So it sounds like actually all you did was break opening .org files via intent.
Here are the intents I tested:
-
Gmail
Intent { act=android.intent.action.VIEW dat=content://com.google.android.gm.sapi/[email protected]/message_attachment_external/#thread-f:1773980045848572456/#msg-f:1773980045848572456/0.0?account_type=com.google&mimeType=application/octet-stream&rendition=1 typ=application/octet-stream flg=0x13080001 cmp=com.madlonkay.orgro.debug/com.madlonkay.orgro.MainActivity }
-
Google Drive
Intent { act=android.intent.action.VIEW dat=content://com.google.android.apps.docs.storage.legacy/enc=encoded=BsdM6DwhbLvgl4CcYbhdRy-NsmPwCvn3L-3MgKq0XO-Z9OfCuX-nCbE= typ=application/octet-stream flg=0x13080003 cmp=com.madlonkay.orgro.debug/com.madlonkay.orgro.MainActivity (has extras) }
-
Files app (Pixel 2 / Android 11)
Intent { act=android.intent.action.VIEW dat=content://com.google.android.apps.nbu.files.provider/1/file:///storage/emulated/0/Documents/amk/custom-fonts.org typ= flg=0x3000001 cmp=com.madlonkay.orgro.debug/com.madlonkay.orgro.MainActivity }
-
EX File Manager
Intent { act=android.intent.action.VIEW dat=content://com.ace.ex.file.manager.files/storage/emulated/0/Download/notes.org typ=*/* flg=0x10400000 cmp=com.madlonkay.orgro.debug/com.madlonkay.orgro.MainActivity }
So it sounds like actually all you did was break opening .org files via intent.
You're right, it's broken.