Skip to content

Provide MainActivity class by Koin#191

Merged
Goooler merged 10 commits intotrunkfrom
land-metro
May 6, 2026
Merged

Provide MainActivity class by Koin#191
Goooler merged 10 commits intotrunkfrom
land-metro

Conversation

@Goooler
Copy link
Copy Markdown
Owner

@Goooler Goooler commented May 6, 2026

@Goooler Goooler mentioned this pull request May 6, 2026
@Goooler Goooler changed the title Type-safe MainActivity class Inject MainActivity class by Koin May 6, 2026
@Goooler Goooler changed the title Inject MainActivity class by Koin Provide MainActivity class by Koin May 6, 2026
@Goooler Goooler requested a review from Copilot May 6, 2026 08:01
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces Koin-based wiring so the glue module can obtain the app’s MainActivity class without using reflection (Class.forName(...)), aligning with the ongoing module separation work (refs PR #180).

Changes:

  • Add Koin dependencies (BOM + core/android) and apply a Koin compiler Gradle plugin in the app module.
  • Start Koin in MainApplication and register an appModule that provides MainActivityClassProvider.
  • Update glue’s mainIntent() helper to resolve the target activity class via Koin instead of reflection.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
gradle/libs.versions.toml Adds Koin BOM/libs and a Koin compiler plugin entry to the version catalog.
glue/src/main/kotlin/com/github/kr328/clash/util/Intent.kt Replaces reflection with a Koin-provided MainActivity class for mainIntent().
glue/build.gradle.kts Adds Koin BOM + core dependency to support the new mainIntent() implementation.
app/src/main/kotlin/com/github/kr328/clash/MainApplication.kt Starts Koin at app startup and installs the app module.
app/src/main/kotlin/com/github/kr328/clash/AppModule.kt Defines a Koin module providing MainActivityClassProvider.
app/build.gradle.kts Applies the Koin compiler plugin and adds Koin Android dependency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread glue/src/main/kotlin/com/github/kr328/clash/util/Intent.kt Outdated
Comment thread glue/src/main/kotlin/com/github/kr328/clash/util/Intent.kt Outdated
Comment thread app/src/main/kotlin/com/github/kr328/clash/MainApplication.kt
Comment thread app/build.gradle.kts Outdated
Comment thread app/src/main/kotlin/com/github/kr328/clash/MainApplication.kt Outdated
Goooler and others added 2 commits May 6, 2026 16:09
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread glue/src/main/kotlin/com/github/kr328/clash/util/Intent.kt
@Goooler Goooler merged commit ce060c9 into trunk May 6, 2026
7 checks passed
@Goooler Goooler deleted the land-metro branch May 6, 2026 08:23
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

Successfully merging this pull request may close these issues.

2 participants