Signal-android: Extracting necessary data to restore Signal after reinstall and Titanium Backup

Created on 20 Aug 2018  路  3Comments  路  Source: signalapp/Signal-Android

Hello,
I have backed up my Signal application using TitaniumBackup (as all other apps are backed up as well). This is a standard procedure for people that flash their androids with new ROMs often.

All other apps have survived my Nougat -> Oreo upgrade but Signal gives me FCs

08-20 17:01:01.880 28479 28479 E AndroidRuntime: FATAL EXCEPTION: main
08-20 17:01:01.880 28479 28479 E AndroidRuntime: Process: org.thoughtcrime.securesms, PID: 28479
08-20 17:01:01.880 28479 28479 E AndroidRuntime: java.lang.AssertionError: javax.crypto.AEADBadTagException
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at org.thoughtcrime.securesms.crypto.KeyStoreHelper.unseal(KeyStoreHelper.java:73)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at org.thoughtcrime.securesms.crypto.DatabaseSecretProvider.getEncryptedDatabaseSecret(DatabaseSecretProvider.java:58)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at org.thoughtcrime.securesms.crypto.DatabaseSecretProvider.getOrCreateDatabaseSecret(DatabaseSecretProvider.java:29)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at org.thoughtcrime.securesms.database.DatabaseFactory.<init>(DatabaseFactory.java:150)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at org.thoughtcrime.securesms.database.DatabaseFactory.getInstance(DatabaseFactory.java:64)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at org.thoughtcrime.securesms.database.DatabaseFactory.getSmsDatabase(DatabaseFactory.java:79)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at org.thoughtcrime.securesms.service.ExpiringMessageManager.<init>(ExpiringMessageManager.java:29)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at org.thoughtcrime.securesms.ApplicationContext.initializeExpiringMessageManager(ApplicationContext.java:180)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at org.thoughtcrime.securesms.ApplicationContext.onCreate(ApplicationContext.java:95)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at android.app.Instrumentation.callApplicationOnCreate(Unknown Source:0)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at android.app.ActivityThread.handleBindApplication(Unknown Source:1064)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:361)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at android.app.ActivityThread.handleBindApplication(<Xposed>)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at android.app.ActivityThread.-wrap1(Unknown Source:0)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(Unknown Source:415)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Unknown Source:21)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at android.os.Looper.loop(Unknown Source:139)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at android.app.ActivityThread.main(Unknown Source:146)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Unknown Source:11)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(Unknown Source:198)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:108)
08-20 17:01:01.880 28479 28479 E AndroidRuntime: Caused by: javax.crypto.AEADBadTagException
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(Unknown Source:107)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at javax.crypto.Cipher.doFinal(Cipher.java:1736)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at org.thoughtcrime.securesms.crypto.KeyStoreHelper.unseal(KeyStoreHelper.java:71)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    ... 22 more
08-20 17:01:01.880 28479 28479 E AndroidRuntime: Caused by: android.security.KeyStoreException: Signature/MAC verification failed
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at android.security.KeyStore.getKeyStoreException(Unknown Source:96)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at android.security.keystore.KeyStoreCryptoOperationChunkedStreamer.doFinal(Unknown Source:38)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at android.security.keystore.AndroidKeyStoreAuthenticatedAESCipherSpi$BufferAllOutputUntilDoFinalStreamer.doFinal(Unknown Source:7)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(Unknown Source:40)
08-20 17:01:01.880 28479 28479 E AndroidRuntime:    ... 24 more
08-20 17:01:01.901  3795  3964 E PhoneWindow_APM : : isCalledPackage return true
08-20 17:01:05.677  3795  3962 E memtrack: Couldn't load memtrack module
08-20 17:01:07.831 28479 28487 E System  : Uncaught exception thrown by finalizer
08-20 17:01:07.832 28479 28487 E System  : java.lang.IllegalStateException: Binder has been finalized!
08-20 17:01:07.832 28479 28487 E System  :  at android.os.BinderProxy.transactNative(Native Method)
08-20 17:01:07.832 28479 28487 E System  :  at android.os.BinderProxy.transact(Unknown Source:102)
08-20 17:01:07.832 28479 28487 E System  :  at android.security.IKeystoreService$Stub$Proxy.abort(Unknown Source:22)
08-20 17:01:07.832 28479 28487 E System  :  at android.security.KeyStore.abort(Unknown Source:2)
08-20 17:01:07.832 28479 28487 E System  :  at android.security.keystore.AndroidKeyStoreCipherSpiBase.finalize(Unknown Source:6)
08-20 17:01:07.832 28479 28487 E System  :  at android.security.keystore.AndroidKeyStoreAuthenticatedAESCipherSpi$GCM$NoPadding.finalize(Unknown Source:0)
08-20 17:01:07.832 28479 28487 E System  :  at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:250)
08-20 17:01:07.832 28479 28487 E System  :  at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:237)
08-20 17:01:07.832 28479 28487 E System  :  at java.lang.Daemons$Daemon.run(Daemons.java:103)
08-20 17:01:07.832 28479 28487 E System  :  at java.lang.Thread.run(Thread.java:764)
08-20 17:01:08.015  3795  3964 E ViewRootImpl: sendUserActionEvent() returned.

What data do I need to recover from my titanium backup to make signal recover my chats / secrets and run again with a fresh install? It seems my Android Device ID has changed, does this impact signals crypto?

Most helpful comment

Titanium Backup does not backup the Android keystore keys where the key for the new encrypted database is stored. This means that with TB you loose access to the database. If you have a full device backup (TWRP or Clockworkmod) you can restore that and extract the necessary keys from it. See https://community.signalusers.org/t/howto-manual-backup-restore-if-full-backup-does-not-work/2462 for more information.

All 3 comments

Signal has its own backup feature and does not support Titanium Backup since a number of releases now. It's under "conversations and media" at the bottom which saves everything including your keys

Titanium Backup does not backup the Android keystore keys where the key for the new encrypted database is stored. This means that with TB you loose access to the database. If you have a full device backup (TWRP or Clockworkmod) you can restore that and extract the necessary keys from it. See https://community.signalusers.org/t/howto-manual-backup-restore-if-full-backup-does-not-work/2462 for more information.

That's a satisfying answer although it means I lost my messages as I did only a Titanium backup. Ah well. Thanks!

Was this page helpful?
0 / 5 - 0 ratings