2022-08-19 10:51:46 +08:00

450 lines
17 KiB
JavaScript

'use strict';
const _0x310e = [
'RbwEt',
'jesju',
'cESkJ',
'node',
'loadURL',
'oEQbF',
'removeAllL',
'webContent',
'../cocos-i',
'select',
'size',
'version',
'join',
'aScript',
'mLYBN',
'unselect',
'ent\x20size',
'dKKAT',
'resize',
'TPjnl',
'User',
'842799JVuQpT',
'index.html',
'IlBgy',
'ApRBL',
'lready!',
'getData',
'dLQyw',
'electron.h',
'576689NkJJcn',
'access_tok',
'query-port',
'exports',
'getSelecte',
'asset',
'ykNBc',
'setImage',
'yPCtW',
'isPortrait',
'click',
'rPQkG',
'setContent',
'gQVMI',
'fixed\x20cont',
'Size',
'DupIz',
'split',
'setMenu',
'NueHt',
'openDevToo',
'server',
'lwDOI',
'UbtjH',
'mainPreloa',
'versions',
'de(',
'LYYCI',
'request',
'GzNUa',
'1xMlblC',
'dvdDp',
'how',
'#2e2c29',
'XoXHt',
'v?.refresh',
'1201626VaCHvn',
'warn',
'Path',
'name',
'append',
'Menu',
'process',
'?port=',
'RrHkd',
':focusAsse',
'simpleMode',
'nspector-c',
'xChts',
'executeJav',
'DdQwk',
'1RyJhNo',
'./package.',
'setContext',
'setMenuBar',
'has\x20tray\x20a',
'ggleSimple',
'Cocos\x20Insp',
'Message',
'ector\x20v',
'then',
'387763giuIJZ',
'Visibility',
'json',
'parse',
'ch-asset',
'gYZds',
'SXqpg',
'ui-kit:tou',
':focusNode',
'Selection',
'YQMXg',
'electron',
'3MBpfmL',
'tml',
'setting.to',
'quydc',
'onfig.json',
'yIZUc',
'OpenDevToo',
'config.jso',
'file://',
'closed',
'2gJOlSw',
'error',
'357509sjjISt',
'rMain',
'destroy',
'Iabjt',
'v.switchMo',
'show',
'Mode()',
'i\x20Mode',
'374149OrYcEB',
'Toggle\x20Min',
'utf-8',
'ready-to-s',
'existsSync',
'./icon.png',
'85441FUXjmn',
'assign',
'xcTRk',
'readFileSy',
'path',
'createFrom',
'disableWeb',
'getUserTok',
'nfigDataFo',
'PDdcz',
'd.js',
'gLLah',
'Sec',
'getContent',
'&mode=',
'YFYku',
'xQTKP',
'WJFpC',
'setting.co',
'DUnFc',
'LzUKU',
'index_low_',
'broadcast',
'isteners'
];
const _0x412a05 = _0x4215;
(function (_0x2f3a2e, _0x7730a5) {
const _0x1f9415 = _0x4215;
while (!![]) {
try {
const _0x118ded = parseInt(_0x1f9415(0x257)) + -parseInt(_0x1f9415(0x255)) * parseInt(_0x1f9415(0x265)) + parseInt(_0x1f9415(0x226)) + parseInt(_0x1f9415(0x1fa)) * -parseInt(_0x1f9415(0x220)) + -parseInt(_0x1f9415(0x23f)) + parseInt(_0x1f9415(0x235)) * -parseInt(_0x1f9415(0x202)) + -parseInt(_0x1f9415(0x25f)) * -parseInt(_0x1f9415(0x24b));
if (_0x118ded === _0x7730a5)
break;
else
_0x2f3a2e['push'](_0x2f3a2e['shift']());
} catch (_0x1363dd) {
_0x2f3a2e['push'](_0x2f3a2e['shift']());
}
}
}(_0x310e, 0xff06b + 0x1 * -0xbf8f8 + 0x6c466));
const {BrowserWindow, app, remote, ipcMain, Menu, Tray, nativeImage, MenuItem} = require(_0x412a05(0x24a)), path = require(_0x412a05(0x1d1)), pcs = require(_0x412a05(0x22c)), os = require('os'), folder = '', devTools = ![];
let win, tray = null, mode = -0x1ce7 + -0x9 * 0x289 + -0x8 * -0x677, unloaded = ![];
const PKG_NAME = require(_0x412a05(0x236) + _0x412a05(0x241))[_0x412a05(0x229)], PKG_VERSION = require(_0x412a05(0x236) + _0x412a05(0x241))[_0x412a05(0x1f0)];
let fs = require('fs'), _configPath = path[_0x412a05(0x1f1)](__dirname, _0x412a05(0x252) + 'n'), __parentConfig = path[_0x412a05(0x1f1)](__dirname, _0x412a05(0x1ed) + _0x412a05(0x231) + _0x412a05(0x24f));
function readConfig() {
const _0x4bb624 = _0x412a05, _0x517f07 = { 'jesju': _0x4bb624(0x261) };
let _0x5c569e = '';
return fs[_0x4bb624(0x263)](__parentConfig) ? _0x5c569e = fs[_0x4bb624(0x268) + 'nc'](__parentConfig, { 'encoding': _0x517f07[_0x4bb624(0x1e6)] }) : _0x5c569e = fs[_0x4bb624(0x268) + 'nc'](_configPath, { 'encoding': _0x517f07[_0x4bb624(0x1e6)] }), JSON[_0x4bb624(0x242)](_0x5c569e);
}
let config = readConfig(), disableWebSec = Boolean(config[_0x412a05(0x1d3) + _0x412a05(0x1d9)]), dw = 0xe9 * -0x2 + 0x1 * -0x131a + 0x14ec, dh = 0x1 * 0x5ab + -0x6c * -0xf + -0xbff;
function changeDWH() {
const _0x4dde7a = _0x412a05, _0x4fdf37 = {
'NueHt': function (_0x32064a, _0x32fbf0) {
return _0x32064a + _0x32fbf0;
}
};
dw = config[_0x4dde7a(0x230)] ? config[_0x4dde7a(0x20b)] ? config[_0x4dde7a(0x1ef)][-0x541 * 0x6 + -0x11 * 0x1e1 + 0x7 * 0x911] : config[_0x4dde7a(0x1ef)][0xd3d + 0x15f9 + 0x2335 * -0x1] : -0x6a1 + 0x1 * 0x1ac9 + -0x85d * 0x2, dh = config[_0x4dde7a(0x230)] ? _0x4fdf37[_0x4dde7a(0x215)](config[_0x4dde7a(0x20b)] ? config[_0x4dde7a(0x1ef)][0x1d31 + 0x19c4 + 0x1b7a * -0x2] : config[_0x4dde7a(0x1ef)][-0x348 + -0x74b + -0xa93 * -0x1], -0x1 * 0x236e + -0x1ef0 + 0x4291) : 0x196d + -0xdf3 * -0x1 + -0x2508;
}
changeDWH();
let u = null;
module[_0x412a05(0x205)] = {
async 'load'() {
const _0x36feb9 = _0x412a05;
ipcMain['on'](PKG_NAME + _0x36feb9(0x247), focusNode), ipcMain['on'](PKG_NAME + (_0x36feb9(0x22f) + 't'), focusAsset);
try {
u = await Editor[_0x36feb9(0x1f9)][_0x36feb9(0x1ff)]();
if (!u[_0x36feb9(0x203) + 'en'])
Object[_0x36feb9(0x266)](u, await Editor[_0x36feb9(0x1f9)][_0x36feb9(0x1d4) + 'en']());
} catch (_0xaed645) {
}
},
'unload'() {
const _0x55d6df = _0x412a05;
unloaded = !![], ipcMain[_0x55d6df(0x1eb) + _0x55d6df(0x1e4)](PKG_NAME + _0x55d6df(0x247)), ipcMain[_0x55d6df(0x1eb) + _0x55d6df(0x1e4)](PKG_NAME + (_0x55d6df(0x22f) + 't'));
},
'methods': {
'previewMode'() {
const _0x523077 = _0x412a05, _0x3f8a1 = {
'oEQbF': function (_0x4c772a, _0xad0e31) {
return _0x4c772a(_0xad0e31);
}
};
if (unloaded)
return;
_0x3f8a1[_0x523077(0x1ea)](tryShowWindow, -0x7 * -0x1c1 + 0x1 * -0x22d + -0x6 * 0x1af);
},
'buildMobileMode'() {
const _0xbe053e = _0x412a05, _0x388eda = {
'dvdDp': function (_0x3b5eaf, _0x1fca84) {
return _0x3b5eaf(_0x1fca84);
}
};
if (unloaded)
return;
_0x388eda[_0xbe053e(0x221)](tryShowWindow, -0x142e + -0x9 * -0x1a3 + 0x574);
},
'buildDesktopMode'() {
const _0x5463e3 = _0x412a05, _0x4ca301 = {
'UbtjH': function (_0x4bb687, _0x8a3fb0) {
return _0x4bb687(_0x8a3fb0);
}
};
if (unloaded)
return;
_0x4ca301[_0x5463e3(0x219)](tryShowWindow, -0x2421 + -0x1517 * 0x1 + 0x393b);
},
'openCustomPage'() {
const _0x2a7c94 = _0x412a05, _0xe2ca47 = {
'PDdcz': function (_0x2d9c17, _0x45212e) {
return _0x2d9c17(_0x45212e);
}
};
if (unloaded)
return;
_0xe2ca47[_0x2a7c94(0x1d6)](tryShowWindow, -0x727 * 0x5 + 0x1 * 0x1445 + 0xf80);
},
'refresh'() {
const _0xf7b3be = _0x412a05, _0x41f7fe = { 'DupIz': _0xf7b3be(0x225) + '()' };
win?.[_0xf7b3be(0x1ec) + 's']?.[_0xf7b3be(0x233) + _0xf7b3be(0x1f2)](_0x41f7fe[_0xf7b3be(0x212)]);
}
}
};
function focusNode(_0x2cd6ba, _0xb25dc2) {
const _0x7f68e4 = _0x412a05, _0x224ad7 = { 'xChts': _0x7f68e4(0x1e8) };
let _0x503ff7 = Editor[_0x7f68e4(0x248)][_0x7f68e4(0x206) + 'd'](_0x224ad7[_0x7f68e4(0x232)]);
Editor[_0x7f68e4(0x248)][_0x7f68e4(0x1f4)](_0x224ad7[_0x7f68e4(0x232)], _0x503ff7), Editor[_0x7f68e4(0x248)][_0x7f68e4(0x1ee)](_0x224ad7[_0x7f68e4(0x232)], _0xb25dc2);
}
function focusAsset(_0x54a396, _0x16b35e) {
const _0x366b25 = _0x412a05, _0x369bef = {
'DUnFc': _0x366b25(0x246) + _0x366b25(0x243),
'TPjnl': _0x366b25(0x207)
};
Editor[_0x366b25(0x23c)][_0x366b25(0x1e3)](_0x369bef[_0x366b25(0x1e0)], _0x16b35e);
let _0xb5d56a = Editor[_0x366b25(0x248)][_0x366b25(0x206) + 'd'](_0x369bef[_0x366b25(0x1f8)]);
Editor[_0x366b25(0x248)][_0x366b25(0x1f4)](_0x369bef[_0x366b25(0x1f8)], _0xb5d56a), Editor[_0x366b25(0x248)][_0x366b25(0x1ee)](_0x369bef[_0x366b25(0x1f8)], _0x16b35e);
}
function _0x4215(_0x413ec0, _0xae40c7) {
_0x413ec0 = _0x413ec0 - (0x6 * 0x5d1 + -0x16bc + -0xa59);
let _0x1cf92d = _0x310e[_0x413ec0];
return _0x1cf92d;
}
async function showWindow() {
const _0x225047 = _0x412a05, _0x5d1bfb = {
'WJFpC': function (_0x228bd6) {
return _0x228bd6();
},
'yPCtW': function (_0x17751b, _0x2b8932) {
return _0x17751b != _0x2b8932;
},
'XoXHt': _0x225047(0x210) + _0x225047(0x1f5),
'ApRBL': _0x225047(0x1df) + _0x225047(0x1d5) + _0x225047(0x258),
'xcTRk': function (_0x1d635b, _0x3c84a9) {
return _0x1d635b + _0x3c84a9;
},
'DdQwk': _0x225047(0x23b) + _0x225047(0x23d),
'gLLah': _0x225047(0x223),
'YFYku': _0x225047(0x1f7),
'LzUKU': _0x225047(0x262) + _0x225047(0x222),
'YQMXg': _0x225047(0x254),
'dLQyw': function (_0x2f05dd, _0x5230dc) {
return _0x2f05dd >= _0x5230dc;
},
'mLYBN': _0x225047(0x217),
'LYYCI': _0x225047(0x204),
'ykNBc': function (_0x54be1d, _0x4b00c8) {
return _0x54be1d + _0x4b00c8;
},
'gYZds': function (_0x380c71, _0x33a196) {
return _0x380c71 + _0x33a196;
},
'RrHkd': function (_0x397b54, _0x6d3c4d) {
return _0x397b54 + _0x6d3c4d;
},
'RbwEt': function (_0x599f75, _0x35f9c4) {
return _0x599f75 + _0x35f9c4;
},
'GzNUa': _0x225047(0x22d),
'Iabjt': _0x225047(0x1db)
};
if (win) {
win[_0x225047(0x25c)](), win[_0x225047(0x1ec) + 's'][_0x225047(0x233) + _0x225047(0x1f2)](_0x225047(0x25b) + _0x225047(0x21c) + mode + ')');
return;
}
win = new BrowserWindow({
'width': dw,
'height': dh,
'title': _0x5d1bfb[_0x225047(0x267)](_0x5d1bfb[_0x225047(0x234)], PKG_VERSION),
'backgroundColor': _0x5d1bfb[_0x225047(0x1d8)],
'autoHideMenuBar': !![],
'webPreferences': {
'useContentSize': !![],
'enablePreferredSizeMode': ![],
'preferredSizeMode': ![],
'webviewTag': !![],
'nodeIntegration': !![],
'nodeIntegrationInSubFrames': !![],
'enableRemoteModule': !![],
'sandbox': ![],
'devTools': devTools,
'contextIsolation': ![],
'webSecurity': !disableWebSec,
'resizable': !config[_0x225047(0x230)],
'minimizable': !config[_0x225047(0x230)],
'maximizable': !config[_0x225047(0x230)],
'preload': path[_0x225047(0x1f1)](__dirname, folder + (_0x225047(0x21a) + _0x225047(0x1d7)))
}
});
try {
win[_0x225047(0x214)](null), win[_0x225047(0x238) + _0x225047(0x240)](![]), win[_0x225047(0x238) + _0x225047(0x240)] = win[_0x225047(0x214)] = function (_0x577dfb) {
};
} catch (_0x280a22) {
}
win['on'](_0x5d1bfb[_0x225047(0x1dc)], () => {
const _0x2138bc = _0x225047, _0x19af86 = {
'lwDOI': function (_0x45ed58) {
const _0x158ff3 = _0x4215;
return _0x5d1bfb[_0x158ff3(0x1de)](_0x45ed58);
},
'yIZUc': function (_0x4b7849, _0x3b49f6) {
const _0x4a1c42 = _0x4215;
return _0x5d1bfb[_0x4a1c42(0x20a)](_0x4b7849, _0x3b49f6);
},
'cESkJ': function (_0xbcdda3, _0x491321) {
const _0x5e89d9 = _0x4215;
return _0x5d1bfb[_0x5e89d9(0x20a)](_0xbcdda3, _0x491321);
},
'xQTKP': _0x5d1bfb[_0x2138bc(0x224)]
};
try {
win[_0x2138bc(0x1ec) + 's'][_0x2138bc(0x233) + _0x2138bc(0x1f2)](_0x5d1bfb[_0x2138bc(0x1fd)])[_0x2138bc(0x23e)](function (_0x2386c8) {
const _0x34f505 = _0x2138bc;
if (_0x2386c8)
config = _0x2386c8;
_0x19af86[_0x34f505(0x218)](changeDWH);
if (config[_0x34f505(0x230)] && win[_0x34f505(0x1ec) + 's']) {
let _0x1a80f9 = win[_0x34f505(0x1da) + _0x34f505(0x211)]();
(_0x19af86[_0x34f505(0x250)](dw, _0x1a80f9[0x3 * 0x11f + -0x1526 + 0x11c9]), _0x19af86[_0x34f505(0x1e7)](dh, _0x1a80f9[-0x23 * -0x61 + -0x438 + -0x59 * 0x1a])) && (win[_0x34f505(0x20e) + _0x34f505(0x211)](dw, dh), devTools && console[_0x34f505(0x227)](_0x19af86[_0x34f505(0x1dd)]));
}
});
} catch (_0x3a8bcb) {
console[_0x2138bc(0x256)](_0x3a8bcb);
}
}), win['on'](_0x5d1bfb[_0x225047(0x1e1)], () => win[_0x225047(0x25c)]()), win['on'](_0x5d1bfb[_0x225047(0x249)], () => {
const _0x491be5 = _0x225047;
win[_0x491be5(0x259)](), win = null;
if (tray)
tray[_0x491be5(0x259)]();
tray = null;
});
let _0x24f5b9 = folder + (_0x225047(0x1e2) + _0x225047(0x201) + _0x225047(0x24c));
_0x5d1bfb[_0x225047(0x200)](process[_0x225047(0x21b)][_0x225047(0x24a)][_0x225047(0x213)]('.')[-0x3a3 * -0x2 + -0xe0d + -0x15b * -0x5], -0x2 * -0xfd9 + 0x6b9 + -0x2666) && (_0x24f5b9 = folder + _0x225047(0x1fb));
let _0x591e11 = await Editor[_0x225047(0x23c)][_0x225047(0x21e)](_0x5d1bfb[_0x225047(0x1f3)], _0x5d1bfb[_0x225047(0x21d)]), _0x301340 = path[_0x225047(0x1f1)](__dirname, _0x5d1bfb[_0x225047(0x208)](_0x5d1bfb[_0x225047(0x244)](_0x5d1bfb[_0x225047(0x22e)](_0x5d1bfb[_0x225047(0x1e5)](_0x24f5b9, _0x5d1bfb[_0x225047(0x21f)]), _0x591e11), _0x5d1bfb[_0x225047(0x25a)]), mode));
if (u) {
let {
cocos_uid: _0x1f4031,
nickname: _0x4fb4c9,
access_token: _0xadd97a
} = u, _0x1874ef = {
'cocos_uid': _0x1f4031,
'nickname': _0x4fb4c9,
'access_token': _0xadd97a
};
for (let _0x12b143 in _0x1874ef) {
_0x301340 += '&' + _0x12b143 + '=' + _0x1874ef[_0x12b143];
}
}
win[_0x225047(0x1e9)](_0x225047(0x253) + _0x301340);
}
function tryShowWindow(_0x62e59) {
const _0x218d29 = _0x412a05, _0x21fe42 = {
'SXqpg': _0x218d29(0x264),
'gQVMI': _0x218d29(0x20c),
'quydc': _0x218d29(0x260) + _0x218d29(0x25e),
'dKKAT': _0x218d29(0x251) + 'ls',
'IlBgy': _0x218d29(0x239) + _0x218d29(0x1fe),
'rPQkG': function (_0x3b850b) {
return _0x3b850b();
}
};
try {
let _0x4dda46 = nativeImage[_0x218d29(0x1d2) + _0x218d29(0x228)](path[_0x218d29(0x1f1)](__dirname, _0x21fe42[_0x218d29(0x245)]));
_0x4dda46 = _0x4dda46[_0x218d29(0x1f7)]({
'width': 0x10,
'height': 0x10
});
tray && tray[_0x218d29(0x209)](_0x4dda46);
if (!tray) {
tray = new Tray(_0x4dda46), tray['on'](_0x21fe42[_0x218d29(0x20f)], function () {
const _0x4cb8f8 = _0x218d29;
win[_0x4cb8f8(0x25c)]();
});
let _0x5daa94 = new Menu();
_0x5daa94[_0x218d29(0x22a)](new MenuItem({
'label': _0x21fe42[_0x218d29(0x24e)],
'click': function () {
const _0x4ad777 = _0x218d29;
win && win[_0x4ad777(0x1ec) + 's'][_0x4ad777(0x233) + _0x4ad777(0x1f2)](_0x4ad777(0x24d) + _0x4ad777(0x23a) + _0x4ad777(0x25d));
}
})), devTools && _0x5daa94[_0x218d29(0x22a)](new MenuItem({
'label': _0x21fe42[_0x218d29(0x1f6)],
'click': function () {
const _0x163c33 = _0x218d29;
win && win[_0x163c33(0x1ec) + 's'][_0x163c33(0x216) + 'ls']();
}
})), tray[_0x218d29(0x237) + _0x218d29(0x22b)](_0x5daa94);
} else {
if (devTools)
console[_0x218d29(0x227)](_0x21fe42[_0x218d29(0x1fc)]);
}
} catch (_0xe9e8b7) {
if (devTools)
console[_0x218d29(0x256)](_0xe9e8b7);
}
mode = _0x62e59;
try {
_0x21fe42[_0x218d29(0x20d)](showWindow);
} catch (_0x1195a4) {
console[_0x218d29(0x256)](_0x1195a4);
}
}