Skip to content

Conversation

@mzorz
Copy link
Contributor

@mzorz mzorz commented Aug 1, 2025

Note: this PR sits on top of #1731

Fix

This app was not being consistently maintained so I had to bring a lot of libraries up to date and do some changes to make it all work as expected (also fixes a couple crashes, one of them listed here from the previous PR)

Test

Smoke test the app, create entires, verify they sync on another platform, check against the production app.

Review

@ParaskP7

Release

Maintenance update - support for Android 15

mzorz added 4 commits July 30, 2025 22:11
…d context instead of baseContext. Also making sure to call the right styles on manifest
…lled in super() instantiation before the mTokenizer variable is instantiated
@mzorz mzorz added this to the Future milestone Aug 1, 2025
@mzorz mzorz added [Type] Debt Technical debt. dependencies Pull requests that update a dependency file Core labels Aug 1, 2025
@dangermattic
Copy link
Collaborator

dangermattic commented Aug 1, 2025

2 Warnings
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Aug 1, 2025

📲 You can test the changes from this Pull Request in Simplenote Android by scanning the QR code below to install the corresponding build.

App Name Simplenote Android
Build TypeDebug
Commit0448e63
Direct Downloadsimplenote-android-prototype-build-pr1733-0448e63-01987a4d-757d-403b-ad99-dddad3c174e0.apk

mzorz added 6 commits August 1, 2025 18:39
- upgraded AGP (android gradle plugin)
- updated all test dependencies, mockito, androidx.test
- updated a test using an old syntax that would make the build fail
- bumped compileSdk to 36
- handling onBackPressed overrides calling superclass in NoteEditorActivity and NewCredentialsActivity
protected InputFilter[] filters = null;
protected TextView topMessage = null;

@SuppressLint("RestrictedApi")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this to avoid linter complaining for now, but tracking separately here #1734

  - Issue: 11 unit tests were failing on CI (Buildkite) with java.lang.ClassNotFoundException: org.wordpress.passcodelock.AbstractAppLock
  - Root Cause: CI was running testRelease which enables ProGuard/R8 minification, while local tests run in debug mode without minification
  - Specific Problem: All failing tests used AnalyticsTracker.track() which triggered instantiation of SimplenoteAppLock → DefaultAppLock → AbstractAppLock, but R8 was stripping the PasscodeLock classes
releaseTest {
initWith release
minifyEnabled false
shrinkResources false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

had to create a different task to run tests on Release with minify disabled, since otherwise there was a ClassDefNotFound error on the AbstractAppLock class, and R8 was stripping the PasscodeLock classes. Kudos to Claude Code for helping me out on this one, see 8c792b4

@mzorz mzorz marked this pull request as ready for review August 3, 2025 11:46
@mzorz mzorz requested a review from ParaskP7 August 3, 2025 11:46
Base automatically changed from deps/update-automattic-tracks-to-6.0.4 to trunk August 4, 2025 07:38
@ParaskP7 ParaskP7 requested a review from Copilot August 4, 2025 07:45
Copy link
Contributor

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 updates the Simplenote Android app's dependencies and fixes crashes, with the primary goal of supporting Android 15. Key changes include upgrading Gradle to 8.14.3, updating Android target SDK to 36, modernizing dependencies, and fixing various compatibility issues.

  • Updates Gradle wrapper and build configurations for Android 15 support
  • Modernizes dependencies including AndroidX libraries, testing frameworks, and other third-party libraries
  • Fixes UI compatibility issues by replacing deprecated android:tint with app:tint

Reviewed Changes

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

Show a summary per file
File Description
gradlew.bat, gradlew Updated Gradle wrapper scripts with improved error handling and latest template
gradle/wrapper/gradle-wrapper.properties Upgraded Gradle to version 8.14.3
Wear/build.gradle Updated Wear module dependencies and compile SDK
Simplenote/build.gradle Major dependency updates and Java 11 migration
PasscodeLock module Updated dependencies and added compatibility annotations
Layout XML files Replaced deprecated android:tint with app:tint
Java/Kotlin source files Fixed crashes and deprecated API usage
Comments suppressed due to low confidence (1)

Simplenote/src/test/java/com/automattic/simplenote/viewmodels/CollaboratorsViewModelTest.kt:166

  • This test assertion may not properly verify the intended behavior. The test should verify that the UI state remains unchanged when listening is stopped, but the current assertion compares against an initial state that may not represent the expected final state.
        assertEquals(initialState, viewModel.uiState.value)

@ParaskP7
Copy link
Contributor

ParaskP7 commented Aug 4, 2025

👋 @mzorz and just an FYI on my part that I started with reviewing this change today, but I didn't manage to finish with it. I'll continue tomorrow. ⏳

PS: In the meanwhile I am not sure if my review should be enough here, lots of changes and lots of library updates. On the other hand, it might be okay if we move faster (than usual) and only do a final check right at the end, when we're done with all the changes. What we want is to at least know that next time we'll need to release an update, we should be set. Wdyt? 🤔

@mzorz
Copy link
Contributor Author

mzorz commented Aug 4, 2025

PS: In the meanwhile I am not sure if my review should be enough here, lots of changes and lots of library updates. On the other hand, it might be okay if we move faster (than usual) and only do a final check right at the end, when we're done with all the changes. What we want is to at least know that next time we'll need to release an update, we should be set. Wdyt? 🤔

I'm fine either way, the main reason I split the PRs and asked for your review in this one is because this PR updates libraries and fixes crashes on the base PR (the one you wrote). The actual functional changes are on the other PRS (targeting SDK 35 plus changing the cwac:anddown library which is not 16kb-page-size compatible).

If you don't spot anything weird on this PR, this one should be good to go (since the PR we merged actually crashes the app anyway, this would be already putting things in a better place). 😅

I'll have someone else review and smoke test the rest of the changes too 👍

@ParaskP7
Copy link
Contributor

ParaskP7 commented Aug 5, 2025

👋 @mzorz and I am on it! 🏃 💨 💨 💨

I'm fine either way, the main reason I split the PRs and asked for your review in this one is because this PR updates libraries and fixes crashes on the base PR (the one you wrote). The actual functional changes are on the other PRS (targeting SDK 35 plus changing the cwac:anddown library which is not 16kb-page-size compatible).

Got it! 👍

If you don't spot anything weird on this PR, this one should be good to go (since the PR we merged actually crashes the app anyway, this would be already putting things in a better place). 😅

True... 😅

I'll have someone else review and smoke test the rest of the changes too 👍

Awesome, thanks! 🙇

Copy link
Contributor

@ParaskP7 ParaskP7 left a comment

Choose a reason for hiding this comment

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

👋 @mzorz !

I have reviewed and tested this PR as per the instructions, great job updating all these dependencies! 🌟 x 🌟 ^ 🌟


I have left a couple of warnings (⚠️), one question (❓), a few suggestions (💡) and some minor (🔍) comments for you to consider. I am NOT going to approve this PR just yet, mainly because of this one CI related warning (⚠️), but other than that I think this is good to go, we can keep iterating on modernizing this codebase on subsequent PRs.


private fun handlePasswordReset(uri: Uri) {
val redirectParam = uri.getQueryParameter("redirect")
if (redirectParam == "simplenote://launch") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Question (❓): The logic within both if/else seems the same to me, what that done on purpose? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oof good catch, fixed in 2589709 - it should just launch the app when capturing a password reset link and the app is installed (this to do the same thing it was doing before, no behavior change)

Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome, thanks for the fix @mzorz , so in the end, no query parameters no nothing needed here, right? 😊

@ParaskP7
Copy link
Contributor

ParaskP7 commented Aug 5, 2025

FYI: I was able to reproduce this exact problem while testing this PR, but only did it once, then I just couldn't any more... 🤷

@mzorz
Copy link
Contributor Author

mzorz commented Aug 5, 2025

Thanks a lot for all this feedback @ParaskP7 ! 🙌 really appreciated.

FYI: I was able to reproduce #1737 (comment) while testing this PR, but only did it once, then I just couldn't any more... 🤷

Thanks for flagging - all of that is being addressed either on the PR changing to targetSdk 35 or later on but on top of that PR.

Just so we're on the same page: for this PR, I concentrated on:

  • upgrading the libraries to latest (not the target SDK)
  • making sure what exists doesn't crash

This PR is already large enough with that aim (upgrading the libraries versions and updating code to match behavior changes only).

So, I fixed some of the comments that were related to the changes above, but all further suggestions I think are better to be handled in separate PRs.

Warning (⚠️): In addition to having unit test working, let's consider having instrumented tests working as well, in this or another follow-up PR (if not too much of a trouble).

Thanks for the pointers here! Also for instrumented tests, I agree it'd be nice to bring them back to life, yet it exceeds the aim of updating the libraries only. I also can imagine integrated tests will change after the changes we're making due to the edge-to-edge UI changes by targeting SDK 35, so let's keep that task isolated for the time being.

I think the only really blocking thing in this PR should be this. Let's continue the discussion there 👍

@ParaskP7
Copy link
Contributor

ParaskP7 commented Aug 5, 2025

💯 @mzorz and I agree with all that you said above, thank you so much for applying all and any of my suggestions! 🙇

FYI: I've resolved all comments but did left the ones we chose to differ as unresolved, just to make it more visible going forward, when and if we decide to do something about them. 🤞

I think the only really blocking thing in this PR should be #1733 (comment). Let's continue the discussion there 👍

Yes, let's do that and then merge this! 🚀

@ParaskP7 ParaskP7 self-requested a review August 5, 2025 13:02
@mzorz
Copy link
Contributor Author

mzorz commented Aug 5, 2025

Thanks once more for you thorough review @ParaskP7 ! We'll take over the things that were left unresolved in subsequent PRs as agreed 🙌

@mzorz mzorz merged commit b790a26 into trunk Aug 5, 2025
15 checks passed
@mzorz mzorz deleted the mzorz/update-compose-android-and-kotlin-libs branch August 5, 2025 15:04
@mzorz mzorz mentioned this pull request Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Core dependencies Pull requests that update a dependency file [Type] Debt Technical debt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants