SSL調査の痕跡 issues #4

This commit is contained in:
tateisu 2017-05-06 22:26:54 +09:00
parent 2188825925
commit 00e74ae282
1 changed files with 13 additions and 10 deletions

View File

@ -19,6 +19,7 @@ import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.Volley; import com.android.volley.toolbox.Volley;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
import jp.juggler.subwaytooter.table.AcctColor; import jp.juggler.subwaytooter.table.AcctColor;
import jp.juggler.subwaytooter.table.AcctSet; import jp.juggler.subwaytooter.table.AcctSet;
@ -30,6 +31,7 @@ import jp.juggler.subwaytooter.table.MediaShown;
import jp.juggler.subwaytooter.table.NotificationTracking; import jp.juggler.subwaytooter.table.NotificationTracking;
import jp.juggler.subwaytooter.table.SavedAccount; import jp.juggler.subwaytooter.table.SavedAccount;
import jp.juggler.subwaytooter.table.UserRelation; import jp.juggler.subwaytooter.table.UserRelation;
import jp.juggler.subwaytooter.util.LogCategory;
import okhttp3.CipherSuite; import okhttp3.CipherSuite;
import okhttp3.ConnectionSpec; import okhttp3.ConnectionSpec;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
@ -38,6 +40,7 @@ import uk.co.chrisjenx.calligraphy.TypefaceUtils;
public class App1 extends Application { public class App1 extends Application {
static final LogCategory log = new LogCategory( "App1" );
static final String DB_NAME = "app_db"; static final String DB_NAME = "app_db";
static final int DB_VERSION = 10; static final int DB_VERSION = 10;
@ -226,7 +229,6 @@ public class App1 extends Application {
typeface_emoji = TypefaceUtils.load( getAssets(), "emojione_android.ttf" ); typeface_emoji = TypefaceUtils.load( getAssets(), "emojione_android.ttf" );
} }
if( db_open_helper == null ){ if( db_open_helper == null ){
db_open_helper = new DBOpenHelper( getApplicationContext() ); db_open_helper = new DBOpenHelper( getApplicationContext() );
@ -245,11 +247,8 @@ public class App1 extends Application {
); );
} }
if( ok_http_client == null ){ if( ok_http_client == null ){
// ok_http_client = new OkHttpClient();
ConnectionSpec spec = new ConnectionSpec.Builder( ConnectionSpec.MODERN_TLS ) ConnectionSpec spec = new ConnectionSpec.Builder( ConnectionSpec.MODERN_TLS )
.cipherSuites( APPROVED_CIPHER_SUITES ) .cipherSuites( APPROVED_CIPHER_SUITES )
.build(); .build();
@ -258,13 +257,16 @@ public class App1 extends Application {
spec_list.add( spec ); spec_list.add( spec );
spec_list.add( ConnectionSpec.CLEARTEXT ); spec_list.add( ConnectionSpec.CLEARTEXT );
ok_http_client = new OkHttpClient.Builder() OkHttpClient.Builder builder = new OkHttpClient.Builder()
.connectTimeout( 30, TimeUnit.SECONDS )
.readTimeout( 30, TimeUnit.SECONDS )
.writeTimeout( 30, TimeUnit.SECONDS )
.connectionSpecs( spec_list ) .connectionSpecs( spec_list )
.build(); ;
ok_http_client = builder.build();
} }
} }
@Override @Override
@ -274,6 +276,7 @@ public class App1 extends Application {
@SuppressLint("StaticFieldLeak") @SuppressLint("StaticFieldLeak")
private static AppState app_state; private static AppState app_state;
static AppState getAppState( Context context ){ static AppState getAppState( Context context ){
// これは最後loadColumnListでDBが必要になる // これは最後loadColumnListでDBが必要になる
if( app_state == null ){ if( app_state == null ){