castlabs / electron-releases

castLabs Electron for Content Security
https://castlabs.com/resources/downstream/
MIT License
225 stars 42 forks source link

Application crash when packaged for MAS target #98

Open fengyy51 opened 3 years ago

fengyy51 commented 3 years ago

In order to publish the application to the app store, i use v12.0.5-wvvmp in my project(base on electron-react-boilerplate) , but the applicatin crash when packaged for MAS target, May I ask what is the reason?

I have setted the entitlements and opened the sandbox switch,but the packaged application started with quit. ``<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

com.apple.security.app-sandbox com.apple.security.application-groups XX.XXX com.apple.security.network.client com.apple.security.network.server com.apple.security.files.user-selected.read-write com.apple.security.cs.allow-jit com.apple.security.cs.allow-unsigned-executable-memory com.apple.security.cs.allow-dyld-environment-variables com.apple.security.cs.disable-library-validation com.apple.security.files.downloads.read-write `` The quit error is"Failed to install Widevine components",I have found the strackInformation is : SeatbeltExecServer: Failed to initialize sandbox: -1 Operation not permitted Can you help me solve the solution? Thanks a lot
khwaaj commented 3 years ago

Wasn't there an additional error message when you get "Failed to install Widevine components", there should be an Error object delivered to the widevine-error handler with more specific information?

AFAICT, the SeatbeltExecServer seems to be a separate issue relating to the Chromium sandbox on macOS. Maybe https://github.com/electron-userland/electron-builder/issues/5506 can provide some hints?

fengyy51 commented 3 years ago

@khwaaj hello I have tried the widevine-error handle and got the information wide--error Error: net::ERR_FAILED at SimpleURLLoaderWrapper. (electron/js2c/browser_init.js:105:7068) at SimpleURLLoaderWrapper.emit (events.js:315:20)

I also tried the solutions provided by electron-userland/electron-builder#5506 ,but had the same question.

khwaaj commented 3 years ago

@fengyy51, unfortunately that doesn't give much of a hint. Are you manually calling the app.verifyWidevineCdm() API in your app? If so, are you calling it after receiving the ready event? If it gets called before ready the Electron network primitives won't be properly initialized and can result in errors like the above.

fengyy51 commented 3 years ago

@khwaaj hello ,I didn't call the app.verifyWidevineCdm()Api in my project。I used the default setting related to the widevine.

I think may be something wrong with the electron-v12.0.5-wvvmp-darwin-x64.zip, Because I can run well in the development environment .But the question will happen when I packege it.

khwaaj commented 3 years ago

The fact that it does work in the development environment indicates that there is nothing wrong with the release itself, there are however many things that can go wrong depending on the packaging and environment you are running in, because of how sandboxing and VMP works.

Are you sure you are using the experimental MAS build? The zip you reference above is the non-MAS version.

Either way you are in uncharted territory, as the note about the MAS build will tell you. There are plenty of reasons to believe there will be issues packaging ECS as a MAS build and getting it accepted. We are certainly interested in how any attempts to integrate with the MAS is progressing, but it is not something that we officially support at this time.

I would suggest you try to disable the different sandboxes to see if that makes a difference, i.e. through the entitlements and/or the --no-sandbox option you can pass to ECS on the command-line. The Seatbelt error above seems to indicate something goes wrong with the ECS sandbox, so maybe there is some incompatibility there.

Beyond that I'm not familiar enough with the MAS to really comment much, maybe someone else who has used Electron and/or ECS with the MAS can provide some ideas/insight?

fengyy51 commented 3 years ago

@khwaaj sorry, I wrote wrong with the zip.I am sure that I am using the MAS build.

I have tried to package the project with the official MAS build (electron-v12.0.5-mas-x64.zip), and it can run well. I think that something different about the two zips will cause the question.

I want to consult that whether has the plan to officially support the MAS version in the future

Thanks a lot