Correctly escape any special characters in the value of the .source directive

git-svn-id: https://smali.googlecode.com/svn/trunk@811 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
jesusfreke@jesusfreke.com 2011-06-03 01:40:23 +00:00
parent a564a1733b
commit baa030c201
2 changed files with 4 additions and 2 deletions

View File

@ -28,6 +28,7 @@
package org.jf.baksmali.Adaptors;
import org.jf.dexlib.Util.Utf8Utils;
import org.jf.util.IndentingWriter;
import org.jf.dexlib.*;
import org.jf.dexlib.Code.Analysis.ValidationException;
@ -164,7 +165,7 @@ public class ClassDefinition {
StringIdItem sourceFile = classDefItem.getSourceFile();
if (sourceFile != null) {
writer.write(".source \"");
writer.write(sourceFile.getStringValue());
Utf8Utils.writeEscapedString(writer, sourceFile.getStringValue());
writer.write("\"\n");
}
}

View File

@ -28,6 +28,7 @@
package org.jf.baksmali.Adaptors;
import org.jf.dexlib.Util.Utf8Utils;
import org.jf.util.IndentingWriter;
import org.jf.dexlib.CodeItem;
import org.jf.dexlib.StringIdItem;
@ -116,7 +117,7 @@ public abstract class DebugMethodItem extends MethodItem {
protected static void writeSetFile(IndentingWriter writer, String fileName) throws IOException {
writer.write(".source \"");
writer.write(fileName);
Utf8Utils.writeEscapedString(writer, fileName);
writer.write('"');
}
}