Merge branch 'bug_fixes' into develop

This commit is contained in:
stom79 2018-10-30 17:09:43 +01:00
commit b2b08cc02d
9 changed files with 34 additions and 48 deletions

View File

@ -30,6 +30,7 @@ import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageButton;
@ -412,14 +413,9 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
if(file.exists()) {
Uri uri = Uri.parse(file.getAbsolutePath());
videoView.setVisibility(View.VISIBLE);
try {
HttpsURLConnection.setDefaultSSLSocketFactory(new TLSSocketFactory());
} catch (KeyManagementException e) {
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
Log.v(Helper.TAG,"uri 2: " + uri);
videoView.setVideoURI(uri);
videoView.seekTo(0);
videoView.start();
MediaController mc = new MediaController(MediaActivity.this);
videoView.setMediaController(mc);
@ -436,6 +432,14 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
}else{
videoView.setVisibility(View.VISIBLE);
Uri uri = Uri.parse(url);
try {
HttpsURLConnection.setDefaultSSLSocketFactory(new TLSSocketFactory());
} catch (KeyManagementException e) {
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
Log.v(Helper.TAG,"uri 1: " + uri);
videoView.setVideoURI(uri);
videoView.start();
MediaController mc = new MediaController(MediaActivity.this);

View File

@ -258,6 +258,13 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
try {
HttpsURLConnection.setDefaultSSLSocketFactory(new TLSSocketFactory());
} catch (KeyManagementException e) {
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
videoView.setVideoURI(uri);
videoView.getCurrentPosition();
fullScreenMediaController = new FullScreenMediaController(PeertubeActivity.this, peertube);

View File

@ -18,14 +18,18 @@ import javax.net.ssl.SSLSocketFactory;
public class TLSSocketFactory extends SSLSocketFactory {
private SSLSocketFactory sSLSocketFactory;
private SSLContext context;
public TLSSocketFactory() throws KeyManagementException, NoSuchAlgorithmException {
SSLContext context = SSLContext.getInstance("TLS");
context = SSLContext.getInstance("TLS");
context.init(null, null, null);
sSLSocketFactory = context.getSocketFactory();
}
public SSLContext getSSLContext(){
return this.context;
}
@Override
public String[] getDefaultCipherSuites() {
return sSLSocketFactory.getDefaultCipherSuites();

View File

@ -38,11 +38,7 @@ public class ConversationDecoration extends RecyclerView.ItemDecoration{
private Context context;
public ConversationDecoration(Context context){
try {
divider = ContextCompat.getDrawable(context,R.drawable.line_divider);
}catch (Exception e){
divider = ResourcesCompat.getDrawable(context.getResources(), R.drawable.line_divider, null);
}
divider = ContextCompat.getDrawable(context,R.drawable.line_divider);
this.context = context;
}

View File

@ -1,31 +0,0 @@
package fr.gouv.etalab.mastodon.services;
import android.annotation.SuppressLint;
import android.app.IntentService;
import android.content.Intent;
import android.support.annotation.Nullable;
import fr.gouv.etalab.mastodon.helper.Helper;
/**
* Created by Thomas on 13/12/2017.
* BaseService class to install provider
*/
@SuppressLint("Registered")
public class BaseService extends IntentService {
static {
Helper.installProvider();
}
public BaseService(String name) {
super(name);
}
@Override
protected void onHandleIntent(@Nullable Intent intent) {
}
}

View File

@ -78,7 +78,9 @@ import static fr.gouv.etalab.mastodon.helper.Helper.notify_user;
public class LiveNotificationService extends Service implements NetworkStateReceiver.NetworkStateReceiverListener {
static {
Helper.installProvider();
}
protected Account account;
boolean backgroundProcess;

View File

@ -47,7 +47,9 @@ import fr.gouv.etalab.mastodon.sqlite.Sqlite;
public class StreamingFederatedTimelineService extends IntentService {
static {
Helper.installProvider();
}
/**
* Creates an IntentService. Invoked by your subclass's constructor.
*

View File

@ -45,7 +45,9 @@ import fr.gouv.etalab.mastodon.sqlite.Sqlite;
public class StreamingLocalTimelineService extends IntentService {
static {
Helper.installProvider();
}
/**
* Creates an IntentService. Invoked by your subclass's constructor.
*

View File

@ -2,5 +2,5 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<size android:height="4dp" />
<solid android:color="?colorAccent" />
<solid android:color="@color/dark_icon" />
</shape>