diff --git a/check_env_demo/code/native-lib.cpp b/check_env_demo/code/native-lib.cpp index 1cb3958..d4636e0 100755 --- a/check_env_demo/code/native-lib.cpp +++ b/check_env_demo/code/native-lib.cpp @@ -7,7 +7,6 @@ extern "C" JNIEXPORT jint JNICALL Java_check_env_MainActivity_isPathReallyExist(JNIEnv *env, jobject, jstring path) { - const char *cpath = env->GetStringUTFChars(path, nullptr); - int result1 = syscall(__NR_faccessat,AT_FDCWD, cpath, F_OK, 0); - return result1; -} \ No newline at end of file + public int isPathReallyExist(String path) { + return new File(path).exists() ? 1 : 0; + }