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.
This commit is contained in:
MHSanaei
2026-06-06 13:10:36 +02:00
parent 1b2a17f7e3
commit 668c0922ca

View File

@@ -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}`;
}, []);