
Unified core library optimizes packet build, modification, delivery, and post-processing with dynamic policy configurations, extensive extensions, and future SQLite support for efficient data packet management.
Medal-core is fully developed by Kotlin, compatible with Kotlin Multiplatform, with rich extension functions and Kotlin-DSL, supports flexible policy configuration, and is compatible with IOS/Android and packet delivery of various channels.
Medal-core is a unified core library for packet DSL, build, modify, delivery, and post-processing, and completes all processing of packets in the fastest and most efficient way.
Here's a simple example of using Medal-core, showing how to use Medal-core to quickly process packets
suspend fun main() {
Channal.Official.version = "x.x.x"
platformManager.switchToAndroid(Channel.Official)
val user = User(
userId = primitive { 12345678 },
password = "medal-test-password"
)
buildStrategy {
version = 1
description = "Android - Get user data"
packet {
i = "V316"
parse("""
{
"pi": "{{pi}}",
"sk": "{{sk}}",
"ui": "{{ui}}"
}
""".trimIndent())
onSuccess { true }
}
}.executeWith(
OfficialProvider(user.userId.content, user.password.getMD5())
)
}The above method is completely equivalent, and use the Medal-core method to construct packets, execute packets, and process packets
Make sure that the kotlin plugin for your IDE supports kotlin 2.1.0 or later
Incompatible Gradle 8.12 or above
If you build in Intellij IDEA with an error,or build with Maven、 try enabling the following settings: Settings / Build, Execution, Deployment / Build Tools / Maven / Runner / Delegate IDE build/run actions to Maven.
Make sure your project root of settings.gradle.kts is added Maven Central repository
dependencyResolutionManagement {
repositories {
mavenCentral()
maven("https://maven.aliyun.com/repository/public") // Optional for China Mainland users
}
}Then add dependency in build.gradle.kts
dependencies {
implementation("io.github.smfdrummer:medal-core:${latest.version}")
}Including latest.version is the latest version number,you can find it in Maven Central
Make sure your project root of settings.gradle is added Maven Central repository
dependencyResolutionManagement {
repositories {
mavenCentral()
maven { url 'https://maven.aliyun.com/repository/public' } // Optional for China Mainland users
}
}
Then add dependency in build.gradle
dependencies {
implementation 'io.github.smfdrummer:medal-core:{{latest.version}}'
}Including latest.version is the latest version number,you can find it in Maven Central
Add the following to the pom.xml file:
<repositories>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
<!-- Aliyun public Maven repository for China Mainland users -->
<repository>
<id>aliyun-central</id>
<url>https://maven.aliyun.com/repository/public</url>
</repository>
</repositories><dependencies>
<dependency>
<groupId>io.github.smfdrummer</groupId>
<artifactId>medal-core</artifactId>
<version>latest.version</version>
</dependency>
</dependencies>Including latest.version is the latest version number,you can find it in Maven Central
For more information, please visit: Wiki learn how to use it
Medal-core is released under the AGPL 3.0 license
Unless commercially licensed, the code needs to be open source in any way you modify or use it
Only projects for personal use and open source can use this library, otherwise there will be a fee
Please comply with the license regulations and do not violate the license regulations, otherwise you will be held legally responsible
Thank you for using Medal-core, and if you have any questions or suggestions, please take Issues
Projects cite the following open source projects (in no particular order):
If you like Medal-core and want to support the development of the project, you can sponsor in the following ways: AiFaDian
Medal-core is fully developed by Kotlin, compatible with Kotlin Multiplatform, with rich extension functions and Kotlin-DSL, supports flexible policy configuration, and is compatible with IOS/Android and packet delivery of various channels.
Medal-core is a unified core library for packet DSL, build, modify, delivery, and post-processing, and completes all processing of packets in the fastest and most efficient way.
Here's a simple example of using Medal-core, showing how to use Medal-core to quickly process packets
suspend fun main() {
Channal.Official.version = "x.x.x"
platformManager.switchToAndroid(Channel.Official)
val user = User(
userId = primitive { 12345678 },
password = "medal-test-password"
)
buildStrategy {
version = 1
description = "Android - Get user data"
packet {
i = "V316"
parse("""
{
"pi": "{{pi}}",
"sk": "{{sk}}",
"ui": "{{ui}}"
}
""".trimIndent())
onSuccess { true }
}
}.executeWith(
OfficialProvider(user.userId.content, user.password.getMD5())
)
}The above method is completely equivalent, and use the Medal-core method to construct packets, execute packets, and process packets
Make sure that the kotlin plugin for your IDE supports kotlin 2.1.0 or later
Incompatible Gradle 8.12 or above
If you build in Intellij IDEA with an error,or build with Maven、 try enabling the following settings: Settings / Build, Execution, Deployment / Build Tools / Maven / Runner / Delegate IDE build/run actions to Maven.
Make sure your project root of settings.gradle.kts is added Maven Central repository
dependencyResolutionManagement {
repositories {
mavenCentral()
maven("https://maven.aliyun.com/repository/public") // Optional for China Mainland users
}
}Then add dependency in build.gradle.kts
dependencies {
implementation("io.github.smfdrummer:medal-core:${latest.version}")
}Including latest.version is the latest version number,you can find it in Maven Central
Make sure your project root of settings.gradle is added Maven Central repository
dependencyResolutionManagement {
repositories {
mavenCentral()
maven { url 'https://maven.aliyun.com/repository/public' } // Optional for China Mainland users
}
}
Then add dependency in build.gradle
dependencies {
implementation 'io.github.smfdrummer:medal-core:{{latest.version}}'
}Including latest.version is the latest version number,you can find it in Maven Central
Add the following to the pom.xml file:
<repositories>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
<!-- Aliyun public Maven repository for China Mainland users -->
<repository>
<id>aliyun-central</id>
<url>https://maven.aliyun.com/repository/public</url>
</repository>
</repositories><dependencies>
<dependency>
<groupId>io.github.smfdrummer</groupId>
<artifactId>medal-core</artifactId>
<version>latest.version</version>
</dependency>
</dependencies>Including latest.version is the latest version number,you can find it in Maven Central
For more information, please visit: Wiki learn how to use it
Medal-core is released under the AGPL 3.0 license
Unless commercially licensed, the code needs to be open source in any way you modify or use it
Only projects for personal use and open source can use this library, otherwise there will be a fee
Please comply with the license regulations and do not violate the license regulations, otherwise you will be held legally responsible
Thank you for using Medal-core, and if you have any questions or suggestions, please take Issues
Projects cite the following open source projects (in no particular order):
If you like Medal-core and want to support the development of the project, you can sponsor in the following ways: AiFaDian