Search in sources :

Example 1 with Translator

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

the class JavaTranslator method testSystemClass.

public static void testSystemClass() {
    Translator translator = new JavaTranslator(Enum.class);
    translator.apply();
    System.out.print(translator);
}
Also used : Translator(com.google.classyshark.silverghost.translator.Translator)

Example 2 with Translator

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

the class StressTest method runAllClassesInDex.

public static void runAllClassesInDex(String jarCanonicalPath) throws Exception {
    DexFile dexFile = DexlibLoader.loadDexFile(new File(jarCanonicalPath));
    Set<? extends ClassDef> allClassesInDex = dexFile.getClasses();
    for (ClassDef currentClass : allClassesInDex) {
        String normType = DexlibAdapter.getClassStringFromDex(currentClass.getType());
        Translator sourceGenerator = TranslatorFactory.createTranslator(normType, new File(jarCanonicalPath));
        sourceGenerator.apply();
        System.out.println(sourceGenerator.toString());
    }
}
Also used : ClassDef(org.jf.dexlib2.iface.ClassDef) Translator(com.google.classyshark.silverghost.translator.Translator) DexFile(org.jf.dexlib2.iface.DexFile) File(java.io.File) DexFile(org.jf.dexlib2.iface.DexFile)

Example 3 with Translator

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

the class StressTest method runAllClassesInJar.

public static void runAllClassesInJar(String jarCanonicalPath) throws Exception {
    List<String> allStuff = JarReader.readClassNamesFromJar(new File(jarCanonicalPath), new LinkedList<ContentReader.Component>());
    for (String currentClass : allStuff) {
        Translator sourceGenerator = TranslatorFactory.createTranslator(currentClass, new File(jarCanonicalPath));
        sourceGenerator.apply();
        System.out.println(sourceGenerator.toString());
    }
}
Also used : Translator(com.google.classyshark.silverghost.translator.Translator) DexFile(org.jf.dexlib2.iface.DexFile) File(java.io.File)

Example 4 with Translator

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

the class JavaTranslator method testJar.

public static void testJar() {
    final File testFile = new File(System.getProperty("user.home") + "/Desktop/" + "ClassyShark.jar");
    String textClass = "com.google.classyshark.gui.panel.reducer.Reducer.class";
    Translator sourceGenerator = TranslatorFactory.createTranslator(textClass, testFile);
    sourceGenerator.apply();
    System.out.println(sourceGenerator.toString());
}
Also used : Translator(com.google.classyshark.silverghost.translator.Translator) File(java.io.File)

Example 5 with Translator

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

the class JavaTranslator method testCustomClass.

public static void testCustomClass() {
    final File testFile = new File(System.getProperty("user.home") + "/Desktop/Scenarios/2 Class/Reducer.class");
    String textClass = "com.google.classyshark.gui.panel.reducer.Reducer.class";
    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)

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