Compare commits
195 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc1c315089 | ||
|
|
bdb8216baa | ||
|
|
f6972bb964 | ||
|
|
ec908963bf | ||
|
|
0a901de7ef | ||
|
|
0ae6b217c3 | ||
|
|
30e325d1e6 | ||
|
|
b17686afdf | ||
|
|
eb72692e57 | ||
|
|
ee83314fb6 | ||
|
|
feb03a25f6 | ||
|
|
add94265ae | ||
|
|
dbb0b4bd9e | ||
|
|
1f3a5262b7 | ||
|
|
1450dc20af | ||
|
|
9fd141a158 | ||
|
|
68660a2e06 | ||
|
|
9984b28e45 | ||
|
|
2afe338c87 | ||
|
|
ef3fd12199 | ||
|
|
f111ad4cea | ||
|
|
d85f28012d | ||
|
|
e49f1f9f06 | ||
|
|
1ef5817cdb | ||
|
|
075a83c41c | ||
|
|
7758595fbd | ||
|
|
e10cd63ea0 | ||
|
|
08f2eba392 | ||
|
|
e201bc5839 | ||
|
|
110ecaf19a | ||
|
|
68281d0b6c | ||
|
|
02ebd331de | ||
|
|
eeb9c9ddcb | ||
|
|
ac9fef7e03 | ||
|
|
ac5caa747d | ||
|
|
4f7df6de63 | ||
|
|
90d4d47303 | ||
|
|
dcd8811652 | ||
|
|
225c1e13a0 | ||
|
|
f910478079 | ||
|
|
69c02e1fb5 | ||
|
|
abde8e96a7 | ||
|
|
98e5509bd5 | ||
|
|
a7844b86e3 | ||
|
|
262562f050 | ||
|
|
b12d44d10e | ||
|
|
e9e8efbb66 | ||
|
|
e0a85bb003 | ||
|
|
77bfd4ef15 | ||
|
|
0931d85c74 | ||
|
|
1d0aa92b62 | ||
|
|
f6b285ff22 | ||
|
|
64a4df26fc | ||
|
|
e38c785aae | ||
|
|
2d96fad40e | ||
|
|
0990faa41d | ||
|
|
dc93b81ae1 | ||
|
|
2448c87def | ||
|
|
5205d8559f | ||
|
|
6bbf0a3c07 | ||
|
|
af23275735 | ||
|
|
0e25a20ba0 | ||
|
|
b0e1180182 | ||
|
|
68dc8238c3 | ||
|
|
7f99346971 | ||
|
|
401165eb34 | ||
|
|
19d3493322 | ||
|
|
a56b432fba | ||
|
|
414cf25ae8 | ||
|
|
1523b51108 | ||
|
|
20d6ff15ea | ||
|
|
036de69acd | ||
|
|
945acc1738 | ||
|
|
5fa10f606a | ||
|
|
36336f738f | ||
|
|
5cdd217017 | ||
|
|
cd4679913a | ||
|
|
a4009897c2 | ||
|
|
1352abed03 | ||
|
|
47be786461 | ||
|
|
aa90f479e8 | ||
|
|
87cd9ab347 | ||
|
|
5b4cc43637 | ||
|
|
8b9fa8d964 | ||
|
|
01a8686542 | ||
|
|
52bc899440 | ||
|
|
0512796945 | ||
|
|
0a92bc4363 | ||
|
|
7273bd52fa | ||
|
|
985355976e | ||
|
|
3f92812707 | ||
|
|
57fc0b2ab2 | ||
|
|
86ca221428 | ||
|
|
0d7a5b8612 | ||
|
|
f31e0d0587 | ||
|
|
4427217cb2 | ||
|
|
c297b946f4 | ||
|
|
077616dca1 | ||
|
|
c007af6500 | ||
|
|
36febf010c | ||
|
|
f6b18053d9 | ||
|
|
9a1ab563b7 | ||
|
|
a0766a8ddc | ||
|
|
08a6017103 | ||
|
|
4c10ace879 | ||
|
|
2216045a50 | ||
|
|
9894d8e8c4 | ||
|
|
0dfa1e0a0a | ||
|
|
926b393c0f | ||
|
|
f688e4dfc6 | ||
|
|
9f1f3cf5f3 | ||
|
|
c7f2c1fad8 | ||
|
|
b1df00ac39 | ||
|
|
60af217859 | ||
|
|
6e34da9d91 | ||
|
|
07f7566c13 | ||
|
|
66ae261fe3 | ||
|
|
e8b9a337b5 | ||
|
|
c965aa5907 | ||
|
|
3f709f82cc | ||
|
|
972d7e7836 | ||
|
|
335bb4ab5e | ||
|
|
a4dd0601b0 | ||
|
|
d2e9499d6f | ||
|
|
a0bc249936 | ||
|
|
46eeaa27c4 | ||
|
|
6a34ad83ef | ||
|
|
a628bf2850 | ||
|
|
ff2e341a1a | ||
|
|
4f6f5b636b | ||
|
|
fdcc756281 | ||
|
|
5750fff8d7 | ||
|
|
923039adb2 | ||
|
|
153e459665 | ||
|
|
2e75085b72 | ||
|
|
6347f7d86e | ||
|
|
829cb397a8 | ||
|
|
b791dfe045 | ||
|
|
6a20f5cdf3 | ||
|
|
b5279af2c5 | ||
|
|
f56b894e4a | ||
|
|
f18029cfc2 | ||
|
|
78c9999e97 | ||
|
|
bd177b9bf1 | ||
|
|
21bdd39803 | ||
|
|
f8047bb853 | ||
|
|
ba344ac3fb | ||
|
|
b474285180 | ||
|
|
0ac9ee6dd3 | ||
|
|
55233fda91 | ||
|
|
ac17136640 | ||
|
|
b99e851af9 | ||
|
|
5e5d635a09 | ||
|
|
dac035fb5f | ||
|
|
16cd982554 | ||
|
|
7396fca9fc | ||
|
|
0b6d648615 | ||
|
|
3449b76df3 | ||
|
|
9b416830ab | ||
|
|
9922386c18 | ||
|
|
1ebb81bf96 | ||
|
|
c3f619dc79 | ||
|
|
8f9444ab54 | ||
|
|
19d0419a2f | ||
|
|
23083003e9 | ||
|
|
0861a24c0c | ||
|
|
13593d8f41 | ||
|
|
c0c910a2b3 | ||
|
|
2a1eccff80 | ||
|
|
3ca0f5443a | ||
|
|
bed19ed24b | ||
|
|
8909be4543 | ||
|
|
c079a9ecae | ||
|
|
de3194fecc | ||
|
|
92f22ba309 | ||
|
|
75625016a9 | ||
|
|
ec673af07b | ||
|
|
867810ecf9 | ||
|
|
80ce7006ba | ||
|
|
9beb2576a2 | ||
|
|
016a4589ea | ||
|
|
7d068dcf17 | ||
|
|
1ec1ac535a | ||
|
|
18b5e4d66a | ||
|
|
af881aaf07 | ||
|
|
daaeceed91 | ||
|
|
d8a6d14088 | ||
|
|
29d35c42e2 | ||
|
|
a982c7cd1d | ||
|
|
1232995cd9 | ||
|
|
c95e5062d0 | ||
|
|
d1380a5772 | ||
|
|
3339e7ce02 | ||
|
|
81f0f5c2c5 | ||
|
|
cc31d09118 |
23 changed files with 387 additions and 83 deletions
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
|
|
@ -98,7 +98,7 @@ jobs:
|
||||||
tag_name: ${{ steps.prepare.outputs.tag }}
|
tag_name: ${{ steps.prepare.outputs.tag }}
|
||||||
name: Release ${{ steps.prepare.outputs.tag }}
|
name: Release ${{ steps.prepare.outputs.tag }}
|
||||||
files: |
|
files: |
|
||||||
dist/shiggycord.js
|
dist/gooncord.js
|
||||||
dist/shiggycord.min.js
|
dist/gooncord.min.js
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
|
||||||
23
README.md
23
README.md
|
|
@ -1,39 +1,40 @@
|
||||||
# ShiggyCord [](https://discord.shiggycord.dev)
|
# GoonCord [](https://discord.gg/nQykFF9Ud6)
|
||||||
|
|
||||||
Bundle based on Kettu, made just for fun
|
An unofficial fork of ShiggyGord, made just for fun
|
||||||
|
Idea taken from me
|
||||||
|
|
||||||
## Installing
|
## Installing
|
||||||
|
|
||||||
### Android
|
### Android
|
||||||
|
|
||||||
- Rooted: [Shiggy Xposed](https://github.com/kmmiio99o/ShiggyXposed)
|
- Rooted: [Goon Xposed](https://github.com/OTKUSteyler/GoonXposed)
|
||||||
|
|
||||||
- Non-Rooted: [Shiggy Manager](https://github.com/kmmiio99o/ShiggyManager)
|
- Non-Rooted: [Goon Manger](https://github.com/OTKUSteyler/GoonManager)
|
||||||
|
|
||||||
### Android/iOS
|
### Android/iOS
|
||||||
- **Injecting bundle:**
|
- **Injecting bundle:**
|
||||||
```url
|
```url
|
||||||
https://github.com/kmmiio99o/ShiggyCord/releases/latest/download/shiggycord.js
|
https://github.com/OTKUSteyler/GoonCord/releases/latest/download/gooncord.js
|
||||||
```
|
```
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
1. Install a ShiggyCord loader with loader config support (any mentioned in the [Installing](#installing) section).
|
1. Install a GoonCord loader with loader config support (any mentioned in the [Installing](#installing) section).
|
||||||
1. Go to Settings > General and enable Developer Settings.
|
1. Go to Settings > General and enable Developer Settings.
|
||||||
1. Clone the repo:
|
1. Clone the repo:
|
||||||
```
|
```
|
||||||
git clone https://github.com/kmmiio99o/Shiggycord.git
|
git clone https://github.com/OTKUSteyler/GoonCord.git
|
||||||
```
|
```
|
||||||
1. Install dependencies:
|
1. Install dependencies:
|
||||||
```
|
```
|
||||||
bun i
|
bun i
|
||||||
```
|
```
|
||||||
1. Build ShiggyCord's code:
|
1. Build GoonCord's code:
|
||||||
```
|
```
|
||||||
bun run build
|
bun run build
|
||||||
```
|
```
|
||||||
1. In the newly created `dist` directory, run a HTTP server. I recommend [http-server](https://www.npmjs.com/package/http-server).
|
1. In the newly created `dist` directory, run a HTTP server. I recommend [http-server](https://www.npmjs.com/package/http-server).
|
||||||
1. Go to Settings > Developer enabled earlier. Enable `Load from custom url` and input the IP address and port of the server (e.g. `http://192.168.1.236:4040/shiggycord.js`) in the new input box labelled `ShiggyCord URL`.
|
1. Go to Settings > Developer enabled earlier. Enable `Load from custom url` and input the IP address and port of the server (e.g. `http://192.168.1.236:4040/gooncord.js`) in the new input box labelled `GoonCord URL`.
|
||||||
1. Restart Discord. Upon reload, you should notice that your device will download ShiggyCord's bundled code from your server, rather than GitHub.
|
1. Restart Discord. Upon reload, you should notice that your device will download GoonCord's bundled code from your server, rather than GitHub.
|
||||||
1. Make your changes, rebuild, reload, go wild!
|
1. Make your changes, rebuild, reload, go wild!
|
||||||
|
|
||||||
Alternatively, you can directly *serve* the bundled code by running `bun run serve`. `shiggycord.js` will be served on your local address under the port 4040. You will then insert `http://<local ip address>:4040/shiggycord.js` as a custom url and reload. Whenever you restart your mobile client, the script will rebuild the bundle as your client fetches it.
|
Alternatively, you can directly *serve* the bundled code by running `bun run serve`. `gooncord.js` will be served on your local address under the port 4040. You will then insert `http://<local ip address>:4040/gooncord.js` as a custom url and reload. Whenever you restart your mobile client, the script will rebuild the bundle as your client fetches it.
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
"name": "ShiggyCord",
|
"name": "GoonCord",
|
||||||
"private": true,
|
"private": true,
|
||||||
"author": {
|
"author": {
|
||||||
"name": "kmmiio99o",
|
"name": "OTKUSteyler",
|
||||||
"url": "https://github.com/kmmiio99o"
|
"url": "https://github.com/OTKUSteyler/GoonCord"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "node scripts/build.mjs",
|
"build": "node scripts/build.mjs",
|
||||||
|
|
|
||||||
|
|
@ -30,12 +30,12 @@ let context = null;
|
||||||
const config = {
|
const config = {
|
||||||
entryPoints: ["src/entry.ts"],
|
entryPoints: ["src/entry.ts"],
|
||||||
bundle: true,
|
bundle: true,
|
||||||
outfile: "dist/shiggycord.js",
|
outfile: "dist/gooncord.js",
|
||||||
format: "iife",
|
format: "iife",
|
||||||
splitting: false,
|
splitting: false,
|
||||||
// Enable minification by default for release builds (when a release-branch is provided).
|
// Enable minification by default for release builds (when a release-branch is provided).
|
||||||
// This keeps development builds unminified for easier debugging.
|
// This keeps development builds unminified for easier debugging.
|
||||||
minify: true,
|
minify: false,
|
||||||
external: [],
|
external: [],
|
||||||
supported: {
|
supported: {
|
||||||
// Hermes does not actually support const and let, even though it syntactically
|
// Hermes does not actually support const and let, even though it syntactically
|
||||||
|
|
@ -141,7 +141,7 @@ if (isThisFileBeingRunViaCLI) {
|
||||||
printBuildSuccess(context.hash, releaseBranch, timeTook);
|
printBuildSuccess(context.hash, releaseBranch, timeTook);
|
||||||
|
|
||||||
const { timeTook: minifiedTimeTook } = await buildBundle({
|
const { timeTook: minifiedTimeTook } = await buildBundle({
|
||||||
minify: true,
|
minify: false,
|
||||||
outfile: config.outfile.replace(/\.js$/, ".min.js"),
|
outfile: config.outfile.replace(/\.js$/, ".min.js"),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ export function serve(options) {
|
||||||
if (pathname?.endsWith(".js")) {
|
if (pathname?.endsWith(".js")) {
|
||||||
try {
|
try {
|
||||||
let fileToServe;
|
let fileToServe;
|
||||||
if (pathname === "/shiggycord.min.js") {
|
if (pathname === "/gooncord.min.js") {
|
||||||
const { config, context, timeTook } = await buildBundle({
|
const { config, context, timeTook } = await buildBundle({
|
||||||
minify: true,
|
minify: true,
|
||||||
});
|
});
|
||||||
|
|
@ -30,7 +30,7 @@ export function serve(options) {
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
fileToServe = config.outfile.replace(/\.js$/, ".min.js");
|
fileToServe = config.outfile.replace(/\.js$/, ".min.js");
|
||||||
} else if (pathname === "/shiggycord.js") {
|
} else if (pathname === "/gooncord.js") {
|
||||||
const { config, context, timeTook } = await buildBundle();
|
const { config, context, timeTook } = await buildBundle();
|
||||||
printBuildSuccess(context.hash, args["release-branch"], timeTook);
|
printBuildSuccess(context.hash, args["release-branch"], timeTook);
|
||||||
fileToServe = config.outfile;
|
fileToServe = config.outfile;
|
||||||
|
|
@ -55,7 +55,7 @@ export function serve(options) {
|
||||||
|
|
||||||
server.listen(args.port ?? 4040);
|
server.listen(args.port ?? 4040);
|
||||||
|
|
||||||
console.info(chalk.bold.yellowBright("Serving ShiggyCord on:"));
|
console.info(chalk.bold.yellowBright("Serving GoonCord on:"));
|
||||||
|
|
||||||
const netInterfaces = os.networkInterfaces();
|
const netInterfaces = os.networkInterfaces();
|
||||||
for (const netinterfaces of Object.values(netInterfaces)) {
|
for (const netinterfaces of Object.values(netInterfaces)) {
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 45 KiB |
|
|
@ -8,7 +8,7 @@ import { messageUtil } from "@metro/common";
|
||||||
|
|
||||||
export default () =>
|
export default () =>
|
||||||
<ApplicationCommand>{
|
<ApplicationCommand>{
|
||||||
name: "debug",
|
name: "Goon",
|
||||||
description: Strings.COMMAND_DEBUG_DESC,
|
description: Strings.COMMAND_DEBUG_DESC,
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
|
|
@ -20,8 +20,8 @@ export default () =>
|
||||||
execute([ephemeral], ctx) {
|
execute([ephemeral], ctx) {
|
||||||
const info = getDebugInfo();
|
const info = getDebugInfo();
|
||||||
const content = [
|
const content = [
|
||||||
"**ShiggyCord Debug Info**",
|
"**💦GoonCord Goon Info💦**",
|
||||||
`> ShiggyCord: ${info.bunny.version} (${info.bunny.loader.name} ${info.bunny.loader.version})`,
|
`> GoonCord: ${info.bunny.version} (${info.bunny.loader.name} ${info.bunny.loader.version})`,
|
||||||
`> Discord: ${info.discord.version} (${info.discord.build})`,
|
`> Discord: ${info.discord.version} (${info.discord.build})`,
|
||||||
`> React: ${info.react.version} (RN ${info.react.nativeVersion})`,
|
`> React: ${info.react.version} (RN ${info.react.nativeVersion})`,
|
||||||
`> Hermes: ${info.hermes.version} (bcv${info.hermes.bytecodeVersion})`,
|
`> Hermes: ${info.hermes.version} (bcv${info.hermes.bytecodeVersion})`,
|
||||||
|
|
@ -29,11 +29,13 @@ export default () =>
|
||||||
`> Device: ${info.device.model}`,
|
`> Device: ${info.device.model}`,
|
||||||
].join("\n");
|
].join("\n");
|
||||||
|
|
||||||
if (ephemeral?.value) {
|
if (ephemeral?.value) {
|
||||||
messageUtil.sendBotMessage(ctx.channel.id, content);
|
messageUtil.sendBotMessage(ctx.channel.id, content);
|
||||||
} else {
|
} else {
|
||||||
const fixNonce = (BigInt(Date.now() - 1420070400000) << 22n).toString();
|
const fixNonce = Date.now().toString();
|
||||||
messageUtil.sendMessage(ctx.channel.id, { content }, void 0, {nonce:fixNonce});
|
messageUtil.sendMessage(ctx.channel.id, { content }, void 0, {
|
||||||
}
|
nonce: fixNonce,
|
||||||
}
|
});
|
||||||
};
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
|
||||||
|
|
@ -190,7 +190,7 @@ export default () =>
|
||||||
if (ephemeral?.value) {
|
if (ephemeral?.value) {
|
||||||
messageUtil.sendBotMessage(ctx.channel.id, content);
|
messageUtil.sendBotMessage(ctx.channel.id, content);
|
||||||
} else {
|
} else {
|
||||||
const fixNonce = (BigInt(Date.now() - 1420070400000) << 22n).toString();
|
const fixNonce = Date.now().toString();
|
||||||
messageUtil.sendMessage(ctx.channel.id, { content }, void 0, {
|
messageUtil.sendMessage(ctx.channel.id, { content }, void 0, {
|
||||||
nonce: fixNonce,
|
nonce: fixNonce,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { BundleUpdaterManager } from "@lib/api/native/modules";
|
||||||
|
|
||||||
export default () =>
|
export default () =>
|
||||||
<ApplicationCommand>{
|
<ApplicationCommand>{
|
||||||
name: "reload",
|
name: "ReGoon",
|
||||||
description: Strings.COMMAND_RELOAD_DESC,
|
description: Strings.COMMAND_RELOAD_DESC,
|
||||||
options: [],
|
options: [],
|
||||||
execute() {
|
execute() {
|
||||||
|
|
|
||||||
|
|
@ -4,15 +4,13 @@
|
||||||
"ARE_YOU_SURE_TO_CLEAR_DATA": "Are you sure you wish to clear the data of {name}?",
|
"ARE_YOU_SURE_TO_CLEAR_DATA": "Are you sure you wish to clear the data of {name}?",
|
||||||
"ARE_YOU_SURE_TO_DELETE_PLUGIN": "Are you sure you wish to delete {name}? This will clear all of the plugin's data.",
|
"ARE_YOU_SURE_TO_DELETE_PLUGIN": "Are you sure you wish to delete {name}? This will clear all of the plugin's data.",
|
||||||
"ARE_YOU_SURE_TO_DELETE_THEME": "Are you sure you wish to delete {name}?",
|
"ARE_YOU_SURE_TO_DELETE_THEME": "Are you sure you wish to delete {name}?",
|
||||||
"AUTO_DEBUGGER": "Automatically connect to Debugger",
|
|
||||||
"AUTO_DEVTOOLS": "Automatically connect to Devtools",
|
|
||||||
"ASSET_BROWSER": "Asset Browser",
|
"ASSET_BROWSER": "Asset Browser",
|
||||||
"ASSET_TYPES": "Asset Types",
|
"ASSET_TYPES": "Asset Types",
|
||||||
"IMAGE_FILES": "Image Files",
|
"IMAGE_FILES": "Image Files",
|
||||||
"TEXT_FILES": "Text Files",
|
"TEXT_FILES": "Text Files",
|
||||||
"BRAND": "Brand",
|
"BRAND": "Brand",
|
||||||
"SHIGGYCORD": "ShiggyCord",
|
"SHIGGYCORD": "💦GoonCord💦",
|
||||||
"SHIGGYCORD_URL": "ShiggyCord URL",
|
"SHIGGYCORD_URL": "GoonCord URL",
|
||||||
"BROWSER": "Browser",
|
"BROWSER": "Browser",
|
||||||
"BYTECODE": "Bytecode",
|
"BYTECODE": "Bytecode",
|
||||||
"CANCEL": "Cancel",
|
"CANCEL": "Cancel",
|
||||||
|
|
@ -24,14 +22,13 @@
|
||||||
"CLEAR_DATA_SUCCESSFUL": "Cleared data for {name}",
|
"CLEAR_DATA_SUCCESSFUL": "Cleared data for {name}",
|
||||||
"CODEBERG": "Codeberg",
|
"CODEBERG": "Codeberg",
|
||||||
"CODENAME": "Codename",
|
"CODENAME": "Codename",
|
||||||
"COMMAND_DEBUG_DESC": "Send ShiggyCord debug info.",
|
"COMMAND_DEBUG_DESC": "Send GoonCord debug info.",
|
||||||
"COMMAND_DEBUG_OPT_EPHEMERALLY": "Send debug info ephemerally.",
|
"COMMAND_DEBUG_OPT_EPHEMERALLY": "Send debug info ephemerally.",
|
||||||
"COMMAND_EVAL_DESC": "Evaluate JavaScript code.",
|
"COMMAND_EVAL_DESC": "Evaluate JavaScript code.",
|
||||||
"COMMAND_EVAL_OPT_ASYNC": "Whether to support 'await' in code. Must explicitly return for result (default: false)",
|
"COMMAND_EVAL_OPT_ASYNC": "Whether to support 'await' in code. Must explicitly return for result (default: false)",
|
||||||
"COMMAND_EVAL_OPT_CODE": "The code to evaluate.",
|
"COMMAND_EVAL_OPT_CODE": "The code to evaluate.",
|
||||||
"COMMAND_PLUGINS_DESC": "Send list of installed plugins.",
|
"COMMAND_PLUGINS_DESC": "Send list of installed plugins.",
|
||||||
"COMMAND_PLUGINS_OPT_EPHEMERALLY": "Send plugins list ephemerally.",
|
"COMMAND_PLUGINS_OPT_EPHEMERALLY": "Send plugins list ephemerally.",
|
||||||
"COMMAND_RELOAD_DESC": "Reload Discord.",
|
|
||||||
"COMPONENT": "Component",
|
"COMPONENT": "Component",
|
||||||
"CONFIRMATION_LINK_IS_A_TYPE": "This link is a **{urlType, select, plugin {Plugin} theme {Theme} other {Add-on}}**, would you like to install it?",
|
"CONFIRMATION_LINK_IS_A_TYPE": "This link is a **{urlType, select, plugin {Plugin} theme {Theme} other {Add-on}}**, would you like to install it?",
|
||||||
"CONNECT_TO_DEBUG_WEBSOCKET": "Connect to debug WebSocket",
|
"CONNECT_TO_DEBUG_WEBSOCKET": "Connect to debug WebSocket",
|
||||||
|
|
@ -42,7 +39,6 @@
|
||||||
"DEBUG": "Debug",
|
"DEBUG": "Debug",
|
||||||
"DEBUGGER_URL": "Debugger URL",
|
"DEBUGGER_URL": "Debugger URL",
|
||||||
"DELETE": "Delete",
|
"DELETE": "Delete",
|
||||||
"DEVTOOLS_URL": "DevTools URL",
|
|
||||||
"DESC_EXTRACT_FONTS_FROM_THEME": "Looks out for \"fonts\" field in your currently applied theme and install it.",
|
"DESC_EXTRACT_FONTS_FROM_THEME": "Looks out for \"fonts\" field in your currently applied theme and install it.",
|
||||||
"DEVELOPER": "Developer",
|
"DEVELOPER": "Developer",
|
||||||
"DEVELOPER_SETTINGS": "Developer Settings",
|
"DEVELOPER_SETTINGS": "Developer Settings",
|
||||||
|
|
@ -70,9 +66,8 @@
|
||||||
"LABEL_EXTRACT_FONTS_FROM_THEME": "Extract font from theme",
|
"LABEL_EXTRACT_FONTS_FROM_THEME": "Extract font from theme",
|
||||||
"LINKS": "Links",
|
"LINKS": "Links",
|
||||||
"LOAD_FROM_CUSTOM_URL": "Load from custom URL",
|
"LOAD_FROM_CUSTOM_URL": "Load from custom URL",
|
||||||
"LOAD_FROM_CUSTOM_URL_DEC": "Load ShiggyCord from a custom endpoint.",
|
"LOAD_FROM_CUSTOM_URL_DEC": "Load GoonCord from a custom endpoint.",
|
||||||
"LOAD_REACT_DEVTOOLS": "Load React DevTools",
|
"LOAD_REACT_DEVTOOLS": "Load React DevTools",
|
||||||
"SHIGGY_URL": "ShiggyCord URL",
|
|
||||||
"LOADER": "Loader",
|
"LOADER": "Loader",
|
||||||
"MACHINE_ID": "Machine ID",
|
"MACHINE_ID": "Machine ID",
|
||||||
"MANUFACTURER": "Manufacturer",
|
"MANUFACTURER": "Manufacturer",
|
||||||
|
|
@ -95,7 +90,7 @@
|
||||||
"PLUGINS": "Plugins",
|
"PLUGINS": "Plugins",
|
||||||
"REFETCH": "Refetch",
|
"REFETCH": "Refetch",
|
||||||
"RELOAD": "Reload",
|
"RELOAD": "Reload",
|
||||||
"RELOAD_DISCORD": "Reshiggy your Discord",
|
"RELOAD_DISCORD": "ReGoon your Discord",
|
||||||
"RELOAD_IN_NORMAL_MODE": "Reload in Normal Mode",
|
"RELOAD_IN_NORMAL_MODE": "Reload in Normal Mode",
|
||||||
"RELOAD_IN_NORMAL_MODE_DESC": "Safe mode currently enabled, tap to reload in normal mode",
|
"RELOAD_IN_NORMAL_MODE_DESC": "Safe mode currently enabled, tap to reload in normal mode",
|
||||||
"RELOAD_IN_SAFE_MODE": "Reload in Safe Mode",
|
"RELOAD_IN_SAFE_MODE": "Reload in Safe Mode",
|
||||||
|
|
@ -124,7 +119,7 @@
|
||||||
"UH_OH": "Uh Oh",
|
"UH_OH": "Uh Oh",
|
||||||
"UNINSTALL": "Uninstall",
|
"UNINSTALL": "Uninstall",
|
||||||
"UNINSTALL_TITLE": "Uninstall {title}",
|
"UNINSTALL_TITLE": "Uninstall {title}",
|
||||||
"URL_PLACEHOLDER": "https://github.com/kmmiio99o/ShiggyCord",
|
"URL_PLACEHOLDER": "https://github.com/OTKUSteyler/GoonCord",
|
||||||
"VERSION": "Version",
|
"VERSION": "Version",
|
||||||
"VERSIONS": "Versions"
|
"VERSIONS": "Versions"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ export function initFetchI18nStrings() {
|
||||||
_loadedLocale.add(resolvedLocale);
|
_loadedLocale.add(resolvedLocale);
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
`https://raw.githubusercontent.com/kmmiio99o/i18n/main/resources/${resolvedLocale}/shiggycord.json`,
|
`https://raw.githubusercontent.com/OTKUSteyler/i18n/main/resources/${resolvedLocale}/gooncord.json`,
|
||||||
)
|
)
|
||||||
.then((r) => r.json())
|
.then((r) => r.json())
|
||||||
.then((strings) => (_loadedStrings[resolvedLocale] = strings))
|
.then((strings) => (_loadedStrings[resolvedLocale] = strings))
|
||||||
|
|
|
||||||
|
|
@ -42,19 +42,19 @@ function transformLinks(content: string, config: FixEmbedSettings): string {
|
||||||
if (config.instagram) {
|
if (config.instagram) {
|
||||||
result = result.replace(
|
result = result.replace(
|
||||||
/https?:\/\/(?:www\.)?instagram\.com(\/[^\s]+)/gi,
|
/https?:\/\/(?:www\.)?instagram\.com(\/[^\s]+)/gi,
|
||||||
"https://uuinstagram.com$1",
|
"https://kkinstagram.com$1",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// TikTok: Replace domain, keep path
|
// TikTok: Replace domain, keep path
|
||||||
if (config.tiktok) {
|
if (config.tiktok) {
|
||||||
result = result.replace(
|
result = result.replace(
|
||||||
/https?:\/\/(?:www\.)?tiktok\.com(\/[^\s]+)/gi,
|
/https?:\/\/(?:www\.)?tiktok\.com(\/[^\s]+)/gi,
|
||||||
"https://tnktok.com$1",
|
"https://tiktokez.com$1",
|
||||||
);
|
);
|
||||||
// TikTok short links (vm.tiktok.com)
|
// TikTok short links (vm.tiktok.com)
|
||||||
result = result.replace(
|
result = result.replace(
|
||||||
/https?:\/\/vm\.tiktok\.com\/([A-Za-z0-9]+)\/?/gi,
|
/https?:\/\/vm\.tiktok\.com\/([A-Za-z0-9]+)\/?/gi,
|
||||||
"https://vm.tnktok.com/$1",
|
"https://vm.tiktokez.com/$1",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// Reddit: Replace domain, keep path
|
// Reddit: Replace domain, keep path
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ export default defineCorePlugin({
|
||||||
) {
|
) {
|
||||||
// Ensure options exists and has a nonce
|
// Ensure options exists and has a nonce
|
||||||
options = options || {};
|
options = options || {};
|
||||||
options.nonce = options.nonce || (BigInt(Date.now() - 1420070400000) << 22n).toString();
|
options.nonce = options.nonce || Date.now().toString();
|
||||||
|
|
||||||
// Call original with fixed parameters
|
// Call original with fixed parameters
|
||||||
return originalSendMessage.call(
|
return originalSendMessage.call(
|
||||||
|
|
|
||||||
301
src/core/plugins/shiggyenhancements/index.tsx
Normal file
301
src/core/plugins/shiggyenhancements/index.tsx
Normal file
|
|
@ -0,0 +1,301 @@
|
||||||
|
import { defineCorePlugin } from "..";
|
||||||
|
import { findByProps } from "@metro";
|
||||||
|
import { logger } from "@lib/utils/logger";
|
||||||
|
import { settings } from "@lib/api/settings";
|
||||||
|
import { React } from "@metro/common";
|
||||||
|
|
||||||
|
const { TableRowGroup, TableRow, TableSwitchRow, Stack } = findByProps(
|
||||||
|
"TableRowGroup",
|
||||||
|
"TableRow",
|
||||||
|
"TableSwitchRow",
|
||||||
|
"Stack",
|
||||||
|
);
|
||||||
|
const { ScrollView } = require("react-native");
|
||||||
|
|
||||||
|
// Get ReactNative for NativeModules
|
||||||
|
const { ReactNative } = window as any;
|
||||||
|
const { DCDSoundManager } = ReactNative?.NativeModules || {};
|
||||||
|
|
||||||
|
// Sound settings type
|
||||||
|
type SoundSettings = {
|
||||||
|
enabled: boolean;
|
||||||
|
probability: number;
|
||||||
|
};
|
||||||
|
|
||||||
|
declare module "@lib/api/settings" {
|
||||||
|
interface Settings {
|
||||||
|
startupSound?: SoundSettings;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const soundUrl =
|
||||||
|
"https://github.com/OTKUSteyler/GoonCord/raw/refs/heads/main/Stuff/All%20I%20Want%20For%20Christmas%20(Is%20Fark).mp3";
|
||||||
|
const soundId = 6971;
|
||||||
|
let soundDuration = -1;
|
||||||
|
let timeoutId: NodeJS.Timeout | null = null;
|
||||||
|
let isPlaying = false;
|
||||||
|
let isPrepared = false;
|
||||||
|
|
||||||
|
// Function to prepare the sound
|
||||||
|
const prepareSound = function (): Promise<any> {
|
||||||
|
return new Promise(function (resolve) {
|
||||||
|
if (!DCDSoundManager) {
|
||||||
|
logger.error("DCDSoundManager not available");
|
||||||
|
resolve(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
DCDSoundManager.prepare(
|
||||||
|
soundUrl,
|
||||||
|
"music",
|
||||||
|
soundId,
|
||||||
|
function (error: any, sound: any) {
|
||||||
|
if (error) {
|
||||||
|
logger.error("Failed to prepare sound:", error);
|
||||||
|
resolve(null);
|
||||||
|
} else {
|
||||||
|
resolve(sound);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// Function to play the sound
|
||||||
|
async function playSound() {
|
||||||
|
if (!DCDSoundManager) {
|
||||||
|
logger.error("DCDSoundManager not available for playback");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isPlaying) {
|
||||||
|
if (timeoutId != null) clearTimeout(timeoutId);
|
||||||
|
DCDSoundManager.stop(soundId);
|
||||||
|
isPlaying = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
isPlaying = true;
|
||||||
|
|
||||||
|
try {
|
||||||
|
await DCDSoundManager.play(soundId);
|
||||||
|
|
||||||
|
if (soundDuration > 0) {
|
||||||
|
timeoutId = setTimeout(function () {
|
||||||
|
isPlaying = false;
|
||||||
|
DCDSoundManager.stop(soundId);
|
||||||
|
timeoutId = null;
|
||||||
|
}, soundDuration);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
logger.error("Error playing sound:", error);
|
||||||
|
isPlaying = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if we should play based on probability
|
||||||
|
function shouldPlaySound(): boolean {
|
||||||
|
const probability = settings.startupSound?.probability ?? 2;
|
||||||
|
const random = Math.random() * 100;
|
||||||
|
return random <= probability;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default defineCorePlugin({
|
||||||
|
manifest: {
|
||||||
|
id: "bunny.enhancements",
|
||||||
|
version: "0.1.0",
|
||||||
|
type: "plugin",
|
||||||
|
spec: 3,
|
||||||
|
main: "",
|
||||||
|
display: {
|
||||||
|
name: "Shiggy Enhancements",
|
||||||
|
description:
|
||||||
|
"Fixes common discord bugs because discord wont, and adds some features. (Originally Kettu Enhancements)",
|
||||||
|
authors: [{ name: "cocobo1" }, { name: "Shiggy Team" }],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
SettingsComponent() {
|
||||||
|
const { useState, useEffect } = React;
|
||||||
|
const [config, setConfig] = useState<SoundSettings>({
|
||||||
|
enabled: settings.startupSound?.enabled ?? true,
|
||||||
|
probability: settings.startupSound?.probability ?? 2,
|
||||||
|
});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
settings.startupSound = config;
|
||||||
|
}, [config]);
|
||||||
|
|
||||||
|
const updateConfig = (
|
||||||
|
key: keyof SoundSettings,
|
||||||
|
value: boolean | number,
|
||||||
|
) => {
|
||||||
|
setConfig((prev) => ({ ...prev, [key]: value }));
|
||||||
|
};
|
||||||
|
|
||||||
|
// Get UI components including TextInput
|
||||||
|
const {
|
||||||
|
TableRowGroup: _TRG,
|
||||||
|
TableRow: _TR,
|
||||||
|
TableSwitchRow: _TSR,
|
||||||
|
Stack: _S,
|
||||||
|
TextInput: _TextInput,
|
||||||
|
} = findByProps(
|
||||||
|
"TableRowGroup",
|
||||||
|
"TableRow",
|
||||||
|
"TableSwitchRow",
|
||||||
|
"Stack",
|
||||||
|
"TextInput",
|
||||||
|
);
|
||||||
|
|
||||||
|
// Fallback if table components aren't available
|
||||||
|
if (!_TRG || !_TSR || !_TR || !_S) {
|
||||||
|
const FallbackText =
|
||||||
|
"Startup Sound UI unavailable (missing TableRow components).";
|
||||||
|
return React.createElement(
|
||||||
|
ScrollView,
|
||||||
|
{ style: { flex: 1, padding: 12 } },
|
||||||
|
FallbackText,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const TableRowGroup = _TRG;
|
||||||
|
const TableRow = _TR;
|
||||||
|
const TableSwitchRow = _TSR;
|
||||||
|
const Stack = _S;
|
||||||
|
const TextInput = _TextInput;
|
||||||
|
|
||||||
|
// Handle probability input change
|
||||||
|
const handleProbabilityChange = (v: string) => {
|
||||||
|
const num = parseInt(v);
|
||||||
|
if (!isNaN(num) && num >= 0 && num <= 100) {
|
||||||
|
updateConfig("probability", num);
|
||||||
|
} else if (v === "") {
|
||||||
|
updateConfig("probability", 0);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Create settings elements
|
||||||
|
const settingsElements = [];
|
||||||
|
|
||||||
|
// Startup Sound toggle with probability display
|
||||||
|
settingsElements.push(
|
||||||
|
React.createElement(
|
||||||
|
TableRowGroup,
|
||||||
|
{ title: "Startup Sound", key: "startup-sound" },
|
||||||
|
React.createElement(TableSwitchRow, {
|
||||||
|
label: "Enable Startup Sound",
|
||||||
|
value: config.enabled,
|
||||||
|
onValueChange: (v: boolean) => updateConfig("enabled", v),
|
||||||
|
}),
|
||||||
|
React.createElement(TableRow, {
|
||||||
|
label: "Play Chance",
|
||||||
|
subLabel: `Current: ${config.probability}% chance to play on startup`,
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Probability input in its own invisible group
|
||||||
|
if (TextInput) {
|
||||||
|
settingsElements.push(
|
||||||
|
React.createElement(
|
||||||
|
TableRowGroup,
|
||||||
|
{ title: "", key: "probability-input-group" },
|
||||||
|
React.createElement(TextInput, {
|
||||||
|
placeholder: "Enter probability (0-100)",
|
||||||
|
value: config.probability.toString(),
|
||||||
|
onChange: handleProbabilityChange,
|
||||||
|
key: "probability-input",
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// About section
|
||||||
|
settingsElements.push(
|
||||||
|
React.createElement(
|
||||||
|
TableRowGroup,
|
||||||
|
{ title: "About", key: "about" },
|
||||||
|
React.createElement(TableRow, {
|
||||||
|
label: "Description",
|
||||||
|
subLabel:
|
||||||
|
"Shiggy Enhancements, more options, more features. Originally Kettu Enhancements with additinal features.",
|
||||||
|
disabled: true,
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
return React.createElement(
|
||||||
|
ScrollView,
|
||||||
|
{ style: { flex: 1 } },
|
||||||
|
React.createElement(
|
||||||
|
Stack,
|
||||||
|
{ spacing: 8, style: { padding: 10 } },
|
||||||
|
...settingsElements,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
start() {
|
||||||
|
logger.log("Shiggy Enhancements: Starting plugin");
|
||||||
|
|
||||||
|
// Initialize sound settings
|
||||||
|
settings.startupSound = settings.startupSound || {
|
||||||
|
enabled: false,
|
||||||
|
probability: 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Check if DCDSoundManager is available
|
||||||
|
if (!DCDSoundManager) {
|
||||||
|
logger.error("DCDSoundManager not found - startup sound disabled");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Play startup sound if enabled and probability check passes
|
||||||
|
if (settings.startupSound.enabled && shouldPlaySound()) {
|
||||||
|
logger.log(
|
||||||
|
`Attempting to play startup sound (${settings.startupSound.probability}% chance)`,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Always prepare the sound fresh each time
|
||||||
|
prepareSound()
|
||||||
|
.then(function (sound) {
|
||||||
|
if (sound) {
|
||||||
|
isPrepared = true;
|
||||||
|
soundDuration = sound.duration || 5000;
|
||||||
|
logger.log(`Sound prepared, duration: ${soundDuration}ms`);
|
||||||
|
playSound();
|
||||||
|
logger.log(
|
||||||
|
`Startup sound played (${settings.startupSound?.probability}% chance)`,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
logger.error("Failed to prepare sound");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
logger.error("Error in sound preparation:", error);
|
||||||
|
});
|
||||||
|
} else if (settings.startupSound.enabled) {
|
||||||
|
logger.log(
|
||||||
|
`Startup sound skipped due to probability (${settings.startupSound?.probability}% chance)`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
logger.log("Shiggy Enhancements: Stopping plugin");
|
||||||
|
|
||||||
|
// Stop and cleanup audio
|
||||||
|
if (DCDSoundManager && isPlaying) {
|
||||||
|
DCDSoundManager.stop(soundId);
|
||||||
|
isPlaying = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (timeoutId) {
|
||||||
|
clearTimeout(timeoutId);
|
||||||
|
timeoutId = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reset preparation state so it can play again next time
|
||||||
|
isPrepared = false;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
@ -11,7 +11,7 @@ export { shiggycordIcon };
|
||||||
|
|
||||||
export default function initSettings() {
|
export default function initSettings() {
|
||||||
registerSection({
|
registerSection({
|
||||||
name: "ShiggyCord",
|
name: "💦GoonCord💦",
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
key: "SHIGGYCORD",
|
key: "SHIGGYCORD",
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ export default function About() {
|
||||||
variant="text-md/medium"
|
variant="text-md/medium"
|
||||||
style={{ textAlign: "center", marginTop: 4 }}
|
style={{ textAlign: "center", marginTop: 4 }}
|
||||||
>
|
>
|
||||||
Shiggy your discord client!
|
Goon your discord client!
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,19 +32,7 @@ export default function General() {
|
||||||
const navigation = NavigationNative.useNavigation();
|
const navigation = NavigationNative.useNavigation();
|
||||||
|
|
||||||
// Custom Community Card Button
|
// Custom Community Card Button
|
||||||
const CommunityCardButton = ({
|
const CommunityCardButton = ({ icon, label, subLabel, color, onPress }) => (
|
||||||
icon,
|
|
||||||
label,
|
|
||||||
subLabel,
|
|
||||||
color,
|
|
||||||
onPress,
|
|
||||||
}: {
|
|
||||||
icon?: number | { uri: string };
|
|
||||||
label: string;
|
|
||||||
subLabel?: string | null;
|
|
||||||
color?: string;
|
|
||||||
onPress?: () => void;
|
|
||||||
}) => (
|
|
||||||
<TouchableOpacity style={{ flex: 1 }} onPress={onPress} activeOpacity={0.7}>
|
<TouchableOpacity style={{ flex: 1 }} onPress={onPress} activeOpacity={0.7}>
|
||||||
<Card
|
<Card
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -72,7 +60,7 @@ export default function General() {
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<TableRow.Icon
|
<TableRow.Icon
|
||||||
source={icon as any}
|
source={icon}
|
||||||
style={{
|
style={{
|
||||||
tintColor: "#FFFFFF",
|
tintColor: "#FFFFFF",
|
||||||
width: 24,
|
width: 24,
|
||||||
|
|
@ -125,8 +113,8 @@ export default function General() {
|
||||||
>
|
>
|
||||||
<TableRowGroup title="App Information">
|
<TableRowGroup title="App Information">
|
||||||
<TableRow
|
<TableRow
|
||||||
label="ShiggyCord"
|
label="💦GoonCord💦"
|
||||||
icon={<TableRow.Icon source={{ uri: shiggycordIcon ?? "" }} />}
|
icon={<TableRow.Icon source={{ uri: shiggycordIcon }} />}
|
||||||
trailing={<TableRow.TrailingText text={debugInfo.bunny.version} />}
|
trailing={<TableRow.TrailingText text={debugInfo.bunny.version} />}
|
||||||
/>
|
/>
|
||||||
<TableRow
|
<TableRow
|
||||||
|
|
|
||||||
|
|
@ -702,7 +702,7 @@ export default function Plugins() {
|
||||||
// Use the insertion order of pluginSettings so newly-installed plugins
|
// Use the insertion order of pluginSettings so newly-installed plugins
|
||||||
// (which add entries to pluginSettings) appear first.
|
// (which add entries to pluginSettings) appear first.
|
||||||
const installedBnIds = Object.keys(pluginSettings || {})
|
const installedBnIds = Object.keys(pluginSettings || {})
|
||||||
.filter((id) => registeredPlugins.has(id))
|
.filter((id) => registeredPlugins.has(id) && !isCorePlugin(id))
|
||||||
.slice()
|
.slice()
|
||||||
.reverse();
|
.reverse();
|
||||||
|
|
||||||
|
|
@ -710,12 +710,12 @@ export default function Plugins() {
|
||||||
.map((id) => registeredPlugins.get(id)!)
|
.map((id) => registeredPlugins.get(id)!)
|
||||||
.map(unifyBunnyPlugin);
|
.map(unifyBunnyPlugin);
|
||||||
|
|
||||||
// Merge lists: show Vendetta-managed plugins first,
|
// Merge lists: show Vendetta-managed plugins first (recent first),
|
||||||
// then Bunny-installed externals (recent first).
|
// then Bunny-installed externals (recent first).
|
||||||
const allPlugins = [...vdPlugins, ...bnPlugins];
|
const allPlugins = [...vdPlugins, ...bnPlugins];
|
||||||
|
|
||||||
// Include core plugins in the list
|
// Filter out core plugins from the list
|
||||||
return allPlugins;
|
return allPlugins.filter((plugin) => !isCorePlugin(plugin.id));
|
||||||
}}
|
}}
|
||||||
ListHeaderComponent={() => null}
|
ListHeaderComponent={() => null}
|
||||||
installAction={{
|
installAction={{
|
||||||
|
|
|
||||||
|
|
@ -126,5 +126,5 @@ export default async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Final ready log for basic UI availability.
|
// Final ready log for basic UI availability.
|
||||||
logger.log("ShiggyCord is ready.");
|
logger.log("GoonCord is ready.");
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -12,22 +12,39 @@ const mmkvStorage = proxyLazy(() => {
|
||||||
|
|
||||||
export default function patchStorage() {
|
export default function patchStorage() {
|
||||||
const patchedKeys = new Set(["ThemeStore", "SelectivelySyncedUserSettingsStore"]);
|
const patchedKeys = new Set(["ThemeStore", "SelectivelySyncedUserSettingsStore"]);
|
||||||
|
const sanitizedKeys = new Set<string>();
|
||||||
|
|
||||||
const patches = [
|
const patches = [
|
||||||
after("get", mmkvStorage, ([key], ret) => {
|
after("get", mmkvStorage, ([key], ret) => {
|
||||||
if (!_colorRef.current || !patchedKeys.has(key)) return;
|
if (!patchedKeys.has(key)) return;
|
||||||
|
|
||||||
const state = findInTree(ret._state, s => typeof s.theme === "string");
|
const state = findInTree(ret._state, s => typeof s.theme === "string");
|
||||||
if (state) state.theme = _colorRef.key;
|
if (!state) return;
|
||||||
|
|
||||||
|
const lastSetDiscordTheme = _colorRef.lastSetDiscordTheme ?? "darker";
|
||||||
|
|
||||||
|
if (/^bn-theme-\d+$/.test(state.theme) && !/^bn-theme-\d+$/.test(lastSetDiscordTheme) && !sanitizedKeys.has(key)) {
|
||||||
|
try {
|
||||||
|
const newVal = { ...ret._state, theme: lastSetDiscordTheme };
|
||||||
|
mmkvStorage.set(key, newVal);
|
||||||
|
sanitizedKeys.add(key);
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
|
state.theme = lastSetDiscordTheme;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_colorRef.current) state.theme = _colorRef.key;
|
||||||
}),
|
}),
|
||||||
before("set", mmkvStorage, ([key, value]) => {
|
before("set", mmkvStorage, ([key, value]) => {
|
||||||
if (!patchedKeys.has(key)) return;
|
if (!patchedKeys.has(key)) return;
|
||||||
|
|
||||||
const json = JSON.stringify(value);
|
const json = JSON.stringify(value);
|
||||||
const lastSetDiscordTheme = _colorRef.lastSetDiscordTheme ?? "darker";
|
const lastSetDiscordTheme = _colorRef.lastSetDiscordTheme ?? "darker";
|
||||||
|
const replacementTheme = /^bn-theme-\d+$/.test(lastSetDiscordTheme) ? "darker" : lastSetDiscordTheme;
|
||||||
const replaced = json.replace(
|
const replaced = json.replace(
|
||||||
/"theme":"bn-theme-\d+"/,
|
/"theme":"bn-theme-\d+"/,
|
||||||
`"theme":${JSON.stringify(lastSetDiscordTheme)}`
|
`"theme":${JSON.stringify(replacementTheme)}`
|
||||||
);
|
);
|
||||||
|
|
||||||
return [key, JSON.parse(replaced)];
|
return [key, JSON.parse(replaced)];
|
||||||
|
|
|
||||||
|
|
@ -57,15 +57,15 @@ export function patchPanelUI(unpatches: (() => void | boolean)[]) {
|
||||||
after("default", findByNameLazy("getScreens", false), (_a, screens) => ({
|
after("default", findByNameLazy("getScreens", false), (_a, screens) => ({
|
||||||
...screens,
|
...screens,
|
||||||
VendettaCustomPage: {
|
VendettaCustomPage: {
|
||||||
title: "ShiggyCord",
|
title: "GoonCord",
|
||||||
render: () => <CustomPageRenderer />,
|
render: () => <CustomPageRenderer />,
|
||||||
},
|
},
|
||||||
BUNNY_CUSTOM_PAGE: {
|
BUNNY_CUSTOM_PAGE: {
|
||||||
title: "ShiggyCord",
|
title: "GoonCord",
|
||||||
render: () => <CustomPageRenderer />,
|
render: () => <CustomPageRenderer />,
|
||||||
},
|
},
|
||||||
SHIGGYCORD_CUSTOM_PAGE: {
|
SHIGGYCORD_CUSTOM_PAGE: {
|
||||||
title: "ShiggyCord",
|
title: "GoonCord",
|
||||||
render: () => <CustomPageRenderer />,
|
render: () => <CustomPageRenderer />,
|
||||||
},
|
},
|
||||||
})),
|
})),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue