-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·122 lines (104 loc) · 3.23 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·122 lines (104 loc) · 3.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/bin/bash
# BC64Keys Build Script - Clean build
echo "🧹 Cleaning old builds..."
rm -rf BC64Keys BC64Keys.app BC64Keys.dSYM 2>/dev/null
echo "🔨 Building BC64Keys..."
# Build for both ARM64 (Apple Silicon) and x86_64 (Intel)
echo " - Building for ARM64 (Apple Silicon)..."
swiftc Sources/BC64Keys/Localization.swift \
Sources/BC64Keys/BC64KeysApp.swift \
-o BC64Keys_arm64 \
-framework SwiftUI \
-framework AppKit \
-framework Carbon \
-parse-as-library \
-target arm64-apple-macos13.0 \
-O
if [ $? -ne 0 ]; then
echo "❌ ARM64 build failed!"
exit 1
fi
echo " - Building for x86_64 (Intel)..."
swiftc Sources/BC64Keys/Localization.swift \
Sources/BC64Keys/BC64KeysApp.swift \
-o BC64Keys_x86_64 \
-framework SwiftUI \
-framework AppKit \
-framework Carbon \
-parse-as-library \
-target x86_64-apple-macos13.0 \
-O
if [ $? -ne 0 ]; then
echo "❌ x86_64 build failed!"
exit 1
fi
echo " - Creating Universal Binary..."
lipo -create BC64Keys_arm64 BC64Keys_x86_64 -output BC64Keys_tmp
rm BC64Keys_arm64 BC64Keys_x86_64
if [ $? -ne 0 ]; then
echo "❌ Universal binary creation failed!"
exit 1
fi
echo "✅ Compilation successful!"
# Create app bundle structure
echo "📦 Creating app bundle..."
mkdir -p BC64Keys.app/Contents/MacOS
mkdir -p BC64Keys.app/Contents/Resources
# Move binary to app bundle
mv BC64Keys_tmp BC64Keys.app/Contents/MacOS/BC64Keys
# Copy app icon if available
if [ -f "AppIcon.icns" ]; then
cp AppIcon.icns BC64Keys.app/Contents/Resources/
echo "✅ App icon added"
fi
# Create Info.plist
cat > BC64Keys.app/Contents/Info.plist << 'EOF'
<?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>CFBundleExecutable</key>
<string>BC64Keys</string>
<key>CFBundleIdentifier</key>
<string>com.bc64.BC64Keys</string>
<key>CFBundleName</key>
<string>BC64Keys</string>
<key>CFBundleDisplayName</key>
<string>BC64Keys</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.7.0</string>
<key>CFBundleVersion</key>
<string>8</string>
<key>CFBundleIconFile</key>
<string>AppIcon</string>
<key>LSMinimumSystemVersion</key>
<string>13.0</string>
<key>NSHighResolutionCapable</key>
<true/>
</dict>
</plist>
EOF
# Create PkgInfo
echo -n "APPL????" > BC64Keys.app/Contents/PkgInfo
echo "✅ App bundle created!"
# Code sign the app with a stable identifier
echo "🔏 Signing app..."
# Using a designated requirement to make the signature more stable
codesign --force --deep --sign - --identifier "com.bc64.BC64Keys" BC64Keys.app
if [ $? -eq 0 ]; then
echo "✅ App signed successfully!"
# Verify signature
codesign -dv BC64Keys.app 2>&1 | grep -E "Identifier|Signature"
else
echo "⚠️ Code signing failed (continuing anyway)"
fi
echo ""
echo "✅ BUILD COMPLETE!"
echo "📱 App location: BC64Keys.app"
echo "🚀 Run with: open BC64Keys.app"
echo ""
echo "⚠️ IMPORTANT: Grant Accessibility permissions!"
echo " System Settings > Privacy & Security > Accessibility"
echo " Add: BC64Keys (this app)"