migu-api-enhanced 2.27.5 → 2.28.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist/YDRZ-JLSMOCYV.cjs +12 -0
- package/dist/YDRZ-JLSMOCYV.cjs.map +1 -0
- package/dist/YDRZ-PHOHCFZ7.mjs +12 -0
- package/dist/activity/index.cjs +10 -10
- package/dist/activity/index.cjs.map +1 -1
- package/dist/activity/index.mjs +5 -5
- package/dist/activity/index.mjs.map +1 -1
- package/dist/chunk-4LG74IW5.cjs +38 -0
- package/dist/chunk-4LG74IW5.cjs.map +1 -0
- package/dist/chunk-CGV2KEQH.mjs +38 -0
- package/dist/chunk-CGV2KEQH.mjs.map +1 -0
- package/dist/{chunk-HBSVQAOM.cjs → chunk-EJRBQONV.cjs} +17 -16
- package/dist/chunk-EJRBQONV.cjs.map +1 -0
- package/dist/{chunk-4ZNJQZKT.mjs → chunk-GU4YGYF5.mjs} +22 -29
- package/dist/chunk-GU4YGYF5.mjs.map +1 -0
- package/dist/chunk-KFBODHXY.mjs +438 -0
- package/dist/chunk-KFBODHXY.mjs.map +1 -0
- package/dist/chunk-KGXC32BN.cjs.map +1 -1
- package/dist/chunk-RKEORE6S.mjs +34 -0
- package/dist/{chunk-BNSCQPYL.mjs.map → chunk-RKEORE6S.mjs.map} +1 -1
- package/dist/{chunk-ZEGJU5LW.cjs → chunk-TVZESJ3J.cjs} +26 -33
- package/dist/chunk-TVZESJ3J.cjs.map +1 -0
- package/dist/{chunk-ID6VPLAX.mjs → chunk-VD7HOOHT.mjs} +16 -15
- package/dist/chunk-VD7HOOHT.mjs.map +1 -0
- package/dist/chunk-XQIVVOH2.cjs +34 -0
- package/dist/chunk-XQIVVOH2.cjs.map +1 -0
- package/dist/chunk-Y6RTHMBM.cjs +438 -0
- package/dist/chunk-Y6RTHMBM.cjs.map +1 -0
- package/dist/decryptMrc-OOH5UIFN.cjs.map +1 -1
- package/dist/index.cjs +308 -244
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +934 -46
- package/dist/index.d.ts +934 -46
- package/dist/index.mjs +180 -116
- package/dist/index.mjs.map +1 -1
- package/dist/login/index.cjs +81 -95
- package/dist/login/index.cjs.map +1 -1
- package/dist/login/index.mjs +76 -90
- package/dist/login/index.mjs.map +1 -1
- package/dist/mrc/index.cjs +7 -4
- package/dist/mrc/index.cjs.map +1 -1
- package/dist/mrc/index.mjs +6 -3
- package/dist/mrc/index.mjs.map +1 -1
- package/dist/{chunk-TOFOR57V.cjs → publicKey-K56XCMLR.cjs} +3 -4
- package/dist/publicKey-K56XCMLR.cjs.map +1 -0
- package/dist/{chunk-JRQEIAY5.mjs → publicKey-UVL2ID6N.mjs} +2 -3
- package/dist/rsalib-FMWPCK5N.mjs +9 -0
- package/dist/rsalib-VSMUMKOT.cjs +9 -0
- package/dist/rsalib-VSMUMKOT.cjs.map +1 -0
- package/dist/utils/index.cjs +184 -15
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +28 -14
- package/dist/utils/index.d.ts +28 -14
- package/dist/utils/index.mjs +192 -23
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +8 -5
- package/dist/YDRZ-M2NM4ZC5.mjs +0 -11
- package/dist/YDRZ-OJHYOY7I.cjs +0 -11
- package/dist/YDRZ-OJHYOY7I.cjs.map +0 -1
- package/dist/chunk-4ZNJQZKT.mjs.map +0 -1
- package/dist/chunk-6EZ26DPY.cjs +0 -18
- package/dist/chunk-6EZ26DPY.cjs.map +0 -1
- package/dist/chunk-BNSCQPYL.mjs +0 -18
- package/dist/chunk-C56WQXBU.cjs +0 -13
- package/dist/chunk-C56WQXBU.cjs.map +0 -1
- package/dist/chunk-FT3OOTMT.cjs +0 -140
- package/dist/chunk-FT3OOTMT.cjs.map +0 -1
- package/dist/chunk-HBSVQAOM.cjs.map +0 -1
- package/dist/chunk-HDGZY5R6.mjs +0 -13
- package/dist/chunk-HDGZY5R6.mjs.map +0 -1
- package/dist/chunk-ID6VPLAX.mjs.map +0 -1
- package/dist/chunk-QMBC3CRQ.mjs +0 -51
- package/dist/chunk-QMBC3CRQ.mjs.map +0 -1
- package/dist/chunk-TIKOSETY.cjs +0 -51
- package/dist/chunk-TIKOSETY.cjs.map +0 -1
- package/dist/chunk-TOFOR57V.cjs.map +0 -1
- package/dist/chunk-Y4SLGNQ3.mjs +0 -140
- package/dist/chunk-Y4SLGNQ3.mjs.map +0 -1
- package/dist/chunk-ZEGJU5LW.cjs.map +0 -1
- package/dist/publicKey-EHY5LDOP.cjs +0 -8
- package/dist/publicKey-EHY5LDOP.cjs.map +0 -1
- package/dist/publicKey-LX6G3T7L.mjs +0 -8
- package/dist/rsalib-GGMEGQT2.cjs +0 -9
- package/dist/rsalib-GGMEGQT2.cjs.map +0 -1
- package/dist/rsalib-HO4SSCTO.mjs +0 -9
- package/dist/rsalib-HO4SSCTO.mjs.map +0 -1
- /package/dist/{YDRZ-M2NM4ZC5.mjs.map → YDRZ-PHOHCFZ7.mjs.map} +0 -0
- /package/dist/{chunk-JRQEIAY5.mjs.map → publicKey-UVL2ID6N.mjs.map} +0 -0
- /package/dist/{publicKey-LX6G3T7L.mjs.map → rsalib-FMWPCK5N.mjs.map} +0 -0
|
@@ -1,27 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/utils/h5fetch.ts
|
|
2
2
|
var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const prefix = `${key}=`;
|
|
8
|
-
if (item.includes(prefix)) {
|
|
9
|
-
const mainPart = item.split(";")[0];
|
|
10
|
-
return mainPart.split("=")[1] || "";
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return "";
|
|
14
|
-
};
|
|
15
|
-
var getSetCookieValueFromObject = (headers, key) => {
|
|
16
|
-
const setCookieHeader = headers["set-cookie"];
|
|
17
|
-
if (!setCookieHeader) {
|
|
18
|
-
return "";
|
|
3
|
+
var client = _axios2.default.create({
|
|
4
|
+
adapter: ["fetch", "xhr", "http"],
|
|
5
|
+
fetchOptions: {
|
|
6
|
+
cache: "no-store"
|
|
19
7
|
}
|
|
20
|
-
|
|
21
|
-
return getCookieValue(cookies, key);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
// src/utils/h5fetch.ts
|
|
8
|
+
});
|
|
25
9
|
var _fetch = async (url, init) => {
|
|
26
10
|
const method = (_optionalChain([init, 'optionalAccess', _ => _.method]) || "GET").toUpperCase();
|
|
27
11
|
const headersRaw = _optionalChain([init, 'optionalAccess', _2 => _2.headers]);
|
|
@@ -45,22 +29,23 @@ var _fetch = async (url, init) => {
|
|
|
45
29
|
headers,
|
|
46
30
|
params: _optionalChain([init, 'optionalAccess', _3 => _3.params]),
|
|
47
31
|
maxRedirects: _optionalChain([init, 'optionalAccess', _4 => _4.maxRedirects]),
|
|
48
|
-
data: _optionalChain([init, 'optionalAccess', _5 => _5.body])
|
|
32
|
+
data: _optionalChain([init, 'optionalAccess', _5 => _5.body]),
|
|
33
|
+
responseType: _optionalChain([init, 'optionalAccess', _6 => _6.responseType]),
|
|
34
|
+
timeout: _optionalChain([init, 'optionalAccess', _7 => _7.timeout])
|
|
49
35
|
};
|
|
50
|
-
if (_optionalChain([init, 'optionalAccess',
|
|
36
|
+
if (_optionalChain([init, 'optionalAccess', _8 => _8.signal])) {
|
|
51
37
|
axiosConfig.signal = init.signal;
|
|
52
38
|
}
|
|
53
|
-
return await
|
|
39
|
+
return await client(axiosConfig);
|
|
54
40
|
};
|
|
55
41
|
var h5fetch = async (url, init) => {
|
|
56
42
|
const response = await _fetch(url, init);
|
|
57
43
|
return response.data;
|
|
58
44
|
};
|
|
59
45
|
var ckfetch = async (url, init) => {
|
|
60
|
-
const
|
|
61
|
-
const cookieHeader = _optionalChain([init, 'optionalAccess', _8 => _8.cookie]) ? Object.entries(init.cookie).map(([k, v]) => `${k}=${v}`).join("; ") : "";
|
|
46
|
+
const cookieHeader = _optionalChain([init, 'optionalAccess', _9 => _9.cookie]) ? Object.entries(init.cookie).map(([k, v]) => `${k}=${v}`).join("; ") : "";
|
|
62
47
|
const newHeaders = {};
|
|
63
|
-
if (_optionalChain([init, 'optionalAccess',
|
|
48
|
+
if (_optionalChain([init, 'optionalAccess', _10 => _10.headers])) {
|
|
64
49
|
if (init.headers instanceof Headers) {
|
|
65
50
|
init.headers.forEach((value, key) => {
|
|
66
51
|
newHeaders[key] = value;
|
|
@@ -76,10 +61,17 @@ var ckfetch = async (url, init) => {
|
|
|
76
61
|
if (cookieHeader) newHeaders["Cookie"] = cookieHeader;
|
|
77
62
|
const response = await _fetch(url, { ...init, headers: newHeaders });
|
|
78
63
|
const cookies = {};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
64
|
+
const setCookieRaw = response.headers["set-cookie"];
|
|
65
|
+
if (setCookieRaw) {
|
|
66
|
+
const setCookies = Array.isArray(setCookieRaw) ? setCookieRaw : [setCookieRaw];
|
|
67
|
+
for (const item of setCookies.flatMap((c) => c.split(",").map((s) => s.trim()))) {
|
|
68
|
+
const [pair] = item.split(";");
|
|
69
|
+
const eqIndex = pair.indexOf("=");
|
|
70
|
+
if (eqIndex > 0) {
|
|
71
|
+
const key = pair.slice(0, eqIndex).trim();
|
|
72
|
+
const value = pair.slice(eqIndex + 1).trim();
|
|
73
|
+
if (value) cookies[key] = value;
|
|
74
|
+
}
|
|
83
75
|
}
|
|
84
76
|
}
|
|
85
77
|
return {
|
|
@@ -91,5 +83,6 @@ var ckfetch = async (url, init) => {
|
|
|
91
83
|
|
|
92
84
|
|
|
93
85
|
|
|
94
|
-
|
|
95
|
-
|
|
86
|
+
|
|
87
|
+
exports._fetch = _fetch; exports.h5fetch = h5fetch; exports.ckfetch = ckfetch;
|
|
88
|
+
//# sourceMappingURL=chunk-TVZESJ3J.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["C:\\Users\\Domdk\\Documents\\trae_projects\\miguMusic-api-enhanced\\dist\\chunk-TVZESJ3J.cjs","../src/utils/h5fetch.ts"],"names":[],"mappings":"AAAA;ACAA,4EAA0C;AAU1C,IAAM,OAAA,EAAS,eAAA,CAAM,MAAA,CAAO;AAAA,EACxB,OAAA,EAAS,CAAC,OAAA,EAAS,KAAA,EAAO,MAAM,CAAA;AAAA,EAChC,YAAA,EAAc;AAAA,IACV,KAAA,EAAO;AAAA,EACX;AACJ,CAAC,CAAA;AAGM,IAAM,OAAA,EAAS,MAAA,CAAO,GAAA,EAAa,IAAA,EAAA,GAA4C;AAClF,EAAA,MAAM,OAAA,EAAA,iBAAU,IAAA,2BAAM,SAAA,GAAU,KAAA,CAAA,CAAO,WAAA,CAAY,CAAA;AACnD,EAAA,MAAM,WAAA,kBAAa,IAAA,6BAAM,SAAA;AACzB,EAAA,IAAI,QAAA,EAAkC,CAAC,CAAA;AAEvC,EAAA,GAAA,CAAI,UAAA,EAAY;AACZ,IAAA,GAAA,CAAI,WAAA,WAAsB,OAAA,EAAS;AAC/B,MAAA,UAAA,CAAW,OAAA,CAAQ,CAAC,KAAA,EAAO,GAAA,EAAA,GAAQ;AAC/B,QAAA,OAAA,CAAQ,GAAG,EAAA,EAAI,KAAA;AAAA,MACnB,CAAC,CAAA;AAAA,IACL,EAAA,KAAA,GAAA,CAAW,KAAA,CAAM,OAAA,CAAQ,UAAU,CAAA,EAAG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MAAA;AACmC,IAAA;AACG,MAAA;AACjB,QAAA;AACrB,MAAA;AACE,IAAA;AACmC,MAAA;AAC1C,IAAA;AACJ,EAAA;AAC0C,EAAA;AAEyB,EAAA;AAE1B,EAAA;AACS,EAAA;AAChC,EAAA;AAC+D,IAAA;AACH,IAAA;AACzC,MAAA;AACG,MAAA;AACf,MAAA;AAC2B,QAAA;AACG,QAAA;AACjB,QAAA;AAC9B,MAAA;AACJ,IAAA;AACJ,EAAA;AAEO,EAAA;AACY,IAAA;AACf,IAAA;AACJ,EAAA;AACJ;AD5BmF;AACA;AACA;AACA;AACA;AACA","file":"C:\\Users\\Domdk\\Documents\\trae_projects\\miguMusic-api-enhanced\\dist\\chunk-TVZESJ3J.cjs","sourcesContent":[null,"import axios, { AxiosRequestConfig } from 'axios';\r\n\r\ntype H5FetchInit = Omit<RequestInit, 'body'> & {\r\n body?: any;\r\n maxRedirects?: number;\r\n cookie?: Record<string, string>;\r\n params?: Record<string, string | number | boolean | undefined>;\r\n};\r\n\r\n// 统一 axios 实例,所有请求都由该实例发出\r\nconst client = axios.create({\r\n adapter: ['fetch', 'xhr', 'http'],\r\n fetchOptions: {\r\n cache: 'no-store',\r\n }\r\n});\r\n\r\n// 内部请求函数\r\nexport const _fetch = async (url: string, init?: H5FetchInit & AxiosRequestConfig) => {\r\n const method = (init?.method || 'GET').toUpperCase();\r\n const headersRaw = init?.headers;\r\n let headers: Record<string, string> = {};\r\n\r\n if (headersRaw) {\r\n if (headersRaw instanceof Headers) {\r\n headersRaw.forEach((value, key) => {\r\n headers[key] = value;\r\n });\r\n } else if (Array.isArray(headersRaw)) {\r\n headersRaw.forEach(([key, value]) => {\r\n headers[key] = value;\r\n });\r\n } else {\r\n headers = headersRaw as Record<string, string>;\r\n }\r\n }\r\n\r\n const axiosConfig: AxiosRequestConfig = {\r\n url,\r\n method,\r\n headers,\r\n params: init?.params,\r\n maxRedirects: init?.maxRedirects,\r\n data: init?.body,\r\n responseType: init?.responseType,\r\n timeout: init?.timeout,\r\n };\r\n\r\n if (init?.signal) {\r\n axiosConfig.signal = init.signal;\r\n }\r\n\r\n return await client(axiosConfig);\r\n};\r\n\r\n// fetch API 兼容层,只返回 body\r\nexport const h5fetch = async (url: string, init?: H5FetchInit & AxiosRequestConfig): Promise<any> => {\r\n const response = await _fetch(url, init);\r\n return response.data;\r\n};\r\n\r\n// 带 Cookie 处理的请求函数,自动设置并提取 cookie\r\nexport const ckfetch = async (\r\n url: string,\r\n init?: RequestInit & AxiosRequestConfig & {\r\n cookie?: Record<string, string>;\r\n }\r\n): Promise<{ data: any; cookies: Record<string, string> }> => {\r\n const cookieHeader = init?.cookie\r\n ? Object.entries(init.cookie).map(([k, v]) => `${k}=${v}`).join('; ')\r\n : '';\r\n\r\n const newHeaders: Record<string, string> = {};\r\n if (init?.headers) {\r\n if (init.headers instanceof Headers) {\r\n init.headers.forEach((value, key) => {\r\n newHeaders[key] = value;\r\n });\r\n } else if (Array.isArray(init.headers)) {\r\n init.headers.forEach(([key, value]) => {\r\n newHeaders[key] = value;\r\n });\r\n } else {\r\n Object.assign(newHeaders, init.headers);\r\n }\r\n }\r\n if (cookieHeader) newHeaders['Cookie'] = cookieHeader;\r\n\r\n const response = await _fetch(url, { ...init, headers: newHeaders });\r\n\r\n const cookies: Record<string, string> = {};\r\n const setCookieRaw = response.headers['set-cookie'] as string | string[] | undefined;\r\n if (setCookieRaw) {\r\n const setCookies = Array.isArray(setCookieRaw) ? setCookieRaw : [setCookieRaw];\r\n for (const item of setCookies.flatMap(c => c.split(',').map(s => s.trim()))) {\r\n const [pair] = item.split(';');\r\n const eqIndex = pair.indexOf('=');\r\n if (eqIndex > 0) {\r\n const key = pair.slice(0, eqIndex).trim();\r\n const value = pair.slice(eqIndex + 1).trim();\r\n if (value) cookies[key] = value;\r\n }\r\n }\r\n }\r\n\r\n return {\r\n data: response.data,\r\n cookies\r\n };\r\n};"]}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
h5fetch
|
|
3
|
+
} from "./chunk-GU4YGYF5.mjs";
|
|
4
|
+
|
|
1
5
|
// src/utils/YDRZ.ts
|
|
2
|
-
import
|
|
3
|
-
import axios from "axios";
|
|
6
|
+
import CryptoJS from "crypto-js";
|
|
4
7
|
function md5(s) {
|
|
5
|
-
return
|
|
8
|
+
return CryptoJS.MD5(s).toString(CryptoJS.enc.Hex);
|
|
6
9
|
}
|
|
7
10
|
var randomUA = () => {
|
|
8
11
|
return "Mozilla/5.0 (iPhone; CPU iPhone OS 17_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.6 Mobile/15E148 Safari/604.1";
|
|
@@ -110,18 +113,16 @@ var YDRZ = {
|
|
|
110
113
|
"businessType": optparams.businessType,
|
|
111
114
|
"userInformations": this.getUserInfo()
|
|
112
115
|
};
|
|
113
|
-
const
|
|
114
|
-
"
|
|
115
|
-
requestData,
|
|
116
|
-
{
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
"Origin": "https://passport.migu.cn"
|
|
120
|
-
}
|
|
116
|
+
const json = await h5fetch("https://verify.cmpassport.com/h5/getPreMobile", {
|
|
117
|
+
method: "POST",
|
|
118
|
+
body: requestData,
|
|
119
|
+
headers: {
|
|
120
|
+
"Referer": "https://passport.migu.cn/",
|
|
121
|
+
"Origin": "https://passport.migu.cn"
|
|
121
122
|
}
|
|
122
|
-
);
|
|
123
|
-
if (!
|
|
124
|
-
const
|
|
123
|
+
});
|
|
124
|
+
if (!json) return;
|
|
125
|
+
const token = json?.token || "";
|
|
125
126
|
if (!token) return;
|
|
126
127
|
return token;
|
|
127
128
|
}
|
|
@@ -132,4 +133,4 @@ export {
|
|
|
132
133
|
yTime,
|
|
133
134
|
YDRZ
|
|
134
135
|
};
|
|
135
|
-
//# sourceMappingURL=chunk-
|
|
136
|
+
//# sourceMappingURL=chunk-VD7HOOHT.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/YDRZ.ts"],"sourcesContent":["import CryptoJS from 'crypto-js';\r\nimport { h5fetch } from './h5fetch';\r\n\r\nexport type LoginOneClickData = {\r\n version: string,\r\n appId: string,\r\n openType: string,\r\n expandParams: string,\r\n isTest: boolean,\r\n sign: string,\r\n getNetworkType: string,\r\n getMsisdnMask: string,\r\n traceId: string,\r\n msgId: string,\r\n timestamp: string,\r\n uuid: string,\r\n businessType: string,\r\n userInformations: string,\r\n}\r\n\r\n/**\r\n * 调用方实际只需提供这些字段;其余字段由 getTokenInfo 内部补齐。\r\n */\r\nexport type GetTokenInfoInput = Pick<LoginOneClickData, 'version' | 'appId' | 'openType' | 'expandParams' | 'isTest' | 'sign' | 'getNetworkType' | 'getMsisdnMask'>;\r\n\r\nexport function md5(s: string){\r\n return CryptoJS.MD5(s).toString(CryptoJS.enc.Hex);\r\n}\r\nconst randomUA = () => {\r\n return \"Mozilla/5.0 (iPhone; CPU iPhone OS 17_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.6 Mobile/15E148 Safari/604.1\";\r\n}\r\nconst nav = {\r\n \"platform\": \"iPhone\",\r\n \"userAgent\": randomUA(),\r\n \"appVersion\": randomUA(),\r\n \"cookieEnabled\": true,\r\n \"empty\": null,\r\n \"hardwareConcurrency\": 6,\r\n \"language\": \"zh-CN\",\r\n \"plugins\": \"\",\r\n \"availWidth\": 390,\r\n \"availHeight\": 844,\r\n \"colorDepth\": 24,\r\n \"timezoneOffset\": -480\r\n}\r\nexport function yTime(){\r\n const date = new Date(),\r\n a =[date.getFullYear(),\r\n date.getMonth()+1,\r\n date.getDate(),\r\n date.getHours(),\r\n date.getMinutes(),\r\n date.getSeconds(),\r\n date.getMilliseconds()\r\n ];\r\n const f = a.map((t)=>{\r\n return t.toString().padStart(2,'0');\r\n })\r\n f[6]=f[6].toString().padStart(3,'0')\r\n return f.join('');\r\n}\r\n\r\nexport const YDRZ = {\r\n \"optparams\":{\r\n \"uuid\": \"\",\r\n \"msgId\": \"\",\r\n \"traceId\": \"\",\r\n \"businessType\": \"10\",\r\n \"appId\": \"\",\r\n \"timestamp\": yTime(),\r\n \"isimge\": false,\r\n \"expandParams\": \"\",\r\n \"userInformations\": \"\",\r\n \"CMRequestApi\": \"\"\r\n },\r\n\r\n randomString(len: number, range: number = 32) {\r\n var i, \r\n bite = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''), \r\n list = [];\r\n for (i = 0x0; i < len; i++)\r\n list[i] = bite[0 | Math.random() * range];\r\n return list.join('');\r\n },\r\n\r\n randomRange(min: number, max: number){\r\n return Math.floor(Math.random() * (min - max) + max);\r\n },\r\n\r\n getUA(){\r\n const ua = nav.userAgent,\r\n l = [nav.platform,\r\n ua,\r\n nav.appVersion,\r\n nav.cookieEnabled,\r\n undefined,\r\n nav.hardwareConcurrency,\r\n nav.language,\r\n nav.plugins,\r\n nav.availWidth,\r\n nav.availHeight,\r\n nav.colorDepth,\r\n nav.timezoneOffset],\r\n key = l.join('@@'),\r\n finalUA = ua.length > 100 ? ua.substring(0, 100) : ua;\r\n return nav.platform + '@@' + finalUA + '@@' + md5(key)\r\n },\r\n\r\n uaE(str: string) {\r\n var b, c, d, r4, r1, r2, r3, result = '', bite = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\", i = 0;\r\n for (; i < str.length; )\r\n r4 = (b = str.charCodeAt(i++)) >> 0x2,\r\n r1 = (0x3 & b) << 0x4 | (c = str.charCodeAt(i++)) >> 0x4,\r\n r2 = (0xf & c) << 0x2 | (d = str.charCodeAt(i++)) >> 0x6,\r\n r3 = 0x3f & d,\r\n isNaN(c) ? r2 = r3 = 0x40 : isNaN(d) && (r3 = 0x40),\r\n result = result + bite.charAt(r4) + bite.charAt(r1) + bite.charAt(r2) + bite.charAt(r3);\r\n return result;\r\n },\r\n\r\n getUserInfo(){\r\n return encodeURIComponent( this.uaE( this.getUA()))\r\n },\r\n\r\n getSign(appID: string, version: string){\r\n const optparams = this.optparams;\r\n optparams.uuid = this.randomString(32, 32);\r\n optparams.msgId = this.randomString(32, 32);\r\n this.optparams = optparams;\r\n\r\n return appID + optparams.msgId + optparams.timestamp + optparams.uuid + version;\r\n },\r\n\r\n async getTokenInfo(data: GetTokenInfoInput): Promise<string | undefined> {\r\n const optparams = this.optparams;\r\n const requestData: LoginOneClickData = {\r\n 'version': data.version,\r\n 'appId': data.appId,\r\n 'openType': data.openType,\r\n 'expandParams': data.expandParams,\r\n 'isTest': data.isTest,\r\n 'sign': data.sign,\r\n 'getNetworkType': data.getNetworkType,\r\n 'getMsisdnMask': data.getMsisdnMask,\r\n 'traceId': optparams.uuid,\r\n 'msgId': optparams.msgId,\r\n 'timestamp': optparams.timestamp,\r\n 'uuid': optparams.uuid,\r\n 'businessType': optparams.businessType,\r\n 'userInformations': this.getUserInfo()\r\n }\r\n //console.log(requestData);\r\n \r\n const json = await h5fetch(\"https://verify.cmpassport.com/h5/getPreMobile\", {\r\n method: 'POST',\r\n body: requestData,\r\n headers: {\r\n 'Referer': 'https://passport.migu.cn/',\r\n 'Origin': 'https://passport.migu.cn',\r\n },\r\n });\r\n\r\n if(!json) return; //console.error('fetch yd e');\r\n const token = json?.token || '';\r\n if(!token) return; //console.error('no token',json)\r\n //console.log(token)\r\n return token;\r\n }\r\n}\r\n"],"mappings":";;;;;AAAA,OAAO,cAAc;AAyBd,SAAS,IAAI,GAAU;AAC1B,SAAO,SAAS,IAAI,CAAC,EAAE,SAAS,SAAS,IAAI,GAAG;AACpD;AACA,IAAM,WAAW,MAAM;AACnB,SAAO;AACX;AACA,IAAM,MAAM;AAAA,EACR,YAAY;AAAA,EACZ,aAAa,SAAS;AAAA,EACtB,cAAc,SAAS;AAAA,EACvB,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,uBAAuB;AAAA,EACvB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,cAAc;AAAA,EACd,eAAe;AAAA,EACf,cAAc;AAAA,EAC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ACjB,gBAAgB,KAAK;AAAA,MACrB,UAAU,KAAK;AAAA,MACf,QAAQ,KAAK;AAAA,MACb,kBAAkB,KAAK;AAAA,MACvB,iBAAiB,KAAK;AAAA,MACtB,WAAW,UAAU;AAAA,MACrB,SAAS,UAAU;AAAA,MACnB,aAAa,UAAU;AAAA,MACvB,QAAQ,UAAU;AAAA,MAClB,gBAAgB,UAAU;AAAA,MAC1B,oBAAoB,KAAK,YAAY;AAAA,IACzC;AAGA,UAAM,OAAO,MAAM,QAAQ,iDAAiD;AAAA,MACxE,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA,QACL,WAAW;AAAA,QACX,UAAU;AAAA,MACd;AAAA,IACJ,CAAC;AAED,QAAG,CAAC,KAAM;AACV,UAAM,QAAQ,MAAM,SAAS;AAC7B,QAAG,CAAC,MAAO;AAEX,WAAO;AAAA,EACX;AACJ;","names":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/utils/device.ts
|
|
2
|
+
function getDeviceId(a, b) {
|
|
3
|
+
var c, d = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), e = [];
|
|
4
|
+
if (b = b || d.length, a)
|
|
5
|
+
for (c = 0; a > c; c++)
|
|
6
|
+
e[c] = d[0 | Math.random() * b];
|
|
7
|
+
else {
|
|
8
|
+
var f;
|
|
9
|
+
for (e[8] = e[13] = e[18] = e[23] = "-", e[14] = "4", c = 0; 36 > c; c++)
|
|
10
|
+
e[c] || (f = 0 | 16 * Math.random(), e[c] = d[19 == c ? 3 & f | 8 : f]);
|
|
11
|
+
}
|
|
12
|
+
return e.join("");
|
|
13
|
+
}
|
|
14
|
+
function randomMac() {
|
|
15
|
+
return Array.from({ length: 12 }, () => Math.floor(Math.random() * 16).toString(16)).join("").toUpperCase();
|
|
16
|
+
}
|
|
17
|
+
function tvDeviceId() {
|
|
18
|
+
return Array.from({ length: 16 }, () => Math.floor(Math.random() * 16).toString(16)).join("");
|
|
19
|
+
}
|
|
20
|
+
function privateIP() {
|
|
21
|
+
return `192.168.${Math.floor(Math.random() * 10)}.${Math.floor(Math.random() * 256)}`;
|
|
22
|
+
}
|
|
23
|
+
function createSalt() {
|
|
24
|
+
return Array.from({ length: 6 }, () => Math.floor(Math.random() * 10)).join("");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
exports.getDeviceId = getDeviceId; exports.randomMac = randomMac; exports.tvDeviceId = tvDeviceId; exports.privateIP = privateIP; exports.createSalt = createSalt;
|
|
34
|
+
//# sourceMappingURL=chunk-XQIVVOH2.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["C:\\Users\\Domdk\\Documents\\trae_projects\\miguMusic-api-enhanced\\dist\\chunk-XQIVVOH2.cjs","../src/utils/device.ts"],"names":[],"mappings":"AAAA;ACAO,SAAS,WAAA,CAAY,CAAA,EAAW,CAAA,EAAmB;AACtD,EAAA,IAAI,CAAA,EAAG,EAAA,EAAI,gEAAA,CAAiE,KAAA,CAAM,EAAE,CAAA,EAAG,EAAA,EAAI,CAAC,CAAA;AAC5F,EAAA,GAAA,CAAI,EAAA,EAAI,EAAA,GAAK,CAAA,CAAE,MAAA,EAAQ,CAAA;AACnB,IAAA,IAAA,CAAK,EAAA,EAAI,CAAA,EAAG,EAAA,EAAI,CAAA,EAAG,CAAA,EAAA;AACf,MAAA,CAAA,CAAE,CAAC,EAAA,EAAI,CAAA,CAAE,EAAA,EAAI,IAAA,CAAK,MAAA,CAAO,EAAA,EAAI,CAAC,CAAA;AAAA,EAAA,KACjC;AACD,IAAA,IAAI,CAAA;AACJ,IAAA,IAAA,CAAK,CAAA,CAAE,CAAC,EAAA,EAAI,CAAA,CAAE,EAAE,EAAA,EAAI,CAAA,CAAE,EAAE,EAAA,EAAI,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,EAAI,GAAG,CAAC,CAAA,CAAA;AACvF;AAC6B;AACmD,EAAA;AAChF;ADAsF;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"C:\\Users\\Domdk\\Documents\\trae_projects\\miguMusic-api-enhanced\\dist\\chunk-XQIVVOH2.cjs","sourcesContent":[null,"export function getDeviceId(a?:number, b?:number): string {\r\n var c, d = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\".split(\"\"), e = [];\r\n if (b = b || d.length, a)\r\n for (c = 0; a > c; c++)\r\n e[c] = d[0 | Math.random() * b];\r\n else {\r\n var f;\r\n for (e[8] = e[13] = e[18] = e[23] = \"-\", e[14] = \"4\", c = 0; \r\n 36 > c; c++)\r\n e[c] || (f = 0 | 16 * Math.random(),\r\n e[c] = d[19 == c ? 3 & f | 8 : f])\r\n }\r\n return e.join(\"\")\r\n}\r\nexport function randomMac() {\r\n return Array.from({ length: 12 }, () => Math.floor(Math.random() * 16).toString(16)).join('').toUpperCase();\r\n}\r\nexport function tvDeviceId() {\r\n return Array.from({ length: 16 }, () => Math.floor(Math.random() * 16).toString(16)).join('');\r\n}\r\nexport function privateIP() {\r\n return `192.168.${Math.floor(Math.random() * 10)}.${Math.floor(Math.random() * 256)}`;\r\n}\r\nexport function createSalt() {\r\n return Array.from({ length: 6 }, () => Math.floor(Math.random()*10)).join('');\r\n}\r\n"]}
|
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/utils/rsalib.js
|
|
2
|
+
var _cryptojs = require('crypto-js'); var _cryptojs2 = _interopRequireDefault(_cryptojs);
|
|
3
|
+
var rsa;
|
|
4
|
+
globalThis.define = function(id, deps, factory) {
|
|
5
|
+
let req = () => ({});
|
|
6
|
+
let exp = {};
|
|
7
|
+
let mod = { exports: exp };
|
|
8
|
+
factory(req, exp, mod);
|
|
9
|
+
rsa = mod.exports;
|
|
10
|
+
};
|
|
11
|
+
globalThis.window = {};
|
|
12
|
+
Object.defineProperty(globalThis, "navigator", {
|
|
13
|
+
writable: true,
|
|
14
|
+
value: {
|
|
15
|
+
appName: "Netscape",
|
|
16
|
+
appVersion: "5.0 (Node.js)"
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
globalThis.window.navigator = globalThis.navigator;
|
|
20
|
+
globalThis.window.crypto = {
|
|
21
|
+
getRandomValues: function(arr) {
|
|
22
|
+
const bytes = _cryptojs2.default.lib.WordArray.random(arr.length).toString(_cryptojs2.default.enc.Latin1);
|
|
23
|
+
for (let i = 0; i < arr.length; i++) {
|
|
24
|
+
arr[i] = bytes.charCodeAt(i) & 255;
|
|
25
|
+
}
|
|
26
|
+
return arr;
|
|
27
|
+
},
|
|
28
|
+
random: function(len) {
|
|
29
|
+
return _cryptojs2.default.lib.WordArray.random(len).toString(_cryptojs2.default.enc.Latin1);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
define("lib/rsa/rsa", [], function(a, b, c) {
|
|
33
|
+
function d(a2, b2, c2) {
|
|
34
|
+
null != a2 && ("number" == typeof a2 ? this.fromNumber(a2, b2, c2) : null == b2 && "string" != typeof a2 ? this.fromString(a2, 256) : this.fromString(a2, b2));
|
|
35
|
+
}
|
|
36
|
+
function e() {
|
|
37
|
+
return new d(null);
|
|
38
|
+
}
|
|
39
|
+
function f(a2, b2, c2, d2, e2, f2) {
|
|
40
|
+
for (; --f2 >= 0; ) {
|
|
41
|
+
var g2 = b2 * this[a2++] + c2[d2] + e2;
|
|
42
|
+
e2 = Math.floor(g2 / 67108864), c2[d2++] = 67108863 & g2;
|
|
43
|
+
}
|
|
44
|
+
return e2;
|
|
45
|
+
}
|
|
46
|
+
function g(a2, b2, c2, d2, e2, f2) {
|
|
47
|
+
for (var g2 = 32767 & b2, h2 = b2 >> 15; --f2 >= 0; ) {
|
|
48
|
+
var i2 = 32767 & this[a2], j2 = this[a2++] >> 15, k2 = h2 * i2 + j2 * g2;
|
|
49
|
+
i2 = g2 * i2 + ((32767 & k2) << 15) + c2[d2] + (1073741823 & e2), e2 = (i2 >>> 30) + (k2 >>> 15) + h2 * j2 + (e2 >>> 30), c2[d2++] = 1073741823 & i2;
|
|
50
|
+
}
|
|
51
|
+
return e2;
|
|
52
|
+
}
|
|
53
|
+
function h(a2, b2, c2, d2, e2, f2) {
|
|
54
|
+
for (var g2 = 16383 & b2, h2 = b2 >> 14; --f2 >= 0; ) {
|
|
55
|
+
var i2 = 16383 & this[a2], j2 = this[a2++] >> 14, k2 = h2 * i2 + j2 * g2;
|
|
56
|
+
i2 = g2 * i2 + ((16383 & k2) << 14) + c2[d2] + e2, e2 = (i2 >> 28) + (k2 >> 14) + h2 * j2, c2[d2++] = 268435455 & i2;
|
|
57
|
+
}
|
|
58
|
+
return e2;
|
|
59
|
+
}
|
|
60
|
+
function i(a2) {
|
|
61
|
+
return nb.charAt(a2);
|
|
62
|
+
}
|
|
63
|
+
function j(a2, b2) {
|
|
64
|
+
var c2 = ob[a2.charCodeAt(b2)];
|
|
65
|
+
return null == c2 ? -1 : c2;
|
|
66
|
+
}
|
|
67
|
+
function k(a2) {
|
|
68
|
+
for (var b2 = this.t - 1; b2 >= 0; --b2)
|
|
69
|
+
a2[b2] = this[b2];
|
|
70
|
+
a2.t = this.t, a2.s = this.s;
|
|
71
|
+
}
|
|
72
|
+
function l(a2) {
|
|
73
|
+
this.t = 1, this.s = 0 > a2 ? -1 : 0, a2 > 0 ? this[0] = a2 : -1 > a2 ? this[0] = a2 + this.DV : this.t = 0;
|
|
74
|
+
}
|
|
75
|
+
function m(a2) {
|
|
76
|
+
var b2 = e();
|
|
77
|
+
return b2.fromInt(a2), b2;
|
|
78
|
+
}
|
|
79
|
+
function n(a2, b2) {
|
|
80
|
+
var c2;
|
|
81
|
+
if (16 == b2)
|
|
82
|
+
c2 = 4;
|
|
83
|
+
else if (8 == b2)
|
|
84
|
+
c2 = 3;
|
|
85
|
+
else if (256 == b2)
|
|
86
|
+
c2 = 8;
|
|
87
|
+
else if (2 == b2)
|
|
88
|
+
c2 = 1;
|
|
89
|
+
else if (32 == b2)
|
|
90
|
+
c2 = 5;
|
|
91
|
+
else {
|
|
92
|
+
if (4 != b2)
|
|
93
|
+
return void this.fromRadix(a2, b2);
|
|
94
|
+
c2 = 2;
|
|
95
|
+
}
|
|
96
|
+
this.t = 0, this.s = 0;
|
|
97
|
+
for (var e2 = a2.length, f2 = false, g2 = 0; --e2 >= 0; ) {
|
|
98
|
+
var h2 = 8 == c2 ? 255 & a2[e2] : j(a2, e2);
|
|
99
|
+
0 > h2 ? "-" == a2.charAt(e2) && (f2 = true) : (f2 = false, 0 == g2 ? this[this.t++] = h2 : g2 + c2 > this.DB ? (this[this.t - 1] |= (h2 & (1 << this.DB - g2) - 1) << g2, this[this.t++] = h2 >> this.DB - g2) : this[this.t - 1] |= h2 << g2, g2 += c2, g2 >= this.DB && (g2 -= this.DB));
|
|
100
|
+
}
|
|
101
|
+
8 == c2 && 0 != (128 & a2[0]) && (this.s = -1, g2 > 0 && (this[this.t - 1] |= (1 << this.DB - g2) - 1 << g2)), this.clamp(), f2 && d.ZERO.subTo(this, this);
|
|
102
|
+
}
|
|
103
|
+
function o() {
|
|
104
|
+
for (var a2 = this.s & this.DM; this.t > 0 && this[this.t - 1] == a2; )
|
|
105
|
+
--this.t;
|
|
106
|
+
}
|
|
107
|
+
function p(a2) {
|
|
108
|
+
if (this.s < 0)
|
|
109
|
+
return "-" + this.negate().toString(a2);
|
|
110
|
+
var b2;
|
|
111
|
+
if (16 == a2)
|
|
112
|
+
b2 = 4;
|
|
113
|
+
else if (8 == a2)
|
|
114
|
+
b2 = 3;
|
|
115
|
+
else if (2 == a2)
|
|
116
|
+
b2 = 1;
|
|
117
|
+
else if (32 == a2)
|
|
118
|
+
b2 = 5;
|
|
119
|
+
else {
|
|
120
|
+
if (4 != a2)
|
|
121
|
+
return this.toRadix(a2);
|
|
122
|
+
b2 = 2;
|
|
123
|
+
}
|
|
124
|
+
var c2, d2 = (1 << b2) - 1, e2 = false, f2 = "", g2 = this.t, h2 = this.DB - g2 * this.DB % b2;
|
|
125
|
+
if (g2-- > 0)
|
|
126
|
+
for (h2 < this.DB && (c2 = this[g2] >> h2) > 0 && (e2 = true, f2 = i(c2)); g2 >= 0; )
|
|
127
|
+
b2 > h2 ? (c2 = (this[g2] & (1 << h2) - 1) << b2 - h2, c2 |= this[--g2] >> (h2 += this.DB - b2)) : (c2 = this[g2] >> (h2 -= b2) & d2, 0 >= h2 && (h2 += this.DB, --g2)), c2 > 0 && (e2 = true), e2 && (f2 += i(c2));
|
|
128
|
+
return e2 ? f2 : "0";
|
|
129
|
+
}
|
|
130
|
+
function q() {
|
|
131
|
+
var a2 = e();
|
|
132
|
+
return d.ZERO.subTo(this, a2), a2;
|
|
133
|
+
}
|
|
134
|
+
function r() {
|
|
135
|
+
return this.s < 0 ? this.negate() : this;
|
|
136
|
+
}
|
|
137
|
+
function s(a2) {
|
|
138
|
+
var b2 = this.s - a2.s;
|
|
139
|
+
if (0 != b2)
|
|
140
|
+
return b2;
|
|
141
|
+
var c2 = this.t;
|
|
142
|
+
if (b2 = c2 - a2.t, 0 != b2)
|
|
143
|
+
return this.s < 0 ? -b2 : b2;
|
|
144
|
+
for (; --c2 >= 0; )
|
|
145
|
+
if (0 != (b2 = this[c2] - a2[c2]))
|
|
146
|
+
return b2;
|
|
147
|
+
return 0;
|
|
148
|
+
}
|
|
149
|
+
function t(a2) {
|
|
150
|
+
var b2, c2 = 1;
|
|
151
|
+
return 0 != (b2 = a2 >>> 16) && (a2 = b2, c2 += 16), 0 != (b2 = a2 >> 8) && (a2 = b2, c2 += 8), 0 != (b2 = a2 >> 4) && (a2 = b2, c2 += 4), 0 != (b2 = a2 >> 2) && (a2 = b2, c2 += 2), 0 != (b2 = a2 >> 1) && (a2 = b2, c2 += 1), c2;
|
|
152
|
+
}
|
|
153
|
+
function u() {
|
|
154
|
+
return this.t <= 0 ? 0 : this.DB * (this.t - 1) + t(this[this.t - 1] ^ this.s & this.DM);
|
|
155
|
+
}
|
|
156
|
+
function v(a2, b2) {
|
|
157
|
+
var c2;
|
|
158
|
+
for (c2 = this.t - 1; c2 >= 0; --c2)
|
|
159
|
+
b2[c2 + a2] = this[c2];
|
|
160
|
+
for (c2 = a2 - 1; c2 >= 0; --c2)
|
|
161
|
+
b2[c2] = 0;
|
|
162
|
+
b2.t = this.t + a2, b2.s = this.s;
|
|
163
|
+
}
|
|
164
|
+
function w(a2, b2) {
|
|
165
|
+
for (var c2 = a2; c2 < this.t; ++c2)
|
|
166
|
+
b2[c2 - a2] = this[c2];
|
|
167
|
+
b2.t = Math.max(this.t - a2, 0), b2.s = this.s;
|
|
168
|
+
}
|
|
169
|
+
function x(a2, b2) {
|
|
170
|
+
var c2, d2 = a2 % this.DB, e2 = this.DB - d2, f2 = (1 << e2) - 1, g2 = Math.floor(a2 / this.DB), h2 = this.s << d2 & this.DM;
|
|
171
|
+
for (c2 = this.t - 1; c2 >= 0; --c2)
|
|
172
|
+
b2[c2 + g2 + 1] = this[c2] >> e2 | h2, h2 = (this[c2] & f2) << d2;
|
|
173
|
+
for (c2 = g2 - 1; c2 >= 0; --c2)
|
|
174
|
+
b2[c2] = 0;
|
|
175
|
+
b2[g2] = h2, b2.t = this.t + g2 + 1, b2.s = this.s, b2.clamp();
|
|
176
|
+
}
|
|
177
|
+
function y(a2, b2) {
|
|
178
|
+
b2.s = this.s;
|
|
179
|
+
var c2 = Math.floor(a2 / this.DB);
|
|
180
|
+
if (c2 >= this.t)
|
|
181
|
+
return void (b2.t = 0);
|
|
182
|
+
var d2 = a2 % this.DB, e2 = this.DB - d2, f2 = (1 << d2) - 1;
|
|
183
|
+
b2[0] = this[c2] >> d2;
|
|
184
|
+
for (var g2 = c2 + 1; g2 < this.t; ++g2)
|
|
185
|
+
b2[g2 - c2 - 1] |= (this[g2] & f2) << e2, b2[g2 - c2] = this[g2] >> d2;
|
|
186
|
+
d2 > 0 && (b2[this.t - c2 - 1] |= (this.s & f2) << e2), b2.t = this.t - c2, b2.clamp();
|
|
187
|
+
}
|
|
188
|
+
function z(a2, b2) {
|
|
189
|
+
for (var c2 = 0, d2 = 0, e2 = Math.min(a2.t, this.t); e2 > c2; )
|
|
190
|
+
d2 += this[c2] - a2[c2], b2[c2++] = d2 & this.DM, d2 >>= this.DB;
|
|
191
|
+
if (a2.t < this.t) {
|
|
192
|
+
for (d2 -= a2.s; c2 < this.t; )
|
|
193
|
+
d2 += this[c2], b2[c2++] = d2 & this.DM, d2 >>= this.DB;
|
|
194
|
+
d2 += this.s;
|
|
195
|
+
} else {
|
|
196
|
+
for (d2 += this.s; c2 < a2.t; )
|
|
197
|
+
d2 -= a2[c2], b2[c2++] = d2 & this.DM, d2 >>= this.DB;
|
|
198
|
+
d2 -= a2.s;
|
|
199
|
+
}
|
|
200
|
+
b2.s = 0 > d2 ? -1 : 0, -1 > d2 ? b2[c2++] = this.DV + d2 : d2 > 0 && (b2[c2++] = d2), b2.t = c2, b2.clamp();
|
|
201
|
+
}
|
|
202
|
+
function A(a2, b2) {
|
|
203
|
+
var c2 = this.abs(), e2 = a2.abs(), f2 = c2.t;
|
|
204
|
+
for (b2.t = f2 + e2.t; --f2 >= 0; )
|
|
205
|
+
b2[f2] = 0;
|
|
206
|
+
for (f2 = 0; f2 < e2.t; ++f2)
|
|
207
|
+
b2[f2 + c2.t] = c2.am(0, e2[f2], b2, f2, 0, c2.t);
|
|
208
|
+
b2.s = 0, b2.clamp(), this.s != a2.s && d.ZERO.subTo(b2, b2);
|
|
209
|
+
}
|
|
210
|
+
function B(a2) {
|
|
211
|
+
for (var b2 = this.abs(), c2 = a2.t = 2 * b2.t; --c2 >= 0; )
|
|
212
|
+
a2[c2] = 0;
|
|
213
|
+
for (c2 = 0; c2 < b2.t - 1; ++c2) {
|
|
214
|
+
var d2 = b2.am(c2, b2[c2], a2, 2 * c2, 0, 1);
|
|
215
|
+
(a2[c2 + b2.t] += b2.am(c2 + 1, 2 * b2[c2], a2, 2 * c2 + 1, d2, b2.t - c2 - 1)) >= b2.DV && (a2[c2 + b2.t] -= b2.DV, a2[c2 + b2.t + 1] = 1);
|
|
216
|
+
}
|
|
217
|
+
a2.t > 0 && (a2[a2.t - 1] += b2.am(c2, b2[c2], a2, 2 * c2, 0, 1)), a2.s = 0, a2.clamp();
|
|
218
|
+
}
|
|
219
|
+
function C(a2, b2, c2) {
|
|
220
|
+
var f2 = a2.abs();
|
|
221
|
+
if (!(f2.t <= 0)) {
|
|
222
|
+
var g2 = this.abs();
|
|
223
|
+
if (g2.t < f2.t)
|
|
224
|
+
return null != b2 && b2.fromInt(0), void (null != c2 && this.copyTo(c2));
|
|
225
|
+
null == c2 && (c2 = e());
|
|
226
|
+
var h2 = e(), i2 = this.s, j2 = a2.s, k2 = this.DB - t(f2[f2.t - 1]);
|
|
227
|
+
k2 > 0 ? (f2.lShiftTo(k2, h2), g2.lShiftTo(k2, c2)) : (f2.copyTo(h2), g2.copyTo(c2));
|
|
228
|
+
var l2 = h2.t, m2 = h2[l2 - 1];
|
|
229
|
+
if (0 != m2) {
|
|
230
|
+
var n2 = m2 * (1 << this.F1) + (l2 > 1 ? h2[l2 - 2] >> this.F2 : 0), o2 = this.FV / n2, p2 = (1 << this.F1) / n2, q2 = 1 << this.F2, r2 = c2.t, s2 = r2 - l2, u2 = null == b2 ? e() : b2;
|
|
231
|
+
for (h2.dlShiftTo(s2, u2), c2.compareTo(u2) >= 0 && (c2[c2.t++] = 1, c2.subTo(u2, c2)), d.ONE.dlShiftTo(l2, u2), u2.subTo(h2, h2); h2.t < l2; )
|
|
232
|
+
h2[h2.t++] = 0;
|
|
233
|
+
for (; --s2 >= 0; ) {
|
|
234
|
+
var v2 = c2[--r2] == m2 ? this.DM : Math.floor(c2[r2] * o2 + (c2[r2 - 1] + q2) * p2);
|
|
235
|
+
if ((c2[r2] += h2.am(0, v2, c2, s2, 0, l2)) < v2)
|
|
236
|
+
for (h2.dlShiftTo(s2, u2), c2.subTo(u2, c2); c2[r2] < --v2; )
|
|
237
|
+
c2.subTo(u2, c2);
|
|
238
|
+
}
|
|
239
|
+
null != b2 && (c2.drShiftTo(l2, b2), i2 != j2 && d.ZERO.subTo(b2, b2)), c2.t = l2, c2.clamp(), k2 > 0 && c2.rShiftTo(k2, c2), 0 > i2 && d.ZERO.subTo(c2, c2);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
function D(a2) {
|
|
244
|
+
var b2 = e();
|
|
245
|
+
return this.abs().divRemTo(a2, null, b2), this.s < 0 && b2.compareTo(d.ZERO) > 0 && a2.subTo(b2, b2), b2;
|
|
246
|
+
}
|
|
247
|
+
function E(a2) {
|
|
248
|
+
this.m = a2;
|
|
249
|
+
}
|
|
250
|
+
function F(a2) {
|
|
251
|
+
return a2.s < 0 || a2.compareTo(this.m) >= 0 ? a2.mod(this.m) : a2;
|
|
252
|
+
}
|
|
253
|
+
function G(a2) {
|
|
254
|
+
return a2;
|
|
255
|
+
}
|
|
256
|
+
function H(a2) {
|
|
257
|
+
a2.divRemTo(this.m, null, a2);
|
|
258
|
+
}
|
|
259
|
+
function I(a2, b2, c2) {
|
|
260
|
+
a2.multiplyTo(b2, c2), this.reduce(c2);
|
|
261
|
+
}
|
|
262
|
+
function J(a2, b2) {
|
|
263
|
+
a2.squareTo(b2), this.reduce(b2);
|
|
264
|
+
}
|
|
265
|
+
function K() {
|
|
266
|
+
if (this.t < 1)
|
|
267
|
+
return 0;
|
|
268
|
+
var a2 = this[0];
|
|
269
|
+
if (0 == (1 & a2))
|
|
270
|
+
return 0;
|
|
271
|
+
var b2 = 3 & a2;
|
|
272
|
+
return b2 = b2 * (2 - (15 & a2) * b2) & 15, b2 = b2 * (2 - (255 & a2) * b2) & 255, b2 = b2 * (2 - ((65535 & a2) * b2 & 65535)) & 65535, b2 = b2 * (2 - a2 * b2 % this.DV) % this.DV, b2 > 0 ? this.DV - b2 : -b2;
|
|
273
|
+
}
|
|
274
|
+
function L(a2) {
|
|
275
|
+
this.m = a2, this.mp = a2.invDigit(), this.mpl = 32767 & this.mp, this.mph = this.mp >> 15, this.um = (1 << a2.DB - 15) - 1, this.mt2 = 2 * a2.t;
|
|
276
|
+
}
|
|
277
|
+
function M(a2) {
|
|
278
|
+
var b2 = e();
|
|
279
|
+
return a2.abs().dlShiftTo(this.m.t, b2), b2.divRemTo(this.m, null, b2), a2.s < 0 && b2.compareTo(d.ZERO) > 0 && this.m.subTo(b2, b2), b2;
|
|
280
|
+
}
|
|
281
|
+
function N(a2) {
|
|
282
|
+
var b2 = e();
|
|
283
|
+
return a2.copyTo(b2), this.reduce(b2), b2;
|
|
284
|
+
}
|
|
285
|
+
function O(a2) {
|
|
286
|
+
for (; a2.t <= this.mt2; )
|
|
287
|
+
a2[a2.t++] = 0;
|
|
288
|
+
for (var b2 = 0; b2 < this.m.t; ++b2) {
|
|
289
|
+
var c2 = 32767 & a2[b2], d2 = c2 * this.mpl + ((c2 * this.mph + (a2[b2] >> 15) * this.mpl & this.um) << 15) & a2.DM;
|
|
290
|
+
for (c2 = b2 + this.m.t, a2[c2] += this.m.am(0, d2, a2, b2, 0, this.m.t); a2[c2] >= a2.DV; )
|
|
291
|
+
a2[c2] -= a2.DV, a2[++c2]++;
|
|
292
|
+
}
|
|
293
|
+
a2.clamp(), a2.drShiftTo(this.m.t, a2), a2.compareTo(this.m) >= 0 && a2.subTo(this.m, a2);
|
|
294
|
+
}
|
|
295
|
+
function P(a2, b2) {
|
|
296
|
+
a2.squareTo(b2), this.reduce(b2);
|
|
297
|
+
}
|
|
298
|
+
function Q(a2, b2, c2) {
|
|
299
|
+
a2.multiplyTo(b2, c2), this.reduce(c2);
|
|
300
|
+
}
|
|
301
|
+
function R() {
|
|
302
|
+
return 0 == (this.t > 0 ? 1 & this[0] : this.s);
|
|
303
|
+
}
|
|
304
|
+
function S(a2, b2) {
|
|
305
|
+
if (a2 > 4294967295 || 1 > a2)
|
|
306
|
+
return d.ONE;
|
|
307
|
+
var c2 = e(), f2 = e(), g2 = b2.convert(this), h2 = t(a2) - 1;
|
|
308
|
+
for (g2.copyTo(c2); --h2 >= 0; )
|
|
309
|
+
if (b2.sqrTo(c2, f2), (a2 & 1 << h2) > 0)
|
|
310
|
+
b2.mulTo(f2, g2, c2);
|
|
311
|
+
else {
|
|
312
|
+
var i2 = c2;
|
|
313
|
+
c2 = f2, f2 = i2;
|
|
314
|
+
}
|
|
315
|
+
return b2.revert(c2);
|
|
316
|
+
}
|
|
317
|
+
function T(a2, b2) {
|
|
318
|
+
var c2;
|
|
319
|
+
return c2 = 256 > a2 || b2.isEven() ? new E(b2) : new L(b2), this.exp(a2, c2);
|
|
320
|
+
}
|
|
321
|
+
function U() {
|
|
322
|
+
this.i = 0, this.j = 0, this.S = new Array();
|
|
323
|
+
}
|
|
324
|
+
function V(a2) {
|
|
325
|
+
var b2, c2, d2;
|
|
326
|
+
for (b2 = 0; 256 > b2; ++b2)
|
|
327
|
+
this.S[b2] = b2;
|
|
328
|
+
for (c2 = 0, b2 = 0; 256 > b2; ++b2)
|
|
329
|
+
c2 = c2 + this.S[b2] + a2[b2 % a2.length] & 255, d2 = this.S[b2], this.S[b2] = this.S[c2], this.S[c2] = d2;
|
|
330
|
+
this.i = 0, this.j = 0;
|
|
331
|
+
}
|
|
332
|
+
function W() {
|
|
333
|
+
var a2;
|
|
334
|
+
return this.i = this.i + 1 & 255, this.j = this.j + this.S[this.i] & 255, a2 = this.S[this.i], this.S[this.i] = this.S[this.j], this.S[this.j] = a2, this.S[a2 + this.S[this.i] & 255];
|
|
335
|
+
}
|
|
336
|
+
function X() {
|
|
337
|
+
return new U();
|
|
338
|
+
}
|
|
339
|
+
function Y(a2) {
|
|
340
|
+
qb[rb++] ^= 255 & a2, qb[rb++] ^= a2 >> 8 & 255, qb[rb++] ^= a2 >> 16 & 255, qb[rb++] ^= a2 >> 24 & 255, rb >= sb && (rb -= sb);
|
|
341
|
+
}
|
|
342
|
+
function Z() {
|
|
343
|
+
Y((/* @__PURE__ */ new Date()).getTime());
|
|
344
|
+
}
|
|
345
|
+
function $() {
|
|
346
|
+
if (null == pb) {
|
|
347
|
+
for (Z(), pb = X(), pb.init(qb), rb = 0; rb < qb.length; ++rb)
|
|
348
|
+
qb[rb] = 0;
|
|
349
|
+
rb = 0;
|
|
350
|
+
}
|
|
351
|
+
return pb.next();
|
|
352
|
+
}
|
|
353
|
+
function _(a2) {
|
|
354
|
+
var b2;
|
|
355
|
+
for (b2 = 0; b2 < a2.length; ++b2)
|
|
356
|
+
a2[b2] = $();
|
|
357
|
+
}
|
|
358
|
+
function ab() {
|
|
359
|
+
}
|
|
360
|
+
function bb(a2, b2) {
|
|
361
|
+
return new d(a2, b2);
|
|
362
|
+
}
|
|
363
|
+
function cb(a2, b2) {
|
|
364
|
+
if (b2 < a2.length + 11)
|
|
365
|
+
return console.error("Message too long for RSA"), null;
|
|
366
|
+
for (var c2 = new Array(), e2 = a2.length - 1; e2 >= 0 && b2 > 0; ) {
|
|
367
|
+
var f2 = a2.charCodeAt(e2--);
|
|
368
|
+
128 > f2 ? c2[--b2] = f2 : f2 > 127 && 2048 > f2 ? (c2[--b2] = 63 & f2 | 128, c2[--b2] = f2 >> 6 | 192) : (c2[--b2] = 63 & f2 | 128, c2[--b2] = f2 >> 6 & 63 | 128, c2[--b2] = f2 >> 12 | 224);
|
|
369
|
+
}
|
|
370
|
+
c2[--b2] = 0;
|
|
371
|
+
for (var g2 = new ab(), h2 = new Array(); b2 > 2; ) {
|
|
372
|
+
for (h2[0] = 0; 0 == h2[0]; )
|
|
373
|
+
g2.nextBytes(h2);
|
|
374
|
+
c2[--b2] = h2[0];
|
|
375
|
+
}
|
|
376
|
+
return c2[--b2] = 2, c2[--b2] = 0, new d(c2);
|
|
377
|
+
}
|
|
378
|
+
function db() {
|
|
379
|
+
this.n = null, this.e = 0, this.d = null, this.p = null, this.q = null, this.dmp1 = null, this.dmq1 = null, this.coeff = null;
|
|
380
|
+
}
|
|
381
|
+
function eb(a2, b2) {
|
|
382
|
+
null != a2 && null != b2 && a2.length > 0 && b2.length > 0 ? (this.n = bb(a2, 16), this.e = parseInt(b2, 16)) : console.error("net error");
|
|
383
|
+
}
|
|
384
|
+
function fb(a2) {
|
|
385
|
+
return a2.modPowInt(this.e, this.n);
|
|
386
|
+
}
|
|
387
|
+
function gb(a2) {
|
|
388
|
+
var b2 = cb(a2, this.n.bitLength() + 7 >> 3);
|
|
389
|
+
if (null == b2)
|
|
390
|
+
return null;
|
|
391
|
+
var c2 = this.doPublic(b2);
|
|
392
|
+
if (null == c2)
|
|
393
|
+
return null;
|
|
394
|
+
var d2 = c2.toString(16);
|
|
395
|
+
return 0 == (1 & d2.length) ? d2 : "0" + d2;
|
|
396
|
+
}
|
|
397
|
+
var hb, ib = 244837814094590, jb = 15715070 == (16777215 & ib);
|
|
398
|
+
jb && "Microsoft Internet Explorer" == navigator.appName ? (d.prototype.am = g, hb = 30) : jb && "Netscape" != navigator.appName ? (d.prototype.am = f, hb = 26) : (d.prototype.am = h, hb = 28), d.prototype.DB = hb, d.prototype.DM = (1 << hb) - 1, d.prototype.DV = 1 << hb;
|
|
399
|
+
var kb = 52;
|
|
400
|
+
d.prototype.FV = Math.pow(2, kb), d.prototype.F1 = kb - hb, d.prototype.F2 = 2 * hb - kb;
|
|
401
|
+
var lb, mb, nb = "0123456789abcdefghijklmnopqrstuvwxyz", ob = new Array();
|
|
402
|
+
for (lb = "0".charCodeAt(0), mb = 0; 9 >= mb; ++mb)
|
|
403
|
+
ob[lb++] = mb;
|
|
404
|
+
for (lb = "a".charCodeAt(0), mb = 10; 36 > mb; ++mb)
|
|
405
|
+
ob[lb++] = mb;
|
|
406
|
+
for (lb = "A".charCodeAt(0), mb = 10; 36 > mb; ++mb)
|
|
407
|
+
ob[lb++] = mb;
|
|
408
|
+
E.prototype.convert = F, E.prototype.revert = G, E.prototype.reduce = H, E.prototype.mulTo = I, E.prototype.sqrTo = J, L.prototype.convert = M, L.prototype.revert = N, L.prototype.reduce = O, L.prototype.mulTo = Q, L.prototype.sqrTo = P, d.prototype.copyTo = k, d.prototype.fromInt = l, d.prototype.fromString = n, d.prototype.clamp = o, d.prototype.dlShiftTo = v, d.prototype.drShiftTo = w, d.prototype.lShiftTo = x, d.prototype.rShiftTo = y, d.prototype.subTo = z, d.prototype.multiplyTo = A, d.prototype.squareTo = B, d.prototype.divRemTo = C, d.prototype.invDigit = K, d.prototype.isEven = R, d.prototype.exp = S, d.prototype.toString = p, d.prototype.negate = q, d.prototype.abs = r, d.prototype.compareTo = s, d.prototype.bitLength = u, d.prototype.mod = D, d.prototype.modPowInt = T, d.ZERO = m(0), d.ONE = m(1), U.prototype.init = V, U.prototype.next = W;
|
|
409
|
+
var pb, qb, rb, sb = 256;
|
|
410
|
+
if (null == qb) {
|
|
411
|
+
qb = new Array(), rb = 0;
|
|
412
|
+
var tb;
|
|
413
|
+
if (window.crypto && window.crypto.getRandomValues) {
|
|
414
|
+
var ub = new Uint8Array(32);
|
|
415
|
+
for (window.crypto.getRandomValues(ub), tb = 0; 32 > tb; ++tb)
|
|
416
|
+
qb[rb++] = ub[tb];
|
|
417
|
+
}
|
|
418
|
+
if ("Netscape" == navigator.appName && navigator.appVersion < "5" && window.crypto) {
|
|
419
|
+
var vb = window.crypto.random(32);
|
|
420
|
+
for (tb = 0; tb < vb.length; ++tb)
|
|
421
|
+
qb[rb++] = 255 & vb.charCodeAt(tb);
|
|
422
|
+
}
|
|
423
|
+
for (; sb > rb; )
|
|
424
|
+
tb = Math.floor(65536 * Math.random()), qb[rb++] = tb >>> 8, qb[rb++] = 255 & tb;
|
|
425
|
+
rb = 0, Z();
|
|
426
|
+
}
|
|
427
|
+
ab.prototype.nextBytes = _, db.prototype.doPublic = fb, db.prototype.setPublic = eb, db.prototype.encrypt = gb, c.exports = {
|
|
428
|
+
RSAKey: db
|
|
429
|
+
};
|
|
430
|
+
});
|
|
431
|
+
var RSAKey = _optionalChain([rsa, 'optionalAccess', _2 => _2.RSAKey]);
|
|
432
|
+
var rsalib_default = rsa;
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
exports.RSAKey = RSAKey; exports.rsalib_default = rsalib_default;
|
|
438
|
+
//# sourceMappingURL=chunk-Y6RTHMBM.cjs.map
|