Commit Graph

451 Commits

Author SHA1 Message Date
Him188
363d1f7ece
Remove module-level opt-ins, add @OptIn explicit in use-sites;
added some opt-in markers on API which should have:

- `appendMiraiCodeTo`

Made API stable (otherwise they require too heavy opt-ins):
- MiraiConsoleImplementation$ConsoleLaunchOptions
- LowLevelApi
2023-05-06 11:04:31 +01:00
Him188
2ef89d2b3f [build] Do not apply Android-relevant plugins if Android target is not enabled 2023-05-02 16:17:48 +01:00
Him188
178ca6c1b5 [build] Rewrite shadow relocation; fix dependency graph issues with Android, and improve build performance:
- Generate relocated JARs with classifier `relocated`, instead of replacing the output of `:jar` task.

- Create `JvmRelocated` publications to publish relocated artifacts.

- Patch Kotlin Metadata and Maven Pom for the added publication.

- Updated deps test to be more strict
2023-05-02 16:17:48 +01:00
Him188
164f621427 [build] Fully support Android target; Update to Gradle 8.0 2023-05-02 16:17:48 +01:00
Him188
cd18eb857d
[gradle] Suppress deprecation on compileKotlinTask since we still need to support older Kotlin versions 2023-05-01 11:08:03 +01:00
Samarium
f0bdd18d26
[idea] feat: provide an option for whether to use the proxy repo (#2636)
* feat(idea): set proxy repository for gradle plugins

* feat(idea): provide an option for whether to use the proxy repo

* chore: update copyright

* fix: rename the message key
2023-04-24 15:22:38 +01:00
Samarium
a397ee9959
[idea] feat: set jvmTarget version explicitly (#2631)
feat(idea): set jvmTarget version explicitly
2023-04-18 10:08:32 +01:00
Karlatemp
e76cdfb5df
[console] Skip downloading mirai-console-compiler-annotations 2023-04-15 23:35:43 +08:00
Samarium
f28a1a0f0d
[idea] feat: generate gradle-wrapper.properties and src/test directory (#2622)
feat: generate gradle-wrapper.properties and src/test directory
2023-04-15 15:01:10 +01:00
Him188
bddee1fd20
[idea] Update to IDEA 2023.1, plugin version 231-2.15.0-182-1
close #2606
2023-04-01 18:26:17 +01:00
NoMathExpectation
cb603adbfc
[console] 支持使用 json 保存与读取 PluginDataPluginConfig (#2498)
* Supports PluginData store with json format.

* Reformat code.
2023-03-22 15:36:54 +00:00
7aGiven
c0dbb59e99
[docs] 在文档注释手表协议不支持戳一戳事件 (#2572) 2023-03-21 14:00:29 +00:00
Him188
427c37e649
[build] Update to Kotlin 1.8.10 2023-03-19 03:18:34 +00:00
StageGuard
78d0b4fd54
QRCode login support & Introduce new authorization factory (#2502)
* [core] process `wtlogin.trans_emp` to support qrcode login

* [core] fix `wtlogin.trans_emp` protocol

* [core] optimize QRCodeLoginProcessor logic

* [core] fix `wtlogin.trans_emp` outgoing packet

* [core] cancel login when logging a bot which is inconsistent from bot factory

* [core] ignore `flag3` check on ANDROID_WATCH & name `flag1` and `flag2`

* [core] provide default `QRCodeLoginListener` for jvm

* [core] don't catch IllegalStateException in QRCodeLoginProcessor

* [core] Use `LoginSolver.createQRCodeLoginListener()` instead of property; Rename configuration name

* [core] Code improvement

* [core] remove qrcode state lock

* [core] ignore `flag3` when command is `wtlogin.trans_emp` in packet codec

* [core] enable qrcode login for macos

* [core] remove debug property in log

* [core] reformat code

* [core] rename `TransEmpResponse` to `Response`

* [core] assert `flag3Exception` not null first

* [core] remove arg client

* [core] update qrcode login notes

* [core] set custom qrcode size

* [core] Draft BotAuthorization

* [core] make SecretsProtection mpp

* [core] BotAuthorization.byXXX

* [core] Move QRCodeLoginListener to `.auth`

* [core] Protect data of BotAccount

* [core] Add SelectorRequireReconnectException

* [core] Implementation of BotAuthorization

* Revert changes of BotConfiguration

* api dump

* [core] remove passwordMd5 in `BotAccount`

* [mock] Add new bot factory function to mock bot factory

* Delete LoginCommandTest

* [core] Improve QRCode render

* [core] Introduce UnsupportedCaptchaMethodException & UnsupportedQRCodeCaptchaException

* api dump

* update docs

* [core] update `DebugRunHelper`

* [core] add simple block for BotAuthorization

* api dump

* Rename `canDoQRLogin` to `supportsQRLogin`, and specify argument names for MiraiProtocolInternal

* Remove `phoneNumber` parameter from BotAccount

* Make `BotAccount.<init>` with String password parameter TestOnly

* Rename `InconsistentBotException` to `InconsistentBotIdException`

* Rename `QRCodeLoginListener.onStatusChanged` to `QRCodeLoginListener.onStateChanged`

* Rename `BotAuthorizationResult` to `BotAuthResult`

* Rename BotAuthComponent, move internal APIs to internal module

* Logic fixup

* doc update

* QRCodeLoginListener.qrCodeStateUpdateInterval & onIntervalLoop

* console login with BotAuthorization

* update testing

* Update mirai-core-api/src/jvmMain/kotlin/utils/LoginSolver.jvm.kt

* Move AuthControl outside SsoProcessor

* Redesign auth

* Add initialTicket to producerCoroutine

* Revert protocol changes of MACOS

* Fix latch death locking

* Fix CoroutineOnDemandValueScope.receiveOrNull exceptional finish

* Fix exception collecting

* Fix DefaultBotAuthorizationFactory loading

* [core] qrcode login for IPAD protocol

* Revert "[core] qrcode login for IPAD protocol"

This reverts commit c1136a8798.

---------

Co-authored-by: Karlatemp <kar@kasukusakura.com>
Co-authored-by: Him188 <Him188@mamoe.net>
2023-03-18 13:52:31 +00:00
ArgonarioD
4f0f733f4d
修复JvmPlugin无法通过自己的classLoader以getResource的方法获取全局依赖的class文件 (#2536)
* [console] Fixed classLoaders of JvmPlugin cannot getResource(classes of global dependencies), fix #2535

* [core/utils/jvm] new fun: addAll(Enumeration)

* [console] modify DynLibClassLoader.tryFastOrStrictResolveResource to tryFastOrStrictResolveResources

* [console] remove allClassesAsResources field

* [console] add var to control whether class files of mirai dependencies could be load as resources

* [console/integration-test] modify loader test

* [console] dump new apis

* [console] rename JvmPluginClasspath.openMiraiDependenciesClassResource and standardize its KDoc

* [console] modify the KDoc of JvmPluginClasspath.shouldResolveConsoleSystemResource

* [console/integration-test] improve resources loading test cases

* [console/integration-test] modify assert to assertTrue
2023-03-12 22:37:47 +08:00
赵怡然
cb78ed34a5
[console] 修复在Android系统运行时,被杀后台时抛出的 InterruptedException 导致崩溃 (#2474)
* 修复在Android系统运行时,被杀后台时抛出的 InterruptedException 导致崩溃

* Update mirai-console/backend/mirai-console/src/MiraiConsoleImplementation.kt

Co-authored-by: Him188 <Him188@mamoe.net>

---------

Co-authored-by: Him188 <Him188@mamoe.net>
2023-03-01 17:57:57 +00:00
NoMathExpectation
a6afd9540c
[console] Fixed reaching UNREACHABLE_CLAUSE when running extensions with non-null function results. (#2528) 2023-02-24 02:15:43 +00:00
Him188
48d674b383
[build] Actions v3 (#2518)
* [build] Update to `actions/checkout@v3` and `actions/setup-java@v3`

* v3
2023-02-20 23:56:20 +00:00
cssxsh
38e03fdc00
[console] Add StartupEvent and AutoLoginEvent (#2446)
* add: console event impl

* add: internal annotation

* add: since 2.15
2023-02-19 11:48:28 +00:00
7aGiven
d8ef9ad282
修改执行指令部分 (#2506)
将PluginManager修改为CommandManager
2023-02-16 02:52:06 +00:00
EnchStudio
c96275892c
[console] typo: 将 consosle 改为 console (#2491) 2023-02-10 16:20:29 +00:00
char46
fa734ce2ff
[docs] 将 TempCommandSender 替换为 GroupTempCommandSender (#2457)
根据后文代码注释'mirai 正计划支持其他渠道发起的临时会话, 届时此事件会变动. 原 TempCommandSender 已更改为 GroupTempCommandSender'修改。
2023-01-25 15:18:23 +00:00
Karlatemp
68e1cc45b3
Fix console not stopped when plugin failed to load 2023-01-19 00:03:27 +08:00
Karlatemp
62ae2ac03c
[console] Create PluginOnDisableCalledOnlyOnceTest test; Fix tests 2023-01-02 23:43:33 +08:00
Karlatemp
6b1aa9c80b
[console] Fix JvmPlugin disabling multiple times; Introduce JvmPlugin status 2023-01-02 23:43:33 +08:00
Karlatemp
2f759c199a
[console] Fix plugin disabling order control 2023-01-02 23:43:32 +08:00
Karlatemp
b59c7336d0
[console] Make JvmPluginLoader a child job of PluginManager 2023-01-02 23:43:32 +08:00
Him188
38737a473a
[mock] Remove MockConsoleImplementation.createLogger because it had been removed in its super class
This commit fixes 7908edb57b
2022-12-27 17:50:41 +00:00
Him188
0a60535d46
[console] Ignore APIs marked with @ExperimentalCommandDescriptors in ABI compatibility checks 2022-12-27 16:01:03 +00:00
Him188
7908edb57b
[core+console] Raise deprecation level for 2.14, API including:
- EventChannel.asChannel
- (internal) syncFromEventImpl
- EmptyMessageChain
- GroupEntranceAnnouncementChangeEvent
- MiraiConsole.createLogger
- SingletonExtensionPoint
2022-12-27 15:53:12 +00:00
Him188
eb0891fe24
[idea] Support IDEA 2022.3 2022-12-22 13:27:45 +00:00
Karlatemp
a3f9755e8e
[console] Disable network log in testing 2022-12-18 22:36:13 +08:00
Karlatemp
e5a48566df [console/logging] Fix test naming 2022-12-17 20:33:33 +00:00
Karlatemp
46cd06d261 [console/logging] Fix typo fix nameing 2022-12-17 20:33:33 +00:00
Karlatemp
6c295723db [console/logging] slf4j binding support 2022-12-17 20:33:33 +00:00
Karlatemp
7537e29b0e [console/logging] Always load LoggerConfig; Add LoggerConfig.Binding settings 2022-12-17 20:33:33 +00:00
Karlatemp
8a07308a56 [console/logging] Introduce LoggerControlState for optimize performance 2022-12-17 20:33:33 +00:00
Karlatemp
889a78e572
[publish] Delete GpgSigner 2022-11-29 15:27:37 +08:00
Him188
65e49283a2
Revert "[console] Enable atomicfu compiler", due to incorrect behavior of atomicfu. See #2329
This reverts commit 440122d4f9.
2022-11-27 20:07:32 +00:00
Him188
4b794feecb
[terminal] Use the more concise way to add and shadow dependencies 2022-11-27 19:58:28 +00:00
Him188
9540bc95c5 [gradle+deps] Adjust memory limit for test Gradle instances 2022-11-27 15:25:18 +00:00
Him188
a6af7e82ea [build] Fix check-publishing actions 2022-11-27 15:25:18 +00:00
cssxsh
5618333a9d
[console/plugin] Fix multi-dependency-repositories not working (#2358) 2022-11-23 10:39:21 +00:00
Karlatemp
841f6e5326
[console] Fix gradle user home detecting; Fix #2357 2022-11-22 13:02:29 +08:00
赵怡然
0e4d5efd38
[console] 修复 JvmPluginInternal 在 Android java.lang.NoSuchMethodError (#2354)
* fix java.lang.NoSuchMethodError

fix java.lang.NoSuchMethodError: No virtual method getDeclaredAnnotation(Ljava/lang/Class;)L

* fix formatting

Co-authored-by: Him188 <Him188@mamoe.net>
2022-11-18 23:26:52 +00:00
Karlatemp
7cbff5a8c2
[console] Fix another concurrently logic 2022-11-02 18:02:24 +08:00
Karlatemp
9e7fd79225
[console] Let JLineInputDaemon use lock terminalExecuteLock; Try to fix \ #2322 2022-11-02 00:24:06 +08:00
Karlatemp
07000456cf
[console] Fix locking; Try to fix \ #2322 2022-11-02 00:10:43 +08:00
Karlatemp
d47221fa35
[console] Add LegacyCompatibilityLayerClassLoader; Load ktor 1.6.8 as fallback; fix #2297 2022-10-29 23:27:17 +08:00
Karlatemp
a47a8e1c2a
[console] [internal] No longer fast resolve netty to core 2022-10-29 23:27:16 +08:00