REPRODUCIBILITY: 100%
OS VERSION: 4.4.0.64
HARDWARE: X10III
UI LANGUAGE: en_GB
REGRESSION: unknonwn
DESCRIPTION:
Desktop files derived from Android packages can include a MimeType=
tag.
Depending on the associations that package specifies, this can lead to an app “hijacking” a whole class of file mime types, or certain mimetypes which may not be wanted by the user.
See below for an example, in which the .apk claims to support the mime type text/*
, which leads to an entry in the mimecache, which apparently overrides any other MimeType that is registered from other apps.
It would seem there are in fact two issues with wildcard use in types:
- Mime Type
foo/*
leads to the app hijacking all file associations, overriding more specific assignments by other apps, so only one app appears in the chooser. - Mime handler type
x-scheme-handler/*
leads to the app appearing on any and all “open URL” type events. See comment below for an app that does this.
PRECONDITIONS:
Example: Install the application “Nextcloud Notes” (https://f-droid.org/is/packages/it.niedermann.owncloud.notes/)
STEPS TO REPRODUCE:
- stop Android Support
- create a text file called ‘text.log’ containg some ascii text. depending on the tool you use, the mime type might be
text/x-log
ortext/plain
- tap on the file using a file manager
→ SFOS opens the file in nextcloud notes, starts Android Support to do it
EXPECTED RESULT:
A prompt to select the text editing/viewing application from a list of text-supporting apps, e.g. Sailfish Office
ACTUAL RESULT:
File is opened automatically without prompt (just the popup that the application may start in the backfround)
MODIFICATIONS:
Lots, but probably none which affect this:
- defaultuser → nemo
- patchmanager and mostly Silica patches
WRT applications and MIME types, I have a couple of custom files in ~/.local/share/applications
, but nothing modified in /usr/share/applications
ADDITIONAL INFORMATION:
Query the file association:
$ lca-tool --file --print file:///home/nemo/test.log
apkd_handler_it_niedermann_owncloud_notes-it_niedermann_owncloud_notes_edit_EditNoteActivity
look in /usr/share/applications/apkd_handler_it_niedermann_owncloud_notes-it_niedermann_owncloud_notes_edit_EditNoteActivity.desktop
find that it has:
MimeType=text/*
look in /usr/share/applications/mimeinfo.cache
and find the corresponding
text/*=apkd_handler_it_niedermann_owncloud_notes-it_niedermann_owncloud_notes_edit_EditNoteActivity.desktop
The text/*
assiciation comes from the Android Manifest directive here: