public static String getReferenceAnnotation(@Nonnull DexBackedDexFile dexFile, int stringIndex, boolean quote) { try { String string = dexFile.getString(stringIndex); if (quote) { string = String.format("\"%s\"", StringUtils.escapeString(string)); } return String.format("string_id_item[%d]: %s", stringIndex, string); } catch (Exception ex) { ex.printStackTrace(System.err); } return String.format("string_id_item[%d]", stringIndex); }
public static void writeStringReference(IndentingWriter writer, String item) throws IOException { writer.write('"'); StringUtils.writeEscapedString(writer, item); writer.write('"'); }
public static void writeTo(IndentingWriter writer, char val) throws IOException { writer.write('\''); StringUtils.writeEscapedChar(writer, val); writer.write('\''); } }
public static void writeStringReference(IndentingWriter writer, String item) throws IOException { writer.write('"'); StringUtils.writeEscapedString(writer, item); writer.write('"'); }
public static void writeTo(IndentingWriter writer, char val) throws IOException { writer.write('\''); StringUtils.writeEscapedChar(writer, val); writer.write('\''); } }
public static void writeStringReference(IndentingWriter writer, String item) throws IOException { writer.write('"'); StringUtils.writeEscapedString(writer, item); writer.write('"'); }
@Override public void annotateItem(@Nonnull AnnotatedBytes out, int itemIndex, @Nullable String itemIdentity) { int stringDataOffset = dexFile.readSmallUint(out.getCursor()); try { String stringValue = dexFile.getString(itemIndex); out.annotate(4, "string_data_item[0x%x]: \"%s\"", stringDataOffset, StringUtils.escapeString(stringValue)); return; } catch (Exception ex) { System.err.print("Error while resolving string value at index: "); System.err.print(itemIndex); ex.printStackTrace(System.err); } out.annotate(4, "string_id_item[0x%x]", stringDataOffset); } };
public static void writeTo(IndentingWriter writer, char val) throws IOException { writer.write('\''); StringUtils.writeEscapedChar(writer, val); writer.write('\''); } }
public static void writeStringReference(IndentingWriter writer, String item) throws IOException { writer.write('"'); StringUtils.writeEscapedString(writer, item); writer.write('"'); }
out.annotate(8, "magic: %s", StringUtils.escapeString(magicBuilder.toString())); out.annotate(4, "checksum"); out.annotate(20, "signature");
public static void writeTo(IndentingWriter writer, char val) throws IOException { writer.write('\''); StringUtils.writeEscapedChar(writer, val); writer.write('\''); } }
@Override public boolean writeTo(IndentingWriter writer) throws IOException { writer.write(".source"); if (sourceFile != null) { writer.write(" \""); StringUtils.writeEscapedString(writer, sourceFile); writer.write('"'); } return true; } }
public static String getReferenceAnnotation(@Nonnull DexBackedDexFile dexFile, int stringIndex, boolean quote) { try { String string = dexFile.getString(stringIndex); if (quote) { string = String.format("\"%s\"", StringUtils.escapeString(string)); } return String.format("string_id_item[%d]: %s", stringIndex, string); } catch (Exception ex) { ex.printStackTrace(System.err); } return String.format("string_id_item[%d]", stringIndex); }
private void writeSourceFile(IndentingWriter writer) throws IOException { String sourceFile = classDef.getSourceFile(); if (sourceFile != null) { writer.write(".source \""); StringUtils.writeEscapedString(writer, sourceFile); writer.write("\"\n"); } }
public static String getReferenceAnnotation(@Nonnull DexBackedDexFile dexFile, int stringIndex, boolean quote) { try { String string = dexFile.getString(stringIndex); if (quote) { string = String.format("\"%s\"", StringUtils.escapeString(string)); } return String.format("string_id_item[%d]: %s", stringIndex, string); } catch (Exception ex) { ex.printStackTrace(System.err); } return String.format("string_id_item[%d]", stringIndex); }
private void writeSourceFile(IndentingWriter writer) throws IOException { String sourceFile = classDef.getSourceFile(); if (sourceFile != null) { writer.write(".source \""); StringUtils.writeEscapedString(writer, sourceFile); writer.write("\"\n"); } }
@Override public void annotateItem(@Nonnull AnnotatedBytes out, int itemIndex, @Nullable String itemIdentity) { int stringDataOffset = dexFile.readSmallUint(out.getCursor()); try { String stringValue = dexFile.getString(itemIndex); out.annotate(4, "string_data_item[0x%x]: \"%s\"", stringDataOffset, StringUtils.escapeString(stringValue)); return; } catch (Exception ex) { System.err.print("Error while resolving string value at index: "); System.err.print(itemIndex); ex.printStackTrace(System.err); } out.annotate(4, "string_id_item[0x%x]", stringDataOffset); } };
@Override public boolean writeTo(IndentingWriter writer) throws IOException { writer.write(".source"); if (sourceFile != null) { writer.write(" \""); StringUtils.writeEscapedString(writer, sourceFile); writer.write('"'); } return true; } }
@Override public void annotateItem(@Nonnull AnnotatedBytes out, int itemIndex, @Nullable String itemIdentity) { int stringDataOffset = dexFile.readSmallUint(out.getCursor()); try { String stringValue = dexFile.getString(itemIndex); out.annotate(4, "string_data_item[0x%x]: \"%s\"", stringDataOffset, StringUtils.escapeString(stringValue)); return; } catch (Exception ex) { System.err.print("Error while resolving string value at index: "); System.err.print(itemIndex); ex.printStackTrace(System.err); } out.annotate(4, "string_id_item[0x%x]", stringDataOffset); } };
private void writeSourceFile(IndentingWriter writer) throws IOException { String sourceFile = classDef.getSourceFile(); if (sourceFile != null) { writer.write(".source \""); StringUtils.writeEscapedString(writer, sourceFile); writer.write("\"\n"); } }