Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
Update to newer versions for dependencies. Disable gzip in TUMonline.
Browse files Browse the repository at this point in the history
  • Loading branch information
kordianbruck committed Sep 17, 2020
1 parent 3469f27 commit 29f99c9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ dependencies {
kapt 'androidx.room:room-compiler:2.3.0-alpha01'

// Play services
implementation 'com.google.android.gms:play-services-base:17.3.0'
implementation 'com.google.android.gms:play-services-base:17.4.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'

// Firebase
implementation 'com.google.firebase:firebase-core:17.4.3'
implementation 'com.google.firebase:firebase-messaging:20.2.1'
implementation 'com.google.firebase:firebase-core:17.5.0'
implementation 'com.google.firebase:firebase-messaging:20.2.4'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'

// Helpers
Expand All @@ -135,7 +135,7 @@ dependencies {
// Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.anko:anko:0.10.8"
implementation 'androidx.core:core-ktx:1.3.0'
implementation 'androidx.core:core-ktx:1.3.1'
implementation 'androidx.fragment:fragment-ktx:1.2.5'

// RxJava
Expand Down Expand Up @@ -181,7 +181,7 @@ dependencies {
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.23.4'
testImplementation 'org.assertj:assertj-core:3.11.1'
testImplementation 'androidx.room:room-testing:2.3.0-alpha01'
testImplementation 'androidx.room:room-testing:2.3.0-alpha02'
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"

testImplementation 'com.android.support.test:rules:1.0.2'
Expand Down
13 changes: 12 additions & 1 deletion app/src/main/java/de/tum/in/tumcampusapp/api/app/ApiHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import de.tum.in.tumcampusapp.BuildConfig;
import de.tum.in.tumcampusapp.utils.Utils;
import kotlin.text.Charsets;
import okhttp3.CertificatePinner;
import okhttp3.CookieJar;
import okhttp3.Interceptor;
Expand Down Expand Up @@ -71,6 +70,9 @@ public static OkHttpClient getOkHttpClient(Context c) {
.cookieJar(cookieJar)
.certificatePinner(certificatePinner);

// Disable gzip for requests as TUMonline
builder.addInterceptor(ApiHelper.disableGzip());

//Add the device identifying header
builder.addInterceptor(ApiHelper.getDeviceInterceptor(c));

Expand All @@ -88,6 +90,15 @@ public static OkHttpClient getOkHttpClient(Context c) {
return client;
}

private static Interceptor disableGzip() {
return chain -> {
Request.Builder newRequest = chain.request()
.newBuilder()
.addHeader("Accept-Encoding", "identity");
return chain.proceed(newRequest.build());
};
}

private static Interceptor getDeviceInterceptor(final Context c) {
//Clearly identify all requests from this app
final StringBuilder userAgent = new StringBuilder("TCA Client ");
Expand Down

0 comments on commit 29f99c9

Please sign in to comment.