Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.NoSuchMethodException #88

Open
ghost opened this issue May 9, 2022 · 9 comments
Open

java.lang.NoSuchMethodException #88

ghost opened this issue May 9, 2022 · 9 comments

Comments

@ghost
Copy link

ghost commented May 9, 2022

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

@MegatronKing
Copy link
Owner

系统版本?

@ghost
Copy link
Author

ghost commented May 9, 2022

Android 12

@ghost
Copy link
Author

ghost commented May 9, 2022

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

@ghost
Copy link
Author

ghost commented May 9, 2022

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)

@MegatronKing
Copy link
Owner

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

@MegatronKing
Copy link
Owner

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

@ghost
Copy link
Author

ghost commented May 9, 2022

好的,谢谢您

@imlee2021
Copy link

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

@plus1998
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants