summaryrefslogtreecommitdiff
path: root/src/libjvm-android.c
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2018-05-29 03:55:32 +0300
committerJari Vetoniemi <mailroxas@gmail.com>2018-05-29 03:55:32 +0300
commit570009a8e49a8c999455f4804ce1c48acaf7df8e (patch)
treecc1baaf6a3c5340410482780f1f0729e4fb424a7 /src/libjvm-android.c
parentdd9ffa55195ee6313bed3b505dc3c6769b92d360 (diff)
jvm/libjvm-*: implement stuff
Wolf simulator (lol) starts working
Diffstat (limited to 'src/libjvm-android.c')
-rw-r--r--src/libjvm-android.c55
1 files changed, 54 insertions, 1 deletions
diff --git a/src/libjvm-android.c b/src/libjvm-android.c
index 5592311..52273bc 100644
--- a/src/libjvm-android.c
+++ b/src/libjvm-android.c
@@ -1,5 +1,5 @@
#include <stdarg.h>
-#include <stdio.h>
+#include <stddef.h>
#include <assert.h>
#include "jvm/jni.h"
@@ -54,14 +54,29 @@ jstring
android_content_Context_getPackageName(JNIEnv *env, jobject object, va_list args)
{
assert(env && object);
+#if WOLF
+ return (*env)->NewStringUTF(env, "com.swiftappskom.thewolfrpg");
+#else
return (*env)->NewStringUTF(env, "com.miHoYo.bh3oversea");
+#endif
}
jstring
android_content_Context_getPackageCodePath(JNIEnv *env, jobject object, va_list args)
{
assert(env && object);
+#if WOLF
+ return (*env)->NewStringUTF(env, "/mnt/media/dev/android2gnulinux/apks/wolf");
+#else
return (*env)->NewStringUTF(env, "/mnt/media/dev/android2gnulinux/apks/honkai");
+#endif
+}
+
+jstring
+android_content_pm_PackageInfo_versionName(JNIEnv *env, jobject object)
+{
+ assert(env && object);
+ return (*env)->NewStringUTF(env, "1.1");
}
jobject
@@ -99,3 +114,41 @@ android_content_Context_getExternalCacheDir(JNIEnv *env, jobject object, va_list
static jobject sv;
return (sv ? sv : (sv = (*env)->AllocObject(env, (*env)->FindClass(env, "java/io/File"))));
}
+
+jstring
+android_net_Uri_decode(JNIEnv *env, jobject object, va_list args)
+{
+ assert(env && object);
+ jstring str = va_arg(args, jstring);
+ (*env)->GetStringUTFChars(env, str, NULL);
+ return str;
+}
+
+jstring
+android_net_Uri_encode(JNIEnv *env, jobject object, va_list args)
+{
+ assert(env && object);
+ jstring str = va_arg(args, jstring);
+ (*env)->GetStringUTFChars(env, str, NULL);
+ return str;
+}
+
+jstring
+android_content_SharedPreferences_getString(JNIEnv *env, jobject object, va_list args)
+{
+ assert(env && object);
+ jstring str1 = va_arg(args, jstring);
+ jstring str2 = va_arg(args, jstring);
+ (*env)->GetStringUTFChars(env, str1, NULL);
+ (*env)->GetStringUTFChars(env, str2, NULL);
+ return str2;
+}
+
+jstring
+android_os_Bundle_getString(JNIEnv *env, jobject object, va_list args)
+{
+ assert(env && object);
+ jstring str1 = va_arg(args, jstring);
+ (*env)->GetStringUTFChars(env, str1, NULL);
+ return NULL;
+}