From d82ace7cfe513a445d2635df654e8ebb71736ff9 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Thu, 3 May 2012 22:26:42 -0500 Subject: [PATCH] Fixed attrib switched with bug. xlif data w/ more than one fix ongoing. --- .../brut/androlib/res/data/value/ResScalarValue.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apktool-lib/src/main/java/brut/androlib/res/data/value/ResScalarValue.java b/apktool-lib/src/main/java/brut/androlib/res/data/value/ResScalarValue.java index 72c3ae11..2d255cfb 100644 --- a/apktool-lib/src/main/java/brut/androlib/res/data/value/ResScalarValue.java +++ b/apktool-lib/src/main/java/brut/androlib/res/data/value/ResScalarValue.java @@ -58,6 +58,15 @@ public abstract class ResScalarValue extends ResValue throws IOException, AndrolibException { String type = res.getResSpec().getType().getName(); boolean item = ! "reference".equals(mType) && ! type.equals(mType); + + String body = encodeAsResXmlValue(); + + /* check for resource reference */ + if (body.contains("@")){ + item = true; + } + + /* check for using attrib as node or item */ String tagName = item ? "item" : type; serializer.startTag(null, tagName); @@ -68,7 +77,6 @@ public abstract class ResScalarValue extends ResValue serializeExtraXmlAttrs(serializer, res); - String body = encodeAsResXmlValue(); if (! body.isEmpty()) { serializer.ignorableWhitespace(body); }