diff --git a/adapter/ohos/Compressor.java b/adapter/ohos/Compressor.java index 6a6478628a435df4e8fae5a81e9176b181ccb9b9..a4d0b6c0fe312833eaea6f5cf6749573b6afabaa 100644 --- a/adapter/ohos/Compressor.java +++ b/adapter/ohos/Compressor.java @@ -655,7 +655,9 @@ public class Compressor { } // copy duplicated hap to duplicated dir and get moduleName of duplicated hap if (selectedHaps.contains(zipEntry.getName())) { - continue; + LOG.error("Compressor::copyHapFromApp file duplicated, file is " + zipEntry.getName()); + throw new BundleException("Compressor::copyHapFromApp file duplicated, file is " + + zipEntry.getName()); } else { // copy selectedHap to tempDir file = new File(tempDir + File.separator + zipEntry.getName()); @@ -719,7 +721,9 @@ public class Compressor { } for (String hapPath : utility.getFormattedHapList()) { if (seletedHaps.contains(new File(hapPath).getName())) { - continue; + LOG.error("Compressor::disposeHap file duplicated, file is " + new File(hapPath).getName()); + throw new BundleException("Compressor::disposeHap file duplicated, file is " + + new File(hapPath).getName()); } File hapFile = new File(hapPath); seletedHaps.add(hapFile.getName()); @@ -727,7 +731,6 @@ public class Compressor { FileUtils.copyFile(hapFile, new File((tempDir +File.separator + hapFile.getName()))); String packInfo = FileUtils.getJsonInZips(hapFile, PACKINFO_NAME); - if (packInfo.isEmpty()) { String errMsg = "Compressor::disposeHap failed, hap has no pack.info!"; LOG.error(errMsg); diff --git a/jar/app_packing_tool.jar b/jar/app_packing_tool.jar index 1b0b82dc8a3da5317776b29d89fb13a7131246c9..b7d986fe10755fb8ef9933d24e14b393a37cc922 100644 Binary files a/jar/app_packing_tool.jar and b/jar/app_packing_tool.jar differ