Skip to content

Commit f53f1a1

Browse files
committed
1:修改之前错误的Https检验工具。
1 parent 39cb3ea commit f53f1a1

File tree

4 files changed

+267
-299
lines changed

4 files changed

+267
-299
lines changed

common/src/main/java/com/guiying/common/base/BaseApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public void exitApp(Context context) {
115115
//杀死后台进程需要在AndroidManifest中声明android.permission.KILL_BACKGROUND_PROCESSES;
116116
ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
117117
activityManager.killBackgroundProcesses(context.getPackageName());
118-
System.exit(0);
118+
//System.exit(0);
119119
} catch (Exception e) {
120120
Log.e("ActivityManager", "app exit" + e.getMessage());
121121
}

common/src/main/java/com/guiying/common/http/HttpClient.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public class HttpClient {
3838

3939
/*The certificate's password*/
4040
private static final String STORE_PASS = "4444444";
41+
private static final String STORE_ALIAS = "4444444";
4142
/*返回数据为String*/
4243
public static final int STRING = 0;
4344
/*返回数据为json对象*/
@@ -74,11 +75,11 @@ private static class HttpClientHolder {
7475

7576
private HttpClient() {
7677
ClearableCookieJar cookieJar = new PersistentCookieJar(new SetCookieCache(), new SharedPrefsCookiePersistor(Utils.getContext()));
77-
//HttpsUtil.SSLParams sslParams = HttpsUtil.getSslSocketFactory(Utils.getContext(), new int[0], , STORE_PASS);
78+
//HttpsUtil.SSLParams sslParams = HttpsUtil.getSslSocketFactory(Utils.getContext(), R.raw.cer,STORE_PASS , STORE_ALIAS);
7879
okHttpClient = new OkHttpClient.Builder()
7980
.connectTimeout(10000L, TimeUnit.MILLISECONDS)
8081
//.sslSocketFactory(sslParams.sSLSocketFactory, sslParams.trustManager)
81-
.hostnameVerifier(HttpsUtil.getHostnameVerifier())
82+
// .hostnameVerifier(HttpsUtil.getHostnameVerifier())
8283
.addInterceptor(new LoggerInterceptor(null, true))
8384
.cookieJar(cookieJar)
8485
.build();

common/src/main/java/com/guiying/common/http/HttpsUtil.java

Lines changed: 0 additions & 296 deletions
This file was deleted.

0 commit comments

Comments
 (0)