ApkDecoder.writeMetaFile(): don't write isFrameworkApk and usesFramework if apk doesn't contain resources.

This commit is contained in:
Ryszard Wiśniewski 2010-06-12 17:26:34 +02:00
parent 18c3f0cf7b
commit 517877c665
2 changed files with 9 additions and 4 deletions

View File

@ -150,7 +150,8 @@ public class Androlib {
public void build(ExtFile appDir, boolean forceBuildAll, boolean debug)
throws AndrolibException {
Map<String, Object> 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);

View File

@ -174,9 +174,13 @@ public class ApkDecoder {
private void writeMetaFile() throws AndrolibException {
Map<String, Object> meta = new LinkedHashMap<String, Object>();
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);
}