Skip to content

Conversation

JohnZoellerG
Copy link

Increment project-wide Kotlin version up to 2.2.0

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @JohnZoellerG, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on enhancing the security and maintainability of the Wear OS authentication sample by addressing potential data leakage in the authentication flow and performing significant dependency and code structure updates. I've upgraded the project's Kotlin version to 2.2.0 and refactored the network communication layer to improve clarity and separation of concerns.

Highlights

  • Kotlin and Dependency Upgrades: I've updated the project-wide Kotlin version to 2.2.0, along with corresponding updates to KSP and Horologist libraries, ensuring the sample benefits from the latest language features and library improvements.
  • Enhanced Authentication Security: I've implemented a crucial fix to prevent data leakage by modifying how credential data is handled between the CredentialManagerAuthenticator and AuthenticationServer. Instead of passing full credential objects, only the necessary, non-sensitive data is now extracted and sent to the server, improving the security posture.
  • Network Layer Refactoring: I've renamed the api package to network and updated associated classes (e.g., ApiResult to NetworkResult, ApiException to NetworkException) to provide a more accurate and consistent naming convention for network-related components.
  • Codebase Organization: I've restructured the UI and ViewModel packages, moving related files into more logical ui.navigation, ui.screens, and ui.viewmodel directories, which enhances the overall maintainability and navigability of the codebase.
  • Build Configuration Modernization: I've updated the Wear OS module's compileSdk to 36, streamlined Compose build options, and adjusted the application ID, aligning the project with the latest Android development practices.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the authentication logic to fix a data leakage issue between the Credential Manager API and the app's server communication layer. This is a great architectural improvement. The PR also updates Kotlin to 2.2.0 and related dependencies, and reorganizes the UI and network packages for better maintainability. The changes are solid. My review includes a few suggestions to address some leftover commented-out code and a potential improvement in the build configuration.

@JohnZoellerG JohnZoellerG force-pushed the clean-move-branch branch 2 times, most recently from 2a53b37 to e4f3d0c Compare August 15, 2025 00:32
@JohnZoellerG JohnZoellerG changed the title Fix data leakage between authentication logic and server invocation in Wear sample. Reorganize logic into cleaner directories and better separation of concerns in Wear sample. Aug 15, 2025
@JohnZoellerG JohnZoellerG marked this pull request as ready for review August 15, 2025 00:36
@@ -87,10 +88,6 @@ android {
buildConfig = true
}

composeOptions {

Choose a reason for hiding this comment

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

nice!

minSdk = 30
targetSdk = 35
targetSdk = 36

Choose a reason for hiding this comment

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


private const val TAG = "OkHttpExtension"

suspend fun Call.await(): Response {

Choose a reason for hiding this comment

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

If you bump to 5.1.0 there is an okhttp-coroutines module with this built in.

composable(ShrineDestinations.HOME_ROUTE) {
val credentialManagerViewModel: CredentialManagerViewModel = viewModel()

Choose a reason for hiding this comment

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

nice catch

@JohnZoellerG JohnZoellerG merged commit c8c2890 into android:credman-compose Aug 25, 2025
1 check passed
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