Files
cursornew2026/fix_chinese.js

32 lines
887 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 修复中文字符前的反斜杠
*/
const fs = require('fs');
const inputPath = 'D:/temp/破解/cursorpro-0.4.5/deobfuscated_full/extension/out/webview/provider.js';
let code = fs.readFileSync(inputPath, 'utf8');
console.log('修复中文字符...');
// 移除中文字符前的反斜杠
// \无 -> 无
const chinesePattern = /\\([\u4e00-\u9fff\u3000-\u303f\uff00-\uffef""''()【】、])/g;
code = code.replace(chinesePattern, '$1');
fs.writeFileSync(inputPath, code);
// 验证
const babel = require('@babel/core');
try {
babel.parseSync(code, { sourceType: 'script' });
console.log('✅ 语法正确');
} catch (e) {
console.error('❌ 语法错误:', e.message);
}
// 检查是否还有问题
const remaining = (code.match(/\\[\u4e00-\u9fff]/g) || []).length;
console.log('剩余转义中文:', remaining);
console.log('✅ 完成');