Skip to content

Commit 56518a9

Browse files
hacks messing with signing
1 parent 2440958 commit 56518a9

3 files changed

Lines changed: 102 additions & 6 deletions

File tree

.github/workflows/build-and-package.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ jobs:
143143
echo "Building with PyInstaller"
144144
python -m PyInstaller --clean --windowed --name "Jumperless" --distpath dist/macos --workpath build/macos --icon "assets/icons/icon.icns" JumperlessWokwiBridge.py
145145
146+
# Apply launcher script hack BEFORE code signing and notarization
147+
echo "Setting up macOS launcher script hack BEFORE code signing..."
148+
python Scripts/setup_macos_launcher.py
149+
146150
- name: Code Sign macOS App
147151
if: matrix.platform == 'macos'
148152
env:
@@ -354,9 +358,17 @@ jobs:
354358
- **Windows x86**: Jumperless-Windows-x86 (EXE + Python fallback)
355359
356360
### macOS Users - Important Note
357-
If the app is code-signed with a Developer ID, you should be able to run it directly.
358361
359-
**If you get a security warning, try these steps:**
362+
**This release includes properly notarized macOS apps that should run without security warnings.**
363+
364+
**To run the app:**
365+
1. **Double-click** `Jumperless.app` - Opens Terminal automatically for CLI interaction
366+
2. **Or run from Terminal** for direct console output:
367+
```bash
368+
/path/to/Jumperless.app/Contents/MacOS/Jumperless
369+
```
370+
371+
**If you still get a security warning:**
360372
1. Right-click the app and select "Open" to bypass Gatekeeper
361373
2. Or remove the quarantine attribute:
362374
```bash
@@ -377,12 +389,15 @@ jobs:
377389
See the README.md in each package for detailed instructions.
378390
379391
### What's New
392+
- **Full macOS notarization support** - Apps are properly signed and notarized
393+
- **No more macOS security warnings** - Apps run without quarantine issues
380394
- Multi-platform CI/CD pipeline with Windows x86 support
381-
- macOS code signing support (notarization disabled by default for faster builds)
382395
- Improved packaging with modern tools
383396
- Better error handling and logging
384397
- Enhanced platform-specific optimizations
385398
- Linux packages now use tar.gz format
399+
- **macOS Terminal launcher** - Double-click opens Terminal automatically
400+
- **Proper launcher script order** - Applied before code signing to maintain notarization
386401
387402
draft: false
388403
prerelease: ${{ !startsWith(github.ref, 'refs/tags/') }}

Scripts/package_app.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,16 +335,17 @@ def package_platform(platform, arch, output_dir):
335335

336336
# Copy executable if it exists
337337
if platform == "macos":
338-
# Handle .app bundle for macOS with launcher script hack
338+
# Handle .app bundle for macOS without launcher script hack
339339
app_bundle_name = "Jumperless.app"
340340
app_bundle_path = Path(f"dist/{platform}/{app_bundle_name}")
341341
if app_bundle_path.exists():
342342
# Copy the entire .app bundle
343343
shutil.copytree(app_bundle_path, platform_dir / app_bundle_name, dirs_exist_ok=True)
344344
print(f"Copied .app bundle: {app_bundle_name}")
345345

346-
# Implement launcher script hack for persistent terminal
347-
setup_macos_launcher_hack(platform_dir / app_bundle_name)
346+
# Launcher script hack is now applied BEFORE code signing in CI/CD
347+
# Skip it here to avoid modifying the signed app bundle
348+
print("Launcher script hack skipped - applied before code signing in CI/CD workflow")
348349
else:
349350
print(f"Warning: .app bundle not found: {app_bundle_path}")
350351
else:

Scripts/setup_macos_launcher.py

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Setup macOS Launcher Script Hack
4+
Applies the launcher script hack BEFORE code signing and notarization
5+
"""
6+
7+
import os
8+
import shutil
9+
from pathlib import Path
10+
11+
def setup_macos_launcher_hack():
12+
"""
13+
Implement the launcher script hack for macOS to get persistent terminal
14+
This happens BEFORE code signing so the signature applies to the final version
15+
"""
16+
print("Setting up macOS launcher script hack...")
17+
18+
app_path = Path("dist/macos/Jumperless.app")
19+
if not app_path.exists():
20+
print(f"Warning: App bundle not found at {app_path}")
21+
return False
22+
23+
macos_dir = app_path / "Contents" / "MacOS"
24+
original_executable = macos_dir / "Jumperless"
25+
cli_executable = macos_dir / "Jumperless_cli"
26+
27+
if not original_executable.exists():
28+
print(f"Warning: Original executable not found at {original_executable}")
29+
return False
30+
31+
# Rename the original executable to Jumperless_cli
32+
if cli_executable.exists():
33+
cli_executable.unlink()
34+
shutil.move(str(original_executable), str(cli_executable))
35+
print(f"Renamed {original_executable} to {cli_executable}")
36+
37+
# Create launcher script content
38+
launcher_script_content = '''#!/bin/bash
39+
# Jumperless macOS Launcher
40+
# Opens Terminal and runs the CLI application
41+
42+
# Get the directory of this script (inside the app bundle)
43+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
44+
CLI_EXECUTABLE="$SCRIPT_DIR/Jumperless_cli"
45+
46+
# Check if CLI executable exists
47+
if [ ! -f "$CLI_EXECUTABLE" ]; then
48+
echo "Error: CLI executable not found at $CLI_EXECUTABLE"
49+
exit 1
50+
fi
51+
52+
# Use AppleScript to open Terminal and run the CLI app
53+
osascript -e "
54+
tell application \\"Terminal\\"
55+
activate
56+
set newWindow to do script \\"\\"
57+
delay 0.5
58+
do script \\"cd '$SCRIPT_DIR' && ./Jumperless_cli\\" in newWindow
59+
set bounds of front window to {100, 100, 1000, 700}
60+
end tell
61+
"
62+
'''
63+
64+
# Write launcher script
65+
with open(original_executable, 'w') as f:
66+
f.write(launcher_script_content)
67+
68+
# Make launcher script executable
69+
os.chmod(original_executable, 0o755)
70+
print(f"Created launcher script at {original_executable}")
71+
72+
return True
73+
74+
if __name__ == "__main__":
75+
success = setup_macos_launcher_hack()
76+
if success:
77+
print("macOS launcher script hack applied successfully")
78+
else:
79+
print("Failed to apply macOS launcher script hack")
80+
exit(1)

0 commit comments

Comments
 (0)