mirror of
https://github.com/revanced/Apktool.git
synced 2025-05-03 15:24:26 +02:00
use BufferedInputStream for APK
faster xml escape function
This commit is contained in:
parent
3736ecef32
commit
07b43d687c
@ -619,8 +619,8 @@ final public class AndrolibResources {
|
|||||||
private ResPackage[] getResPackagesFromApk(ExtFile apkFile,ResTable resTable, boolean keepBroken)
|
private ResPackage[] getResPackagesFromApk(ExtFile apkFile,ResTable resTable, boolean keepBroken)
|
||||||
throws AndrolibException {
|
throws AndrolibException {
|
||||||
try {
|
try {
|
||||||
return ARSCDecoder.decode(apkFile.getDirectory().getFileInput("resources.arsc"),false,
|
BufferedInputStream bfi = new BufferedInputStream(apkFile.getDirectory().getFileInput("resources.arsc"));
|
||||||
keepBroken, resTable).getPackages();
|
return ARSCDecoder.decode(bfi, false, keepBroken, resTable).getPackages();
|
||||||
} catch (DirectoryException ex) {
|
} catch (DirectoryException ex) {
|
||||||
throw new AndrolibException("Could not load resources.arsc from file: " + apkFile, ex);
|
throw new AndrolibException("Could not load resources.arsc from file: " + apkFile, ex);
|
||||||
}
|
}
|
||||||
|
@ -22,13 +22,15 @@ import java.awt.event.KeyEvent;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Ryszard Wiśniewski <brut.alll@gmail.com>
|
* @author Ryszard Wiśniewski <brut.alll@gmail.com>
|
||||||
*/
|
*/
|
||||||
public final class ResXmlEncoders {
|
public final class ResXmlEncoders {
|
||||||
|
|
||||||
public static String escapeXmlChars(String str) {
|
public static String escapeXmlChars(String str) {
|
||||||
return str.replace("&", "&").replace("<", "<");
|
return StringUtils.replace(StringUtils.replace(str, "&", "&"), "<", "<");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String encodeAsResXmlAttr(String str) {
|
public static String encodeAsResXmlAttr(String str) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user