GeezerVison is showing github.com — fix:修复一个crash问题 · devil19/AndroidHttpCapture@94bc36e
File tree
Expand file treeCollapse file tree
Open diff view settings
src/main/java/cn/darkal/networkdiagnosis
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: app/build.gradle +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -26,7 +26,7 @@ android { |
26 | 26 | minSdkVersion 14 |
27 | 27 | targetSdkVersion 22 |
28 | 28 | versionCode 25 |
29 | | - versionName "2.4.25" |
| 29 | + versionName "2.4.26" |
30 | 30 | // Enabling multidex support. |
31 | 31 | multiDexEnabled true |
32 | 32 | resConfigs "zh" |
|
Collapse file
Copy file name to clipboardExpand all lines: app/src/main/java/cn/darkal/networkdiagnosis/Fragment/WebViewFragment.java +6-5Lines changed: 6 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -272,12 +272,13 @@ public void onReceive(Context context, Intent intent) { |
272 | 272 | } |
273 | 273 |
|
274 | 274 | public void loadUrl(String url) { |
275 | | - if (!isSetProxy) { |
276 | | - ProxyUtils.setProxy(webView, "127.0.0.1", SysApplication.proxyPort); |
277 | | - Log.e("~~~~", "initProxyWebView()"); |
278 | | - isSetProxy = true; |
279 | | - } |
280 | 275 | if (webView != null) { |
| 276 | + if (!isSetProxy) { |
| 277 | + ProxyUtils.setProxy(webView, "127.0.0.1", SysApplication.proxyPort); |
| 278 | + Log.e("~~~~", "initProxyWebView()"); |
| 279 | + isSetProxy = true; |
| 280 | + } |
| 281 | + |
281 | 282 | if (!url.startsWith("http://") && !url.startsWith("https://")) { |
282 | 283 | url = "http://" + url; |
283 | 284 | } |
|
Collapse file
Copy file name to clipboardExpand all lines: app/src/main/java/cn/darkal/networkdiagnosis/Utils/ProxyUtils.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -35,7 +35,7 @@ public static boolean setProxy(WebView webview, String host, int port) { |
35 | 35 | } else if (sdkInt < Build.VERSION_CODES.LOLLIPOP) { |
36 | 36 | return setProxyKK(webview, host, port, "android.app.Application"); |
37 | 37 | } else { |
38 | | - return webview.getContext() != null && setProxyLollipop(webview.getContext(), host, port); |
| 38 | + return webview != null && setProxyLollipop(webview.getContext(), host, port); |
39 | 39 | } |
40 | 40 | } |
41 | 41 |
|
|