mirror of
https://github.com/yang991178/fluent-reader.git
synced 2025-03-18 04:10:13 +01:00
publish to mac app store
This commit is contained in:
parent
b1f4b7c613
commit
df7ddf5a00
3
.gitignore
vendored
3
.gitignore
vendored
@ -4,4 +4,5 @@ dist/*.js.map
|
||||
dist/*.html
|
||||
bin/*
|
||||
package-lock.json
|
||||
.DS_Store
|
||||
.DS_Store
|
||||
*.provisionprofile
|
10
build/entitlements.mas.inherit.plist
Normal file
10
build/entitlements.mas.inherit.plist
Normal file
@ -0,0 +1,10 @@
|
||||
<?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/>
|
||||
<key>com.apple.security.cs.allow-jit</key><true/>
|
||||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key><true/>
|
||||
</dict>
|
||||
</plist>
|
7
build/entitlements.mas.loginhelper.plist
Normal file
7
build/entitlements.mas.loginhelper.plist
Normal file
@ -0,0 +1,7 @@
|
||||
<?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/>
|
||||
</dict>
|
||||
</plist>
|
18
build/entitlements.mas.plist
Normal file
18
build/entitlements.mas.plist
Normal file
@ -0,0 +1,18 @@
|
||||
<?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.application-groups</key>
|
||||
<array>
|
||||
<string>EM8VE646TZ.DevHYLiu.FluentReader</string>
|
||||
</array>
|
||||
<!-- Put any entitlements your app requires here. Below is a example -->
|
||||
<key>com.apple.security.network.client</key><true/>
|
||||
<key>com.apple.security.files.user-selected.read-write</key><true/>
|
||||
<key>com.apple.security.files.user-selected.read-only</key><true/>
|
||||
<key>com.apple.security.cs.allow-jit</key><true/>
|
||||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key><true/>
|
||||
<key>com.apple.security.cs.allow-dyld-environment-variables</key><true/>
|
||||
</dict>
|
||||
</plist>
|
31
build/resignAndPackage.sh
Normal file
31
build/resignAndPackage.sh
Normal file
@ -0,0 +1,31 @@
|
||||
printf "......................\nresignAndPackage start\n\n"
|
||||
|
||||
# Name of your app.
|
||||
APP="Fluent Reader"
|
||||
# Your Certificate name.
|
||||
CERT="Jieyu Yan (EM8VE646TZ)"
|
||||
# The path of your app to sign.
|
||||
APP_PATH="/Users/bruce/Documents/repos/fluent-reader/bin/darwin/x64/mas/$APP.app"
|
||||
# The path to the location you want to put the signed package.
|
||||
RESULT_PATH="/Users/bruce/Documents/repos/fluent-reader/bin/darwin/x64/mas/$APP-mac_store.pkg"
|
||||
# The name of certificates you requested.
|
||||
APP_KEY="3rd Party Mac Developer Application: $CERT"
|
||||
INSTALLER_KEY="3rd Party Mac Developer Installer: $CERT"
|
||||
# The path of your plist files.
|
||||
PARENT_PLIST="build/entitlements.mas.plist"
|
||||
CHILD_PLIST="build/entitlements.mas.inherit.plist"
|
||||
LOGINHELPER_PLIST="build/entitlements.mas.loginhelper.plist"
|
||||
FRAMEWORKS_PATH="$APP_PATH/Contents/Frameworks"
|
||||
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/Electron Framework.framework/Versions/A/Electron Framework"
|
||||
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/Electron Framework.framework/Versions/A/Libraries/libffmpeg.dylib"
|
||||
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/Electron Framework.framework/Libraries/libffmpeg.dylib"
|
||||
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/Electron Framework.framework"
|
||||
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/$APP Helper.app/Contents/MacOS/$APP Helper"
|
||||
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/$APP Helper.app/"
|
||||
codesign -s "$APP_KEY" -f --entitlements "$LOGINHELPER_PLIST" "$APP_PATH/Contents/Library/LoginItems/$APP Login Helper.app/Contents/MacOS/$APP Login Helper"
|
||||
codesign -s "$APP_KEY" -f --entitlements "$LOGINHELPER_PLIST" "$APP_PATH/Contents/Library/LoginItems/$APP Login Helper.app/"
|
||||
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$APP_PATH/Contents/MacOS/$APP"
|
||||
codesign -s "$APP_KEY" -f --entitlements "$PARENT_PLIST" "$APP_PATH"
|
||||
productbuild --component "$APP_PATH" /Applications --sign "$INSTALLER_KEY" "$RESULT_PATH"
|
||||
|
||||
printf "\nresignAndPackage end\n......................\n"
|
16
package.json
16
package.json
@ -9,6 +9,7 @@
|
||||
"start": "npm run build && npm run electron",
|
||||
"package-win": "electron-builder -w --x64 && electron-builder -w --ia32 && electron-builder -w appx:arm64",
|
||||
"package-mac": "sudo electron-builder --mac",
|
||||
"package-mas": "sudo electron-builder --mac mas && sudo bash build/resignAndPackage.sh",
|
||||
"package-linux": "electron-builder --linux"
|
||||
},
|
||||
"keywords": [],
|
||||
@ -50,9 +51,20 @@
|
||||
"deleteAppDataOnUninstall": true
|
||||
},
|
||||
"mac": {
|
||||
"darkModeSupport": true,
|
||||
"target": [
|
||||
"dmg"
|
||||
]
|
||||
],
|
||||
"category": "public.app-category.news"
|
||||
},
|
||||
"mas": {
|
||||
"appId": "DevHYLiu.FluentReader",
|
||||
"entitlements": "build/entitlements.mas.plist",
|
||||
"entitlementsInherit": "build/entitlements.mas.inherit.plist",
|
||||
"provisioningProfile": "build/embedded.provisionprofile",
|
||||
"hardenedRuntime": false,
|
||||
"gatekeeperAssess": false,
|
||||
"asarUnpack": []
|
||||
},
|
||||
"linux": {
|
||||
"target": [
|
||||
@ -70,7 +82,7 @@
|
||||
"@types/redux-thunk": "^2.1.0",
|
||||
"@types/reselect": "^2.2.0",
|
||||
"@yang991178/rss-parser": "^3.8.1",
|
||||
"electron": "^9.0.4",
|
||||
"electron": "^9.0.5",
|
||||
"electron-builder": "^22.7.0",
|
||||
"electron-react-devtools": "^0.5.3",
|
||||
"electron-store": "^5.2.0",
|
||||
|
@ -3,20 +3,22 @@ import windowStateKeeper = require("electron-window-state")
|
||||
import Store = require("electron-store")
|
||||
import performUpdate from "./scripts/update-scripts"
|
||||
|
||||
const locked = app.requestSingleInstanceLock()
|
||||
if (!locked) {
|
||||
app.quit()
|
||||
if (!process.mas) {
|
||||
const locked = app.requestSingleInstanceLock()
|
||||
if (!locked) {
|
||||
app.quit()
|
||||
}
|
||||
}
|
||||
|
||||
let mainWindow: BrowserWindow
|
||||
let store: Store
|
||||
let restarting: boolean
|
||||
|
||||
function init() {
|
||||
function init(setTheme = true) {
|
||||
restarting = false
|
||||
store = new Store()
|
||||
performUpdate(store)
|
||||
nativeTheme.themeSource = store.get("theme", "system")
|
||||
if (setTheme) nativeTheme.themeSource = store.get("theme", "system")
|
||||
}
|
||||
|
||||
init()
|
||||
@ -96,7 +98,7 @@ app.on("window-all-closed", function () {
|
||||
}
|
||||
mainWindow = null
|
||||
if (restarting) {
|
||||
init()
|
||||
init(false)
|
||||
createWindow()
|
||||
} else if (process.platform !== "darwin") {
|
||||
app.quit()
|
||||
|
@ -161,10 +161,17 @@ export function importAll(path) {
|
||||
Promise.all(promises).then(() => {
|
||||
delete configs.nedb
|
||||
store.clear()
|
||||
let hasTheme = false
|
||||
for (let [key, value] of Object.entries(configs)) {
|
||||
// @ts-ignore
|
||||
store.set(key, value)
|
||||
if (key === THEME_STORE_KEY) {
|
||||
setThemeSettings(value as ThemeSettings)
|
||||
hasTheme = true
|
||||
} else {
|
||||
// @ts-ignore
|
||||
store.set(key, value)
|
||||
}
|
||||
}
|
||||
if (!hasTheme) setThemeSettings(ThemeSettings.Default)
|
||||
ipcRenderer.send("restart")
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user