cordova-plugin-crosswire-sword 0.2.5 → 0.2.6

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.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-plugin-crosswire-sword",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "The SWORD Project Plugin",
5
5
  "cordova": {
6
6
  "id": "cordova-plugin-crosswire-sword",
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.5">
7
+ version="0.2.6">
8
8
  <name>cordova-plugin-crosswire-sword</name>
9
9
  <description>The SWORD Project Plugin</description>
10
10
  <license>GNU 2.0</license>
@@ -56,6 +56,22 @@
56
56
  <source-file src="libs/android/armeabi-v7a/libsword.so" target-dir="libs/armeabi-v7a" />
57
57
  <source-file src="libs/android/x86/libsword.so" target-dir="libs/x86" />
58
58
  <source-file src="libs/android/x86_64/libsword.so" target-dir="libs/x86_64" />
59
+ <source-file src="libs/android/arm64-v8a/libcrypto.so" target-dir="libs/arm64-v8a" />
60
+ <source-file src="libs/android/armeabi-v7a/libcrypto.so" target-dir="libs/armeabi-v7a" />
61
+ <source-file src="libs/android/x86/libcrypto.so" target-dir="libs/x86" />
62
+ <source-file src="libs/android/x86_64/libcrypto.so" target-dir="libs/x86_64" />
63
+ <source-file src="libs/android/arm64-v8a/libc++_shared.so" target-dir="libs/arm64-v8a" />
64
+ <source-file src="libs/android/armeabi-v7a/libc++_shared.so" target-dir="libs/armeabi-v7a" />
65
+ <source-file src="libs/android/x86/libc++_shared.so" target-dir="libs/x86" />
66
+ <source-file src="libs/android/x86_64/libc++_shared.so" target-dir="libs/x86_64" />
67
+ <source-file src="libs/android/arm64-v8a/libcurl.so" target-dir="libs/arm64-v8a" />
68
+ <source-file src="libs/android/armeabi-v7a/libcurl.so" target-dir="libs/armeabi-v7a" />
69
+ <source-file src="libs/android/x86/libcurl.so" target-dir="libs/x86" />
70
+ <source-file src="libs/android/x86_64/libcurl.so" target-dir="libs/x86_64" />
71
+ <source-file src="libs/android/arm64-v8a/libssl.so" target-dir="libs/arm64-v8a" />
72
+ <source-file src="libs/android/armeabi-v7a/libssl.so" target-dir="libs/armeabi-v7a" />
73
+ <source-file src="libs/android/x86/libssl.so" target-dir="libs/x86" />
74
+ <source-file src="libs/android/x86_64/libssl.so" target-dir="libs/x86_64" />
59
75
 
60
76
  <!-- no longer needed with latest ndk
61
77
  <source-file src="libs/android/arm64-v8a/libc++_shared.so" target-dir="libs/arm64-v8a" />
@@ -159,7 +159,7 @@ public class SWORD extends CordovaPlugin {
159
159
  m.put("shortCopyright", mod.getConfigEntry("ShortCopyright"));
160
160
  m.put("shortPromo", mod.getConfigEntry("ShortPromo"));
161
161
  m.put("cipherKey", mod.getConfigEntry("CipherKey"));
162
- Log.d(TAG, "SWModule_getRemoteModuleByName("+args.getString(0)+", " + args.getString(1) + " returned successfully.");
162
+ //Log.d(TAG, "SWModule_getRemoteModuleByName("+args.getString(0)+", " + args.getString(1) + " returned successfully.");
163
163
  callbackContext.success(m);
164
164
  }
165
165
  else if (action.equals("InstallMgr_remoteInstallModule")) {
@@ -585,20 +585,20 @@ Log.d(TAG, "... finished renderChapter");
585
585
  final String url = args.getString(0);
586
586
  final String postData = args.getString(1);
587
587
  final int method = args.getInt(2);
588
- Log.d(TAG, "about to spawn thread makeRequest(url: " + url + ", postData: " + postData + ", method: " + method);
588
+ //Log.d(TAG, "about to spawn thread makeRequest(url: " + url + ", postData: " + postData + ", method: " + method);
589
589
 
590
590
  cordova.getThreadPool().execute(new Runnable() {
591
591
  private CallbackContext makeRequestContext = callbackContext;
592
592
  @Override
593
593
  public void run() {
594
594
  String response = makeRequest(url, postData, method, null);
595
- Log.d(TAG, "received response from makeRequest with .length(): " + (response != null ? response.length() : "null"));
595
+ //Log.d(TAG, "received response from makeRequest with .length(): " + (response != null ? response.length() : "null"));
596
596
  PluginResult result = new PluginResult(PluginResult.Status.OK, response);
597
- Log.d(TAG, "added response to result object");
597
+ //Log.d(TAG, "added response to result object");
598
598
  result.setKeepCallback(false);
599
- Log.d(TAG, "setting result object keepCallback to false and calling sendPluginResult");
599
+ //Log.d(TAG, "setting result object keepCallback to false and calling sendPluginResult");
600
600
  makeRequestContext.sendPluginResult(result);
601
- Log.d(TAG, "finished calling sendPluginResult");
601
+ //Log.d(TAG, "finished calling sendPluginResult");
602
602
  }
603
603
  });
604
604
 
@@ -637,20 +637,20 @@ Log.d(TAG, "finished calling sendPluginResult");
637
637
 
638
638
  String currentKey[] = masterMod.getKeyChildren();
639
639
 
640
- Log.d(TAG, "getRenderChapter: checking currentKey");
640
+ //Log.d(TAG, "getRenderChapter: checking currentKey");
641
641
  // assert we have a valid location
642
642
  if (currentKey.length <= SWModule.VERSEKEY_BOOKABBREV || currentKey.length <= SWModule.VERSEKEY_CHAPTER) return r;
643
- Log.d(TAG, "getRenderChapter: currentKey valid.");
643
+ //Log.d(TAG, "getRenderChapter: currentKey valid.");
644
644
 
645
645
  masterMod.setKeyText(currentKey[SWModule.VERSEKEY_BOOKABBREV]+"."+currentKey[SWModule.VERSEKEY_CHAPTER]+".1");
646
- Log.d(TAG, "getRenderChapter: masterMod.setKeyText returned.");
646
+ //Log.d(TAG, "getRenderChapter: masterMod.setKeyText returned.");
647
647
 
648
648
  String [] verseKey = masterMod.getKeyChildren();
649
649
  while (
650
650
  masterMod.error() == 0
651
651
  && currentKey[SWModule.VERSEKEY_BOOK].equals(verseKey[SWModule.VERSEKEY_BOOK])
652
652
  && currentKey[SWModule.VERSEKEY_CHAPTER].equals(verseKey[SWModule.VERSEKEY_CHAPTER])) {
653
- Log.d(TAG, "looping chapter: " + verseKey[SWModule.VERSEKEY_OSISREF]);
653
+ //Log.d(TAG, "looping chapter: " + verseKey[SWModule.VERSEKEY_OSISREF]);
654
654
 
655
655
  mod.setKeyText(verseKey[SWModule.VERSEKEY_OSISREF]);
656
656
  char error = mod.error();
@@ -675,7 +675,7 @@ Log.d(TAG, "looping chapter: " + verseKey[SWModule.VERSEKEY_OSISREF]);
675
675
  masterMod.next();
676
676
  verseKey = masterMod.getKeyChildren();
677
677
  }
678
- Log.d(TAG, "Done looping chapter");
678
+ //Log.d(TAG, "Done looping chapter");
679
679
 
680
680
  masterMod.setKeyText(saveMasterKey);
681
681
  mod.setKeyText(saveKey);
@@ -710,14 +710,14 @@ Log.d(TAG, "makeRequest(url: " + url + ", postData: " + postData + ", method: "
710
710
  defaultHeaders.put("Accept", "*/*");
711
711
  // defaultHeaders.put("Content-Type", "application/xml");
712
712
  defaultHeaders.put("Content-Type", "application/x-www-form-urlencoded");
713
- Log.d(TAG, "about to add postData length to header");
713
+ //Log.d(TAG, "about to add postData length to header");
714
714
  if (method != METHOD_GET && postData != null) defaultHeaders.put("Content-Length", Integer.toString(postData.length()));
715
- Log.d(TAG, "finished adding postData length to header");
715
+ //Log.d(TAG, "finished adding postData length to header");
716
716
 
717
717
  try {
718
- Log.d(TAG, "adding any given headers");
718
+ //Log.d(TAG, "adding any given headers");
719
719
  if (headers != null) defaultHeaders.putAll(headers);
720
- Log.d(TAG, "done adding any given headers");
720
+ //Log.d(TAG, "done adding any given headers");
721
721
 
722
722
  if (method == METHOD_GET && postData != null && postData.length() > 0) {
723
723
  // some sanity checks for appending GET params to URL
@@ -727,16 +727,16 @@ Log.d(TAG, "done adding any given headers");
727
727
  url += postData;
728
728
  }
729
729
 
730
- Log.d(TAG, "opening connection");
730
+ //Log.d(TAG, "opening connection");
731
731
  connection = (HttpURLConnection) new URL(url).openConnection();
732
- Log.d(TAG, "setting request method");
732
+ //Log.d(TAG, "setting request method");
733
733
  connection.setRequestMethod(METHODS_TEXT[method]);
734
- Log.d(TAG, "setting request properties");
734
+ //Log.d(TAG, "setting request properties");
735
735
  for (String k : defaultHeaders.keySet()) {
736
736
  connection.setRequestProperty(k, defaultHeaders.get(k));
737
737
  }
738
738
  if (method == METHOD_POST) {
739
- Log.d(TAG, "sending post data");
739
+ //Log.d(TAG, "sending post data");
740
740
  connection.setDoOutput(true);
741
741
  if (postData != null) {
742
742
  DataOutputStream dos = new DataOutputStream(connection.getOutputStream());
@@ -745,10 +745,10 @@ Log.d(TAG, "sending post data");
745
745
  dos.close();
746
746
  }
747
747
  }
748
- Log.d(TAG, "getting response code");
748
+ //Log.d(TAG, "getting response code");
749
749
  int responseCode = connection.getResponseCode();
750
750
  Log.d(TAG, "response code: " + responseCode);
751
- Log.d(TAG, "getting response");
751
+ //Log.d(TAG, "getting response");
752
752
  BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream()));
753
753
  StringBuilder response = new StringBuilder();
754
754
  String line;
@@ -764,7 +764,7 @@ Log.d(TAG, "finished. returning response with .length(): " + response.length());
764
764
  return response.toString();
765
765
  }
766
766
  catch (Exception e) {
767
- Log.d(TAG, "an exception occurred in makeRequest thread: " + e);
767
+ Log.i(TAG, "an exception occurred in makeRequest thread: " + e);
768
768
  e.printStackTrace();
769
769
  }
770
770
  return null;
@@ -350,7 +350,7 @@ debugPrint("initMgr, mgr: " + String(describing: mgr))
350
350
  "name": vkInfo[VERSEKEY_BOOKNAME],
351
351
  "abbrev": vkInfo[VERSEKEY_BOOKABBREV],
352
352
  "osisName": vkInfo[VERSEKEY_OSISBOOKNAME],
353
- "chapterMax": Int(vkInfo[VERSEKEY_CHAPTERMAX]),
353
+ "chapterMax": Int(vkInfo[VERSEKEY_CHAPTERMAX])!,
354
354
  ] as [AnyHashable : Any]
355
355
  retVal.append(bookInfo)
356
356
 
@@ -671,7 +671,7 @@ debugPrint("initMgr, mgr: " + String(describing: mgr))
671
671
  let saveMasterKey = String(cString: org_crosswire_sword_SWModule_getKeyText(masterMod))
672
672
  let saveKey = String(cString: org_crosswire_sword_SWModule_getKeyText(mod))
673
673
  var r = [[String: Any]]()
674
- var currentKey = getStringArray(buffer: org_crosswire_sword_SWModule_getKeyChildren(masterMod))
674
+ let currentKey = getStringArray(buffer: org_crosswire_sword_SWModule_getKeyChildren(masterMod))
675
675
  let book = currentKey[VERSEKEY_BOOKABBREV]
676
676
  let chapter = currentKey[VERSEKEY_CHAPTER]
677
677
  org_crosswire_sword_SWModule_setKeyText(masterMod, book + "." + chapter + ".1")
@@ -725,7 +725,7 @@ debugPrint("initMgr, mgr: " + String(describing: mgr))
725
725
  }
726
726
 
727
727
  @objc(SWModule_terminateSearch:)
728
- func SWModule_setKeyText(command: CDVInvokedUrlCommand) {
728
+ func SWModule_terminateSearch(command: CDVInvokedUrlCommand) {
729
729
  let module = getModule(command: command)
730
730
  if (module != 0) {
731
731
  org_crosswire_sword_SWModule_terminateSearch(module)