mirror of
https://github.com/revanced/Apktool.git
synced 2024-12-13 14:27:46 +01:00
Fix APKs with SDK versions being reference values
This non-standard behavior is rare, but quite annoying. The solution is simple - replacing the reference value with the actual value from integers.xml, just like Apktool already does for versionName.
This commit is contained in:
parent
49e55f522f
commit
400a463286
@ -377,6 +377,25 @@ public class ApkDecoder {
|
|||||||
private void putSdkInfo(MetaInfo meta) throws AndrolibException {
|
private void putSdkInfo(MetaInfo meta) throws AndrolibException {
|
||||||
Map<String, String> info = getResTable().getSdkInfo();
|
Map<String, String> info = getResTable().getSdkInfo();
|
||||||
if (info.size() > 0) {
|
if (info.size() > 0) {
|
||||||
|
String refValue;
|
||||||
|
if (info.get("minSdkVersion") != null) {
|
||||||
|
refValue = ResXmlPatcher.pullValueFromIntegers(mOutDir, info.get("minSdkVersion"));
|
||||||
|
if (refValue != null) {
|
||||||
|
info.put("minSdkVersion", refValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (info.get("targetSdkVersion") != null) {
|
||||||
|
refValue = ResXmlPatcher.pullValueFromIntegers(mOutDir, info.get("targetSdkVersion"));
|
||||||
|
if (refValue != null) {
|
||||||
|
info.put("targetSdkVersion", refValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (info.get("maxSdkVersion") != null) {
|
||||||
|
refValue = ResXmlPatcher.pullValueFromIntegers(mOutDir, info.get("maxSdkVersion"));
|
||||||
|
if (refValue != null) {
|
||||||
|
info.put("maxSdkVersion", refValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
meta.sdkInfo = info;
|
meta.sdkInfo = info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user