cordova-plugin-crosswire-sword 0.2.8 → 0.2.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/RELEASENOTES.md CHANGED
@@ -20,6 +20,12 @@
20
20
  -->
21
21
  # Release Notes
22
22
 
23
+ ### 0.2.9 (Sep 25, 2026)
24
+ * BibleSync works: biblesync 2.2.0 with the Android and Apple interface discovery sent upstream; Android holds a Wi-Fi multicast lock while it runs (CHANGE_WIFI_MULTICAST_STATE); every speaker in the room is heard, not only the first
25
+ * Android: a sword:// or bible:// link the app is opened with reaches the page as handleOpenURL, exactly as cordova-ios does, on a cold start and a warm one
26
+ * iOS: a received BibleSync verse no longer crashes the app
27
+ * The native binaries come from the sword-android-latest and sword-ios-latest links on crosswire.org
28
+
23
29
  ### 0.2.8 (Aug 22, 2026)
24
30
  * iOS: builds with cordova-ios 8 and Xcode 27 (xcframeworks for libsword and curl 8.22 with OpenSSL 3.5.8, verified against the iOS trust store)
25
31
  * The native binaries of both platforms are no longer in git: `make fetch` in bindings/Android and `make ios` in bindings/objc/dependencies download the published sets from crosswire.org
Binary file
Binary file
Binary file
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/libs/ios/SWORD.xcframework/ios-arm64/libSWORD.a
3
- size: 37277640 bytes
4
- sha256: d4e974f37e98c9b7f39b1b8d253066bf01b3379f40dc13d29ef85930f17e01b4
3
+ size: 37291856 bytes
4
+ sha256: 7409692a95d76c57900b0b8744ec40929a86d3b8ab9e1484ed44a9d2f6ef5a88
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/libs/ios/SWORD.xcframework/ios-arm64-simulator/libSWORD.a
3
- size: 37320688 bytes
4
- sha256: bd561095edca8a5277528bcd3140cc14b474d85498dd891d6656dd93e180db57
3
+ size: 37334896 bytes
4
+ sha256: 8feff5c7f71809535934d6d4f72c040eb1c8064fdfa042450dac079420e203d9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-plugin-crosswire-sword",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "The SWORD Project Plugin",
5
5
  "files": [
6
6
  "plugin.xml",
package/plugin.xml CHANGED
@@ -4,7 +4,7 @@
4
4
  xmlns:rim="http://www.blackberry.com/ns/widgets"
5
5
  xmlns:android="http://schemas.android.com/apk/res/android"
6
6
  id="cordova-plugin-crosswire-sword"
7
- version="0.2.8">
7
+ version="0.2.9">
8
8
  <name>cordova-plugin-crosswire-sword</name>
9
9
  <description>The SWORD Project Plugin</description>
10
10
  <license>GNU 2.0</license>
@@ -43,6 +43,10 @@
43
43
  <param name="android-package" value="org.crosswire.sword.cordova.SWORD"/>
44
44
  </feature>
45
45
  </config-file>
46
+ <!-- BibleSync: Wi-Fi drivers drop multicast unless the app holds a MulticastLock -->
47
+ <config-file target="AndroidManifest.xml" parent="/*">
48
+ <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
49
+ </config-file>
46
50
  <source-file src="src/android/SWORD.java" target-dir="src/org/crosswire/sword/cordova" />
47
51
  <source-file src="src/android/SWMgr.java" target-dir="src/org/crosswire/android/sword" />
48
52
  <source-file src="src/android/AndroidMgr.java" target-dir="src/org/crosswire/android/sword" />
@@ -47,9 +47,13 @@ import org.crosswire.android.sword.InstallMgr;
47
47
  import android.provider.Settings;
48
48
  import android.util.Log;
49
49
  import android.content.Intent;
50
+ import android.content.Context;
51
+ import android.net.wifi.WifiManager;
50
52
  import android.app.Activity;
51
53
 
52
54
  public class SWORD extends CordovaPlugin {
55
+ // held while BibleSync runs: without it most Wi-Fi drivers filter out the multicast group
56
+ private WifiManager.MulticastLock multicastLock = null;
53
57
  public static final String TAG = "SWORD";
54
58
  public static SWMgr mgr = null;
55
59
  public static InstallMgr installMgr = null;
@@ -74,9 +78,28 @@ public class SWORD extends CordovaPlugin {
74
78
  * @param webView The CordovaWebView Cordova is running in.
75
79
  */
76
80
  // a sword:// or bible:// link the app was opened with, held until the
77
- // page asks for it (SWMgr_getLaunchUrl)
81
+ // page has loaded, then handed to it exactly as cordova-ios's
82
+ // HandleOpenUrl does: handleOpenURL(url) once deviceready has fired
78
83
  private static String launchUrl = null;
79
84
 
85
+ private void pushOpenUrl(final String url) {
86
+ final String js = "document.addEventListener('deviceready',function(){if (typeof handleOpenURL === 'function') { handleOpenURL(" + org.json.JSONObject.quote(url) + ");}});";
87
+ cordova.getActivity().runOnUiThread(new Runnable() { public void run() {
88
+ webView.getEngine().evaluateJavascript(js, null);
89
+ }});
90
+ }
91
+
92
+ // cold start: the page is loaded, the link can go in
93
+ @Override
94
+ public Object onMessage(String id, Object data) {
95
+ if ("onPageFinished".equals(id) && launchUrl != null) {
96
+ String url = launchUrl;
97
+ launchUrl = null;
98
+ pushOpenUrl(url);
99
+ }
100
+ return null;
101
+ }
102
+
80
103
  private static String deepLink(Intent intent) {
81
104
  if (intent == null || intent.getData() == null) return null;
82
105
  String scheme = intent.getData().getScheme();
@@ -84,14 +107,12 @@ public class SWORD extends CordovaPlugin {
84
107
  return intent.getDataString();
85
108
  }
86
109
 
110
+ // warm start: the page is up, the link goes straight in
87
111
  @Override
88
112
  public void onNewIntent(Intent intent) {
89
113
  final String url = deepLink(intent);
90
114
  if (url == null) return;
91
- launchUrl = url;
92
- cordova.getActivity().runOnUiThread(new Runnable() { public void run() {
93
- webView.getEngine().evaluateJavascript("if (window.swordDeepLink) swordDeepLink(" + org.json.JSONObject.quote(url) + ");", null);
94
- }});
115
+ pushOpenUrl(url);
95
116
  }
96
117
 
97
118
  // who is asking, for the servers we talk to: "Bishop/1.7.905 (OnePlus
@@ -520,6 +541,12 @@ Log.d(TAG, "SWModule_getRenderChapter");
520
541
  final String userName = args.getString(1);
521
542
  final String passphrase = args.getString(2);
522
543
 
544
+ if (multicastLock == null) {
545
+ WifiManager wifi = (WifiManager) cordova.getActivity().getApplicationContext().getSystemService(Context.WIFI_SERVICE);
546
+ if (wifi != null) { multicastLock = wifi.createMulticastLock("BibleSync"); multicastLock.setReferenceCounted(false); }
547
+ }
548
+ if (multicastLock != null) multicastLock.acquire();
549
+
523
550
  cordova.getThreadPool().execute(new Runnable() {
524
551
  @Override
525
552
  public void run() {
@@ -557,6 +584,7 @@ Log.d(TAG, "SWModule_getRenderChapter");
557
584
  }
558
585
  else if (action.equals("SWMgr_stopBibleSync")) {
559
586
  mgr.stopBibleSync();
587
+ if (multicastLock != null && multicastLock.isHeld()) multicastLock.release();
560
588
  callbackContext.success();
561
589
  }
562
590
  else if (action.equals("SWMgr_setJavascript")) {
@@ -587,6 +615,7 @@ Log.d(TAG, "SWModule_getRenderChapter");
587
615
  String translated = mgr.translate(text, locale);
588
616
  callbackContext.success(translated);
589
617
  }
618
+ // kept for older pages; the link now arrives through handleOpenURL
590
619
  else if (action.equals("SWMgr_getLaunchUrl")) {
591
620
  String url = launchUrl;
592
621
  launchUrl = null;
@@ -715,8 +715,9 @@ debugPrint("initMgr, mgr: " + String(describing: mgr))
715
715
  DispatchQueue.global().async {
716
716
  mySWORDPlugin = self
717
717
  org_crosswire_sword_SWMgr_startBibleSync(self.mgr, appName, userName, passphrase, { (cmd : Int8, str1: Optional<UnsafePointer<Int8>>, str2: Optional<UnsafePointer<Int8>>) in
718
- let response1 = String(cString: str1!)
719
- let response2 = String(cString: str2!)
718
+ // a nav message carries no second string (flatapi passes 0)
719
+ let response1 = str1 == nil ? "" : String(cString: str1!)
720
+ let response2 = str2 == nil ? "" : String(cString: str2!)
720
721
  if (mySWORDPlugin != nil && mySWORDPlugin!.bibleSyncCallbackID != "") {
721
722
  if (cmd == CChar("N")) {
722
723
  var retVal = [String:Any]()