MiraiForum

    • Register
    • Login
    • Search
    • Popular
    • Recent
    • Unsolved
    • Tags
    • Groups
    • 友情链接

    Solved 安卓上用mirai-core登录出现异常

    BUG反馈
    2
    14
    396
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • sposer
      sposer last edited by

      大佬们,帮忙看下咋回事呗,顺带能解决就太棒了。
      报错是这样:

      2021-08-28 22:37:26.455 29812-29889/top.heue.mq W/System.err: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
      2021-08-28 22:37:26.455 29812-29889/top.heue.mq W/System.err: SLF4J: Defaulting to no-operation (NOP) logger implementation
      2021-08-28 22:37:26.455 29812-29889/top.heue.mq W/System.err: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
      2021-08-28 22:37:26.483 29812-29889/top.heue.mq W/System.err: ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
      2021-08-28 22:37:26.499 29812-29889/top.heue.mq W/top.heue.mq: Accessing hidden method Lsun/misc/VM;->maxDirectMemory()J (greylist, reflection, allowed)
      2021-08-28 22:37:26.501 29812-29889/top.heue.mq W/top.heue.mq: Accessing hidden field Lsun/nio/ch/SelectorImpl;->selectedKeys:Ljava/util/Set; (greylist, reflection, allowed)
      2021-08-28 22:37:26.501 29812-29889/top.heue.mq W/top.heue.mq: Accessing hidden field Lsun/nio/ch/SelectorImpl;->publicSelectedKeys:Ljava/util/Set; (greylist, reflection, allowed)
      2021-08-28 22:37:26.507 29812-29812/top.heue.mq W/DefaultDispatch: type=1400 audit(0.0:26229411): avc: denied { read } for name="somaxconn" dev="proc" ino=186429504 scontext=u:r:untrusted_app:s0:c190,c258,c512,c768 tcontext=u:object_r:proc_net:s0 tclass=file permissive=0 app=top.heue.mq
      2021-08-28 22:37:26.602 29812-29889/top.heue.mq V/NET: No server list cached.
      2021-08-28 22:37:26.609 29812-29889/top.heue.mq W/System.err: java.security.NoSuchAlgorithmException: ECDH KeyPairGenerator not available
      2021-08-28 22:37:26.610 29812-29889/top.heue.mq W/System.err:     at java.security.KeyPairGenerator.getInstance(KeyPairGenerator.java:241)
      2021-08-28 22:37:26.610 29812-29889/top.heue.mq W/System.err:     at net.mamoe.mirai.internal.utils.crypto.ECDH.lambda-3$testECDH(ECDHJvmDesktop.kt:71)
      2021-08-28 22:37:26.610 29812-29889/top.heue.mq W/System.err:     at net.mamoe.mirai.internal.utils.crypto.ECDH.<clinit>(ECDHJvmDesktop.kt:82)
      2021-08-28 22:37:26.610 29812-29889/top.heue.mq W/System.err:     at net.mamoe.mirai.internal.utils.crypto.ECDHKt.adjustToPublicKey(ECDH.kt:141)
      2021-08-28 22:37:26.610 29812-29889/top.heue.mq W/System.err:     at net.mamoe.mirai.internal.utils.crypto.ECDHKt.adjustToPublicKey(ECDH.kt:136)
      2021-08-28 22:37:26.610 29812-29889/top.heue.mq W/System.err:     at net.mamoe.mirai.internal.utils.crypto.ECDHInitialPublicKey.<init>(ECDH.kt:125)
      2021-08-28 22:37:26.610 29812-29889/top.heue.mq W/System.err:     at net.mamoe.mirai.internal.utils.crypto.ECDHInitialPublicKey.<init>(ECDH.kt:123)
      2021-08-28 22:37:26.610 29812-29889/top.heue.mq W/System.err:     at net.mamoe.mirai.internal.utils.crypto.ECDHKt$defaultInitialPublicKey$2.invoke(ECDH.kt:132)
      2021-08-28 22:37:26.610 29812-29889/top.heue.mq W/System.err:     at net.mamoe.mirai.internal.utils.crypto.ECDHKt$defaultInitialPublicKey$2.invoke(ECDH.kt:132)
      2021-08-28 22:37:26.610 29812-29889/top.heue.mq W/System.err:     at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
      2021-08-28 22:37:26.610 29812-29889/top.heue.mq W/System.err:     at net.mamoe.mirai.internal.utils.crypto.ECDHKt.getDefaultInitialPublicKey(ECDH.kt:132)
      2021-08-28 22:37:26.610 29812-29889/top.heue.mq W/System.err:     at net.mamoe.mirai.internal.network.components.AccountSecretsManagerKt.AccountSecretsImpl(AccountSecretsManager.kt:146)
      2021-08-28 22:37:26.610 29812-29889/top.heue.mq W/System.err:     at net.mamoe.mirai.internal.network.components.AccountSecretsManagerKt.getSecretsOrCreate(AccountSecretsManager.kt:154)
      2021-08-28 22:37:26.610 29812-29889/top.heue.mq W/System.err:     at net.mamoe.mirai.internal.network.components.BotClientHolderImpl.createClient(BotClientHolder.kt:36)
      2021-08-28 22:37:26.610 29812-29889/top.heue.mq W/System.err:     at net.mamoe.mirai.internal.network.components.BotClientHolderImpl.access$createClient(BotClientHolder.kt:24)
      2021-08-28 22:37:26.610 29812-29889/top.heue.mq W/System.err:     at net.mamoe.mirai.internal.network.components.BotClientHolderImpl$client$2.invoke(BotClientHolder.kt:28)
      2021-08-28 22:37:26.611 29812-29889/top.heue.mq W/System.err:     at net.mamoe.mirai.internal.network.components.BotClientHolderImpl$client$2.invoke(BotClientHolder.kt:28)
      2021-08-28 22:37:26.611 29812-29889/top.heue.mq W/System.err:     at net.mamoe.mirai.utils.LateinitMutableProperty.getValue(LateinitMutableProperty.kt:38)
      2021-08-28 22:37:26.611 29812-29889/top.heue.mq W/System.err:     at net.mamoe.mirai.internal.network.components.BotClientHolderImpl.getClient(BotClientHolder.kt:28)
      2021-08-28 22:37:26.611 29812-29889/top.heue.mq W/System.err:     at net.mamoe.mirai.internal.network.components.SsoProcessorImpl.getClient(SsoProcessor.kt:97)
      2021-08-28 22:37:26.611 29812-29889/top.heue.mq W/System.err:     at net.mamoe.mirai.internal.network.components.SsoProcessorImpl.login(SsoProcessor.kt:111)
      2021-08-28 22:37:26.611 29812-29889/top.heue.mq W/System.err:     at net.mamoe.mirai.internal.network.impl.netty.NettyNetworkHandler$StateConnecting$1.invokeSuspend(NettyNetworkHandler.kt:269)
      2021-08-28 22:37:26.611 29812-29889/top.heue.mq W/System.err:     at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
      2021-08-28 22:37:26.611 29812-29889/top.heue.mq W/System.err:     at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
      2021-08-28 22:37:26.611 29812-29889/top.heue.mq W/System.err:     at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
      2021-08-28 22:37:26.611 29812-29889/top.heue.mq W/System.err:     at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
      2021-08-28 22:37:26.611 29812-29889/top.heue.mq W/System.err:     at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
      2021-08-28 22:37:26.611 29812-29889/top.heue.mq W/System.err:     at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
      2021-08-28 22:37:26.872 29812-29889/top.heue.mq I/NET: ECDH key is invalid, start to fetch ecdh public key from server.
      2021-08-28 22:37:26.876 29812-29826/top.heue.mq I/top.heue.mq: Background concurrent copying GC freed 627212(18MB) AllocSpace objects, 6(120KB) LOS objects, 50% free, 18MB/36MB, paused 33us total 134.446ms
      2021-08-28 22:37:27.356 29812-29889/top.heue.mq I/NET: Successfully fetched ecdh public key from server.
      2021-08-28 22:37:27.371 29812-29889/top.heue.mq V/NET: Send: wtlogin.login
      2021-08-28 22:37:28.208 29812-29869/top.heue.mq I/BOT: Login successful
      2021-08-28 22:37:28.208 29812-29889/top.heue.mq V/NET: Recv: wtlogin.login
      2021-08-28 22:37:28.291 29812-29889/top.heue.mq V/NET: No server list cached.
      

      之后就这样循环打印:

      2021-08-28 22:37:28.293 29812-29889/top.heue.mq I/NET: ECDH key is valid.
      2021-08-28 22:37:28.307 29812-29889/top.heue.mq V/NET: Send: wtlogin.exchange_emp
      2021-08-28 22:37:28.489 29812-29889/top.heue.mq V/NET: Recv: wtlogin.exchange_emp
      2021-08-28 22:37:31.563 29812-29889/top.heue.mq V/NET: No server list cached.
      2021-08-28 22:37:31.567 29812-29889/top.heue.mq I/NET: ECDH key is valid.
      

      收不到消息,然后~版本2.7.0和2.8-M1试着都这样,就登录那一步后出问题。
      2.6.8和之前的试了几个都构建失败了。

      以前2.1.1的那个打包的apk倒还能正常登录接收消息。

      1 Reply Last reply Reply Quote 0
      • sposer
        sposer last edited by

        解决了,按照mirai-android中的样子换成mirai-core-android,然后版本改为2.6.8就行了,2.7.0和2.8-M1还是不行。

        1 Reply Last reply Reply Quote 0
        • RainChan
          RainChan 摸鱼 last edited by

          升级到2.7.0即可

          sposer 2 Replies Last reply Reply Quote 0
          • sposer
            sposer @RainChan last edited by

            @rainchan 就是用的2.7.0这样的

            1 Reply Last reply Reply Quote 0
            • RainChan
              RainChan 摸鱼 last edited by

              这很奇怪,为什么我2.7就没问题

              1 Reply Last reply Reply Quote 0
              • RainChan
                RainChan 摸鱼 last edited by

                提供更多信息有助于确定问题

                sposer 1 Reply Last reply Reply Quote 0
                • sposer
                  sposer @RainChan last edited by

                  @rainchan 请问需要提供点啥,日志就是这样

                  RainChan 1 Reply Last reply Reply Quote 0
                  • RainChan
                    RainChan 摸鱼 @sposer last edited by

                    @sposer 整个项目代码

                    sposer 1 Reply Last reply Reply Quote 0
                    • sposer
                      sposer @RainChan last edited by

                      哦哦,这个要等会儿才有空上传,嗯,到时候@你哈

                      1 Reply Last reply Reply Quote 0
                      • sposer
                        sposer @RainChan last edited by

                        @rainchan 495418f4-3af3-4b20-befb-2baf4d015548-image.png
                        登录的地方在MQService里,这是项目链接:
                        自测能运行

                        1 Reply Last reply Reply Quote 0
                        • RainChan
                          RainChan 摸鱼 last edited by RainChan

                          感觉是依赖的问题,mirai依赖加上-android看看

                          sposer 1 Reply Last reply Reply Quote 0
                          • sposer
                            sposer @RainChan last edited by

                            @rainchan 加上变成mirai-core-android,还是那样。

                            1 Reply Last reply Reply Quote 0
                            • RainChan
                              RainChan 摸鱼 last edited by

                              可以参考一下我的项目,我感觉我就是加了个-android就好了

                              sposer 1 Reply Last reply Reply Quote 0
                              • sposer
                                sposer @RainChan last edited by

                                @rainchan 好的,谢谢

                                1 Reply Last reply Reply Quote 0
                                • sposer
                                  sposer last edited by

                                  解决了,按照mirai-android中的样子换成mirai-core-android,然后版本改为2.6.8就行了,2.7.0和2.8-M1还是不行。

                                  1 Reply Last reply Reply Quote 0
                                  • 1 / 1
                                  • First post
                                    Last post
                                  Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact