mirror of
https://github.com/revanced/Apktool.git
synced 2025-02-01 14:47:56 +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;
|
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)
|
public void aaptPackage(File apkFile, File manifest, File resDir, File rawDir, File assetDir, File[] include)
|
||||||
throws AndrolibException {
|
throws AndrolibException {
|
||||||
|
|
||||||
@ -368,7 +384,7 @@ final public class AndrolibResources {
|
|||||||
}
|
}
|
||||||
if (mTargetSdkVersion != null) {
|
if (mTargetSdkVersion != null) {
|
||||||
cmd.add("--target-sdk-version");
|
cmd.add("--target-sdk-version");
|
||||||
cmd.add(mTargetSdkVersion);
|
cmd.add(checkTargetSdkVersionBounds());
|
||||||
}
|
}
|
||||||
if (mMaxSdkVersion != null) {
|
if (mMaxSdkVersion != null) {
|
||||||
cmd.add("--max-sdk-version");
|
cmd.add("--max-sdk-version");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user