android: jni: Add function to reload keys.

This commit is contained in:
bunnei 2023-02-04 00:46:24 -08:00
parent 93bad47edb
commit 63a98e3e1c
3 changed files with 14 additions and 2 deletions

View File

@ -165,6 +165,8 @@ public final class NativeLibrary {
public static native void SetAppDirectory(String directory); public static native void SetAppDirectory(String directory);
public static native boolean ReloadKeys();
// Create the config.ini file. // Create the config.ini file.
public static native void CreateConfigFile(); public static native void CreateConfigFile();

View File

@ -19,6 +19,7 @@
#include "common/settings.h" #include "common/settings.h"
#include "core/core.h" #include "core/core.h"
#include "core/cpu_manager.h" #include "core/cpu_manager.h"
#include "core/crypto/key_manager.h"
#include "core/file_sys/registered_cache.h" #include "core/file_sys/registered_cache.h"
#include "core/file_sys/vfs_real.h" #include "core/file_sys/vfs_real.h"
#include "core/hid/hid_core.h" #include "core/hid/hid_core.h"
@ -261,12 +262,18 @@ void Java_org_yuzu_yuzu_1emu_NativeLibrary_NotifyOrientationChange(JNIEnv* env,
jint layout_option, jint layout_option,
jint rotation) {} jint rotation) {}
void Java_org_yuzu_yuzu_1emu_NativeLibrary_SetAppDirectory([[maybe_unused]] JNIEnv* env, void Java_org_yuzu_yuzu_1emu_NativeLibrary_SetAppDirectory(JNIEnv* env,
[[maybe_unused]] jclass clazz, [[maybe_unused]] jclass clazz,
[[maybe_unused]] jstring j_directory) { jstring j_directory) {
Common::FS::SetAppDirectory(GetJString(env, j_directory)); Common::FS::SetAppDirectory(GetJString(env, j_directory));
} }
jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_ReloadKeys(JNIEnv* env,
[[maybe_unused]] jclass clazz) {
Core::Crypto::KeyManager::Instance().ReloadKeys();
return static_cast<jboolean>(Core::Crypto::KeyManager::Instance().IsKeysLoaded());
}
void Java_org_yuzu_yuzu_1emu_NativeLibrary_UnPauseEmulation([[maybe_unused]] JNIEnv* env, void Java_org_yuzu_yuzu_1emu_NativeLibrary_UnPauseEmulation([[maybe_unused]] JNIEnv* env,
[[maybe_unused]] jclass clazz) {} [[maybe_unused]] jclass clazz) {}

View File

@ -67,6 +67,9 @@ JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_SetAppDirectory(JNI
jclass clazz, jclass clazz,
jstring j_directory); jstring j_directory);
JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_ReloadKeys(JNIEnv* env,
jclass clazz);
JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_utils_DirectoryInitialization_SetSysDirectory( JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_utils_DirectoryInitialization_SetSysDirectory(
JNIEnv* env, jclass clazz, jstring path_); JNIEnv* env, jclass clazz, jstring path_);