Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't sign Electron 6 #201

Closed
yoannmoinet opened this issue Aug 17, 2019 · 4 comments
Closed

Can't sign Electron 6 #201

yoannmoinet opened this issue Aug 17, 2019 · 4 comments
Labels

Comments

@yoannmoinet
Copy link

yoannmoinet commented Aug 17, 2019

Hi there, I'm having an issue signing my app after upgrading to Electron 6.0.2.

I'm using:
electron 6.0.2
electron-packager 14.0.4
electron-osx-sign 0.4.12

⚠️ Note 1: It's working with Electron 5.0.9.
⚠️ Note 2: I have a special char in my App Name ê, see #155.

I'm getting an error message at the end of the process, here's the output

Mac: Signing app... {
    "app": "path/release/MyApp-mas-x64/MyApp.app",
    "platform": "mas",
    "hardenedRuntime": true,      <= tried with and without it
    "strict": false,              <= tried with and without it
    "binaries": [
        "path/release/MyApp-mas-x64/MyApp.app/Contents/Plugins/libwidevinecdm.dylib",
        "path/release/MyApp-mas-x64/MyApp.app/Contents/Plugins/PepperFlashPlayer.plugin",
        "path/release/MyApp-mas-x64/MyApp.app/Contents/Plugins/widevinecdmadapter.plugin",
        "path/release/MyApp-mas-x64/MyApp.app/Contents/Helpers/ffmpeg"
    ],
    "entitlements": "path/build/parent.plist",
    "entitlements-inherit": "path/build/child.plist",
    "provisioning-profile": "path/secrets/myappdev.provisionprofile",
    "identity": "** redacted **'",
    "type": "development"
}
ERROR:  Command failed: codesign --verify --deep --strict --verbose=2 path/release/MyApp-mas-x64/MyApp.app
--prepared:path/release/MyApp-mas-x64/MyApp.app/Contents/Library/LoginItems/MyApp Login Helper.app
--prepared:path/release/MyApp-mas-x64/MyApp.app/Contents/Frameworks/MyApp Helper.app
--validated:path/release/MyApp-mas-x64/MyApp.app/Contents/Library/LoginItems/MyApp Login Helper.app
--validated:path/release/MyApp-mas-x64/MyApp.app/Contents/Frameworks/MyApp Helper.app
--prepared:path/release/MyApp-mas-x64/MyApp.app/Contents/Frameworks/MyApp Helper (Plugin).app
--prepared:path/release/MyApp-mas-x64/MyApp.app/Contents/Frameworks/MyApp Helper (GPU).app
--prepared:path/release/MyApp-mas-x64/MyApp.app/Contents/Frameworks/MyApp Helper (Renderer).app
--prepared:path/release/MyApp-mas-x64/MyApp.app/Contents/Helpers/ffmpeg
--validated:path/release/MyApp-mas-x64/MyApp.app/Contents/Helpers/ffmpeg
--prepared:path/release/MyApp-mas-x64/MyApp.app/Contents/Frameworks/Electron Framework.framework/Versions/Current/.
--validated:path/release/MyApp-mas-x64/MyApp.app/Contents/Frameworks/Electron Framework.framework/Versions/Current/.
path/release/MyApp-mas-x64/MyApp.app: the sealed resource directory is invalid
In subcomponent: path/release/MyApp-mas-x64/MyApp.app/Contents/Frameworks/MyApp Helper (GPU).app

I'm not sure if I'm missing something or not, here's my signing code for reference if that can help:

const signApp = (pro) => (buildPath) => {
    const pluginsPath = path.join(appPath, './Contents/Plugins');
    const helpersPath = path.join(appPath, './Contents/Helpers');
    const signOpts = {
        app: appPath,
        platform,
        hardenedRuntime: true,      <= tried with and without it
        strict: false,              <= tried with and without it
        binaries: [
            path.join(pluginsPath, './libwidevinecdm.dylib'),
            path.join(pluginsPath, './PepperFlashPlayer.plugin'),
            path.join(pluginsPath, './widevinecdmadapter.plugin'),
            path.join(helpersPath, './ffmpeg')
        ]
    };

    if (platform === 'mas') {
        signOpts.entitlements = pro ? PARENT_PLIST_PATH : PARENT_LITE_PLIST_PATH;
        signOpts['entitlements-inherit'] = CHILD_PLIST_PATH;
    }

    if (platform === 'mas' && !dev) {
        signOpts['provisioning-profile'] = pro ? PROVISIONING_PROFILE : PROVISIONING_LITE_PROFILE;
        signOpts.identity = '** redacted **';
        signOpts.type = 'distribution';
    } else {
        signOpts['provisioning-profile'] = pro ? PROVISIONING_DEV_PROFILE : PROVISIONING_LITE_DEV_PROFILE;
        signOpts.identity = '** redacted **';
        signOpts.type = 'development';
    }

    const flatOpts = {
        app: appPath,
        identity: '** redacted **',
        platform,
        hardenedRuntime: true,
        strict: false,
        pkg: pkgPath
    };

    console.log('Mac: Signing app...', JSON.stringify(signOpts, ' ', 4));

    let signProm = sign.signAsync(signOpts);

    if (platform === 'mas' && !dev) {
        signProm = signProm.then(() => sign.flatAsync(flatOpts))
    }

    return signProm.then(() => {
        console.log('Mac: Signed app.');
        return buildPath;
    });
};

I hope I've given enough details.

@yoannmoinet
Copy link
Author

Has anyone been able to sign an Electron 6 app?

@dev-kg
Copy link

dev-kg commented Aug 26, 2019

Yes same problem for me, I can't sign for electron 6 version

@sethlu sethlu added the question label Sep 9, 2019
@jiasongs
Copy link

Yes same problem for me

@sethlu
Copy link
Contributor

sethlu commented Oct 26, 2019

Working code signed Electron 6 demo here: electron/electron#20405 (comment)

Closing this issue for now. My guess it's due to the special chars in file name 🤔
To have special chars in the app name, it's probably better to localize the app names, instead of changing the actual name of the app bundle name. So the special chars won't be part of a file path.

@sethlu sethlu closed this as completed Oct 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants