Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package:jnigen 0.9.1 generates incorrect bindings for 32-bit Android devices #1188

Closed
brianquinlan opened this issue Jun 3, 2024 · 0 comments

Comments

@brianquinlan
Copy link
Contributor

brianquinlan commented Jun 3, 2024

This manifested as cronet_http: Crash occurring on 32bit android devices since version 1.2.1.

package:jnigen generates this code:

 static final _enableHttpCache = ProtectedJniExtensions.lookup<
             ffi.NativeFunction<
                 jni.JniResult Function(ffi.Pointer<ffi.Void>,
                     jni.JMethodIDPtr, ffi.VarArgs<(ffi.Int64, ffi.Int64)>)>>(
         "globalEnv_CallObjectMethod")
     .asFunction<
         jni.JniResult Function(
             ffi.Pointer<ffi.Void>, jni.JMethodIDPtr, int, int)>();

For this signature:

CronetEngine.Builder enableHttpCache(int cacheMode, long maxSize);

I'm guessing that the first argument should be an Int to support 32-bit devices? i.e.

 static final _enableHttpCache = ProtectedJniExtensions.lookup<
             ffi.NativeFunction<
                 jni.JniResult Function(ffi.Pointer<ffi.Void>,
-                     jni.JMethodIDPtr, ffi.VarArgs<(ffi.Int64, ffi.Int64)>)>>(
+                     jni.JMethodIDPtr, ffi.VarArgs<(ffi.Int, ffi.Int64)>)>>(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants