Skip to content

Commit ddede61

Browse files
authored
Swift macOS DMG: classic drag-to-Applications layout (#5440)
## Summary - switch DMG icon layout to match Finder-style drag/install UX (Applications on left, app on right) - remove `--skip-jenkins` so `create-dmg` applies background and icon positioning in CI - update DMG background arrow to a black left-pointing arrow ## Why This makes the install action visually obvious in the DMG window and matches the requested style.
2 parents 880fd78 + 090f54e commit ddede61

File tree

4 files changed

+32
-5
lines changed

4 files changed

+32
-5
lines changed

codemagic.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2155,6 +2155,9 @@ workflows:
21552155
21562156
# Write runtime .env from OMI_DESKTOP_APP_ENV secret (base64-encoded .env.app contents)
21572157
echo "$OMI_DESKTOP_APP_ENV" | base64 --decode > "$APP_BUNDLE/Contents/Resources/.env"
2158+
# Never ship shared Anthropic API keys inside production app bundles.
2159+
# Anthropic access must come from backend or user OAuth mode.
2160+
sed -i '' '/^ANTHROPIC_API_KEY=/d' "$APP_BUNDLE/Contents/Resources/.env"
21582161
echo "App bundle created: $APP_BUNDLE"
21592162
21602163
- name: Sign app
@@ -2300,11 +2303,10 @@ workflows:
23002303
--window-pos 200 120 \
23012304
--window-size 610 365 \
23022305
--icon-size 80 \
2303-
--icon "$APP_NAME.app" 155 175 \
2306+
--icon "$APP_NAME.app" 455 175 \
23042307
--hide-extension "$APP_NAME.app" \
2305-
--app-drop-link 455 175 \
2308+
--app-drop-link 155 175 \
23062309
--no-internet-enable \
2307-
--skip-jenkins \
23082310
$BG_ARGS \
23092311
"$DMG_PATH" \
23102312
"$STAGING_DIR/$APP_NAME.app"

desktop/Desktop/Sources/AppState.swift

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,11 @@ class AppState: ObservableObject {
391391
}
392392

393393
private func loadEnvironment() {
394+
let bundledEnvPath = Bundle.main.path(forResource: ".env", ofType: nil)
395+
394396
// Try to load from .env file in various locations
395397
let envPaths = [
396-
Bundle.main.path(forResource: ".env", ofType: nil),
398+
bundledEnvPath,
397399
FileManager.default.currentDirectoryPath + "/.env",
398400
NSHomeDirectory() + "/.hartford.env",
399401
NSHomeDirectory() + "/.omi.env",
@@ -411,6 +413,10 @@ class AppState: ObservableObject {
411413
let key = String(parts[0]).trimmingCharacters(in: .whitespaces)
412414
// Skip comments
413415
guard !key.hasPrefix("#") else { continue }
416+
if shouldSkipBundledAnthropicKey(key: key, sourcePath: path, bundledEnvPath: bundledEnvPath) {
417+
log(" Skipped ANTHROPIC_API_KEY from bundled .env (prod safety)")
418+
continue
419+
}
414420
let value = String(parts[1]).trimmingCharacters(in: .whitespaces)
415421
.trimmingCharacters(in: CharacterSet(charactersIn: "\"'"))
416422
setenv(key, value, 1)
@@ -432,6 +438,14 @@ class AppState: ObservableObject {
432438
}
433439
}
434440

441+
private func shouldSkipBundledAnthropicKey(key: String, sourcePath: String, bundledEnvPath: String?) -> Bool {
442+
guard key == "ANTHROPIC_API_KEY" else { return false }
443+
guard let bundledEnvPath, sourcePath == bundledEnvPath else { return false }
444+
let bundleId = Bundle.main.bundleIdentifier ?? ""
445+
let isProductionBundle = bundleId == "com.omi.computer-macos"
446+
return isProductionBundle
447+
}
448+
435449
func openScreenRecordingPreferences() {
436450
ScreenCaptureService.openScreenRecordingPreferences()
437451
}

desktop/Desktop/Sources/ProactiveAssistants/ProactiveAssistantsPlugin.swift

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,9 @@ public class ProactiveAssistantsPlugin: NSObject {
126126
// MARK: - Environment Loading
127127

128128
private func loadEnvironment() {
129+
let bundledEnvPath = Bundle.main.path(forResource: ".env", ofType: nil)
129130
let envPaths = [
130-
Bundle.main.path(forResource: ".env", ofType: nil),
131+
bundledEnvPath,
131132
FileManager.default.currentDirectoryPath + "/.env",
132133
NSHomeDirectory() + "/.omi.env",
133134
NSHomeDirectory() + "/.hartford.env"
@@ -139,6 +140,9 @@ public class ProactiveAssistantsPlugin: NSObject {
139140
let parts = line.split(separator: "=", maxSplits: 1)
140141
if parts.count == 2 {
141142
let key = String(parts[0]).trimmingCharacters(in: .whitespaces)
143+
if shouldSkipBundledAnthropicKey(key: key, sourcePath: path, bundledEnvPath: bundledEnvPath) {
144+
continue
145+
}
142146
let value = String(parts[1]).trimmingCharacters(in: .whitespaces)
143147
.trimmingCharacters(in: CharacterSet(charactersIn: "\"'"))
144148
setenv(key, value, 1)
@@ -150,6 +154,13 @@ public class ProactiveAssistantsPlugin: NSObject {
150154
}
151155
}
152156

157+
private func shouldSkipBundledAnthropicKey(key: String, sourcePath: String, bundledEnvPath: String?) -> Bool {
158+
guard key == "ANTHROPIC_API_KEY" else { return false }
159+
guard let bundledEnvPath, sourcePath == bundledEnvPath else { return false }
160+
let bundleId = Bundle.main.bundleIdentifier ?? ""
161+
return bundleId == "com.omi.computer-macos"
162+
}
163+
153164
// MARK: - Assistant Management
154165

155166
private func enableAssistant(identifier: String, enabled: Bool) {

desktop/dmg-assets/background.png

-4.14 KB
Loading

0 commit comments

Comments
 (0)