Compare commits

...

17 Commits
v1.0 ... v1.0.3

Author SHA1 Message Date
yeongpin
0313751edd Remove unuse 2025-01-13 12:22:36 +08:00
yeongpin
8f3a30fc67 new reset ps1 2025-01-13 11:33:06 +08:00
yeongpin
ae0d1d2e19 Update Readme 2025-01-13 11:27:12 +08:00
yeongpin
59329f1ba4 add manual reset 2025-01-13 11:24:38 +08:00
yeongpin
9f3dff7c39 add new install.sh 2025-01-12 23:54:23 +08:00
Pin Studios
4415ab92b0 Update README.md 2025-01-12 22:40:51 +08:00
yeongpin
0f18aebcfb Update 1.0.2 readme 2025-01-12 22:39:33 +08:00
yeongpin
79097bec71 update readme 2025-01-12 21:20:21 +08:00
yeongpin
5673200533 Update Readme 2025-01-12 15:54:23 +08:00
yeongpin
a46be781a5 update readme 2025-01-11 22:34:23 +08:00
yeongpin
7289b55408 update readme 2025-01-11 22:12:04 +08:00
yeongpin
777d090bc8 update new ps1 2025-01-11 19:12:10 +08:00
yeongpin
cfca57583a new ps1 2025-01-11 19:07:44 +08:00
yeongpin
62a35ed699 new ps1 2025-01-11 19:06:11 +08:00
yeongpin
980c755343 update new ps1 2025-01-11 19:04:27 +08:00
yeongpin
0a946d4e4e update ps1 2025-01-11 18:46:04 +08:00
yeongpin
196060cb1b update ps1 2025-01-11 18:43:22 +08:00
5 changed files with 451 additions and 143 deletions

View File

@@ -19,9 +19,48 @@ This is a tool to automatically bypass Cursor's membership check, automatically
<p align="center">
<img src="./images/pro_2025-01-11_00-51-07.png" alt="Cursor Pro Logo" width="400"/><br>
</p>
<p align="center">
<img src="./images/pro_2025-01-11_22-33-09.gif" alt="Cursor Pro Logo" width="600"/><br>
</p>
<br>
<p align="center">
### If this start with Pro Trial, you can use it, don't hurry to upgrade to Pro, unless you can't use Pro, because Pro sometimes will be slow mode
### 如果啟動後是 Pro Trial 會員可以使用就使用不用著急升級到Pro 會員除非不能使用Pro會員因為Pro 會員有時候會 慢速模式
##### If Using Pro Membership, if it is slow mode, please switch to gpt-4o-mini /cursor-slow /cursor-fast mode
##### 如果使用Pro會員是慢速模式的話請切換到gpt-4o-mini /cursor-slow /cursor-fast 模式
</p>
</div>
## 🔄 更新日志
<details>
<summary>v1.0.2</summary>
1. Fix: Some known issues | 修復了一些已知問題
2. Add cloud control device code | 增加雲端控制設備碼
3. Cloud reset device code | 雲端重置設備碼
4. Remove official WatchDog monitoring | 移除官方WatchDog監控
5. Remove Proxy official prompt | 移除Proxy 官方提示
6. Fix: Too Many Computer | 修復Too Many Computer 問題
7. Fix Billing Issue | 修復計費問題
8. Fix: Cursor's configuration | 修復Cursor的配置問題
9. Fix cursor-slow mode | 修復cursor-slow模式
</details>
<details>
<summary>v1.0.1</summary>
1. Fix: Reset machine ID | 修復了重置機器ID的問題
2. Fix: Bypass membership check | 修復了 繞過會員檢查的問題
3. Fix: Auto upgrade to "pro" membership | 修復了 自動升級為pro會員的問題
4. Fix: Real-time send Token request | 修復了 實時發送Token請求的問題
5. Fix: Reset Cursor's configuration | 修復了 重置Cursor的配置的問題
</details>
<details>
<summary>v1.0</summary>
1. Preview Image | 預覽圖<br>
@@ -65,7 +104,7 @@ This is a tool to automatically bypass Cursor's membership check, automatically
|:---:|:---:|
<br>
<details open>
<summary><b>腳本自動化運行</b></summary>
<summary><b>Auto Run Script | 腳本自動化運行</b></summary>
**Linux/macOS**
```bash
@@ -78,6 +117,20 @@ irm https://raw.githubusercontent.com/yeongpin/cursor-free-vip/main/scripts/inst
```
</details>
<details open>
<summary><b>Manual Reset Machine | 手動運行重置機器</b></summary>
**Linux/macOS**
```bash
curl -fsSL https://raw.githubusercontent.com/yeongpin/cursor-free-vip/main/scripts/reset.sh | sudo bash
```
**Windows**
```powershell
irm https://raw.githubusercontent.com/yeongpin/cursor-free-vip/main/scripts/reset.ps1 | iex
```
</details>
2. If you want to stop the script, please press Ctrl+C<br>要停止腳本,請按 Ctrl+C
## Note | 注意事項

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 KiB

View File

@@ -1,192 +1,222 @@
# Check for admin rights and handle elevation
# 檢查是否是通過權限提升啟動的
param(
[switch]$Elevated
)
# 設置顏色主題
$Theme = @{
Primary = 'Cyan'
Success = 'Green'
Warning = 'Yellow'
Error = 'Red'
Info = 'White'
}
# ASCII Logo
$Logo = @"
"@
# 進度條函數
function Write-ProgressBar {
param (
[int]$Percent,
[string]$Activity
)
$width = $Host.UI.RawUI.WindowSize.Width - 20
$completed = [math]::Floor($width * ($Percent / 100))
$remaining = $width - $completed
$progressBar = "[" + ("" * $completed) + ("-" * $remaining) + "]"
Write-Host "`r$Activity $progressBar $Percent%" -NoNewline
}
# 美化輸出函數
function Write-Styled {
param (
[string]$Message,
[string]$Color = $Theme.Info,
[string]$Prefix = "",
[switch]$NoNewline
)
$emoji = switch ($Color) {
$Theme.Success { "" }
$Theme.Error { "" }
$Theme.Warning { "⚠️" }
default { "" }
}
$output = if ($Prefix) { "$emoji $Prefix :: $Message" } else { "$emoji $Message" }
if ($NoNewline) {
Write-Host $output -ForegroundColor $Color -NoNewline
} else {
Write-Host $output -ForegroundColor $Color
}
}
# 檢查管理員權限
$isAdmin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
if (-NOT $isAdmin) {
# Detect PowerShell version and path
Write-Styled "需要管理員權限來安裝" -Color $Theme.Warning -Prefix "權限"
Write-Styled "正在請求管理員權限..." -Color $Theme.Primary -Prefix "提升"
# 顯示操作選項
Write-Host "`n選擇操作:" -ForegroundColor $Theme.Primary
Write-Host "1. 請求管理員權限" -ForegroundColor $Theme.Info
Write-Host "2. 退出程序" -ForegroundColor $Theme.Info
$choice = Read-Host "`n請輸入選項 (1-2)"
if ($choice -ne "1") {
Write-Styled "安裝已取消" -Color $Theme.Warning -Prefix "取消"
Write-Host "`n按任意鍵退出..." -ForegroundColor $Theme.Info
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
exit
}
$pwshPath = if (Get-Command "pwsh" -ErrorAction SilentlyContinue) {
(Get-Command "pwsh").Source # PowerShell 7+
(Get-Command "pwsh").Source
} elseif (Test-Path "$env:ProgramFiles\PowerShell\7\pwsh.exe") {
"$env:ProgramFiles\PowerShell\7\pwsh.exe"
} else {
"powershell.exe" # Windows PowerShell
"powershell.exe"
}
try {
Write-Host "`nRequesting administrator privileges..." -ForegroundColor Cyan
$scriptPath = $MyInvocation.MyCommand.Path
$argList = "-NoProfile -ExecutionPolicy Bypass -File `"$scriptPath`""
Start-Process -FilePath $pwshPath -Verb RunAs -ArgumentList $argList -Wait
$arguments = "-NoProfile -ExecutionPolicy Bypass -File `"$($MyInvocation.MyCommand.Path)`" -Elevated -WindowStyle Normal"
Start-Process -FilePath $pwshPath -Verb RunAs -ArgumentList $arguments
Write-Host "`n請在新開啟的管理員權限視窗中繼續操作..." -ForegroundColor $Theme.Primary
# 等待用戶確認
Write-Host "`n按任意鍵退出此窗口..." -ForegroundColor $Theme.Info
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
exit
}
catch {
Write-Host "`nError: Administrator privileges required" -ForegroundColor Red
Write-Host "Please run this script from an Administrator PowerShell window" -ForegroundColor Yellow
Write-Host "`nTo do this:" -ForegroundColor Cyan
Write-Host "1. Press Win + X" -ForegroundColor White
Write-Host "2. Click 'Windows Terminal (Admin)' or 'PowerShell (Admin)'" -ForegroundColor White
Write-Host "3. Run the installation command again" -ForegroundColor White
Write-Host "`nPress enter to exit..."
Write-Styled "無法獲取管理員權限" -Color $Theme.Error -Prefix "錯誤"
Write-Styled "請以管理員身份運行 PowerShell 後重試" -Color $Theme.Warning -Prefix "提示"
Write-Styled "您可以:" -Color $Theme.Info
Write-Host "1. 右鍵點擊 PowerShell選擇「以系統管理員身分執行」" -ForegroundColor $Theme.Info
Write-Host "2. 然後重新運行此安裝程序" -ForegroundColor $Theme.Info
Write-Host "`n按任意鍵退出..." -ForegroundColor $Theme.Info
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
exit 1
}
}
# Set TLS to 1.2
# 如果是提升權限後的窗口,等待一下確保窗口可見
if ($Elevated) {
Start-Sleep -Seconds 1
}
# 獲取版本號函數
function Get-LatestVersion {
try {
$latestRelease = Invoke-RestMethod -Uri "https://api.github.com/repos/yeongpin/cursor-free-vip/releases/latest"
return @{
Version = $latestRelease.tag_name.TrimStart('v')
Assets = $latestRelease.assets
}
} catch {
Write-Styled $_.Exception.Message -Color $Theme.Error -Prefix "錯誤"
throw "無法獲取最新版本信息"
}
}
# 顯示 Logo
Write-Host $Logo -ForegroundColor $Theme.Primary
$releaseInfo = Get-LatestVersion
$version = $releaseInfo.Version
Write-Host "Version $version" -ForegroundColor $Theme.Info
Write-Host "Created by YeongPin`n" -ForegroundColor $Theme.Info
# 設置 TLS 1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# Create temporary directory
# 創建臨時目錄
$TmpDir = Join-Path $env:TEMP ([System.Guid]::NewGuid().ToString())
New-Item -ItemType Directory -Path $TmpDir | Out-Null
New-Item -ItemType Directory -Path $TmpDir -Force | Out-Null
# Cleanup function
# 清理函數
function Cleanup {
if (Test-Path $TmpDir) {
Remove-Item -Recurse -Force $TmpDir
Remove-Item -Recurse -Force $TmpDir -ErrorAction SilentlyContinue
}
}
# Error handler
trap {
Write-Host "Error: $_" -ForegroundColor Red
Cleanup
Write-Host "Press enter to exit..."
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
exit 1
}
# Detect system architecture
function Get-SystemArch {
if ([Environment]::Is64BitOperatingSystem) {
return "x86_64"
} else {
return "i386"
# 主安裝函數
function Install-CursorFreeVIP {
Write-Styled "開始安裝 Cursor Free VIP" -Color $Theme.Primary -Prefix "安裝"
# 設置安裝目錄
$InstallDir = "$env:ProgramFiles\CursorFreeVIP"
if (!(Test-Path $InstallDir)) {
New-Item -ItemType Directory -Path $InstallDir -Force | Out-Null
}
}
# Download with progress
function Get-FileWithProgress {
param (
[string]$Url,
[string]$OutputFile
)
try {
# 獲取最新版本
Write-Styled "正在檢查最新版本..." -Color $Theme.Primary -Prefix "更新"
$releaseInfo = Get-LatestVersion
$version = $releaseInfo.Version
Write-Styled "找到最新版本: $version" -Color $Theme.Success -Prefix "版本"
# 查找對應的資源
$asset = $releaseInfo.Assets | Where-Object { $_.name -eq "CursorFreeVIP_${version}_windows.exe" }
if (!$asset) {
Write-Styled "找不到檔案: CursorFreeVIP_${version}_windows.exe" -Color $Theme.Error -Prefix "錯誤"
Write-Styled "可用的檔案:" -Color $Theme.Warning -Prefix "資訊"
$releaseInfo.Assets | ForEach-Object {
Write-Styled "- $($_.name)" -Color $Theme.Info
}
throw "找不到對應的安裝檔案"
}
# 下載
Write-Styled "正在下載..." -Color $Theme.Primary -Prefix "下載"
$webClient = New-Object System.Net.WebClient
$webClient.Headers.Add("User-Agent", "PowerShell Script")
$webClient.DownloadFile($Url, $OutputFile)
return $true
}
catch {
Write-Host "Failed to download: $_" -ForegroundColor Red
return $false
}
}
# Main installation function
function Install-CursorFreeVIP {
Write-Host "Starting installation..." -ForegroundColor Cyan
# Detect architecture
$arch = Get-SystemArch
Write-Host "Detected architecture: $arch" -ForegroundColor Green
# Set installation directory
$InstallDir = "$env:ProgramFiles\CursorFreeVIP"
if (!(Test-Path $InstallDir)) {
New-Item -ItemType Directory -Path $InstallDir | Out-Null
}
# Get latest release
try {
$latestRelease = Invoke-RestMethod -Uri "https://api.github.com/repos/yeongpin/cursor-free-vip/releases/latest"
Write-Host "Found latest release: $($latestRelease.tag_name)" -ForegroundColor Cyan
$downloadPath = Join-Path $TmpDir "CursorFreeVIP.exe"
$webClient.DownloadFile($asset.browser_download_url, $downloadPath)
# Look for Windows binary with our architecture
$version = $latestRelease.tag_name.TrimStart('v')
Write-Host "Version: $version" -ForegroundColor Cyan
$possibleNames = @(
"CursorFreeVIP_${version}_windows.exe"
)
# 安裝
Write-Styled "正在安裝到系統..." -Color $Theme.Primary -Prefix "安裝"
Copy-Item -Path $downloadPath -Destination "$InstallDir\CursorFreeVIP.exe" -Force
$asset = $null
foreach ($name in $possibleNames) {
Write-Host "Checking for asset: $name" -ForegroundColor Cyan
$asset = $latestRelease.assets | Where-Object { $_.name -eq $name }
if ($asset) {
Write-Host "Found matching asset: $($asset.name)" -ForegroundColor Green
break
}
}
if (!$asset) {
Write-Host "`nAvailable assets:" -ForegroundColor Yellow
$latestRelease.assets | ForEach-Object { Write-Host "- $($_.name)" }
throw "Could not find appropriate Windows binary for $arch architecture"
}
$downloadUrl = $asset.browser_download_url
}
catch {
Write-Host "Failed to get latest release: $_" -ForegroundColor Red
exit 1
}
# Download binary
Write-Host "`nDownloading latest release..." -ForegroundColor Cyan
$binaryPath = Join-Path $TmpDir "CursorFreeVIP.exe"
if (!(Get-FileWithProgress -Url $downloadUrl -OutputFile $binaryPath)) {
exit 1
}
# Install binary
Write-Host "Installing..." -ForegroundColor Cyan
try {
Copy-Item -Path $binaryPath -Destination "$InstallDir\CursorFreeVIP.exe" -Force
# Add to PATH if not already present
# 添加到 PATH
$currentPath = [Environment]::GetEnvironmentVariable("Path", "Machine")
if ($currentPath -notlike "*$InstallDir*") {
[Environment]::SetEnvironmentVariable("Path", "$currentPath;$InstallDir", "Machine")
}
Write-Styled "安裝完成!" -Color $Theme.Success -Prefix "完成"
Write-Styled "正在啟動程序..." -Color $Theme.Primary -Prefix "啟動"
# 運行程序
Start-Process "$InstallDir\CursorFreeVIP.exe"
}
catch {
Write-Host "Failed to install: $_" -ForegroundColor Red
exit 1
}
Write-Host "Installation completed successfully!" -ForegroundColor Green
Write-Host "Running cursor-free-vip..." -ForegroundColor Cyan
# Run the program
try {
& "$InstallDir\cursor-id-modifier.exe"
if ($LASTEXITCODE -ne 0) {
Write-Host "Failed to run cursor-free-vip" -ForegroundColor Red
exit 1
}
}
catch {
Write-Host "Failed to run cursor-free-vip: $_" -ForegroundColor Red
exit 1
Write-Styled $_.Exception.Message -Color $Theme.Error -Prefix "錯誤"
throw
}
}
# Run installation
# 執行安裝
try {
Install-CursorModifier
Install-CursorFreeVIP
}
catch {
Write-Host "Installation failed: $_" -ForegroundColor Red
Cleanup
Write-Host "Press enter to exit..."
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
exit 1
Write-Styled "安裝失敗" -Color $Theme.Error -Prefix "錯誤"
Write-Styled $_.Exception.Message -Color $Theme.Error
}
finally {
Cleanup
if ($LASTEXITCODE -ne 0) {
Write-Host "Press enter to exit..." -ForegroundColor Green
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
}
Write-Host "`n按任意鍵退出..." -ForegroundColor $Theme.Info
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
}

98
scripts/install.sh Normal file
View File

@@ -0,0 +1,98 @@
#!/bin/bash
# 顏色定義
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
CYAN='\033[0;36m'
NC='\033[0m' # No Color
# Logo
print_logo() {
echo -e "${CYAN}"
cat << "EOF"
██████╗██╗ ██╗██████╗ ███████╗ ██████╗ ██████╗ ██████╗ ██████╗ ██████╗
██╔════╝██║ ██║██╔══██╗██╔════╝██╔═══██╗██╔══██╗ ██╔══██╗██╔══██╗██╔═══██╗
██║ ██║ ██║██████╔╝███████╗██║ ██║██████╔╝ ██████╔╝██████╔╝██║ ██║
██║ ██║ ██║██╔══██╗╚════██║██║ ██║██╔══██╗ ██╔═══╝ ██╔══██╗██║ ██║
╚██████╗╚██████╔╝██║ ██║███████║╚██████╔╝██║ ██║ ██║ ██║ ██║╚██████╔╝
╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝
EOF
echo -e "${NC}"
}
# 檢查是否為 root 用戶
check_root() {
if [ "$EUID" -ne 0 ]; then
echo -e "${RED}❌ 錯誤: 請使用 sudo 運行此腳本${NC}"
exit 1
fi
}
# 獲取最新版本
get_latest_version() {
echo -e "${CYAN} 正在檢查最新版本...${NC}"
local latest_release
latest_release=$(curl -s https://api.github.com/repos/yeongpin/cursor-free-vip/releases/latest)
if [ $? -ne 0 ]; then
echo -e "${RED}❌ 無法獲取最新版本信息${NC}"
exit 1
fi
VERSION=$(echo "$latest_release" | grep -o '"tag_name": ".*"' | cut -d'"' -f4 | tr -d 'v')
echo -e "${GREEN}✅ 找到最新版本: ${VERSION}${NC}"
}
# 檢測系統類型
detect_os() {
if [[ "$(uname)" == "Darwin" ]]; then
OS="mac"
else
OS="linux"
fi
}
# 創建臨時目錄
create_temp_dir() {
TMP_DIR=$(mktemp -d)
trap 'rm -rf "$TMP_DIR"' EXIT
}
# 下載並安裝
install_cursor_free_vip() {
local install_dir="/usr/local/bin"
local binary_name="CursorFreeVIP_${VERSION}_${OS}"
local download_url="https://github.com/yeongpin/cursor-free-vip/releases/download/v${VERSION}/${binary_name}"
echo -e "${CYAN} 正在下載...${NC}"
if ! curl -L -o "${TMP_DIR}/${binary_name}" "$download_url"; then
echo -e "${RED}❌ 下載失敗${NC}"
exit 1
fi
echo -e "${CYAN} 正在安裝...${NC}"
chmod +x "${TMP_DIR}/${binary_name}"
mv "${TMP_DIR}/${binary_name}" "${install_dir}/cursor-free-vip"
if [ $? -eq 0 ]; then
echo -e "${GREEN}✅ 安裝完成!${NC}"
echo -e "${CYAN} 您可以通過運行 'cursor-free-vip' 來啟動程序${NC}"
else
echo -e "${RED}❌ 安裝失敗${NC}"
exit 1
fi
}
# 主程序
main() {
print_logo
check_root
get_latest_version
detect_os
create_temp_dir
install_cursor_free_vip
}
# 運行主程序
main

127
scripts/reset.ps1 Normal file
View File

@@ -0,0 +1,127 @@
# 檢查是否是通過權限提升啟動的
param(
[switch]$Elevated
)
# 設置顏色主題
$Theme = @{
Primary = 'Cyan'
Success = 'Green'
Warning = 'Yellow'
Error = 'Red'
Info = 'White'
}
# ASCII Logo
$Logo = @"
"@
# 美化輸出函數
function Write-Styled {
param (
[string]$Message,
[string]$Color = $Theme.Info,
[string]$Prefix = "",
[switch]$NoNewline
)
$emoji = switch ($Color) {
$Theme.Success { "" }
$Theme.Error { "" }
$Theme.Warning { "⚠️" }
default { "" }
}
$output = if ($Prefix) { "$emoji $Prefix :: $Message" } else { "$emoji $Message" }
if ($NoNewline) {
Write-Host $output -ForegroundColor $Color -NoNewline
} else {
Write-Host $output -ForegroundColor $Color
}
}
# 檢查管理員權限
$isAdmin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
if (-NOT $isAdmin) {
Write-Styled "需要管理員權限來運行重置工具" -Color $Theme.Warning -Prefix "權限"
Write-Styled "正在請求管理員權限..." -Color $Theme.Primary -Prefix "提升"
# 顯示操作選項
Write-Host "`n選擇操作:" -ForegroundColor $Theme.Primary
Write-Host "1. 請求管理員權限" -ForegroundColor $Theme.Info
Write-Host "2. 退出程序" -ForegroundColor $Theme.Info
$choice = Read-Host "`n請輸入選項 (1-2)"
if ($choice -ne "1") {
Write-Styled "操作已取消" -Color $Theme.Warning -Prefix "取消"
Write-Host "`n按任意鍵退出..." -ForegroundColor $Theme.Info
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
exit
}
try {
Start-Process powershell.exe -Verb RunAs -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`" -Elevated"
exit
}
catch {
Write-Styled "無法獲取管理員權限" -Color $Theme.Error -Prefix "錯誤"
Write-Styled "請以管理員身份運行 PowerShell 後重試" -Color $Theme.Warning -Prefix "提示"
Write-Host "`n按任意鍵退出..." -ForegroundColor $Theme.Info
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
exit 1
}
}
# 如果是提升權限後的窗口,等待一下確保窗口可見
if ($Elevated) {
Start-Sleep -Seconds 1
}
# 顯示 Logo
Write-Host $Logo -ForegroundColor $Theme.Primary
Write-Host "Created by YeongPin`n" -ForegroundColor $Theme.Info
# 設置 TLS 1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# 創建臨時目錄
$TmpDir = Join-Path $env:TEMP ([System.Guid]::NewGuid().ToString())
New-Item -ItemType Directory -Path $TmpDir -Force | Out-Null
# 清理函數
function Cleanup {
if (Test-Path $TmpDir) {
Remove-Item -Recurse -Force $TmpDir -ErrorAction SilentlyContinue
}
}
try {
# 下載地址
$url = "https://github.com/yeongpin/cursor-free-vip/releases/download/ManualReset/reset_machine_manual.exe"
$output = Join-Path $TmpDir "reset_machine_manual.exe"
# 下載文件
Write-Styled "正在下載重置工具..." -Color $Theme.Primary -Prefix "下載"
Invoke-WebRequest -Uri $url -OutFile $output
Write-Styled "下載完成!" -Color $Theme.Success -Prefix "完成"
# 執行重置工具
Write-Styled "正在啟動重置工具..." -Color $Theme.Primary -Prefix "執行"
Start-Process -FilePath $output -Wait
Write-Styled "重置完成!" -Color $Theme.Success -Prefix "完成"
}
catch {
Write-Styled "操作失敗" -Color $Theme.Error -Prefix "錯誤"
Write-Styled $_.Exception.Message -Color $Theme.Error
}
finally {
Cleanup
Write-Host "`n按任意鍵退出..." -ForegroundColor $Theme.Info
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
}