Skip to content

Library upgrades and SDK 36 adaptation - #4710

Open
TranceLove wants to merge 7 commits into
TeamAmaze:hotfix/3.11.3from
TranceLove:feature/lib-minor-upgrades
Open

Library upgrades and SDK 36 adaptation#4710
TranceLove wants to merge 7 commits into
TeamAmaze:hotfix/3.11.3from
TranceLove:feature/lib-minor-upgrades

Conversation

@TranceLove

@TranceLove TranceLove commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Description

Library upgrades and SDK 36 adaptation, to stay with Google Play compliance.

Important: with this PR onward Amaze File Manager will require Android M (6.0) or above.

Changes:

  • Require JDK 21 to build
  • Added Jetifier ignore list. In addition to speed up build time by reducing jars to process, also helped Robolectric tests to pass after library upgrades
  • Upgraded libraries to latest possible version with least changes to codebase as possible
    • Gradle: 8.14.5
    • Kotlin: 2.2.20
    • Android Gradle Plugin: 8.13.2
    • Spotless: 8.9.0
    • AndroidX core: 1.16.0
    • AndroidX fragment: 1.8.9
    • AndroidX appcompat: 1.7.1
    • AndroidX annotation: 1.10.0
    • AndroidX constraint layout: 2.2.2
    • sshj: 0.40.0
    • Bouncy castle: 1.85
    • slf4j: 2.0.19
    • junrar: 8.1.1
    • xz: 1.12
    • zip4j: 2.11.6
    • logback-classic: 1.6.1
    • jsoup: 1.23.1
    • gson: 2.14.0
    • rxjava: 2.2.21
    • acra-core: 5.13.1
    • leak-canary-android: 2.14
    • okHttp: 5.1.0
    • commons-net: 3.13.0
    • kotlin-stdlib-jdk8: 2.2.10
    • espresso: 3.7.0
    • AndroidX Test: 1.7.0
    • AndroidX Test extension: 1.3.0
    • kotlin-coroutine-test: 1.11.0
    • UI automator: 2.4.0
    • mockito: 5.23.0
    • mockk: 1.14.11
    • systembartint: 1.0.4
    • awaitility: 4.3.0
    • glide: 5.0.5
    • apache-mina: 2.2.9
    • apache-sshd: 2.19.0
    • apache-ftpserver: 1.2.1
    • robolectric: 4.16.1
    • glide: 5.0.7
    • Google Play Billing: 9.1.0
  • With junrar upgrade, enabled support of newer RAR archives, up to v7
  • Fixed test cases with library upgrades

Automatic tests

  • Added unit tests for specific individual functions
  • Added headless tests for new app functionality
  • Added emulator tests for new UI elements

Manual tests

  • Done

  • Device:

  • OS:

Build tasks success

Successfully running following tasks on local:

  • ./gradlew assembledebug
  • ./gradlew spotlessCheck

Generative code

  • This PR used generative code tools (GenAI, LLMs, etc.)

AI was stepped in on solving issues with Robolectric unit tests.

  • Model: GPT Codex
  • Version: 5.3
  • Provider: Github Copilot

@TranceLove

Copy link
Copy Markdown
Collaborator Author

Pending: smoke test

Build passed and test passed, but app itself is not tested yet :(

For easing the effort on migrating to SDK 36.

Upgraded:
- Gradle: 8.14.5
- Kotlin: 2.2.20
- JDK: 21
- Android Gradle Plugin: 8.13.2
- Spotless: 8.9.0
- AndroidX core: 1.16.0
- AndroidX fragment: 1.8.9
- AndroidX appcompat: 1.7.1
- AndroidX annotation: 1.10.0
- AndroidX constraint layout: 2.2.2
- sshj: 0.40.0
- Bouncy castle: 1.85
- slf4j: 2.0.18
- junrar: 8.1.0, also enables support of RARv5
- xz: 1.12
- zip4j: 2.11.6
- logback-classic: 1.6.1
- jsoup: 1.23.1
- gson: 2.14.0
- rxjava: 2.2.21
- acra-core: 5.13.1
- leak-canary-android: 2.14
- okHttp: 5.1.0
- commons-net: 3.13.0
- kotlin-stdlib-jdk8: 2.2.10
- espresso: 3.7.0
- AndroidX Test: 1.7.0
- AndroidX Test extension: 1.3.0
- kotlin-coroutine-test: 1.11.0
- UI automator: 2.4.0
- mockito: 5.23.0
- mockk: 1.14.11
- systembartint: 1.0.4
- awaitility: 4.3.0
- glide: 5.0.5
- apache-mina: 2.2.9
- apache-sshd: 2.19.0
- apache-ftpserver: 1.2.1
- robolectric: 4.15
Also add bytebuddy to jetifier ignore list
For preparation to Robolectric 4.16
Also upgraded libraries:

- Robolectric: 4.16.1
- Glide: 5.0.7
- Bouncy Castle 1.85.2
- Google Play Android Billing: 9.1.0
Per recommendation for proper source management
@TranceLove
TranceLove requested review from EmmanuelMess and VishnuSanal and removed request for EmmanuelMess September 3, 2026 15:18
@TranceLove
TranceLove marked this pull request as ready for review September 3, 2026 15:18
fileLocation.path?.run {
val zipfile = ZipFile(fileLocation.path)
if (!zipfile.isValidZipFile || zipfile.file.length() == 0L) {
throw ZipException("Zero byte or corrupt zip file")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This smells, the exception is thrown and instantly recaught.

}
} else {
if (zipfile.file.length() == 0L) {
throw ZipException("Zero byte or corrupt zip file")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A very similar exception is already thrown two lines below.

@TranceLove TranceLove Sep 5, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The 2 exceptions handles 2 conditions:

  • Line 81 handles empty zero byte files that pose themselves as zip files
  • Line 83 handles non-zero bytes files that is zip files which have zero entry

.until {
ShadowToast.getLatestToast() != null
}
assertNull(ShadowToast.getLatestToast())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This inverts the condition? From not null to null.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, because RAR v5 is now supported, there should be no error toast pop up.

@EmmanuelMess EmmanuelMess added the PR-Requested-Changes this PR is awaiting an update from the author label Sep 4, 2026
@EmmanuelMess

Copy link
Copy Markdown
Member

Remember this PR needs to be remerged to release/4.0 after it is merged to hotfix.

@TranceLove
TranceLove force-pushed the feature/lib-minor-upgrades branch from d702dd8 to 52178a7 Compare September 5, 2026 03:40
- ZipHelperCallable throws ArchiveException right away upon processing zero byte zips
- i18n string name update: error_unsupported_v5_rar -> error_unsupported_rar_version
- bump slf4j and junrar dependencies
@TranceLove
TranceLove force-pushed the feature/lib-minor-upgrades branch from 52178a7 to ff84ca6 Compare September 5, 2026 03:54
<string name="legacy_listing_title">Use legacy listing for root</string>
<string name="legacy_listing_summary">If enabled, uses legacy method to list files</string>
<string name="error_unsupported_v5_rar">RAR archive \"%s\" is unsupported RAR v5 archive.</string>
<string name="error_unsupported_rar_version">RAR archive \"%s\" is an unsupported RAR archive.</string>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Don't change the id, delete the old one and create a new one. This is to prevent users from seeing the wrong string on other languages and for translators to easily identify strings that changed in content.

try {
fileLocation.path?.run {
val zipfile = ZipFile(fileLocation.path)
if (!zipfile.isValidZipFile || zipfile.file.length() == 0L) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This smells, the exception is thrown and instantly recaught.

- Refactorings to ZipHelperCallable for better exception logic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR-Requested-Changes this PR is awaiting an update from the author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants