Skip to content
This repository has been archived by the owner on Sep 23, 2021. It is now read-only.

Not possible in Mac App Store, aka app-sandbox #121

Open
marcj opened this issue Mar 17, 2020 · 5 comments
Open

Not possible in Mac App Store, aka app-sandbox #121

marcj opened this issue Mar 17, 2020 · 5 comments

Comments

@marcj
Copy link

marcj commented Mar 17, 2020

Hi, first: Thanks for this great library!

I have an issue with getting an app using this library to the Mac App Store. The problem is that the source contains a binary at https://github.com/jorangreef/sudo-prompt/blob/master/index.js#L668 var APPLET = .., which you extract at runtime. In the app-sandbox environment of macOS (which is required by the Mac App Store) such a behavior is forbidden. One way around it is to include that binary as plain file, which I can then code-sign to allow to be executed. That code signing needs to happen during build time and can run during runtime.

So my question is: Would it be possible to place that file inside the package as plain file? What was the intent in encoding it as base64 in the javascript code?

@jorangreef
Copy link
Owner

Thanks @marcj !

That's actually how we used to have it, with the applet as a separate file inside the package. However, we ran into an issue with Electron's ASAR and solved that by including it in the source code directly as base64.

I guess we could do both, ship a separate file as well as base64 and then branch depending on whether the runtime is Electron or Node.js.

@jorangreef
Copy link
Owner

This was the original ASAR issue: #10

@marcj
Copy link
Author

marcj commented Mar 17, 2020

Thanks @jorangreef! But the problem is, I use Electron as well, but not with ASAR though 😅

@jorangreef
Copy link
Owner

That's fine.

@jorangreef
Copy link
Owner

@marcj, would you be able to do a PR for this?

You would need to have the code branch on whether you detect the user is using ASAR or not, and then first unpack the base64 string or use the standalone applet directly respectively.

On the plus side, this would speed up sudo-prompt for apps that don't use ASAR.

One thing to keep in mind though is that for icon and name support, we don't just use the applet, we also modify the plist of the applet. I don't know if that will survive code-signing but if you could test that would be appreciated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants