chaos-fake/main.go

138 lines
3.0 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package main
import (
"github.com/kataras/iris"
"github.com/kataras/iris/middleware/logger"
)
func main() {
app := iris.New()
// log必须在错误容器上方否则会失效
app.Use(logger.New(logger.DefaultConfig()))
app.OnErrorCode(iris.StatusNotFound, func(ctx iris.Context) {
ctx.Application().Logger().Infof("%s %s Notfound", ctx.Method(), ctx.Path())
})
app.Any("/ServerV60", func(ctx iris.Context) {
switch ctx.FormValue("fn") {
case "clonelog": // 关键是否可以开启模拟的app
ctx.JSON(map[string]interface{}{
"msg": "",
})
return
case "apkplug": // 关键:是否启用机型模拟等功能
ctx.JSON(map[string]interface{}{
"err": "",
"d": 0,
"l": 0,
})
return
case "it":
ctx.JSON(map[string]interface{}{
"err": "",
"kf": "客服QQ:2023828192",
"pay": 1,
"pays": 1,
"xwPay": 0,
"zfbPay": 1,
"hp": 0,
"hb": 1,
"pm": 0,
"sa": 1,
"savip": 1,
"son": 1,
"nv": 120,
"jgs": false,
"jgr": false,
"zd": 0,
"zdd": 0,
"qt": 0,
"yz": "W2e8ajuM2KLM0ULzptXILw==",
"au": "http://chaos.91ishare.cn/active_detail.html?t=12",
"au1": "http://chaos.91ishare.cn/active_detail_new.html?t=12",
"adp": "111",
"os": []interface{}{
map[string]interface{}{
"i": 202,
"n": "11.0稳定版",
"d": "1、解决部分APP分身兼容性问题<br/>2、插件完全免费使用",
"t": 0,
"u": "http://dkplat.cn-gd.ufileos.com/res_202",
"tv": "",
},
},
"rgps": "http://chaos.91ishare.cn/",
"gdd": 4,
"gdl": 4,
"st": 1563965353230,
"ud": 16273595,
"m": "13286138576",
"et": 0,
"iv": 0,
"fk": 0,
"fc": 0,
"wk": 1,
"tk": "hZgFmltcBo7yACnSFyWu8U49f1CpBlD0pG2m6ne4jrg=",
"pt": 0,
})
return
default:
ctx.StatusCode(iris.StatusNotFound)
ctx.WriteString("fn Not Found")
return
}
})
app.Any("/update/config.json", func(ctx iris.Context) {
ctx.JSON(map[string]interface{}{
"url": "",
"verName": 7.7,
"verCode": 77,
"s": 0,
"desc": "test",
"v": 77,
"bt1": "",
"bt2": "",
})
})
app.Any("/update/kefu.json", func(ctx iris.Context) {
ctx.JSON(map[string]interface{}{
"s": 0,
"st": "",
"et": "",
"t": "",
"d": "s",
"act": "",
})
})
app.Any("/ServerV64", func(ctx iris.Context) {
switch ctx.FormValue("fn") {
case "at":
ctx.JSON(map[string]interface{}{
"l": []interface{}{},
"err": 0,
})
return
case "is":
ctx.JSON(map[string]interface{}{
"is": false,
"err": "",
})
return
default:
ctx.StatusCode(iris.StatusNotFound)
ctx.WriteString("Not Found")
return
}
})
app.Any("/active_detail.html", func(ctx iris.Context) {
ctx.WriteString("<!DOCTYPE html><html><head><title>活动详情</title></head><body>活动</body></html>")
})
app.Run(iris.Addr(":8081"))
}