mirror of
https://github.com/revanced/Apktool.git
synced 2024-12-05 02:22:55 +01:00
Now one non positional substitution and one positional is detected as "multiple non positional".
This commit is contained in:
parent
14f26474e6
commit
d9cac893f9
@ -137,14 +137,16 @@ public final class ResXmlEncoders {
|
||||
}
|
||||
|
||||
public static boolean hasMultipleNonPositionalSubstitutions(String str) {
|
||||
return findSubstitutions(str, 2).m1.size() > 1;
|
||||
Duo<List<Integer>, List<Integer>> tuple = findSubstitutions(str, 2);
|
||||
return ! tuple.m1.isEmpty() && tuple.m1.size() + tuple.m2.size() > 1;
|
||||
}
|
||||
|
||||
public static String enumerateNonPositionalSubstitutionsIfRequired(String str) {
|
||||
List<Integer> subs = findSubstitutions(str, -1).m1;
|
||||
if (subs.size() < 2) {
|
||||
return str;
|
||||
}
|
||||
Duo<List<Integer>, List<Integer>> tuple = findSubstitutions(str, 2);
|
||||
if (tuple.m1.isEmpty() || tuple.m1.size() + tuple.m2.size() < 2) {
|
||||
return str;
|
||||
}
|
||||
List<Integer> subs = tuple.m1;
|
||||
|
||||
StringBuilder out = new StringBuilder();
|
||||
int pos = 0;
|
||||
|
@ -24,4 +24,5 @@ bar"</string>
|
||||
<string name="test_string22" formatted="false">%02d foo %01d</string>
|
||||
<string name="test_string23" formatted="false">%d foo %1</string>
|
||||
<string name="test_string24" formatted="false">%1% foo %2%</string>
|
||||
<string name="test_string25" formatted="false">foo %s bar %2$s baz</string>
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user