diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameFile.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameFile.java index 5a247137ab..70be6cd080 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameFile.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameFile.java @@ -11,6 +11,8 @@ public class GameFile mPointer = pointer; } + public native static GameFile parse(String path); + @Override public native void finalize(); diff --git a/Source/Android/jni/GameList/GameFile.cpp b/Source/Android/jni/GameList/GameFile.cpp index ee889709fd..b9f7a28df4 100644 --- a/Source/Android/jni/GameList/GameFile.cpp +++ b/Source/Android/jni/GameList/GameFile.cpp @@ -165,6 +165,17 @@ JNIEXPORT jint JNICALL Java_org_dolphinemu_dolphinemu_model_GameFile_getBannerHe return static_cast(GetRef(env, obj)->GetBannerImage().height); } +JNIEXPORT jobject JNICALL Java_org_dolphinemu_dolphinemu_model_GameFile_parse(JNIEnv* env, + jobject obj, + jstring path) +{ + auto game_file = std::make_shared(GetJString(env, path)); + if (!game_file->IsValid()) + game_file.reset(); + + return GameFileToJava(env, game_file); +} + #ifdef __cplusplus } #endif