Compare commits

...

394 Commits

Author SHA1 Message Date
煎饼果子卷鲨鱼辣椒
c5386b51ad 更新README文件中的PowerShell脚本链接,将cursor_win_id_modifier_new.ps1替换为cursor_win_id_modifier.ps1,以确保用户获取最新的增强版脚本。同时,更新反馈部分的脚本名称,提升文档的一致性和准确性。 2025-07-29 10:36:51 +08:00
煎饼果子卷鲨鱼辣椒
5f86b0a76a 更新README文件中的微信群二维码,替换为新的二维码图片,并更新有效期说明。同时,删除了一些不再使用的图片文件以清理项目资源。 2025-07-28 17:01:49 +08:00
煎饼果子卷鲨鱼辣椒
3a3d490025 优化Cursor macOS机器码修改脚本中的权限修复功能,删除冗余的权限修复命令,整合并简化权限验证流程,确保在删除文件夹后立即执行权限修复,提升代码可读性和可维护性。同时,增强启动前权限修复的逻辑,确保Cursor正常启动时权限设置正确。 2025-07-25 15:41:50 +08:00
煎饼果子卷鲨鱼辣椒@86
abe92608bc
Merge pull request #560 from teocns/master
fix: unknown parameter`xattr -r` on newer MacOS versions
2025-07-25 14:55:05 +08:00
Teo
24396c5a7a
fix: unknown parameterxattr -r on newer MacOS versions
Signed-off-by: Teo <teocns@gmail.com>
2025-07-22 16:23:40 +03:00
煎饼果子卷鲨鱼辣椒
8065efd6af 增强Cursor Windows机器码修改脚本,新增设备识别绕过功能,通过JavaScript注入实现对核心文件的修改,确保在不同环境下的设备标识符可访问性。优化了用户反馈信息,提供清晰的操作指引,提升了脚本的可维护性和用户体验。 2025-07-18 15:57:15 +08:00
煎饼果子卷鲨鱼辣椒
460b2b47a7 增强Cursor Windows机器码修改脚本,新增PowerShell原生随机字符串生成函数,提升代码可读性和可维护性。移除原有的随机字符串生成实现,确保生成的机器ID更加安全和随机化,进一步优化用户体验。 2025-07-18 15:04:00 +08:00
煎饼果子卷鲨鱼辣椒
7507be7e8b 增强Cursor Windows机器码修改脚本,新增PowerShell原生随机字符串生成函数以替代原有的密码生成方法,提升了代码的可读性和可维护性。同时,确保生成的机器ID和MAC地址更加安全和随机化,优化了用户体验。 2025-07-18 14:57:13 +08:00
煎饼果子卷鲨鱼辣椒
3504d0e5e2 简化Cursor macOS机器码修改脚本中的权限修复功能,整合多个权限修复命令,提升代码可读性和可维护性。优化了权限验证流程,确保在启动时能够有效处理权限问题,增强用户体验。 2025-07-14 14:51:52 +08:00
煎饼果子卷鲨鱼辣椒
81763a34dd 增强Cursor macOS机器码修改脚本,集成用户提供的权限修复命令,特别处理logs目录权限问题,解决EACCES错误,确保Cursor正常启动。新增启动时权限预检查和修复功能,提升用户体验和脚本的可维护性。 2025-07-14 11:44:43 +08:00
煎饼果子卷鲨鱼辣椒
e319c2c972 修复Cursor应用签名问题,防止出现"应用已损坏"错误。更新日志信息,提供清晰的操作指引,确保用户在遇到启动问题时能够获得有效的解决方案。 2025-07-14 11:25:54 +08:00
煎饼果子卷鲨鱼辣椒
40d7e844a2 移除cursor_mac_id_modifier.sh脚本中的随机ID和UUID生成函数,以简化代码结构并提升可维护性。这一变更旨在优化脚本的清晰度,确保功能专注于MAC地址修改。 2025-07-14 11:22:57 +08:00
煎饼果子卷鲨鱼辣椒
b660ba0080 增强Cursor ID修改工具,新增JavaScript注入功能以实现设备识别绕过,优化了用户反馈信息,确保在注册表修改失败时提供清晰的操作指引。同时,更新了日志信息,提升了脚本的可维护性和用户体验。 2025-07-14 10:59:58 +08:00
煎饼果子卷鲨鱼辣椒
900a07cc8c 删除了多个与Cursor相关的文件,包括下载链接的CSV和JSON文件、历史记录文档、Apple Silicon解决方案、权限修复方案、MAC地址修改总结及相关权限测试脚本。这一变更旨在简化项目结构,移除不再需要的文件,以提升可维护性和清晰度。 2025-07-14 10:50:01 +08:00
煎饼果子卷鲨鱼辣椒
31331a8991 增强Cursor ID修改工具,更新为ES模块兼容版本,重写crypto.randomUUID方法以支持UUID生成,同时覆盖系统ID获取函数,确保在不同环境下的可访问性。移除旧版Windows ID修改脚本,简化结构并提升可维护性,为后续功能扩展打下基础。 2025-07-14 10:37:13 +08:00
煎饼果子卷鲨鱼辣椒
aca18c3ea6 移除cursor_win_id_modifier_new.ps1脚本中的多项已屏蔽功能,包括备份目录创建、现有配置备份、随机ID生成及权限检查等。此更新旨在简化脚本结构,提升可维护性,并为后续功能扩展打下基础。 2025-07-11 17:40:00 +08:00
煎饼果子卷鲨鱼辣椒
57fc804106 更新README文件,新增Windows增强版Cursor机器码修改工具的说明,包含双模式操作和试用重置功能的详细信息。同时,增加了用户反馈与建议部分,鼓励用户分享使用体验和改进意见,以提升工具的可用性和用户体验。 2025-07-11 17:15:11 +08:00
煎饼果子卷鲨鱼辣椒
70a6c49ba0 优化Cursor权限管理和MAC地址修改功能,新增权限修复和验证机制,提升用户交互体验。更新了日志信息,确保在权限和MAC地址修改过程中提供清晰的反馈。同时,改进了错误处理和故障排除信息,增强了脚本的安全性和可维护性。 2025-07-09 19:12:08 +08:00
煎饼果子卷鲨鱼辣椒
730cb66194 增强MAC地址修改功能,新增MAC地址验证和WiFi管理机制,提升了脚本的兼容性和用户体验。集成了多种MAC地址修改方法,优化了错误处理和故障排除信息显示,确保在不同macOS环境下的有效性。同时,改进了用户交互,提供更清晰的操作指引和反馈。 2025-07-09 19:04:39 +08:00
煎饼果子卷鲨鱼辣椒
fabff7298b 增强Cursor权限管理功能,新增macOS特有的深入权限处理,确保在启动前和运行时的权限设置正确。优化了日志目录的权限处理和扩展属性清理,提升了脚本的安全性和用户体验。同时,新增完整权限修复函数,提供更全面的权限管理解决方案。 2025-07-09 17:03:49 +08:00
煎饼果子卷鲨鱼辣椒
421e7fd2da 优化Apple Silicon环境下的MAC地址修改逻辑,新增完全自动化模式,无需用户确认。改进用户交互,确保在MAC地址修改失败时自动切换到JS内核修改方案,减少用户干预。增强Cursor目录权限管理,确保启动前权限正确,提升脚本的安全性和用户体验。 2025-07-09 16:32:11 +08:00
煎饼果子卷鲨鱼辣椒
db938c088a 增强MAC地址修改功能,新增JS内核修改方案以绕过设备识别,提供更直接有效的解决方案。优化了用户反馈信息,确保在MAC地址修改失败时提供清晰的备选方案和操作指引。同时,提升了脚本的可维护性和用户体验。 2025-07-09 14:57:40 +08:00
煎饼果子卷鲨鱼辣椒
9788bcb7e0 群15 2025-07-07 17:38:06 +08:00
煎饼果子卷鲨鱼辣椒
9336372d18 Merge branch 'master' of https://github.com/yuaotian/go-cursor-help
.
2025-07-04 18:50:34 +08:00
煎饼果子卷鲨鱼辣椒
0e03ee274e 增强Cursor目录权限管理功能,新增确保目录权限正确的函数,优化了配置文件生成后的权限检查和恢复机制。确保在修改过程中提供清晰的操作反馈,提升了用户体验和脚本的安全性。同时,修复了Python执行结果解析和验证逻辑,确保修改成功后配置文件的只读保护有效。 2025-07-04 18:50:05 +08:00
煎饼果子卷鲨鱼辣椒@86
442a90c323
Update README_JP.md 2025-07-04 15:18:39 +08:00
煎饼果子卷鲨鱼辣椒@86
06bc74b261
Update README.md 2025-07-04 15:18:26 +08:00
煎饼果子卷鲨鱼辣椒@86
c4834133c8
Update README_CN.md 2025-07-04 15:18:11 +08:00
煎饼果子卷鲨鱼辣椒@86
c4c1aff308
Update README_CN.md 2025-07-04 15:17:58 +08:00
煎饼果子卷鲨鱼辣椒@86
ab6cbc36bb
Update README_CN.md 2025-07-04 15:17:47 +08:00
煎饼果子卷鲨鱼辣椒
874dc94792 增强MAC地址修改功能,新增macOS环境检测和多种修改方法支持,包括传统ifconfig、第三方工具和系统网络偏好设置。优化了用户反馈信息,确保在修改过程中提供清晰的操作指引和故障排除建议。同时,提升了脚本的可维护性和用户体验。 2025-07-04 00:42:45 +08:00
煎饼果子卷鲨鱼辣椒
45354c22d7 新增MAC地址修改功能,支持通过netifaces库和系统命令获取网络接口及当前MAC地址,生成随机MAC地址并进行修改。优化了用户反馈信息,确保在执行过程中提供清晰的操作指引和结果总结。同时,更新了脚本结构以提升可维护性和用户体验。 2025-07-03 15:43:37 +08:00
煎饼果子卷鲨鱼辣椒
1c34aecf45 新增Cursor初始化清理功能和系统注册表MachineGuid修改功能,成功移植自旧版本。优化了机器码修改流程,增加了备份和恢复机制,提升了用户交互体验和错误处理能力。同时,确保配置文件保护机制有效,防止Cursor覆盖用户修改。 2025-07-03 11:26:38 +08:00
煎饼果子卷鲨鱼辣椒
b984cfae26 删除Cursor脚本中的冗余功能,移除与Cursor防掉试用Pro相关的文件夹删除功能及其相关逻辑,简化脚本结构以提升可维护性和执行效率。同时,确保用户在执行过程中获得清晰的操作反馈和提示信息。 2025-07-03 10:58:00 +08:00
煎饼果子卷鲨鱼辣椒
0cdceeed83 回滚之前的方法 2025-07-03 10:57:26 +08:00
煎饼果子卷鲨鱼辣椒
c5c4b62612 修复Cursor脚本中的输出格式问题,优化了安全提示信息的可读性,提升了用户在执行机器码配置修改时的体验。同时,调整了启动Cursor生成配置文件的注释格式,确保信息更加清晰易懂。 2025-07-02 15:39:39 +08:00
煎饼果子卷鲨鱼辣椒
a530e42de6 修复Cursor脚本中的机器码输出问题,确保在用户反馈中正确显示完整的machineId。优化了输出信息的可读性,提升了用户体验。 2025-07-02 11:24:22 +08:00
煎饼果子卷鲨鱼辣椒
80079bd4cc 修复Cursor脚本中的字符串插值问题,确保在输出信息中正确显示变量内容。优化了环境检查和机器码配置修改的用户反馈,提升了脚本的可读性和用户体验。 2025-07-02 11:03:47 +08:00
煎饼果子卷鲨鱼辣椒
dfa1c7ba40 在Windows PowerShell版本中新增了强制关闭Cursor进程和文件权限检查功能,增强了机器码配置修改的安全性和可靠性。优化了修改流程,增加了重试机制和详细的用户反馈,确保用户在执行过程中获得清晰的操作指引和错误处理建议。 2025-07-02 10:20:31 +08:00
煎饼果子卷鲨鱼辣椒
7e566bc768 增强机器码配置修改功能,新增配置文件格式验证及现有遥测属性显示,确保用户在执行过程中获得详细反馈。优化了属性更新和验证逻辑,提升了脚本的可靠性和用户体验。 2025-07-02 10:02:11 +08:00
煎饼果子卷鲨鱼辣椒
ad51a92595 增强Cursor脚本的环境检查和机器码修改功能,新增对Cursor环境的全面检查,包括Python环境、配置文件、目录结构和权限验证。优化了机器码配置修改流程,增加了备份和验证步骤,确保用户在执行过程中获得详细的反馈和建议,提升了用户体验的可靠性和安全性。 2025-07-01 18:11:37 +08:00
煎饼果子卷鲨鱼辣椒
7e3239b2dc 更新Cursor脚本以增强用户交互体验,新增用户选择菜单功能,允许用户选择仅修改机器码或重置环境并修改机器码。根据用户选择,脚本将显示相应的执行流程说明和注意事项,确保用户在执行过程中了解操作步骤。同时,优化了执行逻辑,确保在执行过程中提供必要的警告提示,提升用户体验的可靠性和安全性。 2025-07-01 18:00:23 +08:00
煎饼果子卷鲨鱼辣椒
9d1acba9bb 修复Cursor启动过程中的路径验证和配置文件生成逻辑,确保在路径为空或不可用时提供备用路径。增加了额外的等待时间以确保配置文件完全写入,并在错误处理时提供更详细的调试信息,提升用户体验的可靠性和稳定性。 2025-07-01 17:01:50 +08:00
煎饼果子卷鲨鱼辣椒
29311545b8 增强权限管理功能,新增使用sudo确保目录所有权和用户写入权限的步骤,提升用户在执行Cursor相关操作时的顺利进行。更新脚本以验证权限设置并提供手动修复建议,确保用户体验的可靠性和安全性。 2025-07-01 16:25:52 +08:00
煎饼果子卷鲨鱼辣椒
b2a5edef74 深度修复权限问题,创建完整的目录结构并设置递归权限,确保用户在执行Cursor相关操作时的顺利进行。更新了脚本以增强目录权限管理和所有权验证,提升用户体验。 2025-07-01 15:10:18 +08:00
煎饼果子卷鲨鱼辣椒
9860fb8466 深度修复权限问题,创建完整的目录结构并设置递归权限,确保用户在执行Cursor相关操作时的顺利进行。更新了脚本以增强目录权限管理和所有权验证,提升用户体验。 2025-07-01 14:39:52 +08:00
煎饼果子卷鲨鱼辣椒
f942fc7f2c 新增预创建必要目录结构功能,以避免权限问题,确保用户在执行Cursor相关操作时的顺利进行。更新了相关脚本以增强目录权限管理,提升用户体验。 2025-07-01 14:22:47 +08:00
煎饼果子卷鲨鱼辣椒
fba9857c3f 更新 Cursor 脚本,采用分阶段执行策略,增强用户体验。新增执行流程说明和用户确认步骤,确保用户在执行过程中了解操作步骤及注意事项,同时更新重要提示以支持机器码修改功能。 2025-07-01 14:03:53 +08:00
煎饼果子卷鲨鱼辣椒
ab6db7d431 新增重启Cursor并等待配置文件生成的功能,提升机器码配置修改的可靠性。同时,更新了相关脚本以确保在修改机器码配置时能够正确处理Cursor进程,增强用户体验。 2025-07-01 11:25:33 +08:00
煎饼果子卷鲨鱼辣椒
e282b95c8a 新增重要警告提示,提醒用户在执行 Cursor 防掉试用Pro删除文件夹功能时必须彻底清理指定文件夹,确保没有残留设置,以防止试用状态被恢复。此更新增强了用户在执行关键操作时的警觉性。 2025-07-01 11:10:01 +08:00
煎饼果子卷鲨鱼辣椒
bc450ddc16 新增 Cursor 防掉试用Pro删除文件夹功能,提升用户体验。该功能将删除指定的 Cursor 相关文件夹以重置试用状态,并在执行过程中提供详细的操作统计信息。同时,更新了相关脚本以屏蔽机器码修改功能,确保当前版本专注于文件夹删除操作。 2025-06-30 18:38:20 +08:00
煎饼果子卷鲨鱼辣椒
4992f775da 更新 README 文件以反映 Cursor 版本的升级至 1.0.x,并添加赞助商广告信息。更新了 AppImage 安装说明中的版本号示例,以确保用户获取最新的使用信息。 2025-06-12 15:23:45 +08:00
煎饼果子卷鲨鱼辣椒
4396251d47 更新 README 文件中的微信群二维码,替换为新的二维码图片(qun-14.jpg),并更新有效期至6月18日,以确保用户获取最新的联系方式。 2025-06-11 11:16:49 +08:00
煎饼果子卷鲨鱼辣椒
9a0a1260e0 gg 2025-06-05 15:01:33 +08:00
煎饼果子卷鲨鱼辣椒
a864cf9284 gg 2025-06-05 11:56:37 +08:00
煎饼果子卷鲨鱼辣椒
f3953cd838 移除 Cursor 初始化清理函数的调用,这个方法还需要琢磨一下 2025-05-30 09:54:58 +08:00
煎饼果子卷鲨鱼辣椒
a48185e6a5 支持0.50.x 2025-05-29 17:41:46 +08:00
煎饼果子卷鲨鱼辣椒
c1b7e42e27 新增 Cursor 初始化清理函数以删除不必要的文件和文件夹,提升脚本的稳定性和用户体验。该函数在 Linux 和 macOS 环境下均进行了实现,确保用户配置的清理工作能够顺利完成。 2025-05-29 17:08:19 +08:00
煎饼果子卷鲨鱼辣椒
776ecb0434 新增 Cursor 初始化函数以清理不必要的文件和文件夹,提升脚本的稳定性和用户体验。同时修复了路径字符串中的转义字符问题,确保在 Windows 环境下的兼容性。 2025-05-29 16:57:21 +08:00
煎饼果子卷鲨鱼辣椒
86b2bae098 更新 README 文件中的微信群二维码,替换为新的二维码图片(qun13.png),以确保用户获取最新的联系方式。 2025-05-23 09:50:38 +08:00
煎饼果子卷鲨鱼辣椒
291c6198bc Merge branch 'master' of https://github.com/yuaotian/go-cursor-help 2025-05-05 18:12:58 +08:00
煎饼果子卷鲨鱼辣椒
bc787f2076 新增辅助函数以判断接口类型、生成本地管理+单播MAC地址,并自动检测并调用第三方工具(macchanger或spoof-mac)以增强MAC地址修改功能的可靠性。同时,优化了临时禁用和重新启用接口的逻辑,提供了失败时的恢复/重试选项,提升了用户体验和脚本的稳定性。 2025-05-05 18:11:08 +08:00
煎饼果子卷鲨鱼辣椒@86
9204cef000
Merge pull request #490 from yunfeidog/master
fix(mac): 修复mac无法正确修改接口MAC地址的问题
2025-05-04 16:12:59 +08:00
yunfeidog
363518ad40 fix(mac): 修复mac环境下无法成功修改MAC地址的问题 2025-05-04 14:03:33 +08:00
煎饼果子卷鲨鱼辣椒
d01dcdb7ba 新增 Cursor 安装相关功能,优化了查找和安装过程。包括添加标准安装路径、改进资源目录查找逻辑、实现从本地 AppImage 安装 Cursor 的功能,并增强了日志记录以提高用户体验。同时,更新了配置文件处理逻辑,确保在备份和修改过程中更具可靠性。此更改旨在提升脚本的稳定性和用户友好性。 2025-04-30 12:31:45 +08:00
煎饼果子卷鲨鱼辣椒
234ec180a0 qun-12 2025-04-29 10:17:18 +08:00
煎饼果子卷鲨鱼辣椒
974852944b 在临时修改系统 MAC 地址的功能中,更新了调用方式以确保即使在执行过程中出现错误也不会中断后续操作。此更改通过在调用 change_system_mac_address 函数时添加 || true,提升了脚本的稳定性和用户体验。 2025-04-27 20:45:28 +08:00
煎饼果子卷鲨鱼辣椒
e5ea1700bd 更新 README 文件以添加针对 Linux 用户的注意事项,说明脚本如何定位 Cursor 安装位置,并确保用户能够通过常见路径访问 Cursor。同时,修正了 README 文件中的中文引号格式,以提升文档的准确性和可读性。 2025-04-27 12:07:47 +08:00
煎饼果子卷鲨鱼辣椒@86
3f7ae1fbf3
Merge pull request #483 from Poikilos/python-and-gettext-translation
Add Python version of Linux script and English translation
2025-04-27 11:05:18 +08:00
煎饼果子卷鲨鱼辣椒
e481d97bd2 新增辅助函数以支持修改单个网络接口的 MAC 地址,并优化临时修改系统 MAC 地址的功能,现可处理所有活动的 Wi-Fi 和 Ethernet 接口。此更改包括详细的日志记录和错误处理,确保用户能够清晰了解每个接口的状态和修改结果,提升了功能的可靠性和用户体验。 2025-04-27 11:01:39 +08:00
煎饼果子卷鲨鱼辣椒
702bb5d05f 更新临时修改系统 MAC 地址的功能,通过路由表获取默认网络接口,提升了接口检测的准确性和可靠性。同时,调整了日志信息以更好地反映当前操作状态,确保用户能够清晰了解接口检测的结果和可能的默认设置。此更改旨在进一步优化用户体验和功能的稳定性。 2025-04-27 10:57:24 +08:00
Poikilos
a34ff83bca Add Python version of Linux script and English translation (Other OS can be added by import platform then checking if platform.system() equals "Darwin", or "Linux" or "Windows"). Please test this, since I'm not entirely familiar with the code. I know bash and Python well, so I fixed mistakes but the translations to Python and English were both made by Grok (with original cursor_linux_id_modifier.sh code and several detailed prompts). 2025-04-25 10:10:46 -04:00
煎饼果子卷鲨鱼辣椒
207689ff56 在临时修改系统 MAC 地址的功能中新增检查,以确保文件中是否已存在 randomDeviceId_ 时间戳模式。此更改通过日志记录跳过通用注入,提升了功能的可靠性和用户体验。 2025-04-23 23:11:35 +08:00
煎饼果子卷鲨鱼辣椒
a2d55a00a2 优化临时修改系统 MAC 地址的功能,增加了接口禁用和重新启用的步骤,以确保在修改过程中网络连接的稳定性。添加了详细的日志记录和错误处理,确保用户能够清晰了解 MAC 地址修改的状态和可能的失败原因。此更改旨在提升用户体验和功能的可靠性。 2025-04-22 16:13:29 +08:00
煎饼果子卷鲨鱼辣椒
d48d9fa1d0 新增临时修改系统 MAC 地址的功能,允许用户在不重启的情况下更改主网络接口的 MAC 地址。此更改包括自动检测主网络接口、生成随机 MAC 地址并执行修改,同时在日志中记录相关信息和警告。更新了主程序执行流程以默认调用此功能,确保用户在使用工具时了解相关风险和操作影响。 2025-04-22 11:46:42 +08:00
煎饼果子卷鲨鱼辣椒
33cd677188 更新 README 文件以反映最新的 Cursor 版本支持信息,从 0.47.x 更新至 0.49.x,确保文档的准确性和最新性。同时,更新了日志文件名称和内容,以更好地描述工具的功能。此更改旨在提升用户体验和文档的实用性。 2025-04-22 11:39:05 +08:00
煎饼果子卷鲨鱼辣椒
f6aba31832 更新 README 文件以添加 Cursor 通用解决方案,包括关闭账号、刷新机器码和浏览器更换的步骤。这些更改旨在提供用户在遇到问题时的解决方案,确保文档的实用性和准确性。 2025-04-18 10:13:05 +08:00
煎饼果子卷鲨鱼辣椒
f022fc1736 更新 README 文件以反映最新的 Cursor 版本支持信息,移除对 v0.45.x 及以下版本的支持声明,并更新版本历史链接。同时,更新了 WeChat 二维码的有效期和图片。此更改确保文档的准确性和最新性。 2025-04-18 10:06:05 +08:00
煎饼果子卷鲨鱼辣椒
0c59c68340 mac 2025-04-09 10:38:20 +08:00
煎饼果子卷鲨鱼辣椒
3501dd3602 Merge branch 'master' of https://github.com/yuaotian/go-cursor-help
merge
2025-04-09 10:35:35 +08:00
煎饼果子卷鲨鱼辣椒@86
9eba036c80
Merge pull request #436 from muslim098/add-cursor-free-trial-reset
Add Cursor free trial reset tool
2025-04-09 10:35:23 +08:00
煎饼果子卷鲨鱼辣椒@86
00bbf18ce7
Merge pull request #434 from cursor-home/master
fix: Improve panic recovery mechanism in main function
2025-04-09 10:34:09 +08:00
Abdallah Diaa
2cc31dd77f Add Cursor free trial reset tool
---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/yuaotian/go-cursor-help?shareId=XXXX-XXXX-XXXX-XXXX).
2025-04-09 00:47:38 +02:00
CC11001100
ec954b3130 fix: improve panic recovery in main function
- Move panic recovery defer to the beginning of main function to ensure it can catch panics from all subsequent function calls

- Remove unused setupErrorRecovery function

- Add explanatory comment for the defer placement

This change ensures proper error handling throughout the entire program execution, rather than just within the setupErrorRecovery function scope.
2025-04-08 17:28:39 +08:00
煎饼果子卷鲨鱼辣椒
2ae42e3c2a qun 10 2025-04-08 15:14:19 +08:00
煎饼果子卷鲨鱼辣椒
fc5ea3511b
Merge pull request #393 from hieusats/fix-syntax-error-in-linux-script
Fix syntax error and fix process detection in Linux script
2025-03-31 18:29:15 +08:00
hieu.sats
4daa24e80a Fix process detection in Linux script to avoid terminating itself 2025-03-30 22:41:47 +07:00
hieu.sats
6d53a926e0 Fix syntax error in cursor_linux_id_modifier.sh script 2025-03-30 17:03:09 +07:00
煎饼果子卷鲨鱼辣椒
d47f127ba3 更新README文件中的微信群二维码和有效期信息 2025-03-30 17:16:04 +08:00
煎饼果子卷鲨鱼辣椒
49f5af4827
Merge pull request #387 from hulu798/master
修正脚本Linux版本路径问题
2025-03-30 17:13:16 +08:00
hulu135289
b0455d2c46 修正脚本Linux版本路径问题 2025-03-29 08:14:28 +08:00
煎饼果子卷鲨鱼辣椒
ff17ed48d7 更新cursor_linux_id_modifier.sh和cursor_mac_id_modifier.sh脚本 2025-03-26 23:04:58 +08:00
煎饼果子卷鲨鱼辣椒
df9507a433
Merge pull request #374 from LeaveC/master
Update cursor_mac_id_modifier.sh
2025-03-26 23:00:17 +08:00
LeaveC
f4d8ba125c
Update cursor_mac_id_modifier.sh
去除重置机器码选项
2025-03-26 16:31:40 +08:00
煎饼果子卷鲨鱼辣椒
9ec3f0518c 更新cursor_linux_id_modifier.sh脚本,修改了macOS版本信息的日志输出,注释掉了Linux环境检查的相关代码,并优化了应用修复选项的菜单选择提示,以提升用户交互体验。 2025-03-24 15:09:57 +08:00
煎饼果子卷鲨鱼辣椒
f130869f51
Merge pull request #366 from LeaveC/master
免重置机器码,完美去除app机器码校验
2025-03-24 14:23:31 +08:00
LeaveC
2a382d7faa
免重置机器码,完美去除app机器码校验 2025-03-24 14:18:38 +08:00
LeaveC
fc4f4b870e
免重置机器码,完美去除app机器码校验 2025-03-24 14:14:08 +08:00
煎饼果子卷鲨鱼辣椒
42b6c3f159 重构cursor_mac_id_modifier.sh脚本,新增通用菜单选择函数以提升用户交互体验。优化了用户输入处理逻辑,简化了备份文件恢复和其他选项的选择过程,增强了日志记录功能,确保用户选择的可追溯性。 2025-03-23 20:48:50 +08:00
煎饼果子卷鲨鱼辣椒
d6155e5342 更新README_JP.md文件中的微信群二维码和有效期信息,确保用户获取最新的联系方式和有效期提示。 2025-03-22 15:33:38 +08:00
煎饼果子卷鲨鱼辣椒
f74541b712 Merge branch 'master' of https://github.com/yuaotian/go-cursor-help
he
2025-03-22 15:32:22 +08:00
煎饼果子卷鲨鱼辣椒
b099f4d8a9 更新README文件中的微信群二维码和有效期信息,确保用户获取最新的联系方式和有效期提示。 2025-03-22 15:32:06 +08:00
煎饼果子卷鲨鱼辣椒
d90c9e49d0
Merge pull request #361 from Lintech-1/patch-1
Update cursor_linux_id_modifier.sh
2025-03-22 00:06:02 +08:00
煎饼果子卷鲨鱼辣椒
3b677e23bb
Merge pull request #351 from eltociear/add-japanese-readme
docs: add Japanese README file
2025-03-22 00:05:36 +08:00
Lintech
34b45b5dda
Update cursor_linux_id_modifier.sh
Updated the Linux-specific script to support Cursor v0.47.x, optimized device ID generation logic, enhanced process termination safety, fixed path detection for non-standard installations, improved error handling/logging, added backup/restore functionality, and synchronized multilingual user prompts.
2025-03-21 14:31:27 +03:00
煎饼果子卷鲨鱼辣椒
28de33a5ad 添加修复"应用已损坏"功能到cursor_mac_id_modifier.sh脚本,提供用户选项以解决macOS提示应用已损坏无法打开的问题。增强了日志记录和用户提示信息,提升了脚本的交互性和用户体验。 2025-03-21 19:21:18 +08:00
Ikko Eltociear Ashimine
febb2f551b docs: add Japanese README file
I created Japanese translated README.
2025-03-19 17:54:21 +09:00
煎饼果子卷鲨鱼辣椒
f6cd48a7a5 更新README文件,移除macOS安装脚本中的第一种方法,简化用户操作,确保文档内容更清晰易懂。 2025-03-19 15:33:43 +08:00
煎饼果子卷鲨鱼辣椒
f2e315beac 优化cursor_win_id_modifier.ps1脚本,增强注册表操作的错误处理和用户提示信息,确保在获取和更新MachineGuid时提供更清晰的反馈。同时,简化了备份文件的创建逻辑,仅在原始值存在时进行备份,提升了脚本的稳定性和用户体验。 2025-03-18 00:36:07 +08:00
煎饼果子卷鲨鱼辣椒
5a8d32a807 优化执行macos脚本 2025-03-17 16:59:07 +08:00
煎饼果子卷鲨鱼辣椒
7834b85bde wx_group7.jpg 2025-03-17 16:55:14 +08:00
煎饼果子卷鲨鱼辣椒
6c8a458be2 更新macOS安装脚本,改用临时文件执行以增强安全性和可读性,确保用户在执行过程中获得更好的体验。 2025-03-17 11:34:58 +08:00
煎饼果子卷鲨鱼辣椒
7b0e701422 支持版本更新 2025-03-17 11:17:28 +08:00
煎饼果子卷鲨鱼辣椒
4f8f988518 改进cursor_mac_id_modifier.sh脚本中的用户输入处理,采用更健壮的方式读取用户选择,增强了输入缓冲区清空机制。添加调试日志以便于追踪用户输入,确保脚本在输入问题时不会终止,提升了脚本的稳定性和用户体验。 2025-03-14 19:14:29 +08:00
煎饼果子卷鲨鱼辣椒
cf20a2a470 重构cursor_mac_id_modifier.sh脚本中的Cursor修复选项,将其移至脚本末尾,简化用户选择流程。改进了提示信息和用户输入处理,提升了脚本的交互性和用户体验。 2025-03-14 18:57:29 +08:00
煎饼果子卷鲨鱼辣椒
56688bdf5d 添加Cursor修复功能到cursor_mac_id_modifier.sh脚本,允许用户选择恢复原始安装或强制修复。改进了用户输入处理和提示信息,提升了脚本的交互性和用户体验。 2025-03-14 18:45:38 +08:00
煎饼果子卷鲨鱼辣椒
1fe30260b0 优化cursor_mac_id_modifier.sh脚本的用户输入处理,改进提示信息和输入方式,确保用户选择更直观。此更改提升了用户体验和脚本的交互性。 2025-03-14 18:32:17 +08:00
煎饼果子卷鲨鱼辣椒
b3620ff9f3 修复cursor_mac_id_modifier.sh脚本中的语法错误,确保条件语句正确结束。此更改提高了脚本的稳定性和可读性。 2025-03-14 18:21:56 +08:00
煎饼果子卷鲨鱼辣椒
26355e2270 增强Cursor ID修改工具的日志记录功能,添加日志初始化和命令输出记录,改进错误处理和用户提示信息,确保用户能够更好地追踪脚本执行过程中的关键操作和状态。 2025-03-14 18:13:32 +08:00
煎饼果子卷鲨鱼辣椒
a63fcac86b 更新文档以支持Cursor v0.47.x版本,修改相关提示信息并增强脚本功能以处理设备ID生成。包括对Windows和Mac/Linux的支持更新,确保用户获得最新信息。 2025-03-14 18:07:25 +08:00
煎饼果子卷鲨鱼辣椒
a61be4ba15 更新微信群6 2025-03-12 11:41:43 +08:00
煎饼果子卷鲨鱼辣椒
f05ab67262
Merge pull request #299 from abdibaker/fix-sudo-home-path
fix: correctly identify storage file path when run with sudo
2025-03-10 12:07:49 +08:00
Abdillah Bakari
92d88d275d
fix: correctly identify storage file path when run with sudo 2025-03-07 08:35:12 +03:00
煎饼果子卷鲨鱼辣椒
d7044b6ac8 Merge branches 'master' and 'master' of https://github.com/yuaotian/go-cursor-help
merge pull
2025-03-07 10:23:16 +08:00
煎饼果子卷鲨鱼辣椒
689a0df174
Merge pull request #289 from ManicEuphoria/fix/update_README
docs: Update README.md with instructions for manually disabling macOS auto-updates
2025-03-07 10:22:08 +08:00
煎饼果子卷鲨鱼辣椒
9306749c62 文档: 添加光标人工智能使用限制的故障排除指南
- 更新了 README.md 和 README_CN.md,为常见的 Cursor/Claude 使用问题提供了全面的解决方案
- 添加了试用账户、API 密钥和高负载限制的详细说明
- 包含针对不同访问问题的分步故障排除方法
- 增强了文档功能,提供了清晰的问题描述和建议的解决方案
2025-03-07 10:21:38 +08:00
任科叡
c3ab2b62ee docs: Update README.md with instructions for manually disabling macOS auto-updates (references #255) 2025-03-04 15:19:43 +08:00
煎饼果子卷鲨鱼辣椒
afabbb2247 文档:更新微信组QR码和到期日期
- 用wx_group.jpg替换wx_group4.jpg
 - 更新的小组邀请到期日期至3月10日
 - 删除了过时的微信组QR代码图像
2025-03-03 10:56:59 +08:00
煎饼果子卷鲨鱼辣椒
a9bb8ab031
Merge pull request #286 from Tinyu-Zhao/master
修复在macOS下会将系统进程CursorUIViewService识别成Cursor进程的错误
2025-03-03 10:30:22 +08:00
Tinyu-Zhao
8bde88472f 修复在macOS下会将系统进程CursorUIViewService识别成Cursor进程的错误 2025-03-03 09:37:20 +08:00
煎饼果子卷鲨鱼辣椒
419dadf308 壮举:增强光标MAC自动更新禁用机制
- 添加了综合方法来禁用光标自动更新MacOS
 - 实现App-update.yml文件的备份和修改
 - 改进的光标 - 上层目录处理,并使用可靠的错误检查
 - 添加了自动更新禁用的详细验证步骤
 - 在此过程中增强的记录和用户指导
2025-02-26 21:19:07 +08:00
煎饼果子卷鲨鱼辣椒
097f685e2a
Merge pull request #262 from zuoyexingchen/master
Bugfix: 修复删除 cursor-updater 目录失败的问题
2025-02-23 14:51:10 +08:00
hzz
27b2f28765 Bugfix: 修复删除 cursor-updater 目录失败的问题
问题描述:
在 Windows 系统上,如果用户已经执行过脚本,cursor-updater文件已存在,再次执行脚本删除cursor-updater目录会报错
2025-02-22 22:59:02 +08:00
煎饼果子卷鲨鱼辣椒
f752fa8322 wx group 4 2025-02-22 19:47:35 +08:00
煎饼果子卷鲨鱼辣椒
644d663a4e feat: Enhance Linux ID modifier with advanced file modification checks
- Improved random ID generation to ensure single-line output
- Added chattr attribute removal for immutable files before modification
- Enhanced file modification reliability by handling read-only file attributes
- Implemented pre-modification checks to prevent potential configuration errors
2025-02-19 11:19:29 +08:00
煎饼果子卷鲨鱼辣椒
e8e37b3f89 feat: Improve Cursor Mac ID modifier with advanced file modification checks
- Added comprehensive file existence and modification verification
- Implemented detailed logging for target file status
- Enhanced script reliability with pre-modification checks
- Prevented unnecessary modifications to already updated files
- Introduced more informative warning and error messages
2025-02-18 16:47:25 +08:00
煎饼果子卷鲨鱼辣椒
d83c95e413 feat: Enhance config file modification with special character escaping
- Added robust character escaping for keys and values in JSON configuration
- Used sed to safely handle special characters during file modification
- Improved reliability of modify_or_add_config function
- Prevented potential sed parsing errors with advanced escaping techniques
2025-02-18 14:53:10 +08:00
煎饼果子卷鲨鱼辣椒
17897199ac
Merge pull request #241 from pikpikcu/patch-1
Fix  syntax error near unexpected token
2025-02-16 23:36:17 +08:00
煎饼果子卷鲨鱼辣椒
e8bf820c6d docs: Update version dates in README files
- Corrected version dates in both English and Chinese README files
- Changed release dates from 2024 to 2025 for latest and stable versions
- Maintained consistent formatting across README.md and README_CN.md
2025-02-16 23:33:39 +08:00
PikPikcU
706830daff
Fix syntax error near unexpected token 2025-02-16 07:31:57 +07:00
煎饼果子卷鲨鱼辣椒
dc1e0fd13c refactor: Optimize Cursor Linux ID modifier script for improved reliability
- Simplified process management with more precise process detection using pgrep
- Enhanced system ID generation with improved randomization techniques
- Implemented robust configuration file modification function
- Improved backup and file handling with better error checking
- Streamlined file permission and ownership management
- Added Linux-specific system checks and compatibility improvements
2025-02-16 00:24:58 +08:00
煎饼果子卷鲨鱼辣椒
19f4beec47 refactor: Streamline Cursor app modification script workflow
- Removed unnecessary function calls in main script execution
- Simplified post-configuration process by focusing on essential registry updates
- Removed redundant file tree display after configuration changes
2025-02-13 17:24:10 +08:00
煎饼果子卷鲨鱼辣椒
73773be6d8 fix: Correct syntax error in Cursor app modification script
- Fixed a syntax error by replacing `}` with `fi` in the directory existence check
- Ensured proper shell script syntax for conditional block termination
2025-02-13 16:47:08 +08:00
煎饼果子卷鲨鱼辣椒
dc60f1ef07 refactor: Enhance Cursor app modification script with robust backup and replacement mechanism
- Improved application replacement process with sudo-based file operations
- Added comprehensive backup creation before app modification
- Enhanced error handling during app replacement and restoration
- Simplified temporary file cleanup and permission management
- Removed code signing verification step
- Streamlined sudo usage for critical file operations
2025-02-13 16:38:47 +08:00
煎饼果子卷鲨鱼辣椒
68eff9c9d9 refactor: Improve Cursor app code signing with robust retry mechanism
- Enhanced code signing process with multi-attempt strategy
- Added detailed logging and error handling for signing failures
- Implemented signature verification before app replacement
- Provided manual recovery instructions for persistent signing issues
- Removed automatic backup creation step
2025-02-13 16:29:51 +08:00
煎饼果子卷鲨鱼辣椒
875c60738c docs: Enhance support section with donation options and playful messaging
- Updated "Support" section header
- Added humorous note about supporting project via Latiao
- Adjusted Alipay and ETC donation image sizes
- Expanded donation table layout
- Maintained centered alignment and markdown formatting
2025-02-12 23:03:19 +08:00
煎饼果子卷鲨鱼辣椒
1c98a590b2 docs: Update ETC sponsor section with Alipay QR code and adjusted image sizes 2025-02-12 22:47:11 +08:00
煎饼果子卷鲨鱼辣椒
abd809d68b docs: Add ETC donation address to README
- Included ETC sponsor section with wallet address
- Added centered table layout for donation information
- Maintained consistent markdown formatting and styling
2025-02-12 14:10:35 +08:00
煎饼果子卷鲨鱼辣椒
7ed6397075 refactor: Improve MachineGuid update function with enhanced error handling and recovery
- Replaced reg.exe query with PowerShell registry cmdlets for more robust access
- Added comprehensive error checking and validation for registry operations
- Implemented more detailed backup and restore mechanisms
- Enhanced logging and error reporting for MachineGuid modification process
- Improved function to return boolean status for better error tracking
2025-02-12 11:42:09 +08:00
煎饼果子卷鲨鱼辣椒
dc8807f3dc refactor: Improve MachineGuid backup and error handling robustness
- Added fallback backup location when default backup directory is unavailable
- Enhanced GUID parsing with additional null checks
- Improved backup file recovery error handling
- Added warning message for scenarios without backup file
- Refined error recovery mechanism with more comprehensive checks
2025-02-12 11:40:09 +08:00
煎饼果子卷鲨鱼辣椒
30af54da9c feat: Enhance MachineGuid modification with robust error handling and admin privileges
- Added administrator privilege check before script execution
- Improved MachineGuid update function with detailed error handling
- Implemented comprehensive registry backup and validation
- Added color-coded console output for better user feedback
- Enhanced error recovery mechanism with automatic backup restoration
- Integrated new configuration generation and MachineGuid update in main workflow
2025-02-12 11:33:26 +08:00
煎饼果子卷鲨鱼辣椒
d1d947ae25 style: Remove inline CSS from markdown page
- Deleted embedded CSS styles from CursorHistoryDown.md
- Simplified markdown document structure
- Removed redundant styling that may be better managed externally
2025-02-12 10:52:39 +08:00
煎饼果子卷鲨鱼辣椒
e7ec5635d9 style: Enhance markdown page styling with improved details and link formatting
- Added margin and padding to details elements
- Refined CSS styling for better readability
- Maintained consistent styling approach for markdown documentation
2025-02-12 10:50:38 +08:00
煎饼果子卷鲨鱼辣椒
37a866800f docs: Update WeChat group QR code and adjust donation image size
- Updated WeChat group QR code image to latest version
- Extended group invitation period to February 19th
- Increased Alipay donation QR code width from 300 to 500 pixels
- Maintained existing README_CN.md structure and formatting
2025-02-12 10:48:48 +08:00
煎饼果子卷鲨鱼辣椒
0b26cd9f4d docs: Fix version history link in README files
- Corrected markdown link for version history in both English and Chinese README
- Removed duplicate `.md` extension from link
- Ensured consistent link formatting across language versions
2025-02-12 09:45:02 +08:00
煎饼果子卷鲨鱼辣椒
b07a94f46d docs: Update README with version history and download links
- Added version history section with latest Cursor versions
- Included direct download links for v0.44.11
- Simplified version information presentation
- Maintained MAC address modification warning
- Improved readability and navigation for users
2025-02-11 22:47:37 +08:00
煎饼果子卷鲨鱼辣椒
bfd4aacecd fix: Correct shell script syntax in file modification function
- Fixed incorrect closing brace `}` with proper shell script `fi` syntax
- Corrected conditional statement termination in file processing
- Maintained consistent error handling and logging approach
2025-02-10 18:06:03 +08:00
煎饼果子卷鲨鱼辣椒
150eb4ac95 fix: Correct syntax errors in Cursor app modification script
- Replaced incorrect closing braces `}` with proper shell script `fi` syntax
- Fixed conditional statement terminations in file modification functions
- Improved script readability and prevented potential syntax errors
- Maintained consistent error handling and logging approach
2025-02-10 17:51:22 +08:00
煎饼果子卷鲨鱼辣椒
27d9b84604 refactor: Streamline Cursor app modification with simplified file handling
- Simplified file copying process using direct `cp` command
- Reduced complexity of signature removal for app and helper components
- Improved error handling and logging for file modification steps
- Optimized file permission and ownership management
- Removed LaunchServices database rebuild step
- Enhanced file content modification with more precise string manipulation
- Simplified app replacement and backup mechanism
2025-02-10 17:43:16 +08:00
煎饼果子卷鲨鱼辣椒
e59b1130ad refactor: Improve file modification logic with precise syntax corrections
- Fixed syntax errors in conditional statements by replacing `}` with `fi`
- Enhanced error handling and code readability in file modification process
- Corrected file existence and content modification checks
- Maintained consistent error logging and validation approach
2025-02-10 17:24:11 +08:00
煎饼果子卷鲨鱼辣椒
f3933dc398 refactor: Enhance Cursor app modification with robust file handling and error management
- Significantly improved file modification process with comprehensive error checking
- Added advanced file copying techniques using pv or rsync with progress tracking
- Implemented detailed validation for file copy integrity
- Enhanced signature removal process with timeout and fallback mechanisms
- Added granular logging for each modification step
- Improved error handling for Helper process signature removal
- Implemented backup and restore strategy for modified files
- Added more informative error messages and user guidance
2025-02-10 17:01:50 +08:00
煎饼果子卷鲨鱼辣椒
79fed06fd9 refactor: Improve codesign process with timeout and fallback mechanisms
- Added timeout for signature removal to prevent hanging
- Implemented fallback strategies for signature removal
- Enhanced error handling for Helper process signature removal
- Added logging for signature removal attempts and failures
2025-02-10 16:16:38 +08:00
煎饼果子卷鲨鱼辣椒
11275296b4 refactor: Enhance Cursor app modification with improved file handling and signing
- Replaced `cp` with `rsync` for more robust file copying
- Added detailed logging for file modification steps
- Improved file permission management during modification
- Enhanced codesign process with better metadata preservation
- Added LaunchServices database rebuild after modification
- Improved error handling and user guidance for signing issues
- Temporarily disabled restore feature for future refinement
2025-02-10 16:05:53 +08:00
煎饼果子卷鲨鱼辣椒
11cda5b82d feat: Add Cursor application path definition for file modification
- Defined a clear path constant for the Cursor application
- Prepared for future file modification operations
- Improved script configuration with explicit application location
2025-02-10 15:53:46 +08:00
煎饼果子卷鲨鱼辣椒
e3da5eadd1 refactor: Implement safe and comprehensive Cursor app file modification
- Introduced a new safe modification approach using temporary app copy
- Added signature removal and re-signing process for enhanced compatibility
- Implemented precise file content modification with position-based replacement
- Created automatic backup of original Cursor.app with timestamp
- Improved error handling and rollback mechanism during modification
- Enhanced file permission and ownership management
- Added detailed logging for each modification step
2025-02-10 15:45:52 +08:00
煎饼果子卷鲨鱼辣椒
41d6554ac8 refactor: Improve backup and modification process for Cursor files
- Updated backup file location to use a dedicated user directory
- Enhanced backup process with more robust file handling
- Simplified backup and file modification error handling
- Added detailed manual modification instructions for edge cases
- Improved logging and user guidance for file modifications
- Added a warning for potential post-modification issues
2025-02-10 11:51:16 +08:00
煎饼果子卷鲨鱼辣椒
4b3d154199 refactor: Simplify Cursor file modification and error handling
- Removed SIP status check and related user interaction
- Simplified file modification process with a single modification flag
- Enhanced error handling with a more concise approach
- Added detailed manual modification instructions for failed file updates
- Reduced verbosity of logging and error messages
- Improved overall script readability and maintainability
2025-02-10 11:28:29 +08:00
煎饼果子卷鲨鱼辣椒
9f42395a3e refactor: Improve MAC address modification user interaction and error handling
- Enhanced MAC address modification prompt with clearer default option
- Added robust input handling for MAC address modification choice
- Implemented informative logging for MAC address modification outcomes
- Simplified user interaction flow with case-based input processing
- Removed redundant log message and improved script logic
2025-02-10 11:22:21 +08:00
煎饼果子卷鲨鱼辣椒
5d33049d7b feat: Add SIP status check and enhance file modification safety in Cursor MAC ID modifier
- Implemented comprehensive System Integrity Protection (SIP) status check
- Added detailed user warnings and guidance for SIP-related risks
- Enhanced file backup and modification process with sudo permissions
- Improved error handling for file system permission issues
- Added safety checks and user confirmation before modifying system files
- Included informative messages about SIP status and recommended actions
2025-02-10 10:25:20 +08:00
煎饼果子卷鲨鱼辣椒
fd6872cb2d refactor: Optimize backup file discovery in restore feature
- Replaced `mapfile` with a more robust `while` loop for backup file collection
- Improved file validation during backup file discovery
- Enhanced error handling and file selection process
- Ensured only valid files are added to the backup files array
2025-02-10 10:18:21 +08:00
煎饼果子卷鲨鱼辣椒
3f3d0a6533 fix: Correct syntax errors in restore feature function
- Fixed missing `fi` statements in conditional blocks
- Resolved shell script syntax issues in `restore_feature()`
- Ensured proper control flow and error handling in backup restoration logic
2025-02-08 15:49:08 +08:00
煎饼果子卷鲨鱼辣椒
2bb74b41e0 refactor: Improve backup restoration logic in Cursor MAC ID modifier
- Enhanced restore feature with robust file discovery using `find`
- Added comprehensive error handling and validation for backup restoration
- Improved file selection process with sorted backup file list
- Implemented proper file permissions and ownership restoration
- Fixed potential edge cases in backup file selection and restoration
2025-02-08 15:39:19 +08:00
煎饼果子卷鲨鱼辣椒
4407650e67 fix: Correct syntax errors in restore feature function
- Fixed missing `fi` statements in conditional blocks
- Resolved potential shell script syntax issues in `restore_feature()`
- Ensured proper control flow and error handling in backup restoration logic
2025-02-08 10:15:31 +08:00
煎饼果子卷鲨鱼辣椒
2cc9adf8b8 refactor: Rename restore feature function for clarity
- Renamed `add_restore_feature()` to `restore_feature()`
- Simplified function name while maintaining existing functionality
- Improved code readability and consistency
2025-02-08 09:46:31 +08:00
煎饼果子卷鲨鱼辣椒
8a3ff84f08 feat: Enhance backup file restoration in Cursor MAC ID modifier
- Improved restore feature with more robust file selection mechanism
- Added validation for backup file selection
- Enhanced user interaction with numbered backup file list
- Implemented error handling for backup restoration process
- Simplified restore feature logic and user experience
2025-02-08 09:45:51 +08:00
煎饼果子卷鲨鱼辣椒
b4fd75079c feat: Add macOS system check and configuration restore feature to Cursor MAC ID modifier
- Implemented system check to ensure script runs only on macOS
- Added new restore functionality to recover previous configuration from backups
- Enhanced script with user-friendly backup file selection
- Improved error handling and system compatibility
2025-02-07 18:22:16 +08:00
煎饼果子卷鲨鱼辣椒
8dff3e96c6 feat: Enhance Cursor Linux ID modifier with improved config generation and validation
- Simplified machine ID generation by directly combining prefix and random ID
- Improved sed escape function to handle special characters
- Added JSON configuration file validation using jq
- Implemented fallback mechanism to restore backup if config is invalid
- Streamlined machine ID and device ID generation process
2025-02-07 18:16:25 +08:00
煎饼果子卷鲨鱼辣椒
4d68f4bdb7 refactor: Improve Cursor ID modifier script messaging and formatting
- Updated script header text for Linux, Mac, and Windows versions
- Refined public account promotion message
- Clarified tool description and version support
- Improved readability of promotional text
- Maintained consistent formatting across platforms
2025-02-07 12:23:39 +08:00
煎饼果子卷鲨鱼辣椒
a1625536a2 feat: Automatically disable Cursor auto-update during MAC ID modification
- Directly execute auto-update disabling after MAC address modification
- Remove interactive menu for auto-update disabling
- Add informative messages about auto-update disabling process
- Provide clear instructions for manually re-enabling updates if needed
2025-02-07 12:13:21 +08:00
煎饼果子卷鲨鱼辣椒
5fb473013b refactor: Simplify Cursor auto-update disabling process
- Streamlined auto-update disabling workflow with direct execution
- Removed interactive menu complexity
- Simplified user input handling
- Maintained core auto-update disabling logic
- Added straightforward prompt for user choice
2025-02-07 12:05:38 +08:00
煎饼果子卷鲨鱼辣椒
3041fb84ca fix: Update Cursor auto-update cache directory path
- Corrected the path for the Cursor updater cache directory
- Changed from `~/Library/Application Support/cursor-updater` to `~/Library/Application Support/Caches/cursor-updater`
- Ensures proper auto-update disabling process on macOS
2025-02-07 11:56:22 +08:00
煎饼果子卷鲨鱼辣椒
76c7832b38 refactor: Streamline Cursor auto-update disabling process
- Simplified auto-update disabling workflow with direct sudo commands
- Improved input handling with explicit input validation
- Added debug logging for input tracking
- Removed complex manual guide function
- Enhanced error handling and command execution
- Simplified file permission and creation logic
2025-02-07 11:30:23 +08:00
煎饼果子卷鲨鱼辣椒
0c59acaed6 fix: Correct syntax errors in configuration file generation function
- Fixed missing `fi` keywords in conditional blocks
- Resolved potential shell script syntax issues in `generate_new_config()`
- Maintained existing configuration file generation logic
2025-02-07 10:42:54 +08:00
煎饼果子卷鲨鱼辣椒
6e773bdd29 refactor: Improve configuration file modification robustness and error handling
- Enhanced `modify_or_add_config()` function with more robust file modification approach
- Added temporary file-based modification to prevent partial writes
- Implemented additional file permission and existence checks
- Improved error handling with more granular logging and error conditions
- Ensured clean file modification and temporary file cleanup
2025-02-07 10:34:50 +08:00
煎饼果子卷鲨鱼辣椒
89751a79c3 feat: Improve error handling in configuration modification function
- Added detailed error messages for configuration file modification failures
- Enhanced logging to provide specific guidance for manual configuration updates
- Maintained existing key replacement and addition logic
- Improved user feedback for configuration modification errors
2025-02-07 10:23:56 +08:00
煎饼果子卷鲨鱼辣椒
1ac23403e5 feat: Enhance configuration modification with error handling and file existence check
- Added file existence check before configuration modification
- Implemented error logging for file modification failures
- Added return value checks for sed operations
- Improved error handling in `modify_or_add_config()` function
- Maintained existing configuration key replacement and addition logic
2025-02-07 10:17:56 +08:00
煎饼果子卷鲨鱼辣椒
88541eaeda fix: Correct syntax error in auto-update disabling function
- Fixed missing `fi` keyword in conditional block
- Resolved potential shell script syntax issue
- Maintained existing auto-update disabling logic
2025-02-07 10:16:14 +08:00
煎饼果子卷鲨鱼辣椒
2bfac391b3 refactor: Improve logging and restart instructions in Cursor file modification script
- Updated logging messages to include specific file path in configuration update
- Simplified file modification success logging
- Added separate log message for Cursor restart instructions
- Maintained existing file modification and permission setting logic
2025-02-07 10:14:58 +08:00
煎饼果子卷鲨鱼辣椒
3970940524 feat: Improve configuration file modification with flexible key handling
- Added `modify_or_add_config()` function to handle existing and new configuration keys
- Enhanced file modification logic to support adding missing keys
- Refactored `generate_new_config()` to use new configuration modification method
- Maintained existing telemetry ID generation and file permission setting
- Improved script flexibility for configuration file updates
2025-02-07 10:08:33 +08:00
煎饼果子卷鲨鱼辣椒
cecccd2c7f feat: Enhance Cursor auto-update disabling workflow
- Implemented interactive menu for auto-update disabling
- Added option to exit auto-update configuration
- Improved error handling and user guidance
- Refined user experience with clearer prompts and input validation
- Updated final success message for MAC address modification
2025-02-07 09:59:54 +08:00
煎饼果子卷鲨鱼辣椒
f85d60789e fix: Remove unnecessary braces in MAC address modification logic
- Fixed syntax issues in MAC address modification function
- Removed redundant closing braces in conditional statements
- Maintained existing MAC address modification workflow
- Improved script readability and syntax correctness
2025-02-06 18:21:37 +08:00
煎饼果子卷鲨鱼辣椒
e3f6e51984 feat: Add MAC address modification feature to Cursor ID modifier script
- Implemented MAC address modification functionality for Mac users
- Added network interface selection and random MAC address generation
- Created backup mechanism for original MAC addresses
- Integrated optional MAC address modification into main script workflow
- Updated README files with MAC address modification warning and details
2025-02-06 17:53:40 +08:00
煎饼果子卷鲨鱼辣椒
a5617fb67e
Merge pull request #208 from 7YHong/master
refactor: Fix the incomplete command URLs in the readme file.
2025-02-06 15:35:04 +08:00
qiyanghong
45ff3658f2 refactor: Fix the incomplete command URLs in the readme file. 2025-02-06 14:06:56 +08:00
煎饼果子卷鲨鱼辣椒
a8933b848d refactor: Disable file content validation in Cursor Mac ID modifier script
- Commented out file content validation and logging checks
- Simplified file modification process by removing redundant validation steps
- Maintained existing file replacement logic
- Reduced script complexity while preserving core functionality
2025-02-06 10:51:15 +08:00
煎饼果子卷鲨鱼辣椒
d86701fd94 refactor: Improve Cursor file modification validation and logging
- Enhanced file content validation with more flexible regex matching for crypto.randomUUID()
- Added debug logging to preview file contents during validation
- Improved error detection and logging for file modification process
- Maintained existing script modification strategy with more robust validation
2025-02-06 10:32:43 +08:00
煎饼果子卷鲨鱼辣椒
d8810042f1 refactor: Simplify error handling in Cursor file modification logic
- Removed unnecessary curly braces in error handling blocks
- Improved code readability by simplifying conditional statements
- Maintained existing file modification and validation approach
- Ensured consistent script error handling pattern
2025-02-06 10:09:51 +08:00
煎饼果子卷鲨鱼辣椒
63beebef24 refactor: Enhance Cursor file modification logic with robust error handling
- Replaced awk-based file parsing with more precise sed replacement
- Added comprehensive validation checks for file modifications
- Improved error logging and handling during file processing
- Updated user guidance message to include restart and potential reinstallation instructions
- Maintained existing script functionality with more resilient modification approach
2025-02-06 09:52:51 +08:00
煎饼果子卷鲨鱼辣椒
3d832fbd7d chore: Minor whitespace addition in Mac ID modifier script
- Added an empty line at the end of the script
- Maintained existing script functionality
- Ensured consistent file formatting
2025-02-05 18:17:26 +08:00
煎饼果子卷鲨鱼辣椒
d8f7964d36 refactor: Improve Cursor app file modification logic in Mac ID modifier script
- Replaced complex file parsing with awk-based content modification
- Simplified UUID replacement strategy using crypto.randomUUID()
- Enhanced error handling and file processing robustness
- Optimized temporary file management during script execution
2025-02-05 18:14:35 +08:00
煎饼果子卷鲨鱼辣椒
2a93a856bf refactor: Minor formatting adjustment in Mac ID modifier script
- Removed redundant comment for No Color terminal code
- Maintained existing script structure and functionality
2025-02-05 18:02:31 +08:00
煎饼果子卷鲨鱼辣椒
60def59221 feat: Add Cursor app file modification to Mac ID modifier script
- Implemented `modify_cursor_app_files()` function to patch Cursor's main and CLI JavaScript files
- Added file backup mechanism before modification
- Dynamically locate and replace UUID generation logic in app files
- Ensure proper file permissions and ownership after modification
- Integrated new modification step into main script workflow
2025-02-05 15:40:44 +08:00
煎饼果子卷鲨鱼辣椒
edc68edddb style: Refine Cursor ID modifier script UI and messaging
- Adjusted title spacing in Linux, Mac, and Windows scripts
- Standardized promotional message formatting
- Removed redundant text in Windows script
- Improved visual consistency across platform-specific scripts
2025-02-05 15:05:25 +08:00
煎饼果子卷鲨鱼辣椒
be4c3a7681 feat: Update Cursor ID modifier scripts with version support and promotional messaging
- Updated Linux, Mac, and Windows scripts to support Cursor v0.45.x
- Added promotional message encouraging users to follow public WeChat account
- Refined logo and tool title display
- Removed outdated version support warnings
- Enhanced script messaging with additional context and community engagement
2025-02-05 14:59:04 +08:00
煎饼果子卷鲨鱼辣椒
b0950287a3 refactor: Simplify Mac system UUID modification process
- Removed user confirmation prompt for UUID modification
- Automatically update system UUID without additional user interaction
- Added clear console output to inform user about UUID change and restart requirement
2025-02-05 14:40:44 +08:00
煎饼果子卷鲨鱼辣椒
3d61fa9753 fix: Improve error messages for Linux and Mac ID modifier scripts
- Updated error messages in Linux script to include specific package installation commands
- Enhanced Mac script's UUID modification prompt with better formatting and color
- Added spacing to improve readability of user prompts
2025-02-05 11:53:19 +08:00
煎饼果子卷鲨鱼辣椒
e0639f7419 docs: Update Cursor version support for Mac/Linux in README files
- Marked Mac/Linux 0.45.x versions as fully supported
- Updated support status from "Under testing" to "Supported"
- Encouraged user feedback for Mac/Linux versions
2025-02-04 22:45:11 +08:00
煎饼果子卷鲨鱼辣椒
1c898ec594 feat: Add system ID backup and modification for Linux and Mac scripts
- Implemented `backup_system_id()` function for both Linux and Mac scripts
- Added system ID backup with timestamped files and detailed information
- Introduced machine-id modification for Linux systems
- Added system UUID modification option for Mac systems
- Enhanced logging and user interaction for system ID changes
2025-02-04 22:38:17 +08:00
煎饼果子卷鲨鱼辣椒
719b418b7f docs: Add detailed registry modification documentation to README files
- Added comprehensive explanation of MachineGuid registry modification in both English and Chinese README files
- Included safety measures, potential impacts, and recovery steps for registry changes
- Updated Windows PowerShell script to provide additional registry modification information
- Enhanced user awareness about system-level modifications and their implications
2025-02-04 22:20:52 +08:00
煎饼果子卷鲨鱼辣椒
fe5c1253e9 Update Cursor version support in README and Windows script
- Updated README files to indicate support for Cursor 0.45.x on Windows
- Added version detection function in Windows PowerShell script
- Improved version information display and user guidance
- Marked Mac/Linux 0.45.x support as under testing
2025-02-04 22:11:38 +08:00
煎饼果子卷鲨鱼辣椒
e9bcc02a10 feat: Enhance Cursor ID modifier script with advanced ID generation and version compatibility
- Improved random ID generation with more robust cryptographic methods
- Added new functions for generating standard machine and UUID identifiers
- Implemented version compatibility check for Cursor versions
- Enhanced user guidance with detailed version-specific instructions
- Added automatic MachineGuid update and backup functionality
- Introduced optional auto-update disabling feature with comprehensive error handling
2025-02-04 22:06:10 +08:00
煎饼果子卷鲨鱼辣椒
15ee4454e8
Merge pull request #174 from gsusI/master
docs: add Mac download link and clarify platform-specific downloads
2025-02-04 21:29:05 +08:00
煎饼果子卷鲨鱼辣椒
6254888a50
Merge pull request #188 from Norcy/fix/auto_update
fix disable_auto_update command
2025-02-04 21:28:52 +08:00
Nx
a66bb1d8ab fix disable_auto_update command 2025-02-02 15:29:21 +08:00
煎饼果子卷鲨鱼辣椒
5f26e0a3c1 Update WeChat group QR code and expiration date in README_CN.md
- Refreshed the WeChat group QR code image
- Updated the group invitation expiration date to February 7th
- Maintained existing README_CN.md formatting
2025-01-31 14:13:42 +08:00
jesus
252833b228 docs: add Mac download link and clarify platform-specific downloads 2025-01-28 16:29:28 +01:00
煎饼果子卷鲨鱼辣椒
7e9d937138 Add Cursor v0.44.11 download links to README files
- Added download links for Cursor v0.44.11 in both English and Chinese README files
- Included direct download options from Cursor Official and ToDesktop
- Maintained consistent formatting across language versions
2025-01-25 23:30:54 +08:00
煎饼果子卷鲨鱼辣椒
5501f2d447 Enhance sed command safety with advanced escaping in Linux Cursor ID modifier
- Implemented a custom escape function to handle special characters in sed replacements
- Improved variable escaping to prevent potential sed command injection
- Updated sed substitution syntax to use more robust delimiters
- Maintained existing file modification and permission logic
2025-01-25 20:51:14 +08:00
煎饼果子卷鲨鱼辣椒
0be607f986 Improve sed command safety in Linux Cursor ID modifier script
- Updated sed commands to use safer delimiters and variable escaping
- Replaced hardcoded delimiters with more robust sed substitution syntax
- Maintained existing file modification logic with enhanced security
- Preserved file permission settings after configuration update
2025-01-25 20:20:46 +08:00
煎饼果子卷鲨鱼辣椒
708285a2ef Refactor disable_auto_update() function in Linux script
- Improved error handling logic with more concise conditional checks
- Replaced complex multi-line command with an if statement for better readability
- Simplified file permission and ownership setting validation
- Maintained existing error logging and manual guide display functionality
2025-01-25 20:16:56 +08:00
煎饼果子卷鲨鱼辣椒
2cfd7e63e5 Add auto-update disabling feature to Cursor ID modifier scripts
- Implemented `disable_auto_update()` function for Linux, macOS, and Windows scripts
- Added interactive prompt to allow users to disable Cursor's automatic updates
- Included comprehensive manual guide for users if automatic disabling fails
- Enhanced error handling and validation for update disabling process
- Provided clear instructions and fallback methods across different platforms
2025-01-25 20:05:49 +08:00
煎饼果子卷鲨鱼辣椒
09a95b999f Enhance file permission settings for Cursor configuration files
- Updated Linux, macOS, and Windows scripts to set more restrictive file permissions
- Implemented read-only file access with additional validation checks
- Added fallback methods to ensure configuration file protection
- Improved logging for permission setting processes
2025-01-25 19:58:35 +08:00
煎饼果子卷鲨鱼辣椒
5a3c1c79a8
Merge pull request #158 from loiosunrise/master
[RFR][Fix] fix the script error, it should be 'fi' instead of '}'
2025-01-25 19:44:41 +08:00
loiosunrise
1c733d36b1 fix: fix the script error, it should be 'fi' instead of '}' 2025-01-25 12:07:34 +08:00
煎饼果子卷鲨鱼辣椒
a76b0ed71c Add instructions to disable auto-update feature in README files and update script
- Introduced a new section in both English and Chinese README files detailing methods to disable the auto-update feature for Cursor, including a built-in script and manual steps for Windows, macOS, and Linux.
- Updated the cursor_win_id_modifier.ps1 script to prompt users for disabling auto-update, enhancing user interaction and control over application settings.
- Included warnings about the need for manual updates after disabling the auto-update feature, improving overall user guidance.
2025-01-24 23:06:25 +08:00
煎饼果子卷鲨鱼辣椒
f7345eae36 Update README files and scripts to clarify Cursor version support
- Added important notices in both English and Chinese README files regarding supported Cursor versions: v0.44.11 and below are supported, while the latest 0.45.x versions are temporarily unsupported.
- Enhanced error handling in the cursor ID modifier scripts for Linux, macOS, and Windows to check for the existence of the configuration file before proceeding.
- Improved user feedback by including warnings about the required Cursor version in the script outputs.
- Streamlined the configuration update process in the scripts to ensure clarity and robustness.
2025-01-24 22:40:19 +08:00
煎饼果子卷鲨鱼辣椒
7568d9f423 Enhance Windows Admin Terminal instructions in README files
- Added detailed steps for opening the Windows Admin Terminal in both English and Chinese, including three methods: using Win + X, Win + R, and search.
- Improved formatting and clarity of the instructions to ensure better user understanding.
- Updated the reset script command for consistency across both language versions.
2025-01-22 17:35:28 +08:00
煎饼果子卷鲨鱼辣椒
63fdf398d6 Update README files to enhance Windows terminal and PowerShell installation instructions
- Revised the section on opening the Windows Admin Terminal for clarity and consistency in both English and Chinese.
- Added detailed steps for installing PowerShell, including two methods: using Winget and manual download, with improved formatting for better readability.
- Ensured that all instructions are clear and accessible to users, enhancing the overall documentation quality.
2025-01-22 14:49:07 +08:00
煎饼果子卷鲨鱼辣椒
820d722ac9 Refactor README files and enhance cursor_win_id_modifier.ps1 script
- Removed outdated installation instructions for overseas users in both English and Chinese README files.
- Updated installation commands for macOS and Linux to point to the correct scripts.
- Added a success image display in the installation sections for better user feedback.
- Improved error handling and configuration writing in the cursor_win_id_modifier.ps1 script, ensuring directory existence and setting file permissions more robustly.
- Included a prompt for users to restart Cursor to apply new configurations and added a message to follow the official WeChat account for further engagement.
2025-01-22 14:45:16 +08:00
煎饼果子卷鲨鱼辣椒
b2f07c2eed Update README files to correct section headings for clarity
- Revised section headings in both English and Chinese README files to remove numbering and improve readability.
- Ensured consistency in formatting across both language versions, enhancing user experience and understanding of the solutions provided.
2025-01-21 18:25:09 +08:00
煎饼果子卷鲨鱼辣椒
3c9fe8b9c4 Update README files to clarify trial account limitations and improve formatting
- Revised the descriptions of trial account issues in both English and Chinese README files for better clarity.
- Added specific headings for each issue related to trial limitations, enhancing user understanding of the problems and solutions.
- Improved overall formatting to ensure consistency and readability across both language versions.
2025-01-21 18:22:21 +08:00
煎饼果子卷鲨鱼辣椒
cd238f8913 Update README files to include PowerShell installation guide and improve formatting
- Added a new section in both English and Chinese README files detailing how to install PowerShell, including two methods: using Winget and manual download.
- Updated the Windows terminal instructions to provide clearer steps in Chinese.
- Enhanced the formatting of the WeChat group QR code image in the Chinese README for better visibility.
2025-01-21 18:19:36 +08:00
煎饼果子卷鲨鱼辣椒
2b77ea43aa
Merge pull request #148 from AskitEndo/NEWIssue
[FIXED #147] Readme files updated | 自述文件已更新
2025-01-20 22:21:09 +08:00
Ankit Kumar Singh
186e79b064 readme files updated | 自述文件已更新 2025-01-20 14:02:31 +05:30
煎饼果子卷鲨鱼辣椒
8c3e6a7dd0 Add manual auto-update disable instructions in README files and update cursor_win_id_modifier.ps1 script
- Introduced a new section in both English and Chinese README files detailing how users can manually disable the auto-update feature for Windows and macOS/Linux.
- Updated the cursor_win_id_modifier.ps1 script to prompt users for disabling auto-update, providing a more interactive experience and handling the creation of a blocking file.
- Enhanced documentation to improve user guidance and control over the application settings.
2025-01-11 23:27:44 +08:00
煎饼果子卷鲨鱼辣椒
e6cfcac976 Update README files to correct cursor issues link in recommended reading section
- Updated the link for the "Cursor Issues Collection and Solutions" in both English and Chinese README files to ensure users have access to the correct resource.
- Continued efforts to enhance documentation by providing accurate and valuable references for users.
2025-01-11 15:11:46 +08:00
煎饼果子卷鲨鱼辣椒
49c2a8fa21 Update README_CN.md to add a new line for improved formatting 2025-01-11 14:57:42 +08:00
煎饼果子卷鲨鱼辣椒
9df644ddcd Update README_CN.md to add recommended reading section
- Introduced a new section for recommended reading in the Chinese README file.
- Included a link to a resource on cursor issues to enhance user knowledge and support.
- Continued efforts to improve documentation by providing valuable references for users.
2025-01-11 14:57:18 +08:00
煎饼果子卷鲨鱼辣椒
7d05540177 Update README files to include recommended reading sections
- Added a new section for recommended reading in both English and Chinese README files.
- Included links to resources on cursor issues and AI development assistance to enhance user knowledge and support.
- Improved overall documentation by providing additional valuable references for users.
2025-01-11 14:55:12 +08:00
煎饼果子卷鲨鱼辣椒
ca7efde1b2 Update README files to enhance installation instructions for global and China users
- Added detailed one-click installation commands for Linux, macOS, and Windows users, with separate sections for global and China users.
- Improved clarity by using collapsible sections for better organization of installation instructions.
- Ensured all commands point to the correct scripts for both global and domestic users, enhancing usability and accessibility.
2025-01-11 13:30:38 +08:00
煎饼果子卷鲨鱼辣椒
d4ac7e2bbf Update README.md to enhance user guidance and trial reset solutions
- Revised the trial reset instructions for clarity, providing detailed steps for users encountering usage limits.
- Added temporary solutions including a quick reset method, account switching, and network optimization tips.
- Improved the structure and formatting of the README for better readability and user experience.
- Removed outdated sections and ensured all links point to the correct documentation files.
2025-01-11 13:22:40 +08:00
煎饼果子卷鲨鱼辣椒
55ec244325 Refactor sed command syntax in cursor_linux_id_modifier.sh for improved readability
- Updated sed command delimiters from '/' to '|' for better clarity in modifying telemetry IDs.
- Ensured consistent formatting across multiple sed commands to enhance maintainability of the script.
2025-01-10 18:05:59 +08:00
煎饼果子卷鲨鱼辣椒
5ec30f9c1e Update README.md to increase QR code visibility for WeChat appreciation
- Enlarged the WeChat appreciation QR code image from 300px to 500px for better visibility.
- Maintained the accompanying text to encourage user support and engagement.
- Continued improvements to the layout for a more user-friendly experience.
2025-01-10 17:38:10 +08:00
煎饼果子卷鲨鱼辣椒
96347d7ea4 Update README.md to increase visibility of payment options
- Enlarged the WeChat and Alipay appreciation QR code images for better visibility.
- Enhanced the accompanying text to maintain user engagement and encourage support.
- Overall improvements to the layout for a more user-friendly experience.
2025-01-10 17:37:35 +08:00
煎饼果子卷鲨鱼辣椒
54594b701a Update README.md to enhance user engagement with new payment options
- Changed the WeChat appreciation section to improve clarity and updated the image for better visibility.
- Added a new section for Alipay appreciation, including an image and a friendly message to encourage support.
- Overall improvements to the layout and content for better user experience.
2025-01-10 17:35:15 +08:00
煎饼果子卷鲨鱼辣椒
99c8e55475 Update README.md and cursor_linux_id_modifier.sh for improved user guidance and script functionality
- Enhanced README.md by updating WeChat contact information and adding a WeChat appreciation code section for better user engagement.
- Increased image sizes for better visibility in the README.
- Refined the sed command syntax in cursor_linux_id_modifier.sh for improved readability and consistency in modifying telemetry IDs.
- Ensured overall clarity and usability improvements across both the documentation and script.
2025-01-10 17:28:55 +08:00
煎饼果子卷鲨鱼辣椒
479aecdc78 Update README.md to include proxy download instructions for macOS and Linux users
- Added specific commands for downloading and executing the cursor ID modifier scripts for both macOS and Linux users via a proxy.
- Enhanced clarity and usability of the README documentation by providing detailed instructions for domestic users.
- Ensured consistent formatting and organization throughout the document.
2025-01-10 16:36:21 +08:00
煎饼果子卷鲨鱼辣椒
c3c9d778c0 Update README.md to include Linux ID modifier script instructions
- Added instructions for downloading and executing the cursor_linux_id_modifier.sh script for Linux users.
- Ensured consistency in the installation commands for both macOS and Linux platforms.
- Improved overall clarity and usability of the README documentation.
2025-01-10 16:33:47 +08:00
煎饼果子卷鲨鱼辣椒
46cf8ac78f Refactor cursor_linux_id_modifier.sh for improved process handling and error checking
- Enhanced the method for identifying and terminating Cursor processes to ensure more accurate detection.
- Added error handling for missing commands and file permissions when backing up configuration files.
- Improved comments for clarity and consistency in the script's functionality.
- Updated the public account name in output messages for consistency across platforms.
2025-01-10 16:31:46 +08:00
煎饼果子卷鲨鱼辣椒
5b525c1294 add:更换加速源 2025-01-09 00:36:22 +08:00
煎饼果子卷鲨鱼辣椒
10d06b9987 fix:sh bash 2025-01-09 00:29:55 +08:00
煎饼果子卷鲨鱼辣椒
4b90d906ba Refactor cursor ID modifier scripts to improve output formatting and consistency
- Moved the display of public account information to the end of the output in the macOS script for better user experience.
- Adjusted the placement of public account information in the Windows script to enhance visibility and maintain consistency across platforms.
- Ensured that the message prompting users to restart Cursor is clearly presented in both scripts.
2025-01-09 00:25:09 +08:00
煎饼果子卷鲨鱼辣椒
9495ba7f71 Enhance ID generation in macOS and Windows scripts
- Added a function to generate random hexadecimal strings in the Windows ID modifier script for improved randomness.
- Updated the macOS script to concatenate a hexadecimal representation of the prefix "auth0|user_" with a random ID, ensuring a consistent format for machine IDs across platforms.
- Improved comments in both scripts for better clarity on the ID generation process.
2025-01-09 00:23:32 +08:00
煎饼果子卷鲨鱼辣椒
d0415ff710 Update cursor ID modifier scripts to correct public account name and adjust formatting
- Changed the public account name from "煎饼果子AI" to "煎饼果子卷AI" in both macOS and Windows ID modifier scripts for consistency.
- Adjusted spacing in the display message for "Cursor ID 修改工具" to improve visual alignment in both scripts.
- Ensured consistent user experience across different platforms by maintaining similar formatting in the output messages.
2025-01-09 00:14:47 +08:00
煎饼果子卷鲨鱼辣椒
25e8b6a28e Update README.md to add trial request limit information in English and Chinese
- Included a new section explaining the trial request limit message and solutions for users who reach this limit.
- Provided clear instructions in both English and Chinese to enhance accessibility for a wider audience.
- Ensured consistent formatting and organization to maintain readability throughout the document.
2025-01-08 19:37:25 +08:00
煎饼果子卷鲨鱼辣椒
d6c76e3952 Update README.md to add detailed instructions for opening Windows Administrator Terminal in English and Chinese
- Added a new section with step-by-step instructions for accessing the Windows Administrator Terminal, enhancing usability for both English and Chinese users.
- Included relevant shortcut keys and menu options to provide clear guidance based on different Windows versions.
- Ensured consistent formatting and organization throughout the document to improve overall readability.
2025-01-08 19:32:45 +08:00
煎饼果子卷鲨鱼辣椒
d39b78efd9 Update README.md to enhance proxy download instructions for domestic Linux/macOS users
- Added a new command for domestic users to download and execute the cursor_mac_id_modifier.sh script using gh-proxy.com.
- Improved clarity in the installation instructions to ensure a smoother experience for users in China.
- Maintained consistent formatting throughout the document to enhance usability.
2025-01-08 19:15:40 +08:00
煎饼果子卷鲨鱼辣椒
50e3f5dd23 Refactor README.md to streamline Windows installation instructions
- Replaced the outdated Windows batch script download and execution commands with a single PowerShell command for improved compatibility and clarity.
- Enhanced the instructions for domestic users by consolidating steps and ensuring consistent formatting throughout the document.
- Removed redundant comments to simplify the installation process for Windows users.
2025-01-08 19:12:48 +08:00
煎饼果子卷鲨鱼辣椒
4365cd32d2 Refactor README.md and remove outdated Windows batch script
- Updated README.md to replace references to the Windows reset script from a .bat file to a .ps1 file for improved compatibility with PowerShell.
- Removed the obsolete cursor_win_id_modifier.bat script to streamline the project and eliminate redundancy.
- Ensured clarity in installation instructions for domestic users by maintaining consistent formatting and updated download commands.
2025-01-08 19:11:14 +08:00
煎饼果子卷鲨鱼辣椒
90e18cd86b Update README.md to include additional execution instructions for Windows reset script
- Added code block for executing the reset script in the Windows installation section to enhance clarity.
- Ensured consistency in formatting and improved usability for Windows users.
2025-01-08 19:00:08 +08:00
煎饼果子卷鲨鱼辣椒
b6f664242d Update README.md to enhance installation instructions for domestic users
- Changed section titles to improve clarity, replacing "代理下载执行" with "快速安装".
- Added detailed steps for downloading and executing the reset script for Windows users.
- Ensured consistency in formatting and language across the README to enhance user experience.
2025-01-08 18:59:29 +08:00
煎饼果子卷鲨鱼辣椒
a5f51bdbe4 Update README.md to standardize proxy download instructions for domestic users
- Replaced outdated proxy URLs with the new gh-proxy.com links for both Linux/macOS and Windows users.
- Ensured consistency in the download commands across different operating systems to improve user experience.
- Clarified instructions for executing the downloaded scripts, enhancing usability for domestic users.
2025-01-08 18:58:36 +08:00
煎饼果子卷鲨鱼辣椒
a6508e9d47 Update README.md to refine proxy download instructions for Linux/macOS users
- Modified the download command for the cursor_mac_id_modifier.sh script to point to the correct branch in the repository.
- Removed redundant proxy download instructions for Linux/macOS users to streamline the README content.
- Ensured clarity and consistency in the installation instructions across different operating systems.
2025-01-08 18:55:24 +08:00
煎饼果子卷鲨鱼辣椒
7b3ca99f08 Update README.md with improved proxy download instructions for Windows users
- Revised the proxy download instructions for domestic users, specifically for Windows, to enhance clarity and usability.
- Changed the command to download the script to a temporary location and execute it, ensuring a smoother installation process.
- Updated section headers for consistency and better organization of content.
2025-01-08 18:54:27 +08:00
煎饼果子卷鲨鱼辣椒
57c9c8cc5d fix:``` 2025-01-08 18:49:38 +08:00
煎饼果子卷鲨鱼辣椒
82869fb32d chore: remove CHANGELOG.md and update README with proxy download instructions for domestic users
- Deleted the CHANGELOG.md file as it is no longer needed for project documentation.
- Updated the README.md to include proxy download instructions for Linux and macOS users in China.
- Added similar instructions for Windows users to facilitate easier access to installation scripts.
2025-01-08 18:48:53 +08:00
煎饼果子卷鲨鱼辣椒
a62b7b2361 fix:优化排版 2025-01-08 17:06:46 +08:00
煎饼果子卷鲨鱼辣椒
23fcc59dae 排版 2025-01-08 17:01:48 +08:00
煎饼果子卷鲨鱼辣椒
229639653a 位置 2025-01-08 17:00:04 +08:00
煎饼果子卷鲨鱼辣椒
df3e5a534c docs: update README to include WeChat group information
- Added a section for joining the WeChat group with a QR code and contact details for assistance.
- Enhanced the content to encourage users to follow for updates and tips on using CursorAI.
2025-01-08 16:58:07 +08:00
煎饼果子卷鲨鱼辣椒
4683460ed5 refactor: update ID generation methods and remove obsolete test file
- Renamed the GenerateMacMachineID method to GenerateSQMID and updated its implementation to generate a new SQM ID in UUID format.
- Enhanced the ID generation logic by introducing a buffer pool for efficient memory management.
- Removed the generator_test.go file as it was no longer needed, streamlining the codebase.
- Updated the generateNewConfig function to utilize the new SQMID generation method, ensuring consistency across ID generation processes.
2025-01-01 18:59:12 +08:00
煎饼果子卷鲨鱼辣椒
15d8210bd4 feat: enhance GenerateMachineID to include auth0|user_ prefix
- Updated the GenerateMachineID function to generate a machine ID with the prefix "auth0|user_".
- The random part of the ID is now 25 bytes, producing a 50-character hexadecimal string.
- This change improves the uniqueness and format of generated machine IDs, aligning with authentication standards.
2025-01-01 18:07:40 +08:00
煎饼果子卷鲨鱼辣椒
12468bc363 fix: comment out version assignment in config preparation
- Commented out the version assignment in the prepareUpdatedConfig function within the config.go file to prevent hardcoding of the version number.
- This change allows for more dynamic version handling in the configuration process, aligning with recent updates in the installation scripts that utilize the latest release tag for versioning.
2024-12-30 20:06:03 +08:00
煎饼果子卷鲨鱼辣椒
8f52929e59 fix: update binary naming in installation scripts to remove 'v' prefix
- Modified the installation scripts for both PowerShell and shell to remove the 'v' prefix from the latest release tag when constructing binary names.
- This change ensures consistency in binary naming and improves compatibility with the expected format for asset retrieval.
2024-12-30 19:57:00 +08:00
煎饼果子卷鲨鱼辣椒
d32476d827 feat: add architecture-specific binary naming in installation script
- Introduced a new binary naming format for the cursor-id-modifier to include the latest release tag and support the x86_64 architecture.
- This change enhances version tracking and aligns with standard naming conventions for better clarity in the installation process.
2024-12-30 19:54:23 +08:00
煎饼果子卷鲨鱼辣椒
a0d84c8290 fix: update architecture naming in installation scripts
- Changed architecture identifiers from 'x64' to 'x86_64' and 'x86' to 'i386' in both PowerShell and shell scripts for consistency with standard naming conventions.
- Updated binary naming in the installation scripts to include the latest release tag for better version tracking.
- Enhanced error handling in the shell script to display available assets when a binary is not found.
2024-12-30 19:52:39 +08:00
煎饼果子卷鲨鱼辣椒
df71df76e2 refactor: update project references from 'dacrab' to 'yuaotian'
- Changed module path in go.mod and updated all relevant URLs in README, CHANGELOG, and installation scripts to reflect the new GitHub repository.
- Updated import paths in the main.go file to align with the new module name.
- Adjusted API calls in installation scripts to fetch the latest release from the new repository location.
2024-12-30 19:43:59 +08:00
煎饼果子卷鲨鱼辣椒
397e9d950e chore: update .gitignore and enhance auto-tag workflow with cleanup steps
- Added Go workspace and cache directories to .gitignore to prevent unnecessary files from being tracked.
- Introduced a cleanup step in the auto-tag workflow to remove temporary Go directories and cached files, improving workspace management.
- Updated GOPATH, GOCACHE, and GOMODCACHE paths in the workflow to use temporary directories for better isolation during builds.
2024-12-30 19:35:18 +08:00
煎饼果子卷鲨鱼辣椒
dc7761593d chore: update GoReleaser configuration for improved binary naming and build settings
- Modified binary naming template to include project name and version for better identification.
- Enhanced architecture handling in the naming template to support additional architectures.
- Added 'cursor-id-modifier' to the build settings for more specific build targeting.
- Allowed different binary counts in the release process, improving flexibility in output.
2024-12-30 19:32:49 +08:00
煎饼果子卷鲨鱼辣椒
d36f868f4e chore: update GoReleaser configuration for improved build and release process
- Added GO111MODULE environment variable to ensure module support during builds.
- Updated build flags to include short commit and commit date for better traceability.
- Enhanced release configuration with additional files and improved changelog filtering.
- Reorganized project settings and removed obsolete build verification steps for clarity.
2024-12-30 19:29:04 +08:00
煎饼果子卷鲨鱼辣椒
8f40c70504 chore: update GoReleaser configuration and enhance auto-tag workflow
- Upgraded GoReleaser configuration to version 2, adding build verification and improved release settings.
- Replaced 'go mod download' with 'go mod vendor' and 'go mod verify' for better dependency management.
- Introduced additional build information such as version, commit, and date in the build flags.
- Enhanced the auto-tag workflow by adding a step to prepare the build environment and sync the vendor directory.
- Improved release notes formatting with a header and footer for better clarity in changelogs.
2024-12-30 19:25:59 +08:00
煎饼果子卷鲨鱼辣椒
3050a6c0ad chore: update auto-tag workflow to use snapshot mode and enhance debugging
- Changed GoReleaser execution argument from '--debug' to '--snapshot' for improved release management.
- Added GORELEASER_DEBUG environment variable to enable detailed logging during the release process.
- Introduced GORELEASER_CURRENT_TAG environment variable to capture the current version tag, enhancing visibility in the workflow.
2024-12-30 19:23:34 +08:00
煎饼果子卷鲨鱼辣椒
c41ade9b88 chore: update auto-tag workflow and GitHub Actions versions
- Simplified the workflow_call input in auto-tag-release.yml by removing unnecessary inputs.
- Updated actions/checkout and actions/setup-go to version 3 for improved performance and compatibility.
- Refined conditional checks for version tagging to use the new syntax for better clarity.
- Adjusted GoReleaser action to version 3, ensuring alignment with the latest features and fixes.
2024-12-30 19:21:30 +08:00
煎饼果子卷鲨鱼辣椒
2d008db25e chore: simplify auto-tag workflow by removing GPG signing input
- Removed the 'skip_signing' input from the auto-tag-release.yml workflow to streamline the release process.
- Updated GoReleaser execution arguments to eliminate the '--skip-sign' option, enhancing clarity and focus on the release process.
2024-12-30 19:19:51 +08:00
煎饼果子卷鲨鱼辣椒
bf6adcbac2 chore: update GoReleaser configuration and enhance auto-tag workflow
- Added 'go mod download' step to ensure dependencies are available before builds.
- Introduced debug flag in GoReleaser execution for improved troubleshooting.
- Added error checking step to capture GoReleaser output and configuration details on failure.
- Modified build summary step to reflect GPG signing status as disabled, streamlining the release process.
2024-12-30 19:17:46 +08:00
煎饼果子卷鲨鱼辣椒
f0f77352ae chore: simplify auto-tag workflow by removing GPG signing steps
- Removed GPG key import and signing conditions from the auto-tag-release.yml workflow to streamline the release process.
- Updated GoReleaser execution conditions to focus solely on version tagging, enhancing clarity and reducing complexity.
2024-12-30 19:15:49 +08:00
煎饼果子卷鲨鱼辣椒
c1d5ba84b3 chore: update GoReleaser configuration and auto-tag workflow
- Commented out GPG signing configuration in .goreleaser.yml for clarity.
- Modified the default value for the skip_signing input in auto-tag-release.yml to true, allowing for easier skipping of GPG signing during releases.
2024-12-30 19:12:50 +08:00
煎饼果子卷鲨鱼辣椒
97e6e5165e chore: enhance auto-tag workflow with GPG signing options and build summary
- Added inputs for optional GPG private key and skip signing functionality to the workflow.
- Updated conditions for GPG signing to allow skipping based on input parameters.
- Introduced a new step to generate a build summary, detailing Go version, release version, GPG signing status, and build status, improving visibility into the release process.
2024-12-30 19:06:48 +08:00
煎饼果子卷鲨鱼辣椒
b9bd994803 chore: enhance auto-tag workflow with additional checks and Go environment setup
- Added a configuration check step for GoReleaser to ensure the presence of the configuration file before execution.
- Introduced a step to set up the Go workspace environment, improving the build process.
- Implemented dependency checks to verify and download Go modules, enhancing reliability.
- Modified the GoReleaser steps to handle cases with and without GPG signing, improving flexibility in the release process.
- Enhanced the verification step to include checks for the executability of generated binaries, ensuring successful builds.
2024-12-30 19:03:03 +08:00
煎饼果子卷鲨鱼辣椒
f192037eb5 chore: update auto-tag workflow to require Ubuntu 22.04
- Modified the workflow to specify Ubuntu 22.04 as the runner environment, ensuring compatibility with the latest features.
- Added a note indicating the requirement for Ubuntu 22.04 or 24.04, enhancing clarity for future contributors.
2024-12-30 18:59:48 +08:00
煎饼果子卷鲨鱼辣椒
ff67a07ca7 chore: remove deprecated GitHub Actions workflows for auto-tagging and release
- Deleted the auto-tag.yml and release.yml workflows as they are no longer needed.
- This cleanup helps streamline the repository by removing unused configurations and reducing maintenance overhead.
2024-12-30 18:54:42 +08:00
煎饼果子卷鲨鱼辣椒
f90d6d7e5f chore: enhance GitHub Actions workflows with improved job structure and error handling
- Introduced a pre-job in auto-tag.yml to skip duplicate actions based on content, optimizing workflow execution.
- Updated the auto-tag job to run on ubuntu-latest and added concurrency controls for better resource management.
- Enhanced error handling in both workflows by adding checks for workflow status and notifying on failures.
- Upgraded actions to their latest versions for improved performance and reliability.
- Added caching steps in both workflows to speed up builds and reduce redundant operations.
2024-12-30 18:52:02 +08:00
煎饼果子卷鲨鱼辣椒
84cd8c15c7 chore: update GitHub Actions workflows for improved tagging and release process
- Changed GITHUB_TOKEN reference in auto-tag.yml to use the standard token for better security.
- Added debug steps in both workflows to enhance visibility into the release process and check permissions.
- Updated permissions in release.yml to explicitly define required access levels for contents, packages, and actions.
- Refined the conditional execution for the release job to ensure it only runs when a valid version is generated.
2024-12-30 18:48:49 +08:00
煎饼果子卷鲨鱼辣椒
1e4f2457c2 chore: update GitHub Actions workflows for improved error handling and version validation
- Downgraded actions in both auto-tag.yml and release.yml to v3 and v4 respectively for compatibility.
- Enhanced error handling in the auto-tag workflow by adding checks for git fetch failures and validating version format.
- Introduced additional validation for version numbers to ensure they remain within acceptable ranges.
- Added a verification step in the release workflow to confirm Go installation, improving reliability.
2024-12-30 18:47:06 +08:00
煎饼果子卷鲨鱼辣椒
deb1aafcb5 chore: improve auto-tag workflow with enhanced output verification and debugging
- Updated the output redirection for the generated version to use quotes for better compatibility.
- Enhanced debug output to provide clearer visibility into step and job outputs, aiding in troubleshooting.
- Added a verification step to display the contents of GITHUB_OUTPUT, ensuring the version value is correctly set before proceeding to the release job.
- Refined the conditional execution for the release job to ensure it runs only when the auto-tag job succeeds and a version is generated.
2024-12-30 18:44:19 +08:00
煎饼果子卷鲨鱼辣椒
c4ecb7cede chore: refine auto-tag workflow with version output and enhanced debugging
- Changed output variable from 'new_tag' to 'version' for clarity in the auto-tag job.
- Introduced a new version variable to store the generated version, improving readability.
- Added debug steps to output version information and job outputs, aiding in troubleshooting.
- Updated validation step to provide clearer error messages and confirmation of version validation success.
2024-12-30 18:42:18 +08:00
煎饼果子卷鲨鱼辣椒
6fb415bfcb chore: enhance auto-tag workflow with version validation and error handling
- Added error handling for git fetch command to ensure workflow fails on tag fetch issues.
- Introduced a validation step to check the format of the new version tag, ensuring it adheres to semantic versioning.
- Updated the conditional execution for the release job to prevent running if no new tag is generated, improving workflow reliability.
2024-12-30 18:39:38 +08:00
煎饼果子卷鲨鱼辣椒
f440f47e57 chore: update GitHub Actions workflows to use latest action versions and streamline release process
- Upgraded checkout action from v3 to v4 in both auto-tag.yml and release.yml for improved performance.
- Updated setup-go action from v4 to v5 and goreleaser action from v4 to v5 to leverage the latest features.
- Changed the release job to inherit secrets instead of explicitly defining them, enhancing security.
- Added environment specification for the goreleaser job and refined the conditional execution for the release process.
2024-12-30 18:38:14 +08:00
煎饼果子卷鲨鱼辣椒
32a30afaeb chore: enhance GoReleaser and GitHub Actions workflows for GPG signing
- Added GPG signing configuration in .goreleaser.yml to support artifact signing for all artifacts.
- Updated release.yml to enforce GPG signing by setting global Git configuration options for signing commits and tags.
- Improved the signing process by utilizing the GPG fingerprint from environment variables, enhancing security and flexibility.
2024-12-30 18:35:17 +08:00
煎饼果子卷鲨鱼辣椒
d7fa7a1442 chore: update GitHub Actions workflows to use Ubuntu 22.04 and rename tag input
- Changed the runner environment from 'ubuntu-latest' to 'ubuntu-22.04' in both auto-tag.yml and release.yml for consistency and to ensure compatibility with the latest features.
- Renamed the input parameter from 'tag' to 'version' in release.yml to improve clarity regarding its purpose in the release process.
2024-12-30 18:33:33 +08:00
煎饼果子卷鲨鱼辣椒
622f681377 chore: update GitHub Actions workflows to enforce required secrets for release process
- Explicitly defined RELEASE_TOKEN, GPG_PRIVATE_KEY, and PASSPHRASE as required secrets in both auto-tag.yml and release.yml to enhance security.
- Updated the release.yml to require a tag input for the release process, ensuring clarity in workflow execution.
- Adjusted the GPG key import step to utilize the defined secrets, improving the reliability of the signing process.
2024-12-30 18:31:37 +08:00
煎饼果子卷鲨鱼辣椒
9690adf5a4 chore: downgrade action versions in GitHub workflows for compatibility
- Changed checkout action from v4 to v3 in both auto-tag.yml and release.yml for consistency.
- Downgraded setup-go action from v5 to v4 and goreleaser action from v5 to v4 to ensure compatibility with existing configurations.
- Removed explicit secrets definitions in auto-tag.yml, allowing the workflow to inherit secrets for improved security.
2024-12-30 18:29:50 +08:00
煎饼果子卷鲨鱼辣椒
5ab9a96c32 chore: update auto-tag workflow to explicitly define secrets for enhanced security
- Added explicit definitions for RELEASE_TOKEN, GPG_PRIVATE_KEY, and PASSPHRASE in the auto-tag.yml workflow.
- This change improves security by ensuring that necessary secrets are clearly specified for the release process.
2024-12-30 18:28:46 +08:00
煎饼果子卷鲨鱼辣椒
01a932f3e5 chore: enhance GitHub Actions workflows with GPG key input for signing releases
- Added an optional input for GPG private key in release.yml to support signing releases.
- Updated the conditional check for GPG key import to utilize the new input, improving flexibility and maintainability.
- Ensured that the auto-tag workflow inherits secrets for better security practices.
2024-12-30 18:18:04 +08:00
煎饼果子卷鲨鱼辣椒
a8765f85a7 chore: update GitHub Actions workflows to latest action versions and enhance release configuration
- Upgraded checkout action from v3 to v4 in both auto-tag.yml and release.yml for improved performance.
- Added optional input for GPG private key in release.yml to support signing releases.
- Updated setup-go action from v4 to v5 and goreleaser action from v4 to v5, ensuring compatibility with the latest features.
- Changed GoReleaser version specification to 'latest' for automatic updates.
2024-12-30 18:16:05 +08:00
煎饼果子卷鲨鱼辣椒
e65c5f5fa8 chore: update GitHub Actions workflow to streamline release process
- Removed explicit permissions and secrets from auto-tag.yml, inheriting them instead for improved security and simplicity.
- Added a conditional check for the release job to only run on successful completion of the auto-tag job, enhancing workflow reliability.
2024-12-30 18:14:28 +08:00
煎饼果子卷鲨鱼辣椒
c681b2473c chore: clean up GitHub Actions workflow by removing debug steps and standardizing GPG key import condition
- Removed the debug files step from release.yml to streamline the workflow.
- Standardized the conditional check for GPG key import to improve clarity and maintainability.
2024-12-30 18:13:28 +08:00
煎饼果子卷鲨鱼辣椒
e0db041e93 chore: enhance GoReleaser configuration and GitHub Actions workflows for GPG signing
- Added GPG signing configuration to .goreleaser.yml to support artifact signing.
- Updated auto-tag.yml and release.yml to include necessary secrets for GPG signing, enhancing security and functionality.
- Ensured that GPG keys and passphrase are conditionally utilized in the release process.
2024-12-30 18:10:00 +08:00
煎饼果子卷鲨鱼辣椒
dff58fb4fb chore: update GitHub Actions workflows for permissions and token usage
- Changed permissions in auto-tag.yml and release.yml to 'write-all' for broader access.
- Updated GITHUB_TOKEN to use RELEASE_TOKEN in both workflows for enhanced security.
- Streamlined the workflows by removing redundant permission specifications.
2024-12-30 18:07:39 +08:00
煎饼果子卷鲨鱼辣椒
fa53723283 chore: update GitHub Actions workflows for auto-tagging and release processes
- Updated permissions in both auto-tag.yml and release.yml to include write access for issues and pull requests.
- Changed the checkout action version from v4 to v3 in both workflows for consistency.
- Updated Go setup action version from v5 to v4 and specified the Go version as "1.21".
- Adjusted GPG import action version from v6 to v5.
- Updated GoReleaser action version from v5 to v4 and specified the release version as v1.21.2.
- Standardized string quotes in YAML files for consistency.
2024-12-30 18:03:05 +08:00
煎饼果子卷鲨鱼辣椒
778f48e57a
Merge pull request #85 from dacrab/master
commit request
2024-12-30 17:27:59 +08:00
煎饼果子卷鲨鱼辣椒
835bcfc60c
Merge branch 'master' into master 2024-12-30 17:27:46 +08:00
煎饼果子卷鲨鱼辣椒
1b8aeb4b81 docs: Enhance README.md with new section for public WeChat account and additional resources
- Added a new section to promote the WeChat public account for updates and programming tips.
- Included a QR code image for easy access to the WeChat account.
- This update aims to improve user engagement and provide more resources for developers.
2024-12-30 01:01:50 +08:00
dacrab
ad7ae6fa58 feat: enhance installation script with requirement checks and streamlined download process
- Added a function to check for required commands (curl).
- Simplified the download function to exclusively use curl for downloading assets.
- Improved error handling and user feedback when fetching the latest release information.
- Updated the main installation function to construct the binary name directly and provide clearer output during the installation process.
2024-12-29 16:51:01 +02:00
Vaggelis kavouras
a9094d34dd docs: enhance Windows installation instructions and features in README.md; improve PowerShell script for admin rights detection and user feedback
- Updated README.md to include new Windows installation features and manual installation instructions.
- Enhanced PowerShell installation script (install.ps1) to detect PowerShell version, handle elevation more effectively, and provide clearer user prompts for admin rights.
2024-12-29 00:39:01 +02:00
Vaggelis kavouras
ee2532175a fix: streamline Windows binary extension handling in configuration
- Removed the redundant assignment of the ".exe" extension in .goreleaser.yml.
- Added conditional assignment of the ".exe" extension in build_all.bat to ensure clarity and consistency in binary naming for Windows builds.
2024-12-29 00:14:35 +02:00
Vaggelis kavouras
0f0d1c7d6f fix: remove redundant extension assignment in build script
- Eliminated the unnecessary assignment of the ".exe" extension for Windows in build_all.bat to streamline the script and avoid confusion regarding binary naming conventions.
2024-12-29 00:11:40 +02:00
Vaggelis kavouras
fc9ebdec98 fix: correct binary name duplication in PowerShell installation script
- Removed redundant ".exe" suffix from binary names in install.ps1 to ensure unique and accurate naming for Windows binaries based on architecture.
2024-12-29 00:08:04 +02:00
Vaggelis kavouras
96af6471e4 fix: improve user feedback and error handling in installation scripts and language support
- Removed unnecessary print statement in main.go to streamline output.
- Updated language strings in lang.go to include newline characters for better formatting.
- Enhanced PowerShell installation script (install.ps1) with improved error handling and user prompts for admin rights.
- Modified shell installation script (install.sh) to provide clearer error messages and find matching assets for different architectures.
2024-12-29 00:04:28 +02:00
Vaggelis kavouras
947d11fbc6 refactor: streamline configuration management and enhance UI interactions
- Updated go.mod and go.sum to include necessary dependencies.
- Refactored README.md for clearer installation instructions and improved formatting.
- Enhanced main.go with better error handling and user feedback during execution.
- Improved configuration management in config.go, ensuring atomic writes and better error handling.
- Updated language support in lang.go for clearer user messages.
- Enhanced process management in manager.go to ensure more reliable process termination.
- Improved UI display methods for better user experience.
- Removed outdated test file generator_test.go to clean up the codebase.
- Updated install.ps1 script for better output formatting and error handling.
2024-12-28 23:52:24 +02:00
dacrab
56f09677ca feat: improve process management for auto-closing Cursor instances 2024-12-27 13:53:36 +02:00
dacrab
9d41a9a2c7 feat: add cyberpunk logo and auto-execute after install 2024-12-27 13:50:01 +02:00
dacrab
b3e748554f fix: ensure unique binary names for all platforms 2024-12-27 13:44:43 +02:00
dacrab
1f1f4144bb fix: update release file names and install scripts 2024-12-27 13:42:42 +02:00
dacrab
62129aa239 ci: simplify release artifacts to direct binaries 2024-12-27 13:35:32 +02:00
dacrab
f96a71f909 docs: update installation links to use correct repository 2024-12-27 13:32:53 +02:00
dacrab
fa364cb3ce ci: improve file handling in release workflow 2024-12-27 13:27:57 +02:00
dacrab
ab4806bc2e chore: add MIT license 2024-12-27 13:13:31 +02:00
dacrab
98d60390f5 fix: update version injection in goreleaser config 2024-12-27 13:12:31 +02:00
dacrab
2617a8ece8 fix: update go module dependencies 2024-12-27 13:09:20 +02:00
dacrab
e54f1236ec ci: make release workflow reusable and call it from auto-tag 2024-12-27 13:07:03 +02:00
dacrab
98537b94f9 ci: improve workflow reliability and error handling 2024-12-27 13:05:04 +02:00
dacrab
17c2cb9c2a ci: simplify and fix workflows 2024-12-27 13:02:56 +02:00
dacrab
78ea5908db fix: update repository paths and improve release config 2024-12-27 12:56:03 +02:00
dacrab
114ac32618 fix: update goreleaser config to fix build errors 2024-12-27 12:54:04 +02:00
dacrab
23295a049d ci: add automatic version tagging workflow 2024-12-27 12:51:16 +02:00
dacrab
992941fc68 feat: add version flag and fix gitignore 2024-12-27 12:50:02 +02:00
dacrab
4dc0034165 fix: update goreleaser config to latest format 2024-12-27 12:42:19 +02:00
dacrab
dae6dbcdaa Remove Makefile and update README for improved clarity and installation instructions
- Deleted the Makefile as it was no longer needed for the build process.
- Enhanced the README with clearer installation instructions, including a one-click solution for Linux/macOS and Windows.
- Improved formatting and added details for system support and configuration files.
- Updated the project stats section for better visibility.

These changes streamline the documentation and improve user experience for installation and usage of the Cursor ID Modifier tool.
2024-12-27 12:33:52 +02:00
dacrab
99e31a7bba chore: Refactor build and installation scripts; update configuration and release process
- Enhanced build scripts for improved parallel execution and optimization flags.
- Updated installation scripts for better user experience and error handling.
- Modified .gitignore to include new build artifacts and IDE configurations.
- Updated .goreleaser.yml for better release management and platform support.
- Removed deprecated main.go file and adjusted README for clarity on installation and usage.
- Added support for multiple architectures in build process, including 32-bit and 64-bit for Windows, macOS, and Linux.

These changes streamline the development workflow and enhance the overall usability of the Cursor ID Modifier tool.
2024-12-27 02:05:35 +02:00
煎饼果子卷鲨鱼辣椒
d8e2714c1c refactor: Update machineId generation to support 74-character format
BREAKING CHANGE: machineId format has been updated to generate 74-character hex strings
Technical Analysis:
 Decoded sample ID reveals structured format:
 61757468307c757365725f3031... => "auth0|user_01..."
 Contains identifiable prefix and separator pattern
 Includes encoded user identification information
Changes:
 Modified generateMachineId() to produce 74-character hex strings (37 bytes)
 Updated related documentation and comments
 Ensured compatibility with Cursor v0.44.0 requirements
 Removed legacy format handling code
Format Example:
1757468307c757365725f30314a4552464a514639364237464b44583934484a4831374452
─ Hex encoded string containing auth0 prefix and user information
Note: New format provides enhanced uniqueness and metadata capabilities
Reference:
Thanks to 🙏[Huaguang]佬友 for the analysis: https://linux.do/t/topic/287438/148
 Cursor version: 0.44+
2024-12-19 16:01:14 +08:00
煎饼果子卷鲨鱼辣椒
ab08227350 feat: Update StorageConfig and ID generation logic
- Modified NewStorageConfig to use different ID generation functions for TelemetryMacMachineId and TelemetryMachineId, ensuring machineId uses a new format while others retain the old format.
- Enhanced saveConfig to read the original configuration file, preserving all fields while updating telemetry-related fields.
- Added lastModified and version fields to the configuration if they do not exist, improving configuration management.
- Introduced a new generateMacMachineId function for consistent ID generation.

These changes improve the flexibility and maintainability of the storage configuration handling.
2024-12-19 15:36:41 +08:00
煎饼果子卷鲨鱼辣椒
5ee2265958
Merge pull request #56 from sshallow/fix-readme-issue
fix: Add chmod +x instruction in README for Linux/macOS manual installation
2024-12-19 15:24:47 +08:00
煎饼果子卷鲨鱼辣椒
cc3388ae10 docs: Update Star History section in README.md to include Repobeats for improved project visibility 2024-12-19 06:02:18 +08:00
煎饼果子卷鲨鱼辣椒
b694948d3c docs: Add Repobeats analytics image to README.md for enhanced project visibility 2024-12-19 06:01:31 +08:00
shangshy
8d47175bd8 fix: Add chmod +x instruction in README for Linux/macOS manual installation 2024-12-19 00:04:21 +08:00
煎饼果子卷鲨鱼辣椒
26dd64d8ee
Merge pull request #48 from doraemonkeys/master
feat: add option to set storage.json as read-only.
2024-12-18 13:21:06 +08:00
Ricky
791156055f feat: add option to set storage.json as read-only.
1. Default does not set storage.json file to read-only mode
2. Default retains other configuration information in storage.json
2024-12-18 11:18:27 +08:00
煎饼果子卷鲨鱼辣椒
5884f82d66
Merge pull request #37 from missuo/master
fix: install script on macos
2024-12-16 00:14:30 +08:00
Vincent Young
d45323f316
Update install.sh 2024-12-14 23:22:07 -05:00
煎饼果子卷鲨鱼辣椒
ed46393aea docs: Add Star History section to README.md for better visibility of project popularity 2024-12-15 02:12:31 +08:00
煎饼果子卷鲨鱼辣椒
180c3fd275 feat: Enhance installation scripts with logging, progress display, and prerequisite checks
- Added logging functionality to track installation progress and errors in both PowerShell and Bash scripts.
- Implemented a download progress display for better user experience during file downloads.
- Introduced prerequisite checks to ensure the required PowerShell version and internet connectivity before installation.
- Modified the installation process to run the installed program directly after completion.
- Updated messages to clarify usage instructions for the 'cursor-id-modifier' tool.

These changes improve the robustness and user-friendliness of the installation process across platforms.
2024-12-15 02:00:31 +08:00
煎饼果子卷鲨鱼辣椒
3316f8b0b0 feat: 添加自动安装脚本并优化文档 2024-12-15 01:17:43 +08:00
煎饼果子卷鲨鱼辣椒
9e7d6be7f7 chore: 添加.idea到.gitignore 2024-12-15 01:06:37 +08:00
煎饼果子卷鲨鱼辣椒
079a7bb9b2
Merge pull request #30 from realies/master
feat: lean automated releases
2024-12-14 22:57:19 +08:00
dacrab
2b2fb6d515 refactor: Remove install.sh and enhance README.md with updated installation instructions
- Deleted the `install.sh` script to streamline the installation process and reduce complexity.
- Updated the `README.md` to reflect the new installation method, emphasizing the recommended automatic installation approach.
- Improved clarity in installation instructions for both Linux/macOS and Windows, ensuring users have clear guidance on how to install the tool.
- Added details about the automatic installation script's features, including privilege requests and configuration backups.
- Enhanced the manual installation section with step-by-step instructions for users who prefer that method.

These changes collectively improve the documentation and user experience during the installation process.
2024-12-14 14:58:03 +02:00
realies
f89aa17acf feat: lean automated releases 2024-12-14 05:00:33 +00:00
Xx
0d03e6c462 fix: Correct download link for cursor_modifier.bat in README.md
- Updated the link for downloading `cursor_modifier.bat` to ensure it points to the correct file path, improving clarity for users. This change enhances the usability of the README.md by providing accurate installation instructions.
2024-12-13 16:34:53 +08:00
Xx
627c2220a6 fix: Update script download links in README.md for accuracy
- Corrected the download links for `cursor_modifier.sh` and `cursor_modifier.bat` in both English and Chinese sections of README.md to point to the correct file paths, enhancing clarity and usability for users.

These changes ensure that users can easily access the installation scripts without confusion.
2024-12-13 16:34:08 +08:00
Xx
e3fed51d43 feat: Add MD5 checksums for built files and update cSpell dictionary
- Introduced a new file `md5_checksums.txt` containing MD5 checksums for various platform binaries, enhancing file integrity verification.
- Updated the cSpell dictionary in `.vscode/settings.json` to include additional terms related to the project, improving spell checking accuracy.

These changes improve the build process by providing users with a way to verify the integrity of the built files and enhance development environment settings.
2024-12-13 16:30:21 +08:00
Xx
8a28f29202 feat: Add MD5 checksum generation to build_all.bat
- Introduced a new feature to generate and save MD5 checksums for built files in `build_all.bat`.
- Added a new cyan color code for terminal output to enhance visibility.
- Included messages to inform users about the successful generation and location of the MD5 checksum file.

These changes improve the build process by providing users with a way to verify the integrity of the built files.
2024-12-13 16:29:39 +08:00
Xx
374b509e98 refactor: Clean up telemetry fields in README.md
- Removed the "lastModified" and "version" fields from the telemetry configuration in README.md, streamlining the documentation.
- Updated the "telemetry.sqmId" field to maintain consistency in ID generation instructions.

These changes enhance the clarity of the README.md by focusing on essential telemetry information.
2024-12-13 16:15:06 +08:00
Xx
21aa297b39 feat: Update version to 2.5.0 and enhance installation scripts
- Updated version number to 2.5.0 across all relevant files for consistency.
- Removed obsolete version 2.0.0 binaries and added new binaries for version 2.5.0 for various platforms (Windows, Linux, macOS).
- Updated installation scripts (`cursor_modifier.bat`, `cursor_modifier.sh`, `install.sh`, and `build_all` scripts) to reflect the new version.
- Revised README.md to include updated installation instructions and links to the new binaries, ensuring users have accurate and up-to-date information.

These changes collectively improve the application's usability and ensure users can access the latest version seamlessly.
2024-12-13 16:13:54 +08:00
Xx
98f6eab6de feat: Update version to 2.0.0 and enhance multilingual support across scripts
- Updated version number to 2.0.0 in all relevant files for consistency.
- Improved language detection and multilingual messages in `cursor_modifier.bat` and `cursor_modifier.sh`, enhancing user experience for Chinese and English users.
- Added error handling for missing commands and improved process management in `cursor_modifier.sh`.
- Enhanced configuration management in `main.go` with better telemetry tracking and streamlined ID generation.
- Updated README.md to reflect the new version and configuration changes, ensuring users have accurate information.

These changes collectively improve the application's usability, configuration handling, and user feedback during operation.
2024-12-13 16:09:50 +08:00
Xx
1a4e5c737f feat: Add alternative script installation methods for Linux/macOS and Windows
- Introduced platform-specific scripts (`cursor_modifier.sh` for Linux/macOS and `cursor_modifier.bat` for Windows) to streamline the installation process.
- Scripts automate system language detection, close running Cursor instances, generate new IDs, and update configuration files with a user-friendly interface.
- Updated README.md to include detailed instructions for using the new scripts, enhancing user experience and accessibility.

These changes improve the installation process by providing users with flexible options for setup across different operating systems.
2024-12-13 16:01:06 +08:00
Xx
24287ac575 refactor: Remove obsolete analysis file and improve Windows admin privilege check in main.go
- Deleted the outdated analysis file that contained error diagnostics and solutions.
- Updated the checkAdminPrivileges function in main.go to use a more reliable method for checking Windows administrator privileges, enhancing security and accuracy.
- Fixed a minor display issue in the success message output.
- Added "apprun" to the cSpell dictionary in .vscode/settings.json for improved spell checking.

These changes streamline the codebase and enhance the functionality of the application.
2024-12-13 15:49:05 +08:00
煎饼果子卷鲨鱼辣椒
1b6933267d
Merge pull request #20 from dacrab/master
possible update
2024-12-13 15:33:02 +08:00
dacrab
20b2eb74b7 feat: Enhance main.go with new process management features and multilingual support
- Added new messages for process management, including checking and closing Cursor instances, to improve user feedback.
- Introduced new fields in the TextResource struct for better multilingual support, enhancing user experience across different languages.
- Updated the ensureCursorClosed function to provide clearer status messages during the process of closing instances.
- Improved the overall structure and readability of the code related to process management.

These changes collectively enhance the application's usability and provide clearer communication to users during operation.
2024-12-12 22:35:33 +02:00
dacrab
5fb0288420 feat: Enhance configuration management and process handling in main.go
- Added TelemetrySqmId to StorageConfig for improved telemetry tracking.
- Modified NewStorageConfig to accept an existing configuration, allowing for better state management.
- Updated getConfigPath, saveConfig, and readExistingConfig functions to include username as a parameter for user-specific configuration handling.
- Implemented ensureCursorClosed function to ensure the Cursor application is closed before proceeding.
- Enhanced process management functions to handle both uppercase and lowercase process names for better compatibility across systems.
- Updated README.md with new installation instructions and manual configuration steps for the added TelemetrySqmId.

These changes collectively improve the application's configuration handling and user experience during setup and operation.
2024-12-12 22:08:30 +02:00
Vaggelis kavouras
6cc28518b4 feat: Enhance installation script and main.go for improved user experience
- Updated `install.sh` to include new configuration options for binary retention and download directory, enhancing user flexibility.
- Improved error handling and user feedback in the installation process, including clearer messages for network connectivity and binary verification.
- Added a cleanup function for old versions of the binary to streamline the installation process.
- Refactored `main.go` to improve language detection and configuration management, ensuring better usability across different systems.
- Enhanced README.md with updated installation instructions and clearer descriptions of features and system support.

These changes collectively improve the installation experience and provide users with more control and clarity during setup.
2024-12-12 20:49:52 +02:00
Xx
490edb4d83 feat: Enhance language detection and process management in main.go
- Improved language detection logic to support multiple environment variables and system-specific checks for Windows and Unix systems.
- Added logging for the detected language to enhance user feedback.
- Refactored process management initialization to improve code organization and clarity.
- Updated the main function to include clearer steps for configuration loading and success messaging.

These changes enhance the application's usability by providing better language support and clearer process management.
2024-12-12 23:11:55 +08:00
Xx
81317077cb fix: Update installation URLs in README.md for accuracy
- Corrected the download URLs in the installation instructions for both Linux/macOS and Windows PowerShell to point to the raw content on GitHub.
- This change ensures users can successfully retrieve the installation script without encountering broken links.

These updates enhance the reliability of the documentation and improve the user experience during the installation process.
2024-12-11 17:58:57 +08:00
Xx
38e027cf3f feat: Enhance installation script with improved configuration and error handling
- Updated `install.sh` to allow customizable download directory and binary retention options.
- Added argument parsing for `--keep-binary` and `--download-dir` to enhance user flexibility.
- Improved binary verification process with clearer error messages and executable permission settings.
- Streamlined download process by directly saving to the specified download path.
- Enhanced user feedback with instructions for making the downloaded file executable.

These changes improve the installation experience by providing users with more control and clearer guidance during the setup process.
2024-12-11 17:53:41 +08:00
Xx
9237f883c9 feat: Enhance installation script and improve user feedback
- Corrected character encoding issues in binary verification messages in `install.sh`.
- Updated download progress display and error handling for binary downloads.
- Added a new configuration location message in `main.go` for better user guidance.
- Removed obsolete binary files from releases to streamline the project structure.

These changes improve the reliability of the installation process and enhance user experience with clearer feedback and updated messaging.
2024-12-11 17:39:13 +08:00
Xx
53be4b55fd fix: Correct binary verification message and improve download error handling in install.sh
- Fixed a character encoding issue in the binary verification message to ensure proper display.
- Updated the curl command to use a progress bar instead of verbose output, enhancing user experience during downloads.
- Improved the error message for failed binary downloads to include HTTP status information for better debugging.

These changes enhance the reliability and clarity of the installation script, providing users with more accurate feedback during the installation process.
2024-12-11 17:25:45 +08:00
Xx
e46a7ecfec chore: Update installation script and .gitignore for improved functionality
- Enhanced `install.sh` by adding network connectivity checks and executable file format validation to ensure a smoother installation process.
- Updated the installation directory creation logic to handle errors more gracefully.
- Modified the download URL to point to the correct repository branch and improved the curl command to show download progress.
- Cleaned up `.gitignore` by removing obsolete entries related to binaries and IDE configurations, streamlining the ignored files list.
- Added a new function to clean up old versions of the binary during installation.

These changes improve the reliability and user experience of the installation process.
2024-12-11 17:23:22 +08:00
Xx
bedce7425b fix: Correct closing syntax in install.sh and improve error message
- Fixed a syntax error by replacing the incorrect closing brace with `fi` in the `verify_binary` function.
- Updated the error message for setting executable permissions to ensure proper display without encoding issues.

This commit enhances the reliability of the installation script by correcting syntax and improving user feedback.
2024-12-11 17:12:51 +08:00
Xx
61392768a9 fix: Correct syntax error in install.sh
- Fixed a syntax error in the `check_requirements` function by replacing the incorrect closing brace with `fi`.
- This change ensures proper script execution and improves error handling for user permissions.

This commit addresses a critical issue in the installation script to enhance reliability.
2024-12-11 17:08:47 +08:00
Xx
44226aebf1 refactor: Revise README.md for clarity and structure
- Streamlined the description and usage guidelines for the Cursor Free Trial Reset Tool.
- Improved formatting of platform support and installation instructions for better readability.
- Updated download URLs in installation instructions to reflect the latest paths.
- Enhanced bilingual support by ensuring consistent formatting in both English and Chinese sections.
- Added troubleshooting tips and cautions to guide users effectively.

This commit enhances the documentation to provide clearer instructions and improve user experience.
2024-12-11 17:07:31 +08:00
Xx
af6c9f05de feat: Update installation script and improve error handling
- Updated `install.sh` to include versioning and enhanced bilingual messages for better user feedback.
- Refactored platform detection logic to dynamically set binary names based on the version.
- Added checks for system requirements, including curl installation and write permissions.
- Improved error handling with context-specific messages for better debugging.
- Cleaned up the `go.mod` file by consolidating dependency requirements.

This commit enhances the installation process and user experience by providing clearer feedback and ensuring necessary prerequisites are met.
2024-12-11 17:02:59 +08:00
Xx
2e27634c8d feat: Remove obsolete binaries and update module dependencies
- Deleted outdated binary files for Windows, Linux, and macOS platforms to streamline the project.
- Updated `go.mod` to change the module path to `cursor-id-modifier` and adjusted dependency versions for `github.com/fatih/color` and `golang.org/x/sys`.
- Modified `install.sh` to reflect new binary naming conventions and download URLs.
- Cleaned up whitespace in `main.go` for improved code readability.

This commit focuses on cleaning up the project structure and ensuring dependencies are up-to-date.
2024-12-11 16:40:22 +08:00
煎饼果子卷鲨鱼辣椒
394e144a2e
Merge pull request #9 from dacrab/master
Improvements
2024-12-11 13:14:31 +08:00
Vaggelis kavouras
70dda905d6 feat: Improve configuration management and enhance user experience
- Refactored configuration handling in `main.go` to streamline processes and improve structure.
- Added new methods for better management of configuration files.
- Enhanced user feedback with distinct color-coded success and warning messages.
- Updated build scripts for improved error handling and output clarity.
- Enhanced documentation in `README.md` to clarify usage guidelines and system compatibility.

This commit focuses on refining configuration processes and improving overall user interaction with the tool.
2024-12-10 21:19:50 +02:00
Vaggelis kavouras
3d288e3bd8 feat: Update module path and dependencies; enhance README
- Changed module path from `go-cursor-help` to `github.com/yuaotian/go-cursor-help` in `go.mod`.
- Updated `golang.org/x/sys` dependency version from `v0.25.0` to `v0.28.0`.
- Enhanced `README.md` with improved formatting, added badges, and clarified installation instructions.
- Included important usage guidelines and disclaimers for the Cursor Free Trial Reset Tool, emphasizing compliance with trial terms.

This commit improves module management and enhances documentation clarity for users.
2024-12-10 21:13:47 +02:00
Xx
ea56925a52 v2.0.0 app 2024-12-10 22:33:23 +08:00
Xx
f7fe868d5e feat: Add language support and ID comparison feature
- Introduced a new language display in the banner, showing the current language (Simplified Chinese or English).
- Added a function to display a comparison of old and new IDs after configuration updates.
- Implemented a new function to read existing configuration from a file.
- Updated success and warning messages to use distinct colors for better visibility.

This commit enhances user experience by providing language context and ID comparison during configuration updates.
2024-12-10 22:24:47 +08:00
Xx
a1c2203752 feat: Enhance configuration management and build scripts
- Updated `go.mod` to include new dependencies for color output.
- Refactored `main.go` to improve `StorageConfig` structure and add new methods for configuration management.
- Implemented a progress spinner and error handling for file operations.
- Enhanced build scripts (`build_all.bat` and `build_all.sh`) for better output and error handling, including versioning and cleanup processes.
- Removed obsolete binary files for various platforms.
- Updated VSCode settings for spell checking.

This commit improves the overall functionality and user experience of the Cursor ID Modifier tool.
2024-12-10 22:19:20 +08:00
煎饼果子卷鲨鱼辣椒
fb2358c86f
Merge pull request #4 from scoful/master
enhance:增加备份文件功能
2024-12-10 21:56:53 +08:00
scoful
7b3418f169 enhance:增加备份文件功能 2024-12-10 16:44:55 +08:00
羽大大
32eb8297a5
Merge pull request #1 from HappySinha/patch-1
Window path update: Roaming
2024-12-09 22:27:20 +08:00
Abhishek Kumar
835b6622a2
Window path update: Roaming 2024-12-09 18:36:12 +05:30
Xx
99a6e6ba10 Update README.md to reflect that MacOS and Linux are now tested and supported, enhancing clarity on system compatibility. 2024-12-09 19:17:58 +08:00
Xx
98883c15ef Update README.md to include important usage guidelines and disclaimers for the Cursor Free Trial Reset Tool, clarifying intended scenarios and emphasizing compliance with trial terms. 2024-12-09 16:18:43 +08:00
Xx
5de4106ee6 Fix formatting in README.md by removing extra whitespace at the end of the file 2024-12-09 15:24:03 +08:00
54 changed files with 14458 additions and 365 deletions

272
.github/workflows/auto-tag-release.yml vendored Normal file
View File

@ -0,0 +1,272 @@
# This workflow requires Ubuntu 22.04 or 24.04
name: Auto Tag & Release
on:
push:
branches:
- master
- main
tags:
- "v*"
paths-ignore:
- "**.md"
- "LICENSE"
- ".gitignore"
workflow_call: {}
permissions:
contents: write
packages: write
actions: write
jobs:
pre_job:
runs-on: ubuntu-22.04
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5.3.0
with:
cancel_others: "true"
concurrent_skipping: "same_content"
auto-tag-release:
needs: pre_job
if: |
needs.pre_job.outputs.should_skip != 'true' ||
startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-22.04
timeout-minutes: 15
outputs:
version: ${{ steps.get_latest_tag.outputs.version }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true
submodules: recursive
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: "1.21"
check-latest: true
cache: true
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
~/.cache/git
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-build-
${{ runner.os }}-
# 只在非tag推送时执行自动打tag
- name: Get latest tag
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
id: get_latest_tag
run: |
set -euo pipefail
git fetch --tags --force || {
echo "::error::Failed to fetch tags"
exit 1
}
latest_tag=$(git tag -l 'v*' --sort=-v:refname | head -n 1)
if [ -z "$latest_tag" ]; then
new_version="v0.1.0"
else
major=$(echo $latest_tag | cut -d. -f1)
minor=$(echo $latest_tag | cut -d. -f2)
patch=$(echo $latest_tag | cut -d. -f3)
new_patch=$((patch + 1))
new_version="$major.$minor.$new_patch"
fi
echo "version=$new_version" >> "$GITHUB_OUTPUT"
echo "Generated version: $new_version"
- name: Validate version
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: |
set -euo pipefail
new_tag="${{ steps.get_latest_tag.outputs.version }}"
echo "Validating version: $new_tag"
if [[ ! $new_tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "::error::Invalid version format: $new_tag"
exit 1
fi
major=$(echo $new_tag | cut -d. -f1 | tr -d 'v')
minor=$(echo $new_tag | cut -d. -f2)
patch=$(echo $new_tag | cut -d. -f3)
if [[ $major -gt 99 || $minor -gt 99 || $patch -gt 999 ]]; then
echo "::error::Version numbers out of valid range"
exit 1
fi
echo "Version validation passed"
- name: Create new tag
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
new_tag=${{ steps.get_latest_tag.outputs.version }}
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git tag -a $new_tag -m "Release $new_tag"
git push origin $new_tag
# 在 Run GoReleaser 之前添加配置检查步骤
- name: Check GoReleaser config
run: |
if [ ! -f ".goreleaser.yml" ] && [ ! -f ".goreleaser.yaml" ]; then
echo "::error::GoReleaser configuration file not found"
exit 1
fi
# 添加依赖检查步骤
- name: Check Dependencies
run: |
go mod verify
go mod download
# 如果使用 vendor 模式,则执行以下命令
if [ -d "vendor" ]; then
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 != '') }}
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: release --clean --timeout 60m
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.get_latest_tag.outputs.version }}
CGO_ENABLED: 0
GOPATH: /tmp/go
GOROOT: ${{ env.GOROOT }}
GOCACHE: /tmp/.cache/go-build
GOMODCACHE: /tmp/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
if: failure()
run: |
echo "::group::GoReleaser Debug Info"
cat dist/artifacts.json || true
echo "::endgroup::"
echo "::group::GoReleaser Config"
cat .goreleaser.yml
echo "::endgroup::"
echo "::group::Environment Info"
go version
go env
echo "::endgroup::"
- name: Set Release Version
if: startsWith(github.ref, 'refs/tags/v')
run: |
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
# 改进验证步骤
- name: Verify Release
if: ${{ startsWith(github.ref, 'refs/tags/v') || (success() && steps.get_latest_tag.outputs.version != '') }}
run: |
echo "Verifying release artifacts..."
if [ ! -d "dist" ]; then
echo "::error::Release artifacts not found"
exit 1
fi
# 验证生成的二进制文件
for file in dist/cursor-id-modifier_*; do
if [ -f "$file" ]; then
echo "Verifying: $file"
if [[ "$file" == *.exe ]]; then
# Windows 二进制文件检查
if ! [ -x "$file" ]; then
echo "::error::$file is not executable"
exit 1
fi
else
# Unix 二进制文件检查
if ! [ -x "$file" ]; then
echo "::error::$file is not executable"
exit 1
fi
fi
fi
done
- name: Notify on failure
if: failure()
run: |
echo "::error::Release process failed"
# 修改构建摘要步骤
- name: Build Summary
if: always()
run: |
echo "## Build Summary" >> $GITHUB_STEP_SUMMARY
echo "- Go Version: $(go version)" >> $GITHUB_STEP_SUMMARY
echo "- Release Version: ${VERSION:-N/A}" >> $GITHUB_STEP_SUMMARY
echo "- GPG Signing: Disabled" >> $GITHUB_STEP_SUMMARY
echo "- Build Status: ${{ job.status }}" >> $GITHUB_STEP_SUMMARY
if [ -d "dist" ]; then
echo "### Generated Artifacts" >> $GITHUB_STEP_SUMMARY
ls -lh dist/ | awk '{print "- "$9" ("$5")"}' >> $GITHUB_STEP_SUMMARY
fi

44
.gitignore vendored Normal file
View File

@ -0,0 +1,44 @@
# Compiled binary
/cursor-id-modifier
/cursor-id-modifier.exe
# Build output directories
bin/
dist/
# Go specific
go.sum
go/
.cache/
# IDE and editor files
.vscode/
.idea/
*.swp
*.swo
# OS specific
.DS_Store
Thumbs.db
# Build and release artifacts
releases/
*.syso
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test files
*.test
*.out
coverage.txt
# Temporary files
*.tmp
*~
*.bak
*.log
.cunzhi*/

92
.goreleaser.yml Normal file
View File

@ -0,0 +1,92 @@
version: 2
before:
hooks:
- go mod tidy
- go mod vendor
- go mod verify
builds:
- id: cursor-id-modifier
main: ./cmd/cursor-id-modifier/main.go
binary: cursor-id-modifier
env:
- CGO_ENABLED=0
- GO111MODULE=on
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
- "386"
ignore:
- goos: darwin
goarch: "386"
ldflags:
- -s -w
- -X 'main.version={{.Version}}'
- -X 'main.commit={{.ShortCommit}}'
- -X 'main.date={{.CommitDate}}'
- -X 'main.builtBy=goreleaser'
flags:
- -trimpath
mod_timestamp: '{{ .CommitTimestamp }}'
archives:
- id: binary
format: binary
name_template: >-
{{- .ProjectName }}_
{{- .Version }}_
{{- .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*
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

View File

@ -1,7 +0,0 @@
{
"cSpell.words": [
"LOCALAPPDATA",
"pkill",
"taskkill"
]
}

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2024 dacrab
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.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

675
README.md
View File

@ -1,147 +1,579 @@
# Cursor Free Trial Reset Tool
# 🚀 Cursor Free Trial Reset Tool
[English](#english) | [中文](#chinese)
<div align="center">
<a name="english"></a>
## English
[![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)
### Description
A tool to resolve the following prompt issue during Cursor's free trial period:
```
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.
```
[🌟 English](README.md) | [🌏 中文](README_CN.md) | [🌏 日本語](README_JP.md)
### Features
- Reset Cursor free trial limitations
- Provides both automatic and manual reset methods
- Support multiple platforms
<img src="https://ai-cursor.com/wp-content/uploads/2024/09/logo-cursor-ai-png.webp" alt="Cursor Logo" width="120"/>
### System Support
- ✅ Windows (Tested)
- ⚠️ MacOS (Untested)
- ⚠️ Linux (Untested)
### Automatic Reset
#### Prerequisites
- Requires administrator/root privileges
- Ensure Cursor is completely closed before use
#### Usage
1. Download the appropriate executable for your system:
- Windows: `cursor_id_modifier.exe`
- MacOS: `cursor_id_modifier_mac` or `cursor_id_modifier_mac_arm64`
- Linux: `cursor_id_modifier_linux`
2. Run the program as administrator
3. Follow the prompts
4. Restart Cursor to apply changes
</div>
### Manual Reset
1. Close Cursor completely
2. Locate the storage.json file:
- Windows: `%APPDATA%\Cursor\User\globalStorage\storage.json`
- MacOS: `~/Library/Application Support/Cursor/User/globalStorage/storage.json`
- Linux: `~/.config/Cursor/User/globalStorage/storage.json`
3. Make the file writable (if needed):
- Windows: Right click -> Properties -> Uncheck "Read-only"
- MacOS/Linux: `chmod 666 storage.json`
4. Edit the file and replace these fields with new random values:
```json
{
"telemetry.macMachineId": "generate-64-char-hex",
"telemetry.machineId": "generate-64-char-hex",
"telemetry.devDeviceId": "generate-uuid-format"
}
```
- For hex values: Use 64 characters (0-9, a-f)
- For UUID: Use format like "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
5. Make the file read-only:
- Windows: Right click -> Properties -> Check "Read-only"
- MacOS/Linux: `chmod 444 storage.json`
6. Restart Cursor
> ⚠️ **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.
### ⚠️ Cautions
1. Use this tool at your own risk
2. Backup important data before use
3. For educational and research purposes only
<details open>
<summary><b>📦 Version History & Downloads</b></summary>
### Disclaimer
This tool is for educational purposes only. Users bear all risks and responsibilities associated with its use.
<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).
### Contributing
Issues and Pull Requests are welcome to help improve this project.
---
<a name="chinese"></a>
## 中文
⚠️ **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
>
### 问题描述
解决Cursor在免费订阅期间出现以下提示的问题:
```
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.
<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
```
### 功能特性
- 重置Cursor免费试用限制
- 提供自动和手动重置方法
- 支持多个操作系统平台
Select `1` to automatically complete the disable operation.
### 系统支持
- ✅ Windows (已测试)
- ⚠️ MacOS (未测试)
- ⚠️ Linux (未测试)
#### Method 2: Manual Disable
### 自动重置
#### 使用前提
- 需要管理员/root权限执行
- 请确保已完全退出Cursor程序
**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
#### 使用方法
1. 下载对应系统的可执行文件:
- Windows系统`cursor_id_modifier.exe`
- MacOS系统`cursor_id_modifier_mac``cursor_id_modifier_mac_arm64`
- Linux系统`cursor_id_modifier_linux`
2. 以管理员身份运行程序
3. 按照提示进行操作
4. 重启Cursor即可
**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
### 手动重置
1. 完全关闭Cursor
2. 找到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`
3. 修改文件为可写(如果需要):
- Windows: 右键 -> 属性 -> 取消勾选"只读"
- MacOS/Linux: `chmod 666 storage.json`
4. 编辑文件,替换以下字段为新的随机值:
```json
{
"telemetry.macMachineId": "生成64位十六进制",
"telemetry.machineId": "生成64位十六进制",
"telemetry.devDeviceId": "生成UUID格式"
}
```
- 十六进制值使用64个字符(0-9, a-f)
- UUID格式类似 "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
5. 将文件设为只读:
- Windows: 右键 -> 属性 -> 勾选"只读"
- MacOS/Linux: `chmod 444 storage.json`
6. 重启Cursor
# Go to Settings -> Application -> Update, set Mode to none.
# This must be done to prevent Cursor from checking for updates.
### ⚠️ 注意事项
1. 使用本工具需要您自行承担风险
2. 建议在重要数据做好备份后使用
3. 本工具仅用于学习研究,请勿用于商业用途
# 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
```
### 贡献
欢迎提交Issue和Pull Request来帮助改进这个项目。
> ⚠️ **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.
## License
MIT License
</details>
---
### 📝 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>
```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.
```
#### 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>
<tr>
<td>
**Windows** ✅
- x64 (64-bit)
- x86 (32-bit)
</td>
<td>
**macOS** ✅
- Intel (x64)
- Apple Silicon (M1/M2)
</td>
<td>
**Linux** ✅
- x64 (64-bit)
- x86 (32-bit)
- ARM64
</td>
</tr>
</table>
### 🚀 One-Click Solution
<details open>
<summary><b>Global Users</b></summary>
**macOS**
```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
```
**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**
```powershell
irm 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://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 安装特性:
- 🔍 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)
<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>
### 🔧 Technical Details
<details>
<summary><b>Configuration Files</b></summary>
The program modifies Cursor's `storage.json` config file located at:
- 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>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>
- ✅ Safe process termination
- ✅ Atomic file operations
- ✅ 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
- [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)
---
## 💬 Feedback & Suggestions
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 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>
<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>
---
## ⭐ Project Stats
<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>
## 📄 License
<details>
<summary><b>MIT License</b></summary>
Copyright (c) 2024
@ -154,9 +586,6 @@ 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>

535
README_CN.md Normal file
View File

@ -0,0 +1,535 @@
# 🚀 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>

587
README_JP.md Normal file
View File

@ -0,0 +1,587 @@
# 🚀 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>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,328 @@
package main
import (
"bufio"
"flag"
"fmt"
"os"
"os/exec"
"os/user"
"runtime"
"runtime/debug"
"strings"
"github.com/sirupsen/logrus"
"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"
)
// Global variables
var (
version = "dev"
setReadOnly = flag.Bool("r", false, "set storage.json to read-only mode")
showVersion = flag.Bool("v", false, "show version information")
log = logrus.New()
)
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()
}
}()
handleFlags()
setupLogger()
username := getCurrentUser()
log.Debug("Running as user:", username)
// Initialize components
display := ui.NewDisplay(nil)
configManager := initConfigManager(username)
generator := idgen.NewGenerator()
processManager := process.NewManager(nil, log)
// Check and handle privileges
if err := handlePrivileges(display); err != nil {
return
}
// Setup display
setupDisplay(display)
text := lang.GetText()
// Handle Cursor processes
if err := handleCursorProcesses(display, processManager); err != nil {
return
}
// Handle configuration
oldConfig := readExistingConfig(display, configManager, text)
newConfig := generateNewConfig(display, generator, oldConfig, text)
if err := saveConfiguration(display, configManager, newConfig); err != nil {
return
}
// Show completion messages
showCompletionMessages(display)
if os.Getenv("AUTOMATED_MODE") != "1" {
waitExit()
}
}
func handleFlags() {
flag.Parse()
if *showVersion {
fmt.Printf("Cursor ID Modifier v%s\n", version)
os.Exit(0)
}
}
func setupLogger() {
log.SetFormatter(&logrus.TextFormatter{
FullTimestamp: true,
DisableLevelTruncation: true,
PadLevelText: true,
})
log.SetLevel(logrus.InfoLevel)
}
func getCurrentUser() string {
if username := os.Getenv("SUDO_USER"); username != "" {
return username
}
user, err := user.Current()
if err != nil {
log.Fatal(err)
}
return user.Username
}
func initConfigManager(username string) *config.Manager {
configManager, err := config.NewManager(username)
if err != nil {
log.Fatal(err)
}
return configManager
}
func handlePrivileges(display *ui.Display) error {
isAdmin, err := checkAdminPrivileges()
if err != nil {
log.Error(err)
waitExit()
return err
}
if !isAdmin {
if runtime.GOOS == "windows" {
return handleWindowsPrivileges(display)
}
display.ShowPrivilegeError(
lang.GetText().PrivilegeError,
lang.GetText().RunWithSudo,
lang.GetText().SudoExample,
)
waitExit()
return fmt.Errorf("insufficient privileges")
}
return nil
}
func handleWindowsPrivileges(display *ui.Display) error {
message := "\nRequesting administrator privileges..."
if lang.GetCurrentLanguage() == lang.CN {
message = "\n请求管理员权限..."
}
fmt.Println(message)
if err := selfElevate(); err != nil {
log.Error(err)
display.ShowPrivilegeError(
lang.GetText().PrivilegeError,
lang.GetText().RunAsAdmin,
lang.GetText().RunWithSudo,
lang.GetText().SudoExample,
)
waitExit()
return err
}
return nil
}
func setupDisplay(display *ui.Display) {
if err := display.ClearScreen(); err != nil {
log.Warn("Failed to clear screen:", err)
}
display.ShowLogo()
fmt.Println()
}
func handleCursorProcesses(display *ui.Display, processManager *process.Manager) error {
if os.Getenv("AUTOMATED_MODE") == "1" {
log.Debug("Running in automated mode, skipping Cursor process closing")
return nil
}
display.ShowProgress("Closing Cursor...")
log.Debug("Attempting to close Cursor processes")
if err := processManager.KillCursorProcesses(); err != nil {
log.Error("Failed to close Cursor:", err)
display.StopProgress()
display.ShowError("Failed to close Cursor. Please close it manually and try again.")
waitExit()
return err
}
if processManager.IsCursorRunning() {
log.Error("Cursor processes still detected after closing")
display.StopProgress()
display.ShowError("Failed to close Cursor completely. Please close it manually and try again.")
waitExit()
return fmt.Errorf("cursor still running")
}
log.Debug("Successfully closed all Cursor processes")
display.StopProgress()
fmt.Println()
return nil
}
func readExistingConfig(display *ui.Display, configManager *config.Manager, text lang.TextResource) *config.StorageConfig {
fmt.Println()
display.ShowProgress(text.ReadingConfig)
oldConfig, err := configManager.ReadConfig()
if err != nil {
log.Warn("Failed to read existing config:", err)
oldConfig = nil
}
display.StopProgress()
fmt.Println()
return oldConfig
}
func generateNewConfig(display *ui.Display, generator *idgen.Generator, oldConfig *config.StorageConfig, text lang.TextResource) *config.StorageConfig {
display.ShowProgress(text.GeneratingIds)
newConfig := &config.StorageConfig{}
if machineID, err := generator.GenerateMachineID(); err != nil {
log.Fatal("Failed to generate machine ID:", err)
} else {
newConfig.TelemetryMachineId = machineID
}
if macMachineID, err := generator.GenerateMacMachineID(); err != nil {
log.Fatal("Failed to generate MAC machine ID:", err)
} else {
newConfig.TelemetryMacMachineId = macMachineID
}
if deviceID, err := generator.GenerateDeviceID(); err != nil {
log.Fatal("Failed to generate device ID:", err)
} else {
newConfig.TelemetryDevDeviceId = deviceID
}
if oldConfig != nil && oldConfig.TelemetrySqmId != "" {
newConfig.TelemetrySqmId = oldConfig.TelemetrySqmId
} else if sqmID, err := generator.GenerateSQMID(); err != nil {
log.Fatal("Failed to generate SQM ID:", err)
} else {
newConfig.TelemetrySqmId = sqmID
}
display.StopProgress()
fmt.Println()
return newConfig
}
func saveConfiguration(display *ui.Display, configManager *config.Manager, newConfig *config.StorageConfig) error {
display.ShowProgress("Saving configuration...")
if err := configManager.SaveConfig(newConfig, *setReadOnly); err != nil {
log.Error(err)
waitExit()
return err
}
display.StopProgress()
fmt.Println()
return nil
}
func showCompletionMessages(display *ui.Display) {
display.ShowSuccess(lang.GetText().SuccessMessage, lang.GetText().RestartMessage)
fmt.Println()
message := "Operation completed!"
if lang.GetCurrentLanguage() == lang.CN {
message = "操作完成!"
}
display.ShowInfo(message)
}
func waitExit() {
fmt.Print(lang.GetText().PressEnterToExit)
os.Stdout.Sync()
bufio.NewReader(os.Stdin).ReadString('\n')
}
func checkAdminPrivileges() (bool, error) {
switch runtime.GOOS {
case "windows":
cmd := exec.Command("net", "session")
return cmd.Run() == nil, nil
case "darwin", "linux":
currentUser, err := user.Current()
if err != nil {
return false, fmt.Errorf("failed to get current user: %w", err)
}
return currentUser.Uid == "0", nil
default:
return false, fmt.Errorf("unsupported operating system: %s", runtime.GOOS)
}
}
func selfElevate() error {
os.Setenv("AUTOMATED_MODE", "1")
switch runtime.GOOS {
case "windows":
verb := "runas"
exe, _ := os.Executable()
cwd, _ := os.Getwd()
args := strings.Join(os.Args[1:], " ")
cmd := exec.Command("cmd", "/C", "start", verb, exe, args)
cmd.Dir = cwd
return cmd.Run()
case "darwin", "linux":
exe, err := os.Executable()
if err != nil {
return err
}
cmd := exec.Command("sudo", append([]string{exe}, os.Args[1:]...)...)
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
return cmd.Run()
default:
return fmt.Errorf("unsupported operating system: %s", runtime.GOOS)
}
}

16
go.mod
View File

@ -1,3 +1,15 @@
module go-cursor-help
module github.com/yuaotian/go-cursor-help
go 1.22.0
go 1.21
require (
github.com/fatih/color v1.15.0
github.com/sirupsen/logrus v1.9.3
)
require (
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/stretchr/testify v1.10.0 // indirect
golang.org/x/sys v0.13.0 // indirect
)

26
go.sum Normal file
View File

@ -0,0 +1,26 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

BIN
img/alipay.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
img/alipay_scan_pay.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 KiB

BIN
img/etc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
img/pwsh_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

BIN
img/pwsh_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
img/qun-16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

BIN
img/run_success.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

BIN
img/wx_group7.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

BIN
img/wx_me.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 KiB

BIN
img/wx_public.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
img/wx_public_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
img/wx_zsm.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
img/wx_zsm2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

BIN
img/zanzhu/twillot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

153
internal/config/config.go Normal file
View File

@ -0,0 +1,153 @@
package config
import (
"encoding/json"
"fmt"
"os"
"path/filepath"
"runtime"
"sync"
"time"
)
// StorageConfig represents the storage configuration
type StorageConfig struct {
TelemetryMacMachineId string `json:"telemetry.macMachineId"`
TelemetryMachineId string `json:"telemetry.machineId"`
TelemetryDevDeviceId string `json:"telemetry.devDeviceId"`
TelemetrySqmId string `json:"telemetry.sqmId"`
LastModified string `json:"lastModified"`
Version string `json:"version"`
}
// Manager handles configuration operations
type Manager struct {
configPath string
mu sync.RWMutex
}
// NewManager creates a new configuration manager
func NewManager(username string) (*Manager, error) {
configPath, err := getConfigPath(username)
if err != nil {
return nil, fmt.Errorf("failed to get config path: %w", err)
}
return &Manager{configPath: configPath}, nil
}
// ReadConfig reads the existing configuration
func (m *Manager) ReadConfig() (*StorageConfig, error) {
m.mu.RLock()
defer m.mu.RUnlock()
data, err := os.ReadFile(m.configPath)
if err != nil {
if os.IsNotExist(err) {
return nil, nil
}
return nil, fmt.Errorf("failed to read config file: %w", err)
}
var config StorageConfig
if err := json.Unmarshal(data, &config); err != nil {
return nil, fmt.Errorf("failed to parse config file: %w", err)
}
return &config, nil
}
// SaveConfig saves the configuration
func (m *Manager) SaveConfig(config *StorageConfig, readOnly bool) error {
m.mu.Lock()
defer m.mu.Unlock()
// Ensure parent directories exist
if err := os.MkdirAll(filepath.Dir(m.configPath), 0755); err != nil {
return fmt.Errorf("failed to create config directory: %w", err)
}
// Prepare updated configuration
updatedConfig := m.prepareUpdatedConfig(config)
// Write configuration
if err := m.writeConfigFile(updatedConfig, readOnly); err != nil {
return err
}
return nil
}
// prepareUpdatedConfig merges existing config with updates
func (m *Manager) prepareUpdatedConfig(config *StorageConfig) map[string]interface{} {
// Read existing config
originalFile := make(map[string]interface{})
if data, err := os.ReadFile(m.configPath); err == nil {
json.Unmarshal(data, &originalFile)
}
// Update fields
originalFile["telemetry.sqmId"] = config.TelemetrySqmId
originalFile["telemetry.macMachineId"] = config.TelemetryMacMachineId
originalFile["telemetry.machineId"] = config.TelemetryMachineId
originalFile["telemetry.devDeviceId"] = config.TelemetryDevDeviceId
originalFile["lastModified"] = time.Now().UTC().Format(time.RFC3339)
// originalFile["version"] = "1.0.1"
return originalFile
}
// writeConfigFile handles the atomic write of the config file
func (m *Manager) writeConfigFile(config map[string]interface{}, readOnly bool) error {
// Marshal with indentation
content, err := json.MarshalIndent(config, "", " ")
if err != nil {
return fmt.Errorf("failed to marshal config: %w", err)
}
// Write to temporary file
tmpPath := m.configPath + ".tmp"
if err := os.WriteFile(tmpPath, content, 0666); err != nil {
return fmt.Errorf("failed to write temporary file: %w", err)
}
// Set final permissions
fileMode := os.FileMode(0666)
if readOnly {
fileMode = 0444
}
if err := os.Chmod(tmpPath, fileMode); err != nil {
os.Remove(tmpPath)
return fmt.Errorf("failed to set temporary file permissions: %w", err)
}
// Atomic rename
if err := os.Rename(tmpPath, m.configPath); err != nil {
os.Remove(tmpPath)
return fmt.Errorf("failed to rename file: %w", err)
}
// Sync directory
if dir, err := os.Open(filepath.Dir(m.configPath)); err == nil {
defer dir.Close()
dir.Sync()
}
return nil
}
// getConfigPath returns the path to the configuration file
func getConfigPath(username string) (string, error) {
var configDir string
switch runtime.GOOS {
case "windows":
configDir = filepath.Join(os.Getenv("APPDATA"), "Cursor", "User", "globalStorage")
case "darwin":
configDir = filepath.Join("/Users", username, "Library", "Application Support", "Cursor", "User", "globalStorage")
case "linux":
configDir = filepath.Join("/home", username, ".config", "Cursor", "User", "globalStorage")
default:
return "", fmt.Errorf("unsupported operating system: %s", runtime.GOOS)
}
return filepath.Join(configDir, "storage.json"), nil
}

187
internal/lang/lang.go Normal file
View File

@ -0,0 +1,187 @@
package lang
import (
"os"
"os/exec"
"strings"
"sync"
)
// Language represents a supported language code
type Language string
const (
// CN represents Chinese language
CN Language = "cn"
// EN represents English language
EN Language = "en"
)
// TextResource contains all translatable text resources
type TextResource struct {
// Success messages
SuccessMessage string
RestartMessage string
// Progress messages
ReadingConfig string
GeneratingIds string
CheckingProcesses string
ClosingProcesses string
ProcessesClosed string
PleaseWait string
// Error messages
ErrorPrefix string
PrivilegeError string
// Instructions
RunAsAdmin string
RunWithSudo string
SudoExample string
PressEnterToExit string
SetReadOnlyMessage string
// Info messages
ConfigLocation string
}
var (
currentLanguage Language
currentLanguageOnce sync.Once
languageMutex sync.RWMutex
)
// GetCurrentLanguage returns the current language, detecting it if not already set
func GetCurrentLanguage() Language {
currentLanguageOnce.Do(func() {
currentLanguage = detectLanguage()
})
languageMutex.RLock()
defer languageMutex.RUnlock()
return currentLanguage
}
// SetLanguage sets the current language
func SetLanguage(lang Language) {
languageMutex.Lock()
defer languageMutex.Unlock()
currentLanguage = lang
}
// GetText returns the TextResource for the current language
func GetText() TextResource {
return texts[GetCurrentLanguage()]
}
// detectLanguage detects the system language
func detectLanguage() Language {
// Check environment variables first
if isChineseEnvVar() {
return CN
}
// Then check OS-specific locale
if isWindows() {
if isWindowsChineseLocale() {
return CN
}
} else if isUnixChineseLocale() {
return CN
}
return EN
}
func isChineseEnvVar() bool {
for _, envVar := range []string{"LANG", "LANGUAGE", "LC_ALL"} {
if lang := os.Getenv(envVar); lang != "" && strings.Contains(strings.ToLower(lang), "zh") {
return true
}
}
return false
}
func isWindows() bool {
return os.Getenv("OS") == "Windows_NT"
}
func isWindowsChineseLocale() bool {
// Check Windows UI culture
cmd := exec.Command("powershell", "-Command",
"[System.Globalization.CultureInfo]::CurrentUICulture.Name")
output, err := cmd.Output()
if err == nil && strings.HasPrefix(strings.ToLower(strings.TrimSpace(string(output))), "zh") {
return true
}
// Check Windows locale
cmd = exec.Command("wmic", "os", "get", "locale")
output, err = cmd.Output()
return err == nil && strings.Contains(string(output), "2052")
}
func isUnixChineseLocale() bool {
cmd := exec.Command("locale")
output, err := cmd.Output()
return err == nil && strings.Contains(strings.ToLower(string(output)), "zh_cn")
}
// texts contains all translations
var texts = map[Language]TextResource{
CN: {
// Success messages
SuccessMessage: "[√] 配置文件已成功更新!",
RestartMessage: "[!] 请手动重启 Cursor 以使更新生效",
// Progress messages
ReadingConfig: "正在读取配置文件...",
GeneratingIds: "正在生成新的标识符...",
CheckingProcesses: "正在检查运行中的 Cursor 实例...",
ClosingProcesses: "正在关闭 Cursor 实例...",
ProcessesClosed: "所有 Cursor 实例已关闭",
PleaseWait: "请稍候...",
// Error messages
ErrorPrefix: "程序发生严重错误: %v",
PrivilegeError: "\n[!] 错误:需要管理员权限",
// Instructions
RunAsAdmin: "请右键点击程序,选择「以管理员身份运行」",
RunWithSudo: "请使用 sudo 命令运行此程序",
SudoExample: "示例: sudo %s",
PressEnterToExit: "\n按回车键退出程序...",
SetReadOnlyMessage: "设置 storage.json 为只读模式, 这将导致 workspace 记录信息丢失等问题",
// Info messages
ConfigLocation: "配置文件位置:",
},
EN: {
// Success messages
SuccessMessage: "[√] Configuration file updated successfully!",
RestartMessage: "[!] Please restart Cursor manually for changes to take effect",
// Progress messages
ReadingConfig: "Reading configuration file...",
GeneratingIds: "Generating new identifiers...",
CheckingProcesses: "Checking for running Cursor instances...",
ClosingProcesses: "Closing Cursor instances...",
ProcessesClosed: "All Cursor instances have been closed",
PleaseWait: "Please wait...",
// Error messages
ErrorPrefix: "Program encountered a serious error: %v",
PrivilegeError: "\n[!] Error: Administrator privileges required",
// Instructions
RunAsAdmin: "Please right-click and select 'Run as Administrator'",
RunWithSudo: "Please run this program with sudo",
SudoExample: "Example: sudo %s",
PressEnterToExit: "\nPress Enter to exit...",
SetReadOnlyMessage: "Set storage.json to read-only mode, which will cause issues such as lost workspace records",
// Info messages
ConfigLocation: "Config file location:",
},
}

216
internal/process/manager.go Normal file
View File

@ -0,0 +1,216 @@
package process
import (
"fmt"
"os/exec"
"runtime"
"strings"
"time"
"github.com/sirupsen/logrus"
)
// Config holds process manager configuration
type Config struct {
MaxAttempts int // Maximum number of attempts to kill processes
RetryDelay time.Duration // Delay between retry attempts
ProcessPatterns []string // Process names to look for
}
// DefaultConfig returns the default configuration
func DefaultConfig() *Config {
return &Config{
MaxAttempts: 3,
RetryDelay: 2 * time.Second,
ProcessPatterns: []string{
"Cursor.exe", // Windows executable
"Cursor ", // Linux/macOS executable with space
"cursor ", // Linux/macOS executable lowercase with space
"cursor", // Linux/macOS executable lowercase
"Cursor", // Linux/macOS executable
"*cursor*", // Any process containing cursor
"*Cursor*", // Any process containing Cursor
},
}
}
// Manager handles process-related operations
type Manager struct {
config *Config
log *logrus.Logger
}
// NewManager creates a new process manager with optional config and logger
func NewManager(config *Config, log *logrus.Logger) *Manager {
if config == nil {
config = DefaultConfig()
}
if log == nil {
log = logrus.New()
}
return &Manager{
config: config,
log: log,
}
}
// IsCursorRunning checks if any Cursor process is currently running
func (m *Manager) IsCursorRunning() bool {
processes, err := m.getCursorProcesses()
if err != nil {
m.log.Warn("Failed to get Cursor processes:", err)
return false
}
return len(processes) > 0
}
// KillCursorProcesses attempts to kill all running Cursor processes
func (m *Manager) KillCursorProcesses() error {
for attempt := 1; attempt <= m.config.MaxAttempts; attempt++ {
processes, err := m.getCursorProcesses()
if err != nil {
return fmt.Errorf("failed to get processes: %w", err)
}
if len(processes) == 0 {
return nil
}
// Try graceful shutdown first on Windows
if runtime.GOOS == "windows" {
for _, pid := range processes {
exec.Command("taskkill", "/PID", pid).Run()
time.Sleep(500 * time.Millisecond)
}
}
// Force kill remaining processes
remainingProcesses, _ := m.getCursorProcesses()
for _, pid := range remainingProcesses {
m.killProcess(pid)
}
time.Sleep(m.config.RetryDelay)
if processes, _ := m.getCursorProcesses(); len(processes) == 0 {
return nil
}
}
return nil
}
// getCursorProcesses returns PIDs of running Cursor processes
func (m *Manager) getCursorProcesses() ([]string, error) {
cmd := m.getProcessListCommand()
if cmd == nil {
return nil, fmt.Errorf("unsupported operating system: %s", runtime.GOOS)
}
output, err := cmd.Output()
if err != nil {
return nil, fmt.Errorf("failed to execute command: %w", err)
}
return m.parseProcessList(string(output)), nil
}
// getProcessListCommand returns the appropriate command to list processes based on OS
func (m *Manager) getProcessListCommand() *exec.Cmd {
switch runtime.GOOS {
case "windows":
return exec.Command("tasklist", "/FO", "CSV", "/NH")
case "darwin":
return exec.Command("ps", "-ax")
case "linux":
return exec.Command("ps", "-A")
default:
return nil
}
}
// parseProcessList extracts Cursor process PIDs from process list output
func (m *Manager) parseProcessList(output string) []string {
var processes []string
for _, line := range strings.Split(output, "\n") {
lowerLine := strings.ToLower(line)
if m.isOwnProcess(lowerLine) {
continue
}
if pid := m.findCursorProcess(line, lowerLine); pid != "" {
processes = append(processes, pid)
}
}
return processes
}
// isOwnProcess checks if the process belongs to this application
func (m *Manager) isOwnProcess(line string) bool {
return strings.Contains(line, "cursor-id-modifier") ||
strings.Contains(line, "cursor-helper")
}
// findCursorProcess checks if a process line matches Cursor patterns and returns its PID
func (m *Manager) findCursorProcess(line, lowerLine string) string {
for _, pattern := range m.config.ProcessPatterns {
if m.matchPattern(lowerLine, strings.ToLower(pattern)) {
return m.extractPID(line)
}
}
return ""
}
// matchPattern checks if a line matches a pattern, supporting wildcards
func (m *Manager) matchPattern(line, pattern string) bool {
switch {
case strings.HasPrefix(pattern, "*") && strings.HasSuffix(pattern, "*"):
search := pattern[1 : len(pattern)-1]
return strings.Contains(line, search)
case strings.HasPrefix(pattern, "*"):
return strings.HasSuffix(line, pattern[1:])
case strings.HasSuffix(pattern, "*"):
return strings.HasPrefix(line, pattern[:len(pattern)-1])
default:
return line == pattern
}
}
// extractPID extracts process ID from a process list line based on OS format
func (m *Manager) extractPID(line string) string {
switch runtime.GOOS {
case "windows":
parts := strings.Split(line, ",")
if len(parts) >= 2 {
return strings.Trim(parts[1], "\"")
}
case "darwin", "linux":
parts := strings.Fields(line)
if len(parts) >= 1 {
return parts[0]
}
}
return ""
}
// killProcess forcefully terminates a process by PID
func (m *Manager) killProcess(pid string) error {
cmd := m.getKillCommand(pid)
if cmd == nil {
return fmt.Errorf("unsupported operating system: %s", runtime.GOOS)
}
return cmd.Run()
}
// getKillCommand returns the appropriate command to kill a process based on OS
func (m *Manager) getKillCommand(pid string) *exec.Cmd {
switch runtime.GOOS {
case "windows":
return exec.Command("taskkill", "/F", "/PID", pid)
case "darwin", "linux":
return exec.Command("kill", "-9", pid)
default:
return nil
}
}

94
internal/ui/display.go Normal file
View File

@ -0,0 +1,94 @@
package ui
import (
"fmt"
"os"
"os/exec"
"runtime"
"strings"
"github.com/fatih/color"
)
// Display handles UI operations for terminal output
type Display struct {
spinner *Spinner
}
// NewDisplay creates a new display instance with an optional spinner
func NewDisplay(spinner *Spinner) *Display {
if spinner == nil {
spinner = NewSpinner(nil)
}
return &Display{spinner: spinner}
}
// Terminal Operations
// ClearScreen clears the terminal screen based on OS
func (d *Display) ClearScreen() error {
var cmd *exec.Cmd
switch runtime.GOOS {
case "windows":
cmd = exec.Command("cmd", "/c", "cls")
default:
cmd = exec.Command("clear")
}
cmd.Stdout = os.Stdout
return cmd.Run()
}
// Progress Indicator
// ShowProgress displays a progress message with a spinner
func (d *Display) ShowProgress(message string) {
d.spinner.SetMessage(message)
d.spinner.Start()
}
// StopProgress stops the progress spinner
func (d *Display) StopProgress() {
d.spinner.Stop()
}
// Message Display
// ShowSuccess displays success messages in green
func (d *Display) ShowSuccess(messages ...string) {
green := color.New(color.FgGreen)
for _, msg := range messages {
green.Println(msg)
}
}
// ShowInfo displays an info message in cyan
func (d *Display) ShowInfo(message string) {
cyan := color.New(color.FgCyan)
cyan.Println(message)
}
// ShowError displays an error message in red
func (d *Display) ShowError(message string) {
red := color.New(color.FgRed)
red.Println(message)
}
// ShowPrivilegeError displays privilege error messages with instructions
func (d *Display) ShowPrivilegeError(messages ...string) {
red := color.New(color.FgRed, color.Bold)
yellow := color.New(color.FgYellow)
// Main error message
red.Println(messages[0])
fmt.Println()
// Additional instructions
for _, msg := range messages[1:] {
if strings.Contains(msg, "%s") {
exe, _ := os.Executable()
yellow.Printf(msg+"\n", exe)
} else {
yellow.Println(msg)
}
}
}

20
internal/ui/logo.go Normal file
View File

@ -0,0 +1,20 @@
package ui
import (
"github.com/fatih/color"
)
const cyberpunkLogo = `
`
// ShowLogo displays the application logo
func (d *Display) ShowLogo() {
cyan := color.New(color.FgCyan, color.Bold)
cyan.Println(cyberpunkLogo)
}

122
internal/ui/spinner.go Normal file
View File

@ -0,0 +1,122 @@
package ui
import (
"fmt"
"sync"
"time"
"github.com/fatih/color"
)
// SpinnerConfig defines spinner configuration
type SpinnerConfig struct {
Frames []string // Animation frames for the spinner
Delay time.Duration // Delay between frame updates
}
// DefaultSpinnerConfig returns the default spinner configuration
func DefaultSpinnerConfig() *SpinnerConfig {
return &SpinnerConfig{
Frames: []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"},
Delay: 100 * time.Millisecond,
}
}
// Spinner represents a progress spinner
type Spinner struct {
config *SpinnerConfig
message string
current int
active bool
stopCh chan struct{}
mu sync.RWMutex
}
// NewSpinner creates a new spinner with the given configuration
func NewSpinner(config *SpinnerConfig) *Spinner {
if config == nil {
config = DefaultSpinnerConfig()
}
return &Spinner{
config: config,
stopCh: make(chan struct{}),
}
}
// State management
// SetMessage sets the spinner message
func (s *Spinner) SetMessage(message string) {
s.mu.Lock()
defer s.mu.Unlock()
s.message = message
}
// IsActive returns whether the spinner is currently active
func (s *Spinner) IsActive() bool {
s.mu.RLock()
defer s.mu.RUnlock()
return s.active
}
// Control methods
// Start begins the spinner animation
func (s *Spinner) Start() {
s.mu.Lock()
if s.active {
s.mu.Unlock()
return
}
s.active = true
s.mu.Unlock()
go s.run()
}
// Stop halts the spinner animation
func (s *Spinner) Stop() {
s.mu.Lock()
defer s.mu.Unlock()
if !s.active {
return
}
s.active = false
close(s.stopCh)
s.stopCh = make(chan struct{})
fmt.Print("\r") // Clear the spinner line
}
// Internal methods
func (s *Spinner) run() {
ticker := time.NewTicker(s.config.Delay)
defer ticker.Stop()
cyan := color.New(color.FgCyan, color.Bold)
message := s.message
// Print initial state
fmt.Printf("\r %s %s", cyan.Sprint(s.config.Frames[0]), message)
for {
select {
case <-s.stopCh:
return
case <-ticker.C:
s.mu.RLock()
if !s.active {
s.mu.RUnlock()
return
}
frame := s.config.Frames[s.current%len(s.config.Frames)]
s.current++
s.mu.RUnlock()
fmt.Printf("\r %s", cyan.Sprint(frame))
fmt.Printf("\033[%dG%s", 4, message) // Move cursor and print message
}
}
}

172
main.go
View File

@ -1,172 +0,0 @@
package main
import (
"crypto/rand"
"crypto/sha256"
"encoding/hex"
"encoding/json"
"fmt"
"os"
"path/filepath"
"runtime"
)
// StorageConfig 存储配置结构体
type StorageConfig struct {
TelemetryMacMachineId string `json:"telemetry.macMachineId"`
TelemetryMachineId string `json:"telemetry.machineId"`
TelemetryDevDeviceId string `json:"telemetry.devDeviceId"`
}
// 生成类似原始machineId的字符串 (64位小写hex)
func generateMachineId() string {
// 生成一些随机数据
data := make([]byte, 32)
rand.Read(data)
// 使用SHA256生成hash
hash := sha256.New()
hash.Write(data)
// 转换为小写的hex字符串
return hex.EncodeToString(hash.Sum(nil))
}
// 生成类似原始macMachineId的字符串 (64位小写hex)
func generateMacMachineId() string {
return generateMachineId() // 使用相同的格式
}
// 生成类似原始devDeviceId的字符串 (标准UUID格式)
func generateDevDeviceId() string {
// 生成 UUID v4
uuid := make([]byte, 16)
rand.Read(uuid)
// 设置版本 (4) 和变体位
uuid[6] = (uuid[6] & 0x0f) | 0x40 // 版本 4
uuid[8] = (uuid[8] & 0x3f) | 0x80 // RFC 4122 变体
// 格式化为标准 UUID 字符串
return fmt.Sprintf("%x-%x-%x-%x-%x",
uuid[0:4],
uuid[4:6],
uuid[6:8],
uuid[8:10],
uuid[10:16])
}
// 获取配置文件路径
func getConfigPath() (string, error) {
var configDir string
switch runtime.GOOS {
case "darwin":
homeDir, err := os.UserHomeDir()
if err != nil {
return "", err
}
configDir = filepath.Join(homeDir, "Library", "Application Support", "Cursor", "User", "globalStorage")
case "windows":
appData := os.Getenv("APPDATA")
configDir = filepath.Join(appData, "Cursor", "User", "globalStorage")
case "linux":
homeDir, err := os.UserHomeDir()
if err != nil {
return "", err
}
configDir = filepath.Join(homeDir, ".config", "Cursor", "User", "globalStorage")
default:
return "", fmt.Errorf("不支持的操作系统: %s", runtime.GOOS)
}
return filepath.Join(configDir, "storage.json"), nil
}
// 修改文件权限
func setFilePermissions(filePath string) error {
if runtime.GOOS == "windows" {
// Windows 使用 ACL 权限系统,这里仅设置为只读
return os.Chmod(filePath, 0444)
} else {
// Linux 和 macOS
return os.Chmod(filePath, 0444)
}
}
// 获取Cursor可执行文件路径
func getCursorExePath() (string, error) {
switch runtime.GOOS {
case "windows":
// Windows下通常在LocalAppData目录
localAppData := os.Getenv("LOCALAPPDATA")
return filepath.Join(localAppData, "Programs", "Cursor", "Cursor.exe"), nil
case "darwin":
// macOS下通常在Applications目录
return "/Applications/Cursor.app/Contents/MacOS/Cursor", nil
case "linux":
// Linux下可能在usr/bin目录
return "/usr/bin/cursor", nil
default:
return "", fmt.Errorf("不支持的操作系统: %s", runtime.GOOS)
}
}
func main() {
// 获取配置文件路径
configPath, err := getConfigPath()
if err != nil {
fmt.Printf("获取配置文件路径失败: %v\n", err)
return
}
// 读取原始文件内容
content, err := os.ReadFile(configPath)
if err != nil {
fmt.Printf("读取配置文件失败: %v\n", err)
return
}
// 解析 JSON
var config map[string]interface{}
if err := json.Unmarshal(content, &config); err != nil {
fmt.Printf("解析 JSON 失败: %v\n", err)
return
}
// 修改指定字段,使用更准确的生成方法
config["telemetry.macMachineId"] = generateMacMachineId()
config["telemetry.machineId"] = generateMachineId()
config["telemetry.devDeviceId"] = generateDevDeviceId()
// 转换回 JSON保持原有的格式
newContent, err := json.MarshalIndent(config, "", " ")
if err != nil {
fmt.Printf("生成 JSON 失败: %v\n", err)
return
}
// 先确保文件可写
err = os.Chmod(configPath, 0666)
if err != nil {
fmt.Printf("修改文件权限失败: %v\n", err)
return
}
// 写入文件
err = os.WriteFile(configPath, newContent, 0666)
if err != nil {
fmt.Printf("写入文件失败: %v\n", err)
return
}
// 设置文件为只读
err = setFilePermissions(configPath)
if err != nil {
fmt.Printf("设置文件只读权限失败: %v\n", err)
return
}
fmt.Println("配置文件已成功更新请手动重启Cursor以使更改生效。")
}

116
pkg/idgen/generator.go Normal file
View File

@ -0,0 +1,116 @@
package idgen
import (
"crypto/rand"
"encoding/hex"
"fmt"
"sync"
)
// Generator handles secure ID generation for machines and devices
type Generator struct {
bufferPool sync.Pool
}
// NewGenerator creates a new ID generator
func NewGenerator() *Generator {
return &Generator{
bufferPool: sync.Pool{
New: func() interface{} {
return make([]byte, 64)
},
},
}
}
// Constants for ID generation
const (
machineIDPrefix = "auth0|user_"
uuidFormat = "%s-%s-%s-%s-%s"
)
// 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 {
return "", fmt.Errorf("failed to generate random bytes: %w", err)
}
return hex.EncodeToString(buffer[:length]), 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
}
return fmt.Sprintf("%x%s", []byte(machineIDPrefix), randomPart), nil
}
// GenerateMacMachineID generates a new 64-byte MAC machine ID
func (g *Generator) GenerateMacMachineID() (string, error) {
return g.generateRandomHex(32) // 生成64字符的十六进制
}
// GenerateDeviceID generates a new device ID in UUID format
func (g *Generator) GenerateDeviceID() (string, error) {
id, err := g.generateRandomHex(16)
if err != nil {
return "", err
}
return fmt.Sprintf(uuidFormat,
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
}

375
process_cursor_links.py Normal file
View File

@ -0,0 +1,375 @@
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,28 +1,74 @@
@echo off
echo Creating bin directory...
if not exist "..\bin" mkdir "..\bin"
setlocal EnableDelayedExpansion
echo Building for all platforms...
:: Build optimization flags
set "OPTIMIZATION_FLAGS=-trimpath -ldflags=\"-s -w\""
set "BUILD_JOBS=4"
echo Building for Windows AMD64...
set GOOS=windows
set GOARCH=amd64
go build -o ../bin/cursor_id_modifier.exe ../main.go
:: Messages / 消息
set "EN_MESSAGES[0]=Starting build process for version"
set "EN_MESSAGES[1]=Using optimization flags:"
set "EN_MESSAGES[2]=Cleaning old builds..."
set "EN_MESSAGES[3]=Cleanup completed"
set "EN_MESSAGES[4]=Starting builds for all platforms..."
set "EN_MESSAGES[5]=Building for"
set "EN_MESSAGES[6]=Build successful:"
set "EN_MESSAGES[7]=All builds completed!"
echo Building for macOS AMD64...
set GOOS=darwin
set GOARCH=amd64
go build -o ../bin/cursor_id_modifier_mac ../main.go
:: Colors
set "GREEN=[32m"
set "RED=[31m"
set "RESET=[0m"
echo Building for macOS ARM64...
set GOOS=darwin
set GOARCH=arm64
go build -o ../bin/cursor_id_modifier_mac_arm64 ../main.go
:: Cleanup function
:cleanup
if exist "..\bin" (
rd /s /q "..\bin"
echo %GREEN%!EN_MESSAGES[3]!%RESET%
)
mkdir "..\bin" 2>nul
echo Building for Linux AMD64...
set GOOS=linux
set GOARCH=amd64
go build -o ../bin/cursor_id_modifier_linux ../main.go
:: Build function with optimizations
:build
set "os=%~1"
set "arch=%~2"
set "ext="
if "%os%"=="windows" set "ext=.exe"
echo All builds completed!
pause
echo %GREEN%!EN_MESSAGES[5]! %os%/%arch%%RESET%
set "CGO_ENABLED=0"
set "GOOS=%os%"
set "GOARCH=%arch%"
start /b cmd /c "go build -trimpath -ldflags=\"-s -w\" -o ..\bin\%os%\%arch%\cursor-id-modifier%ext% -a -installsuffix cgo -mod=readonly ..\cmd\cursor-id-modifier"
exit /b 0
:: Main execution
echo %GREEN%!EN_MESSAGES[0]!%RESET%
echo %GREEN%!EN_MESSAGES[1]! %OPTIMIZATION_FLAGS%%RESET%
call :cleanup
echo %GREEN%!EN_MESSAGES[4]!%RESET%
:: Start builds in parallel
set "pending=0"
for %%o in (windows linux darwin) do (
for %%a in (amd64 386) do (
call :build %%o %%a
set /a "pending+=1"
if !pending! geq %BUILD_JOBS% (
timeout /t 1 /nobreak >nul
set "pending=0"
)
)
)
:: Wait for all builds to complete
:wait_builds
timeout /t 2 /nobreak >nul
tasklist /fi "IMAGENAME eq go.exe" 2>nul | find "go.exe" >nul
if not errorlevel 1 goto wait_builds
echo %GREEN%!EN_MESSAGES[7]!%RESET%

151
scripts/build_all.sh Normal file → Executable file
View File

@ -1,22 +1,143 @@
#!/bin/bash
# 创建bin目录如果不存在
mkdir -p ../bin
# 设置颜色代码 / Set color codes
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m' # No Color / 无颜色
# Windows
echo "Building for Windows..."
GOOS=windows GOARCH=amd64 go build -o ../bin/cursor_id_modifier.exe ../main.go
# Build optimization flags
OPTIMIZATION_FLAGS="-trimpath -ldflags=\"-s -w\""
PARALLEL_JOBS=$(nproc || echo "4") # Get number of CPU cores or default to 4
# macOS (Intel)
echo "Building for macOS (Intel)..."
GOOS=darwin GOARCH=amd64 go build -o ../bin/cursor_id_modifier_mac ../main.go
# Messages / 消息
EN_MESSAGES=(
"Starting build process for version"
"Cleaning old builds..."
"Creating bin directory..."
"Failed to create bin directory"
"Building for"
"Successfully built:"
"Failed to build for"
"Build Summary:"
"Successful builds:"
"Failed builds:"
"Generated files:"
)
# macOS (Apple Silicon)
echo "Building for macOS (ARM64)..."
GOOS=darwin GOARCH=arm64 go build -o ../bin/cursor_id_modifier_mac_arm64 ../main.go
CN_MESSAGES=(
"开始构建版本"
"正在清理旧的构建文件..."
"正在创建bin目录..."
"创建bin目录失败"
"正在构建"
"构建成功:"
"构建失败:"
"构建摘要:"
"成功构建数:"
"失败构建数:"
"生成的文件:"
"构建过程被中断"
"错误:"
)
# Linux
echo "Building for Linux..."
GOOS=linux GOARCH=amd64 go build -o ../bin/cursor_id_modifier_linux ../main.go
# 版本信息 / Version info
VERSION="1.0.0"
echo "All builds completed!"
# Detect system language / 检测系统语言
detect_language() {
if [[ $(locale | grep "LANG=zh_CN") ]]; then
echo "cn"
else
echo "en"
fi
}
# Get message based on language / 根据语言获取消息
get_message() {
local index=$1
local lang=$(detect_language)
if [[ "$lang" == "cn" ]]; then
echo "${CN_MESSAGES[$index]}"
else
echo "${EN_MESSAGES[$index]}"
fi
}
# 错误处理函数 / Error handling function
handle_error() {
echo -e "${RED}$(get_message 12) $1${NC}"
exit 1
}
# 清理函数 / Cleanup function
cleanup() {
if [ -d "../bin" ]; then
rm -rf ../bin
echo -e "${GREEN}$(get_message 1)${NC}"
fi
}
# Build function with optimizations
build() {
local os=$1
local arch=$2
local ext=""
[ "$os" = "windows" ] && ext=".exe"
echo -e "${GREEN}$(get_message 4) $os/$arch${NC}"
GOOS=$os GOARCH=$arch CGO_ENABLED=0 go build \
-trimpath \
-ldflags="-s -w" \
-o "../bin/$os/$arch/cursor-id-modifier$ext" \
-a -installsuffix cgo \
-mod=readonly \
../cmd/cursor-id-modifier &
}
# Parallel build execution
build_all() {
local builds=0
local max_parallel=$PARALLEL_JOBS
# Define build targets
declare -A targets=(
["linux/amd64"]=1
["linux/386"]=1
["linux/arm64"]=1
["windows/amd64"]=1
["windows/386"]=1
["darwin/amd64"]=1
["darwin/arm64"]=1
)
for target in "${!targets[@]}"; do
IFS='/' read -r os arch <<< "$target"
build "$os" "$arch"
((builds++))
if ((builds >= max_parallel)); then
wait
builds=0
fi
done
# Wait for remaining builds
wait
}
# Main execution
main() {
cleanup
mkdir -p ../bin || { echo -e "${RED}$(get_message 3)${NC}"; exit 1; }
build_all
echo -e "${GREEN}Build completed successfully${NC}"
}
# 捕获错误信号 / Catch error signals
trap 'echo -e "\n${RED}$(get_message 11)${NC}"; exit 1' INT TERM
# 执行主函数 / Execute main function
main

View File

@ -1,6 +0,0 @@
#!/bin/bash
echo "Building for Linux..."
export GOOS=linux
export GOARCH=amd64
go build -o ../bin/cursor_id_modifier_linux ../main.go
echo "Build complete: ../bin/cursor_id_modifier_linux"

View File

@ -1,13 +0,0 @@
#!/bin/bash
echo "Building for macOS..."
export GOOS=darwin
export GOARCH=amd64
go build -o ../bin/cursor_id_modifier_mac ../main.go
echo "Build complete: ../bin/cursor_id_modifier_mac"
# Build for Apple Silicon
echo "Building for macOS ARM64..."
export GOOS=darwin
export GOARCH=arm64
go build -o ../bin/cursor_id_modifier_mac_arm64 ../main.go
echo "Build complete: ../bin/cursor_id_modifier_mac_arm64"

View File

@ -1,6 +0,0 @@
@echo off
echo Building for Windows...
set GOOS=windows
set GOARCH=amd64
go build -o ../bin/cursor_id_modifier.exe ../main.go
echo Build complete: ../bin/cursor_id_modifier.exe

View File

@ -0,0 +1,318 @@
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

9
scripts/git-actions.sh Executable file
View File

@ -0,0 +1,9 @@
#!/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

193
scripts/install.ps1 Normal file
View File

@ -0,0 +1,193 @@
# Check for admin rights and handle elevation
$isAdmin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
if (-NOT $isAdmin) {
# Detect PowerShell version and path
$pwshPath = if (Get-Command "pwsh" -ErrorAction SilentlyContinue) {
(Get-Command "pwsh").Source # PowerShell 7+
} elseif (Test-Path "$env:ProgramFiles\PowerShell\7\pwsh.exe") {
"$env:ProgramFiles\PowerShell\7\pwsh.exe"
} else {
"powershell.exe" # Windows PowerShell
}
try {
Write-Host "`nRequesting administrator privileges..." -ForegroundColor Cyan
$scriptPath = $MyInvocation.MyCommand.Path
$argList = "-NoProfile -ExecutionPolicy Bypass -File `"$scriptPath`""
Start-Process -FilePath $pwshPath -Verb RunAs -ArgumentList $argList -Wait
exit
}
catch {
Write-Host "`nError: Administrator privileges required" -ForegroundColor Red
Write-Host "Please run this script from an Administrator PowerShell window" -ForegroundColor Yellow
Write-Host "`nTo do this:" -ForegroundColor Cyan
Write-Host "1. Press Win + X" -ForegroundColor White
Write-Host "2. Click 'Windows Terminal (Admin)' or 'PowerShell (Admin)'" -ForegroundColor White
Write-Host "3. Run the installation command again" -ForegroundColor White
Write-Host "`nPress enter to exit..."
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
exit 1
}
}
# Set TLS to 1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# Create temporary directory
$TmpDir = Join-Path $env:TEMP ([System.Guid]::NewGuid().ToString())
New-Item -ItemType Directory -Path $TmpDir | Out-Null
# Cleanup function
function Cleanup {
if (Test-Path $TmpDir) {
Remove-Item -Recurse -Force $TmpDir
}
}
# Error handler
trap {
Write-Host "Error: $_" -ForegroundColor Red
Cleanup
Write-Host "Press enter to exit..."
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
exit 1
}
# Detect system architecture
function Get-SystemArch {
if ([Environment]::Is64BitOperatingSystem) {
return "x86_64"
} else {
return "i386"
}
}
# Download with progress
function Get-FileWithProgress {
param (
[string]$Url,
[string]$OutputFile
)
try {
$webClient = New-Object System.Net.WebClient
$webClient.Headers.Add("User-Agent", "PowerShell Script")
$webClient.DownloadFile($Url, $OutputFile)
return $true
}
catch {
Write-Host "Failed to download: $_" -ForegroundColor Red
return $false
}
}
# Main installation function
function Install-CursorModifier {
Write-Host "Starting installation..." -ForegroundColor Cyan
# Detect architecture
$arch = Get-SystemArch
Write-Host "Detected architecture: $arch" -ForegroundColor Green
# Set installation directory
$InstallDir = "$env:ProgramFiles\CursorModifier"
if (!(Test-Path $InstallDir)) {
New-Item -ItemType Directory -Path $InstallDir | Out-Null
}
# Get latest release
try {
$latestRelease = Invoke-RestMethod -Uri "https://api.github.com/repos/yuaotian/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"
)
$asset = $null
foreach ($name in $possibleNames) {
Write-Host "Checking for asset: $name" -ForegroundColor Cyan
$asset = $latestRelease.assets | Where-Object { $_.name -eq $name }
if ($asset) {
Write-Host "Found matching asset: $($asset.name)" -ForegroundColor Green
break
}
}
if (!$asset) {
Write-Host "`nAvailable assets:" -ForegroundColor Yellow
$latestRelease.assets | ForEach-Object { Write-Host "- $($_.name)" }
throw "Could not find appropriate Windows binary for $arch architecture"
}
$downloadUrl = $asset.browser_download_url
}
catch {
Write-Host "Failed to get latest release: $_" -ForegroundColor Red
exit 1
}
# Download binary
Write-Host "`nDownloading latest release..." -ForegroundColor Cyan
$binaryPath = Join-Path $TmpDir "cursor-id-modifier.exe"
if (!(Get-FileWithProgress -Url $downloadUrl -OutputFile $binaryPath)) {
exit 1
}
# Install binary
Write-Host "Installing..." -ForegroundColor Cyan
try {
Copy-Item -Path $binaryPath -Destination "$InstallDir\cursor-id-modifier.exe" -Force
# Add to PATH if not already present
$currentPath = [Environment]::GetEnvironmentVariable("Path", "Machine")
if ($currentPath -notlike "*$InstallDir*") {
[Environment]::SetEnvironmentVariable("Path", "$currentPath;$InstallDir", "Machine")
}
}
catch {
Write-Host "Failed to install: $_" -ForegroundColor Red
exit 1
}
Write-Host "Installation completed successfully!" -ForegroundColor Green
Write-Host "Running cursor-id-modifier..." -ForegroundColor Cyan
# Run the program
try {
& "$InstallDir\cursor-id-modifier.exe"
if ($LASTEXITCODE -ne 0) {
Write-Host "Failed to run cursor-id-modifier" -ForegroundColor Red
exit 1
}
}
catch {
Write-Host "Failed to run cursor-id-modifier: $_" -ForegroundColor Red
exit 1
}
}
# Run installation
try {
Install-CursorModifier
}
catch {
Write-Host "Installation failed: $_" -ForegroundColor Red
Cleanup
Write-Host "Press enter to exit..."
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
exit 1
}
finally {
Cleanup
if ($LASTEXITCODE -ne 0) {
Write-Host "Press enter to exit..." -ForegroundColor Green
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
}
}

127
scripts/install.sh Executable file
View File

@ -0,0 +1,127 @@
#!/bin/bash
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;36m'
YELLOW='\033[0;33m'
NC='\033[0m'
# Temporary directory for downloads
TMP_DIR=$(mktemp -d)
trap 'rm -rf "$TMP_DIR"' EXIT
# Check for required commands
check_requirements() {
if ! command -v curl >/dev/null 2>&1; then
echo -e "${RED}Error: curl is required${NC}"
exit 1
fi
}
# Detect system information
detect_system() {
local os arch suffix
case "$(uname -s)" in
Linux*) os="linux";;
Darwin*) os="darwin";;
*) echo -e "${RED}Unsupported OS${NC}"; exit 1;;
esac
case "$(uname -m)" in
x86_64)
arch="x86_64"
;;
aarch64|arm64)
arch="arm64"
;;
i386|i686)
arch="i386"
;;
*) echo -e "${RED}Unsupported architecture${NC}"; exit 1;;
esac
echo "$os $arch"
}
# Download with progress
download() {
local url="$1"
local output="$2"
curl -#L "$url" -o "$output"
}
# Check and create installation directory
setup_install_dir() {
local install_dir="$1"
if [ ! -d "$install_dir" ]; then
mkdir -p "$install_dir" || {
echo -e "${RED}Failed to create installation directory${NC}"
exit 1
}
fi
}
# Main installation function
main() {
check_requirements
echo -e "${BLUE}Starting installation...${NC}"
# Detect system
read -r OS ARCH SUFFIX <<< "$(detect_system)"
echo -e "${GREEN}Detected: $OS $ARCH${NC}"
# Set installation directory
INSTALL_DIR="/usr/local/bin"
# Setup installation directory
setup_install_dir "$INSTALL_DIR"
# 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//')
# Construct binary name
BINARY_NAME="cursor-id-modifier_${VERSION}_${OS}_${ARCH}"
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)
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
echo -e "${GREEN}Found matching asset: $BINARY_NAME${NC}"
echo -e "${BLUE}Downloading from: $DOWNLOAD_URL${NC}"
download "$DOWNLOAD_URL" "$TMP_DIR/cursor-id-modifier"
# Install binary
echo -e "${BLUE}Installing...${NC}"
chmod +x "$TMP_DIR/cursor-id-modifier"
sudo mv "$TMP_DIR/cursor-id-modifier" "$INSTALL_DIR/"
echo -e "${GREEN}Installation completed successfully!${NC}"
echo -e "${BLUE}Running cursor-id-modifier...${NC}"
# Run the program with sudo, preserving environment variables
export AUTOMATED_MODE=1
if ! sudo -E cursor-id-modifier; then
echo -e "${RED}Failed to run cursor-id-modifier${NC}"
exit 1
fi
}
main

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

@ -0,0 +1,688 @@
#!/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

@ -0,0 +1,607 @@
# 设置输出编码为 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 "写入配置文件失败: $_"
}
}