main.js
12.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
'use strict';
const _0xea56 = [
'closed',
'../cocos-i',
'bind',
'msOCf',
'GcozP',
'MPQfF',
'DejwD',
'PDVOL',
'webRequest',
'registerHe',
'setReqHead',
'2|0|4|1|3',
'JUmHS',
'Path',
'nspector-c',
'insertCSS',
'has\x20tray\x20a',
'loadURL',
'ready-to-s',
'tryShowWin',
'returnValu',
'dow',
'versions',
'mainPreloa',
'?port=',
'isteners',
'sendToAll',
'showWindow',
'process',
'kAxlS',
'v.switchMo',
'1Flijpm',
'join',
'&mode=',
'previewPor',
'requestHea',
'nativeWin',
'tml',
'lready!',
'removeAllL',
'utf-8',
'index_low_',
'de(',
'asset',
'onfig.json',
'file://',
'setMenu',
'parse',
'aderUrls',
'icRTt',
'NGZai',
'assets:hin',
'node',
'focusNode',
'580702ygnIUE',
'setMenuBar',
'10885CCgiJi',
'lYEXz',
'497133UdCCit',
'1535750OfCtfA',
'show',
'Cocos\x20Insp',
'ZWOmW',
'path',
'OJTiR',
'json',
'electron',
':focusNode',
'setImage',
'defaultSes',
'ver',
'warn',
'ector\x20v',
'Window',
'how',
'Ipc',
'executeJav',
'haaQZ',
'Sec',
'webContent',
'readFileSy',
'QoEvF',
'mnExG',
'createFrom',
'baszG',
'gUYzL',
'137KAJXsf',
'ders',
'1553848EmZdsz',
'XsBMu',
'existsSync',
'ndHeaders',
'Selection',
'fxEMP',
'exports',
':focusAsse',
'config.jso',
'electron.h',
'error',
'name',
'Visibility',
'222304lIRopH',
'select',
'onBeforeSe',
'sion',
'./icon.png',
'aScript',
'./package.',
'setHeader',
'focusAsset',
'resize',
'version',
'index.html',
'DZXtH',
'click',
'2845310iMsafm',
'split',
'#2e2c29',
'ector',
'disableWeb',
'd.js',
'destroy',
'PreviewSer',
'./tj',
'url'
];
const _0x3fdaaf = _0x4c0a;
(function (_0x28eb80, _0x174e75) {
const _0x5a0876 = _0x4c0a;
while (!![]) {
try {
const _0x5307d0 = parseInt(_0x5a0876(0x19e)) + -parseInt(_0x5a0876(0x173)) + parseInt(_0x5a0876(0x171)) * parseInt(_0x5a0876(0x18f)) + parseInt(_0x5a0876(0x191)) + parseInt(_0x5a0876(0x16f)) * -parseInt(_0x5a0876(0x158)) + parseInt(_0x5a0876(0x174)) + -parseInt(_0x5a0876(0x1ac));
if (_0x5307d0 === _0x174e75)
break;
else
_0x28eb80['push'](_0x28eb80['shift']());
} catch (_0x4a8a6b) {
_0x28eb80['push'](_0x28eb80['shift']());
}
}
}(_0xea56, -0x153073 + -0x599df + 0x2837d4 * 0x1));
function _0x4c0a(_0x1f55b3, _0x1a6e8b) {
_0x1f55b3 = _0x1f55b3 - (0xcfe + 0x2 * 0x72f + -0x1a0b);
let _0x2cbbe3 = _0xea56[_0x1f55b3];
return _0x2cbbe3;
}
const {Tray, BrowserWindow, nativeImage, app, remote, ipcMain, session} = require(_0x3fdaaf(0x17b)), path = require(_0x3fdaaf(0x178)), pcs = require(_0x3fdaaf(0x155)), folder = '', devTools = ![];
let win, tray = null, mode = -0x1525 + -0x16db + 0x2c00, unloaded = ![];
const PKG_NAME = require(_0x3fdaaf(0x1a4) + _0x3fdaaf(0x17a))[_0x3fdaaf(0x19c)], PKG_VERSION = require(_0x3fdaaf(0x1a4) + _0x3fdaaf(0x17a))[_0x3fdaaf(0x1a8)];
let {ebtMain} = require(_0x3fdaaf(0x1b4)), fs = require('fs'), _configPath = path[_0x3fdaaf(0x159)](__dirname, _0x3fdaaf(0x199) + 'n'), __parentConfig = path[_0x3fdaaf(0x159)](__dirname, _0x3fdaaf(0x1b7) + _0x3fdaaf(0x1c4) + _0x3fdaaf(0x165));
function readConfig() {
const _0x119ac6 = _0x3fdaaf, _0x2f1798 = { 'NGZai': _0x119ac6(0x161) };
let _0x103b6b = '';
return fs[_0x119ac6(0x193)](__parentConfig) ? _0x103b6b = fs[_0x119ac6(0x189) + 'nc'](__parentConfig, { 'encoding': _0x2f1798[_0x119ac6(0x16b)] }) : _0x103b6b = fs[_0x119ac6(0x189) + 'nc'](_configPath, { 'encoding': _0x2f1798[_0x119ac6(0x16b)] }), JSON[_0x119ac6(0x168)](_0x103b6b);
}
let disableWebSec = Boolean(readConfig()[_0x3fdaaf(0x1b0) + _0x3fdaaf(0x187)]);
const customHeaders = {};
module[_0x3fdaaf(0x197)] = {
async 'load'() {
const _0x3dfee8 = _0x3fdaaf;
ipcMain['on'](PKG_NAME + _0x3dfee8(0x17c), this[_0x3dfee8(0x16e)][_0x3dfee8(0x1b8)](this)), ipcMain['on'](PKG_NAME + (_0x3dfee8(0x198) + 't'), this[_0x3dfee8(0x1a6)][_0x3dfee8(0x1b8)](this)), ipcMain['on'](_0x3dfee8(0x1bf) + _0x3dfee8(0x169), this[_0x3dfee8(0x1bf) + _0x3dfee8(0x169)][_0x3dfee8(0x1b8)](this)), ipcMain['on'](_0x3dfee8(0x1c0) + 'er', this[_0x3dfee8(0x1a5)][_0x3dfee8(0x1b8)](this));
},
'unload'() {
const _0x5427fb = _0x3fdaaf, _0x252559 = { 'baszG': _0x5427fb(0x1c1) }, _0x48f68f = _0x252559[_0x5427fb(0x18d)][_0x5427fb(0x1ad)]('|');
let _0x35dcda = 0x164e + 0x1732 + -0x2d80;
while (!![]) {
switch (_0x48f68f[_0x35dcda++]) {
case '0':
ipcMain[_0x5427fb(0x160) + _0x5427fb(0x152)](PKG_NAME + _0x5427fb(0x17c));
continue;
case '1':
ipcMain[_0x5427fb(0x160) + _0x5427fb(0x152)](_0x5427fb(0x1bf) + _0x5427fb(0x169));
continue;
case '2':
unloaded = !![];
continue;
case '3':
ipcMain[_0x5427fb(0x160) + _0x5427fb(0x152)](_0x5427fb(0x1c0) + 'er');
continue;
case '4':
ipcMain[_0x5427fb(0x160) + _0x5427fb(0x152)](PKG_NAME + (_0x5427fb(0x198) + 't'));
continue;
}
break;
}
},
'focusNode'(_0x558ea4, _0x114977) {
const _0x4dc38b = _0x3fdaaf, _0x13eca2 = { 'lYEXz': _0x4dc38b(0x16d) };
Editor[_0x4dc38b(0x195)][_0x4dc38b(0x19f)](_0x13eca2[_0x4dc38b(0x172)], _0x114977);
},
'focusAsset'(_0x422822, _0xc61147) {
const _0x2a153b = _0x3fdaaf, _0x1d6cec = {
'XsBMu': _0x2a153b(0x16c) + 't',
'fxEMP': _0x2a153b(0x164)
};
Editor[_0x2a153b(0x184)][_0x2a153b(0x153)](_0x1d6cec[_0x2a153b(0x192)], _0xc61147), Editor[_0x2a153b(0x195)][_0x2a153b(0x19f)](_0x1d6cec[_0x2a153b(0x196)], _0xc61147);
},
'registerHeaderUrls'(_0x425d2b, _0x5de918) {
const _0x30ee24 = _0x3fdaaf, _0x339d83 = {
'msOCf': function (_0x59aaea, _0x4daa6a) {
return _0x59aaea(_0x4daa6a);
}
}, _0x4dbef2 = { 'urls': _0x5de918 };
session[_0x30ee24(0x17e) + _0x30ee24(0x1a1)][_0x30ee24(0x1be)][_0x30ee24(0x1a0) + _0x30ee24(0x194)](_0x4dbef2, (_0x38cb73, _0x72d963) => {
const _0xd776d = _0x30ee24;
try {
let _0x452055 = customHeaders[_0x38cb73[_0xd776d(0x1b5)]];
for (let _0x308c33 in _0x452055) {
_0x38cb73[_0xd776d(0x15c) + _0xd776d(0x190)][_0x308c33] = _0x452055[_0x308c33];
}
_0x339d83[_0xd776d(0x1b9)](_0x72d963, { 'requestHeaders': _0x38cb73[_0xd776d(0x15c) + _0xd776d(0x190)] });
} catch (_0x320445) {
Editor[_0xd776d(0x19b)](_0x320445), _0x320445[_0xd776d(0x1ca) + 'e'] = ![];
}
}), _0x425d2b[_0x30ee24(0x1ca) + 'e'] = !![];
},
'setHeader'(_0x3e6a7f, _0xe95c87, _0x52be16) {
const _0x42669f = _0x3fdaaf;
customHeaders[_0xe95c87] = _0x52be16, _0x3e6a7f[_0x42669f(0x1ca) + 'e'] = !![];
},
'showWindow'() {
const _0x1da5de = _0x3fdaaf, _0x5954c2 = {
'JUmHS': _0x1da5de(0x176) + _0x1da5de(0x1af),
'mnExG': function (_0x5144bc, _0x381ace) {
return _0x5144bc + _0x381ace;
},
'OJTiR': _0x1da5de(0x176) + _0x1da5de(0x181),
'kAxlS': _0x1da5de(0x1ae),
'DZXtH': _0x1da5de(0x1c8) + _0x1da5de(0x183),
'GcozP': _0x1da5de(0x1b6),
'ZWOmW': function (_0x435d88, _0x24274d) {
return _0x435d88 >= _0x24274d;
},
'DejwD': function (_0x32ff1e, _0x2b670c) {
return _0x32ff1e + _0x2b670c;
},
'PDVOL': function (_0x584071, _0x412356) {
return _0x584071 + _0x412356;
},
'gUYzL': _0x1da5de(0x151),
'icRTt': _0x1da5de(0x15a)
};
if (win) {
win[_0x1da5de(0x175)](), win[_0x1da5de(0x188) + 's'][_0x1da5de(0x185) + _0x1da5de(0x1a3)](_0x1da5de(0x157) + _0x1da5de(0x163) + mode + ')');
return;
}
win = new Editor[(_0x1da5de(0x182))](_0x5954c2[_0x1da5de(0x1c2)], {
'minWidth': 0x36e,
'minHeight': 0x258,
'width': 0x36e,
'height': 0x258,
'title': _0x5954c2[_0x1da5de(0x18b)](_0x5954c2[_0x1da5de(0x179)], PKG_VERSION),
'backgroundColor': _0x5954c2[_0x1da5de(0x156)],
'useContentSize': ![],
'webPreferences': {
'enablePreferredSizeMode': !![],
'preferredSizeMode': !![],
'webviewTag': !![],
'nodeIntegration': !![],
'enableRemoteModule': !![],
'sandbox': ![],
'devTools': devTools,
'contextIsolation': ![],
'webSecurity': !disableWebSec,
'preload': path[_0x1da5de(0x159)](__dirname, folder + (_0x1da5de(0x1cd) + _0x1da5de(0x1b1)))
}
})[_0x1da5de(0x15d)];
win[_0x1da5de(0x188) + 's'] && (win[_0x1da5de(0x188) + 's'][_0x1da5de(0x1c5)] = function (..._0x657e7c) {
});
try {
win[_0x1da5de(0x167)](null), win[_0x1da5de(0x170) + _0x1da5de(0x19d)](![]);
} catch (_0x4ce46a) {
}
win['on'](_0x5954c2[_0x1da5de(0x1aa)], () => {
const _0x143242 = _0x1da5de;
win[_0x143242(0x175)]();
}), win['on'](_0x5954c2[_0x1da5de(0x1ba)], () => {
const _0x3e8d6e = _0x1da5de;
win[_0x3e8d6e(0x1b2)](), win = null;
if (tray)
tray[_0x3e8d6e(0x1b2)]();
tray = null;
});
let _0x3649e9 = folder + (_0x1da5de(0x162) + _0x1da5de(0x19a) + _0x1da5de(0x15e));
_0x5954c2[_0x1da5de(0x177)](process[_0x1da5de(0x1cc)][_0x1da5de(0x17b)][_0x1da5de(0x1ad)]('.')[0x1 * -0x425 + 0x36d * 0x7 + -0x13d6], -0xa2d + -0x23c2 * -0x1 + -0x1990) && (_0x3649e9 = folder + _0x1da5de(0x1a9));
let _0x516ec1 = path[_0x1da5de(0x159)](__dirname, _0x5954c2[_0x1da5de(0x18b)](_0x5954c2[_0x1da5de(0x1bc)](_0x5954c2[_0x1da5de(0x1bd)](_0x5954c2[_0x1da5de(0x1bd)](_0x3649e9, _0x5954c2[_0x1da5de(0x18e)]), Editor[_0x1da5de(0x1b3) + _0x1da5de(0x17f)][_0x1da5de(0x15b) + 't']), _0x5954c2[_0x1da5de(0x16a)]), mode));
win[_0x1da5de(0x1c7)](_0x1da5de(0x166) + _0x516ec1);
},
'tryShowWindow'(_0x108f26) {
const _0x4df5b7 = _0x3fdaaf, _0x513764 = {
'QoEvF': _0x4df5b7(0x1a2),
'MPQfF': _0x4df5b7(0x1ab),
'haaQZ': _0x4df5b7(0x1c6) + _0x4df5b7(0x15f)
};
try {
let _0x47baec = nativeImage[_0x4df5b7(0x18c) + _0x4df5b7(0x1c3)](path[_0x4df5b7(0x159)](__dirname, _0x513764[_0x4df5b7(0x18a)]));
_0x47baec = _0x47baec[_0x4df5b7(0x1a7)]({
'width': 0x10,
'height': 0x10
});
tray && tray[_0x4df5b7(0x17d)](_0x47baec);
if (!tray)
tray = new Tray(_0x47baec), tray['on'](_0x513764[_0x4df5b7(0x1bb)], function () {
const _0x4b180e = _0x4df5b7;
win[_0x4b180e(0x175)]();
});
else {
if (devTools)
Editor[_0x4df5b7(0x180)](_0x513764[_0x4df5b7(0x186)]);
}
} catch (_0x748672) {
if (devTools)
Editor[_0x4df5b7(0x19b)](_0x748672);
}
mode = _0x108f26;
try {
this[_0x4df5b7(0x154)]();
} catch (_0x848e90) {
Editor[_0x4df5b7(0x19b)](_0x848e90);
}
},
'messages': {
'previewMode'() {
const _0x23e2a2 = _0x3fdaaf;
if (unloaded)
return;
this[_0x23e2a2(0x1c9) + _0x23e2a2(0x1cb)](0x21c + 0x1 * 0x32b + 0x547 * -0x1);
},
'buildMode'() {
const _0x80a3f2 = _0x3fdaaf;
if (unloaded)
return;
this[_0x80a3f2(0x1c9) + _0x80a3f2(0x1cb)](-0xd3 * -0x13 + 0xd * -0x7d + -0x94f);
},
'openCustomPage'() {
const _0x157f2d = _0x3fdaaf;
if (unloaded)
return;
this[_0x157f2d(0x1c9) + _0x157f2d(0x1cb)](-0x32f * 0xa + -0x1614 + -0xe * -0x3da);
}
}
};