beemdevelopment / Aegis

A free, secure and open source app for Android to manage your 2-step verification tokens.
https://getaegis.app
GNU General Public License v3.0
8.36k stars 354 forks source link

Cannot import backup #1380

Closed markusschloesser closed 1 month ago

markusschloesser commented 1 month ago

Version

3.0.1

Source

Google Play

Vault encryption

Yes (with biometric unlock)

Device

Samsung galaxy tab s7+

Android version

13

ROM

stock

Steps to reproduce

Try to import aegis vault from other device (tried with pixel 8 pro and Pixel 6 pro). Result identical if importing from first dialog or after initial setup. The vault was initially created on authenticatorPlus and from there exported to aegis

What do you expect to happen?

Successful import

What happens instead?

Aegis crashes every time Tried with all possible export formats

Log

Will do adb debug later and then attach EDIT: here it is debug.log

after running the relevant crash log lines thru chatgpt i looked at the permissions of the app, and there is no permissions to be given (only camera, but that doesn't seem relevant here). As I don't know much about android app development, I assume you're not interested in what chatgpt suggests doing?

alexbakker commented 1 month ago

Relevant exception from the 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 android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
    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: java.lang.SecurityException: com.samsung.android.providers.media has no access to content://media/external_primary/file/1000000036
    at android.os.Parcel.createExceptionOrNull(Parcel.java:3023)
    at android.os.Parcel.createException(Parcel.java:3007)
    at android.os.Parcel.readException(Parcel.java:2990)
    at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:190)
    at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:153)
    at android.content.ContentProviderProxy.openTypedAssetFile(ContentProviderNative.java:780)
    at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:2034)
    at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1849)
    at android.content.ContentResolver.openInputStream(ContentResolver.java:1525)
    at com.beemdevelopment.aegis.ui.tasks.PBKDFTask.doInBackground(SourceFile:515)
    at android.os.AsyncTask$3.call(AsyncTask.java:394)
    at java.util.concurrent.FutureTask.run(FutureTask.java:264)
    ... 4 more

The cause appears to be a misconfiguration (apparently common on some Samsung devices). A comment on Google's issue tracker suggests a fix you could try: https://issuetracker.google.com/issues/258270138#comment22

markusschloesser commented 1 month ago

Thanks for your reply! I managed to get it working 😊😊👍, though it wasn't "external storage" but either some other permission or me opening the Samsung file manager for the first time. Constructive question: can't this be caught with a manifest requesting the necessary permissions? So that aegis doesn't crash