@annadata/capacitor-mqtt-quic 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AnnadataCapacitorMqttQuic.podspec +2 -2
- package/Package.swift +59 -0
- package/README.md +57 -17
- package/android/NGTCP2_BUILD_INSTRUCTIONS.md +1 -1
- package/android/app/src/main/assets/capacitor.config.json +1 -1
- package/android/build-wolfssl.sh +8 -2
- package/android/build.gradle +4 -1
- package/android/install/nghttp3-android/arm64-v8a/lib/libnghttp3.a +0 -0
- package/android/install/nghttp3-android/arm64-v8a/lib/libnghttp3.so +0 -0
- package/android/install/nghttp3-android/arm64-v8a/lib/pkgconfig/libnghttp3.pc +4 -4
- package/android/install/nghttp3-android/armeabi-v7a/lib/libnghttp3.a +0 -0
- package/android/install/nghttp3-android/armeabi-v7a/lib/libnghttp3.so +0 -0
- package/android/install/nghttp3-android/armeabi-v7a/lib/pkgconfig/libnghttp3.pc +4 -4
- package/android/install/nghttp3-android/x86_64/lib/libnghttp3.a +0 -0
- package/android/install/nghttp3-android/x86_64/lib/libnghttp3.so +0 -0
- package/android/install/nghttp3-android/x86_64/lib/pkgconfig/libnghttp3.pc +4 -4
- package/android/install/ngtcp2-android/arm64-v8a/lib/libngtcp2.a +0 -0
- package/android/install/ngtcp2-android/arm64-v8a/lib/libngtcp2.so +0 -0
- package/android/install/ngtcp2-android/arm64-v8a/lib/libngtcp2_crypto_wolfssl.a +0 -0
- package/android/install/ngtcp2-android/arm64-v8a/lib/libngtcp2_crypto_wolfssl.so +0 -0
- package/android/install/ngtcp2-android/arm64-v8a/lib/pkgconfig/libngtcp2.pc +4 -4
- package/android/install/ngtcp2-android/arm64-v8a/lib/pkgconfig/libngtcp2_crypto_wolfssl.pc +4 -4
- package/android/install/ngtcp2-android/armeabi-v7a/lib/libngtcp2.a +0 -0
- package/android/install/ngtcp2-android/armeabi-v7a/lib/libngtcp2.so +0 -0
- package/android/install/ngtcp2-android/armeabi-v7a/lib/libngtcp2_crypto_wolfssl.a +0 -0
- package/android/install/ngtcp2-android/armeabi-v7a/lib/libngtcp2_crypto_wolfssl.so +0 -0
- package/android/install/ngtcp2-android/armeabi-v7a/lib/pkgconfig/libngtcp2.pc +4 -4
- package/android/install/ngtcp2-android/armeabi-v7a/lib/pkgconfig/libngtcp2_crypto_wolfssl.pc +4 -4
- package/android/install/ngtcp2-android/x86_64/lib/libngtcp2.a +0 -0
- package/android/install/ngtcp2-android/x86_64/lib/libngtcp2.so +0 -0
- package/android/install/ngtcp2-android/x86_64/lib/libngtcp2_crypto_wolfssl.a +0 -0
- package/android/install/ngtcp2-android/x86_64/lib/libngtcp2_crypto_wolfssl.so +0 -0
- package/android/install/ngtcp2-android/x86_64/lib/pkgconfig/libngtcp2.pc +4 -4
- package/android/install/ngtcp2-android/x86_64/lib/pkgconfig/libngtcp2_crypto_wolfssl.pc +4 -4
- package/android/install/wolfssl-android/arm64-v8a/bin/wolfssl-config +1 -1
- package/android/install/wolfssl-android/arm64-v8a/lib/libwolfssl.a +0 -0
- package/android/install/wolfssl-android/arm64-v8a/lib/libwolfssl.la +1 -1
- package/android/install/wolfssl-android/arm64-v8a/lib/pkgconfig/wolfssl.pc +1 -1
- package/android/install/wolfssl-android/armeabi-v7a/bin/wolfssl-config +1 -1
- package/android/install/wolfssl-android/armeabi-v7a/lib/libwolfssl.a +0 -0
- package/android/install/wolfssl-android/armeabi-v7a/lib/libwolfssl.la +1 -1
- package/android/install/wolfssl-android/armeabi-v7a/lib/pkgconfig/wolfssl.pc +1 -1
- package/android/install/wolfssl-android/x86_64/bin/wolfssl-config +1 -1
- package/android/install/wolfssl-android/x86_64/lib/libwolfssl.a +0 -0
- package/android/install/wolfssl-android/x86_64/lib/libwolfssl.la +1 -1
- package/android/install/wolfssl-android/x86_64/lib/pkgconfig/wolfssl.pc +1 -1
- package/android/src/main/cpp/CMakeLists.txt +19 -5
- package/android/src/main/cpp/ngtcp2_jni.cpp +119 -32
- package/android/src/main/kotlin/ai/annadata/mqttquic/MqttQuicPlugin.kt +60 -5
- package/android/src/main/kotlin/ai/annadata/mqttquic/client/MQTTClient.kt +233 -84
- package/android/src/main/kotlin/ai/annadata/mqttquic/mqtt/MQTTProtocol.kt +36 -5
- package/android/src/main/kotlin/ai/annadata/mqttquic/mqtt/MQTTTypes.kt +15 -15
- package/android/src/main/kotlin/ai/annadata/mqttquic/quic/NGTCP2Client.kt +26 -15
- package/android/src/main/kotlin/ai/annadata/mqttquic/quic/QuicClientStub.kt +1 -1
- package/android/src/main/kotlin/ai/annadata/mqttquic/quic/QuicTypes.kt +1 -1
- package/android/src/main/kotlin/ai/annadata/mqttquic/transport/QUICStreamAdapter.kt +80 -5
- package/android/src/main/kotlin/ai/annadata/mqttquic/transport/StreamTransport.kt +4 -0
- package/docs/IMPLEMENTATION_SUMMARY.md +1 -1
- package/docs/NGTCP2_IMPLEMENTATION_STATUS.md +1 -1
- package/docs/PRODUCTION_PUBLISH_STEPS.md +9 -3
- package/docs/diff-node_modules-vs-standalone-android-src.patch +1031 -0
- package/ios/{MqttQuicPlugin.podspec → AnnadataCapacitorMqttQuic.podspec} +4 -4
- package/ios/App/App/capacitor.config.json +1 -1
- package/ios/NGTCP2_BUILD_INSTRUCTIONS.md +3 -3
- package/ios/Package.swift +7 -8
- package/ios/Tests/MQTTProtocolTests.swift +1 -1
- package/ios/build-wolfssl.sh +8 -3
- package/ios/libs/libnghttp3.a +0 -0
- package/ios/libs/libngtcp2.a +0 -0
- package/ios/libs/libngtcp2_crypto_wolfssl.a +0 -0
- package/ios/libs/libwolfssl.a +0 -0
- package/ios/libs-simulator/libnghttp3.a +0 -0
- package/ios/libs-simulator/libngtcp2.a +0 -0
- package/ios/libs-simulator/libngtcp2_crypto_wolfssl.a +0 -0
- package/ios/libs-simulator/libwolfssl.a +0 -0
- package/ios/libs-simulator-x86_64/libnghttp3.a +0 -0
- package/ios/libs-simulator-x86_64/libngtcp2.a +0 -0
- package/ios/libs-simulator-x86_64/libngtcp2_crypto_wolfssl.a +0 -0
- package/ios/libs-simulator-x86_64/libwolfssl.a +0 -0
- package/package.json +5 -2
- package/ios/libs/MqttQuicLibs.xcframework/Info.plist +0 -44
- package/ios/libs/MqttQuicLibs.xcframework/ios-arm64/libmqttquic_native_device.a +0 -0
- package/ios/libs/MqttQuicLibs.xcframework/ios-arm64_x86_64-simulator/libmqttquic_native_simulator.a +0 -0
|
@@ -8,8 +8,8 @@ Pod::Spec.new do |s|
|
|
|
8
8
|
s.summary = 'MQTT-over-QUIC Capacitor plugin (iOS)'
|
|
9
9
|
s.license = package['license']
|
|
10
10
|
s.homepage = 'https://github.com/annadata/capacitor-mqtt-quic'
|
|
11
|
-
s.author = 'Yakub Mohammad'
|
|
12
|
-
s.authors = { 'Yakub Mohammad' => 'yakub@annadata.ai' }
|
|
11
|
+
s.author = 'Mr. Yakub Mohammad'
|
|
12
|
+
s.authors = { 'Mr. Yakub Mohammad' => 'yakub@annadata.ai' }
|
|
13
13
|
s.source = { :git => 'https://github.com/annadata/capacitor-mqtt-quic', :tag => s.version.to_s }
|
|
14
14
|
s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
15
15
|
s.resources = ['ios/Sources/MqttQuicPlugin/Resources/*.pem']
|
package/Package.swift
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// swift-tools-version: 5.9
|
|
2
|
+
import PackageDescription
|
|
3
|
+
|
|
4
|
+
// AnnadataCapacitorMqttQuic – Swift Package for Capacitor 8 (SPM).
|
|
5
|
+
// At plugin root so Capacitor's SPM logic detects and adds it to CapApp-SPM automatically.
|
|
6
|
+
// Requires ios/libs/MqttQuicLibs.xcframework. After building (see build-native.sh), run:
|
|
7
|
+
// cd ios && ./create-xcframework.sh
|
|
8
|
+
let package = Package(
|
|
9
|
+
name: "AnnadataCapacitorMqttQuic",
|
|
10
|
+
platforms: [.iOS(.v15)],
|
|
11
|
+
products: [
|
|
12
|
+
.library(
|
|
13
|
+
name: "AnnadataCapacitorMqttQuic",
|
|
14
|
+
targets: ["AnnadataCapacitorMqttQuic"]
|
|
15
|
+
)
|
|
16
|
+
],
|
|
17
|
+
dependencies: [
|
|
18
|
+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0")
|
|
19
|
+
],
|
|
20
|
+
targets: [
|
|
21
|
+
.binaryTarget(
|
|
22
|
+
name: "MqttQuicLibs",
|
|
23
|
+
path: "ios/libs/MqttQuicLibs.xcframework"
|
|
24
|
+
),
|
|
25
|
+
.target(
|
|
26
|
+
name: "NGTCP2Bridge",
|
|
27
|
+
dependencies: ["MqttQuicLibs"],
|
|
28
|
+
path: "ios/Sources/MqttQuicPlugin/QUIC",
|
|
29
|
+
sources: ["NGTCP2Bridge.mm"],
|
|
30
|
+
publicHeadersPath: ".",
|
|
31
|
+
cxxSettings: [
|
|
32
|
+
.define("NGTCP2_ENABLED"),
|
|
33
|
+
.define("NGHTTP3_ENABLED"),
|
|
34
|
+
.headerSearchPath("../../../include")
|
|
35
|
+
],
|
|
36
|
+
linkerSettings: [
|
|
37
|
+
.linkedLibrary("c++")
|
|
38
|
+
]
|
|
39
|
+
),
|
|
40
|
+
.target(
|
|
41
|
+
name: "AnnadataCapacitorMqttQuic",
|
|
42
|
+
dependencies: [
|
|
43
|
+
"NGTCP2Bridge",
|
|
44
|
+
.product(name: "Capacitor", package: "capacitor-swift-pm")
|
|
45
|
+
],
|
|
46
|
+
path: "ios/Sources/MqttQuicPlugin",
|
|
47
|
+
exclude: [
|
|
48
|
+
"MQTT/MQTT5ReasonCodes.swift.rej",
|
|
49
|
+
"QUIC/NGTCP2Bridge.mm",
|
|
50
|
+
"QUIC/NGTCP2Bridge.h"
|
|
51
|
+
],
|
|
52
|
+
resources: [.process("Resources")],
|
|
53
|
+
swiftSettings: [
|
|
54
|
+
.define("NGTCP2_ENABLED"),
|
|
55
|
+
.define("NGHTTP3_ENABLED")
|
|
56
|
+
]
|
|
57
|
+
)
|
|
58
|
+
]
|
|
59
|
+
)
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
MQTT-over-QUIC Capacitor plugin for **iOS**, **Android**, and **Web (browser/PWA)**. Native: ngtcp2 + WolfSSL for QUIC; Web: MQTT over WebSocket (WSS), same API and event listeners.
|
|
4
4
|
|
|
5
|
-
**Capacitor:**
|
|
5
|
+
**Capacitor:** **8.0+** (tested with Capacitor 8).
|
|
6
6
|
|
|
7
7
|
**Features:**
|
|
8
8
|
- ✅ **MQTT 5.0** support with full properties and reason codes
|
|
@@ -20,7 +20,7 @@ MQTT-over-QUIC Capacitor plugin for **iOS**, **Android**, and **Web (browser/PWA
|
|
|
20
20
|
- Transport abstraction (StreamReader/StreamWriter)
|
|
21
21
|
- **Phase 2**: QUIC transport (ngtcp2) + stream adapters - **In Progress** ⏳
|
|
22
22
|
- Currently uses stub implementations for testing
|
|
23
|
-
- See [NGTCP2_INTEGRATION_PLAN.md](./NGTCP2_INTEGRATION_PLAN.md) for build instructions
|
|
23
|
+
- See [NGTCP2_INTEGRATION_PLAN.md](./docs/NGTCP2_INTEGRATION_PLAN.md) for build instructions
|
|
24
24
|
- **Phase 3**: MQTT client API + Capacitor plugin bridge - **Complete** ✅
|
|
25
25
|
- **Phase 4**: Platform integration in annadata-production - **Complete** ✅
|
|
26
26
|
|
|
@@ -274,7 +274,7 @@ await MqttQuic.publish({
|
|
|
274
274
|
| **Reason Codes** | Detailed error information | Better debugging |
|
|
275
275
|
| **Topic Aliases** | Reduce bandwidth | High-frequency publishing |
|
|
276
276
|
|
|
277
|
-
See [MQTT5_IMPLEMENTATION_COMPLETE.md](./MQTT5_IMPLEMENTATION_COMPLETE.md) for full details.
|
|
277
|
+
See [MQTT5_IMPLEMENTATION_COMPLETE.md](./docs/MQTT5_IMPLEMENTATION_COMPLETE.md) for full details.
|
|
278
278
|
|
|
279
279
|
## TypeScript Interface
|
|
280
280
|
|
|
@@ -357,22 +357,25 @@ This script builds WolfSSL → nghttp3 → ngtcp2 in the correct order for both
|
|
|
357
357
|
For detailed manual build instructions, see:
|
|
358
358
|
- **iOS**: [ios/NGTCP2_BUILD_INSTRUCTIONS.md](./ios/NGTCP2_BUILD_INSTRUCTIONS.md)
|
|
359
359
|
- **Android**: [android/NGTCP2_BUILD_INSTRUCTIONS.md](./android/NGTCP2_BUILD_INSTRUCTIONS.md)
|
|
360
|
-
- **Full Plan**: [NGTCP2_INTEGRATION_PLAN.md](./NGTCP2_INTEGRATION_PLAN.md)
|
|
360
|
+
- **Full Plan**: [NGTCP2_INTEGRATION_PLAN.md](./docs/NGTCP2_INTEGRATION_PLAN.md)
|
|
361
361
|
|
|
362
362
|
**Prerequisites:**
|
|
363
|
-
- iOS: macOS with Xcode
|
|
363
|
+
- iOS: macOS with Xcode 15+
|
|
364
364
|
- Android: Android Studio with NDK r25+ (auto-detected from `$ANDROID_HOME`)
|
|
365
365
|
|
|
366
366
|
## Production / First-time build
|
|
367
367
|
|
|
368
|
-
When you install the plugin from npm (`npm install @annadata/capacitor-mqtt-quic`), the published package may include **prebuilt native libs** (iOS and optionally Android, both using **WolfSSL**).
|
|
368
|
+
When you install the plugin from npm (`npm install @annadata/capacitor-mqtt-quic`), the published package **may** include **prebuilt native libs** (iOS and optionally Android, both using **WolfSSL**). If it does (a "complete" / zero-config package), you only need:
|
|
369
369
|
|
|
370
370
|
```bash
|
|
371
371
|
npm install @annadata/capacitor-mqtt-quic
|
|
372
372
|
npx cap sync
|
|
373
|
+
ionic cap run android # or ios
|
|
373
374
|
```
|
|
374
375
|
|
|
375
|
-
**If your Android build fails with "WolfSSL not found"**,
|
|
376
|
+
**If your Android build fails with "WolfSSL not found"**, the package you installed does not include prebuilt Android libs. Do **one** of the following.
|
|
377
|
+
|
|
378
|
+
**Option A – One-time build (from your app project root, requires Android NDK r25+):** Both iOS and Android use **WolfSSL** as the TLS backend (license/size/QUIC support):
|
|
376
379
|
|
|
377
380
|
```bash
|
|
378
381
|
cd node_modules/@annadata/capacitor-mqtt-quic
|
|
@@ -402,14 +405,51 @@ Or add to your app’s `package.json` and run once:
|
|
|
402
405
|
"setup:wolfssl-android": "cd node_modules/@annadata/capacitor-mqtt-quic && ./build-native.sh --android-only --abi arm64-v8a && ./build-native.sh --android-only --abi armeabi-v7a && ./build-native.sh --android-only --abi x86_64"
|
|
403
406
|
```
|
|
404
407
|
|
|
405
|
-
**
|
|
408
|
+
**Option B – Use a complete package:** Reinstall a version of the plugin that was published with Android prebuilts (see *Publishing a complete package* below). Then no one-time build is needed.
|
|
409
|
+
|
|
410
|
+
**iOS:** The plugin typically ships with vendored static libs (`ios/libs/`) using WolfSSL. If you built the plugin from source and those are missing, run from the plugin repo: `./build-native.sh --ios-only`, then pack/publish.
|
|
411
|
+
|
|
412
|
+
### Publishing a complete (zero-config) package
|
|
413
|
+
|
|
414
|
+
So that **clients have no native build step**, build Android (and iOS) prebuilts **before** publishing, then publish. The tarball will include `android/install/` and consumers can `npm install` and run the app without running `build-native.sh`.
|
|
415
|
+
|
|
416
|
+
From the **plugin repo** (capacitor-mqtt-quic), before `npm publish`:
|
|
417
|
+
|
|
418
|
+
```bash
|
|
419
|
+
# 1) Android prebuilts for all ABIs (required for zero-config Android)
|
|
420
|
+
npm run build:android-prebuilts
|
|
421
|
+
|
|
422
|
+
# 2) iOS prebuilts (if not already present)
|
|
423
|
+
./build-native.sh --ios-only
|
|
424
|
+
|
|
425
|
+
# 3) Build JS and publish (clean does not remove android/install or ios/libs)
|
|
426
|
+
npm run build
|
|
427
|
+
npm run clean:build-artifacts
|
|
428
|
+
npm version patch # or minor
|
|
429
|
+
npm publish --access public
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
See **docs/PRODUCTION_PUBLISH_STEPS.md** for the full checklist.
|
|
433
|
+
|
|
434
|
+
### Connection error: `{"code":"UNIMPLEMENTED"}`
|
|
435
|
+
|
|
436
|
+
Capacitor returns this when the **native plugin method is not found** on the current platform. Common causes and fixes:
|
|
437
|
+
|
|
438
|
+
| Platform | Check |
|
|
439
|
+
|----------|--------|
|
|
440
|
+
| **iOS** | Plugin must be linked. Run `npx cap sync ios` and `cd ios && pod install`, then rebuild in Xcode. Ensure `@annadata/capacitor-mqtt-quic` is in your app’s `package.json` and that the iOS project includes the plugin (Capacitor should auto-discover it). If you use a custom Podfile, ensure the AnnadataCapacitorMqttQuic plugin target is included. |
|
|
441
|
+
| **Android** | Run `npx cap sync android` and rebuild. If you see "WolfSSL not found", run the one-time native build (see above). |
|
|
442
|
+
| **Web / browser** | In browser, the plugin uses the **web** implementation (WSS or WebTransport). If you get UNIMPLEMENTED in the browser, the app may be resolving the native bridge instead of the web plugin—e.g. wrong `capacitor.config` or build. Ensure you’re opening the app as a web build (e.g. `ionic serve` or `cap run web`), not a native app with a WebView. |
|
|
443
|
+
|
|
444
|
+
After adding the plugin or changing native code, always run **`npx cap sync`** and on iOS **`pod install`**, then rebuild the native app.
|
|
406
445
|
|
|
407
446
|
## Development
|
|
408
447
|
|
|
409
448
|
### Build Plugin
|
|
410
449
|
|
|
411
450
|
```bash
|
|
412
|
-
|
|
451
|
+
git clone https://github.com/annadata/capacitor-mqtt-quic.git
|
|
452
|
+
cd capacitor-mqtt-quic
|
|
413
453
|
npm install
|
|
414
454
|
npm run build
|
|
415
455
|
```
|
|
@@ -417,8 +457,8 @@ npm run build
|
|
|
417
457
|
### Add to Capacitor App
|
|
418
458
|
|
|
419
459
|
```bash
|
|
420
|
-
cd
|
|
421
|
-
npm
|
|
460
|
+
cd your-capacitor-app
|
|
461
|
+
npm install @annadata/capacitor-mqtt-quic
|
|
422
462
|
npx cap sync
|
|
423
463
|
```
|
|
424
464
|
|
|
@@ -443,14 +483,14 @@ await MqttQuic.connect({
|
|
|
443
483
|
|
|
444
484
|
## Publishing (maintainers)
|
|
445
485
|
|
|
446
|
-
To pack the plugin **with native libs** and publish to npm, follow **[PRODUCTION_PUBLISH_STEPS.md](./PRODUCTION_PUBLISH_STEPS.md)**.
|
|
486
|
+
To pack the plugin **with native libs** and publish to npm, follow **[PRODUCTION_PUBLISH_STEPS.md](./docs/PRODUCTION_PUBLISH_STEPS.md)**.
|
|
447
487
|
|
|
448
488
|
## Documentation
|
|
449
489
|
|
|
450
|
-
- [Implementation Summary](./IMPLEMENTATION_SUMMARY.md) - Complete project overview
|
|
451
|
-
- [MQTT 5.0 Implementation](./MQTT5_IMPLEMENTATION_COMPLETE.md) - MQTT 5.0 features and usage
|
|
452
|
-
- [ngtcp2 Integration Plan](./NGTCP2_INTEGRATION_PLAN.md) - Build instructions for real QUIC
|
|
453
|
-
- [MQTT Version Analysis](./MQTT_VERSION_ANALYSIS.md) - Why MQTT 5.0?
|
|
490
|
+
- [Implementation Summary](./docs/IMPLEMENTATION_SUMMARY.md) - Complete project overview
|
|
491
|
+
- [MQTT 5.0 Implementation](./docs/MQTT5_IMPLEMENTATION_COMPLETE.md) - MQTT 5.0 features and usage
|
|
492
|
+
- [ngtcp2 Integration Plan](./docs/NGTCP2_INTEGRATION_PLAN.md) - Build instructions for real QUIC
|
|
493
|
+
- [MQTT Version Analysis](./docs/MQTT_VERSION_ANALYSIS.md) - Why MQTT 5.0?
|
|
454
494
|
|
|
455
495
|
## Web / browser support
|
|
456
496
|
|
|
@@ -522,7 +562,7 @@ await MqttQuic.connect({
|
|
|
522
562
|
- **iOS:** 15.0+
|
|
523
563
|
- **Android:** API 21+ (Android 5.0+)
|
|
524
564
|
- **Web:** Any modern browser; MQTT over WSS
|
|
525
|
-
- **Capacitor:**
|
|
565
|
+
- **Capacitor:** 8.0+
|
|
526
566
|
- **QUIC:** ngtcp2 + WolfSSL on native; on web, optional WebTransport (browser's HTTP/3/QUIC) when server supports it
|
|
527
567
|
|
|
528
568
|
## Author
|
|
@@ -337,4 +337,4 @@ After building ngtcp2/nghttp3:
|
|
|
337
337
|
2. Replace `QuicClientStub` with `NGTCP2Client` in `MQTTClient.kt`
|
|
338
338
|
3. Test connection to MQTT server over QUIC
|
|
339
339
|
|
|
340
|
-
See
|
|
340
|
+
See [NGTCP2_INTEGRATION_PLAN.md](../docs/NGTCP2_INTEGRATION_PLAN.md) for detailed implementation guide.
|
package/android/build-wolfssl.sh
CHANGED
|
@@ -47,9 +47,15 @@ fi
|
|
|
47
47
|
if [ ! -d "$WOLFSSL_SOURCE_DIR" ] && [ -d "$PROJECT_DIR/../wolfssl-5.8.4-stable" ]; then
|
|
48
48
|
WOLFSSL_SOURCE_DIR="$PROJECT_DIR/../wolfssl-5.8.4-stable"
|
|
49
49
|
fi
|
|
50
|
+
# Clone WolfSSL if missing
|
|
50
51
|
if [ ! -d "$WOLFSSL_SOURCE_DIR" ]; then
|
|
51
|
-
echo "
|
|
52
|
-
|
|
52
|
+
echo "WolfSSL source not found. Cloning into $DEPS_DIR/wolfssl ..."
|
|
53
|
+
mkdir -p "$DEPS_DIR"
|
|
54
|
+
git clone --depth 1 -b "${WOLFSSL_TAG:-v5.8.4-stable}" "${WOLFSSL_REPO_URL:-https://github.com/wolfSSL/wolfssl.git}" "$DEPS_DIR/wolfssl" || {
|
|
55
|
+
echo "Error: Failed to clone WolfSSL"
|
|
56
|
+
exit 1
|
|
57
|
+
}
|
|
58
|
+
WOLFSSL_SOURCE_DIR="$DEPS_DIR/wolfssl"
|
|
53
59
|
fi
|
|
54
60
|
|
|
55
61
|
# Map ABI to toolchain
|
package/android/build.gradle
CHANGED
|
@@ -36,7 +36,10 @@ android {
|
|
|
36
36
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
37
37
|
externalNativeBuild {
|
|
38
38
|
cmake {
|
|
39
|
-
arguments "-DANDROID_STL=c++_shared"
|
|
39
|
+
arguments "-DANDROID_STL=c++_shared",
|
|
40
|
+
"-DWOLFSSL_ROOT_DIR=${file('install/wolfssl-android').absolutePath}",
|
|
41
|
+
"-DNGTCP2_INSTALL_DIR=${file('install/ngtcp2-android').absolutePath}",
|
|
42
|
+
"-DNGHTTP3_INSTALL_DIR=${file('install/nghttp3-android').absolutePath}"
|
|
40
43
|
cppFlags "-std=c++17"
|
|
41
44
|
}
|
|
42
45
|
}
|
|
Binary file
|
|
Binary file
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
22
22
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
23
23
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
24
|
-
prefix=/Users/annadata/
|
|
25
|
-
exec_prefix=/Users/annadata/
|
|
26
|
-
libdir=/Users/annadata/
|
|
27
|
-
includedir=/Users/annadata/
|
|
24
|
+
prefix=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/nghttp3-android/arm64-v8a
|
|
25
|
+
exec_prefix=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/nghttp3-android/arm64-v8a
|
|
26
|
+
libdir=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/nghttp3-android/arm64-v8a/lib
|
|
27
|
+
includedir=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/nghttp3-android/arm64-v8a/include
|
|
28
28
|
|
|
29
29
|
Name: libnghttp3
|
|
30
30
|
Description: nghttp3 library
|
|
Binary file
|
|
Binary file
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
22
22
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
23
23
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
24
|
-
prefix=/Users/annadata/
|
|
25
|
-
exec_prefix=/Users/annadata/
|
|
26
|
-
libdir=/Users/annadata/
|
|
27
|
-
includedir=/Users/annadata/
|
|
24
|
+
prefix=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/nghttp3-android/armeabi-v7a
|
|
25
|
+
exec_prefix=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/nghttp3-android/armeabi-v7a
|
|
26
|
+
libdir=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/nghttp3-android/armeabi-v7a/lib
|
|
27
|
+
includedir=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/nghttp3-android/armeabi-v7a/include
|
|
28
28
|
|
|
29
29
|
Name: libnghttp3
|
|
30
30
|
Description: nghttp3 library
|
|
Binary file
|
|
Binary file
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
22
22
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
23
23
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
24
|
-
prefix=/Users/annadata/
|
|
25
|
-
exec_prefix=/Users/annadata/
|
|
26
|
-
libdir=/Users/annadata/
|
|
27
|
-
includedir=/Users/annadata/
|
|
24
|
+
prefix=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/nghttp3-android/x86_64
|
|
25
|
+
exec_prefix=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/nghttp3-android/x86_64
|
|
26
|
+
libdir=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/nghttp3-android/x86_64/lib
|
|
27
|
+
includedir=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/nghttp3-android/x86_64/include
|
|
28
28
|
|
|
29
29
|
Name: libnghttp3
|
|
30
30
|
Description: nghttp3 library
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
21
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
22
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
-
prefix=/Users/annadata/
|
|
24
|
-
exec_prefix=/Users/annadata/
|
|
25
|
-
libdir=/Users/annadata/
|
|
26
|
-
includedir=/Users/annadata/
|
|
23
|
+
prefix=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/arm64-v8a
|
|
24
|
+
exec_prefix=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/arm64-v8a
|
|
25
|
+
libdir=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/arm64-v8a/lib
|
|
26
|
+
includedir=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/arm64-v8a/include
|
|
27
27
|
|
|
28
28
|
Name: libngtcp2
|
|
29
29
|
Description: ngtcp2 library
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
21
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
22
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
-
prefix=/Users/annadata/
|
|
24
|
-
exec_prefix=/Users/annadata/
|
|
25
|
-
libdir=/Users/annadata/
|
|
26
|
-
includedir=/Users/annadata/
|
|
23
|
+
prefix=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/arm64-v8a
|
|
24
|
+
exec_prefix=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/arm64-v8a
|
|
25
|
+
libdir=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/arm64-v8a/lib
|
|
26
|
+
includedir=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/arm64-v8a/include
|
|
27
27
|
|
|
28
28
|
Name: libngtcp2_crypto_wolfssl
|
|
29
29
|
Description: ngtcp2 wolfSSL crypto library
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
21
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
22
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
-
prefix=/Users/annadata/
|
|
24
|
-
exec_prefix=/Users/annadata/
|
|
25
|
-
libdir=/Users/annadata/
|
|
26
|
-
includedir=/Users/annadata/
|
|
23
|
+
prefix=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/armeabi-v7a
|
|
24
|
+
exec_prefix=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/armeabi-v7a
|
|
25
|
+
libdir=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/armeabi-v7a/lib
|
|
26
|
+
includedir=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/armeabi-v7a/include
|
|
27
27
|
|
|
28
28
|
Name: libngtcp2
|
|
29
29
|
Description: ngtcp2 library
|
package/android/install/ngtcp2-android/armeabi-v7a/lib/pkgconfig/libngtcp2_crypto_wolfssl.pc
CHANGED
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
21
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
22
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
-
prefix=/Users/annadata/
|
|
24
|
-
exec_prefix=/Users/annadata/
|
|
25
|
-
libdir=/Users/annadata/
|
|
26
|
-
includedir=/Users/annadata/
|
|
23
|
+
prefix=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/armeabi-v7a
|
|
24
|
+
exec_prefix=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/armeabi-v7a
|
|
25
|
+
libdir=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/armeabi-v7a/lib
|
|
26
|
+
includedir=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/armeabi-v7a/include
|
|
27
27
|
|
|
28
28
|
Name: libngtcp2_crypto_wolfssl
|
|
29
29
|
Description: ngtcp2 wolfSSL crypto library
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
21
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
22
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
-
prefix=/Users/annadata/
|
|
24
|
-
exec_prefix=/Users/annadata/
|
|
25
|
-
libdir=/Users/annadata/
|
|
26
|
-
includedir=/Users/annadata/
|
|
23
|
+
prefix=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/x86_64
|
|
24
|
+
exec_prefix=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/x86_64
|
|
25
|
+
libdir=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/x86_64/lib
|
|
26
|
+
includedir=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/x86_64/include
|
|
27
27
|
|
|
28
28
|
Name: libngtcp2
|
|
29
29
|
Description: ngtcp2 library
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
21
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
22
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
-
prefix=/Users/annadata/
|
|
24
|
-
exec_prefix=/Users/annadata/
|
|
25
|
-
libdir=/Users/annadata/
|
|
26
|
-
includedir=/Users/annadata/
|
|
23
|
+
prefix=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/x86_64
|
|
24
|
+
exec_prefix=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/x86_64
|
|
25
|
+
libdir=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/x86_64/lib
|
|
26
|
+
includedir=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/ngtcp2-android/x86_64/include
|
|
27
27
|
|
|
28
28
|
Name: libngtcp2_crypto_wolfssl
|
|
29
29
|
Description: ngtcp2 wolfSSL crypto library
|
|
@@ -4,7 +4,7 @@ package="wolfssl"
|
|
|
4
4
|
version="5.8.4"
|
|
5
5
|
libs="-lwolfssl"
|
|
6
6
|
|
|
7
|
-
prefix="/Users/annadata/
|
|
7
|
+
prefix="/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/wolfssl-android/arm64-v8a"
|
|
8
8
|
exec_prefix="${prefix}"
|
|
9
9
|
bindir="${exec_prefix}/bin"
|
|
10
10
|
sbindir="${exec_prefix}/sbin"
|
|
Binary file
|
|
@@ -38,4 +38,4 @@ dlopen=''
|
|
|
38
38
|
dlpreopen=''
|
|
39
39
|
|
|
40
40
|
# Directory that this library needs to be installed in:
|
|
41
|
-
libdir='/Users/annadata/
|
|
41
|
+
libdir='/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/wolfssl-android/arm64-v8a/lib'
|
|
@@ -4,7 +4,7 @@ package="wolfssl"
|
|
|
4
4
|
version="5.8.4"
|
|
5
5
|
libs="-lwolfssl"
|
|
6
6
|
|
|
7
|
-
prefix="/Users/annadata/
|
|
7
|
+
prefix="/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/wolfssl-android/armeabi-v7a"
|
|
8
8
|
exec_prefix="${prefix}"
|
|
9
9
|
bindir="${exec_prefix}/bin"
|
|
10
10
|
sbindir="${exec_prefix}/sbin"
|
|
Binary file
|
|
@@ -38,4 +38,4 @@ dlopen=''
|
|
|
38
38
|
dlpreopen=''
|
|
39
39
|
|
|
40
40
|
# Directory that this library needs to be installed in:
|
|
41
|
-
libdir='/Users/annadata/
|
|
41
|
+
libdir='/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/wolfssl-android/armeabi-v7a/lib'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
prefix=/Users/annadata/
|
|
1
|
+
prefix=/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/wolfssl-android/armeabi-v7a
|
|
2
2
|
exec_prefix=${prefix}
|
|
3
3
|
libdir=${exec_prefix}/lib
|
|
4
4
|
includedir=${prefix}/include
|
|
@@ -4,7 +4,7 @@ package="wolfssl"
|
|
|
4
4
|
version="5.8.4"
|
|
5
5
|
libs="-lwolfssl"
|
|
6
6
|
|
|
7
|
-
prefix="/Users/annadata/
|
|
7
|
+
prefix="/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/wolfssl-android/x86_64"
|
|
8
8
|
exec_prefix="${prefix}"
|
|
9
9
|
bindir="${exec_prefix}/bin"
|
|
10
10
|
sbindir="${exec_prefix}/sbin"
|
|
Binary file
|
|
@@ -38,4 +38,4 @@ dlopen=''
|
|
|
38
38
|
dlpreopen=''
|
|
39
39
|
|
|
40
40
|
# Directory that this library needs to be installed in:
|
|
41
|
-
libdir='/Users/annadata/
|
|
41
|
+
libdir='/Users/annadata/Ionic/capacitor-mqtt-quic/android/install/wolfssl-android/x86_64/lib'
|
|
@@ -14,9 +14,10 @@ endif()
|
|
|
14
14
|
# WolfSSL path (same layout as iOS: TLS backend for ngtcp2). Override via -DWOLFSSL_ROOT_DIR=...
|
|
15
15
|
if(NOT WOLFSSL_ROOT_DIR)
|
|
16
16
|
set(WOLFSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../install/wolfssl-android" CACHE PATH "Path to WolfSSL for Android")
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
endif()
|
|
18
|
+
# Prefer ABI-specific subdir when present (e.g. when WOLFSSL_ROOT_DIR is passed as base path from Gradle)
|
|
19
|
+
if(EXISTS "${WOLFSSL_ROOT_DIR}/${ANDROID_ABI}")
|
|
20
|
+
set(WOLFSSL_ROOT_DIR "${WOLFSSL_ROOT_DIR}/${ANDROID_ABI}" CACHE PATH "Path to WolfSSL for Android (ABI)" FORCE)
|
|
20
21
|
endif()
|
|
21
22
|
if(NOT WOLFSSL_INCLUDE_DIR AND EXISTS "${WOLFSSL_ROOT_DIR}/include")
|
|
22
23
|
set(WOLFSSL_INCLUDE_DIR "${WOLFSSL_ROOT_DIR}/include")
|
|
@@ -25,7 +26,12 @@ if(NOT WOLFSSL_LIBRARY AND EXISTS "${WOLFSSL_ROOT_DIR}/lib/libwolfssl.a")
|
|
|
25
26
|
set(WOLFSSL_LIBRARY "${WOLFSSL_ROOT_DIR}/lib/libwolfssl.a")
|
|
26
27
|
endif()
|
|
27
28
|
if(NOT WOLFSSL_LIBRARY OR NOT WOLFSSL_INCLUDE_DIR)
|
|
28
|
-
message(FATAL_ERROR
|
|
29
|
+
message(FATAL_ERROR
|
|
30
|
+
"WolfSSL not found at ${WOLFSSL_ROOT_DIR}. "
|
|
31
|
+
"One-time fix (from your app project root): "
|
|
32
|
+
"cd node_modules/@annadata/capacitor-mqtt-quic && "
|
|
33
|
+
"./build-native.sh --android-only --abi ${ANDROID_ABI} "
|
|
34
|
+
"(repeat for armeabi-v7a, x86_64). See plugin README 'Production / First-time build'.")
|
|
29
35
|
endif()
|
|
30
36
|
|
|
31
37
|
# ngtcp2 install/source directories (adjust as needed)
|
|
@@ -46,6 +52,14 @@ if(NOT NGHTTP3_INSTALL_DIR)
|
|
|
46
52
|
endif()
|
|
47
53
|
set(NGHTTP3_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../nghttp3" CACHE PATH "Path to nghttp3 source")
|
|
48
54
|
|
|
55
|
+
# Prefer ABI-specific subdir when install dirs are passed as base path from Gradle
|
|
56
|
+
if(EXISTS "${NGTCP2_INSTALL_DIR}/${ANDROID_ABI}")
|
|
57
|
+
set(NGTCP2_INSTALL_DIR "${NGTCP2_INSTALL_DIR}/${ANDROID_ABI}" CACHE PATH "Path to ngtcp2 install (ABI)" FORCE)
|
|
58
|
+
endif()
|
|
59
|
+
if(EXISTS "${NGHTTP3_INSTALL_DIR}/${ANDROID_ABI}")
|
|
60
|
+
set(NGHTTP3_INSTALL_DIR "${NGHTTP3_INSTALL_DIR}/${ANDROID_ABI}" CACHE PATH "Path to nghttp3 install (ABI)" FORCE)
|
|
61
|
+
endif()
|
|
62
|
+
|
|
49
63
|
# Prefer installed libraries (WolfSSL backend: libngtcp2_crypto_wolfssl.a), fallback to source build
|
|
50
64
|
set(NGTCP2_INCLUDE_DIR "")
|
|
51
65
|
set(NGTCP2_LIBRARY "")
|
|
@@ -112,7 +126,7 @@ target_include_directories(ngtcp2_client PRIVATE
|
|
|
112
126
|
)
|
|
113
127
|
|
|
114
128
|
# Link libraries: WolfSSL + ngtcp2 (same TLS backend as iOS)
|
|
115
|
-
target_link_libraries(ngtcp2_client
|
|
129
|
+
target_link_libraries(ngtcp2_client PRIVATE
|
|
116
130
|
${WOLFSSL_LIBRARY}
|
|
117
131
|
log
|
|
118
132
|
)
|