mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-06 10:05:54 +01:00
Storing isFrameworkApk bool in apktool.yml instead of guessing it at build time.
This commit is contained in:
parent
1826c7f65f
commit
ebfb9e3038
@ -19,6 +19,7 @@ package brut.androlib;
|
||||
|
||||
import brut.androlib.java.AndrolibJava;
|
||||
import brut.androlib.res.AndrolibResources;
|
||||
import brut.androlib.res.data.ResPackage;
|
||||
import brut.androlib.res.data.ResTable;
|
||||
import brut.androlib.res.decoder.ARSCDecoder;
|
||||
import brut.androlib.res.decoder.ARSCDecoder.FlagsOffset;
|
||||
@ -152,8 +153,8 @@ public class Androlib {
|
||||
|
||||
public void build(ExtFile appDir, boolean forceBuildAll, boolean debug)
|
||||
throws AndrolibException {
|
||||
boolean framework = mAndRes.detectWhetherAppIsFramework(appDir);
|
||||
Map<String, Object> meta = readMetaFile(appDir);
|
||||
boolean framework = (Boolean) meta.get("isFrameworkApk");
|
||||
|
||||
new File(appDir, APK_DIRNAME).mkdirs();
|
||||
buildSources(appDir, forceBuildAll, debug);
|
||||
@ -361,6 +362,15 @@ public class Androlib {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isFrameworkApk(ResTable resTable) {
|
||||
for (ResPackage pkg : resTable.listMainPackages()) {
|
||||
if (pkg.getId() < 64) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String getVersion() {
|
||||
return VERSION;
|
||||
}
|
||||
|
@ -163,6 +163,8 @@ public class ApkDecoder {
|
||||
private void writeMetaFile() throws AndrolibException {
|
||||
Map<String, Object> meta = new LinkedHashMap<String, Object>();
|
||||
meta.put("version", Androlib.getVersion());
|
||||
meta.put("isFrameworkApk",
|
||||
Boolean.valueOf(mAndrolib.isFrameworkApk(getResTable())));
|
||||
mAndrolib.writeMetaFile(mOutDir, meta);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user