diff --git a/hapsigntool/hap_sign_tool_lib/src/main/java/com/ohos/hapsigntool/codesigning/datastructure/NativeLibInfoSegment.java b/hapsigntool/hap_sign_tool_lib/src/main/java/com/ohos/hapsigntool/codesigning/datastructure/NativeLibInfoSegment.java index 8e635ac9f592b8f8e0f166a6e2669b132585c3fa..cc857b33685932629db5820d531659b69515a748 100644 --- a/hapsigntool/hap_sign_tool_lib/src/main/java/com/ohos/hapsigntool/codesigning/datastructure/NativeLibInfoSegment.java +++ b/hapsigntool/hap_sign_tool_lib/src/main/java/com/ohos/hapsigntool/codesigning/datastructure/NativeLibInfoSegment.java @@ -234,6 +234,7 @@ public class NativeLibInfoSegment { for (SignedFilePos pos : inSignedFilePosList) { byte[] fileNameBuffer = new byte[pos.getFileNameSize()]; fileNameListSize += pos.getFileNameSize(); + bf.position(pos.getFileNameOffset()); bf.get(fileNameBuffer); inFileNameList.add(new String(fileNameBuffer, StandardCharsets.UTF_8)); } @@ -248,6 +249,7 @@ public class NativeLibInfoSegment { throw new VerifyCodeSignException("SignInfo not aligned in NativeLibInfoSegment"); } byte[] signInfoBuffer = new byte[pos.getSignInfoSize()]; + bf.position(pos.getSignInfoOffset()); bf.get(signInfoBuffer); inSignInfoList.add(SignInfo.fromByteArray(signInfoBuffer)); } diff --git a/hapsigntool/hap_sign_tool_lib/src/main/java/com/ohos/hapsigntool/codesigning/sign/VerifyCodeSignature.java b/hapsigntool/hap_sign_tool_lib/src/main/java/com/ohos/hapsigntool/codesigning/sign/VerifyCodeSignature.java index 4493066e9f3984cfe59c7b70e74a6932ab69ff4c..4c4a401b4d1257c04c41c004adb08ebd62358e19 100644 --- a/hapsigntool/hap_sign_tool_lib/src/main/java/com/ohos/hapsigntool/codesigning/sign/VerifyCodeSignature.java +++ b/hapsigntool/hap_sign_tool_lib/src/main/java/com/ohos/hapsigntool/codesigning/sign/VerifyCodeSignature.java @@ -221,7 +221,7 @@ public class VerifyCodeSignature { hnpEntryNames.add(filePath[0]); hnpLibSignInfoMap.put(entryName, signInfo); } else { - LOGGER.debug("verify lib: {}", entryName); + LOGGER.info("verify lib: {}", entryName); verifyHapLib(inputJar, entryName, signInfo, pairResult); } } @@ -271,7 +271,7 @@ public class VerifyCodeSignature { if (!hnpLibSignInfoMap.containsKey(libPath)) { continue; } - LOGGER.debug("verify lib: {}", libPath); + LOGGER.info("verify lib: {}", libPath); SignInfo signInfo = hnpLibSignInfoMap.get(libPath); byte[] entrySig = signInfo.getSignature(); long dataSize = signInfo.getDataSize();