mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-22 01:37:34 +01:00
refactor sdk codename to sdk level into function
This commit is contained in:
parent
86c2df6648
commit
f9c091f54b
@ -284,21 +284,7 @@ public class Androlib {
|
|||||||
|
|
||||||
if (meta.sdkInfo != null && meta.sdkInfo.get("minSdkVersion") != null) {
|
if (meta.sdkInfo != null && meta.sdkInfo.get("minSdkVersion") != null) {
|
||||||
String minSdkVersion = meta.sdkInfo.get("minSdkVersion");
|
String minSdkVersion = meta.sdkInfo.get("minSdkVersion");
|
||||||
|
mMinSdkVersion = getMinSdkVersionFromAndroidCodename(meta, minSdkVersion);
|
||||||
// Preview builds use short letter for API versions
|
|
||||||
switch (minSdkVersion) {
|
|
||||||
case "M":
|
|
||||||
mMinSdkVersion = ResConfigFlags.SDK_MNC;
|
|
||||||
break;
|
|
||||||
case "N":
|
|
||||||
mMinSdkVersion = ResConfigFlags.SDK_NOUGAT;
|
|
||||||
break;
|
|
||||||
case "O":
|
|
||||||
mMinSdkVersion = ResConfigFlags.SDK_O;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
mMinSdkVersion = Integer.parseInt(meta.sdkInfo.get("minSdkVersion"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outFile == null) {
|
if (outFile == null) {
|
||||||
@ -739,6 +725,19 @@ public class Androlib {
|
|||||||
return files;
|
return files;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int getMinSdkVersionFromAndroidCodename(MetaInfo meta, String sdkVersion) {
|
||||||
|
switch (sdkVersion) {
|
||||||
|
case "M":
|
||||||
|
return ResConfigFlags.SDK_MNC;
|
||||||
|
case "N":
|
||||||
|
return ResConfigFlags.SDK_NOUGAT;
|
||||||
|
case "O":
|
||||||
|
return ResConfigFlags.SDK_O;
|
||||||
|
default:
|
||||||
|
return Integer.parseInt(meta.sdkInfo.get("minSdkVersion"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isModified(File working, File stored) {
|
private boolean isModified(File working, File stored) {
|
||||||
return ! stored.exists() || BrutIO.recursiveModifiedTime(working) > BrutIO .recursiveModifiedTime(stored);
|
return ! stored.exists() || BrutIO.recursiveModifiedTime(working) > BrutIO .recursiveModifiedTime(stored);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user