diff --git a/adapter/ohos/Uncompress.java b/adapter/ohos/Uncompress.java index ffbef2d1e3feeae2b1eb5f9d4ebddfd8977f7e76..baa9317ba4d0589876ac3f2c4e355348d87a4992 100644 --- a/adapter/ohos/Uncompress.java +++ b/adapter/ohos/Uncompress.java @@ -313,12 +313,12 @@ public class Uncompress { entriesNum++; ZipEntry entry = entries.nextElement(); String entryName = ""; - if (entry == null || entry.getName().isEmpty()) { - continue; - } + if (entry == null || entry.getName().isEmpty()) { + continue; + } if (entry.getName().toLowerCase().endsWith(CUT_ENTRY_FILENAME) && - "false".equals(utility.getUnpackCutEntryApk())) { - continue; + "false".equals(utility.getUnpackCutEntryApk())) { + continue; } entryName = entry.getName(); if (!entryName.toLowerCase(Locale.ENGLISH).endsWith(suffix) || @@ -333,6 +333,11 @@ public class Uncompress { destFileDir.mkdir(); } } + if (APK_SUFFIX.equals(suffix) && "true".equals(utility.getUnpackApk()) + && entryName.contains(LINUX_FILE_SEPARATOR)) { + // only unpack shell apk which in the root directory + continue; + } String tempPath = tempDir + LINUX_FILE_SEPARATOR + entryName; File destFile = new File(tempPath); dataTransfer(zipFile, entry, destFile);