mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-06 08:32:51 +08:00
添加 macOS 平台门禁属性导致无法打开应用的修复指引 (#130)
* Fix macOS Gatekeeper issue and provide instructions for running Teyvat Guide on macOS * Update macOS Gatekeeper links in README.md * Update macOS Gatekeeper links in README.md * Improve English translation of README-EN in macos-gatekeeper * Fix language-specific messages in one-click.sh * Fix language-specific messages in one-click.sh * Move the support file * Fix link to macOS Gatekeeper fix guide in README.md * Fix link to macOS Gatekeeper fix guide in README.md * Improve English translation * Update links to macOS Gatekeeper fix guide in README.md
This commit is contained in:
@@ -31,7 +31,9 @@ Game Tool for Genshin Impact player, supports Windows and macOS.
|
||||
<img src="https://get.microsoft.com/images/zh-cn%20dark.svg" alt="download"/>
|
||||
</a>
|
||||
|
||||
> macOS 用户可以通过 Github Release 下载
|
||||
> macOS 用户可以通过 Github Release 下载,可能需要[额外操作](docs/macos-gatekeeper/README.md)以打开。
|
||||
|
||||
> macOS users could download the app from GitHub release, [extra steps](docs/macos-gatekeeper/README-EN.md) are needed to open the app.
|
||||
|
||||
[](https://github.com/BTMuli/TeyvatGuide/releases/latest)
|
||||
|
||||
@@ -92,6 +94,7 @@ Game Tool for Genshin Impact player, supports Windows and macOS.
|
||||
- 资源来源:[项目资源说明](docs/项目资源说明.md)
|
||||
- UIAF:[UIAF v1.1](docs/UIAF.md)
|
||||
- UIGF:[UIGF v3.0](docs/UIGF.md)
|
||||
- [macOS 平台门禁属性导致应用无法打开应用的修复指引](docs/macos-gatekeeper/README.md)
|
||||
|
||||
## 特定项目 / Special Project
|
||||
|
||||
|
||||
63
docs/macos-gatekeeper/README-EN.md
Normal file
63
docs/macos-gatekeeper/README-EN.md
Normal file
@@ -0,0 +1,63 @@
|
||||
[中文版本](./README.md)
|
||||
|
||||
# Special Tips for macOS Users
|
||||
|
||||
Due to Teyvat Guide not being notarized by Apple, some additional steps are required to ensure that Teyvat Guide can run smoothly on the macOS platform.
|
||||
|
||||
> Teyvat Guide is an open-source software based on the MIT license, and all source code is hosted on GitHub. If you have concerns about the security of the software, you can review the source code yourself or download and compile it.
|
||||
|
||||
## Apple's Related Links on "Allowing Apps from Anywhere" and Gatekeeper
|
||||
|
||||
- [Safely open apps on your Mac](https://support.apple.com/102445)
|
||||
- [Gatekeeper and runtime protections in macOS](https://support.apple.com/guide/security/sec5599b66df/)
|
||||
- [Preventing against malware in macOS](https://support.apple.com/guide/security/sec469d47bd8/)
|
||||
|
||||
## Error Prompt
|
||||
|
||||

|
||||
|
||||
Please ensure that Teyvat Guide has been installed, meaning it has been copied to the `/Applications` directory.
|
||||
|
||||
> Note: The "enter password" process described below will not display on the console; only a key icon will appear. Please enter the password based on your intuition and press Enter to confirm.
|
||||
> 
|
||||
|
||||
## Method 1: One-Click Script
|
||||
|
||||
### Step 1: Download the Script
|
||||
|
||||
Download the `one-click.sh` file in this folder, open the terminal, enter `bash /path/to/the/script`, and press Enter. Follow the on-screen instructions.
|
||||
|
||||
> `/path/to/the/script` represents the location where the script is downloaded.
|
||||
|
||||
### Step 2: Launch Teyvat Guide
|
||||
|
||||
Locate the installation location of Teyvat Guide in Finder, **right-click (or hold down the control⌃ key and click)** to choose "Open."
|
||||
|
||||

|
||||
|
||||
## Method 2: Manual Operations
|
||||
|
||||
During the process, you may be asked to enter a password, where "password" refers to the administrator account password:
|
||||
|
||||
1. If you have only one account on your computer, then the "password" is the one you use to log in and unlock your computer;
|
||||
2. If you have multiple accounts on your computer, you should know what "password" means here. :-D
|
||||
|
||||
### Step 1: Enable "Allow Apps from Anywhere"
|
||||
|
||||
Open the terminal, enter `sudo spctl --master-disable` to enable "Allow Apps from Anywhere", and make the selection "Allow applications from **anywhere**" in the "Privacy & Security" section in System Preferences, **you may need to scroll down**.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### Step 2: Clear Gatekeeper Attributes
|
||||
|
||||
Enter `sudo xattr -c /Applications/TeyvatGuide.app` in the terminal to clear the Gatekeeper attributes of Teyvat Guide.
|
||||
|
||||

|
||||
|
||||
### Step 3: Launch Teyvat Guide
|
||||
|
||||
Locate the installation location of Teyvat Guide in Finder, **right-click (or hold down the control⌃ key and click)** to choose "Open."
|
||||
|
||||

|
||||
63
docs/macos-gatekeeper/README.md
Normal file
63
docs/macos-gatekeeper/README.md
Normal file
@@ -0,0 +1,63 @@
|
||||
[English Version](./README-EN.md)
|
||||
|
||||
# 针对 macOS 用户的特殊提示
|
||||
|
||||
由于 Teyvat Guide 没有经过苹果官方公证,故需要进行一些额外的操作来确保 Teyvat Guide 能在 macOS 平台正常运行。
|
||||
|
||||
> Teyvat Guide 是一个**基于 MIT 协议**的开源软件,所有源代码都托管在 GitHub 上,如果您对软件安全性抱有疑虑,可以自行审查源代码或者下载编译打包。
|
||||
|
||||
## Apple 关于任何来源及门禁(`Gatekeeper`)属性的相关链接
|
||||
|
||||
- [在 Mac 上安全地打开 App](https://support.apple.com/102445)
|
||||
- [macOS 中的门禁和运行时保护](https://support.apple.com/guide/security/sec5599b66df/)
|
||||
- [在 macOS 中防范恶意软件](https://support.apple.com/guide/security/sec469d47bd8/)
|
||||
|
||||
## 报错界面
|
||||
|
||||

|
||||
|
||||
下面的所有操作请**确保 Teyvat Guide 已经安装**,即 Teyvat Guide 已经被复制到 `/Applications` 目录下。
|
||||
|
||||
> 注:下面所述的“输入密码”过程不会在控制台上显示,仅会显示一个钥匙图标,请~~凭感觉~~输入后按回车键确认。
|
||||
> 
|
||||
|
||||
## Method 1 一键脚本
|
||||
|
||||
### Step 1 下载脚本
|
||||
|
||||
下载此文件夹中的 `one-click.sh`,打开终端,输入`bash /path/to/the/script`后回车,按照屏幕提示操作。
|
||||
|
||||
> `/path/to/the/script` 表示下载的脚本的位置。
|
||||
|
||||
### Step 2 启动 Teyvat Guide
|
||||
|
||||
在访达中找到 Teyvat Guide 的安装位置,**右键(或按住键盘上的control⌃并点击)选择打开**。
|
||||
|
||||

|
||||
|
||||
## Method 2 手动操作
|
||||
|
||||
过程中可能会要求输入密码,此处的“密码”指的是管理员账户的密码:
|
||||
|
||||
1. 如果你的电脑只有一个账户,那么“密码”就是你登录解锁电脑的密码;
|
||||
2. 如果你的电脑不止一个账号,那么你应该知道此处“密码”的含义。:-D
|
||||
|
||||
### Step 1 开启“任何来源”
|
||||
|
||||
打开终端,输入`sudo spctl --master-disable`开启“任何来源”,并在设置中的“安全与隐私”部分进行选择,**你可能需要向下滑动**。
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### Step 2 清除门禁属性
|
||||
|
||||
在终端输入`sudo xattr -c /Applications/TeyvatGuide.app`清除 Teyvat Guide 的 `Gatekeeper` 属性。
|
||||
|
||||

|
||||
|
||||
### Step 3 启动 Teyvat Guide
|
||||
|
||||
在访达中找到 Teyvat Guide 的安装位置,**右键(或按住键盘上的control⌃并点击)选择打开**。
|
||||
|
||||

|
||||
BIN
docs/macos-gatekeeper/error.png
Normal file
BIN
docs/macos-gatekeeper/error.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 47 KiB |
BIN
docs/macos-gatekeeper/gatekeeper-settings.png
Normal file
BIN
docs/macos-gatekeeper/gatekeeper-settings.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 306 KiB |
BIN
docs/macos-gatekeeper/gatekeeper.png
Normal file
BIN
docs/macos-gatekeeper/gatekeeper.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 193 KiB |
65
docs/macos-gatekeeper/one-click.sh
Normal file
65
docs/macos-gatekeeper/one-click.sh
Normal file
@@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
printf '\e[8;45;65t'
|
||||
clear
|
||||
BLACK="\033[0;30m"
|
||||
DARK_GRAY="\033[1;30m"
|
||||
BLUE="\033[0;34m"
|
||||
LIGHT_BLUE="\033[1;34m"
|
||||
GREEN="\033[0;32m"
|
||||
LIGHT_GREEN="\033[1;32m"
|
||||
CYAN="\033[0;36m"
|
||||
LIGHT_CYAN="\033[1;36m"
|
||||
RED="\033[0;31m"
|
||||
LIGHT_RED="\033[1;31m"
|
||||
PURPLE="\033[0;35m"
|
||||
LIGHT_PURPLE="\033[1;35m"
|
||||
BROWN="\033[0;33m"
|
||||
YELLOW="\033[0;33m"
|
||||
LIGHT_GRAY="\033[0;37m"
|
||||
WHITE="\033[1;37m"
|
||||
NC="\033[0m"
|
||||
|
||||
appName="TeyvatGuide.app"
|
||||
appBashName=${appName// /\ }
|
||||
appDIR="/Applications/${appBashName}"
|
||||
|
||||
# Check system language
|
||||
LANGUAGE=$(defaults read -g AppleLocale | cut -d "_" -f 1)
|
||||
|
||||
if [ "$LANGUAGE" != "zh" ]; then
|
||||
|
||||
echo -e "Fix tool of 『${RED}${appBashName%.*} ${NC}is damaged and cannot be opened / from an unidentified developer』"
|
||||
echo ""
|
||||
# Prompt to install the app if not installed, bypass notarization if installed
|
||||
if [ ! -d "$appDIR" ];then
|
||||
echo -e "❌ ${LIGHT_RED}You have not installed ${appBashName%.*}, please copy the software to the 【${NC}${LIGHT_BLUE}Applications${NC}${LIGHT_RED}】 directory${NC}"
|
||||
else
|
||||
# Bypass notarization
|
||||
echo -e "👇 ${LIGHT_RED}Please enter the administrator password (usually the boot password), press Enter after entering (the password is invisible during input)${NC}"
|
||||
sudo spctl --master-disable
|
||||
sudo /usr/bin/xattr -rd com.apple.quarantine /Applications/"$appBashName"
|
||||
echo ""
|
||||
echo -e "😁 ${LIGHT_GREEN}Repair successful!${NC} You can now run ${LIGHT_GREEN}${appBashName%.*} ${NC}normally."
|
||||
fi
|
||||
echo ""
|
||||
echo -e "✌️ The operation has been successfully completed, you can close this window now!"
|
||||
|
||||
else
|
||||
|
||||
echo -e "『${RED}${appBashName%.*} ${NC}已损坏,无法打开/来自身份不明的开发者』等问题修复工具"
|
||||
echo ""
|
||||
#未安装APP时提醒安装,已安装绕过公证
|
||||
if [ ! -d "$appDIR" ];then
|
||||
echo -e "❌ ${LIGHT_RED}您还未安装 ${appBashName%.*}, 请先将软件拷贝到【${NC}${LIGHT_BLUE}应用程序${NC}${LIGHT_RED}】目录${NC}"
|
||||
else
|
||||
#绕过公证
|
||||
echo -e "👇 ${LIGHT_RED}请输入管理员密码(一般情况下就是开机密码), 输入完成后按下回车键(输入过程中密码是看不见的)${NC}"
|
||||
sudo spctl --master-disable
|
||||
sudo /usr/bin/xattr -rd com.apple.quarantine /Applications/"$appBashName"
|
||||
echo ""
|
||||
echo -e "😁 ${LIGHT_GREEN}修复成功!${NC}您现在可以正常运行 ${LIGHT_GREEN}${appBashName%.*} ${NC}了。"
|
||||
fi
|
||||
echo ""
|
||||
echo -e "✌️ 操作已成功完成, 本窗口可以关闭啦!"
|
||||
|
||||
fi
|
||||
BIN
docs/macos-gatekeeper/open.png
Normal file
BIN
docs/macos-gatekeeper/open.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 669 KiB |
BIN
docs/macos-gatekeeper/password.png
Normal file
BIN
docs/macos-gatekeeper/password.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 126 KiB |
BIN
docs/macos-gatekeeper/remove-gatekeeper.png
Normal file
BIN
docs/macos-gatekeeper/remove-gatekeeper.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 170 KiB |
Reference in New Issue
Block a user