whomwah / qlstephen

A QuickLook plugin that lets you view plain text files without a file extension
https://github.com/whomwah/qlstephen
MIT License
2.75k stars 161 forks source link

macOS X 10.15 Catalina support? #81

Closed silviu-bucsa closed 4 years ago

silviu-bucsa commented 5 years ago

On the Public betas of Mac OS X QLStephen.qlgenerator stopped working. I've attached a screenshot with the message I'm receiving:

Screenshot 2019-07-09 at 08 58 07

I haven't found a workaround.

Thank you.

aslilac commented 5 years ago

This is probably because of notarization enforcement. The binary just needs to be notarized by Apple. (Which I believe requires their $99 developer program subscription.)

pkmnct commented 5 years ago

In the mean time, to get around this, you can go to the folder (⌘⇧G from Finder) ~/Library/Quicklook/QLStephen.qlgenerator/Contents/MacOS/ and right-click QLStephen, selecting Open. This will give you the option to open it anyway, and it should load correctly in the future.

kevinmartin commented 5 years ago

In the mean time, to get around this, you can go to the folder (⌘⇧G from Finder) ~/Library/Quicklook/QLStephen.qlgenerator/Contents/MacOS/ and right-click QLStephen, selecting Open. This will give you the option to open it anyway, and it should load correctly in the future.

This doesn't work for me.

samcat116 commented 5 years ago

On the latest beta you can get by it by going to Security in system preferences after you try and open it once and hit "Allow Anyway". Still would love to see it notarized properly.

adityasrini commented 5 years ago

This is probably because of notarization enforcement. The binary just needs to be notarized by Apple. (Which I believe requires their $99 developer program subscription.)

~Not gonna lie this sounds like extortion. Open source developers should be able to freely ship their code when end users fully understand and accept the risks of using such code.~

EDIT: @samcat116 cleared this up in the subsequent comment.

samcat116 commented 5 years ago

Notarization does not require the $99/yr subscription. Just needs an Developer Apple ID and Xcode .

adityasrini commented 5 years ago

On the latest beta you can get by it by going to Security in system preferences after you try and open it once and hit "Allow Anyway". Still would love to see it notarized properly.

I tried qlmanage -p README.MD for a readme file. I don't get the warning to move the plugin to the Trash, but I now get an error message in the console and the file appears the way it did if I never installed this plugin (plain text).

Testing Quick Look preview with files:
    README.MD
2019-10-07 20:18:17.998 qlmanage[32498:129283] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x6f07, name = 'com.apple.coredrag'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2019-10-07 20:18:18.054 qlmanage[32498:129283] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0xb01f, name = 'com.apple.tsm.portname'
See /usr/include/servers/bootstrap_defs.h for the error codes.

On a related note, I see this message when I try the same thing for a json file with a json reading plugin. this preview cannot be safely displayed in quick look

kallewesterling commented 5 years ago

Just updated my operating system and got this message:

image
KoCMoHaBTa commented 5 years ago

Same here, just updated to Catalina yesterday and QLStephen stopped working. Please update it in order to be compatible with Catalina.

fvvliet commented 5 years ago

+1

adityasrini commented 5 years ago

Please use thumbs up instead of "+1" or "me too" comments. They often add no value, clutter the issue's discussions, and generate unnecessary notifications to all participants, including the project's maintainers.

jeffbyrnes commented 5 years ago

If it helps, here are the docs on Notarizing Your App Before Distribution.

aslilac commented 5 years ago
Screen Shot 2019-10-09 at 2 36 56 PM

@samcat116 This is what I get when I follow the instructions on this page. The app in the screen shot is an freshly created, properly code signed app that meets all of the notarization requirements. If you know something I don't I would love to be proven wrong, but from all the resources I've come across and my own personal experience it seems that the paid Apple Developer Program membership is a necessary part of notarization.

KoCMoHaBTa commented 5 years ago

Can you try with the CLI? As per Notarize Your Preexisting Software under Notarizing Your App Before Distribution, you can try to Upload Your App to the Notarization Service using altool

It might look more complex, but could you give it a shot and try it out.

aslilac commented 5 years ago
Screen Shot 2019-10-09 at 4 07 55 PM

@KoCMoHaBTa When following those instructions, the Archive Post-action script that it gives doesn't even export the zip file that it is supposed to export. I made my own zip file instead, tried uploading it, and got this error. I find it weird that there is a space between "provider" and the period following it, like there is supposed to be a provider name there. The command I ran is exactly the command given in the instructions (except for the file name of course). I'm not entirely sure what a provider is in this context, but I'm guessing it's related to ADP membership.

KoCMoHaBTa commented 5 years ago

@partheseas Check this out - https://forums.developer.apple.com/thread/119445 Looks like the message is misleading and for some reason, the tool cannot find this provider automatically. So you have to specify it as the --asc-provider parameter, part of altool command. In order to find your provider name - check the first post from eskimo on this thread - https://forums.developer.apple.com/thread/113798

graylogo commented 5 years ago

watching……

gggdomi commented 5 years ago

Simply cross-referencing similar issues in other QuickLook plugins in case a solution surfaces somewhere :

Also, there seems to be changes in Catalina beyond notarization breaking the plugins.

jonluca commented 5 years ago

Note that sudo qlmanage -p README.md works for me, with SIP and notarization disabled (with csrutil disable and sudo spctl --master-disable).

Is the move forward to publish a version that is notarized? Or is it a different issue?

biocross commented 5 years ago

So I tried notarizing one of the plugins with my paid developer account, and it doesn't seem to accept .qlgenerator files

I ran the xcrun alttool command, and got an error like

 1 package(s) were not uploaded because they had problems:
    /var/folders/nz/nlsr_8yn2tdblj6fcfyylv140000gn/T/62F12993-D9CA-4467-829C-0460DC836E3A/com.fiatdev.QLMarkdown.itmsp - Error Messages:
        ERROR ITMS-4064: "File extension of file 'QLMarkdown' is invalid for this software; use 'zip,pkg,dmg' instead." at SoftwareAssets/EnigmaSoftwareAsset
2019-10-15 17:40:56.282 altool[3526:23550] *** Error: ERROR ITMS-4064: "File extension of file 'QLMarkdown' is invalid for this software; use 'zip,pkg,dmg' instead." at SoftwareAssets/EnigmaSoftwareAsset

There seems to be no documentation online on notarizing QuickLook plugins either.

KoCMoHaBTa commented 5 years ago

Check this out -> https://github.com/anthonygelibert/QLColorCode/issues/51#issuecomment-541235470

ahmetgeymen commented 5 years ago

I hope description on this site might be useful. https://glyphsapp.com/tutorials/how-to-notarize-your-plug-ins

biocross commented 5 years ago

Thanks @KoCMoHaBTa @ahmetgeymen, I'll try this again in the coming weekend.

cactusnix commented 5 years ago

In the mean time, to get around this, you can go to the folder (⌘⇧G from Finder) ~/Library/Quicklook/QLStephen.qlgenerator/Contents/MacOS/ and right-click QLStephen, selecting Open. This will give you the option to open it anyway, and it should load correctly in the future.

it works for me at macOS 10.15.

SewellDinG commented 5 years ago

QL插件都在~/Library/QuickLook/目录,但从系统设置->拓展->快速查看,却没有允许使用此目录,但其中包含了/System/Library/Frameworks/RealityKit.framework内的几个插件。 brew cask 不允许使用root,并且/System/Library/Frameworks/RealityKit.framework只读。 很烦~ :(

tessus commented 5 years ago

@samcat116

Notarization does not require the $99/yr subscription. Just needs an Developer Apple ID and Xcode .

You are kidding right? You only get a valid developer id, when you pay $99 for the Apple Developer program.

gustavohellwig commented 5 years ago

~/Library/Quicklook/QLStephen.qlgenerator/Contents/MacOS/

In the mean time, to get around this, you can go to the folder (⌘⇧G from Finder) ~/Library/Quicklook/QLStephen.qlgenerator/Contents/MacOS/ and right-click QLStephen, selecting Open. This will give you the option to open it anyway, and it should load correctly in the future.

it works for me at macOS 10.15.

not for me. What else did you do?

OCJvanDijk commented 5 years ago

not for me. What else did you do?

I had to go to Security & Privacy in System Preferences right after you get an error message and I could whitelist it from there. I think I went: Quicklook -> error -> Security panel -> Quicklook again -> additional confirmation dialog and then it worked.

gustavohellwig commented 5 years ago

For me just asked me in the begging to approve, after that, it's not showing that normal window approve in sucurity. This path I could not find it: Quicklook -> error -> Security panel -> Quicklook again -> suggestions ?

OCJvanDijk commented 5 years ago

Sorry that was unclear. I mean that I triggered an error by trying to quicklook a file using QLStephen and after that I could go to the security settings to approve it etc

gustavohellwig commented 5 years ago

Sorry for this questions again... Ok, If I got your logic, I run this:

root@MacBookPro _FILMs # qlmanage -p Test.mkv                                 
Testing Quick Look preview with files:
    Test.mkv
2019-10-22 13:01:01.845 qlmanage[11471:2293464] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x6e03, name = 'com.apple.coredrag'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2019-10-22 13:01:01.884 qlmanage[11471:2293464] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x1431f, name = 'com.apple.tsm.portname'
See /usr/include/servers/bootstrap_defs.h for the error codes.

After that, nothing show up.

mliker commented 5 years ago

Perhaps an inspiration to port this to the new system can be found here https://github.com/anthonygelibert/QLColorCode/issues/51

cactusnix commented 5 years ago

~/Library/Quicklook/QLStephen.qlgenerator/Contents/MacOS/

In the mean time, to get around this, you can go to the folder (⌘⇧G from Finder) ~/Library/Quicklook/QLStephen.qlgenerator/Contents/MacOS/ and right-click QLStephen, selecting Open. This will give you the option to open it anyway, and it should load correctly in the future.

it works for me at macOS 10.15.

not for me. What else did you do?

I don't know how it happened. I tried to uninstall it and then do the same thing again, but after deleting it , the md file still can be preivewed. It confused me.

cactusnix commented 5 years ago

Oh, maybe the Xcode, because it suggests me to open with it. ps: I installed the Xcode yesterday.

gustavohellwig commented 5 years ago

Do you have a Apple paid dev account? That according to what I'm reading can make a huge difference.

biocross commented 5 years ago

So I was successfully able to notarise the plugin, using the steps here. Unfortunately, the signed binary still didn't work in Catalina (atleast QLMarkdown, which I tested). I didn't get security related errors, but it just failed to work.

I think these plugins will have to be re-written as System Extensions to work in Catalina.

ndpta commented 5 years ago

Solution that did a trick for me:

  1. Disable Gatekeeper (Terminal > sudo spctl --master-disable)
  2. Check: .ipa preview works
  3. Enable Gatekeeper (Terminal > sudo spctl --master-enable)
  4. Open 'System Preferences' > 'Security & Privacy' > General tab >> you will see a message at the bottom, 'QLStephen.qlgenerator was blocked from opening because it is not from an identified developer.' > Click on 'Open anyway'
  5. It works now with enabled Gatekeeper
gustavohellwig commented 5 years ago

2. Check: .ipa preview works

What do you mean about "Check: .ipa preview works" ?

I downloaded an .ipa app and pressed Space in Finder, nothing shows up, and tried: qlmanage -p -d1 Downloads/File.ipa and still, nothing is coming to ask me the permission on the System Preferences' > 'Security & Privacy'.

suggestions?

ndpta commented 5 years ago

It's an additional step, just to make sure that preview works.

After disabling Gatekeeper you need to restart Finder to be able to see the .ipa preview. To restart Finder: hold 'option' button and right click on Finder icon in Dock > click Relaunch

And then after enabling Gatekeeper (and clicking on 'Open anyway') you need to restart Finder again.

gustavohellwig commented 5 years ago

I did all of that but still doesn't show anything. Also, I did a test with a zip file with the BetterZip quick preview and also is not working. Screen Shot 2019-10-24 at 11 11 39

What else I'm missing?

ndpta commented 4 years ago

Preview of zip files doesn't fork for me as well now. But ipa - works.

If you want to see preview of archive formats you can try this: https://macitbetter.com/BetterZip-Quick-Look-Generator/

Install it > Launch > Relaunch Finder > Try zip preview

gustavohellwig commented 4 years ago

I did that already too, but still shows that error above.

ndpta commented 4 years ago

Because of Gatekeeper.

Please follow the steps above, and you should get it working.

Screenshot 2019-10-24 at 11 43 39 AM
gustavohellwig commented 4 years ago

Still. there is something else that you have done in yours that I didn't in mine. Do you need to have the Xcode installed? have you done this too: sudo csrutil disable ?

I consider myself pretty smart, so I'm doing what you are saying to do.

ndpta commented 4 years ago

Yes, I have Xcode installed, but I think it doesn't matter. No, 'sudo csrutil disable' didn't do.

I'm sure it should work with disabled Gatekeeper, so check the preview functionality when you have this:

Unknown-2

(and don't forget to relaunch Finder)

gustavohellwig commented 4 years ago

PS: the files with .md and .ipa the previews are working, but not the .apk .zip .mkv .json .js .mp3. All the QuickPreview extensions were installed by the same way.

gustavohellwig commented 4 years ago

Yes, I have Xcode installed, but I think it doesn't matter. No, 'sudo csrutil disable' didn't do.

I'm sure it should work with disabled Gatekeeper, so check the preview functionality when you have this:

Unknown-2

(and don't forget to relaunch Finder)

yeap, that it my case, even after reboot and still.

Screen Shot 2019-10-24 at 13 03 49

ndpta commented 4 years ago

Hm...

Not sure, but maybe try to update Homebrew.

gustavohellwig commented 4 years ago

have done that too.

:(

OCJvanDijk commented 4 years ago

I've been experimenting with a fresh macOS Catalina install on a vm and these are the steps I can reliably make QLStephen work:

  1. brew cask install qlstephen
  2. Restart Finder
  3. Open a finder window and navigate to any folder that contains a plaintext file qlstephen tries to generate a preview for. Maybe you need to trigger Quicklook explicitly by selecting the file and hitting space.
  4. This will generate an error message saying the developer can't be verified. From "move to trash" and "cancel" choose "cancel"
  5. Open System Preferences -> Security & Privacy and under the General tab at the Botton click "Allow anyway"
  6. Log out and log back in
  7. Repeat step 3
  8. In the warning message that now appears choose "open"

Everything should be working now. If you don't have a clean install and you can't trigger the first error message anymore I would uninstall QLStephen first and restart your Mac.

Btw, depending on factors I'm not entirely sure about you can sometimes skip step 2 and/or 6