mirror of
https://github.com/revanced/Apktool.git
synced 2025-02-01 14:47:56 +01:00
AndrolibResources: using ExtFile to get contents of apk file.
This commit is contained in:
parent
c41f46cf08
commit
da2b3d8313
@ -22,6 +22,7 @@ import brut.androlib.res.data.*;
|
|||||||
import brut.androlib.res.data.value.ResFileValue;
|
import brut.androlib.res.data.value.ResFileValue;
|
||||||
import brut.androlib.res.data.value.ResXmlSerializable;
|
import brut.androlib.res.data.value.ResXmlSerializable;
|
||||||
import brut.androlib.res.decoder.*;
|
import brut.androlib.res.decoder.*;
|
||||||
|
import brut.androlib.res.util.ExtFile;
|
||||||
import brut.androlib.res.util.ExtMXSerializer;
|
import brut.androlib.res.util.ExtMXSerializer;
|
||||||
import brut.common.BrutException;
|
import brut.common.BrutException;
|
||||||
import brut.directory.*;
|
import brut.directory.*;
|
||||||
@ -34,9 +35,9 @@ import org.xmlpull.v1.XmlSerializer;
|
|||||||
* @author Ryszard Wiśniewski <brut.alll@gmail.com>
|
* @author Ryszard Wiśniewski <brut.alll@gmail.com>
|
||||||
*/
|
*/
|
||||||
final public class AndrolibResources {
|
final public class AndrolibResources {
|
||||||
public ResTable getResTable(File apkFile) throws AndrolibException {
|
public ResTable getResTable(ExtFile apkFile) throws AndrolibException {
|
||||||
ResTable resTable = new ResTable();
|
ResTable resTable = new ResTable();
|
||||||
decodeArsc(resTable, getAndroidResourcesFile(), false);
|
decodeArsc(resTable, new ExtFile(getAndroidResourcesFile()), false);
|
||||||
decodeArsc(resTable, apkFile, true);
|
decodeArsc(resTable, apkFile, true);
|
||||||
return resTable;
|
return resTable;
|
||||||
}
|
}
|
||||||
@ -206,10 +207,10 @@ final public class AndrolibResources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void decodeArsc(ResTable resTable, File apkFile, boolean main)
|
private void decodeArsc(ResTable resTable, ExtFile apkFile, boolean main)
|
||||||
throws AndrolibException {
|
throws AndrolibException {
|
||||||
try {
|
try {
|
||||||
loadArsc(resTable, new ZipRODirectory(apkFile)
|
loadArsc(resTable, apkFile.getDirectory()
|
||||||
.getFileInput("resources.arsc"), main);
|
.getFileInput("resources.arsc"), main);
|
||||||
} catch (DirectoryException ex) {
|
} catch (DirectoryException ex) {
|
||||||
throw new AndrolibException(
|
throw new AndrolibException(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user