From 7ed273f070312561bae9e1f7c6cd26af6d7e4b0b Mon Sep 17 00:00:00 2001 From: Jean-Marie Mineau Date: Tue, 22 Apr 2025 17:08:21 +0200 Subject: [PATCH] fix warning --- androscalpel_serializer/src/file_reader.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/androscalpel_serializer/src/file_reader.rs b/androscalpel_serializer/src/file_reader.rs index 8b8d1ca..6f77979 100644 --- a/androscalpel_serializer/src/file_reader.rs +++ b/androscalpel_serializer/src/file_reader.rs @@ -237,9 +237,11 @@ impl<'a> DexFileReader<'a> { } fn sanity_check(&self) -> Result<()> { - if self.header.magic.version != [0x30, 0x33, 0x39] { + let version = self.header.magic.version; + let version = (version[0] - 0x30) * 100 + (version[1] - 0x30) * 10 + (version[2] - 0x30); + if version > 39 { warn!( - "DEX 039 is the only version currently supported, found {}", + "Only version <= DEX 039 are currently supported, found {}", std::str::from_utf8(self.header.magic.version.as_slice()) .unwrap_or(&format!("{:x?}", self.header.magic.version)) );