本来网上已有人搭好了相应DNS,也很方便可以使用的,可惜要付费几十大洋,摸摸口袋没钱只好自个本地搭建一个了。记录下搭建流程,省去同行找域名和文件结构的时间。
域名获取方式
本来不想写这个,因为没合适工具我的方式还是挺麻烦的。但毕竟折腾了那么久_
- 最先想到的是直接查路由器的记录,可惜用的垃圾路由器没这功能
- 接着是想用Fiddler、Charles之类的软件开代理捕获请求。可惜只有Macbook没法插网线,用蓝牙连接手机蓝牙共享网络,再开热点。可是蓝牙方式没法设置代理,无法捕获。
- 手机wifi连接电脑代理,然后在用wlan信号桥共享,可惜这种方式只有手机自身的请求能捕获,连接共享的车机请求不行。代理方式应该只针对本机有用,放弃了。
- 那就用DNS吧,电脑装了个dnsmasq,路由器、手机设置好dns,手机再开信号桥(好像只改路由器也行),车机操作,查日志,找到的域名一个个试,替换成本地服务器地址(本地还得搭个web服务器),看服务器日志拿到请求网址,再去原外网拿相应协议格式
域名格式
域名:api.xchanger.cn
关键接口
/i?app_key=903710721ec3a42d683bbe98f027c897851cd858×tamp=1580450713906&hour=14&dow=5&tz=480&sdk_version=18.04&sdk_name=java-native-android&session_duration=60&device_id=0AEM0B0032295199K86A0268&checksum=221cfb009cc97890f05cccfaede04bb1d4fb6543
确认权限和车型,直接请求缺少字段,导致后面借口也无返回/api/v1/banner/index
获取应用市场首页横幅,格式未知/api/v1/product/special
获取首页推荐列表,格式未知/api/v1/product/catalog
获取应用分类
{
"products":[
{
"alias":"",
"categoryId":"100", //分类ID
"description":"",
"image":"",
"metaDescription":"",
"metaKeyword":"",
"metaTitle":"",
"name":"第三方应用", //显示名称
"parentId":"0",
"sortOrder":"0",
"specs":"",
"status":"1",
"top":"0",
"typeid":"2"
}
]
}
/api/v1/product?categoryId=100
获取相应分类的应用列表,44为3中的categoryId
{
"products":[
{
"name":"QQ音乐", //显示名称
"wishlist":0,
"productId":1000,
"typeId":"2",
"manufacturer":"应用商自主开发",
"model":"APP-IHU-XMLY",
"reward":null,
"points":"0",
"description":"",
"specs":"",
"infoKeyword":"",
"infoDescription":"QQ音乐官方车载版",
"metaTitle":"",
"metaDescription":"",
"metaKeyword":"",
"stock":"1",
"image":"",
"images":[
{
"popup":"https://y.gtimg.cn/mediastyle/app/download/img/pc_v17/new_face.png"
}
],
"price":"¥0.00",
"priceNum":"0.0000",
"special":"",
"tax":"",
"discounts":[
],
"options":[
],
"minimum":"1",
"reviewStatus":"1",
"reviewGuest":0,
"customerName":"",
"reviews":"0 评论",
"rating":0,
"attributeGroups":{
"AppPackageName":"com.tencent.qqmusiccar", //包名
"AppSrc":"http://dldir1.qq.com/music/androidcar/qqmusiccar_1.9.5.18_android_release.apk", //下载地址
"AppVersionCode":"1090518",
"AppVersionName":"1.9.5.18",
"AppSize":"10.8M",
"AppDeveloper":"",
"AppUptime":"19-02-25",
"AppUpdetail":"",
"AppPath":"http://dldir1.qq.com/music/androidcar/qqmusiccar_1.9.5.18_android_release.apk", //下载地址
"AppDownnums":"0",
"AppStar":"",
"AppSystem":"0",
"platformVersion":"",
"isFree":"1",
"isGray":null
},
"products":[
],
"recurrings":[
]
}
],
"search":"",
"typeId":"1,3",
"description":"",
"category_id":"100",
"sub_category":"",
"sort":"p.sort_order",
"order":"ASC"
}
来源:CSDN
作者:lyzz0612
链接:https://blog.csdn.net/lyzz0612/article/details/104125073