rhodes 7.5.1 → 7.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (180) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +319 -0
  3. data/README.md +3 -15
  4. data/Rakefile +3 -0
  5. data/appveyor.yml +37 -32
  6. data/azure-pipelines.yml +1 -1
  7. data/bin/rhodes-setup +22 -8
  8. data/extensions/emdk3-manager/ext/platform/android/src/com/rho/emdk3/EMDK3Extension.java +14 -5
  9. data/extensions/instrumentation/ext/platform/android/src/com/rho/instrumentation/Instrumentation.java +29 -15
  10. data/extensions/rhoconnect-push/ext/rhoconnect-push/platform/android/src/com/rhomobile/rhoelements/ans/ANSManager.java +1 -1
  11. data/extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/ElementsCore.java +12 -9
  12. data/extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/graphics/BatteryIndicator.java +2 -2
  13. data/lib/commonAPI/barcode/ext/platform/qt/Barcode.pro +1 -1
  14. data/lib/commonAPI/barcode/ext/platform/qt/Barcode.pro.erb +2 -2
  15. data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/QZXing.pri +9 -21
  16. data/lib/commonAPI/barcode/ext.yml +1 -0
  17. data/lib/commonAPI/bluetooth/ext/platform/qt/Bluetooth.pro +1 -1
  18. data/lib/commonAPI/bluetooth/ext/platform/qt/Bluetooth.pro.erb +1 -1
  19. data/lib/commonAPI/bluetooth/ext/platform/qt/src/bluetooth/bluetoothhelper.h +1 -1
  20. data/lib/commonAPI/coreapi/RhoSystemApi.rb +6 -0
  21. data/lib/commonAPI/coreapi/ext/Intent.xml +4 -0
  22. data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/intent/IntentSingleton.java +6 -0
  23. data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/Notification.java +2 -1
  24. data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/NotificationScheduler.java +1 -1
  25. data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/webview/WebViewSingleton.java +40 -27
  26. data/lib/commonAPI/coreapi/ext/platform/iphone/cpp_based_impl/SystemImpl.mm +5 -6
  27. data/lib/commonAPI/coreapi/ext/platform/iphone/impl/Intent.h +1 -1
  28. data/lib/commonAPI/coreapi/ext/platform/iphone/impl/Intent.m +3 -1
  29. data/lib/commonAPI/coreapi/ext/platform/iphone/impl/NotificationSingleton.h +2 -1
  30. data/lib/commonAPI/coreapi/ext/platform/iphone/impl/NotificationSingleton.m +10 -0
  31. data/lib/commonAPI/coreapi/ext/platform/wm/src/IntentImpl.cpp +3 -0
  32. data/lib/commonAPI/coreapi/ext/shared/SystemImplBase.cpp +13 -0
  33. data/lib/commonAPI/coreapi/ext/shared/SystemImplBase.h +2 -0
  34. data/lib/commonAPI/coreapi/ext/system.xml +3 -0
  35. data/lib/commonAPI/mediacapture/ext/platform/android/ApplicationCameraActivity.erb +2 -2
  36. data/lib/commonAPI/mediacapture/ext/platform/android/ApplicationFileProvider.erb +1 -1
  37. data/lib/commonAPI/mediacapture/ext/platform/android/ext_java.files +1 -0
  38. data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraObject.java +8 -4
  39. data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraRhoListener.java +8 -0
  40. data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/mediacapture/RhoCameraFileProvider.java +6 -0
  41. data/lib/commonAPI/mediacapture/ext/platform/qt/MediaCapture.pro.erb +1 -1
  42. data/lib/commonAPI/mediacapture/ext/platform/qt/Mediacapture.pro +1 -1
  43. data/lib/commonAPI/signature/ext/platform/iphone/impl/readme.txt +7 -0
  44. data/lib/commonAPI/signature/ext/platform/qt/Signature.pro +3 -10
  45. data/lib/commonAPI/signature/ext/platform/qt/Signature.pro.erb +2 -2
  46. data/lib/extensions/fcm-push/ext/iphone/Podfile +15 -2
  47. data/lib/extensions/fcm-push/ext/iphone/fcm-push.xcodeproj/project.pbxproj +6 -7
  48. data/lib/extensions/nfc/ext/platform/android/src/com/rhomobile/nfc/Nfc.java +2 -1
  49. data/lib/extensions/serialport/ext/serialport.pro +1 -1
  50. data/platform/android/Rhodes/jni/include/rhodes/JNIRhodes.h +1 -0
  51. data/platform/android/Rhodes/jni/src/fileapi.cpp +4 -0
  52. data/platform/android/Rhodes/res/drawable/baseline_check_24.xml +5 -0
  53. data/platform/android/Rhodes/res/drawable/baseline_check_240.xml +5 -0
  54. data/platform/android/Rhodes/res/drawable/baseline_close_24.xml +5 -0
  55. data/platform/android/Rhodes/res/drawable/baseline_close_240.xml +5 -0
  56. data/platform/android/Rhodes/res/layout/overlay_layout.xml +39 -0
  57. data/platform/android/Rhodes/res/layout/perrmission_alert_dialog.xml +267 -0
  58. data/platform/android/Rhodes/src/com/rhomobile/rhodes/BaseActivity.java +183 -66
  59. data/platform/android/Rhodes/src/com/rhomobile/rhodes/LocalFileProvider.java +38 -6
  60. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoFileProvider.java +32 -0
  61. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +529 -89
  62. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +26 -4
  63. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +256 -160
  64. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/AbstractRhoExtension.java +14 -3
  65. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtManager.java +4 -0
  66. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtension.java +5 -4
  67. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerImpl.java +79 -38
  68. data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java +6 -1
  69. data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/CallReceiver.java +22 -0
  70. data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/IKioskMode.java +11 -0
  71. data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/KioskManager.java +18 -0
  72. data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/MyAccessibilityService.java +230 -0
  73. data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/MyNotificationListenerService.java +16 -0
  74. data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/MyOverlayService.java +197 -0
  75. data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/PermissionManager.java +232 -0
  76. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +34 -8
  77. data/platform/android/Rhodes/src/com/rhomobile/rhodes/permissioncheck/CheckDrawable.java +53 -0
  78. data/platform/android/Rhodes/src/com/rhomobile/rhodes/permissioncheck/PermissionListGenerate.java +366 -0
  79. data/platform/android/Rhodes/src/com/rhomobile/rhodes/rhodes.iml +11 -0
  80. data/platform/android/Rhodes/src/com/rhomobile/rhodes/socket/SSLImpl.java +1 -0
  81. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/GoogleWebView.java +782 -41
  82. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoInputConnectionWrapper.java +146 -0
  83. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoInputListener.java +21 -0
  84. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebViewClient.java +92 -32
  85. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/TauWebViewOptions.java +118 -0
  86. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/WebSettingsProviderBase.java +18 -17
  87. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/WebSettingsProviderEclairMR1.java +4 -4
  88. data/platform/android/build/RhodesSRC_build.files +13 -0
  89. data/platform/android/build/android-repack.rake +8 -1
  90. data/platform/android/build/android.rake +118 -51
  91. data/platform/android/build/android_tools.rb +1 -1
  92. data/platform/android/build/androidcommon.rb +13 -7
  93. data/platform/android/build/config.yml +4 -1
  94. data/platform/android/build/manifest_generator.rb +14 -10
  95. data/platform/android/build/maven_deps_extractor.rb +7 -1
  96. data/platform/android/build/ndkwrapper.rb +12 -0
  97. data/platform/android/proguard/proguard-base-rules.pro +5 -0
  98. data/platform/android/proguard/proguard.jar +0 -0
  99. data/platform/iphone/Classes/RhoAppBaseLib-Bridging-Header.h +4 -0
  100. data/platform/iphone/Classes/RhoAppBaseStandaloneLib-Bridging-Header.h +4 -0
  101. data/platform/iphone/Classes/RhoCryptAESGCM.swift +105 -0
  102. data/platform/iphone/Classes/RhoUIWebView.h +1 -1
  103. data/platform/iphone/Classes/RhoUIWebView.m +1 -1
  104. data/platform/iphone/Classes/RhoWKWebView.h +1 -1
  105. data/platform/iphone/Classes/RhoWKWebView.mm +32 -4
  106. data/platform/iphone/Classes/RhoWebView.h +1 -1
  107. data/platform/iphone/Classes/RhoWebViewFabrique.m +7 -1
  108. data/platform/iphone/Classes/SimpleMainView.m +5 -5
  109. data/platform/iphone/Classes/URLProtocol/CRhoURLProtocol.m +21 -10
  110. data/platform/iphone/Classes/rho/net/IPhoneNetRequest.mm +4 -0
  111. data/platform/iphone/Framework/RhoApplication/RhoApplication.xcodeproj/project.pbxproj +1 -1
  112. data/platform/iphone/Framework/Rhodes/Rhodes.xcodeproj/project.pbxproj +1 -1
  113. data/platform/iphone/RhoAppBaseLib/RhoAppBaseLib.xcodeproj/project.pbxproj +46 -1
  114. data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +1 -1
  115. data/platform/iphone/curl/curl.xcodeproj/project.pbxproj +4 -1
  116. data/platform/iphone/rbuild/iphone.rake +9 -8
  117. data/platform/iphone/rhoextlib/rhoextlib.xcodeproj/project.pbxproj +4 -1
  118. data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +1 -1
  119. data/platform/iphone/rhosynclib/rhosynclib.xcodeproj/project.pbxproj +1 -1
  120. data/platform/osx/bin/RhoSimulator/RhoSimulator.app.zip +0 -0
  121. data/platform/sailfish/build/{harbour-SailfishRhodes.pro.erb → SailfishRhodes.pro.erb} +10 -17
  122. data/platform/sailfish/build/rhodes.pro.erb +7 -17
  123. data/platform/sailfish/build/rpm/SailfishRhodes.desktop.erb +12 -0
  124. data/platform/sailfish/build/rpm/SailfishRhodes.erb +2 -0
  125. data/platform/sailfish/build/rpm/SailfishRhodes.spec.erb +43 -0
  126. data/platform/sailfish/build/rubylib.pro.erb +29 -29
  127. data/platform/sailfish/build/sailfish.rake +188 -180
  128. data/platform/sailfish/keys/regular_cert.pem +14 -0
  129. data/platform/sailfish/keys/regular_key.pem +4 -0
  130. data/platform/shared/common/RhodesApp.cpp +33 -9
  131. data/platform/shared/common/iphone/RhoCryptImpl.mm +130 -54
  132. data/platform/shared/qt/RhoSimulator.pro +1 -1
  133. data/platform/shared/qt/rhodes/rhodes.pro +4 -11
  134. data/platform/shared/qt/sailfish/SailfishRhodes.desktop +3 -4
  135. data/platform/shared/qt/sailfish/SailfishRhodes.pro +9 -10
  136. data/platform/shared/qt/sailfish/icons/108x108/108x108.png +0 -0
  137. data/platform/shared/qt/sailfish/privileges/sailfishrhodes +2 -0
  138. data/platform/shared/qt/sailfish/qml/pages/FirstPageWK.qml +7 -11
  139. data/platform/shared/qt/sailfish/qml/{harbour-sailfishrhodes.qml → sailfishrhodes.qml} +1 -1
  140. data/platform/shared/qt/sailfish/rpm/sailfishrhodes.spec +80 -0
  141. data/platform/shared/qt/sailfish/rpm/{harbour-sailfishrhodes.yaml → sailfishrhodes.yaml} +2 -2
  142. data/platform/shared/qt/sailfish/src/QtMainWindow.cpp +1 -1
  143. data/platform/shared/qt/sailfish/src/QtMainWindow.h +1 -1
  144. data/platform/shared/qt/sailfish/src/main.cpp +6 -38
  145. data/platform/shared/qt/sailfish/src/rootdelegate.h +2 -14
  146. data/platform/shared/ruby/aurora/ruby/config.h +386 -0
  147. data/platform/shared/ruby/aurora/ruby/constdefs.c +5866 -0
  148. data/platform/shared/ruby/aurora/ruby/constdefs.h +1788 -0
  149. data/platform/shared/sqlite/crypto.c +14 -0
  150. data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
  151. data/platform/win32/build/rhodes.nsi +3 -3
  152. data/platform/win32/build/win32.rake +1 -1
  153. data/rakefile.rb +3 -0
  154. data/res/build-tools/iphonesim/build/Release/iphonesim_8 +4 -4
  155. data/res/generators/templates/application/AndroidManifest.erb +26 -5
  156. data/res/generators/templates/application/build.yml +14 -10
  157. data/res/generators/templates/application/resources/android/res/xml/provider_paths.xml +4 -0
  158. data/res/generators/templates/application/rhoconfig.txt +10 -1
  159. data/res/generators/templates/iphone_project/Bremen8.xcodeproj/project.pbxproj +24 -1
  160. data/res/generators/templates/iphone_project/Classes/SimpleSwiftClass.swift +20 -0
  161. data/res/generators/templates/iphone_project/Classes/rhorunner-Bridging-Header.h +4 -0
  162. data/rhobuild.yml.example +3 -3
  163. data/rhodes.gemspec +4 -2
  164. data/version +1 -1
  165. metadata +81 -26
  166. data/platform/sailfish/build/rho_build.cmd.erb +0 -14
  167. data/platform/sailfish/build/rho_clean.cmd.erb +0 -14
  168. data/platform/sailfish/build/rho_deploy.cmd.erb +0 -15
  169. data/platform/sailfish/build/rho_rpm.cmd.erb +0 -14
  170. data/platform/sailfish/build/rho_rpmvalidation.cmd.erb +0 -14
  171. data/platform/sailfish/build/rpm/harbour-SailfishRhodes.desktop.erb +0 -7
  172. data/platform/sailfish/build/rpm/harbour-SailfishRhodes.erb +0 -2
  173. data/platform/sailfish/build/rpm/harbour-SailfishRhodes.yaml.erb +0 -37
  174. data/platform/shared/qt/sailfish/harbour-sailfishrhodes.desktop +0 -6
  175. data/platform/shared/qt/sailfish/icons/108x108/harbour-sailfishrhodes.png +0 -0
  176. data/platform/shared/qt/sailfish/privileges/harbour-sailfishrhodes +0 -2
  177. data/platform/shared/qt/sailfish/qml/pages/FirstPageWE.qml +0 -236
  178. /data/platform/shared/qt/sailfish/icons/128x128/{harbour-sailfishrhodes.png → sailfishrhodes.png} +0 -0
  179. /data/platform/shared/qt/sailfish/icons/172x172/{harbour-sailfishrhodes.png → sailfishrhodes.png} +0 -0
  180. /data/platform/shared/qt/sailfish/icons/86x86/{harbour-sailfishrhodes.png → sailfishrhodes.png} +0 -0
@@ -41,10 +41,12 @@ import android.content.pm.ResolveInfo;
41
41
  import android.content.pm.PackageManager;
42
42
  import android.content.res.AssetFileDescriptor;
43
43
  import android.database.Cursor;
44
+ import android.database.MatrixCursor;
44
45
  import android.net.Uri;
45
46
  import android.net.Uri.Builder;
46
47
  import android.webkit.MimeTypeMap;
47
48
  import android.os.ParcelFileDescriptor;
49
+ import android.provider.OpenableColumns;
48
50
  import java.io.FileNotFoundException;
49
51
 
50
52
 
@@ -240,14 +242,34 @@ public class LocalFileProvider extends ContentProvider
240
242
  "Insert operation is not supported by this provider");
241
243
  }
242
244
 
245
+ private static final String[] COLUMNS = {
246
+ OpenableColumns.DISPLAY_NAME, OpenableColumns.SIZE };
247
+
243
248
  @Override
244
- public Cursor query(Uri uri, String[] proj, String selection, String[] selectionArgs, String sortOrder) {
249
+ public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
245
250
  Logger.T(TAG, "query: " + uri);
246
-
247
- // Some apps want to query some metadata for files being opened. So do not throw form here...
248
- return null;
249
- // throw new UnsupportedOperationException(
250
- // "Query operation is not supported by this provider");
251
+ // ContentProvider has already checked granted permissions
252
+ final File file = fileFromUri(uri);
253
+ if (projection == null) {
254
+ projection = COLUMNS;
255
+ }
256
+ String[] cols = new String[projection.length];
257
+ Object[] values = new Object[projection.length];
258
+ int i = 0;
259
+ for (String col : projection) {
260
+ if (OpenableColumns.DISPLAY_NAME.equals(col)) {
261
+ cols[i] = OpenableColumns.DISPLAY_NAME;
262
+ values[i++] = file.getName();
263
+ } else if (OpenableColumns.SIZE.equals(col)) {
264
+ cols[i] = OpenableColumns.SIZE;
265
+ values[i++] = file.length();
266
+ }
267
+ }
268
+ cols = copyOf(cols, i);
269
+ values = copyOf(values, i);
270
+ final MatrixCursor cursor = new MatrixCursor(cols, 1);
271
+ cursor.addRow(values);
272
+ return cursor;
251
273
  }
252
274
 
253
275
  @Override
@@ -258,4 +280,14 @@ public class LocalFileProvider extends ContentProvider
258
280
  "Update operation is not supported by this provider");
259
281
  }
260
282
 
283
+ private static String[] copyOf(String[] original, int newLength) {
284
+ final String[] result = new String[newLength];
285
+ System.arraycopy(original, 0, result, 0, newLength);
286
+ return result;
287
+ }
288
+ private static Object[] copyOf(Object[] original, int newLength) {
289
+ final Object[] result = new Object[newLength];
290
+ System.arraycopy(original, 0, result, 0, newLength);
291
+ return result;
292
+ }
261
293
  }
@@ -0,0 +1,32 @@
1
+ /*------------------------------------------------------------------------
2
+ * (The MIT License)
3
+ *
4
+ * Copyright (c) 2008-2011 Rhomobile, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ * THE SOFTWARE.
23
+ *
24
+ * http://rhomobile.com
25
+ *------------------------------------------------------------------------*/
26
+
27
+ package com.rhomobile.rhodes;
28
+
29
+ import androidx.core.content.FileProvider;
30
+
31
+ public class RhoFileProvider extends FileProvider {
32
+ }