0xpr03 / VocableTrainer-Android

Vocabulary Trainer for Android - not lang specific
Apache License 2.0
29 stars 10 forks source link

Android 11 breaks compatibility layer for TLS 1.2+ #68

Closed 0xpr03 closed 2 years ago

0xpr03 commented 2 years ago

Describe the bug On android 11 the survey crashes (sometimes?) due to problems with the netcipher compat layer that provides TLS 1.2+ on android 4.4

msg: java.lang.NoSuchMethodException: com.android.org.conscrypt.Java8EngineSocket.setHostname [class java.lang.String]
stacktrace: java.lang.IllegalStateException: Could not enable SNI
    at info.guardianproject.netcipher.client.TlsOnlySocketFactory$DelegateSSLSocket.setHostname(TlsOnlySocketFactory.java:534)
    at info.guardianproject.netcipher.client.TlsOnlySocketFactory.makeSocketSafe(TlsOnlySocketFactory.java:110)
    at info.guardianproject.netcipher.client.TlsOnlySocketFactory.createSocket(TlsOnlySocketFactory.java:121)
    at com.android.okhttp.internal.io.RealConnection.connectTls(RealConnection.java:185)
    at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:153)
    at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:116)
    at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:186)
    at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:128)
    at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
    at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:289)
    at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:232)
    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:262)
    at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:219)
    at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:30)
    at vocabletrainer.heinecke.aron.vocabletrainer.lib.ViewModel.SurveyViewModel.lambda$submitSurvey$0(SurveyViewModel.java:68)
    at vocabletrainer.heinecke.aron.vocabletrainer.lib.ViewModel.SurveyViewModel.lambda$submitSurvey$0$SurveyViewModel(Unknown Source:0)
    at vocabletrainer.heinecke.aron.vocabletrainer.lib.ViewModel.-$$Lambda$SurveyViewModel$QQ0OZbz57vK6Kw9lAdA7DOx-pyo.run(Unknown Source:4)
    at java.lang.Thread.run(Thread.java:923)
Caused by: java.lang.NoSuchMethodException: com.android.org.conscrypt.Java8EngineSocket.setHostname [class java.lang.String]
    at java.lang.Class.getMethod(Class.java:2072)
    at java.lang.Class.getMethod(Class.java:1693)
    at info.guardianproject.netcipher.client.TlsOnlySocketFactory$DelegateSSLSocket.setHostname(TlsOnlySocketFactory.java:531)
    ... 19 more
slash-under commented 2 years ago

I'm getting constant crashes from the survey, leading to me being unable to submit successfully on Android 12.

0xpr03 commented 2 years ago

Yeah for now the best is to reject the survey until I've got a fix out.

slash-under commented 2 years ago

Unfortunately not rejecting it makes the app unusable since the survey pops up each time, then when you accept, the app crashes.

On Thu, Dec 2, 2021, 20:51 Aron Heinecke @.***> wrote:

Yeah for now the best is to not reject the survey until I've got a fix out.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/0xpr03/VocableTrainer-Android/issues/68#issuecomment-984950746, or unsubscribe https://github.com/notifications/unsubscribe-auth/APA3AUZEAJOKZ6CFCTZGIHTUO7E2NANCNFSM5HP4DLVQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

slash-under commented 2 years ago

Rejecting is the only way I can find to break that loop and make the app usable again.

0xpr03 commented 2 years ago

Unfortunately not rejecting it makes the app unusable since the survey pops up each time, then when you accept, the app crashes.

Eh yeah, I messed that sentence up. I wanted to say reject the survey.

0xpr03 commented 2 years ago

This takes a little bit longer to fix because I had to do a lot of stuff in the background. If you want to know more the details are below: