rhodes 3.2.2 → 3.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ ## 3.2.3
2
+ * Fix Blob sync issue in Rhoconnect-client
3
+ * Fix logging issue on iPhone and Android
4
+ * Fix Cookie issue on Windows phone 7
5
+ * Implement Security token ruby callback
6
+
1
7
  ## 3.2.2
2
8
  * Fix iPhone build for AppStore
3
9
  * Fix Android infinite loop while using GPS
@@ -114,8 +114,23 @@ module Rho
114
114
  start_url = Rho::RhoConfig.start_path
115
115
  start_url = "" unless start_url
116
116
 
117
+ security_token_not_passed = System.get_property('security_token_not_passed')
118
+ security_token_not_passed = false if security_token_not_passed.nil?
119
+ invalid_security_token_start_path_exist = Rho::RhoConfig.exists? 'invalid_security_token_start_path'
120
+ invalid_security_token_start_path = Rho::RhoConfig.invalid_security_token_start_path
121
+
122
+ if security_token_not_passed
123
+ if invalid_security_token_start_path_exist
124
+ start_url = invalid_security_token_start_path
125
+ else
126
+ # exit from application - old way
127
+ puts 'security_token is not passed - application will closed'
128
+ System.exit
129
+ end
130
+ end
131
+
117
132
  puts "on_ui_created.navigate to start url: '#{start_url}'"
118
- WebView.navigate(start_url)
133
+ WebView.navigate(start_url)
119
134
  end
120
135
 
121
136
  def on_ui_destroyed
@@ -518,7 +518,7 @@ public class RhodesActivity extends BaseActivity {
518
518
  if(!RhodesApplication.canStart(paramString))
519
519
  {
520
520
  Logger.E(TAG, "This is hidden app and can be started only with security key.");
521
- RhodesService.exit();
521
+ //RhodesService.exit();
522
522
  return;
523
523
  }
524
524
 
@@ -51,6 +51,7 @@ public class RhodesApp
51
51
  Mutex m_mxScreenRotationCallback = new Mutex();
52
52
  String m_strScreenRotationCallback = "", m_strScreenRotationCallbackParams = "";
53
53
  static String m_strStartParameters = "";
54
+ static boolean m_bSecurityTokenNotPassed = false;
54
55
 
55
56
  int m_currentTabIndex = 0;
56
57
  String[] m_currentUrls = new String[5];
@@ -86,6 +87,9 @@ public class RhodesApp
86
87
  public static void setStartParameters(String szParams ){ m_strStartParameters = (szParams != null? szParams : ""); }
87
88
  public static String getStartParameters(){ return m_strStartParameters; }
88
89
 
90
+ public static void setSecurityTokenNotPassed(boolean is_not_passed) {m_bSecurityTokenNotPassed = is_not_passed;}
91
+ public static boolean isSecurityTokenNotPassed() {return m_bSecurityTokenNotPassed;}
92
+
89
93
  RhodesApp(String strRootPath)
90
94
  {
91
95
  m_strRhoRootPath = strRootPath;
@@ -389,6 +389,8 @@ public class System {
389
389
  Version.SoftVersion ver = Version.getSoftVersion();
390
390
  return ObjectFactory.createString((ver.nMajor < 6 ? "BB" : "WEBKIT")+"/"+DeviceInfo.getSoftwareVersion() );
391
391
  }
392
+ if (strPropName.equalsIgnoreCase("security_token_not_passed"))
393
+ return ObjectFactory.createBoolean(RHODESAPP().isSecurityTokenNotPassed());
392
394
 
393
395
  return RubyConstant.QNIL;
394
396
  }
@@ -1147,8 +1147,7 @@ final public class RhodesApplication extends RhodesApplicationPlatform implement
1147
1147
  AppBuildConfig.getItem("security_token").compareTo(m_strSecurityToken) != 0)
1148
1148
  {
1149
1149
  LOG.INFO("This is hidden app and can be started only with security key.");
1150
- System.exit(0);
1151
- return;
1150
+ RhodesApp.setSecurityTokenNotPassed(true);
1152
1151
  }
1153
1152
 
1154
1153
  LOG.INFO(" STARTING RHODES: ***----------------------------------*** " );
@@ -807,7 +807,7 @@ static Rhodes *instance = NULL;
807
807
  if ( !rho_rhodesapp_canstartapp([start_parameter UTF8String], ", ") )
808
808
  {
809
809
  NSLog(@"This is hidden app and can be started only with security key.");
810
- exit(EXIT_SUCCESS);
810
+ //exit(EXIT_SUCCESS);
811
811
  }
812
812
 
813
813
  return NO;
@@ -7,7 +7,7 @@
7
7
  <key>CFBundlePackageType</key>
8
8
  <string>APPL</string>
9
9
  <key>CFBundleGetInfoString</key>
10
- <string>RhoSimulator 3.2.0.beta.5, Copyright 2010-2011 Rhomobile, Inc.</string>
10
+ <string>RhoSimulator 3.2.2, Copyright 2010-2011 Rhomobile, Inc.</string>
11
11
  <key>CFBundleSignature</key>
12
12
  <string>????</string>
13
13
  <key>CFBundleExecutable</key>
@@ -65,6 +65,7 @@ namespace common{
65
65
 
66
66
  IMPLEMENT_LOGCLASS(CRhodesApp,"RhodesApp");
67
67
  String CRhodesApp::m_strStartParameters;
68
+ boolean CRhodesApp::m_bSecurityTokenNotPassed = false;
68
69
 
69
70
  class CAppCallbacksQueue : public CThreadQueue
70
71
  {
@@ -1572,6 +1573,8 @@ int rho_rhodesapp_canstartapp(const char* szCmdLine, const char* szSeparators)
1572
1573
  CRhodesApp::setStartParameters(szCmdLine);
1573
1574
  RAWLOGC_INFO1("RhodesApp", "New start params: %s", strCmdLine.c_str());
1574
1575
 
1576
+ CRhodesApp::setSecurityTokenNotPassed(false);
1577
+
1575
1578
  const char* szAppSecToken = get_app_build_config_item("security_token");
1576
1579
  if ( !szAppSecToken || !*szAppSecToken)
1577
1580
  return 1;
@@ -1587,8 +1590,10 @@ int rho_rhodesapp_canstartapp(const char* szCmdLine, const char* szSeparators)
1587
1590
  else
1588
1591
  strCmdLineSecToken = tmp;
1589
1592
  }
1593
+ int result = strCmdLineSecToken.compare(szAppSecToken) != 0 ? 0 : 1;
1594
+ CRhodesApp::setSecurityTokenNotPassed(!result);
1590
1595
 
1591
- return strCmdLineSecToken.compare(szAppSecToken) != 0 ? 0 : 1;
1596
+ return result;
1592
1597
  }
1593
1598
 
1594
1599
  } //extern "C"
@@ -64,6 +64,7 @@ private:
64
64
  String m_strLoadingPagePath, m_strLoadingPngPath;
65
65
  String m_strStartUrl, m_strOptionsUrl, m_strRhobundleReloadUrl;//, m_strFirstStartUrl;
66
66
  static String m_strStartParameters;
67
+ static boolean m_bSecurityTokenNotPassed;
67
68
  String m_strRhoMessage;
68
69
  String m_EmptyString;
69
70
 
@@ -111,6 +112,8 @@ public:
111
112
  const String& getLoadingPagePath(){return m_strLoadingPagePath; }
112
113
 
113
114
  static void setStartParameters(const char* szParams ){ m_strStartParameters = (szParams ? szParams : ""); }
115
+ static void setSecurityTokenNotPassed(boolean is_not_passed) {m_bSecurityTokenNotPassed = is_not_passed;}
116
+ static boolean isSecurityTokenNotPassed() {return m_bSecurityTokenNotPassed;}
114
117
  static const String& getStartParameters(){ return m_strStartParameters; }
115
118
 
116
119
  const String& getAppBackUrl();
@@ -137,7 +137,7 @@ void CDBAdapter::open (String strDbPath, String strVer, boolean bTemp)
137
137
  return;
138
138
 
139
139
  LOG(INFO) + "Open DB: " + strDbPath;
140
- close();
140
+ //close();
141
141
 
142
142
  m_mxRuby.create();
143
143
  m_strDbPath = strDbPath;
@@ -660,7 +660,7 @@ void CDBAdapter::setBulkSyncDB(String fDataName, String strCryptKey)
660
660
  db.close();
661
661
 
662
662
  String dbOldName = m_strDbPath;
663
- close();
663
+ close(false);
664
664
 
665
665
  CRhoFile::deleteFilesInFolder(RHODESAPPBASE().getBlobsDirPath().c_str());
666
666
 
@@ -753,7 +753,7 @@ String strTrigger = String("CREATE TRIGGER rhodeleteSchemaTrigger BEFORE DELETE
753
753
  */
754
754
  }
755
755
 
756
- void CDBAdapter::close()
756
+ void CDBAdapter::close(boolean bCloseRubyMutex/* = true*/)
757
757
  {
758
758
  for (Hashtable<String,sqlite3_stmt*>::iterator it = m_mapStatements.begin(); it != m_mapStatements.end(); ++it )
759
759
  sqlite3_finalize( it->second );
@@ -769,7 +769,8 @@ void CDBAdapter::close()
769
769
  m_ptrCrypt = 0;
770
770
  m_strCryptKey = "";
771
771
 
772
- m_mxRuby.close();
772
+ if ( bCloseRubyMutex )
773
+ m_mxRuby.close();
773
774
  }
774
775
 
775
776
  int CDBAdapter::prepareSqlStatement(const char* szSql, int nByte, sqlite3_stmt **ppStmt)
@@ -1162,7 +1163,7 @@ CRubyMutex::CRubyMutex(boolean bIgnore) : m_nLockCount(0), m_valThread(0), m_val
1162
1163
 
1163
1164
  void CRubyMutex::create()
1164
1165
  {
1165
- if ( !m_bIgnore )
1166
+ if ( !m_bIgnore && !m_valMutex)
1166
1167
  m_valMutex = rho_ruby_create_mutex();
1167
1168
  }
1168
1169
 
@@ -109,7 +109,7 @@ public:
109
109
  ~CDBAdapter(void){}
110
110
 
111
111
  void open (String strDbPath, String strVer, boolean bTemp);
112
- void close();
112
+ void close(boolean bCloseRubyMutex = true);
113
113
  sqlite3* getDbHandle(){ return m_dbHandle; }
114
114
  CDBAttrManager& getAttrMgr(){ return m_attrMgr; }
115
115
 
@@ -417,7 +417,7 @@ int CURLNetRequest::getResponseCode(CURLcode err, char const *body, size_t bodys
417
417
  RAWTRACE1("RESPONSE----- (%d bytes)", bodysize);
418
418
  if ( !rho_conf_getBool("log_skip_post") )
419
419
  {
420
- RAWTRACE(body);
420
+ RAWTRACE_DATA(body, bodysize);
421
421
  }
422
422
  RAWTRACE("END RESPONSE-----");
423
423
  }
@@ -123,6 +123,14 @@ VALUE rho_sys_get_property(char* szPropName)
123
123
 
124
124
  if (strcasecmp("has_sqlite",szPropName) == 0)
125
125
  return rho_ruby_create_boolean(1);
126
+
127
+ if (strcasecmp("security_token_not_passed",szPropName) == 0) {
128
+ int passed = 0;
129
+ if ((RHODESAPP().isSecurityTokenNotPassed())) {
130
+ passed = 1;
131
+ }
132
+ return rho_ruby_create_boolean(passed);
133
+ }
126
134
 
127
135
  RAWLOG_ERROR1("Unknown Rho::System property : %s", szPropName);
128
136
 
@@ -293,7 +293,7 @@ HRESULT CRhodesModule::PreMessageLoop(int nShowCmd) throw()
293
293
  if ( !rho_rhodesapp_canstartapp(g_strCmdLine.c_str(), " /-,") )
294
294
  {
295
295
  LOG(INFO) + "This is hidden app and can be started only with security key.";
296
- return S_FALSE;
296
+ //return S_FALSE;
297
297
  }
298
298
 
299
299
  LOG(INFO) + "Rhodes started";
@@ -515,6 +515,7 @@ namespace rho.net
515
515
  m_strRespBody = m_strRespBody.Replace('"', ' ');
516
516
  string[] cookies = m_strRespBody.Split(':');
517
517
  m_strCookies = cookies[1].Trim();
518
+ m_strCookies = Uri.UnescapeDataString(m_strCookies);
518
519
  }
519
520
  pResp.setCookies(m_strCookies);
520
521
  }
data/version CHANGED
@@ -1 +1 @@
1
- 3.2.2
1
+ 3.2.3
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rhodes
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 3
8
8
  - 2
9
- - 2
10
- version: 3.2.2
9
+ - 3
10
+ version: 3.2.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Rhomobile
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-10 00:00:00 -08:00
18
+ date: 2011-11-23 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency