Реверснутый zcode с своими фишками и плагинами
Реверснутая ade zcode без z ai, с массовой загрузкой ключей, умным апи роутингом, плагином для командной разработки
Реверснутая ade zcode без z ai, с массовой загрузкой ключей, умным апи роутингом, плагином для командной разработки
// Проверка установленного app.asar: ключевые файлы и отсутствие бэкапов.
// Запуск: node tools/verify-asar.mjs <путь к app.asar>
import { pathToFileURL } from 'node:url';
const asar = await import(
pathToFileURL('C:/Users/YOU/AppData/Local/npm-cache/_npx/4b0e2640fe917ac8/node_modules/@electron/asar/lib/asar.js').href
);
const file = process.argv[2];
if (!file) throw new Error('укажите путь к app.asar');
const norm = (x) => x.replace(/\\/g, '/').replace(/^\//, '/');
const files = asar.listPackage(file).map(norm);
const read = (n) => asar.extractFile(file, n.replace(/^\//, '')).toString();
const want = [
/^\/main\/index\.js$/,
/^\/main\/key-pool-main\.js$/,
/^\/preload\/index\.cjs$/,
/^\/renderer\/index\.html$/,
/^\/renderer\/assets\/IntlProvider-[^/]+\.js$/,
/^\/renderer\/assets\/styles-[^/]+\.js$/,
/^\/renderer\/assets\/zteam-panel\.js$/,
/^\/renderer\/assets\/key-pool-ui\.js$/,
/^\/hooks\/notify\.mjs$/,
/^\/hooks\/ensure-settings\.mjs$/,
];
console.log('files:', files.length);
let missing = 0;
for (const re of want) {
const hit = files.filter((n) => re.test(n));
if (!hit.length) missing++;
console.log(hit.length ? 'ok ' : 'MISS', re.source, hit.join(', '));
}
const junk = files.filter((n) => /\.(orig|bak|snap|snap\.old)$|pre-(key-pool|crash|rumenu|histfix)/.test(n));
console.log('backup files:', junk.length, junk.slice(0, 5).join(', '));
const intl = files.find((n) => /\/renderer\/assets\/IntlProvider-[^/]+\.js$/.test(n));
const styles = files.find((n) => /\/renderer\/assets\/styles-[^/]+\.js$/.test(n));
const extract = (name) => {
for (const p of [name.replace(/^\//, ''), name.replace(/^\//, '').replace(/\//g, '\\')]) {
try {
return asar.extractFile(file, p).toString();
} catch {}
}
throw new Error(`не найден в архиве: ${name}`);
};
const html = extract('/renderer/index.html');
const intlSrc = extract(intl);
const stylesSrc = extract(styles);
const checks = {
ruDict: intlSrc.includes('"ru-RU":h'),
ruLabels: intlSrc.includes('locale.ru-RU'),
ruMenuItem: stylesSrc.includes('value:`ru-RU`'),
perfCss: html.includes('zcode-perf'),
zteamPanelInHtml: html.includes('zteam-panel.js'),
noZaiAdapters: !extract('/main/index.js').includes('BigModel'),
};
console.log(checks);
console.log(!missing && junk.length === 0 && Object.values(checks).every(Boolean) ? 'VERDICT: PASS' : 'VERDICT: FAIL');