Merge branch 'bug_fix' into develop

This commit is contained in:
stom79 2017-12-13 18:44:43 +01:00
commit 029e05afc4
6 changed files with 45 additions and 10 deletions

View File

@ -9,7 +9,7 @@ android {
targetSdkVersion 27 targetSdkVersion 27
versionCode 88 versionCode 88
versionName "1.6.7-beta-1" versionName "1.6.7-beta-1"
vectorDrawables.useSupportLibrary = true
} }
flavorDimensions "default" flavorDimensions "default"
buildTypes { buildTypes {

View File

@ -2,11 +2,15 @@ package fr.gouv.etalab.mastodon.activities;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import org.conscrypt.Conscrypt; import org.conscrypt.Conscrypt;
import java.security.Provider;
import java.security.Security; import java.security.Security;
import fr.gouv.etalab.mastodon.helper.Helper;
/** /**
* Created by Thomas on 12/12/2017. * Created by Thomas on 12/12/2017.
* Base activity which updates security provider * Base activity which updates security provider
@ -15,9 +19,15 @@ import java.security.Security;
@SuppressLint("Registered") @SuppressLint("Registered")
public class BaseActivity extends AppCompatActivity { public class BaseActivity extends AppCompatActivity {
static { static {
Security.insertProviderAt(Conscrypt.newProvider("GmsCore_OpenSSL"), 2); boolean isGmsCore_OpenSSL = false;
Security.addProvider(Conscrypt.newProvider()); Provider[] providers = Security.getProviders();
for(Provider provider: providers){
if( provider.getName().equals("GmsCore_OpenSSL"))
isGmsCore_OpenSSL = true;
}
if( !isGmsCore_OpenSSL)
Security.addProvider(Security.getProvider("GmsCore_OpenSSL"));
Security.insertProviderAt(Conscrypt.newProvider("GmsCore_OpenSSL"), 1);
} }
} }

View File

@ -37,6 +37,7 @@ import com.evernote.android.job.JobRequest;
import org.conscrypt.Conscrypt; import org.conscrypt.Conscrypt;
import java.security.Provider;
import java.security.Security; import java.security.Security;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@ -78,8 +79,15 @@ public class HomeTimelineSyncJob extends Job implements OnRetrieveHomeTimelineSe
} }
static { static {
Security.insertProviderAt(Conscrypt.newProvider("GmsCore_OpenSSL"), 2); boolean isGmsCore_OpenSSL = false;
Security.addProvider(Conscrypt.newProvider()); Provider[] providers = Security.getProviders();
for(Provider provider: providers){
if( provider.getName().equals("GmsCore_OpenSSL"))
isGmsCore_OpenSSL = true;
}
if( !isGmsCore_OpenSSL)
Security.addProvider(Security.getProvider("GmsCore_OpenSSL"));
Security.insertProviderAt(Conscrypt.newProvider("GmsCore_OpenSSL"), 1);
} }
public static int schedule(boolean updateCurrent){ public static int schedule(boolean updateCurrent){

View File

@ -37,6 +37,7 @@ import com.evernote.android.job.JobRequest;
import org.conscrypt.Conscrypt; import org.conscrypt.Conscrypt;
import java.security.Provider;
import java.security.Security; import java.security.Security;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -69,8 +70,16 @@ public class NotificationsSyncJob extends Job implements OnRetrieveNotifications
static final String NOTIFICATION_REFRESH = "job_notification"; static final String NOTIFICATION_REFRESH = "job_notification";
static { static {
Security.insertProviderAt(Conscrypt.newProvider("GmsCore_OpenSSL"), 2); boolean isGmsCore_OpenSSL = false;
Security.addProvider(Conscrypt.newProvider()); Provider[] providers = Security.getProviders();
for(Provider provider: providers){
if( provider.getName().equals("GmsCore_OpenSSL"))
isGmsCore_OpenSSL = true;
}
if( !isGmsCore_OpenSSL)
Security.addProvider(Security.getProvider("GmsCore_OpenSSL"));
Security.insertProviderAt(Conscrypt.newProvider("GmsCore_OpenSSL"), 1);
} }
@NonNull @NonNull

View File

@ -23,6 +23,7 @@ import com.evernote.android.job.JobRequest;
import org.conscrypt.Conscrypt; import org.conscrypt.Conscrypt;
import java.security.Provider;
import java.security.Security; import java.security.Security;
import java.util.Date; import java.util.Date;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -45,8 +46,15 @@ public class ScheduledTootsSyncJob extends Job {
public static final String SCHEDULED_TOOT = "job_scheduled_toot"; public static final String SCHEDULED_TOOT = "job_scheduled_toot";
static { static {
Security.insertProviderAt(Conscrypt.newProvider("GmsCore_OpenSSL"), 2); boolean isGmsCore_OpenSSL = false;
Security.addProvider(Conscrypt.newProvider()); Provider[] providers = Security.getProviders();
for(Provider provider: providers){
if( provider.getName().equals("GmsCore_OpenSSL"))
isGmsCore_OpenSSL = true;
}
if( !isGmsCore_OpenSSL)
Security.addProvider(Security.getProvider("GmsCore_OpenSSL"));
Security.insertProviderAt(Conscrypt.newProvider("GmsCore_OpenSSL"), 1);
} }
@NonNull @NonNull