11

其实更准确的说法是:

每个基于 WebKit 的浏览器都会在http://m.allrecipes.com/上崩溃,但仅限于三星 Continuum SCH-i400手机。

我正在尝试实现一个基于 WebView 的浏览器,主要用于学习目的(市场上的浏览器太多了,为什么要添加一个?),我对我能以多快的速度提出一个基本的工作浏览器印象深刻。我在Samsung Continuum手机上的许多网站上对其进行了测试,它们都运行良好,除了 m.allrecipes.com.

每当我尝试加载该网页时,都会收到以下 NullPointerException:

E/AndroidRuntime(3147): FATAL EXCEPTION: http10
E/AndroidRuntime(3147): java.lang.NullPointerException
E/AndroidRuntime(3147):     at android.net.http.CertificateChainValidator.doHandshakeAndValidateServerCertificates(CertificateChainValidator.java:194)
E/AndroidRuntime(3147):     at android.net.http.HttpsConnection.openConnection(HttpsConnection.java:308)
E/AndroidRuntime(3147):     at android.net.http.Connection.openHttpConnection(Connection.java:358)
E/AndroidRuntime(3147):     at android.net.http.Connection.processRequests(Connection.java:219)
E/AndroidRuntime(3147):     at android.net.http.ConnectionThread.run(ConnectionThread.java:113)

无法在我的代码中找到对此的解释,我试图查看其他浏览器在此Samsung Continuum手机上的行为方式,访问时m.allrecipes.com

结果非常有趣:Dolphin、Opera、iBrowser 等都没有任何问题

但是Free Private BrowserVoice BrowserEasy Browserm.allrecipes.com在使用相同的堆栈跟踪访问时都会立即崩溃。

因此,如果您可以将手放在一个Samsung Continuum SCH-i400单元上,这个问题很容易重现。

我知道解决这个问题的最快和最简单的方法是使用不同的浏览器或摆脱我的手机。但我希望了解问题的根源,因为它可能会在使用 时指出潜在的问题WebKit,也可能在其他手机上。

所以我的问题基本上是:

  1. 有什么m.allrecipes.com特别之处会触发这个WebKit+Continuum错误?
  2. 有什么Samsung Continuum SCH-i400特别之处以至于它只在这个网站上并且只在基于 WebKit 的浏览器上失败?
  3. WebKit 中的东西太特别了,它不喜欢Continuum+allrecipes.com.
  4. 是否有其他网站会触发此行为?

根据@sarnold 的建议从免费私人浏览器添加日志:

:13.195: D/SKIA_FONT(5973): load_system_fonts(), name = Droid Sans, style = 0, uniqueID = 1
:13.199: D/SKIA_FONT(5973): load_system_fonts(), name = Droid Sans, style = 1, uniqueID = 2
:13.199: D/SKIA_FONT(5973): load_system_fonts(), name = Droid Serif, style = 0, uniqueID = 3
:13.207: D/SKIA_FONT(5973): load_system_fonts(), name = Droid Serif, style = 1, uniqueID = 4
:13.207: D/SKIA_FONT(5973): load_system_fonts(), name = Droid Serif, style = 2, uniqueID = 5
:13.207: D/SKIA_FONT(5973): load_system_fonts(), name = Droid Serif, style = 3, uniqueID = 6
:13.207: D/SKIA_FONT(5973): load_system_fonts(), name = Droid Sans Mono, style = 0, uniqueID = 7
:13.211: D/SKIA_FONT(5973): load_system_fonts(), name = Droid Sans Arabic, style = 0, uniqueID = 8
:13.211: D/SKIA_FONT(5973): load_system_fonts(), name = Droid Sans Hebrew, style = 0, uniqueID = 9
:13.211: D/SKIA_FONT(5973): load_system_fonts(), name = Droid Sans Thai, style = 0, uniqueID = 10
:13.211: D/SKIA_FONT(5973): load_system_fonts(), name = Droid Sans, style = 0, uniqueID = 11
:13.215: D/SKIA_FONT(5973): load_system_fonts(), name = Droid Sans Fallback, style = 0, uniqueID = 12
:13.215: D/SKIA_FONT(5973): load_system_fonts(), oldSansUID = 0, newSansUID = 1
:13.215: D/SKIA_FONT(5973): load_system_fonts(), oldSansBoldUID = 0, newSansBoldUID = 2
:13.308: D/dalvikvm(5973): GC_EXTERNAL_ALLOC freed 3163 objects / 205880 bytes in 13ms
:13.566: I/Ads(5973): To get test ads on this device, call adRequest.addTestDevice("BE8FFE83C668E44B60E7CBD947D7D226");
:13.590: D/dalvikvm(5973): GC_FOR_MALLOC freed 7592 objects / 361280 bytes in 11ms
:13.597: I/Ads(5973): adRequestUrlHtml: <html><head><script src="http://media.admob.com/sdk-core-v40.js"></script><script>AFMA_buildAdURL({"preqs":0,"u_sd":1.375,"slotname":"a14c2366fe4baa1","u_w":349,"msid":"com.JamesBecwar.FreePrivateBrowser","cap":"m","js":"afma-sdk-a-v4.3.1","mv":"8013013.com.android.vending","isu":"BE8FFE83C668E44B60E7CBD947D7D226","cipa":0,"format":"320x50_mb","net":"wi","app_name":"28.android.com.JamesBecwar.FreePrivateBrowser","hl":"en","u_h":581,"u_audio":1});</script></head><body></body></html>
:14.211: W/webcore(5973): Can't get the viewWidth after the first layout
:14.640: I/Ads(5973): Received ad url: <"url": "http://googleads.g.doubleclick.net:80/mads/gma?preqs=0&u_sd=1.375&slotname=a14c2366fe4baa1&u_w=349&msid=com.JamesBecwar.FreePrivateBrowser&cap=m&js=afma-sdk-a-v4.3.1&mv=8013013.com.android.vending&isu=BE8FFE83C668E44B60E7CBD947D7D226&cipa=0&format=320x50_mb&net=wi&app_name=28.android.com.JamesBecwar.FreePrivateBrowser&hl=en&u_h=581&u_audio=1&u_so=p&output=html&region=mobile_app&u_tz=300&ex=1&client_sdk=1&pto=0&caps=interactiveVideo_clickTracking_sdkAdmobApiForAds&jsv=27", "afmaNotifyDt": "null">
:14.769: W/Ads(5973): IOException connecting to ad url.
:14.769: W/Ads(5973): java.net.ConnectException: googleads.g.doubleclick.net/127.0.0.1:80 - Connection refused
:14.769: W/Ads(5973):   at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:254)
:14.769: W/Ads(5973):   at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:533)
:14.769: W/Ads(5973):   at java.net.Socket.connect(Socket.java:1074)
:14.769: W/Ads(5973):   at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:62)
:14.769: W/Ads(5973):   at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:88)
:14.769: W/Ads(5973):   at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHTTPConnection(HttpURLConnectionImpl.java:927)
:14.769: W/Ads(5973):   at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:909)
:14.769: W/Ads(5973):   at com.google.ads.b.run(SourceFile:280)
:14.769: W/Ads(5973):   at java.lang.Thread.run(Thread.java:1096)
:14.812: D/webviewglue(5973): nativeDestroy view: 0x324d00
:14.816: I/Ads(5973): onFailedToReceiveAd(A network error occurred.)
:15.574: D/dalvikvm(5973): GC_FOR_MALLOC freed 5178 objects / 598576 bytes in 25ms
:15.578: D/webviewglue(5973): nativeDestroy view: 0x2634a0
:17.351: I/Database(5973): sqlite returned: error code = 14, msg = cannot open file at source line 25467
:17.359: E/geolocationService(5973): Caught security exception registering for location updates from system. This should only happen in DumpRenderTree.
:41.011: D/dalvikvm(5973): GC_FOR_MALLOC freed 5959 objects / 981064 bytes in 15ms
:42.015: I/Web Console(5973): Omniture: s.t, instance: 1 at http://images.media-allrecipes.com/js/omni/ar_s_code.js?v=5:23
:42.015: I/Web Console(5973): [object Object] at http://images.media-allrecipes.com/js/omni/ar_s_code.js?v=5:24
:42.699: W/dalvikvm(5973): threadid=12: thread exiting with uncaught exception (group=0x4001d7f0)
:42.703: E/AndroidRuntime(5973): FATAL EXCEPTION: http1
:42.703: E/AndroidRuntime(5973): java.lang.NullPointerException
:42.703: E/AndroidRuntime(5973):    at android.net.http.CertificateChainValidator.doHandshakeAndValidateServerCertificates(CertificateChainValidator.java:194)
:42.703: E/AndroidRuntime(5973):    at android.net.http.HttpsConnection.openConnection(HttpsConnection.java:308)
:42.703: E/AndroidRuntime(5973):    at android.net.http.Connection.openHttpConnection(Connection.java:358)
:42.703: E/AndroidRuntime(5973):    at android.net.http.Connection.processRequests(Connection.java:219)
:42.703: E/AndroidRuntime(5973):    at android.net.http.ConnectionThread.run(ConnectionThread.java:113)
:42.773: W/dalvikvm(5973): threadid=22: thread exiting with uncaught exception (group=0x4001d7f0)
:42.781: I/Process(5973): Sending signal. PID: 5973 SIG: 9

以及来自Voice Browser的日志:

:44.226: I/dalvikvm(6273): Jit: resizing JitTable from 4096 to 8192
:44.226: D/dalvikvm(6273): GC_FOR_MALLOC freed 13956 objects / 744856 bytes in 29ms
:45.730: I/Web Console(6273): Omniture: s.t, instance: 1 at http://images.media-allrecipes.com/js/omni/ar_s_code.js?v=5:23
:45.734: I/Web Console(6273): [object Object] at http://images.media-allrecipes.com/js/omni/ar_s_code.js?v=5:24
:46.707: W/dalvikvm(6273): threadid=14: thread exiting with uncaught exception (group=0x4001d7f0)
:46.718: E/AndroidRuntime(6273): FATAL EXCEPTION: http2
:46.718: E/AndroidRuntime(6273): java.lang.NullPointerException
:46.718: E/AndroidRuntime(6273):    at android.net.http.CertificateChainValidator.doHandshakeAndValidateServerCertificates(CertificateChainValidator.java:194)
:46.718: E/AndroidRuntime(6273):    at android.net.http.HttpsConnection.openConnection(HttpsConnection.java:308)
:46.718: E/AndroidRuntime(6273):    at android.net.http.Connection.openHttpConnection(Connection.java:358)
:46.718: E/AndroidRuntime(6273):    at android.net.http.Connection.processRequests(Connection.java:219)
:46.718: E/AndroidRuntime(6273):    at android.net.http.ConnectionThread.run(ConnectionThread.java:113)
:46.718: W/dalvikvm(6273): threadid=15: thread exiting with uncaught exception (group=0x4001d7f0)

并从Easy Browser

:11.597: D/dalvikvm(6557): GC_FOR_MALLOC freed 10496 objects / 629992 bytes in 57ms
:11.605: D/webviewglue(6557): nativeDestroy view: 0x25c8e8
:11.609: W/IInputConnectionWrapper(6557): getCursorCapsMode on inactive InputConnection
:11.640: I/Ads(6557): adRequestUrlHtml: <html><head><script src="http://www.gstatic.com/afma/sdk-core-v40.js"></script><script>AFMA_buildAdURL({"preqs":1,"u_sd":1.375,"slotname":"a14f3f6bc126143","u_w":349,"msid":"easy.browser","cap":"m","js":"afma-sdk-a-v4.1.1","isu":"BE8FFE83C668E44B60E7CBD947D7D226","format":"320x50_mb","net":"wi","app_name":"23.android.easy.browser","hl":"en","u_h":581,"u_audio":1});</script></head><body></body></html>
:11.664: W/IInputConnectionWrapper(6557): getCursorCapsMode on inactive InputConnection
:11.730: W/IInputConnectionWrapper(6557): finishComposingText on inactive InputConnection
:11.867: W/webcore(6557): Can't get the viewWidth after the first layout
:12.051: I/Ads(6557): Received ad url: <"url": "http://googleads.g.doubleclick.net:80/mads/gma?preqs=1&u_sd=1.375&slotname=a14f3f6bc126143&u_w=349&msid=easy.browser&cap=m&js=afma-sdk-a-v4.1.1&isu=BE8FFE83C668E44B60E7CBD947D7D226&format=320x50_mb&net=wi&app_name=23.android.easy.browser&hl=en&u_h=581&u_audio=1&u_so=p&output=html&region=mobile_app&u_tz=300&ex=1&client_sdk=1&askip=1&caps=clickTracking_sdkAdmobApiForAds&jsv=27", "afmaNotifyDt": "null">
:12.086: W/Ads(6557): IOException connecting to ad url.
:12.086: W/Ads(6557): java.net.ConnectException: googleads.g.doubleclick.net/127.0.0.1:80 - Connection refused
:12.086: W/Ads(6557):   at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:254)
:12.086: W/Ads(6557):   at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:533)
:12.086: W/Ads(6557):   at java.net.Socket.connect(Socket.java:1074)
:12.086: W/Ads(6557):   at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:62)
:12.086: W/Ads(6557):   at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:88)
:12.086: W/Ads(6557):   at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHTTPConnection(HttpURLConnectionImpl.java:927)
:12.086: W/Ads(6557):   at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:909)
:12.086: W/Ads(6557):   at b.run(Unknown Source)
:12.086: W/Ads(6557):   at java.lang.Thread.run(Thread.java:1096)
:12.086: D/webviewglue(6557): nativeDestroy view: 0x382ff0
:12.086: I/Ads(6557): onFailedToReceiveAd(A network error occurred.)
:13.890: I/Web Console(6557): Omniture: s.t, instance: 1 at http://images.media-allrecipes.com/js/omni/ar_s_code.js?v=5:23
:13.894: I/Web Console(6557): [object Object] at http://images.media-allrecipes.com/js/omni/ar_s_code.js?v=5:24
:14.687: W/dalvikvm(6557): threadid=21: thread exiting with uncaught exception (group=0x4001d7f0)
:14.687: W/System.err(6557): java.lang.NullPointerException
:14.687: W/System.err(6557):    at android.net.http.CertificateChainValidator.doHandshakeAndValidateServerCertificates(CertificateChainValidator.java:194)
:14.687: W/System.err(6557):    at android.net.http.HttpsConnection.openConnection(HttpsConnection.java:308)
:14.687: W/System.err(6557):    at android.net.http.Connection.openHttpConnection(Connection.java:358)
:14.687: W/System.err(6557):    at android.net.http.Connection.processRequests(Connection.java:219)
:14.687: W/System.err(6557):    at android.net.http.ConnectionThread.run(ConnectionThread.java:113)
4

2 回答 2

6

顺便说一句,我认为您的 Continuum 仍在运行 Android 2.1。

m.allrecipes.com 中有什么特别之处,以至于触发了这个 WebKit+Continuum 错误?

在 Android 2.1 模拟器中,我收到“此证书不是来自受信任的机构”对话框,但它不会崩溃。Android 2.1 可能不支持 StartCom 的根证书(如果我没看错的话,这是有问题的权威)。

根据这个问题,StartCom 的根证书是在 Android 2.2 中添加的,在 4.0.3 模拟器中进行快速测试不会引发错误对话框。

三星 Continuum SCH-i400 有什么特别之处,以至于它只在这个网站上失败,而且只在基于 WebKit 的浏览器上失败?

三星可能对android.net软件包中的某些内容进行了调整并破坏了它,可能是专门与粗略的 SSL 证书相关的。任何将基于的浏览器都将WebView通过相同的代码路径运行;每个拥有自己的 HTML 渲染器的人可能不会,如果他们自己处理 SSL 证书等。

WebKit 中的东西非常特别,以至于它不喜欢 Continuum+allrecipes.com 的组合。

基于堆栈跟踪,从技术上讲没有。您会注意到其中没有任何特定于 WebKit 的内容。这至多是一个 WebKit-on-Android 问题。而且,如上所述,它可能更适合您的三星。

是否有其他网站会触发此行为?

也许可以找到其他具有较小证书颁发机构证书的证书。

于 2012-07-05T23:01:40.097 回答
0

我不太确定这是三星的问题。考虑:

使用 Android 4.0.3 的 HTC One S 加载 m.cycletrader.com 主页没有问题,但搜索时搜索结果页面崩溃。内容一闪而过,然后似乎是刷新,然后是白屏。如果我等待的时间足够长,我会收到一个无限循环重定向通知。

桌面浏览器 (Firefox 25) 使用默认用户代理字符串,加载相同的主页和搜索结果页面没有问题。

桌面浏览器 (Firefox 25) 使用 User-Agent Switcher 报告为 HTC Sensation (Android 4.0.3) 加载相同的主页没有问题,但在搜索时使搜索结果页面崩溃 - 就像实际的智能手机一样。最初是内容的闪烁,然后是白屏,浏览器没有保留源代码以进行诊断和检查。我们最初认为 javascript document.write 是罪魁祸首,但它存在并且不会对其他用户代理造成此问题。

共同点?Omniture。在搜索结果页面上禁用 Omniture,页面加载没有问题。我想知道当 Omniture 检测到某些智能手机,也许还有 Android 版本时,它是否在做一些奇怪的事情(v4.0.3 早些时候得到了一份干净的健康账单,但那是一年前的事了)。

我想深入了解这一点,以便我们可以修复 Omniture 实现中的任何问题,或者发出错误报告,以便 Omniture 注意到他们的代码正在破坏我们的网站 (m.cycletrader.com) .

于 2013-11-21T14:23:10.490 回答