From 1213201aa6e853d0a4195d251f91fef279242de1 Mon Sep 17 00:00:00 2001 From: adityankannan-tw <109274996+adityankannan-tw@users.noreply.github.com> Date: Thu, 19 Oct 2023 15:48:01 +0530 Subject: [PATCH] Remove google code (#946) * refactor(INJI-430): remove google nearby and firebase code Signed-off-by: adityankannan-tw * refactor(INJI-430): update readme Signed-off-by: adityankannan-tw * Update sonar-project.properties --------- Signed-off-by: adityankannan-tw --- .env | 2 - README.md | 9 +--- android/app/build.gradle | 18 +------- android/app/google-services.json | 39 ------------------ android/app/google-services.json.gpg | Bin 499 -> 0 bytes android/app/mosip-google-services.json.gpg | Bin 755 -> 0 bytes .../io/mosip/residentapp/MainApplication.java | 29 ------------- android/build.gradle | 2 - shared/constants.ts | 12 +----- sonar-project.properties | 2 +- 10 files changed, 5 insertions(+), 108 deletions(-) delete mode 100644 android/app/google-services.json delete mode 100644 android/app/google-services.json.gpg delete mode 100644 android/app/mosip-google-services.json.gpg diff --git a/.env b/.env index 6ff684b9d5..f598a9852b 100644 --- a/.env +++ b/.env @@ -6,8 +6,6 @@ MIMOTO_HOST=https://api.qa-inji.mosip.net ESIGNET_HOST=https://api.qa-inji.mosip.net -GOOGLE_NEARBY_MESSAGES_API_KEY= - OBSRV_HOST = https://dataset-api.obsrv.mosip.net #Application Theme can be ( orange | purple ) diff --git a/README.md b/README.md index 48d5ad3694..8020928482 100644 --- a/README.md +++ b/README.md @@ -52,16 +52,9 @@ Create a `.env.local` file using `.env` as your template: ``` MIMOTO_HOST= -GOOGLE_NEARBY_MESSAGES_API_KEY= ``` -And `android/local.properties`: - -``` -GOOGLE_NEARBY_MESSAGES_API_KEY= -``` - -More info here: [Setup Google Nearby Messages in React](https://github.com/mrousavy/react-native-google-nearby-messages#usage) +And `android/local.properties`. ### Android diff --git a/android/app/build.gradle b/android/app/build.gradle index b09cb81fd4..da5151253a 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -3,8 +3,6 @@ plugins { } apply plugin: "com.android.application" -apply plugin: 'com.google.gms.google-services' -apply plugin: 'com.google.firebase.crashlytics' apply plugin: "com.facebook.react" import com.android.build.OutputFile @@ -121,7 +119,6 @@ android { manifestPlaceholders = [ APP_NAME: APP_NAME_RELEASE, - GOOGLE_NEARBY_MESSAGES_API_KEY: "${properties.getProperty('GOOGLE_NEARBY_MESSAGES_API_KEY')}", appAuthRedirectScheme: 'io.mosip.residentapp.inji' ] } @@ -250,20 +247,9 @@ dependencies { } else { implementation jscFlavor } - // Firebase - implementation 'com.google.firebase:firebase-crashlytics:17.3.1' - implementation 'com.google.firebase:firebase-analytics:18.0.2' + implementation 'com.jakewharton.timber:timber:4.7.1' } apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) -apply from: "./eas-build.gradle" - -try { - def servicesJSON = file('google-services.json') - if (servicesJSON.text) { - apply plugin: 'com.google.gms.google-services' - } -} catch(Exception e) { - logger.warn("google-services.json not found, google-services plugin not applied. Push Notifications won't work") -} \ No newline at end of file +apply from: "./eas-build.gradle" \ No newline at end of file diff --git a/android/app/google-services.json b/android/app/google-services.json deleted file mode 100644 index 3d2bb016da..0000000000 --- a/android/app/google-services.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "project_info": { - "project_number": "259470317171", - "project_id": "mosip-resident-app", - "storage_bucket": "mosip-resident-app.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "", - "android_client_info": { - "package_name": "io.mosip.residentapp" - } - }, - "oauth_client": [ - { - "client_id": "", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "", - "client_type": 3 - } - ] - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/android/app/google-services.json.gpg b/android/app/google-services.json.gpg deleted file mode 100644 index 6303fa5765a14e974a81373b47bbe5de2317648a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 499 zcmV(%wrwZ`;#i%T1gmGQx}^!twqtE-vpMf+kZ0JkdP2ohM^e2O zqEN=c|B?=ZHuz3SQT*Mmt>Dgd3xy>vxX3#1n-xIu>JxPKT<4Kdj1)la(Gp*_?CTtSJ4k;(+p~~JYLq^t zstB)N-S~SK%}AQJnm%z9JNaMFzB4e+Y9IyB{lb>#h>}#q(DncX4B{L_rQ1@Gg3^YB zjD0IIx|ugwv7jR5)~PmEs*}5kd}~kCFZJ%gVtIpuS)B!KxI>`B;JNN!8Oan)4N+FDz|_n`TMN+wMU&v2?`D(acZQLQzKY z=%_xRL)A{@Dj^R-Y*Z*XxvC6bY_BG`j5RcCVRnlY9dCG3-`K6Vx$Ps>MrC@Rx909BBJ1p_Spac diff --git a/android/app/mosip-google-services.json.gpg b/android/app/mosip-google-services.json.gpg deleted file mode 100644 index 8b7b3382bb1e30cdee454e1208ed7e2ca73212c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 755 zcmV-8THKtE? zK)aX(ol$$g0hn5_Qe8^8!y22qtvd3KL1^5>rC4u2=q@L+mK~WWyVyv1CRIR!<|7(+ z5dFP$=f@fp*ldn1j@Y5G-A7OZL+W05_Lra|qxq;&#MqsXkbJAo77mIPnxayh5#u6s z(5o9W7)-q?Gmy5lWRyJ$U|`@m(mGryX@f^wY4^qdLLn1==1E;rPg*LOf~OzyuU(1H z^Iv?i5@}A9sv&L>__N(8w-6Yd^qvKUWCi&VVK(oyn1}-(23GH!_3z3>2e83+cwcz{ zeZ|#9M68#mY;k;mJ<=!cw}sNdApwIryfa%A5Gvt-Cor3A4hjrDJ;xq!eh1Q0M@fdf zcEuV`&|vGtc#i|lJai(ngFT=YlY@ZADmvfoM??1k7x^IBJ@(FHNG`{k_a|yA-2UXp zc2uV91SXfM7`RCb4W#!6%3Xs=8mh+Tn%WRjqLMtD=MXSzi_j0fBn4!iGUuY^ z3QFS+oAleIV+)^tHFZl2<+g}Yp@gUJZ?9px_(Nv8Txo%@-I%RTQ zJi`TUOH)oDAPA(>A=So9Z>#UqKN95 z#bTn@U&0gp+JBg>`0O^zw&N>eaY#kTzNFh%3rgg5z8;-+gI&q%MV^YYCgmZpi=u diff --git a/android/app/src/main/java/io/mosip/residentapp/MainApplication.java b/android/app/src/main/java/io/mosip/residentapp/MainApplication.java index d952ffcff7..0271f4666d 100644 --- a/android/app/src/main/java/io/mosip/residentapp/MainApplication.java +++ b/android/app/src/main/java/io/mosip/residentapp/MainApplication.java @@ -21,8 +21,6 @@ import timber.log.Timber; import com.facebook.react.bridge.JSIModulePackage; -import com.google.firebase.analytics.FirebaseAnalytics; -import com.google.firebase.crashlytics.FirebaseCrashlytics; import java.lang.reflect.InvocationTargetException; import java.util.List; @@ -77,36 +75,9 @@ public void onCreate() { if (BuildConfig.DEBUG) { Timber.plant(new Timber.DebugTree()); } - // Setup Firebase - FirebaseAnalytics.getInstance(this); - Timber.plant(new CrashReportingTree()); ApplicationLifecycleDispatcher.onApplicationCreate(this); } - - /** - * A tree which logs important information for crash reporting. - */ - private static class CrashReportingTree extends Timber.Tree { - FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance(); - @Override - protected void log(int priority, String tag, @NonNull String message, Throwable t) { - if (priority == Log.VERBOSE || priority == Log.DEBUG) { - return; - } - - crashlytics.setCustomKey("priority", priority); - crashlytics.setCustomKey("tag", tag); - crashlytics.log(message); - - if (t != null) { - if (priority == Log.ERROR) { - crashlytics.recordException(t); - } - } - } - } - @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); diff --git a/android/build.gradle b/android/build.gradle index 6df566b221..0824a6e5f8 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -17,8 +17,6 @@ buildscript { } dependencies { classpath("com.android.tools.build:gradle:7.3.1") - classpath 'com.google.gms:google-services:4.3.5' - classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1' classpath("com.facebook.react:react-native-gradle-plugin") } } diff --git a/shared/constants.ts b/shared/constants.ts index 09b62c6f7e..19c43d8d3a 100644 --- a/shared/constants.ts +++ b/shared/constants.ts @@ -1,10 +1,5 @@ import {Platform} from 'react-native'; -import { - MIMOTO_HOST, - ESIGNET_HOST, - GOOGLE_NEARBY_MESSAGES_API_KEY, - DEBUG_MODE, -} from 'react-native-dotenv'; +import {MIMOTO_HOST, ESIGNET_HOST, DEBUG_MODE} from 'react-native-dotenv'; import {Argon2iConfig} from './commonUtil'; import {VcIdType} from '../types/vc'; @@ -31,11 +26,6 @@ export const ACTIVITY_LOG_STORE_KEY = 'activityLog'; export const SETTINGS_STORE_KEY = 'settings'; -export const GNM_API_KEY = GOOGLE_NEARBY_MESSAGES_API_KEY; - -// https://developers.google.com/android/reference/com/google/android/gms/nearby/messages/Message#MAX_CONTENT_SIZE_BYTES -export const GNM_MESSAGE_LIMIT = 102400 - 6400; // allowance for metadata - export const APP_ID_LENGTH = 12; // Numbers and Upper case Alphabets without confusing characters like 0, 1, 2, I, O, Z diff --git a/sonar-project.properties b/sonar-project.properties index 5cd49b0753..eb27b507b8 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,4 +1,4 @@ sonar.projectKey=mosip_inji sonar.organization=mosip -sonar.exclusions=.github/**, .vscode/**, android/**, assets/**, build/**, ios/**, node_modules/**, scripts/** +sonar.exclusions=.github/**, .vscode/**, android/**, assets/**, build/**, ios/**, node_modules/**, scripts/**, **/*.java