SQRL pop-up when accessing Google Drive files when offline

  • New Wordpress Plug-In Forum
    Guest:

    Just a note that we have a new forum to contain discussions relating to the Wordpress plug-in which Daniel Persson originated and has been making great progress on. You'll find it under "Server-Side Solutions."

    /Steve.

Stress

New member
Jun 12, 2019
2
0
Pixel 2XL/Android 9 w/ June Security Patch: SQRL app pops up when trying to access Google Drive files when offline. Have to delete app to use Google Drive.
 

ahauser

Well-known member
Feb 22, 2019
82
24
What kind of files are you trying to open?

SQRL should only be activated for binary and pure text files. This is used to import identity files. Also, if another app is registered for the same mime type, you should get to choose which app you want to use to open the file.

The problem is that Android has no concept of file extensions, and the sqrl file format is not of any known mime type (other than binary or text). So it's kind of "all or nothing" for file handling for the SQRL app.
 

Gristle

Well-known member
Feb 16, 2019
341
70
Sounds like maybe there should be a file type for a SQRL identity. You definitely don't want SQRL clients attempting to open random text files or binary blobs.
 

PHolder

Well-known member
May 19, 2018
910
122
Is it possible in Android to cascade the handling of intents? If so, then require SQRL to see a .sqrl filename before accepting a binary file otherwise pass it along and let the OS find another entity to handle it.
 

ahauser

Well-known member
Feb 22, 2019
82
24
application/sqrl?
Unfortunately, it seems like Android does not allow for the creation or registration of custom mime types, at least not outside of your own app's process space. Additionally, filtering for file extensions no longer works and it seems that that's not going to change anytime soon, because Android simply does not honor the concept of file extensions at all.
 

cdsmith

New member
Jun 13, 2019
2
0
I think I am seeing a related issue. Since installing the SQRL app, I am unable to open ODT files attached to an email in the GMail app. ODT files are text files created usually by the Open Office / Libre Office, etc word processors. Open Document Text files. In the GMail app I can see the thumbnail of the file with the start of the content, but when iI tap it, instead of downloading and showing the document like it used to do, I get a SQRL screen that says "This file does not appear to be a valid SQRL identity file." I do not get a pop up asking what app I want to open the file in, it immediately goes to the SQRL app.
 

kalaspuffar

Well-known member
May 19, 2018
267
91
Sweden
coderinsights.com
Hi @cdsmith

In most devices settings you can reset application preferences, can be a bit hidden but should give you back the option to choose application.

If not we might need to make a list of broken devices and exclude the feature for those.

We might even consider removing the feature. We now have the option to open files and this feature is just one to be feature complete and not a feature widely used I believe.

Best regards
Daniel
 
  • Like
Reactions: ahauser

Vela Nanashi

Well-known member
May 19, 2018
625
107
When someone opens a file so your android application sees it, is there a way there to look at the file name and can you then manually filter on the file name and then say to the event handler false "I could not handle this file ask someone else" or true "yeah I handled this file", is that something that the API allows?

Also is this what you guys use: https://developer.android.com/guide/topics/manifest/data-element.html ? It does allow pattern matching on path/filename *.sqrl would be what you could use then, if that works at least, I don't know since I am not an android developer. Also this might be relevant: https://stackoverflow.com/questions/1733195/android-intent-filter-for-a-particular-file-extension
 
Last edited:

PHolder

Well-known member
May 19, 2018
910
122
When someone opens a file so your android application sees it, is there a way there to look at the file name and can you then manually filter on the file name and then say to the event handler false "I could not handle this file ask someone else" or true "yeah I handled this file", is that something that the API allows?
That's what I was trying to ask above: https://sqrl.grc.com/threads/sqrl-pop-up-when-accessing-google-drive-files-when-offline.717/#post-5661
 

ahauser

Well-known member
Feb 22, 2019
82
24
Yes, this is what we're using

It does allow pattern matching on path/filename *.sqrl would be what you could use then, if that works at least, I don't know since I am not an android developer.
Yes, that's how it looks on the surface. But unfortunately, for android:scheme="content" , the pattern matching does not work. And as I tried to explain earlier, this is not regarded as a bug by Google, since Android officially does not support or understand the concept of file extensions.

Sometime in the past, you could use other mechanisms than android:scheme="content" , where pattern matching was possible. Now it isn't anymore.

Acutally, if you read the replies and follow-ups to the accepted answer on this SO post, you'll find people reporting exactly what I've explained above.

We might even consider removing the feature. We now have the option to open files and this feature is just one to be feature complete and not a feature widely used I believe.
I could not agree more. I'll open an issue for this.

//EDIT:
For anyone who is interested: https://github.com/kalaspuffar/secure-quick-reliable-login/issues/351
 
Last edited:

Vela Nanashi

Well-known member
May 19, 2018
625
107
So you can't use scheme:file anymore? That is stupid of them to remove.

Maybe you can add a switch in the app to turn on file handling for 1 hour, have it register to receive the files that long and then remove itself, is that possible? Though really I think most importing into clients running on things with a camera would be via the QR code anyway.
 

ahauser

Well-known member
Feb 22, 2019
82
24
While you can still additionally specify the "file" scheme (and we do), Android will nowadays always use the "content" scheme when invoking a file. If I remember correctly, this was changed some time back for security reasons. Please don't quote me here, it's already a while back when I worked on this stuff and don't remember the exact details.

I don't think that we should even spend any more effort on this, since we already have a working file import feature which can be invoked from within the app. This works as one would expect and should be all that is needed (besides the already present identity qr code scanning and text input import options). Who really needs a 4th option, right? :)
 
  • Like
Reactions: kalaspuffar

Vela Nanashi

Well-known member
May 19, 2018
625
107
Oh, you have importing of files from inside the app, yeah, then why have this other thing if it causes issues?
 

cdsmith

New member
Jun 13, 2019
2
0
So I did a bit of googling and for my phone, which is old and stuck on Android 6, to stop an app from opening a file, you go to settings, apps, and find the app and select it. The app info screen comes up and and one of the items is "Open by default." You pick this and it will show "Supported links." But when I do this for SQRL, it says "Don't open supported links." And below that there's another item that says "Other Defaults" but it says "No defaults set." So it would appear that according to this my phone shouldn't be attempting to open ODT files with SQRL. But it still does. :(
 

ahauser

Well-known member
Feb 22, 2019
82
24
@cdsmith , it won't anymore in the next release of the app.

You can always pick a file for import from within the app, and this will be the officially sanctioned way of importing from a file going forward.