xx视频是一个在线观看视频的APP, 速度非常快, 清晰度也够看, 就是有点瑟瑟的广告, 今天闲着没事我瞅瞅他的api, 看能不能白嫖一波.
Android HttpCanary 抓包.
配置好 HttpCanary 后直接抓xx视频的包, 可以获取到 API 的请求情况, 但是他的 response 是经过加密的.



那接下来只能通过反编译 APP 来看看能不能找到解析方法.
反编译APK
直接丢进 jadx-gui, 很幸运, 这个 APP 好像只做了混淆处理, 直接就成功了.

定位请求
全局搜索 get_info
, 直接定位到 BrowserApiService
类, 通过这个类可以获取到所有的接口了.


右键查找用例,


好像看不出什么, 不过我看了下, 所有的接口返回的数据都是加密的, 所以估计是哪里统一做了处理.
看下请求接口上有一个 @FormUrlEncoded
注解, 咱们来搜索一下看看是什么类库的即可进一步追踪.

然后搜索 retrofit 解密



大概可以知道这个类库解密一般是通过添加 Interceptor
完成的. 接下来我们只需要找到这个 Interceptor
就可以了.
定位 Interceptor
全局搜索 .addInterceptor
, 这个是 retrofit
添加 Interceptor
的接口.

第一个就有收获了.

1 | OkHttpClient.Builder addInterceptor = RetrofitUrlManager.getInstance().with(new OkHttpClient.Builder()).cookieJar(new CookieJarImpl(new PersistentCookieStore(f4030d))).addInterceptor(new CacheInterceptor(f4030d)).addInterceptor(new BaseInterceptor(map)).sslSocketFactory(b()).hostnameVerifier(new c(null)).addInterceptor(new a(this)).addInterceptor(new LoggingInterceptor.Builder().loggable(false).setLevel(Level.BASIC).log(4).request("Request").response("Response").addHeader("log-header", "I am the log request header.").build()); |
查看解码实现
response
的处理一般看最后一个 Interceptor
, 直接进去看实现, 找到 chain.proceed(request)
类似获取 response
的处理:

看上去这个 c2
就是我们需要的解码结果, 点进去看看.



Java 复现测试
还好没有像智能公交那样使用 lib
库, 直接java copy
一下 ok
啦 ~~


咱们PP-Utils
又添加一个新能力了, 嘿嘿
接下来就是复刻他的请求了~~~
后续
这个APP关键的视频部分通过lib加壳了, 什么时候有时间再搞搞脱壳 哈哈