()
| 78 | } |
| 79 | |
| 80 | fn main() { |
| 81 | // Set output encoding to UTF-8 (Rust strings are UTF-8 by default, console might need setup on Windows) |
| 82 | // On Windows, `chcp 65001` might be needed in the terminal before running for full UTF-8 display. |
| 83 | // The script itself cannot reliably change the parent console's encoding. |
| 84 | |
| 85 | // Check administrator privileges |
| 86 | if !is_elevated() { |
| 87 | println!("{}", "[ERROR] Please run this script as administrator".color(RED)); |
| 88 | println!("Right-click the executable and select 'Run as administrator'"); |
| 89 | press_enter_to_exit(1); |
| 90 | } |
| 91 | |
| 92 | // Display Logo |
| 93 | // Using simple print for now, can be enhanced |
| 94 | Command::new("cmd").args(&["/c", "cls"]).status().unwrap(); // Clear screen on Windows |
| 95 | |
| 96 | println!("{}", r#" |
| 97 | ██████╗██╗ ██╗██████╗ ███████╗ ██████╗ ██████╗ |
| 98 | ██╔════╝██║ ██║██╔══██╗██╔════╝██╔═══██╗██╔══██╗ |
| 99 | ██║ ██║ ██║██████╔╝███████╗██║ ██║██████╔╝ |
| 100 | ██║ ██║ ██║██╔══██╗╚════██║██║ ██║██╔══██╗ |
| 101 | ╚██████╗╚██████╔╝██║ ██║███████║╚██████╔╝██║ ██║ |
| 102 | ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝ |
| 103 | |
| 104 | "#.bright_cyan()); |
| 105 | println!("{}", "================================".color(BLUE)); |
| 106 | println!(" {}", "Cursor Device ID Modifier Tool".color(GREEN)); |
| 107 | println!(" {}", "Cursor ID Reset Tool - Community Edition".color(YELLOW)); |
| 108 | println!(" {}", "Free tool for Cursor device ID management".color(YELLOW)); |
| 109 | println!(" {}", "[IMPORTANT] This is a free community tool".color(YELLOW)); |
| 110 | println!("{}", "================================".color(BLUE)); |
| 111 | println!(" {}", "QQ群: 951642519 (交流/下载纯免费自动账号切换工具)".color(YELLOW)); |
| 112 | println!(""); |
| 113 | |
| 114 | // Get and display Cursor version |
| 115 | let cursor_version = get_cursor_version(); |
| 116 | match &cursor_version { |
| 117 | Some(version) => println!("{} Current Cursor version: v{}", "[INFO]".color(GREEN), version), |
| 118 | None => { |
| 119 | println!("{} Unable to detect Cursor version", "[WARNING]".color(YELLOW)); |
| 120 | println!("{} Please ensure Cursor is properly installed", "[TIP]".color(YELLOW)); |
| 121 | } |
| 122 | } |
| 123 | println!(""); |
| 124 | |
| 125 | println!("{} Latest 0.45.x (supported)", "[IMPORTANT NOTE]".color(YELLOW)); |
| 126 | println!(""); |
| 127 | |
| 128 | // Check and close Cursor processes |
| 129 | println!("{} Checking Cursor processes...", "[INFO]".color(GREEN)); |
| 130 | close_cursor_process("Cursor"); |
| 131 | close_cursor_process("cursor"); |
| 132 | println!(""); |
| 133 | |
| 134 | let storage_file_path = match get_storage_file_path() { |
| 135 | Some(path) => path, |
| 136 | None => { |
| 137 | println!("{}", "[ERROR] Could not determine APPDATA path for storage file.".color(RED)); |
nothing calls this directly
no test coverage detected