question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use SSLEngine.setApplicationProtocols() and SSLSocket.getApplicationProtocol() for Android Q

See original GitHub issue

okhttp use some reflection to config the network, such as ALPN, when run in android P, system will logcat the warning in the logcat.

see https://developer.android.com/preview/restrictions-non-sdk-interfaces.html for Android P behavior change

Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->setAlpnProtocols([B)V (light greylist, reflection)
Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->getAlpnSelectedProtocol()[B (light greylist, reflection)
Accessing hidden method Lcom/android/org/conscrypt/TrustManagerImpl;-><init>(Ljava/security/KeyStore;)V (light greylist, reflection)
Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (light greylist, reflection)
Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (light greylist, reflection)
Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (light greylist, reflection)

We look through okhttp source, and found the reflection are all in AndroidPlatform.java.

okhttp has some solution or workaround not to reflet system non-open api?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:35
  • Comments:41 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
AnyBytecommented, Sep 14, 2019

I found out that my issue with

2019-09-14 07:20:53.197 11887-11971/com.ecmsk W/com.ecmsk: Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->setAlpnProtocols([B)V (light greylist, reflection)
2019-09-14 07:20:53.338 11887-11971/com.ecmsk W/com.ecmsk: Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->getAlpnSelectedProtocol()[B (light greylist, reflection)

errors was just a coincidence, right when I started testing my api endpoint Russian government decided to block my domain’s CloudFlare proxy for no apparent reason.

3reactions
garshomcommented, Dec 13, 2020

I have this problem , when I use retrofit and run app on Android 10

compileSdkVersion 30
   buildToolsVersion "30.0.2"
defaultConfig {
    minSdkVersion 24
    targetSdkVersion 30

Accessing hidden method Ljava/lang/invoke/MethodHandles$Lookup;->(Ljava/lang/Class;I)V (greylist, reflection, allowed) 24808-24808 W/outinestutoria: Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->setUseSessionTickets(Z)V (greylist,core-platform-api, reflection, allowed)

24808-24808 W/outinestutoria: Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->setHostname(Ljava/lang/String;)V (greylist,core-platform-api, reflection, allowed)

24808-24808 W/outinestutoria: Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->getAlpnSelectedProtocol()[B (greylist,core-platform-api, reflection, allowed)

24808-24808 W/outinestutoria: Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->setAlpnProtocols([B)V (greylist,core-platform-api, reflection, allowed)

24808-24808 W/outinestutoria: Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (greylist,core-platform-api, reflection, allowed) 24808-24808 W/outinestutoria: Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (greylist,core-platform-api, reflection, allowed) 24808-24808 W/outinestutoria: Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (greylist,core-platform-api, reflection, allowed) 24808-24808 D/NetworkSecurityConfig: No Network Security Config specified, using platform default

am getting the same issue while using ‘com.squareup.retrofit2:retrofit:2.9.0’

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use SSLEngine.setApplicationProtocols() and SSLSocket ...
Use SSLEngine.setApplicationProtocols() and SSLSocket.getApplicationProtocol() for Android Q.
Read more >
SSLEngine - Android Developers
The SSLEngine produces/consumes complete SSL/TLS packets only, and does not store application data internally between calls to wrap()/unwrap() .
Read more >
8 Java Secure Socket Extension (JSSE) Reference Guide
Your application can initiate a new handshake by using one of the following methods: SSLSocket.startHandshake(); SSLEngine.beginHandshake().
Read more >
Why SSLSocket support TLSv1.2 from API level 16+ but ...
I just want to understand the difference between SSLSocket and SSLEngine classes? I can see in android document TLSv1.2 available for ...
Read more >
Android 10 API changes - Di's blog
With the latest Enhance update to support Android 10 I decided to extract API ... android/app/ActionBar$Tab - INVALID_POSITION - <init>()V ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found