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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
|
#include <stdarg.h>
#include <stddef.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);
#if WOLF
return (*env)->NewStringUTF(env, "com.swiftappskom.thewolfrpg");
#elif STARLIGHT
return (*env)->NewStringUTF(env, "jp.co.bandainamcoent.BNEI0242");
#elif SHADOWVERSE
return (*env)->NewStringUTF(env, "com.cygames.Shadowverse");
#elif HEARTHSTONE
return (*env)->NewStringUTF(env, "com.blizzard.wtcg.hearthstone");
#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");
#elif STARLIGHT
return (*env)->NewStringUTF(env, "/mnt/media/dev/android2gnulinux/apks/starlight");
#elif SHADOWVERSE
return (*env)->NewStringUTF(env, "/mnt/media/dev/android2gnulinux/apks/shadowverse");
#elif HEARTHSTONE
return (*env)->NewStringUTF(env, "/mnt/media/dev/android2gnulinux/apks/hearthstone");
#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
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"))));
}
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;
}
jintArray
android_view_InputDevice_getDeviceIds(JNIEnv *env, jobject object, va_list args)
{
assert(env && object);
return (*env)->NewIntArray(env, 1);
}
jint
android_view_InputEvent_getSource(JNIEnv *env, jobject object, va_list args)
{
assert(env && object);
return 0x00001002;
}
jint
android_view_MotionEvent_getAction(JNIEnv *env, jobject object, va_list args)
{
assert(env && object);
static int action;
return (action = !action);
}
jfloat
android_view_MotionEvent_getX(JNIEnv *env, jobject object, va_list args)
{
assert(env && object);
return 1024/2;
}
jfloat
android_view_MotionEvent_getY(JNIEnv *env, jobject object, va_list args)
{
assert(env && object);
return 700;
}
jint
android_view_MotionEvent_getPointerCount(JNIEnv *env, jobject object, va_list args)
{
assert(env && object);
return 1;
}
|