mirror of
https://github.com/revanced/Apktool.git
synced 2024-12-05 02:22:55 +01:00
Loading Android resources from a apktool.jar file, rather than from SDK.
This commit is contained in:
parent
48e1afd6b1
commit
a27e1adcde
@ -56,7 +56,7 @@ final public class AndrolibResources {
|
||||
|
||||
public ResTable getResTable(File apkFile) throws AndrolibException {
|
||||
ResTable resTable = new ResTable();
|
||||
loadApk(resTable, new File(getClass().getProtectionDomain().getCodeSource().getLocation().getPath()), false);
|
||||
loadApk(resTable, getAndroidResourcesFile(), false);
|
||||
loadApk(resTable, apkFile, true);
|
||||
return resTable;
|
||||
}
|
||||
@ -112,7 +112,7 @@ final public class AndrolibResources {
|
||||
cmd[i++] = "-F";
|
||||
cmd[i++] = apkFile.getAbsolutePath();
|
||||
cmd[i++] = "-I";
|
||||
cmd[i++] = mAndroidJar.getAbsolutePath();
|
||||
cmd[i++] = getAndroidResourcesFile().getAbsolutePath();
|
||||
if (manifest != null) {
|
||||
cmd[i++] = "-M";
|
||||
cmd[i++] = manifest.getAbsolutePath();
|
||||
@ -203,6 +203,11 @@ final public class AndrolibResources {
|
||||
}
|
||||
}
|
||||
|
||||
private File getAndroidResourcesFile() {
|
||||
return new File(getClass().getProtectionDomain().getCodeSource()
|
||||
.getLocation().getPath());
|
||||
}
|
||||
|
||||
public static String escapeForResXml(String value) {
|
||||
value = value.replace("'", "\\'");
|
||||
value = value.replace("\n", "\\n\n");
|
||||
|
Loading…
Reference in New Issue
Block a user