rhodes 3.1.0.beta.2 → 3.1.0.beta.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. data/CHANGELOG +1 -1
  2. data/Manifest.txt +26 -1
  3. data/Rakefile +12 -12
  4. data/doc/connect-to-web-services.txt +7 -1
  5. data/doc/css-framework.txt +3 -3
  6. data/doc/device-caps.txt +24 -23
  7. data/doc/generator.txt +4 -2
  8. data/doc/standard-css.txt +17 -42
  9. data/doc/tutorial.txt +23 -29
  10. data/doc/ui.txt +99 -79
  11. data/lib/extensions/barcode/Android.mk +17 -0
  12. data/lib/extensions/barcode/ext/barcode/platform/android/jni/src/barcode.cpp +27 -11
  13. data/lib/extensions/barcode/ext/barcode/platform/android/src/com/google/zxing/client/android/CaptureActivity.java +2 -1
  14. data/lib/extensions/barcode/ext/barcode/platform/android/src/com/rhomobile/barcode/Barcode.java +5 -6
  15. data/lib/extensions/nfc/Android.mk +18 -0
  16. data/lib/extensions/nfc/ext/nfc/platform/android/jni/src/nfc.cpp +9 -16
  17. data/platform/android/Rhodes/jni/Android.mk +25 -314
  18. data/platform/android/Rhodes/jni/rainbow_stab.cpp +31 -0
  19. data/platform/android/Rhodes/jni/src/bluetooth.cpp +5 -9
  20. data/platform/android/Rhodes/jni/src/camera.cpp +5 -12
  21. data/platform/android/Rhodes/jni/src/fileapi.cpp +8 -7
  22. data/platform/android/Rhodes/jni/src/mapview.cpp +29 -13
  23. data/platform/android/Rhodes/jni/src/nativebar.cpp +3 -2
  24. data/platform/android/Rhodes/jni/src/webview.cpp +2 -2
  25. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +2 -0
  26. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapView.java +8 -2
  27. data/platform/android/build/android.rake +1 -1
  28. data/platform/android/build/androidcommon.rb +12 -1
  29. data/platform/iphone/Classes/Bluetooth/Bluetooth.m +6 -2
  30. data/platform/iphone/Classes/Camera/PickImageDelegate.m +3 -3
  31. data/platform/iphone/Classes/DateTimePickerDelegate.m +3 -1
  32. data/platform/iphone/Classes/MapView/MapAnnotation.m +2 -1
  33. data/platform/iphone/Classes/SplitView/RightViewController.m +3 -1
  34. data/platform/iphone/Classes/TabbedMainView.m +3 -1
  35. data/platform/iphone/rbuild/iphone.rake +5 -3
  36. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Info.plist +2 -4
  37. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/MacOS/RhoSimulator +0 -0
  38. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/accessible/libqtaccessiblewidgets.dylib +0 -0
  39. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/bearer/libqgenericbearer.dylib +0 -0
  40. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqcncodecs.dylib +0 -0
  41. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqjpcodecs.dylib +0 -0
  42. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqkrcodecs.dylib +0 -0
  43. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/codecs/libqtwcodecs.dylib +0 -0
  44. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/graphicssystems/libqtracegraphicssystem.dylib +0 -0
  45. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/phonon_backend/libphonon_qt7.dylib +0 -0
  46. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/qmltooling/libtcpserver.dylib +0 -0
  47. data/platform/shared/common/Android.mk +35 -0
  48. data/platform/shared/common/RhodesApp.cpp +17 -14
  49. data/platform/shared/common/map/ESRIMapEngine.cpp +4 -1
  50. data/platform/shared/curl/Android.mk +88 -0
  51. data/platform/shared/db/Android.mk +12 -0
  52. data/platform/shared/db/DBResult.h +1 -1
  53. data/platform/shared/json/Android.mk +18 -0
  54. data/platform/shared/logging/Android.mk +13 -0
  55. data/platform/shared/logging/RhoLogConf.cpp +1 -3
  56. data/platform/shared/net/Android.mk +19 -0
  57. data/platform/shared/qt/rhodes/QtMainWindow.cpp +7 -2
  58. data/platform/shared/qt/rhodes/QtMainWindow.h +1 -0
  59. data/platform/shared/qt/rhodes/QtMainWindow.ui +12 -0
  60. data/platform/shared/qt/rhodes/RhoSimulator.h +33 -0
  61. data/platform/shared/qt/rhodes/rhodes.pro +134 -133
  62. data/platform/shared/ruby/Android.mk +118 -0
  63. data/platform/shared/rubyext/Android.mk +15 -0
  64. data/platform/shared/sqlite/Android.mk +9 -0
  65. data/platform/shared/statistic/Android.mk +9 -0
  66. data/platform/shared/sync/Android.mk +14 -0
  67. data/platform/shared/unzip/Android.mk +9 -0
  68. data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
  69. data/platform/wm/build/wm.rake +1 -1
  70. data/platform/wm/rhodes/bluetooth/Bluetooth.cpp +3 -1
  71. data/rakefile.rb +12 -12
  72. data/res/generators/templates/application/app/Settings/login.erb +2 -2
  73. data/res/generators/templates/application/app/index.bb.erb +12 -17
  74. data/res/generators/templates/application/app/layout.erb +1 -15
  75. data/res/generators/templates/application/public/css/blackberry.css +17 -17
  76. data/res/generators/templates/application/public/css/jqmobile-patch.css +22 -0
  77. data/res/generators/templates/application/public/js/jqmobile-patch.js +28 -14
  78. data/res/generators/templates/model/edit.erb +1 -1
  79. data/res/generators/templates/model/new.erb +1 -1
  80. data/rhodes.gemspec +2 -2
  81. metadata +34 -25
  82. data/platform/android/Rhodes/AndroidManifest.full.xml +0 -101
@@ -0,0 +1,31 @@
1
+ /*------------------------------------------------------------------------
2
+ * (The MIT License)
3
+ *
4
+ * Copyright (c) 2008-2011 Rhomobile, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ * THE SOFTWARE.
23
+ *
24
+ * http://rhomobile.com
25
+ *------------------------------------------------------------------------*/
26
+
27
+ extern "C" void Init_Rainbow() {
28
+ //Just stab for eclipse project
29
+ };
30
+
31
+
@@ -42,21 +42,17 @@
42
42
  #undef DEFAULT_LOGCATEGORY
43
43
  #define DEFAULT_LOGCATEGORY "Bluetooth"
44
44
 
45
-
46
45
  #include "rhodes/jni/com_rhomobile_rhodes_bluetooth_RhoBluetoothManager.h"
47
46
 
48
47
  #include <common/RhodesApp.h>
49
48
  #include "ruby/ext/rho/rhoruby.h"
50
49
 
51
-
52
-
53
-
54
-
55
-
56
50
  RHO_GLOBAL void JNICALL Java_com_rhomobile_rhodes_bluetooth_RhoBluetoothManager_onCallback
57
- (JNIEnv *env, jclass, jstring callback_url, jstring body) {
58
-
59
- rho_net_request_with_data(rho_http_normalizeurl(rho_cast<std::string>(callback_url).c_str()), rho_cast<std::string>(body).c_str());
51
+ (JNIEnv *env, jclass, jstring callback_url, jstring body)
52
+ {
53
+ rho_net_request_with_data(
54
+ RHODESAPP().canonicalizeRhoUrl(rho_cast<std::string>(env, callback_url)).c_str(),
55
+ rho_cast<std::string>(env, body).c_str());
60
56
  }
61
57
 
62
58
 
@@ -34,21 +34,14 @@
34
34
  #undef DEFAULT_LOGCATEGORY
35
35
  #define DEFAULT_LOGCATEGORY "Camera"
36
36
 
37
- //RHO_GLOBAL void JNICALL Java_com_rhomobile_rhodes_camera_Camera_callback
38
- // (JNIEnv *env, jclass, jstring callback, jstring filePath, jstring error, jboolean cancelled)
39
- //{
40
- // rho_rhodesapp_callCameraCallback(rho_cast<std::string>(callback).c_str(),
41
- // rho_cast<std::string>(filePath).c_str(), rho_cast<std::string>(error).c_str(), cancelled);
42
- //}
43
-
44
37
  RHO_GLOBAL void JNICALL Java_com_rhomobile_rhodes_camera_Camera_callback
45
- (JNIEnv *env, jclass, jstring callback_url, jstring body) {
46
- rho_net_request_with_data(rho_http_normalizeurl(rho_cast<std::string>(callback_url).c_str()), rho_cast<std::string>(body).c_str());
38
+ (JNIEnv *env, jclass, jstring callback_url, jstring body)
39
+ {
40
+ rho_net_request_with_data(
41
+ RHODESAPP().canonicalizeRhoUrl(rho_cast<std::string>(env, callback_url)).c_str(),
42
+ rho_cast<std::string>(env, body).c_str());
47
43
  }
48
44
 
49
-
50
-
51
-
52
45
  RHO_GLOBAL void take_picture(char* callback_url, rho_param *options_hash )
53
46
  {
54
47
  JNIEnv *env = jnienv();
@@ -1387,15 +1387,16 @@ RHO_GLOBAL DIR *opendir(const char *dirpath)
1387
1387
  DIR *dirp = NULL;
1388
1388
  if (emulate)
1389
1389
  {
1390
- struct stat st;
1391
- if (::stat(fpath.c_str(), &st) == -1)
1392
- return NULL;
1393
- if (!S_ISDIR(st.st_mode))
1394
1390
  {
1395
- errno = ENOTDIR;
1396
- return NULL;
1391
+ struct stat st;
1392
+ if (::stat(fpath.c_str(), &st) == -1)
1393
+ return NULL;
1394
+ if (!S_ISDIR(st.st_mode))
1395
+ {
1396
+ errno = ENOTDIR;
1397
+ return NULL;
1398
+ }
1397
1399
  }
1398
-
1399
1400
  std::vector<std::string> children;
1400
1401
  children.push_back(".");
1401
1402
  children.push_back("..");
@@ -187,6 +187,7 @@ void AndroidImage::init(JNIEnv *env)
187
187
 
188
188
  m_width = env->CallIntMethod(*m_bitmap, midWidth);
189
189
  m_height = env->CallIntMethod(*m_bitmap, midHeight);
190
+
190
191
  }
191
192
 
192
193
  AndroidImage::~AndroidImage()
@@ -231,6 +232,9 @@ void AndroidDrawingContext::drawImage(int x, int y, IDrawingImage *image)
231
232
 
232
233
  env->CallVoidMethod(m_device, mid, m_canvas, x, y, bitmap);
233
234
 
235
+ /////
236
+ env->DeleteLocalRef(cls);
237
+
234
238
  RHO_MAP_TRACE("drawImage done");
235
239
  }
236
240
 
@@ -247,6 +251,10 @@ void AndroidDrawingContext::drawText(int x, int y, int width, int height, String
247
251
  env->CallVoidMethod(m_device, mid, m_canvas, x, y, width, height,
248
252
  rho_cast<jhstring>(text).get(), color);
249
253
 
254
+ /////
255
+ env->DeleteLocalRef(cls);
256
+
257
+
250
258
  RHO_MAP_TRACE("drawText done");
251
259
  }
252
260
 
@@ -260,6 +268,7 @@ AndroidMapDevice::AndroidMapDevice(rho_param *p)
260
268
  jmethodID mid = getJNIClassStaticMethod(env, cls, "create", "(J)V");
261
269
  if (!mid) return;
262
270
  env->CallStaticVoidMethod(cls, mid, (jlong)this);
271
+
263
272
  RHO_MAP_TRACE("AndroidMapDevice: ctor finish");
264
273
  }
265
274
 
@@ -268,8 +277,16 @@ AndroidMapDevice::~AndroidMapDevice()
268
277
  RHO_MAP_TRACE("AndroidMapDevice: dtor start");
269
278
  rho_param_free(m_params);
270
279
  JNIEnv *env = jnienv();
271
- if (m_jdevice)
280
+ if (m_jdevice) {
281
+ JNIEnv *env = jnienv();
282
+ jclass cls = getJNIClass(RHODES_JAVA_CLASS_MAPVIEW);
283
+ if (!cls) return;
284
+ jmethodID mid = getJNIClassMethod(env, cls, "destroyDevice", "()V");
285
+ if (!mid) return;
286
+ env->CallVoidMethod(m_jdevice, mid);
287
+
272
288
  env->DeleteGlobalRef(m_jdevice);
289
+ }
273
290
  RHO_MAP_TRACE("AndroidMapDevice: dtor finish");
274
291
  }
275
292
 
@@ -296,7 +313,7 @@ void AndroidMapDevice::setMapView(IMapView *mv)
296
313
 
297
314
  m_mapview->setPinImage(m_pin_image.get(), pin_info);
298
315
 
299
- PIN_INFO pin_info1 = {0};
316
+ PIN_INFO pin_info1 = PIN_INFO();
300
317
  pin_info1.x_offset = 5;
301
318
 
302
319
  mv->setPinCalloutImage(m_pin_calloutimage.get(), pin_info1);
@@ -332,10 +349,9 @@ void AndroidMapDevice::setPinCalloutImage(JNIEnv *env, jobject bitmap)
332
349
  RHO_MAP_TRACE("AndroidMapDevice: setPinCalloutImage: start");
333
350
  m_pin_calloutimage.reset(new AndroidImage(bitmap));
334
351
  IMapView *mv = mapView();
335
- if (mv) {
336
-
337
- PIN_INFO pin_info = {0};
338
- pin_info.x_offset = 5;
352
+ if (mv){
353
+ PIN_INFO pin_info = PIN_INFO();
354
+ pin_info.x_offset = 5;
339
355
 
340
356
  mv->setPinCalloutImage(m_pin_calloutimage.get(), pin_info);
341
357
  }
@@ -348,9 +364,8 @@ void AndroidMapDevice::setPinCalloutLinkImage(JNIEnv *env, jobject bitmap)
348
364
  m_pin_calloutlinkimage.reset(new AndroidImage(bitmap));
349
365
  IMapView *mv = mapView();
350
366
  if (mv) {
351
-
352
- PIN_INFO pin_info = {0};
353
- pin_info.x_offset = 5;
367
+ PIN_INFO pin_info = PIN_INFO();
368
+ pin_info.x_offset = 5;
354
369
 
355
370
  mv->setPinCalloutLinkImage(m_pin_calloutlinkimage.get(), pin_info);
356
371
  }
@@ -381,7 +396,7 @@ IDrawingImage *AndroidMapDevice::createImage(String const &path, bool useAlpha)
381
396
 
382
397
  jobject bitmap = env->CallStaticObjectMethod(cls, mid, rho_cast<jhstring>(path).get());
383
398
  IDrawingImage *image = new AndroidImage(bitmap);
384
-
399
+
385
400
  RHO_MAP_TRACE1("createImage: return image=%p", image);
386
401
  return image;
387
402
  }
@@ -402,7 +417,7 @@ IDrawingImage *AndroidMapDevice::createImage(void const *p, size_t size, bool us
402
417
 
403
418
  jobject bitmap = env->CallStaticObjectMethod(cls, mid, data.get());
404
419
  IDrawingImage *image = new AndroidImage(bitmap);
405
-
420
+
406
421
  RHO_MAP_TRACE1("createImage: return image=%p", image);
407
422
  return image;
408
423
  }
@@ -434,6 +449,7 @@ void AndroidMapDevice::requestRedraw()
434
449
  jmethodID mid = getJNIClassMethod(env, cls, "redraw", "()V");
435
450
  if (!mid) return;
436
451
  env->CallVoidMethod(m_jdevice, mid);
452
+
437
453
  }
438
454
 
439
455
  RHO_MAP_TRACE("requestRedraw done");
@@ -727,7 +743,7 @@ RHO_GLOBAL double google_mapview_state_center_lon()
727
743
 
728
744
 
729
745
 
730
- static bool ourIsOldGoogleEngineUsed = false;
746
+ static bool ourIsOldGoogleEngineUsed = true;
731
747
 
732
748
 
733
749
 
@@ -762,7 +778,7 @@ RHO_GLOBAL void mapview_create(rho_param *p)
762
778
  ourIsOldGoogleEngineUsed = false;
763
779
 
764
780
  // detect engine
765
- char* engine = "Google";
781
+ const char* engine = "Google";
766
782
  if (p && p->type == RHO_PARAM_HASH) {
767
783
  rho_param *eng_p = NULL;
768
784
  for (int i = 0, lim = p->v.hash->size; i < lim; ++i) {
@@ -148,6 +148,7 @@ RHO_GLOBAL int native_tabbar_get_current_tab() {
148
148
  RHO_GLOBAL void JNICALL Java_com_rhomobile_rhodes_mainview_TabbedMainView_onTabBarChangeTabCallback
149
149
  (JNIEnv *env, jclass, jstring callback, jstring body)
150
150
  {
151
- rho_net_request_with_data(rho_http_normalizeurl(rho_cast<std::string>(callback).c_str()), rho_cast<std::string>(body).c_str());
152
-
151
+ rho_net_request_with_data(
152
+ RHODESAPP().canonicalizeRhoUrl(rho_cast<std::string>(env, callback)).c_str(),
153
+ rho_cast<std::string>(env, body).c_str());
153
154
  }
@@ -46,8 +46,8 @@ RHO_GLOBAL void rho_webview_navigate(const char* url, int index)
46
46
  return;
47
47
  }
48
48
 
49
- char *normUrl = rho_http_normalizeurl(url);
50
- jhstring objNormUrl = rho_cast<jhstring>(normUrl);
49
+ std::string normUrl = RHODESAPP().canonicalizeRhoUrl(url);
50
+ jhstring objNormUrl = rho_cast<jhstring>(env, normUrl);
51
51
  env->CallStaticVoidMethod(cls, mid, objNormUrl.get(), index);
52
52
  }
53
53
 
@@ -30,6 +30,7 @@ import java.util.Map;
30
30
  import java.util.Vector;
31
31
 
32
32
  import com.rhomobile.rhodes.AndroidR;
33
+ import com.rhomobile.rhodes.Logger;
33
34
  import com.rhomobile.rhodes.RhodesActivity;
34
35
  import com.rhomobile.rhodes.RhodesAppOptions;
35
36
  import com.rhomobile.rhodes.RhodesService;
@@ -580,6 +581,7 @@ public class SimpleMainView implements MainView {
580
581
 
581
582
  public void navigate(String url, int index) {
582
583
  String cleared_url = processForNativeView(url);
584
+ Logger.I(TAG, "Cleared URL: " + url);
583
585
  if (cleared_url.length() > 0) {
584
586
  // check for handle because if we call loadUrl - WebView do not check this url for handle
585
587
  if (!RhodesService.getInstance().handleUrlLoading(cleared_url)) {
@@ -163,7 +163,9 @@ public class MapView extends BaseActivity implements MapTouch {
163
163
  @Override
164
164
  protected void dispatchDraw(Canvas canvas) {
165
165
  //super.dispatchDraw(canvas);
166
- paint(mNativeDevice, canvas);
166
+ if (mNativeDevice != 0) {
167
+ paint(mNativeDevice, canvas);
168
+ }
167
169
  }
168
170
 
169
171
  @Override
@@ -208,8 +210,8 @@ public class MapView extends BaseActivity implements MapTouch {
208
210
 
209
211
  @Override
210
212
  protected void onStop() {
211
- destroy(mNativeDevice);
212
213
  mNativeDevice = 0;
214
+ destroy(mNativeDevice);
213
215
  mc = null;
214
216
  finish();
215
217
  super.onStop();
@@ -316,6 +318,10 @@ public class MapView extends BaseActivity implements MapTouch {
316
318
  bm.recycle();
317
319
  }
318
320
 
321
+ public void destroyDevice() {
322
+ mNativeDevice = 0;
323
+ }
324
+
319
325
  @Override
320
326
  public void touchClick(Touch touch) {
321
327
  click(mNativeDevice, (int)touch.x, (int)touch.y);
@@ -442,7 +442,7 @@ namespace "config" do
442
442
 
443
443
  android_api_levels.sort!
444
444
 
445
- $emuversion = get_market_version($found_api_level) if $emuversion.nil?
445
+ $emuversion = get_market_version($min_sdk_level) if $emuversion.nil?
446
446
  requested_api_level = get_api_level($emuversion)
447
447
 
448
448
  if USE_TRACES
@@ -155,7 +155,12 @@ def cc_def_args
155
155
  args << $ndksysroot
156
156
  #args << "-fvisibility=hidden"
157
157
  args << "-fPIC"
158
+ args << "-fstrict-aliasing"
159
+ args << "-Wall"
160
+ args << "-Wextra"
158
161
  args << "-Wno-psabi" if $ndkgccver != "4.2.1"
162
+ args << "-Wstrict-aliasing"
163
+ args << "-Wno-sign-compare"
159
164
  args << "-mandroid"
160
165
  args << "-DANDROID"
161
166
  args << "-DOS_ANDROID"
@@ -166,8 +171,14 @@ def cc_def_args
166
171
  args << "-O2"
167
172
  args << "-DNDEBUG"
168
173
  else
169
- args << "-O0"
174
+ args << "-O1"
175
+ args << "-fstack-protector-all"
170
176
  args << "-D_DEBUG"
177
+ args << "-Winit-self"
178
+ args << "-Wshadow"
179
+ args << "-Wcast-align"
180
+ args << "-Wvla"
181
+ args << "-Wstack-protector"
171
182
  end
172
183
  $cc_def_args_val = args
173
184
  end
@@ -257,7 +257,9 @@ static RhoBluetoothManager *instance = NULL;
257
257
  strBody = [strBody stringByAppendingString:status];
258
258
  strBody = [strBody stringByAppendingString:@"&connected_device_name="];
259
259
  strBody = [strBody stringByAppendingString:connected_device_name];
260
- rho_net_request_with_data(rho_http_normalizeurl([connectionCallbackURL UTF8String]), [strBody UTF8String]);
260
+ char* norm_url = rho_http_normalizeurl([connectionCallbackURL UTF8String]);
261
+ rho_net_request_with_data(norm_url, [strBody UTF8String]);
262
+ rho_http_free(norm_url);
261
263
  }
262
264
 
263
265
  - (void)fireSessionCallback:(NSString*)connected_device_name event_type:(NSString*)event_type {
@@ -269,7 +271,9 @@ static RhoBluetoothManager *instance = NULL;
269
271
  strBody = [strBody stringByAppendingString:connected_device_name];
270
272
  strBody = [strBody stringByAppendingString:@"&event_type="];
271
273
  strBody = [strBody stringByAppendingString:event_type];
272
- rho_net_request_with_data(rho_http_normalizeurl([sessionCallbackURL UTF8String]), [strBody UTF8String]);
274
+ char* norm_url = rho_http_normalizeurl([sessionCallbackURL UTF8String]);
275
+ rho_net_request_with_data(norm_url, [strBody UTF8String]);
276
+ rho_http_free(norm_url);
273
277
  }
274
278
 
275
279
 
@@ -313,9 +313,9 @@
313
313
 
314
314
  const char* cb = [postUrl UTF8String];
315
315
  const char* b = [strBody UTF8String];
316
- rho_net_request_with_data(rho_http_normalizeurl(cb), b);
317
-
318
-
316
+ char* norm_url = rho_http_normalizeurl(cb);
317
+ rho_net_request_with_data(norm_url, b);
318
+ rho_http_free(norm_url);
319
319
 
320
320
  //rho_rhodesapp_callCameraCallback([postUrl UTF8String], [filename UTF8String],
321
321
  // isError ? "Can't write image to the storage." : "", 0 );
@@ -106,7 +106,9 @@ static NSString* ourChangeValueCallback = nil;
106
106
 
107
107
  const char* cb = [ourChangeValueCallback UTF8String];
108
108
  const char* b = [strBody UTF8String];
109
- rho_net_request_with_data(rho_http_normalizeurl(cb), b);
109
+ char* norm_url = rho_http_normalizeurl(cb);
110
+ rho_net_request_with_data(norm_url, b);
111
+ rho_http_free(norm_url);
110
112
  }
111
113
 
112
114
 
@@ -58,9 +58,10 @@
58
58
 
59
59
  - (void)setUrl:(NSString*)u {
60
60
  const char *surl = [u UTF8String];
61
- const char *norm_url = rho_http_normalizeurl(surl);
61
+ char *norm_url = rho_http_normalizeurl(surl);
62
62
  [url release];
63
63
  url = [[NSString stringWithUTF8String:norm_url] copy];
64
+ rho_http_free(norm_url);
64
65
  }
65
66
 
66
67
  @end
@@ -180,7 +180,9 @@
180
180
  strBody = [strBody stringByAppendingString:[NSString stringWithFormat:@"%d",new_index]];
181
181
  const char* cb = [self.on_change_tab_callback UTF8String];
182
182
  const char* b = [strBody UTF8String];
183
- rho_net_request_with_data(rho_http_normalizeurl(cb), b);
183
+ char* norm_url = rho_http_normalizeurl(cb);
184
+ rho_net_request_with_data(norm_url, b);
185
+ rho_http_free(norm_url);
184
186
  }
185
187
  }
186
188
 
@@ -601,7 +601,9 @@
601
601
  strBody = [strBody stringByAppendingString:[NSString stringWithFormat:@"%d",new_index]];
602
602
  const char* cb = [self.on_change_tab_callback UTF8String];
603
603
  const char* b = [strBody UTF8String];
604
- rho_net_request_with_data(rho_http_normalizeurl(cb), b);
604
+ char* norm_url = rho_http_normalizeurl(cb);
605
+ rho_net_request_with_data(norm_url, b);
606
+ rho_http_free(norm_url);
605
607
  }
606
608
  }
607
609
 
@@ -499,10 +499,12 @@ namespace "build" do
499
499
  vendor = $app_config['vendor'] ? $app_config['vendor'] : "rhomobile"
500
500
  bundle_identifier = "com.#{vendor}.#{appname}"
501
501
  bundle_identifier = $app_config["iphone"]["BundleIdentifier"] unless $app_config["iphone"]["BundleIdentifier"].nil?
502
- saved_identifier = set_app_bundle_identifier(bundle_identifier)
502
+ set_app_bundle_identifier(bundle_identifier)
503
+
504
+ set_app_name(appname)
503
505
 
504
- saved_url_scheme = set_app_url_scheme($app_config["iphone"]["BundleURLScheme"]) unless $app_config["iphone"]["BundleURLScheme"].nil?
505
- saved_url_name = set_app_url_name(bundle_identifier)
506
+ set_app_url_scheme($app_config["iphone"]["BundleURLScheme"]) unless $app_config["iphone"]["BundleURLScheme"].nil?
507
+ set_app_url_name(bundle_identifier)
506
508
 
507
509
  set_app_icon(false)
508
510
  set_default_images(false)