Library upgrades and SDK 36 adaptation - #4710
Conversation
|
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
| fileLocation.path?.run { | ||
| val zipfile = ZipFile(fileLocation.path) | ||
| if (!zipfile.isValidZipFile || zipfile.file.length() == 0L) { | ||
| throw ZipException("Zero byte or corrupt zip file") |
There was a problem hiding this comment.
This smells, the exception is thrown and instantly recaught.
| } | ||
| } else { | ||
| if (zipfile.file.length() == 0L) { | ||
| throw ZipException("Zero byte or corrupt zip file") |
There was a problem hiding this comment.
A very similar exception is already thrown two lines below.
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
This inverts the condition? From not null to null.
There was a problem hiding this comment.
Yes, because RAR v5 is now supported, there should be no error toast pop up.
|
Remember this PR needs to be remerged to release/4.0 after it is merged to hotfix. |
d702dd8 to
52178a7
Compare
- 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
52178a7 to
ff84ca6
Compare
| <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> |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
This smells, the exception is thrown and instantly recaught.
- Refactorings to ZipHelperCallable for better exception logic
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:
Automatic tests
Manual tests
Done
Device:
OS:
Build tasks success
Successfully running following tasks on local:
./gradlew assembledebug./gradlew spotlessCheckGenerative code
AI was stepped in on solving issues with Robolectric unit tests.