@dittolive/ditto 4.5.0 → 4.5.1-experimental.aarch64-linux.1.aarch64

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.
Files changed (289) hide show
  1. package/README.md +2 -2
  2. package/node/ditto.cjs.js +2 -9620
  3. package/node/{ditto.linux-x64.node → ditto.linux-arm64.node} +0 -0
  4. package/package.json +38 -34
  5. package/types/ditto.d.ts +0 -2
  6. package/web/ditto.es6.js +1 -1
  7. package/web/ditto.umd.js +1 -1
  8. package/web/ditto.wasm +0 -0
  9. package/DittoReactNative.podspec +0 -27
  10. package/node/ditto.darwin-arm64.node +0 -0
  11. package/node/ditto.darwin-x64.node +0 -0
  12. package/node/ditto.linux-arm.node +0 -0
  13. package/node/ditto.win32-x64.node +0 -0
  14. package/node/transports.darwin-arm64.node +0 -0
  15. package/node/transports.darwin-x64.node +0 -0
  16. package/react-native/android/CMakeLists.txt +0 -37
  17. package/react-native/android/build.gradle +0 -203
  18. package/react-native/android/cpp-adapter.cpp +0 -254
  19. package/react-native/android/gradle.properties +0 -5
  20. package/react-native/android/src/main/AndroidManifest.xml +0 -4
  21. package/react-native/android/src/main/java/com/dittolive/rnsdk/DittoRNSDKModule.java +0 -85
  22. package/react-native/android/src/main/java/com/dittolive/rnsdk/DittoRNSDKPackage.java +0 -28
  23. package/react-native/boost/boost/assert.hpp +0 -85
  24. package/react-native/boost/boost/config/abi/borland_prefix.hpp +0 -27
  25. package/react-native/boost/boost/config/abi/borland_suffix.hpp +0 -12
  26. package/react-native/boost/boost/config/abi/msvc_prefix.hpp +0 -22
  27. package/react-native/boost/boost/config/abi/msvc_suffix.hpp +0 -8
  28. package/react-native/boost/boost/config/abi_prefix.hpp +0 -25
  29. package/react-native/boost/boost/config/abi_suffix.hpp +0 -25
  30. package/react-native/boost/boost/config/assert_cxx03.hpp +0 -211
  31. package/react-native/boost/boost/config/assert_cxx11.hpp +0 -209
  32. package/react-native/boost/boost/config/assert_cxx14.hpp +0 -47
  33. package/react-native/boost/boost/config/assert_cxx17.hpp +0 -62
  34. package/react-native/boost/boost/config/assert_cxx20.hpp +0 -59
  35. package/react-native/boost/boost/config/assert_cxx98.hpp +0 -23
  36. package/react-native/boost/boost/config/auto_link.hpp +0 -525
  37. package/react-native/boost/boost/config/compiler/borland.hpp +0 -339
  38. package/react-native/boost/boost/config/compiler/clang.hpp +0 -366
  39. package/react-native/boost/boost/config/compiler/clang_version.hpp +0 -83
  40. package/react-native/boost/boost/config/compiler/codegear.hpp +0 -385
  41. package/react-native/boost/boost/config/compiler/comeau.hpp +0 -59
  42. package/react-native/boost/boost/config/compiler/common_edg.hpp +0 -183
  43. package/react-native/boost/boost/config/compiler/compaq_cxx.hpp +0 -19
  44. package/react-native/boost/boost/config/compiler/cray.hpp +0 -446
  45. package/react-native/boost/boost/config/compiler/diab.hpp +0 -26
  46. package/react-native/boost/boost/config/compiler/digitalmars.hpp +0 -143
  47. package/react-native/boost/boost/config/compiler/gcc.hpp +0 -383
  48. package/react-native/boost/boost/config/compiler/gcc_xml.hpp +0 -114
  49. package/react-native/boost/boost/config/compiler/greenhills.hpp +0 -28
  50. package/react-native/boost/boost/config/compiler/hp_acc.hpp +0 -149
  51. package/react-native/boost/boost/config/compiler/intel.hpp +0 -577
  52. package/react-native/boost/boost/config/compiler/kai.hpp +0 -33
  53. package/react-native/boost/boost/config/compiler/metrowerks.hpp +0 -198
  54. package/react-native/boost/boost/config/compiler/mpw.hpp +0 -140
  55. package/react-native/boost/boost/config/compiler/nvcc.hpp +0 -61
  56. package/react-native/boost/boost/config/compiler/pathscale.hpp +0 -138
  57. package/react-native/boost/boost/config/compiler/pgi.hpp +0 -23
  58. package/react-native/boost/boost/config/compiler/sgi_mipspro.hpp +0 -29
  59. package/react-native/boost/boost/config/compiler/sunpro_cc.hpp +0 -222
  60. package/react-native/boost/boost/config/compiler/vacpp.hpp +0 -186
  61. package/react-native/boost/boost/config/compiler/visualc.hpp +0 -391
  62. package/react-native/boost/boost/config/compiler/xlcpp.hpp +0 -299
  63. package/react-native/boost/boost/config/compiler/xlcpp_zos.hpp +0 -173
  64. package/react-native/boost/boost/config/detail/cxx_composite.hpp +0 -203
  65. package/react-native/boost/boost/config/detail/posix_features.hpp +0 -95
  66. package/react-native/boost/boost/config/detail/select_compiler_config.hpp +0 -157
  67. package/react-native/boost/boost/config/detail/select_platform_config.hpp +0 -147
  68. package/react-native/boost/boost/config/detail/select_stdlib_config.hpp +0 -121
  69. package/react-native/boost/boost/config/detail/suffix.hpp +0 -1294
  70. package/react-native/boost/boost/config/header_deprecated.hpp +0 -26
  71. package/react-native/boost/boost/config/helper_macros.hpp +0 -37
  72. package/react-native/boost/boost/config/no_tr1/cmath.hpp +0 -28
  73. package/react-native/boost/boost/config/no_tr1/complex.hpp +0 -28
  74. package/react-native/boost/boost/config/no_tr1/functional.hpp +0 -28
  75. package/react-native/boost/boost/config/no_tr1/memory.hpp +0 -28
  76. package/react-native/boost/boost/config/no_tr1/utility.hpp +0 -28
  77. package/react-native/boost/boost/config/platform/aix.hpp +0 -33
  78. package/react-native/boost/boost/config/platform/amigaos.hpp +0 -15
  79. package/react-native/boost/boost/config/platform/beos.hpp +0 -26
  80. package/react-native/boost/boost/config/platform/bsd.hpp +0 -83
  81. package/react-native/boost/boost/config/platform/cloudabi.hpp +0 -18
  82. package/react-native/boost/boost/config/platform/cray.hpp +0 -18
  83. package/react-native/boost/boost/config/platform/cygwin.hpp +0 -71
  84. package/react-native/boost/boost/config/platform/haiku.hpp +0 -31
  85. package/react-native/boost/boost/config/platform/hpux.hpp +0 -87
  86. package/react-native/boost/boost/config/platform/irix.hpp +0 -31
  87. package/react-native/boost/boost/config/platform/linux.hpp +0 -106
  88. package/react-native/boost/boost/config/platform/macos.hpp +0 -87
  89. package/react-native/boost/boost/config/platform/qnxnto.hpp +0 -31
  90. package/react-native/boost/boost/config/platform/solaris.hpp +0 -31
  91. package/react-native/boost/boost/config/platform/symbian.hpp +0 -97
  92. package/react-native/boost/boost/config/platform/vms.hpp +0 -25
  93. package/react-native/boost/boost/config/platform/vxworks.hpp +0 -422
  94. package/react-native/boost/boost/config/platform/wasm.hpp +0 -23
  95. package/react-native/boost/boost/config/platform/win32.hpp +0 -90
  96. package/react-native/boost/boost/config/platform/zos.hpp +0 -32
  97. package/react-native/boost/boost/config/pragma_message.hpp +0 -31
  98. package/react-native/boost/boost/config/requires_threads.hpp +0 -92
  99. package/react-native/boost/boost/config/stdlib/dinkumware.hpp +0 -324
  100. package/react-native/boost/boost/config/stdlib/libcomo.hpp +0 -93
  101. package/react-native/boost/boost/config/stdlib/libcpp.hpp +0 -180
  102. package/react-native/boost/boost/config/stdlib/libstdcpp3.hpp +0 -482
  103. package/react-native/boost/boost/config/stdlib/modena.hpp +0 -79
  104. package/react-native/boost/boost/config/stdlib/msl.hpp +0 -98
  105. package/react-native/boost/boost/config/stdlib/roguewave.hpp +0 -208
  106. package/react-native/boost/boost/config/stdlib/sgi.hpp +0 -168
  107. package/react-native/boost/boost/config/stdlib/stlport.hpp +0 -258
  108. package/react-native/boost/boost/config/stdlib/vacpp.hpp +0 -74
  109. package/react-native/boost/boost/config/stdlib/xlcpp_zos.hpp +0 -61
  110. package/react-native/boost/boost/config/user.hpp +0 -133
  111. package/react-native/boost/boost/config/warning_disable.hpp +0 -47
  112. package/react-native/boost/boost/config/workaround.hpp +0 -305
  113. package/react-native/boost/boost/config.hpp +0 -67
  114. package/react-native/boost/boost/cstdint.hpp +0 -556
  115. package/react-native/boost/boost/intrusive_ptr.hpp +0 -18
  116. package/react-native/boost/boost/smart_ptr/detail/atomic_count.hpp +0 -103
  117. package/react-native/boost/boost/smart_ptr/detail/atomic_count_gcc.hpp +0 -79
  118. package/react-native/boost/boost/smart_ptr/detail/atomic_count_gcc_atomic.hpp +0 -63
  119. package/react-native/boost/boost/smart_ptr/detail/atomic_count_gcc_x86.hpp +0 -88
  120. package/react-native/boost/boost/smart_ptr/detail/atomic_count_nt.hpp +0 -66
  121. package/react-native/boost/boost/smart_ptr/detail/atomic_count_pt.hpp +0 -104
  122. package/react-native/boost/boost/smart_ptr/detail/atomic_count_spin.hpp +0 -69
  123. package/react-native/boost/boost/smart_ptr/detail/atomic_count_std_atomic.hpp +0 -67
  124. package/react-native/boost/boost/smart_ptr/detail/atomic_count_sync.hpp +0 -72
  125. package/react-native/boost/boost/smart_ptr/detail/atomic_count_win32.hpp +0 -70
  126. package/react-native/boost/boost/smart_ptr/detail/local_counted_base.hpp +0 -148
  127. package/react-native/boost/boost/smart_ptr/detail/local_sp_deleter.hpp +0 -91
  128. package/react-native/boost/boost/smart_ptr/detail/operator_bool.hpp +0 -64
  129. package/react-native/boost/boost/smart_ptr/detail/requires_cxx11.hpp +0 -23
  130. package/react-native/boost/boost/smart_ptr/detail/shared_count.hpp +0 -707
  131. package/react-native/boost/boost/smart_ptr/detail/sp_convertible.hpp +0 -92
  132. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base.hpp +0 -92
  133. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp +0 -163
  134. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_aix.hpp +0 -152
  135. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp +0 -185
  136. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_atomic.hpp +0 -148
  137. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp +0 -170
  138. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp +0 -200
  139. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp +0 -194
  140. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp +0 -179
  141. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp +0 -186
  142. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_nt.hpp +0 -119
  143. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_pt.hpp +0 -147
  144. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp +0 -174
  145. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_spin.hpp +0 -141
  146. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp +0 -147
  147. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_sync.hpp +0 -165
  148. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp +0 -163
  149. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_w32.hpp +0 -140
  150. package/react-native/boost/boost/smart_ptr/detail/sp_counted_impl.hpp +0 -309
  151. package/react-native/boost/boost/smart_ptr/detail/sp_disable_deprecated.hpp +0 -40
  152. package/react-native/boost/boost/smart_ptr/detail/sp_forward.hpp +0 -52
  153. package/react-native/boost/boost/smart_ptr/detail/sp_has_gcc_intrinsics.hpp +0 -27
  154. package/react-native/boost/boost/smart_ptr/detail/sp_has_sync_intrinsics.hpp +0 -69
  155. package/react-native/boost/boost/smart_ptr/detail/sp_interlocked.hpp +0 -173
  156. package/react-native/boost/boost/smart_ptr/detail/sp_noexcept.hpp +0 -48
  157. package/react-native/boost/boost/smart_ptr/detail/sp_nullptr_t.hpp +0 -45
  158. package/react-native/boost/boost/smart_ptr/detail/sp_obsolete.hpp +0 -32
  159. package/react-native/boost/boost/smart_ptr/detail/sp_thread_pause.hpp +0 -51
  160. package/react-native/boost/boost/smart_ptr/detail/sp_thread_sleep.hpp +0 -104
  161. package/react-native/boost/boost/smart_ptr/detail/sp_thread_yield.hpp +0 -100
  162. package/react-native/boost/boost/smart_ptr/detail/sp_typeinfo_.hpp +0 -58
  163. package/react-native/boost/boost/smart_ptr/detail/sp_win32_sleep.hpp +0 -49
  164. package/react-native/boost/boost/smart_ptr/intrusive_ptr.hpp +0 -409
  165. package/react-native/boost/boost/smart_ptr/intrusive_ref_counter.hpp +0 -188
  166. package/react-native/cpp/include/Attachment.h +0 -16
  167. package/react-native/cpp/include/Authentication.h +0 -23
  168. package/react-native/cpp/include/Collection.h +0 -13
  169. package/react-native/cpp/include/DQL.h +0 -21
  170. package/react-native/cpp/include/Document.h +0 -17
  171. package/react-native/cpp/include/Identity.h +0 -17
  172. package/react-native/cpp/include/Lifecycle.h +0 -16
  173. package/react-native/cpp/include/LiveQuery.h +0 -17
  174. package/react-native/cpp/include/Logger.h +0 -22
  175. package/react-native/cpp/include/Misc.h +0 -26
  176. package/react-native/cpp/include/Presence.h +0 -14
  177. package/react-native/cpp/include/RetainableState.h +0 -24
  178. package/react-native/cpp/include/SmallPeerInfo.h +0 -17
  179. package/react-native/cpp/include/Transports.h +0 -25
  180. package/react-native/cpp/include/TypedArray.hpp +0 -167
  181. package/react-native/cpp/include/Utils.h +0 -61
  182. package/react-native/cpp/include/main.h +0 -10
  183. package/react-native/cpp/src/Attachment.cpp +0 -86
  184. package/react-native/cpp/src/Authentication.cpp +0 -224
  185. package/react-native/cpp/src/Collection.cpp +0 -54
  186. package/react-native/cpp/src/DQL.cpp +0 -254
  187. package/react-native/cpp/src/Document.cpp +0 -146
  188. package/react-native/cpp/src/Identity.cpp +0 -123
  189. package/react-native/cpp/src/Lifecycle.cpp +0 -75
  190. package/react-native/cpp/src/LiveQuery.cpp +0 -64
  191. package/react-native/cpp/src/Logger.cpp +0 -200
  192. package/react-native/cpp/src/Misc.cpp +0 -271
  193. package/react-native/cpp/src/Presence.cpp +0 -77
  194. package/react-native/cpp/src/RetainableState.cpp +0 -15
  195. package/react-native/cpp/src/SmallPeerInfo.cpp +0 -108
  196. package/react-native/cpp/src/Transports.cpp +0 -270
  197. package/react-native/cpp/src/TypedArray.cpp +0 -303
  198. package/react-native/cpp/src/Utils.cpp +0 -138
  199. package/react-native/cpp/src/main.cpp +0 -149
  200. package/react-native/dittoffi/dittoffi.h +0 -4698
  201. package/react-native/dittoffi/ifaddrs.cpp +0 -385
  202. package/react-native/dittoffi/ifaddrs.h +0 -206
  203. package/react-native/ios/DittoRNSDK.h +0 -7
  204. package/react-native/ios/DittoRNSDK.mm +0 -107
  205. package/react-native/ios/YeetJSIUtils.h +0 -60
  206. package/react-native/ios/YeetJSIUtils.mm +0 -196
  207. package/react-native/lib/commonjs/ditto.rn.js +0 -93
  208. package/react-native/lib/commonjs/ditto.rn.js.map +0 -1
  209. package/react-native/lib/commonjs/index.js +0 -14
  210. package/react-native/lib/commonjs/index.js.map +0 -1
  211. package/react-native/lib/module/ditto.rn.js +0 -83
  212. package/react-native/lib/module/ditto.rn.js.map +0 -1
  213. package/react-native/lib/module/index.js +0 -13
  214. package/react-native/lib/module/index.js.map +0 -1
  215. package/react-native/lib/typescript/ditto.rn.d.ts +0 -15
  216. package/react-native/lib/typescript/ditto.rn.d.ts.map +0 -1
  217. package/react-native/lib/typescript/index.d.ts +0 -1
  218. package/react-native/lib/typescript/index.d.ts.map +0 -1
  219. package/react-native/scripts/ruby/include_local_boost.rb +0 -78
  220. package/react-native/src/ditto.rn.ts +0 -91
  221. package/react-native/src/environment/environment.fallback.ts +0 -4
  222. package/react-native/src/index.ts +0 -26
  223. package/react-native/src/sources/@cbor-redux.ts +0 -2
  224. package/react-native/src/sources/@ditto.core.ts +0 -1
  225. package/react-native/src/sources/@environment.ts +0 -2
  226. package/react-native/src/sources/attachment-fetch-event.ts +0 -54
  227. package/react-native/src/sources/attachment-fetcher-manager.ts +0 -129
  228. package/react-native/src/sources/attachment-fetcher.ts +0 -124
  229. package/react-native/src/sources/attachment-token.ts +0 -48
  230. package/react-native/src/sources/attachment.ts +0 -59
  231. package/react-native/src/sources/augment.ts +0 -89
  232. package/react-native/src/sources/authenticator.ts +0 -314
  233. package/react-native/src/sources/base-pending-cursor-operation.ts +0 -237
  234. package/react-native/src/sources/base-pending-id-specific-operation.ts +0 -109
  235. package/react-native/src/sources/bridge.ts +0 -549
  236. package/react-native/src/sources/build-time-constants.ts +0 -4
  237. package/react-native/src/sources/cbor.ts +0 -35
  238. package/react-native/src/sources/collection-interface.ts +0 -67
  239. package/react-native/src/sources/collection.ts +0 -212
  240. package/react-native/src/sources/collections-event.ts +0 -99
  241. package/react-native/src/sources/counter.ts +0 -77
  242. package/react-native/src/sources/ditto.ts +0 -945
  243. package/react-native/src/sources/document-id.ts +0 -159
  244. package/react-native/src/sources/document-path.ts +0 -303
  245. package/react-native/src/sources/document.ts +0 -192
  246. package/react-native/src/sources/epilogue.ts +0 -24
  247. package/react-native/src/sources/error-codes.ts +0 -52
  248. package/react-native/src/sources/error.ts +0 -203
  249. package/react-native/src/sources/essentials.ts +0 -53
  250. package/react-native/src/sources/ffi-error.ts +0 -117
  251. package/react-native/src/sources/ffi.ts +0 -1972
  252. package/react-native/src/sources/identity.ts +0 -163
  253. package/react-native/src/sources/init.ts +0 -70
  254. package/react-native/src/sources/internal.ts +0 -113
  255. package/react-native/src/sources/keep-alive.ts +0 -69
  256. package/react-native/src/sources/key-path.ts +0 -195
  257. package/react-native/src/sources/live-query-event.ts +0 -208
  258. package/react-native/src/sources/live-query-manager.ts +0 -101
  259. package/react-native/src/sources/live-query.ts +0 -164
  260. package/react-native/src/sources/logger.ts +0 -196
  261. package/react-native/src/sources/observer-manager.ts +0 -175
  262. package/react-native/src/sources/observer.ts +0 -77
  263. package/react-native/src/sources/pending-collections-operation.ts +0 -232
  264. package/react-native/src/sources/pending-cursor-operation.ts +0 -218
  265. package/react-native/src/sources/pending-id-specific-operation.ts +0 -216
  266. package/react-native/src/sources/presence-manager.ts +0 -160
  267. package/react-native/src/sources/presence.ts +0 -238
  268. package/react-native/src/sources/query-result-item.ts +0 -116
  269. package/react-native/src/sources/query-result.ts +0 -55
  270. package/react-native/src/sources/register.ts +0 -92
  271. package/react-native/src/sources/small-peer-info.ts +0 -176
  272. package/react-native/src/sources/static-tcp-client.ts +0 -6
  273. package/react-native/src/sources/store-observer.ts +0 -176
  274. package/react-native/src/sources/store.ts +0 -365
  275. package/react-native/src/sources/subscription-manager.ts +0 -98
  276. package/react-native/src/sources/subscription.ts +0 -88
  277. package/react-native/src/sources/sync-subscription.ts +0 -90
  278. package/react-native/src/sources/sync.ts +0 -495
  279. package/react-native/src/sources/test-helpers.ts +0 -24
  280. package/react-native/src/sources/transport-conditions-manager.ts +0 -104
  281. package/react-native/src/sources/transport-config.ts +0 -428
  282. package/react-native/src/sources/update-result.ts +0 -66
  283. package/react-native/src/sources/update-results-map.ts +0 -57
  284. package/react-native/src/sources/websocket-client.ts +0 -6
  285. package/react-native/src/sources/write-transaction-collection.ts +0 -122
  286. package/react-native/src/sources/write-transaction-pending-cursor-operation.ts +0 -101
  287. package/react-native/src/sources/write-transaction-pending-id-specific-operation.ts +0 -72
  288. package/react-native/src/sources/write-transaction.ts +0 -119
  289. package/react-native.config.js +0 -9
package/web/ditto.wasm CHANGED
Binary file
@@ -1,27 +0,0 @@
1
- # Podspec *must* be located at package root level or it will not be find for React
2
- # Native's autolinking.
3
- require "json"
4
- require_relative 'react-native/scripts/ruby/include_local_boost.rb'
5
-
6
- package = JSON.parse(File.read(File.join(__dir__, "package.json")))
7
-
8
- Pod::Spec.new do |s|
9
- s.name = "DittoReactNative"
10
- s.version = package["version"]
11
- s.summary = package["description"]
12
- s.homepage = package["homepage"]
13
- s.license = package["license"]
14
- s.authors = package["author"]
15
-
16
- s.platforms = { :ios => "14.0" }
17
-
18
- s.source = { :http => 'https://software.ditto.live/react-native/ditto/4.5.0/ios/DittoReactNative.xcframework.tar.gz' }
19
- s.vendored_frameworks = "DittoReactNative.xcframework"
20
-
21
- include_local_boost(s)
22
-
23
- s.source_files = "react-native/ios/**/*.{h,m,mm}", "react-native/cpp/**/*.{h,cpp,hpp}"
24
- s.public_header_files = 'react-native/dittoffi/dittoffi.h', 'react-native/dittoffi/ifaddrs.h'
25
-
26
- s.dependency "React-Core"
27
- end
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,37 +0,0 @@
1
- cmake_minimum_required(VERSION 3.9.0)
2
-
3
- set (PACKAGE_NAME "cpp")
4
- project(PACKAGE_NAME)
5
- set (BUILD_DIR ../../../)
6
- set(CMAKE_VERBOSE_MAKEFILE ON)
7
- set(CMAKE_CXX_STANDARD 17)
8
-
9
- include_directories(
10
- ../cpp/include
11
- ../dittoffi
12
- ../boost
13
- )
14
-
15
- file(GLOB SOURCES "../cpp/src/*.cpp")
16
- add_library(
17
- ${PACKAGE_NAME}
18
- SHARED
19
- ${SOURCES}
20
- ../dittoffi/ifaddrs.cpp
21
- ./cpp-adapter.cpp
22
-
23
- )
24
-
25
- find_package(ReactAndroid REQUIRED CONFIG)
26
- find_library(log-lib log)
27
-
28
- add_library(ditto STATIC IMPORTED)
29
- set_target_properties(ditto PROPERTIES IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/../dittoffi/android/${ANDROID_ABI}/libdittoffi.a")
30
-
31
- target_link_libraries(
32
- ${PACKAGE_NAME}
33
- ditto
34
- ${log-lib}
35
- ReactAndroid::jsi
36
- android
37
- )
@@ -1,203 +0,0 @@
1
- import java.nio.file.Paths
2
-
3
- buildscript {
4
- repositories {
5
- google()
6
- mavenCentral()
7
- }
8
- dependencies {
9
- classpath 'com.android.tools.build:gradle:7.2.1'
10
- }
11
- }
12
-
13
- def isNewArchitectureEnabled() {
14
- return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
15
- }
16
-
17
- apply plugin: "com.android.library"
18
-
19
-
20
- def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
21
-
22
- if (isNewArchitectureEnabled()) {
23
- apply plugin: 'com.facebook.react'
24
- }
25
-
26
- def getExtOrDefault(name) {
27
- return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["rnsdk_" + name]
28
- }
29
-
30
- def getExtOrIntegerDefault(name) {
31
- return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["rnsdk_" + name]).toInteger()
32
- }
33
-
34
- def found = false
35
- def basePath = projectDir.toPath().normalize()
36
-
37
- // Find node_modules inside the example project
38
- def nodeModulesDir = Paths.get(basePath.getParent().toString(), "example/node_modules")
39
- def reactNativeDir = Paths.get(nodeModulesDir.toString(), "react-native/android")
40
- if (nodeModulesDir.toFile().exists() && reactNativeDir.toFile().exists()) {
41
- found = true
42
- }
43
-
44
- if(!found){
45
- // Node's module resolution algorithm searches up to the root directory,
46
- // after which the base path will be null
47
- while (basePath) {
48
- nodeModulesDir = Paths.get(basePath.toString(), "node_modules")
49
- reactNativeDir = Paths.get(nodeModulesDir.toString(), "react-native/android")
50
- if (nodeModulesDir.toFile().exists() && reactNativeDir.toFile().exists()) {
51
- found = true
52
- break;
53
- }
54
- basePath = basePath.getParent()
55
- }
56
- }
57
-
58
- if(!found) {
59
- throw new GradleException(
60
- "${project.name}: unable to locate React Native android sources. " +
61
- "Ensure you have you installed React Native as a dependency in your project and try again.")
62
- }
63
-
64
- def nodeModulesPath = nodeModulesDir.toString().replace("\\", "/")
65
- def reactNativePath = reactNativeDir.toString().replace("\\", "/")
66
-
67
- def supportsNamespace() {
68
- def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
69
- def major = parsed[0].toInteger()
70
- def minor = parsed[1].toInteger()
71
-
72
- // Namespace support was added in 7.3.0
73
- if (major == 7 && minor >= 3) {
74
- return true
75
- }
76
-
77
- return major >= 8
78
- }
79
-
80
- android {
81
- if (supportsNamespace()) {
82
- namespace "com.dittolive.rnsdk"
83
-
84
- sourceSets {
85
- main {
86
- manifest.srcFile "src/main/AndroidManifestNew.xml"
87
- }
88
- }
89
- }
90
-
91
- // ESSENTIAL for adding JSI
92
- buildFeatures {
93
- prefab true
94
- }
95
-
96
- ndkVersion getExtOrDefault("ndkVersion")
97
- compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
98
-
99
- defaultConfig {
100
- minSdkVersion getExtOrIntegerDefault("minSdkVersion")
101
- targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
102
- buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
103
- externalNativeBuild {
104
- cmake {
105
- cppFlags "-O2 -frtti -fexceptions -Wall -fstack-protector-all"
106
- // ESSENTIAL for adding JSI
107
- arguments "-DANDROID_STL=c++_shared"
108
- abiFilters "x86", "x86_64", "armeabi-v7a", "arm64-v8a"
109
- }
110
- }
111
- }
112
-
113
- externalNativeBuild {
114
- cmake {
115
- path "CMakeLists.txt"
116
- }
117
- }
118
-
119
- buildTypes {
120
- release {
121
- minifyEnabled false
122
- }
123
- }
124
-
125
- lintOptions {
126
- disable "GradleCompatible"
127
- }
128
-
129
- compileOptions {
130
- sourceCompatibility JavaVersion.VERSION_1_8
131
- targetCompatibility JavaVersion.VERSION_1_8
132
- }
133
-
134
- sourceSets {
135
- main {
136
- if (isNewArchitectureEnabled()) {
137
- java.srcDirs += [
138
- // This is needed to build Kotlin project with NewArch enabled
139
- "${project.buildDir}/generated/source/codegen/java"
140
- ]
141
- }
142
- }
143
- }
144
- }
145
-
146
- repositories {
147
- mavenCentral()
148
- google()
149
- }
150
-
151
- dependencies {
152
- // For < 0.71, this will be from the local maven repo
153
- // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
154
- //noinspection GradleDynamicVersion
155
- implementation "com.facebook.react:react-native:+"
156
- implementation files('libs/ditto.aar')
157
- }
158
-
159
- if (isNewArchitectureEnabled()) {
160
- react {
161
- jsRootDir = file("../src/")
162
- libraryName = "DittoRNSDK"
163
- codegenJavaPackageName = "com.dittolive.rnsdk"
164
- }
165
- }
166
-
167
- task downloadBinaries {
168
- doLast {
169
- def defaultArchitectures = ['arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64']
170
-
171
- defaultArchitectures.each { arch ->
172
- def fileUrl = "https://software.ditto.live/react-native/ditto/4.5.0/android/${arch}/libdittoffi.a"
173
-
174
- new File("${project.projectDir}/../dittoffi/android/${arch}").mkdirs()
175
- def localFilePath = "${project.projectDir}/../dittoffi/android/${arch}/libdittoffi.a"
176
-
177
- if (!new File(localFilePath).exists()) {
178
- println "Downloading file for $arch: $fileUrl"
179
- ant.get(src: fileUrl, dest: localFilePath, verbose: true)
180
- } else {
181
- println "File for $arch already exists, skipping download: $localFilePath"
182
- }
183
- }
184
- }
185
- }
186
- preBuild.dependsOn downloadBinaries
187
-
188
- task downloadAar {
189
- def fileUrl = "https://software.ditto.live/react-native/ditto/4.5.0/android/ditto.aar"
190
-
191
- doLast {
192
- new File("${project.projectDir}/libs").mkdirs()
193
-
194
- def localFilePath = "${project.projectDir}/libs/ditto.aar"
195
- if (!new File(localFilePath).exists()) {
196
- println "Downloading file: $fileUrl"
197
- ant.get(src: fileUrl, dest: localFilePath, verbose: true)
198
- } else {
199
- println "File already exists, skipping download: $localFilePath"
200
- }
201
- }
202
- }
203
- preBuild.dependsOn downloadAar
@@ -1,254 +0,0 @@
1
- #include <jni.h>
2
- #include <sys/types.h>
3
- #include <jsi/jsi.h>
4
- #include <pthread.h>
5
-
6
- #include "main.h"
7
- #include "TypedArray.hpp"
8
- #include "dittoffi.h"
9
- #include <sstream>
10
- #include <string>
11
- #include <vector>
12
- #include <android/log.h>
13
-
14
- using namespace facebook::jsi;
15
-
16
- JavaVM *java_vm;
17
- jclass java_class;
18
- jobject java_object;
19
- jobject java_context;
20
-
21
- /**
22
- * A simple callback function that allows us to detach current JNI Environment
23
- * when the thread
24
- * See https://stackoverflow.com/a/30026231 for detailed explanation
25
- */
26
-
27
- void DeferThreadDetach(JNIEnv *env)
28
- {
29
- static pthread_key_t thread_key;
30
-
31
- // Set up a Thread Specific Data key, and a callback that
32
- // will be executed when a thread is destroyed.
33
- // This is only done once, across all threads, and the value
34
- // associated with the key for any given thread will initially
35
- // be NULL.
36
- static auto run_once = []
37
- {
38
- const auto err = pthread_key_create(&thread_key, [](void *ts_env)
39
- {
40
- if (ts_env) {
41
- java_vm->DetachCurrentThread();
42
- } });
43
- if (err)
44
- {
45
- // Failed to create TSD key. Throw an exception if you want to.
46
- }
47
- return 0;
48
- }();
49
-
50
- // For the callback to actually be executed when a thread exits
51
- // we need to associate a non-NULL value with the key on that thread.
52
- // We can use the JNIEnv* as that value.
53
- const auto ts_env = pthread_getspecific(thread_key);
54
- if (!ts_env)
55
- {
56
- if (pthread_setspecific(thread_key, env))
57
- {
58
- // Failed to set thread-specific value for key. Throw an exception if you want to.
59
- }
60
- }
61
- }
62
-
63
- /**
64
- * Get a JNIEnv* valid for this thread, regardless of whether
65
- * we're on a native thread or a Java thread.
66
- * If the calling thread is not currently attached to the JVM
67
- * it will be attached, and then automatically detached when the
68
- * thread is destroyed.
69
- *
70
- * See https://stackoverflow.com/a/30026231 for detailed explanation
71
- */
72
- JNIEnv *GetJniEnv()
73
- {
74
- JNIEnv *env = nullptr;
75
- // We still call GetEnv first to detect if the thread already
76
- // is attached. This is done to avoid setting up a DetachCurrentThread
77
- // call on a Java thread.
78
-
79
- // g_vm is a global.
80
- auto get_env_result = java_vm->GetEnv((void **)&env, JNI_VERSION_1_6);
81
- if (get_env_result == JNI_EDETACHED)
82
- {
83
- if (java_vm->AttachCurrentThread(&env, NULL) == JNI_OK)
84
- {
85
- DeferThreadDetach(env);
86
- }
87
- else
88
- {
89
- // Failed to attach thread. Throw an exception if you want to.
90
- }
91
- }
92
- else if (get_env_result == JNI_EVERSION)
93
- {
94
- // Unsupported JNI version. Throw an exception if you want to.
95
- }
96
- return env;
97
- }
98
-
99
- static jstring string2jstring(JNIEnv *env, const std::string &str)
100
- {
101
- return (*env).NewStringUTF(str.c_str());
102
- }
103
-
104
- void install(Runtime &jsiRuntime)
105
- {
106
- auto getDeviceName = Function::createFromHostFunction(jsiRuntime,
107
- PropNameID::forAscii(jsiRuntime,
108
- "getDeviceName"),
109
- 0,
110
- [](Runtime &runtime,
111
- const Value &thisValue,
112
- const Value *arguments,
113
- size_t count) -> Value
114
- {
115
- JNIEnv *jniEnv = GetJniEnv();
116
-
117
- java_class = jniEnv->GetObjectClass(
118
- java_object);
119
- jmethodID getDeviceName = jniEnv->GetMethodID(
120
- java_class, "getDeviceName",
121
- "()Ljava/lang/String;");
122
- jobject result = jniEnv->CallObjectMethod(
123
- java_object, getDeviceName);
124
- const char *str = jniEnv->GetStringUTFChars(
125
- (jstring)result, NULL);
126
-
127
- return Value(runtime,
128
- String::createFromUtf8(
129
- runtime, str));
130
- });
131
-
132
- jsiRuntime.global().setProperty(jsiRuntime, "getDeviceName", std::move(getDeviceName));
133
-
134
- auto createDirectory = Function::createFromHostFunction(jsiRuntime,
135
- PropNameID::forAscii(jsiRuntime,
136
- "createDirectory"),
137
- 0,
138
- [](Runtime &runtime,
139
- const Value &thisValue,
140
- const Value *arguments,
141
- size_t count) -> Value
142
- {
143
- std::string path = arguments[0].getString(runtime).utf8(runtime);
144
- JNIEnv *jniEnv = GetJniEnv();
145
-
146
- jclass localJavaClass = jniEnv->GetObjectClass(java_object);
147
- jmethodID createDirectory = jniEnv->GetMethodID(localJavaClass, "createDirectory", "(Ljava/lang/String;)Ljava/lang/String;");
148
- jstring jPath = string2jstring(jniEnv, path);
149
- jobject result = jniEnv->CallObjectMethod(java_object, createDirectory, jPath);
150
-
151
- const char *str = jniEnv->GetStringUTFChars((jstring)result, NULL);
152
-
153
- jniEnv->ReleaseStringUTFChars((jstring)result, str);
154
- jniEnv->DeleteLocalRef(jPath);
155
- jniEnv->DeleteLocalRef(localJavaClass);
156
- jniEnv->DeleteLocalRef(result);
157
-
158
- return Value(runtime, String::createFromUtf8(runtime, str));
159
- });
160
-
161
- jsiRuntime.global().setProperty(jsiRuntime, "createDirectory", std::move(createDirectory));
162
-
163
- auto getRandomValues = Function::createFromHostFunction(jsiRuntime,
164
- PropNameID::forUtf8(jsiRuntime, "getRandomValues"),
165
- 1,
166
- [](Runtime &runtime,
167
- const Value &thisArg,
168
- const Value *args,
169
- size_t count) -> Value
170
- {
171
- TypedArrayBase typedArrayBase(runtime, args[0].asObject(runtime));
172
- auto byteLength = typedArrayBase.byteLength(runtime);
173
-
174
- JNIEnv *jniEnv = GetJniEnv();
175
- jclass clazz = jniEnv->GetObjectClass(java_object);
176
- jmethodID getRandomValues = jniEnv->GetMethodID(clazz, "getRandomValues", "(I)[B");
177
- auto b = (jbyteArray)jniEnv->CallObjectMethod(java_object,
178
- getRandomValues,
179
- byteLength);
180
- jboolean isCopy = true;
181
- jbyte *values = jniEnv->GetByteArrayElements(b, &isCopy);
182
- jniEnv->DeleteLocalRef(b);
183
-
184
- auto randomValues = reinterpret_cast<std::byte *>(values);
185
-
186
- auto typedArray = TypedArray<TypedArrayKind::Uint8Array>(runtime, byteLength);
187
- auto arrayBuffer = typedArray.getBuffer(runtime);
188
- memcpy(arrayBuffer.data(runtime), reinterpret_cast<std::byte *>(randomValues), byteLength);
189
- return typedArray;
190
- });
191
-
192
- jsiRuntime.global().setProperty(jsiRuntime, "getRandomValues", std::move(getRandomValues));
193
-
194
- auto ditto_sdk_transports_set_android_context = Function::createFromHostFunction(jsiRuntime,
195
- PropNameID::forUtf8(
196
- jsiRuntime,
197
- "ditto_sdk_transports_set_android_context"),
198
- 1,
199
- [](Runtime &runtime,
200
- const Value &thisArg,
201
- const Value *args,
202
- size_t count) -> Value {
203
-
204
- return ::ditto_sdk_transports_set_android_context(
205
- GetJniEnv(),
206
- java_context);
207
- });
208
-
209
- jsiRuntime.global().setProperty(jsiRuntime, "ditto_sdk_transports_set_android_context",
210
- std::move(ditto_sdk_transports_set_android_context));
211
-
212
- auto ditto_sdk_transports_android_missing_permissions = Function::createFromHostFunction(
213
- jsiRuntime,
214
- PropNameID::forUtf8(jsiRuntime, "ditto_sdk_transports_android_missing_permissions"),
215
- 1,
216
- [](Runtime &runtime,
217
- const Value &thisArg,
218
- const Value *args,
219
- size_t count) -> Value {
220
- char *result = ::ditto_sdk_transports_android_missing_permissions();
221
- std::vector<std::string> lines;
222
- std::stringstream ss(result);
223
- std::string line;
224
- while (std::getline(ss, line, '\n')) {
225
- lines.push_back(line);
226
- }
227
-
228
- Array jsiArray(runtime, lines.size());
229
- for (size_t i = 0; i < lines.size(); ++i) {
230
- jsiArray.setValueAtIndex(runtime, i, String::createFromUtf8(runtime, lines[i]));
231
- }
232
-
233
- return jsiArray;
234
- });
235
-
236
- jsiRuntime.global().setProperty(jsiRuntime, "ditto_sdk_transports_android_missing_permissions",
237
- std::move(ditto_sdk_transports_android_missing_permissions));
238
- }
239
-
240
- extern "C" JNIEXPORT void JNICALL
241
- Java_com_dittolive_rnsdk_DittoRNSDKModule_nativeInstall(JNIEnv *env, jobject thiz, jobject context,
242
- jlong jsiPtr) {
243
- // Save context, module, java_vm objects globally (thread-safe, as opposed to JNIEnv)
244
- java_context = env->NewGlobalRef(context);
245
- java_object = env->NewGlobalRef(thiz);
246
- env->GetJavaVM(&java_vm);
247
-
248
- // Install JSI
249
- Runtime *runtime = reinterpret_cast<Runtime *>(jsiPtr);
250
- if (runtime) {
251
- sharedjsi::install(*runtime);
252
- install(*runtime);
253
- }
254
- }
@@ -1,5 +0,0 @@
1
- rnsdk_kotlinVersion=1.7.0
2
- rnsdk_minSdkVersion=24
3
- rnsdk_targetSdkVersion=31
4
- rnsdk_compileSdkVersion=31
5
- rnsdk_ndkversion=21.4.7075529
@@ -1,4 +0,0 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- package="com.dittolive.rnsdk">
3
-
4
- </manifest>
@@ -1,85 +0,0 @@
1
- package com.dittolive.rnsdk;
2
-
3
- import android.os.Build;
4
- import android.util.Log;
5
-
6
- import androidx.annotation.NonNull;
7
-
8
- import com.facebook.react.bridge.ReactApplicationContext;
9
- import com.facebook.react.bridge.ReactContextBaseJavaModule;
10
- import com.facebook.react.module.annotations.ReactModule;
11
- import com.facebook.react.bridge.ReactMethod;
12
- import java.io.File;
13
-
14
- import java.security.SecureRandom;
15
-
16
- @ReactModule(name = DittoRNSDKModule.NAME)
17
- public class DittoRNSDKModule extends ReactContextBaseJavaModule {
18
- public static final String NAME = "DittoRNSDK";
19
- private native void nativeInstall(ReactApplicationContext context, long jsiPtr);
20
-
21
- public DittoRNSDKModule(ReactApplicationContext reactContext) {
22
- super(reactContext);
23
- }
24
-
25
- @Override
26
- @NonNull
27
- public String getName() {
28
- return NAME;
29
- }
30
-
31
- @ReactMethod(isBlockingSynchronousMethod = true)
32
- public boolean install() {
33
- try {
34
- System.loadLibrary("cpp");
35
-
36
- ReactApplicationContext context = getReactApplicationContext();
37
- nativeInstall(
38
- context,
39
- context.getJavaScriptContextHolder().get()
40
- );
41
- return true;
42
- } catch (Exception exception) {
43
- return false;
44
- }
45
- }
46
-
47
- public String getDeviceName() {
48
- String manufacturer = Build.MANUFACTURER;
49
- String model = Build.MODEL;
50
- if (model.startsWith(manufacturer)) {
51
- return model;
52
- } else {
53
- return manufacturer + " " + model;
54
- }
55
- }
56
-
57
- public String createDirectory(String path) {
58
- File dir;
59
-
60
- // If the path doesn't start with '/', treat it as a relative path.
61
- if (!path.startsWith("/")) {
62
- ReactApplicationContext context = getReactApplicationContext();
63
- File appDir = context.getFilesDir(); // Get app's data directory
64
- dir = new File(appDir, path);
65
- } else {
66
- dir = new File(path);
67
- }
68
-
69
- if (!dir.exists() && !dir.mkdirs()) {
70
- Log.e("AppLog", "Error creating directory: " + dir.getAbsolutePath());
71
- }
72
-
73
- return dir.getAbsolutePath();
74
- }
75
-
76
-
77
- public byte[] getRandomValues(int byteLength) {
78
- byte[] data = new byte[byteLength];
79
- SecureRandom random = new SecureRandom();
80
-
81
- random.nextBytes(data);
82
-
83
- return data;
84
- }
85
- }
@@ -1,28 +0,0 @@
1
- package com.dittolive.rnsdk;
2
-
3
- import androidx.annotation.NonNull;
4
-
5
- import com.facebook.react.ReactPackage;
6
- import com.facebook.react.bridge.NativeModule;
7
- import com.facebook.react.bridge.ReactApplicationContext;
8
- import com.facebook.react.uimanager.ViewManager;
9
-
10
- import java.util.ArrayList;
11
- import java.util.Collections;
12
- import java.util.List;
13
-
14
- public class DittoRNSDKPackage implements ReactPackage {
15
- @NonNull
16
- @Override
17
- public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
18
- List<NativeModule> modules = new ArrayList<>();
19
- modules.add(new DittoRNSDKModule(reactContext));
20
- return modules;
21
- }
22
-
23
- @NonNull
24
- @Override
25
- public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) {
26
- return Collections.emptyList();
27
- }
28
- }