You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The android-jca-branch imports impl_jni whenever dart.library.ffi is true, so JNI replaces FFI on Android and desktop native targets. Independently, hook/build.dart builds and registers libwebcrypto.so for every code-asset target. A JCA test build therefore still packages this package's BoringSSL library.
The core package:webcrypto pubspec does not require Flutter. package:jni 1.0.0 requires Flutter 3.35.6 or newer and registers platform plugins, so keeping JNI in the core dependency graph would change which applications can depend on package:webcrypto.
Runtime registration and native-asset packaging need separate controls. Registering a Dart backend cannot stop the build hook from packaging libwebcrypto.so; the build must know whether the application selected a JCA-only Android configuration.
Draft PR #326 changes native linking and adds BoringSSL symbol tree shaking. If it lands, measure whether a JCA-only build still emits a native asset instead of treating symbol removal as asset omission.
Candidate Package Split
Put the JNI/JCA implementation and package:jni dependency in a companion package:webcrypto_jca package.
Expose a supported backend interface and registration hook from package:webcrypto.
Require each isolate to register the JCA backend before its first Web Crypto operation.
Add an explicit Android build setting that tells the webcrypto build hook when it may omit libwebcrypto.so.
Maintainers still need to decide whether to use this package split.
Decisions Needed
Decide whether JNI belongs in package:webcrypto or a Flutter-only companion package.
Decide whether the prototype may use version-locked private package:webcrypto/src/... imports, or whether package:webcrypto must expose a supported backend interface and registration hook first.
Define registration, repeated-registration, and per-isolate behavior.
Choose the build setting, such as a build-hook user define, that permits omission of libwebcrypto.so only for an Android JCA build.
Define how the build confirms that the companion package is present before it omits BoringSSL, and how runtime reports missing registration.
Decide whether JCA opt-in must exclude FFI or may keep an FFI fallback for PBKDF2.
Validation Required
Add build-hook tests for the default build, Android JCA opt-in, invalid setting values, and non-Android targets.
Compare release APK/AAB contents and size with the default FFI build.
Problem
The
android-jca-branchimportsimpl_jniwheneverdart.library.ffiis true, so JNI replaces FFI on Android and desktop native targets. Independently,hook/build.dartbuilds and registerslibwebcrypto.sofor every code-asset target. A JCA test build therefore still packages this package's BoringSSL library.The core
package:webcryptopubspec does not require Flutter.package:jni1.0.0 requires Flutter 3.35.6 or newer and registers platform plugins, so keeping JNI in the core dependency graph would change which applications can depend onpackage:webcrypto.Runtime registration and native-asset packaging need separate controls. Registering a Dart backend cannot stop the build hook from packaging
libwebcrypto.so; the build must know whether the application selected a JCA-only Android configuration.Draft PR #326 changes native linking and adds BoringSSL symbol tree shaking. If it lands, measure whether a JCA-only build still emits a native asset instead of treating symbol removal as asset omission.
Candidate Package Split
package:jnidependency in a companionpackage:webcrypto_jcapackage.package:webcrypto.webcryptobuild hook when it may omitlibwebcrypto.so.Maintainers still need to decide whether to use this package split.
Decisions Needed
package:webcryptoor a Flutter-only companion package.package:webcrypto/src/...imports, or whetherpackage:webcryptomust expose a supported backend interface and registration hook first.libwebcrypto.soonly for an Android JCA build.Validation Required
Related: #296, #326, #357