Search in sources :

Example 11 with Translator

use of com.google.classyshark.silverghost.translator.Translator in project android-classyshark by google.

the class MetaObjectDex method main.

public static void main(String[] args) throws Exception {
    final File testFile = new File(System.getProperty("user.home") + "/Desktop/classes.dex");
    String textClass = "com.google.common.collect.ImmutableSortedMap";
    Translator translator = TranslatorFactory.createTranslator(textClass, testFile);
    translator.apply();
    System.out.println(translator.toString());
}
Also used : Translator(com.google.classyshark.silverghost.translator.Translator) File(java.io.File)

Example 12 with Translator

use of com.google.classyshark.silverghost.translator.Translator in project android-classyshark by google.

the class SilverGhostFacade method getManifest.

public static String getManifest(File archiveFile) {
    if (!archiveFile.getName().endsWith(".apk")) {
        return "";
    }
    Translator translator = TranslatorFactory.createTranslator("AndroidManifest.xml", archiveFile);
    translator.apply();
    return translator.toString();
}
Also used : Translator(com.google.classyshark.silverghost.translator.Translator) ApkTranslator(com.google.classyshark.silverghost.translator.apk.ApkTranslator)

Example 13 with Translator

use of com.google.classyshark.silverghost.translator.Translator in project android-classyshark by google.

the class SilverGhostFacade method getGeneratedClassString.

public static String getGeneratedClassString(String className, File archiveFile) {
    String result;
    Translator translator = TranslatorFactory.createTranslator(className, archiveFile, getAllClassNames(archiveFile));
    try {
        translator.apply();
        result = translator.toString();
    } catch (NullPointerException npe) {
        System.out.println("Class doesn't exist in the writeArchive");
        return "";
    }
    return result;
}
Also used : Translator(com.google.classyshark.silverghost.translator.Translator) ApkTranslator(com.google.classyshark.silverghost.translator.apk.ApkTranslator)

Example 14 with Translator

use of com.google.classyshark.silverghost.translator.Translator in project android-classyshark by google.

the class DisplayArea method main.

public static void main(String[] args) {
    DisplayArea da = new DisplayArea(null);
    Translator emitter = new JavaTranslator(StringTokenizer.class);
    emitter.apply();
    da.displayClass(emitter.getElementsList(), "");
    JFrame frame = new JFrame("Test");
    frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    frame.getContentPane().add(da.onAddComponentToPane());
    frame.pack();
    frame.setVisible(true);
}
Also used : Translator(com.google.classyshark.silverghost.translator.Translator) JavaTranslator(com.google.classyshark.silverghost.translator.java.JavaTranslator) JFrame(javax.swing.JFrame) JavaTranslator(com.google.classyshark.silverghost.translator.java.JavaTranslator)

Aggregations

Translator (com.google.classyshark.silverghost.translator.Translator)14 File (java.io.File)8 ApkTranslator (com.google.classyshark.silverghost.translator.apk.ApkTranslator)4 DexFile (org.jf.dexlib2.iface.DexFile)2 Reducer (com.google.classyshark.gui.panel.reducer.Reducer)1 ContentReader (com.google.classyshark.silverghost.contentreader.ContentReader)1 JavaTranslator (com.google.classyshark.silverghost.translator.java.JavaTranslator)1 JFrame (javax.swing.JFrame)1 ClassDef (org.jf.dexlib2.iface.ClassDef)1