mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-21 09:17:35 +01:00
ResStringValue: added support for strings which require formatted="false".
This commit is contained in:
parent
99882396b9
commit
9fd97ca9a5
@ -17,7 +17,10 @@
|
||||
package brut.androlib.res.data.value;
|
||||
|
||||
import brut.androlib.AndrolibException;
|
||||
import brut.androlib.res.data.ResResource;
|
||||
import brut.androlib.res.xml.ResXmlEncoders;
|
||||
import java.io.IOException;
|
||||
import org.xmlpull.v1.XmlSerializer;
|
||||
|
||||
/**
|
||||
* @author Ryszard Wiśniewski <brut.alll@gmail.com>
|
||||
@ -46,4 +49,19 @@ public class ResStringValue extends ResScalarValue {
|
||||
protected String encodeAsResXml() throws AndrolibException {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void serializeExtraXmlAttrs(XmlSerializer serializer,
|
||||
ResResource res) throws IOException {
|
||||
int pos = 0;
|
||||
int count = 0;
|
||||
while((pos = mRawValue.indexOf('%', pos)) != -1) {
|
||||
if (mRawValue.charAt(pos + 1) != '%') {
|
||||
if (++count >= 2) {
|
||||
serializer.attribute(null, "formatted", "false");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user