|
5 | 5 | ###[Demo APK下载](https://github.com/darkal/AndroidHttpCapture/blob/master/demo.apk)<br> <br><br> |
6 | 6 | 1. http抓包<br> |
7 | 7 | 当用户通过HttpInterceptor访问页面的时候,所有的http请求都会被记录下来,然后这些请求包可以预览、分享、上传(上传接口的网址需自行在MainActivity修改)。<br> |
8 | | -其中预览是请求包在本机的预览,可以查看请求的响应头和响应体(图片类无法查看响应体)<br> |
9 | | -分享支持分享到微信、分享到手Q等常见分享功能<br> |
| 8 | +####第一次进入程序需要安装CA证书以便进行HTTPS抓包(原理同fiddler,MITM中间人)<br> |
| 9 | +预览页面可以查看从APP启动起所有网络请求数据,实现了按分页过滤、URL搜索功能,并可清空所有数据包<br> |
| 10 | +预览的内容包括Request Header、Request Cookie、Request Content、Response Header、Response Cookie、Response Content<br> |
| 11 | +Content内容如果为JSON将会自动格式化显示<br> |
10 | 12 |  |
11 | | -<br><br> |
| 13 | +<br> |
| 14 | +分享功能将抓包生成的所有数据包打包为har文件并压缩为zip,支持分享到微信、QQ等<br><br> |
12 | 15 |
|
13 | 16 | 2. 环境切换<br> |
14 | 17 | 支持切换模拟为微信、手Q,默认为普通浏览器。<br> |
@@ -41,4 +44,38 @@ schema的协议格式为:jdhttpmonitor://webview?param={'url'='http://www.baid |
41 | 44 | 分享的http包格式后缀为.har,可以通过fiddler方式或者在线工具进行分析。<br> |
42 | 45 | Fiddler方式需要先将包导到电脑上,然后使用fiddler导入该包:Import Sessions->Select Import Format ->HTTPArchive ->选择包,即可<br> |
43 | 46 | 在线工具外网:http://h5.darkal.cn/har/<br> |
44 | | - 只需要将包拖入此工具即可分析<br> |
| 47 | + 只需要将包拖入此工具即可分析<br><br> |
| 48 | + |
| 49 | +三.致谢<br> |
| 50 | +AndroidHttpCapture基于Netty、browsermob-proxy来实现核心抓包的功能<br> |
| 51 | +Netty is an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients.<br> |
| 52 | +https://github.com/netty/netty<br> |
| 53 | +由于Aandroid5.0+不支持Provider 为JKS的证书,所以逆向修改了Netty库的证书部分适配Android系统(netty_android.jar)<br><br> |
| 54 | + |
| 55 | +A free utility to help web developers watch and manipulate network traffic from their AJAX applications.<br> |
| 56 | +https://github.com/lightbody/browsermob-proxy<br> |
| 57 | +修改了多处browsermob-proxy的源码适配Android系统<br> |
| 58 | +####目前遗留了一个Bug:信任所有的服务器证书不做校验<br><br> |
| 59 | + |
| 60 | +四.License<br> |
| 61 | +MIT License |
| 62 | + |
| 63 | +Copyright (c) 2016 AndroidHttpCapture |
| 64 | + |
| 65 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 66 | +of this software and associated documentation files (the "Software"), to deal |
| 67 | +in the Software without restriction, including without limitation the rights |
| 68 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 69 | +copies of the Software, and to permit persons to whom the Software is |
| 70 | +furnished to do so, subject to the following conditions: |
| 71 | + |
| 72 | +The above copyright notice and this permission notice shall be included in all |
| 73 | +copies or substantial portions of the Software. |
| 74 | + |
| 75 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 76 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 77 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 78 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 79 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 80 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 81 | +SOFTWARE. |
0 commit comments