rhodes 3.3.3.beta.3 → 3.3.3.beta.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest.txt +16 -1
- data/Rakefile +77 -28
- data/doc/build.txt +5 -3
- data/doc/configuration.txt +13 -0
- data/doc/device-caps.txt +46 -27
- data/doc/rhom.txt +2 -2
- data/doc/test-log-debug.txt +6 -0
- data/doc/ui.txt +13 -0
- data/lib/build/jake.rb +11 -11
- data/lib/extensions/crypt/crypt/cbc.rb +5 -2
- data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/Nfc.java +14 -4
- data/lib/framework/rho/render.rb +17 -4
- data/lib/framework/rho/rho.rb +1 -1
- data/lib/framework/rho/rhocontroller.rb +11 -1
- data/lib/framework/rhomotoapi.rb +110 -0
- data/platform/android/Rhodes/jni/Android.mk +2 -5
- data/platform/android/Rhodes/jni/include/rhodes/JNIRhodes.h +1 -0
- data/platform/android/Rhodes/jni/include/rhodes/fileapi.h +38 -0
- data/platform/android/Rhodes/jni/src/callbacks.cpp +7 -26
- data/platform/android/Rhodes/jni/src/extmanager.cpp +4 -1
- data/platform/android/Rhodes/jni/src/fileapi.cpp +38 -14
- data/platform/android/Rhodes/jni/src/mapview.cpp +1 -2
- data/platform/android/Rhodes/jni/src/rhodesapp.cpp +10 -0
- data/platform/android/Rhodes/jni/src/rhodessystem.cpp +1 -1
- data/platform/android/Rhodes/jni/src/signature.cpp +1 -4
- data/platform/android/Rhodes/rhobundle.xml +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +11 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivityListener.java +4 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +26 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +3 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/AbstractRhoExtension.java +70 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtData.java +3 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtManager.java +21 -7
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtension.java +19 -10
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtDataImpl.java +8 -5
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManager.java +18 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerImpl.java +168 -31
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/file/RhoFileApi.java +46 -9
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +3 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/Signature.java +27 -53
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/SignatureView.java +27 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/util/Utils.java +13 -14
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebViewClient.java +12 -5
- data/platform/android/build/RhodesSRC_build.files +2 -1
- data/platform/android/build/android.rake +48 -17
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyAPI.java +1 -1
- data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +24 -3
- data/platform/iphone/Classes/AppManager/AppManager.m +1 -1
- data/platform/iphone/Classes/Camera/PickImageDelegate.m +27 -2
- data/platform/iphone/Classes/DateTimePickerDelegate.h +2 -0
- data/platform/iphone/Classes/DateTimePickerDelegate.m +85 -9
- data/platform/iphone/Classes/DateTimePickerViewController.h +21 -0
- data/platform/iphone/Classes/DateTimePickerViewController.m +75 -0
- data/platform/iphone/Classes/GeoLocation/LocationController.h +6 -2
- data/platform/iphone/Classes/GeoLocation/LocationController.m +54 -14
- data/platform/iphone/Classes/RhoMainView.h +2 -0
- data/platform/iphone/Classes/Rhodes.m +11 -5
- data/platform/iphone/Classes/Signature/SignatureDelegate.m +13 -12
- data/platform/iphone/Classes/Signature/SignatureViewController.m +2 -1
- data/platform/iphone/Classes/SimpleMainView.m +3 -0
- data/platform/iphone/Classes/SplitView/SplittedMainView.m +3 -0
- data/platform/iphone/Classes/TabbedMainView.m +30 -11
- data/platform/iphone/rbuild/iphone.rake +7 -1
- data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +6 -0
- data/platform/shared/RhoConnectClient/RhoConnectClient.cpp +1 -1
- data/platform/shared/common/BundleManager.cpp +42 -2
- data/platform/shared/common/ExtManager.h +7 -0
- data/platform/shared/common/RhoFile.cpp +170 -2
- data/platform/shared/common/RhoFile.h +4 -0
- data/platform/shared/common/RhodesApp.cpp +30 -0
- data/platform/shared/common/RhodesApp.h +1 -0
- data/platform/shared/common/map/OSMMapEngine.cpp +11 -3
- data/platform/shared/common/map/OSMMapEngine.h +3 -0
- data/platform/shared/logging/RhoLogConf.cpp +8 -9
- data/platform/shared/logging/RhoLogConf.h +5 -7
- data/platform/shared/logging/RhoLogSink.cpp +3 -3
- data/platform/shared/logging/RhoLogSink.h +1 -1
- data/platform/shared/net/HttpServer.cpp +17 -9
- data/platform/shared/qt/rhodes/main.cpp +1 -1
- data/platform/shared/ruby/ext/rho/rhoruby.c +4 -0
- data/platform/shared/ruby/ext/webview/webview.i +9 -4
- data/platform/shared/ruby/ext/webview/webview_wrap.c +2 -2
- data/platform/shared/test/Tests.cpp +2 -2
- data/platform/wm/build/build_inf.js +75 -47
- data/platform/wm/build/wm.rake +50 -53
- data/platform/wm/rhodes/Rhodes.cpp +40 -97
- data/platform/wm/rhodes/rho/common/ExtManager.cpp +23 -1
- data/platform/wm/rhodes/rho/rubyext/WebView.cpp +9 -0
- data/platform/wm/tools/detool/detool.cpp +103 -52
- data/platform/wp7/RhoRubyExtGen/RhoDateTimePicker.cs +60 -0
- data/platform/wp7/RhoRubyExtGen/RhoRubyExtGen.csproj +1 -0
- data/platform/wp7/RhoRubyExtGen/RhoWebView.cs +4 -4
- data/platform/wp7/RhoRubyLib/Initializers.Generated.cs +15 -1
- data/platform/wp7/RhoRubyLib/RhoRubyLib.csproj +12 -2
- data/platform/wp7/RhoRubyLib/WP_PlatformAdaptationLayer.cs +2 -0
- data/platform/wp7/RhoRubyLib/common/RhoFile.cs +3 -3
- data/platform/wp7/RhoRubyLib/common/RhoFilePath.cs +2 -2
- data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +39 -24
- data/platform/wp7/RhoRubyLib/json/RJSONTokener.cs +8 -1
- data/platform/wp7/RhoRubyLib/logging/RhoLogServerSink.cs +3 -3
- data/platform/wp7/RhoRubyLib/logging/RhoLogger.cs +1 -1
- data/platform/wp7/RhoRubyLib/net/HttpServer.cs +22 -15
- data/platform/wp7/RhoRubyLib/net/NetRequest.cs +1 -1
- data/platform/wp7/RhoRubyLib/rubyext/RhoDateTimePicker.cs +237 -0
- data/platform/wp7/RhoRubyLib/rubyext/RhoWebView.cs +5 -5
- data/platform/wp7/RhoRubyLib/views/RhoDateTimeDlg.xaml +37 -0
- data/platform/wp7/RhoRubyLib/views/RhoDateTimeDlg.xaml.cs +59 -0
- data/platform/wp7/RhoRubyLib/views/RhoView.xaml.cs +34 -41
- data/platform/wp7/rhodes/App.xaml.cs +1 -0
- data/platform/wp7/rhodes/Properties/WMAppManifest.xml +18 -18
- data/platform/wp7/rhodes/Rhodes.csproj +5 -1
- data/platform/wp7/rhodes/Toolkit.Content/ApplicationBar.Cancel.png +0 -0
- data/platform/wp7/rhodes/Toolkit.Content/ApplicationBar.Check.png +0 -0
- data/rakefile.rb +77 -28
- data/res/build-tools/Microsoft.Phone.Controls.Toolkit.dll +0 -0
- data/res/build-tools/YUICompressorLicense.txt +54 -0
- data/res/build-tools/detool.exe +0 -0
- data/res/build-tools/yuicompressor-2.4.7.jar +0 -0
- data/res/generators/templates/application/app/layout.erb +1 -0
- data/res/generators/templates/application/public/js/jquery-wp7-patch.js +8 -2
- data/res/generators/templates/application/public/js/syncengine.js +147 -0
- data/spec/phone_spec/app/Data/septest.json +1 -1
- data/spec/phone_spec/app/spec/asynchttp_spec.rb +11 -10
- data/spec/phone_spec/app/spec/blobsync_spec.rb +9 -34
- data/spec/phone_spec/app/spec/date_spec.rb +6 -6
- data/spec/phone_spec/app/spec/rho_spec.rb +1 -6
- data/spec/phone_spec/app/spec/rhofile_spec.rb +13 -7
- data/spec/phone_spec/app/spec/rhom_object_spec.rb +4 -3
- data/spec/phone_spec/app/spec/syncengine_spec.rb +12 -14
- data/spec/phone_spec/app/spec_runner.rb +9 -10
- data/version +1 -1
- metadata +20 -5
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerSingleton.java +0 -15
@@ -529,10 +529,11 @@ public class SimpleMainView implements MainView {
|
|
529
529
|
// webView = v.detachWebView();
|
530
530
|
if (webView == null) {
|
531
531
|
if (Capabilities.WEBKIT_BROWSER_ENABLED) {
|
532
|
+
Logger.D(TAG, "Creating Motorola WebKIT view");
|
532
533
|
try {
|
533
534
|
Class<? extends IRhoWebView> viewClass = (Class<? extends IRhoWebView>)Class.forName("com.rhomobile.rhodes.webview.EkiohWebView");
|
534
|
-
Constructor<? extends IRhoWebView> viewCtor = viewClass.getConstructor(
|
535
|
-
webView = viewCtor.newInstance(activity);
|
535
|
+
Constructor<? extends IRhoWebView> viewCtor = viewClass.getConstructor(Context.class, Runnable.class);
|
536
|
+
webView = viewCtor.newInstance(activity, RhodesApplication.AppState.AppStarted.addObserver("MotorolaStartEngineObserver", true));
|
536
537
|
} catch (Throwable e) {
|
537
538
|
Logger.E(TAG, e);
|
538
539
|
RhodesApplication.stop();
|
@@ -27,13 +27,9 @@
|
|
27
27
|
package com.rhomobile.rhodes.signature;
|
28
28
|
|
29
29
|
import java.io.File;
|
30
|
-
import java.util.Enumeration;
|
31
30
|
import java.util.Map;
|
32
|
-
import java.util.Vector;
|
33
31
|
|
34
32
|
import android.content.Intent;
|
35
|
-
import android.text.method.HideReturnsTransformationMethod;
|
36
|
-
import android.view.View;
|
37
33
|
import android.view.ViewGroup;
|
38
34
|
import android.webkit.WebView;
|
39
35
|
import android.widget.AbsoluteLayout;
|
@@ -47,12 +43,13 @@ import com.rhomobile.rhodes.util.ContextFactory;
|
|
47
43
|
import com.rhomobile.rhodes.util.PerformOnUiThread;
|
48
44
|
import com.rhomobile.rhodes.util.Utils;
|
49
45
|
|
46
|
+
import com.rhomobile.rhodes.extmanager.AbstractRhoExtension;
|
50
47
|
import com.rhomobile.rhodes.extmanager.IRhoExtData;
|
51
48
|
import com.rhomobile.rhodes.extmanager.IRhoExtension;
|
52
49
|
import com.rhomobile.rhodes.extmanager.IRhoExtManager;
|
53
|
-
import com.rhomobile.rhodes.extmanager.
|
50
|
+
import com.rhomobile.rhodes.extmanager.RhoExtManager;
|
54
51
|
|
55
|
-
public class Signature implements IRhoExtension {
|
52
|
+
public class Signature extends AbstractRhoExtension implements IRhoExtension {
|
56
53
|
|
57
54
|
static final String TAG = "Signature";
|
58
55
|
|
@@ -89,7 +86,7 @@ public class Signature implements IRhoExtension {
|
|
89
86
|
|
90
87
|
public void run() {
|
91
88
|
init();
|
92
|
-
RhodesActivity ra = RhodesActivity.
|
89
|
+
RhodesActivity ra = RhodesActivity.safeGetInstance();
|
93
90
|
Intent intent = new Intent(ra, klass);
|
94
91
|
intent.putExtra(INTENT_EXTRA_PREFIX + "callback", getSharedInstance().mProperties.callbackUrl);
|
95
92
|
intent.putExtra(INTENT_EXTRA_PREFIX + "imageFormat", getSharedInstance().mProperties.imageFormat);
|
@@ -143,9 +140,13 @@ public class Signature implements IRhoExtension {
|
|
143
140
|
callback(callbackUrl, fp, "", fp.length() == 0);
|
144
141
|
}
|
145
142
|
|
146
|
-
|
147
|
-
|
148
|
-
|
143
|
+
public static void inline_signature_visible(int visible, Object params) {
|
144
|
+
inlineSignatureVisible(RhoExtManager.getInstance(), (visible != 0), params);
|
145
|
+
}
|
146
|
+
|
147
|
+
public static void inlineSignatureVisible(final IRhoExtManager extManager, boolean visible, Object params) {
|
148
|
+
if (!visible) {
|
149
|
+
inlineSignatureHide(extManager);
|
149
150
|
return;
|
150
151
|
}
|
151
152
|
|
@@ -155,7 +156,7 @@ public class Signature implements IRhoExtension {
|
|
155
156
|
public void run() {
|
156
157
|
reportMsg(" $$$ Start make of Signature View");
|
157
158
|
|
158
|
-
ViewGroup wv = (
|
159
|
+
ViewGroup wv = (ViewGroup)extManager.getWebView();
|
159
160
|
if ((wv != null) && (ourInlineSignatureView != null)) {
|
160
161
|
wv.removeView(ourInlineSignatureView);
|
161
162
|
ourInlineSignatureView = null;
|
@@ -196,10 +197,14 @@ public class Signature implements IRhoExtension {
|
|
196
197
|
if (ourInlineSignatureView != null) {
|
197
198
|
ImageCapture.takeSignature(callback_url, getSharedInstance().mProperties.imageFormat, ourInlineSignatureView.makeBitmap());
|
198
199
|
}
|
199
|
-
|
200
|
+
inlineSignatureHide(RhoExtManager.getInstance());
|
200
201
|
}
|
201
202
|
|
202
203
|
public static void inline_signature_clear() {
|
204
|
+
inlineSignatureClear(RhoExtManager.getInstance());
|
205
|
+
}
|
206
|
+
|
207
|
+
public static void inlineSignatureClear(IRhoExtManager extmanager) {
|
203
208
|
PerformOnUiThread.exec( new Runnable () {
|
204
209
|
public void run() {
|
205
210
|
if (ourInlineSignatureView != null) {
|
@@ -215,11 +220,11 @@ public class Signature implements IRhoExtension {
|
|
215
220
|
});
|
216
221
|
}
|
217
222
|
|
218
|
-
public static void
|
223
|
+
public static void inlineSignatureHide(final IRhoExtManager extManager) {
|
219
224
|
PerformOnUiThread.exec( new Runnable () {
|
220
225
|
public void run() {
|
221
226
|
if (ourInlineSignatureView != null) {
|
222
|
-
ViewGroup wv = (
|
227
|
+
ViewGroup wv = (ViewGroup)extManager.getWebView();
|
223
228
|
if (wv != null) {
|
224
229
|
wv.removeView(ourInlineSignatureView);
|
225
230
|
ourInlineSignatureView = null;
|
@@ -230,11 +235,12 @@ public class Signature implements IRhoExtension {
|
|
230
235
|
}
|
231
236
|
|
232
237
|
@Override
|
233
|
-
public void onBeforeNavigate(String url, IRhoExtData data) {
|
234
|
-
|
238
|
+
public void onBeforeNavigate(IRhoExtManager extManager, String url, IRhoExtData data) {
|
239
|
+
inlineSignatureHide(extManager);
|
235
240
|
}
|
236
241
|
|
237
|
-
|
242
|
+
@Override
|
243
|
+
public void onSetProperty(IRhoExtManager extManager, String name, String value, IRhoExtData data) {
|
238
244
|
if ((name == null) || (value == null)) {
|
239
245
|
return;
|
240
246
|
}
|
@@ -242,16 +248,16 @@ public class Signature implements IRhoExtension {
|
|
242
248
|
if ("Visibility".equalsIgnoreCase(name)) {
|
243
249
|
if ("Visible".equalsIgnoreCase(value)) {
|
244
250
|
// show
|
245
|
-
|
251
|
+
inlineSignatureVisible(extManager, true, null);
|
246
252
|
}
|
247
253
|
else {
|
248
254
|
// hide;
|
249
|
-
|
255
|
+
inlineSignatureHide(extManager);
|
250
256
|
}
|
251
257
|
}
|
252
258
|
else if ("Clear".equalsIgnoreCase(name)) {
|
253
259
|
// clear
|
254
|
-
|
260
|
+
inlineSignatureClear(extManager);
|
255
261
|
}
|
256
262
|
}
|
257
263
|
|
@@ -264,43 +270,11 @@ public class Signature implements IRhoExtension {
|
|
264
270
|
}
|
265
271
|
|
266
272
|
public static void registerSignatureCaptureExtension() {
|
267
|
-
|
273
|
+
RhoExtManager.getInstance().registerExtension(SIGNATURE_EXT, getSharedInstance());
|
268
274
|
}
|
269
275
|
|
270
276
|
public static native void callback(String callbackUrl, String filePath, String error, boolean cancelled);
|
271
277
|
|
272
|
-
@Override
|
273
|
-
public void onSetPropertiesData(String propId, String data, IRhoExtData ext) {
|
274
|
-
// Nothing
|
275
|
-
}
|
276
|
-
|
277
|
-
@Override
|
278
|
-
public void onNavigateComplete(String urlBeingNavigatedTo, IRhoExtData ext) {
|
279
|
-
}
|
280
|
-
|
281
|
-
@Override
|
282
|
-
public void onDocumentComplete(String urlOfDocument, IRhoExtData ext) {
|
283
|
-
}
|
284
|
-
|
285
|
-
@Override
|
286
|
-
public long onNavigateTimeout(String urlBeingNavigatedTo, IRhoExtData ext) {
|
287
|
-
// TODO Auto-generated method stub
|
288
|
-
return 0;
|
289
|
-
}
|
290
|
-
|
291
|
-
@Override
|
292
|
-
public long onSIPState(boolean bSIPState, IRhoExtData ext) {
|
293
|
-
return 0;
|
294
|
-
}
|
295
|
-
|
296
|
-
@Override
|
297
|
-
public long onNavigateError(String urlBeingNavigatedTo, IRhoExtData ext) {
|
298
|
-
return 0;
|
299
|
-
}
|
300
|
-
|
301
|
-
@Override
|
302
|
-
public void onAppActivate(boolean bActivate, IRhoExtData ext) {
|
303
|
-
}
|
304
278
|
}
|
305
279
|
|
306
280
|
|
@@ -198,7 +198,28 @@ class SignatureView extends SurfaceView implements SurfaceHolder.Callback {
|
|
198
198
|
}
|
199
199
|
}
|
200
200
|
}
|
201
|
-
|
201
|
+
{
|
202
|
+
PointSequence ps = mCurrentSequence;
|
203
|
+
if ((ps != null) && (ps.mPoints != null)) {
|
204
|
+
for (p = 1; p < ps.mPoints.size(); p++) {
|
205
|
+
PointF prev = ps.mPoints.elementAt(p-1);
|
206
|
+
PointF cur = ps.mPoints.elementAt(p);
|
207
|
+
if ((prev != null) && (cur != null)) {
|
208
|
+
canvas.drawLine(prev.x, prev.y, cur.x, cur.y, mPaint);
|
209
|
+
}
|
210
|
+
}
|
211
|
+
}
|
212
|
+
else {
|
213
|
+
if (ps == null) {
|
214
|
+
//Logger.D(TAG, "################## ps == null !");
|
215
|
+
}
|
216
|
+
else {
|
217
|
+
if (ps.mPoints == null) {
|
218
|
+
//Logger.D(TAG, "################## ps.mPoints == null !");
|
219
|
+
}
|
220
|
+
}
|
221
|
+
}
|
222
|
+
}
|
202
223
|
// update screen
|
203
224
|
if (redrawOnScreen && (!isTransparency)) {
|
204
225
|
Canvas c = null;
|
@@ -335,14 +356,17 @@ class SignatureView extends SurfaceView implements SurfaceHolder.Callback {
|
|
335
356
|
mCurrentSequence.mPoints.add(new PointF(x,y));
|
336
357
|
break;
|
337
358
|
case MotionEvent.ACTION_MOVE:
|
338
|
-
doDrawSegment(mX,mY, x,y);
|
359
|
+
//doDrawSegment(mX,mY, x,y);
|
339
360
|
mCurrentSequence.mPoints.add(new PointF(x,y));
|
361
|
+
doFullRedraw(mCanvas, mBitmap, true, true);
|
362
|
+
invalidate();
|
340
363
|
break;
|
341
364
|
case MotionEvent.ACTION_UP:
|
342
|
-
doDrawSegment(mX,mY, x,y);
|
365
|
+
//doDrawSegment(mX,mY, x,y);
|
343
366
|
mCurrentSequence.mPoints.add(new PointF(x,y));
|
344
367
|
mSequences.add(mCurrentSequence);
|
345
368
|
mCurrentSequence = new PointSequence();
|
369
|
+
doFullRedraw(mCanvas, mBitmap, true, true);
|
346
370
|
break;
|
347
371
|
}
|
348
372
|
|
@@ -40,8 +40,6 @@ public class Utils {
|
|
40
40
|
|
41
41
|
public static class FileSource {
|
42
42
|
|
43
|
-
public FileSource() {}
|
44
|
-
|
45
43
|
String[] list(String dir) throws IOException {
|
46
44
|
return new File(dir).list();
|
47
45
|
}
|
@@ -136,24 +134,25 @@ public class Utils {
|
|
136
134
|
}
|
137
135
|
}
|
138
136
|
|
139
|
-
public static void copyRecursively(FileSource fs,
|
137
|
+
public static void copyRecursively(FileSource fs, File source, File target, boolean deleteTarget) throws IOException
|
140
138
|
{
|
141
|
-
if (
|
139
|
+
if (deleteTarget && target.exists())
|
142
140
|
deleteRecursively(target);
|
143
141
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
142
|
+
if (source.isDirectory()) {
|
143
|
+
String[] children = fs.list(source.getAbsolutePath());
|
144
|
+
if (children != null && children.length > 0) {
|
145
|
+
if (!target.exists())
|
146
|
+
target.mkdirs();
|
147
|
+
|
148
|
+
for(String child: children)
|
149
|
+
copyRecursively(fs, new File(source, child), new File(target, child), false);
|
150
|
+
}
|
151
|
+
} else if (source.isFile()){
|
153
152
|
InputStream in = null;
|
154
153
|
OutputStream out = null;
|
155
154
|
try {
|
156
|
-
in = fs.open(source);
|
155
|
+
in = fs.open(source.getAbsolutePath());
|
157
156
|
target.getParentFile().mkdirs();
|
158
157
|
out = new FileOutputStream(target);
|
159
158
|
|
@@ -30,7 +30,7 @@ import com.rhomobile.rhodes.Logger;
|
|
30
30
|
import com.rhomobile.rhodes.RhoConf;
|
31
31
|
import com.rhomobile.rhodes.RhodesActivity;
|
32
32
|
import com.rhomobile.rhodes.RhodesService;
|
33
|
-
import com.rhomobile.rhodes.extmanager.
|
33
|
+
import com.rhomobile.rhodes.extmanager.RhoExtManager;
|
34
34
|
|
35
35
|
import android.graphics.Bitmap;
|
36
36
|
import android.net.http.SslError;
|
@@ -51,14 +51,14 @@ public class RhoWebViewClient extends WebViewClient
|
|
51
51
|
|
52
52
|
@Override
|
53
53
|
public void onPageStarted(WebView view, String url, Bitmap favicon) {
|
54
|
-
|
55
|
-
RhoExtManagerSingleton.getRhoExtManagerInstance().onBeforeNavigate(url);
|
54
|
+
super.onPageStarted(view, url, favicon);
|
56
55
|
|
57
56
|
if (RhodesActivity.ENABLE_LOADING_INDICATION)
|
58
57
|
RhodesActivity.safeGetInstance().getWindow().setFeatureInt(Window.FEATURE_PROGRESS, 0);
|
59
58
|
else
|
60
59
|
RhodesActivity.safeGetInstance().getWindow().setFeatureInt(Window.FEATURE_PROGRESS, RhodesActivity.MAX_PROGRESS);
|
61
|
-
|
60
|
+
|
61
|
+
RhoExtManager.getImplementationInstance().onBeforeNavigate(view, url);
|
62
62
|
}
|
63
63
|
|
64
64
|
@Override
|
@@ -69,11 +69,18 @@ public class RhoWebViewClient extends WebViewClient
|
|
69
69
|
RhodesActivity.safeGetInstance().getWindow().setFeatureInt(
|
70
70
|
Window.FEATURE_PROGRESS, RhodesActivity.MAX_PROGRESS);
|
71
71
|
|
72
|
+
RhoExtManager.getImplementationInstance().onLoadEnd(view, url, 0, 0);
|
73
|
+
|
72
74
|
super.onPageFinished(view, url);
|
73
75
|
}
|
74
76
|
|
75
|
-
|
77
|
+
@Override
|
78
|
+
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl)
|
76
79
|
{
|
80
|
+
super.onReceivedError(view, errorCode, description, failingUrl);
|
81
|
+
|
82
|
+
RhoExtManager.getImplementationInstance().onLoadError(view);
|
83
|
+
|
77
84
|
StringBuilder msg = new StringBuilder(failingUrl);
|
78
85
|
msg.append(" failed: ");
|
79
86
|
msg.append(errorCode);
|
@@ -98,12 +98,13 @@ platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettingsOld.java
|
|
98
98
|
platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebViewClient.java
|
99
99
|
platform/android/Rhodes/src/com/rhomobile/rhodes/webview/IRhoWebView.java
|
100
100
|
platform/android/Rhodes/src/com/rhomobile/rhodes/webview/GoogleWebView.java
|
101
|
+
platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/AbstractRhoExtension.java
|
101
102
|
platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtData.java
|
102
103
|
platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtension.java
|
103
104
|
platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtManager.java
|
104
105
|
platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtDataImpl.java
|
105
106
|
platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerImpl.java
|
106
|
-
platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/
|
107
|
+
platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManager.java
|
107
108
|
platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality.java
|
108
109
|
platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality01.java
|
109
110
|
platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality02.java
|
@@ -337,11 +337,17 @@ namespace "config" do
|
|
337
337
|
end
|
338
338
|
|
339
339
|
task :android => :set_android_platform do
|
340
|
-
|
340
|
+
|
341
341
|
Rake::Task["config:common"].invoke
|
342
342
|
|
343
343
|
$java = $config["env"]["paths"]["java"]
|
344
344
|
|
345
|
+
$neon_root = nil
|
346
|
+
$neon_root = $config["env"]["paths"]["neon"] unless $config["env"]["paths"].nil?
|
347
|
+
if !($app_config["paths"].nil? or $app_config["paths"]["neon"].nil?)
|
348
|
+
$neon_root = $app_config["paths"]["neon"]
|
349
|
+
end
|
350
|
+
|
345
351
|
$androidsdkpath = $config["env"]["paths"]["android"]
|
346
352
|
unless File.exists? $androidsdkpath
|
347
353
|
puts "Missing or invalid 'android' section in rhobuild.yml: '#{$androidsdkpath}'"
|
@@ -580,7 +586,8 @@ namespace "config" do
|
|
580
586
|
$use_google_addon_api = true unless $app_config["capabilities"].index("push").nil?
|
581
587
|
|
582
588
|
unless $app_config['capabilities'].index('motorola').nil? and $app_config['capabilities'].index('motoroladev').nil?
|
583
|
-
$use_motosol_barcode_api = true if $app_config['extensions'].index('barcode') or $app_config['extensions'].index('barcode-moto')
|
589
|
+
$use_motosol_barcode_api = true #if $app_config['extensions'].index('barcode') or $app_config['extensions'].index('barcode-moto')
|
590
|
+
$use_motosol_api_classpath = true unless $app_config['capabilities'].index('motoroladev').nil?
|
584
591
|
raise 'Cannot use Motorola SDK addon and Google SDK addon together!' if $use_google_addon_api
|
585
592
|
end
|
586
593
|
|
@@ -592,7 +599,7 @@ namespace "config" do
|
|
592
599
|
end
|
593
600
|
|
594
601
|
# Look for Motorola barcode SDK addon
|
595
|
-
if $
|
602
|
+
if $use_motosol_api_classpath
|
596
603
|
Dir.glob(File.join($androidsdkpath, 'add-ons', '*')).each do |dir|
|
597
604
|
apijar = File.join(dir, 'libs', 'com.motorolasolutions.scanner.jar')
|
598
605
|
if File.exists? apijar
|
@@ -748,27 +755,41 @@ namespace "build" do
|
|
748
755
|
end
|
749
756
|
|
750
757
|
end
|
751
|
-
# desc "Build RhoBundle for android"
|
752
|
-
task :rhobundle => ["config:android","build:bundle:noxruby",:extensions] do
|
753
|
-
# Rake::Task["build:bundle:noxruby"].execute
|
754
758
|
|
755
|
-
|
759
|
+
desc "Build RhoBundle for android"
|
760
|
+
task :rhobundle => ["config:android", :extensions] do
|
761
|
+
|
762
|
+
Rake::Task["build:bundle:noxruby"].invoke
|
763
|
+
|
764
|
+
#assets = File.join(Jake.get_absolute($androidpath), "Rhodes", "assets")
|
765
|
+
assets = File.join $tmpdir, 'assets'
|
756
766
|
rm_rf assets
|
757
767
|
mkdir_p assets
|
758
768
|
hash = nil
|
759
769
|
["apps", "db", "lib"].each do |d|
|
760
770
|
cp_r File.join($srcdir, d), assets, :preserve => true
|
761
771
|
# Calculate hash of directories
|
762
|
-
hash = get_dir_hash(File.join(
|
772
|
+
hash = get_dir_hash(File.join($srcdir, d), hash)
|
773
|
+
end
|
774
|
+
File.open(File.join($srcdir, "hash"), "w") { |f| f.write(hash.hexdigest) }
|
775
|
+
File.open(File.join($srcdir, "name"), "w") { |f| f.write($appname) }
|
776
|
+
Jake.build_file_map($srcdir, "rho.dat")
|
777
|
+
|
778
|
+
["apps", "db", "lib", "hash", "name", "rho.dat"].each do |d|
|
779
|
+
cp_r File.join($srcdir, d), assets, :preserve => true
|
763
780
|
end
|
764
|
-
File.open(File.join(assets, "hash"), "w") { |f| f.write(hash.hexdigest) }
|
765
781
|
|
766
|
-
File.open(File.join(assets, "name"), "w") { |f| f.write($appname) }
|
767
|
-
|
768
|
-
Jake.build_file_map(assets, "rho.dat")
|
769
782
|
end
|
770
783
|
|
771
|
-
|
784
|
+
desc "Build RhoBundle for Eclipse project"
|
785
|
+
task :eclipsebundle => "build:android:rhobundle" do
|
786
|
+
assets = File.join $tmpdir, 'assets'
|
787
|
+
eclipse_assets = File.join(Jake.get_absolute($androidpath), "Rhodes", "assets")
|
788
|
+
rm_rf eclipse_assets
|
789
|
+
cp_r assets, eclipse_assets, :preserve => true
|
790
|
+
end
|
791
|
+
|
792
|
+
task :extensions => ["config:android", :genconfig] do
|
772
793
|
|
773
794
|
ENV['RHO_PLATFORM'] = 'android'
|
774
795
|
ENV["ANDROID_NDK"] = $androidndkpath
|
@@ -778,6 +799,7 @@ namespace "build" do
|
|
778
799
|
ENV["BUILD_DIR"] ||= $startdir + "/platform/android/build"
|
779
800
|
ENV["RHO_INC"] = $appincdir
|
780
801
|
ENV["RHO_ANDROID_TMP_DIR"] = $tmpdir
|
802
|
+
ENV["NEON_ROOT"] = $neon_root unless $neon_root.nil?
|
781
803
|
|
782
804
|
ext_build_files = File.join($extensionsdir, "ext_build.files")
|
783
805
|
if File.exist? ext_build_files
|
@@ -1460,8 +1482,19 @@ namespace "build" do
|
|
1460
1482
|
end
|
1461
1483
|
end
|
1462
1484
|
|
1485
|
+
task :upgrade_package => :rhobundle do
|
1486
|
+
#puts '$$$$$$$$$$$$$$$$$$'
|
1487
|
+
#puts 'targetdir = '+$targetdir.to_s
|
1488
|
+
#puts 'bindir = '+$bindir.to_s
|
1489
|
+
android_targetdir = File.join($targetdir, 'android')
|
1490
|
+
mkdir_p android_targetdir if not File.exists? android_targetdir
|
1491
|
+
zip_file_path = File.join(android_targetdir, 'upgrade_bundle.zip')
|
1492
|
+
Jake.build_file_map(File.join($srcdir, "apps"), "rhofilelist.txt")
|
1493
|
+
Jake.zip_upgrade_bundle($bindir, zip_file_path)
|
1494
|
+
end
|
1495
|
+
|
1463
1496
|
#desc "build all"
|
1464
|
-
task :all => [:rhobundle, :rhodes]
|
1497
|
+
task :all => ['build:android:rhobundle', :rhodes]
|
1465
1498
|
end
|
1466
1499
|
end
|
1467
1500
|
|
@@ -1482,7 +1515,7 @@ namespace "package" do
|
|
1482
1515
|
|
1483
1516
|
manifest = $appmanifest
|
1484
1517
|
resource = $appres
|
1485
|
-
assets =
|
1518
|
+
assets = File.join($tmpdir, 'assets')
|
1486
1519
|
resourcepkg = $bindir + "/rhodes.ap_"
|
1487
1520
|
|
1488
1521
|
puts "Packaging Assets and Jars"
|
@@ -1498,8 +1531,6 @@ namespace "package" do
|
|
1498
1531
|
end
|
1499
1532
|
|
1500
1533
|
# Workaround: manually add files starting with '_' because aapt silently ignore such files when creating package
|
1501
|
-
rm_rf File.join($tmpdir, "assets")
|
1502
|
-
cp_r assets, $tmpdir
|
1503
1534
|
Dir.glob(File.join($tmpdir, "assets/**/*")).each do |f|
|
1504
1535
|
next unless File.basename(f) =~ /^_/
|
1505
1536
|
relpath = Pathname.new(f).relative_path_from(Pathname.new($tmpdir)).to_s
|