ProtonMail android app crash at launch time in some cases
ProtonMail android app crash at launch time in some cases
Summary
A user has reported ProtonMail app crash on LeEco Le2. Can be reproduced. /e/OS-n
Steps to reproduce
Install ProtonMail app, launch it.
What is the current behavior?
Application crashes.
What is the expected correct behavior?
Application runs.
Relevant logs and/or screenshots
08-19 09:12:48.564 7827 7827 E AndroidRuntime: FATAL EXCEPTION: main
08-19 09:12:48.564 7827 7827 E AndroidRuntime: Process: ch.protonmail.android, PID: 7827
08-19 09:12:48.564 7827 7827 E AndroidRuntime: java.lang.RuntimeException: Unable to create application ch.protonmail.android.core.ProtonMailApplication: java.security.ProviderException: Failed to load generated key pair from keystore
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5451)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at android.app.ActivityThread.-wrap2(ActivityThread.java)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1564)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6186)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: Caused by: java.security.ProviderException: Failed to load generated key pair from keystore
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.loadKeystoreKeyPair(AndroidKeyStoreKeyPairGeneratorSpi.java:518)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.generateKeyPair(AndroidKeyStoreKeyPairGeneratorSpi.java:470)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at java.security.KeyPairGenerator$Delegate.generateKeyPair(KeyPairGenerator.java:699)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.i.a.a(SecureSharedPreferences.kt:285)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.i.a.<init>(SecureSharedPreferences.kt:48)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.i.a.<init>(SecureSharedPreferences.kt:26)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.i.a$a.a(SecureSharedPreferences.kt:445)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.core.ProtonMailApplication.d(ProtonMailApplication.java:217)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.api.TokenManager.load(TokenManager.java:38)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.core.f.x(UserManager.java:421)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.api.ProtonMailApi$Companion.createConstructionParams(ProtonMailApi.kt:144)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.api.ProtonMailApi$Companion.access$createConstructionParams(ProtonMailApi.kt:142)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.api.ProtonMailApi.<init>(ProtonMailApi.kt:116)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.core.a.o.a(AppModule.kt:158)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.core.a.p.a(AppModule_ProvideApiFactory.java:65)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.core.a.p.a(AppModule_ProvideApiFactory.java:46)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.core.a.p.a(AppModule_ProvideApiFactory.java:38)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.core.a.p.get(AppModule_ProvideApiFactory.java:12)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at dagger.b.b.get(DoubleCheck.java:47)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.core.a.ar.b(DaggerAppComponent.java:788)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.core.a.ar.a(DaggerAppComponent.java:649)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.api.segments.event.EventManager.<init>(EventManager.kt:42)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.core.a.o.g(AppModule.kt:67)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.core.a.ac.c(AppModule_ProvideEventManagerFactory.java:34)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.core.a.ac.a(AppModule_ProvideEventManagerFactory.java:25)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.core.a.ac.a(AppModule_ProvideEventManagerFactory.java:21)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.core.a.ac.get(AppModule_ProvideEventManagerFactory.java:8)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at dagger.b.b.get(DoubleCheck.java:47)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.core.a.ar.b(DaggerAppComponent.java:764)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.core.a.ar.a(DaggerAppComponent.java:636)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at ch.protonmail.android.core.ProtonMailApplication.onCreate(ProtonMailApplication.java:168)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1025)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5448)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: ... 8 more
08-19 09:12:48.564 7827 7827 E AndroidRuntime: Caused by: java.security.UnrecoverableKeyException: Failed to obtain X.509 form of public key
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at android.security.keystore.AndroidKeyStoreProvider.loadAndroidKeyStorePublicKeyFromKeystore(AndroidKeyStoreProvider.java:230)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at android.security.keystore.AndroidKeyStoreProvider.loadAndroidKeyStoreKeyPairFromKeystore(AndroidKeyStoreProvider.java:259)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.loadKeystoreKeyPair(AndroidKeyStoreKeyPairGeneratorSpi.java:509)
08-19 09:12:48.564 7827 7827 E AndroidRuntime: ... 40 more
08-19 09:12:48.564 7827 7827 E AndroidRuntime: Caused by: android.security.KeyStoreException: -22
08-19 09:12:48.565 7827 7827 E AndroidRuntime: at android.security.KeyStore.getKeyStoreException(KeyStore.java:676)
08-19 09:12:48.565 7827 7827 E AndroidRuntime: at android.security.keystore.AndroidKeyStoreProvider.loadAndroidKeyStorePublicKeyFromKeystore(AndroidKeyStoreProvider.java:231)
08-19 09:12:48.565 7827 7827 E AndroidRuntime: ... 42 more
08-19 09:12:48.568 1262 3525 W ActivityManager: Force finishing activity ch.protonmail.android/.activities.SplashActivity
08-19 09:12:48.619 1262 7613 I OpenGLRenderer: Initialized EGL, version 1.4
08-19 09:12:48.619 1262 7613 D OpenGLRenderer: Swap behavior 1
08-19 09:12:48.882 1205 1253 W XTCC-5.1.0.19-a: [CS-RIL-LISTENER] timerCallback fired for ril update registering, re-register
08-19 09:12:49.073 1262 2541 W ActivityManager: Activity pause timeout for ActivityRecord{103163c u0 ch.protonmail.android/.activities.SplashActivity t165 f}
08-19 09:12:49.100 3539 3539 D WeatherIconUtils: Decoding resource id = 2131230925 for density = 420
Possible fixes
Device-specific issue?
@rhunault @niharthakkar @amitkumar any advice?