Skip to content

Commit

Permalink
bugfix, fix get wrong package ResPackage for multi-pkg resources.arsc.
Browse files Browse the repository at this point in the history
  • Loading branch information
JingYeoh committed Sep 23, 2019
1 parent 2264e61 commit 9e39755
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,19 @@ public ResPackage selectPkgWithMostResSpecs(ResPackage[] pkgs)
throws AndrolibException {
int id = 0;
int value = 0;
int index = 0;

for (ResPackage resPackage : pkgs) {
for (int i = 0; i < pkgs.length; i++) {
ResPackage resPackage = pkgs[i];
if (resPackage.getResSpecCount() > value && ! resPackage.getName().equalsIgnoreCase("android")) {
value = resPackage.getResSpecCount();
id = resPackage.getId();
index = i;
}
}

// if id is still 0, we only have one pkgId which is "android" -> 1
return (id == 0) ? pkgs[0] : pkgs[1];
return (id == 0) ? pkgs[0] : pkgs[index];
}

public ResPackage loadFrameworkPkg(ResTable resTable, int id, String frameTag)
Expand Down

0 comments on commit 9e39755

Please sign in to comment.