const runncls
=
Java.registerClass({
name:
'com.tencent.imsdk.tmprunn'
,
implements: [Java.use(
'java.lang.Runnable'
)],
methods: {
run() {
/
/
请求智能机器人,获取数据
var medcls
=
Java.use(
'okhttp3.MediaType'
);
var meins
=
medcls.parse(
"application/json;charset=UTF-8"
);
var clentcls
=
Java.use(
'okhttp3.OkHttpClient'
);
var clentins
=
clentcls.$new();
var rebod
=
Java.use(
'okhttp3.RequestBody'
).create(meins,
'{"query_text": "'
+
rectxt
+
'"}'
);
var reqestcls
=
Java.use(
'okhttp3.Request$Builder'
);
var reqins
=
reqestcls.$new().url(
'http://xxx/api/v1/search'
)
.addHeader(
'Accept-Encoding'
,
'gzip, deflate'
)
.addHeader(
'Accept'
,
'application/json, text/plain, */*'
)
.addHeader(
'User-Agent'
,
'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36'
)
/
/
User
-
Agent: Mozilla
/
5.0
(Windows NT
6.3
; Win64; x64) AppleWebKit
/
537.36
(KHTML, like Gecko) Chrome
/
88.0
.
4324.182
Safari
/
537.36
.addHeader(
'Accept-Language'
,
'zh-CN,zh;q=0.9'
)
.post(rebod).build();
console.log(
'begin req'
+
reqins);
var resp
=
clentins.newCall(reqins).execute();
var res
=
resp.body().string();
console.log(
"ai resp:"
+
res);
console.log(res.indexOf(
'400'
));
var ret
=
"恩恩"
;
if
(res.indexOf(
'400'
) !
=
-
1
) {
}
else
if
(res
=
=
'Error with must be str, not IndexError'
) {
}
else
{
ret
=
res;
}
var lopcls
=
Java.use(
'android.os.Looper'
);
/
/
lopcls.prepare();
const mhandcls
=
Java.registerClass({
name:
'com.tencent.imsdk.tmprunn44hndd'
,
implements: [Java.use(
'java.lang.Runnable'
)],
methods: {
run() {
sendhello2(
input
,ret)
backup();
}
}
});
var nhead
=
mhandcls.$new();
var hdins
=
Java.use(
'android.os.Handler'
).$new(lopcls.getMainLooper());
hdins.post(nhead);
}}});
Java.use(
'java.lang.Thread'
).$new(runncls.$new()).start();