Skip to content

Migration: com.passwordmanager to com.jeeldobariya.passcodes#17

Merged
JeelDobariya38 merged 26 commits intomainfrom
feat-package-migration-jeel-dev
Aug 1, 2025
Merged

Migration: com.passwordmanager to com.jeeldobariya.passcodes#17
JeelDobariya38 merged 26 commits intomainfrom
feat-package-migration-jeel-dev

Conversation

@JeelDobariya38
Copy link
Member

@JeelDobariya38 JeelDobariya38 commented Jul 28, 2025

Important

Attention! Attention! Major architecture changes!!

Changes Made

  • Migrated successfully from com.passwordmanager to com.jeeldobariya.passcodes.
  • Update Gradle 7.6 -> 8.14.3.
  • Migrate Gradle: Groovy (old) -> Kotlin DSL.
  • Compile Android App With SDK 36 and Move Target SDK from 33 -> 34.
  • Migrate the code from java to kotlin. [I have use Gemini 2.5 extensively just to migrate it faster I am still unfamiliar with code base and make sense of it. once i complete make sense of it will mark this pr as not drafted mean read to merge @kudanilll]
  • Migrate From SQLiteOpenHelper to Room Library.
  • Add Kotlin Flow library.
  • Add test for Room Database
  • Update changelogs.md and other documentations.
  • Change the project name from Password Manager to Passcodes where possible. [meaning, url are still not updated]
  • successfully closes Migration from com.passwordmanager to com.jeeldobariya.passcodes #14 and resolves ⁉️Doubt: Common Package Name⁉️ #12

TODO: yet left changes

  • Fix issue with app database call on main thread.
  • Automated test for instrumental app.
  • Other documentation changes.
  • Review the changes thoroughly.
  • Understand the codebase myself, if that counts 😂 (as i have use gemini)

@JeelDobariya38 JeelDobariya38 self-assigned this Jul 28, 2025
@JeelDobariya38 JeelDobariya38 added enhancement New feature or request refactor refactor the code labels Jul 28, 2025
@JeelDobariya38 JeelDobariya38 marked this pull request as draft July 28, 2025 12:48
@JeelDobariya38 JeelDobariya38 requested a review from kudanilll July 28, 2025 16:32
@JeelDobariya38
Copy link
Member Author

@kudanilll please, through review the code and point any mistakes.. even if seems small as this is a major changes in project...

fix: the bug of database operation on main thread

bug was introduce in 1fbcc9b

This commit is not stand alone all previous commit are part of it. after bug are part of it.

be very careful revert any of this commit as standalone

chore(depsfix): fix a issue in build.gradle

refactor: ViewPassword.kt to use coroutines

refactor: UpdatePassword.kt to use coroutines

refactor: SavePassword.kt to use coroutines

refactor: LoadPassword.kt to use coroutines

refactor: update the controller to use suspend function

the commit is not complete as a whole

feat: make every db operation a suspend function and use flows

the commit is not complete as a whole

chore(deps): add dependency for coroutines

chore(deps): improve the build.gradle and make morder
@JeelDobariya38 JeelDobariya38 force-pushed the feat-package-migration-jeel-dev branch from b9d521d to d5617ef Compare July 29, 2025 06:13
@JeelDobariya38 JeelDobariya38 added the tests change tests label Jul 29, 2025
@JeelDobariya38
Copy link
Member Author

Most code changes have been done!!. I am still make sense of codebase and also of test. (As this migration was mostly assisted by gemini. And also I am new to kotlin ecosystem)

  • From here, I don't think there will major changes. (In code, In this PR).
  • I have test the app on Android 15.

@kudanilll You also check the codebase!! And it better to review code in this branch as whole rather then this pr itself.

@JeelDobariya38 JeelDobariya38 force-pushed the feat-package-migration-jeel-dev branch from f950ed5 to 5553e7e Compare July 29, 2025 13:06
@JeelDobariya38 JeelDobariya38 requested a review from kudanilll July 29, 2025 13:43
@JeelDobariya38
Copy link
Member Author

JeelDobariya38 commented Jul 29, 2025

@kudanilll 🥳🥳 Finally, migration is completed. Now, I will go through entire kotlin codebase and try make sense of it...

@JeelDobariya38 JeelDobariya38 added the documentation Improvements or additions to documentation label Jul 30, 2025
Copy link
Member Author

@JeelDobariya38 JeelDobariya38 left a comment

Choose a reason for hiding this comment

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

I have thoroughly review the code and understand it and want to point out something to you @kudanilll that stick out to me while review the code...

Also, As I understand code, I am marking pr as ready to merge.... meaning undrafted.... and If everything is fine, Don't wait for me danil just proceed merge it....

Please provide your valuable feedback!! Thanks for your time...

binding = ActivityUpdatePasswordBinding.inflate(layoutInflater)
setContentView(binding.root)

val intent = intent
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know, why gemini just did this, he/we initialized intent and then use it direct;y in next line... Do you @kudanilll, know any specific reason why this might be done?

Or is it a good practice in android community to first take the indent in variable and then do, stuff with it?

Similar changes are also found in ‎app/src/main/kotlin/com/jeeldobariya/passcodes/ui/ViewPasswordActivity.kt

class PasswordAdapter(
private val context: Context,
private var passwordList: List<Password> // Use mutable list if you need to update it
) : BaseAdapter() {
Copy link
Member Author

Choose a reason for hiding this comment

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

I am as Android Beginner, not know of this Adaptor stuff, But still Accept this changes!! I will later, try to learn it...

I can sort of make sense of it as fragment.. but, I am not sure!! And still learn....

I hope @kudanilll you will take care of this code, if any issue occur until I fully learn this stuff!!

Comment on lines +78 to +79
private fun addOnClickListenerOnButton() {
binding.passwordList.setOnItemClickListener { _, _, position, _ ->
Copy link
Member Author

Choose a reason for hiding this comment

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

Important

POTENTIAL BUG!!
But, It's not yet encountered by me in any debug build that, I made or share with fellow friend/tester, @jainil63.

This code to me seems to be buggy, I don't why? and I am not sure is it really?

I guess, It because, I see three thing that i like to point out...

  • passwordAdapter is a lateinit var, Which mean it value can be change later, and could be potential null at first. until we initialize it, in this case, this happen in collectPasswordList() when password are found.. or not. in both case this is initialized..
  • We are in addOnClickListenerOnButton() function, where we just add a event listener, Without do any prior null checks. Note that, In onCreate(). addOnClickListenerOnButton() is called before collectPasswordList().
  • Also, the initialization happen in specifically collect() of Flow. Which mean it could change over time. and passwordAdapter could be reinitialized, and there in that new instance there be no onclicklistener on it, As we call the method only once in onCreate().

Anyways, Whatever the thing is, we will discuss it and probably, make work around it. But not in this PR [considering, there are already very many major change in this PR and it already review by danill and me, for multiple times, cost time & effort] Further changes on this, will be made in a new PR or under explicitly github issue (for bug specific)...

Please Provide Further Information @kudanilll.

Suggested change
private fun addOnClickListenerOnButton() {
binding.passwordList.setOnItemClickListener { _, _, position, _ ->
/*
TODO:
- A Null check & Throw explicit error for null values.
- Call this function every time on reinitialization of passwordAdapter.
- Make this Function idempotent.
*/
private fun addOnClickListenerOnButton() {
binding.passwordList.setOnItemClickListener { _, _, position, _ ->

Copy link
Member Author

Choose a reason for hiding this comment

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

Changes in this file are also unfamiliar to me...
I am still learning permissions as android beginner...

But accept this changes as this is not my code and also, app don't use this stuff!!

@JeelDobariya38 JeelDobariya38 marked this pull request as ready for review July 31, 2025 07:49
@JeelDobariya38 JeelDobariya38 merged commit 6f80203 into main Aug 1, 2025
@JeelDobariya38 JeelDobariya38 deleted the feat-package-migration-jeel-dev branch August 1, 2025 12:25
@JeelDobariya38 JeelDobariya38 changed the title Migration from com.passwordmanager to com.jeeldobariya.passcodes Migration: com.passwordmanager to com.jeeldobariya.passcodes Aug 15, 2025
@JeelDobariya38 JeelDobariya38 added the highlights highly impactful changes label Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request highlights highly impactful changes refactor refactor the code tests change tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migration from com.passwordmanager to com.jeeldobariya.passcodes

2 participants