From 651f4d37d872e261ec649fe6cbe405bff33bdc8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ryszard=20Wi=C5=9Bniewski?= Date: Fri, 2 Apr 2010 20:08:04 +0200 Subject: [PATCH] Fixed support for apk without any sources. --- src/brut/androlib/Androlib.java | 3 +++ src/brut/androlib/res/AndrolibResources.java | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/brut/androlib/Androlib.java b/src/brut/androlib/Androlib.java index 2e1cc4d2..4c35170f 100644 --- a/src/brut/androlib/Androlib.java +++ b/src/brut/androlib/Androlib.java @@ -196,6 +196,9 @@ public class Androlib { public boolean buildResourcesFull(File appDir, boolean forceBuildAll, boolean framework) throws AndrolibException { try { + if (! new File(appDir, "res").exists()) { + return false; + } if (! forceBuildAll) { LOGGER.info("Checking whether resources has changed..."); } diff --git a/src/brut/androlib/res/AndrolibResources.java b/src/brut/androlib/res/AndrolibResources.java index d7114d4e..9583a2df 100644 --- a/src/brut/androlib/res/AndrolibResources.java +++ b/src/brut/androlib/res/AndrolibResources.java @@ -132,6 +132,11 @@ final public class AndrolibResources { public boolean detectWhetherAppIsFramework(File appDir) throws AndrolibException { + File publicXml = new File(appDir, "res/values/public.xml"); + if (! publicXml.exists()) { + return false; + } + Iterator it; try { it = IOUtils.lineIterator(