diff --git a/plugins/Osmand-Nautical/build.gradle b/plugins/Osmand-Nautical/build.gradle index 138b8be4a2..d595b07703 100644 --- a/plugins/Osmand-Nautical/build.gradle +++ b/plugins/Osmand-Nautical/build.gradle @@ -62,12 +62,18 @@ repositories { } } +def analytics = System.getenv("USE_FIREBASE_FOR_PLUGINS") + dependencies { - //compile 'com.google.firebase:firebase-core:9.8.0' - //compile 'com.google.firebase:firebase-config:9.8.0' + if (analytics) { + compile 'com.google.firebase:firebase-core:9.8.0' + compile 'com.google.firebase:firebase-config:9.8.0' + } compile 'com.android.support:appcompat-v7:23.3.0' compile 'com.android.support:design:23.3.0' } -//println "Apply GMS plugin" -//apply plugin: 'com.google.gms.google-services' +if (analytics) { + println "Apply GMS plugin" + apply plugin: 'com.google.gms.google-services' +} diff --git a/plugins/Osmand-Nautical/src/net/osmand/nautical/NauticalActivity.java b/plugins/Osmand-Nautical/src/net/osmand/nautical/NauticalActivity.java index c2bccbd1c2..ed01e7efee 100644 --- a/plugins/Osmand-Nautical/src/net/osmand/nautical/NauticalActivity.java +++ b/plugins/Osmand-Nautical/src/net/osmand/nautical/NauticalActivity.java @@ -72,16 +72,16 @@ public class NauticalActivity extends Activity { } public void logEvent(Activity ctx, String event) { - /* try { Class cl = Class.forName("com.google.firebase.analytics.FirebaseAnalytics"); Method mm = cl.getMethod("getInstance", Context.class); Object inst = mm.invoke(null, ctx == null ? this : ctx); Method log = cl.getMethod("logEvent", String.class, Bundle.class); log.invoke(inst, event, new Bundle()); + } catch (ClassNotFoundException e) { + //ignore } catch (Exception e) { e.printStackTrace(); } - */ } } \ No newline at end of file diff --git a/plugins/Osmand-ParkingPlugin/build.gradle b/plugins/Osmand-ParkingPlugin/build.gradle index a63dd7fc94..29ce3199e9 100644 --- a/plugins/Osmand-ParkingPlugin/build.gradle +++ b/plugins/Osmand-ParkingPlugin/build.gradle @@ -62,12 +62,18 @@ repositories { } } +def analytics = System.getenv("USE_FIREBASE_FOR_PLUGINS") + dependencies { - //compile 'com.google.firebase:firebase-core:9.8.0' - //compile 'com.google.firebase:firebase-config:9.8.0' + if (analytics) { + compile 'com.google.firebase:firebase-core:9.8.0' + compile 'com.google.firebase:firebase-config:9.8.0' + } compile 'com.android.support:appcompat-v7:23.3.0' compile 'com.android.support:design:23.3.0' } -//println "Apply GMS plugin" -//apply plugin: 'com.google.gms.google-services' +if (analytics) { + println "Apply GMS plugin" + apply plugin: 'com.google.gms.google-services' +} diff --git a/plugins/Osmand-ParkingPlugin/src/net/osmand/parkingPlugin/ParkingPluginActivity.java b/plugins/Osmand-ParkingPlugin/src/net/osmand/parkingPlugin/ParkingPluginActivity.java index c43be49da3..e83c802fda 100644 --- a/plugins/Osmand-ParkingPlugin/src/net/osmand/parkingPlugin/ParkingPluginActivity.java +++ b/plugins/Osmand-ParkingPlugin/src/net/osmand/parkingPlugin/ParkingPluginActivity.java @@ -71,16 +71,16 @@ public class ParkingPluginActivity extends Activity { } public void logEvent(Activity ctx, String event) { - /* try { Class cl = Class.forName("com.google.firebase.analytics.FirebaseAnalytics"); Method mm = cl.getMethod("getInstance", Context.class); Object inst = mm.invoke(null, ctx == null ? this : ctx); Method log = cl.getMethod("logEvent", String.class, Bundle.class); log.invoke(inst, event, new Bundle()); + } catch (ClassNotFoundException e) { + //ignore } catch (Exception e) { e.printStackTrace(); } - */ } } \ No newline at end of file diff --git a/plugins/Osmand-SRTMPlugin/build.gradle b/plugins/Osmand-SRTMPlugin/build.gradle index beeb1b7204..f32085c9e5 100644 --- a/plugins/Osmand-SRTMPlugin/build.gradle +++ b/plugins/Osmand-SRTMPlugin/build.gradle @@ -62,12 +62,18 @@ repositories { } } +def analytics = System.getenv("USE_FIREBASE_FOR_PLUGINS") + dependencies { - //compile 'com.google.firebase:firebase-core:9.8.0' - //compile 'com.google.firebase:firebase-config:9.8.0' + if (analytics) { + compile 'com.google.firebase:firebase-core:9.8.0' + compile 'com.google.firebase:firebase-config:9.8.0' + } compile 'com.android.support:appcompat-v7:23.3.0' compile 'com.android.support:design:23.3.0' } -//println "Apply GMS plugin" -//apply plugin: 'com.google.gms.google-services' +if (analytics) { + println "Apply GMS plugin" + apply plugin: 'com.google.gms.google-services' +} diff --git a/plugins/Osmand-SRTMPlugin/src/net/osmand/srtmPlugin/SRTMPluginActivity.java b/plugins/Osmand-SRTMPlugin/src/net/osmand/srtmPlugin/SRTMPluginActivity.java index fca64769b2..92421706d1 100644 --- a/plugins/Osmand-SRTMPlugin/src/net/osmand/srtmPlugin/SRTMPluginActivity.java +++ b/plugins/Osmand-SRTMPlugin/src/net/osmand/srtmPlugin/SRTMPluginActivity.java @@ -73,16 +73,16 @@ public class SRTMPluginActivity extends Activity { } public void logEvent(Activity ctx, String event) { - /* try { Class cl = Class.forName("com.google.firebase.analytics.FirebaseAnalytics"); Method mm = cl.getMethod("getInstance", Context.class); Object inst = mm.invoke(null, ctx == null ? this : ctx); Method log = cl.getMethod("logEvent", String.class, Bundle.class); log.invoke(inst, event, new Bundle()); + } catch (ClassNotFoundException e) { + //ignore } catch (Exception e) { e.printStackTrace(); } - */ } } \ No newline at end of file diff --git a/plugins/Osmand-Skimaps/AndroidManifest.xml b/plugins/Osmand-Skimaps/AndroidManifest.xml index e937648d0b..269d9539f8 100644 --- a/plugins/Osmand-Skimaps/AndroidManifest.xml +++ b/plugins/Osmand-Skimaps/AndroidManifest.xml @@ -15,12 +15,12 @@ android:name="net.osmand.skimaps.SkiMapsActivity" android:theme="@style/AppTheme" android:label="@string/app_name" > - + diff --git a/plugins/Osmand-Skimaps/build.gradle b/plugins/Osmand-Skimaps/build.gradle index 129c1d02ac..49e99647e4 100644 --- a/plugins/Osmand-Skimaps/build.gradle +++ b/plugins/Osmand-Skimaps/build.gradle @@ -63,12 +63,18 @@ repositories { } } +def analytics = System.getenv("USE_FIREBASE_FOR_PLUGINS") + dependencies { - //compile 'com.google.firebase:firebase-core:9.8.0' - //compile 'com.google.firebase:firebase-config:9.8.0' + if (analytics) { + compile 'com.google.firebase:firebase-core:9.8.0' + compile 'com.google.firebase:firebase-config:9.8.0' + } compile 'com.android.support:appcompat-v7:23.3.0' compile 'com.android.support:design:23.3.0' } -//println "Apply GMS plugin" -//apply plugin: 'com.google.gms.google-services' +if (analytics) { + println "Apply GMS plugin" + apply plugin: 'com.google.gms.google-services' +} diff --git a/plugins/Osmand-Skimaps/src/net/osmand/skimaps/SkiMapsActivity.java b/plugins/Osmand-Skimaps/src/net/osmand/skimaps/SkiMapsActivity.java index 21ba65c30c..1f8f3d5b13 100644 --- a/plugins/Osmand-Skimaps/src/net/osmand/skimaps/SkiMapsActivity.java +++ b/plugins/Osmand-Skimaps/src/net/osmand/skimaps/SkiMapsActivity.java @@ -74,16 +74,16 @@ public class SkiMapsActivity extends Activity { } public void logEvent(Activity ctx, String event) { - /* try { Class cl = Class.forName("com.google.firebase.analytics.FirebaseAnalytics"); Method mm = cl.getMethod("getInstance", Context.class); Object inst = mm.invoke(null, ctx == null ? this : ctx); Method log = cl.getMethod("logEvent", String.class, Bundle.class); log.invoke(inst, event, new Bundle()); + } catch (ClassNotFoundException e) { + //ignore } catch (Exception e) { e.printStackTrace(); } - */ } } \ No newline at end of file