├── .gitignore ├── README.md ├── patches.js └── patches ├── CallConfirmation.js ├── CallConfirmation.json ├── DisableNSFWChannelGate.json ├── DisableNSFWGate.json ├── EnableStaging.json ├── Settings.js ├── Settings.json └── SilentTyping.json /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | packages/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DiscordExtras patches 2 | 3 | This repository contains the patches made for DiscordExtras. 4 | If you wanna make your own patches, just look at the currently available patches and try to create your own based off that. 5 | Just edit `patches.js` to set your name before bundling them as deb files for your own use. 6 | NOTE: You'll need `dpkg-deb` installed on your computer if you wanna be able to compile the deb yourself. 7 | 8 | # Patches format 9 | The patches are just JSON files with a list of patches to apply like so: 10 | ```JSON 11 | { 12 | "patches": [ 13 | { 14 | "find": "regex_goes_here", 15 | "replace": "replace_with" 16 | } 17 | ] 18 | } 19 | ``` 20 | The find value can either be a simple string to find and replace, or it can also be regex. 21 | NOTE: The patching tool is implemented in Golang and so the regex should be using the Golang format. -------------------------------------------------------------------------------- /patches.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const { execSync } = require('child_process'); 4 | 5 | const template = `Package: package_name 6 | Name: patch_name 7 | Version: patch_version 8 | Architecture: iphoneos-arm 9 | Description: patch_description 10 | Maintainer: patch_author 11 | Author: patch_author 12 | Section: Patches 13 | Depends: moe.panties.discordextras 14 | `; 15 | 16 | if (!fs.existsSync("packages")) { 17 | fs.mkdirSync("packages"); 18 | } 19 | 20 | if (fs.existsSync("temp")) { 21 | fs.rmdirSync("temp", { recursive: true }); 22 | } 23 | 24 | fs.mkdirSync("temp"); 25 | 26 | const patches = fs.readdirSync("patches"); 27 | const packages = fs.readdirSync("packages"); 28 | 29 | for (const patch of patches) { 30 | if (!patch.includes(".json")) continue; 31 | const patchInfo = JSON.parse(fs.readFileSync(`patches/${patch}`, { encoding: 'utf-8' })); 32 | const patchName = patch.replace('.json', '').toLowerCase(); 33 | const tempFolder = `temp/${patchName}`; 34 | 35 | fs.mkdirSync(tempFolder); 36 | fs.mkdirSync(`${tempFolder}/DEBIAN`); 37 | fs.mkdirSync(`${tempFolder}/Library/Application Support/DiscordExtrasFiles.bundle/patches/`, { recursive: true }); 38 | 39 | const packageName = `moe.panties.${patchName}`; 40 | const version = packages.filter(package => package.includes(patchName)).length; 41 | 42 | const controlFile = template 43 | .replace('package_name', packageName) 44 | .replace('patch_name', patch.replace('.json', '')) 45 | .replace('patch_description', patchInfo.description) 46 | .replaceAll('patch_author', patchInfo.author) 47 | .replace('patch_version', `1.0.0-${version + 1}`); 48 | 49 | fs.writeFileSync(`${tempFolder}/DEBIAN/control`, controlFile); 50 | fs.copyFileSync(`patches/${patch}`, `${tempFolder}/Library/Application Support/DiscordExtrasFiles.bundle/patches/${patch}`); 51 | 52 | const jsFile = patch.replace('.json', '.js'); 53 | if (fs.existsSync(`patches/${jsFile}`)) { 54 | fs.copyFileSync(`patches/${jsFile}`, `${tempFolder}/Library/Application Support/DiscordExtrasFiles.bundle/patches/${jsFile}`); 55 | } 56 | 57 | execSync(`dpkg-deb --build ${tempFolder}`); 58 | fs.renameSync(`temp/${patchName}.deb`, `packages/${patchName}_1.0.0-${version + 1}_iphoneos-arm.deb`) 59 | } 60 | 61 | fs.rmdirSync("temp", { recursive: true }); -------------------------------------------------------------------------------- /patches/CallConfirmation.js: -------------------------------------------------------------------------------- 1 | var channelName=(0,cmod1.computeChannelName)(n,A.default,M.default);C.default.show({title: "Call?", body: `Are you sure you want to start a call with ${channelName}?`,confirmText:"Yes, start the call",cancelText:"Nope, that was an accident",onConfirm:function(){o.default.call(n.id,l,u&&!n.isManaged(),s,function(){return T(n)})},onCancel: N.NOOP}) -------------------------------------------------------------------------------- /patches/CallConfirmation.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Adds a confirmation screen before starting a call in DMs.", 3 | "author": "Aspen", 4 | "modules": { 5 | "find": [ 6 | "e.computeChannelName" 7 | ] 8 | }, 9 | "patches": [ 10 | { 11 | "find": "o.default.call(n.id,l,u&&!n.isManaged(),s,function(){return T(n)})", 12 | "freplace": 0 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /patches/DisableNSFWChannelGate.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Lets you bypass NSFW Channel gate", 3 | "author": "DjDeveloperr", 4 | "patches": [ 5 | { 6 | "rfind": "=\\w\\.nsfw_allowed;", 7 | "replace": "=true;" 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /patches/DisableNSFWGate.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Let's you access NSFW servers on Discord iOS", 3 | "author": "Zoey", 4 | "patches": [ 5 | { 6 | "rfind": ".\\.default\\.getCurrentConfig\\({}\\)\\.showNsfwGate", 7 | "replace": "false" 8 | }, 9 | { 10 | "rfind": "isNSFWGuild=function\\((.*)\\){.*}", 11 | "replace": "isNSFWGuild=function($1){return false}}" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /patches/EnableStaging.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Enable staging mode for the app, it'll enable dev mode and let you use experiments.", 3 | "author": "Zoey", 4 | "patches": [ 5 | { 6 | "find": "g.window.GLOBAL_ENV.RELEASE_CHANNEL=process.env.RELEASE_CHANNEL", 7 | "replace": "g.window.GLOBAL_ENV.RELEASE_CHANNEL='staging'" 8 | } 9 | ] 10 | } -------------------------------------------------------------------------------- /patches/Settings.js: -------------------------------------------------------------------------------- 1 | {key:"renderDiscordExtras",value:function(){return(0,h.default)(J.FormSection,{title:"DiscordExtras Settings",titleTextStyle:ie.titleText,titleWrapperStyle:ie.titleWrapper},void 0,(0,h.default)(J.FormRow,{label:"Version",value:"3.0.0"}),(0,h.default)(J.FormDivider,{}),(0,h.default)(J.FormRow,{label:"GitHub",arrowShown:!0,onPress:function(){y.default.openURL("//github.com/NotZoeyDev/DiscordExtras")}}),(0,h.default)(J.FormDivider,{}),(0,h.default)(J.FormRow,{label:"Twitter",arrowShown:!0,onPress:function(){y.default.openURL("//twitter.com/smolzoey")}}))}}, 2 | -------------------------------------------------------------------------------- /patches/Settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Add DiscordExtras information inside Discord's settings panel.", 3 | "author": "Zoey", 4 | "patches": [ 5 | { 6 | "rfind": "this.renderChangeLog\\(\\)", 7 | "append": ",this.renderDiscordExtras()" 8 | }, 9 | { 10 | "rfind": "this.renderRestorePremium\\(\\)\\)}},", 11 | "fappend": 0 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /patches/SilentTyping.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Silences your typing indicator when you type.", 3 | "author": "eternal#1000", 4 | "patches": [ 5 | { 6 | "rfind": "startTyping:function\\((.?)\\){.*?}\\)}", 7 | "replace": "startTyping:function($1){}" 8 | } 9 | ] 10 | } 11 | --------------------------------------------------------------------------------