|
@@ -1,59 +1,46 @@
|
|
|
-import cn.qqck.kotlin.tools.*
|
|
|
-import dev.botta.json.values.JsonValue
|
|
|
-import okhttp3.MediaType.Companion.toMediaType
|
|
|
-import okhttp3.RequestBody.Companion.toRequestBody
|
|
|
+import cn.qqck.kotlin.tools.Rand
|
|
|
+import cn.qqck.kotlin.tools.fget
|
|
|
+import cn.qqck.kotlin.tools.fset
|
|
|
+import cn.qqck.kotlin.tools.string
|
|
|
|
|
|
fun main() {
|
|
|
- println(Date.day(1))
|
|
|
- println("192.168.1.1".isIpv4())
|
|
|
- println("2409:8c1e:75b0:1120::16".isIpv6())
|
|
|
- println("fe80::1ff:fe23:4567:890a".isIpv6())
|
|
|
+ // println("Date.day(1)".toIntOrNull())
|
|
|
+ // println("192.168.1.1".isIpv4())
|
|
|
+ // println("2409:8c1e:75b0:1120::16".isIpv6())
|
|
|
+ // println("fe80::1ff:fe23:4567:890a".isIpv6())
|
|
|
+ // println(Android.random())
|
|
|
// println(register_queue.isNet())
|
|
|
// register_queue.get()
|
|
|
+ ggcz_用户()
|
|
|
}
|
|
|
|
|
|
-fun ggcz(): JsonValue? {
|
|
|
-
|
|
|
- val proxy = Proxy.Info("39.101.128.132", 801, "tx004", "110110")
|
|
|
-
|
|
|
- val j_serverip = "1.13.162.140"
|
|
|
- val j_uid = "3X6W6rkeRhS7GauNNeu5As8E7t2NORlVu4y4J58X4d16WosyvZuLU9dhcPd4xRBE98m9"
|
|
|
- val j_post = "aid=2031242339&代理地址=${"${proxy.addr}:${proxy.port}"}&代理类型=${
|
|
|
- when (proxy.type) {
|
|
|
- Proxy.Type.Http -> 0
|
|
|
- Proxy.Type.Socks5 -> 1
|
|
|
- else -> 0
|
|
|
- }
|
|
|
- }&代理账号=${proxy.user}&代理密码=${proxy.pass}".toRequestBody("application/x-www-form-urlencoded".toMediaType())
|
|
|
- for (j_i in 0..2) {
|
|
|
- var j_url = "http://${j_serverip}/api/腾讯QQ/图形验证码/任务列表/创建任务?token=${j_uid}"
|
|
|
- val j_data = Okhttp.call(j_url) { it.post(j_post) }?.body?.json() ?: continue
|
|
|
- println("ggcz -> data:${j_data}")
|
|
|
- if (j_data.path("code")?.asInt() != 1) continue
|
|
|
- val j_id = j_data.path("data.id")?.asString() ?: continue
|
|
|
- Thread.sleep(5000)
|
|
|
- j_url = "http://${j_serverip}/api/腾讯QQ/图形验证码/任务列表/查询状态?token=${j_uid}"
|
|
|
- val j_postc = "id=${j_id}".toRequestBody("application/x-www-form-urlencoded".toMediaType())
|
|
|
- for (j_i in 0..180) {
|
|
|
- Thread.sleep(1000)
|
|
|
- val j_result = Okhttp.call(j_url) { it.post(j_postc) }?.body?.json() ?: continue
|
|
|
- println("ggcz -> result:${j_result}")
|
|
|
- if (j_result.path("code")?.asInt() != 1) break
|
|
|
- // 等待处理= 0
|
|
|
- // 开始处理= 1
|
|
|
- // 提交信息= 2
|
|
|
- // 未完成= 100
|
|
|
- // 成功= 10000
|
|
|
- // 类型不支持= 10001
|
|
|
- // 识别错误= 10002
|
|
|
- // 网络错误= 10003
|
|
|
- // 返回错误= 10004
|
|
|
- // 执行错误= 10005
|
|
|
- val j_状态 = j_result.path("data.状态")?.asInt() ?: break
|
|
|
- if (j_状态 < 100) continue
|
|
|
- if (j_状态 == 10000) return j_result.path("data.处理结果")
|
|
|
- break
|
|
|
- }
|
|
|
+fun ggcz_用户() {
|
|
|
+ val j_索引 = mutableMapOf<String, String>()
|
|
|
+ j_索引["1"] = "admin"
|
|
|
+ "C:\\Users\\Administrator\\Desktop\\用户.sql".fget()?.string()?.split("\n")?.forEach {
|
|
|
+ val j_item = it.split("----")
|
|
|
+ if (j_item.size != 10) return@forEach
|
|
|
+ j_索引[j_item[0]] = j_item[2]
|
|
|
}
|
|
|
- return null
|
|
|
-}
|
|
|
+ "C:\\Users\\Administrator\\Desktop\\用户.sql".fget()?.string()?.split("\n")?.forEach {
|
|
|
+ val j_item = it.split("----")
|
|
|
+ if (j_item.size != 10) return@forEach
|
|
|
+ val j_id = j_item[0]
|
|
|
+ val j_uid = j_item[1]
|
|
|
+ val j_账号 = j_item[2]
|
|
|
+ val j_密码 = j_item[3]
|
|
|
+ var j_昵称 = j_item[4]
|
|
|
+ var j_备注 = j_item[5]
|
|
|
+ var j_权限 = j_item[6]
|
|
|
+ val j_状态 = j_item[7]
|
|
|
+ val j_上级id = j_item[8]
|
|
|
+ val j_下级数 = j_item[9]
|
|
|
+ if (j_昵称 == "\"\"") j_昵称 = ""
|
|
|
+ if (j_备注 == "\"\"") j_备注 = ""
|
|
|
+ if (j_权限.startsWith("\"")) j_权限 = j_权限.removePrefix("\"").removeSuffix("\"")
|
|
|
+ val j_sql =
|
|
|
+ "INSERT INTO ggcz_用户 (uid, 账号, 密码, 昵称, 备注, 权限, 状态, 上级id) VALUES ('${Rand.str.num_aZ(68)}','${j_账号}','${j_密码}','${j_昵称}','${j_备注}','${j_权限}','${j_状态}',(SELECT id FROM ggcz_用户 WHERE 账号 = '${j_索引[j_上级id]}'));\n"
|
|
|
+ "C:\\Users\\Administrator\\Desktop\\用户2.sql".fset(j_sql, append = true)
|
|
|
+ print(j_sql)
|
|
|
+ }
|
|
|
+}
|