diff --git a/src/brut/androlib/Androlib.java b/src/brut/androlib/Androlib.java index b7ac28e3..b369fe82 100644 --- a/src/brut/androlib/Androlib.java +++ b/src/brut/androlib/Androlib.java @@ -19,6 +19,7 @@ package brut.androlib; import brut.androlib.java.AndrolibJava; import brut.androlib.res.AndrolibResources; +import brut.androlib.res.data.ResPackage; import brut.androlib.res.data.ResTable; import brut.androlib.res.decoder.ARSCDecoder; import brut.androlib.res.decoder.ARSCDecoder.FlagsOffset; @@ -152,8 +153,8 @@ public class Androlib { public void build(ExtFile appDir, boolean forceBuildAll, boolean debug) throws AndrolibException { - boolean framework = mAndRes.detectWhetherAppIsFramework(appDir); Map meta = readMetaFile(appDir); + boolean framework = (Boolean) meta.get("isFrameworkApk"); new File(appDir, APK_DIRNAME).mkdirs(); buildSources(appDir, forceBuildAll, debug); @@ -361,6 +362,15 @@ public class Androlib { } } + public boolean isFrameworkApk(ResTable resTable) { + for (ResPackage pkg : resTable.listMainPackages()) { + if (pkg.getId() < 64) { + return true; + } + } + return false; + } + public static String getVersion() { return VERSION; } diff --git a/src/brut/androlib/ApkDecoder.java b/src/brut/androlib/ApkDecoder.java index c2259205..280a5c86 100644 --- a/src/brut/androlib/ApkDecoder.java +++ b/src/brut/androlib/ApkDecoder.java @@ -163,6 +163,8 @@ public class ApkDecoder { private void writeMetaFile() throws AndrolibException { Map meta = new LinkedHashMap(); meta.put("version", Androlib.getVersion()); + meta.put("isFrameworkApk", + Boolean.valueOf(mAndrolib.isFrameworkApk(getResTable()))); mAndrolib.writeMetaFile(mOutDir, meta); }