update proxy release

This commit is contained in:
Cynthia Foxwell 2018-07-11 18:32:22 -06:00
parent 9297c285b1
commit 1d4fc955bf
4 changed files with 383 additions and 344 deletions

View file

@ -6,6 +6,12 @@
<meta property="og:description" content="Instructions for installing Lambda" />
<meta property="og:image" content="/lambda.png" />
<script>
function updatePayload() {
document.querySelector('code').innerText = `DiscordNative.globals.appSettings.set('UPDATE_ENDPOINT','https://proxy.xn--lmbda-2be.cf/api');DiscordNative.globals.appSettings.save();reloadElectronApp()`
}
</script>
<style>
@font-face {
font-family: 'IBMVGA8';
@ -45,9 +51,9 @@
<body>
<div>L&lambda;mbda</div>
<a href="https://gitlab.com/Cynosphere/lambda-patcher">Grab the Lambda Patcher</a>
Copy and paste the following string into your Discord console:
<br>
<p>Lambda does not have any Discord internal injection methods anymore.</p>
<code>please wait...</code>
<br>
<b>This is a fork of EndPwn3.</b>
</body>

View file

@ -17,7 +17,7 @@
*/
var internal = {
/*var internal = {
print: function (str) {
console.log(`%c[Customizer]%c ` + str, 'font-weight:bold;color:#0cc', '');
@ -120,3 +120,4 @@ exports = {
}
}
*/

View file

@ -16,51 +16,68 @@
https://github.com/endpwn/
*/
exports = {
if (window.$api === undefined && typeof $api != "undefined") {
console.warn(
"$api is defined, but window.$api is not! assuming we are running under epapi6 and exporting an empty object..."
);
exports = {};
} else
exports = {
manifest: {
replacements: [
{
signature: /{section:(\w)\.SectionTypes\.DIVIDER},{section:"logout",/g,
payload: '{section:$1.SectionTypes.DIVIDER},{section:"ENDPWN",label:"ΣndPwn Settings",element:window.BlankSettingsElement,color:"#0cc"},{section:$1.SectionTypes.DIVIDER},{section:"logout",'
payload:
'{section:$1.SectionTypes.DIVIDER},{section:"ENDPWN",label:"ΣndPwn Settings",element:window.BlankSettingsElement,color:"#0cc"},{section:$1.SectionTypes.DIVIDER},{section:"logout",'
}
],
]
},
init: function () {
init: function() {
delete endpwn.settings.init;
var currentSection = '';
var currentSection = "";
$api.events.listen('ENDPWN_PSEUDO_IPC', msg => {
/*$api.events.listen('ENDPWN_PSEUDO_IPC', msg => {
$api.localStorage.set('customizer_signature', JSON.parse(msg.data).signature);
console.log(currentSection);
renderSettings(currentSection);
});
});*/
window.BlankSettingsElement = $api.util.findConstructor('FormSection', 'FormSection').FormSection;
window.BlankSettingsElement = $api.util.findConstructor(
"FormSection",
"FormSection"
).FormSection;
var buttons = $api.util.findFuncExports('button-', 'colorBlack');
var checkboxes = $api.util.findFuncExports('checkboxEnabled');
var misc = $api.util.findFuncExports('statusRed-', 'inputDefault');
var misc2 = $api.util.findFuncExports('multiInputField');
var headers = $api.util.findFuncExports('h5-', 'h5');
var buttons = $api.util.findFuncExports("button-", "colorBlack");
var checkboxes = $api.util.findFuncExports("checkboxEnabled");
var misc = $api.util.findFuncExports("statusRed-", "inputDefault");
var misc2 = $api.util.findFuncExports("multiInputField");
var headers = $api.util.findFuncExports("h5-", "h5");
var panels = wc.findFunc('flexChild-')[0].exports;
var panels2 = $api.util.findFuncExports('errorMessage-', 'inputWrapper');
var panels = wc.findFunc("flexChild-")[0].exports;
var panels2 = $api.util.findFuncExports(
"errorMessage-",
"inputWrapper"
);
function createVerticalPanel() {
return createElement("div")
.withClass(panels2.vertical, 'epButtonPanel')
return createElement("div").withClass(
panels2.vertical,
"epButtonPanel"
);
}
function createHorizontalPanel() {
return createElement("div")
.withClass(panels.horizontal, 'epButtonPanel')
return createElement("div").withClass(
panels.horizontal,
"epButtonPanel"
);
}
function createButton(name) {
return createElement('button')
return createElement("button")
.withContents(name)
.withClass(
buttons.button,
@ -68,12 +85,12 @@ exports = {
buttons.colorBrand,
buttons.sizeSmall,
buttons.grow,
'epMargin'
"epMargin"
);
}
function createWarnButton(name) {
return createElement('button')
return createElement("button")
.withContents(name)
.withClass(
buttons.button,
@ -81,12 +98,12 @@ exports = {
buttons.colorYellow,
buttons.sizeSmall,
buttons.grow,
'epMargin'
"epMargin"
);
}
function createDangerButton(name) {
return createElement('button')
return createElement("button")
.withContents(name)
.withClass(
buttons.button,
@ -94,7 +111,7 @@ exports = {
buttons.colorRed,
buttons.sizeSmall,
buttons.grow,
'epMargin'
"epMargin"
);
}
@ -108,7 +125,7 @@ exports = {
headers.height20,
headers.weightSemiBold,
headers.defaultColor,
'epMargin'
"epMargin"
)
.withText(text);
}
@ -131,9 +148,9 @@ exports = {
misc.inputDefault,
misc.input,
misc.size16,
'epMargin'
"epMargin"
)
.modify(x => x.value = v)
.modify(x => (x.value = v));
}
//<input class="checkboxEnabled-CtinEn checkbox-2tyjJg" type="checkbox">
@ -141,18 +158,18 @@ exports = {
//switchEnabled-V2WDBB switch-3wwwcV valueChecked-m-4IJZ value-2hFrkk sizeDefault-2YlOZr size-3rFEHg themeDefault-24hCdX
function updateSwitch(s, w) {
if (s.checked) {
w.classList.remove(checkboxes.valueUnchecked.split(' ')[0]);
w.classList.add(checkboxes.valueChecked.split(' ')[0])
}
else {
w.classList.remove(checkboxes.valueChecked.split(' ')[0]);
w.classList.add(checkboxes.valueUnchecked.split(' ')[0])
w.classList.remove(checkboxes.valueUnchecked.split(" ")[0]);
w.classList.add(checkboxes.valueChecked.split(" ")[0]);
} else {
w.classList.remove(checkboxes.valueChecked.split(" ")[0]);
w.classList.add(checkboxes.valueUnchecked.split(" ")[0]);
}
}
function createSwitch(c, i) {
if (c === undefined) c = () => { };
if (c === undefined) c = () => {};
if (i === undefined) i = false;
var s, w = createElement('div')
var s,
w = createElement("div")
.withClass(
checkboxes.switch,
checkboxes.switchEnabled,
@ -161,23 +178,26 @@ exports = {
checkboxes.themeDefault
)
.withChildren(
s = createElement("input")
(s = createElement("input")
.withClass(
checkboxes.checkbox,
checkboxes.checkboxEnabled
)
.modify(x => x.type = 'checkbox')
.modify(x => x.checked = i)
.modify(x => x.onchange = () => {
.modify(x => (x.type = "checkbox"))
.modify(x => (x.checked = i))
.modify(
x =>
(x.onchange = () => {
updateSwitch(s, w);
c(s.checked);
})
)
))
);
updateSwitch(s, w);
return w;
}
function authorizeCustomizer() {
/*function authorizeCustomizer() {
var endpoint = $api.internal.constants.API_HOST;
var url = `https://${endpoint}/oauth2/authorize?client_id=436715820970803203&redirect_uri=https%3A%2F%2Fendpwn.cathoderay.tube%2Fauth%2Fdiscord%2Fintegratedcallback&response_type=code&scope=identify`;
@ -218,31 +238,29 @@ exports = {
});
}
}*/
function renderSettings(e) {
currentSection = e;
if ($("#ep_settings")) $("#ep_settings").remove();
if (e.section == "ENDPWN") {
var pane = $(".content-column.default");
if (!pane) return;
var needAuth = !$api.localStorage.get('customizer_signature');
//var needAuth = !$api.localStorage.get('customizer_signature');
var content = createElement('div')
.withId('ep_settings')
.withClass('flex-vertical')
var content = createElement("div")
.withId("ep_settings")
.withClass("flex-vertical")
.withChildren(
createElement("div")
.withClass('epSettingsHeader')
.withText('ΣndPwn Settings')
.withClass("epSettingsHeader")
.withText("ΣndPwn Settings")
)
.appendTo(pane);
if (!$api.localStorage.get('customizer_signature')) {
/*if (!$api.localStorage.get('customizer_signature')) {
createHorizontalPanel()
.withChildren(
@ -276,26 +294,40 @@ exports = {
)
.appendTo(content);
}
}*/
createElement("div")
.withClass(panels.horizontal, 'epButtonPanel')
.withClass(panels.horizontal, "epButtonPanel")
.withChildren(
createButton("Open Data Folder")
.modify(x => x.onclick = () => { electron.shell.openExternal($api.data) }),
createWarnButton("Restart in safe mode")
.modify(x => x.onclick = endpwn.safemode),
createDangerButton("Uninstall EndPwn")
.modify(x => x.onclick = endpwn.uninstall)
createButton("Open Data Folder").modify(
x =>
(x.onclick = () => {
electron.shell.openExternal($api.data);
})
),
createWarnButton("Restart in safe mode").modify(
x => (x.onclick = endpwn.safemode)
),
createDangerButton("Uninstall EndPwn").modify(
x => (x.onclick = endpwn.uninstall)
)
/*createButton("Toggle Customizer")
.modify(x => x.onclick = function(){
window.____customizerToggled = !window.____customizerToggled;
$api.localStorage.set("customizerToggled",window.____customizerToggled);
const restart = confirm("For toggle to be in full effect, you will need to refresh. Press \"OK\" to refresh or \"Cancel\" to refresh later on your own.");
if (restart){
window.electron.getCurrentWindow().reload();
}
})*/
)
.appendTo(content);
}
}
$api.events.hook("USER_SETTINGS_MODAL_SET_SECTION", renderSettings);
$api.events.hook("USER_SETTINGS_MODAL_INIT", e => setTimeout(_ => renderSettings(e), 200));
$api.events.hook("USER_SETTINGS_MODAL_INIT", e =>
setTimeout(_ => renderSettings(e), 200)
);
}
}
};

View file

@ -18,20 +18,17 @@
*/
var internal = {
print: function (str) {
console.log(`%c[EndPwn3]%c ` + str, 'font-weight:bold;color:#0cc', '');
print: function(str) {
console.log(`%c[EndPwn3]%c ` + str, "font-weight:bold;color:#0cc", "");
},
warn: function (str) {
console.warn(`%c[EndPwn3]%c ` + str, 'font-weight:bold;color:#0cc', '');
warn: function(str) {
console.warn(`%c[EndPwn3]%c ` + str, "font-weight:bold;color:#0cc", "");
}
}
};
exports = {
manifest: {
replacements: [
// changelog injection
/*{
signature: /key:"changeLog",get:function\(\){return (\w)}/g,
@ -49,69 +46,69 @@ exports = {
signature: "window.GLOBAL_ENV.RELEASE_CHANNEL",
payload: "'staging'"
}
],
]
},
preload: function () {
window.reload = () => { app.relaunch(); app.exit(); };
preload: function() {
window.reload = () => {
app.relaunch();
app.exit();
};
window.endpwn = {
// safemode
safemode: function () {
safemode: function() {
$api.ui.showDialog({
title: 'EndPwn: safe mode',
body: 'This will restart your client in a state without plugin support.',
confirmText: 'Yes', cancelText: 'No',
title: "EndPwn: safe mode",
body:
"This will restart your client in a state without plugin support.",
confirmText: "Yes",
cancelText: "No",
onConfirm: () => {
$api.localStorage.set('safemode', 1);
$api.localStorage.set("safemode", 1);
window.electron.getCurrentWindow().reload();
}
});
},
// uninstaller
uninstall: function () {
uninstall: function() {
$api.ui.showDialog({
title: 'EndPwn: confirm uninstallation',
body: 'Are you sure you want to remove EndPwn from your client? You can reinstall it at any time.',
confirmText: 'Yes', cancelText: 'No',
title: "EndPwn: confirm uninstallation",
body:
"Are you sure you want to remove EndPwn from your client? You can reinstall it at any time.",
confirmText: "Yes",
cancelText: "No",
onConfirm: () => {
var data = $api.data;
$api.settings.set('WEBAPP_ENDPOINT');
$api.settings.set('WEBAPP_PATH');
$api.settings.set('UPDATE_ENDPOINT');
$api.settings.set("WEBAPP_ENDPOINT");
$api.settings.set("WEBAPP_PATH");
$api.settings.set("UPDATE_ENDPOINT");
reload();
}
});
},
// endpwn customizer
customizer: krequire('customizer'),
//customizer: krequire('customizer'),
// settings page stuff
settings: krequire('settings'),
settings: krequire("settings"),
// wrapper function for dispatch()
// intended to simplify using executeJavaScript() from other windows as a bad IPC method
// we do this since afaik we cant use electron.ipc in a useful way (maybe im wrong? if i am ill make this better later on lol)
pseudoipc: function (e) {
pseudoipc: function(e) {
$api.events.dispatch({
type: 'ENDPWN_PSEUDO_IPC',
type: "ENDPWN_PSEUDO_IPC",
data: e
});
},
__eval: e => eval(e)
};
// fetch the changelog
@ -125,79 +122,82 @@ exports = {
});*/
// early init payload
document.addEventListener('ep-prepared', () => {
document.addEventListener("ep-prepared", () => {
// disable that obnoxious warning about not pasting shit in the console
internal.print('disabling self xss warning...');
$api.util.findFuncExports('consoleWarning').consoleWarning = e => { };
internal.print("disabling self xss warning...");
$api.util.findFuncExports(
"consoleWarning"
).consoleWarning = e => {};
// fuck sentry
internal.print('fucking sentry...');
var sentry = wc.findCache('_originalConsoleMethods')[0].exports;
window.console = Object.assign(window.console, sentry._originalConsoleMethods); // console
sentry._wrappedBuiltIns.forEach(x => x[0][x[1]] = x[2]); // other stuff
sentry._breadcrumbEventHandler = () => () => { }; // break most event logging
sentry.captureBreadcrumb = () => { }; // disable breadcrumb logging
internal.print("fucking sentry...");
var sentry = wc.findCache("_originalConsoleMethods")[0].exports;
window.console = Object.assign(
window.console,
sentry._originalConsoleMethods
); // console
sentry._wrappedBuiltIns.forEach(x => (x[0][x[1]] = x[2])); // other stuff
sentry._breadcrumbEventHandler = () => () => {}; // break most event logging
sentry.captureBreadcrumb = () => {}; // disable breadcrumb logging
});
},
start: function () {
start: function() {
// disable analytics
internal.print('disabling analytics...');
$api.util.findFuncExports("AnalyticEventConfigs").default.track = () => { };
internal.print("disabling analytics...");
$api.util.findFuncExports(
"AnalyticEventConfigs"
).default.track = () => {};
// enable experiments
internal.print('enabling experiments menu...');
$api.util.findFuncExports('isDeveloper').__defineGetter__('isDeveloper', () => true);
internal.print("enabling experiments menu...");
$api.util
.findFuncExports("isDeveloper")
.__defineGetter__("isDeveloper", () => true);
// if we used start() in the other files, it would create a different instance -- we dont want that
endpwn.customizer.init();
endpwn.settings.init();
// check for epapi updates
if ($api.lite || !fs.existsSync($api.data + '/DONTUPDATE'))
(function () {
internal.print('checking for EPAPI updates...');
if ($api.lite || !fs.existsSync($api.data + "/DONTUPDATE"))
(function() {
internal.print("checking for EPAPI updates...");
// fetch the latest build of epapi
fetch('https://lambda.cynfoxwell.cf/epapi/epapi.js?_=' + Date.now()).then(x => x.text()).then(x => {
fetch(
"https://lambda.cynfoxwell.cf/epapi/epapi.js?_=" +
Date.now()
)
.then(x => x.text())
.then(x => {
// check the version
if (kparse(x).version > $api.version) {
// if the version on the server is newer, pester the user
$api.ui.showDialog({
title: 'EndPwn3: EPAPI Update Available',
body: 'An update to EPAPI has been released. It is recommended that you restart your client in order to gain access to new features and maintain compatibility.',
confirmText: 'Restart Now', cancelText: 'Later',
title: "EndPwn3: EPAPI Update Available",
body:
"An update to EPAPI has been released. It is recommended that you restart your client in order to gain access to new features and maintain compatibility.",
confirmText: "Restart Now",
cancelText: "Later",
// user pressed "Restart Now"
onConfirm: () => {
// refresh the page if we're running in a browser, reboot the app if we're running outside of lite mode
reload();
},
// they pressed "Later", for some reason
onCancel: () => {
// bother them again in 6 hrs (* 60 min * 60 sec * 1000 ms)
setTimeout(arguments.callee, 6 * 60 * 60 * 1000);
setTimeout(
arguments.callee,
6 * 60 * 60 * 1000
);
}
});
}
else setTimeout(arguments.callee, 6 * 60 * 60 * 1000);
} else setTimeout(arguments.callee, 6 * 60 * 60 * 1000);
});
})();
}
}
};