mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-07 10:35:52 +01:00
aapt2: flag for aapt2 and sparse resources to meta-info/apkOptions
This commit is contained in:
parent
0827b2b7a2
commit
f5caccbc2e
@ -27,9 +27,16 @@ public class ApkOptions {
|
|||||||
public boolean updateFiles = false;
|
public boolean updateFiles = false;
|
||||||
public boolean isFramework = false;
|
public boolean isFramework = false;
|
||||||
public boolean resourcesAreCompressed = false;
|
public boolean resourcesAreCompressed = false;
|
||||||
|
public boolean useAapt2 = false;
|
||||||
public Collection<String> doNotCompress;
|
public Collection<String> doNotCompress;
|
||||||
|
|
||||||
public String frameworkFolderLocation = null;
|
public String frameworkFolderLocation = null;
|
||||||
public String frameworkTag = null;
|
public String frameworkTag = null;
|
||||||
public String aaptPath = "";
|
public String aaptPath = "";
|
||||||
|
|
||||||
|
public int aaptVersion = 1; // default to v1
|
||||||
|
|
||||||
|
public boolean isAapt2() {
|
||||||
|
return this.useAapt2 || this.aaptVersion == 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ public class MetaInfo {
|
|||||||
public VersionInfo versionInfo;
|
public VersionInfo versionInfo;
|
||||||
public boolean compressionType;
|
public boolean compressionType;
|
||||||
public boolean sharedLibrary;
|
public boolean sharedLibrary;
|
||||||
|
public boolean sparseResources;
|
||||||
public Map<String, String> unknownFiles;
|
public Map<String, String> unknownFiles;
|
||||||
public Collection<String> doNotCompress;
|
public Collection<String> doNotCompress;
|
||||||
|
|
||||||
@ -60,7 +61,7 @@ public class MetaInfo {
|
|||||||
FileOutputStream fos = new FileOutputStream(file);
|
FileOutputStream fos = new FileOutputStream(file);
|
||||||
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
|
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
|
||||||
Writer writer = new BufferedWriter(outputStreamWriter)
|
Writer writer = new BufferedWriter(outputStreamWriter)
|
||||||
){
|
) {
|
||||||
save(writer);
|
save(writer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -72,7 +73,7 @@ public class MetaInfo {
|
|||||||
public static MetaInfo load(File file) throws IOException {
|
public static MetaInfo load(File file) throws IOException {
|
||||||
try (
|
try (
|
||||||
InputStream fis = new FileInputStream(file)
|
InputStream fis = new FileInputStream(file)
|
||||||
){
|
) {
|
||||||
return load(fis);
|
return load(fis);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user