From b623366cc6ac9732010c4b97e547a7441511e38f Mon Sep 17 00:00:00 2001 From: shankar yadav Date: Tue, 14 Feb 2023 15:40:33 +0530 Subject: [PATCH] Added X-Greyed-App in the headers and updated google service json (#5342) --- app/src/dev/google-services.json | 90 ++++++++++++++++- app/src/prod/google-services.json | 99 ++++++++++++++++++- app/src/qa/google-services.json | 48 ++++++++- .../com/navi/common/network/BaseHttpClient.kt | 6 ++ 4 files changed, 238 insertions(+), 5 deletions(-) diff --git a/app/src/dev/google-services.json b/app/src/dev/google-services.json index 82ae9627ed..63ebadad54 100644 --- a/app/src/dev/google-services.json +++ b/app/src/dev/google-services.json @@ -6,6 +6,45 @@ "storage_bucket": "navi-dev-593cf.appspot.com" }, "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:7545371166:android:7be3e213d25f5641ca0c0f", + "android_client_info": { + "package_name": "com.naviapp" + } + }, + "oauth_client": [ + { + "client_id": "7545371166-e927k3npd4mc7auo0g4fbj3ghli4odt1.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyBxvRqQRHyi6B-isZv0VpF2al5cJA4SZ7s" + }, + { + "current_key": "AIzaSyAxa20cH98hAlk0TmAdldaiD6o1nlAoPnA" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "7545371166-29f25vn86fpdlolv6uj7n757k8m53e5s.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "7545371166-9gmh4tpgglkh1dsr7ojfs3kvjmatb0u0.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "com.gonavi.app.debug" + } + } + ] + } + } + }, { "client_info": { "mobilesdk_app_id": "1:7545371166:android:50fa837fb7444a25ca0c0f", @@ -22,14 +61,63 @@ "api_key": [ { "current_key": "AIzaSyBxvRqQRHyi6B-isZv0VpF2al5cJA4SZ7s" + }, + { + "current_key": "AIzaSyAxa20cH98hAlk0TmAdldaiD6o1nlAoPnA" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "7545371166-e927k3npd4mc7auo0g4fbj3ghli4odt1.apps.googleusercontent.com", + "client_id": "7545371166-29f25vn86fpdlolv6uj7n757k8m53e5s.apps.googleusercontent.com", "client_type": 3 + }, + { + "client_id": "7545371166-9gmh4tpgglkh1dsr7ojfs3kvjmatb0u0.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "com.gonavi.app.debug" + } + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:7545371166:android:fa337bc10b3d4676ca0c0f", + "android_client_info": { + "package_name": "com.naviapp.fps.dev" + } + }, + "oauth_client": [ + { + "client_id": "7545371166-e927k3npd4mc7auo0g4fbj3ghli4odt1.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyBxvRqQRHyi6B-isZv0VpF2al5cJA4SZ7s" + }, + { + "current_key": "AIzaSyAxa20cH98hAlk0TmAdldaiD6o1nlAoPnA" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "7545371166-29f25vn86fpdlolv6uj7n757k8m53e5s.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "7545371166-9gmh4tpgglkh1dsr7ojfs3kvjmatb0u0.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "com.gonavi.app.debug" + } } ] } diff --git a/app/src/prod/google-services.json b/app/src/prod/google-services.json index c7c80562eb..990a8e5f5a 100644 --- a/app/src/prod/google-services.json +++ b/app/src/prod/google-services.json @@ -8,9 +8,9 @@ "client": [ { "client_info": { - "mobilesdk_app_id": "1:1074736393094:android:21cc2dbc71b97768059a07", + "mobilesdk_app_id": "1:1074736393094:android:1b42658f489d11fd059a07", "android_client_info": { - "package_name": "com.naviapp" + "package_name": "com.navi" } }, "oauth_client": [ @@ -30,6 +30,101 @@ { "client_id": "1074736393094-u0ouuc378q74e5iagn36dse6nr3ph152.apps.googleusercontent.com", "client_type": 3 + }, + { + "client_id": "1074736393094-n0d5aeopsk3k7vdb9f1ms7mobhmq9jlk.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "com.gonavi.app" + } + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:1074736393094:android:21cc2dbc71b97768059a07", + "android_client_info": { + "package_name": "com.naviapp" + } + }, + "oauth_client": [ + { + "client_id": "1074736393094-ai231snch0jpkrujicedk0bs9c7nu5kl.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "com.naviapp", + "certificate_hash": "13fe8ea387b1fe6b47c28b918080ab2d5e499a48" + } + }, + { + "client_id": "1074736393094-u0ouuc378q74e5iagn36dse6nr3ph152.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyDxK8u8ONNh3C2-3Xvvavosd2NNuI62wTk" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "1074736393094-u0ouuc378q74e5iagn36dse6nr3ph152.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "1074736393094-n0d5aeopsk3k7vdb9f1ms7mobhmq9jlk.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "com.gonavi.app" + } + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:1074736393094:android:9ced0c993b0e71b4059a07", + "android_client_info": { + "package_name": "com.naviapp.fps" + } + }, + "oauth_client": [ + { + "client_id": "1074736393094-lni6s872pm15hd4ta99mnsc9brekgr74.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "com.naviapp.fps", + "certificate_hash": "7982ade408008dbe40e5cca019305551d68722ea" + } + }, + { + "client_id": "1074736393094-u0ouuc378q74e5iagn36dse6nr3ph152.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyDxK8u8ONNh3C2-3Xvvavosd2NNuI62wTk" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "1074736393094-u0ouuc378q74e5iagn36dse6nr3ph152.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "1074736393094-n0d5aeopsk3k7vdb9f1ms7mobhmq9jlk.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "com.gonavi.app" + } } ] } diff --git a/app/src/qa/google-services.json b/app/src/qa/google-services.json index 11a80be97c..b4d59eed19 100644 --- a/app/src/qa/google-services.json +++ b/app/src/qa/google-services.json @@ -1,6 +1,7 @@ { "project_info": { "project_number": "679085041776", + "firebase_url": "https://navi-qa-default-rtdb.asia-southeast1.firebasedatabase.app", "project_id": "navi-qa", "storage_bucket": "navi-qa.appspot.com" }, @@ -14,7 +15,7 @@ }, "oauth_client": [ { - "client_id": "679085041776-n6juhqpcr8221cifb7051ipkk2se4tpt.apps.googleusercontent.com", + "client_id": "679085041776-433aj023nobf5g9u08ggpqfhg4q9flm1.apps.googleusercontent.com", "client_type": 3 } ], @@ -27,8 +28,51 @@ "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "679085041776-n6juhqpcr8221cifb7051ipkk2se4tpt.apps.googleusercontent.com", + "client_id": "679085041776-433aj023nobf5g9u08ggpqfhg4q9flm1.apps.googleusercontent.com", "client_type": 3 + }, + { + "client_id": "679085041776-5e456o4prchtmblcl6r2vs7nrtuo5tvc.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "com.gonavi.app.debug" + } + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:679085041776:android:e2fdb172f0bd6df6546cb5", + "android_client_info": { + "package_name": "com.naviapp.fps.dev" + } + }, + "oauth_client": [ + { + "client_id": "679085041776-433aj023nobf5g9u08ggpqfhg4q9flm1.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyDNSiKfkive7IietLqcsnoNLVER3OvHwrc" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "679085041776-433aj023nobf5g9u08ggpqfhg4q9flm1.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "679085041776-5e456o4prchtmblcl6r2vs7nrtuo5tvc.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "com.gonavi.app.debug" + } } ] } diff --git a/navi-common/src/main/java/com/navi/common/network/BaseHttpClient.kt b/navi-common/src/main/java/com/navi/common/network/BaseHttpClient.kt index ff373b2f45..abbe5452d8 100644 --- a/navi-common/src/main/java/com/navi/common/network/BaseHttpClient.kt +++ b/navi-common/src/main/java/com/navi/common/network/BaseHttpClient.kt @@ -11,6 +11,8 @@ import android.content.Context import android.os.Build import com.navi.analytics.utils.NaviAnalyticsHelper import com.navi.analytics.utils.NaviTrackEvent +import com.navi.base.sharedpref.CommonPrefConstants +import com.navi.base.sharedpref.PreferenceManager import com.navi.base.utils.BaseUtils import com.navi.common.model.NetworkInfo import okhttp3.* @@ -37,6 +39,9 @@ abstract class BaseHttpClient(private val networkInfo: NetworkInfo, private val private val headerInterceptor: Interceptor get() = Interceptor { chain -> var request = chain.request() + val isNewLogoEnable = + PreferenceManager.getStringPreferenceApp(key = CommonPrefConstants.NEW_APP_LOGO) == CommonPrefConstants.NEW_APP_LOGO + val builder = request.headers.newBuilder().apply { add("Content-Type", "application/json") @@ -44,6 +49,7 @@ abstract class BaseHttpClient(private val networkInfo: NetworkInfo, private val add("appVersionCode", networkInfo.appVersionCode) add("osVersion", "Android_" + Build.VERSION.RELEASE) add("deviceId", BaseUtils.getDeviceId(context)) + add("X-Greyed-App", isNewLogoEnable.toString()) add("defaultLocale", BaseUtils.getDefaultLocale()) BaseUtils.getSessionToken()?.let { add("X-Session-Token", it) } try {