const fs = require('fs'); // 读取原版client.js let code = fs.readFileSync('D:/temp/破解/cursorpro-0.4.5/extension/out/api/client.js', 'utf8'); // 找到 getApiUrl 函数并替换 // 原版: function getApiUrl(){...return ...||DEFAULT_API_URL;} // 替换为直接返回我们的API地址 const newApiUrl = 'https://api.aicode.edu.pl'; // 方法1: 替换整个 getApiUrl 函数 // 匹配 function getApiUrl(){...} code = code.replace( /function getApiUrl\(\)\{[^}]+\}/, `function getApiUrl(){return '${newApiUrl}';}` ); // 保存修改后的代码 fs.writeFileSync('D:/temp/破解/cursorpro-0.4.5/extension/out/api/client.js', code); console.log('API地址已替换为:', newApiUrl); console.log('文件已保存');