From 1a40c82d7908274ed02e07b753dfad182b58f100 Mon Sep 17 00:00:00 2001 From: "fenghao (P)" Date: Sat, 21 Aug 2021 15:37:00 +0800 Subject: [PATCH] =?UTF-8?q?IssueNo:#I46N5X=20Description:=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E7=9B=AE=E5=BD=95=E4=B8=8B=E5=8C=85=E5=90=ABapk?= =?UTF-8?q?=E7=9A=84hap=E5=8C=85=E6=8B=86=E5=8C=85=E5=A4=B1=E8=B4=A5=20Sig?= =?UTF-8?q?:aafwk=20Feature=20or=20Bugfix:=20Bugfig=20Binary=20Source:=20N?= =?UTF-8?q?o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fenghao (P) --- adapter/ohos/Uncompress.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/adapter/ohos/Uncompress.java b/adapter/ohos/Uncompress.java index ffbef2d1..baa9317b 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); -- Gitee