Android Open Source - android-ssl-bypass A D B Interface






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;
//w ww .j  ava  2 s. c  o m
import org.apache.log4j.Logger;

import com.android.ddmlib.AndroidDebugBridge;
import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener;
import com.android.ddmlib.AndroidDebugBridge.IDebugBridgeChangeListener;
import com.android.ddmlib.AndroidDebugBridge.IDeviceChangeListener;
import com.android.ddmlib.Client;
import com.android.ddmlib.IDevice;

public class ADBInterface implements IDeviceChangeListener, IClientChangeListener, IDebugBridgeChangeListener {
  private final static org.apache.log4j.Logger LOGGER = Logger
      .getLogger(ADBInterface.class.getName());
  private IDevice[] devices;
  private IDevice currentDevice;
  private Client[] clients;
  private static ADBInterface sAdbInterface;
  
  public ADBInterface(){
    AndroidDebugBridge.init(true);
  }
  
  public static ADBInterface getInstance(){
    if(ADBInterface.sAdbInterface != null){
      return ADBInterface.sAdbInterface;
    }
    ADBInterface.sAdbInterface = new ADBInterface();
    return ADBInterface.sAdbInterface;
  }
  
  public void createBridge(String adbLocation){
    AndroidDebugBridge.createBridge(adbLocation, true);
    startDeviceListener();
    AndroidDebugBridge.addDebugBridgeChangeListener(sAdbInterface);
  }
  
  public IDevice[] getDevices(){
    devices = AndroidDebugBridge.getBridge().getDevices();
    return devices;
  }
  
  public Client[] getClients(){
    if(currentDevice != null){
      clients = currentDevice.getClients();
    }
    return clients;
  }

  @Override
  public void clientChanged(Client arg0, int arg1) {
    LOGGER.info("clientChanged: " + arg0);
  }

  @Override
  public void deviceChanged(IDevice arg0, int arg1) {
    LOGGER.info("deviceChanged: " + arg0);
    devices = AndroidDebugBridge.getBridge().getDevices();
  }

  @Override
  public void deviceConnected(IDevice arg0) {
    LOGGER.info("deviceConnected: " + arg0);
    devices = AndroidDebugBridge.getBridge().getDevices();
  }

  @Override
  public void deviceDisconnected(IDevice arg0) {
    LOGGER.info("deviceDisconnected: " + arg0);
  }

  public void setCurrentDevice(IDevice d) {
    for(IDevice dev: this.getDevices()){
      if(d.getName().equals(dev.getName())){
        currentDevice = dev;
        startClientListener();
        break;
      }
    }
  }

  public IDevice getCurrentDevice() {
    return currentDevice;
  }

  @Override
  public void bridgeChanged(AndroidDebugBridge arg0) {
    LOGGER.info("bridgeChanged: " + arg0);
    //TODO what should happn here?
    
  }
  
  private void startDeviceListener() {
    AndroidDebugBridge.addDeviceChangeListener(sAdbInterface);
    if (AndroidDebugBridge.getBridge().hasInitialDeviceList()) {
      devices = AndroidDebugBridge.getBridge().getDevices();
    }
  }

  private void startClientListener() {
    AndroidDebugBridge.addClientChangeListener(sAdbInterface);
    if (currentDevice != null) {
      clients = currentDevice.getClients();
    }

  }

}




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