我们有一个定制的 Android Oreo 系统,其中没有网络浏览器。当系统使用 Captive Portal 连接到网络时,CaptivePortalLoginActivity 会启动并出现以下 SSL 错误:
您尝试加入的网络存在安全问题。例如,登录页面可能不属于显示的组织。通过浏览器继续
但是在单击 CONTINUE ANYWAY VIA BROWSER 后,应用程序崩溃,因为没有浏览器存在。
11-19 05:00:03.912 10434 10434 D CaptivePortalLoginActivity: starting activity with intent ACTION_VIEW for http://connectivitycheck.gstatic.com/generate_204
11-19 05:00:03.916 2565 8240 I ActivityManager: START u0 {act=android.intent.action.VIEW dat=http://connectivitycheck.gstatic.com/...} from uid 10019
11-19 05:00:03.920 10434 10434 D AndroidRuntime: Shutting down VM
--------- beginning of crash
11-19 05:00:03.921 10434 10434 E AndroidRuntime: FATAL EXCEPTION: main
11-19 05:00:03.921 10434 10434 E AndroidRuntime: Process: com.android.captiveportallogin, PID: 10434
11-19 05:00:03.921 10434 10434 E AndroidRuntime: java.lang.RuntimeException: Unable to destroy activity {com.android.captiveportallogin/com.android.captiveportallogin.CaptivePortalLoginActivity}: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=http://connectivitycheck.gstatic.com/... }
11-19 05:00:03.921 10434 10434 E AndroidRuntime: at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4385)
11-19 05:00:03.921 10434 10434 E AndroidRuntime: at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4401)
11-19 05:00:03.921 10434 10434 E AndroidRuntime: at android.app.ActivityThread.access$1900(ActivityThread.java:176)
11-19 05:00:03.921 10434 10434 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1649)
11-19 05:00:03.921 10434 10434 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
11-19 05:00:03.921 10434 10434 E AndroidRuntime: at android.os.Looper.loop(Looper.java:164)
11-19 05:00:03.921 10434 10434 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6494)
11-19 05:00:03.921 10434 10434 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
11-19 05:00:03.921 10434 10434 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
11-19 05:00:03.921 10434 10434 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
11-19 05:00:03.921 10434 10434 E AndroidRuntime: Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=http://connectivitycheck.gstatic.com/... }
11-19 05:00:03.921 10434 10434 E AndroidRuntime: at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1937)
11-19 05:00:03.921 10434 10434 E AndroidRuntime: at android.app.Instrumentation.execStartActivity(Instrumentation.java:1616)
11-19 05:00:03.921 10434 10434 E AndroidRuntime: at android.app.Activity.startActivityForResult(Activity.java:4487)
11-19 05:00:03.921 10434 10434 E AndroidRuntime: at android.app.Activity.startActivityForResult(Activity.java:4445)
11-19 05:00:03.921 10434 10434 E AndroidRuntime: at android.app.Activity.startActivity(Activity.java:4806)
11-19 05:00:03.921 10434 10434 E AndroidRuntime: at android.app.Activity.startActivity(Activity.java:4774)
11-19 05:00:03.921 10434 10434 E AndroidRuntime: at com.android.captiveportallogin.CaptivePortalLoginActivity.onDestroy(CaptivePortalLoginActivity.java:270)
11-19 05:00:03.921 10434 10434 E AndroidRuntime: at android.app.Activity.performDestroy(Activity.java:7208)
11-19 05:00:03.921 10434 10434 E AndroidRuntime: at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1249)
11-19 05:00:03.921 10434 10434 E AndroidRuntime: at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4370)
11-19 05:00:03.921 10434 10434 E AndroidRuntime: ... 9 more
11-19 05:00:03.925 10434 10434 I Process : Sending signal. PID: 10434 SIG: 9
如何在没有网络浏览器的情况下在 Android Oreo 中处理 Captive Portal?