keymanapp / keyman

Keyman cross platform input methods system running on Android, iOS, Linux, macOS, Windows and mobile and desktop web
https://keyman.com/
Other
391 stars 108 forks source link

bug(android): attempting to open a package from Files results in an error 'You don't have any apps that can open this type of file' #10133

Open mcdurdin opened 9 months ago

mcdurdin commented 9 months ago

Describe the bug

Screenshot_20231205_123603_My Files

Reproduce the bug

No response

Expected behavior

No response

Related issues

No response

Keyman apps

Keyman version

17.0.217-alpha-test-10103

Operating system

No response

Device

No response

Target application

No response

Browser

No response

Keyboard name

No response

Keyboard version

No response

Language name

No response

Additional context

No response

darcywong00 commented 9 months ago

Previous issue #629 about Samsung's "My Files" browser.

As a workaround, does the Chrome Downloads allow you to install the .kmp file?

mcdurdin commented 8 months ago

Trying to install from Chrome Downloads, I get a toast from Keyman: "storage request permission was denied. May fail to install key..."

FWIW, any error which arises from a user action should be an alert rather than a toast.

darcywong00 commented 8 months ago

Triaged with @mcdurdin to B17S1

mcdurdin commented 7 months ago

Trying to install from Chrome Downloads, I get a toast from Keyman: "storage request permission was denied. May fail to install key..."

Screencap. And a small insight into my life if you look carefully.

https://github.com/keymanapp/keyman/assets/4498365/91526ff9-6aa9-42ae-8125-8134cd87810d

darcywong00 commented 7 months ago

MyFiles creates the intent that Android Studio warns with

[1235/FileExecute ] openFile() ] There is no activity that can handle the intent. (type : , data : content://media/external/file/11269)

Chrome Downloads does trigger the intent with

START u0 {act=android.intent.action.VIEW dat=content://com.android.chrome.DownloadFileProvider/... typ=application/octet-stream flg=0x10000003 cmp=android/com.android.internal.app.ResolverAct

darcywong00 commented 6 months ago

Retesting with 17.0.289 beta and I see this in the Logcat trying to launch a .kmp file from Samsung MyFiles:

com.sec.android.app.myfiles          I  [1351/FileExecute         ] 
    getOpenFileIntent() ] unsupported file type extension : kmp, mimeType : 

I'll call this a dupe of #629 which has some unpleasant caveats with the intent-filters

Per SO reference, Samsung MyFiles browser

The sad answer is that is no good solution but to use */* and no file extension filtering.

When Samsung's file manager tries opening a file whose mime type they don't recognize, they default to passing "" (an empty string), which is impossible to filter for - setting an empty mime type in the intent filter creates a malformed APK that your device will refuse to install, so the only way to catch it is by using */*.

They probably should have defaulted to application/octet-stream, but that's not going to happen anytime soon - unless you work for Samsung, in which case, go change it :)


So, the only (uber unpleasant) alternative is to have an intent filter on all filetypes so the user could select Keyman for .kmp files.

Will close as won't fix - waiting on external

darcywong00 commented 6 months ago

Re-opening to track for Future - still waiting on external Samsung update to MyFiles

mcdurdin commented 6 months ago

https://forum.developer.samsung.com/t/opening-files-with-unknown-content-type-from-my-files/30335