@@ -169,21 +169,21 @@ extern "C"
169
169
}
170
170
171
171
// / invoke native method
172
- void *invokeNativeMethod (void *objPtr, char *methodName, void **args , char **argTypes , int argCount , char *returnType, uint32_t stringTypeBitmask)
172
+ void *invokeNativeMethod (void *objPtr, char *methodName, void **arguments , char **dataTypes , int argumentCount , char *returnType, uint32_t stringTypeBitmask)
173
173
{
174
174
void *nativeInvokeResult = nullptr ;
175
175
JNIEnv *env = _getEnv ();
176
176
177
177
auto object = static_cast <jobject>(objPtr);
178
178
jclass cls = objectGlobalCache[object];
179
179
180
- auto *argValues = new jvalue[argCount ];
181
- if (argCount > 0 )
180
+ auto *argValues = new jvalue[argumentCount ];
181
+ if (argumentCount > 0 )
182
182
{
183
- _fillArgs (args, argTypes , argValues, argCount , stringTypeBitmask);
183
+ _fillArgs (arguments, dataTypes , argValues, argumentCount , stringTypeBitmask);
184
184
}
185
185
186
- char *methodSignature = generateSignature (argTypes, argCount , returnType);
186
+ char *methodSignature = generateSignature (dataTypes, argumentCount , returnType);
187
187
DNDebug (" call method %s %s" , methodName, methodSignature);
188
188
jmethodID method = env->GetMethodID (cls, methodName, methodSignature);
189
189
@@ -201,7 +201,9 @@ extern "C"
201
201
{
202
202
if (env->IsInstanceOf (obj, gStrCls ))
203
203
{
204
- *++argTypes = (char *)" 1" ;
204
+ // / mark the last pointer as string
205
+ // / dart will check this pointer
206
+ *++dataTypes = (char *) " java/lang/String" ;
205
207
nativeInvokeResult = convertToDartUtf16 (env, (jstring)obj);
206
208
}
207
209
else
0 commit comments