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

The app cannot be opened safely #965

Closed
Liklei opened this issue Dec 8, 2020 · 3 comments
Closed

The app cannot be opened safely #965

Liklei opened this issue Dec 8, 2020 · 3 comments

Comments

@Liklei
Copy link

Liklei commented Dec 8, 2020

**macOS version: 11.0.1
**Kap version: 3.3.2

Steps to reproduce

  1. I'll package and use this package.json
  2. run command line - "yarn run dist"
  3. The generated DMG files need to be placed on OSS,and then download it locally
  4. The Mac's security and privacy preferences are set to allow the installation of apps from the App Store and approved developers

Current behaviour

The system told me that I couldn't develop the APP because I couldn't verify the developer.Buttons only move to the wastebasket and cancel

Expected behaviour

We're hoping for the following:
Prior to macOS Catalina, opening an app that hasn't been notarized shows a yellow warning icon and asks if you're sure you want to open it:

Other file or link

1、Safely open apps on your Mac
2、package.json

{
   ......
  "build": {
    "appId": "***",
    "productName": "***",
    "copyright": "***",
    "buildDependenciesFromSource": true,
    "generateUpdatesFilesForAllChannels": true,
    "directories": {
      "buildResources": "build",
      "output": "mac"
    },
    "protocols": {
      "name": "***",
      "schemes": [
        "***"
      ]
    },
    "files": [
      "**/*",
      "!renderer",
      "renderer/out"
    ],
    "mac": {
      "target": [
        "dmg"
      ],
      "icon": "./build/china-icon.icns",
      "electronUpdaterCompatibility": ">=2.16",
      "category": "public.app-category.productivity",
      "minimumSystemVersion": "10.12.0",
      "darkModeSupport": true,
      "hardenedRuntime": true,
      "gatekeeperAssess": false,
      "identity": "***",
      "entitlements": "./build/entitlements.mac.plist",
      "entitlementsInherit": "./build/entitlements.mac.inherit.plist",
      "cscLink": "./build/mac.p12",
      "extendInfo": {
        "NSMicrophoneUsageDescription": "CaptureScreenRecorder needs access to the microphone to be able to record audio for screen recordings.",
        "NSCameraUsageDescription": "A CaptureScreenRecorder plugin wants to use the camera.",
        "NSUserNotificationAlertStyle": "alert",
        "CFBundleDocumentTypes": [
          {
            "CFBundleTypeName": "Video",
            "CFBundleTypeRole": "Viewer",
            "LSHandlerRank": "Alternate",
            "LSItemContentTypes": [
              "public.mpeg-4",
              "***"
            ]
          }
        ]
      }
    },
    "dmg": {
      "background": "./build/background.png",
      "icon": "./build/china-icon.icns",
      "iconSize": 70,
      "iconTextSize": 12,
      "sign": false,
      "format": "UDBZ",
      "contents": [
        {
          "x": 180,
          "y": 170
        },
        {
          "x": 480,
          "y": 170,
          "type": "link",
          "path": "/Applications"
        }
      ]
    },
    "afterSign": "./build/notarization.js"
  }
}

3、notarization.js

const fs = require('fs');
const path = require('path');
const electron_notarize = require('electron-notarize');

module.exports = async function (params) {
    if (process.platform !== 'darwin') {
        return;
    }
    let appId = '***'
    let appPath = path.join(params.appOutDir, `${params.packager.appInfo.productFilename}.app`);

    if (!fs.existsSync(appPath)) {
        throw new Error(`Cannot find application at: ${appPath}`);
    }

    try {
        await electron_notarize.notarize({
            appBundleId: appId,
            appPath: appPath,
            appleId: "***",
            appleIdPassword: "***",
        });
    } catch (error) {
        console.error(error);
    }
    console.log(`Done notarizing ${appId}`);
};
@sindresorhus
Copy link
Member

Why are you packaging Kap yourself? We already provide a packaged version of the app.

@Liklei
Copy link
Author

Liklei commented Dec 8, 2020

Why are you packaging Kap yourself? We already provide a packaged version of the app.
I know , I just wanted to give it a try

@sindresorhus
Copy link
Member

We cannot really provide general Electron support here. Packaging works for us, so it must be something with your system.

You could try https://discuss.atom.io/c/electron/11

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

No branches or pull requests

2 participants