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

[Question] Importing data from FreeOTP #11

Closed
akwala opened this issue Apr 18, 2018 · 8 comments
Closed

[Question] Importing data from FreeOTP #11

akwala opened this issue Apr 18, 2018 · 8 comments

Comments

@akwala
Copy link

akwala commented Apr 18, 2018

FreeOTP doesn't provide a way to export the stored keys. Would it be possible to import the data from FreeOTP into FreeOTP+ using a backup made with Titanium Backup? Any other ways this could be done?

@helloworld1
Copy link
Owner

Yes, I assume you have rooted your phone. You can "adb" to copy.

adb shell
su
cp /data/data/org.fedorahosted.freeotp/shared_prefs/tokens.xml /data/data/org.liberty.android.freeotpplus/shared_prefs/tokens.xml

Titanium Backup may also work but I am not an expert in that.

@akwala
Copy link
Author

akwala commented Apr 18, 2018

Thanks, @helloworld1

The file got copied -- I viewed it -- but FreeOTP+ says no keys are installed.

@helloworld1
Copy link
Owner

Please force stop FreeOTP+ first and then copy the file again. If you leave the app open, it can overwrite the keys.

@helloworld1
Copy link
Owner

I tried it myself. After force close, the keys will be copied correctly.

@akwala
Copy link
Author

akwala commented Apr 19, 2018

Not sure I understand... The tokens.xml under organization.liberty.android.freeotpplus is the one I copied, it has my keys. FreeOTP+ doesn't seem to be reading it. Force stopping the app makes no difference.

I also tried copying the file afresh (after renaming the existing one) while FreeOTP+ was force stopped. The app didn't show any keys when launched. What am I missing?

@helloworld1
Copy link
Owner

helloworld1 commented Apr 19, 2018

Ok, there is some permission issue on the file causing the copied file unreadable. The tokens file copied is owned by root not by the app.

You need to

  1. First in FreeOTP+, create some random token.
  2. Force close FreeOTP+
  3. Use this command in adb
    cat /data/data/org.fedorahosted.freeotp/shared_prefs/tokens.xml > /data/data/org.liberty.android.freeotpplus/shared_prefs/tokens.xml

I captured a video to show how I did it:
https://youtu.be/23kxutlYS9o

@akwala
Copy link
Author

akwala commented Apr 20, 2018

Thanks, @helloworld1 ... That worked!

@gloomytrousers
Copy link

If you have TWRP, you can run @helloworld1's command in recovery via Advanced -> Terminal. No root or ADB required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants