Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seedvault crashes when entering new recovery words #375

Closed
echeoquehaii opened this issue Jan 25, 2022 · 7 comments
Closed

Seedvault crashes when entering new recovery words #375

echeoquehaii opened this issue Jan 25, 2022 · 7 comments
Labels
bug needs info Requires more information from reporter

Comments

@echeoquehaii
Copy link

Hi!
I'm having a weird issue with Seedvault. I had a very old and not used backup, which I didn't need anymore, and wanted to start from scratch. So I deleted Seedvault's data and started the app again, which prompted me with the new Recovery Words. When enter the words SeedVault crashes. Still, it seems like the set up went forward because if I go into Seedvault's settings I can now set backup's location and all the other options. Nevertheless, when I try to start the backup it prompts me to either enter the old recovery words or get new ones. Either option leads me to the same behaviour as at the beginning, with Seedvault crashing and going back to the Seedvault settings screen.

I'm on LineageOS 19, Android 12.

Here's the log: logcat_01-25-2022_19-37-01.txt

@grote grote added the bug label Jan 25, 2022
@grote
Copy link
Collaborator

grote commented Jan 25, 2022

Thanks! What version of Seedvault is shown in its About dialog?

Here's the relevant bits from the log (stuff is pretty messed up):

Process: com.stevesoltys.seedvault, PID: 17241
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:558)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
Caused by: java.lang.reflect.InvocationTargetException
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	... 1 more
Caused by: java.security.KeyStoreException: Failed to import secret key.
	at android.security.keystore2.AndroidKeyStoreSpi.setSecretKeyEntry(AndroidKeyStoreSpi.java:806)
	at android.security.keystore2.AndroidKeyStoreSpi.engineSetEntry(AndroidKeyStoreSpi.java:1176)
	at java.security.KeyStore.setEntry(KeyStore.java:1596)
	at com.stevesoltys.seedvault.crypto.KeyManagerImpl.storeMainKey(KeyManager.kt:80)
	at com.stevesoltys.seedvault.ui.recoverycode.RecoveryCodeViewModel.storeNewCode(RecoveryCodeViewModel.kt:90)
	at com.stevesoltys.seedvault.ui.recoverycode.RecoveryCodeInputFragment.done(RecoveryCodeInputFragment.kt:155)
	at com.stevesoltys.seedvault.ui.recoverycode.RecoveryCodeInputFragment.access$done(RecoveryCodeInputFragment.kt:42)
	at com.stevesoltys.seedvault.ui.recoverycode.RecoveryCodeInputFragment$onViewCreated$2.onClick(RecoveryCodeInputFragment.kt:121)
	at android.view.View.performClick(View.java:7441)
	at android.view.View.performClickInternal(View.java:7418)
	at android.view.View.access$3700(View.java:835)
	at android.view.View$PerformClick.run(View.java:28677)
	at android.os.Handler.handleCallback(Handler.java:938)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7839)
	... 3 more
Caused by: android.security.KeyStoreException: Unsupported purpose
	at android.security.KeyStore2.getKeyStoreException(KeyStore2.java:356)
	at android.security.KeyStoreSecurityLevel.handleExceptions(KeyStoreSecurityLevel.java:57)
	at android.security.KeyStoreSecurityLevel.importKey(KeyStoreSecurityLevel.java:166)
	at android.security.keystore2.AndroidKeyStoreSpi.setSecretKeyEntry(AndroidKeyStoreSpi.java:803)
	... 19 more
Error creating root backup dir.
java.io.IOException: Directory named .SeedVaultAndroidBackup (1), but should be .SeedVaultAndroidBackup
	at com.stevesoltys.seedvault.plugins.saf.DocumentsStorageKt.createOrGetDirectory(DocumentsStorage.kt:170)
	at com.stevesoltys.seedvault.plugins.saf.DocumentsStorage$rootBackupDir$1.invokeSuspend(DocumentsStorage.kt:61)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:241)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:270)
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:79)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:54)
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source:1)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:36)
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source:1)
	at com.stevesoltys.seedvault.plugins.saf.DocumentsStorage.getRootBackupDir$packages__apps__Seedvault__android_common__Seedvault(DocumentsStorage.kt:56)
	at com.stevesoltys.seedvault.storage.SeedvaultStoragePlugin.getRoot(SeedvaultStoragePlugin.kt:16)
	at org.calyxos.backup.storage.plugin.saf.SafStoragePlugin.getFolder(SafStoragePlugin.kt:41)
	at org.calyxos.backup.storage.plugin.saf.SafStoragePlugin.getCurrentBackupSnapshots$suspendImpl(SafStoragePlugin.kt:223)
	at org.calyxos.backup.storage.plugin.saf.SafStoragePlugin.getCurrentBackupSnapshots(Unknown Source:0)
	at org.calyxos.backup.storage.api.StorageBackup$deleteAllSnapshots$2.invokeSuspend(StorageBackup.kt:111)
	at org.calyxos.backup.storage.api.StorageBackup$deleteAllSnapshots$2.invoke(Unknown Source:8)
	at org.calyxos.backup.storage.api.StorageBackup$deleteAllSnapshots$2.invoke(Unknown Source:4)
java.lang.IllegalStateException: No storage set
	at com.stevesoltys.seedvault.storage.SeedvaultStoragePlugin.getRoot(SeedvaultStoragePlugin.kt:16)
	at org.calyxos.backup.storage.plugin.saf.SafStoragePlugin.getFolder(SafStoragePlugin.kt:41)
	at org.calyxos.backup.storage.plugin.saf.SafStoragePlugin.getCurrentBackupSnapshots$suspendImpl(SafStoragePlugin.kt:223)
	at org.calyxos.backup.storage.plugin.saf.SafStoragePlugin.getCurrentBackupSnapshots(Unknown Source:0)
	at org.calyxos.backup.storage.api.StorageBackup$deleteAllSnapshots$2.invokeSuspend(StorageBackup.kt:111)
	at org.calyxos.backup.storage.api.StorageBackup$deleteAllSnapshots$2.invoke(Unknown Source:8)
	at org.calyxos.backup.storage.api.StorageBackup$deleteAllSnapshots$2.invoke(Unknown Source:4)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:91)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:156)
	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
	at org.calyxos.backup.storage.api.StorageBackup.deleteAllSnapshots(StorageBackup.kt:109)
	at com.stevesoltys.seedvault.ui.storage.BackupStorageViewModel$onLocationSet$1.invokeSuspend(BackupStorageViewModel.kt:38)

@grote
Copy link
Collaborator

grote commented Jan 25, 2022

@mikeNG Any idea why we would get a KeyStoreException: Unsupported purpose for PURPOSE_ENCRYPT or PURPOSE_DECRYPT or PURPOSE_SIGN or PURPOSE_VERIFY on LOS 19? Could the purpose be device specific?

@echeoquehaii
Copy link
Author

echeoquehaii commented Jan 25, 2022

Thanks! What version of Seedvault is shown in its About dialog?

Oh not at all, thanks so much to you! Version is 12-3.0.

It looks indeed a bit messy. I was wondering if it was something specific to my device. Unfortunately this is my daily driver and cannot test cleaning up everything, reinstalling or similar, to check if there's anything corrupted in my setting.

@mikeNG
Copy link
Contributor

mikeNG commented Jan 26, 2022

Oh not at all, thanks so much to you! Version is 12-3.0.

It looks indeed a bit messy. I was wondering if it was something specific to my device. Unfortunately this is my daily driver and cannot test cleaning up everything, reinstalling or similar, to check if there's anything corrupted in my setting.

What device is this? Do you have anything else installed except LineageOS (eg. gapps, magisk)

@echeoquehaii
Copy link
Author

echeoquehaii commented Jan 27, 2022

What device is this? Do you have anything else installed except LineageOS (eg. gapps, magisk)

It's a Galaxy S7 and I have Magisk and microg installed on LOS 19, apart from a bunch of other apps I normally use

@echeoquehaii
Copy link
Author

echeoquehaii commented Jan 28, 2022

Might it have something to do for the app being in /system_ext/priv-app instead of /system? (I imagine not)
Also, I remember that previously, when searching for a "SeedVault" app in settings, two entries were appearing, one was the standard SeedVault app, while another one was, I think, com.stevesoltys.seedvault.transport.ConfigurableBackupTransport. I'm not sure it was this exact entry, but I'm sure it was appearing in the apps section as if it was a separate app. Now, when searching for SeedVault there's no trace of another entry. Is it alright that it's missing?

@mikeNG
Copy link
Contributor

mikeNG commented Feb 7, 2022

It has nothing to do with being in /system_ext, this looks like a device specific issue, most likely keystore in your custom OS is not working properly. This is also not an official build of LineageOS so there is no guarantee that it passes the device requirement charter which assures basic hardware functionality.

@grote grote added the needs info Requires more information from reporter label Apr 25, 2022
@grote grote closed this as completed Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs info Requires more information from reporter
Projects
None yet
Development

No branches or pull requests

3 participants