Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upokhttp reflection meet Android P DP1 non-sdk restriction #3980
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
swankjesse
Apr 29, 2018
Member
For CloseGuard, we probably want to just delete the Android-specific overrides. We don’t particularly benefit from using CloseGuard instead of java.util.logging.Logger for configuration.
|
For CloseGuard, we probably want to just delete the Android-specific overrides. We don’t particularly benefit from using CloseGuard instead of java.util.logging.Logger for configuration. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
swankjesse
Apr 29, 2018
Member
@zjupure which version of OkHttp were you running? I couldn’t find the reflective call to TrustManagerImpl;-><init> in the current source tree.
|
@zjupure which version of OkHttp were you running? I couldn’t find the reflective call to |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
af913337456
commented
May 9, 2018
|
the same problem hit me |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
zjupure
commented
May 9, 2018
|
@swankjesse okhttp version in our app is 3.8.1 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
AntoinePurnelle
Jun 6, 2018
Strict mode now allows to have a stacktrace
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
.detectNonSdkApiUsage()
.penaltyLog()
.build());
06-06 19:52:56.935 8671-8671/? D/StrictMode: StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard;
at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
at android.os.-$$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
at java.lang.Class.getDeclaredMethodInternal(Native Method)
at java.lang.Class.getPublicMethodRecursive(Class.java:2075)
at java.lang.Class.getMethod(Class.java:2063)
at java.lang.Class.getMethod(Class.java:1690)
at io.intercom.okhttp3.internal.platform.AndroidPlatform$CloseGuard.get(AndroidPlatform.java:367)
at io.intercom.okhttp3.internal.platform.AndroidPlatform.<init>(AndroidPlatform.java:55)
at io.intercom.okhttp3.internal.platform.AndroidPlatform.buildIfSupported(AndroidPlatform.java:257)
at io.intercom.okhttp3.internal.platform.Platform.findPlatform(Platform.java:184)
at io.intercom.okhttp3.internal.platform.Platform.<clinit>(Platform.java:74)
at io.intercom.okhttp3.internal.platform.Platform.get(Platform.java:80)
at io.intercom.okhttp3.internal.tls.CertificateChainCleaner.get(CertificateChainCleaner.java:41)
at io.intercom.okhttp3.OkHttpClient.<init>(OkHttpClient.java:254)
at io.intercom.okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:914)
at io.intercom.android.sdk.Injector.getNexusClient(Injector.java:153)
at io.intercom.android.sdk.RealIntercom.create(RealIntercom.java:77)
at io.intercom.android.sdk.Intercom.initialize(Intercom.java:68)
at com.aproplan.aproplan.AproPlanApplication.onCreate(AproPlanApplication.java:113)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1154)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5858)
at android.app.ActivityThread.access$1000(ActivityThread.java:197)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1634)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6642)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
AntoinePurnelle
commented
Jun 6, 2018
|
Strict mode now allows to have a stacktrace
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
CloseGuard: https://issuetracker.google.com/issues/111149038 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Nothing actionable here for now. |
swankjesse
added this to the Icebox milestone
Jul 5, 2018
swankjesse
added
the
android
label
Jul 5, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
hacker1024
Aug 11, 2018
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)
I have these messages too. Google have filed an internal bug, so there will probably hopefully be public APIs in the next Android release.
hacker1024
commented
Aug 11, 2018
I have these messages too. Google have filed an internal bug, so there will |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
FlappyElephant
Sep 6, 2018
There is same problem .Any solution?
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
W/android.dc.dem: 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)
FlappyElephant
commented
Sep 6, 2018
|
There is same problem .Any solution?
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
alashow
Sep 7, 2018
This is causing my app to hang about 900ms for the first https request, even though my call is made on a background thread. Is this normal?
Is there a way to avoid the hang?
alashow
commented
Sep 7, 2018
•
|
This is causing my app to hang about 900ms for the first https request, even though my call is made on a background thread. Is this normal? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
korshaknn
Sep 17, 2018
Are there any updates with ALPN methods?
Still have warnings:
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)
Are they going to be fixed? or don't? What is their status?
Thanks!
korshaknn
commented
Sep 17, 2018
|
Are there any updates with ALPN methods? Are they going to be fixed? or don't? What is their status? Thanks! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
johnjohndoe
Sep 18, 2018
Google "deferred this issue for consideration in a future release" at Aug 10, 2018.
I noticed the issue lately on Google Play's devices tests as part of the Beta channel Pre-launch report for a Google Pixel 2, Android 9.
StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation:
Ldalvik/system/CloseGuard;->warnIfOpen()V
at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
at android.os.-$$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
at java.lang.Class.getDeclaredMethodInternal(Native Method)
at java.lang.Class.getPublicMethodRecursive(Class.java:2075)
at java.lang.Class.getMethod(Class.java:2063)
at java.lang.Class.getMethod(Class.java:1690)
at okhttp3.internal.platform.AndroidPlatform$CloseGuard.get(AndroidPlatform.java:372)
at okhttp3.internal.platform.AndroidPlatform.<init>(AndroidPlatform.java:58)
at okhttp3.internal.platform.AndroidPlatform.buildIfSupported(AndroidPlatform.java:260)
at okhttp3.internal.platform.Platform.findPlatform(Platform.java:201)
at okhttp3.internal.platform.Platform.<clinit>(Platform.java:78)
at okhttp3.internal.platform.Platform.get(Platform.java:84)
at okhttp3.internal.tls.CertificateChainCleaner.get(CertificateChainCleaner.java:41)
at okhttp3.OkHttpClient$Builder.sslSocketFactory(OkHttpClient.java:694)
johnjohndoe
commented
Sep 18, 2018
|
Google "deferred this issue for consideration in a future release" at Aug 10, 2018. I noticed the issue lately on Google Play's devices tests as part of the Beta channel Pre-launch report for a Google Pixel 2, Android 9. StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation:
Ldalvik/system/CloseGuard;->warnIfOpen()V
at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
at android.os.-$$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
at java.lang.Class.getDeclaredMethodInternal(Native Method)
at java.lang.Class.getPublicMethodRecursive(Class.java:2075)
at java.lang.Class.getMethod(Class.java:2063)
at java.lang.Class.getMethod(Class.java:1690)
at okhttp3.internal.platform.AndroidPlatform$CloseGuard.get(AndroidPlatform.java:372)
at okhttp3.internal.platform.AndroidPlatform.<init>(AndroidPlatform.java:58)
at okhttp3.internal.platform.AndroidPlatform.buildIfSupported(AndroidPlatform.java:260)
at okhttp3.internal.platform.Platform.findPlatform(Platform.java:201)
at okhttp3.internal.platform.Platform.<clinit>(Platform.java:78)
at okhttp3.internal.platform.Platform.get(Platform.java:84)
at okhttp3.internal.tls.CertificateChainCleaner.get(CertificateChainCleaner.java:41)
at okhttp3.OkHttpClient$Builder.sslSocketFactory(OkHttpClient.java:694) |
zjupure commentedApr 26, 2018
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
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?