-
-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More docs stuff and move some components
- Loading branch information
Showing
24 changed files
with
256 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,6 @@ settings/*.json | |
|
||
config.json | ||
*injected.txt | ||
|
||
# whats dis | ||
src/Powercord/plugins/pc-april/classified/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
const { randomBytes, scryptSync, createCipheriv, createDecipheriv } = require('crypto'); | ||
const { existsSync } = require('fs'); | ||
const { resolve } = require('path'); | ||
const { readdir, readFile, writeFile, unlink } = require('fs').promises; | ||
const filenames = require('./filenames'); | ||
|
||
const encryptor = { | ||
async encrypt (passphrase) { | ||
if (!existsSync(this.src)) { | ||
throw new Error('You don\'t seem to have the classified source files'); | ||
} | ||
|
||
await this._cleanupFiles(); | ||
const files = await readdir(this.src); | ||
|
||
// IV + salt | ||
const iv = randomBytes(16); | ||
const salt = randomBytes(32); | ||
await writeFile(resolve(this.path, 'iv.enc'), iv); | ||
await writeFile(resolve(this.path, 'salt.enc'), salt); | ||
|
||
// Key | ||
const key = scryptSync(passphrase, salt, 32); | ||
for (const file of files) { | ||
// Encryption | ||
const cipher = createCipheriv('aes-256-cbc', key, iv); | ||
let encrypted = cipher.update(await readFile(resolve(this.src, file), 'utf8')); | ||
encrypted = Buffer.concat([ encrypted, cipher.final() ]); | ||
|
||
// Write | ||
await writeFile(resolve(this.path, `${this.filename}.js.enc`), encrypted); | ||
} | ||
}, | ||
|
||
async decrypt (passphrase) { | ||
const memes = []; | ||
const iv = await readFile(resolve(this.path, 'iv.enc')); | ||
const salt = await readFile(resolve(this.path, 'salt.enc')); | ||
const key = scryptSync(passphrase, salt, 32); | ||
const files = await readdir(this.path); | ||
for (const file of files) { | ||
if ([ 'iv.enc', 'salt.enc' ].includes(file)) { | ||
continue; | ||
} | ||
|
||
const encrypted = await readFile(resolve(this.path, file)); | ||
const decipher = createDecipheriv('aes-256-cbc', key, iv); | ||
let decrypted = decipher.update(encrypted); | ||
decrypted = Buffer.concat([ decrypted, decipher.final() ]); | ||
// eslint-disable-next-line no-eval | ||
memes.push(eval(decrypted.toString())); | ||
} | ||
return memes; | ||
}, | ||
|
||
async _cleanupFiles () { | ||
const files = await readdir(this.path); | ||
for (const file of files) { | ||
await unlink(resolve(this.path, file)); | ||
} | ||
}, | ||
|
||
get src () { | ||
return resolve(__dirname, 'classified'); | ||
}, | ||
|
||
get path () { | ||
return resolve(__dirname, 'f_o_o_l_s'); | ||
}, | ||
|
||
get filename () { | ||
return filenames[Math.floor(Math.random() * filenames.length)]; | ||
} | ||
}; | ||
|
||
module.exports = encryptor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
�1|�3�Cx��U | ||
��:��0i��6����r%VӊʄW?8a�� | ||
|������) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
��B��i*�����o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
��z��o���?G�Y���������ov�� |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module.exports = [ | ||
'emma_is_cute', | ||
'cute', | ||
'whatsdis', | ||
'lighttheme', | ||
'facebook', | ||
'system32', | ||
'hahayes', | ||
'docker', | ||
'deletthis', | ||
'kpop', | ||
'ratelimited', | ||
'idk_if_ppl_will_like_this', | ||
'should_be_fun', | ||
'whatever', | ||
'im_proud_of_this_one', | ||
'eyes', | ||
'zoomeyes', | ||
'cool', | ||
'epic', | ||
'emma_is_v_cute' | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const { Plugin } = require('powercord/entities'); | ||
const encryptor = require('./encryptor'); | ||
|
||
module.exports = class Test extends Plugin { | ||
constructor () { | ||
super(); | ||
// for ez access in console | ||
this.encryptor = encryptor; | ||
} | ||
|
||
// eslint-disable-next-line no-empty-function | ||
startPlugin () {} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "April Fools", | ||
"version": "1.0.0", | ||
"description": "wats this", | ||
"author": "Powercord Team", | ||
"license": "MIT" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,100 +1,2 @@ | ||
@import "./reload"; | ||
@import "./plugin"; | ||
|
||
.powercord-plugin-soon { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
|
||
img { | ||
margin-top: 45px; | ||
margin-bottom: 35px; | ||
} | ||
|
||
p { | ||
font-size: 18px; | ||
margin-bottom: 0; | ||
opacity: .7; | ||
} | ||
|
||
div { | ||
margin-top: 20px; | ||
display: flex; | ||
|
||
a { | ||
margin: 0 10px; | ||
} | ||
} | ||
} | ||
|
||
.powercord-plugins { | ||
color: var(--text-normal); | ||
|
||
&-wip { | ||
margin-bottom: 20px; | ||
} | ||
|
||
&-header { | ||
display: flex; | ||
align-items: center; | ||
margin-bottom: 20px; | ||
|
||
h3 { | ||
font-size: 18px; | ||
flex: 1; | ||
} | ||
} | ||
|
||
&-topbar { | ||
margin-top: 20px; | ||
display: flex; | ||
align-items: center; | ||
|
||
> div { | ||
flex: 1; | ||
|
||
+ button { | ||
margin-left: 15px; | ||
} | ||
|
||
> :last-child { | ||
display: none; | ||
} | ||
} | ||
|
||
input { | ||
height: 32px; | ||
} | ||
} | ||
|
||
&-modal { | ||
color: var(--text-normal); | ||
|
||
span + span { | ||
margin-top: 20px; | ||
display: block; | ||
} | ||
|
||
ul { | ||
margin-top: 25px; | ||
padding-left: 20px; | ||
list-style-type: initial; | ||
|
||
li { | ||
margin: 5px 0; | ||
} | ||
} | ||
} | ||
} | ||
|
||
.powercord-folders-opener { | ||
margin-left: 15px; | ||
flex: 0 0 auto; | ||
display: flex; | ||
|
||
button { | ||
&:not(:last-child) { | ||
margin-right: 15px; | ||
} | ||
} | ||
} | ||
@import "../scss_legacy/style"; | ||
@import "../scss_legacy/plugin"; |
File renamed without changes.
Oops, something went wrong.