@xaidenlabs/uso 1.1.73 → 1.1.74
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/package.json +1 -1
- package/src/commands/verify.js +28 -5
package/package.json
CHANGED
package/src/commands/verify.js
CHANGED
|
@@ -6,6 +6,8 @@ const readline = require('readline');
|
|
|
6
6
|
const { log, spinner } = require('../utils/logger');
|
|
7
7
|
const { ensureWalletInteractive, resolveSolanaKeygen } = require('../utils/wallet');
|
|
8
8
|
const { getCargoBinPath } = require('../utils/paths');
|
|
9
|
+
const { isStealthMode } = require('../utils/stealth');
|
|
10
|
+
const { runWsl } = require('../utils/wsl-bridge');
|
|
9
11
|
|
|
10
12
|
const getSolanaBin = () => {
|
|
11
13
|
if (shell.which('solana')) return 'solana';
|
|
@@ -113,6 +115,7 @@ const verify = async () => {
|
|
|
113
115
|
|
|
114
116
|
const templateDir = path.resolve(__dirname, '../../anchor_project');
|
|
115
117
|
const tempDir = path.join(os.tmpdir(), 'uso-verification-' + Date.now());
|
|
118
|
+
const stealth = isStealthMode();
|
|
116
119
|
|
|
117
120
|
try {
|
|
118
121
|
shell.cp('-R', templateDir, tempDir);
|
|
@@ -128,10 +131,30 @@ const verify = async () => {
|
|
|
128
131
|
log.warn(`⚠️ Retrying build (Attempt ${attempts}/${maxAttempts})...`);
|
|
129
132
|
}
|
|
130
133
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
let buildResult;
|
|
135
|
+
|
|
136
|
+
if (stealth.enabled) {
|
|
137
|
+
// Build inside WSL
|
|
138
|
+
const wslTempDir = `/tmp/uso-verify-${Date.now()}`;
|
|
139
|
+
const copyCmd = `mkdir -p ${wslTempDir} && cp -r /mnt/c/Users/*/AppData/Local/Temp/uso-verification-* ${wslTempDir}`;
|
|
140
|
+
|
|
141
|
+
// Copy files to WSL
|
|
142
|
+
runWsl(`mkdir -p ${wslTempDir} && cp -r "${tempDir.replace(/\\/g, '/')}" ${wslTempDir}/project`, {
|
|
143
|
+
distro: stealth.distro
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
// Run anchor build in WSL
|
|
147
|
+
const buildCmd = `cd ${wslTempDir}/project && source $HOME/.cargo/env 2>/dev/null && anchor build`;
|
|
148
|
+
buildResult = runWsl(buildCmd, {
|
|
149
|
+
distro: stealth.distro,
|
|
150
|
+
execOpts: { silent: false }
|
|
151
|
+
});
|
|
152
|
+
} else {
|
|
153
|
+
buildResult = shell.exec(`cd "${tempDir}" && ${anchorCmd} build`, {
|
|
154
|
+
silent: false,
|
|
155
|
+
env: process.env
|
|
156
|
+
});
|
|
157
|
+
}
|
|
135
158
|
|
|
136
159
|
success = buildResult.code === 0;
|
|
137
160
|
let stderr = buildResult.stderr + buildResult.stdout;
|
|
@@ -144,7 +167,7 @@ const verify = async () => {
|
|
|
144
167
|
continue;
|
|
145
168
|
}
|
|
146
169
|
|
|
147
|
-
if (os.platform() === 'win32' && stderr.includes('os error 1314')) {
|
|
170
|
+
if (!stealth.enabled && os.platform() === 'win32' && stderr.includes('os error 1314')) {
|
|
148
171
|
log.warn("⚠️ Privilege error detected (os error 1314).");
|
|
149
172
|
log.info("ℹ️ First-time Solana build requires Administrator privileges to install tools.");
|
|
150
173
|
log.info("🛡️ Retrying with Elevated Permissions (Please accept UAC prompt)...");
|