This commit is contained in:
GH Action - Upstream Sync 2023-07-14 12:36:47 +00:00
commit e2eba87e2b
6 changed files with 11 additions and 30 deletions

View File

@ -7,10 +7,10 @@ import com.whl.quickjs.wrapper.QuickJSContext;
public class Method {
private final QuickJSContext context;
private QuickJSContext ctx;
public Method(QuickJSContext context) {
this.context = context;
public Method(QuickJSContext ctx) {
this.ctx = ctx;
}
@Keep
@ -18,14 +18,4 @@ public class Method {
public void showToast(String msg) {
Utils.notify(msg);
}
@Keep
public static class test {
@Keep
@JSMethod
public int add(int a, int b) {
return a + b;
}
}
}

View File

@ -8,19 +8,18 @@ import com.whl.quickjs.wrapper.QuickJSContext;
public class JSDemo extends Spider {
private QuickJSContext jsContext;
private QuickJSContext ctx;
@Override
public void init(Context context, String extend) {
jsContext = QuickJSContext.create();
jsContext.evaluate("var text = 'Hello QuickJS';");
String text = jsContext.getGlobalObject().getString("text");
ctx = QuickJSContext.create();
ctx.evaluate("var text = 'Hello QuickJS';");
String text = ctx.getGlobalObject().getString("text");
SpiderDebug.log(text);
}
@Override
public void destroy() {
super.destroy();
jsContext.destroy();
ctx.destroy();
}
}

Binary file not shown.

View File

@ -1 +1 @@
8ebd953e794760d656dc0e0cbe9f8d65
ae1463f4584754ef50ab902920ccb7da

View File

@ -1,5 +1,5 @@
{
"spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;8ebd953e794760d656dc0e0cbe9f8d65",
"spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;ae1463f4584754ef50ab902920ccb7da",
"wallpaper": "https://gao.chuqiuyu.tk",
"sites": [
{

View File

@ -1,5 +1,5 @@
{
"spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;8ebd953e794760d656dc0e0cbe9f8d65",
"spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;ae1463f4584754ef50ab902920ccb7da",
"wallpaper": "http://饭太硬.top/深色壁纸/api.php",
"sites": [
{
@ -65,14 +65,6 @@
"changeable": 1,
"ext": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/json/duboku.json"
},
{
"key": "傢伙",
"name": "傢伙",
"type": 4,
"api": " https://php.iptv.hz.cz/moguys.php",
"searchable": 1,
"changeable": 1
},
{
"key": "量子",
"name": "量子",