NetBare-Android icon indicating copy to clipboard operation
NetBare-Android copied to clipboard

java.lang.NoSuchMethodException

Open ghost opened this issue 2 years ago • 9 comments

在netbare-core中的 com.github.megatronking.netbare.http.HttpSSLResponseCodec中的 enableJava8EngineWrapperAlpn()方法 Method setApplicationProtocolsMethod = mSSLEngine.getClass().getDeclaredMethod("setApplicationProtocols", String[].class)语句 javax.net.ssl.SSLEngine中并没有setApplicationProtocols

ghost avatar May 09 '22 01:05 ghost

系统版本?

MegatronKing avatar May 09 '22 01:05 MegatronKing

Android 12

ghost avatar May 09 '22 02:05 ghost

安装了用户证书,好像这个异常跟安卓版本没关系吧,要换jdk吗?

ghost avatar May 09 '22 02:05 ghost

W/.netbare.sampl: Accessing hidden method Lcom/android/org/conscrypt/Java8EngineWrapper;->setApplicationProtocols([Ljava/lang/String;)V (blocked, reflection, denied) E/NetBare: com.android.org.conscrypt.Java8EngineWrapper.setApplicationProtocols [class [Ljava.lang.String;] java.lang.NoSuchMethodException: com.android.org.conscrypt.Java8EngineWrapper.setApplicationProtocols [class [Ljava.lang.String;] at java.lang.Class.getMethod(Class.java:2103) at java.lang.Class.getDeclaredMethod(Class.java:2081) at com.github.megatronking.netbare.http.HttpSSLResponseCodec.enableJava8EngineWrapperAlpn(HttpSSLResponseCodec.java:109) at com.github.megatronking.netbare.http.HttpSSLResponseCodec.enableAlpn(HttpSSLResponseCodec.java:94) at com.github.megatronking.netbare.http.HttpSSLResponseCodec.createEngine(HttpSSLResponseCodec.java:62) at com.github.megatronking.netbare.ssl.SSLResponseCodec.prepareHandshake(SSLResponseCodec.java:86) at com.github.megatronking.netbare.http.HttpSSLResponseCodec.prepareHandshake(HttpSSLResponseCodec.java:87) at com.github.megatronking.netbare.http.HttpSSLCodecInterceptor.intercept(HttpSSLCodecInterceptor.java:97) at com.github.megatronking.netbare.http.HttpSSLCodecInterceptor.intercept(HttpSSLCodecInterceptor.java:38) at com.github.megatronking.netbare.gateway.IndexedInterceptor.intercept(IndexedInterceptor.java:67) at com.github.megatronking.netbare.http.HttpRequestChain.processNext(HttpRequestChain.java:55) at com.github.megatronking.netbare.http.HttpRequestChain.processNext(HttpRequestChain.java:32) at com.github.megatronking.netbare.gateway.InterceptorChain.process(InterceptorChain.java:104) at com.github.megatronking.netbare.http.HttpSniffInterceptor.intercept(HttpSniffInterceptor.java:68) at com.github.megatronking.netbare.http.HttpSniffInterceptor.intercept(HttpSniffInterceptor.java:35) at com.github.megatronking.netbare.gateway.IndexedInterceptor.intercept(IndexedInterceptor.java:67) at com.github.megatronking.netbare.http.HttpRequestChain.processNext(HttpRequestChain.java:55) at com.github.megatronking.netbare.http.HttpRequestChain.processNext(HttpRequestChain.java:32) at com.github.megatronking.netbare.gateway.InterceptorChain.process(InterceptorChain.java:104) at com.github.megatronking.netbare.http.HttpVirtualGateway.onSpecRequest(HttpVirtualGateway.java:121) at com.github.megatronking.netbare.gateway.SpecVirtualGateway.onRequest(SpecVirtualGateway.java:69) at com.github.megatronking.netbare.NetBareVirtualGateway.onRequest(NetBareVirtualGateway.java:88) at com.github.megatronking.netbare.tunnel.TcpVATunnel$1.onRead(TcpVATunnel.java:90) at com.github.megatronking.netbare.tunnel.NioTunnel.onRead(NioTunnel.java:101) at com.github.megatronking.netbare.proxy.TcpProxyServer.process(TcpProxyServer.java:141) at com.github.megatronking.netbare.proxy.BaseProxyServer.run(BaseProxyServer.java:62) at com.github.megatronking.netbare.proxy.TcpProxyServer.run(TcpProxyServer.java:110) at java.lang.Thread.run(Thread.java:920)

ghost avatar May 09 '22 02:05 ghost

setApplicationProtocols([Ljava/lang/String;)V (blocked, reflection, denied),系统隐藏API被禁止反射调用,Android 12没有办法绕过去。

MegatronKing avatar May 09 '22 02:05 MegatronKing

正如置顶公告所说:这个库“依赖系统限制API的反射”无法适配未来的系统版本。

MegatronKing avatar May 09 '22 02:05 MegatronKing

好的,谢谢您

ghost avatar May 09 '22 02:05 ghost

请问一下 HttpCanary v9.2.8.1 为什么注入的时候不会出问题?

imlee2021 avatar Sep 05 '22 12:09 imlee2021

疑惑。。HttpCanary可以在Android12上正常抓包https,netbare不可以

plus1998 avatar Feb 25 '23 10:02 plus1998