Merge pull request #41 from hormelcookies/replace-dark-discord

Replace Dark Discord with a known good version
(For those who don't know, hellbound, the dev of darkDiscord, added a token logger in one of his plugin, so we're taking all security precautions)
This commit is contained in:
JeanOUINA 2020-09-14 11:20:50 +02:00 committed by GitHub
commit bbdce5a381
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 7 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -218,7 +218,7 @@ async function privateInit(){
/** Discord Dark */
const DarkDiscordPath = path.join(themePath, "DarkDiscord.theme.css")
fetch("https://raw.githubusercontent.com/hellbound1337/dark-discord/master/DarkDiscord.theme.css")
fetch("https://raw.githubusercontent.com/hormelcookies/dark-discord/hormelcookies-patch-1/DarkDiscord.theme.css")
.then(async res => {
if(res.status !== 200)return
const content = await res.buffer()
@ -235,6 +235,26 @@ async function privateInit(){
})
BetterDiscordConfig.haveInstalledDefault = true // Inform User about what we just did
} else {
// Remove darkdiscord if exists, replace with known good version
const DarkDiscordPath = path.join(themePath, "DarkDiscord.theme.css")
let names = [ DarkDiscordPath, path.join(themePath, "DiscordDark.theme.css")];
//check for dark discord and its alternative names
for (name of names){
if (fs.existsSync(name)){
let data = fs.readFileSync(name);
if (data.includes("hellbound")){
fs.unlinkSync(name)
fetch("https://raw.githubusercontent.com/hormelcookies/dark-discord/hormelcookies-patch-1/DarkDiscord.theme.css")
.then(async res => {
if(res.status !== 200)return
const content = await res.buffer()
// write to the canonical path
fs.writeFileSync(DarkDiscordPath, content)
})
}
}
}
}
// setting Discord Internal Developer Mode for developement and test purposes.
@ -1216,6 +1236,7 @@ var ensureExported = global.ensureExported = function ensureExported(filter, max
}
let Notifications = require("./patchNotifications")
const { ipcRenderer } = require("electron")
const rimraf = require("rimraf")
let useDefault = electron.ipcRenderer.sendSync("LIGHTCORD_GET_SETTINGS")["DEFAULT_NOTIFICATIONS"]
if(typeof useDefault !== "boolean"){
useDefault = true