-
Notifications
You must be signed in to change notification settings - Fork 221
refactor(android): Migrate native module from Java to Kotlin #1239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Removed the old Java implementation of A0Auth0Module and A0Auth0Package. - Introduced new Kotlin implementations for A0Auth0Module and A0Auth0Package. - Converted CredentialsParser and LocalAuthenticationOptionsParser from Java to Kotlin. - Updated A0Auth0Spec to Kotlin, maintaining the abstract structure for module methods. - Removed deprecated Java files related to the old architecture. - Ensured compatibility with the new architecture by implementing TurboReactPackage.
…ration and dependencies fix(A0Auth0Module): resolve activity casting issues and simplify domain validation
…into SDK-5699-kotlin-migration
pmathew92
reviewed
Jul 17, 2025
pmathew92
reviewed
Jul 17, 2025
pmathew92
reviewed
Jul 17, 2025
pmathew92
reviewed
Jul 17, 2025
private const val INVALID_DOMAIN_URL_ERROR_CODE = "a0.invalid_domain_url" | ||
private const val BIOMETRICS_AUTHENTICATION_ERROR_CODE = "a0.invalid_options_biometrics_authentication" | ||
private const val LOCAL_AUTH_REQUEST_CODE = 150 | ||
const val UNKNOWN_ERROR_RESULT_CODE = 1405 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: lets keep the public properties and private properties ordered together
pmathew92
reviewed
Jul 17, 2025
pmathew92
reviewed
Jul 17, 2025
pmathew92
reviewed
Jul 17, 2025
pmathew92
reviewed
Jul 17, 2025
pmathew92
reviewed
Jul 17, 2025
pmathew92
reviewed
Jul 17, 2025
pmathew92
reviewed
Jul 17, 2025
pmathew92
reviewed
Jul 17, 2025
pmathew92
reviewed
Jul 17, 2025
pmathew92
reviewed
Jul 17, 2025
pmathew92
reviewed
Jul 23, 2025
}) | ||
} | ||
|
||
override fun onActivityResult(activity: Activity, requestCode: Int, resultCode: Int, data: Intent?) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can delete this method ,if not being used
pmathew92
approved these changes
Jul 23, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request fully migrates the native Android implementation of the library from Java to Kotlin. This modernization effort aligns the codebase with current best practices for Android development, where Kotlin is the officially recommended language. The migration enhances code safety, readability, and maintainability without altering the module's functionality.
Key Changes
Complete Code Migration:
.java
source files within theandroid/src
directory have been converted to their Kotlin (.kt
) equivalents.A0Auth0Module
), the package definition (A0Auth0Package
), parsers (CredentialsParser
,LocalAuthenticationOptionsParser
), and architecture-specific specs (A0Auth0Spec
).Updated Build Configuration:
android/build.gradle
file has been updated to add thekotlin-android
plugin and necessary dependencies likekotlin-stdlib
.android/gradle.properties
file has been introduced to centralize and manage versions for Kotlin, Android SDKs, and other build configurations, making them easier to update.Code Refinements:
This is a pure refactoring initiative. There are no intentional changes to the public API or the behavior of the Android native module. The primary goal is to improve the long-term health and maintainability of the codebase.