diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/xml/ResXmlEncoders.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/xml/ResXmlEncoders.java index ec1d7afe..1c847a0c 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/xml/ResXmlEncoders.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/xml/ResXmlEncoders.java @@ -175,6 +175,7 @@ public final class ResXmlEncoders { while ((pos = str.indexOf('%', pos2)) != -1) { pos2 = pos + 1; if (pos2 == length) { + nonPositional.add(pos); break; } char c = str.charAt(pos2++); diff --git a/brut.apktool/apktool-lib/src/test/resources/brut/apktool/testapp/res/values-mcc001/strings.xml b/brut.apktool/apktool-lib/src/test/resources/brut/apktool/testapp/res/values-mcc001/strings.xml index 6beed51c..cb0e70a2 100644 --- a/brut.apktool/apktool-lib/src/test/resources/brut/apktool/testapp/res/values-mcc001/strings.xml +++ b/brut.apktool/apktool-lib/src/test/resources/brut/apktool/testapp/res/values-mcc001/strings.xml @@ -17,7 +17,7 @@ bar" foobar"b az"foo %d of %d - foo %d bar % + foo %d bar % %2$s foo %1$d %-e foo %,d %2$-e foo %1$,d