|
|
|
@ -1,22 +1,26 @@
|
|
|
|
|
export default {
|
|
|
|
|
timeout: undefined,
|
|
|
|
|
noWebpack() {
|
|
|
|
|
if (!window.webpackChunkdiscord_app) {
|
|
|
|
|
return true
|
|
|
|
|
} else if (window.webpackChunkdiscord_app.length < 62) {
|
|
|
|
|
} else if (window.webpackChunkdiscord_app?.length < 56) {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
return false
|
|
|
|
|
},
|
|
|
|
|
async start() {
|
|
|
|
|
const text = await (await fetch("https://git.ruthenic.com/Demon/demoncord-rewrite/raw/branch/master/dist/build.js", {cache: "no-store"})).text()
|
|
|
|
|
await this.inject(text);
|
|
|
|
|
console.log("Starting attempts to load Demoncord...")
|
|
|
|
|
const text = await (await fetch("https://cors.ruthenic.com/https://git.ruthenic.com/Demon/demoncord-rewrite/raw/branch/master/dist/build.js", {cache: "no-store"})).text()
|
|
|
|
|
this.timeout = setInterval(() => this.inject(text), 1e3)
|
|
|
|
|
},
|
|
|
|
|
async inject(code) {
|
|
|
|
|
inject(code) {
|
|
|
|
|
if (this.noWebpack()) {
|
|
|
|
|
return setTimeout(()=>this.inject(code), 1e3)
|
|
|
|
|
console.log(`Failed to start Demoncord: ${window.webpackChunkdiscord_app?.length}`)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
console.log("Starting Demoncord!")
|
|
|
|
|
eval(code)
|
|
|
|
|
clearInterval(this.timeout)
|
|
|
|
|
},
|
|
|
|
|
stop() {
|
|
|
|
|
console.log("Uninjecting is overrated.")
|
|
|
|
|