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
@@ -162,7 +162,10 @@ int on_http_cb(http_parser* parser) { return 0; }
|
|
162
162
|
if (rho_conf_is_property_exists("ios_direct_local_requests")!=0) {
|
163
163
|
canHandle = rho_conf_getBool("ios_direct_local_requests")!=0;
|
164
164
|
}
|
165
|
-
|
165
|
+
if (rho_conf_is_property_exists("ios_direct_local_requests_with_custom_protocol")!=0) {
|
166
|
+
canHandle = canHandle || (rho_conf_getBool("ios_direct_local_requests_with_custom_protocol")!=0);
|
167
|
+
}
|
168
|
+
|
166
169
|
if ( canHandle ) {
|
167
170
|
if (is_net_trace()) {
|
168
171
|
RAWTRACE("$NetRequestProcess$ canInitWithRequest: ios_direct_local_requests = true !");
|
@@ -257,20 +260,28 @@ int on_http_cb(http_parser* parser) { return 0; }
|
|
257
260
|
NSMutableString* s = nil;//[NSMutableString stringWithFormat:@"https://127.0.0.1:%d%@",rho_http_get_port(),[url path]];
|
258
261
|
|
259
262
|
bool force_https = false;
|
263
|
+
bool force_custom_protocol = false;
|
260
264
|
if (rho_conf_is_property_exists("ios_https_local_server")!=0) {
|
261
265
|
force_https = rho_conf_getBool("ios_https_local_server")!=0;
|
262
266
|
}
|
263
|
-
|
267
|
+
if (rho_conf_is_property_exists("ios_direct_local_requests_with_custom_protocol")!=0) {
|
268
|
+
force_custom_protocol = rho_conf_getBool("ios_direct_local_requests_with_custom_protocol")!=0;
|
269
|
+
}
|
270
|
+
|
264
271
|
NSString* spath = [url path];
|
265
272
|
spath = [spath stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]];
|
266
273
|
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
+
if (force_custom_protocol) {
|
275
|
+
s = [NSMutableString stringWithFormat:@"%@://127.0.0.1:%d%@",@"rhoctp",rho_http_get_port(),spath];
|
276
|
+
}
|
277
|
+
else {
|
278
|
+
if (force_https) {
|
279
|
+
s = [NSMutableString stringWithFormat:@"%@://127.0.0.1:%d%@",@"https",rho_http_get_port(),spath];
|
280
|
+
}
|
281
|
+
else {
|
282
|
+
s = [NSMutableString stringWithFormat:@"%@://127.0.0.1:%d%@",@"http", rho_http_get_port(),spath];
|
283
|
+
}
|
284
|
+
}
|
274
285
|
|
275
286
|
|
276
287
|
NSString* squery = [url query];
|
@@ -505,7 +516,7 @@ int on_http_cb(http_parser* parser) { return 0; }
|
|
505
516
|
|
506
517
|
const char* scheme = [[url scheme] UTF8String];
|
507
518
|
if (scheme != 0) {
|
508
|
-
if ((strcmp(scheme, "http") !=0 ) && (strcmp(scheme, "https") !=0 )) {
|
519
|
+
if ((strcmp(scheme, "http") !=0 ) && (strcmp(scheme, "https") !=0 ) && (strcmp(scheme, "rhoctp") !=0 )) {
|
509
520
|
if (is_net_trace()) {
|
510
521
|
RAWTRACE("$NetRequestProcess$ isLocalURL END : return NO");
|
511
522
|
}
|
@@ -174,6 +174,10 @@ totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite;
|
|
174
174
|
[super dealloc];
|
175
175
|
}
|
176
176
|
|
177
|
+
- (BOOL)connectionShouldUseCredentialStorage:(NSURLConnection *)connection {
|
178
|
+
return NO;
|
179
|
+
}
|
180
|
+
|
177
181
|
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)err
|
178
182
|
{
|
179
183
|
if (is_net_trace()) {
|
@@ -0,0 +1,158 @@
|
|
1
|
+
#import "DDData.h"
|
2
|
+
#import <CommonCrypto/CommonDigest.h>
|
3
|
+
|
4
|
+
|
5
|
+
@implementation NSData (DDData)
|
6
|
+
|
7
|
+
static char encodingTable[64] = {
|
8
|
+
'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',
|
9
|
+
'Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f',
|
10
|
+
'g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v',
|
11
|
+
'w','x','y','z','0','1','2','3','4','5','6','7','8','9','+','/' };
|
12
|
+
|
13
|
+
- (NSData *)md5Digest
|
14
|
+
{
|
15
|
+
unsigned char result[CC_MD5_DIGEST_LENGTH];
|
16
|
+
|
17
|
+
CC_MD5([self bytes], (CC_LONG)[self length], result);
|
18
|
+
return [NSData dataWithBytes:result length:CC_MD5_DIGEST_LENGTH];
|
19
|
+
}
|
20
|
+
|
21
|
+
- (NSData *)sha1Digest
|
22
|
+
{
|
23
|
+
unsigned char result[CC_SHA1_DIGEST_LENGTH];
|
24
|
+
|
25
|
+
CC_SHA1([self bytes], (CC_LONG)[self length], result);
|
26
|
+
return [NSData dataWithBytes:result length:CC_SHA1_DIGEST_LENGTH];
|
27
|
+
}
|
28
|
+
|
29
|
+
- (NSString *)hexStringValue
|
30
|
+
{
|
31
|
+
NSMutableString *stringBuffer = [NSMutableString stringWithCapacity:([self length] * 2)];
|
32
|
+
|
33
|
+
const unsigned char *dataBuffer = [self bytes];
|
34
|
+
int i;
|
35
|
+
|
36
|
+
for (i = 0; i < [self length]; ++i)
|
37
|
+
{
|
38
|
+
[stringBuffer appendFormat:@"%02x", (unsigned int)dataBuffer[i]];
|
39
|
+
}
|
40
|
+
|
41
|
+
return [stringBuffer copy];
|
42
|
+
}
|
43
|
+
|
44
|
+
- (NSString *)base64Encoded
|
45
|
+
{
|
46
|
+
const unsigned char *bytes = [self bytes];
|
47
|
+
NSMutableString *result = [NSMutableString stringWithCapacity:[self length]];
|
48
|
+
unsigned long ixtext = 0;
|
49
|
+
unsigned long lentext = [self length];
|
50
|
+
long ctremaining = 0;
|
51
|
+
unsigned char inbuf[3], outbuf[4];
|
52
|
+
unsigned short i = 0;
|
53
|
+
unsigned short charsonline = 0, ctcopy = 0;
|
54
|
+
unsigned long ix = 0;
|
55
|
+
|
56
|
+
while( YES )
|
57
|
+
{
|
58
|
+
ctremaining = lentext - ixtext;
|
59
|
+
if( ctremaining <= 0 ) break;
|
60
|
+
|
61
|
+
for( i = 0; i < 3; i++ ) {
|
62
|
+
ix = ixtext + i;
|
63
|
+
if( ix < lentext ) inbuf[i] = bytes[ix];
|
64
|
+
else inbuf [i] = 0;
|
65
|
+
}
|
66
|
+
|
67
|
+
outbuf [0] = (inbuf [0] & 0xFC) >> 2;
|
68
|
+
outbuf [1] = ((inbuf [0] & 0x03) << 4) | ((inbuf [1] & 0xF0) >> 4);
|
69
|
+
outbuf [2] = ((inbuf [1] & 0x0F) << 2) | ((inbuf [2] & 0xC0) >> 6);
|
70
|
+
outbuf [3] = inbuf [2] & 0x3F;
|
71
|
+
ctcopy = 4;
|
72
|
+
|
73
|
+
switch( ctremaining )
|
74
|
+
{
|
75
|
+
case 1:
|
76
|
+
ctcopy = 2;
|
77
|
+
break;
|
78
|
+
case 2:
|
79
|
+
ctcopy = 3;
|
80
|
+
break;
|
81
|
+
}
|
82
|
+
|
83
|
+
for( i = 0; i < ctcopy; i++ )
|
84
|
+
[result appendFormat:@"%c", encodingTable[outbuf[i]]];
|
85
|
+
|
86
|
+
for( i = ctcopy; i < 4; i++ )
|
87
|
+
[result appendString:@"="];
|
88
|
+
|
89
|
+
ixtext += 3;
|
90
|
+
charsonline += 4;
|
91
|
+
}
|
92
|
+
|
93
|
+
return [NSString stringWithString:result];
|
94
|
+
}
|
95
|
+
|
96
|
+
- (NSData *)base64Decoded
|
97
|
+
{
|
98
|
+
const unsigned char *bytes = [self bytes];
|
99
|
+
NSMutableData *result = [NSMutableData dataWithCapacity:[self length]];
|
100
|
+
|
101
|
+
unsigned long ixtext = 0;
|
102
|
+
unsigned long lentext = [self length];
|
103
|
+
unsigned char ch = 0;
|
104
|
+
unsigned char inbuf[4] = {0, 0, 0, 0};
|
105
|
+
unsigned char outbuf[3] = {0, 0, 0};
|
106
|
+
short i = 0, ixinbuf = 0;
|
107
|
+
BOOL flignore = NO;
|
108
|
+
BOOL flendtext = NO;
|
109
|
+
|
110
|
+
while( YES )
|
111
|
+
{
|
112
|
+
if( ixtext >= lentext ) break;
|
113
|
+
ch = bytes[ixtext++];
|
114
|
+
flignore = NO;
|
115
|
+
|
116
|
+
if( ( ch >= 'A' ) && ( ch <= 'Z' ) ) ch = ch - 'A';
|
117
|
+
else if( ( ch >= 'a' ) && ( ch <= 'z' ) ) ch = ch - 'a' + 26;
|
118
|
+
else if( ( ch >= '0' ) && ( ch <= '9' ) ) ch = ch - '0' + 52;
|
119
|
+
else if( ch == '+' ) ch = 62;
|
120
|
+
else if( ch == '=' ) flendtext = YES;
|
121
|
+
else if( ch == '/' ) ch = 63;
|
122
|
+
else flignore = YES;
|
123
|
+
|
124
|
+
if( ! flignore )
|
125
|
+
{
|
126
|
+
short ctcharsinbuf = 3;
|
127
|
+
BOOL flbreak = NO;
|
128
|
+
|
129
|
+
if( flendtext )
|
130
|
+
{
|
131
|
+
if( ! ixinbuf ) break;
|
132
|
+
if( ( ixinbuf == 1 ) || ( ixinbuf == 2 ) ) ctcharsinbuf = 1;
|
133
|
+
else ctcharsinbuf = 2;
|
134
|
+
ixinbuf = 3;
|
135
|
+
flbreak = YES;
|
136
|
+
}
|
137
|
+
|
138
|
+
inbuf [ixinbuf++] = ch;
|
139
|
+
|
140
|
+
if( ixinbuf == 4 )
|
141
|
+
{
|
142
|
+
ixinbuf = 0;
|
143
|
+
outbuf [0] = ( inbuf[0] << 2 ) | ( ( inbuf[1] & 0x30) >> 4 );
|
144
|
+
outbuf [1] = ( ( inbuf[1] & 0x0F ) << 4 ) | ( ( inbuf[2] & 0x3C ) >> 2 );
|
145
|
+
outbuf [2] = ( ( inbuf[2] & 0x03 ) << 6 ) | ( inbuf[3] & 0x3F );
|
146
|
+
|
147
|
+
for( i = 0; i < ctcharsinbuf; i++ )
|
148
|
+
[result appendBytes:&outbuf[i] length:1];
|
149
|
+
}
|
150
|
+
|
151
|
+
if( flbreak ) break;
|
152
|
+
}
|
153
|
+
}
|
154
|
+
|
155
|
+
return [NSData dataWithData:result];
|
156
|
+
}
|
157
|
+
|
158
|
+
@end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
#import <Foundation/Foundation.h>
|
2
|
+
|
3
|
+
|
4
|
+
@interface NSNumber (DDNumber)
|
5
|
+
|
6
|
+
+ (BOOL)parseString:(NSString *)str intoSInt64:(SInt64 *)pNum;
|
7
|
+
+ (BOOL)parseString:(NSString *)str intoUInt64:(UInt64 *)pNum;
|
8
|
+
|
9
|
+
+ (BOOL)parseString:(NSString *)str intoNSInteger:(NSInteger *)pNum;
|
10
|
+
+ (BOOL)parseString:(NSString *)str intoNSUInteger:(NSUInteger *)pNum;
|
11
|
+
|
12
|
+
@end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
#import "DDNumber.h"
|
2
|
+
|
3
|
+
|
4
|
+
@implementation NSNumber (DDNumber)
|
5
|
+
|
6
|
+
+ (BOOL)parseString:(NSString *)str intoSInt64:(SInt64 *)pNum
|
7
|
+
{
|
8
|
+
if(str == nil)
|
9
|
+
{
|
10
|
+
*pNum = 0;
|
11
|
+
return NO;
|
12
|
+
}
|
13
|
+
|
14
|
+
errno = 0;
|
15
|
+
|
16
|
+
// On both 32-bit and 64-bit machines, long long = 64 bit
|
17
|
+
|
18
|
+
*pNum = strtoll([str UTF8String], NULL, 10);
|
19
|
+
|
20
|
+
if(errno != 0)
|
21
|
+
return NO;
|
22
|
+
else
|
23
|
+
return YES;
|
24
|
+
}
|
25
|
+
|
26
|
+
+ (BOOL)parseString:(NSString *)str intoUInt64:(UInt64 *)pNum
|
27
|
+
{
|
28
|
+
if(str == nil)
|
29
|
+
{
|
30
|
+
*pNum = 0;
|
31
|
+
return NO;
|
32
|
+
}
|
33
|
+
|
34
|
+
errno = 0;
|
35
|
+
|
36
|
+
// On both 32-bit and 64-bit machines, unsigned long long = 64 bit
|
37
|
+
|
38
|
+
*pNum = strtoull([str UTF8String], NULL, 10);
|
39
|
+
|
40
|
+
if(errno != 0)
|
41
|
+
return NO;
|
42
|
+
else
|
43
|
+
return YES;
|
44
|
+
}
|
45
|
+
|
46
|
+
+ (BOOL)parseString:(NSString *)str intoNSInteger:(NSInteger *)pNum
|
47
|
+
{
|
48
|
+
if(str == nil)
|
49
|
+
{
|
50
|
+
*pNum = 0;
|
51
|
+
return NO;
|
52
|
+
}
|
53
|
+
|
54
|
+
errno = 0;
|
55
|
+
|
56
|
+
// On LP64, NSInteger = long = 64 bit
|
57
|
+
// Otherwise, NSInteger = int = long = 32 bit
|
58
|
+
|
59
|
+
*pNum = strtol([str UTF8String], NULL, 10);
|
60
|
+
|
61
|
+
if(errno != 0)
|
62
|
+
return NO;
|
63
|
+
else
|
64
|
+
return YES;
|
65
|
+
}
|
66
|
+
|
67
|
+
+ (BOOL)parseString:(NSString *)str intoNSUInteger:(NSUInteger *)pNum
|
68
|
+
{
|
69
|
+
if(str == nil)
|
70
|
+
{
|
71
|
+
*pNum = 0;
|
72
|
+
return NO;
|
73
|
+
}
|
74
|
+
|
75
|
+
errno = 0;
|
76
|
+
|
77
|
+
// On LP64, NSUInteger = unsigned long = 64 bit
|
78
|
+
// Otherwise, NSUInteger = unsigned int = unsigned long = 32 bit
|
79
|
+
|
80
|
+
*pNum = strtoul([str UTF8String], NULL, 10);
|
81
|
+
|
82
|
+
if(errno != 0)
|
83
|
+
return NO;
|
84
|
+
else
|
85
|
+
return YES;
|
86
|
+
}
|
87
|
+
|
88
|
+
@end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
/**
|
2
|
+
* DDRange is the functional equivalent of a 64 bit NSRange.
|
3
|
+
* The HTTP Server is designed to support very large files.
|
4
|
+
* On 32 bit architectures (ppc, i386) NSRange uses unsigned 32 bit integers.
|
5
|
+
* This only supports a range of up to 4 gigabytes.
|
6
|
+
* By defining our own variant, we can support a range up to 16 exabytes.
|
7
|
+
*
|
8
|
+
* All effort is given such that DDRange functions EXACTLY the same as NSRange.
|
9
|
+
**/
|
10
|
+
|
11
|
+
#import <Foundation/NSValue.h>
|
12
|
+
#import <Foundation/NSObjCRuntime.h>
|
13
|
+
|
14
|
+
@class NSString;
|
15
|
+
|
16
|
+
typedef struct _DDRange {
|
17
|
+
UInt64 location;
|
18
|
+
UInt64 length;
|
19
|
+
} DDRange;
|
20
|
+
|
21
|
+
typedef DDRange *DDRangePointer;
|
22
|
+
|
23
|
+
NS_INLINE DDRange DDMakeRange(UInt64 loc, UInt64 len) {
|
24
|
+
DDRange r;
|
25
|
+
r.location = loc;
|
26
|
+
r.length = len;
|
27
|
+
return r;
|
28
|
+
}
|
29
|
+
|
30
|
+
NS_INLINE UInt64 DDMaxRange(DDRange range) {
|
31
|
+
return (range.location + range.length);
|
32
|
+
}
|
33
|
+
|
34
|
+
NS_INLINE BOOL DDLocationInRange(UInt64 loc, DDRange range) {
|
35
|
+
return (loc - range.location < range.length);
|
36
|
+
}
|
37
|
+
|
38
|
+
NS_INLINE BOOL DDEqualRanges(DDRange range1, DDRange range2) {
|
39
|
+
return ((range1.location == range2.location) && (range1.length == range2.length));
|
40
|
+
}
|
41
|
+
|
42
|
+
FOUNDATION_EXPORT DDRange DDUnionRange(DDRange range1, DDRange range2);
|
43
|
+
FOUNDATION_EXPORT DDRange DDIntersectionRange(DDRange range1, DDRange range2);
|
44
|
+
FOUNDATION_EXPORT NSString *DDStringFromRange(DDRange range);
|
45
|
+
FOUNDATION_EXPORT DDRange DDRangeFromString(NSString *aString);
|
46
|
+
|
47
|
+
NSInteger DDRangeCompare(DDRangePointer pDDRange1, DDRangePointer pDDRange2);
|
48
|
+
|
49
|
+
@interface NSValue (NSValueDDRangeExtensions)
|
50
|
+
|
51
|
+
+ (NSValue *)valueWithDDRange:(DDRange)range;
|
52
|
+
- (DDRange)ddrangeValue;
|
53
|
+
|
54
|
+
- (NSInteger)ddrangeCompare:(NSValue *)ddrangeValue;
|
55
|
+
|
56
|
+
@end
|
@@ -0,0 +1,104 @@
|
|
1
|
+
#import "DDRange.h"
|
2
|
+
#import "DDNumber.h"
|
3
|
+
|
4
|
+
DDRange DDUnionRange(DDRange range1, DDRange range2)
|
5
|
+
{
|
6
|
+
DDRange result;
|
7
|
+
|
8
|
+
result.location = MIN(range1.location, range2.location);
|
9
|
+
result.length = MAX(DDMaxRange(range1), DDMaxRange(range2)) - result.location;
|
10
|
+
|
11
|
+
return result;
|
12
|
+
}
|
13
|
+
|
14
|
+
DDRange DDIntersectionRange(DDRange range1, DDRange range2)
|
15
|
+
{
|
16
|
+
DDRange result;
|
17
|
+
|
18
|
+
if((DDMaxRange(range1) < range2.location) || (DDMaxRange(range2) < range1.location))
|
19
|
+
{
|
20
|
+
return DDMakeRange(0, 0);
|
21
|
+
}
|
22
|
+
|
23
|
+
result.location = MAX(range1.location, range2.location);
|
24
|
+
result.length = MIN(DDMaxRange(range1), DDMaxRange(range2)) - result.location;
|
25
|
+
|
26
|
+
return result;
|
27
|
+
}
|
28
|
+
|
29
|
+
NSString *DDStringFromRange(DDRange range)
|
30
|
+
{
|
31
|
+
return [NSString stringWithFormat:@"{%qu, %qu}", range.location, range.length];
|
32
|
+
}
|
33
|
+
|
34
|
+
DDRange DDRangeFromString(NSString *aString)
|
35
|
+
{
|
36
|
+
DDRange result = DDMakeRange(0, 0);
|
37
|
+
|
38
|
+
// NSRange will ignore '-' characters, but not '+' characters
|
39
|
+
NSCharacterSet *cset = [NSCharacterSet characterSetWithCharactersInString:@"+0123456789"];
|
40
|
+
|
41
|
+
NSScanner *scanner = [NSScanner scannerWithString:aString];
|
42
|
+
[scanner setCharactersToBeSkipped:[cset invertedSet]];
|
43
|
+
|
44
|
+
NSString *str1 = nil;
|
45
|
+
NSString *str2 = nil;
|
46
|
+
|
47
|
+
BOOL found1 = [scanner scanCharactersFromSet:cset intoString:&str1];
|
48
|
+
BOOL found2 = [scanner scanCharactersFromSet:cset intoString:&str2];
|
49
|
+
|
50
|
+
if(found1) [NSNumber parseString:str1 intoUInt64:&result.location];
|
51
|
+
if(found2) [NSNumber parseString:str2 intoUInt64:&result.length];
|
52
|
+
|
53
|
+
return result;
|
54
|
+
}
|
55
|
+
|
56
|
+
NSInteger DDRangeCompare(DDRangePointer pDDRange1, DDRangePointer pDDRange2)
|
57
|
+
{
|
58
|
+
// Comparison basis:
|
59
|
+
// Which range would you encouter first if you started at zero, and began walking towards infinity.
|
60
|
+
// If you encouter both ranges at the same time, which range would end first.
|
61
|
+
|
62
|
+
if(pDDRange1->location < pDDRange2->location)
|
63
|
+
{
|
64
|
+
return NSOrderedAscending;
|
65
|
+
}
|
66
|
+
if(pDDRange1->location > pDDRange2->location)
|
67
|
+
{
|
68
|
+
return NSOrderedDescending;
|
69
|
+
}
|
70
|
+
if(pDDRange1->length < pDDRange2->length)
|
71
|
+
{
|
72
|
+
return NSOrderedAscending;
|
73
|
+
}
|
74
|
+
if(pDDRange1->length > pDDRange2->length)
|
75
|
+
{
|
76
|
+
return NSOrderedDescending;
|
77
|
+
}
|
78
|
+
|
79
|
+
return NSOrderedSame;
|
80
|
+
}
|
81
|
+
|
82
|
+
@implementation NSValue (NSValueDDRangeExtensions)
|
83
|
+
|
84
|
+
+ (NSValue *)valueWithDDRange:(DDRange)range
|
85
|
+
{
|
86
|
+
return [NSValue valueWithBytes:&range objCType:@encode(DDRange)];
|
87
|
+
}
|
88
|
+
|
89
|
+
- (DDRange)ddrangeValue
|
90
|
+
{
|
91
|
+
DDRange result;
|
92
|
+
[self getValue:&result];
|
93
|
+
return result;
|
94
|
+
}
|
95
|
+
|
96
|
+
- (NSInteger)ddrangeCompare:(NSValue *)other
|
97
|
+
{
|
98
|
+
DDRange r1 = [self ddrangeValue];
|
99
|
+
DDRange r2 = [other ddrangeValue];
|
100
|
+
|
101
|
+
return DDRangeCompare(&r1, &r2);
|
102
|
+
}
|
103
|
+
|
104
|
+
@end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
#import <Foundation/Foundation.h>
|
2
|
+
|
3
|
+
#if TARGET_OS_IPHONE
|
4
|
+
// Note: You may need to add the CFNetwork Framework to your project
|
5
|
+
#import <CFNetwork/CFNetwork.h>
|
6
|
+
#endif
|
7
|
+
|
8
|
+
@class HTTPMessage;
|
9
|
+
|
10
|
+
|
11
|
+
@interface HTTPAuthenticationRequest : NSObject
|
12
|
+
{
|
13
|
+
BOOL isBasic;
|
14
|
+
BOOL isDigest;
|
15
|
+
|
16
|
+
NSString *base64Credentials;
|
17
|
+
|
18
|
+
NSString *username;
|
19
|
+
NSString *realm;
|
20
|
+
NSString *nonce;
|
21
|
+
NSString *uri;
|
22
|
+
NSString *qop;
|
23
|
+
NSString *nc;
|
24
|
+
NSString *cnonce;
|
25
|
+
NSString *response;
|
26
|
+
}
|
27
|
+
- (id)initWithRequest:(HTTPMessage *)request;
|
28
|
+
|
29
|
+
- (BOOL)isBasic;
|
30
|
+
- (BOOL)isDigest;
|
31
|
+
|
32
|
+
// Basic
|
33
|
+
- (NSString *)base64Credentials;
|
34
|
+
|
35
|
+
// Digest
|
36
|
+
- (NSString *)username;
|
37
|
+
- (NSString *)realm;
|
38
|
+
- (NSString *)nonce;
|
39
|
+
- (NSString *)uri;
|
40
|
+
- (NSString *)qop;
|
41
|
+
- (NSString *)nc;
|
42
|
+
- (NSString *)cnonce;
|
43
|
+
- (NSString *)response;
|
44
|
+
|
45
|
+
@end
|