diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkDecoder.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkDecoder.java index 36070cf3..c9a6894c 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkDecoder.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkDecoder.java @@ -135,7 +135,7 @@ public class ApkDecoder { // In case we have no resources. We should store the minSdk we pulled from the source opcode api level ApkInfo apkInfo = resourcesDecoder.getApkInfo(); - if (mMinSdkVersion > 0) { + if (! resourcesDecoder.hasResources() && mMinSdkVersion > 0) { apkInfo.setSdkInfoField("minSdkVersion", Integer.toString(mMinSdkVersion)); } diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/ResourcesDecoder.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/ResourcesDecoder.java index 32b945ad..e3ddb943 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/ResourcesDecoder.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/ResourcesDecoder.java @@ -65,7 +65,7 @@ public class ResourcesDecoder { mResTable = new ResTable(mConfig, mApkInfo); } - private boolean hasManifest() throws AndrolibException { + public boolean hasManifest() throws AndrolibException { try { return mApkFile.getDirectory().containsFile("AndroidManifest.xml"); } catch (DirectoryException ex) { @@ -73,7 +73,7 @@ public class ResourcesDecoder { } } - private boolean hasResources() throws AndrolibException { + public boolean hasResources() throws AndrolibException { try { return mApkFile.getDirectory().containsFile("resources.arsc"); } catch (DirectoryException ex) {