#!/bin/zsh # CoinPoker MIT dem Relais starten - vollautomatisch: # 1. Lib bauen, falls noetig (Quelle neuer als Binary). # 2. Signatur oeffnen, falls das Spiel noch Hardened-signiert ist (nach einem Client-Update). # 3. Client starten; DYLD_INSERT_LIBRARIES wird an die Tischprozesse vererbt. # Die Lib legt je Tisch /tmp/-mitte an - genau den Namen sucht hand/tischkanal schon # (kanal_da True), also traegt der Zug-Kanal im Turnier ohne weiteren Umbau. set -e HIER="$(cd "$(dirname "$0")" && pwd)" GAME="/Applications/CoinPoker.app/Contents/Resources/unity-resources-arm64/CoinPoker Game.app" # 1. Lib bauen, wenn sie fehlt oder die Quelle neuer ist. if [ ! -f "$HIER/relais.dylib" ] || [ "$HIER/relais.c" -nt "$HIER/relais.dylib" ]; then "$HIER/bauen.sh" fi # 2. Automatisch patchen, wenn das Spiel Hardened-signiert ist (dann ignoriert dyld die Lib). # Nach einem Client-Update ist die Original-Signatur zurueck -> hier einmal neu oeffnen. if codesign -dv "$GAME/Contents/MacOS/CoinPoker" 2>&1 | grep -q "(runtime)"; then echo "Spiel ist Hardened-signiert - oeffne die Signatur fuer das Relais ..." "$HIER/signatur_oeffnen.sh" fi # 3. Client mit injizierter Lib starten. export DYLD_INSERT_LIBRARIES="$HIER/relais.dylib" exec "/Applications/CoinPoker.app/Contents/MacOS/CoinPoker" --remote-debugging-port=9333