mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-09-12 14:23:16 +08:00
feat: Add support for targetPlatform ShadowRocket
This commit is contained in:
parent
49c8f2e521
commit
848491c0f8
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.8.6",
|
"version": "2.8.7",
|
||||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||||
"main": "src/main.js",
|
"main": "src/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -282,6 +282,9 @@ async function syncToGist(files) {
|
|||||||
async function produceArtifact({ type, name, platform }) {
|
async function produceArtifact({ type, name, platform }) {
|
||||||
platform = platform || 'JSON';
|
platform = platform || 'JSON';
|
||||||
|
|
||||||
|
// produce Clash node format for ShadowRocket
|
||||||
|
if (platform === 'ShadowRocket') platform = 'Clash';
|
||||||
|
|
||||||
if (type === 'subscription') {
|
if (type === 'subscription') {
|
||||||
const allSubs = $.read(SUBS_KEY);
|
const allSubs = $.read(SUBS_KEY);
|
||||||
const sub = findByName(allSubs, name);
|
const sub = findByName(allSubs, name);
|
||||||
|
@ -51,7 +51,7 @@ async function updateGitHubAvatar() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function updateArtifactStore() {
|
async function updateArtifactStore() {
|
||||||
console.log('Updating artifact store');
|
$.log('Updating artifact store');
|
||||||
const settings = $.read(SETTINGS_KEY);
|
const settings = $.read(SETTINGS_KEY);
|
||||||
const { githubUser, gistToken } = settings;
|
const { githubUser, gistToken } = settings;
|
||||||
if (githubUser && gistToken) {
|
if (githubUser && gistToken) {
|
||||||
|
@ -14,7 +14,7 @@ export function getPlatformFromHeaders(headers) {
|
|||||||
} else if (UA.indexOf('Decar') !== -1 || UA.indexOf('Loon') !== -1) {
|
} else if (UA.indexOf('Decar') !== -1 || UA.indexOf('Loon') !== -1) {
|
||||||
return 'Loon';
|
return 'Loon';
|
||||||
} else if (UA.indexOf('Shadowrocket') !== -1) {
|
} else if (UA.indexOf('Shadowrocket') !== -1) {
|
||||||
return 'Clash';
|
return 'ShadowRocket';
|
||||||
} else if (UA.indexOf('Stash') !== -1) {
|
} else if (UA.indexOf('Stash') !== -1) {
|
||||||
return 'Stash';
|
return 'Stash';
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user