fix: shadowrocket url

This commit is contained in:
Harry NG 2026-05-17 03:06:21 +07:00
parent 37b35fc621
commit f12535c1a1
2 changed files with 376 additions and 142 deletions

File diff suppressed because it is too large Load diff

View file

@ -106,12 +106,10 @@ function linkName(link, idx) {
// client expects the sub URL in a slightly different param name. // client expects the sub URL in a slightly different param name.
const shadowrocketUrl = computed(() => { const shadowrocketUrl = computed(() => {
if (!subUrl) return ''; if (!subUrl) return '';
const separator = subUrl.includes('?') ? '&' : '?'; const remark = subTitle || sId || 'Subscription';
const rawUrl = subUrl + separator + 'flag=shadowrocket'; return `sub://${btoa(subUrl)}#${encodeURIComponent(remark)}`;
const base64Url = encodeURIComponent(btoa(rawUrl));
const remark = encodeURIComponent(subTitle || sId || 'Subscription');
return `shadowrocket://add/sub/${base64Url}?remark=${remark}`;
}); });
const v2boxUrl = computed(() => `v2box://install-sub?url=${encodeURIComponent(subUrl)}&name=${encodeURIComponent(sId)}`); const v2boxUrl = computed(() => `v2box://install-sub?url=${encodeURIComponent(subUrl)}&name=${encodeURIComponent(sId)}`);
const streisandUrl = computed(() => `streisand://import/${encodeURIComponent(subUrl)}`); const streisandUrl = computed(() => `streisand://import/${encodeURIComponent(subUrl)}`);
const v2raytunUrl = computed(() => subUrl); const v2raytunUrl = computed(() => subUrl);