Compare commits

..

No commits in common. "master" and "v0.0.26" have entirely different histories.

35 changed files with 247 additions and 12314 deletions

View File

@ -133,6 +133,12 @@ jobs:
exit 1
fi
# 添加 Go 工作目录设置
- name: Set Go Work Directory
run: |
echo "GOPATH=${{ github.workspace }}/go" >> $GITHUB_ENV
echo "${{ github.workspace }}/go/bin" >> $GITHUB_PATH
# 添加依赖检查步骤
- name: Check Dependencies
run: |
@ -143,23 +149,6 @@ jobs:
go mod vendor
fi
# 添加构建环境准备步骤
- name: Prepare Build Environment
run: |
echo "Building version: ${VERSION:-development}"
echo "GOOS=${GOOS:-$(go env GOOS)}" >> $GITHUB_ENV
echo "GOARCH=${GOARCH:-$(go env GOARCH)}" >> $GITHUB_ENV
echo "GO111MODULE=on" >> $GITHUB_ENV
# 添加清理步骤
- name: Cleanup workspace
run: |
rm -rf /tmp/go/
rm -rf .cache/
rm -rf dist/
git clean -fdx
git status
# 修改 GoReleaser 步骤
- name: Run GoReleaser
if: ${{ startsWith(github.ref, 'refs/tags/v') || (success() && steps.get_latest_tag.outputs.version != '') }}
@ -167,38 +156,18 @@ jobs:
with:
distribution: goreleaser
version: latest
args: release --clean --timeout 60m
args: release --clean --timeout 60m --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.get_latest_tag.outputs.version }}
CGO_ENABLED: 0
GOPATH: /tmp/go
GOFLAGS: -mod=vendor
GOPATH: ${{ github.workspace }}/go
GOROOT: ${{ env.GOROOT }}
GOCACHE: /tmp/.cache/go-build
GOMODCACHE: /tmp/go/pkg/mod
GOCACHE: ${{ github.workspace }}/.cache/go-build
GOMODCACHE: ${{ github.workspace }}/go/pkg/mod
GORELEASER_DEBUG: 1
GORELEASER_CURRENT_TAG: ${{ steps.get_latest_tag.outputs.version }}
# 添加额外的构建信息
BUILD_TIME: ${{ steps.get_latest_tag.outputs.version }}
BUILD_COMMIT: ${{ github.sha }}
# 优化 vendor 同步步骤
- name: Sync vendor directory
run: |
echo "Syncing vendor directory..."
go mod tidy
go mod vendor
go mod verify
# 验证 vendor 目录
if [ -d "vendor" ]; then
echo "Verifying vendor directory..."
go mod verify
# 检查是否有未跟踪的文件
if [ -n "$(git status --porcelain vendor/)" ]; then
echo "Warning: Vendor directory has uncommitted changes"
git status vendor/
fi
fi
# 添加错误检查步骤
- name: Check GoReleaser Output

6
.gitignore vendored
View File

@ -8,8 +8,6 @@ dist/
# Go specific
go.sum
go/
.cache/
# IDE and editor files
.vscode/
@ -39,6 +37,4 @@ coverage.txt
*.tmp
*~
*.bak
*.log
.cunzhi*/
*.log

View File

@ -1,10 +1,7 @@
version: 2
before:
hooks:
- go mod tidy
- go mod vendor
- go mod verify
- go mod download
builds:
- id: cursor-id-modifier
@ -12,7 +9,6 @@ builds:
binary: cursor-id-modifier
env:
- CGO_ENABLED=0
- GO111MODULE=on
goos:
- linux
- windows
@ -27,9 +23,6 @@ builds:
ldflags:
- -s -w
- -X 'main.version={{.Version}}'
- -X 'main.commit={{.ShortCommit}}'
- -X 'main.date={{.CommitDate}}'
- -X 'main.builtBy=goreleaser'
flags:
- -trimpath
mod_timestamp: '{{ .CommitTimestamp }}'
@ -38,55 +31,16 @@ archives:
- id: binary
format: binary
name_template: >-
{{- .ProjectName }}_
{{- .Version }}_
{{ .Binary }}_
{{- .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
builds:
- cursor-id-modifier
allow_different_binary_count: true
files:
- none*
{{- if eq .Arch "amd64" }}x64{{ end }}
{{- if eq .Arch "386" }}x86{{ end }}
{{- if eq .Arch "arm64" }}arm64{{ end }}
checksum:
name_template: 'checksums.txt'
algorithm: sha256
release:
draft: true
prerelease: auto
mode: replace
header: |
## Release {{.Tag}} ({{.Date}})
See [CHANGELOG.md](CHANGELOG.md) for details.
footer: |
**Full Changelog**: https://github.com/owner/repo/compare/{{ .PreviousTag }}...{{ .Tag }}
extra_files:
- glob: 'LICENSE*'
- glob: 'README*'
- glob: 'CHANGELOG*'
changelog:
sort: asc
use: github
filters:
exclude:
- '^docs:'
- '^test:'
- '^ci:'
- Merge pull request
- Merge branch
groups:
- title: Features
regexp: "^.*feat[(\\w)]*:+.*$"
order: 0
- title: 'Bug fixes'
regexp: "^.*fix[(\\w)]*:+.*$"
order: 1
- title: Others
order: 999
project_name: cursor-id-modifier

53
CHANGELOG.md Normal file
View File

@ -0,0 +1,53 @@
# 📝 Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.1.23] - 2024-12-29 🚀
### ✨ Features
- **Initial Release**: First public release of Cursor ID Modifier
- **Multi-Platform Support**:
- 🪟 Windows (x64, x86)
- 🍎 macOS (Intel & Apple Silicon)
- 🐧 Linux (x64, x86, ARM64)
- **Installation**:
- Automated installation scripts for all platforms
- One-line installation commands
- Secure download and verification
- **Core Functionality**:
- Telemetry ID modification for Cursor IDE
- Automatic process management
- Secure configuration handling
### 🐛 Bug Fixes
- **Installation**:
- Fixed environment variable preservation in sudo operations
- Enhanced error handling during installation
- Improved binary download reliability
- **Process Management**:
- Improved Cursor process detection accuracy
- Enhanced process termination reliability
- Better handling of edge cases
- **User Experience**:
- Enhanced error messages and user feedback
- Improved progress indicators
- Better handling of system permissions
### 🔧 Technical Improvements
- Optimized binary size with proper build flags
- Enhanced cross-platform compatibility
- Improved error handling and logging
- Better system resource management
### 📚 Documentation
- Added comprehensive installation instructions
- Included platform-specific guidelines
- Enhanced error troubleshooting guide
---
*For more details about the changes, please refer to the [commit history](https://github.com/dacrab/go-cursor-help/commits/main).*
[0.1.22]: https://github.com/dacrab/go-cursor-help/releases/tag/v0.1.23

540
README.md
View File

@ -2,128 +2,23 @@
<div align="center">
[![Release](https://img.shields.io/github/v/release/yuaotian/go-cursor-help?style=flat-square&logo=github&color=blue)](https://github.com/yuaotian/go-cursor-help/releases/latest)
[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square&logo=bookstack)](https://github.com/yuaotian/go-cursor-help/blob/master/LICENSE)
[![Stars](https://img.shields.io/github/stars/yuaotian/go-cursor-help?style=flat-square&logo=github)](https://github.com/yuaotian/go-cursor-help/stargazers)
[![Release](https://img.shields.io/github/v/release/dacrab/go-cursor-help?style=flat-square&logo=github&color=blue)](https://github.com/dacrab/go-cursor-help/releases/latest)
[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square&logo=bookstack)](https://github.com/dacrab/go-cursor-help/blob/master/LICENSE)
[![Stars](https://img.shields.io/github/stars/dacrab/go-cursor-help?style=flat-square&logo=github)](https://github.com/dacrab/go-cursor-help/stargazers)
[🌟 English](README.md) | [🌏 中文](README_CN.md) | [🌏 日本語](README_JP.md)
[🌟 English](#english) | [🌏 中文](#chinese)
<img src="https://ai-cursor.com/wp-content/uploads/2024/09/logo-cursor-ai-png.webp" alt="Cursor Logo" width="120"/>
</div>
> ⚠️ **IMPORTANT NOTICE**
>
> This tool currently supports:
> - ✅ Windows: Latest 1.0.x versions (Supported)
> - ✅ Mac/Linux: Latest 1.0.x versions (Supported, feedback welcome)
>
> Please check your Cursor version before using this tool.
<details open>
<summary><b>📦 Version History & Downloads</b></summary>
<div class="version-card" style="background: linear-gradient(135deg, #6e8efb, #a777e3); border-radius: 8px; padding: 15px; margin: 10px 0; color: white;">
### 🌟 Latest Versions
[View Full Version History]([CursorHistoryDown.md](https://github.com/oslook/cursor-ai-downloads?tab=readme-ov-file))
</div>
</details>
⚠️ **General Solutions for Cursor**
> 1. Close Cursor, log out of your account, and delete your account in the official website Settings (refresh IP node: Japan, Singapore, USA, Hong Kong, prioritizing low latency - not necessarily required but change if conditions allow; Windows users are recommended to refresh DNS cache: `ipconfig /flushdns`)
> Go to the Cursor official website to delete your current account
> Steps: User avatar -> Setting -> Advanced▼ in the bottom left -> Delete Account
>
> 2. Run the machine code refresh script, see the script address below, available in China
>
> 3. Re-register an account, log in, and open Cursor to resume normal use.
>
> 4. Alternative solution: If still unusable after step [**3**], or if you encounter problems such as account registration failure or inability to delete an account, this usually means your browser has been identified or restricted by the target website (risk control). In this case, try switching browsers, such as: Edge, Google Chrome, Firefox. (Or, consider using a browser that can modify or randomize browser fingerprint information).
---
⚠️ **MAC Address Modification Warning**
>
> For Mac users: This script includes a MAC address modification feature that will:
> - Modify your network interface's MAC address
> - Backup original MAC addresses before modification
> - This modification may temporarily affect network connectivity
> - You can skip this step when prompted during execution
>
<details >
<summary><b>🔒 Disable Auto-Update Feature</b></summary>
> To prevent Cursor from automatically updating to unsupported new versions, you can choose to disable the auto-update feature.
#### Method 1: Using Built-in Script (Recommended)
When running the reset tool, the script will ask if you want to disable auto-updates:
```text
[Question] Do you want to disable Cursor auto-update feature?
0) No - Keep default settings (Press Enter)
1) Yes - Disable auto-update
```
Select `1` to automatically complete the disable operation.
#### Method 2: Manual Disable
**Windows:**
1. Close all Cursor processes
2. Delete directory: `%LOCALAPPDATA%\cursor-updater`
3. Create a file with the same name (without extension) in the same location
**macOS:**
```bash
# NOTE: As tested, this method only works for version 0.45.11 and below.
# Close Cursor
pkill -f "Cursor"
# Replacing app-update.yml with a blank/read-only file
cd /Applications/Cursor.app/Contents/Resources
mv app-update.yml app-update.yml.bak
touch app-update.yml
chmod 444 app-update.yml
# Go to Settings -> Application -> Update, set Mode to none.
# This must be done to prevent Cursor from checking for updates.
# NOTE: The cursor-updater modification method may no longer be effective
# In any case, remove update directory and create blocking file
rm -rf ~/Library/Application\ Support/Caches/cursor-updater
touch ~/Library/Application\ Support/Caches/cursor-updater
```
**Linux:**
```bash
# Close Cursor
pkill -f "Cursor"
# Remove update directory and create blocking file
rm -rf ~/.config/cursor-updater
touch ~/.config/cursor-updater
```
> ⚠️ **Note:** After disabling auto-updates, you'll need to manually download and install new versions. It's recommended to update only after confirming the new version is compatible.
</details>
---
## 🌟 English
### 📝 Description
> When you encounter any of these messages:
#### Issue 1: Trial Account Limit <p align="right"><a href="#issue1"><img src="https://img.shields.io/badge/Move%20to%20Solution-Blue?style=plastic" alt="Back To Top"></a></p>
> Resets Cursor's free trial limitation when you see:
```text
Too many free trial accounts used on this machine.
@ -132,81 +27,6 @@ to prevent abuse. Please let us know if you believe
this is a mistake.
```
#### Issue 2: API Key Limitation <p align="right"><a href="#issue2"><img src="https://img.shields.io/badge/Move%20to%20Solution-green?style=plastic" alt="Back To Top"></a></p>
```text
[New Issue]
Composer relies on custom models that cannot be billed to an API key.
Please disable API keys and use a Pro or Business subscription.
Request ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
```
#### Issue 3: Trial Request Limit
> This indicates you've reached the usage limit during the VIP free trial period:
```text
You've reached your trial request limit.
```
#### Issue 4: Claude 3.7 High Load <p align="right"><a href="#issue4"><img src="https://img.shields.io/badge/Move%20to%20Solution-purple?style=plastic" alt="Back To Top"></a></p>
```text
High Load
We're experiencing high demand for Claude 3.7 Sonnet right now. Please upgrade to Pro, or switch to the
'default' model, Claude 3.5 sonnet, another model, or try again in a few moments.
```
<br>
<p id="issue2"></p>
#### Solution : Uninstall Cursor Completely And Reinstall (API key Issue)
1. Download [Geek.exe Uninstaller[Free]](https://geekuninstaller.com/download)
2. Uninstall Cursor app completely
3. Re-Install Cursor app
4. Continue to Solution 1
<br>
<p id="issue1"></p>
> Temporary Solution:
#### Solution 1: Quick Reset (Recommended)
1. Close Cursor application
2. Run the machine code reset script (see installation instructions below)
3. Reopen Cursor to continue using
#### Solution 2: Account Switch
1. File -> Cursor Settings -> Sign Out
2. Close Cursor
3. Run the machine code reset script
4. Login with a new account
#### Solution 3: Network Optimization
If the above solutions don't work, try:
- Switch to low-latency nodes (Recommended regions: Japan, Singapore, US, Hong Kong)
- Ensure network stability
- Clear browser cache and retry
#### Solution 4: Claude 3.7 Access Issue (High Load)
If you see the "High Load" message for Claude 3.7 Sonnet, this indicates Cursor is limiting free trial accounts from using the 3.7 model during certain times of the day. Try:
1. Switch to a new account created with Gmail, possibly connecting through a different IP address
2. Try accessing during off-peak hours (typically 5-10 AM or 3-7 PM when restrictions are often lighter)
3. Consider upgrading to Pro for guaranteed access
4. Use Claude 3.5 Sonnet as a fallback option
> Note: These access patterns may change as Cursor adjusts their resource allocation policies.
### 💻 System Support
<table>
@ -214,7 +34,6 @@ If you see the "High Load" message for Claude 3.7 Sonnet, this indicates Cursor
<td>
**Windows** ✅
- x64 (64-bit)
- x86 (32-bit)
@ -222,7 +41,6 @@ If you see the "High Load" message for Claude 3.7 Sonnet, this indicates Cursor
<td>
**macOS** ✅
- Intel (x64)
- Apple Silicon (M1/M2)
@ -230,7 +48,6 @@ If you see the "High Load" message for Claude 3.7 Sonnet, this indicates Cursor
<td>
**Linux** ✅
- x64 (64-bit)
- x86 (32-bit)
- ARM64
@ -239,164 +56,31 @@ If you see the "High Load" message for Claude 3.7 Sonnet, this indicates Cursor
</tr>
</table>
### 🚀 One-Click Solution
<details open>
<summary><b>Global Users</b></summary>
**macOS**
**Linux/macOS**: Copy and paste in terminal
```bash
# Method two
curl -fsSL https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_mac_id_modifier.sh -o ./cursor_mac_id_modifier.sh && sudo bash ./cursor_mac_id_modifier.sh && rm ./cursor_mac_id_modifier.sh
curl -fsSL https://raw.githubusercontent.com/dacrab/go-cursor-help/master/scripts/install.sh | sudo bash
```
**Linux**
```bash
curl -fsSL https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_linux_id_modifier.sh | sudo bash
```
> **Note for Linux users:** The script attempts to find your Cursor installation by checking common paths (`/usr/bin`, `/usr/local/bin`, `$HOME/.local/bin`, `/opt/cursor`, `/snap/bin`), using the `which cursor` command, and searching within `/usr`, `/opt`, and `$HOME/.local`. If Cursor is installed elsewhere or not found via these methods, the script may fail. Ensure Cursor is accessible via one of these standard locations or methods.
**Windows**
**Windows**: Copy and paste in PowerShell
```powershell
irm https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_win_id_modifier.ps1 | iex
irm https://raw.githubusercontent.com/dacrab/go-cursor-help/master/scripts/install.ps1 | iex
```
**Windows (Enhanced Version)**
```powershell
irm https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_win_id_modifier.ps1 | iex
```
> Enhanced Cursor machine code modifier with dual-mode operation and trial reset functionality
<div align="center">
<img src="img/run_success.png" alt="Run Success" width="600"/>
</div>
</details>
<details open>
<summary><b>China Users (Recommended)</b></summary>
**macOS**
```bash
curl -fsSL https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_mac_id_modifier.sh -o ./cursor_mac_id_modifier.sh && sudo bash ./cursor_mac_id_modifier.sh && rm ./cursor_mac_id_modifier.sh
```
**Linux**
```bash
curl -fsSL https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_linux_id_modifier.sh | sudo bash
```
**Windows**
```powershell
irm https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_win_id_modifier.ps1 | iex
```
**Windows (Enhanced Version)**
```powershell
irm https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_win_id_modifier.ps1 | iex
```
> Enhanced Cursor machine code modifier with dual-mode operation and trial reset functionality
</details>
<details open>
<summary><b>Windows Terminal Run and Configuration</b></summary>
#### How to Open Administrator Terminal in Windows:
##### Method 1: Using Win + X Shortcut
```md
1. Press Win + X key combination
2. Select one of these options from the menu:
- "Windows PowerShell (Administrator)"
- "Windows Terminal (Administrator)"
- "Terminal (Administrator)"
(Options may vary depending on Windows version)
```
##### Method 2: Using Win + R Run Command
```md
1. Press Win + R key combination
2. Type powershell or pwsh in the Run dialog
3. Press Ctrl + Shift + Enter to run as administrator
or type in the opened window: Start-Process pwsh -Verb RunAs
4. Enter the reset script in the administrator terminal:
irm https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_win_id_modifier.ps1 | iex
```
For the enhanced version:
```powershell
irm https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_win_id_modifier.ps1 | iex
```
##### Method 3: Using Search
>![Search PowerShell](img/pwsh_1.png)
>
>Type pwsh in the search box, right-click and select "Run as administrator"
>![Run as Administrator](img/pwsh_2.png)
Enter the reset script in the administrator terminal:
```powershell
irm https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_win_id_modifier.ps1 | iex
```
For the enhanced version:
```powershell
irm https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_win_id_modifier.ps1 | iex
```
### 🔧 PowerShell Installation Guide
If PowerShell is not installed on your system, you can install it using one of these methods:
#### Method 1: Install via Winget (Recommended)
1. Open Command Prompt or PowerShell
2. Run the following command:
```powershell
winget install --id Microsoft.PowerShell --source winget
```
#### Method 2: Manual Installation
1. Download the installer for your system:
- [PowerShell-7.4.6-win-x64.msi](https://github.com/PowerShell/PowerShell/releases/download/v7.4.6/PowerShell-7.4.6-win-x64.msi) (64-bit systems)
- [PowerShell-7.4.6-win-x86.msi](https://github.com/PowerShell/PowerShell/releases/download/v7.4.6/PowerShell-7.4.6-win-x86.msi) (32-bit systems)
- [PowerShell-7.4.6-win-arm64.msi](https://github.com/PowerShell/PowerShell/releases/download/v7.4.6/PowerShell-7.4.6-win-arm64.msi) (ARM64 systems)
2. Double-click the downloaded installer and follow the installation prompts
> 💡 If you encounter any issues, please refer to the [Microsoft Official Installation Guide](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows)
</details>
#### Windows 安装特性:
#### Windows Installation Features:
- 🔍 Automatically detects and uses PowerShell 7 if available
- 🛡️ Requests administrator privileges via UAC prompt
- 📝 Falls back to Windows PowerShell if PS7 isn't found
- 💡 Provides manual instructions if elevation fails
That's it! The script will:
1. ✨ Install the tool automatically
2. 🔄 Reset your Cursor trial immediately
### 📦 Manual Installation
> Download the appropriate file for your system from [releases](https://github.com/yuaotian/go-cursor-help/releases/latest)
> Download the appropriate file for your system from [releases](https://github.com/dacrab/go-cursor-help/releases/latest)
<details>
<summary>Windows Packages</summary>
@ -436,26 +120,12 @@ The program modifies Cursor's `storage.json` config file located at:
<summary><b>Modified Fields</b></summary>
The tool generates new unique identifiers for:
- `telemetry.machineId`
- `telemetry.macMachineId`
- `telemetry.devDeviceId`
- `telemetry.sqmId`
</details>
<details>
<summary><b>Manual Auto-Update Disable</b></summary>
Windows users can manually disable the auto-update feature:
1. Close all Cursor processes
2. Delete directory: `C:\Users\username\AppData\Local\cursor-updater`
3. Create a file with the same name: `cursor-updater` (without extension)
macOS/Linux users can try to locate similar `cursor-updater` directory in their system and perform the same operation.
</details>
<details>
<summary><b>Safety Features</b></summary>
@ -464,100 +134,128 @@ macOS/Linux users can try to locate similar `cursor-updater` directory in their
- ✅ Error handling and recovery
</details>
<details>
<summary><b>Registry Modification Notice</b></summary>
> ⚠️ **Important: This tool modifies the Windows Registry**
#### Modified Registry
- Path: `Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography`
- Key: `MachineGuid`
#### Potential Impact
Modifying this registry key may affect:
- Windows system's unique device identification
- Device recognition and authorization status of certain software
- System features based on hardware identification
#### Safety Measures
1. Automatic Backup
- Original value is automatically backed up before modification
- Backup location: `%APPDATA%\Cursor\User\globalStorage\backups`
- Backup file format: `MachineGuid.backup_YYYYMMDD_HHMMSS`
2. Manual Recovery Steps
- Open Registry Editor (regedit)
- Navigate to: `Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography`
- Right-click on `MachineGuid`
- Select "Modify"
- Paste the value from backup file
#### Important Notes
- Verify backup file existence before modification
- Use backup file to restore original value if needed
- Administrator privileges required for registry modification
</details>
---
### 📚 Recommended Reading
## 🌏 Chinese
- [Cursor Issues Collection and Solutions](https://mp.weixin.qq.com/s/pnJrH7Ifx4WZvseeP1fcEA)
- [AI Universal Development Assistant Prompt Guide](https://mp.weixin.qq.com/s/PRPz-qVkFJSgkuEKkTdzwg)
### 📝 问题描述
---
> 当看到以下提示时重置Cursor试用期
## 💬 Feedback & Suggestions
```text
Too many free trial accounts used on this machine.
Please upgrade to pro. We have this limit in place
to prevent abuse. Please let us know if you believe
this is a mistake.
```
We value your feedback on the new enhanced script! If you've tried the `cursor_win_id_modifier.ps1` script, please share your experience:
### 💻 系统支持
- 🐛 **Bug Reports**: Found any issues? Let us know!
- 💡 **Feature Suggestions**: Have ideas for improvements?
- ⭐ **Success Stories**: Share how the tool helped you!
- 🔧 **Technical Feedback**: Performance, compatibility, or usability insights
Your feedback helps us improve the tool for everyone. Feel free to open an issue or contribute to the project!
---
## Support
<div align="center">
<b>If you find this helpful, consider buying me a spicy gluten snack (Latiao) as appreciation~ 💁☕️</b>
<table>
<tr>
<td>
**Windows** ✅
- x64 & x86
<td align="center">
<b>微信赞赏</b><br>
<img src="img/wx_zsm2.png" width="500" alt="微信赞赏码"><br>
<small>要到饭咧?啊咧?啊咧?不给也没事~ 请随意打赏</small>
</td>
<td align="center">
<b>支付宝赞赏</b><br>
<img src="img/alipay.png" width="500" alt="支付宝赞赏码"><br>
<small>如果觉得有帮助,来包辣条犒劳一下吧~</small>
<td>
**macOS** ✅
- Intel & M-series
</td>
<td align="center">
<b>Alipay</b><br>
<img src="img/alipay_scan_pay.jpg" width="500" alt="Alipay"><br>
<em>1 Latiao = 1 AI thought cycle</em>
</td>
<td align="center">
<b>WeChat</b><br>
<img src="img/qun-16.png" width="500" alt="WeChat"><br>
<em>二维码7天内(8月4日前前)有效,过期请加微信</em>
</td>
<!-- <td align="center">
<b>ETC</b><br>
<img src="img/etc.png" width="100" alt="ETC Address"><br>
ETC: 0xa2745f4CD5d32310AC01694ABDB28bA32D125a6b
</td>
<td align="center"> -->
<td>
**Linux** ✅
- x64 & ARM64
</td>
</tr>
</table>
</div>
### 🚀 一键解决
**Linux/macOS**: 在终端中复制粘贴
```bash
curl -fsSL https://raw.githubusercontent.com/dacrab/go-cursor-help/master/scripts/install.sh | sudo bash
```
**Windows**: 在PowerShell中复制粘贴
```powershell
irm https://raw.githubusercontent.com/dacrab/go-cursor-help/master/scripts/install.ps1 | iex
```
#### Windows 安装特性:
- 🔍 自动检测并使用 PowerShell 7如果可用
- 🛡️ 通过 UAC 提示请求管理员权限
- 📝 如果没有 PS7 则使用 Windows PowerShell
- 💡 如果提权失败会提供手动说明
That's it! The script will:
1. ✨ 自动安装工具
2. 🔄 立即重置Cursor试用期
### 📦 Manual Installation
> Download the appropriate file for your system from [releases](https://github.com/dacrab/go-cursor-help/releases/latest)
<details>
<summary>Windows Packages</summary>
- 64-bit: `cursor-id-modifier_windows_x64.exe`
- 32-bit: `cursor-id-modifier_windows_x86.exe`
</details>
<details>
<summary>macOS Packages</summary>
- Intel: `cursor-id-modifier_darwin_x64_intel`
- M1/M2: `cursor-id-modifier_darwin_arm64_apple_silicon`
</details>
<details>
<summary>Linux Packages</summary>
- 64-bit: `cursor-id-modifier_linux_x64`
- 32-bit: `cursor-id-modifier_linux_x86`
- ARM64: `cursor-id-modifier_linux_arm64`
</details>
### 🔧 技术细节
<details>
<summary><b>配置文件</b></summary>
程序修改Cursor的`storage.json`配置文件,位于:
- Windows: `%APPDATA%\Cursor\User\globalStorage\`
- macOS: `~/Library/Application Support/Cursor/User/globalStorage/`
- Linux: `~/.config/Cursor/User/globalStorage/`
</details>
<details>
<summary><b>修改字段</b></summary>
工具会生成新的唯一标识符:
- `telemetry.machineId`
- `telemetry.macMachineId`
- `telemetry.devDeviceId`
- `telemetry.sqmId`
</details>
<details>
<summary><b>安全特性</b></summary>
## 🔔 关注公众号
#### 获取更多精彩内容
- 第一时间获取最新版本更新
- CursorAI使用技巧和最佳实践
- 利用AI提升编程效率
- 更多AI工具和开发资源
![微信公众号二维码](img/wx_public_2.png)
---
## ⭐ Project Stats
@ -586,6 +284,4 @@ furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
</details>

View File

@ -1,535 +0,0 @@
# 🚀 Cursor 免费试用重置工具
<div align="center">
[![Release](https://img.shields.io/github/v/release/yuaotian/go-cursor-help?style=flat-square&logo=github&color=blue)](https://github.com/yuaotian/go-cursor-help/releases/latest)
[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square&logo=bookstack)](https://github.com/yuaotian/go-cursor-help/blob/master/LICENSE)
[![Stars](https://img.shields.io/github/stars/yuaotian/go-cursor-help?style=flat-square&logo=github)](https://github.com/yuaotian/go-cursor-help/stargazers)
[🌟 English](README.md) | [🌏 中文](README_CN.md) | [🌏 日本語](README_JP.md)
<img src="https://ai-cursor.com/wp-content/uploads/2024/09/logo-cursor-ai-png.webp" alt="Cursor Logo" width="120"/>
> ⚠️ **重要提示**
>
> 本工具当前支持版本:
> - ✅ Windows: 最新的 1.0.x 版本(已支持)
> - ✅ Mac/Linux: 最新的 1.0.x 版本(已支持,欢迎测试并反馈问题)
> 使用前请确认您的 Cursor 版本。
<details open>
<summary><b>📦 版本历史与下载</b></summary>
<div class="version-card" style="background: linear-gradient(135deg, #6e8efb, #a777e3); border-radius: 8px; padding: 15px; margin: 10px 0; color: white;">
[查看完整版本历史]([CursorHistoryDown.md](https://github.com/oslook/cursor-ai-downloads?tab=readme-ov-file))
</div>
</details>
⚠️ **Cursor通用解决方案**
> 1. 关闭Cursor、退出账号、官网Setting删除账号(刷新节点IP日本、新加坡、 美国、香港低延迟为主不一定需要但是有条件就换Windows用户建议刷新DNS缓存`ipconfig /flushdns`)
> 前往Cursor官网删除当前账号
> 步骤:用户头像->Setting-左下角Advanced▼->Delete Account
>
> 2. 刷新机器码脚本,看下面脚本地址,国内可用
>
> 3. 重新注册账号、登录、打开Cursor即可恢复正常使用。
>
> 4. 备用方案:如果步骤 [**3**] 后仍不可用或者遇到注册账号失败、无法删除账号等问题这通常意味着您的浏览器被目标网站识别或限制风控。此时请尝试更换浏览器例如Edge、Google Chrome、Firefox。或者可以尝试使用能够修改或随机化浏览器指纹信息的浏览器
关注大佬公众号煎饼果子卷AI
---
> ⚠️ **MAC地址修改警告**
>
> Mac用户请注意: 本脚本包含MAC地址修改功能将会:
> - 修改您的网络接口MAC地址
> - 在修改前备份原始MAC地址
> - 此修改可能会暂时影响网络连接
> - 执行过程中可以选择跳过此步骤
---
### 📝 问题描述
> 当您遇到以下任何消息时:
#### 问题 1: 试用账号限制 <p align="right"><a href="#solution1"><img src="https://img.shields.io/badge/跳转到解决方案-Blue?style=plastic" alt="跳转到顶部"></a></p>
```text
Too many free trial accounts used on this machine.
Please upgrade to pro. We have this limit in place
to prevent abuse. Please let us know if you believe
this is a mistake.
```
#### 问题 2: API密钥限制 <p align="right"><a href="#solution2"><img src="https://img.shields.io/badge/跳转到解决方案-green?style=plastic" alt="跳转到顶部"></a></p>
```text
[New Issue]
Composer relies on custom models that cannot be billed to an API key.
Please disable API keys and use a Pro or Business subscription.
Request ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
```
#### 问题 3: 试用请求限制
> 这表明您在VIP免费试用期间已达到使用限制
```text
You've reached your trial request limit.
```
#### 问题 4: Claude 3.7 高负载 High Load <p align="right"><a href="#solution4"><img src="https://img.shields.io/badge/跳转到解决方案-purple?style=plastic" alt="跳转到顶部"></a></p>
```text
High Load
We're experiencing high demand for Claude 3.7 Sonnet right now. Please upgrade to Pro, or switch to the
'default' model, Claude 3.5 sonnet, another model, or try again in a few moments.
```
<br>
<p id="solution2"></p>
#### 解决方案完全卸载Cursor并重新安装API密钥问题
1. 下载 [Geek.exe 卸载工具[免费]](https://geekuninstaller.com/download)
2. 完全卸载Cursor应用
3. 重新安装Cursor应用
4. 继续执行解决方案1
<br>
<p id="solution1"></p>
> 临时解决方案:
#### 解决方案 1: 快速重置(推荐)
1. 关闭Cursor应用
2. 运行机器码重置脚本(见下方安装说明)
3. 重新打开Cursor继续使用
#### 解决方案 2: 切换账号
1. 文件 -> Cursor设置 -> 退出登录
2. 关闭Cursor
3. 运行机器码重置脚本
4. 使用新账号登录
#### 解决方案 3: 网络优化
如果上述解决方案不起作用,请尝试:
- 切换到低延迟节点(推荐区域:日本、新加坡、美国、香港)
- 确保网络稳定性
- 清除浏览器缓存并重试
<p id="solution4"></p>
#### 解决方案 4: Claude 3.7 访问问题High Load
如果您看到Claude 3.7 Sonnet的"High Load"高负载消息这表明Cursor在一天中某些时段限制免费试用账号使用3.7模型。请尝试:
1. 使用Gmail邮箱创建新账号可能需要通过不同IP地址连接
2. 尝试在非高峰时段访问通常在早上5-10点或下午3-7点之间限制较少
3. 考虑升级到Pro版本获取保证访问权限
4. 使用Claude 3.5 Sonnet作为备选方案
> 注意随着Cursor调整资源分配策略这些访问模式可能会发生变化。
### 🚀 系统支持
<table>
<tr>
<td>
**Windows** ✅
- x64 & x86
</td>
<td>
**macOS** ✅
- Intel & M-series
</td>
<td>
**Linux** ✅
- x64 & ARM64
</td>
</tr>
</table>
### 🚀 一键解决方案
<details open>
<summary><b>国内用户(推荐)</b></summary>
**macOS**
```bash
curl -fsSL https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_mac_id_modifier.sh -o ./cursor_mac_id_modifier.sh && sudo bash ./cursor_mac_id_modifier.sh && rm ./cursor_mac_id_modifier.sh
```
**Linux**
```bash
curl -fsSL https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_linux_id_modifier.sh | sudo bash
```
> **Linux 用户请注意:** 该脚本通过检查常用路径(`/usr/bin`, `/usr/local/bin`, `$HOME/.local/bin`, `/opt/cursor`, `/snap/bin`)、使用 `which cursor` 命令以及在 `/usr``/opt``$HOME/.local` 目录内搜索,来尝试定位您的 Cursor 安装。如果 Cursor 安装在其他位置或通过这些方法无法找到,脚本可能会失败。请确保可以通过这些标准位置或方法之一访问到 Cursor。
**Windows**
```powershell
irm https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_win_id_modifier.ps1 | iex
```
**Windows (增强版)**
```powershell
irm https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_win_id_modifier.ps1 | iex
```
> 增强版Cursor机器码修改工具支持双模式操作和试用重置功能
<div align="center">
<img src="img/run_success.png" alt="运行成功" width="600"/>
</div>
</details>
<details open>
<summary><b>Windows 管理员终端运行和手动安装</b></summary>
#### Windows 系统打开管理员终端的方法:
##### 方法一:使用 Win + X 快捷键
```md
1. 按下 Win + X 组合键
2. 在弹出的菜单中选择以下任一选项:
- "Windows PowerShell (管理员)"
- "Windows Terminal (管理员)"
- "终端(管理员)"
(具体选项因Windows版本而异)
```
##### 方法二:使用 Win + R 运行命令
```md
1. 按下 Win + R 组合键
2. 在运行框中输入 powershell 或 pwsh
3. 按 Ctrl + Shift + Enter 以管理员身份运行
或在打开的窗口中输入: Start-Process pwsh -Verb RunAs
4. 在管理员终端中输入以下重置脚本:
irm https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_win_id_modifier.ps1 | iex
```
增强版脚本:
```powershell
irm https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_win_id_modifier.ps1 | iex
```
##### 方法三:通过搜索启动
>![搜索 PowerShell](img/pwsh_1.png)
>
>在搜索框中输入 pwsh右键选择"以管理员身份运行"
>![管理员运行](img/pwsh_2.png)
在管理员终端中输入重置脚本:
```powershell
irm https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_win_id_modifier.ps1 | iex
```
增强版脚本:
```powershell
irm https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_win_id_modifier.ps1 | iex
```
### 🔧 PowerShell 安装指南
如果您的系统没有安装 PowerShell,可以通过以下方法安装:
#### 方法一:使用 Winget 安装(推荐)
1. 打开命令提示符或 PowerShell
2. 运行以下命令:
```powershell
winget install --id Microsoft.PowerShell --source winget
```
#### 方法二:手动下载安装
1. 下载对应系统的安装包:
- [PowerShell-7.4.6-win-x64.msi](https://github.com/PowerShell/PowerShell/releases/download/v7.4.6/PowerShell-7.4.6-win-x64.msi) (64位系统)
- [PowerShell-7.4.6-win-x86.msi](https://github.com/PowerShell/PowerShell/releases/download/v7.4.6/PowerShell-7.4.6-win-x86.msi) (32位系统)
- [PowerShell-7.4.6-win-arm64.msi](https://github.com/PowerShell/PowerShell/releases/download/v7.4.6/PowerShell-7.4.6-win-arm64.msi) (ARM64系统)
2. 双击下载的安装包,按提示完成安装
> 💡 如果仍然遇到问题,可以参考 [Microsoft 官方安装指南](https://learn.microsoft.com/zh-cn/powershell/scripting/install/installing-powershell-on-windows)
</details>
#### Windows 安装特性:
- 🔍 自动检测并使用 PowerShell 7如果可用
- 🛡️ 通过 UAC 提示请求管理员权限
- 📝 如果没有 PS7 则使用 Windows PowerShell
- 💡 如果提权失败会提供手动说明
完成后,脚本将:
1. ✨ 自动安装工具
2. 🔄 立即重置 Cursor 试用期
### 📦 手动安装
> 从 [releases](https://github.com/yuaotian/go-cursor-help/releases/latest) 下载适合您系统的文件
<details>
<summary>Windows 安装包</summary>
- 64 位: `cursor-id-modifier_windows_x64.exe`
- 32 位: `cursor-id-modifier_windows_x86.exe`
</details>
<details>
<summary>macOS 安装包</summary>
- Intel: `cursor-id-modifier_darwin_x64_intel`
- M1/M2: `cursor-id-modifier_darwin_arm64_apple_silicon`
</details>
<details>
<summary>Linux 安装包</summary>
- 64 位: `cursor-id-modifier_linux_x64`
- 32 位: `cursor-id-modifier_linux_x86`
- ARM64: `cursor-id-modifier_linux_arm64`
</details>
### 🔧 技术细节
<details>
<summary><b>注册表修改说明</b></summary>
> ⚠️ **重要提示:本工具会修改系统注册表**
#### 修改内容
- 路径:`计算机\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography`
- 项目:`MachineGuid`
#### 潜在影响
修改此注册表项可能会影响:
- Windows 系统对设备的唯一标识
- 某些软件的设备识别和授权状态
- 基于硬件标识的系统功能
#### 安全措施
1. 自动备份
- 每次修改前会自动备份原始值
- 备份保存在:`%APPDATA%\Cursor\User\globalStorage\backups`
- 备份文件格式:`MachineGuid.backup_YYYYMMDD_HHMMSS`
2. 手动恢复方法
- 打开注册表编辑器regedit
- 定位到:`计算机\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography`
- 右键点击 `MachineGuid`
- 选择"修改"
- 粘贴备份文件中的值
#### 注意事项
- 建议在修改前先确认备份文件的存在
- 如遇问题可通过备份文件恢复原始值
- 必须以管理员权限运行才能修改注册表
</details>
<details>
<summary><b>配置文件</b></summary>
程序修改 Cursor 的`storage.json`配置文件,位于:
- Windows: `%APPDATA%\Cursor\User\globalStorage\`
- macOS: `~/Library/Application Support/Cursor/User/globalStorage/`
- Linux: `~/.config/Cursor/User/globalStorage/`
</details>
<details>
<summary><b>修改字段</b></summary>
工具会生成新的唯一标识符:
- `telemetry.machineId`
- `telemetry.macMachineId`
- `telemetry.devDeviceId`
- `telemetry.sqmId`
</details>
<details>
<summary><b>手动禁用自动更新</b></summary>
Windows 用户可以手动禁用自动更新功能:
1. 关闭所有 Cursor 进程
2. 删除目录:`C:\Users\用户名\AppData\Local\cursor-updater`
3. 创建同名文件:`cursor-updater`(不带扩展名)
Linux用户可以尝试在系统中找到类似的`cursor-updater`目录进行相同操作。
MacOS用户按照以下步骤操作
```bash
# 注意经测试此方法仅适用于0.45.11及以下版本不支持0.46.*版本
# 关闭所有 Cursor 进程
pkill -f "Cursor"
# 备份app-update.yml并创建空的只读文件代替原文件
cd /Applications/Cursor.app/Contents/Resources
mv app-update.yml app-update.yml.bak
touch app-update.yml
chmod 444 app-update.yml
# 打开Cursor设置将更新模式设置为"无"该步骤必须执行否则Cursor依然会自动检查更新
# 步骤Settings -> Application -> Update, 将Mode设置为none
# 注意: cursor-updater修改方法可能已失效。但为了以防万一还是删除更新目录并创建阻止文件
rm -rf ~/Library/Application\ Support/Caches/cursor-updater
touch ~/Library/Application\ Support/Caches/cursor-updater
```
</details>
<details>
<summary><b>安全特性</b></summary>
- ✅ 安全的进程终止
- ✅ 原子文件操作
- ✅ 错误处理和恢复
</details>
<details>
<summary><b>重置 Cursor 免费试用</b></summary>
### 使用 `cursor_free_trial_reset.sh` 脚本
#### macOS
```bash
curl -fsSL https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_free_trial_reset.sh -o ./cursor_free_trial_reset.sh && sudo bash ./cursor_free_trial_reset.sh && rm ./cursor_free_trial_reset.sh
```
#### Linux
```bash
curl -fsSL https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_free_trial_reset.sh | sudo bash
```
#### Windows
```powershell
irm https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_free_trial_reset.sh | iex
```
</details>
## 联系方式
<div align="center">
<table>
<tr>
<td align="center">
<b>个人微信</b><br>
<img src="img/wx_me.png" width="250" alt="作者微信"><br>
<b>微信JavaRookie666</b>
</td>
<td align="center">
<b>微信交流群</b><br>
<img src="img/qun-16.png" width="500" alt="WeChat"><br>
<small>二维码7天内(8月4日前)有效,过期请加微信</small>
</td>
<td align="center">
<b>公众号</b><br>
<img src="img/wx_public_2.png" width="250" alt="微信公众号"><br>
<small>获取更多AI开发资源</small>
</td>
<td align="center">
<b>微信赞赏</b><br>
<img src="img/wx_zsm2.png" width="500" alt="微信赞赏码"><br>
<small>要到饭咧?啊咧?啊咧?不给也没事~ 请随意打赏</small>
</td>
<td align="center">
<b>支付宝赞赏</b><br>
<img src="img/alipay.png" width="500" alt="支付宝赞赏码"><br>
<small>如果觉得有帮助,来包辣条犒劳一下吧~</small>
</td>
</tr>
</table>
</div>
---
### 📚 推荐阅读
- [Cursor 异常问题收集和解决方案](https://mp.weixin.qq.com/s/pnJrH7Ifx4WZvseeP1fcEA)
- [AI 通用开发助手提示词指南](https://mp.weixin.qq.com/s/PRPz-qVkFJSgkuEKkTdzwg)
---
## 💬 反馈与建议
我们非常重视您对新增强脚本的反馈!如果您已经尝试了 `cursor_win_id_modifier.ps1` 脚本,请分享您的使用体验:
- 🐛 **错误报告**:发现任何问题?请告诉我们!
- 💡 **功能建议**:有改进想法?
- ⭐ **成功案例**:分享工具如何帮助到您!
- 🔧 **技术反馈**:性能、兼容性或易用性方面的见解
您的反馈帮助我们为所有人改进工具。欢迎提交issue或为项目做出贡献
---
## ⭐ 项目统计
<div align="center">
[![Star History Chart](https://api.star-history.com/svg?repos=yuaotian/go-cursor-help&type=Date)](https://star-history.com/#yuaotian/go-cursor-help&Date)
![Repobeats analytics image](https://repobeats.axiom.co/api/embed/ddaa9df9a94b0029ec3fad399e1c1c4e75755477.svg "Repobeats analytics image")
</div>
## 📄 许可证
<details>
<summary><b>MIT 许可证</b></summary>
Copyright (c) 2024
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
</details>

View File

@ -1,587 +0,0 @@
# 🚀 Cursor 無料試用リセットツール
<div align="center">
[![Release](https://img.shields.io/github/v/release/yuaotian/go-cursor-help?style=flat-square&logo=github&color=blue)](https://github.com/yuaotian/go-cursor-help/releases/latest)
[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square&logo=bookstack)](https://github.com/yuaotian/go-cursor-help/blob/master/LICENSE)
[![Stars](https://img.shields.io/github/stars/yuaotian/go-cursor-help?style=flat-square&logo=github)](https://github.com/yuaotian/go-cursor-help/stargazers)
[🌟 English](README.md) | [🌏 中文](README_CN.md) | [🌏 日本語](README_JP.md)
<img src="https://ai-cursor.com/wp-content/uploads/2024/09/logo-cursor-ai-png.webp" alt="Cursor Logo" width="120"/>
</div>
> ⚠️ **重要なお知らせ**
>
> このツールは現在以下のバージョンをサポートしています:
> - ✅ Windows: 最新の1.0.xバージョンサポート済み
> - ✅ Mac/Linux: 最新の1.0.xバージョンサポート済み、フィードバック歓迎
>
> このツールを使用する前に、Cursorのバージョンを確認してください。
<details open>
<summary><b>📦 バージョン履歴とダウンロード</b></summary>
<div class="version-card" style="background: linear-gradient(135deg, #6e8efb, #a777e3); border-radius: 8px; padding: 15px; margin: 10px 0; color: white;">
### 🌟 最新バージョン
[完全なバージョン履歴を見る]([CursorHistoryDown.md](https://github.com/oslook/cursor-ai-downloads?tab=readme-ov-file))
</div>
</details>
⚠️ **Cursorの一般的な解決策**
> 1. Cursorを閉じ、アカウントからログアウトし、公式サイトの設定からアカウントを削除しますIPードを更新日本、シンガポール、アメリカ、香港など、低遅延を優先。必須ではありませんが条件が整えば変更してください。Windowsユーザーの場合はDNSキャッシュの更新をお勧めします`ipconfig /flushdns`
> Cursor公式サイトで現在のアカウントを削除します
> 手順:ユーザーアイコン->設定->左下のAdvanced▼->Delete Account
>
> 2. マシンコードリセットスクリプトを実行します。下記のスクリプトアドレスを参照してください。
>
> 3. アカウントを再登録し、ログインして、Cursorを開くと、正常に使用できるようになります。
>
> 4. 代替案:ステップ[**3**]の後でもまだ使用できない場合、またはアカウント登録に失敗したり、アカウントを削除できないなどの問題が発生した場合、これは通常、ブラウザがターゲットサイトに識別または制限されているリスク管理ことを意味します。この場合、Edge、Google Chrome、Firefoxなど別のブラウザを試してみてくださいまたは、ブラウザのフィンガープリント情報を変更またはランダム化できるブラウザの使用を検討してください
---
⚠️ **MACアドレス変更警告**
>
> Macユーザーの皆様へ: このスクリプトにはMACアドレス変更機能が含まれています。以下の操作が行われます
> - ネットワークインターフェースのMACアドレスを変更します
> - 変更前に元のMACアドレスをバックアップします
> - この変更により一時的にネットワーク接続が影響を受ける可能性があります
> - 実行中にこのステップをスキップすることができます
>
<details >
<summary><b>🔒 自動更新機能の無効化</b></summary>
> Cursorがサポートされていない新しいバージョンに自動的に更新されるのを防ぐために、自動更新機能を無効にすることができます。
#### 方法1: 組み込みスクリプトを使用する(推奨)
リセットツールを実行するとき、スクリプトは自動更新を無効にするかどうかを尋ねます:
```text
[質問] Cursorの自動更新機能を無効にしますか
0) いいえ - デフォルト設定を維持Enterキーを押す
1) はい - 自動更新を無効にする
```
`1`を選択して無効化操作を自動的に完了します。
#### 方法2: 手動で無効化
**Windows:**
1. すべてのCursorプロセスを閉じます
2. ディレクトリを削除します: `%LOCALAPPDATA%\cursor-updater`
3. 同じ名前のファイルを作成します(拡張子なし)
**macOS:**
```bash
# 注意: テスト済みでは、この方法はバージョン0.45.11およびそれ以前のバージョンでのみ機能します。
# Cursorを閉じます
pkill -f "Cursor"
# app-update.ymlを空の読み取り専用ファイルに置き換えます
cd /Applications/Cursor.app/Contents/Resources
mv app-update.yml app-update.yml.bak
touch app-update.yml
chmod 444 app-update.yml
# 設定 -> アプリケーション -> 更新、モードをnoneに設定します。
# これを行わないと、Cursorは更新をチェックし続けます。
# 注意: cursor-updaterの変更方法はもはや有効ではないかもしれません
# いずれにせよ、更新ディレクトリを削除し、ブロックファイルを作成します
rm -rf ~/Library/Application\ Support/Caches/cursor-updater
touch ~/Library/Application\ Support/Caches/cursor-updater
```
**Linux:**
```bash
# Cursorを閉じます
pkill -f "Cursor"
# 更新ディレクトリを削除し、ブロックファイルを作成します
rm -rf ~/.config/cursor-updater
touch ~/.config/cursor-updater
```
> ⚠️ **注意:** 自動更新を無効にした後、新しいバージョンを手動でダウンロードしてインストールする必要があります。新しいバージョンが互換性があることを確認した後に更新することをお勧めします。
</details>
---
### 📝 説明
> これらのメッセージのいずれかに遭遇した場合:
#### 問題1: 試用アカウント制限 <p align="right"><a href="#issue1"><img src="https://img.shields.io/badge/Move%20to%20Solution-Blue?style=plastic" alt="Back To Top"></a></p>
```text
Too many free trial accounts used on this machine.
Please upgrade to pro. We have this limit in place
to prevent abuse. Please let us know if you believe
this is a mistake.
```
#### 問題2: APIキー制限 <p align="right"><a href="#issue2"><img src="https://img.shields.io/badge/Move%20to%20Solution-green?style=plastic" alt="Back To Top"></a></p>
```text
[New Issue]
Composer relies on custom models that cannot be billed to an API key.
Please disable API keys and use a Pro or Business subscription.
Request ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
```
#### 問題3: 試用リクエスト制限
> これは、VIP無料試用期間中に使用制限に達したことを示しています
```text
You've reached your trial request limit.
```
#### 問題4: Claude 3.7 高負荷 <p align="right"><a href="#issue4"><img src="https://img.shields.io/badge/Move%20to%20Solution-purple?style=plastic" alt="Back To Top"></a></p>
```text
High Load
We're experiencing high demand for Claude 3.7 Sonnet right now. Please upgrade to Pro, or switch to the
'default' model, Claude 3.5 sonnet, another model, or try again in a few moments.
```
<br>
<p id="issue2"></p>
#### 解決策 : Cursorを完全にアンインストールして再インストールするAPIキーの問題
1. [Geek.exeアンインストーラー[無料]](https://geekuninstaller.com/download)をダウンロードします
2. Cursorアプリを完全にアンインストールします
3. Cursorアプリを再インストールします
4. 解決策1を続行します
<br>
<p id="issue1"></p>
> 一時的な解決策:
#### 解決策1: クイックリセット(推奨)
1. Cursorアプリケーションを閉じます
2. マシンコードリセットスクリプトを実行します(以下のインストール手順を参照)
3. Cursorを再度開いて使用を続けます
#### 解決策2: アカウントの切り替え
1. ファイル -> Cursor設定 -> サインアウト
2. Cursorを閉じます
3. マシンコードリセットスクリプトを実行します
4. 新しいアカウントでログインします
#### 解決策3: ネットワークの最適化
上記の解決策が機能しない場合は、次のことを試してください:
- 低遅延ノードに切り替えます(推奨地域:日本、シンガポール、米国、香港)
- ネットワークの安定性を確保します
- ブラウザのキャッシュをクリアして再試行します
#### 解決策4: Claude 3.7 アクセス問題(高負荷)
Claude 3.7 Sonnetの"High Load"メッセージが表示された場合、これはCursorが特定の時間帯に無料試用アカウントの3.7モデルの使用を制限していることを示しています。次のことを試してください:
1. Gmailで作成した新しいアカウントに切り替えます。異なるIPアドレスを使用して接続することをお勧めします
2. 非ピーク時間帯にアクセスを試みます通常、5-10 AMまたは3-7 PMの間に制限が少ないです
3. Proにアップグレードしてアクセスを保証します
4. Claude 3.5 Sonnetを代替オプションとして使用します
> 注意: Cursorがリソース配分ポリシーを調整するにつれて、これらのアクセスパターンは変更される可能性があります。
### 💻 システムサポート
<table>
<tr>
<td>
**Windows** ✅
- x64 (64ビット)
- x86 (32ビット)
</td>
<td>
**macOS** ✅
- Intel (x64)
- Apple Silicon (M1/M2)
</td>
<td>
**Linux** ✅
- x64 (64ビット)
- x86 (32ビット)
- ARM64
</td>
</tr>
</table>
### 🚀 ワンクリックソリューション
<details open>
<summary><b>グローバルユーザー</b></summary>
**macOS**
```bash
# 方法2
curl -fsSL https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_mac_id_modifier.sh -o ./cursor_mac_id_modifier.sh && sudo bash ./cursor_mac_id_modifier.sh && rm ./cursor_mac_id_modifier.sh
```
**Linux**
```bash
curl -fsSL https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_linux_id_modifier.sh | sudo bash
```
**Windows**
```powershell
irm https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_win_id_modifier.ps1 | iex
```
**Windows (強化版)**
```powershell
irm https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_win_id_modifier.ps1 | iex
```
> デュアルモード操作とトライアルリセット機能を備えた強化版Cursorマシンコード修正ツール
<div align="center">
<img src="img/run_success.png" alt="Run Success" width="600"/>
</div>
</details>
<details open>
<summary><b>中国ユーザー(推奨)</b></summary>
**macOS**
```bash
curl -fsSL https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_mac_id_modifier.sh -o ./cursor_mac_id_modifier.sh && sudo bash ./cursor_mac_id_modifier.sh && rm ./cursor_mac_id_modifier.sh
```
**Linux**
```bash
curl -fsSL https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_linux_id_modifier.sh | sudo bash
```
> **Linuxユーザーへの注意** スクリプトは、一般的なパス(`/usr/bin`, `/usr/local/bin`, `$HOME/.local/bin`, `/opt/cursor`, `/snap/bin`)の確認、`which cursor` コマンドの使用、および `/usr``/opt``$HOME/.local` ディレクトリ内の検索によって、Cursor のインストールを見つけようとします。Cursorが他の場所にインストールされているか、これらの方法で見つからない場合、スクリプトは失敗する可能性があります。これらの標準的な場所または方法のいずれかを通じてCursorにアクセスできることを確認してください。
**Windows**
```powershell
irm https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_win_id_modifier.ps1 | iex
```
**Windows (強化版)**
```powershell
irm https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_win_id_modifier.ps1 | iex
```
> デュアルモード操作とトライアルリセット機能を備えた強化版Cursorマシンコード修正ツール
</details>
<details open>
<summary><b>Windowsターミナルの実行と構成</b></summary>
#### Windowsで管理者ターミナルを開く方法
##### 方法1: Win + Xショートカットを使用する
```md
1. Win + Xキーの組み合わせを押します
2. メニューから次のオプションのいずれかを選択します:
- "Windows PowerShell (管理者)"
- "Windows Terminal (管理者)"
- "ターミナル (管理者)"
Windowsのバージョンによってオプションが異なる場合があります
```
##### 方法2: Win + R実行コマンドを使用する
```md
1. Win + Rキーの組み合わせを押します
2. 実行ダイアログにpowershellまたはpwshと入力します
3. Ctrl + Shift + Enterを押して管理者として実行します
または開いたウィンドウに次のように入力します: Start-Process pwsh -Verb RunAs
4. 管理者ターミナルにリセットスクリプトを入力します:
irm https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_win_id_modifier.ps1 | iex
```
強化版スクリプト:
```powershell
irm https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_win_id_modifier.ps1 | iex
```
##### 方法3: 検索を使用する
>![PowerShellを検索](img/pwsh_1.png)
>
>検索ボックスにpwshと入力し、右クリックして「管理者として実行」を選択します
>![管理者として実行](img/pwsh_2.png)
管理者ターミナルにリセットスクリプトを入力します:
```powershell
irm https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_win_id_modifier.ps1 | iex
```
強化版スクリプト:
```powershell
irm https://aizaozao.com/accelerate.php/https://raw.githubusercontent.com/yuaotian/go-cursor-help/refs/heads/master/scripts/run/cursor_win_id_modifier.ps1 | iex
```
### 🔧 PowerShellインストールガイド
システムにPowerShellがインストールされていない場合は、次の方法でインストールできます
#### 方法1: Wingetを使用してインストール推奨
1. コマンドプロンプトまたはPowerShellを開きます
2. 次のコマンドを実行します:
```powershell
winget install --id Microsoft.PowerShell --source winget
```
#### 方法2: 手動でインストール
1. システムに適したインストーラーをダウンロードします:
- [PowerShell-7.4.6-win-x64.msi](https://github.com/PowerShell/PowerShell/releases/download/v7.4.6/PowerShell-7.4.6-win-x64.msi)64ビットシステム用
- [PowerShell-7.4.6-win-x86.msi](https://github.com/PowerShell/PowerShell/releases/download/v7.4.6/PowerShell-7.4.6-win-x86.msi)32ビットシステム用
- [PowerShell-7.4.6-win-arm64.msi](https://github.com/PowerShell/PowerShell/releases/download/v7.4.6/PowerShell-7.4.6-win-arm64.msi)ARM64システム用
2. ダウンロードしたインストーラーをダブルクリックし、インストールの指示に従います
> 💡 問題が発生した場合は、[Microsoft公式インストールガイド](https://learn.microsoft.com/ja-jp/powershell/scripting/install/installing-powershell-on-windows)を参照してください
</details>
#### Windowsインストール機能
- 🔍 PowerShell 7が利用可能な場合は自動的に検出して使用します
- 🛡️ UACプロンプトを介して管理者権限を要求します
- 📝 PS7が見つからない場合はWindows PowerShellにフォールバックします
- 💡 権限昇格に失敗した場合は手動の指示を提供します
これで完了です!スクリプトは次のことを行います:
1. ✨ ツールを自動的にインストールします
2. 🔄 Cursorの試用期間を即座にリセットします
### 📦 手動インストール
> [リリース](https://github.com/yuaotian/go-cursor-help/releases/latest)からシステムに適したファイルをダウンロードします
<details>
<summary>Windowsパッケージ</summary>
- 64ビット: `cursor-id-modifier_windows_x64.exe`
- 32ビット: `cursor-id-modifier_windows_x86.exe`
</details>
<details>
<summary>macOSパッケージ</summary>
- Intel: `cursor-id-modifier_darwin_x64_intel`
- M1/M2: `cursor-id-modifier_darwin_arm64_apple_silicon`
</details>
<details>
<summary>Linuxパッケージ</summary>
- 64ビット: `cursor-id-modifier_linux_x64`
- 32ビット: `cursor-id-modifier_linux_x86`
- ARM64: `cursor-id-modifier_linux_arm64`
</details>
### 🔧 技術的詳細
<details>
<summary><b>構成ファイル</b></summary>
プログラムはCursorの`storage.json`構成ファイルを変更します。場所は次のとおりです:
- Windows: `%APPDATA%\Cursor\User\globalStorage\storage.json`
- macOS: `~/Library/Application Support/Cursor/User/globalStorage/storage.json`
- Linux: `~/.config/Cursor/User/globalStorage/storage.json`
</details>
<details>
<summary><b>変更されたフィールド</b></summary>
ツールは次の新しい一意の識別子を生成します:
- `telemetry.machineId`
- `telemetry.macMachineId`
- `telemetry.devDeviceId`
- `telemetry.sqmId`
</details>
<details>
<summary><b>手動自動更新無効化</b></summary>
Windowsユーザーは自動更新機能を手動で無効にすることができます
1. すべてのCursorプロセスを閉じます
2. ディレクトリを削除します: `C:\Users\username\AppData\Local\cursor-updater`
3. 同じ名前のファイルを作成します: `cursor-updater`(拡張子なし)
macOS/Linuxユーザーはシステム内で同様の`cursor-updater`ディレクトリを見つけて同じ操作を行うことができます。
</details>
<details>
<summary><b>安全機能</b></summary>
- ✅ 安全なプロセス終了
- ✅ アトミックファイル操作
- ✅ エラーハンドリングとリカバリ
</details>
<details>
<summary><b>レジストリ変更通知</b></summary>
> ⚠️ **重要: このツールはWindowsレジストリを変更します**
#### 変更されたレジストリ
- パス: `コンピュータ\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography`
- キー: `MachineGuid`
#### 潜在的な影響
このレジストリキーを変更すると、次のことに影響を与える可能性があります:
- Windowsシステムの一意のデバイス識別
- 特定のソフトウェアのデバイス認識と認証状態
- ハードウェア識別に基づくシステム機能
#### 安全対策
1. 自動バックアップ
- 変更前に元の値が自動的にバックアップされます
- バックアップ場所: `%APPDATA%\Cursor\User\globalStorage\backups`
- バックアップファイル形式: `MachineGuid.backup_YYYYMMDD_HHMMSS`
2. 手動復元手順
- レジストリエディタregeditを開きます
- 次の場所に移動します: `コンピュータ\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography`
- `MachineGuid`を右クリックします
- 「修正」を選択します
- バックアップファイルの値を貼り付けます
#### 重要な注意事項
- 変更前にバックアップファイルの存在を確認します
- 必要に応じてバックアップファイルを使用して元の値を復元します
- レジストリの変更には管理者権限が必要です
</details>
---
### 📚 推奨読書
- [Cursorの問題収集と解決策](https://mp.weixin.qq.com/s/pnJrH7Ifx4WZvseeP1fcEA)
- [AIユニバーサル開発アシスタントプロンプトガイド](https://mp.weixin.qq.com/s/PRPz-qVkFJSgkuEKkTdzwg)
---
## サポート
<div align="center">
<b>このツールが役立つと感じた場合、スパイシーグルテンのおやつLatiaoを買っていただけると嬉しいです~ 💁☕️</b>
<table>
<tr>
<td align="center">
<b>WeChat Pay</b><br>
<img src="img/wx_zsm2.png" width="500" alt="WeChat Pay"><br>
<small>要到饭咧?啊咧?啊咧?不给也没事~ 请随意打赏</small>
</td>
<td align="center">
<b>Alipay</b><br>
<img src="img/alipay.png" width="500" alt="Alipay"><br>
<small>如果觉得有帮助,来包辣条犒劳一下吧~</small>
</td>
<td align="center">
<b>Alipay</b><br>
<img src="img/alipay_scan_pay.jpg" width="500" alt="Alipay"><br>
<em>1 Latiao = 1 AI thought cycle</em>
</td>
<td align="center">
<b>WeChat</b><br>
<img src="img/qun-16.png" width="500" alt="WeChat"><br>
<em>二维码7天内(8月4日前前)有效,过期请加微信</em>
</td>
<!-- <td align="center">
<b>ETC</b><br>
<img src="img/etc.png" width="100" alt="ETC Address"><br>
ETC: 0xa2745f4CD5d32310AC01694ABDB28bA32D125a6b
</td>
<td align="center"> -->
</td>
</tr>
</table>
</div>
---
## 💬 フィードバック&提案
新しい強化スクリプトに関するフィードバックをお待ちしています!`cursor_win_id_modifier.ps1` スクリプトをお試しいただいた方は、ぜひご体験をお聞かせください:
- 🐛 **バグレポート**:問題を発見されましたか?お知らせください!
- 💡 **機能提案**:改善のアイデアはありますか?
- ⭐ **成功事例**:ツールがどのようにお役に立ったかお聞かせください!
- 🔧 **技術的フィードバック**:パフォーマンス、互換性、使いやすさに関するご意見
皆様のフィードバックは、すべてのユーザーのためにツールを改善するのに役立ちます。お気軽にissueを開いたり、プロジェクトに貢献してください
---
## ⭐ プロジェクト統計
<div align="center">
[![Star History Chart](https://api.star-history.com/svg?repos=yuaotian/go-cursor-help&type=Date)](https://star-history.com/#yuaotian/go-cursor-help&Date)
![Repobeats analytics image](https://repobeats.axiom.co/api/embed/ddaa9df9a94b0029ec3fad399e1c1c4e75755477.svg "Repobeats analytics image")
</div>
## 📄 ライセンス
<details>
<summary><b>MITライセンス</b></summary>
Copyright (c) 2024
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
</details>

View File

@ -11,13 +11,13 @@ import (
"runtime/debug"
"strings"
"github.com/sirupsen/logrus"
"github.com/dacrab/go-cursor-help/internal/config"
"github.com/dacrab/go-cursor-help/internal/lang"
"github.com/dacrab/go-cursor-help/internal/process"
"github.com/dacrab/go-cursor-help/internal/ui"
"github.com/dacrab/go-cursor-help/pkg/idgen"
"github.com/yuaotian/go-cursor-help/internal/config"
"github.com/yuaotian/go-cursor-help/internal/lang"
"github.com/yuaotian/go-cursor-help/internal/process"
"github.com/yuaotian/go-cursor-help/internal/ui"
"github.com/yuaotian/go-cursor-help/pkg/idgen"
"github.com/sirupsen/logrus"
)
// Global variables
@ -29,15 +29,7 @@ var (
)
func main() {
// Place defer at the beginning of main to ensure it can catch panics from all subsequent function calls
defer func() {
if r := recover(); r != nil {
log.Errorf("Panic recovered: %v\n", r)
debug.PrintStack()
waitExit()
}
}()
setupErrorRecovery()
handleFlags()
setupLogger()
@ -81,6 +73,16 @@ func main() {
}
}
func setupErrorRecovery() {
defer func() {
if r := recover(); r != nil {
log.Errorf("Panic recovered: %v\n", r)
debug.PrintStack()
waitExit()
}
}()
}
func handleFlags() {
flag.Parse()
if *showVersion {
@ -238,7 +240,7 @@ func generateNewConfig(display *ui.Display, generator *idgen.Generator, oldConfi
if oldConfig != nil && oldConfig.TelemetrySqmId != "" {
newConfig.TelemetrySqmId = oldConfig.TelemetrySqmId
} else if sqmID, err := generator.GenerateSQMID(); err != nil {
} else if sqmID, err := generator.GenerateMacMachineID(); err != nil {
log.Fatal("Failed to generate SQM ID:", err)
} else {
newConfig.TelemetrySqmId = sqmID

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/yuaotian/go-cursor-help
module github.com/dacrab/go-cursor-help
go 1.21

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

View File

@ -91,7 +91,7 @@ func (m *Manager) prepareUpdatedConfig(config *StorageConfig) map[string]interfa
originalFile["telemetry.machineId"] = config.TelemetryMachineId
originalFile["telemetry.devDeviceId"] = config.TelemetryDevDeviceId
originalFile["lastModified"] = time.Now().UTC().Format(time.RFC3339)
// originalFile["version"] = "1.0.1"
originalFile["version"] = "1.0.1"
return originalFile
}

View File

@ -4,113 +4,56 @@ import (
"crypto/rand"
"encoding/hex"
"fmt"
"sync"
"time"
)
// Generator handles secure ID generation for machines and devices
type Generator struct {
bufferPool sync.Pool
}
type Generator struct{}
// NewGenerator creates a new ID generator
func NewGenerator() *Generator {
return &Generator{
bufferPool: sync.Pool{
New: func() interface{} {
return make([]byte, 64)
},
},
}
return &Generator{}
}
// Constants for ID generation
const (
machineIDPrefix = "auth0|user_"
uuidFormat = "%s-%s-%s-%s-%s"
)
// Helper methods
// -------------
// simulateWork adds a small delay to make progress visible
func (g *Generator) simulateWork() {
time.Sleep(800 * time.Millisecond)
}
// generateRandomHex generates a random hex string of specified length
func (g *Generator) generateRandomHex(length int) (string, error) {
buffer := g.bufferPool.Get().([]byte)
defer g.bufferPool.Put(buffer)
if _, err := rand.Read(buffer[:length]); err != nil {
bytes := make([]byte, length)
if _, err := rand.Read(bytes); err != nil {
return "", fmt.Errorf("failed to generate random bytes: %w", err)
}
return hex.EncodeToString(buffer[:length]), nil
return hex.EncodeToString(bytes), nil
}
// GenerateMachineID generates a new machine ID with auth0|user_ prefix
func (g *Generator) GenerateMachineID() (string, error) {
randomPart, err := g.generateRandomHex(32) // 生成64字符的十六进制
if err != nil {
return "", err
}
// Public methods
// -------------
return fmt.Sprintf("%x%s", []byte(machineIDPrefix), randomPart), nil
// GenerateMachineID generates a new 32-byte machine ID
func (g *Generator) GenerateMachineID() (string, error) {
g.simulateWork()
return g.generateRandomHex(32)
}
// GenerateMacMachineID generates a new 64-byte MAC machine ID
func (g *Generator) GenerateMacMachineID() (string, error) {
return g.generateRandomHex(32) // 生成64字符的十六进制
g.simulateWork()
return g.generateRandomHex(64)
}
// GenerateDeviceID generates a new device ID in UUID format
func (g *Generator) GenerateDeviceID() (string, error) {
g.simulateWork()
id, err := g.generateRandomHex(16)
if err != nil {
return "", err
}
return fmt.Sprintf(uuidFormat,
return fmt.Sprintf("%s-%s-%s-%s-%s",
id[0:8], id[8:12], id[12:16], id[16:20], id[20:32]), nil
}
// GenerateSQMID generates a new SQM ID in UUID format (with braces)
func (g *Generator) GenerateSQMID() (string, error) {
id, err := g.GenerateDeviceID()
if err != nil {
return "", err
}
return fmt.Sprintf("{%s}", id), nil
}
// ValidateID validates the format of various ID types
func (g *Generator) ValidateID(id string, idType string) bool {
switch idType {
case "machineID", "macMachineID":
return len(id) == 64 && isHexString(id)
case "deviceID":
return isValidUUID(id)
case "sqmID":
if len(id) < 2 || id[0] != '{' || id[len(id)-1] != '}' {
return false
}
return isValidUUID(id[1 : len(id)-1])
default:
return false
}
}
// Helper functions
func isHexString(s string) bool {
_, err := hex.DecodeString(s)
return err == nil
}
func isValidUUID(uuid string) bool {
if len(uuid) != 36 {
return false
}
for i, r := range uuid {
if i == 8 || i == 13 || i == 18 || i == 23 {
if r != '-' {
return false
}
continue
}
if !((r >= '0' && r <= '9') || (r >= 'a' && r <= 'f') || (r >= 'A' && r <= 'F')) {
return false
}
}
return true
}

View File

@ -1,375 +0,0 @@
import csv
from dataclasses import dataclass
from typing import List
import json
@dataclass
class CursorVersion:
version: str
build_id: str
def get_download_links(self) -> dict:
base_url = f"https://downloader.cursor.sh/builds/{self.build_id}"
return {
"windows": {
"x64": f"{base_url}/windows/nsis/x64",
"arm64": f"{base_url}/windows/nsis/arm64"
},
"mac": {
"universal": f"{base_url}/mac/installer/universal",
"arm64": f"{base_url}/mac/installer/arm64",
"x64": f"{base_url}/mac/installer/x64"
},
"linux": {
"x64": f"{base_url}/linux/appImage/x64"
}
}
def parse_versions(data: str) -> List[CursorVersion]:
versions = []
for line in data.strip().split('\n'):
if not line:
continue
version, build_id = line.strip().split(',')
versions.append(CursorVersion(version, build_id))
return versions
def generate_markdown(versions: List[CursorVersion]) -> str:
md = """# 🖥️ Windows
## x64
<details>
<summary style="font-size:1.2em">📦 Windows x64 安装包</summary>
| 版本 | 下载链接 |
|------|----------|
"""
# Windows x64
for version in versions:
links = version.get_download_links()
md += f"| {version.version} | [下载]({links['windows']['x64']}) |\n"
md += """
</details>
## ARM64
<details>
<summary style="font-size:1.2em">📱 Windows ARM64 安装包</summary>
| 版本 | 下载链接 |
|------|----------|
"""
# Windows ARM64
for version in versions:
links = version.get_download_links()
md += f"| {version.version} | [下载]({links['windows']['arm64']}) |\n"
md += """
</details>
# 🍎 macOS
## Universal
<details>
<summary style="font-size:1.2em">🎯 macOS Universal 安装包</summary>
| 版本 | 下载链接 |
|------|----------|
"""
# macOS Universal
for version in versions:
links = version.get_download_links()
md += f"| {version.version} | [下载]({links['mac']['universal']}) |\n"
md += """
</details>
## ARM64
<details>
<summary style="font-size:1.2em">💪 macOS ARM64 安装包</summary>
| 版本 | 下载链接 |
|------|----------|
"""
# macOS ARM64
for version in versions:
links = version.get_download_links()
md += f"| {version.version} | [下载]({links['mac']['arm64']}) |\n"
md += """
</details>
## Intel
<details>
<summary style="font-size:1.2em">💻 macOS Intel 安装包</summary>
| 版本 | 下载链接 |
|------|----------|
"""
# macOS Intel
for version in versions:
links = version.get_download_links()
md += f"| {version.version} | [下载]({links['mac']['x64']}) |\n"
md += """
</details>
# 🐧 Linux
## x64
<details>
<summary style="font-size:1.2em">🎮 Linux x64 AppImage</summary>
| 版本 | 下载链接 |
|------|----------|
"""
# Linux x64
for version in versions:
links = version.get_download_links()
md += f"| {version.version} | [下载]({links['linux']['x64']}) |\n"
md += """
</details>
<style>
details {
margin: 1em 0;
padding: 0.5em 1em;
background: #f8f9fa;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
summary {
cursor: pointer;
font-weight: bold;
margin: -0.5em -1em;
padding: 0.5em 1em;
}
summary:hover {
background: #f1f3f5;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 1em;
}
th, td {
padding: 0.5em;
text-align: left;
border-bottom: 1px solid #dee2e6;
}
tr:hover {
background: #f1f3f5;
}
a {
color: #0366d6;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>
"""
return md
def main():
# 示例数据
data = """
0.45.11,250207y6nbaw5qc
0.45.10,250205buadkzpea
0.45.9,250202tgstl42dt
0.45.8,250201b44xw1x2k
0.45.7,250130nr6eorv84
0.45.6,25013021lv9say3
0.45.5,250128loaeyulq8
0.45.4,250126vgr3vztvj
0.45.3,250124b0rcj0qql
0.45.2,250123mhituoa6o
0.45.1,2501213ljml5byg
0.45.0,250120dh9ezx9pg
0.44.11,250103fqxdt5u9z
0.44.10,250102ys80vtnud
0.44.9,2412268nc6pfzgo
0.44.8,241222ooktny8mh
0.44.7,2412219nhracv01
0.44.6,2412214pmryneua
0.44.5,241220s3ux0e1tv
0.44.4,241219117fcvexy
0.44.3,241218sybfbogmq
0.44.2,241218ntls52u8v
0.44.0,2412187f9v0nffu
0.43.6,241206z7j6me2e2
0.43.5,241127pdg4cnbu2
0.43.4,241126w13goyvrs
0.43.3,2411246yqzx1jmm
0.43.1,241124gsiwb66nc
0.42.5,24111460bf2loz1
0.42.4,2410291z3bdg1dy
0.42.3,241016kxu9umuir
0.42.2,2410127mj66lvaq
0.42.1,241011i66p9fuvm
0.42.0,241009fij7nohn5
0.41.3,240925fkhcqg263
0.41.2,240921llnho65ov
0.41.1,2409189xe3envg5
0.40.4,2409052yfcjagw2
0.40.3,240829epqamqp7h
0.40.2,240828c021k3aib
0.40.1,2408245thnycuzj
0.40.0,24082202sreugb2
0.39.6,240819ih4ta2fye
0.39.5,240814y9rhzmu7h
0.39.4,240810elmeg3seq
0.39.3,2408092hoyaxt9m
0.39.2,240808phaxh4b5r
0.39.1,240807g919tr4ly
0.39.0,240802cdixtv9a6
0.38.1,240725f0ti25os7
0.38.0,240723790oxe4a2
0.37.1,240714yrr3gmv3k
0.36.2,2407077n6pzboby
0.36.1,240706uekt2eaft
0.36.0,240703xqkjv5aqa
0.35.1,240621pc2f7rl8a
0.35.0,240608cv11mfsjl
0.34.6,240606kgzq24cfb
0.34.6,240605r495newcf
0.34.5,240602rq6xovt3a
0.34.4,2406014h0rgjghe
0.34.3,240529baisuyd2e
0.34.2,240528whh1qyo9h
0.34.1,24052838ygfselt
0.34.0,240527xus72jmkj
0.33.4,240511kb8wt1tms
0.33.3,2405103lx8342ta
0.33.2,240510dwmw395qe
0.33.1,2405039a9h2fqc9
0.33.0,240503hyjsnhazo
0.32.8,240428d499o6zja
0.32.7,240427w5guozr0l
0.32.2,240417ab4wag7sx
0.32.1,2404152czor73fk
0.32.0,240412ugli06ue0
0.31.3,240402rq154jw46
0.31.1,240402pkwfm2ps6
0.31.0,2404018j7z0xv2g
0.30.5,240327tmd2ozdc7
0.30.4,240325dezy8ziab
0.30.3,2403229gtuhto9g
0.30.2,240322gzqjm3p0d
0.30.1,2403212w1ejubt8
0.30.0,240320tpx86e7hk
0.29.1,2403027twmz0d1t
0.29.0,240301kpqvacw2h
0.28.1,240226tstim4evd
0.28.0,240224g2d7jazcq
0.27.4,240219qdbagglqz
0.27.3,240218dxhc6y8os
0.27.2,240216kkzl9nhxi
0.27.1,240215l4ooehnyl
0.27.0,240215at6ewkd59
0.26.2,240212o6r9qxtcg
0.26.1,2402107t904hing
0.26.0,240210k8is5xr6v
0.25.3,240207aacboj1k8
0.25.2,240206p3708uc9z
0.25.1,2402033t030rprh
0.25.0,240203kh86t91q8
0.24.4,240129iecm3e33w
0.24.3,2401289dx79qsc0
0.24.1,240127cad17436d
0.24.0,240126wp9irhmza
0.23.9,240124dsmraeml3
0.23.8,240123fnn1hj1fg
0.23.7,240123xsfe7ywcv
0.23.6,240121m1740elox
0.23.5,2401215utj6tx6q
0.23.4,240121f4qy6ba2y
0.23.3,2401201und3ytom
0.23.2,240120an2k2hf1i
0.23.1,240119fgzxwudn9
0.22.2,24011721vsch1l1
0.22.1,2401083eyk8kmzc
0.22.0,240107qk62kvva3
0.21.1,231230h0vi6srww
0.21.0,231229ezidnxiu3
0.20.2,231219aksf83aad
0.20.1,231218ywfaxax09
0.20.0,231216nsyfew5j1
0.19.1,2312156z2ric57n
0.19.0,231214per9qal2p
0.18.8,2312098ffjr3ign
0.18.7,23120880aolip2i
0.18.6,231207ueqazwde8
0.18.5,231206jzy2n2sbi
0.18.4,2312033zjv5fqai
0.18.3,231203k2vnkxq2m
0.18.1,23120176kaer07t
0.17.0,231127p7iyxn8rg
0.16.0,231116rek2xuq6a
0.15.5,231115a5mv63u9f
0.15.4,23111469e1i3xyi
0.15.3,231113b0yv3uqem
0.15.2,231113ah0kuf3pf
0.15.1,231111yanyyovap
0.15.0,231110mdkomczmw
0.14.1,231109xitrgihlk
0.14.0,231102m6tuamwbx
0.13.4,231029rso7pso8l
0.13.3,231025uihnjkh9v
0.13.2,231024w4iv7xlm6
0.13.1,231022f3j0ubckv
0.13.0,231022ptw6i4j42
0.12.3,231008c5ursm0oj"""
versions = parse_versions(data)
# 生成 Markdown 文件
markdown_content = generate_markdown(versions)
with open('Cursor历史.md', 'w', encoding='utf-8') as f:
f.write(markdown_content)
# 创建结果数据结构
result = {
"versions": []
}
# 处理每个版本
for version in versions:
version_info = {
"version": version.version,
"build_id": version.build_id,
"downloads": version.get_download_links()
}
result["versions"].append(version_info)
# 保存为JSON文件
with open('cursor_downloads.json', 'w', encoding='utf-8') as f:
json.dump(result, f, indent=2, ensure_ascii=False)
# 同时生成CSV格式的下载链接
with open('cursor_downloads.csv', 'w', newline='', encoding='utf-8') as f:
writer = csv.writer(f)
writer.writerow(['Version', 'Platform', 'Architecture', 'Download URL'])
for version in versions:
links = version.get_download_links()
for platform, archs in links.items():
for arch, url in archs.items():
writer.writerow([version.version, platform, arch, url])
if __name__ == "__main__":
main()

View File

@ -1,318 +0,0 @@
msgid ""
msgstr ""
"Project-Id-Version: cursor_id_modifier\n"
"POT-Creation-Date: 2025-04-25 12:00+0000\n"
"PO-Revision-Date: 2025-04-25 12:00+0000\n"
"Language-Team: None\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "Error: No translation file found for domain 'cursor_id_modifier' in {}/zh_CN/LC_MESSAGES/"
msgstr ""
msgid "========== Cursor ID modification tool log start {} =========="
msgstr ""
msgid "[INFO] {} {}"
msgstr ""
msgid "[WARN] {} {}"
msgstr ""
msgid "[ERROR] {} {}"
msgstr ""
msgid "[DEBUG] {} {}"
msgstr ""
msgid "[CMD] {} Executing command: {}"
msgstr ""
msgid "[CMD] {}:"
msgstr ""
msgid "Unable to get username"
msgstr ""
msgid "Finding Cursor installation path..."
msgstr ""
msgid "Found Cursor installation path: {}"
msgstr ""
msgid "Found Cursor via which: {}"
msgstr ""
msgid "Cursor executable not found, will try using config directory"
msgstr ""
msgid "Found Cursor via search: {}"
msgstr ""
msgid "Finding Cursor resource directory..."
msgstr ""
msgid "Found Cursor resource directory: {}"
msgstr ""
msgid "Found resource directory via binary path: {}"
msgstr ""
msgid "Cursor resource directory not found"
msgstr ""
msgid "Please run this script with sudo"
msgstr ""
msgid "Example: sudo {}"
msgstr ""
msgid "Checking Cursor processes..."
msgstr ""
msgid "Getting process details for {}:"
msgstr ""
msgid "No running Cursor processes found"
msgstr ""
msgid "Found running Cursor processes"
msgstr ""
msgid "Attempting to terminate Cursor processes..."
msgstr ""
msgid "Attempting to forcefully terminate processes..."
msgstr ""
msgid "Waiting for processes to terminate, attempt {}/{}..."
msgstr ""
msgid "Cursor processes successfully terminated"
msgstr ""
msgid "Unable to terminate Cursor processes after {} attempts"
msgstr ""
msgid "Please manually terminate the processes and try again"
msgstr ""
msgid "Configuration file does not exist, skipping backup"
msgstr ""
msgid "Configuration backed up to: {}"
msgstr ""
msgid "Backup failed"
msgstr ""
msgid "File does not exist: {}"
msgstr ""
msgid "Unable to modify file permissions: {}"
msgstr ""
msgid "Generated temporary file is empty"
msgstr ""
msgid "Unable to write to file: {}"
msgstr ""
msgid "Machine code reset options"
msgstr ""
msgid "Do you need to reset the machine code? (Usually, modifying JS files is sufficient):"
msgstr ""
msgid "Don't reset - only modify JS files"
msgstr ""
msgid "Reset - modify both config file and machine code"
msgstr ""
msgid "[INPUT_DEBUG] Machine code reset option selected: {}"
msgstr ""
msgid "You chose to reset the machine code"
msgstr ""
msgid "Found existing configuration file: {}"
msgstr ""
msgid "Setting new device and machine IDs..."
msgstr ""
msgid "New device ID: {}"
msgstr ""
msgid "New machine ID: {}"
msgstr ""
msgid "Configuration file modified successfully"
msgstr ""
msgid "Configuration file modification failed"
msgstr ""
msgid "Configuration file not found, this is normal, skipping ID modification"
msgstr ""
msgid "You chose not to reset the machine code, will only modify JS files"
msgstr ""
msgid "Configuration processing completed"
msgstr ""
msgid "Finding Cursor's JS files..."
msgstr ""
msgid "Searching for JS files in resource directory: {}"
msgstr ""
msgid "Found JS file: {}"
msgstr ""
msgid "No JS files found in resource directory, trying other directories..."
msgstr ""
msgid "Searching directory: {}"
msgstr ""
msgid "No modifiable JS files found"
msgstr ""
msgid "Found {} JS files to modify"
msgstr ""
msgid "Starting to modify Cursor's JS files..."
msgstr ""
msgid "Unable to find modifiable JS files"
msgstr ""
msgid "Processing file: {}"
msgstr ""
msgid "Unable to create backup for file: {}"
msgstr ""
msgid "Found x-cursor-checksum setting code"
msgstr ""
msgid "Successfully modified x-cursor-checksum setting code"
msgstr ""
msgid "Failed to modify x-cursor-checksum setting code"
msgstr ""
msgid "Found IOPlatformUUID keyword"
msgstr ""
msgid "Successfully injected randomUUID call into a$ function"
msgstr ""
msgid "Failed to modify a$ function"
msgstr ""
msgid "Successfully injected randomUUID call into v5 function"
msgstr ""
msgid "Failed to modify v5 function"
msgstr ""
msgid "Completed universal modification"
msgstr ""
msgid "File already contains custom injection code, skipping modification"
msgstr ""
msgid "Completed most universal injection"
msgstr ""
msgid "File has already been modified, skipping modification"
msgstr ""
msgid "Failed to modify any JS files"
msgstr ""
msgid "Successfully modified {} JS files"
msgstr ""
msgid "Disabling Cursor auto-update..."
msgstr ""
msgid "Found update configuration file: {}"
msgstr ""
msgid "Disabled update configuration file: {}"
msgstr ""
msgid "Found updater: {}"
msgstr ""
msgid "Disabled updater: {}"
msgstr ""
msgid "No update configuration files or updaters found"
msgstr ""
msgid "Successfully disabled auto-update"
msgstr ""
msgid "You selected: {}"
msgstr ""
msgid "This script only supports Linux systems"
msgstr ""
msgid "Script started..."
msgstr ""
msgid "System information: {}"
msgstr ""
msgid "Current user: {}"
msgstr ""
msgid "System version information"
msgstr ""
msgid "Cursor Linux startup tool"
msgstr ""
msgid "Important notice"
msgstr ""
msgid "This tool prioritizes modifying JS files, which is safer and more reliable"
msgstr ""
msgid "Modifying Cursor JS files..."
msgstr ""
msgid "JS files modified successfully!"
msgstr ""
msgid "JS file modification failed, but configuration file modification may have succeeded"
msgstr ""
msgid "If Cursor still indicates the device is disabled after restarting, please rerun this script"
msgstr ""
msgid "Please restart Cursor to apply the new configuration"
msgstr ""
msgid "Follow the WeChat public account [Pancake AI] to discuss more Cursor tips and AI knowledge (script is free, join the group via the public account for more tips and experts)"
msgstr ""
msgid "Script execution completed"
msgstr ""
msgid "========== Cursor ID modification tool log end {} =========="
msgstr ""
msgid "Detailed log saved to: {}"
msgstr ""
msgid "If you encounter issues, please provide this log file to the developer for troubleshooting"
msgstr ""

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +0,0 @@
#!/bin/bash
REPO_DIR="$PWD"
LOCALES_DIR="$REPO_DIR/locales"
msginit -i cursor_id_modifier.pot -o $LOCALES_DIR/en_US/LC_MESSAGES/cursor_id_modifier.po -l en_US
for lang in en_US zh_CN; do
cd $LOCALES_DIR/$lang/LC_MESSAGES
msgfmt -o cursor_id_modifier.mo cursor_id_modifier.po
done

View File

@ -56,9 +56,9 @@ trap {
# Detect system architecture
function Get-SystemArch {
if ([Environment]::Is64BitOperatingSystem) {
return "x86_64"
return "x64"
} else {
return "i386"
return "x86"
}
}
@ -98,15 +98,15 @@ function Install-CursorModifier {
# Get latest release
try {
$latestRelease = Invoke-RestMethod -Uri "https://api.github.com/repos/yuaotian/go-cursor-help/releases/latest"
$latestRelease = Invoke-RestMethod -Uri "https://api.github.com/repos/dacrab/go-cursor-help/releases/latest"
Write-Host "Found latest release: $($latestRelease.tag_name)" -ForegroundColor Cyan
# Look for Windows binary with our architecture
$version = $latestRelease.tag_name.TrimStart('v')
Write-Host "Version: $version" -ForegroundColor Cyan
$possibleNames = @(
"cursor-id-modifier_${version}_windows_x86_64.exe",
"cursor-id-modifier_${version}_windows_$($arch).exe"
"cursor-id-modifier_windows_$($arch).exe",
"cursor-id-modifier_windows_$($arch).exe",
"cursor-id-modifier_Windows_$($arch).exe",
"cursor-id-modifier_Windows_$($arch).exe"
)
$asset = $null

View File

@ -33,18 +33,21 @@ detect_system() {
case "$(uname -m)" in
x86_64)
arch="x86_64"
arch="x64"
[ "$os" = "darwin" ] && suffix="_intel"
;;
aarch64|arm64)
arch="arm64"
[ "$os" = "darwin" ] && suffix="_apple_silicon"
;;
i386|i686)
arch="i386"
arch="x86"
[ "$os" = "darwin" ] && { echo -e "${RED}32-bit not supported on macOS${NC}"; exit 1; }
;;
*) echo -e "${RED}Unsupported architecture${NC}"; exit 1;;
esac
echo "$os $arch"
echo "$os $arch $suffix"
}
# Download with progress
@ -84,22 +87,17 @@ main() {
# Get latest release info
echo -e "${BLUE}Fetching latest release information...${NC}"
LATEST_URL="https://api.github.com/repos/yuaotian/go-cursor-help/releases/latest"
# Get latest version and remove 'v' prefix
VERSION=$(curl -s "$LATEST_URL" | grep "tag_name" | cut -d'"' -f4 | sed 's/^v//')
LATEST_URL="https://api.github.com/repos/dacrab/go-cursor-help/releases/latest"
# Construct binary name
BINARY_NAME="cursor-id-modifier_${VERSION}_${OS}_${ARCH}"
BINARY_NAME="cursor-id-modifier_${OS}_${ARCH}${SUFFIX}"
echo -e "${BLUE}Looking for asset: $BINARY_NAME${NC}"
# Get download URL directly
DOWNLOAD_URL=$(curl -s "$LATEST_URL" | grep -o "\"browser_download_url\": \"[^\"]*${BINARY_NAME}[^\"]*\"" | cut -d'"' -f4)
DOWNLOAD_URL=$(curl -s "$LATEST_URL" | tr -d '\n' | grep -o "\"browser_download_url\": \"[^\"]*${BINARY_NAME}[^\"]*\"" | cut -d'"' -f4)
if [ -z "$DOWNLOAD_URL" ]; then
echo -e "${RED}Error: Could not find appropriate binary for $OS $ARCH${NC}"
echo -e "${YELLOW}Available assets:${NC}"
curl -s "$LATEST_URL" | grep "browser_download_url" | cut -d'"' -f4
exit 1
fi

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,688 +0,0 @@
#!/bin/bash
# ========================================
# Cursor macOS 机器码修改脚本 (重构精简版)
# ========================================
#
# 🎯 重构目标:
# - 简化脚本复杂度从3158行压缩到约900行
# - 自动化权限修复解决EACCES权限错误
# - 减少用户交互步骤,提升执行效率
# - 保持所有原有功能完整性
#
# 🚀 执行流程说明:
# 1. 环境检测和权限预修复
# 2. 用户选择执行模式(仅修改 vs 完整重置)
# 3. 自动执行所有必要步骤
# 4. 智能设备识别绕过MAC地址或JS内核修改
# 5. 自动权限修复和验证
#
# ========================================
set -e
# ==================== 核心配置 ====================
LOG_FILE="/tmp/cursor_reset_$(date +%Y%m%d_%H%M%S).log"
CURSOR_APP_PATH="/Applications/Cursor.app"
STORAGE_FILE="$HOME/Library/Application Support/Cursor/User/globalStorage/storage.json"
BACKUP_DIR="$HOME/Library/Application Support/Cursor/User/globalStorage/backups"
# 颜色定义
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
# ==================== 统一工具函数 ====================
# 初始化日志
init_log() {
echo "========== Cursor重构脚本执行日志 $(date) ==========" > "$LOG_FILE"
chmod 644 "$LOG_FILE"
}
# 精简日志函数
log() {
local level="$1"
local msg="$2"
local color=""
case "$level" in
"INFO") color="$GREEN" ;;
"WARN") color="$YELLOW" ;;
"ERROR") color="$RED" ;;
*) color="$BLUE" ;;
esac
echo -e "${color}[$level]${NC} $msg"
echo "[$level] $(date '+%H:%M:%S') $msg" >> "$LOG_FILE"
}
# 统一权限管理器 - 解决所有权限问题
fix_permissions() {
log "INFO" "🔧 执行统一权限修复..."
local cursor_support="$HOME/Library/Application Support/Cursor"
local cursor_home="$HOME/.cursor"
# 创建必要目录结构
local dirs=(
"$cursor_support"
"$cursor_support/User"
"$cursor_support/User/globalStorage"
"$cursor_support/logs"
"$cursor_support/CachedData"
"$cursor_home"
"$cursor_home/extensions"
)
for dir in "${dirs[@]}"; do
mkdir -p "$dir" 2>/dev/null || true
done
# 执行核心权限修复命令
if sudo chown -R "$(whoami)" "$cursor_support" 2>/dev/null && \
sudo chown -R "$(whoami)" "$cursor_home" 2>/dev/null && \
chmod -R u+w "$cursor_support" 2>/dev/null && \
chmod -R u+w "$cursor_home/extensions" 2>/dev/null; then
log "INFO" "✅ 权限修复成功"
return 0
else
log "ERROR" "❌ 权限修复失败"
return 1
fi
}
# 环境检测器
detect_environment() {
log "INFO" "🔍 检测系统环境..."
# 检测macOS版本和硬件
MACOS_VERSION=$(sw_vers -productVersion)
HARDWARE_TYPE=$(uname -m)
if [[ "$HARDWARE_TYPE" == "arm64" ]]; then
HARDWARE_TYPE="Apple Silicon"
else
HARDWARE_TYPE="Intel"
fi
# 检测兼容性
local macos_major=$(echo "$MACOS_VERSION" | cut -d. -f1)
if [[ $macos_major -ge 14 ]] || [[ "$HARDWARE_TYPE" == "Apple Silicon" ]]; then
MAC_COMPATIBLE=false
log "WARN" "⚠️ 检测到MAC地址修改受限环境: macOS $MACOS_VERSION ($HARDWARE_TYPE)"
else
MAC_COMPATIBLE=true
log "INFO" "✅ 环境兼容性检查通过"
fi
# 检查Python3
if ! command -v python3 >/dev/null 2>&1; then
log "ERROR" "❌ 未找到Python3请安装: brew install python3"
return 1
fi
# 检查Cursor应用
if [ ! -d "$CURSOR_APP_PATH" ]; then
log "ERROR" "❌ 未找到Cursor应用: $CURSOR_APP_PATH"
return 1
fi
log "INFO" "✅ 环境检测完成: macOS $MACOS_VERSION ($HARDWARE_TYPE)"
return 0
}
# 进程管理器
manage_cursor_process() {
local action="$1" # kill 或 start
case "$action" in
"kill")
log "INFO" "🔄 关闭Cursor进程..."
pkill -f "Cursor" 2>/dev/null || true
sleep 2
# 验证是否关闭
if pgrep -f "Cursor" >/dev/null; then
pkill -9 -f "Cursor" 2>/dev/null || true
sleep 2
fi
log "INFO" "✅ Cursor进程已关闭"
;;
"start")
log "INFO" "🚀 启动Cursor..."
"$CURSOR_APP_PATH/Contents/MacOS/Cursor" > /dev/null 2>&1 &
sleep 15
log "INFO" "✅ Cursor已启动"
;;
esac
}
# 错误处理器
handle_error() {
local error_msg="$1"
local recovery_action="$2"
log "ERROR" "❌ 错误: $error_msg"
if [ -n "$recovery_action" ]; then
log "INFO" "🔄 尝试恢复: $recovery_action"
eval "$recovery_action"
fi
log "INFO" "💡 如需帮助,请查看日志: $LOG_FILE"
}
# ==================== 功能模块 ====================
# 机器码修改器
modify_machine_code() {
log "INFO" "🛠️ 开始修改机器码配置..."
# 检查配置文件
if [ ! -f "$STORAGE_FILE" ]; then
log "ERROR" "❌ 配置文件不存在请先启动Cursor生成配置"
return 1
fi
# 创建备份
mkdir -p "$BACKUP_DIR"
local backup_file="$BACKUP_DIR/storage.json.backup_$(date +%Y%m%d_%H%M%S)"
cp "$STORAGE_FILE" "$backup_file" || {
log "ERROR" "❌ 备份失败"
return 1
}
# 生成新ID
local machine_id="auth0|user_$(openssl rand -hex 16)"
local mac_machine_id=$(uuidgen | tr '[:upper:]' '[:lower:]')
local device_id=$(uuidgen | tr '[:upper:]' '[:lower:]')
local sqm_id="{$(uuidgen | tr '[:lower:]' '[:upper:]')}"
# 修改配置文件
local python_result=$(python3 -c "
import json
import sys
try:
with open('$STORAGE_FILE', 'r', encoding='utf-8') as f:
config = json.load(f)
config['telemetry.machineId'] = '$machine_id'
config['telemetry.macMachineId'] = '$mac_machine_id'
config['telemetry.devDeviceId'] = '$device_id'
config['telemetry.sqmId'] = '$sqm_id'
with open('$STORAGE_FILE', 'w', encoding='utf-8') as f:
json.dump(config, f, indent=2, ensure_ascii=False)
print('SUCCESS')
except Exception as e:
print(f'ERROR: {e}')
sys.exit(1)
" 2>&1)
if echo "$python_result" | grep -q "SUCCESS"; then
# 设置只读保护
chmod 444 "$STORAGE_FILE" 2>/dev/null || true
log "INFO" "✅ 机器码修改成功"
log "INFO" "💾 备份保存至: $(basename "$backup_file")"
return 0
else
log "ERROR" "❌ 机器码修改失败: $python_result"
cp "$backup_file" "$STORAGE_FILE" 2>/dev/null || true
return 1
fi
}
# 智能设备绕过器 - 根据环境自动选择最佳方案
bypass_device_detection() {
log "INFO" "🔧 开始智能设备识别绕过..."
# 根据环境兼容性选择方案
if [ "$MAC_COMPATIBLE" = false ]; then
log "INFO" "💡 检测到MAC地址修改受限使用JS内核修改方案"
return modify_js_kernel
else
log "INFO" "💡 尝试MAC地址修改方案"
if modify_mac_address; then
return 0
else
log "WARN" "⚠️ MAC地址修改失败切换到JS内核修改"
return modify_js_kernel
fi
fi
}
# MAC地址修改器简化版
modify_mac_address() {
log "INFO" "🌐 开始MAC地址修改..."
# 获取活动网络接口
local interfaces=()
while IFS= read -r line; do
if [[ $line == "Hardware Port: Wi-Fi" || $line == "Hardware Port: Ethernet" ]]; then
read -r dev_line
local device=$(echo "$dev_line" | awk '{print $2}')
if [ -n "$device" ] && ifconfig "$device" 2>/dev/null | grep -q "status: active"; then
interfaces+=("$device")
fi
fi
done < <(networksetup -listallhardwareports)
if [ ${#interfaces[@]} -eq 0 ]; then
log "WARN" "⚠️ 未找到活动网络接口"
return 1
fi
local success_count=0
for interface in "${interfaces[@]}"; do
log "INFO" "🔧 处理接口: $interface"
# 生成新MAC地址
local new_mac=$(printf '%02x:%02x:%02x:%02x:%02x:%02x' \
$(( (RANDOM & 0xFC) | 0x02 )) $((RANDOM%256)) $((RANDOM%256)) \
$((RANDOM%256)) $((RANDOM%256)) $((RANDOM%256)))
# 尝试修改MAC地址
if sudo ifconfig "$interface" down 2>/dev/null && \
sleep 2 && \
sudo ifconfig "$interface" ether "$new_mac" 2>/dev/null && \
sudo ifconfig "$interface" up 2>/dev/null; then
log "INFO" "✅ 接口 $interface MAC地址修改成功: $new_mac"
((success_count++))
else
log "WARN" "⚠️ 接口 $interface MAC地址修改失败"
fi
sleep 2
done
if [ $success_count -gt 0 ]; then
log "INFO" "✅ MAC地址修改完成 ($success_count/${#interfaces[@]} 成功)"
return 0
else
return 1
fi
}
# JS内核修改器简化版
modify_js_kernel() {
log "INFO" "🔧 开始JS内核修改..."
# 关闭Cursor
manage_cursor_process "kill"
# 目标JS文件
local js_files=(
"$CURSOR_APP_PATH/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js"
"$CURSOR_APP_PATH/Contents/Resources/app/out/main.js"
)
# 检查是否需要修改
local need_modify=false
for file in "${js_files[@]}"; do
if [ -f "$file" ] && ! grep -q "return crypto.randomUUID()" "$file" 2>/dev/null; then
need_modify=true
break
fi
done
if [ "$need_modify" = false ]; then
log "INFO" "✅ JS文件已修改跳过"
return 0
fi
# 创建备份
local backup_app="/tmp/Cursor.app.backup_$(date +%Y%m%d_%H%M%S)"
cp -R "$CURSOR_APP_PATH" "$backup_app" || {
log "ERROR" "❌ 创建备份失败"
return 1
fi
# 生成设备ID
local new_uuid=$(uuidgen | tr '[:upper:]' '[:lower:]')
local machine_id="auth0|user_$(openssl rand -hex 16)"
# 修改JS文件
local modified_count=0
for file in "${js_files[@]}"; do
if [ ! -f "$file" ]; then
continue
fi
log "INFO" "📝 处理文件: $(basename "$file")"
# 创建注入代码
local inject_code="
// Cursor设备标识符劫持 - $(date +%Y%m%d%H%M%S)
import crypto from 'crypto';
const originalRandomUUID = crypto.randomUUID;
crypto.randomUUID = function() { return '$new_uuid'; };
globalThis.getMachineId = function() { return '$machine_id'; };
console.log('Cursor设备标识符已劫持');
"
# 注入代码
echo "$inject_code" > "${file}.new"
cat "$file" >> "${file}.new"
mv "${file}.new" "$file"
((modified_count++))
log "INFO" "✅ 文件修改成功: $(basename "$file")"
done
if [ $modified_count -gt 0 ]; then
# 重新签名
if codesign --sign - --force --deep "$CURSOR_APP_PATH" 2>/dev/null; then
log "INFO" "✅ JS内核修改完成 ($modified_count 个文件)"
return 0
else
log "WARN" "⚠️ 签名失败,但修改已完成"
return 0
fi
else
log "ERROR" "❌ 未修改任何文件"
return 1
fi
}
# 环境重置器
reset_environment() {
log "INFO" "🗑️ 开始环境重置..."
# 关闭Cursor
manage_cursor_process "kill"
# 删除目标文件夹
local folders=(
"$HOME/Library/Application Support/Cursor"
"$HOME/.cursor"
)
local deleted_count=0
for folder in "${folders[@]}"; do
if [ -d "$folder" ]; then
if rm -rf "$folder"; then
log "INFO" "✅ 已删除: $folder"
((deleted_count++))
else
log "ERROR" "❌ 删除失败: $folder"
fi
fi
done
# 修复权限
fix_permissions
log "INFO" "✅ 环境重置完成 (删除 $deleted_count 个文件夹)"
return 0
}
# 禁用自动更新
disable_auto_update() {
log "INFO" "🚫 禁用自动更新..."
local app_update_yml="$CURSOR_APP_PATH/Contents/Resources/app-update.yml"
local updater_path="$HOME/Library/Application Support/Caches/cursor-updater"
# 禁用app-update.yml
if [ -f "$app_update_yml" ]; then
sudo cp "$app_update_yml" "${app_update_yml}.bak" 2>/dev/null || true
sudo bash -c "echo '' > \"$app_update_yml\"" 2>/dev/null || true
sudo chmod 444 "$app_update_yml" 2>/dev/null || true
fi
# 禁用cursor-updater
sudo rm -rf "$updater_path" 2>/dev/null || true
sudo touch "$updater_path" 2>/dev/null || true
sudo chmod 444 "$updater_path" 2>/dev/null || true
log "INFO" "✅ 自动更新已禁用"
}
# 修复应用签名问题
fix_app_signature() {
log "INFO" "🔧 修复应用签名..."
# 移除隔离属性
sudo find "$CURSOR_APP_PATH" -print0 2>/dev/null | \
xargs -0 sudo xattr -d com.apple.quarantine 2>/dev/null || true
# 重新签名
sudo codesign --force --deep --sign - "$CURSOR_APP_PATH" 2>/dev/null || true
log "INFO" "✅ 应用签名修复完成"
}
# ==================== 主执行流程 ====================
# 快速模式 - 仅修改机器码
quick_mode() {
log "INFO" "🚀 执行快速模式(仅修改机器码)..."
# 检查环境
if ! detect_environment; then
handle_error "环境检测失败" "exit 1"
return 1
fi
# 预修复权限
fix_permissions
# 修改机器码
if ! modify_machine_code; then
handle_error "机器码修改失败" "exit 1"
return 1
fi
# 设备绕过
bypass_device_detection || log "WARN" "⚠️ 设备绕过失败,但机器码修改已完成"
# 禁用更新
disable_auto_update
# 修复签名
fix_app_signature
# 最终权限修复
fix_permissions
log "INFO" "🎉 快速模式执行完成!"
return 0
}
# 完整模式 - 重置环境+修改机器码
full_mode() {
log "INFO" "🚀 执行完整模式(重置环境+修改机器码)..."
# 检查环境
if ! detect_environment; then
handle_error "环境检测失败" "exit 1"
return 1
fi
# 环境重置
if ! reset_environment; then
handle_error "环境重置失败" "exit 1"
return 1
fi
# 启动Cursor生成配置
manage_cursor_process "start"
# 等待配置文件生成
local config_wait=0
while [ ! -f "$STORAGE_FILE" ] && [ $config_wait -lt 30 ]; do
sleep 2
((config_wait += 2))
log "INFO" "⏳ 等待配置文件生成... ($config_wait/30秒)"
done
# 关闭Cursor
manage_cursor_process "kill"
# 修改机器码
if ! modify_machine_code; then
handle_error "机器码修改失败" "exit 1"
return 1
fi
# 设备绕过
bypass_device_detection || log "WARN" "⚠️ 设备绕过失败,但机器码修改已完成"
# 禁用更新
disable_auto_update
# 修复签名
fix_app_signature
# 最终权限修复
fix_permissions
log "INFO" "🎉 完整模式执行完成!"
return 0
}
# ==================== 用户界面 ====================
# 显示Logo和信息
show_header() {
clear
echo -e "
██████╗██╗ ██╗██████╗ ███████╗ ██████╗ ██████╗
██╔════╝██║ ██║██╔══██╗██╔════╝██╔═══██╗██╔══██╗
██║ ██║ ██║██████╔╝███████╗██║ ██║██████╔╝
██║ ██║ ██║██╔══██╗╚════██║██║ ██║██╔══██╗
╚██████╗╚██████╔╝██║ ██║███████║╚██████╔╝██║ ██║
╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝
"
echo -e "${BLUE}================================${NC}"
echo -e "${GREEN}🚀 Cursor 机器码修改工具 (重构版) ${NC}"
echo -e "${YELLOW}📱 关注公众号【煎饼果子卷AI】 ${NC}"
echo -e "${BLUE}================================${NC}"
echo
echo -e "${YELLOW}💡 [免费工具]${NC} 如果对您有帮助,请关注公众号支持开发者"
echo
}
# 用户选择菜单
user_menu() {
echo -e "${GREEN}🎯 [选择模式]${NC} 请选择执行模式:"
echo
echo -e "${BLUE} 1⃣ 快速模式 - 仅修改机器码${NC}"
echo -e "${YELLOW} • 保留现有配置和数据${NC}"
echo -e "${YELLOW} • 执行时间约30秒${NC}"
echo -e "${YELLOW} • 自动权限修复${NC}"
echo
echo -e "${BLUE} 2⃣ 完整模式 - 重置环境+修改机器码${NC}"
echo -e "${RED} • 删除所有Cursor配置请备份${NC}"
echo -e "${YELLOW} • 执行时间约90秒${NC}"
echo -e "${YELLOW} • 彻底重置试用状态${NC}"
echo
while true; do
read -p "请输入选择 (1 或 2): " choice
case "$choice" in
1)
log "INFO" "✅ 用户选择:快速模式"
return 1
;;
2)
echo -e "${RED}⚠️ [警告]${NC} 完整模式将删除所有Cursor配置"
read -p "确认执行?(输入 yes 确认): " confirm
if [ "$confirm" = "yes" ]; then
log "INFO" "✅ 用户选择:完整模式"
return 2
else
echo -e "${YELLOW}👋 [取消]${NC} 请重新选择"
continue
fi
;;
*)
echo -e "${RED}❌ [错误]${NC} 无效选择,请输入 1 或 2"
;;
esac
done
}
# 显示完成信息
show_completion() {
echo
echo -e "${GREEN}================================${NC}"
echo -e "${BLUE} 🎯 执行完成总结 ${NC}"
echo -e "${GREEN}================================${NC}"
echo -e "${GREEN}✅ 机器码配置: 已修改${NC}"
echo -e "${GREEN}✅ 设备识别绕过: 已完成${NC}"
echo -e "${GREEN}✅ 自动更新: 已禁用${NC}"
echo -e "${GREEN}✅ 权限修复: 已完成${NC}"
echo -e "${GREEN}✅ 应用签名: 已修复${NC}"
echo -e "${GREEN}================================${NC}"
echo
echo -e "${YELLOW}📱 关注公众号【煎饼果子卷AI】获取更多Cursor技巧${NC}"
echo
echo -e "${BLUE}🚀 [下一步]${NC} 现在可以启动Cursor使用了"
echo -e "${BLUE}📄 [日志]${NC} 详细日志保存在: $LOG_FILE"
echo
}
# ==================== 主函数 ====================
main() {
# 检查权限
if [ "$EUID" -ne 0 ]; then
echo -e "${RED}❌ [错误]${NC} 请使用 sudo 运行此脚本"
echo "示例: sudo $0"
exit 1
fi
# 检查macOS
if [[ $(uname) != "Darwin" ]]; then
echo -e "${RED}❌ [错误]${NC} 本脚本仅支持 macOS 系统"
exit 1
fi
# 初始化
init_log
log "INFO" "🚀 Cursor重构脚本启动..."
# 预修复权限
fix_permissions
# 显示界面
show_header
# 用户选择
user_menu
local mode=$?
echo
log "INFO" "🚀 开始执行,请稍候..."
echo
# 执行对应模式
case $mode in
1)
if quick_mode; then
show_completion
exit 0
else
log "ERROR" "❌ 快速模式执行失败"
exit 1
fi
;;
2)
if full_mode; then
show_completion
exit 0
else
log "ERROR" "❌ 完整模式执行失败"
exit 1
fi
;;
esac
}
# 执行主函数
main "$@"

File diff suppressed because it is too large Load Diff

View File

@ -1,607 +0,0 @@
# 设置输出编码为 UTF-8
$OutputEncoding = [System.Text.Encoding]::UTF8
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
# 颜色定义
$RED = "`e[31m"
$GREEN = "`e[32m"
$YELLOW = "`e[33m"
$BLUE = "`e[34m"
$NC = "`e[0m"
# 配置文件路径
$STORAGE_FILE = "$env:APPDATA\Cursor\User\globalStorage\storage.json"
$BACKUP_DIR = "$env:APPDATA\Cursor\User\globalStorage\backups"
# 新增 Cursor 初始化函数
function Cursor-初始化 {
Write-Host "$GREEN[信息]$NC 正在执行 Cursor 初始化清理..."
$BASE_PATH = "$env:APPDATA\Cursor\User"
$filesToDelete = @(
(Join-Path -Path $BASE_PATH -ChildPath "globalStorage\\state.vscdb"),
(Join-Path -Path $BASE_PATH -ChildPath "globalStorage\\state.vscdb.backup")
)
$folderToCleanContents = Join-Path -Path $BASE_PATH -ChildPath "History"
$folderToDeleteCompletely = Join-Path -Path $BASE_PATH -ChildPath "workspaceStorage"
Write-Host "$BLUE[调试]$NC 基础路径: $BASE_PATH"
# 删除指定文件
foreach ($file in $filesToDelete) {
Write-Host "$BLUE[调试]$NC 检查文件: $file"
if (Test-Path $file) {
try {
Remove-Item -Path $file -Force -ErrorAction Stop
Write-Host "$GREEN[成功]$NC 已删除文件: $file"
}
catch {
Write-Host "$RED[错误]$NC 删除文件 $file 失败: $($_.Exception.Message)"
}
} else {
Write-Host "$YELLOW[警告]$NC 文件不存在,跳过删除: $file"
}
}
# 清空指定文件夹内容
Write-Host "$BLUE[调试]$NC 检查待清空文件夹: $folderToCleanContents"
if (Test-Path $folderToCleanContents) {
try {
# 获取子项进行删除,以避免删除 History 文件夹本身
Get-ChildItem -Path $folderToCleanContents -Recurse | Remove-Item -Recurse -Force -ErrorAction Stop
Write-Host "$GREEN[成功]$NC 已清空文件夹内容: $folderToCleanContents"
}
catch {
Write-Host "$RED[错误]$NC 清空文件夹 $folderToCleanContents 内容失败: $($_.Exception.Message)"
}
} else {
Write-Host "$YELLOW[警告]$NC 文件夹不存在,跳过清空: $folderToCleanContents"
}
# 删除指定文件夹及其内容
Write-Host "$BLUE[调试]$NC 检查待删除文件夹: $folderToDeleteCompletely"
if (Test-Path $folderToDeleteCompletely) {
try {
Remove-Item -Path $folderToDeleteCompletely -Recurse -Force -ErrorAction Stop
Write-Host "$GREEN[成功]$NC 已删除文件夹: $folderToDeleteCompletely"
}
catch {
Write-Host "$RED[错误]$NC 删除文件夹 $folderToDeleteCompletely 失败: $($_.Exception.Message)"
}
} else {
Write-Host "$YELLOW[警告]$NC 文件夹不存在,跳过删除: $folderToDeleteCompletely"
}
Write-Host "$GREEN[信息]$NC Cursor 初始化清理完成。"
Write-Host "" # 添加空行以改善输出格式
}
# 检查管理员权限
function Test-Administrator {
$user = [Security.Principal.WindowsIdentity]::GetCurrent()
$principal = New-Object Security.Principal.WindowsPrincipal($user)
return $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
}
if (-not (Test-Administrator)) {
Write-Host "$RED[错误]$NC 请以管理员身份运行此脚本"
Write-Host "请右键点击脚本,选择'以管理员身份运行'"
Read-Host "按回车键退出"
exit 1
}
# 显示 Logo
Clear-Host
Write-Host @"
"@
Write-Host "$BLUE================================$NC"
Write-Host "$GREEN Cursor 设备ID 修改工具 $NC"
Write-Host "$YELLOW 关注公众号【煎饼果子卷AI】 $NC"
Write-Host "$YELLOW 一起交流更多Cursor技巧和AI知识(脚本免费、关注公众号加群有更多技巧和大佬) $NC"
Write-Host "$YELLOW [重要提示] 本工具免费如果对您有帮助请关注公众号【煎饼果子卷AI】 $NC"
Write-Host ""
Write-Host "$YELLOW [小小广告] 出售CursorPro教育号一年质保三个月有需要找我(86)WeChatJavaRookie666 $NC"
Write-Host "$BLUE================================$NC"
# 获取并显示 Cursor 版本
function Get-CursorVersion {
try {
# 主要检测路径
$packagePath = "$env:LOCALAPPDATA\\Programs\\cursor\\resources\\app\\package.json"
if (Test-Path $packagePath) {
$packageJson = Get-Content $packagePath -Raw | ConvertFrom-Json
if ($packageJson.version) {
Write-Host "$GREEN[信息]$NC 当前安装的 Cursor 版本: v$($packageJson.version)"
return $packageJson.version
}
}
# 备用路径检测
$altPath = "$env:LOCALAPPDATA\\cursor\\resources\\app\\package.json"
if (Test-Path $altPath) {
$packageJson = Get-Content $altPath -Raw | ConvertFrom-Json
if ($packageJson.version) {
Write-Host "$GREEN[信息]$NC 当前安装的 Cursor 版本: v$($packageJson.version)"
return $packageJson.version
}
}
Write-Host "$YELLOW[警告]$NC 无法检测到 Cursor 版本"
Write-Host "$YELLOW[提示]$NC 请确保 Cursor 已正确安装"
return $null
}
catch {
Write-Host "$RED[错误]$NC 获取 Cursor 版本失败: $_"
return $null
}
}
# 获取并显示版本信息
$cursorVersion = Get-CursorVersion
Write-Host ""
Write-Host "$YELLOW[重要提示]$NC 最新的 1.0.x (以支持)"
Write-Host ""
# 检查并关闭 Cursor 进程
Write-Host "$GREEN[信息]$NC 检查 Cursor 进程..."
function Get-ProcessDetails {
param($processName)
Write-Host "$BLUE[调试]$NC 正在获取 $processName 进程详细信息:"
Get-WmiObject Win32_Process -Filter "name='$processName'" |
Select-Object ProcessId, ExecutablePath, CommandLine |
Format-List
}
# 定义最大重试次数和等待时间
$MAX_RETRIES = 5
$WAIT_TIME = 1
# 处理进程关闭
function Close-CursorProcess {
param($processName)
$process = Get-Process -Name $processName -ErrorAction SilentlyContinue
if ($process) {
Write-Host "$YELLOW[警告]$NC 发现 $processName 正在运行"
Get-ProcessDetails $processName
Write-Host "$YELLOW[警告]$NC 尝试关闭 $processName..."
Stop-Process -Name $processName -Force
$retryCount = 0
while ($retryCount -lt $MAX_RETRIES) {
$process = Get-Process -Name $processName -ErrorAction SilentlyContinue
if (-not $process) { break }
$retryCount++
if ($retryCount -ge $MAX_RETRIES) {
Write-Host "$RED[错误]$NC$MAX_RETRIES 次尝试后仍无法关闭 $processName"
Get-ProcessDetails $processName
Write-Host "$RED[错误]$NC 请手动关闭进程后重试"
Read-Host "按回车键退出"
exit 1
}
Write-Host "$YELLOW[警告]$NC 等待进程关闭,尝试 $retryCount/$MAX_RETRIES..."
Start-Sleep -Seconds $WAIT_TIME
}
Write-Host "$GREEN[信息]$NC $processName 已成功关闭"
}
}
# 关闭所有 Cursor 进程
Close-CursorProcess "Cursor"
Close-CursorProcess "cursor"
# 执行 Cursor 初始化清理
# Cursor-初始化
# 创建备份目录
if (-not (Test-Path $BACKUP_DIR)) {
New-Item -ItemType Directory -Path $BACKUP_DIR | Out-Null
}
# 备份现有配置
if (Test-Path $STORAGE_FILE) {
Write-Host "$GREEN[信息]$NC 正在备份配置文件..."
$backupName = "storage.json.backup_$(Get-Date -Format 'yyyyMMdd_HHmmss')"
Copy-Item $STORAGE_FILE "$BACKUP_DIR\$backupName"
}
# 生成新的 ID
Write-Host "$GREEN[信息]$NC 正在生成新的 ID..."
# 在颜色定义后添加此函数
function Get-RandomHex {
param (
[int]$length
)
$bytes = New-Object byte[] ($length)
$rng = [System.Security.Cryptography.RNGCryptoServiceProvider]::new()
$rng.GetBytes($bytes)
$hexString = [System.BitConverter]::ToString($bytes) -replace '-',''
$rng.Dispose()
return $hexString
}
# 改进 ID 生成函数
function New-StandardMachineId {
$template = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
$result = $template -replace '[xy]', {
param($match)
$r = [Random]::new().Next(16)
$v = if ($match.Value -eq "x") { $r } else { ($r -band 0x3) -bor 0x8 }
return $v.ToString("x")
}
return $result
}
# 在生成 ID 时使用新函数
$MAC_MACHINE_ID = New-StandardMachineId
$UUID = [System.Guid]::NewGuid().ToString()
# 将 auth0|user_ 转换为字节数组的十六进制
$prefixBytes = [System.Text.Encoding]::UTF8.GetBytes("auth0|user_")
$prefixHex = -join ($prefixBytes | ForEach-Object { '{0:x2}' -f $_ })
# 生成32字节(64个十六进制字符)的随机数作为 machineId 的随机部分
$randomPart = Get-RandomHex -length 32
$MACHINE_ID = "$prefixHex$randomPart"
$SQM_ID = "{$([System.Guid]::NewGuid().ToString().ToUpper())}"
# 在Update-MachineGuid函数前添加权限检查
if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
Write-Host "$RED[错误]$NC 请使用管理员权限运行此脚本"
Start-Process powershell "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
exit
}
function Update-MachineGuid {
try {
# 检查注册表路径是否存在,不存在则创建
$registryPath = "HKLM:\SOFTWARE\Microsoft\Cryptography"
if (-not (Test-Path $registryPath)) {
Write-Host "$YELLOW[警告]$NC 注册表路径不存在: $registryPath,正在创建..."
New-Item -Path $registryPath -Force | Out-Null
Write-Host "$GREEN[信息]$NC 注册表路径创建成功"
}
# 获取当前的 MachineGuid如果不存在则使用空字符串作为默认值
$originalGuid = ""
try {
$currentGuid = Get-ItemProperty -Path $registryPath -Name MachineGuid -ErrorAction SilentlyContinue
if ($currentGuid) {
$originalGuid = $currentGuid.MachineGuid
Write-Host "$GREEN[信息]$NC 当前注册表值:"
Write-Host "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography"
Write-Host " MachineGuid REG_SZ $originalGuid"
} else {
Write-Host "$YELLOW[警告]$NC MachineGuid 值不存在,将创建新值"
}
} catch {
Write-Host "$YELLOW[警告]$NC 获取 MachineGuid 失败: $($_.Exception.Message)"
}
# 创建备份目录(如果不存在)
if (-not (Test-Path $BACKUP_DIR)) {
New-Item -ItemType Directory -Path $BACKUP_DIR -Force | Out-Null
}
# 创建备份文件(仅当原始值存在时)
if ($originalGuid) {
$backupFile = "$BACKUP_DIR\MachineGuid_$(Get-Date -Format 'yyyyMMdd_HHmmss').reg"
$backupResult = Start-Process "reg.exe" -ArgumentList "export", "`"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography`"", "`"$backupFile`"" -NoNewWindow -Wait -PassThru
if ($backupResult.ExitCode -eq 0) {
Write-Host "$GREEN[信息]$NC 注册表项已备份到:$backupFile"
} else {
Write-Host "$YELLOW[警告]$NC 备份创建失败,继续执行..."
}
}
# 生成新GUID
$newGuid = [System.Guid]::NewGuid().ToString()
# 更新或创建注册表值
Set-ItemProperty -Path $registryPath -Name MachineGuid -Value $newGuid -Force -ErrorAction Stop
# 验证更新
$verifyGuid = (Get-ItemProperty -Path $registryPath -Name MachineGuid -ErrorAction Stop).MachineGuid
if ($verifyGuid -ne $newGuid) {
throw "注册表验证失败:更新后的值 ($verifyGuid) 与预期值 ($newGuid) 不匹配"
}
Write-Host "$GREEN[信息]$NC 注册表更新成功:"
Write-Host "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography"
Write-Host " MachineGuid REG_SZ $newGuid"
return $true
}
catch {
Write-Host "$RED[错误]$NC 注册表操作失败:$($_.Exception.Message)"
# 尝试恢复备份(如果存在)
if (($backupFile -ne $null) -and (Test-Path $backupFile)) {
Write-Host "$YELLOW[恢复]$NC 正在从备份恢复..."
$restoreResult = Start-Process "reg.exe" -ArgumentList "import", "`"$backupFile`"" -NoNewWindow -Wait -PassThru
if ($restoreResult.ExitCode -eq 0) {
Write-Host "$GREEN[恢复成功]$NC 已还原原始注册表值"
} else {
Write-Host "$RED[错误]$NC 恢复失败,请手动导入备份文件:$backupFile"
}
} else {
Write-Host "$YELLOW[警告]$NC 未找到备份文件或备份创建失败,无法自动恢复"
}
return $false
}
}
# 创建或更新配置文件
Write-Host "$GREEN[信息]$NC 正在更新配置..."
try {
# 检查配置文件是否存在
if (-not (Test-Path $STORAGE_FILE)) {
Write-Host "$RED[错误]$NC 未找到配置文件: $STORAGE_FILE"
Write-Host "$YELLOW[提示]$NC 请先安装并运行一次 Cursor 后再使用此脚本"
Read-Host "按回车键退出"
exit 1
}
# 读取现有配置文件
try {
$originalContent = Get-Content $STORAGE_FILE -Raw -Encoding UTF8
# 将 JSON 字符串转换为 PowerShell 对象
$config = $originalContent | ConvertFrom-Json
# 备份当前值
$oldValues = @{
'machineId' = $config.'telemetry.machineId'
'macMachineId' = $config.'telemetry.macMachineId'
'devDeviceId' = $config.'telemetry.devDeviceId'
'sqmId' = $config.'telemetry.sqmId'
}
# 更新特定的值
$config.'telemetry.machineId' = $MACHINE_ID
$config.'telemetry.macMachineId' = $MAC_MACHINE_ID
$config.'telemetry.devDeviceId' = $UUID
$config.'telemetry.sqmId' = $SQM_ID
# 将更新后的对象转换回 JSON 并保存
$updatedJson = $config | ConvertTo-Json -Depth 10
[System.IO.File]::WriteAllText(
[System.IO.Path]::GetFullPath($STORAGE_FILE),
$updatedJson,
[System.Text.Encoding]::UTF8
)
Write-Host "$GREEN[信息]$NC 成功更新配置文件"
} catch {
# 如果出错,尝试恢复原始内容
if ($originalContent) {
[System.IO.File]::WriteAllText(
[System.IO.Path]::GetFullPath($STORAGE_FILE),
$originalContent,
[System.Text.Encoding]::UTF8
)
}
throw "处理 JSON 失败: $_"
}
# 直接执行更新 MachineGuid不再询问
Update-MachineGuid
# 显示结果
Write-Host ""
Write-Host "$GREEN[信息]$NC 已更新配置:"
Write-Host "$BLUE[调试]$NC machineId: $MACHINE_ID"
Write-Host "$BLUE[调试]$NC macMachineId: $MAC_MACHINE_ID"
Write-Host "$BLUE[调试]$NC devDeviceId: $UUID"
Write-Host "$BLUE[调试]$NC sqmId: $SQM_ID"
# 显示文件树结构
Write-Host ""
Write-Host "$GREEN[信息]$NC 文件结构:"
Write-Host "$BLUE$env:APPDATA\Cursor\User$NC"
Write-Host "├── globalStorage"
Write-Host "│ ├── storage.json (已修改)"
Write-Host "│ └── backups"
# 列出备份文件
$backupFiles = Get-ChildItem "$BACKUP_DIR\*" -ErrorAction SilentlyContinue
if ($backupFiles) {
foreach ($file in $backupFiles) {
Write-Host "│ └── $($file.Name)"
}
} else {
Write-Host "│ └── (空)"
}
# 显示公众号信息
Write-Host ""
Write-Host "$GREEN================================$NC"
Write-Host "$YELLOW 关注公众号【煎饼果子卷AI】一起交流更多Cursor技巧和AI知识(脚本免费、关注公众号加群有更多技巧和大佬) $NC"
Write-Host "$GREEN================================$NC"
Write-Host ""
Write-Host "$GREEN[信息]$NC 请重启 Cursor 以应用新的配置"
Write-Host ""
# 询问是否要禁用自动更新
Write-Host ""
Write-Host "$YELLOW[询问]$NC 是否要禁用 Cursor 自动更新功能?"
Write-Host "0) 否 - 保持默认设置 (按回车键)"
Write-Host "1) 是 - 禁用自动更新"
$choice = Read-Host "请输入选项 (0)"
if ($choice -eq "1") {
Write-Host ""
Write-Host "$GREEN[信息]$NC 正在处理自动更新..."
$updaterPath = "$env:LOCALAPPDATA\cursor-updater"
# 定义手动设置教程
function Show-ManualGuide {
Write-Host ""
Write-Host "$YELLOW[警告]$NC 自动设置失败,请尝试手动操作:"
Write-Host "$YELLOW手动禁用更新步骤$NC"
Write-Host "1. 以管理员身份打开 PowerShell"
Write-Host "2. 复制粘贴以下命令:"
Write-Host "$BLUE命令1 - 删除现有目录(如果存在):$NC"
Write-Host "Remove-Item -Path `"$updaterPath`" -Force -Recurse -ErrorAction SilentlyContinue"
Write-Host ""
Write-Host "$BLUE命令2 - 创建阻止文件:$NC"
Write-Host "New-Item -Path `"$updaterPath`" -ItemType File -Force | Out-Null"
Write-Host ""
Write-Host "$BLUE命令3 - 设置只读属性:$NC"
Write-Host "Set-ItemProperty -Path `"$updaterPath`" -Name IsReadOnly -Value `$true"
Write-Host ""
Write-Host "$BLUE命令4 - 设置权限(可选):$NC"
Write-Host "icacls `"$updaterPath`" /inheritance:r /grant:r `"`$($env:USERNAME):(R)`""
Write-Host ""
Write-Host "$YELLOW验证方法$NC"
Write-Host "1. 运行命令Get-ItemProperty `"$updaterPath`""
Write-Host "2. 确认 IsReadOnly 属性为 True"
Write-Host "3. 运行命令icacls `"$updaterPath`""
Write-Host "4. 确认只有读取权限"
Write-Host ""
Write-Host "$YELLOW[提示]$NC 完成后请重启 Cursor"
}
try {
# 检查cursor-updater是否存在
if (Test-Path $updaterPath) {
# 如果是文件,说明已经创建了阻止更新
if ((Get-Item $updaterPath) -is [System.IO.FileInfo]) {
Write-Host "$GREEN[信息]$NC 已创建阻止更新文件,无需再次阻止"
return
}
# 如果是目录,尝试删除
else {
try {
Remove-Item -Path $updaterPath -Force -Recurse -ErrorAction Stop
Write-Host "$GREEN[信息]$NC 成功删除 cursor-updater 目录"
}
catch {
Write-Host "$RED[错误]$NC 删除 cursor-updater 目录失败"
Show-ManualGuide
return
}
}
}
# 创建阻止文件
try {
New-Item -Path $updaterPath -ItemType File -Force -ErrorAction Stop | Out-Null
Write-Host "$GREEN[信息]$NC 成功创建阻止文件"
}
catch {
Write-Host "$RED[错误]$NC 创建阻止文件失败"
Show-ManualGuide
return
}
# 设置文件权限
try {
# 设置只读属性
Set-ItemProperty -Path $updaterPath -Name IsReadOnly -Value $true -ErrorAction Stop
# 使用 icacls 设置权限
$result = Start-Process "icacls.exe" -ArgumentList "`"$updaterPath`" /inheritance:r /grant:r `"$($env:USERNAME):(R)`"" -Wait -NoNewWindow -PassThru
if ($result.ExitCode -ne 0) {
throw "icacls 命令失败"
}
Write-Host "$GREEN[信息]$NC 成功设置文件权限"
}
catch {
Write-Host "$RED[错误]$NC 设置文件权限失败"
Show-ManualGuide
return
}
# 验证设置
try {
$fileInfo = Get-ItemProperty $updaterPath
if (-not $fileInfo.IsReadOnly) {
Write-Host "$RED[错误]$NC 验证失败:文件权限设置可能未生效"
Show-ManualGuide
return
}
}
catch {
Write-Host "$RED[错误]$NC 验证设置失败"
Show-ManualGuide
return
}
Write-Host "$GREEN[信息]$NC 成功禁用自动更新"
}
catch {
Write-Host "$RED[错误]$NC 发生未知错误: $_"
Show-ManualGuide
}
}
else {
Write-Host "$GREEN[信息]$NC 保持默认设置,不进行更改"
}
# 保留有效的注册表更新
Update-MachineGuid
} catch {
Write-Host "$RED[错误]$NC 主要操作失败: $_"
Write-Host "$YELLOW[尝试]$NC 使用备选方法..."
try {
# 备选方法:使用 Add-Content
$tempFile = [System.IO.Path]::GetTempFileName()
$config | ConvertTo-Json | Set-Content -Path $tempFile -Encoding UTF8
Copy-Item -Path $tempFile -Destination $STORAGE_FILE -Force
Remove-Item -Path $tempFile
Write-Host "$GREEN[信息]$NC 使用备选方法成功写入配置"
} catch {
Write-Host "$RED[错误]$NC 所有尝试都失败了"
Write-Host "错误详情: $_"
Write-Host "目标文件: $STORAGE_FILE"
Write-Host "请确保您有足够的权限访问该文件"
Read-Host "按回车键退出"
exit 1
}
}
Write-Host ""
Read-Host "按回车键退出"
exit 0
# 在文件写入部分修改
function Write-ConfigFile {
param($config, $filePath)
try {
# 使用 UTF8 无 BOM 编码
$utf8NoBom = New-Object System.Text.UTF8Encoding $false
$jsonContent = $config | ConvertTo-Json -Depth 10
# 统一使用 LF 换行符
$jsonContent = $jsonContent.Replace("`r`n", "`n")
[System.IO.File]::WriteAllText(
[System.IO.Path]::GetFullPath($filePath),
$jsonContent,
$utf8NoBom
)
Write-Host "$GREEN[信息]$NC 成功写入配置文件(UTF8 无 BOM)"
}
catch {
throw "写入配置文件失败: $_"
}
}