1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
#include <stdarg.h>
#include <stdio.h>
#include <assert.h>
#include "jvm/jni.h"
jstring
android_os_Build_MANUFACTURER(JNIEnv *env, jobject object)
{
assert(env && object);
return (*env)->NewStringUTF(env, "android2gnulinux");
}
jstring
android_os_Build_MODEL(JNIEnv *env, jobject object)
{
return android_os_Build_MANUFACTURER(env, object);
}
jstring
android_os_Build_PRODUCT(JNIEnv *env, jobject object)
{
return android_os_Build_MANUFACTURER(env, object);
}
jstring
android_os_Build_ID(JNIEnv *env, jobject object)
{
return android_os_Build_MANUFACTURER(env, object);
}
jstring
android_os_Build_VERSION_RELEASE(JNIEnv *env, jobject object)
{
assert(env && object);
XXX
return (*env)->NewStringUTF(env, "1.0");
}
jint
android_os_Build_VERSION_SDK_INT(JNIEnv *env, jobject object)
{
assert(env && object);
return (jint)~0; XXX
}
jstring
android_os_Build_VERSION_INCREMENTAL(JNIEnv *env, jobject object)
{
assert(env && object);
return (*env)->NewStringUTF(env, "0"); XXX
}
jstring
android_content_Context_getPackageName(JNIEnv *env, jobject object, va_list args)
{
assert(env && object);
return (*env)->NewStringUTF(env, "com.miHoYo.bh3oversea");
}
jstring
android_content_Context_getPackageCodePath(JNIEnv *env, jobject object, va_list args)
{
assert(env && object);
return (*env)->NewStringUTF(env, "/mnt/media/dev/android2gnulinux/apks/honkai");
}
jobject
android_content_Context_getExternalFilesDir(JNIEnv *env, jobject object, va_list args)
{
assert(env && object);
FIXME
jstring str = va_arg(args, jstring);
(*env)->GetStringUTFChars(env, str, NULL);
static jobject sv;
return (sv ? sv : (sv = (*env)->AllocObject(env, (*env)->FindClass(env, "java/io/File"))));
}
jobject
android_content_Context_getFilesDir(JNIEnv *env, jobject object, va_list args)
{
assert(env && object);
static jobject sv;
return (sv ? sv : (sv = (*env)->AllocObject(env, (*env)->FindClass(env, "java/io/File"))));
}
jobject
android_content_Context_getCacheDir(JNIEnv *env, jobject object, va_list args)
{
assert(env && object);
static jobject sv;
return (sv ? sv : (sv = (*env)->AllocObject(env, (*env)->FindClass(env, "java/io/File"))));
}
jobject
android_content_Context_getExternalCacheDir(JNIEnv *env, jobject object, va_list args)
{
assert(env && object);
static jobject sv;
return (sv ? sv : (sv = (*env)->AllocObject(env, (*env)->FindClass(env, "java/io/File"))));
}
|