rhodes 7.4.1 → 7.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG +319 -0
- data/CREDITS +3 -1
- data/LICENSE +1 -1
- data/README.md +6 -16
- data/Rakefile +55 -43
- data/SECURITY.md +19 -0
- data/appveyor.yml +66 -8
- data/azure-pipelines.yml +67 -0
- data/bin/rhodes-setup +22 -8
- data/extensions/emdk3-manager/ext/platform/android/src/com/rho/emdk3/EMDK3Extension.java +14 -5
- data/extensions/instrumentation/ext/platform/android/src/com/rho/instrumentation/Instrumentation.java +29 -15
- data/extensions/rhoconnect-push/ext/rhoconnect-push/platform/android/src/com/rhomobile/rhoelements/ans/ANSManager.java +3 -3
- data/extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/ElementsCore.java +12 -9
- data/extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/graphics/BatteryIndicator.java +2 -2
- data/lib/commonAPI/barcode/ext/platform/android/AndroidManifest.xml +3 -1
- data/lib/commonAPI/barcode/ext/platform/android/src/com/google/barcodereader/BarcodeCaptureActivity.java +11 -13
- data/lib/commonAPI/barcode/ext/platform/android/src/com/google/barcodereader/BarcodeGraphicTracker.java +1 -1
- data/lib/commonAPI/barcode/ext/platform/android/src/com/google/barcodereader/ui/camera/CameraSource.java +3 -3
- data/lib/commonAPI/barcode/ext/platform/android/src/com/google/barcodereader/ui/camera/CameraSourcePreview.java +1 -1
- data/lib/commonAPI/barcode/ext/platform/qt/Barcode.pro +1 -1
- data/lib/commonAPI/barcode/ext/platform/qt/Barcode.pro.erb +2 -2
- data/lib/commonAPI/barcode/ext/platform/qt/src/qzxing/QZXing.pri +9 -21
- data/lib/commonAPI/barcode/ext.yml +5 -8
- data/lib/commonAPI/bluetooth/ext/platform/qt/Bluetooth.pro +1 -1
- data/lib/commonAPI/bluetooth/ext/platform/qt/Bluetooth.pro.erb +1 -1
- data/lib/commonAPI/bluetooth/ext/platform/qt/src/bluetooth/bluetoothhelper.h +1 -1
- data/lib/commonAPI/coreapi/RhoSystemApi.rb +6 -0
- data/lib/commonAPI/coreapi/ext/Intent.xml +4 -0
- data/lib/commonAPI/coreapi/ext/platform/android/Rakefile +0 -12
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/intent/IntentSingleton.java +6 -0
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/Notification.java +5 -2
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/NotificationScheduler.java +4 -4
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/NotificationSingleton.java +1 -1
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/webview/WebViewSingleton.java +40 -27
- data/lib/commonAPI/coreapi/ext/platform/iphone/cpp_based_impl/SystemImpl.mm +5 -6
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/Intent.h +1 -1
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/Intent.m +3 -1
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/NotificationSingleton.h +2 -1
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/NotificationSingleton.m +10 -0
- data/lib/commonAPI/coreapi/ext/platform/wm/src/IntentImpl.cpp +3 -0
- data/lib/commonAPI/coreapi/ext/push.xml +5 -2
- data/lib/commonAPI/coreapi/ext/shared/SystemImplBase.cpp +13 -0
- data/lib/commonAPI/coreapi/ext/shared/SystemImplBase.h +2 -0
- data/lib/commonAPI/coreapi/ext/system.xml +3 -0
- data/lib/commonAPI/mediacapture/ext/camera.xml +4 -9
- data/lib/commonAPI/mediacapture/ext/platform/android/ApplicationCameraActivity.erb +2 -2
- data/lib/commonAPI/mediacapture/ext/platform/android/ApplicationFileProvider.erb +1 -1
- data/lib/commonAPI/mediacapture/ext/platform/android/ext_java.files +2 -9
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraExtension.java +0 -2
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraFactory.java +19 -24
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraObject.java +322 -730
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraRhoListener.java +247 -433
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/{CameraSingletonObject.java → CameraSingleton.java} +68 -74
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/mediacapture/RhoCameraFileProvider.java +6 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/MediaCapture.pro.erb +1 -1
- data/lib/commonAPI/mediacapture/ext/platform/qt/Mediacapture.pro +1 -1
- data/lib/commonAPI/printing_zebra/ext/platform/android/src/com/rhomobile/printing/zebra/impl/ZebraPrintingProviderImpl.java +2 -1
- data/lib/commonAPI/signature/ext/platform/iphone/impl/readme.txt +7 -0
- data/lib/commonAPI/signature/ext/platform/qt/Signature.pro +3 -10
- data/lib/commonAPI/signature/ext/platform/qt/Signature.pro.erb +2 -2
- data/lib/extensions/fcm-push/ext/android/ApplicationManifestAdds.erb +15 -17
- data/lib/extensions/fcm-push/ext/android/Rakefile +59 -34
- data/lib/extensions/fcm-push/ext/android/ext_java.files +0 -1
- data/lib/extensions/fcm-push/ext/android/src/com/rhomobile/rhodes/fcm/FCMFacade.java +13 -17
- data/lib/extensions/fcm-push/ext/android/src/com/rhomobile/rhodes/fcm/FCMIntentService.java +81 -80
- data/lib/extensions/fcm-push/ext/android/src/com/rhomobile/rhodes/fcm/FCMListener.java +0 -16
- data/lib/extensions/fcm-push/ext/iphone/Podfile +15 -2
- data/lib/extensions/fcm-push/ext/iphone/fcm-push.xcodeproj/project.pbxproj +6 -7
- data/lib/extensions/fcm-push/ext.yml +1 -1
- data/lib/extensions/gmaps/ext/platform/android/ApplicationManifestAdds.erb +1 -0
- data/lib/extensions/gmaps/ext/platform/android/src/com/rhomobile/rhodes/gmaps/GMapActivity.java +12 -4
- data/lib/extensions/gmaps/ext.yml +3 -1
- data/lib/extensions/nfc/ext/platform/android/src/com/rhomobile/nfc/Nfc.java +2 -1
- data/lib/extensions/serialport/ext/serialport.pro +1 -1
- data/platform/android/Rhodes/jni/include/rhodes/JNIRhodes.h +1 -0
- data/platform/android/Rhodes/jni/src/MethodResultJni.cpp +4 -0
- data/platform/android/Rhodes/jni/src/fileapi.cpp +4 -0
- data/platform/android/Rhodes/res/drawable/baseline_check_24.xml +5 -0
- data/platform/android/Rhodes/res/drawable/baseline_check_240.xml +5 -0
- data/platform/android/Rhodes/res/drawable/baseline_close_24.xml +5 -0
- data/platform/android/Rhodes/res/drawable/baseline_close_240.xml +5 -0
- data/platform/android/Rhodes/res/layout/overlay_layout.xml +39 -0
- data/platform/android/Rhodes/res/layout/perrmission_alert_dialog.xml +267 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/BaseActivity.java +183 -66
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/LocalFileProvider.java +38 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoFileProvider.java +32 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +532 -92
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +26 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +259 -163
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/StatusNotification.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/AbstractRhoExtension.java +14 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtManager.java +4 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtension.java +5 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerImpl.java +79 -38
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java +20 -15
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +18 -9
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/CallReceiver.java +22 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/IKioskMode.java +11 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/KioskManager.java +18 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/MyAccessibilityService.java +230 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/MyNotificationListenerService.java +16 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/MyOverlayService.java +197 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/kioskservices/PermissionManager.java +232 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +34 -8
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality26.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/permissioncheck/CheckDrawable.java +53 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/permissioncheck/PermissionListGenerate.java +366 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/rhodes.iml +11 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/socket/SSLImpl.java +1 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/GoogleWebView.java +782 -41
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoInputConnectionWrapper.java +146 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoInputListener.java +21 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebViewClient.java +92 -32
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/TauWebViewOptions.java +118 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/WebSettingsProviderBase.java +18 -17
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/WebSettingsProviderEclairMR1.java +4 -4
- data/platform/android/build/RhodesSRC_build.files +13 -0
- data/platform/android/build/{aab_builder.rb → aapt2_helper.rb} +94 -37
- data/platform/android/build/android-repack.rake +8 -1
- data/platform/android/build/android.rake +238 -238
- data/platform/android/build/android_tools.rb +10 -10
- data/platform/android/build/androidcommon.rb +31 -14
- data/platform/android/build/build_tools_finder.rb +46 -0
- data/platform/android/build/config.yml +8 -0
- data/platform/android/build/dex_builder.rb +88 -0
- data/platform/android/build/hostplatform.rb +9 -0
- data/platform/android/build/manifest_generator.rb +15 -10
- data/platform/android/build/maven_deps_extractor.rb +29 -22
- data/platform/android/build/ndkwrapper.rb +92 -51
- data/platform/android/proguard/proguard-base-rules.pro +5 -0
- data/platform/android/proguard/proguard.jar +0 -0
- data/platform/iphone/Classes/AppManager/AppManager.m +3 -1
- data/platform/iphone/Classes/Camera/PickImageDelegate.h +2 -0
- data/platform/iphone/Classes/Camera/PickImageDelegate.m +45 -23
- data/platform/iphone/Classes/CocoaServer/CCocoaServer.h +27 -0
- data/platform/iphone/Classes/CocoaServer/CCocoaServer.m +107 -0
- data/platform/iphone/Classes/CocoaServer/RhoHTTPConnection.h +16 -0
- data/platform/iphone/Classes/CocoaServer/RhoHTTPConnection.m +226 -0
- data/platform/iphone/Classes/RhoAppBaseLib-Bridging-Header.h +4 -0
- data/platform/iphone/Classes/RhoAppBaseStandaloneLib-Bridging-Header.h +4 -0
- data/platform/iphone/Classes/RhoCryptAESGCM.swift +105 -0
- data/platform/iphone/Classes/RhoUIWebView.h +1 -1
- data/platform/iphone/Classes/RhoUIWebView.m +1 -1
- data/platform/iphone/Classes/RhoWKWebView.h +1 -1
- data/platform/iphone/Classes/RhoWKWebView.mm +110 -15
- data/platform/iphone/Classes/RhoWebView.h +1 -1
- data/platform/iphone/Classes/RhoWebViewFabrique.m +13 -2
- data/platform/iphone/Classes/Rhodes.m +3 -0
- data/platform/iphone/Classes/SimpleMainView.m +5 -5
- data/platform/iphone/Classes/URLProtocol/CRhoURLProtocol.m +21 -10
- data/platform/iphone/Classes/rho/net/IPhoneNetRequest.mm +4 -0
- data/platform/iphone/CocoaHTTPServer/Core/Categories/DDData.h +14 -0
- data/platform/iphone/CocoaHTTPServer/Core/Categories/DDData.m +158 -0
- data/platform/iphone/CocoaHTTPServer/Core/Categories/DDNumber.h +12 -0
- data/platform/iphone/CocoaHTTPServer/Core/Categories/DDNumber.m +88 -0
- data/platform/iphone/CocoaHTTPServer/Core/Categories/DDRange.h +56 -0
- data/platform/iphone/CocoaHTTPServer/Core/Categories/DDRange.m +104 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPAuthenticationRequest.h +45 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPAuthenticationRequest.m +195 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPConnection.h +120 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPConnection.m +2708 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPLogging.h +136 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPMessage.h +48 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPMessage.m +113 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPResponse.h +149 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPServer.h +205 -0
- data/platform/iphone/CocoaHTTPServer/Core/HTTPServer.m +772 -0
- data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartFormDataParser.h +65 -0
- data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartFormDataParser.m +529 -0
- data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartMessageHeader.h +33 -0
- data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartMessageHeader.m +86 -0
- data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartMessageHeaderField.h +23 -0
- data/platform/iphone/CocoaHTTPServer/Core/Mime/MultipartMessageHeaderField.m +211 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPAsyncFileResponse.h +75 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPAsyncFileResponse.m +405 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPDataResponse.h +13 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPDataResponse.m +79 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPDynamicFileResponse.h +52 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPDynamicFileResponse.m +292 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPErrorResponse.h +9 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPErrorResponse.m +38 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPFileResponse.h +25 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPFileResponse.m +237 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPRedirectResponse.h +12 -0
- data/platform/iphone/CocoaHTTPServer/Core/Responses/HTTPRedirectResponse.m +73 -0
- data/platform/iphone/CocoaHTTPServer/Core/WebSocket.h +105 -0
- data/platform/iphone/CocoaHTTPServer/Core/WebSocket.m +791 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DAVConnection.h +7 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DAVConnection.m +160 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DAVResponse.h +11 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DAVResponse.m +372 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DELETEResponse.h +7 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/DELETEResponse.m +49 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/PUTResponse.h +8 -0
- data/platform/iphone/CocoaHTTPServer/Extensions/WebDAV/PUTResponse.m +69 -0
- data/platform/iphone/CocoaHTTPServer/LICENSE.txt +18 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaAsyncSocket/About.txt +4 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaAsyncSocket/GCDAsyncSocket.h +1226 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaAsyncSocket/GCDAsyncSocket.m +8528 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/About.txt +33 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDASLLogger.h +41 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDASLLogger.m +99 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDAbstractDatabaseLogger.h +102 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDAbstractDatabaseLogger.m +727 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDFileLogger.h +334 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDFileLogger.m +1353 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDLog.h +601 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDLog.m +1083 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDTTYLogger.h +167 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/DDTTYLogger.m +1479 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/Extensions/ContextFilterLogFormatter.h +65 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/Extensions/ContextFilterLogFormatter.m +191 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/Extensions/DispatchQueueLogFormatter.h +116 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/Extensions/DispatchQueueLogFormatter.m +251 -0
- data/platform/iphone/CocoaHTTPServer/Vendor/CocoaLumberjack/Extensions/README.txt +7 -0
- data/platform/iphone/Framework/RhoApplication/RhoApplication.xcodeproj/project.pbxproj +1 -1
- data/platform/iphone/Framework/Rhodes/Rhodes.xcodeproj/project.pbxproj +2 -2
- data/platform/iphone/RhoAppBaseLib/RhoAppBaseLib.xcodeproj/project.pbxproj +410 -1
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +1 -1
- data/platform/iphone/curl/curl.xcodeproj/project.pbxproj +4 -1
- data/platform/iphone/rbuild/iphone.rake +13 -8
- data/platform/iphone/rhoextlib/rhoextlib.xcodeproj/project.pbxproj +4 -1
- data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +1 -1
- data/platform/iphone/rhosynclib/rhosynclib.xcodeproj/project.pbxproj +1 -1
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app.zip +0 -0
- data/platform/sailfish/build/{harbour-SailfishRhodes.pro.erb → SailfishRhodes.pro.erb} +10 -17
- data/platform/sailfish/build/rhodes.pro.erb +7 -17
- data/platform/sailfish/build/rpm/SailfishRhodes.desktop.erb +12 -0
- data/platform/sailfish/build/rpm/SailfishRhodes.erb +2 -0
- data/platform/sailfish/build/rpm/SailfishRhodes.spec.erb +43 -0
- data/platform/sailfish/build/rubylib.pro.erb +29 -29
- data/platform/sailfish/build/sailfish.rake +188 -180
- data/platform/sailfish/keys/regular_cert.pem +14 -0
- data/platform/sailfish/keys/regular_key.pem +4 -0
- data/platform/shared/common/RhodesApp.cpp +59 -10
- data/platform/shared/common/iphone/RhoCryptImpl.mm +130 -54
- data/platform/shared/net/HttpServer.cpp +20 -0
- data/platform/shared/qt/RhoSimulator.pro +1 -1
- data/platform/shared/qt/rhodes/rhodes.pro +4 -11
- data/platform/shared/qt/sailfish/SailfishRhodes.desktop +3 -4
- data/platform/shared/qt/sailfish/SailfishRhodes.pro +9 -10
- data/platform/shared/qt/sailfish/icons/108x108/108x108.png +0 -0
- data/platform/shared/qt/sailfish/privileges/sailfishrhodes +2 -0
- data/platform/shared/qt/sailfish/qml/pages/FirstPageWK.qml +7 -11
- data/platform/shared/qt/sailfish/qml/{harbour-sailfishrhodes.qml → sailfishrhodes.qml} +1 -1
- data/platform/shared/qt/sailfish/rpm/sailfishrhodes.spec +80 -0
- data/platform/shared/qt/sailfish/rpm/{harbour-sailfishrhodes.yaml → sailfishrhodes.yaml} +2 -2
- data/platform/shared/qt/sailfish/src/QtMainWindow.cpp +1 -1
- data/platform/shared/qt/sailfish/src/QtMainWindow.h +1 -1
- data/platform/shared/qt/sailfish/src/main.cpp +6 -38
- data/platform/shared/qt/sailfish/src/rootdelegate.h +2 -14
- data/platform/shared/ruby/aurora/ruby/config.h +386 -0
- data/platform/shared/ruby/aurora/ruby/constdefs.c +5866 -0
- data/platform/shared/ruby/aurora/ruby/constdefs.h +1788 -0
- data/platform/shared/ruby/osx/ruby/config.h +2 -0
- data/platform/shared/ruby/win32/win32.c +10 -3
- data/platform/shared/sqlite/crypto.c +14 -0
- data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
- data/platform/win32/build/rhodes.nsi +3 -3
- data/platform/win32/build/win32.rake +1 -1
- data/rakefile.rb +55 -43
- data/res/build-tools/RhoRuby.exe +0 -0
- data/res/build-tools/aapt2/linux/aapt2 +0 -0
- data/res/build-tools/aapt2/osx/aapt2 +0 -0
- data/res/build-tools/iphonesim/build/Release/iphonesim_8 +4 -4
- data/res/generators/templates/application/AndroidManifest.erb +28 -6
- data/res/generators/templates/application/build.yml +18 -11
- data/res/generators/templates/application/resources/android/res/xml/provider_paths.xml +4 -0
- data/res/generators/templates/application/rhoconfig.txt +15 -1
- data/res/generators/templates/iphone_project/Bremen8.xcodeproj/project.pbxproj +24 -1
- data/res/generators/templates/iphone_project/Classes/SimpleSwiftClass.swift +20 -0
- data/res/generators/templates/iphone_project/Classes/rhorunner-Bridging-Header.h +4 -0
- data/rhobuild.yml.example +4 -4
- data/rhodes.gemspec +4 -3
- data/version +1 -1
- metadata +157 -57
- data/lib/commonAPI/mediacapture/ext/platform/android/adds/res/drawable/camera_btn.xml +0 -14
- data/lib/commonAPI/mediacapture/ext/platform/android/adds/res/layout/camera_land.xml +0 -23
- data/lib/commonAPI/mediacapture/ext/platform/android/adds/res/layout/camera_port.xml +0 -23
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraActivity.java +0 -156
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraEclair.java +0 -227
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraGingerbread.java +0 -152
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraPreview.java +0 -183
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraSingletonEclair.java +0 -14
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraSingletonGingerbread.java +0 -60
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/ICameraObject.java +0 -20
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/ICameraSingletonObject.java +0 -8
- data/lib/extensions/fcm-push/ext/android/src/com/rhomobile/rhodes/fcm/FCMTokenRefresherService.java +0 -27
- data/platform/android/Rhodes/AndroidManifest.xml.erb +0 -89
- data/platform/sailfish/build/rho_build.cmd.erb +0 -14
- data/platform/sailfish/build/rho_clean.cmd.erb +0 -14
- data/platform/sailfish/build/rho_deploy.cmd.erb +0 -15
- data/platform/sailfish/build/rho_rpm.cmd.erb +0 -14
- data/platform/sailfish/build/rho_rpmvalidation.cmd.erb +0 -14
- data/platform/sailfish/build/rpm/harbour-SailfishRhodes.desktop.erb +0 -7
- data/platform/sailfish/build/rpm/harbour-SailfishRhodes.erb +0 -2
- data/platform/sailfish/build/rpm/harbour-SailfishRhodes.yaml.erb +0 -37
- data/platform/shared/qt/sailfish/harbour-sailfishrhodes.desktop +0 -6
- data/platform/shared/qt/sailfish/icons/108x108/harbour-sailfishrhodes.png +0 -0
- data/platform/shared/qt/sailfish/privileges/harbour-sailfishrhodes +0 -2
- data/platform/shared/qt/sailfish/qml/pages/FirstPageWE.qml +0 -236
- /data/platform/shared/qt/sailfish/icons/128x128/{harbour-sailfishrhodes.png → sailfishrhodes.png} +0 -0
- /data/platform/shared/qt/sailfish/icons/172x172/{harbour-sailfishrhodes.png → sailfishrhodes.png} +0 -0
- /data/platform/shared/qt/sailfish/icons/86x86/{harbour-sailfishrhodes.png → sailfishrhodes.png} +0 -0
@@ -0,0 +1,226 @@
|
|
1
|
+
#import "RhoHTTPConnection.h"
|
2
|
+
#import "GCDAsyncSocket.h"
|
3
|
+
#import "HTTPServer.h"
|
4
|
+
#import "HTTPMessage.h"
|
5
|
+
#import "HTTPResponse.h"
|
6
|
+
#import "HTTPAuthenticationRequest.h"
|
7
|
+
#import "DDNumber.h"
|
8
|
+
#import "DDRange.h"
|
9
|
+
#import "DDData.h"
|
10
|
+
#import "HTTPFileResponse.h"
|
11
|
+
#import "HTTPAsyncFileResponse.h"
|
12
|
+
#import "WebSocket.h"
|
13
|
+
#import "HTTPLogging.h"
|
14
|
+
|
15
|
+
|
16
|
+
extern const char* rho_http_direct_request( const char* method, const char* uri, const char* query, const void* headers, const char* body, int bodylen, int* responseLength );
|
17
|
+
extern void rho_http_free_response( const char* data );
|
18
|
+
|
19
|
+
extern void* rho_http_init_headers_list();
|
20
|
+
extern void rho_http_add_header( void* list, const char* name, const char* value );
|
21
|
+
extern void rho_http_free_headers_list( void* list );
|
22
|
+
|
23
|
+
#define HTTP_RESPONSE 90
|
24
|
+
#define HTTP_FINAL_RESPONSE 91
|
25
|
+
#define TIMEOUT_WRITE_BODY -1
|
26
|
+
|
27
|
+
static const int ddLogLevel = LOG_LEVEL_VERBOSE;
|
28
|
+
|
29
|
+
@implementation RhoHTTPConnection
|
30
|
+
|
31
|
+
|
32
|
+
- (BOOL)supportsMethod:(NSString *)method atPath:(NSString *)path
|
33
|
+
{
|
34
|
+
|
35
|
+
if ([method isEqualToString:@"GET"])
|
36
|
+
return YES;
|
37
|
+
|
38
|
+
if ([method isEqualToString:@"POST"])
|
39
|
+
return YES;
|
40
|
+
|
41
|
+
if ([method isEqualToString:@"PUT"])
|
42
|
+
return YES;
|
43
|
+
|
44
|
+
if ([method isEqualToString:@"HEAD"])
|
45
|
+
return YES;
|
46
|
+
|
47
|
+
return NO;
|
48
|
+
}
|
49
|
+
|
50
|
+
/*
|
51
|
+
- (BOOL)expectsRequestBodyFromMethod:(NSString *)method atPath:(NSString *)path {
|
52
|
+
return YES;
|
53
|
+
}
|
54
|
+
*/
|
55
|
+
|
56
|
+
- (void)startConnection
|
57
|
+
{
|
58
|
+
mBodyLen = 0;
|
59
|
+
mBody = nil;
|
60
|
+
mResponseData = nil;
|
61
|
+
[super startConnection];
|
62
|
+
}
|
63
|
+
|
64
|
+
- (void)prepareForBodyWithSize:(UInt64)contentLength {
|
65
|
+
if (mBody != nil) {
|
66
|
+
//[mBody release];
|
67
|
+
mBody = nil;
|
68
|
+
}
|
69
|
+
mBodyLen = contentLength;
|
70
|
+
mBody = [[NSMutableData alloc] initWithCapacity:contentLength];
|
71
|
+
}
|
72
|
+
|
73
|
+
- (void)processBodyData:(NSData *)postDataChunk {
|
74
|
+
// only up to 256 Kb !!! - if larger we must accumulate data !
|
75
|
+
if (mBody == nil) {
|
76
|
+
mBody = [[NSMutableData alloc] initWithCapacity:(128*1024)];
|
77
|
+
}
|
78
|
+
[mBody appendData:postDataChunk];
|
79
|
+
}
|
80
|
+
|
81
|
+
- (void)finishBody
|
82
|
+
{
|
83
|
+
if (mBody != nil) {
|
84
|
+
[request setBody:mBody];
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
|
89
|
+
- (void)replyToHTTPRequest {
|
90
|
+
|
91
|
+
NSString *requestUri = [self requestURI];
|
92
|
+
|
93
|
+
NSURL* nsurl = [NSURL URLWithString:requestUri];
|
94
|
+
NSString *requestMethod = [request method];
|
95
|
+
NSDictionary* requestHeaders = [request allHeaderFields];
|
96
|
+
NSData* requestBody = [request body];
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
const char* uri = [[nsurl path] UTF8String];
|
103
|
+
const char* method = [requestMethod UTF8String];
|
104
|
+
const char* body = [requestBody bytes];
|
105
|
+
int bodylen = (int)requestBody.length;
|
106
|
+
const char* query = [[nsurl query] UTF8String];
|
107
|
+
|
108
|
+
void* cHeaders = rho_http_init_headers_list();
|
109
|
+
|
110
|
+
for (NSString* key in requestHeaders) {
|
111
|
+
NSString* value = [requestHeaders objectForKey:key];
|
112
|
+
|
113
|
+
rho_http_add_header(cHeaders, [key UTF8String], [value UTF8String]);
|
114
|
+
|
115
|
+
}
|
116
|
+
|
117
|
+
int len = 0;
|
118
|
+
|
119
|
+
//if ([requestUri isEqualToString:@"/system/js_api_entrypoint"]) {
|
120
|
+
// int o= 9;
|
121
|
+
// o = 0;
|
122
|
+
//}
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
const char* response = rho_http_direct_request(method, uri, query, cHeaders, body, bodylen, &len);
|
127
|
+
|
128
|
+
rho_http_free_headers_list(cHeaders);
|
129
|
+
if (mBody != nil) {
|
130
|
+
//int c = [mBody retainCount];
|
131
|
+
//[mBody release];
|
132
|
+
mBody = nil;
|
133
|
+
mBodyLen = 0;
|
134
|
+
//[request setBody:nil];
|
135
|
+
}
|
136
|
+
|
137
|
+
|
138
|
+
//CRhoURLResponse* resp = nil;
|
139
|
+
|
140
|
+
if ( response != 0 ) {
|
141
|
+
|
142
|
+
/*
|
143
|
+
// parse http responce for prepare detailed responce instead of raw data
|
144
|
+
// not used currently - just send raw data
|
145
|
+
|
146
|
+
self.httpStatusCode = 0;
|
147
|
+
self.httpBody = nil;
|
148
|
+
self.httpHeaderName = nil;
|
149
|
+
self.httpHeaders = nil;
|
150
|
+
|
151
|
+
http_parser_settings settings;
|
152
|
+
settings.on_header_field = on_http_header;
|
153
|
+
settings.on_header_value = on_http_header_value;
|
154
|
+
settings.on_body = on_http_body;
|
155
|
+
settings.on_status = on_http_status;
|
156
|
+
|
157
|
+
settings.on_headers_complete = on_http_cb;
|
158
|
+
settings.on_message_begin = on_http_cb;
|
159
|
+
settings.on_message_complete = on_http_cb;
|
160
|
+
settings.on_url = on_http_data_cb;
|
161
|
+
http_parser *parser = malloc(sizeof(http_parser));
|
162
|
+
parser->data = self;
|
163
|
+
http_parser_init(parser, HTTP_RESPONSE);
|
164
|
+
http_parser_execute(parser, &settings, response, len);
|
165
|
+
|
166
|
+
NSString* strHttpVer = [NSString stringWithFormat:@"%d.%d",parser->http_major,parser->http_minor];
|
167
|
+
|
168
|
+
self.httpStatusCode = parser->status_code;
|
169
|
+
|
170
|
+
free(parser);
|
171
|
+
*/
|
172
|
+
|
173
|
+
//NSMutableData* responseData = [NSMutableData dataWithCapacity:len];
|
174
|
+
//[responseData appendBytes:response length:len];
|
175
|
+
if (mResponseData != nil) {
|
176
|
+
//[mResponseData release];
|
177
|
+
mResponseData = nil;
|
178
|
+
}
|
179
|
+
mResponseData = [[NSData alloc] initWithBytes:response length:len];
|
180
|
+
//[(NSMutableData*)mResponseData appendBytes:response length:len];
|
181
|
+
rho_http_free_response(response);
|
182
|
+
|
183
|
+
|
184
|
+
//char a[1];
|
185
|
+
//a[0] = 0;
|
186
|
+
//NSData* zz = [NSData dataWithBytes:a length:1];
|
187
|
+
|
188
|
+
[asyncSocket writeData:mResponseData withTimeout:TIMEOUT_WRITE_BODY tag:HTTP_FINAL_RESPONSE];
|
189
|
+
|
190
|
+
//[mResponseData release];
|
191
|
+
|
192
|
+
//[self finishResponse];
|
193
|
+
}
|
194
|
+
else {
|
195
|
+
[self handleResourceNotFound];
|
196
|
+
}
|
197
|
+
|
198
|
+
// totally replace responce functionality
|
199
|
+
//[super replyToHTTPRequest];
|
200
|
+
}
|
201
|
+
|
202
|
+
|
203
|
+
- (void)socket:(GCDAsyncSocket *)sock didWriteDataWithTag:(long)tag
|
204
|
+
{
|
205
|
+
// Inform the http response that we're done
|
206
|
+
if ([httpResponse respondsToSelector:@selector(connectionDidClose)])
|
207
|
+
{
|
208
|
+
[httpResponse connectionDidClose];
|
209
|
+
}
|
210
|
+
|
211
|
+
if (tag == HTTP_FINAL_RESPONSE)
|
212
|
+
{
|
213
|
+
// Cleanup after the last request
|
214
|
+
[self finishResponse];
|
215
|
+
|
216
|
+
// Terminate the connection
|
217
|
+
[asyncSocket disconnect];
|
218
|
+
|
219
|
+
mResponseData = nil;
|
220
|
+
|
221
|
+
// Explictly return to ensure we don't do anything after the socket disconnects
|
222
|
+
return;
|
223
|
+
}
|
224
|
+
}
|
225
|
+
|
226
|
+
@end
|
@@ -0,0 +1,105 @@
|
|
1
|
+
//
|
2
|
+
// RhoCryptAESGCM.swift
|
3
|
+
// RhoAppBaseLib
|
4
|
+
//
|
5
|
+
// Created by Dmitry Soldatenkov on 13.04.2023.
|
6
|
+
//
|
7
|
+
|
8
|
+
import Foundation
|
9
|
+
import os
|
10
|
+
import CryptoKit
|
11
|
+
|
12
|
+
|
13
|
+
@objc(RhoCryptAESGCM)
|
14
|
+
public class RhoCryptAESGCM : NSObject {
|
15
|
+
|
16
|
+
|
17
|
+
@objc(generate_new_key)
|
18
|
+
public func generate_new_key() -> Data? {
|
19
|
+
if #available(iOS 13.0, *) {
|
20
|
+
let key = SymmetricKey(size: .bits256)
|
21
|
+
let key_data = key.withUnsafeBytes { Data(Array($0)) }
|
22
|
+
return key_data
|
23
|
+
}
|
24
|
+
return nil;
|
25
|
+
}
|
26
|
+
|
27
|
+
@objc(encrypt_page::)
|
28
|
+
public func encrypt_page(page : Data, key : Data) -> Data? {
|
29
|
+
|
30
|
+
if #available(iOS 13.0, *) {
|
31
|
+
let data_to_encrypt : Data = page.subdata(in: 0 ..< (page.count-32) )
|
32
|
+
let symm_key = SymmetricKey(data: key)
|
33
|
+
|
34
|
+
// encrypt
|
35
|
+
do {
|
36
|
+
|
37
|
+
let sealedBox = try AES.GCM.seal(data_to_encrypt, using: symm_key)
|
38
|
+
|
39
|
+
//
|
40
|
+
var result_data : Data = sealedBox.ciphertext
|
41
|
+
let nonce_data : Data = Data(sealedBox.nonce)
|
42
|
+
let tag_data : Data = sealedBox.tag
|
43
|
+
|
44
|
+
let random_4_bytes_data : Data = Data((0 ..< 4).map { _ in UInt8.random(in: UInt8.min ... UInt8.max) })
|
45
|
+
|
46
|
+
result_data.append(nonce_data)
|
47
|
+
result_data.append(random_4_bytes_data)
|
48
|
+
result_data.append(tag_data)
|
49
|
+
|
50
|
+
return result_data
|
51
|
+
}
|
52
|
+
catch {
|
53
|
+
return nil
|
54
|
+
}
|
55
|
+
|
56
|
+
}
|
57
|
+
else {
|
58
|
+
return nil
|
59
|
+
}
|
60
|
+
|
61
|
+
}
|
62
|
+
|
63
|
+
@objc(decrypt_page::)
|
64
|
+
public func decrypt_page(page : Data, key : Data) -> Data? {
|
65
|
+
|
66
|
+
|
67
|
+
if #available(iOS 13.0, *) {
|
68
|
+
|
69
|
+
do {
|
70
|
+
let data_to_decrypt : Data = page.subdata(in: 0 ..< (page.count-32) )
|
71
|
+
|
72
|
+
let nonce_data : Data = page.subdata(in: (page.count-32) ..< (page.count-32+12))
|
73
|
+
let tag_data : Data = page.subdata(in: (page.count-16) ..< (page.count))
|
74
|
+
|
75
|
+
let nonce : AES.GCM.Nonce = try AES.GCM.Nonce(data: nonce_data)
|
76
|
+
let symm_key = SymmetricKey(data: key)
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
let sealedBoxRestored = try AES.GCM.SealedBox(nonce: nonce, ciphertext: data_to_decrypt, tag: tag_data)
|
81
|
+
let result_data : Data = try AES.GCM.open(sealedBoxRestored, using: symm_key)
|
82
|
+
|
83
|
+
return result_data
|
84
|
+
}
|
85
|
+
catch {
|
86
|
+
return nil
|
87
|
+
}
|
88
|
+
}
|
89
|
+
else {
|
90
|
+
return nil
|
91
|
+
}
|
92
|
+
|
93
|
+
}
|
94
|
+
|
95
|
+
|
96
|
+
@objc(is_aes_gcm_available)
|
97
|
+
public func is_aes_gcm_available() -> Bool {
|
98
|
+
if #available(iOS 13.0, *) {
|
99
|
+
return true
|
100
|
+
}
|
101
|
+
return false
|
102
|
+
}
|
103
|
+
|
104
|
+
}
|
105
|
+
|
@@ -108,7 +108,7 @@
|
|
108
108
|
|
109
109
|
//UIWebView
|
110
110
|
|
111
|
-
- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script {
|
111
|
+
- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script wantAnswer:(BOOL)wantAnswer{
|
112
112
|
return [webview stringByEvaluatingJavaScriptFromString:script];
|
113
113
|
}
|
114
114
|
|
@@ -126,26 +126,116 @@ static void dumpClassInfo(Class c, int inheritanceDepth)
|
|
126
126
|
isDirectRequestActivated = YES;
|
127
127
|
}
|
128
128
|
}
|
129
|
-
|
129
|
+
BOOL isDirectRequestCustomProtocol = NO;
|
130
|
+
if (rho_conf_is_property_exists("ios_direct_local_requests_with_custom_protocol")!=0) {
|
131
|
+
if (rho_conf_getBool("ios_direct_local_requests_with_custom_protocol")!=0 ) {
|
132
|
+
isDirectRequestCustomProtocol = YES;
|
133
|
+
}
|
134
|
+
}
|
135
|
+
|
136
|
+
if (isDirectRequestActivated || isDirectRequestCustomProtocol) {
|
137
|
+
|
138
|
+
BOOL isDirectProcessingActivated = NO;
|
139
|
+
|
140
|
+
|
141
|
+
if (!isDirectProcessingActivated) {
|
142
|
+
if (isDirectRequestCustomProtocol) {
|
143
|
+
|
144
|
+
CRhoWKURLProtocol *schemeHandler = [[CRhoWKURLProtocol alloc] init];
|
145
|
+
[configuration setURLSchemeHandler:schemeHandler forURLScheme:@"rhoctp"];
|
146
|
+
isDirectProcessingActivated = YES;
|
147
|
+
}
|
148
|
+
}
|
149
|
+
|
150
|
+
#ifdef APP_BUILD_CAPABILITY_IOS_WKWEBVIEW_HTTP_DIRECT_PROCESSING_METHOD_3
|
151
|
+
if (!isDirectProcessingActivated) {
|
152
|
+
|
153
|
+
try {
|
154
|
+
NSArray *privateStrArr = @[@"Handlers", @"Scheme", @"url", @"_"];
|
155
|
+
NSString *keyName = [[[privateStrArr reverseObjectEnumerator] allObjects] componentsJoinedByString:@""];
|
156
|
+
|
157
|
+
CRhoWKURLProtocol *schemeHandler = [[CRhoWKURLProtocol alloc] init];
|
158
|
+
[configuration setURLSchemeHandler:schemeHandler forURLScheme:@"rhoapiprotocol"];
|
159
|
+
NSMutableDictionary *handlers = [configuration valueForKey:keyName];
|
160
|
+
if (handlers != nil) {
|
161
|
+
handlers[@"http"] = schemeHandler;
|
162
|
+
handlers[@"https"] = schemeHandler;
|
163
|
+
isDirectProcessingActivated = YES;
|
164
|
+
}
|
165
|
+
} catch(id anException) {
|
166
|
+
int o = 9;
|
167
|
+
o = 7;
|
168
|
+
|
169
|
+
}
|
170
|
+
}
|
171
|
+
#endif
|
172
|
+
|
173
|
+
#ifdef APP_BUILD_CAPABILITY_IOS_WKWEBVIEW_HTTP_DIRECT_PROCESSING_METHOD_2
|
174
|
+
if (!isDirectProcessingActivated) {
|
175
|
+
|
176
|
+
try {
|
177
|
+
|
178
|
+
NSArray *privateStrArr = @[@"Controller", @"Context", @"Browsing", @"K", @"W"];
|
179
|
+
NSString *className = [[[privateStrArr reverseObjectEnumerator] allObjects] componentsJoinedByString:@""];
|
180
|
+
NSArray *privateStr2Arr = @[@":", @"Protocol", @"Custom", @"For", @"Scheme", @"register"];
|
181
|
+
NSString *selName = [[[privateStr2Arr reverseObjectEnumerator] allObjects] componentsJoinedByString:@""];
|
182
|
+
|
183
|
+
Class cls = NSClassFromString(className);
|
184
|
+
SEL sel = NSSelectorFromString(selName);
|
185
|
+
|
186
|
+
if (cls && sel) {
|
187
|
+
if ([(id)cls respondsToSelector:sel]) {
|
188
|
+
[(id)cls performSelector:sel withObject:@"http"];
|
189
|
+
[(id)cls performSelector:sel withObject:@"https"];
|
190
|
+
isDirectProcessingActivated = YES;
|
191
|
+
}
|
192
|
+
}
|
193
|
+
// already registered when app started
|
194
|
+
//[NSURLProtocol registerClass:[CRhoURLProtocol class]];
|
195
|
+
|
196
|
+
} catch(id anException) {
|
197
|
+
int o = 9;
|
198
|
+
o = 7;
|
199
|
+
|
200
|
+
}
|
201
|
+
|
202
|
+
}
|
203
|
+
#endif
|
204
|
+
|
130
205
|
#ifdef APP_BUILD_CAPABILITY_IOS_WKWEBVIEW_HTTP_DIRECT_PROCESSING
|
131
206
|
|
132
|
-
|
207
|
+
if (!isDirectProcessingActivated) {
|
208
|
+
try {
|
209
|
+
|
210
|
+
CRhoWKURLProtocol *schemeHandler = [[CRhoWKURLProtocol alloc] init];
|
133
211
|
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
212
|
+
// replace original static method to our bogus method
|
213
|
+
Method bogusHandle = class_getClassMethod([WKWebView class], @selector(bogushandlesURLScheme:));
|
214
|
+
Method handleOriginal = class_getClassMethod([WKWebView class], @selector(handlesURLScheme:));
|
215
|
+
method_exchangeImplementations(bogusHandle, handleOriginal);
|
138
216
|
|
139
217
|
|
140
|
-
|
141
|
-
|
218
|
+
[configuration setURLSchemeHandler:schemeHandler forURLScheme:@"http"];
|
219
|
+
[configuration setURLSchemeHandler:schemeHandler forURLScheme:@"https"];
|
142
220
|
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
221
|
+
// return original static method
|
222
|
+
method_exchangeImplementations(bogusHandle, handleOriginal);
|
223
|
+
isDirectProcessingActivated = YES;
|
224
|
+
} catch(id anException) {
|
225
|
+
int o = 9;
|
226
|
+
o = 7;
|
227
|
+
}
|
228
|
+
}
|
147
229
|
#endif
|
230
|
+
|
231
|
+
if (!isDirectProcessingActivated) {
|
232
|
+
RAWLOG_ERROR("You can not enable ios_direct_local_requests if you not added IOS_WKWEBVIEW_HTTP_DIRECT_PROCESSING or/and APP_BUILD_CAPABILITY_IOS_WKWEBVIEW_HTTP_DIRECT_PROCESSING_METHOD_2 or/and APP_BUILD_CAPABILITY_IOS_WKWEBVIEW_HTTP_DIRECT_PROCESSING_METHOD_3 capability/s to build.yml !!!");
|
233
|
+
}
|
148
234
|
}
|
235
|
+
|
236
|
+
configuration.preferences.javaScriptCanOpenWindowsAutomatically = YES;
|
237
|
+
//configuration.limitsNavigationsToAppBoundDomains = NO;
|
238
|
+
|
149
239
|
WKWebView* w = [[WKWebView alloc] initWithFrame:frame configuration:configuration];
|
150
240
|
|
151
241
|
//w.scalesPageToFit = YES;
|
@@ -191,10 +281,15 @@ static void dumpClassInfo(Class c, int inheritanceDepth)
|
|
191
281
|
|
192
282
|
//UIWebView
|
193
283
|
|
194
|
-
- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script {
|
284
|
+
- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script wantAnswer:(BOOL)wantAnswer{
|
195
285
|
__block NSString *resultString = nil;
|
196
286
|
__block BOOL finished = NO;
|
197
287
|
|
288
|
+
if (!wantAnswer) {
|
289
|
+
[webview evaluateJavaScript:script completionHandler:nil];
|
290
|
+
return nil;
|
291
|
+
}
|
292
|
+
|
198
293
|
[webview evaluateJavaScript:script completionHandler:^(id result, NSError *error) {
|
199
294
|
if (error == nil) {
|
200
295
|
if (result != nil) {
|
@@ -206,7 +301,7 @@ static void dumpClassInfo(Class c, int inheritanceDepth)
|
|
206
301
|
finished = YES;
|
207
302
|
}];
|
208
303
|
|
209
|
-
while (!finished)
|
304
|
+
while (!finished && wantAnswer)
|
210
305
|
{
|
211
306
|
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
|
212
307
|
}
|
@@ -271,7 +366,7 @@ static void dumpClassInfo(Class c, int inheritanceDepth)
|
|
271
366
|
- (void)webView:(WKWebView *)webView didFinishNavigation:(null_unspecified WKNavigation *)navigation {
|
272
367
|
// force Ajax CommonAPI calls
|
273
368
|
NSString* jscode = @"window['__rho_nativeBridgeType']='ajax'";
|
274
|
-
[self stringByEvaluatingJavaScriptFromString:jscode];
|
369
|
+
[self stringByEvaluatingJavaScriptFromString:jscode wantAnswer:NO];
|
275
370
|
|
276
371
|
[delegate webViewDidFinishLoad:self];
|
277
372
|
}
|
@@ -49,12 +49,18 @@
|
|
49
49
|
|
50
50
|
BOOL shouldMakeWkWebView = YES;
|
51
51
|
BOOL isDirectRequestActivated = NO;
|
52
|
+
BOOL isDirectRequestCustomProtocol = NO;
|
52
53
|
BOOL isWKWebViewCLassExist = NO;
|
53
54
|
if (rho_conf_is_property_exists("ios_direct_local_requests")!=0) {
|
54
55
|
if (rho_conf_getBool("ios_direct_local_requests")!=0 ) {
|
55
56
|
isDirectRequestActivated = YES;
|
56
57
|
}
|
57
58
|
}
|
59
|
+
if (rho_conf_is_property_exists("ios_direct_local_requests_with_custom_protocol")!=0) {
|
60
|
+
if (rho_conf_getBool("ios_direct_local_requests_with_custom_protocol")!=0 ) {
|
61
|
+
isDirectRequestCustomProtocol = YES;
|
62
|
+
}
|
63
|
+
}
|
58
64
|
if (rho_conf_is_property_exists("ios_use_WKWebView")!=0) {
|
59
65
|
if (rho_conf_getBool("ios_use_WKWebView")==0 ) {
|
60
66
|
#ifdef APP_BUILD_CAPABILITY_IOS_UIWEBVIEW
|
@@ -72,10 +78,15 @@
|
|
72
78
|
|
73
79
|
if (shouldMakeWkWebView) {
|
74
80
|
RAWLOG_INFO("Try to create WKWebView ...");
|
75
|
-
if (isDirectRequestActivated) {
|
81
|
+
if (isDirectRequestActivated && (!isDirectRequestCustomProtocol)) {
|
76
82
|
#ifdef APP_BUILD_CAPABILITY_IOS_WKWEBVIEW_HTTP_DIRECT_PROCESSING
|
83
|
+
|
84
|
+
#elif defined APP_BUILD_CAPABILITY_IOS_WKWEBVIEW_HTTP_DIRECT_PROCESSING_METHOD_2
|
85
|
+
|
86
|
+
#elif defined APP_BUILD_CAPABILITY_IOS_WKWEBVIEW_HTTP_DIRECT_PROCESSING_METHOD_3
|
87
|
+
|
77
88
|
#else
|
78
|
-
RAWLOG_ERROR("You can not enable ios_direct_local_requests if you not added IOS_WKWEBVIEW_HTTP_DIRECT_PROCESSING capability to build.yml !!!");
|
89
|
+
RAWLOG_ERROR("You can not enable ios_direct_local_requests if you not added IOS_WKWEBVIEW_HTTP_DIRECT_PROCESSING or/and APP_BUILD_CAPABILITY_IOS_WKWEBVIEW_HTTP_DIRECT_PROCESSING_METHOD_2 or/and APP_BUILD_CAPABILITY_IOS_WKWEBVIEW_HTTP_DIRECT_PROCESSING_METHOD_3 capability to build.yml !!!");
|
79
90
|
#endif
|
80
91
|
}
|
81
92
|
if (isWKWebViewCLassExist) {
|
@@ -489,6 +489,9 @@ static Rhodes *instance = NULL;
|
|
489
489
|
picker.allowsEditing = NO;
|
490
490
|
}
|
491
491
|
#endif
|
492
|
+
|
493
|
+
delegateObject.isCaptureProcessRunning = YES;
|
494
|
+
|
492
495
|
// Show picker
|
493
496
|
#ifdef __IPHONE_3_2
|
494
497
|
if ((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) && (type != UIImagePickerControllerSourceTypeCamera)) {
|
@@ -732,7 +732,7 @@ static BOOL makeHiddenUntilLoadContent = YES;
|
|
732
732
|
|
733
733
|
//[self loadHTMLString:datas];
|
734
734
|
NSString* jscode = [NSString stringWithFormat:@"document.body.style.backgroundColor = \"#%6X\";", bkg_color];
|
735
|
-
[self.rhoWebView stringByEvaluatingJavaScriptFromString:jscode];
|
735
|
+
[self.rhoWebView stringByEvaluatingJavaScriptFromString:jscode wantAnswer:NO];
|
736
736
|
|
737
737
|
//self.webView.hidden = YES;
|
738
738
|
}
|
@@ -983,7 +983,7 @@ static BOOL makeHiddenUntilLoadContent = YES;
|
|
983
983
|
[self.view.superview bringSubviewToFront:self.view];
|
984
984
|
}
|
985
985
|
RAWLOG_INFO1("Executing JS: %s", [js UTF8String]);
|
986
|
-
[rhoWebView stringByEvaluatingJavaScriptFromString:js];
|
986
|
+
[rhoWebView stringByEvaluatingJavaScriptFromString:js wantAnswer:NO];
|
987
987
|
}
|
988
988
|
|
989
989
|
- (NSString*)currentLocation:(int)index {
|
@@ -993,7 +993,7 @@ static BOOL makeHiddenUntilLoadContent = YES;
|
|
993
993
|
#define CUR_URL_DICT_KEY @"CUR_URL_DICT_KEY"
|
994
994
|
|
995
995
|
-(void) get_current_url_command:(NSMutableDictionary*)dict {
|
996
|
-
NSString* res = [rhoWebView stringByEvaluatingJavaScriptFromString:@"window.location.href"];
|
996
|
+
NSString* res = [rhoWebView stringByEvaluatingJavaScriptFromString:@"window.location.href" wantAnswer:YES];
|
997
997
|
//NSString* res = [[webView.request mainDocumentURL] absoluteString];
|
998
998
|
[dict setValue:res forKey:CUR_URL_DICT_KEY];
|
999
999
|
}
|
@@ -1131,7 +1131,7 @@ static BOOL makeHiddenUntilLoadContent = YES;
|
|
1131
1131
|
#if defined(RHO_NO_RUBY_API)
|
1132
1132
|
if (![scheme isEqualToString:@"http"] && ![scheme isEqualToString:@"https"] && ![scheme isEqualToString:@"file"])
|
1133
1133
|
#else
|
1134
|
-
if (![scheme isEqualToString:@"http"] && ![scheme isEqualToString:@"https"] && ![scheme isEqualToString:@"file"])
|
1134
|
+
if (![scheme isEqualToString:@"http"] && ![scheme isEqualToString:@"https"] && ![scheme isEqualToString:@"rhoctp"] && ![scheme isEqualToString:@"file"])
|
1135
1135
|
#endif
|
1136
1136
|
external = YES;
|
1137
1137
|
else {
|
@@ -1181,7 +1181,7 @@ static BOOL makeHiddenUntilLoadContent = YES;
|
|
1181
1181
|
|
1182
1182
|
- (void)webViewDidFinishLoad:(id<RhoWebView,NSObject>)webView {
|
1183
1183
|
// Disable default context menu on touch
|
1184
|
-
[rhoWebView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout = \"none\";"];
|
1184
|
+
[rhoWebView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout = \"none\";" wantAnswer:NO];
|
1185
1185
|
|
1186
1186
|
PROF_STOP("BROWSER_PAGE");
|
1187
1187
|
|