diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/value/ResStringValue.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/value/ResStringValue.java index 94f568c8..5a07bde1 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/value/ResStringValue.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/value/ResStringValue.java @@ -71,5 +71,5 @@ public class ResStringValue extends ResScalarValue { return allDigits.matcher(val).matches() ? "\\ " + val : val; } - private static Pattern allDigits = Pattern.compile("\\d+"); + private static Pattern allDigits = Pattern.compile("\\d{9,}"); } diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/BuildAndDecodeTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/BuildAndDecodeTest.java index 22fc2f3d..b2144c81 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/BuildAndDecodeTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/BuildAndDecodeTest.java @@ -181,6 +181,11 @@ public class BuildAndDecodeTest { compareXmlFiles("res/layout/issue1063.xml"); } + @Test + public void xmlSmallNumbersDontEscapeTest() throws BrutException { + compareXmlFiles("res/layout/issue1130.xml"); + } + @Test public void qualifiersTest() throws BrutException { compareValuesFiles("values-mcc004-mnc4-en-rUS-ldrtl-sw100dp-w200dp-h300dp" diff --git a/brut.apktool/apktool-lib/src/test/resources/brut/apktool/testapp/res/layout/issue1130.xml b/brut.apktool/apktool-lib/src/test/resources/brut/apktool/testapp/res/layout/issue1130.xml new file mode 100644 index 00000000..ce05fbc3 --- /dev/null +++ b/brut.apktool/apktool-lib/src/test/resources/brut/apktool/testapp/res/layout/issue1130.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file