From cc2545ebb2890175361830864cadd34b4be50db8 Mon Sep 17 00:00:00 2001 From: plus024 <112331452+plus024@users.noreply.github.com> Date: Wed, 31 Dec 2025 21:28:28 +1100 Subject: [PATCH 1/4] fix: use snowflake for message nonce --- src/core/commands/debug.ts | 2 +- src/core/commands/plugins.ts | 2 +- src/core/plugins/messagefix/index.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/commands/debug.ts b/src/core/commands/debug.ts index b1975c6..6f005ed 100644 --- a/src/core/commands/debug.ts +++ b/src/core/commands/debug.ts @@ -28,7 +28,7 @@ export default () => { if (ephemeral?.value) { messageUtil.sendBotMessage(ctx.channel.id, content); } else { - const fixNonce = Date.now().toString(); + const fixNonce = (BigInt(Date.now() - 1420070400000) << 22n).toString(); messageUtil.sendMessage(ctx.channel.id, { content }, void 0, {nonce:fixNonce}); } } diff --git a/src/core/commands/plugins.ts b/src/core/commands/plugins.ts index 8933713..f6d5cfe 100644 --- a/src/core/commands/plugins.ts +++ b/src/core/commands/plugins.ts @@ -36,7 +36,7 @@ export default () => { if (ephemeral?.value) { messageUtil.sendBotMessage(ctx.channel.id, content); } else { - const fixNonce = Date.now().toString(); + const fixNonce = (BigInt(Date.now() - 1420070400000) << 22n).toString(); messageUtil.sendMessage(ctx.channel.id, { content }, void 0, {nonce:fixNonce}); } } diff --git a/src/core/plugins/messagefix/index.ts b/src/core/plugins/messagefix/index.ts index e77f0b9..bb57143 100644 --- a/src/core/plugins/messagefix/index.ts +++ b/src/core/plugins/messagefix/index.ts @@ -33,7 +33,7 @@ export default defineCorePlugin({ ) { // Ensure options exists and has a nonce options = options || {}; - options.nonce = options.nonce || Date.now().toString(); + options.nonce = options.nonce || (BigInt(Date.now() - 1420070400000) << 22n).toString(); // Call original with fixed parameters return originalSendMessage.call( From 179679f215e64626a7ec99b7f786c58c810671bc Mon Sep 17 00:00:00 2001 From: Kernel Builder Date: Thu, 1 Jan 2026 18:12:08 +0100 Subject: [PATCH 2/4] fix background in themes and change version to normal 1.4 fix by purple_eyez from revenge, shiggies for him (may likely still not work on some phones) --- scripts/build.mjs | 2 +- .../themes/colors/patches/background.tsx | 51 ++++++++++--------- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/scripts/build.mjs b/scripts/build.mjs index 82297a5..79745a2 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -75,7 +75,7 @@ const config = { constModules: { globals: { "bunny-build-info": { - version: `"Jolly 1.4"`, + version: `"1.4"`, }, }, }, diff --git a/src/lib/addons/themes/colors/patches/background.tsx b/src/lib/addons/themes/colors/patches/background.tsx index 4c337ca..bf68236 100644 --- a/src/lib/addons/themes/colors/patches/background.tsx +++ b/src/lib/addons/themes/colors/patches/background.tsx @@ -7,16 +7,16 @@ import { findByFilePathLazy } from "@metro"; import chroma from "chroma-js"; import { ImageBackground, StyleSheet } from "react-native"; -const Messages = findByFilePathLazy("components_native/chat/Messages.tsx", true); +const Messages = findByFilePathLazy("modules/messages/native/Messages.tsx", true); -function ThemeBackground({ children }: { children: React.ReactNode }) { +function ThemeBackground({ children }: { children: React.ReactNode; }) { useObservable([colorsPref]); if (!_colorRef.current || colorsPref.customBackground === "hidden" || !_colorRef.current.background?.url || _colorRef.current.background?.blur && (typeof _colorRef.current.background?.blur !== "number") - ){ + ) { return children; } @@ -30,30 +30,35 @@ function ThemeBackground({ children }: { children: React.ReactNode }) { } export default function patchChatBackground() { + try { const patches = [ - after("render", Messages, (_, ret) => { - if (!_colorRef.current || !_colorRef.current.background?.url) return; - const messagesComponent = findInReactTree( - ret, - x => x && "HACK_fixModalInteraction" in x.props && x?.props?.style - ); + after("render", Messages, (_, ret) => { + if (!_colorRef.current || !_colorRef.current.background?.url) return; - if (messagesComponent) { - const flattened = StyleSheet.flatten(messagesComponent.props.style); - const backgroundColor = chroma( - flattened.backgroundColor || "black" - ).alpha( - 1 - (_colorRef.current.background?.opacity ?? 1) - ).hex(); + const messagesComponent = findInReactTree( + ret, + x => x && "HACK_fixModalInteraction" in x.props && x?.props?.style + ); - messagesComponent.props.style = StyleSheet.flatten([ - messagesComponent.props.style, - { backgroundColor } - ]); - } + if (messagesComponent) { + const flattened = StyleSheet.flatten(messagesComponent.props.style); + const backgroundColor = chroma( + flattened.backgroundColor || "black" + ).alpha( + 1 - (_colorRef.current.background?.opacity ?? 1) + ).hex(); - return {ret}; - }) + messagesComponent.props.style = StyleSheet.flatten([ + messagesComponent.props.style, + { backgroundColor } + ]); + } + + return {ret}; + }) ]; + return () => patches.forEach(x => x()); + } catch (e) { + } } From 0df137977d636e7a88d476cace284a4ff825f35e Mon Sep 17 00:00:00 2001 From: cocobo1 Date: Thu, 1 Jan 2026 19:59:39 +0200 Subject: [PATCH 3/4] fix(themes): fix theme backgrounds for SOME people --- scripts/build.mjs | 2 +- .../themes/colors/patches/background.tsx | 61 +++++++++++-------- src/lib/api/debug.ts | 4 -- 3 files changed, 35 insertions(+), 32 deletions(-) diff --git a/scripts/build.mjs b/scripts/build.mjs index c851521..9f42232 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -74,7 +74,7 @@ const config = { constModules: { globals: { "bunny-build-info": { - version: `"v1.4.0"` + version: `"v1.4.1"` } } }, diff --git a/src/lib/addons/themes/colors/patches/background.tsx b/src/lib/addons/themes/colors/patches/background.tsx index 4c337ca..f2ebd00 100644 --- a/src/lib/addons/themes/colors/patches/background.tsx +++ b/src/lib/addons/themes/colors/patches/background.tsx @@ -6,17 +6,18 @@ import { findInReactTree } from "@lib/utils"; import { findByFilePathLazy } from "@metro"; import chroma from "chroma-js"; import { ImageBackground, StyleSheet } from "react-native"; +import { logger } from "@lib/utils/logger"; -const Messages = findByFilePathLazy("components_native/chat/Messages.tsx", true); +const Messages = findByFilePathLazy("modules/messages/native/Messages.tsx", true); -function ThemeBackground({ children }: { children: React.ReactNode }) { +function ThemeBackground({ children }: { children: React.ReactNode; }) { useObservable([colorsPref]); if (!_colorRef.current || colorsPref.customBackground === "hidden" || !_colorRef.current.background?.url || _colorRef.current.background?.blur && (typeof _colorRef.current.background?.blur !== "number") - ){ + ) { return children; } @@ -30,30 +31,36 @@ function ThemeBackground({ children }: { children: React.ReactNode }) { } export default function patchChatBackground() { - const patches = [ - after("render", Messages, (_, ret) => { - if (!_colorRef.current || !_colorRef.current.background?.url) return; - const messagesComponent = findInReactTree( - ret, - x => x && "HACK_fixModalInteraction" in x.props && x?.props?.style - ); + try { + const patches = [ + after("render", Messages, (_, ret) => { + if (!_colorRef.current || !_colorRef.current.background?.url) return; - if (messagesComponent) { - const flattened = StyleSheet.flatten(messagesComponent.props.style); - const backgroundColor = chroma( - flattened.backgroundColor || "black" - ).alpha( - 1 - (_colorRef.current.background?.opacity ?? 1) - ).hex(); + const messagesComponent = findInReactTree( + ret, + x => x && "HACK_fixModalInteraction" in x.props && x?.props?.style + ); - messagesComponent.props.style = StyleSheet.flatten([ - messagesComponent.props.style, - { backgroundColor } - ]); - } + if (messagesComponent) { + const flattened = StyleSheet.flatten(messagesComponent.props.style); + const backgroundColor = chroma( + flattened.backgroundColor || "black" + ).alpha( + 1 - (_colorRef.current.background?.opacity ?? 1) + ).hex(); - return {ret}; - }) - ]; - return () => patches.forEach(x => x()); -} + messagesComponent.props.style = StyleSheet.flatten([ + messagesComponent.props.style, + { backgroundColor } + ]); + } + + return {ret}; + }) + ]; + return () => patches.forEach(x => x()); + } catch (e) { + logger.error("Failed to patch chat background.", e); + return () => { }; + } +} \ No newline at end of file diff --git a/src/lib/api/debug.ts b/src/lib/api/debug.ts index 7bc6f92..8949589 100644 --- a/src/lib/api/debug.ts +++ b/src/lib/api/debug.ts @@ -43,7 +43,6 @@ export async function toggleSafeMode() { setTimeout(BundleUpdaterManager.reload, 400); } -// --- Debugger State & Logic --- let socket: WebSocket | undefined; let originalConsoleLog: any; let originalConsoleError: any; @@ -254,7 +253,6 @@ export function isConnectedToDebugger(): boolean { return socket?.readyState === WebSocket.OPEN; } -// --- React DevTools (RDT) Logic --- const rdtPort = 8097; export let rdtClient: WebSocket | null = null; export let rdtConnected = false; @@ -318,8 +316,6 @@ export function useIsRdtConnected() { return connected; } -// --- Core Utils --- - /** * @internal */ From 28e024c61141cef152c6ded8474eab7073b53fa4 Mon Sep 17 00:00:00 2001 From: kmmiio99o Date: Fri, 2 Jan 2026 00:33:53 +0100 Subject: [PATCH 4/4] fix versioning --- .github/workflows/release.yml | 64 ++++++++++++++--------------------- scripts/build.mjs | 2 +- 2 files changed, 27 insertions(+), 39 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 14a6768..8023de5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,15 +5,6 @@ on: branches: - main workflow_dispatch: - inputs: - release_name: - description: 'Custom Release Name (e.g., "Jolly", "Christmas")' - required: true - type: string - release_tag: - description: 'Release Tag (e.g., "v1.0.0")' - required: true - type: string jobs: release: @@ -38,38 +29,33 @@ jobs: run: bun install shell: bash - - name: Determine Release Info - id: release_info + - name: Extract version + id: extract run: | - # For workflow_dispatch, use the provided inputs - if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then - release_name="${{ github.event.inputs.release_name }}" - release_tag="${{ github.event.inputs.release_tag }}" - else - # For push events, extract version and generate a name - if [ ! -f scripts/build.mjs ]; then - echo "scripts/build.mjs not found" >&2 - exit 1 - fi + # Extract major.minor.patch version from scripts/build.mjs + # This locates the first quoted three-segment version string in the build script (e.g. "1.1.7") + if [ ! -f scripts/build.mjs ]; then + echo "scripts/build.mjs not found" >&2 + exit 1 + fi + # Print a snippet of the file for debugging in workflow logs + echo '--- scripts/build.mjs (snippet) ---' >&2 + sed -n '1,200p' scripts/build.mjs >&2 || true - # Extract version - raw=$(grep -m1 -oE '\"[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?\"' scripts/build.mjs | tr -d '\"' | head -n1 || true) - version=$(printf '%s' "$raw" | sed -E 's/^([0-9]+\.[0-9]+\.[0-9]+).*/\1/') + # Primary extraction: find the first quoted semver (may include prerelease suffix, but we strip it) + raw=$(grep -m1 -oE '\"[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?\"' scripts/build.mjs | tr -d '\"' | head -n1 || true) - if ! printf '%s' "$version" | grep -xE '^[0-9]+\.[0-9]+\.[0-9]+$' >/dev/null; then - echo "Failed to extract a valid base version from scripts/build.mjs" >&2 - exit 1 - fi + # Strip any prerelease suffix, keep only major.minor.patch + version=$(printf '%s' "$raw" | sed -E 's/^([0-9]+\.[0-9]+\.[0-9]+).*/\1/') - # Use version-based naming for push events - release_name="Release v${version}" - release_tag="v${version}" + # Validate final result is exactly major.minor.patch + if ! printf '%s' "$version" | grep -xE '^[0-9]+\.[0-9]+\.[0-9]+$' >/dev/null; then + echo "Failed to extract a valid base version from scripts/build.mjs" >&2 + sed -n '1,200p' scripts/build.mjs >&2 || true + exit 1 fi - echo "release_name=${release_name}" >> $GITHUB_OUTPUT - echo "release_tag=${release_tag}" >> $GITHUB_OUTPUT - echo "Using release name: ${release_name}" >&2 - echo "Using release tag: ${release_tag}" >&2 + echo "version=$version" >> $GITHUB_OUTPUT shell: bash - name: Prepare tag @@ -79,7 +65,9 @@ jobs: run: | set -euo pipefail - tag="${{ steps.release_info.outputs.release_tag }}" + # Use the extracted version directly as the tag for main branch releases + version="${{ steps.extract.outputs.version }}" + tag="${version}" echo "[debug] computed tag=${tag}" >&2 @@ -107,8 +95,8 @@ jobs: - name: Create Release uses: softprops/action-gh-release@v1 with: - tag_name: ${{ steps.release_info.outputs.release_tag }} - name: ${{ steps.release_info.outputs.release_name }} + tag_name: ${{ steps.prepare.outputs.tag }} + name: Release ${{ steps.prepare.outputs.tag }} files: | dist/shiggycord.js dist/shiggycord.min.js diff --git a/scripts/build.mjs b/scripts/build.mjs index 79745a2..6c03b18 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -75,7 +75,7 @@ const config = { constModules: { globals: { "bunny-build-info": { - version: `"1.4"`, + version: `"1.4.1"`, }, }, },