Codebase cleanup - fix build warnings, dependency errors, and compatibility with latest Android Studio#44
Open
hcaldicott wants to merge 2 commits intoYlianst:mainfrom
Open
Codebase cleanup - fix build warnings, dependency errors, and compatibility with latest Android Studio#44hcaldicott wants to merge 2 commits intoYlianst:mainfrom
hcaldicott wants to merge 2 commits intoYlianst:mainfrom
Conversation
added 2 commits
December 18, 2025 17:03
This commit addresses several issues across the application, including dependency updates, code style modernization, and minor bug fixes. **Build & Dependencies:** - Updates the Gradle build scripts to use modern Groovy syntax with explicit assignment operators. - Bumps the versions of several dependencies, including `okhttp`, `code-scanner`, and various AndroidX and Firebase libraries, to resolve potential bugs and improve stability. - Updates the Gradle wrapper to a newer version more widely compatible with newer versions of Android Studio. - Fixes and updates several other dependencies. **Code Refinements:** - Removes redundant semicolons throughout the Kotlin files to adhere to modern code style conventions. - Replaces `var` with `val` for variables that are not reassigned, enhancing code immutability and safety. - Modernizes string and character handling by replacing `toUpperCase()` with the idiomatic `uppercase()`. - Unused parameters in lambdas and exception blocks are now correctly marked with an underscore (`_`). **Bug Fixes:** - Corrects a typo in the `invalid_server_pairing_link` string resource from "Linbk" to "Link". - Addresses a hardcoded string by moving "000000" into a new `zero_string` resource in `strings.xml`. - Suppresses a deprecation warning for the `vibrate()` method on older API levels to clean up build output. - Improves null safety by using a safe cast (`as?`) when retrieving the `Vibrator` system service.
This commit addresses several build warnings. **Build & Dependencies:** - Update onActivityResult to more modern implementation.
Author
|
N.B: This is a pre-req for the fun I'm having over here: https://github.com/hcaldicott/MeshCentralAndroidAgent/tree/remote-control I have 80% completed the implementation of android remote control :) |
|
Hello @hcaldicott , this is a brilliant initiative! I’m confident your work will help many people. Would it be possible for me to assist with any testing? |
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
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.
Hi team,
Submitting a PR here in preparation for some upcoming features I'm planning to implement. I've started working on an accessibility service and enhanced MDM configurability.
A lot of what I'll be implementing extends on the wonderful work by @manfred-mueller in #40, but I wanted to submit an initial PR to tidy up a lot of the warnings and other deprications being thrown when building prior to making any significant changes.
While I have done my best to test the agent since these changes, I would love other contributors to provide feedback as I only have a limited fleet of test devices.
Key Changes
Modernized build tooling & dependencies
code-scanner,dexter,okhttp, Firebase libraries) to keep the project aligned with current Android tooling.Refined Kotlin code style and resources
varusages for immutable values, and deprecatedtoUpperCase()calls with Kotlin idioms and added_markers for unused lambda parameters.invalid_server_pairing_linkand centralizing thezero_stringresource (which might be a little overkill, but hey)fragment_auth.xmlconstraints to remove hard-coded layout ties which were throwing errors and instead used parent references (this is one thing that might require more testing/feedback).Addressed build warnings and deprecated APIs
MainActivityplus shared handling for pending file-deletion approvals (this is the most significant code change).MeshAgent/MeshTunnel, improved null safety for sockets, and ensured notifications useNotificationCompat.ScreenCaptureServiceto use safer handler/parcelable handling andNotificationUtilsto avoid deprecated notification fields.Additional runtime tweaks
nullresources and outdated APIs (vibrator, camera, encryption helpers).I welcome feedback from the team!