From dbf7d1d82e773c2638da858f690675ea1fcb4b7e Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Sun, 30 Jun 2024 22:58:05 +0530 Subject: [PATCH 01/27] ok_http: upgrade jni and regenerate bindings --- pkgs/ok_http/lib/src/jni/bindings.dart | 74 ++++++++++++-------------- pkgs/ok_http/pubspec.yaml | 4 +- 2 files changed, 37 insertions(+), 41 deletions(-) diff --git a/pkgs/ok_http/lib/src/jni/bindings.dart b/pkgs/ok_http/lib/src/jni/bindings.dart index 05ab7b830e..c671ff44e4 100644 --- a/pkgs/ok_http/lib/src/jni/bindings.dart +++ b/pkgs/ok_http/lib/src/jni/bindings.dart @@ -1087,8 +1087,8 @@ class RequestBody_Companion extends jni.JObject { ( ffi.Pointer, ffi.Pointer, - ffi.Int32, - ffi.Int32 + $Int32, + $Int32 )>)>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, @@ -1211,8 +1211,8 @@ class RequestBody_Companion extends jni.JObject { ( ffi.Pointer, ffi.Pointer, - ffi.Int32, - ffi.Int32 + $Int32, + $Int32 )>)>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, @@ -1275,7 +1275,7 @@ class RequestBody_Companion extends jni.JObject { ( ffi.Pointer, ffi.Pointer, - ffi.Int32 + $Int32 )>)>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, @@ -1363,7 +1363,7 @@ class RequestBody_Companion extends jni.JObject { ( ffi.Pointer, ffi.Pointer, - ffi.Int32 + $Int32 )>)>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, @@ -1706,8 +1706,8 @@ class RequestBody extends jni.JObject { ( ffi.Pointer, ffi.Pointer, - ffi.Int32, - ffi.Int32 + $Int32, + $Int32 )>)>>("globalEnv_CallStaticObjectMethod") .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, @@ -1830,8 +1830,8 @@ class RequestBody extends jni.JObject { ( ffi.Pointer, ffi.Pointer, - ffi.Int32, - ffi.Int32 + $Int32, + $Int32 )>)>>("globalEnv_CallStaticObjectMethod") .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, @@ -1894,7 +1894,7 @@ class RequestBody extends jni.JObject { ( ffi.Pointer, ffi.Pointer, - ffi.Int32 + $Int32 )>)>>("globalEnv_CallStaticObjectMethod") .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, @@ -1982,7 +1982,7 @@ class RequestBody extends jni.JObject { ( ffi.Pointer, ffi.Pointer, - ffi.Int32 + $Int32 )>)>>("globalEnv_CallStaticObjectMethod") .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, @@ -2178,7 +2178,7 @@ class Response_Builder extends jni.JObject { static final _code = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Int32,)>)>>("globalEnv_CallObjectMethod") + ffi.VarArgs<($Int32,)>)>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, int)>(); @@ -2584,7 +2584,7 @@ class Response extends jni.JObject { ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Int32, + $Int32, ffi.Pointer, ffi.Pointer, ffi.Pointer, @@ -3334,16 +3334,12 @@ class ResponseBody_BomAwareReader extends jni.JObject { ); static final _read = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< - ( - ffi.Pointer, - ffi.Int32, - ffi.Int32 - )>)>>("globalEnv_CallIntMethod") + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer, $Int32, $Int32)>)>>( + "globalEnv_CallIntMethod") .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, int, int)>(); @@ -4539,7 +4535,7 @@ class OkHttpClient_Builder extends jni.JObject { static final _retryOnConnectionFailure = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Uint8,)>)>>("globalEnv_CallObjectMethod") + ffi.VarArgs<($Int32,)>)>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, int)>(); @@ -4590,7 +4586,7 @@ class OkHttpClient_Builder extends jni.JObject { static final _followRedirects = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Uint8,)>)>>("globalEnv_CallObjectMethod") + ffi.VarArgs<($Int32,)>)>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, int)>(); @@ -4613,7 +4609,7 @@ class OkHttpClient_Builder extends jni.JObject { static final _followSslRedirects = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Uint8,)>)>>("globalEnv_CallObjectMethod") + ffi.VarArgs<($Int32,)>)>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, int)>(); @@ -6418,7 +6414,7 @@ class Call_Factory extends jni.JObject { .toPointer(); } } catch (e) { - return ProtectedJniExtensions.newDartException(e.toString()); + return ProtectedJniExtensions.newDartException(e); } return jni.nullptr; } @@ -6777,7 +6773,7 @@ class Call extends jni.JObject { .toPointer(); } } catch (e) { - return ProtectedJniExtensions.newDartException(e.toString()); + return ProtectedJniExtensions.newDartException(e); } return jni.nullptr; } @@ -7571,7 +7567,7 @@ class Headers extends jni.JObject { static final _name = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Int32,)>)>>("globalEnv_CallObjectMethod") + ffi.VarArgs<($Int32,)>)>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, int)>(); @@ -7593,7 +7589,7 @@ class Headers extends jni.JObject { static final _value = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Int32,)>)>>("globalEnv_CallObjectMethod") + ffi.VarArgs<($Int32,)>)>>("globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, int)>(); @@ -8053,7 +8049,7 @@ class Callback extends jni.JObject { return jni.nullptr; } } catch (e) { - return ProtectedJniExtensions.newDartException(e.toString()); + return ProtectedJniExtensions.newDartException(e); } return jni.nullptr; } @@ -8188,7 +8184,7 @@ class ConnectionPool extends jni.JObject { jni.JMethodIDPtr, ffi.VarArgs< ( - ffi.Int32, + $Int32, ffi.Int64, ffi.Pointer )>)>>("globalEnv_NewObject") @@ -8400,7 +8396,7 @@ class Dispatcher extends jni.JObject { jni.JThrowablePtr Function( ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Int32,)>)>>("globalEnv_CallVoidMethod") + ffi.VarArgs<($Int32,)>)>>("globalEnv_CallVoidMethod") .asFunction< jni.JThrowablePtr Function( ffi.Pointer, jni.JMethodIDPtr, int)>(); @@ -8448,7 +8444,7 @@ class Dispatcher extends jni.JObject { jni.JThrowablePtr Function( ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Int32,)>)>>("globalEnv_CallVoidMethod") + ffi.VarArgs<($Int32,)>)>>("globalEnv_CallVoidMethod") .asFunction< jni.JThrowablePtr Function( ffi.Pointer, jni.JMethodIDPtr, int)>(); @@ -9524,7 +9520,7 @@ class RedirectReceivedCallback extends jni.JObject { return jni.nullptr; } } catch (e) { - return ProtectedJniExtensions.newDartException(e.toString()); + return ProtectedJniExtensions.newDartException(e); } return jni.nullptr; } @@ -9633,8 +9629,8 @@ class RedirectInterceptor_Companion extends jni.JObject { ffi.VarArgs< ( ffi.Pointer, - ffi.Int32, - ffi.Uint8, + $Int32, + $Int32, ffi.Pointer )>)>>("globalEnv_CallObjectMethod") .asFunction< @@ -10043,7 +10039,7 @@ class DataCallback extends jni.JObject { return jni.nullptr; } } catch (e) { - return ProtectedJniExtensions.newDartException(e.toString()); + return ProtectedJniExtensions.newDartException(e); } return jni.nullptr; } diff --git a/pkgs/ok_http/pubspec.yaml b/pkgs/ok_http/pubspec.yaml index 68ff974261..7c242ab18c 100644 --- a/pkgs/ok_http/pubspec.yaml +++ b/pkgs/ok_http/pubspec.yaml @@ -14,12 +14,12 @@ dependencies: sdk: flutter http: ^1.2.1 http_profile: ^0.1.0 - jni: ^0.9.2 + jni: ^0.9.3 plugin_platform_interface: ^2.0.2 dev_dependencies: dart_flutter_team_lints: ^3.0.0 - jnigen: ^0.9.1 + jnigen: ^0.9.3 flutter: plugin: From bd97d77eb1a5cf0585733556239776c720684c54 Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Sun, 30 Jun 2024 23:30:11 +0530 Subject: [PATCH 02/27] ok_http: jnigen fixes Co-authored-by: Hossein Yousefi --- pkgs/ok_http/analysis_options.yaml | 5 - pkgs/ok_http/jnigen.yaml | 10 + pkgs/ok_http/lib/src/jni/bindings.dart | 322 ++++++++++++++++++++++- pkgs/ok_http/lib/src/ok_http_client.dart | 10 +- 4 files changed, 330 insertions(+), 17 deletions(-) delete mode 100644 pkgs/ok_http/analysis_options.yaml diff --git a/pkgs/ok_http/analysis_options.yaml b/pkgs/ok_http/analysis_options.yaml deleted file mode 100644 index 8de8919f97..0000000000 --- a/pkgs/ok_http/analysis_options.yaml +++ /dev/null @@ -1,5 +0,0 @@ -include: ../../analysis_options.yaml - -analyzer: - exclude: - - "lib/src/jni/bindings.dart" diff --git a/pkgs/ok_http/jnigen.yaml b/pkgs/ok_http/jnigen.yaml index c9f06d183a..02c055d1c5 100644 --- a/pkgs/ok_http/jnigen.yaml +++ b/pkgs/ok_http/jnigen.yaml @@ -26,6 +26,7 @@ classes: - "okhttp3.Callback" - "okhttp3.ConnectionPool" - "okhttp3.Dispatcher" + - "java.util.concurrent.ExecutorService" - "okhttp3.Cache" - "com.example.ok_http.RedirectReceivedCallback" - "com.example.ok_http.RedirectInterceptor" @@ -86,3 +87,12 @@ exclude: - "okhttp3.Headers#-deprecated_size" - "okhttp3.Dispatcher#-deprecated_executorService" - "okhttp3.Cache#-deprecated_directory" + - "java.util.concurrent.ExecutorService#invokeAll" + - "java.util.concurrent.ExecutorService#invokeAny" + - "java.util.concurrent.ExecutorService#submit" + +preamble: | + // ignore_for_file: prefer_single_quotes + // ignore_for_file: directives_ordering + // ignore_for_file: prefer_expression_function_bodies + // ignore_for_file: unnecessary_parenthesis diff --git a/pkgs/ok_http/lib/src/jni/bindings.dart b/pkgs/ok_http/lib/src/jni/bindings.dart index c671ff44e4..94e199a1ba 100644 --- a/pkgs/ok_http/lib/src/jni/bindings.dart +++ b/pkgs/ok_http/lib/src/jni/bindings.dart @@ -1,3 +1,8 @@ +// ignore_for_file: prefer_single_quotes +// ignore_for_file: directives_ordering +// ignore_for_file: prefer_expression_function_bodies +// ignore_for_file: unnecessary_parenthesis + // Autogenerated by jnigen. DO NOT EDIT! // ignore_for_file: annotate_overrides @@ -8527,10 +8532,10 @@ class Dispatcher extends jni.JObject { /// from: public final java.util.concurrent.ExecutorService executorService() /// The returned object must be released after use, by calling the [release] method. - jni.JObject executorService() { + ExecutorService executorService() { return _executorService( reference.pointer, _id_executorService as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + .object(const $ExecutorServiceType()); } static final _id_new1 = _class.constructorId( @@ -8551,7 +8556,7 @@ class Dispatcher extends jni.JObject { /// from: public void (java.util.concurrent.ExecutorService executorService) /// The returned object must be released after use, by calling the [release] method. factory Dispatcher.new1( - jni.JObject executorService, + ExecutorService executorService, ) { return Dispatcher.fromReference(_new1(_class.reference.pointer, _id_new1 as jni.JMethodIDPtr, executorService.reference.pointer) @@ -8703,6 +8708,317 @@ final class $DispatcherType extends jni.JObjType { } } +/// from: java.util.concurrent.ExecutorService +class ExecutorService extends jni.JObject { + @override + late final jni.JObjType $type = type; + + ExecutorService.fromReference( + jni.JReference reference, + ) : super.fromReference(reference); + + static final _class = + jni.JClass.forName(r"java/util/concurrent/ExecutorService"); + + /// The type which includes information such as the signature of this class. + static const type = $ExecutorServiceType(); + static final _id_shutdown = _class.instanceMethodId( + r"shutdown", + r"()V", + ); + + static final _shutdown = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public abstract void shutdown() + void shutdown() { + _shutdown(reference.pointer, _id_shutdown as jni.JMethodIDPtr).check(); + } + + static final _id_shutdownNow = _class.instanceMethodId( + r"shutdownNow", + r"()Ljava/util/List;", + ); + + static final _shutdownNow = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public abstract java.util.List shutdownNow() + /// The returned object must be released after use, by calling the [release] method. + jni.JList shutdownNow() { + return _shutdownNow(reference.pointer, _id_shutdownNow as jni.JMethodIDPtr) + .object(const jni.JListType(jni.JObjectType())); + } + + static final _id_isShutdown = _class.instanceMethodId( + r"isShutdown", + r"()Z", + ); + + static final _isShutdown = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallBooleanMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public abstract boolean isShutdown() + bool isShutdown() { + return _isShutdown(reference.pointer, _id_isShutdown as jni.JMethodIDPtr) + .boolean; + } + + static final _id_isTerminated = _class.instanceMethodId( + r"isTerminated", + r"()Z", + ); + + static final _isTerminated = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallBooleanMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public abstract boolean isTerminated() + bool isTerminated() { + return _isTerminated( + reference.pointer, _id_isTerminated as jni.JMethodIDPtr) + .boolean; + } + + static final _id_awaitTermination = _class.instanceMethodId( + r"awaitTermination", + r"(JLjava/util/concurrent/TimeUnit;)Z", + ); + + static final _awaitTermination = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Int64, ffi.Pointer)>)>>( + "globalEnv_CallBooleanMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, + ffi.Pointer)>(); + + /// from: public abstract boolean awaitTermination(long j, java.util.concurrent.TimeUnit timeUnit) + bool awaitTermination( + int j, + jni.JObject timeUnit, + ) { + return _awaitTermination( + reference.pointer, + _id_awaitTermination as jni.JMethodIDPtr, + j, + timeUnit.reference.pointer) + .boolean; + } + + /// Maps a specific port to the implemented interface. + static final Map _$impls = {}; + ReceivePort? _$p; + + static jni.JObjectPtr _$invoke( + int port, + jni.JObjectPtr descriptor, + jni.JObjectPtr args, + ) { + return _$invokeMethod( + port, + $MethodInvocation.fromAddresses( + 0, + descriptor.address, + args.address, + ), + ); + } + + static final ffi.Pointer< + ffi.NativeFunction< + jni.JObjectPtr Function( + ffi.Uint64, jni.JObjectPtr, jni.JObjectPtr)>> + _$invokePointer = ffi.Pointer.fromFunction(_$invoke); + + static ffi.Pointer _$invokeMethod( + int $p, + $MethodInvocation $i, + ) { + try { + final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); + final $a = $i.args; + if ($d == r"shutdown()V") { + _$impls[$p]!.shutdown(); + return jni.nullptr; + } + if ($d == r"shutdownNow()Ljava/util/List;") { + final $r = _$impls[$p]!.shutdownNow(); + return ($r as jni.JObject) + .castTo(const jni.JObjectType()) + .reference + .toPointer(); + } + if ($d == r"isShutdown()Z") { + final $r = _$impls[$p]!.isShutdown(); + return jni.JBoolean($r).reference.toPointer(); + } + if ($d == r"isTerminated()Z") { + final $r = _$impls[$p]!.isTerminated(); + return jni.JBoolean($r).reference.toPointer(); + } + if ($d == r"awaitTermination(JLjava/util/concurrent/TimeUnit;)Z") { + final $r = _$impls[$p]!.awaitTermination( + $a[0] + .castTo(const jni.JLongType(), releaseOriginal: true) + .longValue(releaseOriginal: true), + $a[1].castTo(const jni.JObjectType(), releaseOriginal: true), + ); + return jni.JBoolean($r).reference.toPointer(); + } + } catch (e) { + return ProtectedJniExtensions.newDartException(e); + } + return jni.nullptr; + } + + factory ExecutorService.implement( + $ExecutorServiceImpl $impl, + ) { + final $p = ReceivePort(); + final $x = ExecutorService.fromReference( + ProtectedJniExtensions.newPortProxy( + r"java.util.concurrent.ExecutorService", + $p, + _$invokePointer, + ), + ).._$p = $p; + final $a = $p.sendPort.nativePort; + _$impls[$a] = $impl; + $p.listen(($m) { + if ($m == null) { + _$impls.remove($p.sendPort.nativePort); + $p.close(); + return; + } + final $i = $MethodInvocation.fromMessage($m as List); + final $r = _$invokeMethod($p.sendPort.nativePort, $i); + ProtectedJniExtensions.returnResult($i.result, $r); + }); + return $x; + } +} + +abstract interface class $ExecutorServiceImpl { + factory $ExecutorServiceImpl({ + required void Function() shutdown, + required jni.JList Function() shutdownNow, + required bool Function() isShutdown, + required bool Function() isTerminated, + required bool Function(int j, jni.JObject timeUnit) awaitTermination, + }) = _$ExecutorServiceImpl; + + void shutdown(); + jni.JList shutdownNow(); + bool isShutdown(); + bool isTerminated(); + bool awaitTermination(int j, jni.JObject timeUnit); +} + +class _$ExecutorServiceImpl implements $ExecutorServiceImpl { + _$ExecutorServiceImpl({ + required void Function() shutdown, + required jni.JList Function() shutdownNow, + required bool Function() isShutdown, + required bool Function() isTerminated, + required bool Function(int j, jni.JObject timeUnit) awaitTermination, + }) : _shutdown = shutdown, + _shutdownNow = shutdownNow, + _isShutdown = isShutdown, + _isTerminated = isTerminated, + _awaitTermination = awaitTermination; + + final void Function() _shutdown; + final jni.JList Function() _shutdownNow; + final bool Function() _isShutdown; + final bool Function() _isTerminated; + final bool Function(int j, jni.JObject timeUnit) _awaitTermination; + + void shutdown() { + return _shutdown(); + } + + jni.JList shutdownNow() { + return _shutdownNow(); + } + + bool isShutdown() { + return _isShutdown(); + } + + bool isTerminated() { + return _isTerminated(); + } + + bool awaitTermination(int j, jni.JObject timeUnit) { + return _awaitTermination(j, timeUnit); + } +} + +final class $ExecutorServiceType extends jni.JObjType { + const $ExecutorServiceType(); + + @override + String get signature => r"Ljava/util/concurrent/ExecutorService;"; + + @override + ExecutorService fromReference(jni.JReference reference) => + ExecutorService.fromReference(reference); + + @override + jni.JObjType get superType => const jni.JObjectType(); + + @override + final superCount = 1; + + @override + int get hashCode => ($ExecutorServiceType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == ($ExecutorServiceType) && + other is $ExecutorServiceType; + } +} + /// from: okhttp3.Cache$Companion class Cache_Companion extends jni.JObject { @override diff --git a/pkgs/ok_http/lib/src/ok_http_client.dart b/pkgs/ok_http/lib/src/ok_http_client.dart index 33b1bfd5eb..c152ad18cc 100644 --- a/pkgs/ok_http/lib/src/ok_http_client.dart +++ b/pkgs/ok_http/lib/src/ok_http_client.dart @@ -56,15 +56,7 @@ class OkHttpClient extends BaseClient { if (!_isClosed) { // Refer to OkHttp documentation for the shutdown procedure: // https://square.github.io/okhttp/5.x/okhttp/okhttp3/-ok-http-client/index.html#:~:text=Shutdown - - // Bindings for `java.util.concurrent.ExecutorService` are erroneous. - // https://github.com/dart-lang/native/issues/588 - // So, use the JClass API to call the `shutdown` method by its signature. - _client - .dispatcher() - .executorService() - .jClass - .instanceMethodId('shutdown', '()V'); + _client.dispatcher().executorService().shutdown(); // Remove all idle connections from the resource pool. _client.connectionPool().evictAll(); From 4cb89e8c3c333f9af772c95642e8257f49c72399 Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Mon, 1 Jul 2024 15:59:35 +0530 Subject: [PATCH 03/27] generate bindings for okhttp websocket classes --- pkgs/ok_http/jnigen.yaml | 13 + pkgs/ok_http/lib/src/jni/bindings.dart | 2449 +++++++++++++++++++++++- 2 files changed, 2449 insertions(+), 13 deletions(-) diff --git a/pkgs/ok_http/jnigen.yaml b/pkgs/ok_http/jnigen.yaml index 02c055d1c5..587174b7b2 100644 --- a/pkgs/ok_http/jnigen.yaml +++ b/pkgs/ok_http/jnigen.yaml @@ -32,6 +32,9 @@ classes: - "com.example.ok_http.RedirectInterceptor" - "com.example.ok_http.AsyncInputStreamReader" - "com.example.ok_http.DataCallback" + - "okhttp3.WebSocket" + - "okhttp3.WebSocketListener" + - "okio.ByteString" # Exclude the deprecated methods listed below # They cause syntax errors during the `dart format` step of JNIGen. @@ -90,6 +93,16 @@ exclude: - "java.util.concurrent.ExecutorService#invokeAll" - "java.util.concurrent.ExecutorService#invokeAny" - "java.util.concurrent.ExecutorService#submit" + - "okio.ByteString$Companion#-deprecated_getByte" + - "okio.ByteString$Companion#-deprecated_size" + - 'okio.ByteString\$Companion#-deprecated_decodeBase64' + - 'okio.ByteString\$Companion#-deprecated_decodeHex' + - 'okio.ByteString\$Companion#-deprecated_encodeString' + - 'okio.ByteString\$Companion#-deprecated_encodeUtf8' + - 'okio.ByteString\$Companion#-deprecated_of' + - 'okio.ByteString\$Companion#-deprecated_read' + - "okio.ByteString#-deprecated_getByte" + - "okio.ByteString#-deprecated_size" preamble: | // ignore_for_file: prefer_single_quotes diff --git a/pkgs/ok_http/lib/src/jni/bindings.dart b/pkgs/ok_http/lib/src/jni/bindings.dart index 94e199a1ba..e2d677e3d8 100644 --- a/pkgs/ok_http/lib/src/jni/bindings.dart +++ b/pkgs/ok_http/lib/src/jni/bindings.dart @@ -1070,7 +1070,7 @@ class RequestBody_Companion extends jni.JObject { /// from: public final okhttp3.RequestBody create(okio.ByteString byteString, okhttp3.MediaType mediaType) /// The returned object must be released after use, by calling the [release] method. RequestBody create1( - jni.JObject byteString, + ByteString byteString, jni.JObject mediaType, ) { return _create1(reference.pointer, _id_create1 as jni.JMethodIDPtr, @@ -1195,7 +1195,7 @@ class RequestBody_Companion extends jni.JObject { /// The returned object must be released after use, by calling the [release] method. RequestBody create5( jni.JObject mediaType, - jni.JObject byteString, + ByteString byteString, ) { return _create5(reference.pointer, _id_create5 as jni.JMethodIDPtr, mediaType.reference.pointer, byteString.reference.pointer) @@ -1689,7 +1689,7 @@ class RequestBody extends jni.JObject { /// from: static public final okhttp3.RequestBody create(okio.ByteString byteString, okhttp3.MediaType mediaType) /// The returned object must be released after use, by calling the [release] method. static RequestBody create1( - jni.JObject byteString, + ByteString byteString, jni.JObject mediaType, ) { return _create1(_class.reference.pointer, _id_create1 as jni.JMethodIDPtr, @@ -1814,7 +1814,7 @@ class RequestBody extends jni.JObject { /// The returned object must be released after use, by calling the [release] method. static RequestBody create5( jni.JObject mediaType, - jni.JObject byteString, + ByteString byteString, ) { return _create5(_class.reference.pointer, _id_create5 as jni.JMethodIDPtr, mediaType.reference.pointer, byteString.reference.pointer) @@ -3505,7 +3505,7 @@ class ResponseBody_Companion extends jni.JObject { /// from: public final okhttp3.ResponseBody create(okio.ByteString byteString, okhttp3.MediaType mediaType) /// The returned object must be released after use, by calling the [release] method. ResponseBody create2( - jni.JObject byteString, + ByteString byteString, jni.JObject mediaType, ) { return _create2(reference.pointer, _id_create2 as jni.JMethodIDPtr, @@ -3628,7 +3628,7 @@ class ResponseBody_Companion extends jni.JObject { /// The returned object must be released after use, by calling the [release] method. ResponseBody create6( jni.JObject mediaType, - jni.JObject byteString, + ByteString byteString, ) { return _create6(reference.pointer, _id_create6 as jni.JMethodIDPtr, mediaType.reference.pointer, byteString.reference.pointer) @@ -3908,9 +3908,9 @@ class ResponseBody extends jni.JObject { /// from: public final okio.ByteString byteString() /// The returned object must be released after use, by calling the [release] method. - jni.JObject byteString() { + ByteString byteString() { return _byteString(reference.pointer, _id_byteString as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + .object(const $ByteStringType()); } static final _id_charStream = _class.instanceMethodId( @@ -4065,7 +4065,7 @@ class ResponseBody extends jni.JObject { /// from: static public final okhttp3.ResponseBody create(okio.ByteString byteString, okhttp3.MediaType mediaType) /// The returned object must be released after use, by calling the [release] method. static ResponseBody create2( - jni.JObject byteString, + ByteString byteString, jni.JObject mediaType, ) { return _create2(_class.reference.pointer, _id_create2 as jni.JMethodIDPtr, @@ -4188,7 +4188,7 @@ class ResponseBody extends jni.JObject { /// The returned object must be released after use, by calling the [release] method. static ResponseBody create6( jni.JObject mediaType, - jni.JObject byteString, + ByteString byteString, ) { return _create6(_class.reference.pointer, _id_create6 as jni.JMethodIDPtr, mediaType.reference.pointer, byteString.reference.pointer) @@ -6251,16 +6251,16 @@ class OkHttpClient extends jni.JObject { /// from: public okhttp3.WebSocket newWebSocket(okhttp3.Request request, okhttp3.WebSocketListener webSocketListener) /// The returned object must be released after use, by calling the [release] method. - jni.JObject newWebSocket( + WebSocket newWebSocket( Request request, - jni.JObject webSocketListener, + WebSocketListener webSocketListener, ) { return _newWebSocket( reference.pointer, _id_newWebSocket as jni.JMethodIDPtr, request.reference.pointer, webSocketListener.reference.pointer) - .object(const jni.JObjectType()); + .object(const $WebSocketType()); } static final _id_newBuilder = _class.instanceMethodId( @@ -10450,3 +10450,2426 @@ final class $DataCallbackType extends jni.JObjType { other is $DataCallbackType; } } + +/// from: okhttp3.WebSocket$Factory +class WebSocket_Factory extends jni.JObject { + @override + late final jni.JObjType $type = type; + + WebSocket_Factory.fromReference( + jni.JReference reference, + ) : super.fromReference(reference); + + static final _class = jni.JClass.forName(r"okhttp3/WebSocket$Factory"); + + /// The type which includes information such as the signature of this class. + static const type = $WebSocket_FactoryType(); + static final _id_newWebSocket = _class.instanceMethodId( + r"newWebSocket", + r"(Lokhttp3/Request;Lokhttp3/WebSocketListener;)Lokhttp3/WebSocket;", + ); + + static final _newWebSocket = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); + + /// from: public abstract okhttp3.WebSocket newWebSocket(okhttp3.Request request, okhttp3.WebSocketListener webSocketListener) + /// The returned object must be released after use, by calling the [release] method. + WebSocket newWebSocket( + Request request, + WebSocketListener webSocketListener, + ) { + return _newWebSocket( + reference.pointer, + _id_newWebSocket as jni.JMethodIDPtr, + request.reference.pointer, + webSocketListener.reference.pointer) + .object(const $WebSocketType()); + } + + /// Maps a specific port to the implemented interface. + static final Map _$impls = {}; + ReceivePort? _$p; + + static jni.JObjectPtr _$invoke( + int port, + jni.JObjectPtr descriptor, + jni.JObjectPtr args, + ) { + return _$invokeMethod( + port, + $MethodInvocation.fromAddresses( + 0, + descriptor.address, + args.address, + ), + ); + } + + static final ffi.Pointer< + ffi.NativeFunction< + jni.JObjectPtr Function( + ffi.Uint64, jni.JObjectPtr, jni.JObjectPtr)>> + _$invokePointer = ffi.Pointer.fromFunction(_$invoke); + + static ffi.Pointer _$invokeMethod( + int $p, + $MethodInvocation $i, + ) { + try { + final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); + final $a = $i.args; + if ($d == + r"newWebSocket(Lokhttp3/Request;Lokhttp3/WebSocketListener;)Lokhttp3/WebSocket;") { + final $r = _$impls[$p]!.newWebSocket( + $a[0].castTo(const $RequestType(), releaseOriginal: true), + $a[1].castTo(const $WebSocketListenerType(), releaseOriginal: true), + ); + return ($r as jni.JObject) + .castTo(const jni.JObjectType()) + .reference + .toPointer(); + } + } catch (e) { + return ProtectedJniExtensions.newDartException(e); + } + return jni.nullptr; + } + + factory WebSocket_Factory.implement( + $WebSocket_FactoryImpl $impl, + ) { + final $p = ReceivePort(); + final $x = WebSocket_Factory.fromReference( + ProtectedJniExtensions.newPortProxy( + r"okhttp3.WebSocket$Factory", + $p, + _$invokePointer, + ), + ).._$p = $p; + final $a = $p.sendPort.nativePort; + _$impls[$a] = $impl; + $p.listen(($m) { + if ($m == null) { + _$impls.remove($p.sendPort.nativePort); + $p.close(); + return; + } + final $i = $MethodInvocation.fromMessage($m as List); + final $r = _$invokeMethod($p.sendPort.nativePort, $i); + ProtectedJniExtensions.returnResult($i.result, $r); + }); + return $x; + } +} + +abstract interface class $WebSocket_FactoryImpl { + factory $WebSocket_FactoryImpl({ + required WebSocket Function( + Request request, WebSocketListener webSocketListener) + newWebSocket, + }) = _$WebSocket_FactoryImpl; + + WebSocket newWebSocket(Request request, WebSocketListener webSocketListener); +} + +class _$WebSocket_FactoryImpl implements $WebSocket_FactoryImpl { + _$WebSocket_FactoryImpl({ + required WebSocket Function( + Request request, WebSocketListener webSocketListener) + newWebSocket, + }) : _newWebSocket = newWebSocket; + + final WebSocket Function(Request request, WebSocketListener webSocketListener) + _newWebSocket; + + WebSocket newWebSocket(Request request, WebSocketListener webSocketListener) { + return _newWebSocket(request, webSocketListener); + } +} + +final class $WebSocket_FactoryType extends jni.JObjType { + const $WebSocket_FactoryType(); + + @override + String get signature => r"Lokhttp3/WebSocket$Factory;"; + + @override + WebSocket_Factory fromReference(jni.JReference reference) => + WebSocket_Factory.fromReference(reference); + + @override + jni.JObjType get superType => const jni.JObjectType(); + + @override + final superCount = 1; + + @override + int get hashCode => ($WebSocket_FactoryType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == ($WebSocket_FactoryType) && + other is $WebSocket_FactoryType; + } +} + +/// from: okhttp3.WebSocket +class WebSocket extends jni.JObject { + @override + late final jni.JObjType $type = type; + + WebSocket.fromReference( + jni.JReference reference, + ) : super.fromReference(reference); + + static final _class = jni.JClass.forName(r"okhttp3/WebSocket"); + + /// The type which includes information such as the signature of this class. + static const type = $WebSocketType(); + static final _id_request = _class.instanceMethodId( + r"request", + r"()Lokhttp3/Request;", + ); + + static final _request = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public abstract okhttp3.Request request() + /// The returned object must be released after use, by calling the [release] method. + Request request() { + return _request(reference.pointer, _id_request as jni.JMethodIDPtr) + .object(const $RequestType()); + } + + static final _id_queueSize = _class.instanceMethodId( + r"queueSize", + r"()J", + ); + + static final _queueSize = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallLongMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public abstract long queueSize() + int queueSize() { + return _queueSize(reference.pointer, _id_queueSize as jni.JMethodIDPtr) + .long; + } + + static final _id_send = _class.instanceMethodId( + r"send", + r"(Ljava/lang/String;)Z", + ); + + static final _send = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallBooleanMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public abstract boolean send(java.lang.String string) + bool send( + jni.JString string, + ) { + return _send(reference.pointer, _id_send as jni.JMethodIDPtr, + string.reference.pointer) + .boolean; + } + + static final _id_send1 = _class.instanceMethodId( + r"send", + r"(Lokio/ByteString;)Z", + ); + + static final _send1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallBooleanMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public abstract boolean send(okio.ByteString byteString) + bool send1( + ByteString byteString, + ) { + return _send1(reference.pointer, _id_send1 as jni.JMethodIDPtr, + byteString.reference.pointer) + .boolean; + } + + static final _id_close = _class.instanceMethodId( + r"close", + r"(ILjava/lang/String;)Z", + ); + + static final _close = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<($Int32, ffi.Pointer)>)>>( + "globalEnv_CallBooleanMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, + ffi.Pointer)>(); + + /// from: public abstract boolean close(int i, java.lang.String string) + bool close( + int i, + jni.JString string, + ) { + return _close(reference.pointer, _id_close as jni.JMethodIDPtr, i, + string.reference.pointer) + .boolean; + } + + static final _id_cancel = _class.instanceMethodId( + r"cancel", + r"()V", + ); + + static final _cancel = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public abstract void cancel() + void cancel() { + _cancel(reference.pointer, _id_cancel as jni.JMethodIDPtr).check(); + } + + /// Maps a specific port to the implemented interface. + static final Map _$impls = {}; + ReceivePort? _$p; + + static jni.JObjectPtr _$invoke( + int port, + jni.JObjectPtr descriptor, + jni.JObjectPtr args, + ) { + return _$invokeMethod( + port, + $MethodInvocation.fromAddresses( + 0, + descriptor.address, + args.address, + ), + ); + } + + static final ffi.Pointer< + ffi.NativeFunction< + jni.JObjectPtr Function( + ffi.Uint64, jni.JObjectPtr, jni.JObjectPtr)>> + _$invokePointer = ffi.Pointer.fromFunction(_$invoke); + + static ffi.Pointer _$invokeMethod( + int $p, + $MethodInvocation $i, + ) { + try { + final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); + final $a = $i.args; + if ($d == r"request()Lokhttp3/Request;") { + final $r = _$impls[$p]!.request(); + return ($r as jni.JObject) + .castTo(const jni.JObjectType()) + .reference + .toPointer(); + } + if ($d == r"queueSize()J") { + final $r = _$impls[$p]!.queueSize(); + return jni.JLong($r).reference.toPointer(); + } + if ($d == r"send(Ljava/lang/String;)Z") { + final $r = _$impls[$p]!.send( + $a[0].castTo(const jni.JStringType(), releaseOriginal: true), + ); + return jni.JBoolean($r).reference.toPointer(); + } + if ($d == r"send(Lokio/ByteString;)Z") { + final $r = _$impls[$p]!.send1( + $a[0].castTo(const $ByteStringType(), releaseOriginal: true), + ); + return jni.JBoolean($r).reference.toPointer(); + } + if ($d == r"close(ILjava/lang/String;)Z") { + final $r = _$impls[$p]!.close( + $a[0] + .castTo(const jni.JIntegerType(), releaseOriginal: true) + .intValue(releaseOriginal: true), + $a[1].castTo(const jni.JStringType(), releaseOriginal: true), + ); + return jni.JBoolean($r).reference.toPointer(); + } + if ($d == r"cancel()V") { + _$impls[$p]!.cancel(); + return jni.nullptr; + } + } catch (e) { + return ProtectedJniExtensions.newDartException(e); + } + return jni.nullptr; + } + + factory WebSocket.implement( + $WebSocketImpl $impl, + ) { + final $p = ReceivePort(); + final $x = WebSocket.fromReference( + ProtectedJniExtensions.newPortProxy( + r"okhttp3.WebSocket", + $p, + _$invokePointer, + ), + ).._$p = $p; + final $a = $p.sendPort.nativePort; + _$impls[$a] = $impl; + $p.listen(($m) { + if ($m == null) { + _$impls.remove($p.sendPort.nativePort); + $p.close(); + return; + } + final $i = $MethodInvocation.fromMessage($m as List); + final $r = _$invokeMethod($p.sendPort.nativePort, $i); + ProtectedJniExtensions.returnResult($i.result, $r); + }); + return $x; + } +} + +abstract interface class $WebSocketImpl { + factory $WebSocketImpl({ + required Request Function() request, + required int Function() queueSize, + required bool Function(jni.JString string) send, + required bool Function(ByteString byteString) send1, + required bool Function(int i, jni.JString string) close, + required void Function() cancel, + }) = _$WebSocketImpl; + + Request request(); + int queueSize(); + bool send(jni.JString string); + bool send1(ByteString byteString); + bool close(int i, jni.JString string); + void cancel(); +} + +class _$WebSocketImpl implements $WebSocketImpl { + _$WebSocketImpl({ + required Request Function() request, + required int Function() queueSize, + required bool Function(jni.JString string) send, + required bool Function(ByteString byteString) send1, + required bool Function(int i, jni.JString string) close, + required void Function() cancel, + }) : _request = request, + _queueSize = queueSize, + _send = send, + _send1 = send1, + _close = close, + _cancel = cancel; + + final Request Function() _request; + final int Function() _queueSize; + final bool Function(jni.JString string) _send; + final bool Function(ByteString byteString) _send1; + final bool Function(int i, jni.JString string) _close; + final void Function() _cancel; + + Request request() { + return _request(); + } + + int queueSize() { + return _queueSize(); + } + + bool send(jni.JString string) { + return _send(string); + } + + bool send1(ByteString byteString) { + return _send1(byteString); + } + + bool close(int i, jni.JString string) { + return _close(i, string); + } + + void cancel() { + return _cancel(); + } +} + +final class $WebSocketType extends jni.JObjType { + const $WebSocketType(); + + @override + String get signature => r"Lokhttp3/WebSocket;"; + + @override + WebSocket fromReference(jni.JReference reference) => + WebSocket.fromReference(reference); + + @override + jni.JObjType get superType => const jni.JObjectType(); + + @override + final superCount = 1; + + @override + int get hashCode => ($WebSocketType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == ($WebSocketType) && other is $WebSocketType; + } +} + +/// from: okhttp3.WebSocketListener +class WebSocketListener extends jni.JObject { + @override + late final jni.JObjType $type = type; + + WebSocketListener.fromReference( + jni.JReference reference, + ) : super.fromReference(reference); + + static final _class = jni.JClass.forName(r"okhttp3/WebSocketListener"); + + /// The type which includes information such as the signature of this class. + static const type = $WebSocketListenerType(); + static final _id_new0 = _class.constructorId( + r"()V", + ); + + static final _new0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_NewObject") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public void () + /// The returned object must be released after use, by calling the [release] method. + factory WebSocketListener() { + return WebSocketListener.fromReference( + _new0(_class.reference.pointer, _id_new0 as jni.JMethodIDPtr) + .reference); + } + + static final _id_onOpen = _class.instanceMethodId( + r"onOpen", + r"(Lokhttp3/WebSocket;Lokhttp3/Response;)V", + ); + + static final _onOpen = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); + + /// from: public void onOpen(okhttp3.WebSocket webSocket, okhttp3.Response response) + void onOpen( + WebSocket webSocket, + Response response, + ) { + _onOpen(reference.pointer, _id_onOpen as jni.JMethodIDPtr, + webSocket.reference.pointer, response.reference.pointer) + .check(); + } + + static final _id_onMessage = _class.instanceMethodId( + r"onMessage", + r"(Lokhttp3/WebSocket;Ljava/lang/String;)V", + ); + + static final _onMessage = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); + + /// from: public void onMessage(okhttp3.WebSocket webSocket, java.lang.String string) + void onMessage( + WebSocket webSocket, + jni.JString string, + ) { + _onMessage(reference.pointer, _id_onMessage as jni.JMethodIDPtr, + webSocket.reference.pointer, string.reference.pointer) + .check(); + } + + static final _id_onMessage1 = _class.instanceMethodId( + r"onMessage", + r"(Lokhttp3/WebSocket;Lokio/ByteString;)V", + ); + + static final _onMessage1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); + + /// from: public void onMessage(okhttp3.WebSocket webSocket, okio.ByteString byteString) + void onMessage1( + WebSocket webSocket, + ByteString byteString, + ) { + _onMessage1(reference.pointer, _id_onMessage1 as jni.JMethodIDPtr, + webSocket.reference.pointer, byteString.reference.pointer) + .check(); + } + + static final _id_onClosing = _class.instanceMethodId( + r"onClosing", + r"(Lokhttp3/WebSocket;ILjava/lang/String;)V", + ); + + static final _onClosing = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + $Int32, + ffi.Pointer + )>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, int, ffi.Pointer)>(); + + /// from: public void onClosing(okhttp3.WebSocket webSocket, int i, java.lang.String string) + void onClosing( + WebSocket webSocket, + int i, + jni.JString string, + ) { + _onClosing(reference.pointer, _id_onClosing as jni.JMethodIDPtr, + webSocket.reference.pointer, i, string.reference.pointer) + .check(); + } + + static final _id_onClosed = _class.instanceMethodId( + r"onClosed", + r"(Lokhttp3/WebSocket;ILjava/lang/String;)V", + ); + + static final _onClosed = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + $Int32, + ffi.Pointer + )>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, int, ffi.Pointer)>(); + + /// from: public void onClosed(okhttp3.WebSocket webSocket, int i, java.lang.String string) + void onClosed( + WebSocket webSocket, + int i, + jni.JString string, + ) { + _onClosed(reference.pointer, _id_onClosed as jni.JMethodIDPtr, + webSocket.reference.pointer, i, string.reference.pointer) + .check(); + } + + static final _id_onFailure = _class.instanceMethodId( + r"onFailure", + r"(Lokhttp3/WebSocket;Ljava/lang/Throwable;Lokhttp3/Response;)V", + ); + + static final _onFailure = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + /// from: public void onFailure(okhttp3.WebSocket webSocket, java.lang.Throwable throwable, okhttp3.Response response) + void onFailure( + WebSocket webSocket, + jni.JObject throwable, + Response response, + ) { + _onFailure( + reference.pointer, + _id_onFailure as jni.JMethodIDPtr, + webSocket.reference.pointer, + throwable.reference.pointer, + response.reference.pointer) + .check(); + } +} + +final class $WebSocketListenerType extends jni.JObjType { + const $WebSocketListenerType(); + + @override + String get signature => r"Lokhttp3/WebSocketListener;"; + + @override + WebSocketListener fromReference(jni.JReference reference) => + WebSocketListener.fromReference(reference); + + @override + jni.JObjType get superType => const jni.JObjectType(); + + @override + final superCount = 1; + + @override + int get hashCode => ($WebSocketListenerType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == ($WebSocketListenerType) && + other is $WebSocketListenerType; + } +} + +/// from: okio.ByteString$Companion +class ByteString_Companion extends jni.JObject { + @override + late final jni.JObjType $type = type; + + ByteString_Companion.fromReference( + jni.JReference reference, + ) : super.fromReference(reference); + + static final _class = jni.JClass.forName(r"okio/ByteString$Companion"); + + /// The type which includes information such as the signature of this class. + static const type = $ByteString_CompanionType(); + static final _id_of = _class.instanceMethodId( + r"of", + r"([B)Lokio/ByteString;", + ); + + static final _of = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public final okio.ByteString of(byte[] bs) + /// The returned object must be released after use, by calling the [release] method. + ByteString of( + jni.JArray bs, + ) { + return _of( + reference.pointer, _id_of as jni.JMethodIDPtr, bs.reference.pointer) + .object(const $ByteStringType()); + } + + static final _id_of1 = _class.instanceMethodId( + r"of", + r"([BII)Lokio/ByteString;", + ); + + static final _of1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer, $Int32, $Int32)>)>>( + "globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, int, int)>(); + + /// from: public final okio.ByteString of(byte[] bs, int i, int i1) + /// The returned object must be released after use, by calling the [release] method. + ByteString of1( + jni.JArray bs, + int i, + int i1, + ) { + return _of1(reference.pointer, _id_of1 as jni.JMethodIDPtr, + bs.reference.pointer, i, i1) + .object(const $ByteStringType()); + } + + static final _id_of2 = _class.instanceMethodId( + r"of", + r"(Ljava/nio/ByteBuffer;)Lokio/ByteString;", + ); + + static final _of2 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public final okio.ByteString of(java.nio.ByteBuffer byteBuffer) + /// The returned object must be released after use, by calling the [release] method. + ByteString of2( + jni.JByteBuffer byteBuffer, + ) { + return _of2(reference.pointer, _id_of2 as jni.JMethodIDPtr, + byteBuffer.reference.pointer) + .object(const $ByteStringType()); + } + + static final _id_encodeUtf8 = _class.instanceMethodId( + r"encodeUtf8", + r"(Ljava/lang/String;)Lokio/ByteString;", + ); + + static final _encodeUtf8 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public final okio.ByteString encodeUtf8(java.lang.String string) + /// The returned object must be released after use, by calling the [release] method. + ByteString encodeUtf8( + jni.JString string, + ) { + return _encodeUtf8(reference.pointer, _id_encodeUtf8 as jni.JMethodIDPtr, + string.reference.pointer) + .object(const $ByteStringType()); + } + + static final _id_encodeString = _class.instanceMethodId( + r"encodeString", + r"(Ljava/lang/String;Ljava/nio/charset/Charset;)Lokio/ByteString;", + ); + + static final _encodeString = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); + + /// from: public final okio.ByteString encodeString(java.lang.String string, java.nio.charset.Charset charset) + /// The returned object must be released after use, by calling the [release] method. + ByteString encodeString( + jni.JString string, + jni.JObject charset, + ) { + return _encodeString( + reference.pointer, + _id_encodeString as jni.JMethodIDPtr, + string.reference.pointer, + charset.reference.pointer) + .object(const $ByteStringType()); + } + + static final _id_decodeBase64 = _class.instanceMethodId( + r"decodeBase64", + r"(Ljava/lang/String;)Lokio/ByteString;", + ); + + static final _decodeBase64 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public final okio.ByteString decodeBase64(java.lang.String string) + /// The returned object must be released after use, by calling the [release] method. + ByteString decodeBase64( + jni.JString string, + ) { + return _decodeBase64(reference.pointer, + _id_decodeBase64 as jni.JMethodIDPtr, string.reference.pointer) + .object(const $ByteStringType()); + } + + static final _id_decodeHex = _class.instanceMethodId( + r"decodeHex", + r"(Ljava/lang/String;)Lokio/ByteString;", + ); + + static final _decodeHex = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public final okio.ByteString decodeHex(java.lang.String string) + /// The returned object must be released after use, by calling the [release] method. + ByteString decodeHex( + jni.JString string, + ) { + return _decodeHex(reference.pointer, _id_decodeHex as jni.JMethodIDPtr, + string.reference.pointer) + .object(const $ByteStringType()); + } + + static final _id_read = _class.instanceMethodId( + r"read", + r"(Ljava/io/InputStream;I)Lokio/ByteString;", + ); + + static final _read = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer, $Int32)>)>>( + "globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, int)>(); + + /// from: public final okio.ByteString read(java.io.InputStream inputStream, int i) + /// The returned object must be released after use, by calling the [release] method. + ByteString read( + jni.JObject inputStream, + int i, + ) { + return _read(reference.pointer, _id_read as jni.JMethodIDPtr, + inputStream.reference.pointer, i) + .object(const $ByteStringType()); + } + + static final _id_new0 = _class.constructorId( + r"(Lkotlin/jvm/internal/DefaultConstructorMarker;)V", + ); + + static final _new0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_NewObject") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public void (kotlin.jvm.internal.DefaultConstructorMarker defaultConstructorMarker) + /// The returned object must be released after use, by calling the [release] method. + factory ByteString_Companion( + jni.JObject defaultConstructorMarker, + ) { + return ByteString_Companion.fromReference(_new0( + _class.reference.pointer, + _id_new0 as jni.JMethodIDPtr, + defaultConstructorMarker.reference.pointer) + .reference); + } +} + +final class $ByteString_CompanionType + extends jni.JObjType { + const $ByteString_CompanionType(); + + @override + String get signature => r"Lokio/ByteString$Companion;"; + + @override + ByteString_Companion fromReference(jni.JReference reference) => + ByteString_Companion.fromReference(reference); + + @override + jni.JObjType get superType => const jni.JObjectType(); + + @override + final superCount = 1; + + @override + int get hashCode => ($ByteString_CompanionType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == ($ByteString_CompanionType) && + other is $ByteString_CompanionType; + } +} + +/// from: okio.ByteString +class ByteString extends jni.JObject { + @override + late final jni.JObjType $type = type; + + ByteString.fromReference( + jni.JReference reference, + ) : super.fromReference(reference); + + static final _class = jni.JClass.forName(r"okio/ByteString"); + + /// The type which includes information such as the signature of this class. + static const type = $ByteStringType(); + static final _id_Companion = _class.staticFieldId( + r"Companion", + r"Lokio/ByteString$Companion;", + ); + + /// from: static public final okio.ByteString$Companion Companion + /// The returned object must be released after use, by calling the [release] method. + static ByteString_Companion get Companion => + _id_Companion.get(_class, const $ByteString_CompanionType()); + + static final _id_EMPTY = _class.staticFieldId( + r"EMPTY", + r"Lokio/ByteString;", + ); + + /// from: static public final okio.ByteString EMPTY + /// The returned object must be released after use, by calling the [release] method. + static ByteString get EMPTY => _id_EMPTY.get(_class, const $ByteStringType()); + + static final _id_new0 = _class.constructorId( + r"([B)V", + ); + + static final _new0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_NewObject") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public void (byte[] bs) + /// The returned object must be released after use, by calling the [release] method. + factory ByteString( + jni.JArray bs, + ) { + return ByteString.fromReference(_new0(_class.reference.pointer, + _id_new0 as jni.JMethodIDPtr, bs.reference.pointer) + .reference); + } + + static final _id_utf8 = _class.instanceMethodId( + r"utf8", + r"()Ljava/lang/String;", + ); + + static final _utf8 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public java.lang.String utf8() + /// The returned object must be released after use, by calling the [release] method. + jni.JString utf8() { + return _utf8(reference.pointer, _id_utf8 as jni.JMethodIDPtr) + .object(const jni.JStringType()); + } + + static final _id_string = _class.instanceMethodId( + r"string", + r"(Ljava/nio/charset/Charset;)Ljava/lang/String;", + ); + + static final _string = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public java.lang.String string(java.nio.charset.Charset charset) + /// The returned object must be released after use, by calling the [release] method. + jni.JString string( + jni.JObject charset, + ) { + return _string(reference.pointer, _id_string as jni.JMethodIDPtr, + charset.reference.pointer) + .object(const jni.JStringType()); + } + + static final _id_base64 = _class.instanceMethodId( + r"base64", + r"()Ljava/lang/String;", + ); + + static final _base64 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public java.lang.String base64() + /// The returned object must be released after use, by calling the [release] method. + jni.JString base64() { + return _base64(reference.pointer, _id_base64 as jni.JMethodIDPtr) + .object(const jni.JStringType()); + } + + static final _id_md5 = _class.instanceMethodId( + r"md5", + r"()Lokio/ByteString;", + ); + + static final _md5 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public final okio.ByteString md5() + /// The returned object must be released after use, by calling the [release] method. + ByteString md5() { + return _md5(reference.pointer, _id_md5 as jni.JMethodIDPtr) + .object(const $ByteStringType()); + } + + static final _id_sha1 = _class.instanceMethodId( + r"sha1", + r"()Lokio/ByteString;", + ); + + static final _sha1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public final okio.ByteString sha1() + /// The returned object must be released after use, by calling the [release] method. + ByteString sha1() { + return _sha1(reference.pointer, _id_sha1 as jni.JMethodIDPtr) + .object(const $ByteStringType()); + } + + static final _id_sha256 = _class.instanceMethodId( + r"sha256", + r"()Lokio/ByteString;", + ); + + static final _sha256 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public final okio.ByteString sha256() + /// The returned object must be released after use, by calling the [release] method. + ByteString sha256() { + return _sha256(reference.pointer, _id_sha256 as jni.JMethodIDPtr) + .object(const $ByteStringType()); + } + + static final _id_sha512 = _class.instanceMethodId( + r"sha512", + r"()Lokio/ByteString;", + ); + + static final _sha512 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public final okio.ByteString sha512() + /// The returned object must be released after use, by calling the [release] method. + ByteString sha512() { + return _sha512(reference.pointer, _id_sha512 as jni.JMethodIDPtr) + .object(const $ByteStringType()); + } + + static final _id_hmacSha1 = _class.instanceMethodId( + r"hmacSha1", + r"(Lokio/ByteString;)Lokio/ByteString;", + ); + + static final _hmacSha1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public okio.ByteString hmacSha1(okio.ByteString byteString) + /// The returned object must be released after use, by calling the [release] method. + ByteString hmacSha1( + ByteString byteString, + ) { + return _hmacSha1(reference.pointer, _id_hmacSha1 as jni.JMethodIDPtr, + byteString.reference.pointer) + .object(const $ByteStringType()); + } + + static final _id_hmacSha256 = _class.instanceMethodId( + r"hmacSha256", + r"(Lokio/ByteString;)Lokio/ByteString;", + ); + + static final _hmacSha256 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public okio.ByteString hmacSha256(okio.ByteString byteString) + /// The returned object must be released after use, by calling the [release] method. + ByteString hmacSha256( + ByteString byteString, + ) { + return _hmacSha256(reference.pointer, _id_hmacSha256 as jni.JMethodIDPtr, + byteString.reference.pointer) + .object(const $ByteStringType()); + } + + static final _id_hmacSha512 = _class.instanceMethodId( + r"hmacSha512", + r"(Lokio/ByteString;)Lokio/ByteString;", + ); + + static final _hmacSha512 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public okio.ByteString hmacSha512(okio.ByteString byteString) + /// The returned object must be released after use, by calling the [release] method. + ByteString hmacSha512( + ByteString byteString, + ) { + return _hmacSha512(reference.pointer, _id_hmacSha512 as jni.JMethodIDPtr, + byteString.reference.pointer) + .object(const $ByteStringType()); + } + + static final _id_base64Url = _class.instanceMethodId( + r"base64Url", + r"()Ljava/lang/String;", + ); + + static final _base64Url = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public java.lang.String base64Url() + /// The returned object must be released after use, by calling the [release] method. + jni.JString base64Url() { + return _base64Url(reference.pointer, _id_base64Url as jni.JMethodIDPtr) + .object(const jni.JStringType()); + } + + static final _id_hex = _class.instanceMethodId( + r"hex", + r"()Ljava/lang/String;", + ); + + static final _hex = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public java.lang.String hex() + /// The returned object must be released after use, by calling the [release] method. + jni.JString hex() { + return _hex(reference.pointer, _id_hex as jni.JMethodIDPtr) + .object(const jni.JStringType()); + } + + static final _id_toAsciiLowercase = _class.instanceMethodId( + r"toAsciiLowercase", + r"()Lokio/ByteString;", + ); + + static final _toAsciiLowercase = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public okio.ByteString toAsciiLowercase() + /// The returned object must be released after use, by calling the [release] method. + ByteString toAsciiLowercase() { + return _toAsciiLowercase( + reference.pointer, _id_toAsciiLowercase as jni.JMethodIDPtr) + .object(const $ByteStringType()); + } + + static final _id_toAsciiUppercase = _class.instanceMethodId( + r"toAsciiUppercase", + r"()Lokio/ByteString;", + ); + + static final _toAsciiUppercase = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public okio.ByteString toAsciiUppercase() + /// The returned object must be released after use, by calling the [release] method. + ByteString toAsciiUppercase() { + return _toAsciiUppercase( + reference.pointer, _id_toAsciiUppercase as jni.JMethodIDPtr) + .object(const $ByteStringType()); + } + + static final _id_substring = _class.instanceMethodId( + r"substring", + r"(II)Lokio/ByteString;", + ); + + static final _substring = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.VarArgs<($Int32, $Int32)>)>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, jni.JMethodIDPtr, int, int)>(); + + /// from: public okio.ByteString substring(int i, int i1) + /// The returned object must be released after use, by calling the [release] method. + ByteString substring( + int i, + int i1, + ) { + return _substring( + reference.pointer, _id_substring as jni.JMethodIDPtr, i, i1) + .object(const $ByteStringType()); + } + + static final _id_getByte = _class.instanceMethodId( + r"getByte", + r"(I)B", + ); + + static final _getByte = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.VarArgs<($Int32,)>)>>("globalEnv_CallByteMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, jni.JMethodIDPtr, int)>(); + + /// from: public final byte getByte(int i) + int getByte( + int i, + ) { + return _getByte(reference.pointer, _id_getByte as jni.JMethodIDPtr, i).byte; + } + + static final _id_size = _class.instanceMethodId( + r"size", + r"()I", + ); + + static final _size = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallIntMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public final int size() + int size() { + return _size(reference.pointer, _id_size as jni.JMethodIDPtr).integer; + } + + static final _id_toByteArray = _class.instanceMethodId( + r"toByteArray", + r"()[B", + ); + + static final _toByteArray = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public byte[] toByteArray() + /// The returned object must be released after use, by calling the [release] method. + jni.JArray toByteArray() { + return _toByteArray(reference.pointer, _id_toByteArray as jni.JMethodIDPtr) + .object(const jni.JArrayType(jni.jbyteType())); + } + + static final _id_asByteBuffer = _class.instanceMethodId( + r"asByteBuffer", + r"()Ljava/nio/ByteBuffer;", + ); + + static final _asByteBuffer = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public java.nio.ByteBuffer asByteBuffer() + /// The returned object must be released after use, by calling the [release] method. + jni.JByteBuffer asByteBuffer() { + return _asByteBuffer( + reference.pointer, _id_asByteBuffer as jni.JMethodIDPtr) + .object(const jni.JByteBufferType()); + } + + static final _id_write = _class.instanceMethodId( + r"write", + r"(Ljava/io/OutputStream;)V", + ); + + static final _write = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public void write(java.io.OutputStream outputStream) + void write( + jni.JObject outputStream, + ) { + _write(reference.pointer, _id_write as jni.JMethodIDPtr, + outputStream.reference.pointer) + .check(); + } + + static final _id_rangeEquals = _class.instanceMethodId( + r"rangeEquals", + r"(ILokio/ByteString;II)Z", + ); + + static final _rangeEquals = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + $Int32, + ffi.Pointer, + $Int32, + $Int32 + )>)>>("globalEnv_CallBooleanMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, + ffi.Pointer, int, int)>(); + + /// from: public boolean rangeEquals(int i, okio.ByteString byteString, int i1, int i2) + bool rangeEquals( + int i, + ByteString byteString, + int i1, + int i2, + ) { + return _rangeEquals(reference.pointer, _id_rangeEquals as jni.JMethodIDPtr, + i, byteString.reference.pointer, i1, i2) + .boolean; + } + + static final _id_rangeEquals1 = _class.instanceMethodId( + r"rangeEquals", + r"(I[BII)Z", + ); + + static final _rangeEquals1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + $Int32, + ffi.Pointer, + $Int32, + $Int32 + )>)>>("globalEnv_CallBooleanMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, + ffi.Pointer, int, int)>(); + + /// from: public boolean rangeEquals(int i, byte[] bs, int i1, int i2) + bool rangeEquals1( + int i, + jni.JArray bs, + int i1, + int i2, + ) { + return _rangeEquals1( + reference.pointer, + _id_rangeEquals1 as jni.JMethodIDPtr, + i, + bs.reference.pointer, + i1, + i2) + .boolean; + } + + static final _id_copyInto = _class.instanceMethodId( + r"copyInto", + r"(I[BII)V", + ); + + static final _copyInto = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + $Int32, + ffi.Pointer, + $Int32, + $Int32 + )>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + int, ffi.Pointer, int, int)>(); + + /// from: public void copyInto(int i, byte[] bs, int i1, int i2) + void copyInto( + int i, + jni.JArray bs, + int i1, + int i2, + ) { + _copyInto(reference.pointer, _id_copyInto as jni.JMethodIDPtr, i, + bs.reference.pointer, i1, i2) + .check(); + } + + static final _id_startsWith = _class.instanceMethodId( + r"startsWith", + r"(Lokio/ByteString;)Z", + ); + + static final _startsWith = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallBooleanMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public final boolean startsWith(okio.ByteString byteString) + bool startsWith( + ByteString byteString, + ) { + return _startsWith(reference.pointer, _id_startsWith as jni.JMethodIDPtr, + byteString.reference.pointer) + .boolean; + } + + static final _id_startsWith1 = _class.instanceMethodId( + r"startsWith", + r"([B)Z", + ); + + static final _startsWith1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallBooleanMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public final boolean startsWith(byte[] bs) + bool startsWith1( + jni.JArray bs, + ) { + return _startsWith1(reference.pointer, _id_startsWith1 as jni.JMethodIDPtr, + bs.reference.pointer) + .boolean; + } + + static final _id_endsWith = _class.instanceMethodId( + r"endsWith", + r"(Lokio/ByteString;)Z", + ); + + static final _endsWith = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallBooleanMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public final boolean endsWith(okio.ByteString byteString) + bool endsWith( + ByteString byteString, + ) { + return _endsWith(reference.pointer, _id_endsWith as jni.JMethodIDPtr, + byteString.reference.pointer) + .boolean; + } + + static final _id_endsWith1 = _class.instanceMethodId( + r"endsWith", + r"([B)Z", + ); + + static final _endsWith1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallBooleanMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public final boolean endsWith(byte[] bs) + bool endsWith1( + jni.JArray bs, + ) { + return _endsWith1(reference.pointer, _id_endsWith1 as jni.JMethodIDPtr, + bs.reference.pointer) + .boolean; + } + + static final _id_indexOf = _class.instanceMethodId( + r"indexOf", + r"(Lokio/ByteString;I)I", + ); + + static final _indexOf = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer, $Int32)>)>>( + "globalEnv_CallIntMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, int)>(); + + /// from: public final int indexOf(okio.ByteString byteString, int i) + int indexOf( + ByteString byteString, + int i, + ) { + return _indexOf(reference.pointer, _id_indexOf as jni.JMethodIDPtr, + byteString.reference.pointer, i) + .integer; + } + + static final _id_indexOf1 = _class.instanceMethodId( + r"indexOf", + r"([BI)I", + ); + + static final _indexOf1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer, $Int32)>)>>( + "globalEnv_CallIntMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, int)>(); + + /// from: public int indexOf(byte[] bs, int i) + int indexOf1( + jni.JArray bs, + int i, + ) { + return _indexOf1(reference.pointer, _id_indexOf1 as jni.JMethodIDPtr, + bs.reference.pointer, i) + .integer; + } + + static final _id_lastIndexOf = _class.instanceMethodId( + r"lastIndexOf", + r"(Lokio/ByteString;I)I", + ); + + static final _lastIndexOf = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer, $Int32)>)>>( + "globalEnv_CallIntMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, int)>(); + + /// from: public final int lastIndexOf(okio.ByteString byteString, int i) + int lastIndexOf( + ByteString byteString, + int i, + ) { + return _lastIndexOf(reference.pointer, _id_lastIndexOf as jni.JMethodIDPtr, + byteString.reference.pointer, i) + .integer; + } + + static final _id_lastIndexOf1 = _class.instanceMethodId( + r"lastIndexOf", + r"([BI)I", + ); + + static final _lastIndexOf1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer, $Int32)>)>>( + "globalEnv_CallIntMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, int)>(); + + /// from: public int lastIndexOf(byte[] bs, int i) + int lastIndexOf1( + jni.JArray bs, + int i, + ) { + return _lastIndexOf1(reference.pointer, + _id_lastIndexOf1 as jni.JMethodIDPtr, bs.reference.pointer, i) + .integer; + } + + static final _id_equals = _class.instanceMethodId( + r"equals", + r"(Ljava/lang/Object;)Z", + ); + + static final _equals = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallBooleanMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public boolean equals(java.lang.Object object) + bool equals( + jni.JObject object, + ) { + return _equals(reference.pointer, _id_equals as jni.JMethodIDPtr, + object.reference.pointer) + .boolean; + } + + static final _id_hashCode1 = _class.instanceMethodId( + r"hashCode", + r"()I", + ); + + static final _hashCode1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallIntMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public int hashCode() + int hashCode1() { + return _hashCode1(reference.pointer, _id_hashCode1 as jni.JMethodIDPtr) + .integer; + } + + static final _id_compareTo = _class.instanceMethodId( + r"compareTo", + r"(Lokio/ByteString;)I", + ); + + static final _compareTo = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallIntMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public int compareTo(okio.ByteString byteString) + int compareTo( + ByteString byteString, + ) { + return _compareTo(reference.pointer, _id_compareTo as jni.JMethodIDPtr, + byteString.reference.pointer) + .integer; + } + + static final _id_toString1 = _class.instanceMethodId( + r"toString", + r"()Ljava/lang/String;", + ); + + static final _toString1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public java.lang.String toString() + /// The returned object must be released after use, by calling the [release] method. + jni.JString toString1() { + return _toString1(reference.pointer, _id_toString1 as jni.JMethodIDPtr) + .object(const jni.JStringType()); + } + + static final _id_substring1 = _class.instanceMethodId( + r"substring", + r"(I)Lokio/ByteString;", + ); + + static final _substring1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.VarArgs<($Int32,)>)>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, jni.JMethodIDPtr, int)>(); + + /// from: public final okio.ByteString substring(int i) + /// The returned object must be released after use, by calling the [release] method. + ByteString substring1( + int i, + ) { + return _substring1(reference.pointer, _id_substring1 as jni.JMethodIDPtr, i) + .object(const $ByteStringType()); + } + + static final _id_substring2 = _class.instanceMethodId( + r"substring", + r"()Lokio/ByteString;", + ); + + static final _substring2 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public final okio.ByteString substring() + /// The returned object must be released after use, by calling the [release] method. + ByteString substring2() { + return _substring2(reference.pointer, _id_substring2 as jni.JMethodIDPtr) + .object(const $ByteStringType()); + } + + static final _id_indexOf2 = _class.instanceMethodId( + r"indexOf", + r"(Lokio/ByteString;)I", + ); + + static final _indexOf2 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallIntMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public final int indexOf(okio.ByteString byteString) + int indexOf2( + ByteString byteString, + ) { + return _indexOf2(reference.pointer, _id_indexOf2 as jni.JMethodIDPtr, + byteString.reference.pointer) + .integer; + } + + static final _id_indexOf3 = _class.instanceMethodId( + r"indexOf", + r"([B)I", + ); + + static final _indexOf3 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallIntMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public final int indexOf(byte[] bs) + int indexOf3( + jni.JArray bs, + ) { + return _indexOf3(reference.pointer, _id_indexOf3 as jni.JMethodIDPtr, + bs.reference.pointer) + .integer; + } + + static final _id_lastIndexOf2 = _class.instanceMethodId( + r"lastIndexOf", + r"(Lokio/ByteString;)I", + ); + + static final _lastIndexOf2 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallIntMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public final int lastIndexOf(okio.ByteString byteString) + int lastIndexOf2( + ByteString byteString, + ) { + return _lastIndexOf2(reference.pointer, + _id_lastIndexOf2 as jni.JMethodIDPtr, byteString.reference.pointer) + .integer; + } + + static final _id_lastIndexOf3 = _class.instanceMethodId( + r"lastIndexOf", + r"([B)I", + ); + + static final _lastIndexOf3 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallIntMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public final int lastIndexOf(byte[] bs) + int lastIndexOf3( + jni.JArray bs, + ) { + return _lastIndexOf3(reference.pointer, + _id_lastIndexOf3 as jni.JMethodIDPtr, bs.reference.pointer) + .integer; + } + + static final _id_of = _class.staticMethodId( + r"of", + r"([B)Lokio/ByteString;", + ); + + static final _of = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallStaticObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: static public final okio.ByteString of(byte[] bs) + /// The returned object must be released after use, by calling the [release] method. + static ByteString of( + jni.JArray bs, + ) { + return _of(_class.reference.pointer, _id_of as jni.JMethodIDPtr, + bs.reference.pointer) + .object(const $ByteStringType()); + } + + static final _id_of1 = _class.staticMethodId( + r"of", + r"([BII)Lokio/ByteString;", + ); + + static final _of1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer, $Int32, $Int32)>)>>( + "globalEnv_CallStaticObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, int, int)>(); + + /// from: static public final okio.ByteString of(byte[] bs, int i, int i1) + /// The returned object must be released after use, by calling the [release] method. + static ByteString of1( + jni.JArray bs, + int i, + int i1, + ) { + return _of1(_class.reference.pointer, _id_of1 as jni.JMethodIDPtr, + bs.reference.pointer, i, i1) + .object(const $ByteStringType()); + } + + static final _id_of2 = _class.staticMethodId( + r"of", + r"(Ljava/nio/ByteBuffer;)Lokio/ByteString;", + ); + + static final _of2 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallStaticObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: static public final okio.ByteString of(java.nio.ByteBuffer byteBuffer) + /// The returned object must be released after use, by calling the [release] method. + static ByteString of2( + jni.JByteBuffer byteBuffer, + ) { + return _of2(_class.reference.pointer, _id_of2 as jni.JMethodIDPtr, + byteBuffer.reference.pointer) + .object(const $ByteStringType()); + } + + static final _id_encodeUtf8 = _class.staticMethodId( + r"encodeUtf8", + r"(Ljava/lang/String;)Lokio/ByteString;", + ); + + static final _encodeUtf8 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallStaticObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: static public final okio.ByteString encodeUtf8(java.lang.String string) + /// The returned object must be released after use, by calling the [release] method. + static ByteString encodeUtf8( + jni.JString string, + ) { + return _encodeUtf8(_class.reference.pointer, + _id_encodeUtf8 as jni.JMethodIDPtr, string.reference.pointer) + .object(const $ByteStringType()); + } + + static final _id_encodeString = _class.staticMethodId( + r"encodeString", + r"(Ljava/lang/String;Ljava/nio/charset/Charset;)Lokio/ByteString;", + ); + + static final _encodeString = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallStaticObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); + + /// from: static public final okio.ByteString encodeString(java.lang.String string, java.nio.charset.Charset charset) + /// The returned object must be released after use, by calling the [release] method. + static ByteString encodeString( + jni.JString string, + jni.JObject charset, + ) { + return _encodeString( + _class.reference.pointer, + _id_encodeString as jni.JMethodIDPtr, + string.reference.pointer, + charset.reference.pointer) + .object(const $ByteStringType()); + } + + static final _id_decodeBase64 = _class.staticMethodId( + r"decodeBase64", + r"(Ljava/lang/String;)Lokio/ByteString;", + ); + + static final _decodeBase64 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallStaticObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: static public final okio.ByteString decodeBase64(java.lang.String string) + /// The returned object must be released after use, by calling the [release] method. + static ByteString decodeBase64( + jni.JString string, + ) { + return _decodeBase64(_class.reference.pointer, + _id_decodeBase64 as jni.JMethodIDPtr, string.reference.pointer) + .object(const $ByteStringType()); + } + + static final _id_decodeHex = _class.staticMethodId( + r"decodeHex", + r"(Ljava/lang/String;)Lokio/ByteString;", + ); + + static final _decodeHex = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallStaticObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: static public final okio.ByteString decodeHex(java.lang.String string) + /// The returned object must be released after use, by calling the [release] method. + static ByteString decodeHex( + jni.JString string, + ) { + return _decodeHex(_class.reference.pointer, + _id_decodeHex as jni.JMethodIDPtr, string.reference.pointer) + .object(const $ByteStringType()); + } + + static final _id_read = _class.staticMethodId( + r"read", + r"(Ljava/io/InputStream;I)Lokio/ByteString;", + ); + + static final _read = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer, $Int32)>)>>( + "globalEnv_CallStaticObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, int)>(); + + /// from: static public final okio.ByteString read(java.io.InputStream inputStream, int i) + /// The returned object must be released after use, by calling the [release] method. + static ByteString read( + jni.JObject inputStream, + int i, + ) { + return _read(_class.reference.pointer, _id_read as jni.JMethodIDPtr, + inputStream.reference.pointer, i) + .object(const $ByteStringType()); + } + + static final _id_compareTo1 = _class.instanceMethodId( + r"compareTo", + r"(Ljava/lang/Object;)I", + ); + + static final _compareTo1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallIntMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public int compareTo(java.lang.Object object) + int compareTo1( + jni.JObject object, + ) { + return _compareTo1(reference.pointer, _id_compareTo1 as jni.JMethodIDPtr, + object.reference.pointer) + .integer; + } +} + +final class $ByteStringType extends jni.JObjType { + const $ByteStringType(); + + @override + String get signature => r"Lokio/ByteString;"; + + @override + ByteString fromReference(jni.JReference reference) => + ByteString.fromReference(reference); + + @override + jni.JObjType get superType => const jni.JObjectType(); + + @override + final superCount = 1; + + @override + int get hashCode => ($ByteStringType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == ($ByteStringType) && other is $ByteStringType; + } +} From daf5d3aaef65cb098a63289e82bf3d5c587fba2d Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Fri, 5 Jul 2024 01:16:10 +0530 Subject: [PATCH 04/27] add websocket dependency --- pkgs/ok_http/example/pubspec.yaml | 3 +++ pkgs/ok_http/lib/ok_http.dart | 1 + pkgs/ok_http/pubspec.yaml | 1 + 3 files changed, 5 insertions(+) diff --git a/pkgs/ok_http/example/pubspec.yaml b/pkgs/ok_http/example/pubspec.yaml index 313cd2bbda..ea64ed0ae8 100644 --- a/pkgs/ok_http/example/pubspec.yaml +++ b/pkgs/ok_http/example/pubspec.yaml @@ -16,6 +16,7 @@ dependencies: ok_http: path: ../ provider: ^6.1.1 + web_socket: ^0.1.5 dev_dependencies: dart_flutter_team_lints: ^3.0.0 @@ -27,6 +28,8 @@ dev_dependencies: integration_test: sdk: flutter test: ^1.23.1 + web_socket_conformance_tests: + path: ../../web_socket_conformance_tests/ flutter: uses-material-design: true diff --git a/pkgs/ok_http/lib/ok_http.dart b/pkgs/ok_http/lib/ok_http.dart index 891ec98463..2533c42205 100644 --- a/pkgs/ok_http/lib/ok_http.dart +++ b/pkgs/ok_http/lib/ok_http.dart @@ -53,3 +53,4 @@ import 'package:http/http.dart'; import 'src/ok_http_client.dart'; export 'src/ok_http_client.dart'; +export 'src/ok_http_web_socket.dart'; diff --git a/pkgs/ok_http/pubspec.yaml b/pkgs/ok_http/pubspec.yaml index 7c242ab18c..9781f71478 100644 --- a/pkgs/ok_http/pubspec.yaml +++ b/pkgs/ok_http/pubspec.yaml @@ -16,6 +16,7 @@ dependencies: http_profile: ^0.1.0 jni: ^0.9.3 plugin_platform_interface: ^2.0.2 + web_socket: ^0.1.5 dev_dependencies: dart_flutter_team_lints: ^3.0.0 From 87f75952a7f2d386e09097b6a1665a59ea0d8087 Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Fri, 5 Jul 2024 01:17:03 +0530 Subject: [PATCH 05/27] create proxy and interceptor; generate bindings --- .../com/example/ok_http/WSInterceptor.kt | 37 + .../example/ok_http/WebSocketListenerProxy.kt | 39 + pkgs/ok_http/jnigen.yaml | 4 +- pkgs/ok_http/lib/src/jni/bindings.dart | 801 ++++++++++++++++-- 4 files changed, 822 insertions(+), 59 deletions(-) create mode 100644 pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WSInterceptor.kt create mode 100644 pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WebSocketListenerProxy.kt diff --git a/pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WSInterceptor.kt b/pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WSInterceptor.kt new file mode 100644 index 0000000000..a9a0c8ead1 --- /dev/null +++ b/pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WSInterceptor.kt @@ -0,0 +1,37 @@ +// todo add header +package com.example.ok_http + + + +import okhttp3.Interceptor +import okhttp3.OkHttpClient +import okhttp3.Request +import okhttp3.Response + +// todo add docs +interface WSInterceptedCallback { + fun onWS(request: Request, response: Response) +} + +// todo add docs +class WSInterceptor { + companion object { + fun addWSInterceptor( + clientBuilder: OkHttpClient.Builder, + callback: WSInterceptedCallback, + ): OkHttpClient.Builder { + return clientBuilder.addInterceptor(Interceptor { chain -> + val request = chain.request() + val response = chain.proceed(request) + + callback.onWS(request, response) + + response + .newBuilder() + .removeHeader("sec-websocket-extensions") + .addHeader("sec-websocket-extensions", "permessage-deflate") + .build() + }) + } + } +} diff --git a/pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WebSocketListenerProxy.kt b/pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WebSocketListenerProxy.kt new file mode 100644 index 0000000000..6666dd69da --- /dev/null +++ b/pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WebSocketListenerProxy.kt @@ -0,0 +1,39 @@ +// TODO: add header +// TODO: add doc establishing why this exists (see cronet_http UrlRequestCallbackProxy) + +package com.example.ok_http + +import okhttp3.Response +import okhttp3.WebSocket +import okhttp3.WebSocketListener +import okio.ByteString + +class WebSocketListenerProxy(private val listener: WebSocketListener) : WebSocketListener() { + interface WebSocketListener { + fun onOpen(webSocket: WebSocket, response: Response) + fun onMessage(webSocket: WebSocket, text: String) + fun onMessage(webSocket: WebSocket, bytes: ByteString) + fun onClosing(webSocket: WebSocket, code: Int, reason: String) + fun onFailure(webSocket: WebSocket, t: Throwable, response: Response?) + } + + override fun onOpen(webSocket: WebSocket, response: Response) { + listener.onOpen(webSocket, response) + } + + override fun onMessage(webSocket: WebSocket, text: String) { + listener.onMessage(webSocket, text) + } + + override fun onMessage(webSocket: WebSocket, bytes: ByteString) { + listener.onMessage(webSocket, bytes) + } + + override fun onClosing(webSocket: WebSocket, code: Int, reason: String) { + listener.onClosing(webSocket, code, reason) + } + + override fun onFailure(webSocket: WebSocket, t: Throwable, response: Response?) { + listener.onFailure(webSocket, t, response) + } +} diff --git a/pkgs/ok_http/jnigen.yaml b/pkgs/ok_http/jnigen.yaml index 587174b7b2..acce13cab8 100644 --- a/pkgs/ok_http/jnigen.yaml +++ b/pkgs/ok_http/jnigen.yaml @@ -33,8 +33,10 @@ classes: - "com.example.ok_http.AsyncInputStreamReader" - "com.example.ok_http.DataCallback" - "okhttp3.WebSocket" - - "okhttp3.WebSocketListener" + - "com.example.ok_http.WebSocketListenerProxy" - "okio.ByteString" + - "com.example.ok_http.WSInterceptedCallback" + - "com.example.ok_http.WSInterceptor" # Exclude the deprecated methods listed below # They cause syntax errors during the `dart format` step of JNIGen. diff --git a/pkgs/ok_http/lib/src/jni/bindings.dart b/pkgs/ok_http/lib/src/jni/bindings.dart index e2d677e3d8..6a4569c3e6 100644 --- a/pkgs/ok_http/lib/src/jni/bindings.dart +++ b/pkgs/ok_http/lib/src/jni/bindings.dart @@ -6253,7 +6253,7 @@ class OkHttpClient extends jni.JObject { /// The returned object must be released after use, by calling the [release] method. WebSocket newWebSocket( Request request, - WebSocketListener webSocketListener, + jni.JObject webSocketListener, ) { return _newWebSocket( reference.pointer, @@ -10487,7 +10487,7 @@ class WebSocket_Factory extends jni.JObject { /// The returned object must be released after use, by calling the [release] method. WebSocket newWebSocket( Request request, - WebSocketListener webSocketListener, + jni.JObject webSocketListener, ) { return _newWebSocket( reference.pointer, @@ -10533,7 +10533,7 @@ class WebSocket_Factory extends jni.JObject { r"newWebSocket(Lokhttp3/Request;Lokhttp3/WebSocketListener;)Lokhttp3/WebSocket;") { final $r = _$impls[$p]!.newWebSocket( $a[0].castTo(const $RequestType(), releaseOriginal: true), - $a[1].castTo(const $WebSocketListenerType(), releaseOriginal: true), + $a[1].castTo(const jni.JObjectType(), releaseOriginal: true), ); return ($r as jni.JObject) .castTo(const jni.JObjectType()) @@ -10575,25 +10575,23 @@ class WebSocket_Factory extends jni.JObject { abstract interface class $WebSocket_FactoryImpl { factory $WebSocket_FactoryImpl({ - required WebSocket Function( - Request request, WebSocketListener webSocketListener) + required WebSocket Function(Request request, jni.JObject webSocketListener) newWebSocket, }) = _$WebSocket_FactoryImpl; - WebSocket newWebSocket(Request request, WebSocketListener webSocketListener); + WebSocket newWebSocket(Request request, jni.JObject webSocketListener); } class _$WebSocket_FactoryImpl implements $WebSocket_FactoryImpl { _$WebSocket_FactoryImpl({ - required WebSocket Function( - Request request, WebSocketListener webSocketListener) + required WebSocket Function(Request request, jni.JObject webSocketListener) newWebSocket, }) : _newWebSocket = newWebSocket; - final WebSocket Function(Request request, WebSocketListener webSocketListener) + final WebSocket Function(Request request, jni.JObject webSocketListener) _newWebSocket; - WebSocket newWebSocket(Request request, WebSocketListener webSocketListener) { + WebSocket newWebSocket(Request request, jni.JObject webSocketListener) { return _newWebSocket(request, webSocketListener); } } @@ -10973,43 +10971,21 @@ final class $WebSocketType extends jni.JObjType { } } -/// from: okhttp3.WebSocketListener -class WebSocketListener extends jni.JObject { +/// from: com.example.ok_http.WebSocketListenerProxy$WebSocketListener +class WebSocketListenerProxy_WebSocketListener extends jni.JObject { @override - late final jni.JObjType $type = type; + late final jni.JObjType $type = + type; - WebSocketListener.fromReference( + WebSocketListenerProxy_WebSocketListener.fromReference( jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/WebSocketListener"); + static final _class = jni.JClass.forName( + r"com/example/ok_http/WebSocketListenerProxy$WebSocketListener"); /// The type which includes information such as the signature of this class. - static const type = $WebSocketListenerType(); - static final _id_new0 = _class.constructorId( - r"()V", - ); - - static final _new0 = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>("globalEnv_NewObject") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); - - /// from: public void () - /// The returned object must be released after use, by calling the [release] method. - factory WebSocketListener() { - return WebSocketListener.fromReference( - _new0(_class.reference.pointer, _id_new0 as jni.JMethodIDPtr) - .reference); - } - + static const type = $WebSocketListenerProxy_WebSocketListenerType(); static final _id_onOpen = _class.instanceMethodId( r"onOpen", r"(Lokhttp3/WebSocket;Lokhttp3/Response;)V", @@ -11029,7 +11005,7 @@ class WebSocketListener extends jni.JObject { jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); - /// from: public void onOpen(okhttp3.WebSocket webSocket, okhttp3.Response response) + /// from: public abstract void onOpen(okhttp3.WebSocket webSocket, okhttp3.Response response) void onOpen( WebSocket webSocket, Response response, @@ -11058,7 +11034,7 @@ class WebSocketListener extends jni.JObject { jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); - /// from: public void onMessage(okhttp3.WebSocket webSocket, java.lang.String string) + /// from: public abstract void onMessage(okhttp3.WebSocket webSocket, java.lang.String string) void onMessage( WebSocket webSocket, jni.JString string, @@ -11087,7 +11063,7 @@ class WebSocketListener extends jni.JObject { jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); - /// from: public void onMessage(okhttp3.WebSocket webSocket, okio.ByteString byteString) + /// from: public abstract void onMessage(okhttp3.WebSocket webSocket, okio.ByteString byteString) void onMessage1( WebSocket webSocket, ByteString byteString, @@ -11117,7 +11093,7 @@ class WebSocketListener extends jni.JObject { jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, int, ffi.Pointer)>(); - /// from: public void onClosing(okhttp3.WebSocket webSocket, int i, java.lang.String string) + /// from: public abstract void onClosing(okhttp3.WebSocket webSocket, int i, java.lang.String string) void onClosing( WebSocket webSocket, int i, @@ -11128,12 +11104,381 @@ class WebSocketListener extends jni.JObject { .check(); } - static final _id_onClosed = _class.instanceMethodId( - r"onClosed", + static final _id_onFailure = _class.instanceMethodId( + r"onFailure", + r"(Lokhttp3/WebSocket;Ljava/lang/Throwable;Lokhttp3/Response;)V", + ); + + static final _onFailure = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + /// from: public abstract void onFailure(okhttp3.WebSocket webSocket, java.lang.Throwable throwable, okhttp3.Response response) + void onFailure( + WebSocket webSocket, + jni.JObject throwable, + Response response, + ) { + _onFailure( + reference.pointer, + _id_onFailure as jni.JMethodIDPtr, + webSocket.reference.pointer, + throwable.reference.pointer, + response.reference.pointer) + .check(); + } + + /// Maps a specific port to the implemented interface. + static final Map _$impls = + {}; + ReceivePort? _$p; + + static jni.JObjectPtr _$invoke( + int port, + jni.JObjectPtr descriptor, + jni.JObjectPtr args, + ) { + return _$invokeMethod( + port, + $MethodInvocation.fromAddresses( + 0, + descriptor.address, + args.address, + ), + ); + } + + static final ffi.Pointer< + ffi.NativeFunction< + jni.JObjectPtr Function( + ffi.Uint64, jni.JObjectPtr, jni.JObjectPtr)>> + _$invokePointer = ffi.Pointer.fromFunction(_$invoke); + + static ffi.Pointer _$invokeMethod( + int $p, + $MethodInvocation $i, + ) { + try { + final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); + final $a = $i.args; + if ($d == r"onOpen(Lokhttp3/WebSocket;Lokhttp3/Response;)V") { + _$impls[$p]!.onOpen( + $a[0].castTo(const $WebSocketType(), releaseOriginal: true), + $a[1].castTo(const $ResponseType(), releaseOriginal: true), + ); + return jni.nullptr; + } + if ($d == r"onMessage(Lokhttp3/WebSocket;Ljava/lang/String;)V") { + _$impls[$p]!.onMessage( + $a[0].castTo(const $WebSocketType(), releaseOriginal: true), + $a[1].castTo(const jni.JStringType(), releaseOriginal: true), + ); + return jni.nullptr; + } + if ($d == r"onMessage(Lokhttp3/WebSocket;Lokio/ByteString;)V") { + _$impls[$p]!.onMessage1( + $a[0].castTo(const $WebSocketType(), releaseOriginal: true), + $a[1].castTo(const $ByteStringType(), releaseOriginal: true), + ); + return jni.nullptr; + } + if ($d == r"onClosing(Lokhttp3/WebSocket;ILjava/lang/String;)V") { + _$impls[$p]!.onClosing( + $a[0].castTo(const $WebSocketType(), releaseOriginal: true), + $a[1] + .castTo(const jni.JIntegerType(), releaseOriginal: true) + .intValue(releaseOriginal: true), + $a[2].castTo(const jni.JStringType(), releaseOriginal: true), + ); + return jni.nullptr; + } + if ($d == + r"onFailure(Lokhttp3/WebSocket;Ljava/lang/Throwable;Lokhttp3/Response;)V") { + _$impls[$p]!.onFailure( + $a[0].castTo(const $WebSocketType(), releaseOriginal: true), + $a[1].castTo(const jni.JObjectType(), releaseOriginal: true), + $a[2].castTo(const $ResponseType(), releaseOriginal: true), + ); + return jni.nullptr; + } + } catch (e) { + return ProtectedJniExtensions.newDartException(e); + } + return jni.nullptr; + } + + factory WebSocketListenerProxy_WebSocketListener.implement( + $WebSocketListenerProxy_WebSocketListenerImpl $impl, + ) { + final $p = ReceivePort(); + final $x = WebSocketListenerProxy_WebSocketListener.fromReference( + ProtectedJniExtensions.newPortProxy( + r"com.example.ok_http.WebSocketListenerProxy$WebSocketListener", + $p, + _$invokePointer, + ), + ).._$p = $p; + final $a = $p.sendPort.nativePort; + _$impls[$a] = $impl; + $p.listen(($m) { + if ($m == null) { + _$impls.remove($p.sendPort.nativePort); + $p.close(); + return; + } + final $i = $MethodInvocation.fromMessage($m as List); + final $r = _$invokeMethod($p.sendPort.nativePort, $i); + ProtectedJniExtensions.returnResult($i.result, $r); + }); + return $x; + } +} + +abstract interface class $WebSocketListenerProxy_WebSocketListenerImpl { + factory $WebSocketListenerProxy_WebSocketListenerImpl({ + required void Function(WebSocket webSocket, Response response) onOpen, + required void Function(WebSocket webSocket, jni.JString string) onMessage, + required void Function(WebSocket webSocket, ByteString byteString) + onMessage1, + required void Function(WebSocket webSocket, int i, jni.JString string) + onClosing, + required void Function( + WebSocket webSocket, jni.JObject throwable, Response response) + onFailure, + }) = _$WebSocketListenerProxy_WebSocketListenerImpl; + + void onOpen(WebSocket webSocket, Response response); + void onMessage(WebSocket webSocket, jni.JString string); + void onMessage1(WebSocket webSocket, ByteString byteString); + void onClosing(WebSocket webSocket, int i, jni.JString string); + void onFailure(WebSocket webSocket, jni.JObject throwable, Response response); +} + +class _$WebSocketListenerProxy_WebSocketListenerImpl + implements $WebSocketListenerProxy_WebSocketListenerImpl { + _$WebSocketListenerProxy_WebSocketListenerImpl({ + required void Function(WebSocket webSocket, Response response) onOpen, + required void Function(WebSocket webSocket, jni.JString string) onMessage, + required void Function(WebSocket webSocket, ByteString byteString) + onMessage1, + required void Function(WebSocket webSocket, int i, jni.JString string) + onClosing, + required void Function( + WebSocket webSocket, jni.JObject throwable, Response response) + onFailure, + }) : _onOpen = onOpen, + _onMessage = onMessage, + _onMessage1 = onMessage1, + _onClosing = onClosing, + _onFailure = onFailure; + + final void Function(WebSocket webSocket, Response response) _onOpen; + final void Function(WebSocket webSocket, jni.JString string) _onMessage; + final void Function(WebSocket webSocket, ByteString byteString) _onMessage1; + final void Function(WebSocket webSocket, int i, jni.JString string) + _onClosing; + final void Function( + WebSocket webSocket, jni.JObject throwable, Response response) _onFailure; + + void onOpen(WebSocket webSocket, Response response) { + return _onOpen(webSocket, response); + } + + void onMessage(WebSocket webSocket, jni.JString string) { + return _onMessage(webSocket, string); + } + + void onMessage1(WebSocket webSocket, ByteString byteString) { + return _onMessage1(webSocket, byteString); + } + + void onClosing(WebSocket webSocket, int i, jni.JString string) { + return _onClosing(webSocket, i, string); + } + + void onFailure( + WebSocket webSocket, jni.JObject throwable, Response response) { + return _onFailure(webSocket, throwable, response); + } +} + +final class $WebSocketListenerProxy_WebSocketListenerType + extends jni.JObjType { + const $WebSocketListenerProxy_WebSocketListenerType(); + + @override + String get signature => + r"Lcom/example/ok_http/WebSocketListenerProxy$WebSocketListener;"; + + @override + WebSocketListenerProxy_WebSocketListener fromReference( + jni.JReference reference) => + WebSocketListenerProxy_WebSocketListener.fromReference(reference); + + @override + jni.JObjType get superType => const jni.JObjectType(); + + @override + final superCount = 1; + + @override + int get hashCode => ($WebSocketListenerProxy_WebSocketListenerType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == + ($WebSocketListenerProxy_WebSocketListenerType) && + other is $WebSocketListenerProxy_WebSocketListenerType; + } +} + +/// from: com.example.ok_http.WebSocketListenerProxy +class WebSocketListenerProxy extends jni.JObject { + @override + late final jni.JObjType $type = type; + + WebSocketListenerProxy.fromReference( + jni.JReference reference, + ) : super.fromReference(reference); + + static final _class = + jni.JClass.forName(r"com/example/ok_http/WebSocketListenerProxy"); + + /// The type which includes information such as the signature of this class. + static const type = $WebSocketListenerProxyType(); + static final _id_new0 = _class.constructorId( + r"(Lcom/example/ok_http/WebSocketListenerProxy$WebSocketListener;)V", + ); + + static final _new0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_NewObject") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public void (com.example.ok_http.WebSocketListenerProxy$WebSocketListener webSocketListener) + /// The returned object must be released after use, by calling the [release] method. + factory WebSocketListenerProxy( + WebSocketListenerProxy_WebSocketListener webSocketListener, + ) { + return WebSocketListenerProxy.fromReference(_new0(_class.reference.pointer, + _id_new0 as jni.JMethodIDPtr, webSocketListener.reference.pointer) + .reference); + } + + static final _id_onOpen = _class.instanceMethodId( + r"onOpen", + r"(Lokhttp3/WebSocket;Lokhttp3/Response;)V", + ); + + static final _onOpen = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); + + /// from: public void onOpen(okhttp3.WebSocket webSocket, okhttp3.Response response) + void onOpen( + WebSocket webSocket, + Response response, + ) { + _onOpen(reference.pointer, _id_onOpen as jni.JMethodIDPtr, + webSocket.reference.pointer, response.reference.pointer) + .check(); + } + + static final _id_onMessage = _class.instanceMethodId( + r"onMessage", + r"(Lokhttp3/WebSocket;Ljava/lang/String;)V", + ); + + static final _onMessage = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); + + /// from: public void onMessage(okhttp3.WebSocket webSocket, java.lang.String string) + void onMessage( + WebSocket webSocket, + jni.JString string, + ) { + _onMessage(reference.pointer, _id_onMessage as jni.JMethodIDPtr, + webSocket.reference.pointer, string.reference.pointer) + .check(); + } + + static final _id_onMessage1 = _class.instanceMethodId( + r"onMessage", + r"(Lokhttp3/WebSocket;Lokio/ByteString;)V", + ); + + static final _onMessage1 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); + + /// from: public void onMessage(okhttp3.WebSocket webSocket, okio.ByteString byteString) + void onMessage1( + WebSocket webSocket, + ByteString byteString, + ) { + _onMessage1(reference.pointer, _id_onMessage1 as jni.JMethodIDPtr, + webSocket.reference.pointer, byteString.reference.pointer) + .check(); + } + + static final _id_onClosing = _class.instanceMethodId( + r"onClosing", r"(Lokhttp3/WebSocket;ILjava/lang/String;)V", ); - static final _onClosed = ProtectedJniExtensions.lookup< + static final _onClosing = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JThrowablePtr Function( ffi.Pointer, @@ -11148,13 +11493,13 @@ class WebSocketListener extends jni.JObject { jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, int, ffi.Pointer)>(); - /// from: public void onClosed(okhttp3.WebSocket webSocket, int i, java.lang.String string) - void onClosed( + /// from: public void onClosing(okhttp3.WebSocket webSocket, int i, java.lang.String string) + void onClosing( WebSocket webSocket, int i, jni.JString string, ) { - _onClosed(reference.pointer, _id_onClosed as jni.JMethodIDPtr, + _onClosing(reference.pointer, _id_onClosing as jni.JMethodIDPtr, webSocket.reference.pointer, i, string.reference.pointer) .check(); } @@ -11199,15 +11544,16 @@ class WebSocketListener extends jni.JObject { } } -final class $WebSocketListenerType extends jni.JObjType { - const $WebSocketListenerType(); +final class $WebSocketListenerProxyType + extends jni.JObjType { + const $WebSocketListenerProxyType(); @override - String get signature => r"Lokhttp3/WebSocketListener;"; + String get signature => r"Lcom/example/ok_http/WebSocketListenerProxy;"; @override - WebSocketListener fromReference(jni.JReference reference) => - WebSocketListener.fromReference(reference); + WebSocketListenerProxy fromReference(jni.JReference reference) => + WebSocketListenerProxy.fromReference(reference); @override jni.JObjType get superType => const jni.JObjectType(); @@ -11216,12 +11562,12 @@ final class $WebSocketListenerType extends jni.JObjType { final superCount = 1; @override - int get hashCode => ($WebSocketListenerType).hashCode; + int get hashCode => ($WebSocketListenerProxyType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($WebSocketListenerType) && - other is $WebSocketListenerType; + return other.runtimeType == ($WebSocketListenerProxyType) && + other is $WebSocketListenerProxyType; } } @@ -12873,3 +13219,342 @@ final class $ByteStringType extends jni.JObjType { return other.runtimeType == ($ByteStringType) && other is $ByteStringType; } } + +/// from: com.example.ok_http.WSInterceptedCallback +class WSInterceptedCallback extends jni.JObject { + @override + late final jni.JObjType $type = type; + + WSInterceptedCallback.fromReference( + jni.JReference reference, + ) : super.fromReference(reference); + + static final _class = + jni.JClass.forName(r"com/example/ok_http/WSInterceptedCallback"); + + /// The type which includes information such as the signature of this class. + static const type = $WSInterceptedCallbackType(); + static final _id_onWS = _class.instanceMethodId( + r"onWS", + r"(Lokhttp3/Request;Lokhttp3/Response;)V", + ); + + static final _onWS = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); + + /// from: public abstract void onWS(okhttp3.Request request, okhttp3.Response response) + void onWS( + Request request, + Response response, + ) { + _onWS(reference.pointer, _id_onWS as jni.JMethodIDPtr, + request.reference.pointer, response.reference.pointer) + .check(); + } + + /// Maps a specific port to the implemented interface. + static final Map _$impls = {}; + ReceivePort? _$p; + + static jni.JObjectPtr _$invoke( + int port, + jni.JObjectPtr descriptor, + jni.JObjectPtr args, + ) { + return _$invokeMethod( + port, + $MethodInvocation.fromAddresses( + 0, + descriptor.address, + args.address, + ), + ); + } + + static final ffi.Pointer< + ffi.NativeFunction< + jni.JObjectPtr Function( + ffi.Uint64, jni.JObjectPtr, jni.JObjectPtr)>> + _$invokePointer = ffi.Pointer.fromFunction(_$invoke); + + static ffi.Pointer _$invokeMethod( + int $p, + $MethodInvocation $i, + ) { + try { + final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); + final $a = $i.args; + if ($d == r"onWS(Lokhttp3/Request;Lokhttp3/Response;)V") { + _$impls[$p]!.onWS( + $a[0].castTo(const $RequestType(), releaseOriginal: true), + $a[1].castTo(const $ResponseType(), releaseOriginal: true), + ); + return jni.nullptr; + } + } catch (e) { + return ProtectedJniExtensions.newDartException(e); + } + return jni.nullptr; + } + + factory WSInterceptedCallback.implement( + $WSInterceptedCallbackImpl $impl, + ) { + final $p = ReceivePort(); + final $x = WSInterceptedCallback.fromReference( + ProtectedJniExtensions.newPortProxy( + r"com.example.ok_http.WSInterceptedCallback", + $p, + _$invokePointer, + ), + ).._$p = $p; + final $a = $p.sendPort.nativePort; + _$impls[$a] = $impl; + $p.listen(($m) { + if ($m == null) { + _$impls.remove($p.sendPort.nativePort); + $p.close(); + return; + } + final $i = $MethodInvocation.fromMessage($m as List); + final $r = _$invokeMethod($p.sendPort.nativePort, $i); + ProtectedJniExtensions.returnResult($i.result, $r); + }); + return $x; + } +} + +abstract interface class $WSInterceptedCallbackImpl { + factory $WSInterceptedCallbackImpl({ + required void Function(Request request, Response response) onWS, + }) = _$WSInterceptedCallbackImpl; + + void onWS(Request request, Response response); +} + +class _$WSInterceptedCallbackImpl implements $WSInterceptedCallbackImpl { + _$WSInterceptedCallbackImpl({ + required void Function(Request request, Response response) onWS, + }) : _onWS = onWS; + + final void Function(Request request, Response response) _onWS; + + void onWS(Request request, Response response) { + return _onWS(request, response); + } +} + +final class $WSInterceptedCallbackType + extends jni.JObjType { + const $WSInterceptedCallbackType(); + + @override + String get signature => r"Lcom/example/ok_http/WSInterceptedCallback;"; + + @override + WSInterceptedCallback fromReference(jni.JReference reference) => + WSInterceptedCallback.fromReference(reference); + + @override + jni.JObjType get superType => const jni.JObjectType(); + + @override + final superCount = 1; + + @override + int get hashCode => ($WSInterceptedCallbackType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == ($WSInterceptedCallbackType) && + other is $WSInterceptedCallbackType; + } +} + +/// from: com.example.ok_http.WSInterceptor$Companion +class WSInterceptor_Companion extends jni.JObject { + @override + late final jni.JObjType $type = type; + + WSInterceptor_Companion.fromReference( + jni.JReference reference, + ) : super.fromReference(reference); + + static final _class = + jni.JClass.forName(r"com/example/ok_http/WSInterceptor$Companion"); + + /// The type which includes information such as the signature of this class. + static const type = $WSInterceptor_CompanionType(); + static final _id_addWSInterceptor = _class.instanceMethodId( + r"addWSInterceptor", + r"(Lokhttp3/OkHttpClient$Builder;Lcom/example/ok_http/WSInterceptedCallback;)Lokhttp3/OkHttpClient$Builder;", + ); + + static final _addWSInterceptor = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs< + ( + ffi.Pointer, + ffi.Pointer + )>)>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer, ffi.Pointer)>(); + + /// from: public final okhttp3.OkHttpClient$Builder addWSInterceptor(okhttp3.OkHttpClient$Builder builder, com.example.ok_http.WSInterceptedCallback wSInterceptedCallback) + /// The returned object must be released after use, by calling the [release] method. + OkHttpClient_Builder addWSInterceptor( + OkHttpClient_Builder builder, + WSInterceptedCallback wSInterceptedCallback, + ) { + return _addWSInterceptor( + reference.pointer, + _id_addWSInterceptor as jni.JMethodIDPtr, + builder.reference.pointer, + wSInterceptedCallback.reference.pointer) + .object(const $OkHttpClient_BuilderType()); + } + + static final _id_new0 = _class.constructorId( + r"(Lkotlin/jvm/internal/DefaultConstructorMarker;)V", + ); + + static final _new0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_NewObject") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, + ffi.Pointer)>(); + + /// from: public void (kotlin.jvm.internal.DefaultConstructorMarker defaultConstructorMarker) + /// The returned object must be released after use, by calling the [release] method. + factory WSInterceptor_Companion( + jni.JObject defaultConstructorMarker, + ) { + return WSInterceptor_Companion.fromReference(_new0( + _class.reference.pointer, + _id_new0 as jni.JMethodIDPtr, + defaultConstructorMarker.reference.pointer) + .reference); + } +} + +final class $WSInterceptor_CompanionType + extends jni.JObjType { + const $WSInterceptor_CompanionType(); + + @override + String get signature => r"Lcom/example/ok_http/WSInterceptor$Companion;"; + + @override + WSInterceptor_Companion fromReference(jni.JReference reference) => + WSInterceptor_Companion.fromReference(reference); + + @override + jni.JObjType get superType => const jni.JObjectType(); + + @override + final superCount = 1; + + @override + int get hashCode => ($WSInterceptor_CompanionType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == ($WSInterceptor_CompanionType) && + other is $WSInterceptor_CompanionType; + } +} + +/// from: com.example.ok_http.WSInterceptor +class WSInterceptor extends jni.JObject { + @override + late final jni.JObjType $type = type; + + WSInterceptor.fromReference( + jni.JReference reference, + ) : super.fromReference(reference); + + static final _class = + jni.JClass.forName(r"com/example/ok_http/WSInterceptor"); + + /// The type which includes information such as the signature of this class. + static const type = $WSInterceptorType(); + static final _id_Companion = _class.staticFieldId( + r"Companion", + r"Lcom/example/ok_http/WSInterceptor$Companion;", + ); + + /// from: static public final com.example.ok_http.WSInterceptor$Companion Companion + /// The returned object must be released after use, by calling the [release] method. + static WSInterceptor_Companion get Companion => + _id_Companion.get(_class, const $WSInterceptor_CompanionType()); + + static final _id_new0 = _class.constructorId( + r"()V", + ); + + static final _new0 = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_NewObject") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public void () + /// The returned object must be released after use, by calling the [release] method. + factory WSInterceptor() { + return WSInterceptor.fromReference( + _new0(_class.reference.pointer, _id_new0 as jni.JMethodIDPtr) + .reference); + } +} + +final class $WSInterceptorType extends jni.JObjType { + const $WSInterceptorType(); + + @override + String get signature => r"Lcom/example/ok_http/WSInterceptor;"; + + @override + WSInterceptor fromReference(jni.JReference reference) => + WSInterceptor.fromReference(reference); + + @override + jni.JObjType get superType => const jni.JObjectType(); + + @override + final superCount = 1; + + @override + int get hashCode => ($WSInterceptorType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == ($WSInterceptorType) && + other is $WSInterceptorType; + } +} From dc6984b0a679bb442146f7ae6fb119170e3f400e Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Fri, 5 Jul 2024 01:17:56 +0530 Subject: [PATCH 06/27] first websocket impl --- pkgs/ok_http/lib/src/ok_http_web_socket.dart | 177 +++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 pkgs/ok_http/lib/src/ok_http_web_socket.dart diff --git a/pkgs/ok_http/lib/src/ok_http_web_socket.dart b/pkgs/ok_http/lib/src/ok_http_web_socket.dart new file mode 100644 index 0000000000..b1c653de80 --- /dev/null +++ b/pkgs/ok_http/lib/src/ok_http_web_socket.dart @@ -0,0 +1,177 @@ +import 'dart:async'; +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:jni/jni.dart'; +import 'package:web_socket/web_socket.dart'; + +import 'jni/bindings.dart' as bindings; + +class OkHttpWebSocket implements WebSocket { + late bindings.OkHttpClient _client; + late final bindings.WebSocket _webSocket; + final _events = StreamController(); + String? _protocol; + + OkHttpWebSocket._() { + _client = bindings.WSInterceptor.Companion + .addWSInterceptor(bindings.OkHttpClient_Builder(), + bindings.WSInterceptedCallback.implement( + bindings.$WSInterceptedCallbackImpl(onWS: (req, res) { + print(req.headers().toString1()); + print(res.headers().toString1()); + }))).build(); + } + + static Future connect(Uri url, + {Iterable? protocols}) async => + OkHttpWebSocket._()._connect(url, protocols); + + Future _connect(Uri url, Iterable? protocols) async { + if (!url.isScheme('ws') && !url.isScheme('wss')) { + throw ArgumentError.value( + url, 'url', 'only ws: and wss: schemes are supported'); + } + + final requestBuilder = + bindings.Request_Builder().url1(url.toString().toJString()); + + if (protocols != null) { + requestBuilder.addHeader('Sec-WebSocket-Protocol'.toJString(), + protocols.join(', ').toJString()); + } + + var openCompleter = Completer(); + + _client.newWebSocket( + requestBuilder.build(), + bindings.WebSocketListenerProxy( + bindings.WebSocketListenerProxy_WebSocketListener.implement( + bindings.$WebSocketListenerProxy_WebSocketListenerImpl( + onOpen: (webSocket, response) { + _webSocket = webSocket; + + var protocolHeader = + response.header1('sec-websocket-protocol'.toJString()); + if (!protocolHeader.isNull) { + _protocol = protocolHeader.toDartString(); + print('$_protocol; $protocols'); + if (!(protocols?.contains(_protocol) ?? true)) { + openCompleter + .completeError(WebSocketException('Protocol mismatch. ' + 'Expected one of $protocols, but received $_protocol')); + return; + } + } + + openCompleter.complete(this); + }, + onMessage: (bindings.WebSocket webSocket, JString string) { + if (_events.isClosed) return; + _events.add(TextDataReceived(string.toDartString())); + }, + onMessage1: + (bindings.WebSocket webSocket, bindings.ByteString byteString) { + if (_events.isClosed) return; + _events.add( + BinaryDataReceived(byteString.toByteArray().toUint8List())); + }, + onClosing: + (bindings.WebSocket webSocket, int i, JString string) async { + if (_events.isClosed) throw WebSocketConnectionClosed(); + + _events.add(CloseReceived(i, string.toDartString())); + await _events.close(); + + _client.dispatcher().executorService().shutdown(); + _client.connectionPool().evictAll(); + var cache = _client.cache(); + if (!cache.isNull) { + cache.close(); + } + _client.release(); + }, + onFailure: (bindings.WebSocket webSocket, JObject throwable, + bindings.Response response) { + var throwableString = throwable.toString(); + if (throwableString.contains('java.io.EOFException') || + throwableString.contains( + // ignore: lines_longer_than_80_chars + 'java.net.ProtocolException: Control frames must be final.')) { + _events.add(CloseReceived(1006, 'closed abnormal')); + unawaited(_events.close()); + return; + } + print('problems $throwableString'); + var error = WebSocketException( + 'Connection ended unexpectedly $throwableString'); + if (openCompleter.isCompleted) { + _events.addError(error); + return; + } + openCompleter.completeError(error); + }, + )))); + + return openCompleter.future; + } + + @override + Future close([int? code, String? reason]) async { + if (_events.isClosed) { + throw WebSocketConnectionClosed(); + } + + if (code != null && code != 1000 && !(code >= 3000 && code <= 4999)) { + throw ArgumentError('Invalid argument: $code, close code must be 1000 or ' + 'in the range 3000-4999'); + } + if (reason != null && utf8.encode(reason).length > 123) { + throw ArgumentError.value(reason, 'reason', + 'reason must be <= 123 bytes long when encoded as UTF-8'); + } + + // unawaited(_events.close()); + + _webSocket.close(code ?? 1010, + reason?.toJString() ?? JString.fromReference(jNullReference)); + } + + @override + Stream get events => _events.stream; + + @override + String get protocol => _protocol ?? ''; + + @override + void sendBytes(Uint8List b) { + if (_events.isClosed) { + throw WebSocketConnectionClosed(); + } + _webSocket.send1(bindings.ByteString.of(b.toJArray())); + } + + @override + void sendText(String s) { + if (_events.isClosed) { + throw WebSocketConnectionClosed(); + } + _webSocket.send(s.toJString()); + } +} + +extension on Uint8List { + JArray toJArray() => + JArray(jbyte.type, length)..setRange(0, length, this); +} + +extension on JArray { + Uint8List toUint8List({int? length}) { + length ??= this.length; + final list = Uint8List(length); + for (var i = 0; i < length; i++) { + list[i] = this[i]; + } + return list; + } +} From 78b66379b0466b83c7216b6da535de838dbff266 Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Fri, 5 Jul 2024 01:18:12 +0530 Subject: [PATCH 07/27] create an example section for websocket demo --- pkgs/ok_http/example/lib/main.dart | 172 ++++++++++++++++++++++++++--- 1 file changed, 155 insertions(+), 17 deletions(-) diff --git a/pkgs/ok_http/example/lib/main.dart b/pkgs/ok_http/example/lib/main.dart index 0fd1807ea0..2417a4e4fb 100644 --- a/pkgs/ok_http/example/lib/main.dart +++ b/pkgs/ok_http/example/lib/main.dart @@ -2,6 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'dart:async'; import 'dart:convert'; import 'dart:io'; @@ -11,6 +12,7 @@ import 'package:http/io_client.dart'; import 'package:http_image_provider/http_image_provider.dart'; import 'package:ok_http/ok_http.dart'; import 'package:provider/provider.dart'; +import 'package:web_socket/web_socket.dart'; import 'book.dart'; @@ -48,6 +50,45 @@ class HomePage extends StatefulWidget { } class _HomePageState extends State { + int _selectedIndex = 1; + final _labels = ['HTTP', 'WebSocket']; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: + Text(_selectedIndex == 0 ? 'Book Search' : 'WebSocket Echo')), + bottomNavigationBar: BottomNavigationBar( + currentIndex: _selectedIndex, + onTap: (value) => setState(() { + _selectedIndex = value; + }), + items: [ + BottomNavigationBarItem( + icon: const Icon(Icons.cloud_outlined), + activeIcon: const Icon(Icons.cloud), + label: _labels[0], + ), + BottomNavigationBarItem( + icon: const Icon(Icons.swap_vert_circle_outlined), + activeIcon: const Icon(Icons.swap_vert_circle), + label: _labels[1], + ), + ], + ), + body: _selectedIndex == 0 ? const BookSearch() : const WebSocketEcho()); + } +} + +class BookSearch extends StatefulWidget { + const BookSearch({super.key}); + + @override + State createState() => _BookSearchState(); +} + +class _BookSearchState extends State { List? _books; String? _lastQuery; late Client _client; @@ -99,24 +140,21 @@ class _HomePageState extends State { ? BookList(_books!) : const Text('No results found', style: TextStyle(fontSize: 24)); - return Scaffold( - appBar: AppBar(title: const Text('Book Search')), - body: Padding( - padding: const EdgeInsets.all(10), - child: Column( - children: [ - const SizedBox(height: 20), - TextField( - onChanged: _runSearch, - decoration: const InputDecoration( - labelText: 'Search', - suffixIcon: Icon(Icons.search), - ), + return Padding( + padding: const EdgeInsets.all(10), + child: Column( + children: [ + const SizedBox(height: 20), + TextField( + onChanged: _runSearch, + decoration: const InputDecoration( + labelText: 'Search', + suffixIcon: Icon(Icons.search), ), - const SizedBox(height: 20), - Expanded(child: searchResult), - ], - ), + ), + const SizedBox(height: 20), + Expanded(child: searchResult), + ], ), ); } @@ -147,3 +185,103 @@ class _BookListState extends State { ), ); } + +class WebSocketEcho extends StatefulWidget { + const WebSocketEcho({super.key}); + + @override + State createState() => _WebSocketEchoState(); +} + +class _WebSocketEchoState extends State { + final List _messages = []; + final msgController = TextEditingController(); + + late WebSocket _webSocket; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.all(10), + child: Column( + children: [ + Row( + children: [ + Expanded( + child: ElevatedButton( + onPressed: () async { + try { + _webSocket = await OkHttpWebSocket.connect( + Uri.parse('wss://echo.websocket.org')); + } on WebSocketException catch (e) { + print('Error connecting to WebSocket: ${e.message}'); + return; + } + + _webSocket.events.listen((event) { + setState(() { + switch (event) { + case TextDataReceived(text: final text): + _messages.add([text, false]); + break; + case CloseReceived(): + _messages.add(['Connection closed', false]); + default: + _messages.add( + ['Unknown message received $event', false]); + } + }); + }); + }, + child: const Text('Connect'))), + const SizedBox(width: 16), + Expanded( + child: ElevatedButton( + onPressed: () => _webSocket.close(), + child: const Text('Disconnect'))), + ], + ), + Row( + children: [ + Expanded( + child: TextField( + controller: msgController, + decoration: const InputDecoration( + labelText: 'Message', + ), + ), + ), + ElevatedButton( + onPressed: () { + _webSocket.sendText(msgController.text); + + setState(() { + _messages.add([msgController.text, true]); + }); + }, + child: const Text('Send')), + ], + ), + const SizedBox(height: 20), + Expanded( + child: ListView.builder( + itemBuilder: (context, index) { + return ListTile( + title: Text(_messages[index][0] as String), + trailing: Icon(_messages[index][1] as bool + ? Icons.upload + : Icons.download), + ); + }, + itemCount: _messages.length, + )), + ], + ), + ); + } +} From 7b93fb0b14f6ca202808b06f2f57d30735fb9a6f Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Fri, 5 Jul 2024 01:19:07 +0530 Subject: [PATCH 08/27] add integration tests --- .../example/integration_test/web_socket_test.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 pkgs/ok_http/example/integration_test/web_socket_test.dart diff --git a/pkgs/ok_http/example/integration_test/web_socket_test.dart b/pkgs/ok_http/example/integration_test/web_socket_test.dart new file mode 100644 index 0000000000..8f1a9656f8 --- /dev/null +++ b/pkgs/ok_http/example/integration_test/web_socket_test.dart @@ -0,0 +1,10 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ok_http/ok_http.dart'; +import 'package:web_socket_conformance_tests/web_socket_conformance_tests.dart'; + +void main() { + testAll(OkHttpWebSocket.connect); +} From bb68b2bc71d7c726e152779e34b816aab0d9bb56 Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Sun, 7 Jul 2024 11:45:31 +0530 Subject: [PATCH 09/27] add helper comments and docs to kotlin files --- .../com/example/ok_http/WSInterceptor.kt | 32 ++- .../example/ok_http/WebSocketListenerProxy.kt | 16 +- pkgs/ok_http/example/lib/main.dart | 16 +- pkgs/ok_http/jnigen.yaml | 1 - pkgs/ok_http/lib/src/jni/bindings.dart | 191 +----------------- pkgs/ok_http/lib/src/ok_http_client.dart | 4 +- pkgs/ok_http/lib/src/ok_http_web_socket.dart | 75 +++---- 7 files changed, 91 insertions(+), 244 deletions(-) diff --git a/pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WSInterceptor.kt b/pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WSInterceptor.kt index a9a0c8ead1..d7d9f74ed7 100644 --- a/pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WSInterceptor.kt +++ b/pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WSInterceptor.kt @@ -1,36 +1,30 @@ -// todo add header -package com.example.ok_http - +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. +package com.example.ok_http import okhttp3.Interceptor import okhttp3.OkHttpClient -import okhttp3.Request -import okhttp3.Response -// todo add docs -interface WSInterceptedCallback { - fun onWS(request: Request, response: Response) -} - -// todo add docs +/** + * Usage of `chain.proceed(...)` via JNI Bindings leads to threading issues. This is a workaround + * to intercept the response before it is parsed by the WebSocketReader, to prevent response parsing errors. + */ class WSInterceptor { companion object { fun addWSInterceptor( - clientBuilder: OkHttpClient.Builder, - callback: WSInterceptedCallback, + clientBuilder: OkHttpClient.Builder ): OkHttpClient.Builder { return clientBuilder.addInterceptor(Interceptor { chain -> val request = chain.request() val response = chain.proceed(request) - callback.onWS(request, response) - - response - .newBuilder() + response.newBuilder() + // Removing this header to ensure that OkHttp does not fail due to unexpected values. .removeHeader("sec-websocket-extensions") - .addHeader("sec-websocket-extensions", "permessage-deflate") - .build() + // Adding the header to ensure successful parsing of the response. + .addHeader("sec-websocket-extensions", "permessage-deflate").build() }) } } diff --git a/pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WebSocketListenerProxy.kt b/pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WebSocketListenerProxy.kt index 6666dd69da..e0366c78be 100644 --- a/pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WebSocketListenerProxy.kt +++ b/pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WebSocketListenerProxy.kt @@ -1,5 +1,6 @@ -// TODO: add header -// TODO: add doc establishing why this exists (see cronet_http UrlRequestCallbackProxy) +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. package com.example.ok_http @@ -8,6 +9,17 @@ import okhttp3.WebSocket import okhttp3.WebSocketListener import okio.ByteString +/** + * `OkHttp` expects a subclass of the abstract class [`WebSocketListener`](https://square.github.io/okhttp/5.x/okhttp/okhttp3/-web-socket-listener/index.html) + * to be passed to the `newWebSocket` method. + * + * `package:jnigen` does not support the ability to subclass abstract Java classes in Dart + * (see https://github.com/dart-lang/jnigen/issues/348). + * + * This file provides an interface `WebSocketListener`, which can + * be implemented in Dart and a wrapper class `WebSocketListenerProxy`, which + * can be passed to the OkHttp API. + */ class WebSocketListenerProxy(private val listener: WebSocketListener) : WebSocketListener() { interface WebSocketListener { fun onOpen(webSocket: WebSocket, response: Response) diff --git a/pkgs/ok_http/example/lib/main.dart b/pkgs/ok_http/example/lib/main.dart index 2417a4e4fb..a291743be9 100644 --- a/pkgs/ok_http/example/lib/main.dart +++ b/pkgs/ok_http/example/lib/main.dart @@ -50,7 +50,7 @@ class HomePage extends StatefulWidget { } class _HomePageState extends State { - int _selectedIndex = 1; + int _selectedIndex = 0; final _labels = ['HTTP', 'WebSocket']; @override @@ -81,6 +81,7 @@ class _HomePageState extends State { } } +/// Example to demonstrate HTTP Calls with [OkHttpClient]. class BookSearch extends StatefulWidget { const BookSearch({super.key}); @@ -186,6 +187,8 @@ class _BookListState extends State { ); } +/// Example to demonstrate WebSocket communication with [OkHttpWebSocket], +/// using the echo server at `wss://echo.websocket.org`. class WebSocketEcho extends StatefulWidget { const WebSocketEcho({super.key}); @@ -194,6 +197,7 @@ class WebSocketEcho extends StatefulWidget { } class _WebSocketEchoState extends State { + // Contains a list of pairs [String message, bool isSent]. final List _messages = []; final msgController = TextEditingController(); @@ -231,6 +235,7 @@ class _WebSocketEchoState extends State { break; case CloseReceived(): _messages.add(['Connection closed', false]); + // For this example, binary data is not expected. default: _messages.add( ['Unknown message received $event', false]); @@ -242,7 +247,13 @@ class _WebSocketEchoState extends State { const SizedBox(width: 16), Expanded( child: ElevatedButton( - onPressed: () => _webSocket.close(), + onPressed: () { + try { + _webSocket.close(); + } on WebSocketException catch (e) { + print('Error closing WebSocket: ${e.message}'); + } + }, child: const Text('Disconnect'))), ], ), @@ -259,7 +270,6 @@ class _WebSocketEchoState extends State { ElevatedButton( onPressed: () { _webSocket.sendText(msgController.text); - setState(() { _messages.add([msgController.text, true]); }); diff --git a/pkgs/ok_http/jnigen.yaml b/pkgs/ok_http/jnigen.yaml index acce13cab8..40f40c67d1 100644 --- a/pkgs/ok_http/jnigen.yaml +++ b/pkgs/ok_http/jnigen.yaml @@ -35,7 +35,6 @@ classes: - "okhttp3.WebSocket" - "com.example.ok_http.WebSocketListenerProxy" - "okio.ByteString" - - "com.example.ok_http.WSInterceptedCallback" - "com.example.ok_http.WSInterceptor" # Exclude the deprecated methods listed below diff --git a/pkgs/ok_http/lib/src/jni/bindings.dart b/pkgs/ok_http/lib/src/jni/bindings.dart index 6a4569c3e6..ccd0e9ff24 100644 --- a/pkgs/ok_http/lib/src/jni/bindings.dart +++ b/pkgs/ok_http/lib/src/jni/bindings.dart @@ -13220,168 +13220,6 @@ final class $ByteStringType extends jni.JObjType { } } -/// from: com.example.ok_http.WSInterceptedCallback -class WSInterceptedCallback extends jni.JObject { - @override - late final jni.JObjType $type = type; - - WSInterceptedCallback.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - static final _class = - jni.JClass.forName(r"com/example/ok_http/WSInterceptedCallback"); - - /// The type which includes information such as the signature of this class. - static const type = $WSInterceptedCallbackType(); - static final _id_onWS = _class.instanceMethodId( - r"onWS", - r"(Lokhttp3/Request;Lokhttp3/Response;)V", - ); - - static final _onWS = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< - ( - ffi.Pointer, - ffi.Pointer - )>)>>("globalEnv_CallVoidMethod") - .asFunction< - jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); - - /// from: public abstract void onWS(okhttp3.Request request, okhttp3.Response response) - void onWS( - Request request, - Response response, - ) { - _onWS(reference.pointer, _id_onWS as jni.JMethodIDPtr, - request.reference.pointer, response.reference.pointer) - .check(); - } - - /// Maps a specific port to the implemented interface. - static final Map _$impls = {}; - ReceivePort? _$p; - - static jni.JObjectPtr _$invoke( - int port, - jni.JObjectPtr descriptor, - jni.JObjectPtr args, - ) { - return _$invokeMethod( - port, - $MethodInvocation.fromAddresses( - 0, - descriptor.address, - args.address, - ), - ); - } - - static final ffi.Pointer< - ffi.NativeFunction< - jni.JObjectPtr Function( - ffi.Uint64, jni.JObjectPtr, jni.JObjectPtr)>> - _$invokePointer = ffi.Pointer.fromFunction(_$invoke); - - static ffi.Pointer _$invokeMethod( - int $p, - $MethodInvocation $i, - ) { - try { - final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); - final $a = $i.args; - if ($d == r"onWS(Lokhttp3/Request;Lokhttp3/Response;)V") { - _$impls[$p]!.onWS( - $a[0].castTo(const $RequestType(), releaseOriginal: true), - $a[1].castTo(const $ResponseType(), releaseOriginal: true), - ); - return jni.nullptr; - } - } catch (e) { - return ProtectedJniExtensions.newDartException(e); - } - return jni.nullptr; - } - - factory WSInterceptedCallback.implement( - $WSInterceptedCallbackImpl $impl, - ) { - final $p = ReceivePort(); - final $x = WSInterceptedCallback.fromReference( - ProtectedJniExtensions.newPortProxy( - r"com.example.ok_http.WSInterceptedCallback", - $p, - _$invokePointer, - ), - ).._$p = $p; - final $a = $p.sendPort.nativePort; - _$impls[$a] = $impl; - $p.listen(($m) { - if ($m == null) { - _$impls.remove($p.sendPort.nativePort); - $p.close(); - return; - } - final $i = $MethodInvocation.fromMessage($m as List); - final $r = _$invokeMethod($p.sendPort.nativePort, $i); - ProtectedJniExtensions.returnResult($i.result, $r); - }); - return $x; - } -} - -abstract interface class $WSInterceptedCallbackImpl { - factory $WSInterceptedCallbackImpl({ - required void Function(Request request, Response response) onWS, - }) = _$WSInterceptedCallbackImpl; - - void onWS(Request request, Response response); -} - -class _$WSInterceptedCallbackImpl implements $WSInterceptedCallbackImpl { - _$WSInterceptedCallbackImpl({ - required void Function(Request request, Response response) onWS, - }) : _onWS = onWS; - - final void Function(Request request, Response response) _onWS; - - void onWS(Request request, Response response) { - return _onWS(request, response); - } -} - -final class $WSInterceptedCallbackType - extends jni.JObjType { - const $WSInterceptedCallbackType(); - - @override - String get signature => r"Lcom/example/ok_http/WSInterceptedCallback;"; - - @override - WSInterceptedCallback fromReference(jni.JReference reference) => - WSInterceptedCallback.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($WSInterceptedCallbackType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($WSInterceptedCallbackType) && - other is $WSInterceptedCallbackType; - } -} - /// from: com.example.ok_http.WSInterceptor$Companion class WSInterceptor_Companion extends jni.JObject { @override @@ -13398,34 +13236,27 @@ class WSInterceptor_Companion extends jni.JObject { static const type = $WSInterceptor_CompanionType(); static final _id_addWSInterceptor = _class.instanceMethodId( r"addWSInterceptor", - r"(Lokhttp3/OkHttpClient$Builder;Lcom/example/ok_http/WSInterceptedCallback;)Lokhttp3/OkHttpClient$Builder;", + r"(Lokhttp3/OkHttpClient$Builder;)Lokhttp3/OkHttpClient$Builder;", ); static final _addWSInterceptor = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs< - ( - ffi.Pointer, - ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Pointer,)>)>>( + "globalEnv_CallObjectMethod") .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer)>(); - /// from: public final okhttp3.OkHttpClient$Builder addWSInterceptor(okhttp3.OkHttpClient$Builder builder, com.example.ok_http.WSInterceptedCallback wSInterceptedCallback) + /// from: public final okhttp3.OkHttpClient$Builder addWSInterceptor(okhttp3.OkHttpClient$Builder builder) /// The returned object must be released after use, by calling the [release] method. OkHttpClient_Builder addWSInterceptor( OkHttpClient_Builder builder, - WSInterceptedCallback wSInterceptedCallback, ) { - return _addWSInterceptor( - reference.pointer, - _id_addWSInterceptor as jni.JMethodIDPtr, - builder.reference.pointer, - wSInterceptedCallback.reference.pointer) + return _addWSInterceptor(reference.pointer, + _id_addWSInterceptor as jni.JMethodIDPtr, builder.reference.pointer) .object(const $OkHttpClient_BuilderType()); } diff --git a/pkgs/ok_http/lib/src/ok_http_client.dart b/pkgs/ok_http/lib/src/ok_http_client.dart index c152ad18cc..4454d72d1f 100644 --- a/pkgs/ok_http/lib/src/ok_http_client.dart +++ b/pkgs/ok_http/lib/src/ok_http_client.dart @@ -279,12 +279,12 @@ class OkHttpClientWithProfile extends OkHttpClient { OkHttpClientWithProfile() : super(); } -extension on Uint8List { +extension JUint8List on Uint8List { JArray toJArray() => JArray(jbyte.type, length)..setRange(0, length, this); } -extension on JArray { +extension DartJArray on JArray { Uint8List toUint8List({int? length}) { length ??= this.length; final list = Uint8List(length); diff --git a/pkgs/ok_http/lib/src/ok_http_web_socket.dart b/pkgs/ok_http/lib/src/ok_http_web_socket.dart index b1c653de80..28c7abb86c 100644 --- a/pkgs/ok_http/lib/src/ok_http_web_socket.dart +++ b/pkgs/ok_http/lib/src/ok_http_web_socket.dart @@ -1,3 +1,7 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + import 'dart:async'; import 'dart:convert'; import 'dart:typed_data'; @@ -6,6 +10,7 @@ import 'package:jni/jni.dart'; import 'package:web_socket/web_socket.dart'; import 'jni/bindings.dart' as bindings; +import 'ok_http_client.dart'; class OkHttpWebSocket implements WebSocket { late bindings.OkHttpClient _client; @@ -14,13 +19,10 @@ class OkHttpWebSocket implements WebSocket { String? _protocol; OkHttpWebSocket._() { + // Add the WSInterceptor to prevent response parsing errors. _client = bindings.WSInterceptor.Companion - .addWSInterceptor(bindings.OkHttpClient_Builder(), - bindings.WSInterceptedCallback.implement( - bindings.$WSInterceptedCallbackImpl(onWS: (req, res) { - print(req.headers().toString1()); - print(res.headers().toString1()); - }))).build(); + .addWSInterceptor(bindings.OkHttpClient_Builder()) + .build(); } static Future connect(Uri url, @@ -55,7 +57,6 @@ class OkHttpWebSocket implements WebSocket { response.header1('sec-websocket-protocol'.toJString()); if (!protocolHeader.isNull) { _protocol = protocolHeader.toDartString(); - print('$_protocol; $protocols'); if (!(protocols?.contains(_protocol) ?? true)) { openCompleter .completeError(WebSocketException('Protocol mismatch. ' @@ -78,31 +79,30 @@ class OkHttpWebSocket implements WebSocket { }, onClosing: (bindings.WebSocket webSocket, int i, JString string) async { - if (_events.isClosed) throw WebSocketConnectionClosed(); + okHttpClientClose(); + + if (_events.isClosed) return; _events.add(CloseReceived(i, string.toDartString())); await _events.close(); - - _client.dispatcher().executorService().shutdown(); - _client.connectionPool().evictAll(); - var cache = _client.cache(); - if (!cache.isNull) { - cache.close(); - } - _client.release(); }, onFailure: (bindings.WebSocket webSocket, JObject throwable, bindings.Response response) { + if (_events.isClosed) return; + var throwableString = throwable.toString(); - if (throwableString.contains('java.io.EOFException') || - throwableString.contains( - // ignore: lines_longer_than_80_chars - 'java.net.ProtocolException: Control frames must be final.')) { + + // If the throwable is: + // - java.net.ProtocolException: Control frames must be final. + // - java.io.EOFException + // - java.net.SocketException: Socket closed + // Then the connection was closed abnormally. + if (throwableString.contains(RegExp( + r'(java\.net\.ProtocolException: Control frames must be final\.|java\.io\.EOFException|java\.net\.SocketException: Socket closed)'))) { _events.add(CloseReceived(1006, 'closed abnormal')); unawaited(_events.close()); return; } - print('problems $throwableString'); var error = WebSocketException( 'Connection ended unexpectedly $throwableString'); if (openCompleter.isCompleted) { @@ -131,10 +131,16 @@ class OkHttpWebSocket implements WebSocket { 'reason must be <= 123 bytes long when encoded as UTF-8'); } - // unawaited(_events.close()); + unawaited(_events.close()); + + // When no code is provided, cause an abnormal closure to send 1005. + if (code == null) { + _webSocket.cancel(); + return; + } - _webSocket.close(code ?? 1010, - reason?.toJString() ?? JString.fromReference(jNullReference)); + _webSocket.close( + code, reason?.toJString() ?? JString.fromReference(jNullReference)); } @override @@ -158,20 +164,15 @@ class OkHttpWebSocket implements WebSocket { } _webSocket.send(s.toJString()); } -} - -extension on Uint8List { - JArray toJArray() => - JArray(jbyte.type, length)..setRange(0, length, this); -} -extension on JArray { - Uint8List toUint8List({int? length}) { - length ??= this.length; - final list = Uint8List(length); - for (var i = 0; i < length; i++) { - list[i] = this[i]; + /// Closes the OkHttpClient using the recommended shutdown procedure. + void okHttpClientClose() { + _client.dispatcher().executorService().shutdown(); + _client.connectionPool().evictAll(); + var cache = _client.cache(); + if (!cache.isNull) { + cache.close(); } - return list; + _client.release(); } } From 5cea12ba31e60a46e4f2125ff5dd0847314330f9 Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Sun, 7 Jul 2024 11:55:46 +0530 Subject: [PATCH 10/27] add more docs --- pkgs/ok_http/lib/ok_http.dart | 4 +++- pkgs/ok_http/lib/src/ok_http_web_socket.dart | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/pkgs/ok_http/lib/ok_http.dart b/pkgs/ok_http/lib/ok_http.dart index 2533c42205..75b43ae8a5 100644 --- a/pkgs/ok_http/lib/ok_http.dart +++ b/pkgs/ok_http/lib/ok_http.dart @@ -3,7 +3,9 @@ // BSD-style license that can be found in the LICENSE file. /// An Android Flutter plugin that provides access to the -/// [OkHttp](https://square.github.io/okhttp/) HTTP client. +/// [OkHttp](https://square.github.io/okhttp/) HTTP client, and the OkHttp +/// [WebSocket](https://square.github.io/okhttp/5.x/okhttp/okhttp3/-web-socket/index.html) +/// API /// /// ``` /// import 'package:ok_http/ok_http.dart'; diff --git a/pkgs/ok_http/lib/src/ok_http_web_socket.dart b/pkgs/ok_http/lib/src/ok_http_web_socket.dart index 28c7abb86c..4a0a0650d3 100644 --- a/pkgs/ok_http/lib/src/ok_http_web_socket.dart +++ b/pkgs/ok_http/lib/src/ok_http_web_socket.dart @@ -12,6 +12,9 @@ import 'package:web_socket/web_socket.dart'; import 'jni/bindings.dart' as bindings; import 'ok_http_client.dart'; +/// A [WebSocket] implemented using the OkHttp library's +/// [WebSocket](https://square.github.io/okhttp/5.x/okhttp/okhttp3/-web-socket/index.html) +/// API. class OkHttpWebSocket implements WebSocket { late bindings.OkHttpClient _client; late final bindings.WebSocket _webSocket; @@ -25,6 +28,15 @@ class OkHttpWebSocket implements WebSocket { .build(); } + /// Create a new WebSocket connection using `OkHttp`'s + /// [WebSocket](https://square.github.io/okhttp/5.x/okhttp/okhttp3/-web-socket/index.html) + /// API. + /// + /// The URL supplied in [url] must use the scheme ws or wss. + /// + /// If provided, the [protocols] argument indicates that subprotocols that + /// the peer is able to select. See + /// [RFC-6455 1.9](https://datatracker.ietf.org/doc/html/rfc6455#section-1.9). static Future connect(Uri url, {Iterable? protocols}) async => OkHttpWebSocket._()._connect(url, protocols); @@ -79,7 +91,7 @@ class OkHttpWebSocket implements WebSocket { }, onClosing: (bindings.WebSocket webSocket, int i, JString string) async { - okHttpClientClose(); + _okHttpClientClose(); if (_events.isClosed) return; @@ -166,7 +178,7 @@ class OkHttpWebSocket implements WebSocket { } /// Closes the OkHttpClient using the recommended shutdown procedure. - void okHttpClientClose() { + void _okHttpClientClose() { _client.dispatcher().executorService().shutdown(); _client.connectionPool().evictAll(); var cache = _client.cache(); From 3c14e5dd712e7d55a1cb054e5a6fe8bcbbfe1ee7 Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Sun, 7 Jul 2024 11:59:39 +0530 Subject: [PATCH 11/27] Squashed commit of the following: commit 4178b67e7970ff02926e79649db5ab473b46cf30 Author: Brian Quinlan Date: Wed Jul 3 17:16:38 2024 -0700 Clarify when Client.close must be called (#1255) commit 719dc5f43e3d81ed24f499f122b58be2eb933b4c Author: Brian Quinlan Date: Tue Jul 2 11:18:29 2024 -0700 Upgrade to http_image_provider: 0.0.3 (#1253) commit 75b1efb125c6433f6efcb68e6a1509883ab276a2 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Jul 2 10:46:54 2024 -0700 Bump the github-actions group across 1 directory with 4 updates (#1251) Bumps the github-actions group with 4 updates in the / directory: [actions/checkout](https://github.com/actions/checkout), [subosito/flutter-action](https://github.com/subosito/flutter-action), [reactivecircus/android-emulator-runner](https://github.com/reactivecircus/android-emulator-runner) and [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart). Updates `actions/checkout` from 4.1.1 to 4.1.7 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/b4ffde65f46336ab88eb53be808477a3936bae11...692973e3d937129bcbf40652eb9f2f61becf3332) Updates `subosito/flutter-action` from 2.12.0 to 2.16.0 - [Release notes](https://github.com/subosito/flutter-action/releases) - [Commits](https://github.com/subosito/flutter-action/compare/2783a3f08e1baf891508463f8c6653c258246225...44ac965b96f18d999802d4b807e3256d5a3f9fa1) Updates `reactivecircus/android-emulator-runner` from 2.30.1 to 2.31.0 - [Release notes](https://github.com/reactivecircus/android-emulator-runner/releases) - [Changelog](https://github.com/ReactiveCircus/android-emulator-runner/blob/main/CHANGELOG.md) - [Commits](https://github.com/reactivecircus/android-emulator-runner/compare/6b0df4b0efb23bb0ec63d881db79aefbc976e4b2...77986be26589807b8ebab3fde7bbf5c60dabec32) Updates `dart-lang/setup-dart` from 1.6.4 to 1.6.5 - [Release notes](https://github.com/dart-lang/setup-dart/releases) - [Changelog](https://github.com/dart-lang/setup-dart/blob/main/CHANGELOG.md) - [Commits](https://github.com/dart-lang/setup-dart/compare/f0ead981b4d9a35b37f30d36160575d60931ec30...0a8a0fc875eb934c15d08629302413c671d3f672) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: subosito/flutter-action dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: reactivecircus/android-emulator-runner dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: dart-lang/setup-dart dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit cdfb94caada17fbe7fbe7246fa29e43a029ff4b1 Author: Brian Quinlan Date: Mon Jul 1 14:16:10 2024 -0700 Add an section explaining the benefits of using `package:ok_http`. (#1252) --- .github/workflows/cronet.yml | 6 +- .github/workflows/cupertino.yml | 4 +- .github/workflows/dart.yml | 96 +++++++++++------------ .github/workflows/java.yml | 4 +- .github/workflows/okhttp.yaml | 6 +- pkgs/cronet_http/example/lib/main.dart | 2 +- pkgs/cronet_http/example/pubspec.yaml | 2 +- pkgs/cupertino_http/example/lib/main.dart | 2 +- pkgs/cupertino_http/example/pubspec.yaml | 2 +- pkgs/flutter_http_example/lib/main.dart | 2 +- pkgs/flutter_http_example/pubspec.yaml | 2 +- pkgs/http/lib/src/client.dart | 7 +- pkgs/ok_http/README.md | 21 +++++ pkgs/ok_http/example/lib/main.dart | 2 +- pkgs/ok_http/example/pubspec.yaml | 2 +- 15 files changed, 92 insertions(+), 68 deletions(-) diff --git a/.github/workflows/cronet.yml b/.github/workflows/cronet.yml index 40b51469be..c6ca3e47be 100644 --- a/.github/workflows/cronet.yml +++ b/.github/workflows/cronet.yml @@ -31,12 +31,12 @@ jobs: run: working-directory: pkgs/cronet_http steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 with: distribution: 'zulu' java-version: '17' - - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 + - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 with: channel: 'stable' - id: install @@ -49,7 +49,7 @@ jobs: if: always() && steps.install.outcome == 'success' run: flutter analyze --fatal-infos - name: Run tests - uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 + uses: reactivecircus/android-emulator-runner@77986be26589807b8ebab3fde7bbf5c60dabec32 if: always() && steps.install.outcome == 'success' with: # api-level/minSdkVersion should be help in sync in: diff --git a/.github/workflows/cupertino.yml b/.github/workflows/cupertino.yml index b790193875..e701c73395 100644 --- a/.github/workflows/cupertino.yml +++ b/.github/workflows/cupertino.yml @@ -33,8 +33,8 @@ jobs: # version. flutter-version: ["3.22.0", "any"] steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 with: flutter-version: ${{ matrix.flutter-version }} channel: 'stable' diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index a294017b2b..00a651ede0 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -29,12 +29,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: sdk: stable - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - name: mono_repo self validate run: dart pub global activate mono_repo 6.6.1 - name: mono_repo self validate @@ -54,12 +54,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: sdk: "3.2.0" - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - id: pkgs_http_client_conformance_tests_pub_upgrade name: pkgs/http_client_conformance_tests; dart pub upgrade run: dart pub upgrade @@ -84,12 +84,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: sdk: "3.3.0" - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - id: pkgs_http_pub_upgrade name: pkgs/http; dart pub upgrade run: dart pub upgrade @@ -132,12 +132,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: sdk: "3.4.0" - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - id: pkgs_http_profile_pub_upgrade name: pkgs/http_profile; dart pub upgrade run: dart pub upgrade @@ -162,12 +162,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - id: pkgs_http_pub_upgrade name: pkgs/http; dart pub upgrade run: dart pub upgrade @@ -228,12 +228,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - id: pkgs_http_pub_upgrade name: pkgs/http; dart pub upgrade run: dart pub upgrade @@ -294,12 +294,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Flutter SDK - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 + uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 with: channel: stable - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - id: pkgs_flutter_http_example_pub_upgrade name: pkgs/flutter_http_example; flutter pub upgrade run: flutter pub upgrade @@ -324,12 +324,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Flutter SDK - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 + uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 with: channel: stable - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - id: pkgs_flutter_http_example_pub_upgrade name: pkgs/flutter_http_example; flutter pub upgrade run: flutter pub upgrade @@ -354,12 +354,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: sdk: "3.3.0" - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - id: pkgs_http_pub_upgrade name: pkgs/http; dart pub upgrade run: dart pub upgrade @@ -393,12 +393,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: sdk: "3.3.0" - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - id: pkgs_http_pub_upgrade name: pkgs/http; dart pub upgrade run: dart pub upgrade @@ -432,12 +432,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: sdk: "3.3.0" - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - id: pkgs_http_pub_upgrade name: pkgs/http; dart pub upgrade run: dart pub upgrade @@ -471,12 +471,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: sdk: "3.3.0" - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - id: pkgs_web_socket_pub_upgrade name: pkgs/web_socket; dart pub upgrade run: dart pub upgrade @@ -510,12 +510,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: sdk: "3.3.0" - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - id: pkgs_web_socket_pub_upgrade name: pkgs/web_socket; dart pub upgrade run: dart pub upgrade @@ -549,12 +549,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: sdk: "3.4.0" - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - id: pkgs_http_profile_pub_upgrade name: pkgs/http_profile; dart pub upgrade run: dart pub upgrade @@ -588,12 +588,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - id: pkgs_http_pub_upgrade name: pkgs/http; dart pub upgrade run: dart pub upgrade @@ -627,12 +627,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - id: pkgs_http_pub_upgrade name: pkgs/http; dart pub upgrade run: dart pub upgrade @@ -666,12 +666,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - id: pkgs_http_pub_upgrade name: pkgs/http; dart pub upgrade run: dart pub upgrade @@ -714,12 +714,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - id: pkgs_http_pub_upgrade name: pkgs/http; dart pub upgrade run: dart pub upgrade @@ -753,12 +753,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - id: pkgs_web_socket_pub_upgrade name: pkgs/web_socket; dart pub upgrade run: dart pub upgrade @@ -792,12 +792,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - id: pkgs_web_socket_pub_upgrade name: pkgs/web_socket; dart pub upgrade run: dart pub upgrade @@ -831,12 +831,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Flutter SDK - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 + uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 with: channel: stable - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - id: pkgs_flutter_http_example_pub_upgrade name: pkgs/flutter_http_example; flutter pub upgrade run: flutter pub upgrade @@ -870,12 +870,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Flutter SDK - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 + uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 with: channel: stable - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - id: pkgs_flutter_http_example_pub_upgrade name: pkgs/flutter_http_example; flutter pub upgrade run: flutter pub upgrade @@ -909,12 +909,12 @@ jobs: os:macos-latest;pub-cache-hosted os:macos-latest - name: Setup Flutter SDK - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 + uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 with: channel: stable - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - id: pkgs_flutter_http_example_pub_upgrade name: pkgs/flutter_http_example; flutter pub upgrade run: flutter pub upgrade @@ -938,12 +938,12 @@ jobs: runs-on: windows-latest steps: - name: Setup Flutter SDK - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 + uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 with: channel: stable - id: checkout name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - id: pkgs_flutter_http_example_pub_upgrade name: pkgs/flutter_http_example; flutter pub upgrade run: flutter pub upgrade diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml index fd0afc9639..f9ae20d336 100644 --- a/.github/workflows/java.yml +++ b/.github/workflows/java.yml @@ -29,8 +29,8 @@ jobs: run: working-directory: pkgs/java_http steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 with: channel: 'stable' - id: install diff --git a/.github/workflows/okhttp.yaml b/.github/workflows/okhttp.yaml index 6670fd2f8d..e20a039ce9 100644 --- a/.github/workflows/okhttp.yaml +++ b/.github/workflows/okhttp.yaml @@ -28,12 +28,12 @@ jobs: run: working-directory: pkgs/ok_http steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 with: distribution: 'zulu' java-version: '17' - - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 + - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 with: channel: 'stable' - id: install @@ -46,7 +46,7 @@ jobs: if: always() && steps.install.outcome == 'success' run: flutter analyze --fatal-infos - name: Run tests - uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 + uses: reactivecircus/android-emulator-runner@77986be26589807b8ebab3fde7bbf5c60dabec32 if: always() && steps.install.outcome == 'success' with: # api-level/minSdkVersion should be help in sync in: diff --git a/pkgs/cronet_http/example/lib/main.dart b/pkgs/cronet_http/example/lib/main.dart index 1af8e9203f..62990e337d 100644 --- a/pkgs/cronet_http/example/lib/main.dart +++ b/pkgs/cronet_http/example/lib/main.dart @@ -142,7 +142,7 @@ class _BookListState extends State { key: ValueKey(widget.books[index].title), child: ListTile( leading: Image( - image: HttpImage( + image: HttpImageProvider( widget.books[index].imageUrl.replace(scheme: 'https'), client: context.read())), title: Text(widget.books[index].title), diff --git a/pkgs/cronet_http/example/pubspec.yaml b/pkgs/cronet_http/example/pubspec.yaml index 5d94a3944e..a2ed4b03cb 100644 --- a/pkgs/cronet_http/example/pubspec.yaml +++ b/pkgs/cronet_http/example/pubspec.yaml @@ -13,7 +13,7 @@ dependencies: flutter: sdk: flutter http: ^1.0.0 - http_image_provider: ^0.0.2 + http_image_provider: ^0.0.3 provider: ^6.1.1 dev_dependencies: diff --git a/pkgs/cupertino_http/example/lib/main.dart b/pkgs/cupertino_http/example/lib/main.dart index 24436ea052..78fcb9c8ad 100644 --- a/pkgs/cupertino_http/example/lib/main.dart +++ b/pkgs/cupertino_http/example/lib/main.dart @@ -141,7 +141,7 @@ class _BookListState extends State { key: ValueKey(widget.books[index].title), child: ListTile( leading: Image( - image: HttpImage( + image: HttpImageProvider( widget.books[index].imageUrl.replace(scheme: 'https'), client: context.read())), title: Text(widget.books[index].title), diff --git a/pkgs/cupertino_http/example/pubspec.yaml b/pkgs/cupertino_http/example/pubspec.yaml index a57f39fd05..b074234bff 100644 --- a/pkgs/cupertino_http/example/pubspec.yaml +++ b/pkgs/cupertino_http/example/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: flutter: sdk: flutter http: ^1.0.0 - http_image_provider: ^0.0.2 + http_image_provider: ^0.0.3 provider: ^6.1.1 dev_dependencies: diff --git a/pkgs/flutter_http_example/lib/main.dart b/pkgs/flutter_http_example/lib/main.dart index 13d8bc24d8..899105b227 100644 --- a/pkgs/flutter_http_example/lib/main.dart +++ b/pkgs/flutter_http_example/lib/main.dart @@ -138,7 +138,7 @@ class _BookListState extends State { key: ValueKey(widget.books[index].title), child: ListTile( leading: Image( - image: HttpImage( + image: HttpImageProvider( widget.books[index].imageUrl.replace(scheme: 'https'), client: context.read())), title: Text(widget.books[index].title), diff --git a/pkgs/flutter_http_example/pubspec.yaml b/pkgs/flutter_http_example/pubspec.yaml index b3b3ef50f7..272f50d854 100644 --- a/pkgs/flutter_http_example/pubspec.yaml +++ b/pkgs/flutter_http_example/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: flutter: sdk: flutter http: ^1.0.0 - http_image_provider: ^0.0.2 + http_image_provider: ^0.0.3 provider: ^6.0.5 dev_dependencies: diff --git a/pkgs/http/lib/src/client.dart b/pkgs/http/lib/src/client.dart index dace470a75..6de5698104 100644 --- a/pkgs/http/lib/src/client.dart +++ b/pkgs/http/lib/src/client.dart @@ -148,8 +148,11 @@ abstract interface class Client { /// Closes the client and cleans up any resources associated with it. /// - /// It's important to close each client when it's done being used; failing to - /// do so can cause the Dart process to hang. + /// Some clients maintain a pool of network connections that will not be + /// disconnected until the client is closed. This may cause programs using + /// using the Dart SDK (`dart run`, `dart test`, `dart compile`, etc.) to + /// not terminate until the client is closed. Programs run using the Flutter + /// SDK can still terminate even with an active connection pool. /// /// Once [close] is called, no other methods should be called. If [close] is /// called while other asynchronous methods are running, the behavior is diff --git a/pkgs/ok_http/README.md b/pkgs/ok_http/README.md index cca48a3079..6c21d824e7 100644 --- a/pkgs/ok_http/README.md +++ b/pkgs/ok_http/README.md @@ -4,6 +4,25 @@ An Android Flutter plugin that provides access to the [OkHttp][] HTTP client. +## Why use `package:ok_http`? + +### 👍 Increased compatibility and reduced disk profile + +`package:ok_http` is smaller and works on more devices than other packages. + +This size of the [example application][] APK file using different packages: + +| Package | APK Size (MiB) | +|-|-| +| **`ok_http`** | **20.3** | +| [`cronet_http`](https://pub.dev/packages/cronet_http) [^1] | 20.6 | +| [`cronet_http` (embedded)](https://pub.dev/packages/cronet_http#use-embedded-cronet) [^2] | 34.4 | +| `dart:io` [^3] | 20.4 | + +[^1]: Requires [Google Play Services][], which are not available on all devices. +[^2]: Embeds the Cronet HTTP library. +[^3]: Accessed through [`IOClient`](https://pub.dev/documentation/http/latest/io_client/IOClient-class.html). + ## Status: experimental **NOTE**: This package is currently experimental and published under the @@ -19,4 +38,6 @@ Your feedback is valuable and will help us evolve this package. For general feedback, suggestions, and comments, please file an issue in the [bug tracker](https://github.com/dart-lang/http/issues). +[example application]: https://github.com/dart-lang/http/tree/master/pkgs/flutter_http_example [OkHttp]: https://square.github.io/okhttp/ +[Google Play Services]: https://developers.google.com/android/guides/overview diff --git a/pkgs/ok_http/example/lib/main.dart b/pkgs/ok_http/example/lib/main.dart index a291743be9..871779eed0 100644 --- a/pkgs/ok_http/example/lib/main.dart +++ b/pkgs/ok_http/example/lib/main.dart @@ -177,7 +177,7 @@ class _BookListState extends State { key: ValueKey(widget.books[index].title), child: ListTile( leading: Image( - image: HttpImage( + image: HttpImageProvider( widget.books[index].imageUrl.replace(scheme: 'https'), client: context.read())), title: Text(widget.books[index].title), diff --git a/pkgs/ok_http/example/pubspec.yaml b/pkgs/ok_http/example/pubspec.yaml index ea64ed0ae8..8a394364fe 100644 --- a/pkgs/ok_http/example/pubspec.yaml +++ b/pkgs/ok_http/example/pubspec.yaml @@ -12,7 +12,7 @@ dependencies: flutter: sdk: flutter http: ^1.0.0 - http_image_provider: ^0.0.2 + http_image_provider: ^0.0.3 ok_http: path: ../ provider: ^6.1.1 From 91c9378d5a05f67e3b95933e5ebc45f2eb2ad4fe Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Sun, 7 Jul 2024 12:09:03 +0530 Subject: [PATCH 12/27] add more and more docs --- pkgs/ok_http/README.md | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/pkgs/ok_http/README.md b/pkgs/ok_http/README.md index 6c21d824e7..18668cc382 100644 --- a/pkgs/ok_http/README.md +++ b/pkgs/ok_http/README.md @@ -1,8 +1,8 @@ -[![pub package](https://img.shields.io/pub/v/cronet_http.svg)](https://pub.dev/packages/ok_http) +[![pub package](https://img.shields.io/pub/v/ok_http.svg)](https://pub.dev/packages/ok_http) [![package publisher](https://img.shields.io/pub/publisher/ok_http.svg)](https://pub.dev/packages/ok_http/publisher) An Android Flutter plugin that provides access to the -[OkHttp][] HTTP client. +[OkHttp][] HTTP client and the OkHttp [WebSocket][] API. ## Why use `package:ok_http`? @@ -12,17 +12,23 @@ An Android Flutter plugin that provides access to the This size of the [example application][] APK file using different packages: -| Package | APK Size (MiB) | -|-|-| -| **`ok_http`** | **20.3** | -| [`cronet_http`](https://pub.dev/packages/cronet_http) [^1] | 20.6 | -| [`cronet_http` (embedded)](https://pub.dev/packages/cronet_http#use-embedded-cronet) [^2] | 34.4 | -| `dart:io` [^3] | 20.4 | +| Package | APK Size (MiB) | +| ----------------------------------------------------------------------------------------- | -------------- | +| **`ok_http`** | **20.3** | +| [`cronet_http`](https://pub.dev/packages/cronet_http) [^1] | 20.6 | +| [`cronet_http` (embedded)](https://pub.dev/packages/cronet_http#use-embedded-cronet) [^2] | 34.4 | +| `dart:io` [^3] | 20.4 | [^1]: Requires [Google Play Services][], which are not available on all devices. [^2]: Embeds the Cronet HTTP library. [^3]: Accessed through [`IOClient`](https://pub.dev/documentation/http/latest/io_client/IOClient-class.html). +### 🔌 Supports WebSockets out of the box + +`package:ok_http` wraps the OkHttp [WebSocket][] API, allowing you to use it in your Flutter app with ease. + +See the [OkHttp Example App][] for usage notes. + ## Status: experimental **NOTE**: This package is currently experimental and published under the @@ -41,3 +47,5 @@ feedback, suggestions, and comments, please file an issue in the [example application]: https://github.com/dart-lang/http/tree/master/pkgs/flutter_http_example [OkHttp]: https://square.github.io/okhttp/ [Google Play Services]: https://developers.google.com/android/guides/overview +[WebSocket]: https://square.github.io/okhttp/5.x/okhttp/okhttp3/-web-socket/index.html +[OkHttp Example App]: https://github.com/dart-lang/http/tree/master/pkgs/ok_http/example/ From 9968a7665a4527ddc94cdc0625bbe240913bd2ac Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Sun, 7 Jul 2024 12:14:37 +0530 Subject: [PATCH 13/27] update changelog --- pkgs/ok_http/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/ok_http/CHANGELOG.md b/pkgs/ok_http/CHANGELOG.md index 433fc4ec44..602cb6c46b 100644 --- a/pkgs/ok_http/CHANGELOG.md +++ b/pkgs/ok_http/CHANGELOG.md @@ -3,3 +3,4 @@ - Implementation of [`BaseClient`](https://pub.dev/documentation/http/latest/http/BaseClient-class.html) and `send()` method using [`enqueue()` API](https://square.github.io/okhttp/5.x/okhttp/okhttp3/-call/enqueue.html) - `ok_http` can now send asynchronous requests and stream response bodies. - Add [DevTools Network View](https://docs.flutter.dev/tools/devtools/network) support. +- WebSockets support is now available in the `ok_http` package. Wraps around the OkHttp [WebSocket API](https://square.github.io/okhttp/5.x/okhttp/okhttp3/-web-socket/index.html). From add63c51fd2f129d7611fb69601264985761428b Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Sun, 7 Jul 2024 12:27:49 +0530 Subject: [PATCH 14/27] Revert "ok_http: jnigen fixes" This reverts commit bd97d77eb1a5cf0585733556239776c720684c54. --- pkgs/ok_http/analysis_options.yaml | 5 + pkgs/ok_http/jnigen.yaml | 1 - pkgs/ok_http/lib/src/jni/bindings.dart | 322 +---------------------- pkgs/ok_http/lib/src/ok_http_client.dart | 10 +- 4 files changed, 17 insertions(+), 321 deletions(-) create mode 100644 pkgs/ok_http/analysis_options.yaml diff --git a/pkgs/ok_http/analysis_options.yaml b/pkgs/ok_http/analysis_options.yaml new file mode 100644 index 0000000000..8de8919f97 --- /dev/null +++ b/pkgs/ok_http/analysis_options.yaml @@ -0,0 +1,5 @@ +include: ../../analysis_options.yaml + +analyzer: + exclude: + - "lib/src/jni/bindings.dart" diff --git a/pkgs/ok_http/jnigen.yaml b/pkgs/ok_http/jnigen.yaml index 40f40c67d1..6c657a29ef 100644 --- a/pkgs/ok_http/jnigen.yaml +++ b/pkgs/ok_http/jnigen.yaml @@ -26,7 +26,6 @@ classes: - "okhttp3.Callback" - "okhttp3.ConnectionPool" - "okhttp3.Dispatcher" - - "java.util.concurrent.ExecutorService" - "okhttp3.Cache" - "com.example.ok_http.RedirectReceivedCallback" - "com.example.ok_http.RedirectInterceptor" diff --git a/pkgs/ok_http/lib/src/jni/bindings.dart b/pkgs/ok_http/lib/src/jni/bindings.dart index ccd0e9ff24..24e1232c50 100644 --- a/pkgs/ok_http/lib/src/jni/bindings.dart +++ b/pkgs/ok_http/lib/src/jni/bindings.dart @@ -1,8 +1,3 @@ -// ignore_for_file: prefer_single_quotes -// ignore_for_file: directives_ordering -// ignore_for_file: prefer_expression_function_bodies -// ignore_for_file: unnecessary_parenthesis - // Autogenerated by jnigen. DO NOT EDIT! // ignore_for_file: annotate_overrides @@ -8532,10 +8527,10 @@ class Dispatcher extends jni.JObject { /// from: public final java.util.concurrent.ExecutorService executorService() /// The returned object must be released after use, by calling the [release] method. - ExecutorService executorService() { + jni.JObject executorService() { return _executorService( reference.pointer, _id_executorService as jni.JMethodIDPtr) - .object(const $ExecutorServiceType()); + .object(const jni.JObjectType()); } static final _id_new1 = _class.constructorId( @@ -8556,7 +8551,7 @@ class Dispatcher extends jni.JObject { /// from: public void (java.util.concurrent.ExecutorService executorService) /// The returned object must be released after use, by calling the [release] method. factory Dispatcher.new1( - ExecutorService executorService, + jni.JObject executorService, ) { return Dispatcher.fromReference(_new1(_class.reference.pointer, _id_new1 as jni.JMethodIDPtr, executorService.reference.pointer) @@ -8708,317 +8703,6 @@ final class $DispatcherType extends jni.JObjType { } } -/// from: java.util.concurrent.ExecutorService -class ExecutorService extends jni.JObject { - @override - late final jni.JObjType $type = type; - - ExecutorService.fromReference( - jni.JReference reference, - ) : super.fromReference(reference); - - static final _class = - jni.JClass.forName(r"java/util/concurrent/ExecutorService"); - - /// The type which includes information such as the signature of this class. - static const type = $ExecutorServiceType(); - static final _id_shutdown = _class.instanceMethodId( - r"shutdown", - r"()V", - ); - - static final _shutdown = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>("globalEnv_CallVoidMethod") - .asFunction< - jni.JThrowablePtr Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); - - /// from: public abstract void shutdown() - void shutdown() { - _shutdown(reference.pointer, _id_shutdown as jni.JMethodIDPtr).check(); - } - - static final _id_shutdownNow = _class.instanceMethodId( - r"shutdownNow", - r"()Ljava/util/List;", - ); - - static final _shutdownNow = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); - - /// from: public abstract java.util.List shutdownNow() - /// The returned object must be released after use, by calling the [release] method. - jni.JList shutdownNow() { - return _shutdownNow(reference.pointer, _id_shutdownNow as jni.JMethodIDPtr) - .object(const jni.JListType(jni.JObjectType())); - } - - static final _id_isShutdown = _class.instanceMethodId( - r"isShutdown", - r"()Z", - ); - - static final _isShutdown = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>("globalEnv_CallBooleanMethod") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); - - /// from: public abstract boolean isShutdown() - bool isShutdown() { - return _isShutdown(reference.pointer, _id_isShutdown as jni.JMethodIDPtr) - .boolean; - } - - static final _id_isTerminated = _class.instanceMethodId( - r"isTerminated", - r"()Z", - ); - - static final _isTerminated = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>>("globalEnv_CallBooleanMethod") - .asFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - )>(); - - /// from: public abstract boolean isTerminated() - bool isTerminated() { - return _isTerminated( - reference.pointer, _id_isTerminated as jni.JMethodIDPtr) - .boolean; - } - - static final _id_awaitTermination = _class.instanceMethodId( - r"awaitTermination", - r"(JLjava/util/concurrent/TimeUnit;)Z", - ); - - static final _awaitTermination = ProtectedJniExtensions.lookup< - ffi.NativeFunction< - jni.JniResult Function( - ffi.Pointer, - jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Int64, ffi.Pointer)>)>>( - "globalEnv_CallBooleanMethod") - .asFunction< - jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, - ffi.Pointer)>(); - - /// from: public abstract boolean awaitTermination(long j, java.util.concurrent.TimeUnit timeUnit) - bool awaitTermination( - int j, - jni.JObject timeUnit, - ) { - return _awaitTermination( - reference.pointer, - _id_awaitTermination as jni.JMethodIDPtr, - j, - timeUnit.reference.pointer) - .boolean; - } - - /// Maps a specific port to the implemented interface. - static final Map _$impls = {}; - ReceivePort? _$p; - - static jni.JObjectPtr _$invoke( - int port, - jni.JObjectPtr descriptor, - jni.JObjectPtr args, - ) { - return _$invokeMethod( - port, - $MethodInvocation.fromAddresses( - 0, - descriptor.address, - args.address, - ), - ); - } - - static final ffi.Pointer< - ffi.NativeFunction< - jni.JObjectPtr Function( - ffi.Uint64, jni.JObjectPtr, jni.JObjectPtr)>> - _$invokePointer = ffi.Pointer.fromFunction(_$invoke); - - static ffi.Pointer _$invokeMethod( - int $p, - $MethodInvocation $i, - ) { - try { - final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); - final $a = $i.args; - if ($d == r"shutdown()V") { - _$impls[$p]!.shutdown(); - return jni.nullptr; - } - if ($d == r"shutdownNow()Ljava/util/List;") { - final $r = _$impls[$p]!.shutdownNow(); - return ($r as jni.JObject) - .castTo(const jni.JObjectType()) - .reference - .toPointer(); - } - if ($d == r"isShutdown()Z") { - final $r = _$impls[$p]!.isShutdown(); - return jni.JBoolean($r).reference.toPointer(); - } - if ($d == r"isTerminated()Z") { - final $r = _$impls[$p]!.isTerminated(); - return jni.JBoolean($r).reference.toPointer(); - } - if ($d == r"awaitTermination(JLjava/util/concurrent/TimeUnit;)Z") { - final $r = _$impls[$p]!.awaitTermination( - $a[0] - .castTo(const jni.JLongType(), releaseOriginal: true) - .longValue(releaseOriginal: true), - $a[1].castTo(const jni.JObjectType(), releaseOriginal: true), - ); - return jni.JBoolean($r).reference.toPointer(); - } - } catch (e) { - return ProtectedJniExtensions.newDartException(e); - } - return jni.nullptr; - } - - factory ExecutorService.implement( - $ExecutorServiceImpl $impl, - ) { - final $p = ReceivePort(); - final $x = ExecutorService.fromReference( - ProtectedJniExtensions.newPortProxy( - r"java.util.concurrent.ExecutorService", - $p, - _$invokePointer, - ), - ).._$p = $p; - final $a = $p.sendPort.nativePort; - _$impls[$a] = $impl; - $p.listen(($m) { - if ($m == null) { - _$impls.remove($p.sendPort.nativePort); - $p.close(); - return; - } - final $i = $MethodInvocation.fromMessage($m as List); - final $r = _$invokeMethod($p.sendPort.nativePort, $i); - ProtectedJniExtensions.returnResult($i.result, $r); - }); - return $x; - } -} - -abstract interface class $ExecutorServiceImpl { - factory $ExecutorServiceImpl({ - required void Function() shutdown, - required jni.JList Function() shutdownNow, - required bool Function() isShutdown, - required bool Function() isTerminated, - required bool Function(int j, jni.JObject timeUnit) awaitTermination, - }) = _$ExecutorServiceImpl; - - void shutdown(); - jni.JList shutdownNow(); - bool isShutdown(); - bool isTerminated(); - bool awaitTermination(int j, jni.JObject timeUnit); -} - -class _$ExecutorServiceImpl implements $ExecutorServiceImpl { - _$ExecutorServiceImpl({ - required void Function() shutdown, - required jni.JList Function() shutdownNow, - required bool Function() isShutdown, - required bool Function() isTerminated, - required bool Function(int j, jni.JObject timeUnit) awaitTermination, - }) : _shutdown = shutdown, - _shutdownNow = shutdownNow, - _isShutdown = isShutdown, - _isTerminated = isTerminated, - _awaitTermination = awaitTermination; - - final void Function() _shutdown; - final jni.JList Function() _shutdownNow; - final bool Function() _isShutdown; - final bool Function() _isTerminated; - final bool Function(int j, jni.JObject timeUnit) _awaitTermination; - - void shutdown() { - return _shutdown(); - } - - jni.JList shutdownNow() { - return _shutdownNow(); - } - - bool isShutdown() { - return _isShutdown(); - } - - bool isTerminated() { - return _isTerminated(); - } - - bool awaitTermination(int j, jni.JObject timeUnit) { - return _awaitTermination(j, timeUnit); - } -} - -final class $ExecutorServiceType extends jni.JObjType { - const $ExecutorServiceType(); - - @override - String get signature => r"Ljava/util/concurrent/ExecutorService;"; - - @override - ExecutorService fromReference(jni.JReference reference) => - ExecutorService.fromReference(reference); - - @override - jni.JObjType get superType => const jni.JObjectType(); - - @override - final superCount = 1; - - @override - int get hashCode => ($ExecutorServiceType).hashCode; - - @override - bool operator ==(Object other) { - return other.runtimeType == ($ExecutorServiceType) && - other is $ExecutorServiceType; - } -} - /// from: okhttp3.Cache$Companion class Cache_Companion extends jni.JObject { @override diff --git a/pkgs/ok_http/lib/src/ok_http_client.dart b/pkgs/ok_http/lib/src/ok_http_client.dart index 4454d72d1f..9ef7f75402 100644 --- a/pkgs/ok_http/lib/src/ok_http_client.dart +++ b/pkgs/ok_http/lib/src/ok_http_client.dart @@ -56,7 +56,15 @@ class OkHttpClient extends BaseClient { if (!_isClosed) { // Refer to OkHttp documentation for the shutdown procedure: // https://square.github.io/okhttp/5.x/okhttp/okhttp3/-ok-http-client/index.html#:~:text=Shutdown - _client.dispatcher().executorService().shutdown(); + + // Bindings for `java.util.concurrent.ExecutorService` are erroneous. + // https://github.com/dart-lang/native/issues/588 + // So, use the JClass API to call the `shutdown` method by its signature. + _client + .dispatcher() + .executorService() + .jClass + .instanceMethodId('shutdown', '()V'); // Remove all idle connections from the resource pool. _client.connectionPool().evictAll(); From 280b727c512949f3dc37425cf2f8190d4cceba33 Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Sun, 7 Jul 2024 12:33:07 +0530 Subject: [PATCH 15/27] jnigen fixes --- pkgs/ok_http/analysis_options.yaml | 5 - pkgs/ok_http/jnigen.yaml | 1 + pkgs/ok_http/lib/src/jni/bindings.dart | 322 ++++++++++++++++++++++- pkgs/ok_http/lib/src/ok_http_client.dart | 9 +- 4 files changed, 321 insertions(+), 16 deletions(-) delete mode 100644 pkgs/ok_http/analysis_options.yaml diff --git a/pkgs/ok_http/analysis_options.yaml b/pkgs/ok_http/analysis_options.yaml deleted file mode 100644 index 8de8919f97..0000000000 --- a/pkgs/ok_http/analysis_options.yaml +++ /dev/null @@ -1,5 +0,0 @@ -include: ../../analysis_options.yaml - -analyzer: - exclude: - - "lib/src/jni/bindings.dart" diff --git a/pkgs/ok_http/jnigen.yaml b/pkgs/ok_http/jnigen.yaml index 6c657a29ef..40f40c67d1 100644 --- a/pkgs/ok_http/jnigen.yaml +++ b/pkgs/ok_http/jnigen.yaml @@ -26,6 +26,7 @@ classes: - "okhttp3.Callback" - "okhttp3.ConnectionPool" - "okhttp3.Dispatcher" + - "java.util.concurrent.ExecutorService" - "okhttp3.Cache" - "com.example.ok_http.RedirectReceivedCallback" - "com.example.ok_http.RedirectInterceptor" diff --git a/pkgs/ok_http/lib/src/jni/bindings.dart b/pkgs/ok_http/lib/src/jni/bindings.dart index 24e1232c50..ccd0e9ff24 100644 --- a/pkgs/ok_http/lib/src/jni/bindings.dart +++ b/pkgs/ok_http/lib/src/jni/bindings.dart @@ -1,3 +1,8 @@ +// ignore_for_file: prefer_single_quotes +// ignore_for_file: directives_ordering +// ignore_for_file: prefer_expression_function_bodies +// ignore_for_file: unnecessary_parenthesis + // Autogenerated by jnigen. DO NOT EDIT! // ignore_for_file: annotate_overrides @@ -8527,10 +8532,10 @@ class Dispatcher extends jni.JObject { /// from: public final java.util.concurrent.ExecutorService executorService() /// The returned object must be released after use, by calling the [release] method. - jni.JObject executorService() { + ExecutorService executorService() { return _executorService( reference.pointer, _id_executorService as jni.JMethodIDPtr) - .object(const jni.JObjectType()); + .object(const $ExecutorServiceType()); } static final _id_new1 = _class.constructorId( @@ -8551,7 +8556,7 @@ class Dispatcher extends jni.JObject { /// from: public void (java.util.concurrent.ExecutorService executorService) /// The returned object must be released after use, by calling the [release] method. factory Dispatcher.new1( - jni.JObject executorService, + ExecutorService executorService, ) { return Dispatcher.fromReference(_new1(_class.reference.pointer, _id_new1 as jni.JMethodIDPtr, executorService.reference.pointer) @@ -8703,6 +8708,317 @@ final class $DispatcherType extends jni.JObjType { } } +/// from: java.util.concurrent.ExecutorService +class ExecutorService extends jni.JObject { + @override + late final jni.JObjType $type = type; + + ExecutorService.fromReference( + jni.JReference reference, + ) : super.fromReference(reference); + + static final _class = + jni.JClass.forName(r"java/util/concurrent/ExecutorService"); + + /// The type which includes information such as the signature of this class. + static const type = $ExecutorServiceType(); + static final _id_shutdown = _class.instanceMethodId( + r"shutdown", + r"()V", + ); + + static final _shutdown = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallVoidMethod") + .asFunction< + jni.JThrowablePtr Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public abstract void shutdown() + void shutdown() { + _shutdown(reference.pointer, _id_shutdown as jni.JMethodIDPtr).check(); + } + + static final _id_shutdownNow = _class.instanceMethodId( + r"shutdownNow", + r"()Ljava/util/List;", + ); + + static final _shutdownNow = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallObjectMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public abstract java.util.List shutdownNow() + /// The returned object must be released after use, by calling the [release] method. + jni.JList shutdownNow() { + return _shutdownNow(reference.pointer, _id_shutdownNow as jni.JMethodIDPtr) + .object(const jni.JListType(jni.JObjectType())); + } + + static final _id_isShutdown = _class.instanceMethodId( + r"isShutdown", + r"()Z", + ); + + static final _isShutdown = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallBooleanMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public abstract boolean isShutdown() + bool isShutdown() { + return _isShutdown(reference.pointer, _id_isShutdown as jni.JMethodIDPtr) + .boolean; + } + + static final _id_isTerminated = _class.instanceMethodId( + r"isTerminated", + r"()Z", + ); + + static final _isTerminated = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>>("globalEnv_CallBooleanMethod") + .asFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + )>(); + + /// from: public abstract boolean isTerminated() + bool isTerminated() { + return _isTerminated( + reference.pointer, _id_isTerminated as jni.JMethodIDPtr) + .boolean; + } + + static final _id_awaitTermination = _class.instanceMethodId( + r"awaitTermination", + r"(JLjava/util/concurrent/TimeUnit;)Z", + ); + + static final _awaitTermination = ProtectedJniExtensions.lookup< + ffi.NativeFunction< + jni.JniResult Function( + ffi.Pointer, + jni.JMethodIDPtr, + ffi.VarArgs<(ffi.Int64, ffi.Pointer)>)>>( + "globalEnv_CallBooleanMethod") + .asFunction< + jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, + ffi.Pointer)>(); + + /// from: public abstract boolean awaitTermination(long j, java.util.concurrent.TimeUnit timeUnit) + bool awaitTermination( + int j, + jni.JObject timeUnit, + ) { + return _awaitTermination( + reference.pointer, + _id_awaitTermination as jni.JMethodIDPtr, + j, + timeUnit.reference.pointer) + .boolean; + } + + /// Maps a specific port to the implemented interface. + static final Map _$impls = {}; + ReceivePort? _$p; + + static jni.JObjectPtr _$invoke( + int port, + jni.JObjectPtr descriptor, + jni.JObjectPtr args, + ) { + return _$invokeMethod( + port, + $MethodInvocation.fromAddresses( + 0, + descriptor.address, + args.address, + ), + ); + } + + static final ffi.Pointer< + ffi.NativeFunction< + jni.JObjectPtr Function( + ffi.Uint64, jni.JObjectPtr, jni.JObjectPtr)>> + _$invokePointer = ffi.Pointer.fromFunction(_$invoke); + + static ffi.Pointer _$invokeMethod( + int $p, + $MethodInvocation $i, + ) { + try { + final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); + final $a = $i.args; + if ($d == r"shutdown()V") { + _$impls[$p]!.shutdown(); + return jni.nullptr; + } + if ($d == r"shutdownNow()Ljava/util/List;") { + final $r = _$impls[$p]!.shutdownNow(); + return ($r as jni.JObject) + .castTo(const jni.JObjectType()) + .reference + .toPointer(); + } + if ($d == r"isShutdown()Z") { + final $r = _$impls[$p]!.isShutdown(); + return jni.JBoolean($r).reference.toPointer(); + } + if ($d == r"isTerminated()Z") { + final $r = _$impls[$p]!.isTerminated(); + return jni.JBoolean($r).reference.toPointer(); + } + if ($d == r"awaitTermination(JLjava/util/concurrent/TimeUnit;)Z") { + final $r = _$impls[$p]!.awaitTermination( + $a[0] + .castTo(const jni.JLongType(), releaseOriginal: true) + .longValue(releaseOriginal: true), + $a[1].castTo(const jni.JObjectType(), releaseOriginal: true), + ); + return jni.JBoolean($r).reference.toPointer(); + } + } catch (e) { + return ProtectedJniExtensions.newDartException(e); + } + return jni.nullptr; + } + + factory ExecutorService.implement( + $ExecutorServiceImpl $impl, + ) { + final $p = ReceivePort(); + final $x = ExecutorService.fromReference( + ProtectedJniExtensions.newPortProxy( + r"java.util.concurrent.ExecutorService", + $p, + _$invokePointer, + ), + ).._$p = $p; + final $a = $p.sendPort.nativePort; + _$impls[$a] = $impl; + $p.listen(($m) { + if ($m == null) { + _$impls.remove($p.sendPort.nativePort); + $p.close(); + return; + } + final $i = $MethodInvocation.fromMessage($m as List); + final $r = _$invokeMethod($p.sendPort.nativePort, $i); + ProtectedJniExtensions.returnResult($i.result, $r); + }); + return $x; + } +} + +abstract interface class $ExecutorServiceImpl { + factory $ExecutorServiceImpl({ + required void Function() shutdown, + required jni.JList Function() shutdownNow, + required bool Function() isShutdown, + required bool Function() isTerminated, + required bool Function(int j, jni.JObject timeUnit) awaitTermination, + }) = _$ExecutorServiceImpl; + + void shutdown(); + jni.JList shutdownNow(); + bool isShutdown(); + bool isTerminated(); + bool awaitTermination(int j, jni.JObject timeUnit); +} + +class _$ExecutorServiceImpl implements $ExecutorServiceImpl { + _$ExecutorServiceImpl({ + required void Function() shutdown, + required jni.JList Function() shutdownNow, + required bool Function() isShutdown, + required bool Function() isTerminated, + required bool Function(int j, jni.JObject timeUnit) awaitTermination, + }) : _shutdown = shutdown, + _shutdownNow = shutdownNow, + _isShutdown = isShutdown, + _isTerminated = isTerminated, + _awaitTermination = awaitTermination; + + final void Function() _shutdown; + final jni.JList Function() _shutdownNow; + final bool Function() _isShutdown; + final bool Function() _isTerminated; + final bool Function(int j, jni.JObject timeUnit) _awaitTermination; + + void shutdown() { + return _shutdown(); + } + + jni.JList shutdownNow() { + return _shutdownNow(); + } + + bool isShutdown() { + return _isShutdown(); + } + + bool isTerminated() { + return _isTerminated(); + } + + bool awaitTermination(int j, jni.JObject timeUnit) { + return _awaitTermination(j, timeUnit); + } +} + +final class $ExecutorServiceType extends jni.JObjType { + const $ExecutorServiceType(); + + @override + String get signature => r"Ljava/util/concurrent/ExecutorService;"; + + @override + ExecutorService fromReference(jni.JReference reference) => + ExecutorService.fromReference(reference); + + @override + jni.JObjType get superType => const jni.JObjectType(); + + @override + final superCount = 1; + + @override + int get hashCode => ($ExecutorServiceType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == ($ExecutorServiceType) && + other is $ExecutorServiceType; + } +} + /// from: okhttp3.Cache$Companion class Cache_Companion extends jni.JObject { @override diff --git a/pkgs/ok_http/lib/src/ok_http_client.dart b/pkgs/ok_http/lib/src/ok_http_client.dart index 9ef7f75402..d0822f0a8a 100644 --- a/pkgs/ok_http/lib/src/ok_http_client.dart +++ b/pkgs/ok_http/lib/src/ok_http_client.dart @@ -57,14 +57,7 @@ class OkHttpClient extends BaseClient { // Refer to OkHttp documentation for the shutdown procedure: // https://square.github.io/okhttp/5.x/okhttp/okhttp3/-ok-http-client/index.html#:~:text=Shutdown - // Bindings for `java.util.concurrent.ExecutorService` are erroneous. - // https://github.com/dart-lang/native/issues/588 - // So, use the JClass API to call the `shutdown` method by its signature. - _client - .dispatcher() - .executorService() - .jClass - .instanceMethodId('shutdown', '()V'); + _client.dispatcher().executorService().shutdown(); // Remove all idle connections from the resource pool. _client.connectionPool().evictAll(); From 1f8de0c4c8a462c74c0e93f1da32fb4bb0d8ac47 Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Mon, 8 Jul 2024 00:14:52 +0530 Subject: [PATCH 16/27] fix duplicate sections in the readme --- pkgs/ok_http/README.md | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/pkgs/ok_http/README.md b/pkgs/ok_http/README.md index 984a45a63c..7dacb21ecb 100644 --- a/pkgs/ok_http/README.md +++ b/pkgs/ok_http/README.md @@ -29,25 +29,6 @@ This size of the [example application][] APK file using different packages: See the [OkHttp Example App][] for usage notes. -## Why use `package:ok_http`? - -### 👍 Increased compatibility and reduced disk profile - -`package:ok_http` is smaller and works on more devices than other packages. - -This size of the [example application][] APK file using different packages: - -| Package | APK Size (MiB) | -|-|-| -| **`ok_http`** | **20.3** | -| [`cronet_http`](https://pub.dev/packages/cronet_http) [^1] | 20.6 | -| [`cronet_http` (embedded)](https://pub.dev/packages/cronet_http#use-embedded-cronet) [^2] | 34.4 | -| `dart:io` [^3] | 20.4 | - -[^1]: Requires [Google Play Services][], which are not available on all devices. -[^2]: Embeds the Cronet HTTP library. -[^3]: Accessed through [`IOClient`](https://pub.dev/documentation/http/latest/io_client/IOClient-class.html). - ## Status: experimental **NOTE**: This package is currently experimental and published under the @@ -67,5 +48,5 @@ feedback, suggestions, and comments, please file an issue in the [OkHttp]: https://square.github.io/okhttp/ [Google Play Services]: https://developers.google.com/android/guides/overview [WebSocket]: https://square.github.io/okhttp/5.x/okhttp/okhttp3/-web-socket/index.html -[OkHttp Example App]: https://github.com/dart-lang/http/tree/master/pkgs/ok_http/example/ +[OkHttp Example App]: https://github.com/dart-lang/http/tree/master/pkgs/ok_http/example/] From 6e6445818ac39cda6a40c83c14e7e5a5fd8af58c Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Mon, 8 Jul 2024 00:48:35 +0530 Subject: [PATCH 17/27] minor text fixes --- pkgs/ok_http/README.md | 3 +-- pkgs/ok_http/lib/src/ok_http_web_socket.dart | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/ok_http/README.md b/pkgs/ok_http/README.md index 7dacb21ecb..18668cc382 100644 --- a/pkgs/ok_http/README.md +++ b/pkgs/ok_http/README.md @@ -48,5 +48,4 @@ feedback, suggestions, and comments, please file an issue in the [OkHttp]: https://square.github.io/okhttp/ [Google Play Services]: https://developers.google.com/android/guides/overview [WebSocket]: https://square.github.io/okhttp/5.x/okhttp/okhttp3/-web-socket/index.html - -[OkHttp Example App]: https://github.com/dart-lang/http/tree/master/pkgs/ok_http/example/] +[OkHttp Example App]: https://github.com/dart-lang/http/tree/master/pkgs/ok_http/example/ diff --git a/pkgs/ok_http/lib/src/ok_http_web_socket.dart b/pkgs/ok_http/lib/src/ok_http_web_socket.dart index 4a0a0650d3..1f52fca8fa 100644 --- a/pkgs/ok_http/lib/src/ok_http_web_socket.dart +++ b/pkgs/ok_http/lib/src/ok_http_web_socket.dart @@ -111,7 +111,7 @@ class OkHttpWebSocket implements WebSocket { // Then the connection was closed abnormally. if (throwableString.contains(RegExp( r'(java\.net\.ProtocolException: Control frames must be final\.|java\.io\.EOFException|java\.net\.SocketException: Socket closed)'))) { - _events.add(CloseReceived(1006, 'closed abnormal')); + _events.add(CloseReceived(1006, 'Closed abnormal')); unawaited(_events.close()); return; } From 0bd1a73204b7918f55ca056aca8de4f378eac8e9 Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Sun, 14 Jul 2024 17:59:58 +0530 Subject: [PATCH 18/27] fix JArray extensions --- pkgs/ok_http/lib/src/ok_http_client.dart | 14 ++++---------- pkgs/ok_http/lib/src/ok_http_web_socket.dart | 11 ++++++++++- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/pkgs/ok_http/lib/src/ok_http_client.dart b/pkgs/ok_http/lib/src/ok_http_client.dart index d0822f0a8a..f6f973514e 100644 --- a/pkgs/ok_http/lib/src/ok_http_client.dart +++ b/pkgs/ok_http/lib/src/ok_http_client.dart @@ -280,18 +280,12 @@ class OkHttpClientWithProfile extends OkHttpClient { OkHttpClientWithProfile() : super(); } -extension JUint8List on Uint8List { +extension on Uint8List { JArray toJArray() => JArray(jbyte.type, length)..setRange(0, length, this); } -extension DartJArray on JArray { - Uint8List toUint8List({int? length}) { - length ??= this.length; - final list = Uint8List(length); - for (var i = 0; i < length; i++) { - list[i] = this[i]; - } - return list; - } +extension on JArray { + Uint8List toUint8List({int? length}) => + Uint8List.fromList(getRange(0, length ?? this.length)); } diff --git a/pkgs/ok_http/lib/src/ok_http_web_socket.dart b/pkgs/ok_http/lib/src/ok_http_web_socket.dart index 1f52fca8fa..e43000514f 100644 --- a/pkgs/ok_http/lib/src/ok_http_web_socket.dart +++ b/pkgs/ok_http/lib/src/ok_http_web_socket.dart @@ -10,7 +10,6 @@ import 'package:jni/jni.dart'; import 'package:web_socket/web_socket.dart'; import 'jni/bindings.dart' as bindings; -import 'ok_http_client.dart'; /// A [WebSocket] implemented using the OkHttp library's /// [WebSocket](https://square.github.io/okhttp/5.x/okhttp/okhttp3/-web-socket/index.html) @@ -188,3 +187,13 @@ class OkHttpWebSocket implements WebSocket { _client.release(); } } + +extension on Uint8List { + JArray toJArray() => + JArray(jbyte.type, length)..setRange(0, length, this); +} + +extension on JArray { + Uint8List toUint8List({int? length}) => + Uint8List.fromList(getRange(0, length ?? this.length)); +} From 4efbfadf2e9de7bbf7b7da2e3ccc3d6dad3eef2a Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Sun, 14 Jul 2024 18:14:02 +0530 Subject: [PATCH 19/27] remove websocket example --- pkgs/ok_http/example/lib/main.dart | 182 +++-------------------------- 1 file changed, 17 insertions(+), 165 deletions(-) diff --git a/pkgs/ok_http/example/lib/main.dart b/pkgs/ok_http/example/lib/main.dart index 871779eed0..e8177895ec 100644 --- a/pkgs/ok_http/example/lib/main.dart +++ b/pkgs/ok_http/example/lib/main.dart @@ -2,7 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'dart:async'; import 'dart:convert'; import 'dart:io'; @@ -12,7 +11,6 @@ import 'package:http/io_client.dart'; import 'package:http_image_provider/http_image_provider.dart'; import 'package:ok_http/ok_http.dart'; import 'package:provider/provider.dart'; -import 'package:web_socket/web_socket.dart'; import 'book.dart'; @@ -50,46 +48,6 @@ class HomePage extends StatefulWidget { } class _HomePageState extends State { - int _selectedIndex = 0; - final _labels = ['HTTP', 'WebSocket']; - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: - Text(_selectedIndex == 0 ? 'Book Search' : 'WebSocket Echo')), - bottomNavigationBar: BottomNavigationBar( - currentIndex: _selectedIndex, - onTap: (value) => setState(() { - _selectedIndex = value; - }), - items: [ - BottomNavigationBarItem( - icon: const Icon(Icons.cloud_outlined), - activeIcon: const Icon(Icons.cloud), - label: _labels[0], - ), - BottomNavigationBarItem( - icon: const Icon(Icons.swap_vert_circle_outlined), - activeIcon: const Icon(Icons.swap_vert_circle), - label: _labels[1], - ), - ], - ), - body: _selectedIndex == 0 ? const BookSearch() : const WebSocketEcho()); - } -} - -/// Example to demonstrate HTTP Calls with [OkHttpClient]. -class BookSearch extends StatefulWidget { - const BookSearch({super.key}); - - @override - State createState() => _BookSearchState(); -} - -class _BookSearchState extends State { List? _books; String? _lastQuery; late Client _client; @@ -141,21 +99,24 @@ class _BookSearchState extends State { ? BookList(_books!) : const Text('No results found', style: TextStyle(fontSize: 24)); - return Padding( - padding: const EdgeInsets.all(10), - child: Column( - children: [ - const SizedBox(height: 20), - TextField( - onChanged: _runSearch, - decoration: const InputDecoration( - labelText: 'Search', - suffixIcon: Icon(Icons.search), + return Scaffold( + appBar: AppBar(title: const Text('Book Search')), + body: Padding( + padding: const EdgeInsets.all(10), + child: Column( + children: [ + const SizedBox(height: 20), + TextField( + onChanged: _runSearch, + decoration: const InputDecoration( + labelText: 'Search', + suffixIcon: Icon(Icons.search), + ), ), - ), - const SizedBox(height: 20), - Expanded(child: searchResult), - ], + const SizedBox(height: 20), + Expanded(child: searchResult), + ], + ), ), ); } @@ -186,112 +147,3 @@ class _BookListState extends State { ), ); } - -/// Example to demonstrate WebSocket communication with [OkHttpWebSocket], -/// using the echo server at `wss://echo.websocket.org`. -class WebSocketEcho extends StatefulWidget { - const WebSocketEcho({super.key}); - - @override - State createState() => _WebSocketEchoState(); -} - -class _WebSocketEchoState extends State { - // Contains a list of pairs [String message, bool isSent]. - final List _messages = []; - final msgController = TextEditingController(); - - late WebSocket _webSocket; - - @override - void initState() { - super.initState(); - } - - @override - Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.all(10), - child: Column( - children: [ - Row( - children: [ - Expanded( - child: ElevatedButton( - onPressed: () async { - try { - _webSocket = await OkHttpWebSocket.connect( - Uri.parse('wss://echo.websocket.org')); - } on WebSocketException catch (e) { - print('Error connecting to WebSocket: ${e.message}'); - return; - } - - _webSocket.events.listen((event) { - setState(() { - switch (event) { - case TextDataReceived(text: final text): - _messages.add([text, false]); - break; - case CloseReceived(): - _messages.add(['Connection closed', false]); - // For this example, binary data is not expected. - default: - _messages.add( - ['Unknown message received $event', false]); - } - }); - }); - }, - child: const Text('Connect'))), - const SizedBox(width: 16), - Expanded( - child: ElevatedButton( - onPressed: () { - try { - _webSocket.close(); - } on WebSocketException catch (e) { - print('Error closing WebSocket: ${e.message}'); - } - }, - child: const Text('Disconnect'))), - ], - ), - Row( - children: [ - Expanded( - child: TextField( - controller: msgController, - decoration: const InputDecoration( - labelText: 'Message', - ), - ), - ), - ElevatedButton( - onPressed: () { - _webSocket.sendText(msgController.text); - setState(() { - _messages.add([msgController.text, true]); - }); - }, - child: const Text('Send')), - ], - ), - const SizedBox(height: 20), - Expanded( - child: ListView.builder( - itemBuilder: (context, index) { - return ListTile( - title: Text(_messages[index][0] as String), - trailing: Icon(_messages[index][1] as bool - ? Icons.upload - : Icons.download), - ); - }, - itemCount: _messages.length, - )), - ], - ), - ); - } -} From b2711bd25f5391fd549f70bbb7af2ded8ecb4677 Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Sun, 14 Jul 2024 18:36:12 +0530 Subject: [PATCH 20/27] fix ok_http_web_socket.dart nits --- pkgs/ok_http/lib/src/ok_http_web_socket.dart | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pkgs/ok_http/lib/src/ok_http_web_socket.dart b/pkgs/ok_http/lib/src/ok_http_web_socket.dart index e43000514f..6298932ede 100644 --- a/pkgs/ok_http/lib/src/ok_http_web_socket.dart +++ b/pkgs/ok_http/lib/src/ok_http_web_socket.dart @@ -20,8 +20,13 @@ class OkHttpWebSocket implements WebSocket { final _events = StreamController(); String? _protocol; + /// Private constructor to prevent direct instantiation. + /// + /// Used by [connect] to create a new WebSocket connection, which requires a + /// [bindings.OkHttpClient] instance (see [_connect]), and cannot be accessed + /// statically. OkHttpWebSocket._() { - // Add the WSInterceptor to prevent response parsing errors. + // Add the WebSocketInterceptor to prevent response parsing errors. _client = bindings.WSInterceptor.Companion .addWSInterceptor(bindings.OkHttpClient_Builder()) .build(); @@ -33,7 +38,7 @@ class OkHttpWebSocket implements WebSocket { /// /// The URL supplied in [url] must use the scheme ws or wss. /// - /// If provided, the [protocols] argument indicates that subprotocols that + /// If provided, the [protocols] argument indicates the subprotocols that /// the peer is able to select. See /// [RFC-6455 1.9](https://datatracker.ietf.org/doc/html/rfc6455#section-1.9). static Future connect(Uri url, @@ -67,7 +72,7 @@ class OkHttpWebSocket implements WebSocket { var protocolHeader = response.header1('sec-websocket-protocol'.toJString()); if (!protocolHeader.isNull) { - _protocol = protocolHeader.toDartString(); + _protocol = protocolHeader.toDartString(releaseOriginal: true); if (!(protocols?.contains(_protocol) ?? true)) { openCompleter .completeError(WebSocketException('Protocol mismatch. ' @@ -110,7 +115,7 @@ class OkHttpWebSocket implements WebSocket { // Then the connection was closed abnormally. if (throwableString.contains(RegExp( r'(java\.net\.ProtocolException: Control frames must be final\.|java\.io\.EOFException|java\.net\.SocketException: Socket closed)'))) { - _events.add(CloseReceived(1006, 'Closed abnormal')); + _events.add(CloseReceived(1006, 'abnormal close')); unawaited(_events.close()); return; } @@ -177,6 +182,8 @@ class OkHttpWebSocket implements WebSocket { } /// Closes the OkHttpClient using the recommended shutdown procedure. + /// + /// https://square.github.io/okhttp/5.x/okhttp/okhttp3/-ok-http-client/index.html#:~:text=Shutdown void _okHttpClientClose() { _client.dispatcher().executorService().shutdown(); _client.connectionPool().evictAll(); From d0d19618119003125bc95b1a0b1643885cc166e3 Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Sun, 14 Jul 2024 18:42:51 +0530 Subject: [PATCH 21/27] rename 'WSInterceptor' to 'WebSocketInterceptor' --- ...Interceptor.kt => WebSocketInterceptor.kt} | 2 +- pkgs/ok_http/jnigen.yaml | 2 +- pkgs/ok_http/lib/src/jni/bindings.dart | 76 ++++++++++--------- pkgs/ok_http/lib/src/ok_http_web_socket.dart | 2 +- 4 files changed, 42 insertions(+), 40 deletions(-) rename pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/{WSInterceptor.kt => WebSocketInterceptor.kt} (97%) diff --git a/pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WSInterceptor.kt b/pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WebSocketInterceptor.kt similarity index 97% rename from pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WSInterceptor.kt rename to pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WebSocketInterceptor.kt index d7d9f74ed7..52ae8a84c9 100644 --- a/pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WSInterceptor.kt +++ b/pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WebSocketInterceptor.kt @@ -11,7 +11,7 @@ import okhttp3.OkHttpClient * Usage of `chain.proceed(...)` via JNI Bindings leads to threading issues. This is a workaround * to intercept the response before it is parsed by the WebSocketReader, to prevent response parsing errors. */ -class WSInterceptor { +class WebSocketInterceptor { companion object { fun addWSInterceptor( clientBuilder: OkHttpClient.Builder diff --git a/pkgs/ok_http/jnigen.yaml b/pkgs/ok_http/jnigen.yaml index 40f40c67d1..ecbd85e99c 100644 --- a/pkgs/ok_http/jnigen.yaml +++ b/pkgs/ok_http/jnigen.yaml @@ -35,7 +35,7 @@ classes: - "okhttp3.WebSocket" - "com.example.ok_http.WebSocketListenerProxy" - "okio.ByteString" - - "com.example.ok_http.WSInterceptor" + - "com.example.ok_http.WebSocketInterceptor" # Exclude the deprecated methods listed below # They cause syntax errors during the `dart format` step of JNIGen. diff --git a/pkgs/ok_http/lib/src/jni/bindings.dart b/pkgs/ok_http/lib/src/jni/bindings.dart index ccd0e9ff24..970edfa89b 100644 --- a/pkgs/ok_http/lib/src/jni/bindings.dart +++ b/pkgs/ok_http/lib/src/jni/bindings.dart @@ -13220,20 +13220,20 @@ final class $ByteStringType extends jni.JObjType { } } -/// from: com.example.ok_http.WSInterceptor$Companion -class WSInterceptor_Companion extends jni.JObject { +/// from: com.example.ok_http.WebSocketInterceptor$Companion +class WebSocketInterceptor_Companion extends jni.JObject { @override - late final jni.JObjType $type = type; + late final jni.JObjType $type = type; - WSInterceptor_Companion.fromReference( + WebSocketInterceptor_Companion.fromReference( jni.JReference reference, ) : super.fromReference(reference); static final _class = - jni.JClass.forName(r"com/example/ok_http/WSInterceptor$Companion"); + jni.JClass.forName(r"com/example/ok_http/WebSocketInterceptor$Companion"); /// The type which includes information such as the signature of this class. - static const type = $WSInterceptor_CompanionType(); + static const type = $WebSocketInterceptor_CompanionType(); static final _id_addWSInterceptor = _class.instanceMethodId( r"addWSInterceptor", r"(Lokhttp3/OkHttpClient$Builder;)Lokhttp3/OkHttpClient$Builder;", @@ -13277,10 +13277,10 @@ class WSInterceptor_Companion extends jni.JObject { /// from: public void (kotlin.jvm.internal.DefaultConstructorMarker defaultConstructorMarker) /// The returned object must be released after use, by calling the [release] method. - factory WSInterceptor_Companion( + factory WebSocketInterceptor_Companion( jni.JObject defaultConstructorMarker, ) { - return WSInterceptor_Companion.fromReference(_new0( + return WebSocketInterceptor_Companion.fromReference(_new0( _class.reference.pointer, _id_new0 as jni.JMethodIDPtr, defaultConstructorMarker.reference.pointer) @@ -13288,16 +13288,17 @@ class WSInterceptor_Companion extends jni.JObject { } } -final class $WSInterceptor_CompanionType - extends jni.JObjType { - const $WSInterceptor_CompanionType(); +final class $WebSocketInterceptor_CompanionType + extends jni.JObjType { + const $WebSocketInterceptor_CompanionType(); @override - String get signature => r"Lcom/example/ok_http/WSInterceptor$Companion;"; + String get signature => + r"Lcom/example/ok_http/WebSocketInterceptor$Companion;"; @override - WSInterceptor_Companion fromReference(jni.JReference reference) => - WSInterceptor_Companion.fromReference(reference); + WebSocketInterceptor_Companion fromReference(jni.JReference reference) => + WebSocketInterceptor_Companion.fromReference(reference); @override jni.JObjType get superType => const jni.JObjectType(); @@ -13306,38 +13307,38 @@ final class $WSInterceptor_CompanionType final superCount = 1; @override - int get hashCode => ($WSInterceptor_CompanionType).hashCode; + int get hashCode => ($WebSocketInterceptor_CompanionType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($WSInterceptor_CompanionType) && - other is $WSInterceptor_CompanionType; + return other.runtimeType == ($WebSocketInterceptor_CompanionType) && + other is $WebSocketInterceptor_CompanionType; } } -/// from: com.example.ok_http.WSInterceptor -class WSInterceptor extends jni.JObject { +/// from: com.example.ok_http.WebSocketInterceptor +class WebSocketInterceptor extends jni.JObject { @override - late final jni.JObjType $type = type; + late final jni.JObjType $type = type; - WSInterceptor.fromReference( + WebSocketInterceptor.fromReference( jni.JReference reference, ) : super.fromReference(reference); static final _class = - jni.JClass.forName(r"com/example/ok_http/WSInterceptor"); + jni.JClass.forName(r"com/example/ok_http/WebSocketInterceptor"); /// The type which includes information such as the signature of this class. - static const type = $WSInterceptorType(); + static const type = $WebSocketInterceptorType(); static final _id_Companion = _class.staticFieldId( r"Companion", - r"Lcom/example/ok_http/WSInterceptor$Companion;", + r"Lcom/example/ok_http/WebSocketInterceptor$Companion;", ); - /// from: static public final com.example.ok_http.WSInterceptor$Companion Companion + /// from: static public final com.example.ok_http.WebSocketInterceptor$Companion Companion /// The returned object must be released after use, by calling the [release] method. - static WSInterceptor_Companion get Companion => - _id_Companion.get(_class, const $WSInterceptor_CompanionType()); + static WebSocketInterceptor_Companion get Companion => + _id_Companion.get(_class, const $WebSocketInterceptor_CompanionType()); static final _id_new0 = _class.constructorId( r"()V", @@ -13357,22 +13358,23 @@ class WSInterceptor extends jni.JObject { /// from: public void () /// The returned object must be released after use, by calling the [release] method. - factory WSInterceptor() { - return WSInterceptor.fromReference( + factory WebSocketInterceptor() { + return WebSocketInterceptor.fromReference( _new0(_class.reference.pointer, _id_new0 as jni.JMethodIDPtr) .reference); } } -final class $WSInterceptorType extends jni.JObjType { - const $WSInterceptorType(); +final class $WebSocketInterceptorType + extends jni.JObjType { + const $WebSocketInterceptorType(); @override - String get signature => r"Lcom/example/ok_http/WSInterceptor;"; + String get signature => r"Lcom/example/ok_http/WebSocketInterceptor;"; @override - WSInterceptor fromReference(jni.JReference reference) => - WSInterceptor.fromReference(reference); + WebSocketInterceptor fromReference(jni.JReference reference) => + WebSocketInterceptor.fromReference(reference); @override jni.JObjType get superType => const jni.JObjectType(); @@ -13381,11 +13383,11 @@ final class $WSInterceptorType extends jni.JObjType { final superCount = 1; @override - int get hashCode => ($WSInterceptorType).hashCode; + int get hashCode => ($WebSocketInterceptorType).hashCode; @override bool operator ==(Object other) { - return other.runtimeType == ($WSInterceptorType) && - other is $WSInterceptorType; + return other.runtimeType == ($WebSocketInterceptorType) && + other is $WebSocketInterceptorType; } } diff --git a/pkgs/ok_http/lib/src/ok_http_web_socket.dart b/pkgs/ok_http/lib/src/ok_http_web_socket.dart index 6298932ede..f44038048d 100644 --- a/pkgs/ok_http/lib/src/ok_http_web_socket.dart +++ b/pkgs/ok_http/lib/src/ok_http_web_socket.dart @@ -27,7 +27,7 @@ class OkHttpWebSocket implements WebSocket { /// statically. OkHttpWebSocket._() { // Add the WebSocketInterceptor to prevent response parsing errors. - _client = bindings.WSInterceptor.Companion + _client = bindings.WebSocketInterceptor.Companion .addWSInterceptor(bindings.OkHttpClient_Builder()) .build(); } From 7bc6d26aa1d11167b794e14eaf1bdaed8baeb3b5 Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Sun, 14 Jul 2024 19:00:55 +0530 Subject: [PATCH 22/27] refer to deadlock issue in package: jni --- .../src/main/kotlin/com/example/ok_http/WebSocketInterceptor.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WebSocketInterceptor.kt b/pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WebSocketInterceptor.kt index 52ae8a84c9..da64591576 100644 --- a/pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WebSocketInterceptor.kt +++ b/pkgs/ok_http/android/src/main/kotlin/com/example/ok_http/WebSocketInterceptor.kt @@ -10,6 +10,8 @@ import okhttp3.OkHttpClient /** * Usage of `chain.proceed(...)` via JNI Bindings leads to threading issues. This is a workaround * to intercept the response before it is parsed by the WebSocketReader, to prevent response parsing errors. + * + * https://github.com/dart-lang/native/issues/1337 */ class WebSocketInterceptor { companion object { From 8871562defd84436c5747cb9259e26aca1622a65 Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Sun, 14 Jul 2024 20:13:38 +0530 Subject: [PATCH 23/27] added usage notes to readme and docs --- pkgs/ok_http/README.md | 38 +++++++++++++++----- pkgs/ok_http/lib/src/ok_http_web_socket.dart | 23 ++++++++++++ 2 files changed, 52 insertions(+), 9 deletions(-) diff --git a/pkgs/ok_http/README.md b/pkgs/ok_http/README.md index 18668cc382..c9b08d18c1 100644 --- a/pkgs/ok_http/README.md +++ b/pkgs/ok_http/README.md @@ -12,12 +12,12 @@ An Android Flutter plugin that provides access to the This size of the [example application][] APK file using different packages: -| Package | APK Size (MiB) | -| ----------------------------------------------------------------------------------------- | -------------- | -| **`ok_http`** | **20.3** | -| [`cronet_http`](https://pub.dev/packages/cronet_http) [^1] | 20.6 | -| [`cronet_http` (embedded)](https://pub.dev/packages/cronet_http#use-embedded-cronet) [^2] | 34.4 | -| `dart:io` [^3] | 20.4 | +| Package | APK Size (MiB) | +|-|-| +| **`ok_http`** | **20.3** | +| [`cronet_http`](https://pub.dev/packages/cronet_http) [^1] | 20.6 | +| [`cronet_http` (embedded)](https://pub.dev/packages/cronet_http#use-embedded-cronet) [^2] | 34.4 | +| `dart:io` [^3] | 20.4 | [^1]: Requires [Google Play Services][], which are not available on all devices. [^2]: Embeds the Cronet HTTP library. @@ -25,9 +25,30 @@ This size of the [example application][] APK file using different packages: ### 🔌 Supports WebSockets out of the box -`package:ok_http` wraps the OkHttp [WebSocket][] API, allowing you to use it in your Flutter app with ease. +`package:ok_http` wraps the OkHttp [WebSocket][] API which supports: -See the [OkHttp Example App][] for usage notes. +- Configured System Proxy on Android +- HTTP/2 + +```dart +import 'package:ok_http/ok_http.dart'; +import 'package:web_socket/web_socket.dart'; +void main() async { + final socket = await OkHttpWebSocket.connect( + Uri.parse('wss://ws.postman-echo.com/raw')); + socket.events.listen((e) async { + switch (e) { + case TextDataReceived(text: final text): + print('Received Text: $text'); + await socket.close(); + case BinaryDataReceived(data: final data): + print('Received Binary: $data'); + case CloseReceived(code: final code, reason: final reason): + print('Connection to server closed: $code [$reason]'); + } + }); +} +``` ## Status: experimental @@ -48,4 +69,3 @@ feedback, suggestions, and comments, please file an issue in the [OkHttp]: https://square.github.io/okhttp/ [Google Play Services]: https://developers.google.com/android/guides/overview [WebSocket]: https://square.github.io/okhttp/5.x/okhttp/okhttp3/-web-socket/index.html -[OkHttp Example App]: https://github.com/dart-lang/http/tree/master/pkgs/ok_http/example/ diff --git a/pkgs/ok_http/lib/src/ok_http_web_socket.dart b/pkgs/ok_http/lib/src/ok_http_web_socket.dart index f44038048d..b33e64f24e 100644 --- a/pkgs/ok_http/lib/src/ok_http_web_socket.dart +++ b/pkgs/ok_http/lib/src/ok_http_web_socket.dart @@ -14,6 +14,29 @@ import 'jni/bindings.dart' as bindings; /// A [WebSocket] implemented using the OkHttp library's /// [WebSocket](https://square.github.io/okhttp/5.x/okhttp/okhttp3/-web-socket/index.html) /// API. +/// +/// +/// ```dart +/// import 'package:ok_http/ok_http.dart'; +/// import 'package:web_socket/web_socket.dart'; +/// +/// void main() async { +/// final socket = await OkHttpWebSocket.connect( +/// Uri.parse('wss://ws.postman-echo.com/raw')); +/// +/// socket.events.listen((e) async { +/// switch (e) { +/// case TextDataReceived(text: final text): +/// print('Received Text: $text'); +/// await socket.close(); +/// case BinaryDataReceived(data: final data): +/// print('Received Binary: $data'); +/// case CloseReceived(code: final code, reason: final reason): +/// print('Connection to server closed: $code [$reason]'); +/// } +/// }); +/// } +/// ``` class OkHttpWebSocket implements WebSocket { late bindings.OkHttpClient _client; late final bindings.WebSocket _webSocket; From 57fe25f0dc204953b75fd23f713b98f559599a2b Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Mon, 15 Jul 2024 22:37:12 +0530 Subject: [PATCH 24/27] documentation improvements --- pkgs/ok_http/README.md | 2 ++ pkgs/ok_http/lib/src/ok_http_web_socket.dart | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/ok_http/README.md b/pkgs/ok_http/README.md index c9b08d18c1..513234815e 100644 --- a/pkgs/ok_http/README.md +++ b/pkgs/ok_http/README.md @@ -30,6 +30,8 @@ This size of the [example application][] APK file using different packages: - Configured System Proxy on Android - HTTP/2 +**Example Usage of `OkHttpWebSocket`:** + ```dart import 'package:ok_http/ok_http.dart'; import 'package:web_socket/web_socket.dart'; diff --git a/pkgs/ok_http/lib/src/ok_http_web_socket.dart b/pkgs/ok_http/lib/src/ok_http_web_socket.dart index b33e64f24e..f0d609e24a 100644 --- a/pkgs/ok_http/lib/src/ok_http_web_socket.dart +++ b/pkgs/ok_http/lib/src/ok_http_web_socket.dart @@ -15,7 +15,7 @@ import 'jni/bindings.dart' as bindings; /// [WebSocket](https://square.github.io/okhttp/5.x/okhttp/okhttp3/-web-socket/index.html) /// API. /// -/// +/// Example usage of [OkHttpWebSocket]: /// ```dart /// import 'package:ok_http/ok_http.dart'; /// import 'package:web_socket/web_socket.dart'; From 05400b540e01c8aeeb5aa3a460b5922f2292ef06 Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Mon, 15 Jul 2024 23:29:16 +0530 Subject: [PATCH 25/27] bump up version from `0.1.0-wip` to `0.1.0` --- pkgs/ok_http/CHANGELOG.md | 2 +- pkgs/ok_http/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/ok_http/CHANGELOG.md b/pkgs/ok_http/CHANGELOG.md index 602cb6c46b..557f19db20 100644 --- a/pkgs/ok_http/CHANGELOG.md +++ b/pkgs/ok_http/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.1.0-wip +## 0.1.0 - Implementation of [`BaseClient`](https://pub.dev/documentation/http/latest/http/BaseClient-class.html) and `send()` method using [`enqueue()` API](https://square.github.io/okhttp/5.x/okhttp/okhttp3/-call/enqueue.html) - `ok_http` can now send asynchronous requests and stream response bodies. diff --git a/pkgs/ok_http/pubspec.yaml b/pkgs/ok_http/pubspec.yaml index 9781f71478..05c173bbb3 100644 --- a/pkgs/ok_http/pubspec.yaml +++ b/pkgs/ok_http/pubspec.yaml @@ -1,5 +1,5 @@ name: ok_http -version: 0.1.0-wip +version: 0.1.0 description: >- An Android Flutter plugin that provides access to the OkHttp HTTP client. repository: https://github.com/dart-lang/http/tree/master/pkgs/ok_http From 1d0ef4c7d7f1cffd811035bc0348699ffa1d98e1 Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Mon, 15 Jul 2024 23:54:53 +0530 Subject: [PATCH 26/27] increase step `test` timeout to 1200s to prevent workflow failures --- .github/workflows/okhttp.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/okhttp.yaml b/.github/workflows/okhttp.yaml index e20a039ce9..367bcf2732 100644 --- a/.github/workflows/okhttp.yaml +++ b/.github/workflows/okhttp.yaml @@ -55,4 +55,4 @@ jobs: # - pkgs/ok_http/example/android/app/build.gradle api-level: 21 arch: x86_64 - script: cd pkgs/ok_http/example && flutter test --timeout=120s integration_test/ + script: cd pkgs/ok_http/example && flutter test --timeout=1200s integration_test/ From 260c2a2a9cf6072984e022482bcd6691ca4eff56 Mon Sep 17 00:00:00 2001 From: Anikate-De Date: Tue, 16 Jul 2024 14:46:00 +0530 Subject: [PATCH 27/27] upgrade jni versions and regenerate bindings --- pkgs/ok_http/jnigen.yaml | 3 - pkgs/ok_http/lib/src/jni/bindings.dart | 2622 +++++++++--------- pkgs/ok_http/lib/src/ok_http_client.dart | 2 +- pkgs/ok_http/lib/src/ok_http_web_socket.dart | 2 +- pkgs/ok_http/pubspec.yaml | 4 +- 5 files changed, 1316 insertions(+), 1317 deletions(-) diff --git a/pkgs/ok_http/jnigen.yaml b/pkgs/ok_http/jnigen.yaml index ecbd85e99c..7f63d6c2d9 100644 --- a/pkgs/ok_http/jnigen.yaml +++ b/pkgs/ok_http/jnigen.yaml @@ -106,7 +106,4 @@ exclude: - "okio.ByteString#-deprecated_size" preamble: | - // ignore_for_file: prefer_single_quotes - // ignore_for_file: directives_ordering // ignore_for_file: prefer_expression_function_bodies - // ignore_for_file: unnecessary_parenthesis diff --git a/pkgs/ok_http/lib/src/jni/bindings.dart b/pkgs/ok_http/lib/src/jni/bindings.dart index 970edfa89b..66f0078d9a 100644 --- a/pkgs/ok_http/lib/src/jni/bindings.dart +++ b/pkgs/ok_http/lib/src/jni/bindings.dart @@ -1,11 +1,9 @@ -// ignore_for_file: prefer_single_quotes -// ignore_for_file: directives_ordering // ignore_for_file: prefer_expression_function_bodies -// ignore_for_file: unnecessary_parenthesis // Autogenerated by jnigen. DO NOT EDIT! // ignore_for_file: annotate_overrides +// ignore_for_file: argument_type_not_assignable // ignore_for_file: camel_case_extensions // ignore_for_file: camel_case_types // ignore_for_file: constant_identifier_names @@ -14,8 +12,11 @@ // ignore_for_file: lines_longer_than_80_chars // ignore_for_file: no_leading_underscores_for_local_identifiers // ignore_for_file: non_constant_identifier_names +// ignore_for_file: only_throw_errors // ignore_for_file: overridden_fields +// ignore_for_file: prefer_double_quotes // ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element // ignore_for_file: unused_field // ignore_for_file: unused_import @@ -23,10 +24,11 @@ // ignore_for_file: unused_shown_name // ignore_for_file: use_super_parameters -import "dart:isolate" show ReceivePort; -import "dart:ffi" as ffi; -import "package:jni/internal_helpers_for_jnigen.dart"; -import "package:jni/jni.dart" as jni; +import 'dart:ffi' as ffi; +import 'dart:isolate' show ReceivePort; + +import 'package:jni/internal_helpers_for_jnigen.dart'; +import 'package:jni/jni.dart' as jni; /// from: okhttp3.Request$Builder class Request_Builder extends jni.JObject { @@ -37,12 +39,12 @@ class Request_Builder extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/Request$Builder"); + static final _class = jni.JClass.forName(r'okhttp3/Request$Builder'); /// The type which includes information such as the signature of this class. static const type = $Request_BuilderType(); static final _id_new0 = _class.constructorId( - r"()V", + r'()V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -50,7 +52,7 @@ class Request_Builder extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_NewObject") + )>>('globalEnv_NewObject') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -66,7 +68,7 @@ class Request_Builder extends jni.JObject { } static final _id_new1 = _class.constructorId( - r"(Lokhttp3/Request;)V", + r'(Lokhttp3/Request;)V', ); static final _new1 = ProtectedJniExtensions.lookup< @@ -75,7 +77,7 @@ class Request_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_NewObject") + 'globalEnv_NewObject') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -91,8 +93,8 @@ class Request_Builder extends jni.JObject { } static final _id_url = _class.instanceMethodId( - r"url", - r"(Lokhttp3/HttpUrl;)Lokhttp3/Request$Builder;", + r'url', + r'(Lokhttp3/HttpUrl;)Lokhttp3/Request$Builder;', ); static final _url = ProtectedJniExtensions.lookup< @@ -101,7 +103,7 @@ class Request_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -117,8 +119,8 @@ class Request_Builder extends jni.JObject { } static final _id_url1 = _class.instanceMethodId( - r"url", - r"(Ljava/lang/String;)Lokhttp3/Request$Builder;", + r'url', + r'(Ljava/lang/String;)Lokhttp3/Request$Builder;', ); static final _url1 = ProtectedJniExtensions.lookup< @@ -127,7 +129,7 @@ class Request_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -143,8 +145,8 @@ class Request_Builder extends jni.JObject { } static final _id_url2 = _class.instanceMethodId( - r"url", - r"(Ljava/net/URL;)Lokhttp3/Request$Builder;", + r'url', + r'(Ljava/net/URL;)Lokhttp3/Request$Builder;', ); static final _url2 = ProtectedJniExtensions.lookup< @@ -153,7 +155,7 @@ class Request_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -169,8 +171,8 @@ class Request_Builder extends jni.JObject { } static final _id_header = _class.instanceMethodId( - r"header", - r"(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder;", + r'header', + r'(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder;', ); static final _header = ProtectedJniExtensions.lookup< @@ -182,7 +184,7 @@ class Request_Builder extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -199,8 +201,8 @@ class Request_Builder extends jni.JObject { } static final _id_addHeader = _class.instanceMethodId( - r"addHeader", - r"(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder;", + r'addHeader', + r'(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder;', ); static final _addHeader = ProtectedJniExtensions.lookup< @@ -212,7 +214,7 @@ class Request_Builder extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -229,8 +231,8 @@ class Request_Builder extends jni.JObject { } static final _id_removeHeader = _class.instanceMethodId( - r"removeHeader", - r"(Ljava/lang/String;)Lokhttp3/Request$Builder;", + r'removeHeader', + r'(Ljava/lang/String;)Lokhttp3/Request$Builder;', ); static final _removeHeader = ProtectedJniExtensions.lookup< @@ -239,7 +241,7 @@ class Request_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -255,8 +257,8 @@ class Request_Builder extends jni.JObject { } static final _id_headers = _class.instanceMethodId( - r"headers", - r"(Lokhttp3/Headers;)Lokhttp3/Request$Builder;", + r'headers', + r'(Lokhttp3/Headers;)Lokhttp3/Request$Builder;', ); static final _headers = ProtectedJniExtensions.lookup< @@ -265,7 +267,7 @@ class Request_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -281,8 +283,8 @@ class Request_Builder extends jni.JObject { } static final _id_cacheControl = _class.instanceMethodId( - r"cacheControl", - r"(Lokhttp3/CacheControl;)Lokhttp3/Request$Builder;", + r'cacheControl', + r'(Lokhttp3/CacheControl;)Lokhttp3/Request$Builder;', ); static final _cacheControl = ProtectedJniExtensions.lookup< @@ -291,7 +293,7 @@ class Request_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -309,8 +311,8 @@ class Request_Builder extends jni.JObject { } static final _id_get0 = _class.instanceMethodId( - r"get", - r"()Lokhttp3/Request$Builder;", + r'get', + r'()Lokhttp3/Request$Builder;', ); static final _get0 = ProtectedJniExtensions.lookup< @@ -318,7 +320,7 @@ class Request_Builder extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -333,8 +335,8 @@ class Request_Builder extends jni.JObject { } static final _id_head = _class.instanceMethodId( - r"head", - r"()Lokhttp3/Request$Builder;", + r'head', + r'()Lokhttp3/Request$Builder;', ); static final _head = ProtectedJniExtensions.lookup< @@ -342,7 +344,7 @@ class Request_Builder extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -357,8 +359,8 @@ class Request_Builder extends jni.JObject { } static final _id_post = _class.instanceMethodId( - r"post", - r"(Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;", + r'post', + r'(Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;', ); static final _post = ProtectedJniExtensions.lookup< @@ -367,7 +369,7 @@ class Request_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -383,8 +385,8 @@ class Request_Builder extends jni.JObject { } static final _id_delete = _class.instanceMethodId( - r"delete", - r"(Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;", + r'delete', + r'(Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;', ); static final _delete = ProtectedJniExtensions.lookup< @@ -393,7 +395,7 @@ class Request_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -409,8 +411,8 @@ class Request_Builder extends jni.JObject { } static final _id_put = _class.instanceMethodId( - r"put", - r"(Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;", + r'put', + r'(Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;', ); static final _put = ProtectedJniExtensions.lookup< @@ -419,7 +421,7 @@ class Request_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -435,8 +437,8 @@ class Request_Builder extends jni.JObject { } static final _id_patch = _class.instanceMethodId( - r"patch", - r"(Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;", + r'patch', + r'(Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;', ); static final _patch = ProtectedJniExtensions.lookup< @@ -445,7 +447,7 @@ class Request_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -461,8 +463,8 @@ class Request_Builder extends jni.JObject { } static final _id_method = _class.instanceMethodId( - r"method", - r"(Ljava/lang/String;Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;", + r'method', + r'(Ljava/lang/String;Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;', ); static final _method = ProtectedJniExtensions.lookup< @@ -474,7 +476,7 @@ class Request_Builder extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -491,8 +493,8 @@ class Request_Builder extends jni.JObject { } static final _id_tag = _class.instanceMethodId( - r"tag", - r"(Ljava/lang/Object;)Lokhttp3/Request$Builder;", + r'tag', + r'(Ljava/lang/Object;)Lokhttp3/Request$Builder;', ); static final _tag = ProtectedJniExtensions.lookup< @@ -501,7 +503,7 @@ class Request_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -517,8 +519,8 @@ class Request_Builder extends jni.JObject { } static final _id_tag1 = _class.instanceMethodId( - r"tag", - r"(Ljava/lang/Class;Ljava/lang/Object;)Lokhttp3/Request$Builder;", + r'tag', + r'(Ljava/lang/Class;Ljava/lang/Object;)Lokhttp3/Request$Builder;', ); static final _tag1 = ProtectedJniExtensions.lookup< @@ -530,7 +532,7 @@ class Request_Builder extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -551,8 +553,8 @@ class Request_Builder extends jni.JObject { } static final _id_build = _class.instanceMethodId( - r"build", - r"()Lokhttp3/Request;", + r'build', + r'()Lokhttp3/Request;', ); static final _build = ProtectedJniExtensions.lookup< @@ -560,7 +562,7 @@ class Request_Builder extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -575,8 +577,8 @@ class Request_Builder extends jni.JObject { } static final _id_delete1 = _class.instanceMethodId( - r"delete", - r"()Lokhttp3/Request$Builder;", + r'delete', + r'()Lokhttp3/Request$Builder;', ); static final _delete1 = ProtectedJniExtensions.lookup< @@ -584,7 +586,7 @@ class Request_Builder extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -603,7 +605,7 @@ final class $Request_BuilderType extends jni.JObjType { const $Request_BuilderType(); @override - String get signature => r"Lokhttp3/Request$Builder;"; + String get signature => r'Lokhttp3/Request$Builder;'; @override Request_Builder fromReference(jni.JReference reference) => @@ -634,12 +636,12 @@ class Request extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/Request"); + static final _class = jni.JClass.forName(r'okhttp3/Request'); /// The type which includes information such as the signature of this class. static const type = $RequestType(); static final _id_new0 = _class.constructorId( - r"(Lokhttp3/HttpUrl;Ljava/lang/String;Lokhttp3/Headers;Lokhttp3/RequestBody;Ljava/util/Map;)V", + r'(Lokhttp3/HttpUrl;Ljava/lang/String;Lokhttp3/Headers;Lokhttp3/RequestBody;Ljava/util/Map;)V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -654,7 +656,7 @@ class Request extends jni.JObject { ffi.Pointer, ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_NewObject") + )>)>>('globalEnv_NewObject') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -686,8 +688,8 @@ class Request extends jni.JObject { } static final _id_url = _class.instanceMethodId( - r"url", - r"()Lokhttp3/HttpUrl;", + r'url', + r'()Lokhttp3/HttpUrl;', ); static final _url = ProtectedJniExtensions.lookup< @@ -695,7 +697,7 @@ class Request extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -710,8 +712,8 @@ class Request extends jni.JObject { } static final _id_method = _class.instanceMethodId( - r"method", - r"()Ljava/lang/String;", + r'method', + r'()Ljava/lang/String;', ); static final _method = ProtectedJniExtensions.lookup< @@ -719,7 +721,7 @@ class Request extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -734,8 +736,8 @@ class Request extends jni.JObject { } static final _id_headers = _class.instanceMethodId( - r"headers", - r"()Lokhttp3/Headers;", + r'headers', + r'()Lokhttp3/Headers;', ); static final _headers = ProtectedJniExtensions.lookup< @@ -743,7 +745,7 @@ class Request extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -758,8 +760,8 @@ class Request extends jni.JObject { } static final _id_body = _class.instanceMethodId( - r"body", - r"()Lokhttp3/RequestBody;", + r'body', + r'()Lokhttp3/RequestBody;', ); static final _body = ProtectedJniExtensions.lookup< @@ -767,7 +769,7 @@ class Request extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -782,8 +784,8 @@ class Request extends jni.JObject { } static final _id_isHttps = _class.instanceMethodId( - r"isHttps", - r"()Z", + r'isHttps', + r'()Z', ); static final _isHttps = ProtectedJniExtensions.lookup< @@ -791,7 +793,7 @@ class Request extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallBooleanMethod") + )>>('globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -804,8 +806,8 @@ class Request extends jni.JObject { } static final _id_header = _class.instanceMethodId( - r"header", - r"(Ljava/lang/String;)Ljava/lang/String;", + r'header', + r'(Ljava/lang/String;)Ljava/lang/String;', ); static final _header = ProtectedJniExtensions.lookup< @@ -814,7 +816,7 @@ class Request extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -830,8 +832,8 @@ class Request extends jni.JObject { } static final _id_headers1 = _class.instanceMethodId( - r"headers", - r"(Ljava/lang/String;)Ljava/util/List;", + r'headers', + r'(Ljava/lang/String;)Ljava/util/List;', ); static final _headers1 = ProtectedJniExtensions.lookup< @@ -840,7 +842,7 @@ class Request extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -856,8 +858,8 @@ class Request extends jni.JObject { } static final _id_tag = _class.instanceMethodId( - r"tag", - r"()Ljava/lang/Object;", + r'tag', + r'()Ljava/lang/Object;', ); static final _tag = ProtectedJniExtensions.lookup< @@ -865,7 +867,7 @@ class Request extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -880,8 +882,8 @@ class Request extends jni.JObject { } static final _id_tag1 = _class.instanceMethodId( - r"tag", - r"(Ljava/lang/Class;)Ljava/lang/Object;", + r'tag', + r'(Ljava/lang/Class;)Ljava/lang/Object;', ); static final _tag1 = ProtectedJniExtensions.lookup< @@ -890,7 +892,7 @@ class Request extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -907,8 +909,8 @@ class Request extends jni.JObject { } static final _id_newBuilder = _class.instanceMethodId( - r"newBuilder", - r"()Lokhttp3/Request$Builder;", + r'newBuilder', + r'()Lokhttp3/Request$Builder;', ); static final _newBuilder = ProtectedJniExtensions.lookup< @@ -916,7 +918,7 @@ class Request extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -931,8 +933,8 @@ class Request extends jni.JObject { } static final _id_cacheControl = _class.instanceMethodId( - r"cacheControl", - r"()Lokhttp3/CacheControl;", + r'cacheControl', + r'()Lokhttp3/CacheControl;', ); static final _cacheControl = ProtectedJniExtensions.lookup< @@ -940,7 +942,7 @@ class Request extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -956,8 +958,8 @@ class Request extends jni.JObject { } static final _id_toString1 = _class.instanceMethodId( - r"toString", - r"()Ljava/lang/String;", + r'toString', + r'()Ljava/lang/String;', ); static final _toString1 = ProtectedJniExtensions.lookup< @@ -965,7 +967,7 @@ class Request extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -984,7 +986,7 @@ final class $RequestType extends jni.JObjType { const $RequestType(); @override - String get signature => r"Lokhttp3/Request;"; + String get signature => r'Lokhttp3/Request;'; @override Request fromReference(jni.JReference reference) => @@ -1014,13 +1016,13 @@ class RequestBody_Companion extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/RequestBody$Companion"); + static final _class = jni.JClass.forName(r'okhttp3/RequestBody$Companion'); /// The type which includes information such as the signature of this class. static const type = $RequestBody_CompanionType(); static final _id_create = _class.instanceMethodId( - r"create", - r"(Ljava/lang/String;Lokhttp3/MediaType;)Lokhttp3/RequestBody;", + r'create', + r'(Ljava/lang/String;Lokhttp3/MediaType;)Lokhttp3/RequestBody;', ); static final _create = ProtectedJniExtensions.lookup< @@ -1032,7 +1034,7 @@ class RequestBody_Companion extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -1049,8 +1051,8 @@ class RequestBody_Companion extends jni.JObject { } static final _id_create1 = _class.instanceMethodId( - r"create", - r"(Lokio/ByteString;Lokhttp3/MediaType;)Lokhttp3/RequestBody;", + r'create', + r'(Lokio/ByteString;Lokhttp3/MediaType;)Lokhttp3/RequestBody;', ); static final _create1 = ProtectedJniExtensions.lookup< @@ -1062,7 +1064,7 @@ class RequestBody_Companion extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -1079,8 +1081,8 @@ class RequestBody_Companion extends jni.JObject { } static final _id_create2 = _class.instanceMethodId( - r"create", - r"([BLokhttp3/MediaType;II)Lokhttp3/RequestBody;", + r'create', + r'([BLokhttp3/MediaType;II)Lokhttp3/RequestBody;', ); static final _create2 = ProtectedJniExtensions.lookup< @@ -1094,7 +1096,7 @@ class RequestBody_Companion extends jni.JObject { ffi.Pointer, $Int32, $Int32 - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer, int, int)>(); @@ -1113,8 +1115,8 @@ class RequestBody_Companion extends jni.JObject { } static final _id_create3 = _class.instanceMethodId( - r"create", - r"(Ljava/io/File;Lokhttp3/MediaType;)Lokhttp3/RequestBody;", + r'create', + r'(Ljava/io/File;Lokhttp3/MediaType;)Lokhttp3/RequestBody;', ); static final _create3 = ProtectedJniExtensions.lookup< @@ -1126,7 +1128,7 @@ class RequestBody_Companion extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -1143,8 +1145,8 @@ class RequestBody_Companion extends jni.JObject { } static final _id_create4 = _class.instanceMethodId( - r"create", - r"(Lokhttp3/MediaType;Ljava/lang/String;)Lokhttp3/RequestBody;", + r'create', + r'(Lokhttp3/MediaType;Ljava/lang/String;)Lokhttp3/RequestBody;', ); static final _create4 = ProtectedJniExtensions.lookup< @@ -1156,7 +1158,7 @@ class RequestBody_Companion extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -1173,8 +1175,8 @@ class RequestBody_Companion extends jni.JObject { } static final _id_create5 = _class.instanceMethodId( - r"create", - r"(Lokhttp3/MediaType;Lokio/ByteString;)Lokhttp3/RequestBody;", + r'create', + r'(Lokhttp3/MediaType;Lokio/ByteString;)Lokhttp3/RequestBody;', ); static final _create5 = ProtectedJniExtensions.lookup< @@ -1186,7 +1188,7 @@ class RequestBody_Companion extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -1203,8 +1205,8 @@ class RequestBody_Companion extends jni.JObject { } static final _id_create6 = _class.instanceMethodId( - r"create", - r"(Lokhttp3/MediaType;[BII)Lokhttp3/RequestBody;", + r'create', + r'(Lokhttp3/MediaType;[BII)Lokhttp3/RequestBody;', ); static final _create6 = ProtectedJniExtensions.lookup< @@ -1218,7 +1220,7 @@ class RequestBody_Companion extends jni.JObject { ffi.Pointer, $Int32, $Int32 - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer, int, int)>(); @@ -1237,8 +1239,8 @@ class RequestBody_Companion extends jni.JObject { } static final _id_create7 = _class.instanceMethodId( - r"create", - r"(Lokhttp3/MediaType;Ljava/io/File;)Lokhttp3/RequestBody;", + r'create', + r'(Lokhttp3/MediaType;Ljava/io/File;)Lokhttp3/RequestBody;', ); static final _create7 = ProtectedJniExtensions.lookup< @@ -1250,7 +1252,7 @@ class RequestBody_Companion extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -1267,8 +1269,8 @@ class RequestBody_Companion extends jni.JObject { } static final _id_create8 = _class.instanceMethodId( - r"create", - r"([BLokhttp3/MediaType;I)Lokhttp3/RequestBody;", + r'create', + r'([BLokhttp3/MediaType;I)Lokhttp3/RequestBody;', ); static final _create8 = ProtectedJniExtensions.lookup< @@ -1281,7 +1283,7 @@ class RequestBody_Companion extends jni.JObject { ffi.Pointer, ffi.Pointer, $Int32 - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer, int)>(); @@ -1299,8 +1301,8 @@ class RequestBody_Companion extends jni.JObject { } static final _id_create9 = _class.instanceMethodId( - r"create", - r"([BLokhttp3/MediaType;)Lokhttp3/RequestBody;", + r'create', + r'([BLokhttp3/MediaType;)Lokhttp3/RequestBody;', ); static final _create9 = ProtectedJniExtensions.lookup< @@ -1312,7 +1314,7 @@ class RequestBody_Companion extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -1329,8 +1331,8 @@ class RequestBody_Companion extends jni.JObject { } static final _id_create10 = _class.instanceMethodId( - r"create", - r"([B)Lokhttp3/RequestBody;", + r'create', + r'([B)Lokhttp3/RequestBody;', ); static final _create10 = ProtectedJniExtensions.lookup< @@ -1339,7 +1341,7 @@ class RequestBody_Companion extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -1355,8 +1357,8 @@ class RequestBody_Companion extends jni.JObject { } static final _id_create11 = _class.instanceMethodId( - r"create", - r"(Lokhttp3/MediaType;[BI)Lokhttp3/RequestBody;", + r'create', + r'(Lokhttp3/MediaType;[BI)Lokhttp3/RequestBody;', ); static final _create11 = ProtectedJniExtensions.lookup< @@ -1369,7 +1371,7 @@ class RequestBody_Companion extends jni.JObject { ffi.Pointer, ffi.Pointer, $Int32 - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer, int)>(); @@ -1387,8 +1389,8 @@ class RequestBody_Companion extends jni.JObject { } static final _id_create12 = _class.instanceMethodId( - r"create", - r"(Lokhttp3/MediaType;[B)Lokhttp3/RequestBody;", + r'create', + r'(Lokhttp3/MediaType;[B)Lokhttp3/RequestBody;', ); static final _create12 = ProtectedJniExtensions.lookup< @@ -1400,7 +1402,7 @@ class RequestBody_Companion extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -1417,7 +1419,7 @@ class RequestBody_Companion extends jni.JObject { } static final _id_new0 = _class.constructorId( - r"(Lkotlin/jvm/internal/DefaultConstructorMarker;)V", + r'(Lkotlin/jvm/internal/DefaultConstructorMarker;)V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -1426,7 +1428,7 @@ class RequestBody_Companion extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_NewObject") + 'globalEnv_NewObject') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -1449,7 +1451,7 @@ final class $RequestBody_CompanionType const $RequestBody_CompanionType(); @override - String get signature => r"Lokhttp3/RequestBody$Companion;"; + String get signature => r'Lokhttp3/RequestBody$Companion;'; @override RequestBody_Companion fromReference(jni.JReference reference) => @@ -1480,13 +1482,13 @@ class RequestBody extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/RequestBody"); + static final _class = jni.JClass.forName(r'okhttp3/RequestBody'); /// The type which includes information such as the signature of this class. static const type = $RequestBodyType(); static final _id_Companion = _class.staticFieldId( - r"Companion", - r"Lokhttp3/RequestBody$Companion;", + r'Companion', + r'Lokhttp3/RequestBody$Companion;', ); /// from: static public final okhttp3.RequestBody$Companion Companion @@ -1495,7 +1497,7 @@ class RequestBody extends jni.JObject { _id_Companion.get(_class, const $RequestBody_CompanionType()); static final _id_new0 = _class.constructorId( - r"()V", + r'()V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -1503,7 +1505,7 @@ class RequestBody extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_NewObject") + )>>('globalEnv_NewObject') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -1519,8 +1521,8 @@ class RequestBody extends jni.JObject { } static final _id_contentType = _class.instanceMethodId( - r"contentType", - r"()Lokhttp3/MediaType;", + r'contentType', + r'()Lokhttp3/MediaType;', ); static final _contentType = ProtectedJniExtensions.lookup< @@ -1528,7 +1530,7 @@ class RequestBody extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -1543,8 +1545,8 @@ class RequestBody extends jni.JObject { } static final _id_contentLength = _class.instanceMethodId( - r"contentLength", - r"()J", + r'contentLength', + r'()J', ); static final _contentLength = ProtectedJniExtensions.lookup< @@ -1552,7 +1554,7 @@ class RequestBody extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallLongMethod") + )>>('globalEnv_CallLongMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -1567,8 +1569,8 @@ class RequestBody extends jni.JObject { } static final _id_writeTo = _class.instanceMethodId( - r"writeTo", - r"(Lokio/BufferedSink;)V", + r'writeTo', + r'(Lokio/BufferedSink;)V', ); static final _writeTo = ProtectedJniExtensions.lookup< @@ -1577,7 +1579,7 @@ class RequestBody extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallVoidMethod") + 'globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -1592,8 +1594,8 @@ class RequestBody extends jni.JObject { } static final _id_isDuplex = _class.instanceMethodId( - r"isDuplex", - r"()Z", + r'isDuplex', + r'()Z', ); static final _isDuplex = ProtectedJniExtensions.lookup< @@ -1601,7 +1603,7 @@ class RequestBody extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallBooleanMethod") + )>>('globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -1615,8 +1617,8 @@ class RequestBody extends jni.JObject { } static final _id_isOneShot = _class.instanceMethodId( - r"isOneShot", - r"()Z", + r'isOneShot', + r'()Z', ); static final _isOneShot = ProtectedJniExtensions.lookup< @@ -1624,7 +1626,7 @@ class RequestBody extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallBooleanMethod") + )>>('globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -1638,8 +1640,8 @@ class RequestBody extends jni.JObject { } static final _id_create = _class.staticMethodId( - r"create", - r"(Ljava/lang/String;Lokhttp3/MediaType;)Lokhttp3/RequestBody;", + r'create', + r'(Ljava/lang/String;Lokhttp3/MediaType;)Lokhttp3/RequestBody;', ); static final _create = ProtectedJniExtensions.lookup< @@ -1651,7 +1653,7 @@ class RequestBody extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallStaticObjectMethod") + )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -1668,8 +1670,8 @@ class RequestBody extends jni.JObject { } static final _id_create1 = _class.staticMethodId( - r"create", - r"(Lokio/ByteString;Lokhttp3/MediaType;)Lokhttp3/RequestBody;", + r'create', + r'(Lokio/ByteString;Lokhttp3/MediaType;)Lokhttp3/RequestBody;', ); static final _create1 = ProtectedJniExtensions.lookup< @@ -1681,7 +1683,7 @@ class RequestBody extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallStaticObjectMethod") + )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -1698,8 +1700,8 @@ class RequestBody extends jni.JObject { } static final _id_create2 = _class.staticMethodId( - r"create", - r"([BLokhttp3/MediaType;II)Lokhttp3/RequestBody;", + r'create', + r'([BLokhttp3/MediaType;II)Lokhttp3/RequestBody;', ); static final _create2 = ProtectedJniExtensions.lookup< @@ -1713,7 +1715,7 @@ class RequestBody extends jni.JObject { ffi.Pointer, $Int32, $Int32 - )>)>>("globalEnv_CallStaticObjectMethod") + )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer, int, int)>(); @@ -1732,8 +1734,8 @@ class RequestBody extends jni.JObject { } static final _id_create3 = _class.staticMethodId( - r"create", - r"(Ljava/io/File;Lokhttp3/MediaType;)Lokhttp3/RequestBody;", + r'create', + r'(Ljava/io/File;Lokhttp3/MediaType;)Lokhttp3/RequestBody;', ); static final _create3 = ProtectedJniExtensions.lookup< @@ -1745,7 +1747,7 @@ class RequestBody extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallStaticObjectMethod") + )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -1762,8 +1764,8 @@ class RequestBody extends jni.JObject { } static final _id_create4 = _class.staticMethodId( - r"create", - r"(Lokhttp3/MediaType;Ljava/lang/String;)Lokhttp3/RequestBody;", + r'create', + r'(Lokhttp3/MediaType;Ljava/lang/String;)Lokhttp3/RequestBody;', ); static final _create4 = ProtectedJniExtensions.lookup< @@ -1775,7 +1777,7 @@ class RequestBody extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallStaticObjectMethod") + )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -1792,8 +1794,8 @@ class RequestBody extends jni.JObject { } static final _id_create5 = _class.staticMethodId( - r"create", - r"(Lokhttp3/MediaType;Lokio/ByteString;)Lokhttp3/RequestBody;", + r'create', + r'(Lokhttp3/MediaType;Lokio/ByteString;)Lokhttp3/RequestBody;', ); static final _create5 = ProtectedJniExtensions.lookup< @@ -1805,7 +1807,7 @@ class RequestBody extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallStaticObjectMethod") + )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -1822,8 +1824,8 @@ class RequestBody extends jni.JObject { } static final _id_create6 = _class.staticMethodId( - r"create", - r"(Lokhttp3/MediaType;[BII)Lokhttp3/RequestBody;", + r'create', + r'(Lokhttp3/MediaType;[BII)Lokhttp3/RequestBody;', ); static final _create6 = ProtectedJniExtensions.lookup< @@ -1837,7 +1839,7 @@ class RequestBody extends jni.JObject { ffi.Pointer, $Int32, $Int32 - )>)>>("globalEnv_CallStaticObjectMethod") + )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer, int, int)>(); @@ -1856,8 +1858,8 @@ class RequestBody extends jni.JObject { } static final _id_create7 = _class.staticMethodId( - r"create", - r"(Lokhttp3/MediaType;Ljava/io/File;)Lokhttp3/RequestBody;", + r'create', + r'(Lokhttp3/MediaType;Ljava/io/File;)Lokhttp3/RequestBody;', ); static final _create7 = ProtectedJniExtensions.lookup< @@ -1869,7 +1871,7 @@ class RequestBody extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallStaticObjectMethod") + )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -1886,8 +1888,8 @@ class RequestBody extends jni.JObject { } static final _id_create8 = _class.staticMethodId( - r"create", - r"([BLokhttp3/MediaType;I)Lokhttp3/RequestBody;", + r'create', + r'([BLokhttp3/MediaType;I)Lokhttp3/RequestBody;', ); static final _create8 = ProtectedJniExtensions.lookup< @@ -1900,7 +1902,7 @@ class RequestBody extends jni.JObject { ffi.Pointer, ffi.Pointer, $Int32 - )>)>>("globalEnv_CallStaticObjectMethod") + )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer, int)>(); @@ -1918,8 +1920,8 @@ class RequestBody extends jni.JObject { } static final _id_create9 = _class.staticMethodId( - r"create", - r"([BLokhttp3/MediaType;)Lokhttp3/RequestBody;", + r'create', + r'([BLokhttp3/MediaType;)Lokhttp3/RequestBody;', ); static final _create9 = ProtectedJniExtensions.lookup< @@ -1931,7 +1933,7 @@ class RequestBody extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallStaticObjectMethod") + )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -1948,8 +1950,8 @@ class RequestBody extends jni.JObject { } static final _id_create10 = _class.staticMethodId( - r"create", - r"([B)Lokhttp3/RequestBody;", + r'create', + r'([B)Lokhttp3/RequestBody;', ); static final _create10 = ProtectedJniExtensions.lookup< @@ -1958,7 +1960,7 @@ class RequestBody extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallStaticObjectMethod") + 'globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -1974,8 +1976,8 @@ class RequestBody extends jni.JObject { } static final _id_create11 = _class.staticMethodId( - r"create", - r"(Lokhttp3/MediaType;[BI)Lokhttp3/RequestBody;", + r'create', + r'(Lokhttp3/MediaType;[BI)Lokhttp3/RequestBody;', ); static final _create11 = ProtectedJniExtensions.lookup< @@ -1988,7 +1990,7 @@ class RequestBody extends jni.JObject { ffi.Pointer, ffi.Pointer, $Int32 - )>)>>("globalEnv_CallStaticObjectMethod") + )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer, int)>(); @@ -2006,8 +2008,8 @@ class RequestBody extends jni.JObject { } static final _id_create12 = _class.staticMethodId( - r"create", - r"(Lokhttp3/MediaType;[B)Lokhttp3/RequestBody;", + r'create', + r'(Lokhttp3/MediaType;[B)Lokhttp3/RequestBody;', ); static final _create12 = ProtectedJniExtensions.lookup< @@ -2019,7 +2021,7 @@ class RequestBody extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallStaticObjectMethod") + )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -2040,7 +2042,7 @@ final class $RequestBodyType extends jni.JObjType { const $RequestBodyType(); @override - String get signature => r"Lokhttp3/RequestBody;"; + String get signature => r'Lokhttp3/RequestBody;'; @override RequestBody fromReference(jni.JReference reference) => @@ -2070,12 +2072,12 @@ class Response_Builder extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/Response$Builder"); + static final _class = jni.JClass.forName(r'okhttp3/Response$Builder'); /// The type which includes information such as the signature of this class. static const type = $Response_BuilderType(); static final _id_new0 = _class.constructorId( - r"()V", + r'()V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -2083,7 +2085,7 @@ class Response_Builder extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_NewObject") + )>>('globalEnv_NewObject') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -2099,7 +2101,7 @@ class Response_Builder extends jni.JObject { } static final _id_new1 = _class.constructorId( - r"(Lokhttp3/Response;)V", + r'(Lokhttp3/Response;)V', ); static final _new1 = ProtectedJniExtensions.lookup< @@ -2108,7 +2110,7 @@ class Response_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_NewObject") + 'globalEnv_NewObject') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -2124,8 +2126,8 @@ class Response_Builder extends jni.JObject { } static final _id_request = _class.instanceMethodId( - r"request", - r"(Lokhttp3/Request;)Lokhttp3/Response$Builder;", + r'request', + r'(Lokhttp3/Request;)Lokhttp3/Response$Builder;', ); static final _request = ProtectedJniExtensions.lookup< @@ -2134,7 +2136,7 @@ class Response_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -2150,8 +2152,8 @@ class Response_Builder extends jni.JObject { } static final _id_protocol = _class.instanceMethodId( - r"protocol", - r"(Lokhttp3/Protocol;)Lokhttp3/Response$Builder;", + r'protocol', + r'(Lokhttp3/Protocol;)Lokhttp3/Response$Builder;', ); static final _protocol = ProtectedJniExtensions.lookup< @@ -2160,7 +2162,7 @@ class Response_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -2176,14 +2178,14 @@ class Response_Builder extends jni.JObject { } static final _id_code = _class.instanceMethodId( - r"code", - r"(I)Lokhttp3/Response$Builder;", + r'code', + r'(I)Lokhttp3/Response$Builder;', ); static final _code = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>("globalEnv_CallObjectMethod") + ffi.VarArgs<($Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, int)>(); @@ -2198,8 +2200,8 @@ class Response_Builder extends jni.JObject { } static final _id_message = _class.instanceMethodId( - r"message", - r"(Ljava/lang/String;)Lokhttp3/Response$Builder;", + r'message', + r'(Ljava/lang/String;)Lokhttp3/Response$Builder;', ); static final _message = ProtectedJniExtensions.lookup< @@ -2208,7 +2210,7 @@ class Response_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -2224,8 +2226,8 @@ class Response_Builder extends jni.JObject { } static final _id_handshake = _class.instanceMethodId( - r"handshake", - r"(Lokhttp3/Handshake;)Lokhttp3/Response$Builder;", + r'handshake', + r'(Lokhttp3/Handshake;)Lokhttp3/Response$Builder;', ); static final _handshake = ProtectedJniExtensions.lookup< @@ -2234,7 +2236,7 @@ class Response_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -2250,8 +2252,8 @@ class Response_Builder extends jni.JObject { } static final _id_header = _class.instanceMethodId( - r"header", - r"(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Response$Builder;", + r'header', + r'(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Response$Builder;', ); static final _header = ProtectedJniExtensions.lookup< @@ -2263,7 +2265,7 @@ class Response_Builder extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -2280,8 +2282,8 @@ class Response_Builder extends jni.JObject { } static final _id_addHeader = _class.instanceMethodId( - r"addHeader", - r"(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Response$Builder;", + r'addHeader', + r'(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Response$Builder;', ); static final _addHeader = ProtectedJniExtensions.lookup< @@ -2293,7 +2295,7 @@ class Response_Builder extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -2310,8 +2312,8 @@ class Response_Builder extends jni.JObject { } static final _id_removeHeader = _class.instanceMethodId( - r"removeHeader", - r"(Ljava/lang/String;)Lokhttp3/Response$Builder;", + r'removeHeader', + r'(Ljava/lang/String;)Lokhttp3/Response$Builder;', ); static final _removeHeader = ProtectedJniExtensions.lookup< @@ -2320,7 +2322,7 @@ class Response_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -2336,8 +2338,8 @@ class Response_Builder extends jni.JObject { } static final _id_headers = _class.instanceMethodId( - r"headers", - r"(Lokhttp3/Headers;)Lokhttp3/Response$Builder;", + r'headers', + r'(Lokhttp3/Headers;)Lokhttp3/Response$Builder;', ); static final _headers = ProtectedJniExtensions.lookup< @@ -2346,7 +2348,7 @@ class Response_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -2362,8 +2364,8 @@ class Response_Builder extends jni.JObject { } static final _id_body = _class.instanceMethodId( - r"body", - r"(Lokhttp3/ResponseBody;)Lokhttp3/Response$Builder;", + r'body', + r'(Lokhttp3/ResponseBody;)Lokhttp3/Response$Builder;', ); static final _body = ProtectedJniExtensions.lookup< @@ -2372,7 +2374,7 @@ class Response_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -2388,8 +2390,8 @@ class Response_Builder extends jni.JObject { } static final _id_networkResponse = _class.instanceMethodId( - r"networkResponse", - r"(Lokhttp3/Response;)Lokhttp3/Response$Builder;", + r'networkResponse', + r'(Lokhttp3/Response;)Lokhttp3/Response$Builder;', ); static final _networkResponse = ProtectedJniExtensions.lookup< @@ -2398,7 +2400,7 @@ class Response_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -2414,8 +2416,8 @@ class Response_Builder extends jni.JObject { } static final _id_cacheResponse = _class.instanceMethodId( - r"cacheResponse", - r"(Lokhttp3/Response;)Lokhttp3/Response$Builder;", + r'cacheResponse', + r'(Lokhttp3/Response;)Lokhttp3/Response$Builder;', ); static final _cacheResponse = ProtectedJniExtensions.lookup< @@ -2424,7 +2426,7 @@ class Response_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -2440,8 +2442,8 @@ class Response_Builder extends jni.JObject { } static final _id_priorResponse = _class.instanceMethodId( - r"priorResponse", - r"(Lokhttp3/Response;)Lokhttp3/Response$Builder;", + r'priorResponse', + r'(Lokhttp3/Response;)Lokhttp3/Response$Builder;', ); static final _priorResponse = ProtectedJniExtensions.lookup< @@ -2450,7 +2452,7 @@ class Response_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -2466,14 +2468,14 @@ class Response_Builder extends jni.JObject { } static final _id_sentRequestAtMillis = _class.instanceMethodId( - r"sentRequestAtMillis", - r"(J)Lokhttp3/Response$Builder;", + r'sentRequestAtMillis', + r'(J)Lokhttp3/Response$Builder;', ); static final _sentRequestAtMillis = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Int64,)>)>>("globalEnv_CallObjectMethod") + ffi.VarArgs<(ffi.Int64,)>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, int)>(); @@ -2489,14 +2491,14 @@ class Response_Builder extends jni.JObject { } static final _id_receivedResponseAtMillis = _class.instanceMethodId( - r"receivedResponseAtMillis", - r"(J)Lokhttp3/Response$Builder;", + r'receivedResponseAtMillis', + r'(J)Lokhttp3/Response$Builder;', ); static final _receivedResponseAtMillis = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Int64,)>)>>("globalEnv_CallObjectMethod") + ffi.VarArgs<(ffi.Int64,)>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, int)>(); @@ -2512,8 +2514,8 @@ class Response_Builder extends jni.JObject { } static final _id_build = _class.instanceMethodId( - r"build", - r"()Lokhttp3/Response;", + r'build', + r'()Lokhttp3/Response;', ); static final _build = ProtectedJniExtensions.lookup< @@ -2521,7 +2523,7 @@ class Response_Builder extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -2540,7 +2542,7 @@ final class $Response_BuilderType extends jni.JObjType { const $Response_BuilderType(); @override - String get signature => r"Lokhttp3/Response$Builder;"; + String get signature => r'Lokhttp3/Response$Builder;'; @override Response_Builder fromReference(jni.JReference reference) => @@ -2571,12 +2573,12 @@ class Response extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/Response"); + static final _class = jni.JClass.forName(r'okhttp3/Response'); /// The type which includes information such as the signature of this class. static const type = $ResponseType(); static final _id_new0 = _class.constructorId( - r"(Lokhttp3/Request;Lokhttp3/Protocol;Ljava/lang/String;ILokhttp3/Handshake;Lokhttp3/Headers;Lokhttp3/ResponseBody;Lokhttp3/Response;Lokhttp3/Response;Lokhttp3/Response;JJLokhttp3/internal/connection/Exchange;)V", + r'(Lokhttp3/Request;Lokhttp3/Protocol;Ljava/lang/String;ILokhttp3/Handshake;Lokhttp3/Headers;Lokhttp3/ResponseBody;Lokhttp3/Response;Lokhttp3/Response;Lokhttp3/Response;JJLokhttp3/internal/connection/Exchange;)V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -2599,7 +2601,7 @@ class Response extends jni.JObject { ffi.Int64, ffi.Int64, ffi.Pointer - )>)>>("globalEnv_NewObject") + )>)>>('globalEnv_NewObject') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -2655,8 +2657,8 @@ class Response extends jni.JObject { } static final _id_request = _class.instanceMethodId( - r"request", - r"()Lokhttp3/Request;", + r'request', + r'()Lokhttp3/Request;', ); static final _request = ProtectedJniExtensions.lookup< @@ -2664,7 +2666,7 @@ class Response extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -2679,8 +2681,8 @@ class Response extends jni.JObject { } static final _id_protocol = _class.instanceMethodId( - r"protocol", - r"()Lokhttp3/Protocol;", + r'protocol', + r'()Lokhttp3/Protocol;', ); static final _protocol = ProtectedJniExtensions.lookup< @@ -2688,7 +2690,7 @@ class Response extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -2703,8 +2705,8 @@ class Response extends jni.JObject { } static final _id_message = _class.instanceMethodId( - r"message", - r"()Ljava/lang/String;", + r'message', + r'()Ljava/lang/String;', ); static final _message = ProtectedJniExtensions.lookup< @@ -2712,7 +2714,7 @@ class Response extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -2727,8 +2729,8 @@ class Response extends jni.JObject { } static final _id_code = _class.instanceMethodId( - r"code", - r"()I", + r'code', + r'()I', ); static final _code = ProtectedJniExtensions.lookup< @@ -2736,7 +2738,7 @@ class Response extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallIntMethod") + )>>('globalEnv_CallIntMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -2749,8 +2751,8 @@ class Response extends jni.JObject { } static final _id_handshake = _class.instanceMethodId( - r"handshake", - r"()Lokhttp3/Handshake;", + r'handshake', + r'()Lokhttp3/Handshake;', ); static final _handshake = ProtectedJniExtensions.lookup< @@ -2758,7 +2760,7 @@ class Response extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -2773,8 +2775,8 @@ class Response extends jni.JObject { } static final _id_headers = _class.instanceMethodId( - r"headers", - r"()Lokhttp3/Headers;", + r'headers', + r'()Lokhttp3/Headers;', ); static final _headers = ProtectedJniExtensions.lookup< @@ -2782,7 +2784,7 @@ class Response extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -2797,8 +2799,8 @@ class Response extends jni.JObject { } static final _id_body = _class.instanceMethodId( - r"body", - r"()Lokhttp3/ResponseBody;", + r'body', + r'()Lokhttp3/ResponseBody;', ); static final _body = ProtectedJniExtensions.lookup< @@ -2806,7 +2808,7 @@ class Response extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -2821,8 +2823,8 @@ class Response extends jni.JObject { } static final _id_networkResponse = _class.instanceMethodId( - r"networkResponse", - r"()Lokhttp3/Response;", + r'networkResponse', + r'()Lokhttp3/Response;', ); static final _networkResponse = ProtectedJniExtensions.lookup< @@ -2830,7 +2832,7 @@ class Response extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -2846,8 +2848,8 @@ class Response extends jni.JObject { } static final _id_cacheResponse = _class.instanceMethodId( - r"cacheResponse", - r"()Lokhttp3/Response;", + r'cacheResponse', + r'()Lokhttp3/Response;', ); static final _cacheResponse = ProtectedJniExtensions.lookup< @@ -2855,7 +2857,7 @@ class Response extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -2871,8 +2873,8 @@ class Response extends jni.JObject { } static final _id_priorResponse = _class.instanceMethodId( - r"priorResponse", - r"()Lokhttp3/Response;", + r'priorResponse', + r'()Lokhttp3/Response;', ); static final _priorResponse = ProtectedJniExtensions.lookup< @@ -2880,7 +2882,7 @@ class Response extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -2896,8 +2898,8 @@ class Response extends jni.JObject { } static final _id_sentRequestAtMillis = _class.instanceMethodId( - r"sentRequestAtMillis", - r"()J", + r'sentRequestAtMillis', + r'()J', ); static final _sentRequestAtMillis = ProtectedJniExtensions.lookup< @@ -2905,7 +2907,7 @@ class Response extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallLongMethod") + )>>('globalEnv_CallLongMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -2920,8 +2922,8 @@ class Response extends jni.JObject { } static final _id_receivedResponseAtMillis = _class.instanceMethodId( - r"receivedResponseAtMillis", - r"()J", + r'receivedResponseAtMillis', + r'()J', ); static final _receivedResponseAtMillis = ProtectedJniExtensions.lookup< @@ -2929,7 +2931,7 @@ class Response extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallLongMethod") + )>>('globalEnv_CallLongMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -2944,8 +2946,8 @@ class Response extends jni.JObject { } static final _id_exchange = _class.instanceMethodId( - r"exchange", - r"()Lokhttp3/internal/connection/Exchange;", + r'exchange', + r'()Lokhttp3/internal/connection/Exchange;', ); static final _exchange = ProtectedJniExtensions.lookup< @@ -2953,7 +2955,7 @@ class Response extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -2968,8 +2970,8 @@ class Response extends jni.JObject { } static final _id_isSuccessful = _class.instanceMethodId( - r"isSuccessful", - r"()Z", + r'isSuccessful', + r'()Z', ); static final _isSuccessful = ProtectedJniExtensions.lookup< @@ -2977,7 +2979,7 @@ class Response extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallBooleanMethod") + )>>('globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -2992,8 +2994,8 @@ class Response extends jni.JObject { } static final _id_headers1 = _class.instanceMethodId( - r"headers", - r"(Ljava/lang/String;)Ljava/util/List;", + r'headers', + r'(Ljava/lang/String;)Ljava/util/List;', ); static final _headers1 = ProtectedJniExtensions.lookup< @@ -3002,7 +3004,7 @@ class Response extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -3018,8 +3020,8 @@ class Response extends jni.JObject { } static final _id_header = _class.instanceMethodId( - r"header", - r"(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", + r'header', + r'(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;', ); static final _header = ProtectedJniExtensions.lookup< @@ -3031,7 +3033,7 @@ class Response extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -3048,8 +3050,8 @@ class Response extends jni.JObject { } static final _id_trailers = _class.instanceMethodId( - r"trailers", - r"()Lokhttp3/Headers;", + r'trailers', + r'()Lokhttp3/Headers;', ); static final _trailers = ProtectedJniExtensions.lookup< @@ -3057,7 +3059,7 @@ class Response extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -3072,14 +3074,14 @@ class Response extends jni.JObject { } static final _id_peekBody = _class.instanceMethodId( - r"peekBody", - r"(J)Lokhttp3/ResponseBody;", + r'peekBody', + r'(J)Lokhttp3/ResponseBody;', ); static final _peekBody = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Int64,)>)>>("globalEnv_CallObjectMethod") + ffi.VarArgs<(ffi.Int64,)>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, int)>(); @@ -3094,8 +3096,8 @@ class Response extends jni.JObject { } static final _id_newBuilder = _class.instanceMethodId( - r"newBuilder", - r"()Lokhttp3/Response$Builder;", + r'newBuilder', + r'()Lokhttp3/Response$Builder;', ); static final _newBuilder = ProtectedJniExtensions.lookup< @@ -3103,7 +3105,7 @@ class Response extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -3118,8 +3120,8 @@ class Response extends jni.JObject { } static final _id_isRedirect = _class.instanceMethodId( - r"isRedirect", - r"()Z", + r'isRedirect', + r'()Z', ); static final _isRedirect = ProtectedJniExtensions.lookup< @@ -3127,7 +3129,7 @@ class Response extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallBooleanMethod") + )>>('globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -3141,8 +3143,8 @@ class Response extends jni.JObject { } static final _id_challenges = _class.instanceMethodId( - r"challenges", - r"()Ljava/util/List;", + r'challenges', + r'()Ljava/util/List;', ); static final _challenges = ProtectedJniExtensions.lookup< @@ -3150,7 +3152,7 @@ class Response extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -3165,8 +3167,8 @@ class Response extends jni.JObject { } static final _id_cacheControl = _class.instanceMethodId( - r"cacheControl", - r"()Lokhttp3/CacheControl;", + r'cacheControl', + r'()Lokhttp3/CacheControl;', ); static final _cacheControl = ProtectedJniExtensions.lookup< @@ -3174,7 +3176,7 @@ class Response extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -3190,8 +3192,8 @@ class Response extends jni.JObject { } static final _id_close = _class.instanceMethodId( - r"close", - r"()V", + r'close', + r'()V', ); static final _close = ProtectedJniExtensions.lookup< @@ -3199,7 +3201,7 @@ class Response extends jni.JObject { jni.JThrowablePtr Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallVoidMethod") + )>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function( ffi.Pointer, @@ -3212,8 +3214,8 @@ class Response extends jni.JObject { } static final _id_toString1 = _class.instanceMethodId( - r"toString", - r"()Ljava/lang/String;", + r'toString', + r'()Ljava/lang/String;', ); static final _toString1 = ProtectedJniExtensions.lookup< @@ -3221,7 +3223,7 @@ class Response extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -3236,8 +3238,8 @@ class Response extends jni.JObject { } static final _id_header1 = _class.instanceMethodId( - r"header", - r"(Ljava/lang/String;)Ljava/lang/String;", + r'header', + r'(Ljava/lang/String;)Ljava/lang/String;', ); static final _header1 = ProtectedJniExtensions.lookup< @@ -3246,7 +3248,7 @@ class Response extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -3266,7 +3268,7 @@ final class $ResponseType extends jni.JObjType { const $ResponseType(); @override - String get signature => r"Lokhttp3/Response;"; + String get signature => r'Lokhttp3/Response;'; @override Response fromReference(jni.JReference reference) => @@ -3297,12 +3299,12 @@ class ResponseBody_BomAwareReader extends jni.JObject { ) : super.fromReference(reference); static final _class = - jni.JClass.forName(r"okhttp3/ResponseBody$BomAwareReader"); + jni.JClass.forName(r'okhttp3/ResponseBody$BomAwareReader'); /// The type which includes information such as the signature of this class. static const type = $ResponseBody_BomAwareReaderType(); static final _id_new0 = _class.constructorId( - r"(Lokio/BufferedSource;Ljava/nio/charset/Charset;)V", + r'(Lokio/BufferedSource;Ljava/nio/charset/Charset;)V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -3314,7 +3316,7 @@ class ResponseBody_BomAwareReader extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_NewObject") + )>)>>('globalEnv_NewObject') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -3334,8 +3336,8 @@ class ResponseBody_BomAwareReader extends jni.JObject { } static final _id_read = _class.instanceMethodId( - r"read", - r"([CII)I", + r'read', + r'([CII)I', ); static final _read = ProtectedJniExtensions.lookup< @@ -3344,7 +3346,7 @@ class ResponseBody_BomAwareReader extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer, $Int32, $Int32)>)>>( - "globalEnv_CallIntMethod") + 'globalEnv_CallIntMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, int, int)>(); @@ -3361,8 +3363,8 @@ class ResponseBody_BomAwareReader extends jni.JObject { } static final _id_close = _class.instanceMethodId( - r"close", - r"()V", + r'close', + r'()V', ); static final _close = ProtectedJniExtensions.lookup< @@ -3370,7 +3372,7 @@ class ResponseBody_BomAwareReader extends jni.JObject { jni.JThrowablePtr Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallVoidMethod") + )>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function( ffi.Pointer, @@ -3388,7 +3390,7 @@ final class $ResponseBody_BomAwareReaderType const $ResponseBody_BomAwareReaderType(); @override - String get signature => r"Lokhttp3/ResponseBody$BomAwareReader;"; + String get signature => r'Lokhttp3/ResponseBody$BomAwareReader;'; @override ResponseBody_BomAwareReader fromReference(jni.JReference reference) => @@ -3419,13 +3421,13 @@ class ResponseBody_Companion extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/ResponseBody$Companion"); + static final _class = jni.JClass.forName(r'okhttp3/ResponseBody$Companion'); /// The type which includes information such as the signature of this class. static const type = $ResponseBody_CompanionType(); static final _id_create = _class.instanceMethodId( - r"create", - r"(Ljava/lang/String;Lokhttp3/MediaType;)Lokhttp3/ResponseBody;", + r'create', + r'(Ljava/lang/String;Lokhttp3/MediaType;)Lokhttp3/ResponseBody;', ); static final _create = ProtectedJniExtensions.lookup< @@ -3437,7 +3439,7 @@ class ResponseBody_Companion extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -3454,8 +3456,8 @@ class ResponseBody_Companion extends jni.JObject { } static final _id_create1 = _class.instanceMethodId( - r"create", - r"([BLokhttp3/MediaType;)Lokhttp3/ResponseBody;", + r'create', + r'([BLokhttp3/MediaType;)Lokhttp3/ResponseBody;', ); static final _create1 = ProtectedJniExtensions.lookup< @@ -3467,7 +3469,7 @@ class ResponseBody_Companion extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -3484,8 +3486,8 @@ class ResponseBody_Companion extends jni.JObject { } static final _id_create2 = _class.instanceMethodId( - r"create", - r"(Lokio/ByteString;Lokhttp3/MediaType;)Lokhttp3/ResponseBody;", + r'create', + r'(Lokio/ByteString;Lokhttp3/MediaType;)Lokhttp3/ResponseBody;', ); static final _create2 = ProtectedJniExtensions.lookup< @@ -3497,7 +3499,7 @@ class ResponseBody_Companion extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -3514,8 +3516,8 @@ class ResponseBody_Companion extends jni.JObject { } static final _id_create3 = _class.instanceMethodId( - r"create", - r"(Lokio/BufferedSource;Lokhttp3/MediaType;J)Lokhttp3/ResponseBody;", + r'create', + r'(Lokio/BufferedSource;Lokhttp3/MediaType;J)Lokhttp3/ResponseBody;', ); static final _create3 = ProtectedJniExtensions.lookup< @@ -3528,7 +3530,7 @@ class ResponseBody_Companion extends jni.JObject { ffi.Pointer, ffi.Pointer, ffi.Int64 - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer, int)>(); @@ -3546,8 +3548,8 @@ class ResponseBody_Companion extends jni.JObject { } static final _id_create4 = _class.instanceMethodId( - r"create", - r"(Lokhttp3/MediaType;Ljava/lang/String;)Lokhttp3/ResponseBody;", + r'create', + r'(Lokhttp3/MediaType;Ljava/lang/String;)Lokhttp3/ResponseBody;', ); static final _create4 = ProtectedJniExtensions.lookup< @@ -3559,7 +3561,7 @@ class ResponseBody_Companion extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -3576,8 +3578,8 @@ class ResponseBody_Companion extends jni.JObject { } static final _id_create5 = _class.instanceMethodId( - r"create", - r"(Lokhttp3/MediaType;[B)Lokhttp3/ResponseBody;", + r'create', + r'(Lokhttp3/MediaType;[B)Lokhttp3/ResponseBody;', ); static final _create5 = ProtectedJniExtensions.lookup< @@ -3589,7 +3591,7 @@ class ResponseBody_Companion extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -3606,8 +3608,8 @@ class ResponseBody_Companion extends jni.JObject { } static final _id_create6 = _class.instanceMethodId( - r"create", - r"(Lokhttp3/MediaType;Lokio/ByteString;)Lokhttp3/ResponseBody;", + r'create', + r'(Lokhttp3/MediaType;Lokio/ByteString;)Lokhttp3/ResponseBody;', ); static final _create6 = ProtectedJniExtensions.lookup< @@ -3619,7 +3621,7 @@ class ResponseBody_Companion extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -3636,8 +3638,8 @@ class ResponseBody_Companion extends jni.JObject { } static final _id_create7 = _class.instanceMethodId( - r"create", - r"(Lokhttp3/MediaType;JLokio/BufferedSource;)Lokhttp3/ResponseBody;", + r'create', + r'(Lokhttp3/MediaType;JLokio/BufferedSource;)Lokhttp3/ResponseBody;', ); static final _create7 = ProtectedJniExtensions.lookup< @@ -3650,7 +3652,7 @@ class ResponseBody_Companion extends jni.JObject { ffi.Pointer, ffi.Int64, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, int, ffi.Pointer)>(); @@ -3668,7 +3670,7 @@ class ResponseBody_Companion extends jni.JObject { } static final _id_new0 = _class.constructorId( - r"(Lkotlin/jvm/internal/DefaultConstructorMarker;)V", + r'(Lkotlin/jvm/internal/DefaultConstructorMarker;)V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -3677,7 +3679,7 @@ class ResponseBody_Companion extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_NewObject") + 'globalEnv_NewObject') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -3700,7 +3702,7 @@ final class $ResponseBody_CompanionType const $ResponseBody_CompanionType(); @override - String get signature => r"Lokhttp3/ResponseBody$Companion;"; + String get signature => r'Lokhttp3/ResponseBody$Companion;'; @override ResponseBody_Companion fromReference(jni.JReference reference) => @@ -3731,13 +3733,13 @@ class ResponseBody extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/ResponseBody"); + static final _class = jni.JClass.forName(r'okhttp3/ResponseBody'); /// The type which includes information such as the signature of this class. static const type = $ResponseBodyType(); static final _id_Companion = _class.staticFieldId( - r"Companion", - r"Lokhttp3/ResponseBody$Companion;", + r'Companion', + r'Lokhttp3/ResponseBody$Companion;', ); /// from: static public final okhttp3.ResponseBody$Companion Companion @@ -3746,7 +3748,7 @@ class ResponseBody extends jni.JObject { _id_Companion.get(_class, const $ResponseBody_CompanionType()); static final _id_new0 = _class.constructorId( - r"()V", + r'()V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -3754,7 +3756,7 @@ class ResponseBody extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_NewObject") + )>>('globalEnv_NewObject') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -3770,8 +3772,8 @@ class ResponseBody extends jni.JObject { } static final _id_contentType = _class.instanceMethodId( - r"contentType", - r"()Lokhttp3/MediaType;", + r'contentType', + r'()Lokhttp3/MediaType;', ); static final _contentType = ProtectedJniExtensions.lookup< @@ -3779,7 +3781,7 @@ class ResponseBody extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -3794,8 +3796,8 @@ class ResponseBody extends jni.JObject { } static final _id_contentLength = _class.instanceMethodId( - r"contentLength", - r"()J", + r'contentLength', + r'()J', ); static final _contentLength = ProtectedJniExtensions.lookup< @@ -3803,7 +3805,7 @@ class ResponseBody extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallLongMethod") + )>>('globalEnv_CallLongMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -3818,8 +3820,8 @@ class ResponseBody extends jni.JObject { } static final _id_byteStream = _class.instanceMethodId( - r"byteStream", - r"()Ljava/io/InputStream;", + r'byteStream', + r'()Ljava/io/InputStream;', ); static final _byteStream = ProtectedJniExtensions.lookup< @@ -3827,7 +3829,7 @@ class ResponseBody extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -3842,8 +3844,8 @@ class ResponseBody extends jni.JObject { } static final _id_source = _class.instanceMethodId( - r"source", - r"()Lokio/BufferedSource;", + r'source', + r'()Lokio/BufferedSource;', ); static final _source = ProtectedJniExtensions.lookup< @@ -3851,7 +3853,7 @@ class ResponseBody extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -3866,8 +3868,8 @@ class ResponseBody extends jni.JObject { } static final _id_bytes = _class.instanceMethodId( - r"bytes", - r"()[B", + r'bytes', + r'()[B', ); static final _bytes = ProtectedJniExtensions.lookup< @@ -3875,7 +3877,7 @@ class ResponseBody extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -3890,8 +3892,8 @@ class ResponseBody extends jni.JObject { } static final _id_byteString = _class.instanceMethodId( - r"byteString", - r"()Lokio/ByteString;", + r'byteString', + r'()Lokio/ByteString;', ); static final _byteString = ProtectedJniExtensions.lookup< @@ -3899,7 +3901,7 @@ class ResponseBody extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -3914,8 +3916,8 @@ class ResponseBody extends jni.JObject { } static final _id_charStream = _class.instanceMethodId( - r"charStream", - r"()Ljava/io/Reader;", + r'charStream', + r'()Ljava/io/Reader;', ); static final _charStream = ProtectedJniExtensions.lookup< @@ -3923,7 +3925,7 @@ class ResponseBody extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -3938,8 +3940,8 @@ class ResponseBody extends jni.JObject { } static final _id_string = _class.instanceMethodId( - r"string", - r"()Ljava/lang/String;", + r'string', + r'()Ljava/lang/String;', ); static final _string = ProtectedJniExtensions.lookup< @@ -3947,7 +3949,7 @@ class ResponseBody extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -3962,8 +3964,8 @@ class ResponseBody extends jni.JObject { } static final _id_close = _class.instanceMethodId( - r"close", - r"()V", + r'close', + r'()V', ); static final _close = ProtectedJniExtensions.lookup< @@ -3971,7 +3973,7 @@ class ResponseBody extends jni.JObject { jni.JThrowablePtr Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallVoidMethod") + )>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function( ffi.Pointer, @@ -3984,8 +3986,8 @@ class ResponseBody extends jni.JObject { } static final _id_create = _class.staticMethodId( - r"create", - r"(Ljava/lang/String;Lokhttp3/MediaType;)Lokhttp3/ResponseBody;", + r'create', + r'(Ljava/lang/String;Lokhttp3/MediaType;)Lokhttp3/ResponseBody;', ); static final _create = ProtectedJniExtensions.lookup< @@ -3997,7 +3999,7 @@ class ResponseBody extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallStaticObjectMethod") + )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -4014,8 +4016,8 @@ class ResponseBody extends jni.JObject { } static final _id_create1 = _class.staticMethodId( - r"create", - r"([BLokhttp3/MediaType;)Lokhttp3/ResponseBody;", + r'create', + r'([BLokhttp3/MediaType;)Lokhttp3/ResponseBody;', ); static final _create1 = ProtectedJniExtensions.lookup< @@ -4027,7 +4029,7 @@ class ResponseBody extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallStaticObjectMethod") + )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -4044,8 +4046,8 @@ class ResponseBody extends jni.JObject { } static final _id_create2 = _class.staticMethodId( - r"create", - r"(Lokio/ByteString;Lokhttp3/MediaType;)Lokhttp3/ResponseBody;", + r'create', + r'(Lokio/ByteString;Lokhttp3/MediaType;)Lokhttp3/ResponseBody;', ); static final _create2 = ProtectedJniExtensions.lookup< @@ -4057,7 +4059,7 @@ class ResponseBody extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallStaticObjectMethod") + )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -4074,8 +4076,8 @@ class ResponseBody extends jni.JObject { } static final _id_create3 = _class.staticMethodId( - r"create", - r"(Lokio/BufferedSource;Lokhttp3/MediaType;J)Lokhttp3/ResponseBody;", + r'create', + r'(Lokio/BufferedSource;Lokhttp3/MediaType;J)Lokhttp3/ResponseBody;', ); static final _create3 = ProtectedJniExtensions.lookup< @@ -4088,7 +4090,7 @@ class ResponseBody extends jni.JObject { ffi.Pointer, ffi.Pointer, ffi.Int64 - )>)>>("globalEnv_CallStaticObjectMethod") + )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer, int)>(); @@ -4106,8 +4108,8 @@ class ResponseBody extends jni.JObject { } static final _id_create4 = _class.staticMethodId( - r"create", - r"(Lokhttp3/MediaType;Ljava/lang/String;)Lokhttp3/ResponseBody;", + r'create', + r'(Lokhttp3/MediaType;Ljava/lang/String;)Lokhttp3/ResponseBody;', ); static final _create4 = ProtectedJniExtensions.lookup< @@ -4119,7 +4121,7 @@ class ResponseBody extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallStaticObjectMethod") + )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -4136,8 +4138,8 @@ class ResponseBody extends jni.JObject { } static final _id_create5 = _class.staticMethodId( - r"create", - r"(Lokhttp3/MediaType;[B)Lokhttp3/ResponseBody;", + r'create', + r'(Lokhttp3/MediaType;[B)Lokhttp3/ResponseBody;', ); static final _create5 = ProtectedJniExtensions.lookup< @@ -4149,7 +4151,7 @@ class ResponseBody extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallStaticObjectMethod") + )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -4166,8 +4168,8 @@ class ResponseBody extends jni.JObject { } static final _id_create6 = _class.staticMethodId( - r"create", - r"(Lokhttp3/MediaType;Lokio/ByteString;)Lokhttp3/ResponseBody;", + r'create', + r'(Lokhttp3/MediaType;Lokio/ByteString;)Lokhttp3/ResponseBody;', ); static final _create6 = ProtectedJniExtensions.lookup< @@ -4179,7 +4181,7 @@ class ResponseBody extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallStaticObjectMethod") + )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -4196,8 +4198,8 @@ class ResponseBody extends jni.JObject { } static final _id_create7 = _class.staticMethodId( - r"create", - r"(Lokhttp3/MediaType;JLokio/BufferedSource;)Lokhttp3/ResponseBody;", + r'create', + r'(Lokhttp3/MediaType;JLokio/BufferedSource;)Lokhttp3/ResponseBody;', ); static final _create7 = ProtectedJniExtensions.lookup< @@ -4210,7 +4212,7 @@ class ResponseBody extends jni.JObject { ffi.Pointer, ffi.Int64, ffi.Pointer - )>)>>("globalEnv_CallStaticObjectMethod") + )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, int, ffi.Pointer)>(); @@ -4232,7 +4234,7 @@ final class $ResponseBodyType extends jni.JObjType { const $ResponseBodyType(); @override - String get signature => r"Lokhttp3/ResponseBody;"; + String get signature => r'Lokhttp3/ResponseBody;'; @override ResponseBody fromReference(jni.JReference reference) => @@ -4263,12 +4265,12 @@ class OkHttpClient_Builder extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/OkHttpClient$Builder"); + static final _class = jni.JClass.forName(r'okhttp3/OkHttpClient$Builder'); /// The type which includes information such as the signature of this class. static const type = $OkHttpClient_BuilderType(); static final _id_new0 = _class.constructorId( - r"()V", + r'()V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -4276,7 +4278,7 @@ class OkHttpClient_Builder extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_NewObject") + )>>('globalEnv_NewObject') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -4292,7 +4294,7 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_new1 = _class.constructorId( - r"(Lokhttp3/OkHttpClient;)V", + r'(Lokhttp3/OkHttpClient;)V', ); static final _new1 = ProtectedJniExtensions.lookup< @@ -4301,7 +4303,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_NewObject") + 'globalEnv_NewObject') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -4317,8 +4319,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_dispatcher = _class.instanceMethodId( - r"dispatcher", - r"(Lokhttp3/Dispatcher;)Lokhttp3/OkHttpClient$Builder;", + r'dispatcher', + r'(Lokhttp3/Dispatcher;)Lokhttp3/OkHttpClient$Builder;', ); static final _dispatcher = ProtectedJniExtensions.lookup< @@ -4327,7 +4329,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -4343,8 +4345,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_connectionPool = _class.instanceMethodId( - r"connectionPool", - r"(Lokhttp3/ConnectionPool;)Lokhttp3/OkHttpClient$Builder;", + r'connectionPool', + r'(Lokhttp3/ConnectionPool;)Lokhttp3/OkHttpClient$Builder;', ); static final _connectionPool = ProtectedJniExtensions.lookup< @@ -4353,7 +4355,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -4371,8 +4373,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_interceptors = _class.instanceMethodId( - r"interceptors", - r"()Ljava/util/List;", + r'interceptors', + r'()Ljava/util/List;', ); static final _interceptors = ProtectedJniExtensions.lookup< @@ -4380,7 +4382,7 @@ class OkHttpClient_Builder extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -4396,8 +4398,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_addInterceptor = _class.instanceMethodId( - r"addInterceptor", - r"(Lokhttp3/Interceptor;)Lokhttp3/OkHttpClient$Builder;", + r'addInterceptor', + r'(Lokhttp3/Interceptor;)Lokhttp3/OkHttpClient$Builder;', ); static final _addInterceptor = ProtectedJniExtensions.lookup< @@ -4406,7 +4408,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -4424,8 +4426,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_networkInterceptors = _class.instanceMethodId( - r"networkInterceptors", - r"()Ljava/util/List;", + r'networkInterceptors', + r'()Ljava/util/List;', ); static final _networkInterceptors = ProtectedJniExtensions.lookup< @@ -4433,7 +4435,7 @@ class OkHttpClient_Builder extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -4449,8 +4451,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_addNetworkInterceptor = _class.instanceMethodId( - r"addNetworkInterceptor", - r"(Lokhttp3/Interceptor;)Lokhttp3/OkHttpClient$Builder;", + r'addNetworkInterceptor', + r'(Lokhttp3/Interceptor;)Lokhttp3/OkHttpClient$Builder;', ); static final _addNetworkInterceptor = ProtectedJniExtensions.lookup< @@ -4459,7 +4461,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -4477,8 +4479,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_eventListener = _class.instanceMethodId( - r"eventListener", - r"(Lokhttp3/EventListener;)Lokhttp3/OkHttpClient$Builder;", + r'eventListener', + r'(Lokhttp3/EventListener;)Lokhttp3/OkHttpClient$Builder;', ); static final _eventListener = ProtectedJniExtensions.lookup< @@ -4487,7 +4489,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -4505,8 +4507,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_eventListenerFactory = _class.instanceMethodId( - r"eventListenerFactory", - r"(Lokhttp3/EventListener$Factory;)Lokhttp3/OkHttpClient$Builder;", + r'eventListenerFactory', + r'(Lokhttp3/EventListener$Factory;)Lokhttp3/OkHttpClient$Builder;', ); static final _eventListenerFactory = ProtectedJniExtensions.lookup< @@ -4515,7 +4517,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -4533,14 +4535,14 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_retryOnConnectionFailure = _class.instanceMethodId( - r"retryOnConnectionFailure", - r"(Z)Lokhttp3/OkHttpClient$Builder;", + r'retryOnConnectionFailure', + r'(Z)Lokhttp3/OkHttpClient$Builder;', ); static final _retryOnConnectionFailure = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>("globalEnv_CallObjectMethod") + ffi.VarArgs<($Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, int)>(); @@ -4556,8 +4558,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_authenticator = _class.instanceMethodId( - r"authenticator", - r"(Lokhttp3/Authenticator;)Lokhttp3/OkHttpClient$Builder;", + r'authenticator', + r'(Lokhttp3/Authenticator;)Lokhttp3/OkHttpClient$Builder;', ); static final _authenticator = ProtectedJniExtensions.lookup< @@ -4566,7 +4568,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -4584,14 +4586,14 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_followRedirects = _class.instanceMethodId( - r"followRedirects", - r"(Z)Lokhttp3/OkHttpClient$Builder;", + r'followRedirects', + r'(Z)Lokhttp3/OkHttpClient$Builder;', ); static final _followRedirects = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>("globalEnv_CallObjectMethod") + ffi.VarArgs<($Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, int)>(); @@ -4607,14 +4609,14 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_followSslRedirects = _class.instanceMethodId( - r"followSslRedirects", - r"(Z)Lokhttp3/OkHttpClient$Builder;", + r'followSslRedirects', + r'(Z)Lokhttp3/OkHttpClient$Builder;', ); static final _followSslRedirects = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>("globalEnv_CallObjectMethod") + ffi.VarArgs<($Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, int)>(); @@ -4630,8 +4632,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_cookieJar = _class.instanceMethodId( - r"cookieJar", - r"(Lokhttp3/CookieJar;)Lokhttp3/OkHttpClient$Builder;", + r'cookieJar', + r'(Lokhttp3/CookieJar;)Lokhttp3/OkHttpClient$Builder;', ); static final _cookieJar = ProtectedJniExtensions.lookup< @@ -4640,7 +4642,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -4656,8 +4658,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_cache = _class.instanceMethodId( - r"cache", - r"(Lokhttp3/Cache;)Lokhttp3/OkHttpClient$Builder;", + r'cache', + r'(Lokhttp3/Cache;)Lokhttp3/OkHttpClient$Builder;', ); static final _cache = ProtectedJniExtensions.lookup< @@ -4666,7 +4668,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -4682,8 +4684,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_dns = _class.instanceMethodId( - r"dns", - r"(Lokhttp3/Dns;)Lokhttp3/OkHttpClient$Builder;", + r'dns', + r'(Lokhttp3/Dns;)Lokhttp3/OkHttpClient$Builder;', ); static final _dns = ProtectedJniExtensions.lookup< @@ -4692,7 +4694,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -4708,8 +4710,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_proxy = _class.instanceMethodId( - r"proxy", - r"(Ljava/net/Proxy;)Lokhttp3/OkHttpClient$Builder;", + r'proxy', + r'(Ljava/net/Proxy;)Lokhttp3/OkHttpClient$Builder;', ); static final _proxy = ProtectedJniExtensions.lookup< @@ -4718,7 +4720,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -4734,8 +4736,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_proxySelector = _class.instanceMethodId( - r"proxySelector", - r"(Ljava/net/ProxySelector;)Lokhttp3/OkHttpClient$Builder;", + r'proxySelector', + r'(Ljava/net/ProxySelector;)Lokhttp3/OkHttpClient$Builder;', ); static final _proxySelector = ProtectedJniExtensions.lookup< @@ -4744,7 +4746,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -4762,8 +4764,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_proxyAuthenticator = _class.instanceMethodId( - r"proxyAuthenticator", - r"(Lokhttp3/Authenticator;)Lokhttp3/OkHttpClient$Builder;", + r'proxyAuthenticator', + r'(Lokhttp3/Authenticator;)Lokhttp3/OkHttpClient$Builder;', ); static final _proxyAuthenticator = ProtectedJniExtensions.lookup< @@ -4772,7 +4774,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -4790,8 +4792,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_socketFactory = _class.instanceMethodId( - r"socketFactory", - r"(Ljavax/net/SocketFactory;)Lokhttp3/OkHttpClient$Builder;", + r'socketFactory', + r'(Ljavax/net/SocketFactory;)Lokhttp3/OkHttpClient$Builder;', ); static final _socketFactory = ProtectedJniExtensions.lookup< @@ -4800,7 +4802,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -4818,8 +4820,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_sslSocketFactory = _class.instanceMethodId( - r"sslSocketFactory", - r"(Ljavax/net/ssl/SSLSocketFactory;)Lokhttp3/OkHttpClient$Builder;", + r'sslSocketFactory', + r'(Ljavax/net/ssl/SSLSocketFactory;)Lokhttp3/OkHttpClient$Builder;', ); static final _sslSocketFactory = ProtectedJniExtensions.lookup< @@ -4828,7 +4830,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -4846,8 +4848,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_sslSocketFactory1 = _class.instanceMethodId( - r"sslSocketFactory", - r"(Ljavax/net/ssl/SSLSocketFactory;Ljavax/net/ssl/X509TrustManager;)Lokhttp3/OkHttpClient$Builder;", + r'sslSocketFactory', + r'(Ljavax/net/ssl/SSLSocketFactory;Ljavax/net/ssl/X509TrustManager;)Lokhttp3/OkHttpClient$Builder;', ); static final _sslSocketFactory1 = ProtectedJniExtensions.lookup< @@ -4859,7 +4861,7 @@ class OkHttpClient_Builder extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -4879,8 +4881,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_connectionSpecs = _class.instanceMethodId( - r"connectionSpecs", - r"(Ljava/util/List;)Lokhttp3/OkHttpClient$Builder;", + r'connectionSpecs', + r'(Ljava/util/List;)Lokhttp3/OkHttpClient$Builder;', ); static final _connectionSpecs = ProtectedJniExtensions.lookup< @@ -4889,7 +4891,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -4905,8 +4907,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_protocols = _class.instanceMethodId( - r"protocols", - r"(Ljava/util/List;)Lokhttp3/OkHttpClient$Builder;", + r'protocols', + r'(Ljava/util/List;)Lokhttp3/OkHttpClient$Builder;', ); static final _protocols = ProtectedJniExtensions.lookup< @@ -4915,7 +4917,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -4931,8 +4933,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_hostnameVerifier = _class.instanceMethodId( - r"hostnameVerifier", - r"(Ljavax/net/ssl/HostnameVerifier;)Lokhttp3/OkHttpClient$Builder;", + r'hostnameVerifier', + r'(Ljavax/net/ssl/HostnameVerifier;)Lokhttp3/OkHttpClient$Builder;', ); static final _hostnameVerifier = ProtectedJniExtensions.lookup< @@ -4941,7 +4943,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -4959,8 +4961,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_certificatePinner = _class.instanceMethodId( - r"certificatePinner", - r"(Lokhttp3/CertificatePinner;)Lokhttp3/OkHttpClient$Builder;", + r'certificatePinner', + r'(Lokhttp3/CertificatePinner;)Lokhttp3/OkHttpClient$Builder;', ); static final _certificatePinner = ProtectedJniExtensions.lookup< @@ -4969,7 +4971,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -4987,8 +4989,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_callTimeout = _class.instanceMethodId( - r"callTimeout", - r"(JLjava/util/concurrent/TimeUnit;)Lokhttp3/OkHttpClient$Builder;", + r'callTimeout', + r'(JLjava/util/concurrent/TimeUnit;)Lokhttp3/OkHttpClient$Builder;', ); static final _callTimeout = ProtectedJniExtensions.lookup< @@ -4997,7 +4999,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Int64, ffi.Pointer)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, ffi.Pointer)>(); @@ -5014,8 +5016,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_callTimeout1 = _class.instanceMethodId( - r"callTimeout", - r"(Ljava/time/Duration;)Lokhttp3/OkHttpClient$Builder;", + r'callTimeout', + r'(Ljava/time/Duration;)Lokhttp3/OkHttpClient$Builder;', ); static final _callTimeout1 = ProtectedJniExtensions.lookup< @@ -5024,7 +5026,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -5040,8 +5042,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_connectTimeout = _class.instanceMethodId( - r"connectTimeout", - r"(JLjava/util/concurrent/TimeUnit;)Lokhttp3/OkHttpClient$Builder;", + r'connectTimeout', + r'(JLjava/util/concurrent/TimeUnit;)Lokhttp3/OkHttpClient$Builder;', ); static final _connectTimeout = ProtectedJniExtensions.lookup< @@ -5050,7 +5052,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Int64, ffi.Pointer)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, ffi.Pointer)>(); @@ -5070,8 +5072,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_connectTimeout1 = _class.instanceMethodId( - r"connectTimeout", - r"(Ljava/time/Duration;)Lokhttp3/OkHttpClient$Builder;", + r'connectTimeout', + r'(Ljava/time/Duration;)Lokhttp3/OkHttpClient$Builder;', ); static final _connectTimeout1 = ProtectedJniExtensions.lookup< @@ -5080,7 +5082,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -5096,8 +5098,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_readTimeout = _class.instanceMethodId( - r"readTimeout", - r"(JLjava/util/concurrent/TimeUnit;)Lokhttp3/OkHttpClient$Builder;", + r'readTimeout', + r'(JLjava/util/concurrent/TimeUnit;)Lokhttp3/OkHttpClient$Builder;', ); static final _readTimeout = ProtectedJniExtensions.lookup< @@ -5106,7 +5108,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Int64, ffi.Pointer)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, ffi.Pointer)>(); @@ -5123,8 +5125,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_readTimeout1 = _class.instanceMethodId( - r"readTimeout", - r"(Ljava/time/Duration;)Lokhttp3/OkHttpClient$Builder;", + r'readTimeout', + r'(Ljava/time/Duration;)Lokhttp3/OkHttpClient$Builder;', ); static final _readTimeout1 = ProtectedJniExtensions.lookup< @@ -5133,7 +5135,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -5149,8 +5151,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_writeTimeout = _class.instanceMethodId( - r"writeTimeout", - r"(JLjava/util/concurrent/TimeUnit;)Lokhttp3/OkHttpClient$Builder;", + r'writeTimeout', + r'(JLjava/util/concurrent/TimeUnit;)Lokhttp3/OkHttpClient$Builder;', ); static final _writeTimeout = ProtectedJniExtensions.lookup< @@ -5159,7 +5161,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Int64, ffi.Pointer)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, ffi.Pointer)>(); @@ -5176,8 +5178,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_writeTimeout1 = _class.instanceMethodId( - r"writeTimeout", - r"(Ljava/time/Duration;)Lokhttp3/OkHttpClient$Builder;", + r'writeTimeout', + r'(Ljava/time/Duration;)Lokhttp3/OkHttpClient$Builder;', ); static final _writeTimeout1 = ProtectedJniExtensions.lookup< @@ -5186,7 +5188,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -5202,8 +5204,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_pingInterval = _class.instanceMethodId( - r"pingInterval", - r"(JLjava/util/concurrent/TimeUnit;)Lokhttp3/OkHttpClient$Builder;", + r'pingInterval', + r'(JLjava/util/concurrent/TimeUnit;)Lokhttp3/OkHttpClient$Builder;', ); static final _pingInterval = ProtectedJniExtensions.lookup< @@ -5212,7 +5214,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Int64, ffi.Pointer)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, ffi.Pointer)>(); @@ -5229,8 +5231,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_pingInterval1 = _class.instanceMethodId( - r"pingInterval", - r"(Ljava/time/Duration;)Lokhttp3/OkHttpClient$Builder;", + r'pingInterval', + r'(Ljava/time/Duration;)Lokhttp3/OkHttpClient$Builder;', ); static final _pingInterval1 = ProtectedJniExtensions.lookup< @@ -5239,7 +5241,7 @@ class OkHttpClient_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -5255,14 +5257,14 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_minWebSocketMessageToCompress = _class.instanceMethodId( - r"minWebSocketMessageToCompress", - r"(J)Lokhttp3/OkHttpClient$Builder;", + r'minWebSocketMessageToCompress', + r'(J)Lokhttp3/OkHttpClient$Builder;', ); static final _minWebSocketMessageToCompress = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<(ffi.Int64,)>)>>("globalEnv_CallObjectMethod") + ffi.VarArgs<(ffi.Int64,)>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, int)>(); @@ -5278,8 +5280,8 @@ class OkHttpClient_Builder extends jni.JObject { } static final _id_build = _class.instanceMethodId( - r"build", - r"()Lokhttp3/OkHttpClient;", + r'build', + r'()Lokhttp3/OkHttpClient;', ); static final _build = ProtectedJniExtensions.lookup< @@ -5287,7 +5289,7 @@ class OkHttpClient_Builder extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -5307,7 +5309,7 @@ final class $OkHttpClient_BuilderType const $OkHttpClient_BuilderType(); @override - String get signature => r"Lokhttp3/OkHttpClient$Builder;"; + String get signature => r'Lokhttp3/OkHttpClient$Builder;'; @override OkHttpClient_Builder fromReference(jni.JReference reference) => @@ -5338,12 +5340,12 @@ class OkHttpClient_Companion extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/OkHttpClient$Companion"); + static final _class = jni.JClass.forName(r'okhttp3/OkHttpClient$Companion'); /// The type which includes information such as the signature of this class. static const type = $OkHttpClient_CompanionType(); static final _id_new0 = _class.constructorId( - r"(Lkotlin/jvm/internal/DefaultConstructorMarker;)V", + r'(Lkotlin/jvm/internal/DefaultConstructorMarker;)V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -5352,7 +5354,7 @@ class OkHttpClient_Companion extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_NewObject") + 'globalEnv_NewObject') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -5375,7 +5377,7 @@ final class $OkHttpClient_CompanionType const $OkHttpClient_CompanionType(); @override - String get signature => r"Lokhttp3/OkHttpClient$Companion;"; + String get signature => r'Lokhttp3/OkHttpClient$Companion;'; @override OkHttpClient_Companion fromReference(jni.JReference reference) => @@ -5406,13 +5408,13 @@ class OkHttpClient extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/OkHttpClient"); + static final _class = jni.JClass.forName(r'okhttp3/OkHttpClient'); /// The type which includes information such as the signature of this class. static const type = $OkHttpClientType(); static final _id_Companion = _class.staticFieldId( - r"Companion", - r"Lokhttp3/OkHttpClient$Companion;", + r'Companion', + r'Lokhttp3/OkHttpClient$Companion;', ); /// from: static public final okhttp3.OkHttpClient$Companion Companion @@ -5421,7 +5423,7 @@ class OkHttpClient extends jni.JObject { _id_Companion.get(_class, const $OkHttpClient_CompanionType()); static final _id_new0 = _class.constructorId( - r"(Lokhttp3/OkHttpClient$Builder;)V", + r'(Lokhttp3/OkHttpClient$Builder;)V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -5430,7 +5432,7 @@ class OkHttpClient extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_NewObject") + 'globalEnv_NewObject') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -5446,8 +5448,8 @@ class OkHttpClient extends jni.JObject { } static final _id_dispatcher = _class.instanceMethodId( - r"dispatcher", - r"()Lokhttp3/Dispatcher;", + r'dispatcher', + r'()Lokhttp3/Dispatcher;', ); static final _dispatcher = ProtectedJniExtensions.lookup< @@ -5455,7 +5457,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -5470,8 +5472,8 @@ class OkHttpClient extends jni.JObject { } static final _id_connectionPool = _class.instanceMethodId( - r"connectionPool", - r"()Lokhttp3/ConnectionPool;", + r'connectionPool', + r'()Lokhttp3/ConnectionPool;', ); static final _connectionPool = ProtectedJniExtensions.lookup< @@ -5479,7 +5481,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -5495,8 +5497,8 @@ class OkHttpClient extends jni.JObject { } static final _id_interceptors = _class.instanceMethodId( - r"interceptors", - r"()Ljava/util/List;", + r'interceptors', + r'()Ljava/util/List;', ); static final _interceptors = ProtectedJniExtensions.lookup< @@ -5504,7 +5506,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -5520,8 +5522,8 @@ class OkHttpClient extends jni.JObject { } static final _id_networkInterceptors = _class.instanceMethodId( - r"networkInterceptors", - r"()Ljava/util/List;", + r'networkInterceptors', + r'()Ljava/util/List;', ); static final _networkInterceptors = ProtectedJniExtensions.lookup< @@ -5529,7 +5531,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -5545,8 +5547,8 @@ class OkHttpClient extends jni.JObject { } static final _id_eventListenerFactory = _class.instanceMethodId( - r"eventListenerFactory", - r"()Lokhttp3/EventListener$Factory;", + r'eventListenerFactory', + r'()Lokhttp3/EventListener$Factory;', ); static final _eventListenerFactory = ProtectedJniExtensions.lookup< @@ -5554,7 +5556,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -5570,8 +5572,8 @@ class OkHttpClient extends jni.JObject { } static final _id_retryOnConnectionFailure = _class.instanceMethodId( - r"retryOnConnectionFailure", - r"()Z", + r'retryOnConnectionFailure', + r'()Z', ); static final _retryOnConnectionFailure = ProtectedJniExtensions.lookup< @@ -5579,7 +5581,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallBooleanMethod") + )>>('globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -5594,8 +5596,8 @@ class OkHttpClient extends jni.JObject { } static final _id_authenticator = _class.instanceMethodId( - r"authenticator", - r"()Lokhttp3/Authenticator;", + r'authenticator', + r'()Lokhttp3/Authenticator;', ); static final _authenticator = ProtectedJniExtensions.lookup< @@ -5603,7 +5605,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -5619,8 +5621,8 @@ class OkHttpClient extends jni.JObject { } static final _id_followRedirects = _class.instanceMethodId( - r"followRedirects", - r"()Z", + r'followRedirects', + r'()Z', ); static final _followRedirects = ProtectedJniExtensions.lookup< @@ -5628,7 +5630,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallBooleanMethod") + )>>('globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -5643,8 +5645,8 @@ class OkHttpClient extends jni.JObject { } static final _id_followSslRedirects = _class.instanceMethodId( - r"followSslRedirects", - r"()Z", + r'followSslRedirects', + r'()Z', ); static final _followSslRedirects = ProtectedJniExtensions.lookup< @@ -5652,7 +5654,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallBooleanMethod") + )>>('globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -5667,8 +5669,8 @@ class OkHttpClient extends jni.JObject { } static final _id_cookieJar = _class.instanceMethodId( - r"cookieJar", - r"()Lokhttp3/CookieJar;", + r'cookieJar', + r'()Lokhttp3/CookieJar;', ); static final _cookieJar = ProtectedJniExtensions.lookup< @@ -5676,7 +5678,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -5691,8 +5693,8 @@ class OkHttpClient extends jni.JObject { } static final _id_cache = _class.instanceMethodId( - r"cache", - r"()Lokhttp3/Cache;", + r'cache', + r'()Lokhttp3/Cache;', ); static final _cache = ProtectedJniExtensions.lookup< @@ -5700,7 +5702,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -5715,8 +5717,8 @@ class OkHttpClient extends jni.JObject { } static final _id_dns = _class.instanceMethodId( - r"dns", - r"()Lokhttp3/Dns;", + r'dns', + r'()Lokhttp3/Dns;', ); static final _dns = ProtectedJniExtensions.lookup< @@ -5724,7 +5726,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -5739,8 +5741,8 @@ class OkHttpClient extends jni.JObject { } static final _id_proxy = _class.instanceMethodId( - r"proxy", - r"()Ljava/net/Proxy;", + r'proxy', + r'()Ljava/net/Proxy;', ); static final _proxy = ProtectedJniExtensions.lookup< @@ -5748,7 +5750,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -5763,8 +5765,8 @@ class OkHttpClient extends jni.JObject { } static final _id_proxySelector = _class.instanceMethodId( - r"proxySelector", - r"()Ljava/net/ProxySelector;", + r'proxySelector', + r'()Ljava/net/ProxySelector;', ); static final _proxySelector = ProtectedJniExtensions.lookup< @@ -5772,7 +5774,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -5788,8 +5790,8 @@ class OkHttpClient extends jni.JObject { } static final _id_proxyAuthenticator = _class.instanceMethodId( - r"proxyAuthenticator", - r"()Lokhttp3/Authenticator;", + r'proxyAuthenticator', + r'()Lokhttp3/Authenticator;', ); static final _proxyAuthenticator = ProtectedJniExtensions.lookup< @@ -5797,7 +5799,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -5813,8 +5815,8 @@ class OkHttpClient extends jni.JObject { } static final _id_socketFactory = _class.instanceMethodId( - r"socketFactory", - r"()Ljavax/net/SocketFactory;", + r'socketFactory', + r'()Ljavax/net/SocketFactory;', ); static final _socketFactory = ProtectedJniExtensions.lookup< @@ -5822,7 +5824,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -5838,8 +5840,8 @@ class OkHttpClient extends jni.JObject { } static final _id_sslSocketFactory = _class.instanceMethodId( - r"sslSocketFactory", - r"()Ljavax/net/ssl/SSLSocketFactory;", + r'sslSocketFactory', + r'()Ljavax/net/ssl/SSLSocketFactory;', ); static final _sslSocketFactory = ProtectedJniExtensions.lookup< @@ -5847,7 +5849,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -5863,8 +5865,8 @@ class OkHttpClient extends jni.JObject { } static final _id_x509TrustManager = _class.instanceMethodId( - r"x509TrustManager", - r"()Ljavax/net/ssl/X509TrustManager;", + r'x509TrustManager', + r'()Ljavax/net/ssl/X509TrustManager;', ); static final _x509TrustManager = ProtectedJniExtensions.lookup< @@ -5872,7 +5874,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -5888,8 +5890,8 @@ class OkHttpClient extends jni.JObject { } static final _id_connectionSpecs = _class.instanceMethodId( - r"connectionSpecs", - r"()Ljava/util/List;", + r'connectionSpecs', + r'()Ljava/util/List;', ); static final _connectionSpecs = ProtectedJniExtensions.lookup< @@ -5897,7 +5899,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -5913,8 +5915,8 @@ class OkHttpClient extends jni.JObject { } static final _id_protocols = _class.instanceMethodId( - r"protocols", - r"()Ljava/util/List;", + r'protocols', + r'()Ljava/util/List;', ); static final _protocols = ProtectedJniExtensions.lookup< @@ -5922,7 +5924,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -5937,8 +5939,8 @@ class OkHttpClient extends jni.JObject { } static final _id_hostnameVerifier = _class.instanceMethodId( - r"hostnameVerifier", - r"()Ljavax/net/ssl/HostnameVerifier;", + r'hostnameVerifier', + r'()Ljavax/net/ssl/HostnameVerifier;', ); static final _hostnameVerifier = ProtectedJniExtensions.lookup< @@ -5946,7 +5948,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -5962,8 +5964,8 @@ class OkHttpClient extends jni.JObject { } static final _id_certificatePinner = _class.instanceMethodId( - r"certificatePinner", - r"()Lokhttp3/CertificatePinner;", + r'certificatePinner', + r'()Lokhttp3/CertificatePinner;', ); static final _certificatePinner = ProtectedJniExtensions.lookup< @@ -5971,7 +5973,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -5987,8 +5989,8 @@ class OkHttpClient extends jni.JObject { } static final _id_certificateChainCleaner = _class.instanceMethodId( - r"certificateChainCleaner", - r"()Lokhttp3/internal/tls/CertificateChainCleaner;", + r'certificateChainCleaner', + r'()Lokhttp3/internal/tls/CertificateChainCleaner;', ); static final _certificateChainCleaner = ProtectedJniExtensions.lookup< @@ -5996,7 +5998,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -6012,8 +6014,8 @@ class OkHttpClient extends jni.JObject { } static final _id_callTimeoutMillis = _class.instanceMethodId( - r"callTimeoutMillis", - r"()I", + r'callTimeoutMillis', + r'()I', ); static final _callTimeoutMillis = ProtectedJniExtensions.lookup< @@ -6021,7 +6023,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallIntMethod") + )>>('globalEnv_CallIntMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -6036,8 +6038,8 @@ class OkHttpClient extends jni.JObject { } static final _id_connectTimeoutMillis = _class.instanceMethodId( - r"connectTimeoutMillis", - r"()I", + r'connectTimeoutMillis', + r'()I', ); static final _connectTimeoutMillis = ProtectedJniExtensions.lookup< @@ -6045,7 +6047,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallIntMethod") + )>>('globalEnv_CallIntMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -6060,8 +6062,8 @@ class OkHttpClient extends jni.JObject { } static final _id_readTimeoutMillis = _class.instanceMethodId( - r"readTimeoutMillis", - r"()I", + r'readTimeoutMillis', + r'()I', ); static final _readTimeoutMillis = ProtectedJniExtensions.lookup< @@ -6069,7 +6071,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallIntMethod") + )>>('globalEnv_CallIntMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -6084,8 +6086,8 @@ class OkHttpClient extends jni.JObject { } static final _id_writeTimeoutMillis = _class.instanceMethodId( - r"writeTimeoutMillis", - r"()I", + r'writeTimeoutMillis', + r'()I', ); static final _writeTimeoutMillis = ProtectedJniExtensions.lookup< @@ -6093,7 +6095,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallIntMethod") + )>>('globalEnv_CallIntMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -6108,8 +6110,8 @@ class OkHttpClient extends jni.JObject { } static final _id_pingIntervalMillis = _class.instanceMethodId( - r"pingIntervalMillis", - r"()I", + r'pingIntervalMillis', + r'()I', ); static final _pingIntervalMillis = ProtectedJniExtensions.lookup< @@ -6117,7 +6119,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallIntMethod") + )>>('globalEnv_CallIntMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -6132,8 +6134,8 @@ class OkHttpClient extends jni.JObject { } static final _id_minWebSocketMessageToCompress = _class.instanceMethodId( - r"minWebSocketMessageToCompress", - r"()J", + r'minWebSocketMessageToCompress', + r'()J', ); static final _minWebSocketMessageToCompress = ProtectedJniExtensions.lookup< @@ -6141,7 +6143,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallLongMethod") + )>>('globalEnv_CallLongMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -6156,8 +6158,8 @@ class OkHttpClient extends jni.JObject { } static final _id_getRouteDatabase = _class.instanceMethodId( - r"getRouteDatabase", - r"()Lokhttp3/internal/connection/RouteDatabase;", + r'getRouteDatabase', + r'()Lokhttp3/internal/connection/RouteDatabase;', ); static final _getRouteDatabase = ProtectedJniExtensions.lookup< @@ -6165,7 +6167,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -6181,7 +6183,7 @@ class OkHttpClient extends jni.JObject { } static final _id_new1 = _class.constructorId( - r"()V", + r'()V', ); static final _new1 = ProtectedJniExtensions.lookup< @@ -6189,7 +6191,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_NewObject") + )>>('globalEnv_NewObject') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -6205,8 +6207,8 @@ class OkHttpClient extends jni.JObject { } static final _id_newCall = _class.instanceMethodId( - r"newCall", - r"(Lokhttp3/Request;)Lokhttp3/Call;", + r'newCall', + r'(Lokhttp3/Request;)Lokhttp3/Call;', ); static final _newCall = ProtectedJniExtensions.lookup< @@ -6215,7 +6217,7 @@ class OkHttpClient extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -6231,8 +6233,8 @@ class OkHttpClient extends jni.JObject { } static final _id_newWebSocket = _class.instanceMethodId( - r"newWebSocket", - r"(Lokhttp3/Request;Lokhttp3/WebSocketListener;)Lokhttp3/WebSocket;", + r'newWebSocket', + r'(Lokhttp3/Request;Lokhttp3/WebSocketListener;)Lokhttp3/WebSocket;', ); static final _newWebSocket = ProtectedJniExtensions.lookup< @@ -6244,7 +6246,7 @@ class OkHttpClient extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -6264,8 +6266,8 @@ class OkHttpClient extends jni.JObject { } static final _id_newBuilder = _class.instanceMethodId( - r"newBuilder", - r"()Lokhttp3/OkHttpClient$Builder;", + r'newBuilder', + r'()Lokhttp3/OkHttpClient$Builder;', ); static final _newBuilder = ProtectedJniExtensions.lookup< @@ -6273,7 +6275,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -6288,8 +6290,8 @@ class OkHttpClient extends jni.JObject { } static final _id_clone = _class.instanceMethodId( - r"clone", - r"()Ljava/lang/Object;", + r'clone', + r'()Ljava/lang/Object;', ); static final _clone = ProtectedJniExtensions.lookup< @@ -6297,7 +6299,7 @@ class OkHttpClient extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -6316,7 +6318,7 @@ final class $OkHttpClientType extends jni.JObjType { const $OkHttpClientType(); @override - String get signature => r"Lokhttp3/OkHttpClient;"; + String get signature => r'Lokhttp3/OkHttpClient;'; @override OkHttpClient fromReference(jni.JReference reference) => @@ -6347,13 +6349,13 @@ class Call_Factory extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/Call$Factory"); + static final _class = jni.JClass.forName(r'okhttp3/Call$Factory'); /// The type which includes information such as the signature of this class. static const type = $Call_FactoryType(); static final _id_newCall = _class.instanceMethodId( - r"newCall", - r"(Lokhttp3/Request;)Lokhttp3/Call;", + r'newCall', + r'(Lokhttp3/Request;)Lokhttp3/Call;', ); static final _newCall = ProtectedJniExtensions.lookup< @@ -6362,7 +6364,7 @@ class Call_Factory extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -6409,7 +6411,7 @@ class Call_Factory extends jni.JObject { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; - if ($d == r"newCall(Lokhttp3/Request;)Lokhttp3/Call;") { + if ($d == r'newCall(Lokhttp3/Request;)Lokhttp3/Call;') { final $r = _$impls[$p]!.newCall( $a[0].castTo(const $RequestType(), releaseOriginal: true), ); @@ -6430,7 +6432,7 @@ class Call_Factory extends jni.JObject { final $p = ReceivePort(); final $x = Call_Factory.fromReference( ProtectedJniExtensions.newPortProxy( - r"okhttp3.Call$Factory", + r'okhttp3.Call$Factory', $p, _$invokePointer, ), @@ -6475,7 +6477,7 @@ final class $Call_FactoryType extends jni.JObjType { const $Call_FactoryType(); @override - String get signature => r"Lokhttp3/Call$Factory;"; + String get signature => r'Lokhttp3/Call$Factory;'; @override Call_Factory fromReference(jni.JReference reference) => @@ -6506,13 +6508,13 @@ class Call extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/Call"); + static final _class = jni.JClass.forName(r'okhttp3/Call'); /// The type which includes information such as the signature of this class. static const type = $CallType(); static final _id_request = _class.instanceMethodId( - r"request", - r"()Lokhttp3/Request;", + r'request', + r'()Lokhttp3/Request;', ); static final _request = ProtectedJniExtensions.lookup< @@ -6520,7 +6522,7 @@ class Call extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -6535,8 +6537,8 @@ class Call extends jni.JObject { } static final _id_execute = _class.instanceMethodId( - r"execute", - r"()Lokhttp3/Response;", + r'execute', + r'()Lokhttp3/Response;', ); static final _execute = ProtectedJniExtensions.lookup< @@ -6544,7 +6546,7 @@ class Call extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -6559,8 +6561,8 @@ class Call extends jni.JObject { } static final _id_enqueue = _class.instanceMethodId( - r"enqueue", - r"(Lokhttp3/Callback;)V", + r'enqueue', + r'(Lokhttp3/Callback;)V', ); static final _enqueue = ProtectedJniExtensions.lookup< @@ -6569,7 +6571,7 @@ class Call extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallVoidMethod") + 'globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -6584,8 +6586,8 @@ class Call extends jni.JObject { } static final _id_cancel = _class.instanceMethodId( - r"cancel", - r"()V", + r'cancel', + r'()V', ); static final _cancel = ProtectedJniExtensions.lookup< @@ -6593,7 +6595,7 @@ class Call extends jni.JObject { jni.JThrowablePtr Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallVoidMethod") + )>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function( ffi.Pointer, @@ -6606,8 +6608,8 @@ class Call extends jni.JObject { } static final _id_isExecuted = _class.instanceMethodId( - r"isExecuted", - r"()Z", + r'isExecuted', + r'()Z', ); static final _isExecuted = ProtectedJniExtensions.lookup< @@ -6615,7 +6617,7 @@ class Call extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallBooleanMethod") + )>>('globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -6629,8 +6631,8 @@ class Call extends jni.JObject { } static final _id_isCanceled = _class.instanceMethodId( - r"isCanceled", - r"()Z", + r'isCanceled', + r'()Z', ); static final _isCanceled = ProtectedJniExtensions.lookup< @@ -6638,7 +6640,7 @@ class Call extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallBooleanMethod") + )>>('globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -6652,8 +6654,8 @@ class Call extends jni.JObject { } static final _id_timeout = _class.instanceMethodId( - r"timeout", - r"()Lokio/Timeout;", + r'timeout', + r'()Lokio/Timeout;', ); static final _timeout = ProtectedJniExtensions.lookup< @@ -6661,7 +6663,7 @@ class Call extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -6676,8 +6678,8 @@ class Call extends jni.JObject { } static final _id_clone = _class.instanceMethodId( - r"clone", - r"()Lokhttp3/Call;", + r'clone', + r'()Lokhttp3/Call;', ); static final _clone = ProtectedJniExtensions.lookup< @@ -6685,7 +6687,7 @@ class Call extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -6731,46 +6733,46 @@ class Call extends jni.JObject { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; - if ($d == r"request()Lokhttp3/Request;") { + if ($d == r'request()Lokhttp3/Request;') { final $r = _$impls[$p]!.request(); return ($r as jni.JObject) .castTo(const jni.JObjectType()) .reference .toPointer(); } - if ($d == r"execute()Lokhttp3/Response;") { + if ($d == r'execute()Lokhttp3/Response;') { final $r = _$impls[$p]!.execute(); return ($r as jni.JObject) .castTo(const jni.JObjectType()) .reference .toPointer(); } - if ($d == r"enqueue(Lokhttp3/Callback;)V") { + if ($d == r'enqueue(Lokhttp3/Callback;)V') { _$impls[$p]!.enqueue( $a[0].castTo(const $CallbackType(), releaseOriginal: true), ); return jni.nullptr; } - if ($d == r"cancel()V") { + if ($d == r'cancel()V') { _$impls[$p]!.cancel(); return jni.nullptr; } - if ($d == r"isExecuted()Z") { + if ($d == r'isExecuted()Z') { final $r = _$impls[$p]!.isExecuted(); return jni.JBoolean($r).reference.toPointer(); } - if ($d == r"isCanceled()Z") { + if ($d == r'isCanceled()Z') { final $r = _$impls[$p]!.isCanceled(); return jni.JBoolean($r).reference.toPointer(); } - if ($d == r"timeout()Lokio/Timeout;") { + if ($d == r'timeout()Lokio/Timeout;') { final $r = _$impls[$p]!.timeout(); return ($r as jni.JObject) .castTo(const jni.JObjectType()) .reference .toPointer(); } - if ($d == r"clone()Lokhttp3/Call;") { + if ($d == r'clone()Lokhttp3/Call;') { final $r = _$impls[$p]!.clone(); return ($r as jni.JObject) .castTo(const jni.JObjectType()) @@ -6789,7 +6791,7 @@ class Call extends jni.JObject { final $p = ReceivePort(); final $x = Call.fromReference( ProtectedJniExtensions.newPortProxy( - r"okhttp3.Call", + r'okhttp3.Call', $p, _$invokePointer, ), @@ -6897,7 +6899,7 @@ final class $CallType extends jni.JObjType { const $CallType(); @override - String get signature => r"Lokhttp3/Call;"; + String get signature => r'Lokhttp3/Call;'; @override Call fromReference(jni.JReference reference) => Call.fromReference(reference); @@ -6926,12 +6928,12 @@ class Headers_Builder extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/Headers$Builder"); + static final _class = jni.JClass.forName(r'okhttp3/Headers$Builder'); /// The type which includes information such as the signature of this class. static const type = $Headers_BuilderType(); static final _id_new0 = _class.constructorId( - r"()V", + r'()V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -6939,7 +6941,7 @@ class Headers_Builder extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_NewObject") + )>>('globalEnv_NewObject') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -6955,8 +6957,8 @@ class Headers_Builder extends jni.JObject { } static final _id_add = _class.instanceMethodId( - r"add", - r"(Ljava/lang/String;)Lokhttp3/Headers$Builder;", + r'add', + r'(Ljava/lang/String;)Lokhttp3/Headers$Builder;', ); static final _add = ProtectedJniExtensions.lookup< @@ -6965,7 +6967,7 @@ class Headers_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -6981,8 +6983,8 @@ class Headers_Builder extends jni.JObject { } static final _id_add1 = _class.instanceMethodId( - r"add", - r"(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Headers$Builder;", + r'add', + r'(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Headers$Builder;', ); static final _add1 = ProtectedJniExtensions.lookup< @@ -6994,7 +6996,7 @@ class Headers_Builder extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -7011,8 +7013,8 @@ class Headers_Builder extends jni.JObject { } static final _id_addUnsafeNonAscii = _class.instanceMethodId( - r"addUnsafeNonAscii", - r"(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Headers$Builder;", + r'addUnsafeNonAscii', + r'(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Headers$Builder;', ); static final _addUnsafeNonAscii = ProtectedJniExtensions.lookup< @@ -7024,7 +7026,7 @@ class Headers_Builder extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -7044,8 +7046,8 @@ class Headers_Builder extends jni.JObject { } static final _id_addAll = _class.instanceMethodId( - r"addAll", - r"(Lokhttp3/Headers;)Lokhttp3/Headers$Builder;", + r'addAll', + r'(Lokhttp3/Headers;)Lokhttp3/Headers$Builder;', ); static final _addAll = ProtectedJniExtensions.lookup< @@ -7054,7 +7056,7 @@ class Headers_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -7070,8 +7072,8 @@ class Headers_Builder extends jni.JObject { } static final _id_add2 = _class.instanceMethodId( - r"add", - r"(Ljava/lang/String;Ljava/util/Date;)Lokhttp3/Headers$Builder;", + r'add', + r'(Ljava/lang/String;Ljava/util/Date;)Lokhttp3/Headers$Builder;', ); static final _add2 = ProtectedJniExtensions.lookup< @@ -7083,7 +7085,7 @@ class Headers_Builder extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -7100,8 +7102,8 @@ class Headers_Builder extends jni.JObject { } static final _id_add3 = _class.instanceMethodId( - r"add", - r"(Ljava/lang/String;Ljava/time/Instant;)Lokhttp3/Headers$Builder;", + r'add', + r'(Ljava/lang/String;Ljava/time/Instant;)Lokhttp3/Headers$Builder;', ); static final _add3 = ProtectedJniExtensions.lookup< @@ -7113,7 +7115,7 @@ class Headers_Builder extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -7130,8 +7132,8 @@ class Headers_Builder extends jni.JObject { } static final _id_set0 = _class.instanceMethodId( - r"set", - r"(Ljava/lang/String;Ljava/util/Date;)Lokhttp3/Headers$Builder;", + r'set', + r'(Ljava/lang/String;Ljava/util/Date;)Lokhttp3/Headers$Builder;', ); static final _set0 = ProtectedJniExtensions.lookup< @@ -7143,7 +7145,7 @@ class Headers_Builder extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -7160,8 +7162,8 @@ class Headers_Builder extends jni.JObject { } static final _id_set1 = _class.instanceMethodId( - r"set", - r"(Ljava/lang/String;Ljava/time/Instant;)Lokhttp3/Headers$Builder;", + r'set', + r'(Ljava/lang/String;Ljava/time/Instant;)Lokhttp3/Headers$Builder;', ); static final _set1 = ProtectedJniExtensions.lookup< @@ -7173,7 +7175,7 @@ class Headers_Builder extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -7190,8 +7192,8 @@ class Headers_Builder extends jni.JObject { } static final _id_removeAll = _class.instanceMethodId( - r"removeAll", - r"(Ljava/lang/String;)Lokhttp3/Headers$Builder;", + r'removeAll', + r'(Ljava/lang/String;)Lokhttp3/Headers$Builder;', ); static final _removeAll = ProtectedJniExtensions.lookup< @@ -7200,7 +7202,7 @@ class Headers_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -7216,8 +7218,8 @@ class Headers_Builder extends jni.JObject { } static final _id_set2 = _class.instanceMethodId( - r"set", - r"(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Headers$Builder;", + r'set', + r'(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Headers$Builder;', ); static final _set2 = ProtectedJniExtensions.lookup< @@ -7229,7 +7231,7 @@ class Headers_Builder extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -7246,8 +7248,8 @@ class Headers_Builder extends jni.JObject { } static final _id_get0 = _class.instanceMethodId( - r"get", - r"(Ljava/lang/String;)Ljava/lang/String;", + r'get', + r'(Ljava/lang/String;)Ljava/lang/String;', ); static final _get0 = ProtectedJniExtensions.lookup< @@ -7256,7 +7258,7 @@ class Headers_Builder extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -7272,8 +7274,8 @@ class Headers_Builder extends jni.JObject { } static final _id_build = _class.instanceMethodId( - r"build", - r"()Lokhttp3/Headers;", + r'build', + r'()Lokhttp3/Headers;', ); static final _build = ProtectedJniExtensions.lookup< @@ -7281,7 +7283,7 @@ class Headers_Builder extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -7300,7 +7302,7 @@ final class $Headers_BuilderType extends jni.JObjType { const $Headers_BuilderType(); @override - String get signature => r"Lokhttp3/Headers$Builder;"; + String get signature => r'Lokhttp3/Headers$Builder;'; @override Headers_Builder fromReference(jni.JReference reference) => @@ -7331,13 +7333,13 @@ class Headers_Companion extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/Headers$Companion"); + static final _class = jni.JClass.forName(r'okhttp3/Headers$Companion'); /// The type which includes information such as the signature of this class. static const type = $Headers_CompanionType(); static final _id_of = _class.instanceMethodId( - r"of", - r"([Ljava/lang/String;)Lokhttp3/Headers;", + r'of', + r'([Ljava/lang/String;)Lokhttp3/Headers;', ); static final _of = ProtectedJniExtensions.lookup< @@ -7346,7 +7348,7 @@ class Headers_Companion extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -7362,8 +7364,8 @@ class Headers_Companion extends jni.JObject { } static final _id_of1 = _class.instanceMethodId( - r"of", - r"(Ljava/util/Map;)Lokhttp3/Headers;", + r'of', + r'(Ljava/util/Map;)Lokhttp3/Headers;', ); static final _of1 = ProtectedJniExtensions.lookup< @@ -7372,7 +7374,7 @@ class Headers_Companion extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -7388,7 +7390,7 @@ class Headers_Companion extends jni.JObject { } static final _id_new0 = _class.constructorId( - r"(Lkotlin/jvm/internal/DefaultConstructorMarker;)V", + r'(Lkotlin/jvm/internal/DefaultConstructorMarker;)V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -7397,7 +7399,7 @@ class Headers_Companion extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_NewObject") + 'globalEnv_NewObject') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -7419,7 +7421,7 @@ final class $Headers_CompanionType extends jni.JObjType { const $Headers_CompanionType(); @override - String get signature => r"Lokhttp3/Headers$Companion;"; + String get signature => r'Lokhttp3/Headers$Companion;'; @override Headers_Companion fromReference(jni.JReference reference) => @@ -7450,13 +7452,13 @@ class Headers extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/Headers"); + static final _class = jni.JClass.forName(r'okhttp3/Headers'); /// The type which includes information such as the signature of this class. static const type = $HeadersType(); static final _id_Companion = _class.staticFieldId( - r"Companion", - r"Lokhttp3/Headers$Companion;", + r'Companion', + r'Lokhttp3/Headers$Companion;', ); /// from: static public final okhttp3.Headers$Companion Companion @@ -7465,8 +7467,8 @@ class Headers extends jni.JObject { _id_Companion.get(_class, const $Headers_CompanionType()); static final _id_get0 = _class.instanceMethodId( - r"get", - r"(Ljava/lang/String;)Ljava/lang/String;", + r'get', + r'(Ljava/lang/String;)Ljava/lang/String;', ); static final _get0 = ProtectedJniExtensions.lookup< @@ -7475,7 +7477,7 @@ class Headers extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -7491,8 +7493,8 @@ class Headers extends jni.JObject { } static final _id_getDate = _class.instanceMethodId( - r"getDate", - r"(Ljava/lang/String;)Ljava/util/Date;", + r'getDate', + r'(Ljava/lang/String;)Ljava/util/Date;', ); static final _getDate = ProtectedJniExtensions.lookup< @@ -7501,7 +7503,7 @@ class Headers extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -7517,8 +7519,8 @@ class Headers extends jni.JObject { } static final _id_getInstant = _class.instanceMethodId( - r"getInstant", - r"(Ljava/lang/String;)Ljava/time/Instant;", + r'getInstant', + r'(Ljava/lang/String;)Ljava/time/Instant;', ); static final _getInstant = ProtectedJniExtensions.lookup< @@ -7527,7 +7529,7 @@ class Headers extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -7543,8 +7545,8 @@ class Headers extends jni.JObject { } static final _id_size = _class.instanceMethodId( - r"size", - r"()I", + r'size', + r'()I', ); static final _size = ProtectedJniExtensions.lookup< @@ -7552,7 +7554,7 @@ class Headers extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallIntMethod") + )>>('globalEnv_CallIntMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -7565,14 +7567,14 @@ class Headers extends jni.JObject { } static final _id_name = _class.instanceMethodId( - r"name", - r"(I)Ljava/lang/String;", + r'name', + r'(I)Ljava/lang/String;', ); static final _name = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>("globalEnv_CallObjectMethod") + ffi.VarArgs<($Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, int)>(); @@ -7587,14 +7589,14 @@ class Headers extends jni.JObject { } static final _id_value = _class.instanceMethodId( - r"value", - r"(I)Ljava/lang/String;", + r'value', + r'(I)Ljava/lang/String;', ); static final _value = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>("globalEnv_CallObjectMethod") + ffi.VarArgs<($Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, int)>(); @@ -7609,8 +7611,8 @@ class Headers extends jni.JObject { } static final _id_names = _class.instanceMethodId( - r"names", - r"()Ljava/util/Set;", + r'names', + r'()Ljava/util/Set;', ); static final _names = ProtectedJniExtensions.lookup< @@ -7618,7 +7620,7 @@ class Headers extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -7633,8 +7635,8 @@ class Headers extends jni.JObject { } static final _id_values = _class.instanceMethodId( - r"values", - r"(Ljava/lang/String;)Ljava/util/List;", + r'values', + r'(Ljava/lang/String;)Ljava/util/List;', ); static final _values = ProtectedJniExtensions.lookup< @@ -7643,7 +7645,7 @@ class Headers extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -7659,8 +7661,8 @@ class Headers extends jni.JObject { } static final _id_byteCount = _class.instanceMethodId( - r"byteCount", - r"()J", + r'byteCount', + r'()J', ); static final _byteCount = ProtectedJniExtensions.lookup< @@ -7668,7 +7670,7 @@ class Headers extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallLongMethod") + )>>('globalEnv_CallLongMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -7682,8 +7684,8 @@ class Headers extends jni.JObject { } static final _id_iterator = _class.instanceMethodId( - r"iterator", - r"()Ljava/util/Iterator;", + r'iterator', + r'()Ljava/util/Iterator;', ); static final _iterator = ProtectedJniExtensions.lookup< @@ -7691,7 +7693,7 @@ class Headers extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -7706,8 +7708,8 @@ class Headers extends jni.JObject { } static final _id_newBuilder = _class.instanceMethodId( - r"newBuilder", - r"()Lokhttp3/Headers$Builder;", + r'newBuilder', + r'()Lokhttp3/Headers$Builder;', ); static final _newBuilder = ProtectedJniExtensions.lookup< @@ -7715,7 +7717,7 @@ class Headers extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -7730,8 +7732,8 @@ class Headers extends jni.JObject { } static final _id_equals = _class.instanceMethodId( - r"equals", - r"(Ljava/lang/Object;)Z", + r'equals', + r'(Ljava/lang/Object;)Z', ); static final _equals = ProtectedJniExtensions.lookup< @@ -7740,7 +7742,7 @@ class Headers extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallBooleanMethod") + 'globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -7755,8 +7757,8 @@ class Headers extends jni.JObject { } static final _id_hashCode1 = _class.instanceMethodId( - r"hashCode", - r"()I", + r'hashCode', + r'()I', ); static final _hashCode1 = ProtectedJniExtensions.lookup< @@ -7764,7 +7766,7 @@ class Headers extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallIntMethod") + )>>('globalEnv_CallIntMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -7778,8 +7780,8 @@ class Headers extends jni.JObject { } static final _id_toString1 = _class.instanceMethodId( - r"toString", - r"()Ljava/lang/String;", + r'toString', + r'()Ljava/lang/String;', ); static final _toString1 = ProtectedJniExtensions.lookup< @@ -7787,7 +7789,7 @@ class Headers extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -7802,8 +7804,8 @@ class Headers extends jni.JObject { } static final _id_toMultimap = _class.instanceMethodId( - r"toMultimap", - r"()Ljava/util/Map;", + r'toMultimap', + r'()Ljava/util/Map;', ); static final _toMultimap = ProtectedJniExtensions.lookup< @@ -7811,7 +7813,7 @@ class Headers extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -7827,8 +7829,8 @@ class Headers extends jni.JObject { } static final _id_of = _class.staticMethodId( - r"of", - r"([Ljava/lang/String;)Lokhttp3/Headers;", + r'of', + r'([Ljava/lang/String;)Lokhttp3/Headers;', ); static final _of = ProtectedJniExtensions.lookup< @@ -7837,7 +7839,7 @@ class Headers extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallStaticObjectMethod") + 'globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -7853,8 +7855,8 @@ class Headers extends jni.JObject { } static final _id_of1 = _class.staticMethodId( - r"of", - r"(Ljava/util/Map;)Lokhttp3/Headers;", + r'of', + r'(Ljava/util/Map;)Lokhttp3/Headers;', ); static final _of1 = ProtectedJniExtensions.lookup< @@ -7863,7 +7865,7 @@ class Headers extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallStaticObjectMethod") + 'globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -7879,7 +7881,7 @@ class Headers extends jni.JObject { } static final _id_new0 = _class.constructorId( - r"([Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V", + r'([Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -7891,7 +7893,7 @@ class Headers extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_NewObject") + )>)>>('globalEnv_NewObject') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -7915,7 +7917,7 @@ final class $HeadersType extends jni.JObjType { const $HeadersType(); @override - String get signature => r"Lokhttp3/Headers;"; + String get signature => r'Lokhttp3/Headers;'; @override Headers fromReference(jni.JReference reference) => @@ -7945,13 +7947,13 @@ class Callback extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/Callback"); + static final _class = jni.JClass.forName(r'okhttp3/Callback'); /// The type which includes information such as the signature of this class. static const type = $CallbackType(); static final _id_onFailure = _class.instanceMethodId( - r"onFailure", - r"(Lokhttp3/Call;Ljava/io/IOException;)V", + r'onFailure', + r'(Lokhttp3/Call;Ljava/io/IOException;)V', ); static final _onFailure = ProtectedJniExtensions.lookup< @@ -7963,7 +7965,7 @@ class Callback extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallVoidMethod") + )>)>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -7979,8 +7981,8 @@ class Callback extends jni.JObject { } static final _id_onResponse = _class.instanceMethodId( - r"onResponse", - r"(Lokhttp3/Call;Lokhttp3/Response;)V", + r'onResponse', + r'(Lokhttp3/Call;Lokhttp3/Response;)V', ); static final _onResponse = ProtectedJniExtensions.lookup< @@ -7992,7 +7994,7 @@ class Callback extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallVoidMethod") + )>)>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -8039,14 +8041,14 @@ class Callback extends jni.JObject { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; - if ($d == r"onFailure(Lokhttp3/Call;Ljava/io/IOException;)V") { + if ($d == r'onFailure(Lokhttp3/Call;Ljava/io/IOException;)V') { _$impls[$p]!.onFailure( $a[0].castTo(const $CallType(), releaseOriginal: true), $a[1].castTo(const jni.JObjectType(), releaseOriginal: true), ); return jni.nullptr; } - if ($d == r"onResponse(Lokhttp3/Call;Lokhttp3/Response;)V") { + if ($d == r'onResponse(Lokhttp3/Call;Lokhttp3/Response;)V') { _$impls[$p]!.onResponse( $a[0].castTo(const $CallType(), releaseOriginal: true), $a[1].castTo(const $ResponseType(), releaseOriginal: true), @@ -8065,7 +8067,7 @@ class Callback extends jni.JObject { final $p = ReceivePort(); final $x = Callback.fromReference( ProtectedJniExtensions.newPortProxy( - r"okhttp3.Callback", + r'okhttp3.Callback', $p, _$invokePointer, ), @@ -8119,7 +8121,7 @@ final class $CallbackType extends jni.JObjType { const $CallbackType(); @override - String get signature => r"Lokhttp3/Callback;"; + String get signature => r'Lokhttp3/Callback;'; @override Callback fromReference(jni.JReference reference) => @@ -8149,12 +8151,12 @@ class ConnectionPool extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/ConnectionPool"); + static final _class = jni.JClass.forName(r'okhttp3/ConnectionPool'); /// The type which includes information such as the signature of this class. static const type = $ConnectionPoolType(); static final _id_new0 = _class.constructorId( - r"(Lokhttp3/internal/connection/RealConnectionPool;)V", + r'(Lokhttp3/internal/connection/RealConnectionPool;)V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -8163,7 +8165,7 @@ class ConnectionPool extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_NewObject") + 'globalEnv_NewObject') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -8179,7 +8181,7 @@ class ConnectionPool extends jni.JObject { } static final _id_new1 = _class.constructorId( - r"(IJLjava/util/concurrent/TimeUnit;)V", + r'(IJLjava/util/concurrent/TimeUnit;)V', ); static final _new1 = ProtectedJniExtensions.lookup< @@ -8192,7 +8194,7 @@ class ConnectionPool extends jni.JObject { $Int32, ffi.Int64, ffi.Pointer - )>)>>("globalEnv_NewObject") + )>)>>('globalEnv_NewObject') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, int, ffi.Pointer)>(); @@ -8210,7 +8212,7 @@ class ConnectionPool extends jni.JObject { } static final _id_new2 = _class.constructorId( - r"()V", + r'()V', ); static final _new2 = ProtectedJniExtensions.lookup< @@ -8218,7 +8220,7 @@ class ConnectionPool extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_NewObject") + )>>('globalEnv_NewObject') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -8234,8 +8236,8 @@ class ConnectionPool extends jni.JObject { } static final _id_idleConnectionCount = _class.instanceMethodId( - r"idleConnectionCount", - r"()I", + r'idleConnectionCount', + r'()I', ); static final _idleConnectionCount = ProtectedJniExtensions.lookup< @@ -8243,7 +8245,7 @@ class ConnectionPool extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallIntMethod") + )>>('globalEnv_CallIntMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -8258,8 +8260,8 @@ class ConnectionPool extends jni.JObject { } static final _id_connectionCount = _class.instanceMethodId( - r"connectionCount", - r"()I", + r'connectionCount', + r'()I', ); static final _connectionCount = ProtectedJniExtensions.lookup< @@ -8267,7 +8269,7 @@ class ConnectionPool extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallIntMethod") + )>>('globalEnv_CallIntMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -8282,8 +8284,8 @@ class ConnectionPool extends jni.JObject { } static final _id_evictAll = _class.instanceMethodId( - r"evictAll", - r"()V", + r'evictAll', + r'()V', ); static final _evictAll = ProtectedJniExtensions.lookup< @@ -8291,7 +8293,7 @@ class ConnectionPool extends jni.JObject { jni.JThrowablePtr Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallVoidMethod") + )>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function( ffi.Pointer, @@ -8308,7 +8310,7 @@ final class $ConnectionPoolType extends jni.JObjType { const $ConnectionPoolType(); @override - String get signature => r"Lokhttp3/ConnectionPool;"; + String get signature => r'Lokhttp3/ConnectionPool;'; @override ConnectionPool fromReference(jni.JReference reference) => @@ -8339,12 +8341,12 @@ class Dispatcher extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/Dispatcher"); + static final _class = jni.JClass.forName(r'okhttp3/Dispatcher'); /// The type which includes information such as the signature of this class. static const type = $DispatcherType(); static final _id_new0 = _class.constructorId( - r"()V", + r'()V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -8352,7 +8354,7 @@ class Dispatcher extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_NewObject") + )>>('globalEnv_NewObject') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -8368,8 +8370,8 @@ class Dispatcher extends jni.JObject { } static final _id_getMaxRequests = _class.instanceMethodId( - r"getMaxRequests", - r"()I", + r'getMaxRequests', + r'()I', ); static final _getMaxRequests = ProtectedJniExtensions.lookup< @@ -8377,7 +8379,7 @@ class Dispatcher extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallIntMethod") + )>>('globalEnv_CallIntMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -8392,8 +8394,8 @@ class Dispatcher extends jni.JObject { } static final _id_setMaxRequests = _class.instanceMethodId( - r"setMaxRequests", - r"(I)V", + r'setMaxRequests', + r'(I)V', ); static final _setMaxRequests = ProtectedJniExtensions.lookup< @@ -8401,7 +8403,7 @@ class Dispatcher extends jni.JObject { jni.JThrowablePtr Function( ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>("globalEnv_CallVoidMethod") + ffi.VarArgs<($Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function( ffi.Pointer, jni.JMethodIDPtr, int)>(); @@ -8416,8 +8418,8 @@ class Dispatcher extends jni.JObject { } static final _id_getMaxRequestsPerHost = _class.instanceMethodId( - r"getMaxRequestsPerHost", - r"()I", + r'getMaxRequestsPerHost', + r'()I', ); static final _getMaxRequestsPerHost = ProtectedJniExtensions.lookup< @@ -8425,7 +8427,7 @@ class Dispatcher extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallIntMethod") + )>>('globalEnv_CallIntMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -8440,8 +8442,8 @@ class Dispatcher extends jni.JObject { } static final _id_setMaxRequestsPerHost = _class.instanceMethodId( - r"setMaxRequestsPerHost", - r"(I)V", + r'setMaxRequestsPerHost', + r'(I)V', ); static final _setMaxRequestsPerHost = ProtectedJniExtensions.lookup< @@ -8449,7 +8451,7 @@ class Dispatcher extends jni.JObject { jni.JThrowablePtr Function( ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>("globalEnv_CallVoidMethod") + ffi.VarArgs<($Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function( ffi.Pointer, jni.JMethodIDPtr, int)>(); @@ -8464,8 +8466,8 @@ class Dispatcher extends jni.JObject { } static final _id_getIdleCallback = _class.instanceMethodId( - r"getIdleCallback", - r"()Ljava/lang/Runnable;", + r'getIdleCallback', + r'()Ljava/lang/Runnable;', ); static final _getIdleCallback = ProtectedJniExtensions.lookup< @@ -8473,7 +8475,7 @@ class Dispatcher extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -8489,8 +8491,8 @@ class Dispatcher extends jni.JObject { } static final _id_setIdleCallback = _class.instanceMethodId( - r"setIdleCallback", - r"(Ljava/lang/Runnable;)V", + r'setIdleCallback', + r'(Ljava/lang/Runnable;)V', ); static final _setIdleCallback = ProtectedJniExtensions.lookup< @@ -8499,7 +8501,7 @@ class Dispatcher extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallVoidMethod") + 'globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -8514,8 +8516,8 @@ class Dispatcher extends jni.JObject { } static final _id_executorService = _class.instanceMethodId( - r"executorService", - r"()Ljava/util/concurrent/ExecutorService;", + r'executorService', + r'()Ljava/util/concurrent/ExecutorService;', ); static final _executorService = ProtectedJniExtensions.lookup< @@ -8523,7 +8525,7 @@ class Dispatcher extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -8539,7 +8541,7 @@ class Dispatcher extends jni.JObject { } static final _id_new1 = _class.constructorId( - r"(Ljava/util/concurrent/ExecutorService;)V", + r'(Ljava/util/concurrent/ExecutorService;)V', ); static final _new1 = ProtectedJniExtensions.lookup< @@ -8548,7 +8550,7 @@ class Dispatcher extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_NewObject") + 'globalEnv_NewObject') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -8564,8 +8566,8 @@ class Dispatcher extends jni.JObject { } static final _id_cancelAll = _class.instanceMethodId( - r"cancelAll", - r"()V", + r'cancelAll', + r'()V', ); static final _cancelAll = ProtectedJniExtensions.lookup< @@ -8573,7 +8575,7 @@ class Dispatcher extends jni.JObject { jni.JThrowablePtr Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallVoidMethod") + )>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function( ffi.Pointer, @@ -8586,8 +8588,8 @@ class Dispatcher extends jni.JObject { } static final _id_queuedCalls = _class.instanceMethodId( - r"queuedCalls", - r"()Ljava/util/List;", + r'queuedCalls', + r'()Ljava/util/List;', ); static final _queuedCalls = ProtectedJniExtensions.lookup< @@ -8595,7 +8597,7 @@ class Dispatcher extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -8610,8 +8612,8 @@ class Dispatcher extends jni.JObject { } static final _id_runningCalls = _class.instanceMethodId( - r"runningCalls", - r"()Ljava/util/List;", + r'runningCalls', + r'()Ljava/util/List;', ); static final _runningCalls = ProtectedJniExtensions.lookup< @@ -8619,7 +8621,7 @@ class Dispatcher extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -8635,8 +8637,8 @@ class Dispatcher extends jni.JObject { } static final _id_queuedCallsCount = _class.instanceMethodId( - r"queuedCallsCount", - r"()I", + r'queuedCallsCount', + r'()I', ); static final _queuedCallsCount = ProtectedJniExtensions.lookup< @@ -8644,7 +8646,7 @@ class Dispatcher extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallIntMethod") + )>>('globalEnv_CallIntMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -8659,8 +8661,8 @@ class Dispatcher extends jni.JObject { } static final _id_runningCallsCount = _class.instanceMethodId( - r"runningCallsCount", - r"()I", + r'runningCallsCount', + r'()I', ); static final _runningCallsCount = ProtectedJniExtensions.lookup< @@ -8668,7 +8670,7 @@ class Dispatcher extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallIntMethod") + )>>('globalEnv_CallIntMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -8687,7 +8689,7 @@ final class $DispatcherType extends jni.JObjType { const $DispatcherType(); @override - String get signature => r"Lokhttp3/Dispatcher;"; + String get signature => r'Lokhttp3/Dispatcher;'; @override Dispatcher fromReference(jni.JReference reference) => @@ -8718,13 +8720,13 @@ class ExecutorService extends jni.JObject { ) : super.fromReference(reference); static final _class = - jni.JClass.forName(r"java/util/concurrent/ExecutorService"); + jni.JClass.forName(r'java/util/concurrent/ExecutorService'); /// The type which includes information such as the signature of this class. static const type = $ExecutorServiceType(); static final _id_shutdown = _class.instanceMethodId( - r"shutdown", - r"()V", + r'shutdown', + r'()V', ); static final _shutdown = ProtectedJniExtensions.lookup< @@ -8732,7 +8734,7 @@ class ExecutorService extends jni.JObject { jni.JThrowablePtr Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallVoidMethod") + )>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function( ffi.Pointer, @@ -8745,8 +8747,8 @@ class ExecutorService extends jni.JObject { } static final _id_shutdownNow = _class.instanceMethodId( - r"shutdownNow", - r"()Ljava/util/List;", + r'shutdownNow', + r'()Ljava/util/List;', ); static final _shutdownNow = ProtectedJniExtensions.lookup< @@ -8754,7 +8756,7 @@ class ExecutorService extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -8769,8 +8771,8 @@ class ExecutorService extends jni.JObject { } static final _id_isShutdown = _class.instanceMethodId( - r"isShutdown", - r"()Z", + r'isShutdown', + r'()Z', ); static final _isShutdown = ProtectedJniExtensions.lookup< @@ -8778,7 +8780,7 @@ class ExecutorService extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallBooleanMethod") + )>>('globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -8792,8 +8794,8 @@ class ExecutorService extends jni.JObject { } static final _id_isTerminated = _class.instanceMethodId( - r"isTerminated", - r"()Z", + r'isTerminated', + r'()Z', ); static final _isTerminated = ProtectedJniExtensions.lookup< @@ -8801,7 +8803,7 @@ class ExecutorService extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallBooleanMethod") + )>>('globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -8816,8 +8818,8 @@ class ExecutorService extends jni.JObject { } static final _id_awaitTermination = _class.instanceMethodId( - r"awaitTermination", - r"(JLjava/util/concurrent/TimeUnit;)Z", + r'awaitTermination', + r'(JLjava/util/concurrent/TimeUnit;)Z', ); static final _awaitTermination = ProtectedJniExtensions.lookup< @@ -8826,7 +8828,7 @@ class ExecutorService extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Int64, ffi.Pointer)>)>>( - "globalEnv_CallBooleanMethod") + 'globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, ffi.Pointer)>(); @@ -8876,26 +8878,26 @@ class ExecutorService extends jni.JObject { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; - if ($d == r"shutdown()V") { + if ($d == r'shutdown()V') { _$impls[$p]!.shutdown(); return jni.nullptr; } - if ($d == r"shutdownNow()Ljava/util/List;") { + if ($d == r'shutdownNow()Ljava/util/List;') { final $r = _$impls[$p]!.shutdownNow(); return ($r as jni.JObject) .castTo(const jni.JObjectType()) .reference .toPointer(); } - if ($d == r"isShutdown()Z") { + if ($d == r'isShutdown()Z') { final $r = _$impls[$p]!.isShutdown(); return jni.JBoolean($r).reference.toPointer(); } - if ($d == r"isTerminated()Z") { + if ($d == r'isTerminated()Z') { final $r = _$impls[$p]!.isTerminated(); return jni.JBoolean($r).reference.toPointer(); } - if ($d == r"awaitTermination(JLjava/util/concurrent/TimeUnit;)Z") { + if ($d == r'awaitTermination(JLjava/util/concurrent/TimeUnit;)Z') { final $r = _$impls[$p]!.awaitTermination( $a[0] .castTo(const jni.JLongType(), releaseOriginal: true) @@ -8916,7 +8918,7 @@ class ExecutorService extends jni.JObject { final $p = ReceivePort(); final $x = ExecutorService.fromReference( ProtectedJniExtensions.newPortProxy( - r"java.util.concurrent.ExecutorService", + r'java.util.concurrent.ExecutorService', $p, _$invokePointer, ), @@ -8997,7 +8999,7 @@ final class $ExecutorServiceType extends jni.JObjType { const $ExecutorServiceType(); @override - String get signature => r"Ljava/util/concurrent/ExecutorService;"; + String get signature => r'Ljava/util/concurrent/ExecutorService;'; @override ExecutorService fromReference(jni.JReference reference) => @@ -9028,13 +9030,13 @@ class Cache_Companion extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/Cache$Companion"); + static final _class = jni.JClass.forName(r'okhttp3/Cache$Companion'); /// The type which includes information such as the signature of this class. static const type = $Cache_CompanionType(); static final _id_key = _class.instanceMethodId( - r"key", - r"(Lokhttp3/HttpUrl;)Ljava/lang/String;", + r'key', + r'(Lokhttp3/HttpUrl;)Ljava/lang/String;', ); static final _key = ProtectedJniExtensions.lookup< @@ -9043,7 +9045,7 @@ class Cache_Companion extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -9059,8 +9061,8 @@ class Cache_Companion extends jni.JObject { } static final _id_varyMatches = _class.instanceMethodId( - r"varyMatches", - r"(Lokhttp3/Response;Lokhttp3/Headers;Lokhttp3/Request;)Z", + r'varyMatches', + r'(Lokhttp3/Response;Lokhttp3/Headers;Lokhttp3/Request;)Z', ); static final _varyMatches = ProtectedJniExtensions.lookup< @@ -9073,7 +9075,7 @@ class Cache_Companion extends jni.JObject { ffi.Pointer, ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallBooleanMethod") + )>)>>('globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -9098,8 +9100,8 @@ class Cache_Companion extends jni.JObject { } static final _id_hasVaryAll = _class.instanceMethodId( - r"hasVaryAll", - r"(Lokhttp3/Response;)Z", + r'hasVaryAll', + r'(Lokhttp3/Response;)Z', ); static final _hasVaryAll = ProtectedJniExtensions.lookup< @@ -9108,7 +9110,7 @@ class Cache_Companion extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallBooleanMethod") + 'globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -9123,8 +9125,8 @@ class Cache_Companion extends jni.JObject { } static final _id_varyHeaders = _class.instanceMethodId( - r"varyHeaders", - r"(Lokhttp3/Response;)Lokhttp3/Headers;", + r'varyHeaders', + r'(Lokhttp3/Response;)Lokhttp3/Headers;', ); static final _varyHeaders = ProtectedJniExtensions.lookup< @@ -9133,7 +9135,7 @@ class Cache_Companion extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -9149,7 +9151,7 @@ class Cache_Companion extends jni.JObject { } static final _id_new0 = _class.constructorId( - r"(Lkotlin/jvm/internal/DefaultConstructorMarker;)V", + r'(Lkotlin/jvm/internal/DefaultConstructorMarker;)V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -9158,7 +9160,7 @@ class Cache_Companion extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_NewObject") + 'globalEnv_NewObject') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -9180,7 +9182,7 @@ final class $Cache_CompanionType extends jni.JObjType { const $Cache_CompanionType(); @override - String get signature => r"Lokhttp3/Cache$Companion;"; + String get signature => r'Lokhttp3/Cache$Companion;'; @override Cache_Companion fromReference(jni.JReference reference) => @@ -9211,12 +9213,12 @@ class Cache_Entry_Companion extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/Cache$Entry$Companion"); + static final _class = jni.JClass.forName(r'okhttp3/Cache$Entry$Companion'); /// The type which includes information such as the signature of this class. static const type = $Cache_Entry_CompanionType(); static final _id_new0 = _class.constructorId( - r"(Lkotlin/jvm/internal/DefaultConstructorMarker;)V", + r'(Lkotlin/jvm/internal/DefaultConstructorMarker;)V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -9225,7 +9227,7 @@ class Cache_Entry_Companion extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_NewObject") + 'globalEnv_NewObject') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -9248,7 +9250,7 @@ final class $Cache_Entry_CompanionType const $Cache_Entry_CompanionType(); @override - String get signature => r"Lokhttp3/Cache$Entry$Companion;"; + String get signature => r'Lokhttp3/Cache$Entry$Companion;'; @override Cache_Entry_Companion fromReference(jni.JReference reference) => @@ -9279,13 +9281,13 @@ class Cache extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/Cache"); + static final _class = jni.JClass.forName(r'okhttp3/Cache'); /// The type which includes information such as the signature of this class. static const type = $CacheType(); static final _id_Companion = _class.staticFieldId( - r"Companion", - r"Lokhttp3/Cache$Companion;", + r'Companion', + r'Lokhttp3/Cache$Companion;', ); /// from: static public final okhttp3.Cache$Companion Companion @@ -9294,7 +9296,7 @@ class Cache extends jni.JObject { _id_Companion.get(_class, const $Cache_CompanionType()); static final _id_new0 = _class.constructorId( - r"(Ljava/io/File;JLokhttp3/internal/io/FileSystem;)V", + r'(Ljava/io/File;JLokhttp3/internal/io/FileSystem;)V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -9307,7 +9309,7 @@ class Cache extends jni.JObject { ffi.Pointer, ffi.Int64, ffi.Pointer - )>)>>("globalEnv_NewObject") + )>)>>('globalEnv_NewObject') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, int, ffi.Pointer)>(); @@ -9329,8 +9331,8 @@ class Cache extends jni.JObject { } static final _id_isClosed = _class.instanceMethodId( - r"isClosed", - r"()Z", + r'isClosed', + r'()Z', ); static final _isClosed = ProtectedJniExtensions.lookup< @@ -9338,7 +9340,7 @@ class Cache extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallBooleanMethod") + )>>('globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -9352,7 +9354,7 @@ class Cache extends jni.JObject { } static final _id_new1 = _class.constructorId( - r"(Ljava/io/File;J)V", + r'(Ljava/io/File;J)V', ); static final _new1 = ProtectedJniExtensions.lookup< @@ -9361,7 +9363,7 @@ class Cache extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer, ffi.Int64)>)>>( - "globalEnv_NewObject") + 'globalEnv_NewObject') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, int)>(); @@ -9378,8 +9380,8 @@ class Cache extends jni.JObject { } static final _id_initialize = _class.instanceMethodId( - r"initialize", - r"()V", + r'initialize', + r'()V', ); static final _initialize = ProtectedJniExtensions.lookup< @@ -9387,7 +9389,7 @@ class Cache extends jni.JObject { jni.JThrowablePtr Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallVoidMethod") + )>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function( ffi.Pointer, @@ -9400,8 +9402,8 @@ class Cache extends jni.JObject { } static final _id_delete = _class.instanceMethodId( - r"delete", - r"()V", + r'delete', + r'()V', ); static final _delete = ProtectedJniExtensions.lookup< @@ -9409,7 +9411,7 @@ class Cache extends jni.JObject { jni.JThrowablePtr Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallVoidMethod") + )>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function( ffi.Pointer, @@ -9422,8 +9424,8 @@ class Cache extends jni.JObject { } static final _id_evictAll = _class.instanceMethodId( - r"evictAll", - r"()V", + r'evictAll', + r'()V', ); static final _evictAll = ProtectedJniExtensions.lookup< @@ -9431,7 +9433,7 @@ class Cache extends jni.JObject { jni.JThrowablePtr Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallVoidMethod") + )>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function( ffi.Pointer, @@ -9444,8 +9446,8 @@ class Cache extends jni.JObject { } static final _id_urls = _class.instanceMethodId( - r"urls", - r"()Ljava/util/Iterator;", + r'urls', + r'()Ljava/util/Iterator;', ); static final _urls = ProtectedJniExtensions.lookup< @@ -9453,7 +9455,7 @@ class Cache extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -9468,8 +9470,8 @@ class Cache extends jni.JObject { } static final _id_writeAbortCount = _class.instanceMethodId( - r"writeAbortCount", - r"()I", + r'writeAbortCount', + r'()I', ); static final _writeAbortCount = ProtectedJniExtensions.lookup< @@ -9477,7 +9479,7 @@ class Cache extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallIntMethod") + )>>('globalEnv_CallIntMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -9492,8 +9494,8 @@ class Cache extends jni.JObject { } static final _id_writeSuccessCount = _class.instanceMethodId( - r"writeSuccessCount", - r"()I", + r'writeSuccessCount', + r'()I', ); static final _writeSuccessCount = ProtectedJniExtensions.lookup< @@ -9501,7 +9503,7 @@ class Cache extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallIntMethod") + )>>('globalEnv_CallIntMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -9516,8 +9518,8 @@ class Cache extends jni.JObject { } static final _id_size = _class.instanceMethodId( - r"size", - r"()J", + r'size', + r'()J', ); static final _size = ProtectedJniExtensions.lookup< @@ -9525,7 +9527,7 @@ class Cache extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallLongMethod") + )>>('globalEnv_CallLongMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -9538,8 +9540,8 @@ class Cache extends jni.JObject { } static final _id_maxSize = _class.instanceMethodId( - r"maxSize", - r"()J", + r'maxSize', + r'()J', ); static final _maxSize = ProtectedJniExtensions.lookup< @@ -9547,7 +9549,7 @@ class Cache extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallLongMethod") + )>>('globalEnv_CallLongMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -9560,8 +9562,8 @@ class Cache extends jni.JObject { } static final _id_flush = _class.instanceMethodId( - r"flush", - r"()V", + r'flush', + r'()V', ); static final _flush = ProtectedJniExtensions.lookup< @@ -9569,7 +9571,7 @@ class Cache extends jni.JObject { jni.JThrowablePtr Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallVoidMethod") + )>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function( ffi.Pointer, @@ -9582,8 +9584,8 @@ class Cache extends jni.JObject { } static final _id_close = _class.instanceMethodId( - r"close", - r"()V", + r'close', + r'()V', ); static final _close = ProtectedJniExtensions.lookup< @@ -9591,7 +9593,7 @@ class Cache extends jni.JObject { jni.JThrowablePtr Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallVoidMethod") + )>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function( ffi.Pointer, @@ -9604,8 +9606,8 @@ class Cache extends jni.JObject { } static final _id_directory = _class.instanceMethodId( - r"directory", - r"()Ljava/io/File;", + r'directory', + r'()Ljava/io/File;', ); static final _directory = ProtectedJniExtensions.lookup< @@ -9613,7 +9615,7 @@ class Cache extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -9628,8 +9630,8 @@ class Cache extends jni.JObject { } static final _id_networkCount = _class.instanceMethodId( - r"networkCount", - r"()I", + r'networkCount', + r'()I', ); static final _networkCount = ProtectedJniExtensions.lookup< @@ -9637,7 +9639,7 @@ class Cache extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallIntMethod") + )>>('globalEnv_CallIntMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -9652,8 +9654,8 @@ class Cache extends jni.JObject { } static final _id_hitCount = _class.instanceMethodId( - r"hitCount", - r"()I", + r'hitCount', + r'()I', ); static final _hitCount = ProtectedJniExtensions.lookup< @@ -9661,7 +9663,7 @@ class Cache extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallIntMethod") + )>>('globalEnv_CallIntMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -9675,8 +9677,8 @@ class Cache extends jni.JObject { } static final _id_requestCount = _class.instanceMethodId( - r"requestCount", - r"()I", + r'requestCount', + r'()I', ); static final _requestCount = ProtectedJniExtensions.lookup< @@ -9684,7 +9686,7 @@ class Cache extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallIntMethod") + )>>('globalEnv_CallIntMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -9699,8 +9701,8 @@ class Cache extends jni.JObject { } static final _id_key = _class.staticMethodId( - r"key", - r"(Lokhttp3/HttpUrl;)Ljava/lang/String;", + r'key', + r'(Lokhttp3/HttpUrl;)Ljava/lang/String;', ); static final _key = ProtectedJniExtensions.lookup< @@ -9709,7 +9711,7 @@ class Cache extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallStaticObjectMethod") + 'globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -9729,7 +9731,7 @@ final class $CacheType extends jni.JObjType { const $CacheType(); @override - String get signature => r"Lokhttp3/Cache;"; + String get signature => r'Lokhttp3/Cache;'; @override Cache fromReference(jni.JReference reference) => @@ -9760,13 +9762,13 @@ class RedirectReceivedCallback extends jni.JObject { ) : super.fromReference(reference); static final _class = - jni.JClass.forName(r"com/example/ok_http/RedirectReceivedCallback"); + jni.JClass.forName(r'com/example/ok_http/RedirectReceivedCallback'); /// The type which includes information such as the signature of this class. static const type = $RedirectReceivedCallbackType(); static final _id_onRedirectReceived = _class.instanceMethodId( - r"onRedirectReceived", - r"(Lokhttp3/Response;Ljava/lang/String;)V", + r'onRedirectReceived', + r'(Lokhttp3/Response;Ljava/lang/String;)V', ); static final _onRedirectReceived = ProtectedJniExtensions.lookup< @@ -9778,7 +9780,7 @@ class RedirectReceivedCallback extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallVoidMethod") + )>)>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -9828,7 +9830,7 @@ class RedirectReceivedCallback extends jni.JObject { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; - if ($d == r"onRedirectReceived(Lokhttp3/Response;Ljava/lang/String;)V") { + if ($d == r'onRedirectReceived(Lokhttp3/Response;Ljava/lang/String;)V') { _$impls[$p]!.onRedirectReceived( $a[0].castTo(const $ResponseType(), releaseOriginal: true), $a[1].castTo(const jni.JStringType(), releaseOriginal: true), @@ -9847,7 +9849,7 @@ class RedirectReceivedCallback extends jni.JObject { final $p = ReceivePort(); final $x = RedirectReceivedCallback.fromReference( ProtectedJniExtensions.newPortProxy( - r"com.example.ok_http.RedirectReceivedCallback", + r'com.example.ok_http.RedirectReceivedCallback', $p, _$invokePointer, ), @@ -9896,7 +9898,7 @@ final class $RedirectReceivedCallbackType const $RedirectReceivedCallbackType(); @override - String get signature => r"Lcom/example/ok_http/RedirectReceivedCallback;"; + String get signature => r'Lcom/example/ok_http/RedirectReceivedCallback;'; @override RedirectReceivedCallback fromReference(jni.JReference reference) => @@ -9928,13 +9930,13 @@ class RedirectInterceptor_Companion extends jni.JObject { ) : super.fromReference(reference); static final _class = - jni.JClass.forName(r"com/example/ok_http/RedirectInterceptor$Companion"); + jni.JClass.forName(r'com/example/ok_http/RedirectInterceptor$Companion'); /// The type which includes information such as the signature of this class. static const type = $RedirectInterceptor_CompanionType(); static final _id_addRedirectInterceptor = _class.instanceMethodId( - r"addRedirectInterceptor", - r"(Lokhttp3/OkHttpClient$Builder;IZLcom/example/ok_http/RedirectReceivedCallback;)Lokhttp3/OkHttpClient$Builder;", + r'addRedirectInterceptor', + r'(Lokhttp3/OkHttpClient$Builder;IZLcom/example/ok_http/RedirectReceivedCallback;)Lokhttp3/OkHttpClient$Builder;', ); static final _addRedirectInterceptor = ProtectedJniExtensions.lookup< @@ -9948,7 +9950,7 @@ class RedirectInterceptor_Companion extends jni.JObject { $Int32, $Int32, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, int, int, ffi.Pointer)>(); @@ -9972,7 +9974,7 @@ class RedirectInterceptor_Companion extends jni.JObject { } static final _id_new0 = _class.constructorId( - r"(Lkotlin/jvm/internal/DefaultConstructorMarker;)V", + r'(Lkotlin/jvm/internal/DefaultConstructorMarker;)V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -9981,7 +9983,7 @@ class RedirectInterceptor_Companion extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_NewObject") + 'globalEnv_NewObject') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -10005,7 +10007,7 @@ final class $RedirectInterceptor_CompanionType @override String get signature => - r"Lcom/example/ok_http/RedirectInterceptor$Companion;"; + r'Lcom/example/ok_http/RedirectInterceptor$Companion;'; @override RedirectInterceptor_Companion fromReference(jni.JReference reference) => @@ -10037,13 +10039,13 @@ class RedirectInterceptor extends jni.JObject { ) : super.fromReference(reference); static final _class = - jni.JClass.forName(r"com/example/ok_http/RedirectInterceptor"); + jni.JClass.forName(r'com/example/ok_http/RedirectInterceptor'); /// The type which includes information such as the signature of this class. static const type = $RedirectInterceptorType(); static final _id_Companion = _class.staticFieldId( - r"Companion", - r"Lcom/example/ok_http/RedirectInterceptor$Companion;", + r'Companion', + r'Lcom/example/ok_http/RedirectInterceptor$Companion;', ); /// from: static public final com.example.ok_http.RedirectInterceptor$Companion Companion @@ -10052,7 +10054,7 @@ class RedirectInterceptor extends jni.JObject { _id_Companion.get(_class, const $RedirectInterceptor_CompanionType()); static final _id_new0 = _class.constructorId( - r"()V", + r'()V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -10060,7 +10062,7 @@ class RedirectInterceptor extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_NewObject") + )>>('globalEnv_NewObject') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -10080,7 +10082,7 @@ final class $RedirectInterceptorType extends jni.JObjType { const $RedirectInterceptorType(); @override - String get signature => r"Lcom/example/ok_http/RedirectInterceptor;"; + String get signature => r'Lcom/example/ok_http/RedirectInterceptor;'; @override RedirectInterceptor fromReference(jni.JReference reference) => @@ -10112,12 +10114,12 @@ class AsyncInputStreamReader extends jni.JObject { ) : super.fromReference(reference); static final _class = - jni.JClass.forName(r"com/example/ok_http/AsyncInputStreamReader"); + jni.JClass.forName(r'com/example/ok_http/AsyncInputStreamReader'); /// The type which includes information such as the signature of this class. static const type = $AsyncInputStreamReaderType(); static final _id_new0 = _class.constructorId( - r"()V", + r'()V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -10125,7 +10127,7 @@ class AsyncInputStreamReader extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_NewObject") + )>>('globalEnv_NewObject') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -10141,8 +10143,8 @@ class AsyncInputStreamReader extends jni.JObject { } static final _id_readAsync = _class.instanceMethodId( - r"readAsync", - r"(Ljava/io/InputStream;Lcom/example/ok_http/DataCallback;)Ljava/util/concurrent/Future;", + r'readAsync', + r'(Ljava/io/InputStream;Lcom/example/ok_http/DataCallback;)Ljava/util/concurrent/Future;', ); static final _readAsync = ProtectedJniExtensions.lookup< @@ -10154,7 +10156,7 @@ class AsyncInputStreamReader extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -10171,8 +10173,8 @@ class AsyncInputStreamReader extends jni.JObject { } static final _id_shutdown = _class.instanceMethodId( - r"shutdown", - r"()V", + r'shutdown', + r'()V', ); static final _shutdown = ProtectedJniExtensions.lookup< @@ -10180,7 +10182,7 @@ class AsyncInputStreamReader extends jni.JObject { jni.JThrowablePtr Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallVoidMethod") + )>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function( ffi.Pointer, @@ -10198,7 +10200,7 @@ final class $AsyncInputStreamReaderType const $AsyncInputStreamReaderType(); @override - String get signature => r"Lcom/example/ok_http/AsyncInputStreamReader;"; + String get signature => r'Lcom/example/ok_http/AsyncInputStreamReader;'; @override AsyncInputStreamReader fromReference(jni.JReference reference) => @@ -10229,13 +10231,13 @@ class DataCallback extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"com/example/ok_http/DataCallback"); + static final _class = jni.JClass.forName(r'com/example/ok_http/DataCallback'); /// The type which includes information such as the signature of this class. static const type = $DataCallbackType(); static final _id_onDataRead = _class.instanceMethodId( - r"onDataRead", - r"([B)V", + r'onDataRead', + r'([B)V', ); static final _onDataRead = ProtectedJniExtensions.lookup< @@ -10244,7 +10246,7 @@ class DataCallback extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallVoidMethod") + 'globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -10259,8 +10261,8 @@ class DataCallback extends jni.JObject { } static final _id_onFinished = _class.instanceMethodId( - r"onFinished", - r"()V", + r'onFinished', + r'()V', ); static final _onFinished = ProtectedJniExtensions.lookup< @@ -10268,7 +10270,7 @@ class DataCallback extends jni.JObject { jni.JThrowablePtr Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallVoidMethod") + )>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function( ffi.Pointer, @@ -10281,8 +10283,8 @@ class DataCallback extends jni.JObject { } static final _id_onError = _class.instanceMethodId( - r"onError", - r"(Ljava/io/IOException;)V", + r'onError', + r'(Ljava/io/IOException;)V', ); static final _onError = ProtectedJniExtensions.lookup< @@ -10291,7 +10293,7 @@ class DataCallback extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallVoidMethod") + 'globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -10337,18 +10339,18 @@ class DataCallback extends jni.JObject { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; - if ($d == r"onDataRead([B)V") { + if ($d == r'onDataRead([B)V') { _$impls[$p]!.onDataRead( $a[0].castTo(const jni.JArrayType(jni.jbyteType()), releaseOriginal: true), ); return jni.nullptr; } - if ($d == r"onFinished()V") { + if ($d == r'onFinished()V') { _$impls[$p]!.onFinished(); return jni.nullptr; } - if ($d == r"onError(Ljava/io/IOException;)V") { + if ($d == r'onError(Ljava/io/IOException;)V') { _$impls[$p]!.onError( $a[0].castTo(const jni.JObjectType(), releaseOriginal: true), ); @@ -10366,7 +10368,7 @@ class DataCallback extends jni.JObject { final $p = ReceivePort(); final $x = DataCallback.fromReference( ProtectedJniExtensions.newPortProxy( - r"com.example.ok_http.DataCallback", + r'com.example.ok_http.DataCallback', $p, _$invokePointer, ), @@ -10429,7 +10431,7 @@ final class $DataCallbackType extends jni.JObjType { const $DataCallbackType(); @override - String get signature => r"Lcom/example/ok_http/DataCallback;"; + String get signature => r'Lcom/example/ok_http/DataCallback;'; @override DataCallback fromReference(jni.JReference reference) => @@ -10460,13 +10462,13 @@ class WebSocket_Factory extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/WebSocket$Factory"); + static final _class = jni.JClass.forName(r'okhttp3/WebSocket$Factory'); /// The type which includes information such as the signature of this class. static const type = $WebSocket_FactoryType(); static final _id_newWebSocket = _class.instanceMethodId( - r"newWebSocket", - r"(Lokhttp3/Request;Lokhttp3/WebSocketListener;)Lokhttp3/WebSocket;", + r'newWebSocket', + r'(Lokhttp3/Request;Lokhttp3/WebSocketListener;)Lokhttp3/WebSocket;', ); static final _newWebSocket = ProtectedJniExtensions.lookup< @@ -10478,7 +10480,7 @@ class WebSocket_Factory extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -10530,7 +10532,7 @@ class WebSocket_Factory extends jni.JObject { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; if ($d == - r"newWebSocket(Lokhttp3/Request;Lokhttp3/WebSocketListener;)Lokhttp3/WebSocket;") { + r'newWebSocket(Lokhttp3/Request;Lokhttp3/WebSocketListener;)Lokhttp3/WebSocket;') { final $r = _$impls[$p]!.newWebSocket( $a[0].castTo(const $RequestType(), releaseOriginal: true), $a[1].castTo(const jni.JObjectType(), releaseOriginal: true), @@ -10552,7 +10554,7 @@ class WebSocket_Factory extends jni.JObject { final $p = ReceivePort(); final $x = WebSocket_Factory.fromReference( ProtectedJniExtensions.newPortProxy( - r"okhttp3.WebSocket$Factory", + r'okhttp3.WebSocket$Factory', $p, _$invokePointer, ), @@ -10600,7 +10602,7 @@ final class $WebSocket_FactoryType extends jni.JObjType { const $WebSocket_FactoryType(); @override - String get signature => r"Lokhttp3/WebSocket$Factory;"; + String get signature => r'Lokhttp3/WebSocket$Factory;'; @override WebSocket_Factory fromReference(jni.JReference reference) => @@ -10631,13 +10633,13 @@ class WebSocket extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okhttp3/WebSocket"); + static final _class = jni.JClass.forName(r'okhttp3/WebSocket'); /// The type which includes information such as the signature of this class. static const type = $WebSocketType(); static final _id_request = _class.instanceMethodId( - r"request", - r"()Lokhttp3/Request;", + r'request', + r'()Lokhttp3/Request;', ); static final _request = ProtectedJniExtensions.lookup< @@ -10645,7 +10647,7 @@ class WebSocket extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -10660,8 +10662,8 @@ class WebSocket extends jni.JObject { } static final _id_queueSize = _class.instanceMethodId( - r"queueSize", - r"()J", + r'queueSize', + r'()J', ); static final _queueSize = ProtectedJniExtensions.lookup< @@ -10669,7 +10671,7 @@ class WebSocket extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallLongMethod") + )>>('globalEnv_CallLongMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -10683,8 +10685,8 @@ class WebSocket extends jni.JObject { } static final _id_send = _class.instanceMethodId( - r"send", - r"(Ljava/lang/String;)Z", + r'send', + r'(Ljava/lang/String;)Z', ); static final _send = ProtectedJniExtensions.lookup< @@ -10693,7 +10695,7 @@ class WebSocket extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallBooleanMethod") + 'globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -10708,8 +10710,8 @@ class WebSocket extends jni.JObject { } static final _id_send1 = _class.instanceMethodId( - r"send", - r"(Lokio/ByteString;)Z", + r'send', + r'(Lokio/ByteString;)Z', ); static final _send1 = ProtectedJniExtensions.lookup< @@ -10718,7 +10720,7 @@ class WebSocket extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallBooleanMethod") + 'globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -10733,8 +10735,8 @@ class WebSocket extends jni.JObject { } static final _id_close = _class.instanceMethodId( - r"close", - r"(ILjava/lang/String;)Z", + r'close', + r'(ILjava/lang/String;)Z', ); static final _close = ProtectedJniExtensions.lookup< @@ -10743,7 +10745,7 @@ class WebSocket extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<($Int32, ffi.Pointer)>)>>( - "globalEnv_CallBooleanMethod") + 'globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, ffi.Pointer)>(); @@ -10759,8 +10761,8 @@ class WebSocket extends jni.JObject { } static final _id_cancel = _class.instanceMethodId( - r"cancel", - r"()V", + r'cancel', + r'()V', ); static final _cancel = ProtectedJniExtensions.lookup< @@ -10768,7 +10770,7 @@ class WebSocket extends jni.JObject { jni.JThrowablePtr Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallVoidMethod") + )>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function( ffi.Pointer, @@ -10812,30 +10814,30 @@ class WebSocket extends jni.JObject { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; - if ($d == r"request()Lokhttp3/Request;") { + if ($d == r'request()Lokhttp3/Request;') { final $r = _$impls[$p]!.request(); return ($r as jni.JObject) .castTo(const jni.JObjectType()) .reference .toPointer(); } - if ($d == r"queueSize()J") { + if ($d == r'queueSize()J') { final $r = _$impls[$p]!.queueSize(); return jni.JLong($r).reference.toPointer(); } - if ($d == r"send(Ljava/lang/String;)Z") { + if ($d == r'send(Ljava/lang/String;)Z') { final $r = _$impls[$p]!.send( $a[0].castTo(const jni.JStringType(), releaseOriginal: true), ); return jni.JBoolean($r).reference.toPointer(); } - if ($d == r"send(Lokio/ByteString;)Z") { + if ($d == r'send(Lokio/ByteString;)Z') { final $r = _$impls[$p]!.send1( $a[0].castTo(const $ByteStringType(), releaseOriginal: true), ); return jni.JBoolean($r).reference.toPointer(); } - if ($d == r"close(ILjava/lang/String;)Z") { + if ($d == r'close(ILjava/lang/String;)Z') { final $r = _$impls[$p]!.close( $a[0] .castTo(const jni.JIntegerType(), releaseOriginal: true) @@ -10844,7 +10846,7 @@ class WebSocket extends jni.JObject { ); return jni.JBoolean($r).reference.toPointer(); } - if ($d == r"cancel()V") { + if ($d == r'cancel()V') { _$impls[$p]!.cancel(); return jni.nullptr; } @@ -10860,7 +10862,7 @@ class WebSocket extends jni.JObject { final $p = ReceivePort(); final $x = WebSocket.fromReference( ProtectedJniExtensions.newPortProxy( - r"okhttp3.WebSocket", + r'okhttp3.WebSocket', $p, _$invokePointer, ), @@ -10950,7 +10952,7 @@ final class $WebSocketType extends jni.JObjType { const $WebSocketType(); @override - String get signature => r"Lokhttp3/WebSocket;"; + String get signature => r'Lokhttp3/WebSocket;'; @override WebSocket fromReference(jni.JReference reference) => @@ -10982,13 +10984,13 @@ class WebSocketListenerProxy_WebSocketListener extends jni.JObject { ) : super.fromReference(reference); static final _class = jni.JClass.forName( - r"com/example/ok_http/WebSocketListenerProxy$WebSocketListener"); + r'com/example/ok_http/WebSocketListenerProxy$WebSocketListener'); /// The type which includes information such as the signature of this class. static const type = $WebSocketListenerProxy_WebSocketListenerType(); static final _id_onOpen = _class.instanceMethodId( - r"onOpen", - r"(Lokhttp3/WebSocket;Lokhttp3/Response;)V", + r'onOpen', + r'(Lokhttp3/WebSocket;Lokhttp3/Response;)V', ); static final _onOpen = ProtectedJniExtensions.lookup< @@ -11000,7 +11002,7 @@ class WebSocketListenerProxy_WebSocketListener extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallVoidMethod") + )>)>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -11016,8 +11018,8 @@ class WebSocketListenerProxy_WebSocketListener extends jni.JObject { } static final _id_onMessage = _class.instanceMethodId( - r"onMessage", - r"(Lokhttp3/WebSocket;Ljava/lang/String;)V", + r'onMessage', + r'(Lokhttp3/WebSocket;Ljava/lang/String;)V', ); static final _onMessage = ProtectedJniExtensions.lookup< @@ -11029,7 +11031,7 @@ class WebSocketListenerProxy_WebSocketListener extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallVoidMethod") + )>)>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -11045,8 +11047,8 @@ class WebSocketListenerProxy_WebSocketListener extends jni.JObject { } static final _id_onMessage1 = _class.instanceMethodId( - r"onMessage", - r"(Lokhttp3/WebSocket;Lokio/ByteString;)V", + r'onMessage', + r'(Lokhttp3/WebSocket;Lokio/ByteString;)V', ); static final _onMessage1 = ProtectedJniExtensions.lookup< @@ -11058,7 +11060,7 @@ class WebSocketListenerProxy_WebSocketListener extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallVoidMethod") + )>)>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -11074,8 +11076,8 @@ class WebSocketListenerProxy_WebSocketListener extends jni.JObject { } static final _id_onClosing = _class.instanceMethodId( - r"onClosing", - r"(Lokhttp3/WebSocket;ILjava/lang/String;)V", + r'onClosing', + r'(Lokhttp3/WebSocket;ILjava/lang/String;)V', ); static final _onClosing = ProtectedJniExtensions.lookup< @@ -11088,7 +11090,7 @@ class WebSocketListenerProxy_WebSocketListener extends jni.JObject { ffi.Pointer, $Int32, ffi.Pointer - )>)>>("globalEnv_CallVoidMethod") + )>)>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, int, ffi.Pointer)>(); @@ -11105,8 +11107,8 @@ class WebSocketListenerProxy_WebSocketListener extends jni.JObject { } static final _id_onFailure = _class.instanceMethodId( - r"onFailure", - r"(Lokhttp3/WebSocket;Ljava/lang/Throwable;Lokhttp3/Response;)V", + r'onFailure', + r'(Lokhttp3/WebSocket;Ljava/lang/Throwable;Lokhttp3/Response;)V', ); static final _onFailure = ProtectedJniExtensions.lookup< @@ -11119,7 +11121,7 @@ class WebSocketListenerProxy_WebSocketListener extends jni.JObject { ffi.Pointer, ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallVoidMethod") + )>)>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function( ffi.Pointer, @@ -11176,28 +11178,28 @@ class WebSocketListenerProxy_WebSocketListener extends jni.JObject { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; - if ($d == r"onOpen(Lokhttp3/WebSocket;Lokhttp3/Response;)V") { + if ($d == r'onOpen(Lokhttp3/WebSocket;Lokhttp3/Response;)V') { _$impls[$p]!.onOpen( $a[0].castTo(const $WebSocketType(), releaseOriginal: true), $a[1].castTo(const $ResponseType(), releaseOriginal: true), ); return jni.nullptr; } - if ($d == r"onMessage(Lokhttp3/WebSocket;Ljava/lang/String;)V") { + if ($d == r'onMessage(Lokhttp3/WebSocket;Ljava/lang/String;)V') { _$impls[$p]!.onMessage( $a[0].castTo(const $WebSocketType(), releaseOriginal: true), $a[1].castTo(const jni.JStringType(), releaseOriginal: true), ); return jni.nullptr; } - if ($d == r"onMessage(Lokhttp3/WebSocket;Lokio/ByteString;)V") { + if ($d == r'onMessage(Lokhttp3/WebSocket;Lokio/ByteString;)V') { _$impls[$p]!.onMessage1( $a[0].castTo(const $WebSocketType(), releaseOriginal: true), $a[1].castTo(const $ByteStringType(), releaseOriginal: true), ); return jni.nullptr; } - if ($d == r"onClosing(Lokhttp3/WebSocket;ILjava/lang/String;)V") { + if ($d == r'onClosing(Lokhttp3/WebSocket;ILjava/lang/String;)V') { _$impls[$p]!.onClosing( $a[0].castTo(const $WebSocketType(), releaseOriginal: true), $a[1] @@ -11208,7 +11210,7 @@ class WebSocketListenerProxy_WebSocketListener extends jni.JObject { return jni.nullptr; } if ($d == - r"onFailure(Lokhttp3/WebSocket;Ljava/lang/Throwable;Lokhttp3/Response;)V") { + r'onFailure(Lokhttp3/WebSocket;Ljava/lang/Throwable;Lokhttp3/Response;)V') { _$impls[$p]!.onFailure( $a[0].castTo(const $WebSocketType(), releaseOriginal: true), $a[1].castTo(const jni.JObjectType(), releaseOriginal: true), @@ -11228,7 +11230,7 @@ class WebSocketListenerProxy_WebSocketListener extends jni.JObject { final $p = ReceivePort(); final $x = WebSocketListenerProxy_WebSocketListener.fromReference( ProtectedJniExtensions.newPortProxy( - r"com.example.ok_http.WebSocketListenerProxy$WebSocketListener", + r'com.example.ok_http.WebSocketListenerProxy$WebSocketListener', $p, _$invokePointer, ), @@ -11323,7 +11325,7 @@ final class $WebSocketListenerProxy_WebSocketListenerType @override String get signature => - r"Lcom/example/ok_http/WebSocketListenerProxy$WebSocketListener;"; + r'Lcom/example/ok_http/WebSocketListenerProxy$WebSocketListener;'; @override WebSocketListenerProxy_WebSocketListener fromReference( @@ -11357,12 +11359,12 @@ class WebSocketListenerProxy extends jni.JObject { ) : super.fromReference(reference); static final _class = - jni.JClass.forName(r"com/example/ok_http/WebSocketListenerProxy"); + jni.JClass.forName(r'com/example/ok_http/WebSocketListenerProxy'); /// The type which includes information such as the signature of this class. static const type = $WebSocketListenerProxyType(); static final _id_new0 = _class.constructorId( - r"(Lcom/example/ok_http/WebSocketListenerProxy$WebSocketListener;)V", + r'(Lcom/example/ok_http/WebSocketListenerProxy$WebSocketListener;)V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -11371,7 +11373,7 @@ class WebSocketListenerProxy extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_NewObject") + 'globalEnv_NewObject') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -11387,8 +11389,8 @@ class WebSocketListenerProxy extends jni.JObject { } static final _id_onOpen = _class.instanceMethodId( - r"onOpen", - r"(Lokhttp3/WebSocket;Lokhttp3/Response;)V", + r'onOpen', + r'(Lokhttp3/WebSocket;Lokhttp3/Response;)V', ); static final _onOpen = ProtectedJniExtensions.lookup< @@ -11400,7 +11402,7 @@ class WebSocketListenerProxy extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallVoidMethod") + )>)>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -11416,8 +11418,8 @@ class WebSocketListenerProxy extends jni.JObject { } static final _id_onMessage = _class.instanceMethodId( - r"onMessage", - r"(Lokhttp3/WebSocket;Ljava/lang/String;)V", + r'onMessage', + r'(Lokhttp3/WebSocket;Ljava/lang/String;)V', ); static final _onMessage = ProtectedJniExtensions.lookup< @@ -11429,7 +11431,7 @@ class WebSocketListenerProxy extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallVoidMethod") + )>)>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -11445,8 +11447,8 @@ class WebSocketListenerProxy extends jni.JObject { } static final _id_onMessage1 = _class.instanceMethodId( - r"onMessage", - r"(Lokhttp3/WebSocket;Lokio/ByteString;)V", + r'onMessage', + r'(Lokhttp3/WebSocket;Lokio/ByteString;)V', ); static final _onMessage1 = ProtectedJniExtensions.lookup< @@ -11458,7 +11460,7 @@ class WebSocketListenerProxy extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallVoidMethod") + )>)>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -11474,8 +11476,8 @@ class WebSocketListenerProxy extends jni.JObject { } static final _id_onClosing = _class.instanceMethodId( - r"onClosing", - r"(Lokhttp3/WebSocket;ILjava/lang/String;)V", + r'onClosing', + r'(Lokhttp3/WebSocket;ILjava/lang/String;)V', ); static final _onClosing = ProtectedJniExtensions.lookup< @@ -11488,7 +11490,7 @@ class WebSocketListenerProxy extends jni.JObject { ffi.Pointer, $Int32, ffi.Pointer - )>)>>("globalEnv_CallVoidMethod") + )>)>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, int, ffi.Pointer)>(); @@ -11505,8 +11507,8 @@ class WebSocketListenerProxy extends jni.JObject { } static final _id_onFailure = _class.instanceMethodId( - r"onFailure", - r"(Lokhttp3/WebSocket;Ljava/lang/Throwable;Lokhttp3/Response;)V", + r'onFailure', + r'(Lokhttp3/WebSocket;Ljava/lang/Throwable;Lokhttp3/Response;)V', ); static final _onFailure = ProtectedJniExtensions.lookup< @@ -11519,7 +11521,7 @@ class WebSocketListenerProxy extends jni.JObject { ffi.Pointer, ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallVoidMethod") + )>)>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function( ffi.Pointer, @@ -11549,7 +11551,7 @@ final class $WebSocketListenerProxyType const $WebSocketListenerProxyType(); @override - String get signature => r"Lcom/example/ok_http/WebSocketListenerProxy;"; + String get signature => r'Lcom/example/ok_http/WebSocketListenerProxy;'; @override WebSocketListenerProxy fromReference(jni.JReference reference) => @@ -11580,13 +11582,13 @@ class ByteString_Companion extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okio/ByteString$Companion"); + static final _class = jni.JClass.forName(r'okio/ByteString$Companion'); /// The type which includes information such as the signature of this class. static const type = $ByteString_CompanionType(); static final _id_of = _class.instanceMethodId( - r"of", - r"([B)Lokio/ByteString;", + r'of', + r'([B)Lokio/ByteString;', ); static final _of = ProtectedJniExtensions.lookup< @@ -11595,7 +11597,7 @@ class ByteString_Companion extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -11611,8 +11613,8 @@ class ByteString_Companion extends jni.JObject { } static final _id_of1 = _class.instanceMethodId( - r"of", - r"([BII)Lokio/ByteString;", + r'of', + r'([BII)Lokio/ByteString;', ); static final _of1 = ProtectedJniExtensions.lookup< @@ -11621,7 +11623,7 @@ class ByteString_Companion extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer, $Int32, $Int32)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, int, int)>(); @@ -11639,8 +11641,8 @@ class ByteString_Companion extends jni.JObject { } static final _id_of2 = _class.instanceMethodId( - r"of", - r"(Ljava/nio/ByteBuffer;)Lokio/ByteString;", + r'of', + r'(Ljava/nio/ByteBuffer;)Lokio/ByteString;', ); static final _of2 = ProtectedJniExtensions.lookup< @@ -11649,7 +11651,7 @@ class ByteString_Companion extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -11665,8 +11667,8 @@ class ByteString_Companion extends jni.JObject { } static final _id_encodeUtf8 = _class.instanceMethodId( - r"encodeUtf8", - r"(Ljava/lang/String;)Lokio/ByteString;", + r'encodeUtf8', + r'(Ljava/lang/String;)Lokio/ByteString;', ); static final _encodeUtf8 = ProtectedJniExtensions.lookup< @@ -11675,7 +11677,7 @@ class ByteString_Companion extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -11691,8 +11693,8 @@ class ByteString_Companion extends jni.JObject { } static final _id_encodeString = _class.instanceMethodId( - r"encodeString", - r"(Ljava/lang/String;Ljava/nio/charset/Charset;)Lokio/ByteString;", + r'encodeString', + r'(Ljava/lang/String;Ljava/nio/charset/Charset;)Lokio/ByteString;', ); static final _encodeString = ProtectedJniExtensions.lookup< @@ -11704,7 +11706,7 @@ class ByteString_Companion extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallObjectMethod") + )>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -11724,8 +11726,8 @@ class ByteString_Companion extends jni.JObject { } static final _id_decodeBase64 = _class.instanceMethodId( - r"decodeBase64", - r"(Ljava/lang/String;)Lokio/ByteString;", + r'decodeBase64', + r'(Ljava/lang/String;)Lokio/ByteString;', ); static final _decodeBase64 = ProtectedJniExtensions.lookup< @@ -11734,7 +11736,7 @@ class ByteString_Companion extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -11750,8 +11752,8 @@ class ByteString_Companion extends jni.JObject { } static final _id_decodeHex = _class.instanceMethodId( - r"decodeHex", - r"(Ljava/lang/String;)Lokio/ByteString;", + r'decodeHex', + r'(Ljava/lang/String;)Lokio/ByteString;', ); static final _decodeHex = ProtectedJniExtensions.lookup< @@ -11760,7 +11762,7 @@ class ByteString_Companion extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -11776,8 +11778,8 @@ class ByteString_Companion extends jni.JObject { } static final _id_read = _class.instanceMethodId( - r"read", - r"(Ljava/io/InputStream;I)Lokio/ByteString;", + r'read', + r'(Ljava/io/InputStream;I)Lokio/ByteString;', ); static final _read = ProtectedJniExtensions.lookup< @@ -11786,7 +11788,7 @@ class ByteString_Companion extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer, $Int32)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, int)>(); @@ -11803,7 +11805,7 @@ class ByteString_Companion extends jni.JObject { } static final _id_new0 = _class.constructorId( - r"(Lkotlin/jvm/internal/DefaultConstructorMarker;)V", + r'(Lkotlin/jvm/internal/DefaultConstructorMarker;)V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -11812,7 +11814,7 @@ class ByteString_Companion extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_NewObject") + 'globalEnv_NewObject') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -11835,7 +11837,7 @@ final class $ByteString_CompanionType const $ByteString_CompanionType(); @override - String get signature => r"Lokio/ByteString$Companion;"; + String get signature => r'Lokio/ByteString$Companion;'; @override ByteString_Companion fromReference(jni.JReference reference) => @@ -11866,13 +11868,13 @@ class ByteString extends jni.JObject { jni.JReference reference, ) : super.fromReference(reference); - static final _class = jni.JClass.forName(r"okio/ByteString"); + static final _class = jni.JClass.forName(r'okio/ByteString'); /// The type which includes information such as the signature of this class. static const type = $ByteStringType(); static final _id_Companion = _class.staticFieldId( - r"Companion", - r"Lokio/ByteString$Companion;", + r'Companion', + r'Lokio/ByteString$Companion;', ); /// from: static public final okio.ByteString$Companion Companion @@ -11881,8 +11883,8 @@ class ByteString extends jni.JObject { _id_Companion.get(_class, const $ByteString_CompanionType()); static final _id_EMPTY = _class.staticFieldId( - r"EMPTY", - r"Lokio/ByteString;", + r'EMPTY', + r'Lokio/ByteString;', ); /// from: static public final okio.ByteString EMPTY @@ -11890,7 +11892,7 @@ class ByteString extends jni.JObject { static ByteString get EMPTY => _id_EMPTY.get(_class, const $ByteStringType()); static final _id_new0 = _class.constructorId( - r"([B)V", + r'([B)V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -11899,7 +11901,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_NewObject") + 'globalEnv_NewObject') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -11915,8 +11917,8 @@ class ByteString extends jni.JObject { } static final _id_utf8 = _class.instanceMethodId( - r"utf8", - r"()Ljava/lang/String;", + r'utf8', + r'()Ljava/lang/String;', ); static final _utf8 = ProtectedJniExtensions.lookup< @@ -11924,7 +11926,7 @@ class ByteString extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -11939,8 +11941,8 @@ class ByteString extends jni.JObject { } static final _id_string = _class.instanceMethodId( - r"string", - r"(Ljava/nio/charset/Charset;)Ljava/lang/String;", + r'string', + r'(Ljava/nio/charset/Charset;)Ljava/lang/String;', ); static final _string = ProtectedJniExtensions.lookup< @@ -11949,7 +11951,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -11965,8 +11967,8 @@ class ByteString extends jni.JObject { } static final _id_base64 = _class.instanceMethodId( - r"base64", - r"()Ljava/lang/String;", + r'base64', + r'()Ljava/lang/String;', ); static final _base64 = ProtectedJniExtensions.lookup< @@ -11974,7 +11976,7 @@ class ByteString extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -11989,8 +11991,8 @@ class ByteString extends jni.JObject { } static final _id_md5 = _class.instanceMethodId( - r"md5", - r"()Lokio/ByteString;", + r'md5', + r'()Lokio/ByteString;', ); static final _md5 = ProtectedJniExtensions.lookup< @@ -11998,7 +12000,7 @@ class ByteString extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -12013,8 +12015,8 @@ class ByteString extends jni.JObject { } static final _id_sha1 = _class.instanceMethodId( - r"sha1", - r"()Lokio/ByteString;", + r'sha1', + r'()Lokio/ByteString;', ); static final _sha1 = ProtectedJniExtensions.lookup< @@ -12022,7 +12024,7 @@ class ByteString extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -12037,8 +12039,8 @@ class ByteString extends jni.JObject { } static final _id_sha256 = _class.instanceMethodId( - r"sha256", - r"()Lokio/ByteString;", + r'sha256', + r'()Lokio/ByteString;', ); static final _sha256 = ProtectedJniExtensions.lookup< @@ -12046,7 +12048,7 @@ class ByteString extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -12061,8 +12063,8 @@ class ByteString extends jni.JObject { } static final _id_sha512 = _class.instanceMethodId( - r"sha512", - r"()Lokio/ByteString;", + r'sha512', + r'()Lokio/ByteString;', ); static final _sha512 = ProtectedJniExtensions.lookup< @@ -12070,7 +12072,7 @@ class ByteString extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -12085,8 +12087,8 @@ class ByteString extends jni.JObject { } static final _id_hmacSha1 = _class.instanceMethodId( - r"hmacSha1", - r"(Lokio/ByteString;)Lokio/ByteString;", + r'hmacSha1', + r'(Lokio/ByteString;)Lokio/ByteString;', ); static final _hmacSha1 = ProtectedJniExtensions.lookup< @@ -12095,7 +12097,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -12111,8 +12113,8 @@ class ByteString extends jni.JObject { } static final _id_hmacSha256 = _class.instanceMethodId( - r"hmacSha256", - r"(Lokio/ByteString;)Lokio/ByteString;", + r'hmacSha256', + r'(Lokio/ByteString;)Lokio/ByteString;', ); static final _hmacSha256 = ProtectedJniExtensions.lookup< @@ -12121,7 +12123,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -12137,8 +12139,8 @@ class ByteString extends jni.JObject { } static final _id_hmacSha512 = _class.instanceMethodId( - r"hmacSha512", - r"(Lokio/ByteString;)Lokio/ByteString;", + r'hmacSha512', + r'(Lokio/ByteString;)Lokio/ByteString;', ); static final _hmacSha512 = ProtectedJniExtensions.lookup< @@ -12147,7 +12149,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -12163,8 +12165,8 @@ class ByteString extends jni.JObject { } static final _id_base64Url = _class.instanceMethodId( - r"base64Url", - r"()Ljava/lang/String;", + r'base64Url', + r'()Ljava/lang/String;', ); static final _base64Url = ProtectedJniExtensions.lookup< @@ -12172,7 +12174,7 @@ class ByteString extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -12187,8 +12189,8 @@ class ByteString extends jni.JObject { } static final _id_hex = _class.instanceMethodId( - r"hex", - r"()Ljava/lang/String;", + r'hex', + r'()Ljava/lang/String;', ); static final _hex = ProtectedJniExtensions.lookup< @@ -12196,7 +12198,7 @@ class ByteString extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -12211,8 +12213,8 @@ class ByteString extends jni.JObject { } static final _id_toAsciiLowercase = _class.instanceMethodId( - r"toAsciiLowercase", - r"()Lokio/ByteString;", + r'toAsciiLowercase', + r'()Lokio/ByteString;', ); static final _toAsciiLowercase = ProtectedJniExtensions.lookup< @@ -12220,7 +12222,7 @@ class ByteString extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -12236,8 +12238,8 @@ class ByteString extends jni.JObject { } static final _id_toAsciiUppercase = _class.instanceMethodId( - r"toAsciiUppercase", - r"()Lokio/ByteString;", + r'toAsciiUppercase', + r'()Lokio/ByteString;', ); static final _toAsciiUppercase = ProtectedJniExtensions.lookup< @@ -12245,7 +12247,7 @@ class ByteString extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -12261,14 +12263,14 @@ class ByteString extends jni.JObject { } static final _id_substring = _class.instanceMethodId( - r"substring", - r"(II)Lokio/ByteString;", + r'substring', + r'(II)Lokio/ByteString;', ); static final _substring = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32, $Int32)>)>>("globalEnv_CallObjectMethod") + ffi.VarArgs<($Int32, $Int32)>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, int, int)>(); @@ -12285,14 +12287,14 @@ class ByteString extends jni.JObject { } static final _id_getByte = _class.instanceMethodId( - r"getByte", - r"(I)B", + r'getByte', + r'(I)B', ); static final _getByte = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>("globalEnv_CallByteMethod") + ffi.VarArgs<($Int32,)>)>>('globalEnv_CallByteMethod') .asFunction< jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, int)>(); @@ -12305,8 +12307,8 @@ class ByteString extends jni.JObject { } static final _id_size = _class.instanceMethodId( - r"size", - r"()I", + r'size', + r'()I', ); static final _size = ProtectedJniExtensions.lookup< @@ -12314,7 +12316,7 @@ class ByteString extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallIntMethod") + )>>('globalEnv_CallIntMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -12327,8 +12329,8 @@ class ByteString extends jni.JObject { } static final _id_toByteArray = _class.instanceMethodId( - r"toByteArray", - r"()[B", + r'toByteArray', + r'()[B', ); static final _toByteArray = ProtectedJniExtensions.lookup< @@ -12336,7 +12338,7 @@ class ByteString extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -12351,8 +12353,8 @@ class ByteString extends jni.JObject { } static final _id_asByteBuffer = _class.instanceMethodId( - r"asByteBuffer", - r"()Ljava/nio/ByteBuffer;", + r'asByteBuffer', + r'()Ljava/nio/ByteBuffer;', ); static final _asByteBuffer = ProtectedJniExtensions.lookup< @@ -12360,7 +12362,7 @@ class ByteString extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -12376,8 +12378,8 @@ class ByteString extends jni.JObject { } static final _id_write = _class.instanceMethodId( - r"write", - r"(Ljava/io/OutputStream;)V", + r'write', + r'(Ljava/io/OutputStream;)V', ); static final _write = ProtectedJniExtensions.lookup< @@ -12386,7 +12388,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallVoidMethod") + 'globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -12401,8 +12403,8 @@ class ByteString extends jni.JObject { } static final _id_rangeEquals = _class.instanceMethodId( - r"rangeEquals", - r"(ILokio/ByteString;II)Z", + r'rangeEquals', + r'(ILokio/ByteString;II)Z', ); static final _rangeEquals = ProtectedJniExtensions.lookup< @@ -12416,7 +12418,7 @@ class ByteString extends jni.JObject { ffi.Pointer, $Int32, $Int32 - )>)>>("globalEnv_CallBooleanMethod") + )>)>>('globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, ffi.Pointer, int, int)>(); @@ -12434,8 +12436,8 @@ class ByteString extends jni.JObject { } static final _id_rangeEquals1 = _class.instanceMethodId( - r"rangeEquals", - r"(I[BII)Z", + r'rangeEquals', + r'(I[BII)Z', ); static final _rangeEquals1 = ProtectedJniExtensions.lookup< @@ -12449,7 +12451,7 @@ class ByteString extends jni.JObject { ffi.Pointer, $Int32, $Int32 - )>)>>("globalEnv_CallBooleanMethod") + )>)>>('globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, int, ffi.Pointer, int, int)>(); @@ -12472,8 +12474,8 @@ class ByteString extends jni.JObject { } static final _id_copyInto = _class.instanceMethodId( - r"copyInto", - r"(I[BII)V", + r'copyInto', + r'(I[BII)V', ); static final _copyInto = ProtectedJniExtensions.lookup< @@ -12487,7 +12489,7 @@ class ByteString extends jni.JObject { ffi.Pointer, $Int32, $Int32 - )>)>>("globalEnv_CallVoidMethod") + )>)>>('globalEnv_CallVoidMethod') .asFunction< jni.JThrowablePtr Function(ffi.Pointer, jni.JMethodIDPtr, int, ffi.Pointer, int, int)>(); @@ -12505,8 +12507,8 @@ class ByteString extends jni.JObject { } static final _id_startsWith = _class.instanceMethodId( - r"startsWith", - r"(Lokio/ByteString;)Z", + r'startsWith', + r'(Lokio/ByteString;)Z', ); static final _startsWith = ProtectedJniExtensions.lookup< @@ -12515,7 +12517,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallBooleanMethod") + 'globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -12530,8 +12532,8 @@ class ByteString extends jni.JObject { } static final _id_startsWith1 = _class.instanceMethodId( - r"startsWith", - r"([B)Z", + r'startsWith', + r'([B)Z', ); static final _startsWith1 = ProtectedJniExtensions.lookup< @@ -12540,7 +12542,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallBooleanMethod") + 'globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -12555,8 +12557,8 @@ class ByteString extends jni.JObject { } static final _id_endsWith = _class.instanceMethodId( - r"endsWith", - r"(Lokio/ByteString;)Z", + r'endsWith', + r'(Lokio/ByteString;)Z', ); static final _endsWith = ProtectedJniExtensions.lookup< @@ -12565,7 +12567,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallBooleanMethod") + 'globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -12580,8 +12582,8 @@ class ByteString extends jni.JObject { } static final _id_endsWith1 = _class.instanceMethodId( - r"endsWith", - r"([B)Z", + r'endsWith', + r'([B)Z', ); static final _endsWith1 = ProtectedJniExtensions.lookup< @@ -12590,7 +12592,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallBooleanMethod") + 'globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -12605,8 +12607,8 @@ class ByteString extends jni.JObject { } static final _id_indexOf = _class.instanceMethodId( - r"indexOf", - r"(Lokio/ByteString;I)I", + r'indexOf', + r'(Lokio/ByteString;I)I', ); static final _indexOf = ProtectedJniExtensions.lookup< @@ -12615,7 +12617,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer, $Int32)>)>>( - "globalEnv_CallIntMethod") + 'globalEnv_CallIntMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, int)>(); @@ -12631,8 +12633,8 @@ class ByteString extends jni.JObject { } static final _id_indexOf1 = _class.instanceMethodId( - r"indexOf", - r"([BI)I", + r'indexOf', + r'([BI)I', ); static final _indexOf1 = ProtectedJniExtensions.lookup< @@ -12641,7 +12643,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer, $Int32)>)>>( - "globalEnv_CallIntMethod") + 'globalEnv_CallIntMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, int)>(); @@ -12657,8 +12659,8 @@ class ByteString extends jni.JObject { } static final _id_lastIndexOf = _class.instanceMethodId( - r"lastIndexOf", - r"(Lokio/ByteString;I)I", + r'lastIndexOf', + r'(Lokio/ByteString;I)I', ); static final _lastIndexOf = ProtectedJniExtensions.lookup< @@ -12667,7 +12669,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer, $Int32)>)>>( - "globalEnv_CallIntMethod") + 'globalEnv_CallIntMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, int)>(); @@ -12683,8 +12685,8 @@ class ByteString extends jni.JObject { } static final _id_lastIndexOf1 = _class.instanceMethodId( - r"lastIndexOf", - r"([BI)I", + r'lastIndexOf', + r'([BI)I', ); static final _lastIndexOf1 = ProtectedJniExtensions.lookup< @@ -12693,7 +12695,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer, $Int32)>)>>( - "globalEnv_CallIntMethod") + 'globalEnv_CallIntMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, int)>(); @@ -12709,8 +12711,8 @@ class ByteString extends jni.JObject { } static final _id_equals = _class.instanceMethodId( - r"equals", - r"(Ljava/lang/Object;)Z", + r'equals', + r'(Ljava/lang/Object;)Z', ); static final _equals = ProtectedJniExtensions.lookup< @@ -12719,7 +12721,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallBooleanMethod") + 'globalEnv_CallBooleanMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -12734,8 +12736,8 @@ class ByteString extends jni.JObject { } static final _id_hashCode1 = _class.instanceMethodId( - r"hashCode", - r"()I", + r'hashCode', + r'()I', ); static final _hashCode1 = ProtectedJniExtensions.lookup< @@ -12743,7 +12745,7 @@ class ByteString extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallIntMethod") + )>>('globalEnv_CallIntMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -12757,8 +12759,8 @@ class ByteString extends jni.JObject { } static final _id_compareTo = _class.instanceMethodId( - r"compareTo", - r"(Lokio/ByteString;)I", + r'compareTo', + r'(Lokio/ByteString;)I', ); static final _compareTo = ProtectedJniExtensions.lookup< @@ -12767,7 +12769,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallIntMethod") + 'globalEnv_CallIntMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -12782,8 +12784,8 @@ class ByteString extends jni.JObject { } static final _id_toString1 = _class.instanceMethodId( - r"toString", - r"()Ljava/lang/String;", + r'toString', + r'()Ljava/lang/String;', ); static final _toString1 = ProtectedJniExtensions.lookup< @@ -12791,7 +12793,7 @@ class ByteString extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -12806,14 +12808,14 @@ class ByteString extends jni.JObject { } static final _id_substring1 = _class.instanceMethodId( - r"substring", - r"(I)Lokio/ByteString;", + r'substring', + r'(I)Lokio/ByteString;', ); static final _substring1 = ProtectedJniExtensions.lookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, - ffi.VarArgs<($Int32,)>)>>("globalEnv_CallObjectMethod") + ffi.VarArgs<($Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, int)>(); @@ -12828,8 +12830,8 @@ class ByteString extends jni.JObject { } static final _id_substring2 = _class.instanceMethodId( - r"substring", - r"()Lokio/ByteString;", + r'substring', + r'()Lokio/ByteString;', ); static final _substring2 = ProtectedJniExtensions.lookup< @@ -12837,7 +12839,7 @@ class ByteString extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_CallObjectMethod") + )>>('globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -12852,8 +12854,8 @@ class ByteString extends jni.JObject { } static final _id_indexOf2 = _class.instanceMethodId( - r"indexOf", - r"(Lokio/ByteString;)I", + r'indexOf', + r'(Lokio/ByteString;)I', ); static final _indexOf2 = ProtectedJniExtensions.lookup< @@ -12862,7 +12864,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallIntMethod") + 'globalEnv_CallIntMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -12877,8 +12879,8 @@ class ByteString extends jni.JObject { } static final _id_indexOf3 = _class.instanceMethodId( - r"indexOf", - r"([B)I", + r'indexOf', + r'([B)I', ); static final _indexOf3 = ProtectedJniExtensions.lookup< @@ -12887,7 +12889,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallIntMethod") + 'globalEnv_CallIntMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -12902,8 +12904,8 @@ class ByteString extends jni.JObject { } static final _id_lastIndexOf2 = _class.instanceMethodId( - r"lastIndexOf", - r"(Lokio/ByteString;)I", + r'lastIndexOf', + r'(Lokio/ByteString;)I', ); static final _lastIndexOf2 = ProtectedJniExtensions.lookup< @@ -12912,7 +12914,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallIntMethod") + 'globalEnv_CallIntMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -12927,8 +12929,8 @@ class ByteString extends jni.JObject { } static final _id_lastIndexOf3 = _class.instanceMethodId( - r"lastIndexOf", - r"([B)I", + r'lastIndexOf', + r'([B)I', ); static final _lastIndexOf3 = ProtectedJniExtensions.lookup< @@ -12937,7 +12939,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallIntMethod") + 'globalEnv_CallIntMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -12952,8 +12954,8 @@ class ByteString extends jni.JObject { } static final _id_of = _class.staticMethodId( - r"of", - r"([B)Lokio/ByteString;", + r'of', + r'([B)Lokio/ByteString;', ); static final _of = ProtectedJniExtensions.lookup< @@ -12962,7 +12964,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallStaticObjectMethod") + 'globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -12978,8 +12980,8 @@ class ByteString extends jni.JObject { } static final _id_of1 = _class.staticMethodId( - r"of", - r"([BII)Lokio/ByteString;", + r'of', + r'([BII)Lokio/ByteString;', ); static final _of1 = ProtectedJniExtensions.lookup< @@ -12988,7 +12990,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer, $Int32, $Int32)>)>>( - "globalEnv_CallStaticObjectMethod") + 'globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, int, int)>(); @@ -13006,8 +13008,8 @@ class ByteString extends jni.JObject { } static final _id_of2 = _class.staticMethodId( - r"of", - r"(Ljava/nio/ByteBuffer;)Lokio/ByteString;", + r'of', + r'(Ljava/nio/ByteBuffer;)Lokio/ByteString;', ); static final _of2 = ProtectedJniExtensions.lookup< @@ -13016,7 +13018,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallStaticObjectMethod") + 'globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -13032,8 +13034,8 @@ class ByteString extends jni.JObject { } static final _id_encodeUtf8 = _class.staticMethodId( - r"encodeUtf8", - r"(Ljava/lang/String;)Lokio/ByteString;", + r'encodeUtf8', + r'(Ljava/lang/String;)Lokio/ByteString;', ); static final _encodeUtf8 = ProtectedJniExtensions.lookup< @@ -13042,7 +13044,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallStaticObjectMethod") + 'globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -13058,8 +13060,8 @@ class ByteString extends jni.JObject { } static final _id_encodeString = _class.staticMethodId( - r"encodeString", - r"(Ljava/lang/String;Ljava/nio/charset/Charset;)Lokio/ByteString;", + r'encodeString', + r'(Ljava/lang/String;Ljava/nio/charset/Charset;)Lokio/ByteString;', ); static final _encodeString = ProtectedJniExtensions.lookup< @@ -13071,7 +13073,7 @@ class ByteString extends jni.JObject { ( ffi.Pointer, ffi.Pointer - )>)>>("globalEnv_CallStaticObjectMethod") + )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, ffi.Pointer)>(); @@ -13091,8 +13093,8 @@ class ByteString extends jni.JObject { } static final _id_decodeBase64 = _class.staticMethodId( - r"decodeBase64", - r"(Ljava/lang/String;)Lokio/ByteString;", + r'decodeBase64', + r'(Ljava/lang/String;)Lokio/ByteString;', ); static final _decodeBase64 = ProtectedJniExtensions.lookup< @@ -13101,7 +13103,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallStaticObjectMethod") + 'globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -13117,8 +13119,8 @@ class ByteString extends jni.JObject { } static final _id_decodeHex = _class.staticMethodId( - r"decodeHex", - r"(Ljava/lang/String;)Lokio/ByteString;", + r'decodeHex', + r'(Ljava/lang/String;)Lokio/ByteString;', ); static final _decodeHex = ProtectedJniExtensions.lookup< @@ -13127,7 +13129,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallStaticObjectMethod") + 'globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -13143,8 +13145,8 @@ class ByteString extends jni.JObject { } static final _id_read = _class.staticMethodId( - r"read", - r"(Ljava/io/InputStream;I)Lokio/ByteString;", + r'read', + r'(Ljava/io/InputStream;I)Lokio/ByteString;', ); static final _read = ProtectedJniExtensions.lookup< @@ -13153,7 +13155,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer, $Int32)>)>>( - "globalEnv_CallStaticObjectMethod") + 'globalEnv_CallStaticObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer, int)>(); @@ -13170,8 +13172,8 @@ class ByteString extends jni.JObject { } static final _id_compareTo1 = _class.instanceMethodId( - r"compareTo", - r"(Ljava/lang/Object;)I", + r'compareTo', + r'(Ljava/lang/Object;)I', ); static final _compareTo1 = ProtectedJniExtensions.lookup< @@ -13180,7 +13182,7 @@ class ByteString extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallIntMethod") + 'globalEnv_CallIntMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -13199,7 +13201,7 @@ final class $ByteStringType extends jni.JObjType { const $ByteStringType(); @override - String get signature => r"Lokio/ByteString;"; + String get signature => r'Lokio/ByteString;'; @override ByteString fromReference(jni.JReference reference) => @@ -13230,13 +13232,13 @@ class WebSocketInterceptor_Companion extends jni.JObject { ) : super.fromReference(reference); static final _class = - jni.JClass.forName(r"com/example/ok_http/WebSocketInterceptor$Companion"); + jni.JClass.forName(r'com/example/ok_http/WebSocketInterceptor$Companion'); /// The type which includes information such as the signature of this class. static const type = $WebSocketInterceptor_CompanionType(); static final _id_addWSInterceptor = _class.instanceMethodId( - r"addWSInterceptor", - r"(Lokhttp3/OkHttpClient$Builder;)Lokhttp3/OkHttpClient$Builder;", + r'addWSInterceptor', + r'(Lokhttp3/OkHttpClient$Builder;)Lokhttp3/OkHttpClient$Builder;', ); static final _addWSInterceptor = ProtectedJniExtensions.lookup< @@ -13245,7 +13247,7 @@ class WebSocketInterceptor_Companion extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_CallObjectMethod") + 'globalEnv_CallObjectMethod') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -13261,7 +13263,7 @@ class WebSocketInterceptor_Companion extends jni.JObject { } static final _id_new0 = _class.constructorId( - r"(Lkotlin/jvm/internal/DefaultConstructorMarker;)V", + r'(Lkotlin/jvm/internal/DefaultConstructorMarker;)V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -13270,7 +13272,7 @@ class WebSocketInterceptor_Companion extends jni.JObject { ffi.Pointer, jni.JMethodIDPtr, ffi.VarArgs<(ffi.Pointer,)>)>>( - "globalEnv_NewObject") + 'globalEnv_NewObject') .asFunction< jni.JniResult Function(ffi.Pointer, jni.JMethodIDPtr, ffi.Pointer)>(); @@ -13294,7 +13296,7 @@ final class $WebSocketInterceptor_CompanionType @override String get signature => - r"Lcom/example/ok_http/WebSocketInterceptor$Companion;"; + r'Lcom/example/ok_http/WebSocketInterceptor$Companion;'; @override WebSocketInterceptor_Companion fromReference(jni.JReference reference) => @@ -13326,13 +13328,13 @@ class WebSocketInterceptor extends jni.JObject { ) : super.fromReference(reference); static final _class = - jni.JClass.forName(r"com/example/ok_http/WebSocketInterceptor"); + jni.JClass.forName(r'com/example/ok_http/WebSocketInterceptor'); /// The type which includes information such as the signature of this class. static const type = $WebSocketInterceptorType(); static final _id_Companion = _class.staticFieldId( - r"Companion", - r"Lcom/example/ok_http/WebSocketInterceptor$Companion;", + r'Companion', + r'Lcom/example/ok_http/WebSocketInterceptor$Companion;', ); /// from: static public final com.example.ok_http.WebSocketInterceptor$Companion Companion @@ -13341,7 +13343,7 @@ class WebSocketInterceptor extends jni.JObject { _id_Companion.get(_class, const $WebSocketInterceptor_CompanionType()); static final _id_new0 = _class.constructorId( - r"()V", + r'()V', ); static final _new0 = ProtectedJniExtensions.lookup< @@ -13349,7 +13351,7 @@ class WebSocketInterceptor extends jni.JObject { jni.JniResult Function( ffi.Pointer, jni.JMethodIDPtr, - )>>("globalEnv_NewObject") + )>>('globalEnv_NewObject') .asFunction< jni.JniResult Function( ffi.Pointer, @@ -13370,7 +13372,7 @@ final class $WebSocketInterceptorType const $WebSocketInterceptorType(); @override - String get signature => r"Lcom/example/ok_http/WebSocketInterceptor;"; + String get signature => r'Lcom/example/ok_http/WebSocketInterceptor;'; @override WebSocketInterceptor fromReference(jni.JReference reference) => diff --git a/pkgs/ok_http/lib/src/ok_http_client.dart b/pkgs/ok_http/lib/src/ok_http_client.dart index f6f973514e..752dbaa41a 100644 --- a/pkgs/ok_http/lib/src/ok_http_client.dart +++ b/pkgs/ok_http/lib/src/ok_http_client.dart @@ -287,5 +287,5 @@ extension on Uint8List { extension on JArray { Uint8List toUint8List({int? length}) => - Uint8List.fromList(getRange(0, length ?? this.length)); + getRange(0, length ?? this.length).buffer.asUint8List(); } diff --git a/pkgs/ok_http/lib/src/ok_http_web_socket.dart b/pkgs/ok_http/lib/src/ok_http_web_socket.dart index f0d609e24a..4136a62852 100644 --- a/pkgs/ok_http/lib/src/ok_http_web_socket.dart +++ b/pkgs/ok_http/lib/src/ok_http_web_socket.dart @@ -225,5 +225,5 @@ extension on Uint8List { extension on JArray { Uint8List toUint8List({int? length}) => - Uint8List.fromList(getRange(0, length ?? this.length)); + getRange(0, length ?? this.length).buffer.asUint8List(); } diff --git a/pkgs/ok_http/pubspec.yaml b/pkgs/ok_http/pubspec.yaml index 05c173bbb3..f2b817dc8a 100644 --- a/pkgs/ok_http/pubspec.yaml +++ b/pkgs/ok_http/pubspec.yaml @@ -14,13 +14,13 @@ dependencies: sdk: flutter http: ^1.2.1 http_profile: ^0.1.0 - jni: ^0.9.3 + jni: ^0.10.1 plugin_platform_interface: ^2.0.2 web_socket: ^0.1.5 dev_dependencies: dart_flutter_team_lints: ^3.0.0 - jnigen: ^0.9.3 + jnigen: ^0.10.0 flutter: plugin: