Search in sources :

Example 1 with Reducer

use of com.google.classyshark.gui.panel.reducer.Reducer in project android-classyshark by google.

the class SilverGhost method readContents.

//                     1. READ CONTENTS
public void readContents() {
    contentReader = new ContentReader(getBinaryArchive());
    long start = System.currentTimeMillis();
    contentReader.load();
    reducer = new Reducer(contentReader.getAllClassNames());
    System.out.println("Archive Reading " + (System.currentTimeMillis() - start) + " ms ");
    if (binaryArchive.getName().endsWith(".apk")) {
        Translator translator = TranslatorFactory.createTranslator("AndroidManifest.xml", binaryArchive);
        translator.apply();
        manifestStr = translator.toString();
    }
    fullArchiveReader.readAsyncArchive(binaryArchive);
}
Also used : Translator(com.google.classyshark.silverghost.translator.Translator) ContentReader(com.google.classyshark.silverghost.contentreader.ContentReader) Reducer(com.google.classyshark.gui.panel.reducer.Reducer)

Example 2 with Reducer

use of com.google.classyshark.gui.panel.reducer.Reducer in project android-classyshark by google.

the class FilesTree method main.

public static void main(String[] args) {
    File test = new File(System.getProperty("user.home") + "/Desktop/ClassyShark/Scenarios/7 Jayce/data.jar");
    FilesTree filesTree = new FilesTree(null);
    ContentReader loader = new ContentReader(test);
    loader.load();
    Reducer reducer = new Reducer(loader.getAllClassNames());
    reducer.reduce("");
    filesTree.fillArchive(test, reducer.getAllClassNames(), loader.getAllComponents());
    for (String s : reducer.getAllClassNames()) {
        System.out.println(NodeInfo.extractClassName(s));
    }
    JFrame frame = new JFrame("Test");
    JScrollPane scrolledTree = new JScrollPane(filesTree.getJTree());
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(scrolledTree);
    frame.pack();
    frame.setVisible(true);
}
Also used : JScrollPane(javax.swing.JScrollPane) JFrame(javax.swing.JFrame) ContentReader(com.google.classyshark.silverghost.contentreader.ContentReader) Reducer(com.google.classyshark.gui.panel.reducer.Reducer) File(java.io.File)

Aggregations

Reducer (com.google.classyshark.gui.panel.reducer.Reducer)2 ContentReader (com.google.classyshark.silverghost.contentreader.ContentReader)2 Translator (com.google.classyshark.silverghost.translator.Translator)1 File (java.io.File)1 JFrame (javax.swing.JFrame)1 JScrollPane (javax.swing.JScrollPane)1