Rebrand to "Bunny"

This commit is contained in:
amsyarasyiq 2024-02-09 10:37:36 +08:00
parent 874af6b0c6
commit d543317bca
11 changed files with 53 additions and 45 deletions

View file

@ -1,18 +1,28 @@
> [!NOTE]
> "Pyondetta" is not the final name of the mod.\
> This fork has been slowly progressing **since Dec 2023**, and [a set of new features](https://github.com/pyoncord/Pyondetta/issues/1) have been implemented.
> This fork has been slowly progressing **since Dec 2023**, and [a set of new features](https://github.com/pyoncord/Bunny/issues/1) have been implemented.\
> See [FAQs](#faqs)
# Pyondetta
A mod for Discord's mobile apps, fork of Vendetta, *with an actual progess.*
# Bunny
A mod for Discord's mobile apps, fork of Vendetta—from its contributor, *with an actual progess.*
## FAQs
### Why Bunny?
Bunny is a fork from a contributor of the good Vendetta, and is still passionate to work with Discord mods. Since Vendetta has reached EOL, Bunny was created to publish what I have been working behind the scenes.
### Bunny vs Pyoncord
Pyoncord and Bunny is a completely different mod. [Pyoncord](https://github.com/pyoncord/pyoncord) is my very own mod, and is currently in a very WIP but usable state.
### Discord server?
I'm not so much of an active Discord user myself. Since I'm ~~*a loner*~~ alone, managing a Discord server would be tough. Though, I still have created [a server for Pyoncord](https://discord.gg/97QVKX4z) for the sake of support (using GitHub issues is much preferable).
## Installing
Pyondetta's codebase is platform-agnostic, but you need a platform-specific loader.
Bunny's codebase is platform-agnostic, but you need a platform-specific loader.
> [!NOTE]
> - As of now, Pyoncord/Pyondetta does not have a proper independent loader.
> - However, you may use Vendetta's loader (VendettaXposed, VendettaTweak) and override loader url to [Pyondetta](https://raw.githubusercontent.com/pyoncord/detta-builds/main/pyondetta.js) (read [#Contributing > 7](#contributing))
> - Once our own independent loader is ready, support for Vendetta loader will cease
> - As of now, Pyoncord/Bunny does not have a proper independent loader.
> - However, you may use Vendetta's loader (VendettaXposed, VendettaTweak) and override loader url to [Bunny](https://raw.githubusercontent.com/pyoncord/detta-builds/main/bunny.js) (read [#Contributing > 7](#contributing))
> - Once our own independent loader is ready, support for Vendetta loader will be ceased
### Android
* Root - [VendettaXposed](https://github.com/vendetta-mod/VendettaXposed/releases/latest)
@ -26,25 +36,14 @@ Pyondetta's codebase is platform-agnostic, but you need a platform-specific load
* Jailed - You can get IPAs from [the thread](https://discord.com/channels/1015931589865246730/1087295482667208766) in our [Discord server](https://discord.gg/n9QQ4XhhJP) or from our [host](https://discord.k6.tf/ios/).
- These IPAs do *not* work with AltStore! You should use [Sideloadly](https://sideloadly.io).
## FAQs
### Why Pyondetta?
Pyondetta is a fork from a maintainer of the good Vendetta, and is still passionate to work with Discord mods. Since Vendetta has reached EOL, Pyondetta was created to publish what I have been working behind the scenes.
### Pyondetta vs Pyoncord
Pyoncord and Pyondetta is a completely different mod. Pyoncord is my very own mod, and is in a very WIP project
### Discord server?
I'm not so much of an active Discord user myself. Since I'm ~~*a loner*~~ alone, managing a Discord server would be tough. Though, I still have created [a server for Pyoncord](https://discord.gg/97QVKX4z) for the sake of support (using GitHub issues is much preferable).
## Contributing
1. Install a Pyondetta loader with loader config support (any mentioned in the [Installing](#installing) section).
1. Install a Bunny loader with loader config support (any mentioned in the [Installing](#installing) section).
2. Go to Settings > General and enable Developer Settings.
3. Clone the repo:
```
git clone https://github.com/pyoncord/pyondetta
git clone https://github.com/pyoncord/bunny
```
4. Install dependencies:
@ -53,7 +52,7 @@ I'm not so much of an active Discord user myself. Since I'm ~~*a loner*~~ alone,
```
<sup>`npm` or `yarn` should also work.</sup>
5. Build Pyondetta's code:
5. Build Bunny's code:
```
pnpm build
```
@ -63,6 +62,6 @@ I'm not so much of an active Discord user myself. Since I'm ~~*a loner*~~ alone,
7. Go to Settings > Developer enabled earlier). Enable `Load from custom url` and input the IP address and port of the server (e.g. e.g. `http://192.168.1.236:4040`) in the new input box labelled `VENDETTA URL`.
8. Restart Discord. Upon reload, you should notice that your device will download Pyondetta's bundled code from your server, rather than GitHub.
8. Restart Discord. Upon reload, you should notice that your device will download Bunny's bundled code from your server, rather than GitHub.
9. Make your changes, rebuild, reload, go wild!

View file

@ -2,8 +2,10 @@
import swc from "@swc/core";
import { execSync } from "child_process";
import esbuild from "esbuild";
import { readFile } from "fs/promises";
import { copyFile, copyFileSync } from "fs";
import { readFile, writeFile } from "fs/promises";
import { createServer } from "http";
import path from "path";
import { argv } from "process";
const isFlag = (s, l) => argv.slice(2).some(c => c === `-${s}` || c === `--${l}`);
@ -28,14 +30,14 @@ try {
// accepts it, but it's treated just like 'var' and causes issues
"const-and-let": false
},
outfile: "dist/pyondetta.js",
outfile: "dist/bunny.js",
keepNames: true,
define: {
__vendettaIsDev: `${!isRelease}`,
__vendettaVersion: `"${isRelease ? commitHash : timeHash}"`,
},
footer: {
js: "//# sourceURL=pyondetta"
js: "//# sourceURL=bunny"
},
loader: { ".png": "dataurl" },
legalComments: "none",
@ -70,7 +72,11 @@ try {
name: "buildLog",
setup: async build => {
build.onStart(() => console.log(`Building with commit hash "${commitHash}", isRelease="${isRelease}", timeHash="${timeHash}"`));
build.onEnd(result => console.log(`Built with ${result.errors?.length} errors!`));
build.onEnd(result => {
const { outfile } = build.initialOptions;
copyFileSync(outfile, path.resolve(outfile, "..", "pyondetta.js"))
console.log(`Built with ${result.errors?.length} errors!`);
});
}
}
]
@ -86,10 +92,10 @@ try {
const server = createServer(async (req, res) => {
try {
if (req.url === "/vendetta.js" || req.url === "/pyoncord.js" || req.url === "/pyondetta.js") {
if (req.url === "/vendetta.js" || req.url === "/pyoncord.js" || req.url === "/bunny.js") {
await ctx.rebuild();
res.writeHead(200);
res.end(await readFile("./dist/pyondetta.js"), "utf-8");
res.end(await readFile("./dist/bunny.js"), "utf-8");
} else {
res.writeHead(404);
res.end();

View file

@ -1,7 +1,7 @@
{
"name": "pyondetta",
"name": "bunny",
"version": "1.0.0",
"description": "A mod for Discord's mobile apps.",
"description": "A mod for Discord's mobile apps, fork of Vendetta.",
"scripts": {
"dev": "node build.mjs",
"build": "node build.mjs --release",
@ -12,7 +12,9 @@
"discord",
"android",
"ios",
"react native"
"react native",
"vendetta",
"bunny"
],
"author": "pylixonly, Team Vendetta",
"license": "BSD-3-Clause",

View file

@ -1,7 +1,7 @@
import { ClientInfoManager } from "@lib/native";
// This logs in the native logging implementation, e.g. logcat
console.log("Hello from Pyondetta!");
console.log("Hello from Bunny! Pyon!");
// Make 'freeze' and 'seal' do nothing
Object.freeze = Object;

View file

@ -1,7 +1,7 @@
import { patchLogHook } from "@lib/debug";
import { patchCommands } from "@lib/commands";
import { initPlugins } from "@lib/plugins";
import { patchChatBackground } from "@lib/themes";
import { initThemes, patchChatBackground } from "@lib/themes";
import { patchAssets } from "@ui/assets";
import initQuickInstall from "@ui/quickInstall";
import initSafeMode from "@ui/safeMode";
@ -10,6 +10,7 @@ import initFixes from "@lib/fixes";
import logger from "@lib/logger";
import windowObject from "@lib/windowObject";
initThemes()
export default async () => {
// Load everything in parallel
const unloads = await Promise.all([

View file

@ -62,7 +62,7 @@ export async function evalPlugin(plugin: Plugin) {
// Wrapping this with wrapSync is NOT an option.
storage: await createStorage<Record<string, any>>(createMMKVBackend(plugin.id)),
},
logger: new logModule(`Pyondetta » ${plugin.manifest.name}`),
logger: new logModule(`Bunny » ${plugin.manifest.name}`),
};
const pluginString = `vendetta=>{return ${plugin.js}}\n//# sourceURL=${plugin.id}`;

View file

@ -15,7 +15,7 @@ export default function SettingsSection() {
return (
<ErrorBoundary>
<FormSection key="Vendetta" title={`Pyondetta${settings.safeMode?.enabled ? " (Safe Mode)" : ""}`}>
<FormSection key="Vendetta" title={`Bunny${settings.safeMode?.enabled ? " (Safe Mode)" : ""}`}>
{screens.map((s, i) => (
<>
<FormRow

View file

@ -119,8 +119,8 @@ export const getYouData = () => {
return {
getLayout: () => ({
title: "Pyondetta",
label: "Pyondetta",
title: "Bunny",
label: "Bunny",
// We can't use our keyMap function here since `settings` is an array not an object
settings: getRenderableScreens(true).map(s => s.key)
}),

View file

@ -61,7 +61,7 @@ export default function Developer() {
<TableRowGroup title="Loader config">
<TableSwitchRow
label="Load from custom url"
subLabel={"Load Pyondetta from a custom endpoint."}
subLabel={"Load Bunny from a custom endpoint."}
icon={<TableRow.Icon source={getAssetIDByName("copy")} />}
value={loaderConfig.customLoadUrl.enabled}
onValueChange={(v: boolean) => {
@ -73,7 +73,7 @@ export default function Developer() {
size="md"
onChange={(v: string) => loaderConfig.customLoadUrl.url = v}
placeholder="http://localhost:4040/vendetta.js"
label="Pyondetta URL"
label="Bunny URL"
/>} />}
{window.__vendetta_loader.features.devtools && <TableSwitchRow
label="Load React DevTools"
@ -111,7 +111,7 @@ export default function Developer() {
options: [
// @ts-expect-error
// Of course, to trigger an error, we need to do something incorrectly. The below will do!
{ label: "Pyondetta", onPress: () => navigation.push("VendettaCustomPage", { render: () => <undefined /> }) },
{ label: "Bunny", onPress: () => navigation.push("VendettaCustomPage", { render: () => <undefined /> }) },
{ label: "Discord", isDestructive: true, onPress: () => navigation.push("VendettaCustomPage", { noErrorBoundary: true }) },
],
})}

View file

@ -24,7 +24,7 @@ export default function General() {
const versions = [
{
label: "Pyondetta",
label: "Bunny",
version: debugInfo.vendetta.version,
icon: "ic_progress_wrench_24px",
},

View file

@ -44,7 +44,7 @@ function oldYouPatch(patches: Function[]) {
ancestorRendererData: data.rendererConfigs[s.key],
setting: s.key,
title: data.titleConfig[s.key],
breadcrumbs: ["Pyondetta"],
breadcrumbs: ["Bunny"],
icon: data.rendererConfigs[s.key].icon,
})),
// .filter can be removed when dropping support for 189.3 and below (unless Discord changes things again)
@ -78,7 +78,7 @@ function newYouPatch(patches: Function[]) {
patches.push(before("type", settingsListComponents.SearchableSettingsList, ([{ sections }]) => manipulateSections(sections, data.getLayout())));
patches.push(after("getSettingListSearchResultItems", gettersModule, (_, ret) => {
ret.forEach((s: any) => screens.some(b => b.key === s.setting) && (s.breadcrumbs = ["Pyondetta"]))
ret.forEach((s: any) => screens.some(b => b.key === s.setting) && (s.breadcrumbs = ["Bunny"]))
}));
const oldRendererConfig = settingConstantsModule.SETTING_RENDERER_CONFIG;
@ -94,7 +94,7 @@ function newYouPatch(patches: Function[]) {
const isLabel = (i: any, name: string) => i?.label === name || i?.title === name;
function manipulateSections(sections: any[], layout: any) {
if (!Array.isArray(sections) || sections.find((i: any) => isLabel(i, "Pyondetta"))) return;
if (!Array.isArray(sections) || sections.find((i: any) => isLabel(i, "Bunny"))) return;
// Add our settings
const accountSettingsIndex = sections.findIndex((i: any) => isLabel(i, i18n.Messages.ACCOUNT_SETTINGS));