rhodes 5.5.0.7 → 5.5.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +1 -1
  3. data/CREDITS +3 -3
  4. data/Rakefile +24 -0
  5. data/extensions/instrumentation/ext/platform/android/src/com/rho/instrumentation/Instrumentation.java +5 -0
  6. data/extensions/rhoconnect-push/ext/rhoconnect-push/platform/android/Rakefile +1 -1
  7. data/lib/build/jake.rb +5 -0
  8. data/lib/commonAPI/clipboard/ext.yml +17 -0
  9. data/lib/commonAPI/clipboard/ext/Clipboard.xml +49 -0
  10. data/lib/commonAPI/clipboard/ext/build +19 -0
  11. data/lib/commonAPI/clipboard/ext/build.bat +29 -0
  12. data/lib/commonAPI/clipboard/ext/platform/android/Rakefile +141 -0
  13. data/lib/commonAPI/clipboard/ext/platform/android/ext_java.files +9 -0
  14. data/lib/commonAPI/clipboard/ext/platform/android/ext_native.files +7 -0
  15. data/lib/commonAPI/clipboard/ext/platform/android/jni/Clipboard_impl.cpp +61 -0
  16. data/lib/commonAPI/clipboard/ext/platform/android/src/com/rho/clipboard/Clipboard.java +15 -0
  17. data/lib/commonAPI/clipboard/ext/platform/android/src/com/rho/clipboard/ClipboardFactory.java +18 -0
  18. data/lib/commonAPI/clipboard/ext/platform/android/src/com/rho/clipboard/ClipboardSingleton.java +146 -0
  19. data/lib/commonAPI/clipboard/ext/platform/iphone/Clipboard.xcodeproj/project.pbxproj +368 -0
  20. data/lib/commonAPI/clipboard/ext/platform/iphone/Clipboard_Prefix.pch +7 -0
  21. data/lib/commonAPI/clipboard/ext/platform/iphone/Rakefile +73 -0
  22. data/lib/commonAPI/clipboard/ext/platform/iphone/impl/Clipboard.h +11 -0
  23. data/lib/commonAPI/clipboard/ext/platform/iphone/impl/Clipboard.m +12 -0
  24. data/lib/commonAPI/clipboard/ext/platform/iphone/impl/ClipboardFactorySingleton.m +16 -0
  25. data/lib/commonAPI/clipboard/ext/platform/iphone/impl/ClipboardSetup.m +9 -0
  26. data/lib/commonAPI/clipboard/ext/platform/iphone/impl/ClipboardSingleton.h +18 -0
  27. data/lib/commonAPI/clipboard/ext/platform/iphone/impl/ClipboardSingleton.m +43 -0
  28. data/lib/commonAPI/clipboard/ext/platform/iphone/impl/readme.txt +7 -0
  29. data/lib/commonAPI/coreapi/ext/NativeTabbar.xml +3 -3
  30. data/lib/commonAPI/coreapi/ext/shared/TimerImpl.cpp +36 -27
  31. data/lib/commonAPI/coreapi/public/api/rhoapi-force.ajax.js +3 -1
  32. data/lib/commonAPI/coreapi/public/api/rhoapi.js +2 -1
  33. data/lib/commonAPI/devicesecurity/ext.yml +11 -0
  34. data/lib/commonAPI/devicesecurity/ext/DeviceSecurity.xml +91 -0
  35. data/lib/commonAPI/devicesecurity/ext/build +19 -0
  36. data/lib/commonAPI/devicesecurity/ext/build.bat +29 -0
  37. data/lib/commonAPI/devicesecurity/ext/platform/android/InbuiltValues.erb +16 -0
  38. data/lib/commonAPI/devicesecurity/ext/platform/android/Rakefile +166 -0
  39. data/lib/commonAPI/devicesecurity/ext/platform/android/ext_java.files +10 -0
  40. data/lib/commonAPI/devicesecurity/ext/platform/android/ext_native.files +7 -0
  41. data/lib/commonAPI/devicesecurity/ext/platform/android/jni/DeviceSecurity_impl.cpp +61 -0
  42. data/lib/commonAPI/devicesecurity/ext/platform/android/src/com/rho/devicesecurity/DeviceSecurity.java +14 -0
  43. data/lib/commonAPI/devicesecurity/ext/platform/android/src/com/rho/devicesecurity/DeviceSecurityFactory.java +18 -0
  44. data/lib/commonAPI/devicesecurity/ext/platform/android/src/com/rho/devicesecurity/DeviceSecuritySingleton.java +412 -0
  45. data/lib/commonAPI/devicesecurity/ext/platform/iphone/DeviceSecurity.xcodeproj/project.pbxproj +368 -0
  46. data/lib/commonAPI/devicesecurity/ext/platform/iphone/DeviceSecurity_Prefix.pch +7 -0
  47. data/lib/commonAPI/devicesecurity/ext/platform/iphone/Rakefile +73 -0
  48. data/lib/commonAPI/devicesecurity/ext/platform/iphone/impl/DeviceSecurity.h +11 -0
  49. data/lib/commonAPI/devicesecurity/ext/platform/iphone/impl/DeviceSecurity.m +12 -0
  50. data/lib/commonAPI/devicesecurity/ext/platform/iphone/impl/DeviceSecurityFactorySingleton.m +16 -0
  51. data/lib/commonAPI/devicesecurity/ext/platform/iphone/impl/DeviceSecuritySetup.m +9 -0
  52. data/lib/commonAPI/devicesecurity/ext/platform/iphone/impl/DeviceSecuritySingleton.h +19 -0
  53. data/lib/commonAPI/devicesecurity/ext/platform/iphone/impl/DeviceSecuritySingleton.m +106 -0
  54. data/lib/commonAPI/devicesecurity/ext/platform/iphone/impl/readme.txt +7 -0
  55. data/platform/android/Rhodes/src/com/rhomobile/rhodes/LocalFileProvider.java +5 -1
  56. data/platform/android/Rhodes/src/com/rhomobile/rhodes/util/Utils.java +9 -0
  57. data/platform/android/build/android.rake +42 -1
  58. data/platform/android/build/androidcommon.rb +4 -2
  59. data/platform/iphone/Classes/RhoWKWebView.m +4 -0
  60. data/platform/iphone/Classes/URLProtocol/CRhoURLProtocol.h +2 -0
  61. data/platform/iphone/Classes/URLProtocol/CRhoURLProtocol.m +195 -30
  62. data/platform/iphone/Classes/rho/net/IPhoneNetRequest.mm +91 -4
  63. data/platform/iphone/rbuild/iphone.rake +297 -231
  64. data/platform/iphone/rbuild/putsOverride.rake +8 -0
  65. data/platform/shared/common/RhoTime.cpp +81 -40
  66. data/platform/shared/common/RhodesApp.cpp +16 -18
  67. data/platform/shared/db/DBAdapter.cpp +33 -0
  68. data/platform/shared/db/DBAdapter.h +5 -0
  69. data/platform/shared/net/HttpServer.cpp +27 -1
  70. data/platform/shared/net/INetRequest.cpp +33 -6
  71. data/platform/shared/qt/rhodes/qkineticscroller.cpp +2 -2
  72. data/platform/shared/qt/rhodes/qkineticscroller_p.h +1 -1
  73. data/platform/shared/qt/rhodes/qtscrollerfilter.cpp +3 -3
  74. data/platform/shared/qt/rhodes/qtscrollevent.cpp +2 -2
  75. data/platform/shared/qt/rhodes/qwebviewkineticscroller.cpp +1 -1
  76. data/platform/shared/qt/rhodes/qwebviewkineticscroller.h +1 -1
  77. data/platform/wm/build/wm.rake +7 -3
  78. data/platform/wm/rhodes/browser/BrowserFactory.cpp +4 -6
  79. data/platform/wm/rhodes/browser/stubs.cpp +5 -0
  80. data/platform/wm/rhodes/rhodes.vcproj +31 -2
  81. data/rakefile.rb +24 -0
  82. data/res/generators/templates/application/app/Settings/home.erb +1 -1
  83. data/res/generators/templates/application/build.yml +61 -4
  84. data/res/generators/templates/application/icon/icon.png +0 -0
  85. data/res/generators/templates/application/icon/icon114.png +0 -0
  86. data/res/generators/templates/application/icon/icon120.png +0 -0
  87. data/res/generators/templates/application/icon/icon144.png +0 -0
  88. data/res/generators/templates/application/icon/icon152.png +0 -0
  89. data/res/generators/templates/application/icon/icon180.png +0 -0
  90. data/res/generators/templates/application/icon/icon57.png +0 -0
  91. data/res/generators/templates/application/icon/icon60.png +0 -0
  92. data/res/generators/templates/application/icon/icon72.png +0 -0
  93. data/res/generators/templates/application/icon/icon76.png +0 -0
  94. data/res/generators/templates/application/production/iTunesArtwork.png +0 -0
  95. data/res/generators/templates/application/production/iTunesArtwork@2x.png +0 -0
  96. data/res/generators/templates/iphone_project/Bremen7.xcodeproj/project.pbxproj +1 -0
  97. data/res/generators/templates/iphone_project/buildRhoBundle +23 -7
  98. data/res/generators/templates/iphone_project/root/Info.plist +0 -2
  99. data/res/generators/templates/iphone_project/root/iTunesArtwork +0 -0
  100. data/res/generators/templates/iphone_project/root/iTunesArtwork@2x +0 -0
  101. data/res/generators/templates/iphone_project/root/icon114.png +0 -0
  102. data/res/generators/templates/iphone_project/root/icon120.png +0 -0
  103. data/res/generators/templates/iphone_project/root/icon144.png +0 -0
  104. data/res/generators/templates/iphone_project/root/icon152.png +0 -0
  105. data/res/generators/templates/iphone_project/root/icon180.png +0 -0
  106. data/res/generators/templates/iphone_project/root/icon57.png +0 -0
  107. data/res/generators/templates/iphone_project/root/icon60.png +0 -0
  108. data/res/generators/templates/iphone_project/root/icon72.png +0 -0
  109. data/res/generators/templates/iphone_project/root/icon76.png +0 -0
  110. data/res/generators/templates/iphone_project/root/rhorunner_development.entitlements +6 -0
  111. data/rhodes.gemspec +19 -17
  112. data/version +1 -1
  113. metadata +118 -44
@@ -0,0 +1,7 @@
1
+ //
2
+ // Prefix header for all source files of the 'CocoaTouchStaticLibrary' target in the 'CocoaTouchStaticLibrary' project.
3
+ //
4
+
5
+ #ifdef __OBJC__
6
+ #import <Foundation/Foundation.h>
7
+ #endif
@@ -0,0 +1,73 @@
1
+ require 'fileutils'
2
+
3
+ USE_STLPORT = true
4
+
5
+ puts "clipboard extension !"
6
+
7
+ namespace "build" do
8
+
9
+ task :config do
10
+
11
+ $targetdir = ENV['TARGET_TEMP_DIR']
12
+ raise "TARGET_TEMP_DIR is not set" if $targetdir.nil?
13
+
14
+ $tempdir = ENV['TEMP_FILES_DIR']
15
+ raise "TEMP_FILES_DIR is not set" if $tempdir.nil?
16
+
17
+ $rootdir = ENV['RHO_ROOT']
18
+ raise "RHO_ROOT is not set" if $rootdir.nil?
19
+
20
+ $xcodebuild = ENV['XCODEBUILD']
21
+ raise "XCODEBUILD is not set" if $xcodebuild.nil?
22
+
23
+ $configuration = ENV['CONFIGURATION']
24
+ raise "CONFIGURATION is not set" if $configuration.nil?
25
+
26
+ $sdk = ENV['SDK_NAME']
27
+ raise "SDK_NAME is not set" if $sdk.nil?
28
+
29
+ $bindir = ENV['PLATFORM_DEVELOPER_BIN_DIR']
30
+ raise "PLATFORM_DEVELOPER_BIN_DIR is not set" if $bindir.nil?
31
+
32
+ $sdkroot = ENV['SDKROOT']
33
+ raise "SDKROOT is not set" if $sdkroot.nil?
34
+
35
+ $arch = ENV['ARCHS']
36
+ raise "ARCHS is not set" if $arch.nil?
37
+
38
+ $gccbin = $bindir + '/gcc-4.2'
39
+ $arbin = $bindir + '/ar'
40
+
41
+ end
42
+
43
+ task :all => :config do
44
+
45
+ iphone_path = '.'
46
+
47
+ simulator = $sdk =~ /iphonesimulator/
48
+
49
+ if $configuration == 'Distribution'
50
+ $configuration = 'Release'
51
+ end
52
+
53
+ result_lib = iphone_path + '/build/' + $configuration + '-' + ( simulator ? "iphonesimulator" : "iphoneos") + '/libClipboard.a'
54
+ target_lib = $targetdir + '/libClipboard.a'
55
+
56
+ rm_rf 'build'
57
+ rm_rf target_lib
58
+
59
+ args = ['build', '-target', 'Clipboard', '-configuration', $configuration, '-sdk', $sdk]
60
+
61
+ require File.join(ENV['RHO_ROOT'], 'platform','iphone','rbuild','iphonecommon')
62
+
63
+ ret = IPhoneBuild.run_and_trace($xcodebuild,args)
64
+
65
+ # copy result to $targetdir
66
+ cp result_lib,target_lib
67
+
68
+ end
69
+
70
+
71
+ end
72
+
73
+ task :default => "build:all"
@@ -0,0 +1,11 @@
1
+
2
+ #import "IClipboard.h"
3
+ #import "ClipboardBase.h"
4
+
5
+ @interface Clipboard : ClipboardBase<IClipboard> {
6
+ }
7
+
8
+
9
+
10
+
11
+ @end
@@ -0,0 +1,12 @@
1
+
2
+ #import "Clipboard.h"
3
+
4
+
5
+ @implementation Clipboard
6
+
7
+
8
+
9
+
10
+
11
+
12
+ @end
@@ -0,0 +1,16 @@
1
+
2
+ #import "IClipboard.h"
3
+ #import "ClipboardFactoryBase.h"
4
+
5
+ static ClipboardFactoryBase* ourClipboardFactory = nil;
6
+
7
+ @implementation ClipboardFactorySingleton
8
+
9
+ +(id<IClipboardFactory>) getClipboardFactoryInstance {
10
+ if (ourClipboardFactory == nil) {
11
+ ourClipboardFactory = [[ClipboardFactoryBase alloc] init];
12
+ }
13
+ return ourClipboardFactory;
14
+ }
15
+
16
+ @end
@@ -0,0 +1,9 @@
1
+ #import <Foundation/Foundation.h>
2
+ #include "common/app_build_capabilities.h"
3
+
4
+ extern void Init_Clipboard_API();
5
+
6
+ void Init_Clipboard_extension()
7
+ {
8
+ Init_Clipboard_API();
9
+ }
@@ -0,0 +1,18 @@
1
+
2
+ #import "IClipboard.h"
3
+ #import "ClipboardSingletonBase.h"
4
+
5
+ @interface ClipboardSingleton : ClipboardSingletonBase<IClipboardSingleton> {
6
+ }
7
+
8
+
9
+
10
+ -(void) getText:(id<IMethodResult>)methodResult;
11
+ -(void) hasText:(id<IMethodResult>)methodResult;
12
+ -(void) setText:(NSString*)text methodResult:(id<IMethodResult>)methodResult;
13
+ -(void) clear:(id<IMethodResult>)methodResult;
14
+
15
+
16
+
17
+
18
+ @end
@@ -0,0 +1,43 @@
1
+
2
+ #import "ClipboardSingleton.h"
3
+ #import <UIKit/UIKit.h>
4
+
5
+ @implementation ClipboardSingleton
6
+
7
+
8
+
9
+ -(void) getText:(id<IMethodResult>)methodResult {
10
+ UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
11
+ if (pasteboard.hasStrings) {
12
+ NSString* text = pasteboard.string;
13
+ [methodResult setResult:text];
14
+ }
15
+ else {
16
+ [methodResult setResult:[NSNull null]];
17
+ }
18
+ }
19
+
20
+ -(void) hasText:(id<IMethodResult>)methodResult {
21
+ UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
22
+ if (pasteboard.hasStrings) {
23
+ [methodResult setResult:[NSNumber numberWithBool:YES]];
24
+ }
25
+ else {
26
+ [methodResult setResult:[NSNumber numberWithBool:NO]];
27
+ }
28
+ }
29
+
30
+ -(void) setText:(NSString*)text methodResult:(id<IMethodResult>)methodResult {
31
+ UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
32
+ pasteboard.string = text;
33
+ }
34
+
35
+ -(void) clear:(id<IMethodResult>)methodResult {
36
+ UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
37
+ [pasteboard setValue:@"" forPasteboardType:UIPasteboardNameGeneral];
38
+ }
39
+
40
+
41
+
42
+
43
+ @end
@@ -0,0 +1,7 @@
1
+ contains files with module API Implementation.
2
+
3
+ Developer should create it - after first generation this folder is empty and this folder do not changed with next generation processes !!!.
4
+
5
+ Developer should make at least <ModuleName>FactorySingleton.m with acees to <ModuleName>Factory interface!
6
+ All other files include base_impl can be removed from project if it wants by developer.
7
+ Default stub generated code placed in stub_impl folder - you can just copy all files from /generated/stub_impl to this folder and implement unemplemented methods.
@@ -15,7 +15,7 @@ Be sure to review the [JavaScript API Usage](/guide/api_js) guide for important
15
15
  ## Ruby Usage
16
16
  Be sure to review the [Ruby API Usage](/guide/api_ruby) guide for important information about using this API in Ruby.
17
17
  </MORE_HELP>
18
-
18
+
19
19
  <TEMPLATES>
20
20
  </TEMPLATES>
21
21
 
@@ -37,13 +37,13 @@ Be sure to review the [Ruby API Usage](/guide/api_ruby) guide for important info
37
37
  <DESC>Properties of Tab elements.</DESC>
38
38
  <PARAMS>
39
39
  <PARAM name="label" type="STRING">
40
- <DESC>Visible label to display on the tabbar.</DESC>
40
+ <DESC>Visible label to display on the tabbar. Label is required property. If you do not want to display label - set it to empty string.</DESC>
41
41
  </PARAM>
42
42
  <PARAM name="action" type="STRING" rhoAction="true">
43
43
  <DESC>URL to page which will be loaded into tab. Predefined actions are not supported. It may be path to Ruby controller action; i.e. '/app/Account' would load the Account index action. For ruby callback use 'callback:/app/Account' Or javascript method to call: 'javascript: methodOnTab();'. Or path to html page to load.</DESC>
44
44
  </PARAM>
45
45
  <PARAM name="icon" type="STRING">
46
- <DESC>Relative path to tabbar item icon in your application; typically located in /public/images/.</DESC>
46
+ <DESC>Relative path to tabbar item icon in your application; typically located in /public/images/. iPhone and Android: Icons must be no more than 30x30 pixels and must be in .png format.</DESC>
47
47
  <PLATFORM>Win32, Android, iOS, WP8</PLATFORM>
48
48
  </PARAM>
49
49
  <PARAM name="reload" type="BOOLEAN" default="false">
@@ -11,35 +11,41 @@
11
11
 
12
12
  extern "C" void rho_ios_log_console_output(const char* message);
13
13
 
14
- namespace rho
15
- {
14
+
15
+
16
+ #undef DEFAULT_LOGCATEGORY
17
+ #define DEFAULT_LOGCATEGORY "TimerImpl"
18
+
19
+
20
+ namespace rho
21
+ {
16
22
  class CTimerFactory;
17
23
 
18
24
  using namespace apiGenerator;
19
25
  using namespace common;
20
-
26
+
21
27
  class CTimerSingletonImpl: public CTimerSingletonBase
22
28
  {
23
29
  static unsigned int createdTimers;
24
30
 
25
31
  public:
26
-
32
+
27
33
  CTimerSingletonImpl(): CTimerSingletonBase(){}
28
-
34
+
29
35
  //methods
30
- // create Create a timers objects.
31
- virtual void create(rho::apiGenerator::CMethodResult& oResult)
36
+ // create Create a timers objects.
37
+ virtual void create(rho::apiGenerator::CMethodResult& oResult)
32
38
  {
33
39
  ++createdTimers;
34
40
 
35
41
  char buf[10];
36
42
  sprintf(buf, "%d", createdTimers);
37
43
  oResult.set(buf);
38
- }
39
- // enumerate This is documentation
40
- virtual void enumerate(rho::apiGenerator::CMethodResult& oResult) { }
44
+ }
45
+ // enumerate This is documentation
46
+ virtual void enumerate(rho::apiGenerator::CMethodResult& oResult) { }
41
47
  };
42
-
48
+
43
49
  unsigned int CTimerSingletonImpl::createdTimers = 0;
44
50
 
45
51
  class CTimerImpl : public CTimerBase, public common::CRhoTimer::ICallback
@@ -55,7 +61,7 @@ namespace rho
55
61
 
56
62
  virtual void run()
57
63
  {
58
-
64
+
59
65
  while ( !RHODESAPP().isApplicationActive() ) {
60
66
  wait(10);
61
67
  }
@@ -71,37 +77,40 @@ namespace rho
71
77
 
72
78
  public:
73
79
  CTimerImpl(const rho::String& timerID) : m_timerID(timerID), m_answerThread(0) {}
74
- virtual ~CTimerImpl()
80
+ virtual ~CTimerImpl()
75
81
  {
76
82
  if (!m_answerThread)
77
83
  delete m_answerThread;
78
84
  }
79
85
 
80
86
  //methods
81
- virtual void start( int interval, rho::apiGenerator::CMethodResult& oResult)
87
+ virtual void start( int interval, rho::apiGenerator::CMethodResult& oResult)
82
88
  {
83
89
  if (interval <= 0)
84
90
  {
91
+ LOG(ERROR) + "$NetRequestProcess$ PRE SET ERROR CTimerImpl::start";
85
92
  oResult.setError("invalid interval");
86
- return;
93
+ LOG(ERROR) + "$NetRequestProcess$ POST SET ERROR CTimerImpl::start";
94
+
95
+ return;
87
96
  }
88
97
 
89
98
  m_oResult = oResult;
90
99
  common::CRhoTimer& timerManager = RHODESAPP().getTimer();
91
100
  timerManager.addNativeTimer(interval, this);
92
- }
101
+ }
93
102
 
94
103
  virtual void stop(rho::apiGenerator::CMethodResult& oResult)
95
104
  {
96
105
  common::CRhoTimer& timerManager = RHODESAPP().getTimer();
97
106
  timerManager.stopNativeTimer(this);
98
- }
107
+ }
99
108
 
100
- virtual void isAlive(rho::apiGenerator::CMethodResult& oResult)
109
+ virtual void isAlive(rho::apiGenerator::CMethodResult& oResult)
101
110
  {
102
111
  common::CRhoTimer& timerManager = RHODESAPP().getTimer();
103
112
  oResult.set(timerManager.isNativeTimerExist(this));
104
- }
113
+ }
105
114
 
106
115
  virtual bool onTimer()
107
116
  {
@@ -114,20 +123,20 @@ namespace rho
114
123
  return true;
115
124
  }
116
125
  };
117
-
126
+
118
127
  ////////////////////////////////////////////////////////////////////////
119
-
120
- class CTimerFactory: public CTimerFactoryBase
128
+
129
+ class CTimerFactory: public CTimerFactoryBase
121
130
  {
122
131
  public:
123
132
  CTimerFactory(){}
124
-
133
+
125
134
  ITimerSingleton* createModuleSingleton()
126
- {
135
+ {
127
136
  return new CTimerSingletonImpl();
128
137
  }
129
-
130
- virtual ITimer* createModuleByID(const rho::String& strID){
138
+
139
+ virtual ITimer* createModuleByID(const rho::String& strID){
131
140
  return new CTimerImpl(strID);
132
141
  };
133
142
 
@@ -136,7 +145,7 @@ namespace rho
136
145
  return m_hashModules.size();
137
146
  }
138
147
  };
139
-
148
+
140
149
  }
141
150
 
142
151
  extern "C" void Init_Timer_extension()
@@ -11,6 +11,8 @@
11
11
  (function ($, rho, rhoPlatform, rhoUtil) {
12
12
  'use strict';
13
13
 
14
- window[rhoUtil.flag.NATIVE_BRIDGE_TYPE] = window[rhoUtil.flag.NATIVE_BRIDGE_TYPE] || rhoPlatform.id.AJAX;
14
+ //window[rhoUtil.flag.NATIVE_BRIDGE_TYPE] = window[rhoUtil.flag.NATIVE_BRIDGE_TYPE] || rhoPlatform.id.AJAX;
15
+ window[rhoUtil.flag.NATIVE_BRIDGE_TYPE] = rhoPlatform.id.AJAX;
16
+
15
17
 
16
18
  })(Rho.jQuery, Rho, Rho.platform, Rho.util);
@@ -194,6 +194,7 @@ var Rho = Rho || (function ($) {
194
194
 
195
195
  // === Core parts ============================================================
196
196
 
197
+ var baseCallbackId = new Date().valueOf();
197
198
  var idCount = 0;
198
199
  var pendingCallbacks = {};
199
200
 
@@ -208,7 +209,7 @@ var Rho = Rho || (function ($) {
208
209
  if ('undefined' == typeof tag || !tag)
209
210
  tag = RHO_ID_PARAM;
210
211
 
211
- return (tag + '#' + idCount++);
212
+ return (tag + '#' + baseCallbackId + idCount++);
212
213
  }
213
214
 
214
215
  function toBool(value) {
@@ -0,0 +1,11 @@
1
+ entry: Init_DeviceSecurity_extension
2
+ javaentry: com.devicesecurity.DeviceSecurity
3
+ libraries: ["DeviceSecurity"]
4
+ android:
5
+ source_list: ext/platform/android/ext_java.files
6
+ exttype: rakefile
7
+ prebuild_rake_task: 'generate_inbuilt_values'
8
+
9
+ xml_api_paths: ext/DeviceSecurity.xml
10
+
11
+ platforms: ["iphone", "android"]
@@ -0,0 +1,91 @@
1
+ <?xml version = "1.0"?>
2
+ <?xml-stylesheet type="text/xsl" href="pb_help.xsl"?>
3
+ <API>
4
+ <MODULE name="DeviceSecurity" parent="Rho">
5
+ <HELP_OVERVIEW>Device Security API</HELP_OVERVIEW>
6
+ <MORE_HELP>API for check device securty (JailBrake for iOS, root for Android etc.)</MORE_HELP>
7
+
8
+ <TEMPLATES>
9
+ </TEMPLATES>
10
+
11
+ <PROPERTIES >
12
+ </PROPERTIES>
13
+
14
+ <METHODS>
15
+
16
+ <METHOD name="isDeviceSecured" access="STATIC" >
17
+ <DESC>return true is device secured. On iOS checked - device is not JailBraked, on Android checked - device is not rooted + is not simulator + not in debug mode</DESC>
18
+ <PLATFORM>iOS, Android</PLATFORM>
19
+ <RETURN type="BOOLEAN"/>
20
+ </METHOD>
21
+
22
+ <METHOD name="isDeviceJailbroken" access="STATIC" >
23
+ <DESC>return true if device Jailbroken</DESC>
24
+ <PLATFORM>iOS</PLATFORM>
25
+ <RETURN type="BOOLEAN"/>
26
+ </METHOD>
27
+
28
+ <METHOD name="isDeviceRooted" access="STATIC" >
29
+ <DESC>return true if device rooted</DESC>
30
+ <PLATFORM>Android</PLATFORM>
31
+ <RETURN type="BOOLEAN"/>
32
+ </METHOD>
33
+
34
+ <METHOD name="isRunOnSimulator" access="STATIC" >
35
+ <DESC>return true if application run on simulator</DESC>
36
+ <PLATFORM>Android</PLATFORM>
37
+ <RETURN type="BOOLEAN"/>
38
+ </METHOD>
39
+
40
+ <METHOD name="isDebugMode" access="STATIC" >
41
+ <DESC>return true if application run in Debug mode</DESC>
42
+ <PLATFORM>Android</PLATFORM>
43
+ <RETURN type="BOOLEAN"/>
44
+ </METHOD>
45
+
46
+ <METHOD name="getAppCertificateSignatures" access="STATIC" >
47
+ <DESC>Returns application certificates signatures.</DESC>
48
+ <PLATFORM>Android</PLATFORM>
49
+ <RETURN type="ARRAY"/>
50
+ </METHOD>
51
+
52
+ <METHOD name="getAllowedCertificateSignatures" access="STATIC" >
53
+ <DESC>Returns allowed certificates signatures inbuilt to application.</DESC>
54
+ <PLATFORM>Android</PLATFORM>
55
+ <RETURN type="ARRAY"/>
56
+ </METHOD>
57
+
58
+ <METHOD name="haveAnySignatureIssues" access="STATIC" >
59
+ <DESC>Checks if there are mismatches between allowed and runtime certificates.</DESC>
60
+ <PLATFORM>Android</PLATFORM>
61
+ <RETURN type="BOOLEAN"/>
62
+ </METHOD>
63
+
64
+ <METHOD name="getInstallerPackageName" access="STATIC" >
65
+ <DESC>Returns application installer package name.</DESC>
66
+ <PLATFORM>Android</PLATFORM>
67
+ <RETURN type="STRING"/>
68
+ </METHOD>
69
+
70
+ <METHOD name="haveAnyInstallerIssues" access="STATIC" >
71
+ <DESC>Checks if there are mismatches between allowed and runtime installer packages.</DESC>
72
+ <PLATFORM>Android</PLATFORM>
73
+ <RETURN type="BOOLEAN"/>
74
+ </METHOD>
75
+
76
+ <METHOD name="getAllowedInstallerPackages" access="STATIC" >
77
+ <DESC>Returns allowed installer package names inbuilt to application.</DESC>
78
+ <PLATFORM>Android</PLATFORM>
79
+ <RETURN type="ARRAY"/>
80
+ </METHOD>
81
+
82
+ </METHODS>
83
+
84
+ <USER_OVERVIEW>
85
+ </USER_OVERVIEW>
86
+
87
+ <VER_INTRODUCED>1.0.0</VER_INTRODUCED>
88
+ <PLATFORM>
89
+ </PLATFORM>
90
+ </MODULE>
91
+ </API>