From 668c0922ca446ffabf2755074ee6ea90221d67d2 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Sat, 6 Jun 2026 13:10:36 +0200 Subject: [PATCH] fix(sub): restore standard base64 for Shadowrocket sub link (#5001) URL-safe base64 (-/_ with stripped padding) broke Shadowrocket import: it decodes the add/sub path segment as standard base64 and rejects -/_, so the subscription was silently not added. Revert to plain btoa() output as originally shipped in #3489. --- frontend/src/pages/sub/SubPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/sub/SubPage.tsx b/frontend/src/pages/sub/SubPage.tsx index 369db30d..04131350 100644 --- a/frontend/src/pages/sub/SubPage.tsx +++ b/frontend/src/pages/sub/SubPage.tsx @@ -120,7 +120,7 @@ export default function SubPage() { if (!subUrl) return ''; const separator = subUrl.includes('?') ? '&' : '?'; const rawUrl = subUrl + separator + 'flag=shadowrocket'; - const base64Url = btoa(rawUrl).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); + const base64Url = btoa(rawUrl); const remark = encodeURIComponent(subTitle || sId || 'Subscription'); return `shadowrocket://add/sub/${base64Url}?remark=${remark}`; }, []);