fix warning

This commit is contained in:
Jean-Marie Mineau 2025-04-22 17:08:21 +02:00
parent 1f2de8b60d
commit 7ed273f070
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2

View file

@ -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))
);