跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

test-account-device.sh

31 行 · 1.6 KB历史下载
1#!/usr/bin/env bash
2set -euo pipefail
3cd "$(dirname "$0")/.."
4temporary="$(mktemp -d)"
5trap 'rm -rf "$temporary"' EXIT
6binary="$temporary/account-device-tests"
7case "${1:-}" in
8 '') ;;
9 --biometric)
10 : "${CAGE_SIGNING_IDENTITY:?Biometric tests require a Developer ID identity}"
11 : "${CAGE_PROVISIONING_PROFILE:?Biometric tests require a provisioning profile}"
12 bundle="$temporary/Cage.app"
13 mkdir -p "$bundle/Contents/MacOS"
14 cp "$CAGE_PROVISIONING_PROFILE" "$bundle/Contents/embedded.provisionprofile"
15 cat > "$bundle/Contents/Info.plist" <<'PLIST'
16<?xml version="1.0" encoding="UTF-8"?><plist version="1.0"><dict><key>CFBundleIdentifier</key><string>io.github.lee-xeo.claude-cage</string><key>CFBundleExecutable</key><string>Cage</string><key>CFBundlePackageType</key><string>APPL</string></dict></plist>
17PLIST
18 binary="$bundle/Contents/MacOS/Cage"
19 ;;
20 *) echo 'Usage: scripts/test-account-device.sh [--biometric]' >&2; exit 2 ;;
21esac
22swiftc -O -parse-as-library -framework Security -framework LocalAuthentication \
23 desktop/AccountDevice.swift desktop/AccountDeviceTests.swift -o "$binary"
24if [[ "${1:-}" == --biometric ]]; then
25 codesign --force --sign "$CAGE_SIGNING_IDENTITY" --timestamp=none "$binary"
26 signing_team="$(codesign -dv --verbose=4 "$binary" 2>&1 | sed -n 's/^TeamIdentifier=//p')"
27 bash scripts/prepare-account-signing.sh "$CAGE_PROVISIONING_PROFILE" "$signing_team" "$temporary/account.entitlements"
28 codesign --force --sign "$CAGE_SIGNING_IDENTITY" --options runtime --timestamp=none \
29 --entitlements "$temporary/account.entitlements" "$bundle"
30fi
31"$binary" "$@"