You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ads>> ip com.isecpartners.android.jdwp.plugin.SSLBypassJDIPlugin
114
-
ads>> ip TestJythonPlugin
115
+
116
+
ads>> ip com.isecpartners.android.jdwp.plugin.SSLBypassJDIPlugin
117
+
ads>> ip TestJythonPlugin
115
118
116
119
117
120
After the plugin has been successfully initialized, do the action in the app that causes an SSL connection to be made. Breakpoints should be hit and handled via the initialized plugins.
@@ -143,37 +146,177 @@ without closing the app.
143
146
Building
144
147
==================
145
148
146
-
* Modify the properties in build.properties corresponding to locations of ddmlib and tools.jar on your filesystem
149
+
* Modify the properties in build.properties corresponding to locations of ddmlib
147
150
148
151
* ddmlib is found in the Android SDK at: android-sdk\tools\lib\ddmlib.jar
149
152
150
-
* tools.jar is found in the JDK libs, for example: C:/Program Files (x86)/Java/jdk1.7.0_05/lib/tools.jar
153
+
* Ensure that tools.jar can be found by setting JAVA_HOME to point to the JDK root directory
154
+
155
+
* tools.jar is found in the JDK lib dir, for example: C:/Program Files (x86)/Java/jdk1.7.0_05/lib/tools.jar
151
156
152
157
* Run the ant build file: build.xml
153
158
154
159
Testing
155
160
===================
156
161
157
-
* Run tests using the emulator
162
+
* Run tests using the emulator
158
163
159
-
* Install AndroidSSLBypassHelperApp
164
+
* Install AndroidSSLBypassHelperApp
160
165
161
-
* Install SSLTestApp
166
+
* Install SSLTestApp
162
167
163
-
* Setup proxy
168
+
* Setup proxy
164
169
165
-
* Right now SSLTestApp points to the host as seen from the emulator (10.0.2.2)
170
+
* Right now SSLTestApp points to the host as seen from the emulator (10.0.2.2)
166
171
167
-
* This is hardcoded for now, a better test app will be included in the future
168
-
169
-
* Follow the basic usage instructions for running SSLBypassJDIPlugin
172
+
* This is hardcoded for now, a better test app will be included in the future
173
+
174
+
* Follow the basic usage instructions for running SSLBypassJDIPlugin
170
175
171
-
Writing new plugins
172
-
===================
173
176
174
-
*TODO
177
+
Custom Jython Plugin Overview
178
+
=====================
179
+
180
+
This tool is rather poorly named "android-ssl-bypass" in that bypassing SSL is far from all it does. It was initally presented at conference where bypassing ssl was its main purpose. However, it was created to be an extensible debugging tool that can be used for a variety of debugging tasks. It might be more aptly named something like "android-debug-shell", and probably will be changed to that at some point. This aims to provide a basic guide for creating your own simple debugging plugins for the tool using Jython. The plugins can be written in Java as well, but Jython is the easiest method for extensibility.
181
+
182
+
The power of Jython is that it lets us easily use and Java classes in the classpath. So we can import the Java Class AbstractJDIPlugin and create a Python class which extends it in order to create a plugin that can be loaded by the tool. In the future when the APIs are more solid there will be real documentation, but for now there is only source code :). Some jargon:
A plugin must implement the abstract methods setupEvents() and handleEvent(Event). In the setupEvents method, the plugins creates and registers EventRequest objects using the convience methods provided by the Abstract JDIPlugin API, such as createBreakpointRequest(String locationString).
Now in the handleEvents(Event e) method we handle the events we just registered for. The tool works in a last in wins manner as far as two plugins trying to register for the same event (overall this feature is still in heavy dev so prepare for some bugs here when trying to load multiple plugins at once). Now we can do stuff with the Event object which is received by the function. In this case we know we are dealing with a BreakpointEvent (http://docs.oracle.com/javase/1.5.0/docs/guide/jpda/jdi/com/sun/jdi/event/BreakpointEvent.html) because that is all we registered. We can use the methods of the event to extract the current thread, frame, location, and method. From that we can obtain the local variables and much more.
Then we can choose to resume the event set which causes all threads to resume and the application continues execution.
242
+
243
+
self.resumeEventSet()
244
+
245
+
The plugin can then be used by attaching to the process, loading the plugins from the directory in which the Jython plugin is located, and initalizing the plugin. The following is an example debugging session from the example plugin in plugins/TestJythonPlugin:
0 commit comments