mirror of
https://github.com/EndPwnArchive/endpwn3.git
synced 2024-08-15 00:23:30 +00:00
minor refactor of system plugin
This commit is contained in:
parent
ae3b4e75f1
commit
ff46ffd5d1
2 changed files with 50 additions and 44 deletions
|
@ -61,10 +61,10 @@
|
|||
}
|
||||
|
||||
// install endpwn
|
||||
var o = fs.existsSync(data + '/settings.json') ? JSON.parse(fs.readFileSync(data + '/settings.json', 'utf8')) : {}; // load settings.json
|
||||
o['WEBAPP_ENDPOINT'] = location.href.split('?')[0] + '?'; // aim the app at stage 0
|
||||
o['WEBAPP_PATH'] = undefined; // clear old WEBAPP_PATH
|
||||
fs.writeFileSync(data + '/settings.json', JSON.stringify(o, null, 2)); // commit changes to disk
|
||||
var o = fs.existsSync(data + '/settings.json') ? JSON.parse(fs.readFileSync(data + '/settings.json', 'utf8')) : {}; // load settings.json
|
||||
o['WEBAPP_ENDPOINT'] = location.href.split('?')[0] + '?'; // aim the app at stage 0
|
||||
o['WEBAPP_PATH'] = undefined; // clear old WEBAPP_PATH
|
||||
fs.writeFileSync(data + '/settings.json', JSON.stringify(o, null, 2)); // commit changes to disk
|
||||
|
||||
try {
|
||||
// reverse asarpwn3
|
||||
|
@ -85,7 +85,6 @@
|
|||
|
||||
function load() {
|
||||
var branch = require('path').basename(data).substr(7);
|
||||
//win.loadURL('https://' + (branch && branch != 'development' ? branch + '.' : '') + 'discordapp.com/channels/@me');
|
||||
electron.BrowserWindow.addExtension(data + '/crxpwn');
|
||||
electron.getCurrentWindow().loadURL('https://' + (branch && branch != 'development' ? branch + '.' : '') + 'discordapp.com/channels/@me');
|
||||
}
|
||||
|
@ -97,13 +96,12 @@
|
|||
if (!fs.existsSync(data + '/plugins')) fs.mkdirSync(data + '/plugins');
|
||||
|
||||
// dont update EPAPI/CRISPR if DONTUPDATE exists
|
||||
// TODO: make this mess into an async function so we can use await
|
||||
if (!fs.existsSync(data + '/DONTUPDATE')) {
|
||||
|
||||
var crxpwn = await (await fetch(approot + '/crxpwn.js?_=' + Date.now())).text();
|
||||
fs.writeFileSync(data + '/crxpwn/payload.js', crxpwn);
|
||||
|
||||
var epapi = await (await fetch('https://endpwn.github.io/epapi/epapi.js?_=' + Date.now())).text();
|
||||
var epapi = await (await fetch('https://endpwn.github.io/epapi-staging/epapi.js?_=' + Date.now())).text();
|
||||
fs.writeFileSync(data + '/epapi.js', epapi);
|
||||
|
||||
var crispr = await (await fetch('https://endpwn.github.io/crispr/crispr.js?_=' + Date.now())).text();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue