From 517877c665e7f4a07b66289ffd5b54bd3711cc6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ryszard=20Wi=C5=9Bniewski?= Date: Sat, 12 Jun 2010 17:26:34 +0200 Subject: [PATCH] ApkDecoder.writeMetaFile(): don't write isFrameworkApk and usesFramework if apk doesn't contain resources. --- src/brut/androlib/Androlib.java | 3 ++- src/brut/androlib/ApkDecoder.java | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/brut/androlib/Androlib.java b/src/brut/androlib/Androlib.java index 94a3f320..b8eac992 100644 --- a/src/brut/androlib/Androlib.java +++ b/src/brut/androlib/Androlib.java @@ -150,7 +150,8 @@ public class Androlib { public void build(ExtFile appDir, boolean forceBuildAll, boolean debug) throws AndrolibException { Map meta = readMetaFile(appDir); - boolean framework = (Boolean) meta.get("isFrameworkApk"); + Object t1 = meta.get("isFrameworkApk"); + boolean framework = t1 == null ? false : (Boolean) t1; new File(appDir, APK_DIRNAME).mkdirs(); buildSources(appDir, forceBuildAll, debug); diff --git a/src/brut/androlib/ApkDecoder.java b/src/brut/androlib/ApkDecoder.java index 477d6a66..b6de62bc 100644 --- a/src/brut/androlib/ApkDecoder.java +++ b/src/brut/androlib/ApkDecoder.java @@ -174,9 +174,13 @@ 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()))); - putUsesFramework(meta); + + if (hasResources()) { + meta.put("isFrameworkApk", + Boolean.valueOf(mAndrolib.isFrameworkApk(getResTable()))); + putUsesFramework(meta); + } + mAndrolib.writeMetaFile(mOutDir, meta); }