TeamAmaze / TeamAmaze/AmazeFileManager

Better wrong password handling

Open
#4,353 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-SMB Issue-Bug Issue-Easy (good first issue)
Dominant language
Kotlin
Stars
6.4k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
1

Description

Describe the bug
New phone. Old Amaze Smb connection copies without password / left empty. Connection attempt crashed Amaze.

To Reproduce
Steps to reproduce the behavior:

  1. Create a working SMB connection.
  2. Sync apps and settings to a new phone.
  3. Connect to SMB will crash because password did not copy over
  4. See error

Expected behavior
If password is empty or incorrect, do not crash but print an error message that does not fade away in a bubble.

Screenshots

Smartphone (please complete the following information):
Google Pixel 9, fully updated.

Additional context

Issue explanation (write below this line)

Exception

  • App Name: Amaze File Manager
  • Package: com.amaze.filemanager
  • Version: 3.10
  • User Action: UI Error
  • Request: Application crash
  • OS: Linux Android 15 - 35
  • Device: tokay
  • Model: Pixel 9
  • Product: tokay
Crash log

java.lang.RuntimeException: An error occurred while executing doInBackground()
	at android.os.AsyncTask$4.done(AsyncTask.java:415)
	at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:381)
	at java.util.concurrent.FutureTask.setException(FutureTask.java:250)
	at java.util.concurrent.FutureTask.run(FutureTask.java:269)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
	at java.lang.Thread.run(Thread.java:1012)
Caused by: javax.crypto.AEADBadTagException
	at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:632)
	at javax.crypto.Cipher.doFinal(Cipher.java:2074)
	at com.amaze.filemanager.utils.PasswordUtil.aesDecryptPassword(PasswordUtil.kt:65)
	at com.amaze.filemanager.utils.PasswordUtil.decryptPassword(PasswordUtil.kt:124)
	at com.amaze.filemanager.utils.PasswordUtil.decryptPassword$default(PasswordUtil.kt:118)
	at com.amaze.filemanager.utils.smb.SmbUtil$getSmbDecryptedPath$1.invoke(SmbUtil.kt:60)
	at com.amaze.filemanager.utils.smb.SmbUtil$getSmbDecryptedPath$1.invoke(SmbUtil.kt:59)
	at com.amaze.filemanager.utils.smb.SmbUtil.buildPath(SmbUtil.kt:85)
	at com.amaze.filemanager.utils.smb.SmbUtil.getSmbDecryptedPath(SmbUtil.kt:59)
	at com.amaze.filemanager.utils.smb.SmbUtil.create(SmbUtil.kt:105)
	at com.amaze.filemanager.filesystem.HybridFile.getSmbFile(HybridFile.java:510)
	at com.amaze.filemanager.asynchronous.asynctasks.LoadFilesListTask.listSmb(LoadFilesListTask.java:683)
	at com.amaze.filemanager.asynchronous.asynctasks.LoadFilesListTask.doInBackground(LoadFilesListTask.java:162)
	at com.amaze.filemanager.asynchronous.asynctasks.LoadFilesListTask.doInBackground(LoadFilesListTask.java:91)
	at android.os.AsyncTask$3.call(AsyncTask.java:394)
	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
	... 3 more
Caused by: android.security.KeyStoreException: Signature/MAC verification failed (internal Keystore code: -30 message: system/security/keystore2/src/operation.rs:848: KeystoreOperation::finish

Caused by:
    0: system/security/keystore2/src/operation.rs:429: Finish failed.
    1: Error::Km(r#VERIFICATION_FAILED)) (public error code: 10 internal Keystore code: -30)
	at android.security.KeyStore2.getKeyStoreException(KeyStore2.java:416)
	at android.security.KeyStoreOperation.handleExceptions(KeyStoreOperation.java:79)
	at android.security.KeyStoreOperation.finish(KeyStoreOperation.java:132)
	at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer$MainDataStream.finish(KeyStoreCryptoOperationChunkedStreamer.java:228)
	at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:181)
	at android.security.keystore2.AndroidKeyStoreAuthenticatedAESCipherSpi$BufferAllOutputUntilDoFinalStreamer.doFinal(AndroidKeyStoreAuthenticatedAESCipherSpi.java:396)
	at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:624)
	... 18 more


Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the decryption failure from PasswordUtil.kt:65 and :124 through SmbUtil.kt:60, :85, and :105 into LoadFilesListTask.java:683. Reproduce the empty or invalid-password SMB connection, then verify that it reports a persistent error instead of crashing or showing only a fading bubble.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.