Skip to content

Commit 406d430

Browse files
author
拉隆
committed
新增setpath接口
1 parent b013e39 commit 406d430

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

bootstrap.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,24 @@ JNIEXPORT void JNICALL Java_io_github_noodle1983_Boostrap_init
4242
bootstrap();
4343
}
4444

45+
__attribute__ ((visibility ("default")))
46+
JNIEXPORT void JNICALL Java_io_github_noodle1983_Boostrap_setpath
47+
(JNIEnv * jenv, jclass cls, jstring dataPath, jstring path, jstring apkPath)
48+
{
49+
const char* target_file_path = jenv->GetStringUTFChars(path, NULL);
50+
const char* apk_path = jenv->GetStringUTFChars(apkPath, NULL);
51+
const char* data_file_path = jenv->GetStringUTFChars(dataPath, NULL);
52+
g_data_file_path = dupstr(data_file_path); // never delete, ok with only one
53+
54+
use_data_dir(target_file_path, apk_path);
55+
56+
MY_INFO("set_path jieluo:%s", target_file_path);
57+
58+
jenv->ReleaseStringUTFChars(dataPath, data_file_path);
59+
jenv->ReleaseStringUTFChars(path, target_file_path);
60+
jenv->ReleaseStringUTFChars(apkPath, apk_path);
61+
}
62+
4563
static std::string get_bundle_id()
4664
{
4765
pid_t pid = getpid();

io_github_noodle1983_Boostrap.h

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)