From 7cbf56aef3e9e29fb3bf455dd70f704dacb7448c Mon Sep 17 00:00:00 2001 From: "fenghao (P)" Date: Mon, 12 Jul 2021 10:36:23 +0800 Subject: [PATCH 1/3] =?UTF-8?q?IssueNo:#I3MOQ1=20Description:=E5=BC=80?= =?UTF-8?q?=E6=BA=90=E6=95=8F=E6=84=9F=E8=AF=8D=E6=95=B4=E6=94=B9=20Sig:aa?= =?UTF-8?q?fwk=20Feature=20or=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/Compressor.java | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/adapter/ohos/Compressor.java b/adapter/ohos/Compressor.java index d8c9fc53..3b1487e5 100644 --- a/adapter/ohos/Compressor.java +++ b/adapter/ohos/Compressor.java @@ -965,43 +965,43 @@ public class Compressor { * compress pack.info * * @param sourceFile source - * @param zos ZipOutputStream + * @param zipOutputStream ZipOutputStream * @param name filename * @param KeepDirStructure Empty File */ - private void compress(File sourceFile, ZipOutputStream zos, String name, + private void compress(File sourceFile, ZipOutputStream zipOutputStream, String name, boolean KeepDirStructure) { FileInputStream in = null; try { byte[] buf = new byte[BUFFER_SIZE]; if (sourceFile.isFile()) { ZipEntry zipEntry = getStoredZipEntry(sourceFile, name); - zos.putNextEntry(zipEntry); + zipOutputStream.putNextEntry(zipEntry); in = new FileInputStream(sourceFile); int len; while ((len = in.read(buf)) != -1) { - zos.write(buf, 0, len); + zipOutputStream.write(buf, 0, len); } - zos.closeEntry(); + zipOutputStream.closeEntry(); } else { File[] listFiles = sourceFile.listFiles(); if (listFiles == null || listFiles.length == 0) { if (KeepDirStructure) { if (!name.isEmpty()) { ZipEntry zipEntry = getStoredZipEntry(sourceFile, name + "/"); - zos.putNextEntry(zipEntry); + zipOutputStream.putNextEntry(zipEntry); } else { ZipEntry zipEntry = getStoredZipEntry(sourceFile, name); - zos.putNextEntry(zipEntry); + zipOutputStream.putNextEntry(zipEntry); } - zos.closeEntry(); + zipOutputStream.closeEntry(); } } else { for (File file : listFiles) { if (KeepDirStructure) { - isNameEmpty(zos, name, KeepDirStructure, file); + isNameEmpty(zipOutputStream, name, KeepDirStructure, file); } else { - compress(file, zos, file.getName(), KeepDirStructure); + compress(file, zipOutputStream, file.getName(), KeepDirStructure); } } } @@ -1057,16 +1057,16 @@ public class Compressor { /** * isNameEmpty * - * @param zos ZipOutputStream + * @param zipOutputStream ZipOutputStream * @param name filename * @param KeepDirStructure KeepDirStructure * @param file file */ - private void isNameEmpty(ZipOutputStream zos, String name, boolean KeepDirStructure, File file) { + private void isNameEmpty(ZipOutputStream zipOutputStream, String name, boolean KeepDirStructure, File file) { if (!name.isEmpty()) { - compress(file, zos, name + "/" + file.getName(), KeepDirStructure); + compress(file, zipOutputStream, name + "/" + file.getName(), KeepDirStructure); } else { - compress(file, zos, file.getName(), KeepDirStructure); + compress(file, zipOutputStream, file.getName(), KeepDirStructure); } } -- Gitee From 9c03b2f40b4e72e0fbbd97cbcfa85c1bd893ff9c Mon Sep 17 00:00:00 2001 From: "fenghao (P)" Date: Mon, 12 Jul 2021 10:54:19 +0800 Subject: [PATCH 2/3] =?UTF-8?q?IssueNo:#I3TV5X=20Description:README?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E6=95=B4=E6=94=B9=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/bundles/packing_tool/readme.md | 224 ------------------------- 1 file changed, 224 deletions(-) delete mode 100644 adapter/bundles/packing_tool/readme.md diff --git a/adapter/bundles/packing_tool/readme.md b/adapter/bundles/packing_tool/readme.md deleted file mode 100644 index e5a27079..00000000 --- a/adapter/bundles/packing_tool/readme.md +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright (c) 2019-2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -use commands for package hap or app. - -CONSTRAINT: -1.When the app depends on a hap, you need to wait the hap has been packaged, - It can be controlled according to the return value of the command execution. -2.If the same command appears many times in a command, take the last value that appears. - For example: --mode hap --mode app - the mode value is app. -3.If there are several parameters in the same command, take the first value. - For example: --mode hap app - the mode value is hap. -4.Path cannot start with '--', to avoid conflict with the instruction. -5.Command must be lowercase(such as:--mode), and file's suffix is case insensitive, - but json's filename must be config.json and index's filename must be resources.index. -6.Absolute paths is recommended. -7.After package a hap, files under resources/ will put into assets/entry/resources/ directory, - files under lib/ will be putted into libs/ directory, - files under maple-so/ will be putted into maple/ directory, - file of resources.index will be putted into assets/entry/ directory. -8.maple so input method have a tentative plan which can support two input methods. - If "maple-so-path" is valid, "maple-so-dir" will not be used. - The input method of "maple-so-path" will be discarded later. -9.In app package mode, signature and certificate may be resource files later, - so parameters are reserved now. - -HAP USAGE: -java -jar hmos_app_packing_tool.jar --mode