added more keys (@equipter)
[RRG-proxmark3.git] / client / android / jni_tools.h
blob8e900374fb7dbc253d4c368f189eeec9fd81b33f
1 //
2 // Created by dell on 2017/9/1.
3 //
5 #ifndef DXL_TOOLS_H
6 #define DXL_TOOLS_H
8 #include <jni.h>
9 #include <android/log.h>
10 #include <string.h>
12 //JNI LOG
13 #define TAG "PM3"
14 #define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE,TAG,__VA_ARGS__)
15 #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,TAG,__VA_ARGS__)
16 #define LOGI(...) __android_log_print(ANDROID_LOG_INFO,TAG,__VA_ARGS__)
17 #define LOGW(...) __android_log_print(ANDROID_LOG_WARN,TAG,__VA_ARGS__)
18 #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,TAG,__VA_ARGS__)
20 // a global jvm instance
21 JavaVM *g_JavaVM;
23 // get current env for jvm
24 JNIEnv *getJniEnv();
26 // detach native thread from jvm, must native thread can detach!
27 void detachThread();
29 typedef struct {
30 char **cmd;
31 int len;
32 } CMD;
34 // cmd arg parse
35 CMD *parse_command_line(const char *commandStr);
37 // cmd arg struct free
38 void free_command_line(CMD *);
40 #endif //DXL_TOOLS_H