Some APKs are reporting wrong pkgId

- fallback to renamed package to find that pkgId
This commit is contained in:
Connor Tumbleson 2015-08-21 11:01:43 -05:00
parent 579d7c561e
commit e8ad159438

View File

@ -18,6 +18,7 @@ package brut.androlib;
import brut.androlib.err.InFileNotFoundException;
import brut.androlib.err.OutDirExistsException;
import brut.androlib.err.UndefinedResObject;
import brut.androlib.res.AndrolibResources;
import brut.androlib.res.data.ResPackage;
import brut.androlib.res.data.ResTable;
@ -347,7 +348,11 @@ public class ApkDecoder {
private void putPackageInfo(Map<String, Object> meta) throws AndrolibException {
String renamed = getResTable().getPackageRenamed();
String original = getResTable().getPackageOriginal();
int id = getResTable().getPackageId();
try {
id = getResTable().getPackage(renamed).getId();
} catch (UndefinedResObject ignored) {}
HashMap<String, String> packages = new HashMap<String, String>();