Keepassdx: Crash on autofill with classic icons pack

Created on 15 Apr 2020  路  3Comments  路  Source: Kunzisoft/KeePassDX

Describe the bug
While creating a sample database for #519 I encountered this crash in the autofill user flow.

To Reproduce

  1. Install KeePassDX, enable autofill service
  2. Select Classic Icon pack
  3. Go to https://ethz.ch/login/en.html
  4. Click on Sign in with KeePassDX
  5. Select test database
  6. Enter password
  7. See linear progress indicator opening database
  8. CRASH!

Expected behavior
Autofill suggests successfully.

Keepass Database

  • Created with: KeePassXC 2.5.4
  • Location: local filesystem
  • Size: <10 KBs
  • Contains attachment: no

KeePassDX (please complete the following information):

  • Version: 2.5RC1
  • Build: F-Droid
  • Language: English

Device:

  • Device: OnePlus 5
  • Version: Lineage 16

Additional context
Add any other context about the problem here.

  • Browser for Autofill: Fennec 68.7.0

Logcat:

FATAL EXCEPTION: main
Process: com.kunzisoft.keepass.libre, PID: 29114
java.lang.IllegalStateException: Immutable bitmap passed to Canvas constructor
    at android.graphics.Canvas.<init>(Canvas.java:115)
    at com.kunzisoft.keepass.icons.IconDrawableFactory.assignDrawableToRemoteViews(IconDrawableFactory.kt:83)
    at com.kunzisoft.keepass.icons.IconDrawableFactoryKt.assignDatabaseIcon(IconDrawableFactory.kt:289)
    at com.kunzisoft.keepass.autofill.AutofillHelper.newRemoteViews(AutofillHelper.kt:218)
    at com.kunzisoft.keepass.autofill.AutofillHelper.buildDataset$app_libreRelease(AutofillHelper.kt:95)
    at com.kunzisoft.keepass.autofill.AutofillHelper.buildResponse(AutofillHelper.kt:133)
    at com.kunzisoft.keepass.activities.PasswordActivity$launchGroupActivity$3$1.invoke(PasswordActivity.kt:277)
    at com.kunzisoft.keepass.activities.PasswordActivity$launchGroupActivity$3$1.invoke(PasswordActivity.kt:75)
    at com.kunzisoft.keepass.autofill.AutofillHelper.checkAutoSearchInfo(AutofillHelper.kt:169)
    at com.kunzisoft.keepass.activities.PasswordActivity$launchGroupActivity$3.invoke(PasswordActivity.kt:272)
    at com.kunzisoft.keepass.activities.PasswordActivity$launchGroupActivity$3.invoke(PasswordActivity.kt:75)
    at com.kunzisoft.keepass.activities.helpers.EntrySelectionHelper.doEntrySelectionAction(EntrySelectionHelper.kt:58)
    at com.kunzisoft.keepass.activities.PasswordActivity.launchGroupActivity(PasswordActivity.kt:258)
    at com.kunzisoft.keepass.activities.PasswordActivity.access$launchGroupActivity(PasswordActivity.kt:75)
    at com.kunzisoft.keepass.activities.PasswordActivity$onCreate$$inlined$apply$lambda$1.invoke(PasswordActivity.kt:184)
    at com.kunzisoft.keepass.activities.PasswordActivity$onCreate$$inlined$apply$lambda$1.invoke(PasswordActivity.kt:75)
    at com.kunzisoft.keepass.database.action.ProgressDialogThread$actionTaskListener$1.onStopAction(ProgressDialogThread.kt:105)
    at com.kunzisoft.keepass.notifications.DatabaseTaskNotificationService$onStartCommand$$inlined$let$lambda$2.invoke(DatabaseTaskNotificationService.kt:174)
    at com.kunzisoft.keepass.notifications.DatabaseTaskNotificationService$onStartCommand$$inlined$let$lambda$2.invoke(DatabaseTaskNotificationService.kt:47)
    at com.kunzisoft.keepass.notifications.DatabaseTaskNotificationService$ActionRunnableAsyncTask.onPostExecute(DatabaseTaskNotificationService.kt:594)
    at com.kunzisoft.keepass.notifications.DatabaseTaskNotificationService$ActionRunnableAsyncTask.onPostExecute(DatabaseTaskNotificationService.kt:569)
    at android.os.AsyncTask.finish(AsyncTask.java:695)
    at android.os.AsyncTask.access$600(AsyncTask.java:180)
    at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:712)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:6718)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

~I could NOT reproduce this on my OnePlus 7 (OxygenOs 10.0.4) nor with my real database on this very OnePlus 5.
Only the test database crashes the app (though reproducibly), and only on this device.~

~I haven't tried reinstalling KeePassDX though. Nevertheless, I guess it doesn't hurt pasting the logcat here, feel free to close.~

EDIT: I could reproduce it better. The crash only occurs when the classic icon pack is selected, the Material icon pack works.

bug completed developments

Most helpful comment

I was able to narrow it down, i.e. make it crash on both devices :)
The culprit seems to be the classic icon pack, the Material icon pack works fine. See updates issue description above.

All 3 comments

Thank you, it seems that the problem comes from the new display of icons in the autofill.
RemoteViews are finicky depending on the device, I don't know why. I will capture an exception to display the default icon if the remoteView does not want to display the image.

I was able to narrow it down, i.e. make it crash on both devices :)
The culprit seems to be the classic icon pack, the Material icon pack works fine. See updates issue description above.

Indeed, in this case, I will improve the solution for this problem. The drawable tries to be tinted while the image is immutable, that's the issue, I hadn't thought of this detail...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MisterY picture MisterY  路  7Comments

Wandelstock picture Wandelstock  路  6Comments

gihucom picture gihucom  路  3Comments

stp-ip picture stp-ip  路  3Comments

erwincatt picture erwincatt  路  4Comments