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

Orgro appears as handler for non-Org files/links on Android #58

Open
YuriySharlai opened this issue Dec 24, 2021 · 7 comments
Open

Orgro appears as handler for non-Org files/links on Android #58

YuriySharlai opened this issue Dec 24, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@YuriySharlai
Copy link

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.

@amake
Copy link
Owner

amake commented Dec 24, 2021

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.

@amake amake added the bug Something isn't working label Feb 4, 2022
@TriStaRvOiD
Copy link

TriStaRvOiD commented Mar 26, 2022

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.

Screen_Recording_20220326-185202_Material.Files.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.

@amake amake changed the title Attempt to open .eps files as text Orgro appears as handler for non-Org files/links on Android Jul 21, 2023
@amake
Copy link
Owner

amake commented Jul 21, 2023

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 24d125c; 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.

@TriStaRvOiD
Copy link

TriStaRvOiD commented Aug 11, 2023

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.

@amake
Copy link
Owner

amake commented Aug 12, 2023

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 even text/*, 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.

@amake
Copy link
Owner

amake commented Aug 12, 2023

Here are the intents I tested:

  • Gmail

    Intent { act=android.intent.action.VIEW dat=content://com.google.android.gm.sapi/me@example.com/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 }
    

@TriStaRvOiD
Copy link

So it sounds like actually all you did was break opening .org files via intent.

You're right, it's broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants