mirror of
https://github.com/revanced/Apktool.git
synced 2024-12-12 05:47:46 +01:00
Prefix integers only exceeding 9 digits to treat as string
- This prevents small numbers like "1" to become "\ 1" - added unit tests - fixes #1130
This commit is contained in:
parent
e82ef1034a
commit
f3e21023ac
@ -71,5 +71,5 @@ public class ResStringValue extends ResScalarValue {
|
|||||||
return allDigits.matcher(val).matches() ? "\\ " + val : val;
|
return allDigits.matcher(val).matches() ? "\\ " + val : val;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Pattern allDigits = Pattern.compile("\\d+");
|
private static Pattern allDigits = Pattern.compile("\\d{9,}");
|
||||||
}
|
}
|
||||||
|
@ -181,6 +181,11 @@ public class BuildAndDecodeTest {
|
|||||||
compareXmlFiles("res/layout/issue1063.xml");
|
compareXmlFiles("res/layout/issue1063.xml");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void xmlSmallNumbersDontEscapeTest() throws BrutException {
|
||||||
|
compareXmlFiles("res/layout/issue1130.xml");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void qualifiersTest() throws BrutException {
|
public void qualifiersTest() throws BrutException {
|
||||||
compareValuesFiles("values-mcc004-mnc4-en-rUS-ldrtl-sw100dp-w200dp-h300dp"
|
compareValuesFiles("values-mcc004-mnc4-en-rUS-ldrtl-sw100dp-w200dp-h300dp"
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<TableLayout android:shrinkColumns="1" />
|
||||||
|
<TableLayout android:shrinkColumns="\ 2147483647" />
|
||||||
|
<TableLayout android:shrinkColumns="\ 2147483648" />
|
||||||
|
<TableLayout android:shrinkColumns="\ 555555555555555555" />
|
||||||
|
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user