From a612ad7e3e910a1bc427ba46e67d21e49de4e39b Mon Sep 17 00:00:00 2001 From: "fenghao (P)" Date: Sat, 18 Sep 2021 15:31:20 +0800 Subject: [PATCH] =?UTF-8?q?IssueNo:#I497D1=20Description:=E8=A7=A3?= =?UTF-8?q?=E6=9E=90hapName=E6=9C=89=E8=AF=AF=20Sig:aafwk=20Feature=20or?= =?UTF-8?q?=20Bugfix:=20Bugfig=20Binary=20Source:=20No?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fenghao (P) --- adapter/ohos/Uncompress.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adapter/ohos/Uncompress.java b/adapter/ohos/Uncompress.java index b01c353a..bd3d5d3e 100644 --- a/adapter/ohos/Uncompress.java +++ b/adapter/ohos/Uncompress.java @@ -1263,9 +1263,9 @@ public class Uncompress { } private static String getHapNameWithoutSuffix(String hapFileName) { - if (hapFileName == null || hapFileName.isEmpty()) { + if (hapFileName == null || hapFileName.isEmpty() || hapFileName.lastIndexOf(".") == -1) { return ""; } - return hapFileName.replace(HAP_SUFFIX, ""); + return hapFileName.substring(0, hapFileName.lastIndexOf(".")); } } -- Gitee