@dcloudio/uni-cli-shared 3.0.0-alpha-5000720260327001 → 3.0.0-alpha-5000820260420001
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.
|
@@ -336,6 +336,9 @@ function findLastIndex(array, predicate) {
|
|
|
336
336
|
return -1;
|
|
337
337
|
}
|
|
338
338
|
let encryptUniModules = {};
|
|
339
|
+
function refreshEncryptUniModules(platform, inputDir) {
|
|
340
|
+
encryptUniModules = findCloudEncryptUniModules(platform, inputDir, process.env.UNI_MODULES_ENCRYPT_CACHE_DIR, 'all');
|
|
341
|
+
}
|
|
339
342
|
function resolveEncryptUniModule(id, platform, isX = true) {
|
|
340
343
|
id = id.split('?', 2)[0];
|
|
341
344
|
const parts = id.split('/');
|
|
@@ -378,12 +381,20 @@ function resolveEncryptUniModule(id, platform, isX = true) {
|
|
|
378
381
|
}
|
|
379
382
|
exports.resolveEncryptUniModule = resolveEncryptUniModule;
|
|
380
383
|
async function checkEncryptUniModules(inputDir, params, sdkType = 'all') {
|
|
384
|
+
const isHarmonySplitCompile = params.platform === 'app-harmony' && sdkType !== 'all';
|
|
381
385
|
// 初始化指定 sdk 类型的加密插件
|
|
382
386
|
const curEncryptUniModules = findCloudEncryptUniModules(params.platform, inputDir, process.env.UNI_MODULES_ENCRYPT_CACHE_DIR, sdkType);
|
|
383
387
|
if (!Object.keys(curEncryptUniModules).length) {
|
|
388
|
+
// 鸿蒙会按 utssdk/easycom 分两次扫描,这里回填一次全量状态,避免子集扫描把插件类型覆盖掉
|
|
389
|
+
if (isHarmonySplitCompile) {
|
|
390
|
+
refreshEncryptUniModules(params.platform, inputDir);
|
|
391
|
+
}
|
|
384
392
|
return {};
|
|
385
393
|
}
|
|
386
394
|
if (!process.env.UNI_HBUILDERX_PLUGINS) {
|
|
395
|
+
if (isHarmonySplitCompile) {
|
|
396
|
+
refreshEncryptUniModules(params.platform, inputDir);
|
|
397
|
+
}
|
|
387
398
|
return {};
|
|
388
399
|
}
|
|
389
400
|
const cacheDir = process.env.UNI_MODULES_ENCRYPT_CACHE_DIR;
|
|
@@ -445,7 +456,7 @@ async function checkEncryptUniModules(inputDir, params, sdkType = 'all') {
|
|
|
445
456
|
}
|
|
446
457
|
}
|
|
447
458
|
// 初始化所有
|
|
448
|
-
|
|
459
|
+
refreshEncryptUniModules(params.platform, inputDir);
|
|
449
460
|
}
|
|
450
461
|
exports.checkEncryptUniModules = checkEncryptUniModules;
|
|
451
462
|
function getUniModulesEncryptType(pluginId) {
|