AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.
HTML ai-agentcloudflarecloudflare-d1cloudflare-r2cloudflare-workersdockerelectronevernoteevernote-alternativeknowledge-basemcpnote-takingobsidian-alternativeoffline-firstpersonal-knowledge-basepwaself-hostedsqlitetiptapweb-clipper
fix(desktop): launch WeChat share extension with system entry point
tianma-if615a25f50193
diff --git a/apps/desktop/share-extension/ShareViewController.swift b/apps/desktop/share-extension/ShareViewController.swiftindex 53aa3ced..c3337a8f 100644--- a/apps/desktop/share-extension/ShareViewController.swift+++ b/apps/desktop/share-extension/ShareViewController.swift@@ -38,10 +38,10 @@ final class ShareViewController: NSViewController {guard let url = shareURL(for: destination) else {throw CocoaError(.fileWriteUnknown)}- if let context = extensionContext {- _ = await context.open(url)- context.completeRequest(returningItems: nil)+ guard let context = extensionContext, await context.open(url) else {+ throw CocoaError(.fileReadUnknown)}+ context.completeRequest(returningItems: nil)} catch {extensionContext?.cancelRequest(withError: error)}diff --git a/scripts/build-macos-share-extension.sh b/scripts/build-macos-share-extension.shindex 0afb0a72..e6cc14fc 100755--- a/scripts/build-macos-share-extension.sh+++ b/scripts/build-macos-share-extension.sh@@ -30,12 +30,19 @@ sed \plutil -lint "$appex/Contents/Info.plist" >/dev/nullswiftc \-O \+ -parse-as-library \+ -application-extension \-target "$target" \-sdk "$sdk" \-module-name EdgeEverShare \-emit-executable \+ -Xlinker -e -Xlinker _NSExtensionMain \-o "$appex/Contents/MacOS/EdgeEverShare" \"$source_directory/ShareViewController.swift"+if ! xcrun nm -u "$appex/Contents/MacOS/EdgeEverShare" | grep -q '_NSExtensionMain'; then+ echo "Share extension is missing the NSExtensionMain entry point" >&2+ exit 1+fichmod 755 "$appex/Contents/MacOS/EdgeEverShare"codesign \--force \diff --git a/scripts/verify-desktop-package.mjs b/scripts/verify-desktop-package.mjsindex e7f4bd13..1602751d 100644--- a/scripts/verify-desktop-package.mjs+++ b/scripts/verify-desktop-package.mjs@@ -96,6 +96,9 @@ if (requestedPlatform === "darwin") {const shareExtension = join(unpackedApp, "Contents", "PlugIns", "EdgeEverShare.appex", "Contents", "MacOS", "EdgeEverShare");assert.ok(existsSync(shareExtension), `macOS app bundle is missing the WeChat share extension: ${shareExtension}`);verifyMachOArch(shareExtension, requestedArch, "WeChat share extension");+ const extensionSymbols = spawnSync("nm", ["-u", shareExtension], { encoding: "utf8" });+ assert.equal(extensionSymbols.status, 0, `WeChat share extension symbol inspection failed: ${extensionSymbols.stderr || extensionSymbols.stdout}`);+ assert.match(extensionSymbols.stdout, /\b_NSExtensionMain\b/, "WeChat share extension must use the system extension entry point");const shareExtensionInfo = readFileSync(join(unpackedApp, "Contents", "PlugIns", "EdgeEverShare.appex", "Contents", "Info.plist"), "utf8");assert.match(shareExtensionInfo, /com\.apple\.share-services/, "WeChat share extension must register a share service");assert.match(shareExtensionInfo, /NSExtensionActivationSupportsFileWithMaxCount/, "WeChat share extension must accept shared files");