Drop firebase/facebook
This commit is contained in:
parent
49e7cc2b2c
commit
bec204e9a9
16 changed files with 12 additions and 1011 deletions
|
@ -17,12 +17,6 @@ apply plugin: 'com.android.application'
|
||||||
// </unzip>
|
// </unzip>
|
||||||
// Less important
|
// 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 {
|
task printc {
|
||||||
configurations.each { if(it.isCanBeResolved()) println it.name }
|
configurations.each { if(it.isCanBeResolved()) println it.name }
|
||||||
|
@ -50,8 +44,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion System.getenv("MIN_SDK_VERSION") ? System.getenv("MIN_SDK_VERSION").toInteger() :
|
minSdkVersion System.getenv("MIN_SDK_VERSION") ? System.getenv("MIN_SDK_VERSION").toInteger() : 14
|
||||||
(analytics ? 15 : 14)
|
|
||||||
targetSdkVersion 26
|
targetSdkVersion 26
|
||||||
versionCode 330
|
versionCode 330
|
||||||
versionCode System.getenv("APK_NUMBER_VERSION") ? System.getenv("APK_NUMBER_VERSION").toInteger() : versionCode
|
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 {
|
dependencies {
|
||||||
implementation project(path: ':OsmAnd-java', configuration: 'android')
|
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:multidex:1.0.1'
|
||||||
implementation 'com.android.support:gridlayout-v7:27.1.1'
|
implementation 'com.android.support:gridlayout-v7:27.1.1'
|
||||||
implementation 'com.android.support:cardview-v7:27.1.1'
|
implementation 'com.android.support:cardview-v7:27.1.1'
|
||||||
|
@ -436,7 +420,3 @@ dependencies {
|
||||||
exclude group: 'com.android.support'
|
exclude group: 'com.android.support'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(analytics) {
|
|
||||||
println "Apply GMS plugin"
|
|
||||||
apply plugin: 'com.google.gms.google-services'
|
|
||||||
}
|
|
||||||
|
|
|
@ -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"
|
|
||||||
}
|
|
|
@ -2,7 +2,6 @@ package net.osmand.plus;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlarmManager;
|
import android.app.AlarmManager;
|
||||||
import android.app.Application;
|
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
@ -14,7 +13,6 @@ import android.content.pm.PackageManager.NameNotFoundException;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.support.multidex.MultiDex;
|
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.SQLiteAPI;
|
||||||
import net.osmand.plus.api.SQLiteAPIImpl;
|
import net.osmand.plus.api.SQLiteAPIImpl;
|
||||||
import net.osmand.plus.base.MapViewTrackingUtilities;
|
import net.osmand.plus.base.MapViewTrackingUtilities;
|
||||||
import net.osmand.plus.dashboard.DashErrorFragment;
|
|
||||||
import net.osmand.plus.dialogs.ErrorBottomSheetDialog;
|
import net.osmand.plus.dialogs.ErrorBottomSheetDialog;
|
||||||
import net.osmand.plus.dialogs.RateUsBottomSheetDialog;
|
import net.osmand.plus.dialogs.RateUsBottomSheetDialog;
|
||||||
import net.osmand.plus.download.DownloadIndexesThread;
|
import net.osmand.plus.download.DownloadIndexesThread;
|
||||||
|
@ -76,11 +73,8 @@ import java.io.File;
|
||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
import java.lang.Thread.UncaughtExceptionHandler;
|
import java.lang.Thread.UncaughtExceptionHandler;
|
||||||
import java.lang.reflect.Method;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import btools.routingapp.BRouterServiceConnection;
|
import btools.routingapp.BRouterServiceConnection;
|
||||||
import btools.routingapp.IBRouterService;
|
import btools.routingapp.IBRouterService;
|
||||||
|
@ -89,8 +83,6 @@ public class OsmandApplication extends MultiDexApplication {
|
||||||
public static final String EXCEPTION_PATH = "exception.log";
|
public static final String EXCEPTION_PATH = "exception.log";
|
||||||
private static final org.apache.commons.logging.Log LOG = PlatformUtil.getLog(OsmandApplication.class);
|
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);
|
final AppInitializer appInitializer = new AppInitializer(this);
|
||||||
OsmandSettings osmandSettings = null;
|
OsmandSettings osmandSettings = null;
|
||||||
OsmAndAppCustomization appCustomization;
|
OsmAndAppCustomization appCustomization;
|
||||||
|
@ -98,7 +90,6 @@ public class OsmandApplication extends MultiDexApplication {
|
||||||
private final OsmAndTaskManager taskManager = new OsmAndTaskManager(this);
|
private final OsmAndTaskManager taskManager = new OsmAndTaskManager(this);
|
||||||
private final UiUtilities iconsCache = new UiUtilities(this);
|
private final UiUtilities iconsCache = new UiUtilities(this);
|
||||||
Handler uiHandler;
|
Handler uiHandler;
|
||||||
private boolean plusVersionInApp;
|
|
||||||
|
|
||||||
NavigationService navigationService;
|
NavigationService navigationService;
|
||||||
|
|
||||||
|
@ -182,8 +173,6 @@ public class OsmandApplication extends MultiDexApplication {
|
||||||
// if(!osmandSettings.FOLLOW_THE_ROUTE.get()) {
|
// if(!osmandSettings.FOLLOW_THE_ROUTE.get()) {
|
||||||
// targetPointsHelper.clearPointToNavigate(false);
|
// targetPointsHelper.clearPointToNavigate(false);
|
||||||
// }
|
// }
|
||||||
initExternalLibs();
|
|
||||||
plusVersionInApp = getRemoteBoolean(SHOW_PLUS_VERSION_INAPP_PARAM, true);
|
|
||||||
startApplication();
|
startApplication();
|
||||||
System.out.println("Time to start application " + (System.currentTimeMillis() - timeToStart) + " ms. Should be less < 800 ms");
|
System.out.println("Time to start application " + (System.currentTimeMillis() - timeToStart) + " ms. Should be less < 800 ms");
|
||||||
timeToStart = System.currentTimeMillis();
|
timeToStart = System.currentTimeMillis();
|
||||||
|
@ -194,7 +183,7 @@ public class OsmandApplication extends MultiDexApplication {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPlusVersionInApp() {
|
public boolean isPlusVersionInApp() {
|
||||||
return plusVersionInApp;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isExternalStorageDirectoryReadOnly() {
|
public boolean isExternalStorageDirectoryReadOnly() {
|
||||||
|
@ -924,117 +913,12 @@ public class OsmandApplication extends MultiDexApplication {
|
||||||
try {
|
try {
|
||||||
if (Version.isGooglePlayEnabled(this) && !Version.isPaidVersion(this)
|
if (Version.isGooglePlayEnabled(this) && !Version.isPaidVersion(this)
|
||||||
&& !osmandSettings.DO_NOT_SEND_ANONYMOUS_APP_USAGE.get()) {
|
&& !osmandSettings.DO_NOT_SEND_ANONYMOUS_APP_USAGE.get()) {
|
||||||
Class<?> cl = Class.forName("com.google.firebase.analytics.FirebaseAnalytics");
|
// not implemented yet
|
||||||
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 (Exception e) {
|
} 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<String, Object> 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) {
|
public void restartApp(Context ctx) {
|
||||||
AlertDialog.Builder bld = new AlertDialog.Builder(ctx);
|
AlertDialog.Builder bld = new AlertDialog.Builder(ctx);
|
||||||
|
|
|
@ -60,7 +60,6 @@ import net.osmand.plus.download.ui.SearchDialogFragment;
|
||||||
import net.osmand.plus.download.ui.UpdatesIndexFragment;
|
import net.osmand.plus.download.ui.UpdatesIndexFragment;
|
||||||
import net.osmand.plus.helpers.FileNameTranslationHelper;
|
import net.osmand.plus.helpers.FileNameTranslationHelper;
|
||||||
import net.osmand.plus.inapp.InAppPurchaseHelper;
|
import net.osmand.plus.inapp.InAppPurchaseHelper;
|
||||||
import net.osmand.plus.inapp.InAppPurchaseHelper.InAppPurchaseListener;
|
|
||||||
import net.osmand.plus.inapp.InAppPurchaseHelper.InAppPurchaseTaskType;
|
import net.osmand.plus.inapp.InAppPurchaseHelper.InAppPurchaseTaskType;
|
||||||
import net.osmand.plus.openseamapsplugin.NauticalMapsPlugin;
|
import net.osmand.plus.openseamapsplugin.NauticalMapsPlugin;
|
||||||
import net.osmand.plus.srtmplugin.SRTMPlugin;
|
import net.osmand.plus.srtmplugin.SRTMPlugin;
|
||||||
|
@ -131,7 +130,6 @@ public class DownloadActivity extends AbstractDownloadActivity implements Downlo
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
getMyApplication().applyTheme(this);
|
getMyApplication().applyTheme(this);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
getMyApplication().fetchRemoteParams();
|
|
||||||
downloadThread = getMyApplication().getDownloadThread();
|
downloadThread = getMyApplication().getDownloadThread();
|
||||||
DownloadResources indexes = getDownloadThread().getIndexes();
|
DownloadResources indexes = getDownloadThread().getIndexes();
|
||||||
if (!indexes.isDownloadedFromInternet) {
|
if (!indexes.isDownloadedFromInternet) {
|
||||||
|
|
|
@ -62,18 +62,7 @@ repositories {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def analytics = System.getenv("USE_FIREBASE_FOR_PLUGINS")
|
|
||||||
|
|
||||||
dependencies {
|
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:appcompat-v7:27.1.1'
|
||||||
implementation 'com.android.support:design:27.1.1'
|
implementation 'com.android.support:design:27.1.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
if (analytics) {
|
|
||||||
println "Apply GMS plugin"
|
|
||||||
apply plugin: 'com.google.gms.google-services'
|
|
||||||
}
|
|
|
@ -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"
|
|
||||||
}
|
|
|
@ -3,7 +3,6 @@ package net.osmand.nautical;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.pm.ResolveInfo;
|
import android.content.pm.ResolveInfo;
|
||||||
|
@ -15,8 +14,6 @@ import android.widget.TextView;
|
||||||
|
|
||||||
import net.osmand.nauticalPlugin.R;
|
import net.osmand.nauticalPlugin.R;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
|
|
||||||
public class NauticalActivity extends Activity {
|
public class NauticalActivity extends Activity {
|
||||||
private static final String OSMAND_COMPONENT = "net.osmand"; //$NON-NLS-1$
|
private static final String OSMAND_COMPONENT = "net.osmand"; //$NON-NLS-1$
|
||||||
private static final String OSMAND_COMPONENT_PLUS = "net.osmand.plus"; //$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) {
|
public void logEvent(Activity ctx, String event) {
|
||||||
try {
|
try {
|
||||||
Class<?> cl = Class.forName("com.google.firebase.analytics.FirebaseAnalytics");
|
// not implemented yet
|
||||||
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) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
//ignore
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -62,18 +62,7 @@ repositories {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def analytics = System.getenv("USE_FIREBASE_FOR_PLUGINS")
|
|
||||||
|
|
||||||
dependencies {
|
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:appcompat-v7:27.1.1'
|
||||||
implementation 'com.android.support:design:27.1.1'
|
implementation 'com.android.support:design:27.1.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
if (analytics) {
|
|
||||||
println "Apply GMS plugin"
|
|
||||||
apply plugin: 'com.google.gms.google-services'
|
|
||||||
}
|
|
||||||
|
|
|
@ -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"
|
|
||||||
}
|
|
|
@ -4,7 +4,6 @@ package net.osmand.parkingPlugin;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.pm.ResolveInfo;
|
import android.content.pm.ResolveInfo;
|
||||||
|
@ -14,8 +13,6 @@ import android.text.Html;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
|
|
||||||
public class ParkingPluginActivity extends Activity {
|
public class ParkingPluginActivity extends Activity {
|
||||||
private static final String OSMAND_COMPONENT = "net.osmand"; //$NON-NLS-1$
|
private static final String OSMAND_COMPONENT = "net.osmand"; //$NON-NLS-1$
|
||||||
private static final String OSMAND_COMPONENT_PLUS = "net.osmand.plus"; //$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) {
|
public void logEvent(Activity ctx, String event) {
|
||||||
try {
|
try {
|
||||||
Class<?> cl = Class.forName("com.google.firebase.analytics.FirebaseAnalytics");
|
// not implemented yet
|
||||||
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) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
//ignore
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -62,18 +62,7 @@ repositories {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def analytics = System.getenv("USE_FIREBASE_FOR_PLUGINS")
|
|
||||||
|
|
||||||
dependencies {
|
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:appcompat-v7:27.1.1'
|
||||||
implementation 'com.android.support:design:27.1.1'
|
implementation 'com.android.support:design:27.1.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
if (analytics) {
|
|
||||||
println "Apply GMS plugin"
|
|
||||||
apply plugin: 'com.google.gms.google-services'
|
|
||||||
}
|
|
||||||
|
|
|
@ -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"
|
|
||||||
}
|
|
|
@ -4,7 +4,6 @@ package net.osmand.srtmPlugin;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.pm.ResolveInfo;
|
import android.content.pm.ResolveInfo;
|
||||||
|
@ -16,8 +15,6 @@ import android.widget.TextView;
|
||||||
|
|
||||||
import net.osmand.srtmPlugin.paid.R;
|
import net.osmand.srtmPlugin.paid.R;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
|
|
||||||
public class SRTMPluginActivity extends Activity {
|
public class SRTMPluginActivity extends Activity {
|
||||||
private static final String OSMAND_COMPONENT = "net.osmand"; //$NON-NLS-1$
|
private static final String OSMAND_COMPONENT = "net.osmand"; //$NON-NLS-1$
|
||||||
private static final String OSMAND_COMPONENT_PLUS = "net.osmand.plus"; //$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) {
|
public void logEvent(Activity ctx, String event) {
|
||||||
try {
|
try {
|
||||||
Class<?> cl = Class.forName("com.google.firebase.analytics.FirebaseAnalytics");
|
// not implemented yet
|
||||||
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) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
//ignore
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -63,18 +63,7 @@ repositories {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def analytics = System.getenv("USE_FIREBASE_FOR_PLUGINS")
|
|
||||||
|
|
||||||
dependencies {
|
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:appcompat-v7:27.1.1'
|
||||||
implementation 'com.android.support:design:27.1.1'
|
implementation 'com.android.support:design:27.1.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
if (analytics) {
|
|
||||||
println "Apply GMS plugin"
|
|
||||||
apply plugin: 'com.google.gms.google-services'
|
|
||||||
}
|
|
||||||
|
|
|
@ -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"
|
|
||||||
}
|
|
|
@ -3,7 +3,6 @@ package net.osmand.skimaps;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.pm.ResolveInfo;
|
import android.content.pm.ResolveInfo;
|
||||||
|
@ -15,8 +14,6 @@ import android.widget.TextView;
|
||||||
|
|
||||||
import net.osmand.skimapsPlugin.R;
|
import net.osmand.skimapsPlugin.R;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
|
|
||||||
public class SkiMapsActivity extends Activity {
|
public class SkiMapsActivity extends Activity {
|
||||||
private static final String OSMAND_COMPONENT = "net.osmand"; //$NON-NLS-1$
|
private static final String OSMAND_COMPONENT = "net.osmand"; //$NON-NLS-1$
|
||||||
private static final String OSMAND_COMPONENT_PLUS = "net.osmand.plus"; //$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) {
|
public void logEvent(Activity ctx, String event) {
|
||||||
try {
|
try {
|
||||||
Class<?> cl = Class.forName("com.google.firebase.analytics.FirebaseAnalytics");
|
// not implemented yet
|
||||||
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) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
//ignore
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue