From cc6eae55d926b3eddb5b150e2d845b6a92c2425a Mon Sep 17 00:00:00 2001 From: josc146 Date: Sat, 25 Mar 2023 09:48:02 +0800 Subject: [PATCH] build: adjust to comply with apple's review policy --- .github/workflows/tagged-release.yml | 2 +- safari/appdmg.json | 4 ++-- safari/build.sh | 10 ++++++---- safari/project.patch | 8 ++++---- safari/project.pre.patch | 19 +++++++++++++++++++ 5 files changed, 32 insertions(+), 11 deletions(-) create mode 100644 safari/project.pre.patch diff --git a/.github/workflows/tagged-release.yml b/.github/workflows/tagged-release.yml index e2f5f09..c6bcca7 100644 --- a/.github/workflows/tagged-release.yml +++ b/.github/workflows/tagged-release.yml @@ -44,11 +44,11 @@ jobs: with: node-version: 18 - run: npm ci - - run: npm run build - uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: 14.2 + - run: sed -i '' "s/0.0.0/${{ env.VERSION }}/g" safari/project.pre.patch - run: sed -i '' "s/0.0.0/${{ env.VERSION }}/g" safari/project.patch - run: npm run build:safari diff --git a/safari/appdmg.json b/safari/appdmg.json index 9f1d3c6..48006c0 100644 --- a/safari/appdmg.json +++ b/safari/appdmg.json @@ -1,8 +1,8 @@ { - "title": "ChatGPTBox", + "title": "Fission - ChatBox", "icon": "../src/logo.png", "contents": [ { "x": 448, "y": 344, "type": "link", "path": "/Applications" }, - { "x": 192, "y": 344, "type": "file", "path": "../build/chatGPTBox.app" } + { "x": 192, "y": 344, "type": "file", "path": "../build/Fission - ChatBox.app" } ] } diff --git a/safari/build.sh b/safari/build.sh index 8095f81..a576611 100644 --- a/safari/build.sh +++ b/safari/build.sh @@ -1,10 +1,12 @@ +git apply safari/project.pre.patch +npm run build xcrun safari-web-extension-converter ./build/firefox \ - --project-location ./build/safari --app-name chatGPTBox \ + --project-location ./build/safari --app-name "Fission - ChatBox" \ --bundle-identifier dev.josStorer.chatGPTBox --force --no-prompt --no-open git apply safari/project.patch -xcodebuild archive -project ./build/safari/chatGPTBox/chatGPTBox.xcodeproj \ - -scheme "chatGPTBox (macOS)" -configuration Release -archivePath ./build/safari/chatGPTBox.xcarchive -xcodebuild -exportArchive -archivePath ./build/safari/chatGPTBox.xcarchive \ +xcodebuild archive -project "./build/safari/Fission - ChatBox/Fission - ChatBox.xcodeproj" \ + -scheme "Fission - ChatBox (macOS)" -configuration Release -archivePath "./build/safari/Fission - ChatBox.xcarchive" +xcodebuild -exportArchive -archivePath "./build/safari/Fission - ChatBox.xcarchive" \ -exportOptionsPlist ./safari/export-options.plist -exportPath ./build npm install -D appdmg rm ./build/safari.dmg diff --git a/safari/project.patch b/safari/project.patch index ee097ed..f12cffd 100644 --- a/safari/project.patch +++ b/safari/project.patch @@ -1,5 +1,5 @@ ---- a/build/safari/chatGPTBox/chatGPTBox.xcodeproj/project.pbxproj -+++ b/build/safari/chatGPTBox/chatGPTBox.xcodeproj/project.pbxproj +--- a/build/safari/Fission - ChatBox/Fission - ChatBox.xcodeproj/project.pbxproj ++++ b/build/safari/Fission - ChatBox/Fission - ChatBox.xcodeproj/project.pbxproj @@ -825,7 +825,7 @@ "@executable_path/../../../../Frameworks", ); @@ -19,11 +19,11 @@ + ); ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_ENTITLEMENTS = "macOS (App)/chatGPTBox.entitlements"; + CODE_SIGN_ENTITLEMENTS = "macOS (App)/Fission - ChatBox.entitlements"; @@ -887,6 +891,7 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "macOS (App)/Info.plist"; - INFOPLIST_KEY_CFBundleDisplayName = "chatGPTBox"; + INFOPLIST_KEY_CFBundleDisplayName = "Fission - ChatBox"; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INFOPLIST_KEY_NSMainStoryboardFile = Main; INFOPLIST_KEY_NSPrincipalClass = NSApplication; diff --git a/safari/project.pre.patch b/safari/project.pre.patch new file mode 100644 index 0000000..c21ee90 --- /dev/null +++ b/safari/project.pre.patch @@ -0,0 +1,19 @@ +--- a/src/manifest.v2.json ++++ b/src/manifest.v2.json +@@ -1,5 +1,5 @@ + { +- "name": "ChatGPTBox", ++ "name": "Fission - ChatBox", + "description": "Integrating ChatGPT into your browser deeply, everything you need is here", + "version": "0.0.0", + "manifest_version": 2, +@@ -17,7 +17,8 @@ + "background": { + "scripts": [ + "background.js" +- ] ++ ], ++ "persistent": false + }, + "browser_action": { + "default_popup": "popup.html"