mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-20 22:16:49 +01:00
Android: resolve symlinks in SDL_AndroidGetInternalStoragePath (thanks Henrique Gemignani and cigumo!)
Fixes issues on modern Android versions when the path is used in code that explicitly doesn't follow symlinks (such as PHYSFS_mkdir).
This commit is contained in:
parent
72d4507918
commit
3bfada2e02
@ -2029,10 +2029,14 @@ const char * SDL_AndroidGetInternalStoragePath(void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* path = fileObject.getAbsolutePath(); */
|
||||
/* path = fileObject.getCanonicalPath(); */
|
||||
mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, fileObject),
|
||||
"getAbsolutePath", "()Ljava/lang/String;");
|
||||
"getCanonicalPath", "()Ljava/lang/String;");
|
||||
pathString = (jstring)(*env)->CallObjectMethod(env, fileObject, mid);
|
||||
if (Android_JNI_ExceptionOccurred(SDL_FALSE)) {
|
||||
LocalReferenceHolder_Cleanup(&refs);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
path = (*env)->GetStringUTFChars(env, pathString, NULL);
|
||||
s_AndroidInternalFilesPath = SDL_strdup(path);
|
||||
|
Loading…
Reference in New Issue
Block a user