From b95223408610a53dd5fa94a339d3b92a9ebf1005 Mon Sep 17 00:00:00 2001 From: Ruben Gees Date: Sun, 7 Apr 2024 18:19:18 +0200 Subject: [PATCH 1/2] Update certificates and make pinning optional --- .../src/main/kotlin/me/proxer/library/ProxerApi.kt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/library/src/main/kotlin/me/proxer/library/ProxerApi.kt b/library/src/main/kotlin/me/proxer/library/ProxerApi.kt index 18ba2efc..8a2b71fd 100644 --- a/library/src/main/kotlin/me/proxer/library/ProxerApi.kt +++ b/library/src/main/kotlin/me/proxer/library/ProxerApi.kt @@ -63,16 +63,12 @@ class ProxerApi private constructor(retrofit: Retrofit) { const val TEST_KEY = "test" private val CERTIFICATES = arrayOf( - // https://censys.io/certificates/0687260331a72403d909f105e69bcf0d32e1bd2493ffc6d9206d11bcd6770739 "sha256/Vjs8r4z+80wjNcr1YKepWQboSIRi63WsWXhIMN+eWys=", - // https://censys.io/certificates/16af57a9f676b0ab126095aa5ebadef22ab31119d644ac95cd4b93dbf3f26aeb "sha256/Y9mvm0exBk1JoQ57f9Vm28jKo5lFm/woKcVxrYxu80o=", - // https://censys.io/certificates/1793927a0614549789adce2f8f34f7f0b66d0f3ae3a3b84d21ec15dbba4fadc7 "sha256/58qRu/uxh4gFezqAcERupSkRYBlBAvfcw7mEjGPLnNU=", - // https://censys.io/certificates/52f0e1c4e58ec629291b60317f074671b85d7ea80d5b07273463534b32b40234 "sha256/grX4Ta9HpZx6tSHkmCrvpApTQGo67CYDnvprLg5yRME=", - // https://censys.io/certificates/96bcec06264976f37460779acf28c5a7cfe8a3c0aae11a8ffcee05c0bddf08c6 - "sha256/C5+lpZ7tcVwmwQIMcRtPbsQtWLABXhQzejna0wHFr8M=" + "sha256/C5+lpZ7tcVwmwQIMcRtPbsQtWLABXhQzejna0wHFr8M=", + "sha256/TeT9kTnquzkcIJC0caQ09mL9o/Fj6GqUPJ5IQQ/ztUM=", ) private const val DEFAULT_USER_AGENT = "ProxerLibJava/" + BuildConfig.VERSION @@ -182,6 +178,7 @@ class ProxerApi private constructor(retrofit: Retrofit) { private var moshi: Moshi? = null private var client: OkHttpClient? = null private var retrofit: Retrofit? = null + private var enableCertificatePinning: Boolean = false private var enableRateLimitProtection: Boolean = false /** @@ -263,7 +260,7 @@ class ProxerApi private constructor(retrofit: Retrofit) { if (enableRateLimitProtection) add(4, RateLimitInterceptor(moshi, client?.cache)) } - certificatePinner(constructCertificatePinner()) + if (enableCertificatePinning) certificatePinner(constructCertificatePinner()) } .build() } From 8e7d70afc0882fb41581d56308e12ad4c701832d Mon Sep 17 00:00:00 2001 From: Ruben Gees Date: Sun, 7 Apr 2024 18:34:58 +0200 Subject: [PATCH 2/2] Bump version --- README.md | 6 +++--- gradle/versions.gradle | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9e4a0b64..9eb6e2a4 100644 --- a/README.md +++ b/README.md @@ -19,12 +19,12 @@ And this to your module build.gradle: ```groovy dependencies { - implementation 'com.github.proxer:ProxerLibJava:5.3.0' + implementation 'com.github.proxer:ProxerLibJava:5.4.0' } ``` You can also download the `jar` directly -from [here](https://jitpack.io/com/github/proxer/ProxerLibJava/5.3.0/ProxerLibJava-5.3.0.jar), if you prefer. +from [here](https://jitpack.io/com/github/proxer/ProxerLibJava/5.4.0/ProxerLibJava-5.4.0.jar), if you prefer. > Note that this jar does not come with the required dependencies. You have to include those manually in that case. @@ -271,7 +271,7 @@ If you need to provide the config yourself (e.g. when using an older ProGuard ve ### More -You can find detailed JavaDoc [here](https://jitpack.io/com/github/proxer/ProxerLibJava/5.3.0/javadoc/). +You can find detailed JavaDoc [here](https://jitpack.io/com/github/proxer/ProxerLibJava/5.4.0/javadoc/). ## Working on the library diff --git a/gradle/versions.gradle b/gradle/versions.gradle index 37b450ef..7a3c42bb 100644 --- a/gradle/versions.gradle +++ b/gradle/versions.gradle @@ -1,5 +1,5 @@ ext { - version = "5.3.0" + version = "5.4.0" group = "com.github.proxer" gradleVersion = "6.7.1"