mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-20 16:57:34 +01:00
Merge branch 'master' of https://github.com/Promon/Apktool into Promon-master
This commit is contained in:
commit
4ba1a035ae
@ -307,6 +307,22 @@ final public class AndrolibResources {
|
||||
mSharedLibrary = flag;
|
||||
}
|
||||
|
||||
// Ensure that targetSdkVersion is between minSdkVersion/maxSdkVersion if
|
||||
// they are specified.
|
||||
private String checkTargetSdkVersionBounds()
|
||||
{
|
||||
int target = Integer.parseInt(mTargetSdkVersion);
|
||||
int min = (mMinSdkVersion != null) ? Integer.parseInt(mMinSdkVersion) : 0;
|
||||
int max = (mMaxSdkVersion != null) ? Integer.parseInt(mMaxSdkVersion) : target;
|
||||
|
||||
// Your APK seems broken otherwise.
|
||||
assert (min <= max);
|
||||
|
||||
target = Math.min(max, target);
|
||||
target = Math.max(min, target);
|
||||
return Integer.toString(target);
|
||||
}
|
||||
|
||||
public void aaptPackage(File apkFile, File manifest, File resDir, File rawDir, File assetDir, File[] include)
|
||||
throws AndrolibException {
|
||||
|
||||
@ -368,7 +384,7 @@ final public class AndrolibResources {
|
||||
}
|
||||
if (mTargetSdkVersion != null) {
|
||||
cmd.add("--target-sdk-version");
|
||||
cmd.add(mTargetSdkVersion);
|
||||
cmd.add(checkTargetSdkVersionBounds());
|
||||
}
|
||||
if (mMaxSdkVersion != null) {
|
||||
cmd.add("--max-sdk-version");
|
||||
|
Loading…
x
Reference in New Issue
Block a user