freeotp / freeotp-android

Apache License 2.0
1.44k stars 303 forks source link

Why is import/export still suggested when it doesn't work? #395

Open nolosb opened 9 months ago

nolosb commented 9 months ago

I had installed FreeOTP on a new phone a month ago. Had to do a reset now, exported keys, wanted to import after the reset. It doesn't work. Apparently many others face the same problem. I don't understand why the app still suggests to do a backup when it doesn't work? This is not a minor issue.

GeorgeHu6 commented 9 months ago

I met this problem too now in version 2.0.3 (Android).

HardDie commented 5 months ago

I have encountered the same problem. But before this import was working 100%, I tested it before I started using this app. But now I tried to set up a new phone and after entering the password nothing happens, just a blank screen.

HardDie commented 5 months ago

This is so weird. I seem to have started using FreeOTP when it was in version 2.0.2. I backed it up from time to time, and old backups created on version 2.0.2 could be restored on both version 2.0.2 and 2.0.3. But new backups created on version 2.0.3 could not be restored on all versions of the application.

phudgee commented 5 months ago

So what do we do now? I was unaware of the issue, backed up, reset my phone, now I am unable to import, and have lost all my 2FA access. Is there a workaround?

HardDie commented 5 months ago

I spent a whole evening trying to find how to do this but couldn't. I got lucky and had all my 2FA codes on my other phone, so I visited all the sites, generated new codes and switched to Aegis. If you've already lost them, you'll probably have to restore all your accounts.

But I will be happy to be wrong and if you find a way to restore data from this backup, please share it.

nolosb commented 5 months ago

I had to restore all my accounts. Then switched to using FreeOTP+.

vollkorn1982 commented 4 months ago

I was able to recover my accounts when moving to a new phone. The problem seems to be the export in version 2.0.3. I did a downgrade to version 2.0.2, exported my accounts and was able to import the backup with version 2.0.3 on the new device.

What you need:

  1. Copy the apk on the phone: adb push org.fedorahosted.freeotp_43.apk /data/local/tmp
  2. On the old phone do a downgrade: adb shell pm install -r -d /data/local/tmp/org.fedorahosted.freeotp_43.apk
  3. Export your accounts on the old phone.
  4. Copy the backup file over to the new phone.
  5. Import backup file on new phone with version 2.0.3
vollkorn1982 commented 4 months ago

I think it should be possible to build an exporter, which takes a backup file, decrypts it and stores it as .cvs or similar, so that one can import it with another tool. The code for restoring tokens from the backup is at https://github.com/freeotp/freeotp-android/blob/master/mobile/src/main/java/org/fedorahosted/freeotp/TokenPersistence.java#L146

xinwu-yui commented 4 months ago

i have downgrade to 2.0.2。but it did not work!

vollkorn1982 commented 4 months ago

@xinwu-yui What exactly did you try? Mind you, to follow my workaround you have to have a working app with all the TOTPs inside, that you downgrade.

xinwu-yui commented 4 months ago

i clone source code and debug。i think The reason for the error is that there was an encryption issue during export