Android Open Source - android-ssl-bypass Abstract Jython Console Plugin






From Project

Back to project page android-ssl-bypass.

License

The source code is released under:

Copyright (c) 2012, iSEC Partners. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the ...

If you think the Android project android-ssl-bypass listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.isecpartners.android.jdwp.pluginservice;
//from  w w  w .j  a  va2 s .  c om
import org.apache.log4j.Logger;
import org.python.core.PyObject;
import org.python.core.PySystemState;
import org.python.util.PythonInterpreter;

import com.isecpartners.android.jdwp.DalvikUtils;
import com.sun.jdi.event.Event;

public abstract class AbstractJythonConsolePlugin extends AbstractJDIPlugin {

  private final static org.apache.log4j.Logger LOGGER = Logger
      .getLogger(AbstractJythonConsolePlugin.class.getName());

  public AbstractJythonConsolePlugin(String name) {
    super(name);
  }
  /*
   * TODO this is a dirty hack which requires modifying the jython console code 
   * (credits: http://code.google.com/p/jythonconsole/) in order to close this thread
   * to get control back to the main commandline
   * Probably a better way to do this
   */
  public void consoleQuit(Event event) {
    AbstractJythonConsolePlugin.LOGGER.info("console quit called!");
    this.resumeEventSet();
  }

  @Override
  public void handleEvent(Event event) {
    AbstractJythonConsolePlugin.LOGGER.info("handling event: " + event);
    PySystemState.initialize();
    PythonInterpreter pyi = new PythonInterpreter();
    pyi.exec("import sys");
    pyi.exec("import os");
    // you can pass the python.path to java to avoid hardcoding this
    // java -Dpython.path=/path/to/jythonconsole-0.0.6 EmbedExample
    pyi.exec("con_path = os.path.abspath(r'jythonconsole/jythonconsole-0.0.7/')");
    pyi.exec("sys.path.append(con_path)");
    pyi.exec("from console import main");
    PyObject main = pyi.get("main");

    // stuff some objects into the namespace

    // TODO make an event wrapper object for easier console use?
    DalvikUtils dvmUtils = new DalvikUtils(event.virtualMachine(), 0);
    pyi.set("event", event);
    pyi.set("dvmUtils", dvmUtils);
    pyi.set("plugin", this);
    main.__call__(pyi.getLocals());
  }

  @Override
  public abstract void setupEvents();

}




Java Source Code List

com.isec.helperapp.EasySSLSocketFactory.java
com.isec.helperapp.EasyX509TrustManager.java
com.isec.helperapp.MainActivity.java
com.isec.helperapp.TrustAllTrustManager.java
com.isec.ssltest.SSLTestActivity.java
com.isecpartners.android.jdwp.ADBInterface.java
com.isecpartners.android.jdwp.ClassLoaderUtils.java
com.isecpartners.android.jdwp.ClassWrapper.java
com.isecpartners.android.jdwp.CommandLine.java
com.isecpartners.android.jdwp.Constants.java
com.isecpartners.android.jdwp.Control.java
com.isecpartners.android.jdwp.DalvikUtils.java
com.isecpartners.android.jdwp.DexClassLoaderNotFoundException.java
com.isecpartners.android.jdwp.LocationNotFoundException.java
com.isecpartners.android.jdwp.NoLoadClassMethodException.java
com.isecpartners.android.jdwp.NoVMSessionException.java
com.isecpartners.android.jdwp.NotImplementedException.java
com.isecpartners.android.jdwp.ReferenceTypeNotFoundException.java
com.isecpartners.android.jdwp.VirtualMachineEventManager.java
com.isecpartners.android.jdwp.VirtualMachineSession.java
com.isecpartners.android.jdwp.common.Message.java
com.isecpartners.android.jdwp.common.QueueAgentInterface.java
com.isecpartners.android.jdwp.common.QueueAgent.java
com.isecpartners.android.jdwp.connection.AbstractConnection.java
com.isecpartners.android.jdwp.connection.AttachingConnection.java
com.isecpartners.android.jdwp.connection.DVMConnectionProvider.java
com.isecpartners.android.jdwp.connection.DefaultConnectionFactory.java
com.isecpartners.android.jdwp.connection.NoAttachingConnectorException.java
com.isecpartners.android.jdwp.connection.NoListeningConnectorException.java
com.isecpartners.android.jdwp.plugin.JythonConsoleJDIPlugin.java
com.isecpartners.android.jdwp.plugin.SSLBypassJDIPlugin.java
com.isecpartners.android.jdwp.plugin.TestJDIPlugin.java
com.isecpartners.android.jdwp.plugin.TraceMethodsJDIPlugin.java
com.isecpartners.android.jdwp.pluginservice.AbstractJDIPlugin.java
com.isecpartners.android.jdwp.pluginservice.AbstractJythonConsolePlugin.java
com.isecpartners.android.jdwp.pluginservice.AbstractPluginService.java
com.isecpartners.android.jdwp.pluginservice.ClasspathUtils.java
com.isecpartners.android.jdwp.pluginservice.JDIPluginServiceFactory.java
com.isecpartners.android.jdwp.pluginservice.JDIPluginService.java
com.isecpartners.android.jdwp.pluginservice.JDIPlugin.java
com.isecpartners.android.jdwp.pluginservice.JythonPluginServiceFactory.java
com.isecpartners.android.jdwp.pluginservice.JythonPluginService.java
com.isecpartners.android.jdwp.pluginservice.PluginNotFoundException.java
com.isecpartners.android.jdwp.pluginservice.PluginService.java