Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK 34 adaptations #4215

Open
wants to merge 4 commits into
base: release/4.0
Choose a base branch
from

Conversation

TranceLove
Copy link
Collaborator

Description

On Google Play store's requirements. Inevitably support for Kitkats must be dropped.

  • Minimum version requirement set to LOLLIPOP, required after SDK upgrade and future Billing library upgrade to 7.0.0 as well
  • Compile with JDK 17, for future compatibility with sardine-android (WebDAV browsing (and uploading?) support. #376)
  • Code adaptations to remove switch cases to resource IDs, as mandated since Gradle 8.0
  • Fix import of resource IDs from library level resources
  • Fix bad programming habits in test cases

Automatic tests

  • Added test cases

Manual tests

  • Done

Build tasks success

Successfully running following tasks on local:

  • ./gradlew assembledebug
  • ./gradlew spotlessCheck

@TranceLove
Copy link
Collaborator Author

TranceLove commented Jul 8, 2024

Pending tasks:

  • Fix Jacoco report stopped working - currently stub task only
  • Test on devices

@Bambooin
Copy link
Contributor

Bambooin commented Jul 9, 2024

Found one issue during local build(./gradlew assembleFdroidRelease).

> Task :app:minifyFdroidReleaseWithR8 FAILED
ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in ~/github/amaze/app/build/outputs/mapping/fdroidRelease/missing_rules.txt.
ERROR: R8: Missing class com.amaze.filemanager.fileoperations.exceptions.CloudPluginException (referenced from: androidx.core.util.Pair com.amaze.filemanager.asynchronous.asynctasks.LoadFilesListTask.doInBackground(java.lang.Void[]) and 7 other contexts)
Missing class com.amaze.filemanager.fileoperations.exceptions.ShellNotRunningException (referenced from: void com.amaze.filemanager.application.AppConfig.lambda$getTrashBinInstance$2(java.lang.String) and 11 other contexts)
Missing class com.amaze.filemanager.fileoperations.exceptions.StreamNotFoundException (referenced from: void com.amaze.filemanager.asynchronous.asynctasks.texteditor.read.ReadTextFileTask.onError(java.lang.Throwable) and 2 other contexts)
Missing class com.amaze.filemanager.fileoperations.filesystem.FolderState (referenced from: java.lang.Integer com.amaze.filemanager.filesystem.ftp.NetCopyClientUtils$checkFolder$template$1.execute(net.schmizz.sshj.sftp.SFTPClient) and 3 other contexts)
Missing class com.amaze.filemanager.fileoperations.filesystem.OpenMode (referenced from: com.amaze.filemanager.fileoperations.filesystem.OpenMode com.amaze.filemanager.adapters.data.LayoutElementParcelable.mode and 208 other contexts)
Missing class com.amaze.filemanager.fileoperations.filesystem.StorageNaming$DeviceDescription (referenced from: java.lang.String com.amaze.filemanager.ui.strings.StorageNamingHelper.getNameForDeviceDescription(android.content.Context, java.io.File, int))
Missing class com.amaze.filemanager.fileoperations.filesystem.StorageNaming (referenced from: java.util.ArrayList com.amaze.filemanager.ui.activities.MainActivity.getStorageDirectoriesLegacy())
Missing class com.amaze.filemanager.fileoperations.filesystem.cloud.CloudStreamer (referenced from: com.amaze.filemanager.fileoperations.filesystem.cloud.CloudStreamer com.amaze.filemanager.filesystem.ssh.SshClientUtils$launchFtp$1.$streamer and 5 other contexts)
Missing class com.amaze.filemanager.fileoperations.filesystem.compressed.ArchivePasswordCache (referenced from: void com.amaze.filemanager.asynchronous.asynctasks.compress.SevenZipHelperCallable.addElements(java.util.ArrayList) and 9 other contexts)
Missing class com.amaze.filemanager.fileoperations.filesystem.root.NativeOperations (referenced from: boolean com.amaze.filemanager.filesystem.HybridFile.isDirectory(android.content.Context) and 1 other context)
Missing class com.amaze.filemanager.fileoperations.filesystem.smbstreamer.Streamer (referenced from: com.amaze.filemanager.fileoperations.filesystem.smbstreamer.Streamer com.amaze.filemanager.filesystem.files.FileUtils$5.val$s and 3 other contexts)
Missing class com.amaze.filemanager.fileoperations.filesystem.usb.SingletonUsbOtg (referenced from: void com.amaze.filemanager.ui.activities.MainActivity$2.onReceive(android.content.Context, android.content.Intent) and 8 other contexts)
Missing class com.amaze.filemanager.fileoperations.filesystem.usb.UsbOtgRepresentation (referenced from: void com.amaze.filemanager.ui.activities.MainActivity$2.onReceive(android.content.Context, android.content.Intent) and 2 other contexts)
Missing class com.amaze.filemanager.fileoperations.utils.OnLowMemory (referenced from: void com.amaze.filemanager.asynchronous.services.CopyService$DoInBackground$Copy.copyFiles(com.amaze.filemanager.filesystem.HybridFileParcelable, com.amaze.filemanager.filesystem.HybridFile, com.amaze.filemanager.utils.ProgressHandler) and 2 other contexts)
Missing class com.amaze.filemanager.fileoperations.utils.UpdatePosition (referenced from: com.amaze.filemanager.fileoperations.utils.UpdatePosition com.amaze.filemanager.asynchronous.management.ServiceWatcherUtil.UPDATE_POSITION and 27 other contexts)
Missing class com.amaze.filemanager.filesystem.compressed.sevenz.SevenZArchiveEntry (referenced from: void com.amaze.filemanager.asynchronous.asynctasks.compress.SevenZipHelperCallable.addElements(java.util.ArrayList) and 2 other contexts)
Missing class com.amaze.filemanager.filesystem.compressed.sevenz.SevenZFile (referenced from: void com.amaze.filemanager.asynchronous.asynctasks.compress.SevenZipHelperCallable.addElements(java.util.ArrayList) and 2 other contexts)
Missing class org.bouncycastle.asn1.ASN1ApplicationSpecific (referenced from: void jcifs.spnego.NegTokenInit.parse(byte[]))
Missing class org.bouncycastle.asn1.DERApplicationSpecific (referenced from: byte[] jcifs.spnego.NegTokenInit.toByteArray())
Missing class org.bouncycastle.jsse.BCSSLParameters (referenced from: void okhttp3.internal.platform.BouncyCastlePlatform.configureTlsExtensions(javax.net.ssl.SSLSocket, java.lang.String, java.util.List) and 1 other context)
Missing class org.bouncycastle.jsse.BCSSLSocket (referenced from: void okhttp3.internal.platform.BouncyCastlePlatform.configureTlsExtensions(javax.net.ssl.SSLSocket, java.lang.String, java.util.List) and 5 other contexts)
Missing class org.bouncycastle.jsse.provider.BouncyCastleJsseProvider (referenced from: void okhttp3.internal.platform.BouncyCastlePlatform.<init>())
Missing class org.conscrypt.Conscrypt$Version (referenced from: boolean okhttp3.internal.platform.ConscryptPlatform$Companion.atLeastVersion(int, int, int))
Missing class org.conscrypt.Conscrypt (referenced from: boolean okhttp3.internal.platform.ConscryptPlatform$Companion.atLeastVersion(int, int, int) and 4 other contexts)
Missing class org.conscrypt.ConscryptHostnameVerifier (referenced from: okhttp3.internal.platform.ConscryptPlatform$DisabledHostnameVerifier)
Missing class org.openjsse.javax.net.ssl.SSLParameters (referenced from: void okhttp3.internal.platform.OpenJSSEPlatform.configureTlsExtensions(javax.net.ssl.SSLSocket, java.lang.String, java.util.List))
Missing class org.openjsse.javax.net.ssl.SSLSocket (referenced from: void okhttp3.internal.platform.OpenJSSEPlatform.configureTlsExtensions(javax.net.ssl.SSLSocket, java.lang.String, java.util.List) and 1 other context)
Missing class org.openjsse.net.ssl.OpenJSSE (referenced from: void okhttp3.internal.platform.OpenJSSEPlatform.<init>())
Missing class sun.security.x509.X509Key (referenced from: void net.i2p.crypto.eddsa.EdDSAEngine.engineInitVerify(java.security.PublicKey))

FAILURE: Build failed with an exception.

So I disable minifyEnabled and the build passed, but the Amaze crashes with NoClassDefFoundError in Android 13.

@TranceLove
Copy link
Collaborator Author

@Bambooin right, the minify rule. Added them back - although some can indeed just put dontwarn and skip them - either they're not used or should be available at system level. 🤔

@TranceLove TranceLove force-pushed the feature/sdk34 branch 4 times, most recently from 0350790 to 68df2d2 Compare July 11, 2024 15:29
@TranceLove
Copy link
Collaborator Author

TranceLove commented Jul 11, 2024

With gradlew clean spotlessApply spotlessCheck jacocoTestPlayReleaseUnitTestReport some other classes, especially at file_operations module are seen missing, failing unit tests.

Probably related to proguard rule at file_operations module IMO. Wild guess, still looking into it...

@TranceLove TranceLove force-pushed the feature/sdk34 branch 3 times, most recently from 01b96d6 to 4194638 Compare July 16, 2024 15:47
@TranceLove TranceLove marked this pull request as ready for review August 3, 2024 10:47
- build.gradle upgrades
- Code adaptations to remove switch cases to resource IDs
- Fix import of resource IDs from library level resources
- Minimum version requirement set to LOLLIPOP
@TranceLove
Copy link
Collaborator Author

build test apk

VishalNehra
VishalNehra previously approved these changes Oct 8, 2024
@VishalNehra
Copy link
Member

getting following error at application startup
Caused by: java.lang.SecurityException: com.amaze.filemanager.debug: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts at android.os.Parcel.createExceptionOrNull(Parcel.java:3087) at android.os.Parcel.createException(Parcel.java:3071) at android.os.Parcel.readException(Parcel.java:3054) at android.os.Parcel.readException(Parcel.java:2996) at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:5684) at java.lang.reflect.Method.invoke(Native Method) at leakcanary.ServiceWatcher$install$4$2.invoke(ServiceWatcher.kt:85) at java.lang.reflect.Proxy.invoke(Proxy.java:1006) at $Proxy8.registerReceiverWithFeature(Unknown Source) at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1868) at android.app.ContextImpl.registerReceiver(ContextImpl.java:1804) at android.app.ContextImpl.registerReceiver(ContextImpl.java:1792) at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:765) at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:765) at com.amaze.filemanager.ui.activities.MainActivity.onResume(MainActivity.java:1366) at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1622)

- Fix Context.registerReceiver() on newer Androids
- Quirks to work around problems with ContextCompat.registerReceiver() at Robolectric tests
- Remove CMake version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants