mirror of
https://github.com/revanced/Apktool.git
synced 2025-04-30 14:14:25 +02: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 {
|
public ResTable getResTable(File apkFile) throws AndrolibException {
|
||||||
ResTable resTable = new ResTable();
|
ResTable resTable = new ResTable();
|
||||||
loadApk(resTable, new File(getClass().getProtectionDomain().getCodeSource().getLocation().getPath()), false);
|
loadApk(resTable, getAndroidResourcesFile(), false);
|
||||||
loadApk(resTable, apkFile, true);
|
loadApk(resTable, apkFile, true);
|
||||||
return resTable;
|
return resTable;
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ final public class AndrolibResources {
|
|||||||
cmd[i++] = "-F";
|
cmd[i++] = "-F";
|
||||||
cmd[i++] = apkFile.getAbsolutePath();
|
cmd[i++] = apkFile.getAbsolutePath();
|
||||||
cmd[i++] = "-I";
|
cmd[i++] = "-I";
|
||||||
cmd[i++] = mAndroidJar.getAbsolutePath();
|
cmd[i++] = getAndroidResourcesFile().getAbsolutePath();
|
||||||
if (manifest != null) {
|
if (manifest != null) {
|
||||||
cmd[i++] = "-M";
|
cmd[i++] = "-M";
|
||||||
cmd[i++] = manifest.getAbsolutePath();
|
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) {
|
public static String escapeForResXml(String value) {
|
||||||
value = value.replace("'", "\\'");
|
value = value.replace("'", "\\'");
|
||||||
value = value.replace("\n", "\\n\n");
|
value = value.replace("\n", "\\n\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user