java-wechaty
java-wechaty copied to clipboard
java版本是否还在维护?
您好,我这边尝试用java版本sdk wechaty本地docker启动0.78版本。程序无法启动
io.grpc.StatusRuntimeException: UNAUTHENTICATED: Invalid Wechaty TOKEN "127.0.0.1:8788" at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:244) ~[grpc-stub-1.29.0.jar:1.29.0] at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:225) ~[grpc-stub-1.29.0.jar:1.29.0] at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:142) ~[grpc-stub-1.29.0.jar:1.29.0] at io.github.wechaty.grpc.PuppetGrpc$PuppetBlockingStub.start(PuppetGrpc.java:2744) ~[grpc-0.16.1.jar:?] at io.github.wechaty.grpc.GrpcPuppet.start(GrpcPuppet.kt:78) [wechaty-puppet-hostie-0.1.5-SNAPSHOT.jar:?]
请问java版本还有在维护吗
这个是传递的token有问题,可以在上图中增加下鉴权token,但是puppet server 可能还是有问题
@xiangyaoan https://juejin.cn/post/7097964854064971812/ 你可以参考下这个文档,主流程是能跑起来的,并且需要新增一下authority或者我新提交的pr
@IanCao 我是这样用的

你在grpc请求上新增authority了么
没有,我就是copy 的 example代码 设置了token和endpoint 这个wechaty/wechaty:0.78 用go-wechaty 没问题
JavaClient 需要改下代码 参考 https://github.com/wechaty/java-wechaty/pull/108
我参考#108改了GrpcPuppet.kt 但是GrpcUtil的checkAuthority 过不去,No host in authority
兄弟 你启动起来了没有? 我遇到了跟你一样的问题 现在不知道怎么解决了 如果你解决了的话 能请教下吗?
我参考#108改了GrpcPuppet.kt 但是GrpcUtil的checkAuthority 过不去,No host in authority 一样显示No host in authority
ManagedChannelImplBuilder debug模式修改authorityCheckerDisabled = true. 可以正常返回二维码
String checkAuthority(String authority) {
if (authorityCheckerDisabled) {
return authority;
}
return GrpcUtil.checkAuthority(authority);
}
GrpcPuppet代码部分,目前没有找到修改authorityCheckerDisabled的方法
channel = ManagedChannelBuilder.forAddress(discoverHostieIp.first, NumberUtils.toInt(discoverHostieIp.second))
.usePlaintext().executor(newFixedThreadPool)
.overrideAuthority(puppetOptions?.token)
.usePlaintext().build()
这个问题现在还没结论吗