clean: setTargetSdkVersion used before manifest was decoded

This commit is contained in:
IgorEisberg 2021-07-03 22:35:59 +03:00
parent 992de66bac
commit 1fd3f52b9d

View File

@ -102,8 +102,6 @@ public class ApkDecoder {
case DECODE_RESOURCES_NONE: case DECODE_RESOURCES_NONE:
mAndrolib.decodeResourcesRaw(mApkFile, outDir); mAndrolib.decodeResourcesRaw(mApkFile, outDir);
if (mForceDecodeManifest == FORCE_DECODE_MANIFEST_FULL) { if (mForceDecodeManifest == FORCE_DECODE_MANIFEST_FULL) {
setTargetSdkVersion();
// done after raw decoding of resources because copyToDir overwrites dest files // done after raw decoding of resources because copyToDir overwrites dest files
if (hasManifest()) { if (hasManifest()) {
mAndrolib.decodeManifestWithResources(mApkFile, outDir, getResTable()); mAndrolib.decodeManifestWithResources(mApkFile, outDir, getResTable());
@ -111,8 +109,6 @@ public class ApkDecoder {
} }
break; break;
case DECODE_RESOURCES_FULL: case DECODE_RESOURCES_FULL:
setTargetSdkVersion();
if (hasManifest()) { if (hasManifest()) {
mAndrolib.decodeManifestWithResources(mApkFile, outDir, getResTable()); mAndrolib.decodeManifestWithResources(mApkFile, outDir, getResTable());
} }
@ -222,17 +218,6 @@ public class ApkDecoder {
} }
} }
public void setTargetSdkVersion() throws AndrolibException {
if (mResTable == null) {
mResTable = mAndrolib.getResTable(mApkFile);
}
Map<String, String> sdkInfo = mResTable.getSdkInfo();
if (sdkInfo.get("targetSdkVersion") != null) {
mApiLevel = Integer.parseInt(sdkInfo.get("targetSdkVersion"));
}
}
public void setBaksmaliDebugMode(boolean bakDeb) { public void setBaksmaliDebugMode(boolean bakDeb) {
mBakDeb = bakDeb; mBakDeb = bakDeb;
} }