diff --git a/OsmAnd/build.gradle b/OsmAnd/build.gradle index 1b1d8bc060..1cc5d1a72d 100644 --- a/OsmAnd/build.gradle +++ b/OsmAnd/build.gradle @@ -17,12 +17,6 @@ apply plugin: 'com.android.application' // // Less important -// Configure eclipse-aar plugin -def analytics = (!System.getenv("APP_FEATURES") || System.getenv("APP_FEATURES").contains("+play_market")) && - getGradle().getStartParameter().getTaskRequests().toString().contains("Free") - - - task printc { configurations.each { if(it.isCanBeResolved()) println it.name } @@ -50,8 +44,7 @@ android { } defaultConfig { - minSdkVersion System.getenv("MIN_SDK_VERSION") ? System.getenv("MIN_SDK_VERSION").toInteger() : - (analytics ? 15 : 14) + minSdkVersion System.getenv("MIN_SDK_VERSION") ? System.getenv("MIN_SDK_VERSION").toInteger() : 14 targetSdkVersion 26 versionCode 330 versionCode System.getenv("APK_NUMBER_VERSION") ? System.getenv("APK_NUMBER_VERSION").toInteger() : versionCode @@ -383,17 +376,8 @@ task appStart(type: Exec) { } -project.logger.warn("Analytics enabled for free version: $analytics") dependencies { implementation project(path: ':OsmAnd-java', configuration: 'android') - if (analytics) { - // Analytics is totally removed to stay free from 3rd party collecting users data -// implementation 'com.google.firebase:firebase-core:12.0.1' -// implementation 'com.google.firebase:firebase-messaging:12.0.1' -// implementation 'com.google.firebase:firebase-iid:12.0.1' -// implementation 'com.google.firebase:firebase-config:12.0.1' -// implementation 'com.facebook.android:facebook-android-sdk:4.31.0' - } implementation 'com.android.support:multidex:1.0.1' implementation 'com.android.support:gridlayout-v7:27.1.1' implementation 'com.android.support:cardview-v7:27.1.1' @@ -436,7 +420,3 @@ dependencies { exclude group: 'com.android.support' } } -if(analytics) { - println "Apply GMS plugin" - apply plugin: 'com.google.gms.google-services' -} diff --git a/OsmAnd/google-services.json b/OsmAnd/google-services.json deleted file mode 100644 index a38df8478a..0000000000 --- a/OsmAnd/google-services.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "project_info": { - "project_number": "521675454867", - "firebase_url": "https://osmand-1e236.firebaseio.com", - "project_id": "osmand-1e236", - "storage_bucket": "osmand-1e236.appspot.com" - }, - - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:521675454867:android:be0477f14dc015f4", - "android_client_info": { - "package_name": "net.osmand" - } - }, - "oauth_client": [ - { - "client_id": "521675454867-te1hdssotqq2dhu7pj2pjm17eulm1tvf.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "net.osmand", - "certificate_hash": "49a9ace0bfee7bb91506d7921f93a47808cb62ab" - } - }, - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBMaRMiPY-mS3J_-aX30sRBFB-WGIm-M-U" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "521675454867-ta1aisohg7g0k542gdh9fbeb2v4qsncf.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "net.osmand.maps", - "app_store_id": "934850257" - } - }, - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - } - ] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:521675454867:android:47aa2619f9a3dda7", - "android_client_info": { - "package_name": "net.osmand.dev" - } - }, - "oauth_client": [ - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBMaRMiPY-mS3J_-aX30sRBFB-WGIm-M-U" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - }, - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java index f0a72c569f..30a9cc3a21 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java +++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java @@ -2,7 +2,6 @@ package net.osmand.plus; import android.app.Activity; import android.app.AlarmManager; -import android.app.Application; import android.app.PendingIntent; import android.content.Context; import android.content.DialogInterface; @@ -14,7 +13,6 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Configuration; import android.os.AsyncTask; import android.os.Build; -import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.support.multidex.MultiDex; @@ -47,7 +45,6 @@ import net.osmand.plus.activities.SavingTrackHelper; import net.osmand.plus.api.SQLiteAPI; import net.osmand.plus.api.SQLiteAPIImpl; import net.osmand.plus.base.MapViewTrackingUtilities; -import net.osmand.plus.dashboard.DashErrorFragment; import net.osmand.plus.dialogs.ErrorBottomSheetDialog; import net.osmand.plus.dialogs.RateUsBottomSheetDialog; import net.osmand.plus.download.DownloadIndexesThread; @@ -76,11 +73,8 @@ import java.io.File; import java.io.FileWriter; import java.io.PrintStream; import java.lang.Thread.UncaughtExceptionHandler; -import java.lang.reflect.Method; import java.util.ArrayList; -import java.util.HashMap; import java.util.Locale; -import java.util.Map; import btools.routingapp.BRouterServiceConnection; import btools.routingapp.IBRouterService; @@ -89,8 +83,6 @@ public class OsmandApplication extends MultiDexApplication { public static final String EXCEPTION_PATH = "exception.log"; private static final org.apache.commons.logging.Log LOG = PlatformUtil.getLog(OsmandApplication.class); - private static final String SHOW_PLUS_VERSION_INAPP_PARAM = "show_plus_version_inapp"; - final AppInitializer appInitializer = new AppInitializer(this); OsmandSettings osmandSettings = null; OsmAndAppCustomization appCustomization; @@ -98,7 +90,6 @@ public class OsmandApplication extends MultiDexApplication { private final OsmAndTaskManager taskManager = new OsmAndTaskManager(this); private final UiUtilities iconsCache = new UiUtilities(this); Handler uiHandler; - private boolean plusVersionInApp; NavigationService navigationService; @@ -182,8 +173,6 @@ public class OsmandApplication extends MultiDexApplication { // if(!osmandSettings.FOLLOW_THE_ROUTE.get()) { // targetPointsHelper.clearPointToNavigate(false); // } - initExternalLibs(); - plusVersionInApp = getRemoteBoolean(SHOW_PLUS_VERSION_INAPP_PARAM, true); startApplication(); System.out.println("Time to start application " + (System.currentTimeMillis() - timeToStart) + " ms. Should be less < 800 ms"); timeToStart = System.currentTimeMillis(); @@ -194,7 +183,7 @@ public class OsmandApplication extends MultiDexApplication { } public boolean isPlusVersionInApp() { - return plusVersionInApp; + return true; } public boolean isExternalStorageDirectoryReadOnly() { @@ -924,117 +913,12 @@ public class OsmandApplication extends MultiDexApplication { try { if (Version.isGooglePlayEnabled(this) && !Version.isPaidVersion(this) && !osmandSettings.DO_NOT_SEND_ANONYMOUS_APP_USAGE.get()) { - 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()); + // not implemented yet } } catch (Exception e) { - e.printStackTrace(); + // ignore } } - - - public void initExternalLibs() { - initRemoteConfig(); - printFirebasetoken(); - initFBEvents(); - } - - public void initFBEvents() { - try { - if (Version.isGooglePlayEnabled(this) && Version.isFreeVersion(this)) { - Class cls = Class.forName("com.facebook.FacebookSdk"); - Method ms = cls.getMethod("sdkInitialize", Context.class); - ms.invoke(null, getApplicationContext()); - Class cl = Class.forName("com.facebook.appevents.AppEventsLogger"); - Method mm = cl.getMethod("activateApp", Application.class); - mm.invoke(null, this); - Method mu = cl.getMethod("getUserID"); - String uid = (String) mu.invoke(null); - LOG.info("FB token: " + uid); - } - } catch (Exception e) { - LOG.error(e.getMessage(), e); - } - } - - public void initRemoteConfig() { - try { - if (Version.isGooglePlayEnabled(this) && Version.isFreeVersion(this)) { - Class cl = Class.forName("com.google.firebase.remoteconfig.FirebaseRemoteConfig"); - Method mm = cl.getMethod("getInstance"); - Object inst = mm.invoke(null); - Method log = cl.getMethod("setDefaults", Map.class); - Map defaults = new HashMap<>(); - defaults.put(SHOW_PLUS_VERSION_INAPP_PARAM, Boolean.TRUE); - log.invoke(inst, defaults); - } - } catch (Exception e) { - LOG.error(e.getMessage(), e); - } - } - - - public void printFirebasetoken() { - try { - if (Version.isGooglePlayEnabled(this) && Version.isFreeVersion(this)) { - Class cl = Class.forName("com.google.firebase.iid.FirebaseInstanceId"); - Method mm = cl.getMethod("getInstance"); - Object inst = mm.invoke(null); - Method getToken = cl.getMethod("getToken"); - String firebaseToken = (String) getToken.invoke(inst); - LOG.info("Fbase token: " + firebaseToken); - } - } catch (Exception e) { - LOG.error(e.getMessage(), e); - } - } - - public void fetchRemoteParams() { - try { - if(Version.isGooglePlayEnabled(this) && Version.isFreeVersion(this)) { - Class cl = Class.forName("com.google.firebase.remoteconfig.FirebaseRemoteConfig"); - Method mm = cl.getMethod("getInstance"); - Object inst = mm.invoke(null); - Method log = cl.getMethod("fetch"); - log.invoke(inst); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void activateFetchedRemoteParams() { - try { - if (Version.isGooglePlayEnabled(this) && Version.isFreeVersion(this)) { - Class cl = Class.forName("com.google.firebase.remoteconfig.FirebaseRemoteConfig"); - Method mm = cl.getMethod("getInstance"); - Object inst = mm.invoke(null); - Method log = cl.getMethod("activateFetched"); - log.invoke(inst); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - public boolean getRemoteBoolean(String key, boolean defaultValue) { - try { - if (Version.isGooglePlayEnabled(this) && Version.isFreeVersion(this)) { - Class cl = Class.forName("com.google.firebase.remoteconfig.FirebaseRemoteConfig"); - Method mm = cl.getMethod("getInstance"); - Object inst = mm.invoke(null); - Method log = cl.getMethod("getBoolean", String.class); - Boolean res = (Boolean)log.invoke(inst, key); - return res == null ? defaultValue : res; - } - } catch (Exception e) { - e.printStackTrace(); - } - return defaultValue; - } public void restartApp(Context ctx) { AlertDialog.Builder bld = new AlertDialog.Builder(ctx); diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java index 0d9923aca0..5ea3e4e872 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java @@ -60,7 +60,6 @@ import net.osmand.plus.download.ui.SearchDialogFragment; import net.osmand.plus.download.ui.UpdatesIndexFragment; import net.osmand.plus.helpers.FileNameTranslationHelper; import net.osmand.plus.inapp.InAppPurchaseHelper; -import net.osmand.plus.inapp.InAppPurchaseHelper.InAppPurchaseListener; import net.osmand.plus.inapp.InAppPurchaseHelper.InAppPurchaseTaskType; import net.osmand.plus.openseamapsplugin.NauticalMapsPlugin; import net.osmand.plus.srtmplugin.SRTMPlugin; @@ -131,7 +130,6 @@ public class DownloadActivity extends AbstractDownloadActivity implements Downlo protected void onCreate(Bundle savedInstanceState) { getMyApplication().applyTheme(this); super.onCreate(savedInstanceState); - getMyApplication().fetchRemoteParams(); downloadThread = getMyApplication().getDownloadThread(); DownloadResources indexes = getDownloadThread().getIndexes(); if (!indexes.isDownloadedFromInternet) { diff --git a/plugins/Osmand-Nautical/build.gradle b/plugins/Osmand-Nautical/build.gradle index bffb49fe7a..c7fc9219d7 100644 --- a/plugins/Osmand-Nautical/build.gradle +++ b/plugins/Osmand-Nautical/build.gradle @@ -62,18 +62,7 @@ repositories { } } -def analytics = System.getenv("USE_FIREBASE_FOR_PLUGINS") - dependencies { - if (analytics) { - implementation 'com.google.firebase:firebase-core:12.0.1' - implementation 'com.google.firebase:firebase-config:12.0.1' - } implementation 'com.android.support:appcompat-v7:27.1.1' implementation 'com.android.support:design:27.1.1' } - -if (analytics) { - println "Apply GMS plugin" - apply plugin: 'com.google.gms.google-services' -} \ No newline at end of file diff --git a/plugins/Osmand-Nautical/google-services.json b/plugins/Osmand-Nautical/google-services.json deleted file mode 100644 index 5627ab1b77..0000000000 --- a/plugins/Osmand-Nautical/google-services.json +++ /dev/null @@ -1,156 +0,0 @@ -{ - "project_info": { - "project_number": "521675454867", - "firebase_url": "https://osmand-1e236.firebaseio.com", - "project_id": "osmand-1e236", - "storage_bucket": "osmand-1e236.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:521675454867:android:be0477f14dc015f4", - "android_client_info": { - "package_name": "net.osmand" - } - }, - "oauth_client": [ - { - "client_id": "521675454867-te1hdssotqq2dhu7pj2pjm17eulm1tvf.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "net.osmand", - "certificate_hash": "49A9ACE0BFEE7BB91506D7921F93A47808CB62AB" - } - }, - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBMaRMiPY-mS3J_-aX30sRBFB-WGIm-M-U" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "521675454867-ta1aisohg7g0k542gdh9fbeb2v4qsncf.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "net.osmand.maps", - "app_store_id": "934850257" - } - } - ] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:521675454867:android:89d7051c910a2ed6", - "android_client_info": { - "package_name": "net.osmand.plus" - } - }, - "oauth_client": [ - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBMaRMiPY-mS3J_-aX30sRBFB-WGIm-M-U" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:521675454867:android:7e1b6333fdbe27e4", - "android_client_info": { - "package_name": "net.osmand.skimapsPlugin" - } - }, - "oauth_client": [ - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBMaRMiPY-mS3J_-aX30sRBFB-WGIm-M-U" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:521675454867:android:b53cc47c00e16275", - "android_client_info": { - "package_name": "net.osmand.nauticalPlugin" - } - }, - "oauth_client": [ - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBMaRMiPY-mS3J_-aX30sRBFB-WGIm-M-U" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/plugins/Osmand-Nautical/src/net/osmand/nautical/NauticalActivity.java b/plugins/Osmand-Nautical/src/net/osmand/nautical/NauticalActivity.java index c89c7fca37..e8554e011b 100644 --- a/plugins/Osmand-Nautical/src/net/osmand/nautical/NauticalActivity.java +++ b/plugins/Osmand-Nautical/src/net/osmand/nautical/NauticalActivity.java @@ -3,7 +3,6 @@ package net.osmand.nautical; import android.app.Activity; import android.content.ActivityNotFoundException; import android.content.ComponentName; -import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; @@ -15,8 +14,6 @@ import android.widget.TextView; import net.osmand.nauticalPlugin.R; -import java.lang.reflect.Method; - public class NauticalActivity extends Activity { private static final String OSMAND_COMPONENT = "net.osmand"; //$NON-NLS-1$ private static final String OSMAND_COMPONENT_PLUS = "net.osmand.plus"; //$NON-NLS-1$ @@ -73,15 +70,9 @@ 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 + // not implemented yet } catch (Exception e) { - e.printStackTrace(); + //ignore } } } \ No newline at end of file diff --git a/plugins/Osmand-ParkingPlugin/build.gradle b/plugins/Osmand-ParkingPlugin/build.gradle index 64c0e887e9..fec05b744f 100644 --- a/plugins/Osmand-ParkingPlugin/build.gradle +++ b/plugins/Osmand-ParkingPlugin/build.gradle @@ -62,18 +62,7 @@ repositories { } } -def analytics = System.getenv("USE_FIREBASE_FOR_PLUGINS") - dependencies { - if (analytics) { - implementation 'com.google.firebase:firebase-core:12.0.1' - implementation 'com.google.firebase:firebase-config:12.0.1' - } implementation 'com.android.support:appcompat-v7:27.1.1' implementation 'com.android.support:design:27.1.1' } - -if (analytics) { - println "Apply GMS plugin" - apply plugin: 'com.google.gms.google-services' -} diff --git a/plugins/Osmand-ParkingPlugin/google-services.json b/plugins/Osmand-ParkingPlugin/google-services.json deleted file mode 100644 index 590474959b..0000000000 --- a/plugins/Osmand-ParkingPlugin/google-services.json +++ /dev/null @@ -1,187 +0,0 @@ -{ - "project_info": { - "project_number": "521675454867", - "firebase_url": "https://osmand-1e236.firebaseio.com", - "project_id": "osmand-1e236", - "storage_bucket": "osmand-1e236.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:521675454867:android:be0477f14dc015f4", - "android_client_info": { - "package_name": "net.osmand" - } - }, - "oauth_client": [ - { - "client_id": "521675454867-te1hdssotqq2dhu7pj2pjm17eulm1tvf.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "net.osmand", - "certificate_hash": "49A9ACE0BFEE7BB91506D7921F93A47808CB62AB" - } - }, - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBMaRMiPY-mS3J_-aX30sRBFB-WGIm-M-U" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "521675454867-ta1aisohg7g0k542gdh9fbeb2v4qsncf.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "net.osmand.maps", - "app_store_id": "934850257" - } - }, - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - } - ] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:521675454867:android:89d7051c910a2ed6", - "android_client_info": { - "package_name": "net.osmand.plus" - } - }, - "oauth_client": [ - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBMaRMiPY-mS3J_-aX30sRBFB-WGIm-M-U" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:521675454867:android:7e1b6333fdbe27e4", - "android_client_info": { - "package_name": "net.osmand.skimapsPlugin" - } - }, - "oauth_client": [ - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBMaRMiPY-mS3J_-aX30sRBFB-WGIm-M-U" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:521675454867:android:b53cc47c00e16275", - "android_client_info": { - "package_name": "net.osmand.nauticalPlugin" - } - }, - "oauth_client": [ - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBMaRMiPY-mS3J_-aX30sRBFB-WGIm-M-U" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:521675454867:android:d3c770d3b10e292d", - "android_client_info": { - "package_name": "net.osmand.parkingPlugin" - } - }, - "oauth_client": [ - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBMaRMiPY-mS3J_-aX30sRBFB-WGIm-M-U" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/plugins/Osmand-ParkingPlugin/src/net/osmand/parkingPlugin/ParkingPluginActivity.java b/plugins/Osmand-ParkingPlugin/src/net/osmand/parkingPlugin/ParkingPluginActivity.java index 7748a9f5ce..54cbeb154d 100644 --- a/plugins/Osmand-ParkingPlugin/src/net/osmand/parkingPlugin/ParkingPluginActivity.java +++ b/plugins/Osmand-ParkingPlugin/src/net/osmand/parkingPlugin/ParkingPluginActivity.java @@ -4,7 +4,6 @@ package net.osmand.parkingPlugin; import android.app.Activity; import android.content.ActivityNotFoundException; import android.content.ComponentName; -import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; @@ -14,8 +13,6 @@ import android.text.Html; import android.view.View; import android.widget.TextView; -import java.lang.reflect.Method; - public class ParkingPluginActivity extends Activity { private static final String OSMAND_COMPONENT = "net.osmand"; //$NON-NLS-1$ private static final String OSMAND_COMPONENT_PLUS = "net.osmand.plus"; //$NON-NLS-1$ @@ -72,15 +69,9 @@ 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 + // not implemented yet } catch (Exception e) { - e.printStackTrace(); + //ignore } } } \ No newline at end of file diff --git a/plugins/Osmand-SRTMPlugin/build.gradle b/plugins/Osmand-SRTMPlugin/build.gradle index 08f2a28c72..15afa5f028 100644 --- a/plugins/Osmand-SRTMPlugin/build.gradle +++ b/plugins/Osmand-SRTMPlugin/build.gradle @@ -62,18 +62,7 @@ repositories { } } -def analytics = System.getenv("USE_FIREBASE_FOR_PLUGINS") - dependencies { - if (analytics) { - implementation 'com.google.firebase:firebase-core:12.0.1' - implementation 'com.google.firebase:firebase-config:12.0.1' - } implementation 'com.android.support:appcompat-v7:27.1.1' implementation 'com.android.support:design:27.1.1' } - -if (analytics) { - println "Apply GMS plugin" - apply plugin: 'com.google.gms.google-services' -} diff --git a/plugins/Osmand-SRTMPlugin/google-services.json b/plugins/Osmand-SRTMPlugin/google-services.json deleted file mode 100644 index 42d581ebd7..0000000000 --- a/plugins/Osmand-SRTMPlugin/google-services.json +++ /dev/null @@ -1,218 +0,0 @@ -{ - "project_info": { - "project_number": "521675454867", - "firebase_url": "https://osmand-1e236.firebaseio.com", - "project_id": "osmand-1e236", - "storage_bucket": "osmand-1e236.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:521675454867:android:be0477f14dc015f4", - "android_client_info": { - "package_name": "net.osmand" - } - }, - "oauth_client": [ - { - "client_id": "521675454867-te1hdssotqq2dhu7pj2pjm17eulm1tvf.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "net.osmand", - "certificate_hash": "49A9ACE0BFEE7BB91506D7921F93A47808CB62AB" - } - }, - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBMaRMiPY-mS3J_-aX30sRBFB-WGIm-M-U" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "521675454867-ta1aisohg7g0k542gdh9fbeb2v4qsncf.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "net.osmand.maps", - "app_store_id": "934850257" - } - } - ] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:521675454867:android:89d7051c910a2ed6", - "android_client_info": { - "package_name": "net.osmand.plus" - } - }, - "oauth_client": [ - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBMaRMiPY-mS3J_-aX30sRBFB-WGIm-M-U" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:521675454867:android:7e1b6333fdbe27e4", - "android_client_info": { - "package_name": "net.osmand.skimapsPlugin" - } - }, - "oauth_client": [ - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBMaRMiPY-mS3J_-aX30sRBFB-WGIm-M-U" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:521675454867:android:b53cc47c00e16275", - "android_client_info": { - "package_name": "net.osmand.nauticalPlugin" - } - }, - "oauth_client": [ - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBMaRMiPY-mS3J_-aX30sRBFB-WGIm-M-U" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:521675454867:android:d3c770d3b10e292d", - "android_client_info": { - "package_name": "net.osmand.parkingPlugin" - } - }, - "oauth_client": [ - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBMaRMiPY-mS3J_-aX30sRBFB-WGIm-M-U" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:521675454867:android:eedc4a033f567685", - "android_client_info": { - "package_name": "net.osmand.srtmPlugin.paid" - } - }, - "oauth_client": [ - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBMaRMiPY-mS3J_-aX30sRBFB-WGIm-M-U" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/plugins/Osmand-SRTMPlugin/src/net/osmand/srtmPlugin/SRTMPluginActivity.java b/plugins/Osmand-SRTMPlugin/src/net/osmand/srtmPlugin/SRTMPluginActivity.java index 9b4bec7bf6..d60c60190a 100644 --- a/plugins/Osmand-SRTMPlugin/src/net/osmand/srtmPlugin/SRTMPluginActivity.java +++ b/plugins/Osmand-SRTMPlugin/src/net/osmand/srtmPlugin/SRTMPluginActivity.java @@ -4,7 +4,6 @@ package net.osmand.srtmPlugin; import android.app.Activity; import android.content.ActivityNotFoundException; import android.content.ComponentName; -import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; @@ -16,8 +15,6 @@ import android.widget.TextView; import net.osmand.srtmPlugin.paid.R; -import java.lang.reflect.Method; - public class SRTMPluginActivity extends Activity { private static final String OSMAND_COMPONENT = "net.osmand"; //$NON-NLS-1$ private static final String OSMAND_COMPONENT_PLUS = "net.osmand.plus"; //$NON-NLS-1$ @@ -74,15 +71,9 @@ 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 + // not implemented yet } catch (Exception e) { - e.printStackTrace(); + //ignore } } } \ No newline at end of file diff --git a/plugins/Osmand-Skimaps/build.gradle b/plugins/Osmand-Skimaps/build.gradle index 91210d7b80..e103d4b997 100644 --- a/plugins/Osmand-Skimaps/build.gradle +++ b/plugins/Osmand-Skimaps/build.gradle @@ -63,18 +63,7 @@ repositories { } } -def analytics = System.getenv("USE_FIREBASE_FOR_PLUGINS") - dependencies { - if (analytics) { - implementation 'com.google.firebase:firebase-core:12.0.1' - implementation 'com.google.firebase:firebase-config:12.0.1' - } implementation 'com.android.support:appcompat-v7:27.1.1' implementation 'com.android.support:design:27.1.1' } - -if (analytics) { - println "Apply GMS plugin" - apply plugin: 'com.google.gms.google-services' -} diff --git a/plugins/Osmand-Skimaps/google-services.json b/plugins/Osmand-Skimaps/google-services.json deleted file mode 100644 index de9416f039..0000000000 --- a/plugins/Osmand-Skimaps/google-services.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "project_info": { - "project_number": "521675454867", - "firebase_url": "https://osmand-1e236.firebaseio.com", - "project_id": "osmand-1e236", - "storage_bucket": "osmand-1e236.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:521675454867:android:be0477f14dc015f4", - "android_client_info": { - "package_name": "net.osmand" - } - }, - "oauth_client": [ - { - "client_id": "521675454867-te1hdssotqq2dhu7pj2pjm17eulm1tvf.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "net.osmand", - "certificate_hash": "49A9ACE0BFEE7BB91506D7921F93A47808CB62AB" - } - }, - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBMaRMiPY-mS3J_-aX30sRBFB-WGIm-M-U" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "521675454867-ta1aisohg7g0k542gdh9fbeb2v4qsncf.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "net.osmand.maps", - "app_store_id": "934850257" - } - } - ] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:521675454867:android:89d7051c910a2ed6", - "android_client_info": { - "package_name": "net.osmand.plus" - } - }, - "oauth_client": [ - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBMaRMiPY-mS3J_-aX30sRBFB-WGIm-M-U" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:521675454867:android:7e1b6333fdbe27e4", - "android_client_info": { - "package_name": "net.osmand.skimapsPlugin" - } - }, - "oauth_client": [ - { - "client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBMaRMiPY-mS3J_-aX30sRBFB-WGIm-M-U" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/plugins/Osmand-Skimaps/src/net/osmand/skimaps/SkiMapsActivity.java b/plugins/Osmand-Skimaps/src/net/osmand/skimaps/SkiMapsActivity.java index 30b849d59d..75719a14c1 100644 --- a/plugins/Osmand-Skimaps/src/net/osmand/skimaps/SkiMapsActivity.java +++ b/plugins/Osmand-Skimaps/src/net/osmand/skimaps/SkiMapsActivity.java @@ -3,7 +3,6 @@ package net.osmand.skimaps; import android.app.Activity; import android.content.ActivityNotFoundException; import android.content.ComponentName; -import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; @@ -15,8 +14,6 @@ import android.widget.TextView; import net.osmand.skimapsPlugin.R; -import java.lang.reflect.Method; - public class SkiMapsActivity extends Activity { private static final String OSMAND_COMPONENT = "net.osmand"; //$NON-NLS-1$ private static final String OSMAND_COMPONENT_PLUS = "net.osmand.plus"; //$NON-NLS-1$ @@ -75,15 +72,9 @@ 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 + // not implemented yet } catch (Exception e) { - e.printStackTrace(); + //ignore } } } \ No newline at end of file