This repository was archived by the owner on Oct 14, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import os
22import platform
33import json
4+ import sys
45from colorama import Fore , Style
56
67from exit_cursor import ExitCursor
@@ -393,11 +394,39 @@ def check_cursor_version():
393394 return None
394395
395396
397+ def reset_machine_id (less_than_0_45 ):
398+ if less_than_0_45 :
399+ MachineIDResetter ().reset_machine_ids ()
400+ else :
401+ patch_cursor_get_machine_id .patch_cursor_get_machine_id ()
402+
403+
396404if __name__ == "__main__" :
397405 print_logo ()
398406 browser_manager = None
399407 try :
400408 logging .info ("\n === 初始化程序 ===" )
409+ # 提示用户选择操作模式
410+ print ("\n 请选择操作模式:" )
411+ print ("1. 仅重置机器码" )
412+ print ("2. 完整注册流程" )
413+ while True :
414+ try :
415+ choice = int (input ("请输入选项 (1 或 2): " ).strip ())
416+ if choice in [1 , 2 ]:
417+ break
418+ else :
419+ print ("无效的选项,请重新输入" )
420+ except ValueError :
421+ print ("请输入有效的数字" )
422+
423+ if choice == 1 :
424+ # 仅执行重置机器码
425+ less_than_0_45 = check_cursor_version ()
426+ reset_machine_id (less_than_0_45 )
427+ logging .info ("机器码重置完成" )
428+ sys .exit (0 )
429+
401430 # 小于0.45的版本需要打补丁
402431 less_than_0_45 = check_cursor_version ()
403432 if less_than_0_45 :
@@ -456,11 +485,7 @@ def check_cursor_version():
456485 )
457486
458487 logging .info ("重置机器码..." )
459- # 判断cursor版本是否小于0.45
460- if less_than_0_45 :
461- MachineIDResetter ().reset_machine_ids ()
462- else :
463- patch_cursor_get_machine_id .patch_cursor_get_machine_id ()
488+ reset_machine_id (less_than_0_45 )
464489 logging .info ("所有操作已完成" )
465490 else :
466491 logging .error ("获取会话令牌失败,注册流程未完成" )
You can’t perform that action at this time.
0 commit comments