Skip to content

Provide MainActivityAlias by AppInfoProvider#192

Merged
Goooler merged 1 commit intotrunkfrom
provide-main-alias
May 6, 2026
Merged

Provide MainActivityAlias by AppInfoProvider#192
Goooler merged 1 commit intotrunkfrom
provide-main-alias

Conversation

@Goooler
Copy link
Copy Markdown
Owner

@Goooler Goooler commented May 6, 2026

No description provided.

@Goooler Goooler force-pushed the provide-main-alias branch from 987ad18 to 18afe41 Compare May 6, 2026 09:03
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 centralizes knowledge about the app’s main activity entry points by introducing an AppInfoProvider (backed by Koin) and migrating call sites that previously hardcoded or locally provided the main activity class / alias.

Changes:

  • Replaced the old MainActivityClassProvider lookup in mainIntent() with AppInfoProvider.instance.
  • Moved Context.mainActivityAlias from UiStore’s companion to a shared util extension backed by AppInfoProvider.
  • Wired AppInfoProvider into the app’s Koin module and updated settings VM imports accordingly.

Reviewed changes

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

Show a summary per file
File Description
ui/settings/src/main/kotlin/com/github/kr328/clash/settings/vm/AppSettingsViewModel.kt Switches to the new mainActivityAlias import location.
glue/src/main/kotlin/com/github/kr328/clash/util/Intent.kt Uses AppInfoProvider for mainIntent() and introduces Koin-backed Context.mainActivityAlias.
glue/src/main/kotlin/com/github/kr328/clash/store/UiStore.kt Removes the old hardcoded alias extension and imports the new util-based alias.
glue/src/main/kotlin/com/github/kr328/clash/di/AppInfoProvider.kt Adds the Koin-resolved provider interface used across modules.
app/src/main/kotlin/com/github/kr328/clash/AppModule.kt Registers AppInfoProvider in Koin and defines the alias string.

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

Comment thread glue/src/main/kotlin/com/github/kr328/clash/store/UiStore.kt
Comment on lines +13 to +14
val Context.mainActivityAlias: ComponentName
get() = ComponentName(this, appInfoProvider.mainActivityAlias)
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fine.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Comment thread app/src/main/kotlin/com/github/kr328/clash/AppModule.kt
@Goooler Goooler merged commit be7d6b3 into trunk May 6, 2026
3 checks passed
@Goooler Goooler deleted the provide-main-alias branch May 6, 2026 09:08
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