From ce9c6304af940514281a3ec094cfac1aadce25a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ryszard=20Wi=C5=9Bniewski?= Date: Wed, 2 Jun 2010 00:43:31 +0200 Subject: [PATCH] AndrolibResources.loadFrameworkPkg(): added check for loaded pkg id. --- src/brut/androlib/res/AndrolibResources.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/brut/androlib/res/AndrolibResources.java b/src/brut/androlib/res/AndrolibResources.java index ac16160d..bc233b3e 100644 --- a/src/brut/androlib/res/AndrolibResources.java +++ b/src/brut/androlib/res/AndrolibResources.java @@ -82,8 +82,14 @@ final public class AndrolibResources { "Arsc files with zero or multiple packages"); } - resTable.addPackage(pkgs[0], false); - return pkgs[0]; + ResPackage pkg = pkgs[0]; + if (pkg.getId() != id) { + throw new AndrolibException("Expected pkg of id: " + + String.valueOf(id) + ", got: " + pkg.getId()); + } + + resTable.addPackage(pkg, false); + return pkg; } public void decode(ResTable resTable, ExtFile apkFile, File outDir)