mirror of
https://github.com/revanced/Apktool.git
synced 2025-06-12 05:07:41 +02:00
Prevents double escaping of special chars in arrays.xml/<item> tags
This commit is contained in:
@ -58,7 +58,7 @@ public class ResArrayValue extends ResBagValue implements
|
||||
serializer.attribute(null, "name", res.getResSpec().getName());
|
||||
for (int i = 0; i < mItems.length; i++) {
|
||||
serializer.startTag(null, "item");
|
||||
serializer.text(mItems[i].encodeAsResXmlItemValue());
|
||||
serializer.text(mItems[i].encodeAsResXmlNonEscapedItemValue());
|
||||
serializer.endTag(null, "item");
|
||||
}
|
||||
serializer.endTag(null, type);
|
||||
|
@ -57,6 +57,10 @@ public abstract class ResScalarValue extends ResValue implements
|
||||
return encodeAsResXmlValueExt().replace("@android:", "@*android:");
|
||||
}
|
||||
|
||||
public String encodeAsResXmlNonEscapedItemValue() throws AndrolibException {
|
||||
return encodeAsResXmlValue().replace("@android:", "@*android:").replace("&", "&").replace("<","<");
|
||||
}
|
||||
|
||||
public String encodeAsResXmlValueExt() throws AndrolibException {
|
||||
String rawValue = mRawValue;
|
||||
if (rawValue != null) {
|
||||
|
@ -5,6 +5,8 @@
|
||||
<item>TEST2</item>
|
||||
<item>TEST3</item>
|
||||
<item>%2$s foo %1$d</item>
|
||||
<item>http://google.com&boo=1&foo=2</item>
|
||||
<item><b>Bolded Text</b></item>
|
||||
</string-array>
|
||||
<integer-array name="test_array2">
|
||||
<item>-1</item>
|
||||
|
Reference in New Issue
Block a user