rhodes 7.4.1 → 7.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +5 -5
  2. data/CREDITS +3 -1
  3. data/LICENSE +1 -1
  4. data/README.md +3 -1
  5. data/Rakefile +52 -43
  6. data/SECURITY.md +19 -0
  7. data/appveyor.yml +60 -7
  8. data/azure-pipelines.yml +67 -0
  9. data/extensions/rhoconnect-push/ext/rhoconnect-push/platform/android/src/com/rhomobile/rhoelements/ans/ANSManager.java +2 -2
  10. data/lib/commonAPI/barcode/ext/platform/android/AndroidManifest.xml +3 -1
  11. data/lib/commonAPI/barcode/ext/platform/android/src/com/google/barcodereader/BarcodeCaptureActivity.java +11 -13
  12. data/lib/commonAPI/barcode/ext/platform/android/src/com/google/barcodereader/BarcodeGraphicTracker.java +1 -1
  13. data/lib/commonAPI/barcode/ext/platform/android/src/com/google/barcodereader/ui/camera/CameraSource.java +3 -3
  14. data/lib/commonAPI/barcode/ext/platform/android/src/com/google/barcodereader/ui/camera/CameraSourcePreview.java +1 -1
  15. data/lib/commonAPI/barcode/ext.yml +4 -8
  16. data/lib/commonAPI/coreapi/ext/platform/android/Rakefile +0 -12
  17. data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/Notification.java +4 -2
  18. data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/NotificationScheduler.java +3 -3
  19. data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/NotificationSingleton.java +1 -1
  20. data/lib/commonAPI/coreapi/ext/push.xml +5 -2
  21. data/lib/commonAPI/mediacapture/ext/camera.xml +4 -9
  22. data/lib/commonAPI/mediacapture/ext/platform/android/ApplicationFileProvider.erb +1 -1
  23. data/lib/commonAPI/mediacapture/ext/platform/android/ext_java.files +1 -9
  24. data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraExtension.java +0 -2
  25. data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraFactory.java +19 -24
  26. data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraObject.java +317 -729
  27. data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraRhoListener.java +240 -434
  28. data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/{CameraSingletonObject.java → CameraSingleton.java} +68 -74
  29. data/lib/commonAPI/printing_zebra/ext/platform/android/src/com/rhomobile/printing/zebra/impl/ZebraPrintingProviderImpl.java +2 -1
  30. data/lib/extensions/fcm-push/ext/android/ApplicationManifestAdds.erb +15 -17
  31. data/lib/extensions/fcm-push/ext/android/Rakefile +59 -34
  32. data/lib/extensions/fcm-push/ext/android/ext_java.files +0 -1
  33. data/lib/extensions/fcm-push/ext/android/src/com/rhomobile/rhodes/fcm/FCMFacade.java +13 -17
  34. data/lib/extensions/fcm-push/ext/android/src/com/rhomobile/rhodes/fcm/FCMIntentService.java +81 -80
  35. data/lib/extensions/fcm-push/ext/android/src/com/rhomobile/rhodes/fcm/FCMListener.java +0 -16
  36. data/lib/extensions/fcm-push/ext.yml +1 -1
  37. data/lib/extensions/gmaps/ext/platform/android/ApplicationManifestAdds.erb +1 -0
  38. data/lib/extensions/gmaps/ext/platform/android/src/com/rhomobile/rhodes/gmaps/GMapActivity.java +12 -4
  39. data/lib/extensions/gmaps/ext.yml +3 -1
  40. data/platform/android/Rhodes/jni/src/MethodResultJni.cpp +4 -0
  41. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +3 -3
  42. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +3 -3
  43. data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/StatusNotification.java +1 -1
  44. data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java +14 -14
  45. data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +18 -9
  46. data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality26.java +1 -1
  47. data/platform/android/build/{aab_builder.rb → aapt2_helper.rb} +94 -37
  48. data/platform/android/build/android.rake +124 -191
  49. data/platform/android/build/android_tools.rb +9 -9
  50. data/platform/android/build/androidcommon.rb +18 -7
  51. data/platform/android/build/build_tools_finder.rb +46 -0
  52. data/platform/android/build/config.yml +5 -0
  53. data/platform/android/build/dex_builder.rb +88 -0
  54. data/platform/android/build/hostplatform.rb +9 -0
  55. data/platform/android/build/manifest_generator.rb +1 -0
  56. data/platform/android/build/maven_deps_extractor.rb +22 -21
  57. data/platform/android/build/ndkwrapper.rb +80 -51
  58. data/platform/iphone/Classes/AppManager/AppManager.m +3 -1
  59. data/platform/iphone/Classes/Camera/PickImageDelegate.h +2 -0
  60. data/platform/iphone/Classes/Camera/PickImageDelegate.m +45 -23
  61. data/platform/iphone/Classes/CocoaServer/CCocoaServer.h +27 -0
  62. data/platform/iphone/Classes/CocoaServer/CCocoaServer.m +107 -0
  63. data/platform/iphone/Classes/CocoaServer/RhoHTTPConnection.h +16 -0
  64. data/platform/iphone/Classes/CocoaServer/RhoHTTPConnection.m +226 -0
  65. data/platform/iphone/Classes/RhoWKWebView.mm +78 -11
  66. data/platform/iphone/Classes/RhoWebViewFabrique.m +6 -1
  67. data/platform/iphone/Classes/Rhodes.m +3 -0
  68. data/platform/iphone/CocoaHTTPServer/Core/Categories/DDData.h +14 -0
  69. data/platform/iphone/CocoaHTTPServer/Core/Categories/DDData.m +158 -0
  70. data/platform/iphone/CocoaHTTPServer/Core/Categories/DDNumber.h +12 -0
  71. data/platform/iphone/CocoaHTTPServer/Core/Categories/DDNumber.m +88 -0
  72. data/platform/iphone/CocoaHTTPServer/Core/Categories/DDRange.h +56 -0
  73. data/platform/iphone/CocoaHTTPServer/Core/Categories/DDRange.m +104 -0
  74. data/platform/iphone/CocoaHTTPServer/Core/HTTPAuthenticationRequest.h +45 -0
  75. data/platform/iphone/CocoaHTTPServer/Core/HTTPAuthenticationRequest.m +195 -0
  76. data/platform/iphone/CocoaHTTPServer/Core/HTTPConnection.h +120 -0
  77. data/platform/iphone/CocoaHTTPServer/Core/HTTPConnection.m +2708 -0
  78. data/platform/iphone/CocoaHTTPServer/Core/HTTPLogging.h +136 -0
  79. data/platform/iphone/CocoaHTTPServer/Core/HTTPMessage.h +48 -0
  80. data/platform/iphone/CocoaHTTPServer/Core/HTTPMessage.m +113 -0
  81. data/platform/iphone/CocoaHTTPServer/Core/HTTPResponse.h +149 -0
  82. data/platform/iphone/CocoaHTTPServer/Core/HTTPServer.h +205 -0
  83. data/platform/iphone/CocoaHTTPServer/Core/HTTPServer.m +772 -0
  84. data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartFormDataParser.h +65 -0
  85. data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartFormDataParser.m +529 -0
  86. data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartMessageHeader.h +33 -0
  87. data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartMessageHeader.m +86 -0
  88. data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartMessageHeaderField.h +23 -0
  89. data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartMessageHeaderField.m +211 -0
  90. data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPAsyncFileResponse.h +75 -0
  91. data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPAsyncFileResponse.m +405 -0
  92. data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPDataResponse.h +13 -0
  93. data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPDataResponse.m +79 -0
  94. data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPDynamicFileResponse.h +52 -0
  95. data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPDynamicFileResponse.m +292 -0
  96. data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPErrorResponse.h +9 -0
  97. data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPErrorResponse.m +38 -0
  98. data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPFileResponse.h +25 -0
  99. data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPFileResponse.m +237 -0
  100. data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPRedirectResponse.h +12 -0
  101. data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPRedirectResponse.m +73 -0
  102. data/platform/iphone/CocoaHTTPServer/Core/WebSocket.h +105 -0
  103. data/platform/iphone/CocoaHTTPServer/Core/WebSocket.m +791 -0
  104. data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DAVConnection.h +7 -0
  105. data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DAVConnection.m +160 -0
  106. data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DAVResponse.h +11 -0
  107. data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DAVResponse.m +372 -0
  108. data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DELETEResponse.h +7 -0
  109. data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DELETEResponse.m +49 -0
  110. data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/PUTResponse.h +8 -0
  111. data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/PUTResponse.m +69 -0
  112. data/platform/iphone/CocoaHTTPServer/LICENSE.txt +18 -0
  113. data/platform/iphone/CocoaHTTPServer/Vendor/CocoaAsyncSocket/About.txt +4 -0
  114. data/platform/iphone/CocoaHTTPServer/Vendor/CocoaAsyncSocket/GCDAsyncSocket.h +1226 -0
  115. data/platform/iphone/CocoaHTTPServer/Vendor/CocoaAsyncSocket/GCDAsyncSocket.m +8528 -0
  116. data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/About.txt +33 -0
  117. data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDASLLogger.h +41 -0
  118. data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDASLLogger.m +99 -0
  119. data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDAbstractDatabaseLogger.h +102 -0
  120. data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDAbstractDatabaseLogger.m +727 -0
  121. data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDFileLogger.h +334 -0
  122. data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDFileLogger.m +1353 -0
  123. data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDLog.h +601 -0
  124. data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDLog.m +1083 -0
  125. data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDTTYLogger.h +167 -0
  126. data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDTTYLogger.m +1479 -0
  127. data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/Extensions/ContextFilterLogFormatter.h +65 -0
  128. data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/Extensions/ContextFilterLogFormatter.m +191 -0
  129. data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/Extensions/DispatchQueueLogFormatter.h +116 -0
  130. data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/Extensions/DispatchQueueLogFormatter.m +251 -0
  131. data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/Extensions/README.txt +7 -0
  132. data/platform/iphone/Framework/Rhodes/Rhodes.xcodeproj/project.pbxproj +1 -1
  133. data/platform/iphone/RhoAppBaseLib/RhoAppBaseLib.xcodeproj/project.pbxproj +364 -0
  134. data/platform/iphone/rbuild/iphone.rake +4 -0
  135. data/platform/osx/bin/RhoSimulator/RhoSimulator.app.zip +0 -0
  136. data/platform/shared/common/RhodesApp.cpp +26 -1
  137. data/platform/shared/net/HttpServer.cpp +20 -0
  138. data/platform/shared/qt/RhoSimulator.pro +1 -1
  139. data/platform/shared/ruby/osx/ruby/config.h +2 -0
  140. data/platform/shared/ruby/win32/win32.c +10 -3
  141. data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
  142. data/rakefile.rb +52 -43
  143. data/res/build-tools/RhoRuby.exe +0 -0
  144. data/res/build-tools/aapt2/linux/aapt2 +0 -0
  145. data/res/build-tools/aapt2/osx/aapt2 +0 -0
  146. data/res/generators/templates/application/AndroidManifest.erb +2 -1
  147. data/res/generators/templates/application/build.yml +4 -1
  148. data/res/generators/templates/application/rhoconfig.txt +5 -0
  149. data/rhobuild.yml.example +4 -4
  150. data/rhodes.gemspec +1 -2
  151. data/version +1 -1
  152. metadata +80 -35
  153. data/lib/commonAPI/mediacapture/ext/platform/android/adds/res/drawable/camera_btn.xml +0 -14
  154. data/lib/commonAPI/mediacapture/ext/platform/android/adds/res/layout/camera_land.xml +0 -23
  155. data/lib/commonAPI/mediacapture/ext/platform/android/adds/res/layout/camera_port.xml +0 -23
  156. data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraActivity.java +0 -156
  157. data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraEclair.java +0 -227
  158. data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraGingerbread.java +0 -152
  159. data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraPreview.java +0 -183
  160. data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraSingletonEclair.java +0 -14
  161. data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraSingletonGingerbread.java +0 -60
  162. data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/ICameraObject.java +0 -20
  163. data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/ICameraSingletonObject.java +0 -8
  164. data/lib/extensions/fcm-push/ext/android/src/com/rhomobile/rhodes/fcm/FCMTokenRefresherService.java +0 -27
  165. data/platform/android/Rhodes/AndroidManifest.xml.erb +0 -89
@@ -0,0 +1,5 @@
1
+ maven_deps:
2
+ - 'androidx.core:core:1.3.2'
3
+ - 'androidx.lifecycle:lifecycle-common:2.3.1'
4
+ - 'androidx.lifecycle:lifecycle-common-java8:2.3.1'
5
+ - 'org.conscrypt:conscrypt-android:2.5.1'
@@ -0,0 +1,88 @@
1
+ require_relative '../../../lib/build/jake.rb'
2
+ require_relative 'hostplatform.rb'
3
+ require 'singleton'
4
+
5
+ module AndroidTools
6
+
7
+ class DexBuilder
8
+ include Singleton
9
+
10
+ attr_accessor :logger, :sdk_path, :build_tools_path, :androidplatform, :javabin
11
+
12
+ def build( jarlist = [], outdex )
13
+ tools_path = detect_tools_path
14
+
15
+ bin,args = build_cmd_line(tools_path, jarlist, outdex)
16
+
17
+ @logger.debug "BIN: #{bin}, ARGS: #{args}"
18
+ return false unless bin
19
+
20
+ Jake.run(bin,args)
21
+ $?.success?
22
+ end
23
+
24
+ def detect_tools_path
25
+
26
+ if (@build_tools_path)
27
+ path = @build_tools_path
28
+ else
29
+ path_guess_1 = File.join(@sdk_path, "platforms", @androidplatform, "tools")
30
+ if (File.directory?(path_guess_1))
31
+ path = path_guess_1
32
+ else
33
+ path_guess_2 = File.join(@sdk_path, "platform-tools")
34
+ if (File.directory?(path_guess_2))
35
+ path = path_guess_2
36
+ end
37
+ end
38
+
39
+ end
40
+
41
+ path
42
+ end
43
+
44
+ def build_cmd_line(tools_path, jarlist, outdex)
45
+
46
+ @logger.error( "DEX builder: path to build tools not set" ) unless @build_tools_path
47
+
48
+ @logger.info( "DEX builder: looking for DEX tool in #{@build_tools_path}")
49
+
50
+ #try to find dx.jar first
51
+ dexjar = File.join(@build_tools_path,"lib","dx.jar")
52
+ if File.file?(dexjar)
53
+
54
+ @logger.info( "DEX builder: found dx.jar")
55
+
56
+ args = []
57
+ args << "-Xmx1024m"
58
+ args << "-jar"
59
+ args << dexjar
60
+ args << "--dex"
61
+ args << "--output=#{outdex}"
62
+ args.concat jarlist
63
+
64
+ return @javabin, args
65
+
66
+ else #then go for d8
67
+ d8 = File.join(@build_tools_path,"d8"+HostPlatform::bat_ext)
68
+ if File.file?(d8)
69
+ @logger.info( "DEX builder: found d8")
70
+
71
+ raise "I'm expecting to have output dex named classes.dex for d8 tool but found #{File.basename(outdex)}" if (File.basename(outdex) != 'classes.dex')
72
+
73
+ args = []
74
+ args << '--output'
75
+ args << "#{File.dirname(outdex)}"
76
+ #args << '--no-desugaring'
77
+ args.concat jarlist
78
+
79
+ return d8, args
80
+ else
81
+ @logger.error( "Can't find proper DEX builder in the build tools")
82
+ end
83
+
84
+ return nil,nil
85
+ end
86
+ end
87
+ end
88
+ end
@@ -23,6 +23,15 @@ module HostPlatform
23
23
  end
24
24
  module_function :exe_ext
25
25
 
26
+ def bat_ext
27
+ if HostPlatform.windows?
28
+ '.bat'
29
+ else
30
+ ''
31
+ end
32
+ end
33
+ module_function :bat_ext
34
+
26
35
  def num_cpus
27
36
  num = nil
28
37
  if HostPlatform.linux?
@@ -54,6 +54,7 @@ class ManifestGenerator
54
54
 
55
55
  def addGoogleMaps
56
56
  @usesLibraries['com.google.android.maps'] = true
57
+ @usesLibraries['org.apache.http.legacy'] = false
57
58
  end
58
59
 
59
60
  def addGooglePush(erbPath)
@@ -25,6 +25,8 @@ class MavenDepsExtractor
25
25
  @file_deps = []
26
26
 
27
27
  @rhoroot = File.join( File.dirname(__FILE__),'..','..','..')
28
+
29
+ #@m2home = ENV["APPVEYOR_BUILD_WORKER_IMAGE"].nil? ? File.join( @rhoroot, 'res', 'build-tools', 'maven' ) : File.join('C:','PROGRA~2','Apache','Maven')
28
30
  @m2home = File.join( @rhoroot, 'res', 'build-tools', 'maven' )
29
31
  @mvnbin = File.join( @m2home, 'bin', 'mvn' )
30
32
 
@@ -46,7 +48,6 @@ class MavenDepsExtractor
46
48
  @jni_libs = []
47
49
  @manifests = []
48
50
 
49
- @have_v4_support_lib = false
50
51
 
51
52
  end
52
53
 
@@ -159,7 +160,6 @@ class MavenDepsExtractor
159
160
 
160
161
  Dir[File.join(src,'*')].each do |f|
161
162
 
162
- @have_v4_support_lib = true if ( File.basename(f) =~ /support-v4/ )
163
163
 
164
164
  if File.extname(f) == '.aar'
165
165
  target = File.join(dst,File.basename(f,'.aar'))
@@ -204,9 +204,9 @@ class MavenDepsExtractor
204
204
  def dep_copy_cmd
205
205
  argv = []
206
206
  argv << @mvnbin
207
- argv << 'dependency:copy-dependencies'
207
+ argv << '"dependency:copy-dependencies"'
208
208
  # argv << '-o' #work offline
209
- argv << "-Dmaven.repo.local=#{File.join(@m2home,'m2')}"
209
+ argv << "\"-Dmaven.repo.local=#{File.join(@m2home,'m2')}\""
210
210
  argv << '-e' if Rake.application.options.trace
211
211
  argv << '-X' if Rake.application.options.trace
212
212
 
@@ -236,21 +236,24 @@ class MavenDepsExtractor
236
236
 
237
237
  def dep_get_cmd(grp_id, art_id, ver, repos)
238
238
  argv = []
239
- argv << @mvnbin
240
- argv << 'dependency:get'
241
- argv << "-Dmaven.repo.local=#{File.join(@m2home,'m2')}"
242
-
243
- argv << "-DgroupId=#{grp_id}"
244
- argv << "-DartifactId=#{art_id}"
245
- argv << "-Dversion=#{ver}"
246
- argv << "-DremoteRepositories=#{repos}"
247
- argv << "-Dpackaging=pom"
248
- argv << "-Ddest=./"
249
- argv << "-Dtransitive=false"
250
-
239
+ argv << "\"" + @mvnbin + "\""
240
+ argv << '"dependency:get"'
241
+ argv << "\"-Dmaven.repo.local=#{File.join(@m2home,'m2')}\""
242
+
243
+ argv << "\"-DgroupId=#{grp_id}\""
244
+ argv << "\"-DartifactId=#{art_id}\""
245
+ argv << "\"-Dversion=#{ver}\""
246
+ argv << "\"-DremoteRepositories=#{repos}\""
247
+ argv << "\"-Dpackaging=pom\""
248
+ argv << "\"-Ddest=./\""
249
+ argv << "\"-Dtransitive=false\""
250
+
251
+ argv << '-B'
252
+ argv << '-q'
251
253
  argv << '-e' if Rake.application.options.trace
252
254
  argv << '-X' if Rake.application.options.trace
253
255
 
256
+
254
257
  argv.join(' ')
255
258
  end
256
259
 
@@ -267,9 +270,10 @@ class MavenDepsExtractor
267
270
  Jake.run3( cmd, pwd, env )
268
271
  rm pom
269
272
 
273
+ target = File.join(path,'target')
270
274
  @logger.debug "Moving extracted dependencies to #{path}"
271
- Dir[File.join(path,'target','dependency','*')].each { |f| mv(f,path) }
272
- rm_r File.join(path,'target')
275
+ Dir[File.join(target,'dependency','*')].each { |f| mv(f,path) }
276
+ rm_r File.join(target) if File.directory?(target)
273
277
  end
274
278
 
275
279
  def split_dependency( dep )
@@ -377,9 +381,6 @@ class MavenDepsExtractor
377
381
  @jars.join(separator)
378
382
  end
379
383
 
380
- def have_v4_support_lib?
381
- @have_v4_support_lib
382
- end
383
384
 
384
385
  end
385
386
 
@@ -1,5 +1,8 @@
1
1
  require_relative 'hostplatform'
2
2
 
3
+ #RTFM first: https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md
4
+
5
+
3
6
  class NDKWrapper
4
7
 
5
8
  @root_path = nil
@@ -10,6 +13,16 @@ class NDKWrapper
10
13
 
11
14
  @gccver = "unknown"
12
15
 
16
+ #https://android.googlesource.com/platform/ndk/+/ndk-release-r16/docs/UnifiedHeaders.md
17
+ @@abi_triple = {
18
+ 'arm' => 'arm-linux-androideabi',
19
+ 'aarch64' => 'aarch64-linux-android',
20
+ 'mips' => 'mipsel-linux-android',
21
+ 'mips64'=> 'mips64el-linux-android',
22
+ 'x86' => 'i686-linux-android',
23
+ 'x86_64'=> 'x86_64-linux-android'
24
+ }
25
+
13
26
  def self.create( ndk_path )
14
27
  end
15
28
 
@@ -46,30 +59,36 @@ class NDKWrapper
46
59
  end
47
60
 
48
61
  def link_sysroot( api, abi )
49
- linkabi = abi == "aarch64" ? "arm64" : abi
50
- #locate closest available NDK platform for target API
51
- n_api = api.to_i
52
- n_api.downto(1) { |i|
53
- path = File.join( @root_path, 'platforms', "android-#{i.to_s}", "arch-#{linkabi}" )
54
62
 
55
- return path if File.directory?(path)
56
- }
63
+ path = nil
64
+
65
+ if @rev_major >= 22
66
+ #look for libs inside toolchain
67
+ p = File.join( sysroot_18,'usr','lib',@@abi_triple[abi])
68
+ puts "Checking NDK sysroot at: #{p}"
69
+ path = p if File.directory?(p)
70
+
71
+ else
72
+ linkabi = abi == "aarch64" ? "arm64" : abi
73
+ #locate closest available NDK platform for target API
74
+ n_api = api.to_i
75
+ n_api.downto(1) { |i|
76
+ path = File.join( @root_path, 'platforms', "android-#{i.to_s}", "arch-#{linkabi}" )
77
+
78
+ break if File.directory?(path)
79
+ }
80
+ end
81
+
82
+ raise "Unable to detect NDK link root for API: #{api}, ABI: #{abi}" unless path
57
83
 
58
- raise "Unable to detect NDK link root for API: #{api}, ABI: #{abi}"
84
+ puts "NDK sysroot detected at: #{path}"
85
+ return path
59
86
  end
60
87
 
61
88
  def link_sysroot_level_ext( api, abi )
62
89
 
63
- if @rev_major >= 18
64
- triple = {
65
- 'arm' => 'arm-linux-androideabi',
66
- 'aarch64' => 'aarch64-linux-android',
67
- 'mips' => 'mipsel-linux-android',
68
- 'mips64'=> 'mips64el-linux-android',
69
- 'x86' => 'i686-linux-android',
70
- 'x86_64'=> 'x86_64-linux-android'
71
- }
72
- File.join( sysroot_18, 'usr', 'lib', triple[abi], api.to_s)
90
+ if @rev_major >= 18
91
+ File.join( sysroot_18, 'usr', 'lib', @@abi_triple[abi], api.to_s)
73
92
  else
74
93
  nil
75
94
  end
@@ -89,8 +108,8 @@ class NDKWrapper
89
108
  File.join( @root_path, 'sysroot' )
90
109
  end
91
110
 
92
- def toolchain
93
- $toolchain
111
+ def toolchain_name
112
+ @toolchain_name
94
113
  end
95
114
 
96
115
  def sysroot_18
@@ -169,34 +188,34 @@ class NDKWrapper
169
188
  toolchainversions = ['4.8','4.9']
170
189
  end
171
190
 
172
- $toolchain = 'unknown-toolchain'
191
+ toolchain = 'unknown-toolchain'
173
192
  if abi == 'arm'
174
193
  if @rev_major >= 18
175
- $toolchain = 'armv7a-linux-androideabi'
194
+ @toolchain_name = 'armv7a-linux-androideabi'
176
195
  else
177
- $toolchain = 'arm-linux-androideabi'
196
+ @toolchain_name = 'arm-linux-androideabi'
178
197
  end
179
198
  elsif abi == 'x86'
180
199
  if @rev_major >= 18
181
- $toolchain = 'i686-linux-android'
200
+ @toolchain_name = 'i686-linux-android'
182
201
  else
183
- $toolchain = 'x86'
202
+ @toolchain_name = 'x86'
184
203
  end
185
204
  elsif abi == 'x86_64'
186
205
  if @rev_major >= 18
187
- $toolchain = 'x86_64-linux-android'
206
+ @toolchain_name = 'x86_64-linux-android'
188
207
  else
189
- $toolchain = 'x86_64'
208
+ @toolchain_name = 'x86_64'
190
209
  end
191
210
  elsif abi == 'mips'
192
211
  if @rev_major >= 18
193
212
  raise "Mips not supported!"
194
213
  else
195
- $toolchain = 'mipsel-linux-android'
214
+ @toolchain_name = 'mipsel-linux-android'
196
215
  end
197
216
  elsif abi == 'aarch64'
198
217
  if @rev_major >= 18
199
- $toolchain = 'aarch64-linux-android'
218
+ @toolchain_name = 'aarch64-linux-android'
200
219
  else
201
220
  raise "Aarch64 not supported for this ndk version!"
202
221
  end
@@ -213,8 +232,8 @@ class NDKWrapper
213
232
  if(@rev_major >= 18)
214
233
  variants << File.join(@root_path,'toolchains','llvm','prebuilt',ndkhost)
215
234
  else
216
- variants << File.join(@root_path,'build','prebuilt',ndkhost,"#{$toolchain}-#{version}")
217
- variants << File.join(@root_path,'toolchains',"#{$toolchain}-#{version}",'prebuilt',ndkhost)
235
+ variants << File.join(@root_path,'build','prebuilt',ndkhost,"#{@toolchain_name}-#{version}")
236
+ variants << File.join(@root_path,'toolchains',"#{@toolchain_name}-#{version}",'prebuilt',ndkhost)
218
237
  end
219
238
 
220
239
 
@@ -223,13 +242,14 @@ class NDKWrapper
223
242
  next unless File.directory? variant
224
243
 
225
244
  ndktools = variant
226
- ndkabi = $toolchain
245
+ ndkabi = @toolchain_name
227
246
  @gccver = version
228
247
 
229
248
  ndkabi = 'i686-linux-android' if ndkabi == 'x86'
230
249
  ndkabi = 'x86_64-linux-android' if ndkabi == 'x86_64'
231
250
 
232
- puts "Toolchain is detected: #{ndktools}, abi: #{ndkabi}, version: #{@gccver}" if Rake.application.options.trace
251
+ puts "Toolchain is detected: #{ndktools}, abi: #{ndkabi}, version: #{@gccver}"
252
+ @toolchain_root = ndktools
233
253
 
234
254
  tools = {}
235
255
 
@@ -244,7 +264,7 @@ class NDKWrapper
244
264
  end
245
265
 
246
266
  if ndktools.nil?
247
- raise "Can't detect NDK toolchain path (corrupted NDK installation?)"
267
+ raise "Can't detect NDK toolchain path (corrupted NDK installation?), toolchain is " + @toolchain_name
248
268
  end
249
269
  end
250
270
 
@@ -256,12 +276,28 @@ class NDKWrapper
256
276
  @rev_major
257
277
  end
258
278
 
259
- def check_tool( tool, ndktoolsdir, abi )
260
- if(@rev_major >= 18)
261
- abi = 'arm-linux-androideabi' if abi == 'armv7a-linux-androideabi'
279
+ def select_tool_abi_prefix( tool, abi )
280
+ prefix = abi
281
+
282
+ if (@rev_major >= 22 )
283
+ prefix = 'llvm'
284
+ elsif (@rev_major >= 18)
285
+ prefix = 'arm-linux-androideabi' if abi == 'armv7a-linux-androideabi'
262
286
  end
263
287
 
264
- toolpath = File.join(ndktoolsdir,'bin',"#{abi}-#{tool}#{HostPlatform.exe_ext}")
288
+ #is_compiler = ['gcc','g++'].include?(tool)
289
+ #if is_compiler
290
+ #else
291
+ #end
292
+
293
+ prefix
294
+ end
295
+
296
+ def check_tool( tool, ndktoolsdir, abi )
297
+
298
+ tool_abi_prefix = select_tool_abi_prefix( tool, abi )
299
+
300
+ toolpath = File.join(ndktoolsdir,'bin',"#{tool_abi_prefix}-#{tool}#{HostPlatform.exe_ext}")
265
301
  if(@rev_major >= 18)
266
302
  if (tool == 'gcc')
267
303
  toolpath = File.join(ndktoolsdir,'bin',"clang#{HostPlatform.exe_ext}")
@@ -280,20 +316,13 @@ class NDKWrapper
280
316
  end
281
317
 
282
318
  def sysincludes(api,abi)
283
- if @rev_major >= 16
284
- #https://android.googlesource.com/platform/ndk/+/ndk-release-r16/docs/UnifiedHeaders.md
285
- triple = {
286
- 'arm' => 'arm-linux-androideabi',
287
- 'aarch64' => 'aarch64-linux-android',
288
- 'mips' => 'mipsel-linux-android',
289
- 'mips64'=> 'mips64el-linux-android',
290
- 'x86' => 'i686-linux-android',
291
- 'x86_64'=> 'x86_64-linux-android'
292
- }
293
- if @rev_major >= 18
294
- File.join( sysroot_18, 'usr', 'include', triple[abi])
319
+ if @rev_major >= 16
320
+ if @rev_major >= 22
321
+ File.join( sysroot_18, 'usr', 'include' )
322
+ elsif @rev_major >= 18
323
+ File.join( sysroot_18, 'usr', 'include', @@abi_triple[abi])
295
324
  else
296
- File.join( sysroot_16(api,abi), 'usr', 'include', triple[abi])
325
+ File.join( sysroot_16(api,abi), 'usr', 'include', @@abi_triple[abi])
297
326
  end
298
327
  else
299
328
  nil
@@ -1523,7 +1523,9 @@ void rho_title_change(const int tabIndex, const char* strTitle) {
1523
1523
 
1524
1524
  // this method called from logging system - loggins system add logmessage to log and also copy it to iOS console by NSLog()
1525
1525
  void rho_ios_log_console_output(const char* message) {
1526
- NSLog(@"%@", [NSString stringWithUTF8String:message]);
1526
+ NSString* str = [[NSString alloc] initWithUTF8String:message];
1527
+ NSLog(@"%@", str);
1528
+ [str release];
1527
1529
  }
1528
1530
 
1529
1531
  void rho_startup_logging(const char* message) {
@@ -100,10 +100,12 @@
100
100
  UIPopoverController *popover;
101
101
  #endif
102
102
  RhoCameraSettings* settings;
103
+ BOOL isCaptureProcessRunning;
103
104
 
104
105
  }
105
106
 
106
107
  @property (retain) RhoCameraSettings* settings;
108
+ @property (atomic) BOOL isCaptureProcessRunning;
107
109
 
108
110
 
109
111
  - (void)imagePickerController:(UIImagePickerController *)picker
@@ -151,7 +151,7 @@
151
151
 
152
152
  @implementation PickImageDelegate
153
153
 
154
- @synthesize settings;
154
+ @synthesize settings, isCaptureProcessRunning;
155
155
 
156
156
 
157
157
  -(void) sendCancelCallback {
@@ -517,6 +517,13 @@
517
517
 
518
518
  - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
519
519
  {
520
+
521
+ if (!self.isCaptureProcessRunning) {
522
+ return;
523
+ }
524
+ //NSLog(@"$$$###$$$ didFinishPickingMediaWithInfo");
525
+ self.isCaptureProcessRunning = NO;
526
+
520
527
  if (settings.format == CAMERA_SETTINGS_FORMAT_NOT_SETTED) {
521
528
  NSURL* url = (NSURL*)[info objectForKey:UIImagePickerControllerReferenceURL];
522
529
  //const char* cs_url = [[url path] UTF8String];
@@ -538,32 +545,39 @@
538
545
  settings.format = CAMERA_SETTINGS_FORMAT_JPG;
539
546
  }
540
547
  }
548
+
549
+ // Remove the picker interface and release the picker object.
550
+ [picker dismissViewControllerAnimated:NO completion:nil];
551
+ [picker.view removeFromSuperview];
552
+ //picker.view.hidden = YES;
553
+ #ifdef __IPHONE_3_2
554
+ [popover dismissPopoverAnimated:YES];
555
+ #endif
556
+ [picker release];
557
+
541
558
  UIImage* image = (UIImage*)[info objectForKey:UIImagePickerControllerEditedImage];
542
559
  if (image == nil) {
543
560
  image = (UIImage*)[info objectForKey:UIImagePickerControllerOriginalImage];
544
561
  }
545
- if (image != nil) {
546
- [self useImage:image];
562
+ if (image != nil) {
563
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
564
+ [self useImage:image];
565
+ });
547
566
  }
548
567
  else {
549
568
  //rho_rhodesapp_callCameraCallback([postUrl UTF8String], "", "", 1);
550
- [self sendCancelCallback];
569
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
570
+ [self sendCancelCallback];
571
+ });
551
572
  }
552
- // Remove the picker interface and release the picker object.
553
- [picker dismissViewControllerAnimated:YES completion:nil];
554
- [picker.view removeFromSuperview];
555
- //picker.view.hidden = YES;
556
- [picker release];
557
- #ifdef __IPHONE_3_2
558
- [popover dismissPopoverAnimated:YES];
559
- #endif
560
573
  }
561
574
 
562
575
 
563
576
  - (void)imagePickerController:(UIImagePickerController *)picker
564
577
  didFinishPickingImage:(UIImage *)image
565
578
  editingInfo:(NSDictionary *)editingInfo
566
- {
579
+ {
580
+ //NSLog(@"$$$###$$$ didFinishPickingImage");
567
581
  if (settings.format == CAMERA_SETTINGS_FORMAT_NOT_SETTED) {
568
582
  settings.format = CAMERA_SETTINGS_FORMAT_JPG;
569
583
  }
@@ -573,7 +587,7 @@
573
587
  //it (along with the crop rectangle) from the dictionary in the editingInfo parameter.
574
588
  [self useImage:image];
575
589
  // Remove the picker interface and release the picker object.
576
- [picker dismissViewControllerAnimated:YES completion:nil];
590
+ [picker dismissViewControllerAnimated:NO completion:nil];
577
591
  [picker.view removeFromSuperview];
578
592
  //picker.view.hidden = YES;
579
593
  [picker release];
@@ -584,19 +598,27 @@
584
598
 
585
599
  - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
586
600
  {
587
- // Notify view about cancel
588
- //rho_rhodesapp_callCameraCallback([postUrl UTF8String], "", "", 1);
589
- [self sendCancelCallback];
590
-
591
- // Remove the picker interface and release the picker object.
592
- [picker dismissViewControllerAnimated:YES completion:nil];
601
+ if (!self.isCaptureProcessRunning) {
602
+ return;
603
+ }
604
+ self.isCaptureProcessRunning = NO;
605
+ // Remove the picker interface and release the picker object.
606
+ [picker dismissViewControllerAnimated:YES completion:nil];
593
607
  [picker.view removeFromSuperview];
594
- //picker.view.hidden = YES;
595
- [picker release];
608
+ //picker.view.hidden = YES;
596
609
  #ifdef __IPHONE_3_2
597
610
  [popover dismissPopoverAnimated:YES];
598
611
  #endif
599
- }
612
+ [picker release];
613
+
614
+
615
+ // Notify view about cancel
616
+ //rho_rhodesapp_callCameraCallback([postUrl UTF8String], "", "", 1);
617
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
618
+ [self sendCancelCallback];
619
+ });
620
+
621
+ }
600
622
 
601
623
  #ifdef __IPHONE_3_2
602
624
  // UIPopoverControllerDelegate implementation
@@ -0,0 +1,27 @@
1
+
2
+ #import <Foundation/Foundation.h>
3
+ #import "HTTPServer.h"
4
+
5
+
6
+
7
+
8
+ @interface CCocoaServer : NSObject {
9
+
10
+ HTTPServer *httpServer;
11
+
12
+ }
13
+
14
+ + (CCocoaServer*)sharedInstance;
15
+
16
+
17
+ -(id)init;
18
+ -(void)start;
19
+ -(void)stop;
20
+
21
+
22
+
23
+ -(void) createServer;
24
+
25
+ @end
26
+
27
+