fix: add missing hasResources check (#3182)

This commit is contained in:
Igor Eisberg 2023-07-20 18:40:16 +03:00 committed by GitHub
parent e3e2a7e1d6
commit 261003316e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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));
}

View File

@ -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) {