mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 01:40:46 +08:00
feat.新增 java sample (但好像还不能用)
This commit is contained in:
2
src/Java/.gitignore
vendored
Normal file
2
src/Java/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*.class
|
||||
*.jar
|
||||
12
src/Java/com/meo/asst/libmaa.java
Normal file
12
src/Java/com/meo/asst/libmaa.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package com.meo.asst;
|
||||
|
||||
public class libmaa {
|
||||
|
||||
static {
|
||||
// System.loadLibrary("MeoAssistant");
|
||||
System.loadLibrary("MeoAssistantJni");
|
||||
}
|
||||
|
||||
public static native long create(String dirname);
|
||||
public static native void destroy(long handle);
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
JNIEXPORT jlong JNICALL Java_com_maa_create(JNIEnv* env, jclass c, jstring jstr_dirname)
|
||||
JNIEXPORT jlong JNICALL Java_com_meo_asst_libmaa_create(JNIEnv* env, jclass c, jstring jstr_dirname)
|
||||
{
|
||||
LOG_D(__FUNCTION__);
|
||||
|
||||
@@ -46,7 +46,7 @@ extern "C" {
|
||||
return (jlong)p_asst;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_maa_destroy(JNIEnv* env, jclass c, jlong jlong_asst)
|
||||
JNIEXPORT void JNICALL Java_com_meo_asst_libmaa_destroy(JNIEnv* env, jclass c, jlong jlong_asst)
|
||||
{
|
||||
LOG_D(__FUNCTION__);
|
||||
|
||||
|
||||
8
src/Java/sample.java
Normal file
8
src/Java/sample.java
Normal file
@@ -0,0 +1,8 @@
|
||||
import com.meo.asst.libmaa;
|
||||
|
||||
public class sample {
|
||||
public static void main(String[] args) {
|
||||
long handle = libmaa.create("D:\\Code\\MeoAssistantArknights\\x64\\Release");
|
||||
libmaa.destroy(handle);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user