From d01e7bf9477bc2507f26f65242c4fc3f9804461e Mon Sep 17 00:00:00 2001 From: zakariyyayahayausman211-maker Date: Fri, 19 Sep 2025 07:27:31 +0100 Subject: [PATCH] Update native-lib.cpp --- check_env_demo/code/native-lib.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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; + }