fixing system. fixes #8

This commit is contained in:
Connor Tumbleson 2012-09-01 23:46:26 -05:00
parent 38ed873aa3
commit 24a66fdbe1
5 changed files with 12 additions and 9 deletions

View File

@ -215,7 +215,7 @@ public class Main {
"Copyright 2010 Ryszard Wiśniewski <brut.alll@gmail.com>\n" + "Copyright 2010 Ryszard Wiśniewski <brut.alll@gmail.com>\n" +
"with smali v" + ApktoolProperties.get("smaliVersion") + "with smali v" + ApktoolProperties.get("smaliVersion") +
", and baksmali v" + ApktoolProperties.get("baksmaliVersion") + "\n" + ", and baksmali v" + ApktoolProperties.get("baksmaliVersion") + "\n" +
"Updated by iBotPeaches (@iBotPeaches)\n" + "Updated by iBotPeaches <connor.tumbleson@gmail.com> \n" +
"Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n" + "Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n" +
"\n" + "\n" +
"Usage: apktool [-q|--quiet OR -v|--verbose] COMMAND [...]\n" + "Usage: apktool [-q|--quiet OR -v|--verbose] COMMAND [...]\n" +

View File

@ -48,9 +48,12 @@ public class ResReferenceValue extends ResIntValue {
spec.hasDefaultResource() && spec.hasDefaultResource() &&
spec.getDefaultResource().getValue() instanceof ResIdValue; spec.getDefaultResource().getValue() instanceof ResIdValue;
return /* generate the beginning to fix @android */
(mTheme ? '?' : '@') + String mStart = (mTheme ? '?' : '@') + (newId ? "+" : "");
(newId ? "+" : "") + // mStart = mStart.replace("@android", "@*android");
/* now dump back */
return mStart +
spec.getFullName(mPackage, spec.getFullName(mPackage,
mTheme && spec.getType().getName().equals("attr")); mTheme && spec.getType().getName().equals("attr"));
} }

View File

@ -41,18 +41,18 @@ public abstract class ResScalarValue extends ResValue
if (mRawValue != null) { if (mRawValue != null) {
return mRawValue; return mRawValue;
} }
return encodeAsResXml(); return encodeAsResXml().replace("@android:", "@*android:");
} }
public String encodeAsResXmlItemValue() throws AndrolibException { public String encodeAsResXmlItemValue() throws AndrolibException {
return encodeAsResXmlValue(); return encodeAsResXmlValue().replace("@android:", "@*android:");
} }
public String encodeAsResXmlValue() throws AndrolibException { public String encodeAsResXmlValue() throws AndrolibException {
if (mRawValue != null) { if (mRawValue != null) {
return mRawValue; return mRawValue;
} }
return encodeAsResXmlValueExt(); return encodeAsResXmlValueExt().replace("@android:", "@*android:");
} }
public String encodeAsResXmlValueExt() throws AndrolibException { public String encodeAsResXmlValueExt() throws AndrolibException {

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="test_reference1">@string/test1</string> <string name="test_reference1">@string/test1</string>
<string name="test_reference2">@android:string/ok</string> <string name="test_reference2">@*android:string/ok</string>
<string name="test_reference3">?android:textStyle</string> <string name="test_reference3">?android:textStyle</string>
</resources> </resources>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<View xmlns:android="http://schemas.android.com/apk/res/android" <View xmlns:android="http://schemas.android.com/apk/res/android"
test1="@string/test1" test1="@string/test1"
test2="@android:string/ok" test2="@*android:string/ok"
test3="?android:textStyle" test3="?android:textStyle"
/> />