File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
firebase-auth-rest/core/src/main/java/com/anotherdev/firebase/auth/rest/api Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 11package com .anotherdev .firebase .auth .rest .api ;
22
3+ import android .content .Context ;
4+ import android .content .pm .ApplicationInfo ;
5+
36import com .anotherdev .firebase .auth .init .AppContext ;
47import com .anotherdev .firebase .auth .util .FarGson ;
58
912import retrofit2 .Retrofit ;
1013import retrofit2 .converter .gson .GsonConverterFactory ;
1114
12- import static com .anotherdev .firebase .auth .core .BuildConfig .DEBUG ;
1315import static okhttp3 .logging .HttpLoggingInterceptor .Level .BASIC ;
1416import static okhttp3 .logging .HttpLoggingInterceptor .Level .BODY ;
1517
@@ -20,9 +22,11 @@ public final class RestAuthApi {
2022
2123
2224 private RestAuthApi () {
25+ Context context = AppContext .get ();
26+ boolean isDebugBuild = (context .getApplicationInfo ().flags & ApplicationInfo .FLAG_DEBUGGABLE ) != 0 ;
2327 OkHttpClient okHttpClient = new OkHttpClient .Builder ()
24- .addInterceptor (new HttpLoggingInterceptor ().setLevel (DEBUG ? BODY : BASIC ))
25- .addInterceptor (new RestAuthInterceptor (AppContext . get () ))
28+ .addInterceptor (new HttpLoggingInterceptor ().setLevel (isDebugBuild ? BODY : BASIC ))
29+ .addInterceptor (new RestAuthInterceptor (context ))
2630 .build ();
2731
2832 auth = buildApi (okHttpClient , IdentityToolkitApi .BASE_URL , IdentityToolkitApi .class );
You can’t perform that action at this time.
0 commit comments