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)