diff --git a/apktool-cli/src/main/java/brut/apktool/Main.java b/apktool-cli/src/main/java/brut/apktool/Main.java index acf36769..f343fb16 100644 --- a/apktool-cli/src/main/java/brut/apktool/Main.java +++ b/apktool-cli/src/main/java/brut/apktool/Main.java @@ -215,7 +215,7 @@ public class Main { "Copyright 2010 Ryszard Wiśniewski \n" + "with smali v" + ApktoolProperties.get("smaliVersion") + ", and baksmali v" + ApktoolProperties.get("baksmaliVersion") + "\n" + - "Updated by iBotPeaches (@iBotPeaches)\n" + + "Updated by iBotPeaches \n" + "Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n" + "\n" + "Usage: apktool [-q|--quiet OR -v|--verbose] COMMAND [...]\n" + diff --git a/apktool-lib/src/main/java/brut/androlib/res/data/value/ResReferenceValue.java b/apktool-lib/src/main/java/brut/androlib/res/data/value/ResReferenceValue.java index 469eccc0..d626e039 100644 --- a/apktool-lib/src/main/java/brut/androlib/res/data/value/ResReferenceValue.java +++ b/apktool-lib/src/main/java/brut/androlib/res/data/value/ResReferenceValue.java @@ -48,9 +48,12 @@ public class ResReferenceValue extends ResIntValue { spec.hasDefaultResource() && spec.getDefaultResource().getValue() instanceof ResIdValue; - return - (mTheme ? '?' : '@') + - (newId ? "+" : "") + + /* generate the beginning to fix @android */ + String mStart = (mTheme ? '?' : '@') + (newId ? "+" : ""); + // mStart = mStart.replace("@android", "@*android"); + + /* now dump back */ + return mStart + spec.getFullName(mPackage, mTheme && spec.getType().getName().equals("attr")); } 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 c293536a..9569d88d 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 @@ -41,18 +41,18 @@ public abstract class ResScalarValue extends ResValue if (mRawValue != null) { return mRawValue; } - return encodeAsResXml(); + return encodeAsResXml().replace("@android:", "@*android:"); } public String encodeAsResXmlItemValue() throws AndrolibException { - return encodeAsResXmlValue(); + return encodeAsResXmlValue().replace("@android:", "@*android:"); } public String encodeAsResXmlValue() throws AndrolibException { if (mRawValue != null) { return mRawValue; } - return encodeAsResXmlValueExt(); + return encodeAsResXmlValueExt().replace("@android:", "@*android:"); } public String encodeAsResXmlValueExt() throws AndrolibException { diff --git a/apktool-lib/src/test/resources/brut/apktool/testapp/res/values-mcc002/strings.xml b/apktool-lib/src/test/resources/brut/apktool/testapp/res/values-mcc002/strings.xml index 843a88ca..2017d36e 100644 --- a/apktool-lib/src/test/resources/brut/apktool/testapp/res/values-mcc002/strings.xml +++ b/apktool-lib/src/test/resources/brut/apktool/testapp/res/values-mcc002/strings.xml @@ -1,6 +1,6 @@ @string/test1 - @android:string/ok + @*android:string/ok ?android:textStyle diff --git a/apktool-lib/src/test/resources/brut/apktool/testapp/res/xml/references.xml b/apktool-lib/src/test/resources/brut/apktool/testapp/res/xml/references.xml index ebf6ed43..ac200d2b 100644 --- a/apktool-lib/src/test/resources/brut/apktool/testapp/res/xml/references.xml +++ b/apktool-lib/src/test/resources/brut/apktool/testapp/res/xml/references.xml @@ -1,6 +1,6 @@