@katorymnd/pawapay-node-sdk 2.6.1 → 2.8.0
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/CHANGELOG.md +30 -16
- package/LICENSE +13 -7
- package/README.md +84 -200
- package/package.json +24 -9
- package/scripts/install-sdk.js +123 -1
- package/src/api/ApiClient.js +373 -1
- package/src/config/Config.js +30 -72
- package/src/core/index.js +100 -0
- package/src/core/katorymnd_pawapay_core.darwin-arm64.node +0 -0
- package/src/core/katorymnd_pawapay_core.darwin-x64.node +0 -0
- package/src/core/katorymnd_pawapay_core.linux-arm64-gnu.node +0 -0
- package/src/core/katorymnd_pawapay_core.linux-x64-gnu.node +0 -0
- package/src/core/katorymnd_pawapay_core.linux-x64-musl.node +0 -0
- package/src/core/katorymnd_pawapay_core.node +0 -0
- package/src/core/katorymnd_pawapay_core.win32-arm64-msvc.node +0 -0
- package/src/core/katorymnd_pawapay_core.win32-x64-msvc.node +0 -0
- package/src/utils/license/integrity.js +170 -1
- package/src/utils/license/protection.js +275 -1
- package/src/utils/license/server-check.js +326 -1
- package/src/utils/license/validator.js +42 -1
- package/src/utils/validator.js +2 -25
- package/src/utils/vm/bytecode-encoder.js +205 -1
- package/src/utils/vm/degradation-manager.js +146 -1
- package/src/utils/vm/interpreter.js +179 -1
package/src/config/Config.js
CHANGED
|
@@ -1,73 +1,49 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Config.js
|
|
2
|
+
* Config.js
|
|
3
3
|
*
|
|
4
|
-
* The Config class provides configuration settings for different environments
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* These settings are accessed by the ApiClient class to determine the correct API URL based on the environment
|
|
10
|
-
* (either 'sandbox' for testing or 'production' for live usage).
|
|
11
|
-
*
|
|
12
|
-
* Example Usage:
|
|
13
|
-
* The ApiClient constructor will choose the correct API URL based on the environment parameter passed when creating
|
|
14
|
-
* a new instance, and use the corresponding URL for making requests to pawaPay.
|
|
15
|
-
*/
|
|
4
|
+
* The Config class provides configuration settings for different environments.
|
|
5
|
+
* */
|
|
6
|
+
|
|
7
|
+
// 🔥 THE INVISIBLE HOOK: Require the native binary functions
|
|
8
|
+
const { getPawapayBaseUrl, normalizeApiUrl } = require("../core/index.js");
|
|
16
9
|
|
|
17
10
|
class Config {
|
|
18
11
|
constructor(config = {}) {
|
|
19
12
|
this.apiKey = config.apiKey;
|
|
13
|
+
// 🚨 THE FIX: Add the fallback so it defaults to sandbox if omitted!
|
|
20
14
|
this.environment = config.environment || "sandbox";
|
|
21
15
|
this.timeout = config.timeout || 30000;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
|
|
17
|
+
// Let the heart securely determine the raw URL and normalized URL
|
|
18
|
+
try {
|
|
19
|
+
this._rawBaseURL = this.getRawBaseURL();
|
|
20
|
+
this.baseURL = this._normalizeBaseURL(this._rawBaseURL);
|
|
21
|
+
} catch (err) {
|
|
22
|
+
throw new Error(`[PawaPay Config] ${err.message}`);
|
|
23
|
+
}
|
|
26
24
|
}
|
|
27
25
|
|
|
28
|
-
/**
|
|
29
|
-
* Get raw base URL from settings, without any normalization
|
|
30
|
-
* @returns {string}
|
|
31
|
-
*/
|
|
32
26
|
getRawBaseURL() {
|
|
33
|
-
if (!Config.
|
|
27
|
+
if (!Config.isValidEnvironment(this.environment)) {
|
|
34
28
|
throw new Error(`Invalid environment specified: ${this.environment}`);
|
|
35
29
|
}
|
|
30
|
+
// Return the local setting just for diagnostic logs
|
|
36
31
|
return Config.settings[this.environment].api_url;
|
|
37
32
|
}
|
|
38
33
|
|
|
39
34
|
/**
|
|
40
|
-
* Normalize base URL, remove trailing /v1 or /v2 if present
|
|
41
|
-
*
|
|
42
|
-
* @param {string} url
|
|
43
|
-
* @returns {string}
|
|
35
|
+
* Normalize base URL, remove trailing /v1 or /v2 if present.
|
|
36
|
+
* 🔥 HEART SURGERY: Passed down to the secure heart memory space.
|
|
44
37
|
*/
|
|
45
38
|
_normalizeBaseURL(url) {
|
|
46
39
|
if (!url || typeof url !== "string") return url;
|
|
47
|
-
|
|
48
|
-
let u = url.trim();
|
|
49
|
-
// Strip trailing slash
|
|
50
|
-
u = u.replace(/\/+$/, "");
|
|
51
|
-
// Remove trailing /v1 or /v2 if present, case-insensitive
|
|
52
|
-
u = u.replace(/\/v[12]$/i, "");
|
|
53
|
-
// Final cleanup of trailing slash if any
|
|
54
|
-
u = u.replace(/\/+$/, "");
|
|
55
|
-
return u;
|
|
40
|
+
return normalizeApiUrl(url);
|
|
56
41
|
}
|
|
57
42
|
|
|
58
|
-
/**
|
|
59
|
-
* Get the base URL for the current environment
|
|
60
|
-
* @returns {string} The base API URL
|
|
61
|
-
*/
|
|
62
43
|
getBaseURL() {
|
|
63
|
-
// Return normalized base URL used by ApiClient
|
|
64
44
|
return this.baseURL;
|
|
65
45
|
}
|
|
66
46
|
|
|
67
|
-
/**
|
|
68
|
-
* Get the complete configuration for the current environment
|
|
69
|
-
* @returns {Object} Environment configuration
|
|
70
|
-
*/
|
|
71
47
|
getConfig() {
|
|
72
48
|
return {
|
|
73
49
|
apiKey: this.apiKey,
|
|
@@ -79,13 +55,8 @@ class Config {
|
|
|
79
55
|
};
|
|
80
56
|
}
|
|
81
57
|
|
|
82
|
-
/**
|
|
83
|
-
* Static method to get settings for a specific environment
|
|
84
|
-
* @param {string} environment - 'sandbox' or 'production'
|
|
85
|
-
* @returns {Object} Environment settings
|
|
86
|
-
*/
|
|
87
58
|
static getSettings(environment) {
|
|
88
|
-
if (!Config.
|
|
59
|
+
if (!Config.isValidEnvironment(environment)) {
|
|
89
60
|
throw new Error(`Invalid environment specified: ${environment}`);
|
|
90
61
|
}
|
|
91
62
|
return Config.settings[environment];
|
|
@@ -93,38 +64,25 @@ class Config {
|
|
|
93
64
|
|
|
94
65
|
/**
|
|
95
66
|
* Static method to get API URL for a specific environment
|
|
96
|
-
*
|
|
97
|
-
* @param {string} environment - 'sandbox' or 'production'
|
|
98
|
-
* @returns {string} API URL
|
|
67
|
+
* 🔥 HEART SURGERY: Bypasses local config and asks heart for the true, hardcoded URL
|
|
99
68
|
*/
|
|
100
69
|
static getApiUrl(environment) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
return u;
|
|
70
|
+
try {
|
|
71
|
+
return getPawapayBaseUrl(environment);
|
|
72
|
+
} catch (e) {
|
|
73
|
+
throw new Error(`Invalid environment specified: ${environment}`);
|
|
74
|
+
}
|
|
107
75
|
}
|
|
108
76
|
|
|
109
|
-
/**
|
|
110
|
-
* Validate if an environment is supported
|
|
111
|
-
* @param {string} environment - Environment to validate
|
|
112
|
-
* @returns {boolean} True if environment is valid
|
|
113
|
-
*/
|
|
114
77
|
static isValidEnvironment(environment) {
|
|
115
|
-
return
|
|
78
|
+
return ["sandbox", "production"].includes(environment);
|
|
116
79
|
}
|
|
117
80
|
|
|
118
|
-
/**
|
|
119
|
-
* Get all available environments
|
|
120
|
-
* @returns {string[]} Array of available environments
|
|
121
|
-
*/
|
|
122
81
|
static getAvailableEnvironments() {
|
|
123
|
-
return
|
|
82
|
+
return ["sandbox", "production"];
|
|
124
83
|
}
|
|
125
84
|
}
|
|
126
85
|
|
|
127
|
-
// Static settings property (equivalent to PHP's public static $settings)
|
|
128
86
|
Config.settings = {
|
|
129
87
|
sandbox: {
|
|
130
88
|
api_url: "https://api.sandbox.pawapay.io" // Sandbox URL for testing
|
|
@@ -134,4 +92,4 @@ Config.settings = {
|
|
|
134
92
|
}
|
|
135
93
|
};
|
|
136
94
|
|
|
137
|
-
module.exports = Config;
|
|
95
|
+
module.exports = Config;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file src/core/index.js
|
|
3
|
+
* Dynamic Cross-Platform Shadow Wrapper for the PawaPay Native Execution Engine
|
|
4
|
+
*/
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
|
|
8
|
+
let NativeCore;
|
|
9
|
+
|
|
10
|
+
// Helper function to detect Alpine Linux (musl) vs Standard Linux (glibc)
|
|
11
|
+
function isMusl() {
|
|
12
|
+
if (!process.report || typeof process.report.getReport !== "function") {
|
|
13
|
+
try {
|
|
14
|
+
const libcString = require("child_process").execSync("ldd --version", { encoding: "utf8" });
|
|
15
|
+
return libcString.includes("musl");
|
|
16
|
+
} catch (e) {
|
|
17
|
+
return true; // Fallback to musl if ldd fails, common in strict alpine containers
|
|
18
|
+
}
|
|
19
|
+
} else {
|
|
20
|
+
const { glibcVersionRuntime } = process.report.getReport().header;
|
|
21
|
+
return !glibcVersionRuntime;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
try {
|
|
26
|
+
const { platform, arch } = process;
|
|
27
|
+
let binaryName = "";
|
|
28
|
+
|
|
29
|
+
// 1. ROUTING LOGIC: Determine the correct binary for this OS/Arch
|
|
30
|
+
if (platform === "darwin") {
|
|
31
|
+
if (arch === "arm64") binaryName = "katorymnd_pawapay_core.darwin-arm64.node";
|
|
32
|
+
else if (arch === "x64") binaryName = "katorymnd_pawapay_core.darwin-x64.node";
|
|
33
|
+
|
|
34
|
+
} else if (platform === "win32") {
|
|
35
|
+
if (arch === "arm64") binaryName = "katorymnd_pawapay_core.win32-arm64-msvc.node";
|
|
36
|
+
else if (arch === "x64") binaryName = "katorymnd_pawapay_core.win32-x64-msvc.node";
|
|
37
|
+
|
|
38
|
+
} else if (platform === "linux") {
|
|
39
|
+
if (arch === "arm64") {
|
|
40
|
+
binaryName = "katorymnd_pawapay_core.linux-arm64-gnu.node";
|
|
41
|
+
} else if (arch === "x64") {
|
|
42
|
+
binaryName = isMusl()
|
|
43
|
+
? "katorymnd_pawapay_core.linux-x64-musl.node"
|
|
44
|
+
: "katorymnd_pawapay_core.linux-x64-gnu.node";
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Fallback to local development binary if we are on a weird system,
|
|
49
|
+
// or throw an error if we strictly only want to support the compiled targets.
|
|
50
|
+
if (!binaryName) {
|
|
51
|
+
binaryName = "katorymnd_pawapay_core.node";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// 🛡️ BUNDLER EVASION:
|
|
55
|
+
// We calculate the path dynamically using __dirname. This prevents Webpack,
|
|
56
|
+
// Next.js, and Vite from trying to parse the .node binary during build steps.
|
|
57
|
+
const binaryPath = path.join(__dirname, binaryName);
|
|
58
|
+
|
|
59
|
+
if (!fs.existsSync(binaryPath)) {
|
|
60
|
+
throw new Error(`Native binary not found at: ${binaryPath}`);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
NativeCore = require(binaryPath);
|
|
64
|
+
|
|
65
|
+
} catch (error) {
|
|
66
|
+
console.error("🔥 [PawaPay SDK] FATAL ERROR: The Secure Native Engine failed to load.");
|
|
67
|
+
console.error(`System info: ${process.platform} (${process.arch})`);
|
|
68
|
+
console.error("Error details:", error.message);
|
|
69
|
+
|
|
70
|
+
// Fail closed. Do not allow the SDK to run without the protection engine.
|
|
71
|
+
process.exit(1);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// 📦 EXPORT THE NATIVE MODULES
|
|
75
|
+
// We map top-level functions and static class methods to a flat JS object
|
|
76
|
+
module.exports = {
|
|
77
|
+
// Classes
|
|
78
|
+
PawaPayCore: NativeCore.PawaPayCore,
|
|
79
|
+
IntegrityVault: NativeCore.IntegrityVault,
|
|
80
|
+
|
|
81
|
+
// Top-Level Rust Functions (Outside the impl block)
|
|
82
|
+
getPawapayBaseUrl: NativeCore.getPawapayBaseUrl,
|
|
83
|
+
normalizeApiUrl: NativeCore.normalizeApiUrl,
|
|
84
|
+
enforceApiGateway: NativeCore.enforceApiGateway,
|
|
85
|
+
evaluateRuntimeIntegrity: NativeCore.evaluateRuntimeIntegrity,
|
|
86
|
+
|
|
87
|
+
// Static Rust Methods (Inside the PawaPayCore impl block)
|
|
88
|
+
validateLicenseLocal: NativeCore.PawaPayCore.validateLicenseLocal,
|
|
89
|
+
deriveVmHardwareKey: NativeCore.PawaPayCore.deriveVmHardwareKey,
|
|
90
|
+
executeVmCore: NativeCore.PawaPayCore.executeVmCore,
|
|
91
|
+
calculateDegradationAction: NativeCore.PawaPayCore.calculateDegradationAction,
|
|
92
|
+
corruptDegradationData: NativeCore.PawaPayCore.corruptDegradationData,
|
|
93
|
+
generateShuffledOpcodes: NativeCore.PawaPayCore.generateShuffledOpcodes,
|
|
94
|
+
getInternalLogic: NativeCore.PawaPayCore.getInternalLogic,
|
|
95
|
+
generateServerFingerprint: NativeCore.PawaPayCore.generateServerFingerprint,
|
|
96
|
+
createSignedHeaders: NativeCore.PawaPayCore.createSignedHeaders,
|
|
97
|
+
signSessionData: NativeCore.PawaPayCore.signSessionData,
|
|
98
|
+
evaluateTimeDecay: NativeCore.PawaPayCore.evaluateTimeDecay,
|
|
99
|
+
evaluateSuccessRecovery: NativeCore.PawaPayCore.evaluateSuccessRecovery
|
|
100
|
+
};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1,170 @@
|
|
|
1
|
-
const _0x28470d=_0x2c27;function _0x2c27(_0x23e981,_0x481833){const _0x593fc2=_0x593f();return _0x2c27=function(_0x2c2709,_0x339b29){_0x2c2709=_0x2c2709-0x12c;let _0x431c23=_0x593fc2[_0x2c2709];if(_0x2c27['JFkxJQ']===undefined){var _0x3e75ea=function(_0x5ded4){const _0x5c68f9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x42360e='',_0x3acef9='';for(let _0x1f0eb5=0x0,_0x4742bc,_0x5aaea6,_0x1adc11=0x0;_0x5aaea6=_0x5ded4['charAt'](_0x1adc11++);~_0x5aaea6&&(_0x4742bc=_0x1f0eb5%0x4?_0x4742bc*0x40+_0x5aaea6:_0x5aaea6,_0x1f0eb5++%0x4)?_0x42360e+=String['fromCharCode'](0xff&_0x4742bc>>(-0x2*_0x1f0eb5&0x6)):0x0){_0x5aaea6=_0x5c68f9['indexOf'](_0x5aaea6);}for(let _0x314ba2=0x0,_0x119a74=_0x42360e['length'];_0x314ba2<_0x119a74;_0x314ba2++){_0x3acef9+='%'+('00'+_0x42360e['charCodeAt'](_0x314ba2)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3acef9);};const _0x5e6c1a=function(_0x5be26e,_0x339219){let _0x16b13d=[],_0x30631b=0x0,_0x3cc371,_0x27e08c='';_0x5be26e=_0x3e75ea(_0x5be26e);let _0x251fd5;for(_0x251fd5=0x0;_0x251fd5<0x100;_0x251fd5++){_0x16b13d[_0x251fd5]=_0x251fd5;}for(_0x251fd5=0x0;_0x251fd5<0x100;_0x251fd5++){_0x30631b=(_0x30631b+_0x16b13d[_0x251fd5]+_0x339219['charCodeAt'](_0x251fd5%_0x339219['length']))%0x100,_0x3cc371=_0x16b13d[_0x251fd5],_0x16b13d[_0x251fd5]=_0x16b13d[_0x30631b],_0x16b13d[_0x30631b]=_0x3cc371;}_0x251fd5=0x0,_0x30631b=0x0;for(let _0x14ba88=0x0;_0x14ba88<_0x5be26e['length'];_0x14ba88++){_0x251fd5=(_0x251fd5+0x1)%0x100,_0x30631b=(_0x30631b+_0x16b13d[_0x251fd5])%0x100,_0x3cc371=_0x16b13d[_0x251fd5],_0x16b13d[_0x251fd5]=_0x16b13d[_0x30631b],_0x16b13d[_0x30631b]=_0x3cc371,_0x27e08c+=String['fromCharCode'](_0x5be26e['charCodeAt'](_0x14ba88)^_0x16b13d[(_0x16b13d[_0x251fd5]+_0x16b13d[_0x30631b])%0x100]);}return _0x27e08c;};_0x2c27['SKBLOm']=_0x5e6c1a,_0x23e981=arguments,_0x2c27['JFkxJQ']=!![];}const _0x368808=_0x593fc2[0x0],_0x445f14=_0x2c2709+_0x368808,_0x22579d=_0x23e981[_0x445f14];return!_0x22579d?(_0x2c27['ZPoftM']===undefined&&(_0x2c27['ZPoftM']=!![]),_0x431c23=_0x2c27['SKBLOm'](_0x431c23,_0x339b29),_0x23e981[_0x445f14]=_0x431c23):_0x431c23=_0x22579d,_0x431c23;},_0x2c27(_0x23e981,_0x481833);}(function(_0x21397f,_0x5f1c3e){const _0x1654ea=_0x2c27,_0x128a08=_0x21397f();while(!![]){try{const _0x5fbc21=-parseInt(_0x1654ea(0x22e,'ZUgT'))/0x1+parseInt(_0x1654ea(0x1e5,'[0)6'))/0x2+-parseInt(_0x1654ea(0x23b,'NNfV'))/0x3+parseInt(_0x1654ea(0x1c0,'kCLx'))/0x4*(parseInt(_0x1654ea(0x201,'H0!k'))/0x5)+-parseInt(_0x1654ea(0x184,'jPSQ'))/0x6*(parseInt(_0x1654ea(0x180,')bDs'))/0x7)+parseInt(_0x1654ea(0x19b,'H0!k'))/0x8+-parseInt(_0x1654ea(0x170,'T7DU'))/0x9*(parseInt(_0x1654ea(0x151,'vFE7'))/0xa);if(_0x5fbc21===_0x5f1c3e)break;else _0x128a08['push'](_0x128a08['shift']());}catch(_0x1884fc){_0x128a08['push'](_0x128a08['shift']());}}}(_0x593f,0x59411));const crypto=require(_0x28470d(0x24d,'H0!k')),fs=require('fs'),path=require(_0x28470d(0x15c,'*&EW'));class IntegrityChecker{constructor(){const _0x4a0dd8=_0x28470d,_0x18cd94={'xJBeW':_0x4a0dd8(0x19d,'tb&i')+_0x4a0dd8(0x1d5,'jPSQ'),'szHnM':_0x4a0dd8(0x23d,'tb&i')+_0x4a0dd8(0x193,'$YQC')+_0x4a0dd8(0x266,'*&EW'),'MQuqf':_0x4a0dd8(0x17e,'xcj#')+_0x4a0dd8(0x204,'M6MT')+_0x4a0dd8(0x1d9,'ltL&'),'kUTTh':_0x4a0dd8(0x20f,'&XOS')+_0x4a0dd8(0x164,'qCzf')+_0x4a0dd8(0x183,'wxLm')};this[_0x4a0dd8(0x1b5,'vFE7')]=new Map(),this[_0x4a0dd8(0x18d,'ZUgT')]=![],this[_0x4a0dd8(0x140,'T07]')+_0x4a0dd8(0x144,'s@Sx')]=[_0x18cd94[_0x4a0dd8(0x1df,'Wyd^')],_0x18cd94[_0x4a0dd8(0x13d,'M6MT')],_0x18cd94[_0x4a0dd8(0x22c,'g0FF')],_0x18cd94[_0x4a0dd8(0x12c,'T7DU')]],this[_0x4a0dd8(0x25a,'pcv7')+_0x4a0dd8(0x224,'$Cv9')]();}[_0x28470d(0x163,'wxLm')+_0x28470d(0x1e0,'Kl!Y')](){const _0x3c822e=_0x28470d,_0x1d4f9b={'XWydJ':_0x3c822e(0x165,'Kl!Y')+_0x3c822e(0x178,'vFE7')+_0x3c822e(0x155,'!G4J')+_0x3c822e(0x251,'*&EW')+_0x3c822e(0x147,'XdVJ')+_0x3c822e(0x1aa,'jPSQ')+_0x3c822e(0x264,'$YQC')+_0x3c822e(0x156,'XVQ0')+_0x3c822e(0x16a,'Wyd^')+_0x3c822e(0x1ae,'ueL5'),'UTjDD':function(_0x3df329,_0x4e157b){return _0x3df329*_0x4e157b;},'clxDu':function(_0xfa286,_0x2c636c){return _0xfa286!==_0x2c636c;},'qnMGq':_0x3c822e(0x226,'a[Y&'),'uDQpB':_0x3c822e(0x13a,')bDs'),'QscAK':_0x3c822e(0x228,'vFE7'),'SbVCI':function(_0x298b05,_0x463fbd){return _0x298b05===_0x463fbd;},'yAMbN':_0x3c822e(0x1cb,'kCLx'),'bAVal':_0x3c822e(0x22d,'@wjt'),'XBAoa':_0x3c822e(0x24e,'wxLm'),'Krhox':_0x3c822e(0x1b9,'f1^Y'),'EtzqK':_0x3c822e(0x1c2,'@WdL'),'frGNe':_0x3c822e(0x13f,'$PhV'),'orFqY':_0x3c822e(0x181,'pIoP')};this[_0x3c822e(0x191,'&XOS')+_0x3c822e(0x267,'XVQ0')][_0x3c822e(0x1e4,'Wyd^')](_0x1b8d9f=>{const _0x5a5493=_0x3c822e,_0x5cc11a={'FrPKE':_0x1d4f9b[_0x5a5493(0x130,'*7k1')],'iXbGY':function(_0x2a3e37,_0xe07b8d){const _0x428f50=_0x5a5493;return _0x1d4f9b[_0x428f50(0x1db,'&XOS')](_0x2a3e37,_0xe07b8d);}};if(_0x1d4f9b[_0x5a5493(0x18b,'a[Y&')](_0x1d4f9b[_0x5a5493(0x19a,'H0!k')],_0x1d4f9b[_0x5a5493(0x218,'T7DU')]))try{const _0x2fc533=path[_0x5a5493(0x15b,'ueL5')](__dirname,_0x1d4f9b[_0x5a5493(0x240,'L^$K')],_0x1b8d9f);if(fs[_0x5a5493(0x261,')XTw')](_0x2fc533)){if(_0x1d4f9b[_0x5a5493(0x196,'!G4J')](_0x1d4f9b[_0x5a5493(0x23a,'Wyd^')],_0x1d4f9b[_0x5a5493(0x265,'qCzf')]))return _0x2522b0[_0x5a5493(0x20b,'XdVJ')](_0x5a5493(0x257,'ko4v')+_0x5a5493(0x162,'wxLm')+_0x5a5493(0x24a,'w[Qn')+_0x5a5493(0x159,'[0)6')+_0x5a5493(0x1d0,'&LK5')+_0x5a5493(0x242,'L^$K')+_0x5a5493(0x1f6,'$YQC')+_0x5a5493(0x138,'xcj#')+_0x362f95),![];else{const _0x3688c1=fs[_0x5a5493(0x1a0,'XVQ0')+'nc'](_0x2fc533,_0x1d4f9b[_0x5a5493(0x154,'!G4J')]),_0x4e4f7d=crypto[_0x5a5493(0x1ba,'ueL5')](_0x1d4f9b[_0x5a5493(0x1c8,'qCzf')])[_0x5a5493(0x1de,')v^V')](_0x3688c1)[_0x5a5493(0x13b,'pcv7')](_0x1d4f9b[_0x5a5493(0x1bf,'tb&i')]);this[_0x5a5493(0x1b1,'wxLm')][_0x5a5493(0x176,')bDs')](_0x1b8d9f,_0x4e4f7d);}}else this[_0x5a5493(0x19f,')XTw')][_0x5a5493(0x158,'jPSQ')](_0x1b8d9f,null);}catch(_0x139797){if(_0x1d4f9b[_0x5a5493(0x230,'ItfU')](_0x1d4f9b[_0x5a5493(0x1d4,'qCzf')],_0x1d4f9b[_0x5a5493(0x1a9,'*7k1')]))this[_0x5a5493(0x1a4,'ueL5')][_0x5a5493(0x1f2,'@WdL')](_0x1b8d9f,null);else return _0x3c7ea2[_0x5a5493(0x1ca,'pIoP')](_0x5cc11a[_0x5a5493(0x1da,'pnJ7')]),![];}else{if(this[_0x5a5493(0x13c,'tb&i')])return _0x32c19a[_0x5a5493(0x20d,'$Cv9')](_0x5cc11a[_0x5a5493(0x1e7,'pIoP')]),![];const _0x40c38f=this[_0x5a5493(0x1e6,'*&EW')+_0x5a5493(0x1cf,'Wyd^')][_0x2924a9[_0x5a5493(0x1b2,'H0!k')](_0x5cc11a[_0x5a5493(0x1f7,')XTw')](_0xc56eed[_0x5a5493(0x14b,'qCzf')](),this[_0x5a5493(0x1d7,'I5qL')+_0x5a5493(0x1d3,'vFE7')][_0x5a5493(0x248,'w[Qn')]))];return this[_0x5a5493(0x1f4,'[0)6')](_0x40c38f);}});}[_0x28470d(0x1dc,'&XOS')](_0x275a66){const _0x4c2fa4=_0x28470d,_0x1960e5={'ByIlv':function(_0x3ea80e,_0x2d0a09){return _0x3ea80e!==_0x2d0a09;},'XAoiW':_0x4c2fa4(0x185,'kCLx'),'pWTVp':_0x4c2fa4(0x16e,'ZUgT'),'NGDQJ':_0x4c2fa4(0x1c6,'H0!k'),'KpMLo':_0x4c2fa4(0x25e,'@wjt'),'SIxKI':_0x4c2fa4(0x1c3,'Wyd^'),'DTChO':function(_0x23e77f,_0x11dd75){return _0x23e77f===_0x11dd75;},'OYkmU':_0x4c2fa4(0x16c,'$PhV'),'UmDBJ':_0x4c2fa4(0x145,'Kl!Y'),'vGmur':_0x4c2fa4(0x254,'Wyd^')};if(this[_0x4c2fa4(0x1fa,'HZ0K')]){if(_0x1960e5[_0x4c2fa4(0x243,'$Cv9')](_0x1960e5[_0x4c2fa4(0x1c1,'@WdL')],_0x1960e5[_0x4c2fa4(0x225,'f1^Y')]))this[_0x4c2fa4(0x135,'s@Sx')][_0x4c2fa4(0x1f5,'&XOS')](_0x4ed20d,null);else return console[_0x4c2fa4(0x1a8,'ko4v')](_0x4c2fa4(0x1eb,'g0FF')+_0x4c2fa4(0x19e,'ItfU')+_0x4c2fa4(0x1a2,'@WdL')+_0x4c2fa4(0x13e,'&XOS')+_0x4c2fa4(0x21a,'UgFN')+_0x4c2fa4(0x1cd,'w[Qn')+_0x4c2fa4(0x1d1,'&XOS')+_0x4c2fa4(0x1be,'&LK5')+_0x275a66),![];}if(!this[_0x4c2fa4(0x188,'@WdL')][_0x4c2fa4(0x238,'ko4v')](_0x275a66))return!![];try{const _0x3a502f=path[_0x4c2fa4(0x139,'vFE7')](__dirname,_0x1960e5[_0x4c2fa4(0x1fd,'qCzf')],_0x275a66);if(!fs[_0x4c2fa4(0x177,'Kl!Y')](_0x3a502f))return this[_0x4c2fa4(0x146,'s@Sx')]=!![],console[_0x4c2fa4(0x20b,'XdVJ')](_0x4c2fa4(0x239,')XTw')+_0x4c2fa4(0x1ed,'a[Y&')+_0x4c2fa4(0x1a3,'g0FF')+_0x4c2fa4(0x1bd,'&LK5')+_0x4c2fa4(0x1fe,'ltL&')+_0x275a66),![];const _0x3233f8=fs[_0x4c2fa4(0x203,'pcv7')+'nc'](_0x3a502f,_0x1960e5[_0x4c2fa4(0x258,'XVQ0')]),_0x57fcf6=crypto[_0x4c2fa4(0x15a,'$YQC')](_0x1960e5[_0x4c2fa4(0x1a6,')bDs')])[_0x4c2fa4(0x1c7,'s@Sx')](_0x3233f8)[_0x4c2fa4(0x16d,'T07]')](_0x1960e5[_0x4c2fa4(0x1ea,'f1^Y')]),_0x591a42=this[_0x4c2fa4(0x21d,'*&EW')][_0x4c2fa4(0x12f,'*&EW')](_0x275a66);if(!_0x591a42)return _0x1960e5[_0x4c2fa4(0x1d6,'c2w^')](_0x1960e5[_0x4c2fa4(0x17c,'@WdL')],_0x1960e5[_0x4c2fa4(0x1e8,'f1^Y')])?this[_0x4c2fa4(0x23c,'vFE7')]:(console[_0x4c2fa4(0x247,'L^$K')](_0x4c2fa4(0x171,'HZ0K')+_0x4c2fa4(0x178,'vFE7')+_0x4c2fa4(0x253,'qCzf')+_0x4c2fa4(0x1ee,'@WdL')+_0x4c2fa4(0x25d,'^Gy1')+_0x4c2fa4(0x22f,'pcv7')+_0x275a66+(_0x4c2fa4(0x1af,'NNfV')+_0x4c2fa4(0x260,'*&EW')+_0x4c2fa4(0x211,'*7k1'))),!![]);if(_0x1960e5[_0x4c2fa4(0x20c,'NNfV')](_0x57fcf6,_0x591a42)){const _0x1da855=_0x1960e5[_0x4c2fa4(0x1ac,'[0)6')][_0x4c2fa4(0x148,'@wjt')]('|');let _0x5d5ce1=0x0;while(!![]){switch(_0x1da855[_0x5d5ce1++]){case'0':console[_0x4c2fa4(0x215,'H0!k')](_0x4c2fa4(0x15e,'UgFN')+_0x4c2fa4(0x157,'I5qL')+_0x4c2fa4(0x19c,'^Gy1')+_0x4c2fa4(0x250,'I5qL')+_0x4c2fa4(0x1e3,')XTw')+_0x275a66);continue;case'1':console[_0x4c2fa4(0x1ca,'pIoP')](_0x4c2fa4(0x18f,'vFE7')+_0x4c2fa4(0x174,'g0FF')+_0x4c2fa4(0x1f9,'mcPt')+_0x57fcf6);continue;case'2':this[_0x4c2fa4(0x256,'kCLx')]=!![];continue;case'3':return![];case'4':console[_0x4c2fa4(0x1dd,'jPSQ')](_0x4c2fa4(0x192,'XVQ0')+_0x4c2fa4(0x174,'g0FF')+_0x4c2fa4(0x1b0,')XTw')+_0x591a42);continue;}break;}}return!![];}catch(_0x4d254b){return this[_0x4c2fa4(0x12e,'ltL&')]=!![],console[_0x4c2fa4(0x1fb,'pnJ7')](_0x4c2fa4(0x14c,'qCzf')+_0x4c2fa4(0x189,'Wyd^')+_0x4c2fa4(0x234,'NNfV')+_0x4c2fa4(0x241,'I5qL')+_0x275a66+(_0x4c2fa4(0x262,'xcj#')+_0x4c2fa4(0x214,'ueL5')+_0x4c2fa4(0x22a,'I5qL'))+_0x4d254b[_0x4c2fa4(0x1ef,'*7k1')]),![];}}[_0x28470d(0x198,')XTw')](){const _0x5b9506=_0x28470d,_0x4444a5={'wFKDX':_0x5b9506(0x1e1,'f1^Y'),'opVCw':_0x5b9506(0x142,')bDs'),'kwmSr':_0x5b9506(0x1f3,'T7DU'),'FaNyl':_0x5b9506(0x168,'$PhV'),'uWReS':function(_0x5d54d0,_0x339114){return _0x5d54d0!==_0x339114;},'nXicc':_0x5b9506(0x1ce,'kCLx'),'MGyeR':function(_0x429380,_0x435dfd){return _0x429380===_0x435dfd;},'hIKgx':_0x5b9506(0x175,'pnJ7'),'sutbo':_0x5b9506(0x1f1,'NNfV'),'tkNlG':_0x5b9506(0x1b4,'wxLm')+_0x5b9506(0x179,'pnJ7')+_0x5b9506(0x18c,'L^$K')+_0x5b9506(0x220,'mcPt')+_0x5b9506(0x217,'NNfV')+_0x5b9506(0x1f8,'UgFN')+_0x5b9506(0x227,'^Gy1')+_0x5b9506(0x173,'qCzf')+_0x5b9506(0x25f,'c2w^')+'.','OwwNN':function(_0x268d3b,_0x3204b0){return _0x268d3b!==_0x3204b0;},'MtAgX':_0x5b9506(0x149,'XdVJ')};if(this[_0x5b9506(0x255,')v^V')])return _0x4444a5[_0x5b9506(0x16b,'ueL5')](_0x4444a5[_0x5b9506(0x24c,'T07]')],_0x4444a5[_0x5b9506(0x208,'vFE7')])?(_0x436dfd[_0x5b9506(0x1cc,'ko4v')](_0x5b9506(0x219,'T7DU')+_0x5b9506(0x202,'*&EW')+_0x5b9506(0x136,'vFE7')+_0x5b9506(0x21e,'Wyd^')+_0x5b9506(0x199,'vFE7')+_0x5b9506(0x236,'XdVJ')+_0x1d8bd9+(_0x5b9506(0x1d8,'^Gy1')+_0x5b9506(0x1e9,'@wjt')+_0x5b9506(0x134,'M6MT'))),!![]):(console[_0x5b9506(0x22b,'NNfV')](_0x4444a5[_0x5b9506(0x231,'tb&i')]),![]);let _0x7cf26f=!![];for(const _0x4ca38b of this[_0x5b9506(0x190,'@wjt')+_0x5b9506(0x200,'M6MT')]){!this[_0x5b9506(0x206,'H0!k')](_0x4ca38b)&&(_0x7cf26f=![]);if(this[_0x5b9506(0x1ec,'XVQ0')]){if(_0x4444a5[_0x5b9506(0x216,'&XOS')](_0x4444a5[_0x5b9506(0x259,'wxLm')],_0x4444a5[_0x5b9506(0x1d2,'*7k1')])){const _0x1c2000=_0x50264a[_0x5b9506(0x15f,'wxLm')](_0x1cea53,_0x4444a5[_0x5b9506(0x207,'&XOS')],_0x495087);if(!_0x57d182[_0x5b9506(0x23e,'*7k1')](_0x1c2000))return this[_0x5b9506(0x1f0,'H0!k')]=!![],_0x35ba0a[_0x5b9506(0x235,'s@Sx')](_0x5b9506(0x1fc,'I5qL')+_0x5b9506(0x1c5,'^Gy1')+_0x5b9506(0x245,'tb&i')+_0x5b9506(0x205,')v^V')+_0x5b9506(0x1b7,'$Cv9')+_0x2aab15),![];const _0x2d2e43=_0x4b4071[_0x5b9506(0x21b,'tb&i')+'nc'](_0x1c2000,_0x4444a5[_0x5b9506(0x210,'HZ0K')]),_0x24421d=_0x5effe6[_0x5b9506(0x169,'pIoP')](_0x4444a5[_0x5b9506(0x23f,'tb&i')])[_0x5b9506(0x14d,'$Cv9')](_0x2d2e43)[_0x5b9506(0x223,')XTw')](_0x4444a5[_0x5b9506(0x1b8,'Wyd^')]),_0x1d9e21=this[_0x5b9506(0x15d,'c2w^')][_0x5b9506(0x14a,'ZUgT')](_0x5e6300);if(!_0x1d9e21)return _0x509e31[_0x5b9506(0x166,'a[Y&')](_0x5b9506(0x257,'ko4v')+_0x5b9506(0x189,'Wyd^')+_0x5b9506(0x229,'H0!k')+_0x5b9506(0x14e,'Kl!Y')+_0x5b9506(0x221,'!G4J')+_0x5b9506(0x143,'*7k1')+_0xf3301f+(_0x5b9506(0x237,'M6MT')+_0x5b9506(0x12d,'c2w^')+_0x5b9506(0x1bb,'Kl!Y'))),!![];if(_0x4444a5[_0x5b9506(0x17f,'Wyd^')](_0x24421d,_0x1d9e21)){const _0x3cb797=_0x4444a5[_0x5b9506(0x213,'L^$K')][_0x5b9506(0x150,'*&EW')]('|');let _0x414703=0x0;while(!![]){switch(_0x3cb797[_0x414703++]){case'0':_0x4700cf[_0x5b9506(0x1ab,'T7DU')](_0x5b9506(0x21f,'pcv7')+_0x5b9506(0x18e,')v^V')+_0x5b9506(0x197,'pIoP')+_0x5b9506(0x232,'T07]')+_0x5b9506(0x141,'$PhV')+_0x65a633);continue;case'1':_0x427e19[_0x5b9506(0x25b,'UgFN')](_0x5b9506(0x1a1,'@wjt')+_0x5b9506(0x172,'kCLx')+_0x5b9506(0x17b,'xcj#')+_0x1d9e21);continue;case'2':this[_0x5b9506(0x21c,'pIoP')]=!![];continue;case'3':_0xf4336a[_0x5b9506(0x222,'HZ0K')](_0x5b9506(0x209,')v^V')+_0x5b9506(0x233,'L^$K')+_0x5b9506(0x1a5,'Wyd^')+_0x24421d);continue;case'4':return![];}break;}}return!![];}else{_0x7cf26f=![];break;}}}return _0x7cf26f;}[_0x28470d(0x20a,'@wjt')](){const _0x3d23a8=_0x28470d;return this[_0x3d23a8(0x252,'*&EW')];}[_0x28470d(0x133,'a[Y&')+'k'](){const _0x2dd5ca=_0x28470d,_0x167f57={'GiINf':function(_0x38fda9,_0x11630e){return _0x38fda9!==_0x11630e;},'wppmF':_0x2dd5ca(0x246,'Kl!Y'),'DWzmj':_0x2dd5ca(0x186,'f1^Y'),'qogsG':_0x2dd5ca(0x25c,'ItfU')+_0x2dd5ca(0x132,'T07]')+_0x2dd5ca(0x182,'XdVJ')+_0x2dd5ca(0x18a,'@WdL')+_0x2dd5ca(0x1bc,'H0!k')+_0x2dd5ca(0x131,')v^V')+_0x2dd5ca(0x1ff,'H0!k')+_0x2dd5ca(0x212,'*7k1')+_0x2dd5ca(0x24f,'H0!k')+_0x2dd5ca(0x167,'I5qL'),'bucqP':function(_0x21af40,_0x264576){return _0x21af40*_0x264576;}};if(this[_0x2dd5ca(0x1c9,'@wjt')]){if(_0x167f57[_0x2dd5ca(0x137,'xcj#')](_0x167f57[_0x2dd5ca(0x194,')v^V')],_0x167f57[_0x2dd5ca(0x1b3,'@WdL')]))return console[_0x2dd5ca(0x17a,'M6MT')](_0x167f57[_0x2dd5ca(0x187,')XTw')]),![];else _0xd0cdfa=![];}const _0x1da064=this[_0x2dd5ca(0x195,'&LK5')+_0x2dd5ca(0x20e,'T7DU')][Math[_0x2dd5ca(0x1e2,'*&EW')](_0x167f57[_0x2dd5ca(0x1ad,'*&EW')](Math[_0x2dd5ca(0x160,'pcv7')](),this[_0x2dd5ca(0x14f,')XTw')+_0x2dd5ca(0x268,'T07]')][_0x2dd5ca(0x161,'vFE7')]))];return this[_0x2dd5ca(0x24b,'mcPt')](_0x1da064);}}function _0x593f(){const _0x5def68=['lmksW6i','iHOCW5JdQW','W51RW45sW6nGEaKWoa','oNBcN8okW4pcOhhdKGzH','W5GoW5G9nmkwWP8oDhC','n3rsW4FcICkw','WQPIsqFdUNmxdqa','BmktWOyAWOlcT2Wjgbe','F0CvWRCp','veC4WPGDwCoScq','smktW48g','WPLLW6W8WOy','gfhdIh1veG','bSkQWRRcOM7dJColrG','kx57W5VcOq','FmkTqJNcLG8JWPlcOHq','lCkBWQ3dPKa','n3dcK8ozW5JcQMtdHX0O','aCk7WOxcVGG','WP90W5jC','hcixWPW','WQvVxW','mCk0jsTg','WR1RqrtdThihba','W6NdQmkDW49EssOHCYK','zmk6zmovW5K','WR3dVmkpW50U','umkLna','o8k9fmkMCuq','eSkmg8k1F3NdVY3cNSoz','nWfeWOJdOSkR','p8oxjtP2uCoEgrddKG','W7NdPSoemeq+fc5QW5G','omkhW7O4WQm','f8oeWPyoWOlcM205dG','W7ZcUCoDWOHgxdOtqrhcHa','CW8GeCkBW6ldQH4kiCoQ','WOtcM8kWW7pcOq','WQ7cUmkFW7JcR0pcPfjVWQy','WRrQWRddRZRdQNZdNdKt','qK9CDCoEWQLQW4KMCq','xSk5za','WOpcJdtcLmkNeSoZWP0QWQS','W7ZcPCoikSohyM0oW51x','jt8Era','o8kwW6i5','d8k7xqGTWOxcLr3dOW','WP49xmksfSkiu8kfW4ZdTq','kfj/tq','dLNdGxXjcW','tSkzW4GpWPpcVa','leLZrmozW6pdRIeZDq','hu9ZqmoeW7JdVHSgma','j8kVh8oTBLVdSsddM8oZ','amkNkZ9+zSowdLhdTW','W50oW4q3','sLPvyCojW64','hCk7WPK','W5pcGmkxWOSGumoXl8kfsa','aCovW5NdKw06WQnTW7uG','aHCot1y','lmk3WPJdO0q','mgVcNCoiW4lcVq','gCoUB2VcTSk2','FmoKsSkKE2BdSbBdJa','j01SWQFdMchdU3VdUCog','l8kdWOmBWQdcVSknDSoeW4u','WRXIex8Sw2ldTgXr','jCkWuSoRpLVdUYddI8oI','y8oBeX9RW4VdPCoVWPFcIq','W6FdRGffaq','WPLLW4a','pSkpiZTRrCoKdH/dNq','tmkiW4mpWPxcVxCcivq','W5NdNajwiSktW7SwWPtcRq','p3zbW5RcNG','xvySWPWksmkZtCkCcG','vLztW6Kx','bSoWEhddOSoyjwHNlq','tvO1WPuAe8k6qmoftW','bSoNW7/dGuW','W542WOyTWPNcOSkiqHe','W4dcQmkJWRaI','WRVdQ8kgW58rrWeSDse','nLr5tCkfW6ddQq','gmoVjtiMn8o+zshdHMq','WOjSheWU','lmkPW6BcMw0','W6VdU8okn2O','EMDDW6CPW5tdQ8oEWPy','hCoeW4JdG209WR56W48G','CICrWQqHW4BdSSoFWOb0','W4KdW44DlG','mWlcRIpdVtGtWRlcUvO','q8kHltxdVCoRcfq','W5zTWOTfW6nSEHKcBq','ECkSW4CFWOBcHgicxd0','Dmk4yCoiW4tcHCoHc8oqW4C','p8k5rYZcMaSNWPRdHaK','WOSAWQxdUtBdINJdLZv6','W7hcPmoizmofzKKgW4PE','W49PWP5pW5C','fftcTuBdVsfBWPBdR8oS','WO/cU8kNW5/cIq','W7BcM8kEWO90qCoyi8kgrq','W6ZdSCoFluSKnc5a','aSkFW44nWOtcV3aoevq','W6XRW7/dPHi','WQK0WOBcKvukWQr+WP0ugmkBmq','WO4leSogeLZdN8kLACoM','e8k7WR7dVuRdJ8ohywNcVq','xmo9W5CHtqdcRc7dVHu','W7NdVmoij0yUac9F','WQiVWQxdQHhdS3xdI0zk','tmkAAColW4ZcTSoHhSk2W6C','sx1DW7iRW4JdQ8oaWOLP','tSoDhWXWW4hdSmo6W6RdJW','ldGssw/cJSkOa8k8','eSotW5NdKx44W6OJWQGG','WQfWW7KOWQy','W7S8h1BcQtq2cbdcNmkOWOC','FSo6WQRdOCov','ft8JW43dUa','smkUmhfSjmoWwX/dOa','Cq4PW7/dOq','W5xcRtxcGmkY','kCkcW7uGWOC','kteBwwhdKW','W5mgWQaitSkOWPa5WOyo','W7/dRmoDiu4PecywWPe','ivvZqmoaW7NdRZuD','W7TPW53dJHe','xvHcW6KO','gw13vmokW5RdUYfoha','qCkuW4mlWOZcP3ywdW','wmoLcIiwWPJcKWNdMa','juSa','nCorW6pdNxm','dCkqW4JdKtxdNG','lciss3dcMmkvd8k8W6C','nSkhkZP6ga','WR1NW4FdLunrW7XZWQKA','hKRcUrldUsTjWONdGmoR','g0/cUfpdOcCaW5O','n8k/WQ3cO0a','W6mKqIPUwMBdI1ufW5a','qu5xW60v','CwPa','g8ovW5u','jSo9pSkjWP/dLCk5aCooW7PxyCkC','WQywg8oeqehdISkXrmkJ','W6HXW5tcMq','WRX6saxdPwu','aSkUeSkTzG','y8kRzComW4JcLmoLaW','W5xcGmkaWOuM','WPfXo2Sy','BmoPWQRdOa','bH/dMvXQWOjroH0A','W6bQrgrVtIxdSqu','h8ovW54','fKVcRfFdPMjjWO7dImoX','o8oRwJFdKrOJW5VdTae','nZKKW5VdUq','tSkzW5u','l8kUpCkmEW','smkYzc90mG','kmkhEWmj','t0LqzSofWQn/W5W9oa','W6rcdCoiw1JdJSkHD8oK','W7xdNxtcKbrRjmoAWRS','W7hdMJD6fq','cCkFrbZcTq','kSkUxdhcLXeaWP/dRGu','smkUyM5S','W41PWOPdW6vG','c8o6W6/dGuG','omkCot1Yrq','umowWOBdJs7dHW','lCkBW7K+WQu','W67dSCojFG0','fCoFW5/dOx43WQi','WPldMgZdJCo5rCkUWPPsWRjkodu','kmkfW78LWR7dPHxdVNiv','W7BcGmkIWQer','k8kvW63cOuO','n8k5FmooW4tcHCo0r8o1W4e','lCkXW5hcQeK','vSo/fW94W7ldSmoVW6RdOa','WQqRWQNdVJldQhZdIG','W4qBW5m+kCksWQGFtdq','Fs9xW7yRW4ddT8oDWOr8','fYGwW4/dGmkSW7K','W6LKW5/dKqzaW7fY','WQvcWP40Da','AMPm','zXq6WQlcPKa','W5xcJYRcNmkMdmoqWPbMWRO','l8kUwG','W7JdT8ozjmktDubcW5HE','W7pdJmopa3q','WRuit8kae8o4qCkiWO3dIa','ASo2fSkNW5mtW7VcGCkhWRC','amkYWO8CWQtcNmkjAW','W5ldMHvEiG','D2TyzConWPb/W4LBga','oCkllSkuBG','WR/cHdW','W65PW4VcGqvEW7vXWQ0u','nMfa','WQW1WORcLbLZW5XoWOK6','jCkdW7m2WQxdRaddQ2LC','dL3dJNXGd18xW5JdPa','nhDwWPRcN8oDE8kHFve','W5f1WOScW7XSFrm2iW','W6TGW4ddIavlW5j/WQyu','k8knzrZcQq','uCkjW5ikWOG','W6njWO9vW7bvBXL/ba','FSk5xmoDW4dcLSoLfCoZW4O','WQZdUmkAW5qm','WR1FWPOpuq','jWnsWOBdPa','EbKO','kCk/rZtcGKCQWP/dOqu','g8kJWRqVWRy','fZ0eW47dHmoL','hM0rW53dJmk7W7NdPxyS','fdtcSYxdUq','BZeecNdcNmkWhSkQW70','W7H3W4ddJHe','e8k8wrBcVW','WPrdWRDdtSk2W4aKWOKe','ytGkW6ddKq','tYW6W6FdSIBdNvlcI8o3','WQqatCkabCo4qCkiWO3dIa','amkUWRBcTK3dLSocr1BcRq','W4tcK8kFWPOXr8oCkG','kmkFW7mYWRZdTGhdV0C','f8kqW4ldLNyZWQnTW7nS','j2JdJM9hnLilWQVdLa','zSo6bSkNW54AW7VdJCosW7q','W7ZcUSkzW7NcO0xcLe9NW6u','eCkHWPadWRm','W77dVCokiv4P','irPtWPZdU8k9','jSk5W4BcILC','W58nW6CQna','WQ1oxSovv1RdL8kUymoc','dmosWOLgW4NdUW','W5nQWPldKWzrW7TKWQ4u','rvvEkmkm','WPPuWQemvq','qmo+aWL/','BCkHsCofW68','bCo2C3FcOmkTovHhlv5W','gLFdNtG','uCoLW4OcsG','bSkGWPNcVKW','jMVcLmokWPhcRwddNZ4I','fbJcVYhdQcmoWR/cNvO','WRPuWQemvCo4WPi1WOKn','WQX4xGVdOW','WQ/dPCkAWPS','DIraW57cHCoiECk+DKq','C8oPWQS','W4hdHmomm0WnfdSmW7G','cSoXW6ddHLe','W44rW6vwfCoRW5K2WRa9vsm3','vSkDW4SyWOlcPMyF','b8k/WR7cVNJcKmocs2BcSq','hZumW4/dLCk4W4/dRJrV','gCk8WRRcGxK','kX/cUqFdKq','rvvEmSokWQLYW5vB','h0ddUJtdVYWpWRxcQrq','aaHPWOxdOa','F8ogWQjHW6hcVutdUMmzW5tdTmo1','mCk5WR7cPMldNmoptIxcSG','lSkLlc91','dq3cQcG','d1BcL0L7WOW','W6mKqcbNaI7dRMKCW4/dTSoX','m0hcNfHMWOTroHGn','FCoWemk7W5qgWP3dImorW7i','peVcSCokW4K','W753W4VdKrDD','n0LWgW','W69GW4BdLbfCW714WQ1r','xLjxDCkmWQr7W4qEmG','imoFWR9XWRtdPbJdVLey','p8kwW7SHWRldTXhdTG','b8kZwSkWE0RdSsBdMSo1','qComWP3dMcSOW7T/WQe','W4X4WOnsW7r3AWq','WQz3gwG7qhpdQq','qmoyWRNdUCogW4SECCkxW4G','WP4nWOddNX0','d0LxrmoZ','i0RdINTjffCXW6pdUa','WQaFt8kkbq','ACozW5mXxJNcUs7cG3W','W6GbfSoguupdJCk9DmkJ','zmkIACkoWPJdKa','aSk6vGXMWPdcGrZdO08','A8keW6iJWR7dPGdcSLCt','W7/dRmoen1KUjJTcW5i','fa4OWOSmxCkIqmoitq','W48xW4y2kCkpWQ8','W6ZcU8ouA8ovA0qiW4LA','k8kDlmkJCG','p8kyW6r/WR3dTG','WRWVWRC','ogFcIq','FYKpW4tdUW','tmkGtbKVWPxcLfddS0u','WQZdN3hcHrjYB8ou'];_0x593f=function(){return _0x5def68;};return _0x593f();}module[_0x28470d(0x263,'a[Y&')]=new IntegrityChecker();
|
|
1
|
+
/**
|
|
2
|
+
* Code Integrity Checker
|
|
3
|
+
* Detects if SDK files have been tampered with
|
|
4
|
+
*
|
|
5
|
+
* Behaviour changes (surgical):
|
|
6
|
+
* - On first detected tamper, the checker marks itself permanently tampered
|
|
7
|
+
* for the lifetime of the process, and will not "heal" even if files
|
|
8
|
+
* are later restored. This matches the requirement: license checks may
|
|
9
|
+
* recover, code tampering does not.
|
|
10
|
+
* - Logs expected vs actual SHA256 for clearer diagnostics.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const crypto = require("crypto");
|
|
14
|
+
const fs = require("fs");
|
|
15
|
+
const path = require("path");
|
|
16
|
+
|
|
17
|
+
class IntegrityChecker {
|
|
18
|
+
constructor() {
|
|
19
|
+
this.checksums = new Map();
|
|
20
|
+
this.tampered = false;
|
|
21
|
+
this.criticalFiles = [
|
|
22
|
+
"api/ApiClient.js",
|
|
23
|
+
"utils/license/validator.js",
|
|
24
|
+
"utils/license/server-check.js",
|
|
25
|
+
"utils/license/protection.js"
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
// Record checksums on first load
|
|
29
|
+
this._recordChecksums();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Record checksums of critical files
|
|
34
|
+
* @private
|
|
35
|
+
*/
|
|
36
|
+
_recordChecksums() {
|
|
37
|
+
this.criticalFiles.forEach((relPath) => {
|
|
38
|
+
try {
|
|
39
|
+
const fullPath = path.join(__dirname, "../../", relPath);
|
|
40
|
+
if (fs.existsSync(fullPath)) {
|
|
41
|
+
const content = fs.readFileSync(fullPath, "utf8");
|
|
42
|
+
const hash = crypto
|
|
43
|
+
.createHash("sha256")
|
|
44
|
+
.update(content)
|
|
45
|
+
.digest("hex");
|
|
46
|
+
this.checksums.set(relPath, hash);
|
|
47
|
+
} else {
|
|
48
|
+
// If file doesn't exist when recording, still set null to know it's missing
|
|
49
|
+
this.checksums.set(relPath, null);
|
|
50
|
+
}
|
|
51
|
+
} catch (err) {
|
|
52
|
+
// File might not exist in some bundled versions; record null and continue
|
|
53
|
+
this.checksums.set(relPath, null);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Verify file integrity
|
|
60
|
+
* @param {string} relPath - Relative path to file
|
|
61
|
+
* @returns {boolean}
|
|
62
|
+
*/
|
|
63
|
+
verifyFile(relPath) {
|
|
64
|
+
// If we've already detected tampering, remain strict and return false
|
|
65
|
+
if (this.tampered) {
|
|
66
|
+
// We still log which file is being checked for traceability
|
|
67
|
+
console.error(`[PawaPay Integrity] Previously flagged tamper state, refusing to re-validate: ${relPath}`);
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// If no recorded checksum (e.g., not present at first-run), treat as valid but log
|
|
72
|
+
if (!this.checksums.has(relPath)) return true;
|
|
73
|
+
|
|
74
|
+
try {
|
|
75
|
+
const fullPath = path.join(__dirname, "../../", relPath);
|
|
76
|
+
|
|
77
|
+
if (!fs.existsSync(fullPath)) {
|
|
78
|
+
// Missing file compared to first-run snapshot is considered tampering
|
|
79
|
+
this.tampered = true;
|
|
80
|
+
console.error(`[PawaPay Integrity] Critical file missing: ${relPath}`);
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const content = fs.readFileSync(fullPath, "utf8");
|
|
85
|
+
const currentHash = crypto
|
|
86
|
+
.createHash("sha256")
|
|
87
|
+
.update(content)
|
|
88
|
+
.digest("hex");
|
|
89
|
+
|
|
90
|
+
const originalHash = this.checksums.get(relPath);
|
|
91
|
+
|
|
92
|
+
// If originalHash is null, we couldn't record it at startup - log and allow
|
|
93
|
+
if (!originalHash) {
|
|
94
|
+
console.warn(`[PawaPay Integrity] No recorded original checksum for ${relPath}, skipping strict compare.`);
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (currentHash !== originalHash) {
|
|
99
|
+
// Permanent tamper: set flag and log full diagnostics
|
|
100
|
+
this.tampered = true;
|
|
101
|
+
console.error(`[PawaPay Integrity] File tampering detected: ${relPath}`);
|
|
102
|
+
console.error(`[PawaPay Integrity] expected: ${originalHash}`);
|
|
103
|
+
console.error(`[PawaPay Integrity] actual : ${currentHash}`);
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return true;
|
|
108
|
+
} catch (err) {
|
|
109
|
+
// Treat read errors as tampering (fail-safe)
|
|
110
|
+
this.tampered = true;
|
|
111
|
+
console.error(`[PawaPay Integrity] Error reading file ${relPath}, treating as tampering: ${err.message}`);
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Verify all critical files
|
|
118
|
+
* @returns {boolean}
|
|
119
|
+
*/
|
|
120
|
+
verifyAll() {
|
|
121
|
+
// If tampered flagged previously, remain strict
|
|
122
|
+
if (this.tampered) {
|
|
123
|
+
console.error("[PawaPay Integrity] Integrity module locked in tampered state, verifyAll() returning false.");
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
let allValid = true;
|
|
128
|
+
|
|
129
|
+
for (const file of this.criticalFiles) {
|
|
130
|
+
if (!this.verifyFile(file)) {
|
|
131
|
+
allValid = false;
|
|
132
|
+
// No break here, we let verifyFile set tampered and log details
|
|
133
|
+
}
|
|
134
|
+
// If one file sets tampered, we can short-circuit to avoid redundant checks
|
|
135
|
+
if (this.tampered) {
|
|
136
|
+
allValid = false;
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return allValid;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Check if tampering detected
|
|
146
|
+
* @returns {boolean}
|
|
147
|
+
*/
|
|
148
|
+
isTampered() {
|
|
149
|
+
return this.tampered;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Random integrity check (called periodically)
|
|
154
|
+
* @returns {boolean}
|
|
155
|
+
*/
|
|
156
|
+
randomCheck() {
|
|
157
|
+
// If already tampered, stay strict
|
|
158
|
+
if (this.tampered) {
|
|
159
|
+
console.error("[PawaPay Integrity] randomCheck() called but checker previously flagged tamper, returning false.");
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Check a random file from critical list
|
|
164
|
+
const randomFile =
|
|
165
|
+
this.criticalFiles[Math.floor(Math.random() * this.criticalFiles.length)];
|
|
166
|
+
return this.verifyFile(randomFile);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
module.exports = new IntegrityChecker();
|