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",
"version": "2.19.37",
"version": "2.19.38",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
"main": "src/main.js",
"scripts": {

View File

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

View File

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

View File

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