mirror of
https://github.com/revanced/smali.git
synced 2025-05-29 12:20:11 +02:00
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:
parent
a564a1733b
commit
baa030c201
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
package org.jf.baksmali.Adaptors;
|
package org.jf.baksmali.Adaptors;
|
||||||
|
|
||||||
|
import org.jf.dexlib.Util.Utf8Utils;
|
||||||
import org.jf.util.IndentingWriter;
|
import org.jf.util.IndentingWriter;
|
||||||
import org.jf.dexlib.*;
|
import org.jf.dexlib.*;
|
||||||
import org.jf.dexlib.Code.Analysis.ValidationException;
|
import org.jf.dexlib.Code.Analysis.ValidationException;
|
||||||
@ -164,7 +165,7 @@ public class ClassDefinition {
|
|||||||
StringIdItem sourceFile = classDefItem.getSourceFile();
|
StringIdItem sourceFile = classDefItem.getSourceFile();
|
||||||
if (sourceFile != null) {
|
if (sourceFile != null) {
|
||||||
writer.write(".source \"");
|
writer.write(".source \"");
|
||||||
writer.write(sourceFile.getStringValue());
|
Utf8Utils.writeEscapedString(writer, sourceFile.getStringValue());
|
||||||
writer.write("\"\n");
|
writer.write("\"\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
package org.jf.baksmali.Adaptors;
|
package org.jf.baksmali.Adaptors;
|
||||||
|
|
||||||
|
import org.jf.dexlib.Util.Utf8Utils;
|
||||||
import org.jf.util.IndentingWriter;
|
import org.jf.util.IndentingWriter;
|
||||||
import org.jf.dexlib.CodeItem;
|
import org.jf.dexlib.CodeItem;
|
||||||
import org.jf.dexlib.StringIdItem;
|
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 {
|
protected static void writeSetFile(IndentingWriter writer, String fileName) throws IOException {
|
||||||
writer.write(".source \"");
|
writer.write(".source \"");
|
||||||
writer.write(fileName);
|
Utf8Utils.writeEscapedString(writer, fileName);
|
||||||
writer.write('"');
|
writer.write('"');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user