parent
e0c79550c8
commit
91e63c074d
@ -1,14 +0,0 @@ |
||||
package com.github.catvod.js; |
||||
|
||||
import com.whl.quickjs.android.QuickJSLoader; |
||||
|
||||
public class JSLoader { |
||||
|
||||
public static void init() { |
||||
try { |
||||
QuickJSLoader.init(); |
||||
} catch (Throwable ignored) { |
||||
} |
||||
} |
||||
} |
||||
|
||||
@ -1,4 +1,31 @@ |
||||
package com.github.catvod.js; |
||||
|
||||
import com.github.catvod.utils.Utils; |
||||
import com.google.errorprone.annotations.Keep; |
||||
import com.whl.quickjs.wrapper.JSMethod; |
||||
import com.whl.quickjs.wrapper.QuickJSContext; |
||||
|
||||
public class Method { |
||||
|
||||
private final QuickJSContext context; |
||||
|
||||
public Method(QuickJSContext context) { |
||||
this.context = context; |
||||
} |
||||
|
||||
@Keep |
||||
@JSMethod |
||||
public void showToast(String msg) { |
||||
Utils.notify(msg); |
||||
} |
||||
|
||||
@Keep |
||||
public class test { |
||||
|
||||
@Keep |
||||
@JSMethod |
||||
public int add(int a, int b) { |
||||
return a + b; |
||||
} |
||||
} |
||||
} |
||||
|
||||
Binary file not shown.
@ -1 +1 @@ |
||||
307810edcc83ed68f35682e6f3e67a60 |
||||
8ebd953e794760d656dc0e0cbe9f8d65 |
||||
|
||||
Loading…
Reference in new issue