mollyim / mollyim-android

Enhanced and security-focused fork of Signal.
GNU Affero General Public License v3.0
1.7k stars 90 forks source link

Molly crashes when it does not prompt for biometric authentication on startup #365

Closed Mojitzu closed 1 month ago

Mojitzu commented 2 months ago

Is there an existing issue for this?

Bug description

Steps to reproduce

Molly version

v.7.13.4-1-FOSS

Android version

Android 14 ( GrapheneOS:2024090400)

Device

Google Pixel 7a

Link to debug log

Mojitzu commented 2 months ago

I have the app logs that are produced during the crash:

type: crash
osVersion: google/lynx/lynx:14/AP2A.240905.003/2024091900:user/release-keys
package: im.molly.app:144302
process: im.molly.app
processUptime: 227 + 307 ms
installer: dev.imranr.obtainium

java.lang.RuntimeException: Unable to start service org.thoughtcrime.securesms.service.KeyCachingService@793b642 with Intent { cmp=im.molly.app/org.thoughtcrime.securesms.service.KeyCachingService }: java.lang.IllegalStateException
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5126)
    at android.app.ActivityThread.-$$Nest$mhandleServiceArgs(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2439)
    at android.os.Handler.dispatchMessage(Handler.java:107)
    at android.os.Looper.loopOnce(Looper.java:232)
    at android.os.Looper.loop(Looper.java:317)
    at android.app.ActivityThread.main(ActivityThread.java:8623)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
    at com.android.internal.os.ExecInit.main(ExecInit.java:50)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:369)
Caused by: java.lang.IllegalStateException
    at org.thoughtcrime.securesms.service.KeyCachingService.getMasterSecret(KeyCachingService.java:88)
    at org.thoughtcrime.securesms.crypto.EncryptedPreferences.getCipher(EncryptedPreferences.java:438)
    at org.thoughtcrime.securesms.crypto.EncryptedPreferences.getDecryptedObject(EncryptedPreferences.java:370)
    at org.thoughtcrime.securesms.crypto.EncryptedPreferences.getInt(EncryptedPreferences.java:273)
    at org.thoughtcrime.securesms.util.TextSecurePreferences.getIntegerPreference(TextSecurePreferences.java:1057)
    at org.thoughtcrime.securesms.util.TextSecurePreferences.getNotificationChannelVersion(TextSecurePreferences.java:948)
    at org.thoughtcrime.securesms.notifications.NotificationChannels.<init>(NotificationChannels.java:113)
    at org.thoughtcrime.securesms.notifications.NotificationChannels.getInstance(NotificationChannels.java:92)
    at org.thoughtcrime.securesms.service.KeyCachingService.foregroundService(KeyCachingService.java:237)
    at org.thoughtcrime.securesms.service.KeyCachingService.handleCacheKey(KeyCachingService.java:156)
    at org.thoughtcrime.securesms.service.KeyCachingService.onStartCommand(KeyCachingService.java:119)
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5108)
    ... 11 more
valldrac commented 2 months ago

@Mojitzu Thanks for the log. It does seem like a bug in the app, but I need to see the full log. The crash info alone isn’t enough. I need to check what the app was doing before the crash. If you could extract the rest of the log using ADB, I’d really appreciate it. If you’re unsure how to do that, you can Google it or join our Matrix chat for help.

Mojitzu commented 2 months ago

I will try to send the full log today. As of today I does not crash anymore when I try to submit the logs. I have attached them and I hope that helps molly-log-1727067405035.zip

Mojitzu commented 2 months ago

The log will come tommorrow wasnt able to find time today!

valldrac commented 2 months ago

The log will come tommorrow wasnt able to find time today!

No need. I can see the problem from the molly-log you sent above. The app can’t open its database because it’s corrupted. I don't know how it got corrupted, but it’s not related to the biometric authentication. Did you copy Molly from another device using some tool, or reset Android's KeyStore? Have you lost data in another app? Is your storage almost full?

Unfortunately, the only fix is to delete and reinstall the app. If you did a backup, you should be able to recover your chats.

Mojitzu commented 1 month ago

Nothing of the above is the case but I had a filesystem error on my device that showed after an update but I never had ans data loss because of that.

Mojitzu commented 1 month ago

But I remember that in the day the problems with Molly first appeard something happened that could have corrupted the database. After powering my phone on (it was shutdown during the night) all Apps that are installed on my secondar user appeard on the owner profile. I think it was a bug because I used the same password for my owner profile and my secondar user (profile). Could that cause the problem?

valldrac commented 1 month ago

Thanks for replying. Yes. It's pretty likely. If that's the case, the database file corruption happened outside the app. Unfortunately, like I said, there's no fix for it. I'm going to close the ticket.