LighthouseApp/install_bearvpn.sh
speakeloudest 75d4c48e41
Some checks failed
Build Windows / build (push) Has been cancelled
feat: 源码提交
2025-10-19 23:30:54 -07:00

69 lines
1.8 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# BearVPN 安装脚本
# 此脚本帮助用户在 macOS 上安全安装 BearVPN
echo "🐻 BearVPN 安装助手"
echo "===================="
echo ""
# 检查是否在正确的目录
if [ ! -f "BearVPN.app/Contents/Info.plist" ]; then
echo "❌ 错误:请在包含 BearVPN.app 的目录中运行此脚本"
exit 1
fi
echo "📱 正在检查应用..."
APP_PATH="./BearVPN.app"
# 检查应用是否存在
if [ ! -d "$APP_PATH" ]; then
echo "❌ 错误:找不到 BearVPN.app"
exit 1
fi
echo "✅ 找到 BearVPN.app"
# 移除隔离属性
echo "🔓 正在移除隔离属性..."
sudo xattr -rd com.apple.quarantine "$APP_PATH"
if [ $? -eq 0 ]; then
echo "✅ 隔离属性已移除"
else
echo "⚠️ 警告:无法移除隔离属性,请手动操作"
fi
# 检查签名状态
echo "🔍 检查应用签名状态..."
codesign -dv "$APP_PATH" 2>&1 | grep -q "Developer ID"
if [ $? -eq 0 ]; then
echo "✅ 应用已使用开发者证书签名"
else
echo "⚠️ 应用未使用开发者证书签名"
fi
# 移动到应用程序文件夹
echo "📁 正在安装到应用程序文件夹..."
if [ -d "/Applications/BearVPN.app" ]; then
echo "⚠️ 发现已存在的 BearVPN正在备份..."
mv "/Applications/BearVPN.app" "/Applications/BearVPN.app.backup.$(date +%Y%m%d_%H%M%S)"
fi
cp -R "$APP_PATH" "/Applications/"
if [ $? -eq 0 ]; then
echo "✅ BearVPN 已安装到 /Applications/"
else
echo "❌ 安装失败"
exit 1
fi
echo ""
echo "🎉 安装完成!"
echo ""
echo "📋 如果应用无法打开,请尝试以下步骤:"
echo "1. 右键点击 BearVPN.app → '打开'"
echo "2. 在系统偏好设置 → 安全性与隐私 → 允许从以下位置下载的应用 → 选择 '任何来源'"
echo "3. 或者运行sudo spctl --master-disable"
echo ""
echo "🔧 如需帮助,请联系技术支持"