rhodes 2.2.6 → 2.3.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +20 -0
- data/README.md +46 -0
- data/Rakefile +85 -80
- data/bin/rhodes +2 -2
- data/bin/rhogen +1 -1
- data/doc/application.txt +277 -0
- data/doc/bb-css.txt +209 -0
- data/doc/build.txt +785 -0
- data/doc/configuration.txt +236 -0
- data/doc/connect-to-web-services.txt +282 -0
- data/doc/contributing.txt +64 -0
- data/doc/css-framework.txt +144 -0
- data/doc/device-caps.txt +1152 -0
- data/doc/extensions.txt +528 -0
- data/doc/files.txt +4 -0
- data/doc/generator.txt +141 -0
- data/doc/install.txt +35 -0
- data/doc/introduction.txt +88 -0
- data/doc/rhom.txt +826 -0
- data/doc/standard-css.txt +392 -0
- data/doc/synchronization.txt +542 -0
- data/doc/test-log-debug.txt +148 -0
- data/doc/tutorial.txt +136 -0
- data/doc/ui.txt +766 -0
- data/installer/EnvVarUpdate.nsh +328 -0
- data/installer/README.html +81 -0
- data/installer/RHOSYNC-LICENSE.txt +675 -0
- data/installer/icon.ico +0 -0
- data/installer/instant-rhodes.nsi +427 -0
- data/lib/build/jake.rb +15 -1
- data/lib/extensions/barcode/ext/barcode/platform/android/jni/src/imageprovider.cpp +1 -1
- data/lib/extensions/barcode/ext/barcode/platform/bb/Barcode6.files +45 -0
- data/lib/extensions/barcode/ext/barcode/platform/bb/Rakefile +6 -0
- data/lib/extensions/barcode/ext/barcode/platform/bb/barcode6.jdp +92 -0
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Barcode.xcodeproj/project.pbxproj +7 -4
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Rakefile +2 -1
- data/lib/extensions/barcode/ext/barcode/platform/wm/src/wm_imageprovider.cpp +1 -1
- data/lib/extensions/digest-sha1/ext/build.bat +1 -0
- data/lib/extensions/digest-sha1/ext/digest-sha1.vcproj +335 -0
- data/lib/extensions/esri/ext/build +17 -0
- data/lib/extensions/esri/ext/build.bat +29 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewFactory.h +7 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewFactory.mm +58 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewFactoryRegister.mm +22 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewManager.h +21 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewManager.mm +32 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/InitESRI.c +5 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/MapViewControllerESRI.h +143 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/MapViewControllerESRI.m +919 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/ESRI.xcodeproj/project.pbxproj +320 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/ESRI_Prefix.pch +7 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Rakefile +76 -0
- data/lib/extensions/esri/ext.yml +3 -0
- data/lib/extensions/net-http/monitor.rb +265 -0
- data/lib/extensions/net-http/net/ftp.rb +981 -0
- data/lib/extensions/net-http/thread.rb +367 -0
- data/lib/extensions/rhocgi/cgi.rb +16 -0
- data/lib/extensions/rhospec/rhospec.rb +118 -0
- data/lib/framework/base64.rb +91 -0
- data/lib/framework/builtinME.rb +13 -10
- data/lib/framework/ostruct.rb +145 -0
- data/lib/framework/res/back_btn.wm.png +0 -0
- data/lib/framework/res/blue_pushpin.wm.png +0 -0
- data/lib/framework/res/blue_pushpin_small.wm.png +0 -0
- data/lib/framework/res/callout.wm.png +0 -0
- data/lib/framework/res/callout_link.wm.png +0 -0
- data/lib/framework/res/forward_btn.wm.png +0 -0
- data/lib/framework/res/home_btn.wm.png +0 -0
- data/lib/framework/res/options_btn.wm.png +0 -0
- data/lib/framework/res/refresh_btn.wm.png +0 -0
- data/lib/framework/rho/render.rb +5 -2
- data/lib/framework/rho/rho.rb +320 -50
- data/lib/framework/rho/rhoapplication.rb +48 -10
- data/lib/framework/rho/rhonativeviewmanager.rb +73 -0
- data/lib/framework/rho/rhosupport.rb +15 -1
- data/lib/framework/rho/rhotabbar.rb +29 -0
- data/lib/framework/rho/rhotoolbar.rb +17 -0
- data/lib/framework/rho/rhoutils.rb +22 -6
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/rholang/rhomsg_de.rb +4 -3
- data/lib/framework/rholang/rhomsg_en.rb +1 -0
- data/lib/framework/rholang/rhomsg_es.rb +1 -0
- data/lib/framework/rholang/rhomsg_it.rb +1 -0
- data/lib/framework/rhom/rhom.rb +31 -10
- data/lib/framework/rhom/rhom_db_adapter.rb +33 -23
- data/lib/framework/rhom/rhom_object_factory.rb +465 -249
- data/lib/framework/rhom/rhom_source.rb +22 -7
- data/lib/framework/version.rb +1 -1
- data/lib/rhodes.rb +1 -1
- data/platform/android/Rhodes/AndroidManifest.xml +83 -20
- data/platform/android/Rhodes/gen/com/rhomobile/rhodes/R.java +5 -0
- data/platform/android/Rhodes/jni/include/rhodes/RhoClassFactory.h +2 -0
- data/platform/android/Rhodes/jni/include/rhodes/details/rhojava.inc +9 -5
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhodesAppOptions.h +53 -0
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhodesService.h +46 -56
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_SplashScreen.h +10 -0
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_mapview_MapView.h +93 -0
- data/platform/android/Rhodes/jni/include/rhodes/rhocryptimpl.h +38 -0
- data/platform/android/Rhodes/jni/include/rhodes.h +64 -8
- data/platform/android/Rhodes/jni/src/RhoClassFactory.cpp +6 -0
- data/platform/android/Rhodes/jni/src/alert.cpp +5 -11
- data/platform/android/Rhodes/jni/src/bluetooth.cpp +66 -29
- data/platform/android/Rhodes/jni/src/callbacks.cpp +24 -21
- data/platform/android/Rhodes/jni/src/camera.cpp +2 -6
- data/platform/android/Rhodes/jni/src/datetimepicker.cpp +13 -11
- data/platform/android/Rhodes/jni/src/event.cpp +9 -15
- data/platform/android/Rhodes/jni/src/fileapi.cpp +13 -27
- data/platform/android/Rhodes/jni/src/logconf.cpp +3 -3
- data/platform/android/Rhodes/jni/src/mapview.cpp +696 -16
- data/platform/android/Rhodes/jni/src/menu.cpp +3 -3
- data/platform/android/Rhodes/jni/src/nativebar.cpp +55 -4
- data/platform/android/Rhodes/jni/src/nativeview.cpp +33 -0
- data/platform/android/Rhodes/jni/src/phonebook.cpp +6 -11
- data/platform/android/Rhodes/jni/src/rhoconf.cpp +4 -4
- data/platform/android/Rhodes/jni/src/rhocryptimpl.cpp +87 -0
- data/platform/android/Rhodes/jni/src/rhodes.cpp +55 -34
- data/platform/android/Rhodes/jni/src/ringtones.cpp +2 -3
- data/platform/android/Rhodes/jni/src/signature.cpp +3 -5
- data/platform/android/Rhodes/jni/src/splashscreen.cpp +7 -0
- data/platform/android/Rhodes/jni/src/sslimpl.cpp +17 -20
- data/platform/android/Rhodes/jni/src/webview.cpp +13 -12
- data/platform/android/Rhodes/res/drawable/callout.png +0 -0
- data/platform/android/Rhodes/res/drawable/callout_link.png +0 -0
- data/platform/android/Rhodes/res/drawable/signature_cancel.png +0 -0
- data/platform/android/Rhodes/res/drawable/signature_clear.png +0 -0
- data/platform/android/Rhodes/res/drawable/signature_ok.png +0 -0
- data/platform/android/Rhodes/res/layout/datetime.xml +4 -0
- data/platform/android/Rhodes/res/layout/signature.xml +24 -17
- data/platform/android/Rhodes/res/layout/status_bar_ongoing_event_progress_bar.xml +102 -0
- data/platform/android/Rhodes/res/values/strings.xml +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/AndroidR.java +6 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Base64.java +575 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/BaseActivity.java +83 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +21 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushReceiver.java +23 -15
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushService.java +2 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoCryptImpl.java +151 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoMenu.java +2 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +372 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesAppOptions.java +11 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +58 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +705 -523
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RingtoneManager.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/SplashScreen.java +167 -85
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Utils.java +36 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +4 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/Alert.java +33 -20
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/IRhoBluetoothManager.java +2 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManager.java +2 -24
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManagerNew.java +106 -36
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManagerOld.java +15 -58
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothSession.java +0 -7
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/Camera.java +6 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/FileList.java +4 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCapture.java +91 -27
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/datetime/DateTimePicker.java +6 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/datetime/DateTimePickerScreen.java +275 -42
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/file/RhoFileApi.java +1 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +1 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +120 -43
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +518 -28
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java +2 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/GoogleMapView.java +434 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapTouch.java +20 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapView.java +296 -336
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MultiTouchHandler.java +111 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/OneTouchHandler.java +77 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/TouchHandler.java +10 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/nativeview/RhoNativeViewManager.java +0 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Contact.java +5 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorNew.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorOld.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/ImageCapture.java +6 -11
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/Signature.java +6 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/SignatureView.java +0 -7
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/ui/LogViewDialog.java +9 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/util/PerformOnUiThread.java +8 -8
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientNew.java +5 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientOld.java +11 -7
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettingsNew.java +3 -5
- data/platform/android/build/RhodesSRC_build.files +32 -23
- data/platform/android/build/android.rake +28 -11
- data/platform/android/build/androidcommon.rb +2 -0
- data/platform/android/build/librhocommon_build.files +9 -5
- data/platform/android/build/librhodes_build.files +1 -0
- data/platform/android/build/libruby_build.files +1 -0
- data/platform/bb/Hsqldb/Hsqldb.jdp +0 -2
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBResult.java +10 -2
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBStorage.java +37 -5
- data/platform/bb/Hsqldb/src/org/hsqldb/Column.java +5 -5
- data/platform/bb/Hsqldb/src/org/hsqldb/Expression.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/Function.java +73 -78
- data/platform/bb/Hsqldb/src/org/hsqldb/Library.java +288 -8
- data/platform/bb/RubyVM/RubyVM.jdp +3 -0
- data/platform/bb/RubyVM/src/com/rho/FilePath.java +13 -1
- data/platform/bb/RubyVM/src/com/rho/IRhoRubyHelper.java +2 -2
- data/platform/bb/RubyVM/src/com/rho/RhoAppAdapter.java +12 -0
- data/platform/bb/RubyVM/src/com/rho/RhoClassFactory.java +18 -1
- data/platform/bb/RubyVM/src/com/rho/RhoConf.java +128 -108
- data/platform/bb/RubyVM/src/com/rho/RhoLogConf.java +9 -10
- data/platform/bb/RubyVM/src/com/rho/RhoLogger.java +16 -1
- data/platform/bb/RubyVM/src/com/rho/RhoProfiler.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/RhoRuby.java +20 -0
- data/platform/bb/RubyVM/src/com/rho/RhodesApp.java +5 -2
- data/platform/bb/RubyVM/src/com/rho/ThreadQueue.java +65 -46
- data/platform/bb/RubyVM/src/com/rho/db/DBAdapter.java +192 -50
- data/platform/bb/RubyVM/src/com/rho/db/DBAttrManager.java +8 -114
- data/platform/bb/RubyVM/src/com/rho/db/DBException.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/db/IDBCallback.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/db/IDBResult.java +5 -3
- data/platform/bb/RubyVM/src/com/rho/db/IDBStorage.java +5 -1
- data/platform/bb/RubyVM/src/com/rho/file/FileAccessBB.java +109 -0
- data/platform/bb/RubyVM/src/com/rho/file/RhoFile.java +85 -0
- data/platform/bb/RubyVM/src/com/rho/net/NetRequest.java +12 -4
- data/platform/bb/RubyVM/src/com/rho/net/NetResponse.java +5 -0
- data/platform/bb/RubyVM/src/com/rho/net/RhoConnection.java +37 -23
- data/platform/bb/RubyVM/src/com/rho/net/URI.java +84 -0
- data/platform/bb/RubyVM/src/com/rho/sync/ClientRegister.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/sync/SyncEngine.java +119 -61
- data/platform/bb/RubyVM/src/com/rho/sync/SyncNotify.java +61 -24
- data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +108 -54
- data/platform/bb/RubyVM/src/com/rho/sync/SyncThread.java +121 -163
- data/platform/bb/RubyVM/src/com/xruby/GeneratedMethods/RubyString_Methods.java +23 -0
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyMutex.java +1 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyRange.java +3 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyRegexp.java +3 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyString.java +208 -25
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyTime.java +3 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RhoSupport.java +5 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyAPI.java +12 -5
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyID.java +1 -0
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyKernelModule.java +16 -0
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyKernelModule_Methods.java +5 -0
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyValue.java +1 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/stdlib/RubyStringIO.java +4 -1
- data/platform/bb/{Hsqldb → RubyVM}/src/j2me/math/Number.java +33 -0
- data/platform/bb/build/RubyVM_build.files +3 -0
- data/platform/bb/build/bb.rake +140 -62
- data/platform/bb/build/hsqldb_build.files +0 -2
- data/platform/bb/build/rhodes_build.files +5 -0
- data/platform/bb/rhodes/platform/4.7/com/rho/RhoMainScreen.java +43 -7
- data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +23 -2
- data/platform/bb/rhodes/platform/5.0/com/rho/RhodesApplicationPlatform.java +5 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteCopyResult.java +143 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteResult.java +269 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteStorage.java +446 -0
- data/platform/bb/rhodes/platform/common/com/rho/BrowserAdapter5.java +3 -0
- data/platform/bb/rhodes/platform/common/com/rho/RhoMainScreen.java +12 -2
- data/platform/bb/rhodes/platform/common/com/rho/db/SqliteCopyResult.java +2 -0
- data/platform/bb/rhodes/platform/common/com/rho/db/SqliteResult.java +2 -0
- data/platform/bb/rhodes/platform/common/com/rho/db/SqliteStorage.java +2 -0
- data/platform/bb/rhodes/resources/mappin.png +0 -0
- data/platform/bb/rhodes/rhodes.jdp +3 -0
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +21 -18
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter5.java +150 -0
- data/platform/bb/rhodes/src/com/rho/IBrowserAdapter.java +1 -0
- data/platform/bb/rhodes/src/com/rho/RhoMainScreen.java +63 -4
- data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +6 -5
- data/platform/bb/rhodes/src/com/rho/RhodesApplicationPlatform.java +242 -2
- data/platform/bb/rhodes/src/com/rho/db/SqliteCopyResult.java +143 -0
- data/platform/bb/rhodes/src/com/rho/db/SqliteResult.java +269 -0
- data/platform/bb/rhodes/src/com/rho/db/SqliteStorage.java +446 -0
- data/platform/bb/rhodes/src/com/rho/file/Jsr75File.java +1 -1
- data/platform/bb/rhodes/src/com/rho/net/NetworkAccess.java +71 -14
- data/platform/bb/rhodes/src/com/rho/net/bb/BBHttpConnection.java +4 -2
- data/platform/bb/rhodes/src/com/rho/rubyext/Alert.java +28 -12
- data/platform/bb/rhodes/src/com/rho/rubyext/System.java +100 -4
- data/platform/bb/rhodes/src/com/rho/rubyext/WebView.java +3 -2
- data/platform/bb/rhodes/src/com/rho/rubyext/XMLParser.java +1 -1
- data/platform/bb/rhodes/src/rhomobile/NativeBar.java +32 -0
- data/platform/bb/rhodes/src/rhomobile/PushListeningThread.java +9 -2
- data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +174 -41
- data/platform/bb/rhodes/src/rhomobile/datetime/DateTimePicker.java +52 -3
- data/platform/bb/rhodes/src/rhomobile/datetime/DateTimeScreen.java +33 -1
- data/platform/bb/rhodes/src/rhomobile/mapview/Annotation.java +2 -14
- data/platform/bb/rhodes/src/rhomobile/mapview/ESRIMapField.java +686 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/ESRIMapProvider.java +14 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/GeoCoding.java +13 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/GoogleGeoCoding.java +174 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/GoogleMapField.java +104 -330
- data/platform/bb/rhodes/src/rhomobile/mapview/MapTools.java +79 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/MapView.java +35 -12
- data/platform/bb/rhodes/src/rhomobile/mapview/MapViewParent.java +2 -1
- data/platform/bb/rhodes/src/rhomobile/mapview/MapViewScreen.java +336 -44
- data/platform/bb/rhodes/src/rhomobile/mapview/RhoMapField.java +3 -6
- data/platform/iphone/Classes/AppManager/AppManager.m +19 -4
- data/platform/iphone/Classes/DateTime.h +4 -0
- data/platform/iphone/Classes/DateTime.m +1 -1
- data/platform/iphone/Classes/DateTimePicker.m +8 -1
- data/platform/iphone/Classes/DateTimePickerDelegate.m +7 -1
- data/platform/iphone/Classes/Event/Event.m +2 -2
- data/platform/iphone/Classes/MapView/MapViewController.h +4 -1
- data/platform/iphone/Classes/MapView/MapViewController.m +6 -46
- data/platform/iphone/Classes/MapView/MapViewManager.h +26 -0
- data/platform/iphone/Classes/MapView/MapViewManager.m +172 -0
- data/platform/iphone/Classes/NativeBar.h +34 -0
- data/platform/iphone/Classes/NativeBar.m +131 -26
- data/platform/iphone/Classes/NativeView/NVDelegate.h +26 -0
- data/platform/iphone/Classes/NativeView/NVDelegate.m +40 -0
- data/platform/iphone/Classes/NativeView/NVViewController.h +24 -0
- data/platform/iphone/Classes/NativeView/NVViewController.m +90 -0
- data/platform/iphone/Classes/NativeView/RhoNativeViewManager.mm +449 -0
- data/platform/iphone/Classes/{RhoNativeViewManagerOC.h → NativeView/RhoNativeViewManagerOC.h} +15 -0
- data/platform/iphone/Classes/RhoAlert.m +3 -3
- data/platform/iphone/Classes/RhoMainView.h +3 -0
- data/platform/iphone/Classes/Rhodes.h +6 -2
- data/platform/iphone/Classes/Rhodes.m +47 -79
- data/platform/iphone/Classes/Signature/SignatureViewController.m +1 -0
- data/platform/iphone/Classes/SimpleMainView.h +18 -1
- data/platform/iphone/Classes/SimpleMainView.m +180 -35
- data/platform/iphone/Classes/SplitView/LeftViewController.h +1 -1
- data/platform/iphone/Classes/SplitView/LeftViewController.m +13 -7
- data/platform/iphone/Classes/SplitView/RightViewController.h +1 -1
- data/platform/iphone/Classes/SplitView/RightViewController.m +26 -11
- data/platform/iphone/Classes/SplitView/SplittedMainView.h +1 -6
- data/platform/iphone/Classes/SplitView/SplittedMainView.m +14 -52
- data/platform/iphone/Classes/TabbedMainView.h +25 -3
- data/platform/iphone/Classes/TabbedMainView.m +340 -14
- data/platform/iphone/ESRI/BluePushpin.png +0 -0
- data/platform/iphone/ESRI/BluePushpin@2x.png +0 -0
- data/platform/iphone/ESRI/esri.png +0 -0
- data/platform/iphone/ESRI/esri@2x.png +0 -0
- data/platform/iphone/Info.plist +1 -1
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +26 -3
- data/platform/iphone/rbuild/iphone.rake +100 -4
- data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +12 -0
- data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +116 -12
- data/platform/shared/SyncClient/SyncClient.cpp +29 -3
- data/platform/shared/SyncClient/SyncClient.h +2 -1
- data/platform/shared/common/IRhoClassFactory.h +3 -0
- data/platform/shared/common/IRhoCrypt.h +16 -0
- data/platform/shared/common/IRhoThreadImpl.h +1 -0
- data/platform/shared/common/RhoAppAdapter.h +2 -0
- data/platform/shared/common/RhoConf.cpp +97 -46
- data/platform/shared/common/RhoConf.h +14 -13
- data/platform/shared/common/RhoFile.cpp +10 -0
- data/platform/shared/common/RhoFile.h +1 -0
- data/platform/shared/common/RhoMath.cpp +43 -0
- data/platform/shared/common/RhoMath.h +27 -0
- data/platform/shared/common/RhoNativeViewManager.h +27 -1
- data/platform/shared/common/RhoPort.h +11 -0
- data/platform/shared/common/RhoStd.h +5 -0
- data/platform/shared/common/RhoThread.cpp +1 -1
- data/platform/shared/common/RhoThread.h +1 -1
- data/platform/shared/common/RhodesApp.cpp +381 -139
- data/platform/shared/common/RhodesApp.h +24 -10
- data/platform/shared/common/RhodesAppBase.cpp +72 -1
- data/platform/shared/common/RhodesAppBase.h +5 -1
- data/platform/shared/common/SplashScreen.h +4 -4
- data/platform/shared/common/ThreadQueue.cpp +44 -17
- data/platform/shared/common/ThreadQueue.h +4 -0
- data/platform/shared/common/app_build_configs.c +0 -1
- data/platform/shared/common/iphone/RhoClassfactory.h +6 -0
- data/platform/shared/common/iphone/RhoCryptImpl.h +47 -0
- data/platform/shared/common/iphone/RhoCryptImpl.mm +286 -0
- data/platform/shared/common/map/ESRIMapEngine.cpp +921 -0
- data/platform/shared/common/map/ESRIMapEngine.h +255 -0
- data/platform/shared/common/map/GoogleMapEngine.cpp +160 -0
- data/platform/shared/common/map/GoogleMapEngine.h +52 -0
- data/platform/shared/common/map/MapEngine.cpp +304 -0
- data/platform/shared/common/map/MapEngine.h +214 -0
- data/platform/shared/db/DBAdapter.cpp +147 -18
- data/platform/shared/db/DBAdapter.h +38 -12
- data/platform/shared/db/DBAttrManager.cpp +4 -3
- data/platform/shared/db/DBAttrManager.h +7 -7
- data/platform/shared/db/res/db/syncdb.triggers +0 -5
- data/platform/shared/db/res/db/syncdb_java.triggers +21 -0
- data/platform/shared/json/JSONIterator.cpp +11 -1
- data/platform/shared/json/JSONIterator.h +1 -0
- data/platform/shared/logging/RhoLogConf.cpp +29 -12
- data/platform/shared/net/CURLNetRequest.cpp +80 -25
- data/platform/shared/net/CURLNetRequest.h +6 -2
- data/platform/shared/net/HttpServer.cpp +12 -6
- data/platform/shared/net/HttpServer.h +2 -1
- data/platform/shared/net/INetRequest.h +1 -0
- data/platform/shared/ruby/ext/alert/alert.i +5 -0
- data/platform/shared/ruby/ext/alert/alert_wrap.c +439 -108
- data/platform/shared/ruby/ext/datetimepicker/datetimepicker.i +42 -0
- data/platform/shared/ruby/ext/datetimepicker/datetimepicker_wrap.c +521 -120
- data/platform/shared/ruby/ext/nativebar/nativebar.i +16 -0
- data/platform/shared/ruby/ext/nativebar/nativebar_wrap.c +623 -128
- data/platform/shared/ruby/ext/nativeviewmanager/nativeviewmanager.i +18 -0
- data/platform/shared/ruby/ext/nativeviewmanager/nativeviewmanager_wrap.c +2321 -0
- data/platform/shared/ruby/ext/rho/extensions.c +0 -1
- data/platform/shared/ruby/ext/rho/rhoruby.c +53 -0
- data/platform/shared/ruby/ext/rho/rhoruby.h +6 -0
- data/platform/shared/ruby/ext/sqlite3_api/sqlite3_api_wrap.c +6 -3
- data/platform/shared/ruby/ext/syncengine/syncengine.i +9 -1
- data/platform/shared/ruby/ext/syncengine/syncengine_wrap.c +61 -0
- data/platform/shared/ruby/ext/system/system.i +4 -0
- data/platform/shared/ruby/ext/system/system_wrap.c +33 -5
- data/platform/shared/rubyext/RhoAppAdapter.cpp +11 -1
- data/platform/shared/rubyext/System.cpp +9 -0
- data/platform/shared/rubyext/WebView.h +1 -0
- data/platform/shared/sqlite/crypto.c +907 -0
- data/platform/shared/sqlite/sqlite3.c +6 -0
- data/platform/shared/sync/SyncEngine.cpp +49 -19
- data/platform/shared/sync/SyncEngine.h +0 -1
- data/platform/shared/sync/SyncNotify.cpp +14 -5
- data/platform/shared/sync/SyncNotify.h +2 -2
- data/platform/shared/sync/SyncSource.cpp +79 -33
- data/platform/shared/sync/SyncSource.h +1 -0
- data/platform/shared/sync/SyncThread.cpp +26 -11
- data/platform/shared/xruby/src/com/xruby/compiler/codedom/StringExpression.java +4 -2
- data/platform/wm/RhoLib/RhoLib.vcproj +108 -72
- data/platform/wm/build/wm.rake +6 -0
- data/platform/wm/rhodes/Alert.cpp +4 -3
- data/platform/wm/rhodes/Alert.h +1 -1
- data/platform/wm/rhodes/DateTimePicker.cpp +30 -3
- data/platform/wm/rhodes/DateTimePicker.h +9 -1
- data/platform/wm/rhodes/MainWindow.cpp +121 -61
- data/platform/wm/rhodes/MainWindow.h +29 -4
- data/platform/wm/rhodes/MapView/Graphics.cpp +547 -0
- data/platform/wm/rhodes/MapView/Graphics.h +136 -0
- data/platform/wm/rhodes/MapView/MapViewManager.cpp +391 -0
- data/platform/wm/rhodes/MapView/MapViewManager.h +158 -0
- data/platform/wm/rhodes/RhoCryptImpl.cpp +248 -0
- data/platform/wm/rhodes/RhoCryptImpl.h +51 -0
- data/platform/wm/rhodes/RhoNativeViewManager.cpp +208 -0
- data/platform/wm/rhodes/Rhodes.cpp +94 -102
- data/platform/wm/rhodes/Rhodes.rc +27 -0
- data/platform/wm/rhodes/SyncStatusDlg.cpp +1 -0
- data/platform/wm/rhodes/SyncStatusDlg.h +2 -1
- data/platform/wm/rhodes/bluetooth/Bluetooth.cpp +7 -4
- data/platform/wm/rhodes/camera/Camera.cpp +36 -15
- data/platform/wm/rhodes/camera/Camera.h +0 -4
- data/platform/wm/rhodes/resource.h +10 -2
- data/platform/wm/rhodes/rho/common/RhoClassFactory.cpp +7 -0
- data/platform/wm/rhodes/rho/common/RhoClassFactory.h +1 -0
- data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +10 -2
- data/platform/wm/rhodes/rho/net/NetRequestImpl.h +10 -0
- data/platform/wm/rhodes/rho/rubyext/NativeToolbar.cpp +513 -0
- data/platform/wm/rhodes/rho/rubyext/NativeToolbar.h +74 -0
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +22 -10
- data/platform/wm/rhodes/rho/rubyext/WebView.cpp +5 -0
- data/platform/wm/rhodes/rhodes.vcproj +38 -2
- data/platform/wm/rhodes/stdafx.h +2 -1
- data/platform/wm/rubylib/rubylib.vcproj +12 -0
- data/rakefile.rb +85 -80
- data/res/build-tools/iphonesim/Source/iPhoneSimulator.m +14 -3
- data/res/build-tools/iphonesim/build/Release/iphonesim +0 -0
- data/res/build-tools/iphonesim/iphonesim.xcodeproj/project.pbxproj +2 -0
- data/res/build-tools/xruby-0.3.3.jar +0 -0
- data/res/generators/templates/application/app/application.rb +2 -2
- data/res/generators/templates/application/app/helpers/application_helper.rb +1 -1
- data/res/generators/templates/application/public/css/android.css +1 -0
- data/res/generators/templates/application/public/jqtouch/jquery.1.3.2.min.js +1 -1
- data/res/generators/templates/application/rhoconfig.txt +66 -14
- data/rhodes.gemspec +3 -3
- data/spec/framework_spec/app/spec/core/file/expand_path_spec.rb +7 -3
- data/spec/framework_spec/build.yml +1 -1
- data/spec/phone_spec/Rakefile +1 -0
- data/spec/phone_spec/app/Account/account.rb +2 -0
- data/spec/phone_spec/app/Account_s/account_s.rb +7 -0
- data/spec/phone_spec/app/spec/{fixtures → array/fixtures}/classes.rb +0 -0
- data/spec/phone_spec/app/spec/{array_pack_spec.rb → array/pack_spec.rb} +2 -1
- data/spec/phone_spec/app/spec/bulksync_spec.rb +1 -0
- data/spec/phone_spec/app/spec/contacts_spec.rb +2 -0
- data/spec/phone_spec/app/spec/rho_spec.rb +34 -233
- data/spec/phone_spec/app/spec/rhom_object_spec.rb +396 -87
- data/spec/phone_spec/app/spec/string/element_set_spec.rb +251 -0
- data/spec/phone_spec/app/spec/string/end_with_spec.rb +49 -0
- data/spec/phone_spec/app/spec/string/fixtures/classes.rb +27 -0
- data/spec/phone_spec/app/spec/{lstrip_spec.rb → string/lstrip_spec.rb} +0 -0
- data/spec/phone_spec/app/spec/string/replace_spec.rb +52 -0
- data/spec/phone_spec/app/spec/{rstrip_spec.rb → string/rstrip_spec.rb} +0 -0
- data/spec/phone_spec/app/spec/string/slice_spec.rb +473 -0
- data/spec/phone_spec/app/spec/string/split_spec.rb +302 -0
- data/spec/phone_spec/app/spec/string/start_with_spec.rb +48 -0
- data/spec/phone_spec/app/spec/{strip_spec.rb → string/strip_spec.rb} +0 -0
- data/spec/phone_spec/app/spec/syncengine_spec.rb +30 -1
- data/spec/phone_spec/app/spec_runner.rb +15 -7
- data/spec/phone_spec/build.yml +2 -2
- metadata +154 -25
- data/README.textile +0 -45
- data/platform/android/Rhodes/AndroidManifest.full.xml +0 -62
- data/platform/android/Rhodes/gen/com/rhomobile/rhodes/Manifest.java +0 -14
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoActivity.java +0 -20
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +0 -193
- data/platform/bb/Hsqldb/src/com/rho/file/FileAccessBB.java +0 -25
- data/platform/bb/RubyVM/src/com/rho/AppBuildConfig.java +0 -22
- data/platform/bb/RubyVM/src/com/rho/Capabilities.java +0 -6
- data/platform/bb/RubyVM/src/com/rho/Extensions.java +0 -11
- data/platform/iphone/Classes/RhoNativeViewManager.mm +0 -226
@@ -48,16 +48,28 @@ public class NativeBar {
|
|
48
48
|
public void run() {
|
49
49
|
try {
|
50
50
|
RhodesService r = RhodesService.getInstance();
|
51
|
+
|
51
52
|
MainView mainView = r.getMainView();
|
52
53
|
MainView v = null;
|
53
54
|
|
55
|
+
SimpleMainView smv = null;
|
56
|
+
if (mainView instanceof SimpleMainView) {
|
57
|
+
smv = (SimpleMainView)mainView;
|
58
|
+
}
|
59
|
+
|
54
60
|
switch (type) {
|
55
61
|
case NOBAR_TYPE:
|
56
|
-
|
62
|
+
if (smv == null)
|
63
|
+
v = new SimpleMainView(mainView);
|
64
|
+
else
|
65
|
+
smv.removeToolbar();
|
57
66
|
started = false;
|
58
67
|
break;
|
59
68
|
case TOOLBAR_TYPE:
|
60
|
-
|
69
|
+
if (smv == null)
|
70
|
+
v = new SimpleMainView(mainView, params);
|
71
|
+
else
|
72
|
+
smv.setToolbar(params);
|
61
73
|
started = true;
|
62
74
|
break;
|
63
75
|
case TABBAR_TYPE:
|
@@ -68,8 +80,14 @@ public class NativeBar {
|
|
68
80
|
Logger.E(TAG, "Unknown bar type passed: " + type);
|
69
81
|
}
|
70
82
|
|
71
|
-
if (v != null)
|
83
|
+
if (v != null) {
|
72
84
|
r.setMainView(v);
|
85
|
+
if (v instanceof TabbedMainView) {
|
86
|
+
// loading of default opened tab should be after TabView insert to real Views tree
|
87
|
+
TabbedMainView tmv = (TabbedMainView)v;
|
88
|
+
tmv.loadFirstPage();
|
89
|
+
}
|
90
|
+
}
|
73
91
|
}
|
74
92
|
catch (Exception e) {
|
75
93
|
reportFail("CreateTask", e);
|
@@ -8,9 +8,21 @@ import android.util.Log;
|
|
8
8
|
|
9
9
|
public class PushReceiver extends BroadcastReceiver {
|
10
10
|
|
11
|
-
private static final String TAG =
|
11
|
+
private static final String TAG = PushReceiver.class.getSimpleName();
|
12
12
|
|
13
13
|
private static final String REG_ID = "registration_id";
|
14
|
+
|
15
|
+
public static final String INTENT_SOURCE = PushReceiver.class.getName();
|
16
|
+
|
17
|
+
private static final String INTENT_PREFIX = PushReceiver.class.getPackage().getName();
|
18
|
+
|
19
|
+
public static final String INTENT_TYPE = INTENT_PREFIX + ".type";
|
20
|
+
public static final String INTENT_REGISTRATION_ID = INTENT_PREFIX + ".registration_id";
|
21
|
+
public static final String INTENT_EXTRAS = INTENT_PREFIX + ".extras";
|
22
|
+
|
23
|
+
public static final int INTENT_TYPE_UNKNOWN = 0;
|
24
|
+
public static final int INTENT_TYPE_REGISTRATION_ID = 1;
|
25
|
+
public static final int INTENT_TYPE_MESSAGE = 2;
|
14
26
|
|
15
27
|
private void handleRegistration(Context context, Intent intent) {
|
16
28
|
String id = intent.getStringExtra(REG_ID);
|
@@ -23,26 +35,22 @@ public class PushReceiver extends BroadcastReceiver {
|
|
23
35
|
Log.d(TAG, "Unregistered: " + unregistered);
|
24
36
|
}
|
25
37
|
else if (id != null) {
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
return;
|
32
|
-
}
|
33
|
-
r.setPushRegistrationId(id);
|
38
|
+
Intent serviceIntent = new Intent(context, RhodesService.class);
|
39
|
+
serviceIntent.putExtra(RhodesService.INTENT_SOURCE, INTENT_SOURCE);
|
40
|
+
serviceIntent.putExtra(INTENT_TYPE, INTENT_TYPE_REGISTRATION_ID);
|
41
|
+
serviceIntent.putExtra(INTENT_REGISTRATION_ID, id);
|
42
|
+
context.startService(serviceIntent);
|
34
43
|
}
|
35
44
|
else
|
36
45
|
Log.w(TAG, "Unknown registration event");
|
37
46
|
}
|
38
47
|
|
39
48
|
private void handleMessage(Context context, Intent intent) {
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
r.handlePushMessage(intent);
|
49
|
+
Intent serviceIntent = new Intent(context, RhodesService.class);
|
50
|
+
serviceIntent.putExtra(RhodesService.INTENT_SOURCE, INTENT_SOURCE);
|
51
|
+
serviceIntent.putExtra(INTENT_TYPE, INTENT_TYPE_MESSAGE);
|
52
|
+
serviceIntent.putExtra(INTENT_EXTRAS, intent.getExtras());
|
53
|
+
context.startService(serviceIntent);
|
46
54
|
}
|
47
55
|
|
48
56
|
@Override
|
@@ -29,7 +29,7 @@ public class PushService {
|
|
29
29
|
|
30
30
|
Logger.D(TAG, "Register for PUSH messages (use \"" + Push.SENDER + "\" as sender)");
|
31
31
|
|
32
|
-
Context ctx = RhodesService.
|
32
|
+
Context ctx = RhodesService.getContext();
|
33
33
|
Intent registrationIntent = new Intent(C2DM_INTENT_PREFIX + "REGISTER");
|
34
34
|
registrationIntent.putExtra("app", PendingIntent.getBroadcast(ctx, 0, new Intent(), 0));
|
35
35
|
registrationIntent.putExtra("sender", Push.SENDER);
|
@@ -44,7 +44,7 @@ public class PushService {
|
|
44
44
|
|
45
45
|
Logger.D(TAG, "Unregister from PUSH messages");
|
46
46
|
|
47
|
-
Context ctx = RhodesService.
|
47
|
+
Context ctx = RhodesService.getContext();
|
48
48
|
Intent unregIntent = new Intent(C2DM_INTENT_PREFIX + "UNREGISTER");
|
49
49
|
unregIntent.putExtra("app", PendingIntent.getBroadcast(ctx, 0, new Intent(), 0));
|
50
50
|
ctx.startService(unregIntent);
|
@@ -0,0 +1,151 @@
|
|
1
|
+
package com.rhomobile.rhodes;
|
2
|
+
|
3
|
+
import java.security.SecureRandom;
|
4
|
+
import java.security.spec.AlgorithmParameterSpec;
|
5
|
+
|
6
|
+
import javax.crypto.Cipher;
|
7
|
+
import javax.crypto.KeyGenerator;
|
8
|
+
import javax.crypto.SecretKey;
|
9
|
+
import javax.crypto.spec.IvParameterSpec;
|
10
|
+
import javax.crypto.spec.SecretKeySpec;
|
11
|
+
import java.nio.ByteBuffer;
|
12
|
+
|
13
|
+
//import android.util.Base64;
|
14
|
+
import android.content.SharedPreferences;
|
15
|
+
import android.app.Activity;
|
16
|
+
import com.rhomobile.rhodes.Logger;
|
17
|
+
|
18
|
+
public class RhoCryptImpl
|
19
|
+
{
|
20
|
+
private static final String TAG = "RhoCryptJava";
|
21
|
+
|
22
|
+
byte[] m_dbKeyData;
|
23
|
+
String m_strDBPartition;
|
24
|
+
final String m_strPrefName = "rho_internal_data";
|
25
|
+
Cipher m_encryptCipher, m_decryptCipher;
|
26
|
+
final int m_nKeyLenBit = 128; // 192 and 256 bits may not be available
|
27
|
+
|
28
|
+
private void readKeyFromStorage()
|
29
|
+
{
|
30
|
+
SharedPreferences settings = RhodesActivity.getInstance().getSharedPreferences( m_strPrefName, Activity.MODE_PRIVATE);
|
31
|
+
String strOldKey = settings.getString(m_strDBPartition, "");
|
32
|
+
if ( strOldKey != null && strOldKey.length() > 0 )
|
33
|
+
{
|
34
|
+
m_dbKeyData = Base64.decode(strOldKey);//, Base64.DEFAULT);
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
private void generateNewKey()throws Exception
|
39
|
+
{
|
40
|
+
KeyGenerator kgen = KeyGenerator.getInstance("AES");
|
41
|
+
SecureRandom sr = SecureRandom.getInstance("SHA1PRNG");
|
42
|
+
kgen.init(m_nKeyLenBit, sr);
|
43
|
+
SecretKey skey = kgen.generateKey();
|
44
|
+
m_dbKeyData = skey.getEncoded();
|
45
|
+
}
|
46
|
+
|
47
|
+
private void writeKeyToStorage()
|
48
|
+
{
|
49
|
+
SharedPreferences settings = RhodesActivity.getInstance().getSharedPreferences(m_strPrefName, Activity.MODE_PRIVATE);
|
50
|
+
SharedPreferences.Editor editor = settings.edit();
|
51
|
+
String strKey = Base64.encodeToString(m_dbKeyData, false);//, Base64.DEFAULT);
|
52
|
+
editor.putString(m_strDBPartition, strKey );
|
53
|
+
editor.commit();
|
54
|
+
}
|
55
|
+
|
56
|
+
private void initKey(String szPartition)throws Exception
|
57
|
+
{
|
58
|
+
if ( m_dbKeyData != null )
|
59
|
+
return;
|
60
|
+
|
61
|
+
m_strDBPartition = szPartition;
|
62
|
+
|
63
|
+
readKeyFromStorage();
|
64
|
+
if ( m_dbKeyData != null )
|
65
|
+
return;
|
66
|
+
|
67
|
+
generateNewKey();
|
68
|
+
writeKeyToStorage();
|
69
|
+
}
|
70
|
+
|
71
|
+
private void initContext(String szPartition)throws Exception
|
72
|
+
{
|
73
|
+
if ( m_dbKeyData != null )
|
74
|
+
return;
|
75
|
+
|
76
|
+
initKey(szPartition);
|
77
|
+
|
78
|
+
byte[] iv = new byte[]
|
79
|
+
{
|
80
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
81
|
+
};
|
82
|
+
|
83
|
+
AlgorithmParameterSpec paramSpec = new IvParameterSpec(iv);
|
84
|
+
|
85
|
+
SecretKeySpec skeySpec = new SecretKeySpec(m_dbKeyData, "AES");
|
86
|
+
m_encryptCipher = Cipher.getInstance("AES/CBC/NoPadding");
|
87
|
+
m_encryptCipher.init(Cipher.ENCRYPT_MODE, skeySpec, paramSpec);
|
88
|
+
|
89
|
+
m_decryptCipher = Cipher.getInstance("AES/CBC/NoPadding");
|
90
|
+
m_decryptCipher.init(Cipher.DECRYPT_MODE, skeySpec, paramSpec);
|
91
|
+
|
92
|
+
}
|
93
|
+
|
94
|
+
private static void reportFail(String name, Exception e)
|
95
|
+
{
|
96
|
+
Logger.E(TAG, "Call of \"" + name + "\" failed: " + e.getMessage());
|
97
|
+
}
|
98
|
+
|
99
|
+
public boolean db_encrypt( String szPartition, ByteBuffer dataIn, ByteBuffer dataOut )
|
100
|
+
{
|
101
|
+
try
|
102
|
+
{
|
103
|
+
initContext(szPartition);
|
104
|
+
|
105
|
+
dataOut.rewind();
|
106
|
+
m_encryptCipher.doFinal(dataIn, dataOut);
|
107
|
+
|
108
|
+
return true;
|
109
|
+
}catch(Exception exc)
|
110
|
+
{
|
111
|
+
reportFail("db_encrypt", exc);
|
112
|
+
return false;
|
113
|
+
}
|
114
|
+
}
|
115
|
+
|
116
|
+
public boolean db_decrypt( String szPartition, ByteBuffer dataIn, ByteBuffer dataOut )
|
117
|
+
{
|
118
|
+
try
|
119
|
+
{
|
120
|
+
initContext(szPartition);
|
121
|
+
|
122
|
+
dataOut.rewind();
|
123
|
+
m_decryptCipher.doFinal(dataIn, dataOut);
|
124
|
+
|
125
|
+
return true;
|
126
|
+
}catch(Exception exc)
|
127
|
+
{
|
128
|
+
reportFail("db_encrypt", exc);
|
129
|
+
return false;
|
130
|
+
}
|
131
|
+
}
|
132
|
+
|
133
|
+
public boolean set_db_CryptKey( String szPartition, String szKey, boolean bPersistent )
|
134
|
+
{
|
135
|
+
m_strDBPartition = szPartition;
|
136
|
+
byte[] keyData = Base64.decode(szKey);//, Base64.DEFAULT);
|
137
|
+
|
138
|
+
if ( keyData.length != (m_nKeyLenBit/8))
|
139
|
+
{
|
140
|
+
reportFail("set_db_CryptKey", new Exception("Incorrect key size : " + keyData.length + "; Should be: " + (int)(m_nKeyLenBit/8)));
|
141
|
+
return false;
|
142
|
+
}
|
143
|
+
m_dbKeyData = keyData;
|
144
|
+
|
145
|
+
if ( bPersistent )
|
146
|
+
writeKeyToStorage();
|
147
|
+
|
148
|
+
return true;
|
149
|
+
}
|
150
|
+
|
151
|
+
}
|
@@ -68,7 +68,7 @@ public class RhoMenu {
|
|
68
68
|
mainView.reload(mainView.activeTab());
|
69
69
|
}
|
70
70
|
else if (type.equalsIgnoreCase("home")) {
|
71
|
-
mainView.navigate(
|
71
|
+
mainView.navigate(RhodesAppOptions.getStartUrl(), mainView.activeTab());
|
72
72
|
}
|
73
73
|
else if (type.equalsIgnoreCase("back")) {
|
74
74
|
mainView.back(mainView.activeTab());
|
@@ -77,7 +77,7 @@ public class RhoMenu {
|
|
77
77
|
mainView.forward(mainView.activeTab());
|
78
78
|
}
|
79
79
|
else if (type.equalsIgnoreCase("options")) {
|
80
|
-
mainView.navigate(
|
80
|
+
mainView.navigate(RhodesAppOptions.getOptionsUrl(), mainView.activeTab());
|
81
81
|
}
|
82
82
|
else if (type.equalsIgnoreCase("sync")) {
|
83
83
|
r.doSyncAllSources(true);
|
@@ -0,0 +1,372 @@
|
|
1
|
+
package com.rhomobile.rhodes;
|
2
|
+
|
3
|
+
import java.lang.reflect.Constructor;
|
4
|
+
|
5
|
+
import com.rhomobile.rhodes.bluetooth.RhoBluetoothManager;
|
6
|
+
import com.rhomobile.rhodes.mainview.MainView;
|
7
|
+
import com.rhomobile.rhodes.util.PerformOnUiThread;
|
8
|
+
import com.rhomobile.rhodes.webview.ChromeClientOld;
|
9
|
+
import com.rhomobile.rhodes.webview.RhoWebSettings;
|
10
|
+
|
11
|
+
import android.content.ComponentName;
|
12
|
+
import android.content.Context;
|
13
|
+
import android.content.Intent;
|
14
|
+
import android.content.ServiceConnection;
|
15
|
+
import android.graphics.Bitmap;
|
16
|
+
import android.os.Build;
|
17
|
+
import android.os.Bundle;
|
18
|
+
import android.os.Handler;
|
19
|
+
import android.os.IBinder;
|
20
|
+
import android.util.Log;
|
21
|
+
import android.view.KeyEvent;
|
22
|
+
import android.view.Menu;
|
23
|
+
import android.view.MenuItem;
|
24
|
+
import android.view.Window;
|
25
|
+
import android.view.WindowManager;
|
26
|
+
import android.webkit.WebChromeClient;
|
27
|
+
import android.webkit.WebView;
|
28
|
+
import android.webkit.WebViewClient;
|
29
|
+
|
30
|
+
public class RhodesActivity extends BaseActivity {
|
31
|
+
|
32
|
+
private static final String TAG = RhodesActivity.class.getSimpleName();
|
33
|
+
|
34
|
+
private static final boolean DEBUG = false;
|
35
|
+
|
36
|
+
public static boolean ENABLE_LOADING_INDICATION = true;
|
37
|
+
|
38
|
+
public static int MAX_PROGRESS = 10000;
|
39
|
+
|
40
|
+
static final String RHO_START_PARAMS_KEY = "RhoStartParams";
|
41
|
+
|
42
|
+
private static RhodesActivity sInstance;
|
43
|
+
|
44
|
+
private Handler mHandler;
|
45
|
+
|
46
|
+
private SplashScreen mSplashScreen;
|
47
|
+
|
48
|
+
private MainView mMainView;
|
49
|
+
|
50
|
+
private RhoMenu mAppMenu;
|
51
|
+
|
52
|
+
private WebChromeClient mChromeClient;
|
53
|
+
private WebViewClient mWebViewClient;
|
54
|
+
private RhoWebSettings mWebSettings;
|
55
|
+
|
56
|
+
private long uiThreadId = 0;
|
57
|
+
|
58
|
+
public long getUiThreadId() {
|
59
|
+
return uiThreadId;
|
60
|
+
}
|
61
|
+
|
62
|
+
private Runnable mSetup = new Runnable() {
|
63
|
+
public void run() {
|
64
|
+
doSetup();
|
65
|
+
}
|
66
|
+
};
|
67
|
+
|
68
|
+
@Override
|
69
|
+
protected void onCreate(Bundle savedInstanceState) {
|
70
|
+
super.onCreate(savedInstanceState);
|
71
|
+
|
72
|
+
Thread ct = Thread.currentThread();
|
73
|
+
//ct.setPriority(Thread.MAX_PRIORITY);
|
74
|
+
uiThreadId = ct.getId();
|
75
|
+
|
76
|
+
//requestWindowFeature(Window.FEATURE_NO_TITLE);
|
77
|
+
|
78
|
+
requestWindowFeature(Window.FEATURE_PROGRESS);
|
79
|
+
getWindow().setFeatureInt(Window.FEATURE_PROGRESS, 10000);
|
80
|
+
|
81
|
+
mSplashScreen = new SplashScreen(this);
|
82
|
+
setMainView(mSplashScreen);
|
83
|
+
|
84
|
+
mHandler = new Handler();
|
85
|
+
mHandler.post(mSetup);
|
86
|
+
|
87
|
+
sInstance = this;
|
88
|
+
|
89
|
+
RhodesService r = RhodesService.getInstance();
|
90
|
+
if ( r != null )
|
91
|
+
{
|
92
|
+
r.callUiCreatedCallback();
|
93
|
+
}else
|
94
|
+
{
|
95
|
+
mHandler.post(new Runnable() {
|
96
|
+
public void run() {
|
97
|
+
RhodesService r = RhodesService.getInstance();
|
98
|
+
if (r == null) {
|
99
|
+
// If there is no yet running RhodesService instance,
|
100
|
+
// try to do the same after 100ms
|
101
|
+
mHandler.postDelayed(this, 100);
|
102
|
+
return;
|
103
|
+
}
|
104
|
+
|
105
|
+
r.callUiCreatedCallback();
|
106
|
+
}
|
107
|
+
});
|
108
|
+
}
|
109
|
+
}
|
110
|
+
|
111
|
+
public static void setFullscreen(int enable) {
|
112
|
+
//Utils.platformLog(TAG, "setFullscreen("+String.valueOf(enable)+")");
|
113
|
+
final int en = enable;
|
114
|
+
PerformOnUiThread.exec( new Runnable() {
|
115
|
+
public void run() {
|
116
|
+
if (en != 0) {
|
117
|
+
getInstance().getWindow().clearFlags( WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
|
118
|
+
getInstance().getWindow().setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
119
|
+
}
|
120
|
+
else {
|
121
|
+
getInstance().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
122
|
+
getInstance().getWindow().setFlags( WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN, WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
|
123
|
+
}
|
124
|
+
}
|
125
|
+
}
|
126
|
+
, false);
|
127
|
+
}
|
128
|
+
|
129
|
+
@Override
|
130
|
+
public void onStart() {
|
131
|
+
super.onStart();
|
132
|
+
//sInstance = this;
|
133
|
+
}
|
134
|
+
|
135
|
+
@Override
|
136
|
+
public void onStop()
|
137
|
+
{
|
138
|
+
super.onStop();
|
139
|
+
|
140
|
+
RhodesService r = RhodesService.getInstance();
|
141
|
+
if (r != null)
|
142
|
+
r.callUiDestroyedCallback();
|
143
|
+
}
|
144
|
+
|
145
|
+
@Override
|
146
|
+
public void onDestroy() {
|
147
|
+
//RhodesService r = RhodesService.getInstance();
|
148
|
+
//if (r != null)
|
149
|
+
// r.callUiDestroyedCallback();
|
150
|
+
|
151
|
+
sInstance = null;
|
152
|
+
super.onDestroy();
|
153
|
+
}
|
154
|
+
|
155
|
+
@Override
|
156
|
+
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
157
|
+
switch (keyCode) {
|
158
|
+
case KeyEvent.KEYCODE_BACK:
|
159
|
+
RhodesService r = RhodesService.getInstance();
|
160
|
+
if (DEBUG)
|
161
|
+
Log.d(TAG, "onKeyDown: r=" + r);
|
162
|
+
if (r == null)
|
163
|
+
return false;
|
164
|
+
|
165
|
+
MainView v = r.getMainView();
|
166
|
+
v.back(v.activeTab());
|
167
|
+
return true;
|
168
|
+
}
|
169
|
+
|
170
|
+
return super.onKeyDown(keyCode, event);
|
171
|
+
}
|
172
|
+
|
173
|
+
@Override
|
174
|
+
public boolean onPrepareOptionsMenu(Menu menu) {
|
175
|
+
super.onPrepareOptionsMenu(menu);
|
176
|
+
mAppMenu = new RhoMenu(menu);
|
177
|
+
return true;
|
178
|
+
}
|
179
|
+
|
180
|
+
@Override
|
181
|
+
public boolean onOptionsItemSelected(MenuItem item) {
|
182
|
+
if (mAppMenu == null)
|
183
|
+
return false;
|
184
|
+
return mAppMenu.onMenuItemSelected(item);
|
185
|
+
}
|
186
|
+
|
187
|
+
public static RhodesActivity getInstance() {
|
188
|
+
return sInstance;
|
189
|
+
}
|
190
|
+
|
191
|
+
public RhodesService getService() {
|
192
|
+
return mRhodesService;
|
193
|
+
}
|
194
|
+
|
195
|
+
public void post(Runnable r) {
|
196
|
+
mHandler.post(r);
|
197
|
+
}
|
198
|
+
|
199
|
+
public void post(Runnable r, int delay) {
|
200
|
+
mHandler.postDelayed(r, delay);
|
201
|
+
}
|
202
|
+
|
203
|
+
private void doSetup() {
|
204
|
+
initWebStuff();
|
205
|
+
}
|
206
|
+
|
207
|
+
public SplashScreen getSplashScreen() {
|
208
|
+
return mSplashScreen;
|
209
|
+
}
|
210
|
+
|
211
|
+
public void setMainView(MainView v) {
|
212
|
+
setMainView(v, true);
|
213
|
+
}
|
214
|
+
|
215
|
+
public void setMainView(final MainView v, boolean waitUntilNavigationDone) {
|
216
|
+
if (DEBUG)
|
217
|
+
Log.d(TAG, "setMainView: v=" + v + "; mMainView=" + mMainView);
|
218
|
+
|
219
|
+
// If there's no previous mMainView, don't wait
|
220
|
+
if (mMainView == null)
|
221
|
+
waitUntilNavigationDone = false;
|
222
|
+
|
223
|
+
// Set mMainView right now but not yet do it visible
|
224
|
+
mMainView = v;
|
225
|
+
|
226
|
+
// This is action need to be executed when mMainView should become visible
|
227
|
+
final Runnable setMainViewVisible = new Runnable() {
|
228
|
+
public void run() {
|
229
|
+
if (DEBUG)
|
230
|
+
Log.d(TAG, "setMainViewAction: v=" + v);
|
231
|
+
setContentView(v.getView());
|
232
|
+
}
|
233
|
+
};
|
234
|
+
|
235
|
+
if (true/*!waitUntilNavigationDone*/) {
|
236
|
+
// Make new MainView visible right now
|
237
|
+
setMainViewVisible.run();
|
238
|
+
}
|
239
|
+
else {
|
240
|
+
// If we're requested to wait until first navigation will be done,
|
241
|
+
// use the trick: keep current main view until first navigate will be
|
242
|
+
// finished in the new MainView.
|
243
|
+
// This will end up in good user experience - user will see
|
244
|
+
// new MainView only when it will have completely load its content
|
245
|
+
// (no blank screens for user).
|
246
|
+
WebView webView = v.getWebView(0);
|
247
|
+
webView.setWebViewClient(new WebViewClient() {
|
248
|
+
@Override
|
249
|
+
public void onPageFinished(WebView view, String url) {
|
250
|
+
mWebViewClient.onPageFinished(view, url);
|
251
|
+
// Restore standard WebViewClient to be sure this callback will not
|
252
|
+
// be called anymore (it should be called only once)
|
253
|
+
view.setWebViewClient(mWebViewClient);
|
254
|
+
|
255
|
+
setMainViewVisible.run();
|
256
|
+
}
|
257
|
+
});
|
258
|
+
}
|
259
|
+
}
|
260
|
+
|
261
|
+
public MainView getMainView() {
|
262
|
+
return mMainView;
|
263
|
+
}
|
264
|
+
|
265
|
+
public WebView createWebView() {
|
266
|
+
WebView view = new WebView(this);
|
267
|
+
mWebSettings.setWebSettings(view);
|
268
|
+
view.setWebChromeClient(mChromeClient);
|
269
|
+
view.setWebViewClient(mWebViewClient);
|
270
|
+
view.clearCache(true);
|
271
|
+
|
272
|
+
return view;
|
273
|
+
}
|
274
|
+
|
275
|
+
private void initWebStuff() {
|
276
|
+
String ccName;
|
277
|
+
String wsName;
|
278
|
+
int sdkVersion = Integer.parseInt(Build.VERSION.SDK);
|
279
|
+
if (sdkVersion < Build.VERSION_CODES.ECLAIR_MR1) {
|
280
|
+
ccName = "ChromeClientOld";
|
281
|
+
wsName = "RhoWebSettingsOld";
|
282
|
+
}
|
283
|
+
else {
|
284
|
+
ccName = "ChromeClientNew";
|
285
|
+
wsName = "RhoWebSettingsNew";
|
286
|
+
}
|
287
|
+
|
288
|
+
try {
|
289
|
+
String pkgname = ChromeClientOld.class.getPackage().getName();
|
290
|
+
String fullName = pkgname + "." + ccName;
|
291
|
+
Class<? extends WebChromeClient> ccClass =
|
292
|
+
Class.forName(fullName).asSubclass(WebChromeClient.class);
|
293
|
+
|
294
|
+
Constructor<? extends WebChromeClient> ctor = ccClass.getConstructor(RhodesActivity.class);
|
295
|
+
mChromeClient = ctor.newInstance(this);
|
296
|
+
|
297
|
+
pkgname = RhoWebSettings.class.getPackage().getName();
|
298
|
+
fullName = pkgname + "." + wsName;
|
299
|
+
Class<? extends RhoWebSettings> wsClass =
|
300
|
+
Class.forName(fullName).asSubclass(RhoWebSettings.class);
|
301
|
+
mWebSettings = wsClass.newInstance();
|
302
|
+
|
303
|
+
mWebViewClient = new WebViewClient() {
|
304
|
+
@Override
|
305
|
+
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
306
|
+
return getService().handleUrlLoading(url);
|
307
|
+
}
|
308
|
+
|
309
|
+
@Override
|
310
|
+
public void onPageStarted(WebView view, String url, Bitmap favicon) {
|
311
|
+
if (ENABLE_LOADING_INDICATION)
|
312
|
+
getWindow().setFeatureInt(Window.FEATURE_PROGRESS, 0);
|
313
|
+
super.onPageStarted(view, url, favicon);
|
314
|
+
}
|
315
|
+
|
316
|
+
@Override
|
317
|
+
public void onPageFinished(WebView view, String url) {
|
318
|
+
// Set title
|
319
|
+
String title = view.getTitle();
|
320
|
+
setTitle(title);
|
321
|
+
if (ENABLE_LOADING_INDICATION)
|
322
|
+
getWindow().setFeatureInt(Window.FEATURE_PROGRESS, MAX_PROGRESS);
|
323
|
+
|
324
|
+
super.onPageFinished(view, url);
|
325
|
+
}
|
326
|
+
};
|
327
|
+
}
|
328
|
+
catch (Exception e) {
|
329
|
+
throw new IllegalStateException(e);
|
330
|
+
}
|
331
|
+
}
|
332
|
+
|
333
|
+
@Override
|
334
|
+
public void onServiceConnected(ComponentName name, IBinder service) {
|
335
|
+
super.onServiceConnected(name, service);
|
336
|
+
|
337
|
+
if (!isValidSecurityToken()) {
|
338
|
+
Logger.E(TAG, "This is hidden app and can be started only with security key.");
|
339
|
+
getRhodesApplication().exit();
|
340
|
+
return;
|
341
|
+
}
|
342
|
+
|
343
|
+
ENABLE_LOADING_INDICATION = !RhoConf.getBool("disable_loading_indication");
|
344
|
+
}
|
345
|
+
|
346
|
+
private boolean isValidSecurityToken()
|
347
|
+
{
|
348
|
+
String rho_start_params = "";
|
349
|
+
|
350
|
+
Object params = getIntent().getExtras();
|
351
|
+
if (params != null && params instanceof Bundle)
|
352
|
+
{
|
353
|
+
Bundle startParams = (Bundle)params;
|
354
|
+
rho_start_params = startParams.getString(RHO_START_PARAMS_KEY);
|
355
|
+
}
|
356
|
+
|
357
|
+
return RhodesService.canStartApp(rho_start_params, ", ");
|
358
|
+
}
|
359
|
+
|
360
|
+
public static Context getContext() {
|
361
|
+
RhodesActivity ra = RhodesActivity.getInstance();
|
362
|
+
if (ra == null)
|
363
|
+
throw new IllegalStateException("No rhodes activity instance at this moment");
|
364
|
+
return ra;
|
365
|
+
}
|
366
|
+
|
367
|
+
@Override
|
368
|
+
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
369
|
+
RhoBluetoothManager.onActivityResult(requestCode, resultCode, data);
|
370
|
+
}
|
371
|
+
|
372
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
package com.rhomobile.rhodes;
|
2
|
+
|
3
|
+
public class RhodesAppOptions {
|
4
|
+
|
5
|
+
public static native String getOptionsUrl();
|
6
|
+
public static native String getStartUrl();
|
7
|
+
public static native String getCurrentUrl();
|
8
|
+
public static native String getAppBackUrl();
|
9
|
+
public static native String getBlobPath();
|
10
|
+
|
11
|
+
}
|