feat: 兼容 xishang0128/sparkle 的 JavaScript 覆写; ProxyUtils 新增 Buffer, Base64

This commit is contained in:
xream 2025-05-11 16:21:28 +08:00
parent d2c3956884
commit b3f6876bbd
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
4 changed files with 22 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "sub-store", "name": "sub-store",
"version": "2.19.37", "version": "2.19.38",
"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": {

View File

@ -1,3 +1,4 @@
import { Base64 } from 'js-base64';
import { Buffer } from 'buffer'; import { Buffer } from 'buffer';
import rs from '@/utils/rs'; import rs from '@/utils/rs';
import YAML from '@/utils/yaml'; import YAML from '@/utils/yaml';
@ -333,6 +334,8 @@ export const ProxyUtils = {
downloadFile, downloadFile,
isValidUUID, isValidUUID,
doh, doh,
Buffer,
Base64,
}; };
function tryParse(parser, line) { function tryParse(parser, line) {

View File

@ -1141,6 +1141,10 @@ function createDynamicFunction(name, script, $arguments, $options) {
'$httpClient', '$httpClient',
'$notification', '$notification',
'ProxyUtils', 'ProxyUtils',
'yaml',
'Buffer',
'b64d',
'b64e',
'scriptResourceCache', 'scriptResourceCache',
'flowUtils', 'flowUtils',
'produceArtifact', 'produceArtifact',
@ -1158,6 +1162,10 @@ function createDynamicFunction(name, script, $arguments, $options) {
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
$notification, $notification,
ProxyUtils, ProxyUtils,
ProxyUtils.yaml,
ProxyUtils.Buffer,
ProxyUtils.Base64.decode,
ProxyUtils.Base64.encode,
scriptResourceCache, scriptResourceCache,
flowUtils, flowUtils,
produceArtifact, produceArtifact,
@ -1170,6 +1178,10 @@ function createDynamicFunction(name, script, $arguments, $options) {
'$substore', '$substore',
'lodash', 'lodash',
'ProxyUtils', 'ProxyUtils',
'yaml',
'Buffer',
'b64d',
'b64e',
'scriptResourceCache', 'scriptResourceCache',
'flowUtils', 'flowUtils',
'produceArtifact', 'produceArtifact',
@ -1181,6 +1193,10 @@ function createDynamicFunction(name, script, $arguments, $options) {
$, $,
lodash, lodash,
ProxyUtils, ProxyUtils,
ProxyUtils.yaml,
ProxyUtils.Buffer,
ProxyUtils.Base64.decode,
ProxyUtils.Base64.encode,
scriptResourceCache, scriptResourceCache,
flowUtils, flowUtils,
produceArtifact, produceArtifact,

View File

@ -34,4 +34,6 @@ export default {
load, load,
safeDump, safeDump,
dump, dump,
parse: safeLoad,
stringify: safeDump,
}; };