Commit 42b78437 authored by tRuNKator's avatar tRuNKator Committed by skylot

fix: use quantity attribute for plurals (PR #486)

parent d5f42662
...@@ -15,6 +15,8 @@ import jadx.core.xmlgen.entry.RawNamedValue; ...@@ -15,6 +15,8 @@ import jadx.core.xmlgen.entry.RawNamedValue;
import jadx.core.xmlgen.entry.ResourceEntry; import jadx.core.xmlgen.entry.ResourceEntry;
import jadx.core.xmlgen.entry.ValuesParser; import jadx.core.xmlgen.entry.ValuesParser;
import static jadx.core.xmlgen.ParserConstants.PLURALS_MAP;
public class ResXmlGen { public class ResXmlGen {
private static final Set<String> SKIP_RES_TYPES = new HashSet<>(Arrays.asList( private static final Set<String> SKIP_RES_TYPES = new HashSet<>(Arrays.asList(
...@@ -147,16 +149,22 @@ public class ResXmlGen { ...@@ -147,16 +149,22 @@ public class ResXmlGen {
} }
} }
} }
if (typeName.equals("attr")) { switch (typeName) {
if (nameStr != null) { case "attr":
addSimpleValue(cw, typeName, itemTag, nameStr, valueStr, ""); if (nameStr != null)
} addSimpleValue(cw, typeName, itemTag, nameStr, valueStr, "");
} else if (typeName.equals("style")) { break;
if (nameStr != null) { case "style":
addSimpleValue(cw, typeName, itemTag, nameStr, "", valueStr); if (nameStr != null)
} addSimpleValue(cw, typeName, itemTag, nameStr, "", valueStr);
} else { break;
addSimpleValue(cw, typeName, itemTag, null, null, valueStr); case "plurals":
final String quantity = PLURALS_MAP.get(value.getNameRef());
addSimpleValue(cw, typeName, itemTag, "quantity", quantity, valueStr);
break;
default:
addSimpleValue(cw, typeName, itemTag, null, null, valueStr);
break;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment