Giter Site home page Giter Site logo

node-webkit-macappstore's Introduction

Mac AppStore patch for node-webkit

This patch is totally based on this work: https://github.com/rogerwang/chromium.src/pull/17

The original patch by @trevorlinton did not work with 0.11.5, so I fixed it for the newer version until node-webkit (or now nw) official repository gets updated with the proper changes, and buildbot slave is created for Mac AppStore executable.

Background

node-webkit (now nw.js) executable cannot be submitted to Mac AppStore as is and needs to be tweaked is its Chromium part uses QuickTime and various deprecated / private APIs; this patch removes usage of QuickTime libraries and makes a few other changes that allow node-webkit to be submitted to AppStore. The binary from this repository was successfully submitted via Application Loader on Jan 14th, 2015.

It is further discussed here: nwjs/nw.js#936

Important Update

Latest review in January required to drop some more APIs, so I also had to patch the webkit located within node-webkit/src/third_party/WebKit to get it approved by App Store.

How to get node-webkit build accepted on Mac App Store

I figured out that Apple may be rejecting the latest ffmpegsumo.so located under libraries. If you do not use ffmpeg, you may delete the file from node-webkit Framework.framework/Libraries/ffmpegsumo.so and resubmit.

If you do use ffmpeg, however, more investigations are necessary to submit it to App Store—it uses certain QtKit APIs that need removal as well (or rather, a conversion to AVFoundation).

The most recent binary of 0.11.5 was accepted by App Store without ffmpegsumo.so on January 26th 2015 (and once with it, too, earlier).

Submitting to App Store

To ensure successful submittion, you will need to:

  1. Delete the ffmpegsumo.so (if you're not using it, as explained above)
  • Edit the plist to match your app ID
  • Sign the code with the right entitlements that enable sandbox on it see here by @trevorlinton
  • Ensure you do not request the entitlements you do not need (like printing or etc., App Review team checks that)
  • Finally, create a package with productbuild tool on your Mac and upload to App Store for review.

Sandboxing Issues

Once sandboxed, the app may crash with deny forbidden-sandbox-reinit error. To fix that, please see this closed issue for details.

node-webkit-macappstore's People

Contributors

alexeyst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-webkit-macappstore's Issues

Sandboxed app crashes on <input type="file">

Hello,

I'm having issues with my sandboxed app when using file dialogs.

The app crashes with those messages, when clicking on the input, or triggering it with Javascript:

com.apple.xpc.launchd[1]: (com.apple.appkit.xpc.openAndSavePanelService[26550]) Service exited with abnormal code: 1
node-webkit[26543]: an error occurred while attempting to connect to listener 'com.apple.view-bridge': Connection interrupted
node-webkit[26543]: *** Assertion failure in +[NSXPCSharedListener connectionForListenerNamed:fromServiceNamed:], /SourceCache/ViewBridge/ViewBridge-99/NSXPCSharedListener.m:394
node-webkit[26543]: NSXPCSharedListener unable to create endpoint for listener named com.apple.view-bridge

You may be able to reproduce the bug by using this simple installation:

package.json:

{
  "name": "Sample",
  "version": "1.0.0",
  "main": "app.html",
  "window": {
    "width": 500,
    "height": 500,
    "show": true
  },
  "webkit": {
    "plugin": true,
    "page-cache": false
  }
}

app.html:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
    </head>
    <body>
        <input type="file">
    </body>
</html>

App entitlement:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.security.app-sandbox</key>
    <true/>
    <key>com.apple.security.files.user-selected.read-write</key>
    <true/>
    <key>com.apple.security.network.client</key>
    <true/>
    <key>com.apple.security.network.server</key>
    <true/>
    <key>com.apple.security.temporary-exception.files.absolute-path.read-write</key>
    <array>
        <string>/private/tmp/</string>
        <string>/private/var/tmp/</string>
        <string>/private/var/folders/ml/</string>
    </array>
</dict>
</plist>

Helpers entitlements:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.security.app-sandbox</key>
    <true/>
    <key>com.apple.security.inherit</key>
    <true/>
</dict>
</plist>

Can not sign app; got rejected

I have tried to sign this app like this
$ codesign --force -d --deep-verify -v -v -v -s "MYIDENTITY" node-webkit.app
and verify it like that
$ spctl -a -t exec -vv node-webkit.app
node-webkit.app: rejected
origin=3rd Party Mac Developer Application: COMPANY INC (MYIDENTITY)

I also tried https://github.com/trevorlinton/chromium/blob/node/macstore_sign.sh tool by @trevorlinton, but got the same result

OSX 10.10.2 and xcode Version 6.1.1 (6A2008a) (also tried xcode 6.2)

Rejected because of the com.apple.security.network.server entitlement

Our app has been rejected during review process because of the com.apple.security.network.server entitlement.
I tried removing it but then nwjs crashes because I think it needs it for developer webtools http server. It doesn't get socket permission.
Anybody had this problem before?
I looked into disabling developer webtools but it looks like that is not possible.
I filed an appeal to the "review board" and waiting for an answer.

Signed app crashes on startup

Hi,

a few users have reported that the sandboxed app crashes on startup.

The error occurs with the current 0.11.5 binary.

I built a new binary based on nwjs 0.12.1, but the problem remains for those users (same error).

(You can check the new binary here - I wanted to resolve this issue before submitting a pull request)

When the app is not signed, it runs smoothly.


Here is the error:

Crashed Thread:        0  CrBrowserMain  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BREAKPOINT (SIGTRAP)
Exception Codes:       0x0000000000000002, 0x0000000000000000

Complete log file is available here.

App crashes when sandboxed.

Hi,
When I sandbox and run the app, the app crashes, and I can see this message in the console:
node-webkit Help(21572) deny forbidden-sandbox-reinit

node-webkit Help(21572) deny forbidden-sandbox-reinit

Process: node-webkit Help [21572]
Path: /Users/User/deployer.app/Contents/Frameworks/node-webkit Helper.app/Contents/MacOS/node-webkit Helper
Load Address: 0x1025d0000
Identifier: com.intel.nw.helper
Version: 2125.104 (38.0.2125.104)
Code Type: x86_64 (Native)
Parent Process: node-webkit [21569]

Date/Time: 2015-02-21 20:06:44.985 +0530
OS Version: Mac OS X 10.10.2 (14C109)
Report Version: 8

Thread 0:
0 libsystem_kernel.dylib 0x00007fff8fa50e92 mac_syscall + 10
1 libsystem_secinit.dylib 0x00007fff8a162b21 libsecinit_initialize_once + 20
2 libdispatch.dylib 0x00007fff8ccabc13 dispatch_client_callout + 8
3 libdispatch.dylib 0x00007fff8ccabb26 dispatch_once_f + 117
4 libSystem.B.dylib 0x00007fff90005aaa libSystem_initializer + 131
5 dyld 0x00007fff62f7aceb ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 265
6 dyld 0x00007fff62f7ae78 ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 40
7 dyld 0x00007fff62f77871 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 305
8 dyld 0x00007fff62f77806 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 198
9 dyld 0x00007fff62f77806 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 198
10 dyld 0x00007fff62f77806 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 198
11 dyld 0x00007fff62f77806 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 198
12 dyld 0x00007fff62f77806 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 198
13 dyld 0x00007fff62f77806 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 198
14 dyld 0x00007fff62f776f8 ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 138
15 dyld 0x00007fff62f77969 ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 75
16 dyld 0x00007fff62f6a245 dyld::initializeMainExecutable() + 187
17 dyld 0x00007fff62f6dbe1 dyld::main(macho_header const, unsigned long, int, char const
, char const
, char const__, unsigned long_) + 2716
18 dyld 0x00007fff62f69276 dyldbootstrap::start(macho_header const_, int, char const__, long, macho_header const_, unsigned long*) + 512
19 dyld 0x00007fff62f69036 _dyld_start + 54

Binary Images:
0x7fff62f68000 - 0x7fff62f9e837 dyld (353.2.1) <65dccb06-339c-3e25-9702-600a28291d0e> /usr/lib/dyld
0x7fff8a162000 - 0x7fff8a163fff libsystem_secinit.dylib (18) <581dad0f-6b63-3a48-b63b-917af799abaa> /usr/lib/system/libsystem_secinit.dylib
0x7fff8ccaa000 - 0x7fff8ccd4ff7 libdispatch.dylib (442.1.4) <502cf32b-669b-3709-8862-08188225e4f0> /usr/lib/system/libdispatch.dylib
0x7fff8fa3b000 - 0x7fff8fa58fff libsystem_kernel.dylib (2782.10.72) <97cd7acd-ea0c-3434-befc-fcd013d6bb73> /usr/lib/system/libsystem_kernel.dylib
0x7fff90004000 - 0x7fff90005fff libSystem.B.dylib (1213) <90b107bc-ff74-32cc-b1cf-4e02f544d957> /usr/lib/libSystem.B.dylib

I am using the following entitlements:

entitlements.child
`

com.apple.security.app-sandbox com.apple.security.inherit `

entitlements.parent
`

com.apple.security.app-sandbox com.apple.security.network.client com.apple.security.network.server com.apple.security.files.user-selected.read-write com.apple.security.temporary-exception.files.absolute-path.read-write /private/tmp/ /private/var/tmp/ /private/var/folders/ml/ `

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.