rhodes 5.5.2 → 5.5.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +1 -1
- data/CREDITS +3 -3
- data/LICENSE +1 -1
- data/README.html +1 -1
- data/Rakefile +53 -14
- data/bin/get-rhodes-info +0 -0
- data/extensions/rhoconnect-push/ext/rhoconnect-push/platform/android/Rakefile +1 -1
- data/lib/build/jake.rb +11 -0
- data/lib/commonAPI/barcode/ext/platform/iphone/impl/BarcodeFactory.m +2 -1
- data/lib/commonAPI/coreapi/ext/NativeTabbar.xml +4 -0
- data/lib/commonAPI/coreapi/ext/platform/iphone/cpp_based_impl/SystemImpl.mm +1 -0
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/NativeTabbarSingleton.m +7 -2
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/NativeToolbarSingleton.m +6 -2
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/NavbarSingleton.m +8 -2
- data/lib/commonAPI/coreapi/ext/shared/ApplicationImpl.cpp +3 -0
- data/lib/commonAPI/coreapi/ext/shared/NetworkImpl.cpp +1 -0
- data/lib/commonAPI/coreapi/ext/shared/TimerImpl.cpp +36 -27
- data/lib/commonAPI/coreapi/public/api/rhoapi.js +6 -3
- data/lib/commonAPI/mediacapture/ext.yml +1 -2
- data/lib/commonAPI/mediacapture/ext/build.bat +8 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/MediaCapture.pro +82 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/Rakefile +35 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/resources/diaClosed.png +0 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/resources/diaOpened.png +0 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/resources/mediacapture.qrc +7 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/resources/photoSave.png +0 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/src/CCameraData.cpp +83 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/src/CCameraData.h +54 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/src/CameraDialogBuilder.h +36 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/src/CameraDialogController.h +31 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/src/CameraDialogView.h +73 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/src/Camera_impl.cpp +337 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/src/ImageFileNameGetter.h +40 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/src/ImageFilenameGetterResult.h +36 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/src/cameracrossthreadhalper.h +17 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/src/cameradialogview.cpp +178 -0
- data/lib/commonAPI/mediacapture/ext/shared/MediacaptureInit.cpp +8 -8
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/version.rb +1 -1
- data/platform/android/Rhodes/AndroidManifest.xml.erb +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +9 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SplashScreen.java +33 -0
- data/platform/android/build/android.rake +97 -43
- data/platform/android/build/android_studio_project_generator.rb +21 -0
- data/platform/android/build/android_tools.rb +8 -6
- data/platform/iphone/Classes/AppManager/AppManager.h +6 -0
- data/platform/iphone/Classes/AppManager/AppManager.m +76 -37
- data/platform/iphone/Classes/MapView/GoogleGeocoder.m +2 -3
- data/platform/iphone/Classes/MapView/MapViewController.m +3 -3
- data/platform/iphone/Classes/NativeBar.h +1 -0
- data/platform/iphone/Classes/NativeBar.m +15 -0
- data/platform/iphone/Classes/RhoViewController.m +8 -3
- data/platform/iphone/Classes/RhoWKWebView.m +1 -1
- data/platform/iphone/Classes/Rhodes.m +55 -38
- data/platform/iphone/Classes/SimpleMainView.m +3 -2
- data/platform/iphone/Classes/TabbedMainView.h +2 -0
- data/platform/iphone/Classes/TabbedMainView.m +15 -3
- data/platform/iphone/Classes/URLProtocol/CRhoURLProtocol.h +2 -0
- data/platform/iphone/Classes/URLProtocol/CRhoURLProtocol.m +185 -30
- data/platform/iphone/Classes/rho/net/IPhoneNetRequest.mm +105 -6
- data/platform/iphone/rbuild/iphone.rake +426 -267
- data/platform/iphone/rbuild/putsOverride.rake +8 -0
- data/platform/shared/api_generator/iphone/CJSConverter.mm +5 -3
- data/platform/shared/common/BundleManager.cpp +16 -6
- data/platform/shared/common/PosixThreadImpl.cpp +10 -4
- data/platform/shared/common/RhoTime.cpp +81 -40
- data/platform/shared/common/RhodesApp.cpp +2 -2
- data/platform/shared/common/RhodesApp.h +1 -1
- data/platform/shared/db/DBAdapter.cpp +33 -0
- data/platform/shared/db/DBAdapter.h +5 -0
- data/platform/shared/logging/RhoLogConf.cpp +17 -1
- data/platform/shared/logging/RhoLogConf.h +6 -0
- data/platform/shared/net/CURLNetRequest.cpp +6 -0
- data/platform/shared/net/HttpServer.cpp +27 -1
- data/platform/shared/net/INetRequest.cpp +33 -6
- data/platform/shared/net/INetRequest.h +2 -0
- data/platform/shared/qt/RhoSimulator_dev.pro +14 -10
- data/platform/shared/qt/rhodes/QtMainWindow.cpp +2 -2
- data/platform/shared/qt/rhodes/iexecutable.h +27 -0
- data/platform/shared/qt/rhodes/impl/MainWindowImpl.cpp +5 -0
- data/platform/shared/qt/rhodes/impl/MainWindowImpl.h +3 -0
- data/platform/shared/qt/rhodes/qkineticscroller.cpp +2 -2
- data/platform/shared/qt/rhodes/qkineticscroller_p.h +1 -1
- data/platform/shared/qt/rhodes/qtscrollerfilter.cpp +3 -3
- data/platform/shared/qt/rhodes/qtscrollevent.cpp +2 -2
- data/platform/shared/qt/rhodes/qwebviewkineticscroller.cpp +1 -1
- data/platform/shared/qt/rhodes/qwebviewkineticscroller.h +1 -1
- data/platform/shared/qt/rhodes/resources/rho.png +0 -0
- data/platform/shared/qt/rhodes/rhodes.pro +3 -2
- data/platform/wm/build/wm.rake +28 -9
- data/platform/wm/rhodes/browser/BrowserFactory.cpp +4 -6
- data/platform/wm/rhodes/browser/stubs.cpp +5 -0
- data/platform/wm/rhodes/rho/net/NetRequestImpl.h +3 -0
- data/platform/wm/rhodes/rhodes.vcproj +31 -2
- data/rakefile.rb +53 -14
- data/res/build-tools/iphonesim/build/Release/iphonesim_8 +2 -2
- data/res/generators/rhogen.rb +6 -147
- data/res/generators/templates/api/platform/iphone/generated/base_impl/MontanaBase.m +7 -7
- data/res/generators/templates/api/platform/iphone/generated/javascript/montana_js_wrap.mm +2 -4
- data/res/generators/templates/application/AndroidManifest.erb +1 -1
- data/res/generators/templates/application/app/Settings/home.erb +1 -1
- data/res/generators/templates/application/build.yml +52 -6
- data/res/generators/templates/application/icon/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-hdpi/ic_notification.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-hdpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-hdpi/loading.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-ldpi/ic_notification.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-ldpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-ldpi/loading.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-mdpi/ic_notification.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-mdpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-mdpi/loading.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-xhdpi/ic_notification.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-xhdpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-xhdpi/loading.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-xxhdpi/ic_notification.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-xxhdpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-xxhdpi/loading.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-xxxhdpi/ic_notification.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-xxxhdpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-xxxhdpi/loading.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable/ic_notification.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable/loading.png +0 -0
- data/res/generators/templates/application/resources/android/res/mipmap-hdpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/mipmap-ldpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/mipmap-mdpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/mipmap-xhdpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/mipmap-xxhdpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/mipmap-xxxhdpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/mipmap/icon.png +0 -0
- data/res/generators/templates/application/{app/loading-568h@2x.png → resources/ios/Default-568h@2x.png} +0 -0
- data/res/generators/templates/application/{app/loading-667h@2x.png → resources/ios/Default-667h@2x.png} +0 -0
- data/res/generators/templates/application/{app/loading-736h@3x.png → resources/ios/Default-736h@3x.png} +0 -0
- data/res/generators/templates/application/{app/loading-Landscape.png → resources/ios/Default-Landscape.png} +0 -0
- data/res/generators/templates/application/{app/loading-Landscape@2x.png → resources/ios/Default-Landscape@2x.png} +0 -0
- data/res/generators/templates/application/{app/loading-LandscapeLeft.png → resources/ios/Default-LandscapeLeft.png} +0 -0
- data/res/generators/templates/application/{app/loading-LandscapeLeft@2x.png → resources/ios/Default-LandscapeLeft@2x.png} +0 -0
- data/res/generators/templates/application/{app/loading-LandscapeRight.png → resources/ios/Default-LandscapeRight.png} +0 -0
- data/res/generators/templates/application/{app/loading-LandscapeRight@2x.png → resources/ios/Default-LandscapeRight@2x.png} +0 -0
- data/res/generators/templates/application/{app/loading-Portrait.png → resources/ios/Default-Portrait.png} +0 -0
- data/res/generators/templates/application/{app/loading-Portrait@2x.png → resources/ios/Default-Portrait@2x.png} +0 -0
- data/res/generators/templates/application/{app/loading-PortraitUpsideDown.png → resources/ios/Default-PortraitUpsideDown.png} +0 -0
- data/res/generators/templates/application/{app/loading-PortraitUpsideDown@2x.png → resources/ios/Default-PortraitUpsideDown@2x.png} +0 -0
- data/res/generators/templates/application/resources/ios/Default.png +0 -0
- data/res/generators/templates/application/{app/loading@2x.png → resources/ios/Default@2x.png} +0 -0
- data/res/generators/templates/application/resources/ios/iTunesArtwork.png +0 -0
- data/res/generators/templates/application/resources/ios/iTunesArtwork@2x.png +0 -0
- data/res/generators/templates/application/resources/ios/icon114.png +0 -0
- data/res/generators/templates/application/resources/ios/icon120.png +0 -0
- data/res/generators/templates/application/resources/ios/icon144.png +0 -0
- data/res/generators/templates/application/resources/ios/icon152.png +0 -0
- data/res/generators/templates/application/resources/ios/icon180.png +0 -0
- data/res/generators/templates/application/resources/ios/icon57.png +0 -0
- data/res/generators/templates/application/resources/ios/icon60.png +0 -0
- data/res/generators/templates/application/resources/ios/icon72.png +0 -0
- data/res/generators/templates/application/resources/ios/icon76.png +0 -0
- data/res/generators/templates/application/rhoconfig.txt +2 -1
- data/res/generators/templates/iphone_project/Bremen7.xcodeproj/project.pbxproj +44 -0
- data/res/generators/templates/iphone_project/Resources/back_btn.png +0 -0
- data/res/generators/templates/iphone_project/Resources/back_btn@2x.png +0 -0
- data/res/generators/templates/iphone_project/Resources/back_btn@3x.png +0 -0
- data/res/generators/templates/iphone_project/Resources/forward_btn.png +0 -0
- data/res/generators/templates/iphone_project/Resources/forward_btn@2x.png +0 -0
- data/res/generators/templates/iphone_project/Resources/forward_btn@3x.png +0 -0
- data/res/generators/templates/iphone_project/Resources/gears.png +0 -0
- data/res/generators/templates/iphone_project/Resources/gears@2x.png +0 -0
- data/res/generators/templates/iphone_project/Resources/gears@3x.png +0 -0
- data/res/generators/templates/iphone_project/Resources/home_btn.png +0 -0
- data/res/generators/templates/iphone_project/Resources/home_btn@2x.png +0 -0
- data/res/generators/templates/iphone_project/Resources/home_btn@3x.png +0 -0
- data/res/generators/templates/iphone_project/Resources/sync_btn.png +0 -0
- data/res/generators/templates/iphone_project/Resources/sync_btn@2x.png +0 -0
- data/res/generators/templates/iphone_project/Resources/sync_btn@3x.png +0 -0
- data/res/generators/templates/iphone_project/buildRhoBundle +23 -7
- data/res/generators/templates/iphone_project/root/Info.plist +0 -7
- data/res/generators/templates/iphone_project/root/iTunesArtwork +0 -0
- data/res/generators/templates/iphone_project/root/iTunesArtwork@2x +0 -0
- data/res/generators/templates/iphone_project/root/icon114.png +0 -0
- data/res/generators/templates/iphone_project/root/icon120.png +0 -0
- data/res/generators/templates/iphone_project/root/icon144.png +0 -0
- data/res/generators/templates/iphone_project/root/icon152.png +0 -0
- data/res/generators/templates/iphone_project/root/icon180.png +0 -0
- data/res/generators/templates/iphone_project/root/icon57.png +0 -0
- data/res/generators/templates/iphone_project/root/icon60.png +0 -0
- data/res/generators/templates/iphone_project/root/icon72.png +0 -0
- data/res/generators/templates/iphone_project/root/icon76.png +0 -0
- data/res/generators/templates/project/android_studio_project/app/build.gradle.erb +88 -0
- data/res/generators/templates/project/android_studio_project/build.gradle +23 -0
- data/res/generators/templates/project/android_studio_project/gradle.properties +17 -0
- data/res/generators/templates/project/android_studio_project/gradlew +160 -0
- data/res/generators/templates/project/android_studio_project/gradlew.bat +90 -0
- data/res/generators/templates/project/android_studio_project/settings.gradle +1 -0
- data/rhodes.gemspec +7 -6
- data/version +1 -1
- metadata +135 -42
- data/res/generators/templates/application/icon/icon.svg +0 -22
- data/res/generators/templates/application/icon/icon114.png +0 -0
- data/res/generators/templates/application/icon/icon120.png +0 -0
- data/res/generators/templates/application/icon/icon144.png +0 -0
- data/res/generators/templates/application/icon/icon152.png +0 -0
- data/res/generators/templates/application/icon/icon180.png +0 -0
- data/res/generators/templates/application/icon/icon57.png +0 -0
- data/res/generators/templates/application/icon/icon60.png +0 -0
- data/res/generators/templates/application/icon/icon72.png +0 -0
- data/res/generators/templates/application/icon/icon76.png +0 -0
- data/res/generators/templates/application/production/iTunesArtwork.png +0 -0
- data/res/generators/templates/application/production/iTunesArtwork@2x.png +0 -0
@@ -1,15 +1,15 @@
|
|
1
1
|
#include "common/RhodesApp.h"
|
2
2
|
|
3
|
-
#
|
3
|
+
#if !defined(OS_WP8) && !defined(OS_WINDOWS_DESKTOP)
|
4
4
|
extern "C" void Init_Camera_API();
|
5
5
|
extern "C" void Init_Videocapture();
|
6
6
|
#endif
|
7
|
-
#if defined(OS_WINCE) || defined(OS_WP8)
|
7
|
+
#if defined(OS_WINCE) || defined(OS_WP8) || defined(OS_WINDOWS_DESKTOP)
|
8
8
|
extern "C" void Init_Camera_extension();
|
9
9
|
#endif
|
10
|
-
extern "C" void Init_Mediacapture_extension()
|
11
|
-
{
|
12
|
-
#
|
10
|
+
extern "C" void Init_Mediacapture_extension()
|
11
|
+
{
|
12
|
+
#if !defined(OS_WP8) && !defined(OS_WINDOWS_DESKTOP)
|
13
13
|
Init_Camera_API();
|
14
14
|
#ifndef RHO_NO_RUBY_API
|
15
15
|
RHODESAPP().getExtManager().requireRubyFile("RhoCameraApi");
|
@@ -18,7 +18,7 @@ extern "C" void Init_Mediacapture_extension()
|
|
18
18
|
Init_Videocapture();
|
19
19
|
#endif
|
20
20
|
|
21
|
-
#if defined(OS_WINCE) || defined(OS_WP8)
|
22
|
-
Init_Camera_extension();
|
23
|
-
#endif
|
21
|
+
#if defined(OS_WINCE) || defined(OS_WP8) || defined(OS_WINDOWS_DESKTOP)
|
22
|
+
Init_Camera_extension();
|
23
|
+
#endif
|
24
24
|
}
|
data/lib/framework/rhodes.rb
CHANGED
data/lib/framework/version.rb
CHANGED
@@ -25,7 +25,7 @@
|
|
25
25
|
<supports-screens android:smallScreens='true' android:normalScreens='true' android:largeScreens='true' android:xlargeScreens='true'/>
|
26
26
|
<application android:name='com.rhomobile.rhodes.RhodesApplication'
|
27
27
|
android:label='@string/app_name'
|
28
|
-
android:icon='@
|
28
|
+
android:icon='@mipmap/icon'
|
29
29
|
android:debuggable='<%= @debuggable %>'>
|
30
30
|
|
31
31
|
<!-- Uses libraries -->
|
@@ -1047,8 +1047,15 @@ public class RhodesService extends Service {
|
|
1047
1047
|
RhodesService service = getInstance();
|
1048
1048
|
Context ctx = RhodesService.getContext();
|
1049
1049
|
|
1050
|
-
Intent intent =
|
1051
|
-
|
1050
|
+
Intent intent = service.getPackageManager().getLaunchIntentForPackage(appName);
|
1051
|
+
|
1052
|
+
try {
|
1053
|
+
service.resolveAppName(appName, intent);
|
1054
|
+
} catch ( Throwable e ) {
|
1055
|
+
Logger.W(TAG, "Can't resolve app name, will run with default intent: " + appName);
|
1056
|
+
Logger.W(TAG, e);
|
1057
|
+
}
|
1058
|
+
|
1052
1059
|
service.parseAppParams(params, intent);
|
1053
1060
|
|
1054
1061
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
@@ -35,6 +35,7 @@ import java.lang.Thread;
|
|
35
35
|
|
36
36
|
import android.app.Activity;
|
37
37
|
import android.content.res.AssetManager;
|
38
|
+
import android.graphics.Bitmap;
|
38
39
|
import android.graphics.BitmapFactory;
|
39
40
|
import android.graphics.Color;
|
40
41
|
import android.os.Environment;
|
@@ -164,6 +165,19 @@ public class SplashScreen implements MainView{
|
|
164
165
|
type++;
|
165
166
|
}
|
166
167
|
|
168
|
+
Bitmap loading_bitmap = null;
|
169
|
+
try {
|
170
|
+
Logger.I(TAG, "Loading image try to open from resources !!!");
|
171
|
+
int loading_id = RhoExtManager.getResourceId("drawable.loading");
|
172
|
+
loading_bitmap = BitmapFactory.decodeResource(activity.getResources(), loading_id);
|
173
|
+
if (loading_bitmap != null) {
|
174
|
+
type = 55;
|
175
|
+
}
|
176
|
+
}
|
177
|
+
catch (Throwable e) {
|
178
|
+
Logger.E(TAG, e);
|
179
|
+
}
|
180
|
+
|
167
181
|
switch (type) {
|
168
182
|
case 0:
|
169
183
|
try {
|
@@ -244,6 +258,25 @@ public class SplashScreen implements MainView{
|
|
244
258
|
mView = webView;
|
245
259
|
}
|
246
260
|
break;
|
261
|
+
case 55:
|
262
|
+
{
|
263
|
+
try {
|
264
|
+
Logger.I(TAG, "Loading image from resource R.drawable.loading !");
|
265
|
+
|
266
|
+
ImageView imageView = new ImageView(activity);
|
267
|
+
imageView.setBackgroundColor(mBackgroundColor);
|
268
|
+
imageView.setImageBitmap(loading_bitmap);
|
269
|
+
loading_bitmap = null;
|
270
|
+
imageView.setAdjustViewBounds(true);
|
271
|
+
imageView.setScaleType(mScaleType);
|
272
|
+
mView = imageView;
|
273
|
+
RhoExtManager.getInstance().registerExtension("SplashScreen", mDocCompleteListener = new SplashScreenExtension());
|
274
|
+
}
|
275
|
+
catch (Throwable e) {
|
276
|
+
Logger.E(TAG, e);
|
277
|
+
}
|
278
|
+
}
|
279
|
+
break;
|
247
280
|
default:
|
248
281
|
{
|
249
282
|
mSplashScreenListener.onSplashScreenGone(this);
|
@@ -29,6 +29,7 @@ require File.dirname(__FILE__) + '/android_tools.rb'
|
|
29
29
|
require File.dirname(__FILE__) + '/maven_deps_extractor.rb'
|
30
30
|
require File.dirname(__FILE__) + '/manifest_generator.rb'
|
31
31
|
require File.dirname(__FILE__) + '/eclipse_project_generator.rb'
|
32
|
+
require File.dirname(__FILE__) + '/android_studio_project_generator.rb'
|
32
33
|
require File.dirname(__FILE__) + '/../../../lib/build/BuildConfig'
|
33
34
|
load File.dirname(__FILE__) + '/android-repack.rake'
|
34
35
|
require 'pathname'
|
@@ -76,48 +77,66 @@ ANDROID_PERMISSIONS = {
|
|
76
77
|
ANDROID_CAPS_ALWAYS_ENABLED = ['network_state']
|
77
78
|
|
78
79
|
def set_app_icon_android
|
79
|
-
iconappbase = File.join $app_path, 'icon', 'icon'
|
80
|
-
|
81
|
-
{'drawable' => '',
|
82
|
-
'drawable-ldpi' => '36',
|
83
|
-
'drawable-mdpi' => '48',
|
84
|
-
'drawable-hdpi' => '72',
|
85
|
-
'drawable-xhdpi' => '96',
|
86
|
-
'drawable-xxhdpi' => '144',
|
87
|
-
'drawable-xxxhdpi' => '192'
|
88
|
-
}.each do |folder, size|
|
89
|
-
drawable = File.join $appres, folder
|
90
|
-
iconresname = File.join(drawable, "icon.png")
|
91
|
-
|
92
|
-
iconapppath = iconappbase + size + '.png'
|
93
|
-
|
94
|
-
if File.exists?(iconapppath) or File.exists?(iconresname)
|
95
|
-
iconapppath = iconappbase + '.png' unless File.exists? iconapppath
|
96
|
-
rm_f iconresname
|
97
|
-
mkdir_p drawable
|
98
|
-
cp iconapppath, iconresname if File.exist? drawable
|
99
|
-
end
|
100
|
-
end
|
101
80
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
81
|
+
res_path = File.join($app_path, 'resources', 'android', 'res')
|
82
|
+
if File.exists? res_path
|
83
|
+
# NEW resource - just copy it to res folder
|
84
|
+
puts "add resources from application'sresource folder [#{res_path}] to [#{$tmpdir}]"
|
85
|
+
cp_r res_path, $tmpdir
|
86
|
+
|
87
|
+
else
|
88
|
+
# NEW resources not found - use old mechanism
|
89
|
+
|
90
|
+
iconappbase = File.join $app_path, 'icon', 'icon'
|
91
|
+
|
92
|
+
{'drawable' => '',
|
93
|
+
'drawable-ldpi' => '36',
|
94
|
+
'drawable-mdpi' => '48',
|
95
|
+
'drawable-hdpi' => '72',
|
96
|
+
'drawable-xhdpi' => '96',
|
97
|
+
'drawable-xxhdpi' => '144',
|
98
|
+
'drawable-xxxhdpi' => '192',
|
99
|
+
'mipmap' => '',
|
100
|
+
'mipmap-ldpi' => '36',
|
101
|
+
'mipmap-mdpi' => '48',
|
102
|
+
'mipmap-hdpi' => '72',
|
103
|
+
'mipmap-xhdpi' => '96',
|
104
|
+
'mipmap-xxhdpi' => '144',
|
105
|
+
'mipmap-xxxhdpi' => '192'
|
106
|
+
}.each do |folder, size|
|
107
|
+
drawable = File.join $appres, folder
|
108
|
+
iconresname = File.join(drawable, "icon.png")
|
109
|
+
|
110
|
+
iconapppath = iconappbase + size + '.png'
|
111
|
+
|
112
|
+
if File.exists?(iconapppath) or File.exists?(iconresname)
|
113
|
+
iconapppath = iconappbase + '.png' unless File.exists? iconapppath
|
114
|
+
rm_f iconresname
|
115
|
+
mkdir_p drawable
|
116
|
+
cp iconapppath, iconresname if File.exist? drawable
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
{'drawable' => '',
|
121
|
+
'drawable-ldpi' => '18',
|
122
|
+
'drawable-mdpi' => '24',
|
123
|
+
'drawable-hdpi' => '36',
|
124
|
+
'drawable-xhdpi' => '48',
|
125
|
+
'drawable-xxhdpi' => '72',
|
126
|
+
'drawable-xxxhdpi' => '96'
|
127
|
+
}.each do |folder, size|
|
128
|
+
drawable = File.join $appres, folder
|
129
|
+
iconresname = File.join(drawable, "ic_notification.png")
|
130
|
+
|
131
|
+
iconapppath = iconappbase + size + '.png'
|
132
|
+
|
133
|
+
if File.exists?(iconapppath) or File.exists?(iconresname)
|
134
|
+
iconapppath = iconappbase + '.png' unless File.exists? iconapppath
|
135
|
+
rm_f iconresname
|
136
|
+
mkdir_p drawable
|
137
|
+
cp iconapppath, iconresname if File.exist? drawable
|
138
|
+
end
|
139
|
+
end
|
121
140
|
end
|
122
141
|
end
|
123
142
|
|
@@ -211,8 +230,40 @@ namespace 'project' do
|
|
211
230
|
end
|
212
231
|
|
213
232
|
task :studio => ['config:android', 'config:android:extensions','build:android:manifest'] do
|
214
|
-
|
215
|
-
|
233
|
+
|
234
|
+
project_template_path = File.join 'res','generators','templates','project','android_studio_project'
|
235
|
+
|
236
|
+
|
237
|
+
main_gradle_script = File.join( project_template_path, 'build.gradle' )
|
238
|
+
gradle_properties = File.join( project_template_path, 'gradle.properties' )
|
239
|
+
gradlew = File.join( project_template_path, 'gradlew' )
|
240
|
+
gradlew_bat = File.join( project_template_path, 'gradlew.bat' )
|
241
|
+
settings_gradle = File.join( project_template_path, 'settings.gradle' )
|
242
|
+
app_gradle_template = File.join( project_template_path, 'app', 'build.gradle.erb' )
|
243
|
+
project_path = File.join $app_path,'project','android_studio'
|
244
|
+
|
245
|
+
rhodes_path = File.absolute_path '.'
|
246
|
+
|
247
|
+
generator = AndroidStudioProjectGenerator.new
|
248
|
+
generator.rhoRoot = rhodes_path
|
249
|
+
generator.buildToolsVersion = $build_tools_ver
|
250
|
+
generator.applicationId = $app_package_name
|
251
|
+
generator.minSdkVersion = $min_sdk_level
|
252
|
+
generator.targetSdkVersion = 12
|
253
|
+
generator.compileSdkVersion = $found_api_level
|
254
|
+
generator.versionName = $app_config["version"]
|
255
|
+
|
256
|
+
|
257
|
+
mkdir_p File.join(project_path,'app')
|
258
|
+
|
259
|
+
app_gradle_path = File.join( project_path, 'app', 'build.gradle')
|
260
|
+
File.open( app_gradle_path, 'w' ) { |f| f.write generator.render_app_gradle( app_gradle_template ) }
|
261
|
+
|
262
|
+
cp main_gradle_script, project_path
|
263
|
+
cp gradle_properties, project_path
|
264
|
+
cp gradlew, project_path
|
265
|
+
cp gradlew_bat, project_path
|
266
|
+
cp settings_gradle, project_path
|
216
267
|
end
|
217
268
|
end
|
218
269
|
end
|
@@ -528,6 +579,8 @@ namespace "config" do
|
|
528
579
|
$storealias = $config["android"]["production"]["alias"] if $storealias.nil? and !$config["android"].nil? and !$config["android"]["production"].nil?
|
529
580
|
$storealias = "rhomobile.keystore" if $storealias.nil?
|
530
581
|
|
582
|
+
$build_tools_ver = File.split( build_tools_path )[1]
|
583
|
+
|
531
584
|
end
|
532
585
|
|
533
586
|
$app_config["capabilities"] += ANDROID_CAPS_ALWAYS_ENABLED
|
@@ -1666,6 +1719,7 @@ namespace "build" do
|
|
1666
1719
|
generator.screenOrientation = $android_orientation unless $android_orientation.nil?
|
1667
1720
|
generator.hardwareAcceleration = true if $app_config["capabilities"].index('hardware_acceleration')
|
1668
1721
|
generator.apikey = $gapikey if $gapikey
|
1722
|
+
generator.debuggable = $debug
|
1669
1723
|
|
1670
1724
|
generator.addUriParams $uri_scheme, $uri_host, $uri_path_prefix
|
1671
1725
|
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'erb'
|
2
|
+
|
3
|
+
class AndroidStudioProjectGenerator
|
4
|
+
attr_accessor :rhoRoot
|
5
|
+
attr_accessor :compileSdkVersion
|
6
|
+
attr_accessor :buildToolsVersion
|
7
|
+
attr_accessor :applicationId
|
8
|
+
attr_accessor :minSdkVersion
|
9
|
+
attr_accessor :targetSdkVersion
|
10
|
+
attr_accessor :versionCode
|
11
|
+
attr_accessor :versionName
|
12
|
+
|
13
|
+
def render_app_gradle(erbPath)
|
14
|
+
@versionCode = @versionName.to_i
|
15
|
+
#@compileSdkVersion = @targetSdkVersion
|
16
|
+
|
17
|
+
tpl = File.read erbPath
|
18
|
+
erb = ERB.new tpl
|
19
|
+
erb.result binding
|
20
|
+
end
|
21
|
+
end
|
@@ -31,6 +31,9 @@
|
|
31
31
|
|
32
32
|
#USE_TRACES = Rake.application.options.trace
|
33
33
|
|
34
|
+
require 'pp'
|
35
|
+
require 'open3'
|
36
|
+
|
34
37
|
module AndroidTools
|
35
38
|
|
36
39
|
def fill_api_levels(sdkpath)
|
@@ -290,7 +293,7 @@ def run_emulator(options = {})
|
|
290
293
|
end
|
291
294
|
end
|
292
295
|
|
293
|
-
raise "
|
296
|
+
raise "Emulator image is not found for selected target: #{$androidtargets[get_api_level($emuversion)][:abis].inspect}" unless abi
|
294
297
|
end
|
295
298
|
|
296
299
|
unless File.directory?( File.join(ENV['HOME'], ".android", "avd", "#{$avdname}.avd" ) )
|
@@ -300,7 +303,7 @@ def run_emulator(options = {})
|
|
300
303
|
puts "AVD name: #{$avdname}, emulator version: #{$emuversion}, target id: #{targetid}"
|
301
304
|
end
|
302
305
|
raise "Unable to create AVD image. No appropriate target API for SDK version: #{$emuversion}" unless targetid
|
303
|
-
createavd = "\"#{$androidbin}\" create avd --name #{$avdname} --target #{targetid} --sdcard 128M"
|
306
|
+
createavd = "echo no | \"#{$androidbin}\" create avd --name #{$avdname} --target #{targetid} --sdcard 128M"
|
304
307
|
createavd = createavd + " --abi #{abi}" if abi
|
305
308
|
puts "Creating AVD image: #{createavd}"
|
306
309
|
IO.popen(createavd, 'r+') do |io|
|
@@ -422,7 +425,6 @@ def load_app_and_run(device_flag, apkfile, pkgname)
|
|
422
425
|
argv << apkfile
|
423
426
|
|
424
427
|
cmd = argv.join(' ')
|
425
|
-
argv = cmd if RUBY_VERSION =~ /^1\.8/
|
426
428
|
|
427
429
|
count = 0
|
428
430
|
done = false
|
@@ -432,9 +434,9 @@ def load_app_and_run(device_flag, apkfile, pkgname)
|
|
432
434
|
begin
|
433
435
|
status = Timeout::timeout(300) do
|
434
436
|
puts "CMD: #{cmd}"
|
435
|
-
|
436
|
-
child =
|
437
|
-
while line =
|
437
|
+
Open3.popen3(cmd) do |pin,pout,perr,wait_thr|
|
438
|
+
child = pout.pid
|
439
|
+
while line = perr.gets
|
438
440
|
theoutput << line
|
439
441
|
puts "RET: #{line}"
|
440
442
|
end
|
@@ -39,6 +39,9 @@
|
|
39
39
|
+ (NSString *) getApplicationsRosterUrl;
|
40
40
|
+ (bool) installApplication:(NSString*)appName data:(NSData*)appData;
|
41
41
|
|
42
|
+
+ (void) startupLogging:(NSString*)message;
|
43
|
+
+ (BOOL) isEnabledStartupLogging;
|
44
|
+
|
42
45
|
- (void) copyFromMainBundle:(NSFileManager*)fileManager fromPath:(NSString*)source
|
43
46
|
toPath:(NSString*)target remove:(BOOL)remove;
|
44
47
|
- (void) configure;
|
@@ -49,3 +52,6 @@
|
|
49
52
|
- (void) openURL:(NSString*)url;
|
50
53
|
|
51
54
|
@end
|
55
|
+
|
56
|
+
|
57
|
+
void rho_startup_logging(const char* message);
|
@@ -61,29 +61,51 @@ VALUE rho_sys_has_wifi_network();
|
|
61
61
|
VALUE rho_sys_has_cell_network();
|
62
62
|
|
63
63
|
|
64
|
+
|
65
|
+
static BOOL getEnabledStartupLogging() {
|
66
|
+
static int res = -1;
|
67
|
+
if (res == -1) {
|
68
|
+
const char* svalue = get_app_build_config_item("iphone_enable_startup_logging");
|
69
|
+
if (svalue != NULL) {
|
70
|
+
if ((svalue[0] != '0') && (svalue[0] != 'f') && (svalue[0] != 'F') ) {
|
71
|
+
res = 1;
|
72
|
+
}
|
73
|
+
else {
|
74
|
+
res = 0;
|
75
|
+
}
|
76
|
+
}
|
77
|
+
}
|
78
|
+
return res == 1;
|
79
|
+
}
|
80
|
+
|
81
|
+
// when Application manager is initialize Rhodes logging system is not ready !!!
|
82
|
+
#define ENABLE_STARTUP_TRACES getEnabledStartupLogging()
|
83
|
+
|
84
|
+
|
85
|
+
|
64
86
|
BOOL isPathIsSymLink(NSFileManager *fileManager, NSString* path) {
|
65
87
|
NSError *error;
|
66
88
|
|
67
89
|
NSDictionary *attributes = [fileManager attributesOfItemAtPath:path error:&error];
|
68
90
|
|
69
91
|
if (attributes == nil) {
|
70
|
-
|
92
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: SymLink NO : %@", path);
|
71
93
|
return NO;
|
72
94
|
}
|
73
95
|
|
74
96
|
NSString* fileType = [attributes objectForKey:NSFileType];
|
75
97
|
|
76
98
|
if (fileType == nil) {
|
77
|
-
|
99
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: SymLink NO : %@", path);
|
78
100
|
return NO;
|
79
101
|
}
|
80
102
|
|
81
103
|
BOOL res = [NSFileTypeSymbolicLink isEqualToString:fileType];
|
82
104
|
if (res) {
|
83
|
-
|
105
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: SymLink YES : %@", path);
|
84
106
|
}
|
85
107
|
else {
|
86
|
-
|
108
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: SymLink NO : %@", path);
|
87
109
|
}
|
88
110
|
|
89
111
|
return res;
|
@@ -121,6 +143,19 @@ BOOL isPathIsSymLink(NSFileManager *fileManager, NSString* path) {
|
|
121
143
|
return(gInstance);
|
122
144
|
}
|
123
145
|
|
146
|
+
|
147
|
+
+ (void) startupLogging:(NSString*)message {
|
148
|
+
if (ENABLE_STARTUP_TRACES) {
|
149
|
+
NSLog(@"Rhodes startup : %@", message);
|
150
|
+
}
|
151
|
+
}
|
152
|
+
|
153
|
+
+ (BOOL) isEnabledStartupLogging {
|
154
|
+
return getEnabledStartupLogging();
|
155
|
+
}
|
156
|
+
|
157
|
+
|
158
|
+
|
124
159
|
/*
|
125
160
|
* Gets root folder of the site
|
126
161
|
* Application folders located undern the root
|
@@ -141,7 +176,7 @@ BOOL isPathIsSymLink(NSFileManager *fileManager, NSString* path) {
|
|
141
176
|
|
142
177
|
|
143
178
|
+ (NSString *) getApplicationsRosterUrl {
|
144
|
-
return @"http://
|
179
|
+
return @"http://tau-technologies.com/";
|
145
180
|
}
|
146
181
|
|
147
182
|
+ (bool) installApplication:(NSString*)appName data:(NSData*)appData {
|
@@ -194,8 +229,8 @@ BOOL isPathIsSymLink(NSFileManager *fileManager, NSString* path) {
|
|
194
229
|
|
195
230
|
|
196
231
|
- (BOOL)isContentsEqual:(NSFileManager*)fileManager first:(NSString*)filePath1 second:(NSString*)filePath2 {
|
197
|
-
NSLog(@"filePath1: %@", filePath1);
|
198
|
-
NSLog(@"filePath2: %@", filePath2);
|
232
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: filePath1: %@", filePath1);
|
233
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: filePath2: %@", filePath2);
|
199
234
|
if (![fileManager fileExistsAtPath:filePath1] || ![fileManager fileExistsAtPath:filePath2])
|
200
235
|
return NO;
|
201
236
|
|
@@ -252,12 +287,12 @@ BOOL isPathIsSymLink(NSFileManager *fileManager, NSString* path) {
|
|
252
287
|
// check exist of sym-link
|
253
288
|
NSString* testName = [rhoRoot stringByAppendingPathComponent:@"lib"];
|
254
289
|
if (![fileManager fileExistsAtPath:testName]) {
|
255
|
-
NSLog(@"
|
290
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: Can not found main Sym-Link - we should restore all sym-links !");
|
256
291
|
contentChanged = YES;
|
257
292
|
restoreSymLinks_only = YES;
|
258
293
|
}
|
259
294
|
else {
|
260
|
-
NSLog(@"
|
295
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: Main Sym-Link founded - disable restoring !");
|
261
296
|
}
|
262
297
|
}
|
263
298
|
|
@@ -266,10 +301,10 @@ BOOL isPathIsSymLink(NSFileManager *fileManager, NSString* path) {
|
|
266
301
|
NSString* testName = [rhoRoot stringByAppendingPathComponent:@"lib"];
|
267
302
|
BOOL libExist = [fileManager fileExistsAtPath:testName];
|
268
303
|
if (libExist) {
|
269
|
-
NSLog(@"
|
304
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: Lib File is Exist: %@", testName);
|
270
305
|
}
|
271
306
|
else {
|
272
|
-
NSLog(@"
|
307
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: Lib File is NOT Exist: %@", testName);
|
273
308
|
}
|
274
309
|
|
275
310
|
|
@@ -301,9 +336,9 @@ BOOL isPathIsSymLink(NSFileManager *fileManager, NSString* path) {
|
|
301
336
|
|
302
337
|
// Create symlink to "lib"
|
303
338
|
NSString *src = [bundleRoot stringByAppendingPathComponent:@"lib"];
|
304
|
-
NSLog(@"src: %@", src);
|
339
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: src: %@", src);
|
305
340
|
NSString *dst = [rhoRoot stringByAppendingPathComponent:@"lib"];
|
306
|
-
NSLog(@"dst: %@", dst);
|
341
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: dst: %@", dst);
|
307
342
|
[fileManager removeItemAtPath:dst error:&error];
|
308
343
|
|
309
344
|
[fileManager createSymbolicLinkAtPath:dst withDestinationPath:src error:&error];
|
@@ -313,9 +348,9 @@ BOOL isPathIsSymLink(NSFileManager *fileManager, NSString* path) {
|
|
313
348
|
for (int i = 0, lim = sizeof(dirs)/sizeof(dirs[0]); i < lim; ++i) {
|
314
349
|
// Create directory
|
315
350
|
src = [bundleRoot stringByAppendingPathComponent:dirs[i]];
|
316
|
-
NSLog(@"src: %@", src);
|
351
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: src: %@", src);
|
317
352
|
dst = [rhoRoot stringByAppendingPathComponent:dirs[i]];
|
318
|
-
NSLog(@"dst: %@", dst);
|
353
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: dst: %@", dst);
|
319
354
|
if (![fileManager fileExistsAtPath:dst])
|
320
355
|
[fileManager createDirectoryAtPath:dst withIntermediateDirectories:YES attributes:nil error:&error];
|
321
356
|
|
@@ -325,9 +360,9 @@ BOOL isPathIsSymLink(NSFileManager *fileManager, NSString* path) {
|
|
325
360
|
for (int i = 0, lim = [subelements count]; i < lim; ++i) {
|
326
361
|
NSString *child = [subelements objectAtIndex:i];
|
327
362
|
NSString *fchild = [src stringByAppendingPathComponent:child];
|
328
|
-
NSLog(@"
|
363
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: .. src: %@", fchild);
|
329
364
|
NSString *target = [dst stringByAppendingPathComponent:child];
|
330
|
-
NSLog(@"
|
365
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: .. dst: %@", target);
|
331
366
|
[fileManager removeItemAtPath:target error:&error];
|
332
367
|
if ([child isEqualToString:@"rhoconfig.txt"]) {
|
333
368
|
[fileManager setDelegate:nil];
|
@@ -360,9 +395,9 @@ BOOL isPathIsSymLink(NSFileManager *fileManager, NSString* path) {
|
|
360
395
|
if ([copy_dirs[i] isEqualToString:@"db"] && !hasOldName)
|
361
396
|
remove = NO;
|
362
397
|
NSString *src = [bundleRoot stringByAppendingPathComponent:copy_dirs[i]];
|
363
|
-
NSLog(@"copy src: %@", src);
|
398
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: copy src: %@", src);
|
364
399
|
NSString *dst = [rhoDBRoot stringByAppendingPathComponent:copy_dirs[i]];
|
365
|
-
NSLog(@"copy dst: %@", dst);
|
400
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: copy dst: %@", dst);
|
366
401
|
|
367
402
|
//[self copyFromMainBundle:fileManager fromPath:src toPath:dst remove:remove];
|
368
403
|
|
@@ -370,9 +405,9 @@ BOOL isPathIsSymLink(NSFileManager *fileManager, NSString* path) {
|
|
370
405
|
for (int i = 0, lim = [subelements count]; i < lim; ++i) {
|
371
406
|
NSString *child = [subelements objectAtIndex:i];
|
372
407
|
NSString *fchild = [src stringByAppendingPathComponent:child];
|
373
|
-
NSLog(@"
|
408
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: .. copy src: %@", fchild);
|
374
409
|
NSString *target = [dst stringByAppendingPathComponent:child];
|
375
|
-
NSLog(@"
|
410
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: .. copy dst: %@", target);
|
376
411
|
|
377
412
|
BOOL copyit = YES;
|
378
413
|
|
@@ -394,9 +429,9 @@ BOOL isPathIsSymLink(NSFileManager *fileManager, NSString* path) {
|
|
394
429
|
NSString *items[] = {@"hash", @"name"};
|
395
430
|
for (int i = 0, lim = sizeof(items)/sizeof(items[0]); i < lim; ++i) {
|
396
431
|
NSString *src = [bundleRoot stringByAppendingPathComponent:items[i]];
|
397
|
-
NSLog(@"copy src: %@", src);
|
432
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: copy src: %@", src);
|
398
433
|
NSString *dst = [rhoRoot stringByAppendingPathComponent:items[i]];
|
399
|
-
NSLog(@"copy dst: %@", dst);
|
434
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: copy dst: %@", dst);
|
400
435
|
[fileManager removeItemAtPath:dst error:&error];
|
401
436
|
[fileManager copyItemAtPath:src toPath:dst error:&error];
|
402
437
|
|
@@ -413,19 +448,19 @@ BOOL isPathIsSymLink(NSFileManager *fileManager, NSString* path) {
|
|
413
448
|
if ([dirs[i] isEqualToString:@"db"] && !hasOldName)
|
414
449
|
remove = NO;
|
415
450
|
NSString *src = [bundleRoot stringByAppendingPathComponent:dirs[i]];
|
416
|
-
NSLog(@"src: %@", src);
|
451
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: src: %@", src);
|
417
452
|
NSString *dst = [rhoRoot stringByAppendingPathComponent:dirs[i]];
|
418
|
-
NSLog(@"dst: %@", dst);
|
453
|
+
if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: dst: %@", dst);
|
419
454
|
[self copyFromMainBundle:fileManager fromPath:src toPath:dst remove:remove];
|
420
455
|
}
|
421
456
|
}
|
422
457
|
}
|
423
458
|
}
|
424
|
-
NSLog(@"Create rhodes logging and rhoconfig.txt loading");
|
425
|
-
rho_logconf_Init_with_separate_user_path(rho_native_rhopath(), rho_native_rhopath(), "", rho_native_rhouserpath());
|
426
|
-
NSLog(@"Create rhodes app");
|
427
|
-
rho_rhodesapp_create_with_separate_user_path(rho_native_rhopath(), rho_native_rhouserpath());
|
428
|
-
RAWLOG_INFO("Rhodes started");
|
459
|
+
//if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: Create rhodes logging and rhoconfig.txt loading");
|
460
|
+
//rho_logconf_Init_with_separate_user_path(rho_native_rhopath(), rho_native_rhopath(), "", rho_native_rhouserpath());
|
461
|
+
//if (ENABLE_STARTUP_TRACES) NSLog(@"RhoAppManager: Create rhodes app");
|
462
|
+
//rho_rhodesapp_create_with_separate_user_path(rho_native_rhopath(), rho_native_rhouserpath());
|
463
|
+
//RAWLOG_INFO("Rhodes started");
|
429
464
|
}
|
430
465
|
|
431
466
|
|
@@ -677,7 +712,7 @@ int rho_sys_is_app_installed(const char *appname) {
|
|
677
712
|
}
|
678
713
|
|
679
714
|
void rho_sys_app_uninstall(const char *appname) {
|
680
|
-
|
715
|
+
RAWLOG_ERROR("ERROR: Uninstall of applications is unsupported on iOS platfrom !!!");
|
681
716
|
}
|
682
717
|
|
683
718
|
|
@@ -1196,11 +1231,11 @@ void setApplicationBadgeNumber(NSInteger badgeNumber)
|
|
1196
1231
|
{
|
1197
1232
|
if (checkNotificationType(UIUserNotificationTypeBadge))
|
1198
1233
|
{
|
1199
|
-
|
1234
|
+
RAWLOG_INFO1("badge number changed to %d", (int)badgeNumber);
|
1200
1235
|
[UIApplication sharedApplication].applicationIconBadgeNumber = badgeNumber;
|
1201
1236
|
}
|
1202
1237
|
else
|
1203
|
-
|
1238
|
+
RAWLOG_INFO("access denied for UIUserNotificationTypeBadge");
|
1204
1239
|
}
|
1205
1240
|
#else
|
1206
1241
|
// compile with Xcode 5 (iOS SDK < 8.0)
|
@@ -1235,7 +1270,7 @@ int rho_sys_set_do_not_bakup_attribute(const char* path, int value) {
|
|
1235
1270
|
result = setxattr(path, attrName, &attrValue, sizeof(attrValue), 0, 0);
|
1236
1271
|
|
1237
1272
|
if (result != 0) {
|
1238
|
-
|
1273
|
+
RAWLOG_WARNING1("WARNING: Can not change [do_not_bakup] attribute for path: %s", path);
|
1239
1274
|
}
|
1240
1275
|
}
|
1241
1276
|
else {
|
@@ -1245,7 +1280,7 @@ int rho_sys_set_do_not_bakup_attribute(const char* path, int value) {
|
|
1245
1280
|
if (result != -1) {
|
1246
1281
|
int removeResult = removexattr(path, attrName, 0);
|
1247
1282
|
if (removeResult == 0) {
|
1248
|
-
|
1283
|
+
RAWLOG_WARNING1("Removed extended attribute on file %s", [pathString UTF8String]);
|
1249
1284
|
}
|
1250
1285
|
}
|
1251
1286
|
|
@@ -1258,7 +1293,7 @@ int rho_sys_set_do_not_bakup_attribute(const char* path, int value) {
|
|
1258
1293
|
result = success ? 0 : -1;
|
1259
1294
|
|
1260
1295
|
if (result != 0) {
|
1261
|
-
|
1296
|
+
RAWLOG_WARNING2("Can not change [do_not_bakup] attribute for path: %s, error: %d", [pathString UTF8String], (int)[error localizedDescription]);
|
1262
1297
|
}
|
1263
1298
|
}
|
1264
1299
|
|
@@ -1301,11 +1336,15 @@ void rho_title_change(const int tabIndex, const char* strTitle) {
|
|
1301
1336
|
}
|
1302
1337
|
|
1303
1338
|
|
1304
|
-
|
1339
|
+
// this method called from logging system - loggins system add logmessage to log and also copy it to iOS console by NSLog()
|
1305
1340
|
void rho_ios_log_console_output(const char* message) {
|
1306
1341
|
NSLog(@"%@", [NSString stringWithUTF8String:message]);
|
1307
1342
|
}
|
1308
1343
|
|
1344
|
+
void rho_startup_logging(const char* message) {
|
1345
|
+
[AppManager startupLogging:[NSString stringWithUTF8String:message]];
|
1346
|
+
}
|
1347
|
+
|
1309
1348
|
/*
|
1310
1349
|
#define MAX_ACTIONS 4
|
1311
1350
|
const static struct {
|