Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix(macos): strip extended attributes before codesigning

Louis Beaumont1beb68b01c7b
diff --git a/CLAUDE.md b/CLAUDE.md
index 526f8099e..0292f69d1 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -22,3 +22,9 @@
## Testing
- `cargo test` for Rust
- `bun test` for JS/TS
+
+## macOS Dev Builds
+- Dev builds are signed with a developer certificate for consistent permissions
+- Config: `screenpipe-app-tauri/src-tauri/tauri.conf.json` → `bundle.macOS.signingIdentity`
+- This ensures macOS TCC recognizes the app across rebuilds (permissions persist)
+- Other devs without the cert will see permission issues - onboarding has "continue anyway" button after 5s
diff --git a/screenpipe-app-tauri/components/onboarding/status.tsx b/screenpipe-app-tauri/components/onboarding/status.tsx
index 616dc4018..ac8372432 100644
--- a/screenpipe-app-tauri/components/onboarding/status.tsx
+++ b/screenpipe-app-tauri/components/onboarding/status.tsx
@@ -272,26 +272,26 @@ const OnboardingStatus: React.FC<OnboardingStatusProps> = ({
};
const requestPermission = async (type: "screen" | "audio") => {
- // Check if permission is already granted - don't show any popup
- const permStatus = type === "screen"
- ? permissions?.screenRecording
- : permissions?.microphone;
- const isGranted = permStatus === "granted" || permStatus === "notNeeded";
-
- if (isGranted) {
- return; // Already have permission, do nothing
- }
-
try {
- // Just open System Settings - let user toggle there
- // Don't call commands.requestPermission() as it triggers annoying native popup
+ // Always do a fresh permission check before triggering dialog
+ const freshPerms = await commands.doPermissionsCheck(false);
+ const permStatus = type === "screen"
+ ? freshPerms.screenRecording
+ : freshPerms.microphone;
+ const isGranted = permStatus === "granted" || permStatus === "notNeeded";
+
+ if (isGranted) {
+ return; // Already have permission, do nothing
+ }
+
+ // Trigger native permission dialog
if (type === "screen") {
- await commands.openPermissionSettings("screenRecording");
+ await commands.requestPermission("screenRecording");
} else {
- await commands.openPermissionSettings("microphone");
+ await commands.requestPermission("microphone");
}
} catch (error) {
- console.error("Failed to open permission settings:", error);
+ console.error("Failed to request permission:", error);
}
};
@@ -532,7 +532,7 @@ const OnboardingStatus: React.FC<OnboardingStatusProps> = ({
animate={{ opacity: 1 }}
>
<div className="w-6 h-6 border border-foreground border-t-transparent animate-spin" />
- <p className="font-mono text-sm text-muted-foreground">preparing...</p>
+ <p className="font-mono text-sm text-muted-foreground">starting screenpipe...</p>
{isStuck && (
<motion.div
diff --git a/screenpipe-app-tauri/package.json b/screenpipe-app-tauri/package.json
index f14a3cf1d..1ab184d37 100644
--- a/screenpipe-app-tauri/package.json
+++ b/screenpipe-app-tauri/package.json
@@ -11,6 +11,8 @@
"predev": "bun scripts/pre_build.js",
"prebuild": "bun scripts/pre_build.js",
"tauri": "tauri",
+ "tauri:build": "xattr -cr src-tauri 2>/dev/null || true && bun tauri build",
+ "tauri:build:clean": "xattr -cr . 2>/dev/null || true && xattr -cr src-tauri/target 2>/dev/null || true && bun tauri build",
"clean": "rm -rf out && cargo clean && rm -rf src-tauri/{screenpipe-*,tesseract-*,ffmpeg*,bun*,ollama*,ui_monitor*} node_modules"
},
"dependencies": {
diff --git a/screenpipe-app-tauri/scripts/pre_build.js b/screenpipe-app-tauri/scripts/pre_build.js
index 32b05c8e9..a85847cdd 100644
--- a/screenpipe-app-tauri/scripts/pre_build.js
+++ b/screenpipe-app-tauri/scripts/pre_build.js
@@ -437,6 +437,15 @@ if (platform == 'macos') {
console.log('FFMPEG and FFPROBE checks completed');
console.log('Moved and renamed ffmpeg binary for externalBin');
+
+ // Strip extended attributes from all binaries to prevent codesign failures
+ console.log('Stripping extended attributes from binaries...');
+ try {
+ await $`xattr -cr ${cwd}`;
+ console.log('Extended attributes stripped successfully');
+ } catch (error) {
+ console.log('Note: xattr command not available or failed (non-fatal)');
+ }
}
diff --git a/screenpipe-app-tauri/src-tauri/src/permissions.rs b/screenpipe-app-tauri/src-tauri/src/permissions.rs
index 9e498db4b..d46b85f25 100644
--- a/screenpipe-app-tauri/src-tauri/src/permissions.rs
+++ b/screenpipe-app-tauri/src-tauri/src/permissions.rs
@@ -41,9 +41,22 @@ pub async fn request_permission(permission: OSPermission) {
match permission {
OSPermission::ScreenRecording => {
use core_graphics_helmer_fork::access::ScreenCaptureAccess;
- ScreenCaptureAccess.request();
+ // Only request if not already granted
+ if !ScreenCaptureAccess.preflight() {
+ ScreenCaptureAccess.request();
+ }
+ }
+ OSPermission::Microphone => {
+ // Only request if not already granted
+ use nokhwa_bindings_macos::AVAuthorizationStatus;
+ use objc::*;
+ let cls = objc::class!(AVCaptureDevice);
+ let status: AVAuthorizationStatus =
+ unsafe { msg_send![cls, authorizationStatusForMediaType:AVMediaType::Audio.into_ns_str()] };
+ if status != AVAuthorizationStatus::Authorized {
+ request_av_permission(AVMediaType::Audio);
+ }
}
- OSPermission::Microphone => request_av_permission(AVMediaType::Audio),
}
}
}
diff --git a/screenpipe-app-tauri/src-tauri/tauri.conf.json b/screenpipe-app-tauri/src-tauri/tauri.conf.json
index 66cadad96..7e6d2c80b 100644
--- a/screenpipe-app-tauri/src-tauri/tauri.conf.json
+++ b/screenpipe-app-tauri/src-tauri/tauri.conf.json
@@ -36,7 +36,11 @@
],
"resources": [
"assets/*"
- ]
+ ],
+ "macOS": {
+ "signingIdentity": "Apple Development: Louis Beaumont (NJ372MT773)",
+ "entitlements": null
+ }
},
"plugins": {
"updater": {