From bb0ea876fa9844d620cdf25bf45582f3d5d1ee58 Mon Sep 17 00:00:00 2001 From: Vavassor Date: Tue, 18 Jul 2017 00:30:24 -0400 Subject: [PATCH] Okay, toss BouncyCastleProvider so we can release a beta. --- app/build.gradle | 5 +-- app/proguard-rules.pro | 18 ++++---- .../keylesspalace/tusky/TuskyApplication.java | 41 ------------------- 3 files changed, 9 insertions(+), 55 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ed17a6c0..6c72ce6c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "com.keylesspalace.tusky" minSdkVersion 15 targetSdkVersion 25 - versionCode 22 - versionName "1.1.4-beta.6" + versionCode 23 + versionName "1.1.4-beta.7" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary true } @@ -57,7 +57,6 @@ dependencies { compile('org.eclipse.paho:org.eclipse.paho.android.service:1.1.1') { exclude module: 'support-v4' } - compile 'org.bouncycastle:bcprov-jdk15on:1.57' testCompile 'junit:junit:4.12' //room compile 'android.arch.persistence.room:runtime:1.0.0-alpha3' diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 58d10815..80b43f0b 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -45,19 +45,15 @@ -keepattributes SourceFile,LineNumberTable # remove all logging from production apk --assumenosideeffects class android.util.Log { - public static *** getStackTraceString(...); - public static *** d(...); - public static *** w(...); - public static *** v(...); - public static *** i(...); -} +#-assumenosideeffects class android.util.Log { +# public static *** getStackTraceString(...); +# public static *** d(...); +# public static *** w(...); +# public static *** v(...); +# public static *** i(...); +#} # for jsoup -keep public class org.jsoup.** { public *; } - -# for bouncycastle --keep class org.bouncycastle.** --dontwarn javax.naming.** diff --git a/app/src/main/java/com/keylesspalace/tusky/TuskyApplication.java b/app/src/main/java/com/keylesspalace/tusky/TuskyApplication.java index d666ad62..86c865b0 100644 --- a/app/src/main/java/com/keylesspalace/tusky/TuskyApplication.java +++ b/app/src/main/java/com/keylesspalace/tusky/TuskyApplication.java @@ -18,20 +18,13 @@ package com.keylesspalace.tusky; import android.app.Application; import android.arch.persistence.room.Room; import android.net.Uri; -import android.util.Log; import com.jakewharton.picasso.OkHttp3Downloader; import com.keylesspalace.tusky.db.AppDatabase; import com.keylesspalace.tusky.util.OkHttpUtils; import com.squareup.picasso.Picasso; -import org.bouncycastle.jce.provider.BouncyCastleProvider; - -import java.security.Provider; -import java.security.Security; - public class TuskyApplication extends Application { - private static final String TAG = "TuskyApplication"; // logging tag private static AppDatabase db; public static AppDatabase getDB() { @@ -59,40 +52,6 @@ public class TuskyApplication extends Application { throw new RuntimeException(e); } - /* Install the new provider or, if there's a pre-existing older version, replace the - * existing version of it. */ - final String providerName = "BC"; - Provider existingProvider = Security.getProvider(providerName); - if (existingProvider == null) { - try { - int priority = Security.addProvider(new BouncyCastleProvider()); - Log.i(TAG, String.format("BouncyCastleProvider was added with priority %d.", - priority)); - } catch (SecurityException e) { - Log.e(TAG, "Permission to add the security provider was denied."); - } - } else { - Provider replacement = new BouncyCastleProvider(); - if (existingProvider.getVersion() < replacement.getVersion()) { - Provider[] providers = Security.getProviders(); - int priority = 1; - for (int i = 0; i < providers.length; i++) { - if (providers[i].getName().equals(providerName)) { - priority = i + 1; - } - } - try { - Security.removeProvider(providerName); - Security.insertProviderAt(replacement, priority); - Log.i(TAG, String.format( - "BouncyCastleProvider version %f was updated to version %f.", - existingProvider.getVersion(), replacement.getVersion())); - } catch (SecurityException e) { - Log.e(TAG, "Permission to update a security provider was denied."); - } - } - } - db = Room.databaseBuilder(getApplicationContext(), AppDatabase.class, "tuskyDB") .allowMainThreadQueries() .build();