TeamAmaze / TeamAmaze/AmazeFileManager
Crash upon connecting to FTP server
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 6.4k
- Forks
- 1.7k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 1
Description
Describe the bug
app crashes on connecting with ftp server
To Reproduce
Steps to reproduce the behavior:
- create ftp server on other device B amaze file manger
- select cloud connection on device A
- choose SCP/SFTP connection on A
- enter details and connect with server
- app crashes and produces the following error on A
Expected behavior
a successful FTP connection between A & B
Smartphone (please complete the following information):
- Device:MiPad (mocha)
- OS: 4.4
- Rooted: no
- Version: 3.8.4
Additional context
Issue explanation (write below this line)
Exception
- App Name: Amaze File Manager
- Package: com.amaze.filemanager
- Version: 3.8.4
- User Action: UI Error
- Request: Application crash
- OS: Linux Android 4.4.4 - 19
- Device: mocha
- Model: MI PAD
- Product: mocha
Crash log
java.lang.RuntimeException: error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long com.android.org.conscrypt.NativeCrypto.ENGINE_load_private_key(Native Method)
at com.android.org.conscrypt.OpenSSLEngine.getPrivateKeyById(OpenSSLEngine.java:66)
at android.security.AndroidKeyStore.engineGetKey(AndroidKeyStore.java:86)
at java.security.KeyStoreSpi.engineGetEntry(KeyStoreSpi.java:372)
at java.security.KeyStore.getEntry(KeyStore.java:644)
at com.amaze.filemanager.utils.security.SecretKeygen.encryptAESKey(SecretKeygen.kt:166)
at com.amaze.filemanager.utils.security.SecretKeygen.setKeyPreference(SecretKeygen.kt:153)
at com.amaze.filemanager.utils.security.SecretKeygen.getRsaSecretKey(SecretKeygen.kt:115)
at com.amaze.filemanager.utils.security.SecretKeygen.getSecretKey(SecretKeygen.kt:66)
at com.amaze.filemanager.utils.PasswordUtil.rsaEncryptPassword(PasswordUtil.kt:81)
at com.amaze.filemanager.utils.PasswordUtil.encryptPassword(PasswordUtil.kt:112)
at com.amaze.filemanager.utils.PasswordUtil.encryptPassword$default(PasswordUtil.kt:104)
at com.amaze.filemanager.utils.SmbUtil.getSmbEncryptedPath(SmbUtil.kt:82)
at com.amaze.filemanager.filesystem.ftp.NetCopyClientUtils.encryptFtpPathAsNecessary(NetCopyClientUtils.kt:115)
at com.amaze.filemanager.ui.dialogs.SftpConnectDialog.authenticateAndSaveSetup(SftpConnectDialog.kt:609)
at com.amaze.filemanager.ui.dialogs.SftpConnectDialog.authenticateAndSaveSetup$default(SftpConnectDialog.kt:603)
at com.amaze.filemanager.ui.dialogs.SftpConnectDialog.positiveButtonForFtp(SftpConnectDialog.kt:347)
at com.amaze.filemanager.ui.dialogs.SftpConnectDialog.handleOnPositiveButton$lambda-11(SftpConnectDialog.kt:339)
at com.amaze.filemanager.ui.dialogs.SftpConnectDialog.$r8$lambda$82hphGRYlLWtftUybxE6PGboOWc(SftpConnectDialog.kt)
at com.amaze.filemanager.ui.dialogs.SftpConnectDialog$$ExternalSyntheticLambda5.onClick(R8$$SyntheticClass)
at com.afollestad.materialdialogs.MaterialDialog.onClick(MaterialDialog.java:410)
at android.view.View.performClick(View.java:4444)
at android.view.View$PerformClick.run(View.java:18440)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5028)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:788)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:604)
at dalvik.system.NativeStart.main(Native Method)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with SftpConnectDialog.kt at authenticateAndSaveSetup and positiveButtonForFtp, then follow the stack trace through NetCopyClientUtils.kt, PasswordUtil.kt, and SecretKeygen.kt. Reproduce the FTP connection on the reported Android 4.4 device and trace the key-loading failure; done means the app no longer crashes and the FTP connection succeeds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile, networking, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100