feat: Reworked Loon producer

This commit is contained in:
Peng-YM committed 2022-06-20 22:58:27 +08:00
1 parent 409c4cbdd9
commit bca4f06fcd
4 files changed
+255 -81

No files matched your search

+3 -3
View File
@@ -6,11 +6,11 @@
* ███████║╚██████╔╝██████╔╝ ███████║ ██║ ╚██████╔╝██║ ██║███████╗
* ╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝
* Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket!
* @updated: 2022/6/20 22:08:58
* @version: 2.0.11
* @updated: 2022/6/20 22:56:59
* @version: 2.1.0
* @author: Peng-YM
* @github: https://github.com/Peng-YM/Sub-Store
* @documentation: https://www.notion.so/Sub-Store-6259586994d34c11a4ced5c406264b46
*/
!function(){var createModuleFactory=function(t){var e;return function(r){return e||t(e={exports:{},parent:r},e.exports),e.exports}},_$buffer_2=createModuleFactory((function(t,e){(function(t){(function(){"use strict";e.Buffer=r,e.SlowBuffer=function(t){return+t!=t&&(t=0),r.alloc(+t)},e.INSPECT_MAX_BYTES=50;function t(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=r.prototype,e}function r(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return u(t)}return n(t,e,r)}function n(e,n,o){if("string"==typeof e)return function(e,n){if("string"==typeof n&&""!==n||(n="utf8"),!r.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var o=0|s(e,n),u=t(o),i=u.write(e,n);return i!==o&&(u=u.slice(0,i)),u}(e,n);if(ArrayBuffer.isView(e))return i(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(k(e,ArrayBuffer)||e&&k(e.buffer,ArrayBuffer))return function(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');var o;return(o=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n)).__proto__=r.prototype,o}(e,n,o);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var u=e.valueOf&&e.valueOf();if(null!=u&&u!==e)return r.from(u,n,o);var c=function(e){if(r.isBuffer(e)){var n=0|a(e.length),o=t(n);return 0===o.length||e.copy(o,0,0,n),o}return void 0!==e.length?"number"!=typeof e.length||B(e.length)?t(0):i(e):"Buffer"===e.type&&Array.isArray(e.data)?i(e.data):void 0}(e);if(c)return c;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return r.from(e[Symbol.toPrimitive]("string"),n,o);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function o(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function u(e){return o(e),t(e<0?0:0|a(e))}function i(e){for(var r=e.length<0?0:0|a(e.length),n=t(r),o=0;o<r;o+=1)n[o]=255&e[o];return n}function a(t){if(t>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function s(t,e){if(r.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||k(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,o=arguments.length>2&&!0===arguments[2];if(!o&&0===n)return 0;for(var u=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return R(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return D(t).length;default:if(u)return o?-1:R(t).length;e=(""+e).toLowerCase(),u=!0}}function c(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function l(t,e,n,o,u){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),B(n=+n)&&(n=u?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(u)return-1;n=t.length-1}else if(n<0){if(!u)return-1;n=0}if("string"==typeof e&&(e=r.from(e,o)),r.isBuffer(e))return 0===e.length?-1:p(t,e,n,o,u);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?u?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):p(t,[e],n,o,u);throw new TypeError("val must be string, number or Buffer")}function p(t,e,r,n,o){var u,i=1,a=t.length,s=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;i=2,a/=2,s/=2,r/=2}function c(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(o){var l=-1;for(u=r;u<a;u++)if(c(t,u)===c(e,-1===l?0:u-l)){if(-1===l&&(l=u),u-l+1===s)return l*i}else-1!==l&&(u-=u-l),l=-1}else for(r+s>a&&(r=a-s),u=r;u>=0;u--){for(var p=!0,f=0;f<s;f++)if(c(t,u+f)!==c(e,f)){p=!1;break}if(p)return u}return-1}function f(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var u=e.length;n>u/2&&(n=u/2);for(var i=0;i<n;++i){var a=parseInt(e.substr(2*i,2),16);if(B(a))return i;t[r+i]=a}return i}function _(t,e,r,n){return I(R(e,t.length-r),t,r,n)}function h(t,e,r,n){return I(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function d(t,e,r,n){return h(t,e,r,n)}function g(t,e,r,n){return I(D(e),t,r,n)}function y(t,e,r,n){return I(function(t,e){for(var r,n,o,u=[],i=0;i<t.length&&!((e-=2)<0);++i)n=(r=t.charCodeAt(i))>>8Line truncated
!function(){var createModuleFactory=function(t){var e;return function(r){return e||t(e={exports:{},parent:r},e.exports),e.exports}},_$buffer_2=createModuleFactory((function(t,e){(function(t){(function(){"use strict";e.Buffer=r,e.SlowBuffer=function(t){return+t!=t&&(t=0),r.alloc(+t)},e.INSPECT_MAX_BYTES=50;function t(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=r.prototype,e}function r(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return u(t)}return n(t,e,r)}function n(e,n,o){if("string"==typeof e)return function(e,n){if("string"==typeof n&&""!==n||(n="utf8"),!r.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var o=0|s(e,n),u=t(o),i=u.write(e,n);return i!==o&&(u=u.slice(0,i)),u}(e,n);if(ArrayBuffer.isView(e))return i(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(k(e,ArrayBuffer)||e&&k(e.buffer,ArrayBuffer))return function(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');var o;return(o=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n)).__proto__=r.prototype,o}(e,n,o);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var u=e.valueOf&&e.valueOf();if(null!=u&&u!==e)return r.from(u,n,o);var c=function(e){if(r.isBuffer(e)){var n=0|a(e.length),o=t(n);return 0===o.length||e.copy(o,0,0,n),o}return void 0!==e.length?"number"!=typeof e.length||B(e.length)?t(0):i(e):"Buffer"===e.type&&Array.isArray(e.data)?i(e.data):void 0}(e);if(c)return c;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return r.from(e[Symbol.toPrimitive]("string"),n,o);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function o(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function u(e){return o(e),t(e<0?0:0|a(e))}function i(e){for(var r=e.length<0?0:0|a(e.length),n=t(r),o=0;o<r;o+=1)n[o]=255&e[o];return n}function a(t){if(t>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function s(t,e){if(r.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||k(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,o=arguments.length>2&&!0===arguments[2];if(!o&&0===n)return 0;for(var u=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return I(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return R(t).length;default:if(u)return o?-1:I(t).length;e=(""+e).toLowerCase(),u=!0}}function c(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function p(t,e,n,o,u){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),B(n=+n)&&(n=u?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(u)return-1;n=t.length-1}else if(n<0){if(!u)return-1;n=0}if("string"==typeof e&&(e=r.from(e,o)),r.isBuffer(e))return 0===e.length?-1:l(t,e,n,o,u);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?u?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):l(t,[e],n,o,u);throw new TypeError("val must be string, number or Buffer")}function l(t,e,r,n,o){var u,i=1,a=t.length,s=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;i=2,a/=2,s/=2,r/=2}function c(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(o){var p=-1;for(u=r;u<a;u++)if(c(t,u)===c(e,-1===p?0:u-p)){if(-1===p&&(p=u),u-p+1===s)return p*i}else-1!==p&&(u-=u-p),p=-1}else for(r+s>a&&(r=a-s),u=r;u>=0;u--){for(var l=!0,f=0;f<s;f++)if(c(t,u+f)!==c(e,f)){l=!1;break}if(l)return u}return-1}function f(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var u=e.length;n>u/2&&(n=u/2);for(var i=0;i<n;++i){var a=parseInt(e.substr(2*i,2),16);if(B(a))return i;t[r+i]=a}return i}function _(t,e,r,n){return D(I(e,t.length-r),t,r,n)}function h(t,e,r,n){return D(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function d(t,e,r,n){return h(t,e,r,n)}function g(t,e,r,n){return D(R(e),t,r,n)}function y(t,e,r,n){return D(function(t,e){for(var r,n,o,u=[],i=0;i<t.length&&!((e-=2)<0);++i)n=(r=t.charCodeAt(i))>>8Line truncated
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.0.11",
"version": "2.1.0",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {
+248 -74
View File
@@ -1,86 +1,22 @@
/* eslint-disable no-case-declarations */
const targetPlatform = 'Loon';
import { isPresent, Result } from './utils';
export default function Loon_Producer() {
const targetPlatform = 'Loon';
const produce = (proxy) => {
let obfs_opts = '',
tls_opts = '',
udp_opts = '',
tfo_opts = '';
if (typeof proxy.udp !== 'undefined') {
udp_opts = proxy.udp ? ',udp=true' : ',udp=false';
}
tfo_opts = `,fast-open=${proxy.tfo || false}`;
switch (proxy.type) {
case 'ss':
obfs_opts = ',,';
if (proxy.plugin) {
if (proxy.plugin === 'obfs') {
const { mode, host } = proxy['plugin-opts'];
obfs_opts = `,${mode},${host || ''}`;
} else {
throw new Error(
`Platform ${targetPlatform} does not support obfs option: ${proxy.obfs}`,
);
}
}
return `${proxy.name}=shadowsocks,${proxy.server},${proxy.port},${proxy.cipher},"${proxy.password}"${obfs_opts}${udp_opts}${tfo_opts}`;
return shadowsocks(proxy);
case 'ssr':
return `${proxy.name}=shadowsocksr,${proxy.server},${
proxy.port
},${proxy.cipher},"${proxy.password}",${proxy.protocol},{${
proxy['protocol-param'] || ''
}},${proxy.obfs},{${
proxy['obfs-param'] || ''
}}${udp_opts}${tfo_opts}`;
case 'vmess':
obfs_opts = '';
if (proxy.network === 'ws') {
const host = proxy['ws-opts'].headers.Host || proxy.server;
obfs_opts = `,transport:ws,host:${host},path:${
proxy['ws-opts'].path || '/'
}`;
} else {
obfs_opts = `,transport:tcp`;
}
if (proxy.tls) {
obfs_opts += `${
proxy.sni ? ',tls-name:' + proxy.sni : ''
},skip-cert-verify:${proxy['skip-cert-verify'] || 'false'}`;
}
let result = `${proxy.name}=vmess,${proxy.server},${
proxy.port
},${proxy.cipher === 'auto' ? 'none' : proxy.cipher},"${
proxy.uuid
}",over-tls:${proxy.tls || 'false'}${obfs_opts}`;
if (proxy.alterId === 0) proxy['vmess-aead'] = true;
if (typeof proxy['vmess-aead'] !== 'undefined') {
result += `,vmess-aead=${proxy['vmess-aead']}`;
}
return result;
return shadowsocksr(proxy);
case 'trojan':
return `${proxy.name}=trojan,${proxy.server},${proxy.port},"${
proxy.password
}"${
proxy.sni ? ',tls-name:' + proxy.sni : ''
},skip-cert-verify:${
proxy['skip-cert-verify'] || 'false'
}${udp_opts}`;
return trojan(proxy);
case 'vmess':
return vmess(proxy);
case 'vless':
return vless(proxy);
case 'http':
tls_opts = '';
const base = `${proxy.name}=${proxy.tls ? 'http' : 'https'},${
proxy.server
},${proxy.port},${proxy.username || ''},${
proxy.password || ''
}`;
if (proxy.tls) {
// https
tls_opts = `${
proxy.sni ? ',tls-name:' + proxy.sni : ''
},skip-cert-verify:${proxy['skip-cert-verify']}`;
return base + tls_opts;
} else return base;
return http(proxy);
}
throw new Error(
`Platform ${targetPlatform} does not support proxy type: ${proxy.type}`,
@@ -88,3 +24,241 @@ export default function Loon_Producer() {
};
return { produce };
}
function shadowsocks(proxy) {
const result = new Result(proxy);
result.append(
`${proxy.name}=shadowsocks,${proxy.server},${proxy.port},${proxy.cipher},"${proxy.password}"`,
);
// obfs
if (isPresent(proxy, 'plugin')) {
if (proxy.plugin === 'obfs') {
result.append(`,obfs-name=${proxy['plugin-opts'].mode}`);
result.appendIfPresent(
`,obfs-host=${proxy['plugin-opts'].host}`,
'plugin-opts.host',
);
result.appendIfPresent(
`,obfs-uri=${proxy['plugin-opts'].path}`,
'plugin-opts.path',
);
} else {
throw new Error(`plugin ${proxy.plugin} is not supported`);
}
}
// tfo
result.appendIfPresent(`,fast-open=${proxy.tfo}`, 'tfo');
// udp
result.appendIfPresent(`,udp=${proxy.udp}`, 'udp');
return result.toString();
}
function shadowsocksr(proxy) {
const result = new Result(proxy);
result.append(
`${proxy.name}=shadowsocksr,${proxy.server},${proxy.port},${proxy.cipher},"${proxy.password}"`,
);
// ssr protocol
result.append(`,protocol=${proxy.protocol}`);
result.appendIfPresent(
`,protocol-param=${proxy['protocol-param']}`,
'protocol-param',
);
// obfs
result.appendIfPresent(`,obfs=${proxy.obfs}`, 'obfs');
result.appendIfPresent(`,obfs-host=${proxy['obfs-param']}`, 'obfs-param');
// tfo
result.appendIfPresent(`,fast-open=${proxy.tfo}`, 'tfo');
// udp
result.appendIfPresent(`,udp=${proxy.udp}`, 'udp');
return result.toString();
}
function trojan(proxy) {
const result = new Result(proxy);
result.append(
`${proxy.name}=trojan,${proxy.server},${proxy.port},"${proxy.password}"`,
);
// transport
if (isPresent(proxy, 'network')) {
if (proxy.network === 'ws') {
result.append(`,transport=ws`);
result.appendIfPresent(
`,path=${proxy['ws-opts'].path}`,
'ws-opts.path',
);
result.appendIfPresent(
`,host=${proxy['ws-opts'].headers.Host}`,
'ws-opts.headers.Host',
);
} else {
throw new Error(`network ${proxy.network} is unsupported`);
}
}
// tls verification
result.appendIfPresent(
`,skip-cert-verify=${proxy['skip-cert-verify']}`,
'skip-cert-verify',
);
// sni
result.appendIfPresent(`,tls-name=${proxy.sni}`, 'sni');
// tfo
result.appendIfPresent(`,fast-open=${proxy.tfo}`, 'tfo');
// udp
result.appendIfPresent(`,udp=${proxy.udp}`, 'udp');
return result.toString();
}
function vmess(proxy) {
const result = new Result(proxy);
result.append(
`${proxy.name}=vmess,${proxy.server},${proxy.port},${
proxy.cipher === 'auto' ? 'none' : proxy.cipher
},"${proxy.uuid}"`,
);
// transport
if (isPresent(proxy, 'network')) {
if (proxy.network === 'ws') {
result.append(`,transport=ws`);
result.appendIfPresent(
`,path=${proxy['ws-opts'].path}`,
'ws-opts.path',
);
result.appendIfPresent(
`,host=${proxy['ws-opts'].headers.Host}`,
'ws-opts.headers.Host',
);
} else if (proxy.network === 'http') {
result.append(`,transport=http`);
result.appendIfPresent(
`,path=${proxy['http-opts'].path}`,
'http-opts.path',
);
result.appendIfPresent(
`,host=${proxy['http-opts'].headers.Host}`,
'http-opts.headers.Host',
);
} else {
throw new Error(`network ${proxy.network} is unsupported`);
}
} else {
result.append(`,transport=tcp`);
}
// tls
result.appendIfPresent(`,over-tls=${proxy.tls}`, 'tls');
// tls verification
result.appendIfPresent(
`,skip-cert-verify=${proxy['skip-cert-verify']}`,
'skip-cert-verify',
);
// sni
result.appendIfPresent(`,tls-name=${proxy.sni}`, 'sni');
// AEAD
result.appendIfPresent(`,alterId=${proxy.alterId}`, 'alterId');
// tfo
result.appendIfPresent(`,fast-open=${proxy.tfo}`, 'tfo');
// udp
result.appendIfPresent(`,udp=${proxy.udp}`, 'udp');
return result.toString();
}
function vless(proxy) {
const result = new Result(proxy);
result.append(
`${proxy.name}=vless,${proxy.server},${proxy.port},"${proxy.uuid}"`,
);
// transport
if (isPresent(proxy, 'network')) {
if (proxy.network === 'ws') {
result.append(`,transport=ws`);
result.appendIfPresent(
`,path=${proxy['ws-opts'].path}`,
'ws-opts.path',
);
result.appendIfPresent(
`,host=${proxy['ws-opts'].headers.Host}`,
'ws-opts.headers.Host',
);
} else if (proxy.network === 'http') {
result.append(`,transport=http`);
result.appendIfPresent(
`,path=${proxy['http-opts'].path}`,
'http-opts.path',
);
result.appendIfPresent(
`,host=${proxy['http-opts'].headers.Host}`,
'http-opts.headers.Host',
);
} else {
throw new Error(`network ${proxy.network} is unsupported`);
}
} else {
result.append(`,transport=tcp`);
}
// tls
result.appendIfPresent(`,over-tls=${proxy.tls}`, 'tls');
// tls verification
result.appendIfPresent(
`,skip-cert-verify=${proxy['skip-cert-verify']}`,
'skip-cert-verify',
);
// sni
result.appendIfPresent(`,tls-name=${proxy.sni}`, 'sni');
// tfo
result.appendIfPresent(`,fast-open=${proxy.tfo}`, 'tfo');
// udp
result.appendIfPresent(`,udp=${proxy.udp}`, 'udp');
return result.toString();
}
function http(proxy) {
const result = new Result(proxy);
const type = proxy.tls ? 'https' : 'http';
result.append(`${proxy.name}=${type},${proxy.server},${proxy.port}`);
result.appendIfPresent(`,${proxy.username}`, 'username');
result.appendIfPresent(`,"${proxy.password}"`, 'password');
// sni
result.appendIfPresent(`,sni=${proxy.sni}`, 'sni');
// tls verification
result.appendIfPresent(
`,skip-cert-verify=${proxy['skip-cert-verify']}`,
'skip-cert-verify',
);
// tfo
result.appendIfPresent(`,tfo=${proxy.tfo}`, 'tfo');
// udp
result.appendIfPresent(`,udp-relay=${proxy.udp}`, 'udp');
return result.toString();
}
+3 -3
View File
@@ -6,11 +6,11 @@
* ███████║╚██████╔╝██████╔╝ ███████║ ██║ ╚██████╔╝██║ ██║███████╗
* ╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝
* Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket!
* @updated: 2022/6/20 22:08:58
* @version: 2.0.11
* @updated: 2022/6/20 22:56:59
* @version: 2.1.0
* @author: Peng-YM
* @github: https://github.com/Peng-YM/Sub-Store
* @documentation: https://www.notion.so/Sub-Store-6259586994d34c11a4ced5c406264b46
*/
!function(){var createModuleFactory=function(t){var e;return function(r){return e||t(e={exports:{},parent:r},e.exports),e.exports}},_$buffer_2=createModuleFactory((function(t,e){(function(t){(function(){"use strict";e.Buffer=r,e.SlowBuffer=function(t){return+t!=t&&(t=0),r.alloc(+t)},e.INSPECT_MAX_BYTES=50;function t(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=r.prototype,e}function r(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return a(t)}return n(t,e,r)}function n(e,n,o){if("string"==typeof e)return function(e,n){if("string"==typeof n&&""!==n||(n="utf8"),!r.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var o=0|s(e,n),a=t(o),i=a.write(e,n);return i!==o&&(a=a.slice(0,i)),a}(e,n);if(ArrayBuffer.isView(e))return i(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(T(e,ArrayBuffer)||e&&T(e.buffer,ArrayBuffer))return function(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');var o;return(o=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n)).__proto__=r.prototype,o}(e,n,o);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var a=e.valueOf&&e.valueOf();if(null!=a&&a!==e)return r.from(a,n,o);var c=function(e){if(r.isBuffer(e)){var n=0|u(e.length),o=t(n);return 0===o.length||e.copy(o,0,0,n),o}return void 0!==e.length?"number"!=typeof e.length||j(e.length)?t(0):i(e):"Buffer"===e.type&&Array.isArray(e.data)?i(e.data):void 0}(e);if(c)return c;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return r.from(e[Symbol.toPrimitive]("string"),n,o);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function o(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function a(e){return o(e),t(e<0?0:0|u(e))}function i(e){for(var r=e.length<0?0:0|u(e.length),n=t(r),o=0;o<r;o+=1)n[o]=255&e[o];return n}function u(t){if(t>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function s(t,e){if(r.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||T(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,o=arguments.length>2&&!0===arguments[2];if(!o&&0===n)return 0;for(var a=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return k(t).length;default:if(a)return o?-1:L(t).length;e=(""+e).toLowerCase(),a=!0}}function c(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function l(t,e,n,o,a){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),j(n=+n)&&(n=a?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(a)return-1;n=t.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof e&&(e=r.from(e,o)),r.isBuffer(e))return 0===e.length?-1:p(t,e,n,o,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):p(t,[e],n,o,a);throw new TypeError("val must be string, number or Buffer")}function p(t,e,r,n,o){var a,i=1,u=t.length,s=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;i=2,u/=2,s/=2,r/=2}function c(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(o){var l=-1;for(a=r;a<u;a++)if(c(t,a)===c(e,-1===l?0:a-l)){if(-1===l&&(l=a),a-l+1===s)return l*i}else-1!==l&&(a-=a-l),l=-1}else for(r+s>u&&(r=u-s),a=r;a>=0;a--){for(var p=!0,f=0;f<s;f++)if(c(t,a+f)!==c(e,f)){p=!1;break}if(p)return a}return-1}function f(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var a=e.length;n>a/2&&(n=a/2);for(var i=0;i<n;++i){var u=parseInt(e.substr(2*i,2),16);if(j(u))return i;t[r+i]=u}return i}function _(t,e,r,n){return R(L(e,t.length-r),t,r,n)}function h(t,e,r,n){return R(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function d(t,e,r,n){return h(t,e,r,n)}function y(t,e,r,n){return R(k(e),t,r,n)}function g(t,e,r,n){return R(function(t,e){for(var r,n,o,a=[],i=0;i<t.length&&!((e-=2)<0);++i)n=(r=t.charCodeAt(i))>>8Line truncated
!function(){var createModuleFactory=function(t){var e;return function(r){return e||t(e={exports:{},parent:r},e.exports),e.exports}},_$buffer_2=createModuleFactory((function(t,e){(function(t){(function(){"use strict";e.Buffer=r,e.SlowBuffer=function(t){return+t!=t&&(t=0),r.alloc(+t)},e.INSPECT_MAX_BYTES=50;function t(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=r.prototype,e}function r(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return a(t)}return n(t,e,r)}function n(e,n,o){if("string"==typeof e)return function(e,n){if("string"==typeof n&&""!==n||(n="utf8"),!r.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var o=0|s(e,n),a=t(o),i=a.write(e,n);return i!==o&&(a=a.slice(0,i)),a}(e,n);if(ArrayBuffer.isView(e))return i(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(R(e,ArrayBuffer)||e&&R(e.buffer,ArrayBuffer))return function(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');var o;return(o=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n)).__proto__=r.prototype,o}(e,n,o);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var a=e.valueOf&&e.valueOf();if(null!=a&&a!==e)return r.from(a,n,o);var c=function(e){if(r.isBuffer(e)){var n=0|u(e.length),o=t(n);return 0===o.length||e.copy(o,0,0,n),o}return void 0!==e.length?"number"!=typeof e.length||T(e.length)?t(0):i(e):"Buffer"===e.type&&Array.isArray(e.data)?i(e.data):void 0}(e);if(c)return c;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return r.from(e[Symbol.toPrimitive]("string"),n,o);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function o(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function a(e){return o(e),t(e<0?0:0|u(e))}function i(e){for(var r=e.length<0?0:0|u(e.length),n=t(r),o=0;o<r;o+=1)n[o]=255&e[o];return n}function u(t){if(t>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function s(t,e){if(r.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||R(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,o=arguments.length>2&&!0===arguments[2];if(!o&&0===n)return 0;for(var a=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return k(t).length;default:if(a)return o?-1:L(t).length;e=(""+e).toLowerCase(),a=!0}}function c(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function p(t,e,n,o,a){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),T(n=+n)&&(n=a?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(a)return-1;n=t.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof e&&(e=r.from(e,o)),r.isBuffer(e))return 0===e.length?-1:l(t,e,n,o,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):l(t,[e],n,o,a);throw new TypeError("val must be string, number or Buffer")}function l(t,e,r,n,o){var a,i=1,u=t.length,s=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;i=2,u/=2,s/=2,r/=2}function c(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(o){var p=-1;for(a=r;a<u;a++)if(c(t,a)===c(e,-1===p?0:a-p)){if(-1===p&&(p=a),a-p+1===s)return p*i}else-1!==p&&(a-=a-p),p=-1}else for(r+s>u&&(r=u-s),a=r;a>=0;a--){for(var l=!0,f=0;f<s;f++)if(c(t,a+f)!==c(e,f)){l=!1;break}if(l)return a}return-1}function f(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var a=e.length;n>a/2&&(n=a/2);for(var i=0;i<n;++i){var u=parseInt(e.substr(2*i,2),16);if(T(u))return i;t[r+i]=u}return i}function _(t,e,r,n){return I(L(e,t.length-r),t,r,n)}function h(t,e,r,n){return I(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function d(t,e,r,n){return h(t,e,r,n)}function y(t,e,r,n){return I(k(e),t,r,n)}function g(t,e,r,n){return I(function(t,e){for(var r,n,o,a=[],i=0;i<t.length&&!((e-=2)<0);++i)n=(r=t.charCodeAt(i))>>8Line truncated