从网络请求中可以看到接口请求中有对传递的参数签名,
通过反编译团油apk,可以从源码中找到接口签名方法和参数。
反编译安卓需要用到的三件套 apktool、dex2jar2.0、jd-gui , 网上下载好,按说明操作即可
# app_key
app4.0.2_android
# app_secret
2674614042c372d9d9179d9769781a04
# 签名方法
app_secret + 参数按字母排序后连接名和值 + app_secret , MD5-32位小
> sign = md5(2674614042c372d9d9179d9769781a04app_keyapp4.0.2_androidapp_version6.3.6shumeiIDtimestamp1615942421019token6d681475ecc94320a07c9183faa038052674614042c372d9d9179d9769781a04)
除sign外所有请求参数都要参与签名,关键参数说明:
timestamp 当前时间戳13位
token 登录token,一段时间可能失效,需要重新获取
userLatStr 位置维度,高德坐标系
userLngStr 位置经度
# 查询参数设置
https://acs.czb365.com/services/v3/user/getOilPrefer
sign=f2bd822bffdf543381ffafbe26cdbd11&app_key=app4.0.2_android×tamp=1615942421019&app_version=6.3.6&shumeiID=&token=6d681475ecc94320a07c9183faa03805
# 油站列表
https://acs.czb365.com/services/v3/gas/mapGasInfoListPage/4.0
sign=405d29a0d4e30ecdffc742d99d229344&app_key=app4.0.2_android×tamp=1615942424861&app_version=6.3.6&shumeiID=&userLatStr=37.747033236114014&userLngStr=112.72527001425678&oilNo=92&sort=0&pageIndex=1&pageSize=10&range=6&brandTypes=2%2C3%2C5%2C48%2C36%2C38%2C11%2C10%2C14%2C43%2C28%2C8%2C9%2C47%2C45%2C30%2C57%2C71%2C55%2C4&channelId=0&cityCode=0354&isRecommend=0&token=6d681475ecc94320a07c9183faa03805
## 油站全量列表
https://mcs.czb365.com/services/v3/gas/queryGasInfoListOilNoNew
sign=9ec2759d0c617ac377495c4db89e6ad3&app_key=app4.0.2_android×tamp=1615969234640&channelId=98633339
# 油站信息
POST https://acs.czb365.com/services/v3/gas/getGasGunOilInfoV2/4.0 HTTP/1.1
Content-Type: multipart/form-data; boundary=1c8df50d-416f-4271-ad79-830ce1ecaa3f
Content-Length: 1281
Host: acs.czb365.com
Connection: Keep-Alive
Accept-Encoding: gzip
Cookie: sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%2262314951%22%2C%22%24device_id%22%3A%22178353a07db107-09031b3b8eaa5d-760c4521-409920-178353a07dc44c%22%2C%22props%22%3A%7B%22%24latest_referrer%22%3A%22%22%2C%22%24latest_referrer_host%22%3A%22%22%2C%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%7D%2C%22first_id%22%3A%22178353a07db107-09031b3b8eaa5d-760c4521-409920-178353a07dc44c%22%7D; acw_tc=2760829316159424292134769e5cee1b4771f7dc191db977258c6ac1dbb8ce; JSESSIONID=D7DD7989A044FE5BBE17FAC658A13D45
User-Agent: okhttp/3.14.9
--1c8df50d-416f-4271-ad79-830ce1ecaa3f
content-disposition: form-data; name="app_mode"
Content-Length: 5
false
--1c8df50d-416f-4271-ad79-830ce1ecaa3f
content-disposition: form-data; name="shumeiID"
Content-Length: 0
--1c8df50d-416f-4271-ad79-830ce1ecaa3f
content-disposition: form-data; name="token"
Content-Length: 32
6d681475ecc94320a07c9183faa03805
--1c8df50d-416f-4271-ad79-830ce1ecaa3f
content-disposition: form-data; name="app_version"
Content-Length: 5
6.3.6
--1c8df50d-416f-4271-ad79-830ce1ecaa3f
content-disposition: form-data; name="app_channel"
Content-Length: 4
b360
--1c8df50d-416f-4271-ad79-830ce1ecaa3f
content-disposition: form-data; name="timestamp"
Content-Length: 13
1615943200318
--1c8df50d-416f-4271-ad79-830ce1ecaa3f
content-disposition: form-data; name="app_key"
Content-Length: 16
app4.0.2_android
--1c8df50d-416f-4271-ad79-830ce1ecaa3f
content-disposition: form-data; name="gasId"
Content-Length: 11
HC000018935
--1c8df50d-416f-4271-ad79-830ce1ecaa3f
content-disposition: form-data; name="isRn"
Content-Length: 4
true
--1c8df50d-416f-4271-ad79-830ce1ecaa3f
content-disposition: form-data; name="sign"
Content-Length: 32
da27366f74039462d4d9a8eb1faab447
--1c8df50d-416f-4271-ad79-830ce1ecaa3f--
# 油价详情
POST https://acs.czb365.com/services/v3/gas/getGasInfoDetailV3 HTTP/1.1
Content-Type: multipart/form-data; boundary=e496e263-87fa-400f-bc9e-e5fd5d8b8493
Content-Length: 1953
Host: acs.czb365.com
Connection: Keep-Alive
Accept-Encoding: gzip
Cookie: sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%2262314951%22%2C%22%24device_id%22%3A%22178353a07db107-09031b3b8eaa5d-760c4521-409920-178353a07dc44c%22%2C%22props%22%3A%7B%22%24latest_referrer%22%3A%22%22%2C%22%24latest_referrer_host%22%3A%22%22%2C%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%7D%2C%22first_id%22%3A%22178353a07db107-09031b3b8eaa5d-760c4521-409920-178353a07dc44c%22%7D; acw_tc=2760829316159424292134769e5cee1b4771f7dc191db977258c6ac1dbb8ce; JSESSIONID=DFE987A811B09821F4D89CD9C76B55E4
User-Agent: okhttp/3.14.9
--e496e263-87fa-400f-bc9e-e5fd5d8b8493
content-disposition: form-data; name="app_mode"
Content-Length: 5
false
--e496e263-87fa-400f-bc9e-e5fd5d8b8493
content-disposition: form-data; name="shumeiID"
Content-Length: 0
--e496e263-87fa-400f-bc9e-e5fd5d8b8493
content-disposition: form-data; name="token"
Content-Length: 32
6d681475ecc94320a07c9183faa03805
--e496e263-87fa-400f-bc9e-e5fd5d8b8493
content-disposition: form-data; name="app_version"
Content-Length: 5
6.3.6
--e496e263-87fa-400f-bc9e-e5fd5d8b8493
content-disposition: form-data; name="app_channel"
Content-Length: 4
b360
--e496e263-87fa-400f-bc9e-e5fd5d8b8493
content-disposition: form-data; name="timestamp"
Content-Length: 13
1615943201871
--e496e263-87fa-400f-bc9e-e5fd5d8b8493
content-disposition: form-data; name="app_key"
Content-Length: 16
app4.0.2_android
--e496e263-87fa-400f-bc9e-e5fd5d8b8493
content-disposition: form-data; name="gasId"
Content-Length: 11
HC000018935
--e496e263-87fa-400f-bc9e-e5fd5d8b8493
content-disposition: form-data; name="oilNo"
Content-Length: 2
92
--e496e263-87fa-400f-bc9e-e5fd5d8b8493
content-disposition: form-data; name="userLatStr"
Content-Length: 18
37.747033236114014
--e496e263-87fa-400f-bc9e-e5fd5d8b8493
content-disposition: form-data; name="userLngStr"
Content-Length: 18
112.72527001425678
--e496e263-87fa-400f-bc9e-e5fd5d8b8493
content-disposition: form-data; name="cityCode"
Content-Length: 4
0354
--e496e263-87fa-400f-bc9e-e5fd5d8b8493
content-disposition: form-data; name="pageToken"
Content-Length: 65
com.czb.chezhubang.base.rncore.view.BaseReactRootActivity@a70ea7e
--e496e263-87fa-400f-bc9e-e5fd5d8b8493
content-disposition: form-data; name="isRn"
Content-Length: 4
true
--e496e263-87fa-400f-bc9e-e5fd5d8b8493
content-disposition: form-data; name="sign"
Content-Length: 32
72a0a6bb1e627e5561861f52c6a1fd3d
--e496e263-87fa-400f-bc9e-e5fd5d8b8493--
> https://acs.czb365.com/services/v3/gas/getGasInfoDetailV3?app_key=app4.0.2_android×tamp=1615970274645&sign=62dde52bab6945ac12e618efca09a002&channelId=98633339&gasId=HC000018935&token=6d681475ecc94320a07c9183faa03805