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
@@ -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
|
-
|
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
|
57
81
|
|
58
|
-
raise "Unable to detect NDK link root for API: #{api}, ABI: #{abi}"
|
82
|
+
raise "Unable to detect NDK link root for API: #{api}, ABI: #{abi}" unless path
|
83
|
+
|
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
|
-
|
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
|
93
|
-
|
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
|
-
|
191
|
+
toolchain = 'unknown-toolchain'
|
173
192
|
if abi == 'arm'
|
174
193
|
if @rev_major >= 18
|
175
|
-
|
194
|
+
@toolchain_name = 'armv7a-linux-androideabi'
|
176
195
|
else
|
177
|
-
|
196
|
+
@toolchain_name = 'arm-linux-androideabi'
|
178
197
|
end
|
179
198
|
elsif abi == 'x86'
|
180
199
|
if @rev_major >= 18
|
181
|
-
|
200
|
+
@toolchain_name = 'i686-linux-android'
|
182
201
|
else
|
183
|
-
|
202
|
+
@toolchain_name = 'x86'
|
184
203
|
end
|
185
204
|
elsif abi == 'x86_64'
|
186
205
|
if @rev_major >= 18
|
187
|
-
|
206
|
+
@toolchain_name = 'x86_64-linux-android'
|
188
207
|
else
|
189
|
-
|
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
|
-
|
214
|
+
@toolchain_name = 'mipsel-linux-android'
|
196
215
|
end
|
197
216
|
elsif abi == 'aarch64'
|
198
217
|
if @rev_major >= 18
|
199
|
-
|
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,"#{
|
217
|
-
variants << File.join(@root_path,'toolchains',"#{
|
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 =
|
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}"
|
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,40 @@ class NDKWrapper
|
|
256
276
|
@rev_major
|
257
277
|
end
|
258
278
|
|
259
|
-
def
|
260
|
-
if
|
261
|
-
|
279
|
+
def get_llvm_stl_path( arch )
|
280
|
+
if @rev_major <= 24
|
281
|
+
arch = 'arm64-v8a' if arch == "aarch64"
|
282
|
+
localabi = arch
|
283
|
+
localabi = "armeabi-v7a" if arch == "armeabi"
|
284
|
+
File.join(@root_path, "sources", "cxx-stl", "llvm-libc++", "libs", localabi, "libc++_shared.so")
|
285
|
+
else
|
286
|
+
arch = "arm" if arch == "armeabi"
|
287
|
+
File.join(@root_path, "toolchains", "llvm", "prebuilt", "darwin-x86_64", "sysroot", "usr", "lib", @@abi_triple[arch], "libc++_shared.so")
|
288
|
+
end
|
289
|
+
end
|
290
|
+
|
291
|
+
def select_tool_abi_prefix( tool, abi )
|
292
|
+
prefix = abi
|
293
|
+
|
294
|
+
if (@rev_major >= 22 )
|
295
|
+
prefix = 'llvm'
|
296
|
+
elsif (@rev_major >= 18)
|
297
|
+
prefix = 'arm-linux-androideabi' if abi == 'armv7a-linux-androideabi'
|
262
298
|
end
|
263
299
|
|
264
|
-
|
300
|
+
#is_compiler = ['gcc','g++'].include?(tool)
|
301
|
+
#if is_compiler
|
302
|
+
#else
|
303
|
+
#end
|
304
|
+
|
305
|
+
prefix
|
306
|
+
end
|
307
|
+
|
308
|
+
def check_tool( tool, ndktoolsdir, abi )
|
309
|
+
|
310
|
+
tool_abi_prefix = select_tool_abi_prefix( tool, abi )
|
311
|
+
|
312
|
+
toolpath = File.join(ndktoolsdir,'bin',"#{tool_abi_prefix}-#{tool}#{HostPlatform.exe_ext}")
|
265
313
|
if(@rev_major >= 18)
|
266
314
|
if (tool == 'gcc')
|
267
315
|
toolpath = File.join(ndktoolsdir,'bin',"clang#{HostPlatform.exe_ext}")
|
@@ -280,20 +328,13 @@ class NDKWrapper
|
|
280
328
|
end
|
281
329
|
|
282
330
|
def sysincludes(api,abi)
|
283
|
-
if @rev_major >= 16
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
'
|
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])
|
331
|
+
if @rev_major >= 16
|
332
|
+
if @rev_major >= 22
|
333
|
+
File.join( sysroot_18, 'usr', 'include' )
|
334
|
+
elsif @rev_major >= 18
|
335
|
+
File.join( sysroot_18, 'usr', 'include', @@abi_triple[abi])
|
295
336
|
else
|
296
|
-
File.join( sysroot_16(api,abi), 'usr', 'include',
|
337
|
+
File.join( sysroot_16(api,abi), 'usr', 'include', @@abi_triple[abi])
|
297
338
|
end
|
298
339
|
else
|
299
340
|
nil
|
@@ -613,3 +613,8 @@ public static final android.os.Parcelable$Creator *;
|
|
613
613
|
-dontwarn android.support.design.internal.**
|
614
614
|
-dontwarn com.google.android.gms.**
|
615
615
|
-dontwarn android.support.v4.**
|
616
|
+
|
617
|
+
-keep public class androidx.**
|
618
|
+
-keep public class kotlin.**
|
619
|
+
-dontwarn androidx.**
|
620
|
+
-dontwarn kotlin.**
|
Binary file
|
@@ -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
|
-
|
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
|
-
|
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
|
-
|
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:
|
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
|
-
|
588
|
-
|
589
|
-
|
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
|
-
|
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
|
+
|
@@ -0,0 +1,107 @@
|
|
1
|
+
|
2
|
+
#import "CCocoaServer.h"
|
3
|
+
#import "RhoHTTPConnection.h"
|
4
|
+
|
5
|
+
|
6
|
+
#import "DDLog.h"
|
7
|
+
#import "DDTTYLogger.h"
|
8
|
+
|
9
|
+
|
10
|
+
extern int rho_http_get_port();
|
11
|
+
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 );
|
12
|
+
extern void rho_http_free_response( const char* data );
|
13
|
+
|
14
|
+
extern void* rho_http_init_headers_list();
|
15
|
+
extern void rho_http_add_header( void* list, const char* name, const char* value );
|
16
|
+
extern void rho_http_free_headers_list( void* list );
|
17
|
+
|
18
|
+
static const int ddLogLevel = LOG_LEVEL_VERBOSE;
|
19
|
+
|
20
|
+
|
21
|
+
static CCocoaServer* ourSharedInstance = nil;
|
22
|
+
|
23
|
+
@implementation CCocoaServer
|
24
|
+
|
25
|
+
+ (CCocoaServer*)sharedInstance {
|
26
|
+
if (ourSharedInstance == nil) {
|
27
|
+
ourSharedInstance = [[CCocoaServer alloc] init];
|
28
|
+
}
|
29
|
+
return ourSharedInstance;
|
30
|
+
}
|
31
|
+
|
32
|
+
-(id)init {
|
33
|
+
self = [super init];
|
34
|
+
httpServer = nil;
|
35
|
+
return self;
|
36
|
+
}
|
37
|
+
|
38
|
+
-(void) createServer {
|
39
|
+
NSLog(@"$$$$$ HTTP SERVER CREATE()");
|
40
|
+
|
41
|
+
[DDLog addLogger:[DDTTYLogger sharedInstance]];
|
42
|
+
|
43
|
+
httpServer = [[HTTPServer alloc] init];
|
44
|
+
[httpServer setType:@"_http._tcp."];
|
45
|
+
[httpServer setPort:rho_http_get_port()]; // setup port
|
46
|
+
[httpServer setInterface:@"localhost"]; // accept only inner connections
|
47
|
+
[httpServer setConnectionClass:[RhoHTTPConnection class]]; // replace connection for replace responce functionlity
|
48
|
+
}
|
49
|
+
|
50
|
+
-(void)start{
|
51
|
+
|
52
|
+
if (httpServer == nil) {
|
53
|
+
NSLog(@"$$$$$ HTTP SERVER START() - NO SERVER !");
|
54
|
+
return;
|
55
|
+
}
|
56
|
+
NSLog(@"$$$$$ HTTP SERVER START()");
|
57
|
+
|
58
|
+
NSError *error;
|
59
|
+
|
60
|
+
if (![httpServer isRunning]) {
|
61
|
+
if([httpServer start:&error])
|
62
|
+
{
|
63
|
+
NSLog(@"Started HTTP Server on port %hu", [httpServer listeningPort]);
|
64
|
+
}
|
65
|
+
else
|
66
|
+
{
|
67
|
+
NSLog(@"Error starting HTTP Server: %@", [error localizedDescription]);
|
68
|
+
}
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
-(void)stop {
|
75
|
+
if (httpServer == nil) {
|
76
|
+
NSLog(@"$$$$$ HTTP SERVER STOP() - NO SERVER !");
|
77
|
+
|
78
|
+
return;
|
79
|
+
}
|
80
|
+
NSLog(@"$$$$$ HTTP SERVER STOP()");
|
81
|
+
|
82
|
+
if ([httpServer isRunning]) {
|
83
|
+
[httpServer stop];
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
87
|
+
|
88
|
+
@end
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
void rho_cocoa_server_init() {
|
94
|
+
CCocoaServer* server = [CCocoaServer sharedInstance];
|
95
|
+
[server createServer];
|
96
|
+
[server start];
|
97
|
+
}
|
98
|
+
|
99
|
+
void rho_cocoa_server_stop() {
|
100
|
+
CCocoaServer* server = [CCocoaServer sharedInstance];
|
101
|
+
[server stop];
|
102
|
+
}
|
103
|
+
|
104
|
+
void rho_cocoa_server_start() {
|
105
|
+
CCocoaServer* server = [CCocoaServer sharedInstance];
|
106
|
+
[server start];
|
107
|
+
}
|