diff --git a/adapter/ohos/CommandParser.java b/adapter/ohos/CommandParser.java index 89ddb00bec72d17f0257bb8219db06fb6d3e3887..848cbf588ae08f1fa305ffd7dc98d1a511c22f68 100644 --- a/adapter/ohos/CommandParser.java +++ b/adapter/ohos/CommandParser.java @@ -36,6 +36,7 @@ public class CommandParser { private static final String CMD_INDEX_PATH = "--index-path"; private static final String CMD_JS_PATH = "--js-path"; private static final String CMD_ETS_PATH = "--ets-path"; + private static final String CMD_RPCID_PATH = "--rpcid-path"; private static final String CMD_SO_PATH = "--maple-so-path"; private static final String CMD_SO_DIR = "--maple-so-dir"; private static final String CMD_ABILITY_SO_PATH = "--ability-so-path"; @@ -313,6 +314,9 @@ public class CommandParser { utility.setEtsPath(value); return true; } + case CMD_RPCID_PATH: { + utility.setRpcidPath(value); + } default : { return false; } diff --git a/adapter/ohos/Compressor.java b/adapter/ohos/Compressor.java index 2f4476b404841bb64b14ff905942991a5a7ddb20..d2236587bf9322a8c2d0b0f84032db92039d0b72 100644 --- a/adapter/ohos/Compressor.java +++ b/adapter/ohos/Compressor.java @@ -244,6 +244,11 @@ public class Compressor { pathToFile(utility, utility.getResourcesPath(), resourcesPath, false); } + if (!utility.getRpcidPath().isEmpty()) { + String rpcidPath = NULL_DIR_NAME; + pathToFile(utility, utility.getRpcidPath(), rpcidPath, false); + } + if (!utility.getAssetsPath().isEmpty()) { pathToFile(utility, utility.getAssetsPath(), ASSETS_DIR_NAME, false); } @@ -306,6 +311,11 @@ public class Compressor { pathToFile(utility, utility.getEtsPath(), etsPath, false); } + if (!utility.getRpcidPath().isEmpty()) { + String rpcidPath = NULL_DIR_NAME; + pathToFile(utility, utility.getRpcidPath(), rpcidPath, false); + } + if (!utility.getAssetsPath().isEmpty()) { pathToFile(utility, utility.getAssetsPath(), ASSETS_DIR_NAME, false); } @@ -1256,7 +1266,7 @@ public class Compressor { */ private void obtainModuleVersion(Utility utility, File srcFile, String baseDir) throws BundleException { String moduleJson = ""; - moduleJson = checkModuleTypeInHaps(utility, srcFile, entryName); + moduleJson = checkModuleTypeInHaps(utility, srcFile, baseDir); if (utility.getIsModuleJson() && !moduleJson.equals("")) { Version version = ModuleJsonUtil.getVersion(moduleJson); diff --git a/adapter/ohos/ModuleJsonUtil.java b/adapter/ohos/ModuleJsonUtil.java index 4504a65046fef9023431d77d7bcba698d9833efe..9db0dac13049b64350e0f9388d930b06c80b72fe 100644 --- a/adapter/ohos/ModuleJsonUtil.java +++ b/adapter/ohos/ModuleJsonUtil.java @@ -34,7 +34,7 @@ public class ModuleJsonUtil { * @param jsonStr uncompress json object * @return the result */ - public static Version getVersion(String jsonString) { + public static Version getVersion(String jsonString) throws BundleException { Version version = new Version(); try { if (jsonString != null) { diff --git a/adapter/ohos/Utility.java b/adapter/ohos/Utility.java index 0a4383b9d6272d591bd72fc00f8a86053aecd8e5..5df9654dd02d8e0d780c9ba5e4f8d654d475684d 100644 --- a/adapter/ohos/Utility.java +++ b/adapter/ohos/Utility.java @@ -75,6 +75,7 @@ public class Utility { private String filePath = ""; private String jsPath = ""; private String etsPath = ""; + private String rpcidPath = ""; private int VersionCode = -1; private String VersionName = ""; private boolean isModuleJson = false; @@ -467,6 +468,14 @@ public class Utility { public void setEtsPath(String etsPath) { this.etsPath = etsPath; } + public String getRpcidPath() { + return rpcidPath; + } + + public void setRpcidPath(String rpcidPath) { + this.rpcidPath = rpcidPath; + } + public String getVersionName() { return VersionName; } diff --git a/jar/hmos_app_packing_tool.jar b/jar/hmos_app_packing_tool.jar index 06f78049be894cca1a171e37910efbd2f8dd7de8..d50f34d3bec7cfe6b266b3516969d2e9a34b229e 100644 Binary files a/jar/hmos_app_packing_tool.jar and b/jar/hmos_app_packing_tool.jar differ