Commit d86d07d9 authored by Administrator's avatar Administrator

扩展包

parent 85dca1e6
# ratel扩展开发包
ratel扩展开发包是一个工作在ratel框架之上的扩展开发包,对于ratel插件来说,他并不是必须的。ratel扩展包更多面对企业用户做app深度控制时使用。主要功能包括:
1. 流量拦截
2. ssl证书信任
3. UI自动化
扩展开发包的依赖如下:
```
dependencies {
compileOnly 'com.virjar:ratel-api:1.3.1'
implementation 'com.virjar:ratel-extersion:1.0.2'
}
```
## 流量拦截
流量拦截是ratel支持的一种基于socket对象监控的抓包方案。他可以直接拦截所有tcp流量,包括SSL。同时不需要考虑SSL证书,http代理无法生效等问题,并且在在抓包的同时,可以通过堆栈回溯方法知道网络流量的代码发送位置。本模块命名为SocketMonitor。
使用socketMonitor的方法很简单。通过注册网络事件监听函数即可:
```
SocketMonitor.setPacketEventObserver(dataModel -> {
try {
//抓包数据在dataModel中,处理你的抓包业务即可
} catch (Throwable throwable) {
throwable.printStackTrace();
}
});
```
当然,如果你只是想在日志文件里面记录所有的抓包结果,那么使用如下代码:
```
SocketMonitor.setPacketEventObserver(new FileLogEventObserver(context.getDir("socket_monitor", Context.MODE_PRIVATE)));
```
然后在socket_monitor文件夹下即可看到抓包数据
## ssl证书信任
这个没什么好说的,迁移了大名鼎鼎的JustTrustMe,实现SSL中间人攻击抓包证书检查问题。
```
JustTrustMe.trustAllCertificate();
```
## UI自动化
这个模块命名为SuperAppium,Appium是一个大名鼎鼎的UI自动化框架,主要给测试人员提供app测试case的功能。同时也有很多人基于Appium进行数据抓取,跑单等业务。
SuperAppium则是控制功能比Appium更强的一套自动化框架,他是基于ratel本身提供的上帝模式能力儿实现的。主要表现为以下特点:
1. 页面事件回调的异步序列调用。和Appium项目,SuperAppium的case编写,通过Activity生命周期挂钩。页面被加载会直接进入case操作函数。不需要类似Appium通过sleep等待,pull页面状态判断。其控制速度相对快很多
2. 进程内驱动,控制脱机。Appium的控制代码运行在PC之上,中间通过USB传输控制指令到手机中,其控制数据流为:python(PC)->appiumServer(PC)->USB->BootStrap.jar->UIAutoMator->AccessibilitySerivice->App。中间夸了两个主机,六个进程。整个链路太长,其实大规模使用极度不稳定。然后SuperAppium则是通过
......@@ -43,6 +43,11 @@ ratelManager的apk,在ratel server的首页有下载地址
# 发布记录
## 引擎发布记录
### V1.2.8
1. [bugfix] rebuild dex 模式下,cinit代码识别错误&强行继承了带final修饰的attachBaseContext方法导致facebook打开闪退
2. [improve] 移除ratel框架不支持的so
### V1.2.7
1. [improve] sync sandhook : disable forceProcessProfiles in Q
2. [bugfix] 存在弹窗情况下,无法自杀app问题
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment