Open apps from unidentified developer [CLOSED]

Questions, glitches, bugs and crashes
Post Reply
sasha
Posts: 164
Joined: Wed Feb 17, 2016 4:59 pm

Open apps from unidentified developer [CLOSED]

Post by sasha » Mon Sep 18, 2017 9:26 am

When opening apps from an unidentified developer/not from Mac App Store for the first time, there's a warning dialog and the app is not run.
open1.png
open1.png (48.87 KiB) Viewed 1661 times
In Finder, you have to Right Click -> Open that gives you an extended version of this dialog with an Open button.
open2.png
open2.png (48.27 KiB) Viewed 1661 times
So far, I was not able to get this extended warning from NC and had to use Finder in this situation. Am I missing something?

It's a minor thing, but IMHO, it would be nice if NC's Right Click -> Open would behave the same as Finder's Right Click -> Open.

User avatar
mike
Posts: 731
Joined: Thu Jul 16, 2015 5:35 am
Location: Barnaul, Russia

Re: Open apps from unidentified developer

Post by mike » Thu Sep 21, 2017 10:27 am

Interesting one, never knew it was possible in Finder.
AFAIK there's no official APIs to bypass Gatekeeper's dialog, but I think it's possible to fiddle with it via quarantine info in xattrs.
This question needs R&D, it's quite shady at the moment.

User avatar
mike
Posts: 731
Joined: Thu Jul 16, 2015 5:35 am
Location: Barnaul, Russia

Re: Open apps from unidentified developer

Post by mike » Wed Jan 17, 2018 8:13 am

After a brief research, it looks like the "spctl" command can be used to achieve the same behavior:
spctl --enable --path /Applications/FooBar.app
I'll try to embed the background execution of this tool in a transparent mode.

UPDATE:
Nope, this requires providing credentials of an administrator account for any operations apart from assessment.
Finder somehow cheats and bypasses this authentication. That doesn't surprise much though.

So I think asking for an administrative account is an overkill.
There's a simpler solution BTW:
- Navigate to the downloaded app;
- Hit Alt+Cmd+X, this will open extended attributes of the folder (xxx.app);
- Select com.apple.quarantine;
- Remove it via F8 or Cmd+Backspace;
- Now Gatekeeper won't bother anymore.

User avatar
swoop
Posts: 53
Joined: Thu Mar 02, 2017 2:40 pm
Location: Brussels, Belgium

Re: Open apps from unidentified developer

Post by swoop » Thu Apr 26, 2018 9:57 am

mike wrote:
Wed Jan 17, 2018 8:13 am
There's a simpler solution BTW:
- Navigate to the downloaded app;
- Hit Alt+Cmd+X, this will open extended attributes of the folder (xxx.app);
- Select com.apple.quarantine;
- Remove it via F8 or Cmd+Backspace;
- Now Gatekeeper won't bother anymore.
That's like magic! Thank you for the info!
Total Commander (Windows 95 - Windows 7) (retired for Mac)
Nimble Commander (retired Crax, Commander One, DCommander)
Macbook 12" 2016 - macOS High Sierra

JayB
Posts: 126
Joined: Sun Jan 08, 2017 4:38 pm

Re: Open apps from unidentified developer [CLOSED]

Post by JayB » Wed May 23, 2018 2:57 pm

You can also script your own "Dequarantine & Open…" command:

Code: Select all

#!/bin/bash
account=$(id -un)
label="$account-deQ"
for target in "${@}"
do
	target_name=$(basename "$target")
	prompt="$account wants to dequarantine $target_name."
	osascript &>/dev/null << EOF
do shell script "/usr/bin/xattr -dr com.apple.quarantine \"$target\" 2>/dev/null && /usr/bin/spctl --add --label \"$label\" \"$target\" 2>/dev/null && /usr/bin/spctl --enable --label \"$label\" 2>/dev/null" with prompt "$prompt" with administrator privileges
EOF
	open -a "$target"
done
exit
Save it as a shell script & add the script as a tool in Nimble Commander Preferences, then assign a keyboard shortcut, e.g. CTRL-ALT-CMD-Q. Note: haven't tested it thoroughly, but it should work imho. Running the script with administrator privileges is necessary: spctl always needs it (see comment above), and the xattr command also needs it in case you have an app or executable installed with admin privileges.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests