Merge pull request #1034 from xianglin1998/master

Android libpm3 updated.
This commit is contained in:
Iceman 2020-10-26 10:02:05 +01:00 committed by GitHub
commit c0c6c04e92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 11 deletions

View file

@ -127,6 +127,7 @@ add_library(pm3rrg_rdv4 SHARED
${PM3_ROOT}/client/src/cmdlfcotag.c ${PM3_ROOT}/client/src/cmdlfcotag.c
${PM3_ROOT}/client/src/cmdlfdestron.c ${PM3_ROOT}/client/src/cmdlfdestron.c
${PM3_ROOT}/client/src/cmdlfem4x.c ${PM3_ROOT}/client/src/cmdlfem4x.c
${PM3_ROOT}/client/src/cmdlfem4x05.c
${PM3_ROOT}/client/src/cmdlfem4x50.c ${PM3_ROOT}/client/src/cmdlfem4x50.c
${PM3_ROOT}/client/src/cmdlffdxb.c ${PM3_ROOT}/client/src/cmdlffdxb.c
${PM3_ROOT}/client/src/cmdlfgallagher.c ${PM3_ROOT}/client/src/cmdlfgallagher.c
@ -150,7 +151,6 @@ add_library(pm3rrg_rdv4 SHARED
${PM3_ROOT}/client/src/cmdlfsecurakey.c ${PM3_ROOT}/client/src/cmdlfsecurakey.c
${PM3_ROOT}/client/src/cmdlft55xx.c ${PM3_ROOT}/client/src/cmdlft55xx.c
${PM3_ROOT}/client/src/cmdlfti.c ${PM3_ROOT}/client/src/cmdlfti.c
${PM3_ROOT}/client/src/cmdlfverichip.c
${PM3_ROOT}/client/src/cmdlfviking.c ${PM3_ROOT}/client/src/cmdlfviking.c
${PM3_ROOT}/client/src/cmdlfvisa2000.c ${PM3_ROOT}/client/src/cmdlfvisa2000.c
${PM3_ROOT}/client/src/cmdmain.c ${PM3_ROOT}/client/src/cmdmain.c

View file

@ -37,7 +37,7 @@
static char *g_android_executable_directory = NULL; static char *g_android_executable_directory = NULL;
static char *g_android_user_directory = NULL; static char *g_android_user_directory = NULL;
char version_information[] = {"ANDROID_LIBRARY 1.4.6 build by DXL"}; char version_information[] = {""};
const char *get_my_executable_directory(void) { const char *get_my_executable_directory(void) {
if (g_android_executable_directory == NULL) { if (g_android_executable_directory == NULL) {
@ -86,7 +86,7 @@ jint Console(JNIEnv *env, jobject instance, jstring cmd_) {
PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "");
char *cmd = (char *)((*env)->GetStringUTFChars(env, cmd_, 0)); char *cmd = (char *) ((*env)->GetStringUTFChars(env, cmd_, 0));
int ret = CommandReceived(cmd); int ret = CommandReceived(cmd);
if (ret == 99) { if (ret == 99) {
// exit / quit // exit / quit
@ -102,7 +102,7 @@ jint Console(JNIEnv *env, jobject instance, jstring cmd_) {
* Is client running! * Is client running!
* */ * */
jboolean IsClientRunning(JNIEnv *env, jobject instance) { jboolean IsClientRunning(JNIEnv *env, jobject instance) {
return (jboolean)((jboolean) conn.run); return (jboolean) ((jboolean) conn.run);
} }
/* /*
@ -114,7 +114,7 @@ jboolean TestPm3(JNIEnv *env, jobject instance) {
return false; return false;
} }
bool ret = (TestProxmark() == PM3_SUCCESS); bool ret = (TestProxmark() == PM3_SUCCESS);
return (jboolean)(ret); return (jboolean) (ret);
} }
/* /*
@ -141,18 +141,18 @@ JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved) {
} }
jclass clz_test = (*jniEnv)->FindClass(jniEnv, "cn/rrg/devices/Proxmark3RRGRdv4"); jclass clz_test = (*jniEnv)->FindClass(jniEnv, "cn/rrg/devices/Proxmark3RRGRdv4");
JNINativeMethod methods[] = { JNINativeMethod methods[] = {
{"startExecute", "(Ljava/lang/String;)I", (void *) Console}, {"startExecute", "(Ljava/lang/String;)I", (void *) Console},
{"stopExecute", "()V", (void *) ClosePm3}, {"stopExecute", "()V", (void *) ClosePm3},
{"isExecuting", "()Z", (void *) IsClientRunning} {"isExecuting", "()Z", (void *) IsClientRunning}
}; };
JNINativeMethod methods1[] = { JNINativeMethod methods1[] = {
{"testPm3", "()Z", (void *) TestPm3}, {"testPm3", "()Z", (void *) TestPm3},
{"closePm3", "()V", ClosePm3} {"closePm3", "()V", ClosePm3}
}; };
if ((*jniEnv)->RegisterNatives(jniEnv, clazz, methods, sizeof(methods) / sizeof(methods[0])) != if ((*jniEnv)->RegisterNatives(jniEnv, clazz, methods, sizeof(methods) / sizeof(methods[0])) !=
JNI_OK) { JNI_OK) {
return -1; return -1;
} }