diff --git a/adapter/ohos/CommandParser.java b/adapter/ohos/CommandParser.java index 6b67ea5332d5c22b0b75d04d49e48820f431650f..84b84b63f89bbfbd005db3438917eee7696e2e6e 100644 --- a/adapter/ohos/CommandParser.java +++ b/adapter/ohos/CommandParser.java @@ -39,6 +39,7 @@ public class CommandParser { private static final String CMD_ABILITY_SO_PATH = "--ability-so-path"; private static final String CMD_DEX_PATH = "--dex-path"; private static final String CMD_ABC_PATH = "--abc-path"; + private static final String CMD_FILE_PATH = "--file-path"; private static final String CMD_LIB_PATH = "--lib-path"; private static final String CMD_RES_PATH = "--res-path"; private static final String CMD_RESOURCES_PATH = "--resources-path"; @@ -262,6 +263,10 @@ public class CommandParser { utility.setAbcPath(value); return true; } + case CMD_FILE_PATH: { + utility.setFilePath(value); + return true; + } case CMD_LIB_PATH: { utility.setLibPath(value); return true; diff --git a/adapter/ohos/Compressor.java b/adapter/ohos/Compressor.java index 3b1487e54ca705bbd72443e017e97097366d6a84..7f62d3619b5ffbde797ec59d484e0916d6a525de 100644 --- a/adapter/ohos/Compressor.java +++ b/adapter/ohos/Compressor.java @@ -199,6 +199,10 @@ public class Compressor { pathToFile(utility, utility.getLibPath(), LIBS_DIR_NAME, utility.isCompressNativeLibs()); } + if (!utility.getFilePath().isEmpty()) { + pathToFile(utility, utility.getFilePath(), NULL_DIR_NAME, false); + } + if (!utility.getResPath().isEmpty() && !utility.getModuleName().isEmpty()) { String resPath = ASSETS_DIR_NAME + utility.getModuleName() + LINUX_FILE_SEPARATOR + RESOURCES_DIR_NAME; diff --git a/adapter/ohos/Utility.java b/adapter/ohos/Utility.java index bf68cb22e05c66fd81847c67fbe2a76dfdab75f4..5375746923cb0b7c99a381c49f7b1cfdb4e8bd70 100644 --- a/adapter/ohos/Utility.java +++ b/adapter/ohos/Utility.java @@ -72,6 +72,7 @@ public class Utility { private String entryCardPath = ""; private String packRes = ""; private String packResPath = ""; + private String filePath = ""; private List formattedSoPathList = new ArrayList<>(); private List formattedAbilitySoPathList = new ArrayList<>(); @@ -164,6 +165,16 @@ public class Utility { } } + public String getFilePath() { + return filePath; + } + + public void setFilePath(String filePath) { + if (!filePath.startsWith(CMD_PREFIX)) { + this.filePath = filePath; + } + } + public String getIndexPath() { return indexPath; }