如何将您的Google Authenticator凭证移至新的Android手机或平板电脑

如何将您的Google Authenticator凭证移至新的Android手机或平板电脑

Most of the app data on your Android is probably synced online will automatically sync to a new phone or tablet. However, your Google Authenticator credentials won’t — they aren’t synchronized for obvious security reasons.

Android上的大多数应用程序数据可能已在线同步,将自动同步到新手机或平板电脑。 但是,您的Google Authenticator凭据不会-出于明显的安全原因,它们不会同步。

If you’re doing a factory reset, getting a new phone, or just want to copy your credentials to second device, these steps will help you move your authenticator data over so you won’t lose your access codes.

如果您要恢复出厂设置,购买新手机,或者只想将凭据复制到第二台设备,这些步骤将帮助您转移身份验证器数据,从而不会丢失访问密码。

移至其他手机 (Move to a Different Phone)

Google now allows you to move your credentials to a different phone. Access the 2-step verification page, click the Move to a different phone link, and scan the QR code or enter your credentials into a new phone. Your old authentication app will stop working.

Google现在允许您将凭据转移到其他手机上。 进入两步验证页面,单击“移至其他手机”链接,然后扫描QR码或将您的凭据输入新手机。 您的旧身份验证应用将停止运行。

如何将您的Google Authenticator凭证移至新的Android手机或平板电脑

Other services that use Google Authenticator may not offer this feature, so you may need to disable and re-enable your account or extract your codes instead. One of the processes below will also allow you to enable Google Authenticator on multiple devices – such as your phone and your tablet – although Google claims not to support this.

使用Google Authenticator的其他服务可能不提供此功能,因此您可能需要禁用并重新启用您的帐户或提取代码。 尽管Google声称不支持此功能,但是以下过程之一还允许您在多种设备(例如手机和平板电脑)上启用Google Authenticator。

禁用和重新启用两步身份验证 (Disable & Re-enable Two-Step Authentication)

If you’re performing a factory reset and don’t want to rely on your printed security codes or SMS verification, you may want to disable two-step authentication ahead of time. To do so, click the Remove link on the 2-step verification page. This temporarily disables two-factor authentication.

如果您要恢复出厂设置,并且不想依靠打印的安全代码或SMS验证,则可能需要提前禁用两步身份验证。 为此,请点击两步验证页面上的删除链接。 这将暂时禁用两因素身份验证。

如何将您的Google Authenticator凭证移至新的Android手机或平板电脑

Perform the factory reset and then add an authentication app again from this page. When you reach the stage where you’re given a QR code and a code you can manually type, re-enter it into your phone. If you want to enable Google Authenticator on multiple devices, enter the code into multiple devices before closing this window.

执行出厂重置,然后从此页面再次添加身份验证应用程序。 当您到达获得QR码和可以手动键入的代码的阶段时,请将其重新输入到手机中。 如果要在多台设备上启用Google Authenticator,请在关闭此窗口之前将代码输入到多台设备中。

While you could write down the code displayed here and keep it in a safe place, that isn’t necessarily a good idea – anyone who found it would be able to enter it into their own phone and see your time-based authentication codes.

尽管您可以记下此处显示的代码并将其保存在安全的地方,但这不一定是个好主意-找到它的任何人都可以将其输入到自己的手机中,并查看您基于时间的身份验证代码。

如何将您的Google Authenticator凭证移至新的Android手机或平板电脑

备份和还原您的Google Authenticator数据[仅root] (Back Up & Restore Your Google Authenticator Data [Root Only])

If your Android is rooted, you can use Titanium Backup, which we’ve written about before, to take a backup of your Google Authenticator app data. For security reasons, it’s not normally possible for another app to read this data – that’s why root access is required.

如果您的Android是扎根的,则可以使用我们之前写过的Titanium Backup来备份您的Google Authenticator应用程序数据。 出于安全原因,其他应用通常无法读取此数据-这就是为什么需要root访问权限的原因。

Locate Authenticator under the Backup/Restore tab and use the backup option to back up its data. Copy the backup data from the TitaniumBackup folder on your device to your computer. You can then copy it to your new device and restore it later.

在“备份/还原”选项卡下找到身份验证器,然后使用“备份”选项备份其数据。 将备份数据从设备上的TitaniumBackup文件夹复制到计算机。 然后,您可以将其复制到新设备上,然后再还原。

如何将您的Google Authenticator凭证移至新的Android手机或平板电脑

Note that this may not work with devices running different versions of the Android operating system, but it’s perfect for restoring after a factory reset.

请注意,这可能不适用于运行不同版本的Android操作系统的设备,但是非常适合在恢复出厂设置后进行还原。

手动提取您的凭据[仅root] (Manually Extract Your Credentials [Root Only])

If you have root access to your device, you can actually extract the credentials manually, although it’s more work than just using Titanium Backup.

如果您具有设备的超级用户访问权限,则实际上可以手动提取凭据,尽管这不仅比使用Titanium Backup还要复杂。

adb will need root access for you to do this – if you’re using a custom ROM, you may already have an adb with root access. If you’re using a stock ROM, you’ll need something like adbd Insecure to do this. You can download adb Insecure from Google Play or for free on the XDA Developers forums. Use the app to put adbd in insecure mode.

若要执行此操作,adb将需要root用户访问权限–如果您使用的是自定义ROM,则可能已经具有具有root用户访问权限的adb。 如果使用的是ROM,则需要使用adbd Insecure之类的工具。 您可以从Google Play下载adb​​ Insecure或在XDA Developers论坛上免费下载。 使用该应用将adbd置于不安全模式。

Note: If you have root access, you can also grab the databases file from /data/data/com.google.android.apps.authenticator2/databases/databases using a root file explorer and copy it to your computer

注意:如果您具有root用户访问权限,则还可以使用根文件资源管理器从/data/data/com.google.android.apps.authenticator2/databases/databases中获取数据库文件,并将其复制到计算机上

如何将您的Google Authenticator凭证移至新的Android手机或平板电脑

Once adb is in insecure mode, you can connect your Android device to your computer and use the adb command (setup instructions here) to grab the Google Authenticator databases file and copy it to your computer:

一旦adb处于不安全模式,您就可以将Android设备连接到计算机,并使用adb命令(此处的设置说明)来获取Google Authenticator数据库文件并将其复制到您的计算机上:

adb pull /data/data/com.google.android.apps.authenticator2/databases/databases

adb pull /data/data/com.google.android.apps.authenticator2/databases/databases

You can then use an sqlite editor to open the file and view its contents. If you’re using the command-line sqlite3 program, use the following commands:

然后,您可以使用sqlite编辑器打开文件并查看其内容。 如果使用命令行sqlite3程序,请使用以下命令:

sqlite3 ./databases

sqlite3 ./数据库

select * from accounts;

从帐户中选择*;

You’ll see your Google Authenticator keys, which you can now re-add to another device.

您会看到自己的Google Authenticator**,现在可以将其重新添加到另一台设备。

如何将您的Google Authenticator凭证移至新的Android手机或平板电脑


Luckily, Google no longer resets your application-specific passwords – even if you disable and re-enable Google Authenticator, your application-specific passwords will remain valid.

幸运的是,Google不再重置您的应用程序专用密码-即使您禁用并重新启用Google Authenticator,您的应用程序专用密码仍将保持有效。

Thanks to Dan over at cadince for inspiring much of this post!

多亏了cadince的Dan给予了我很多启发

翻译自: https://www.howtogeek.com/130755/how-to-move-your-google-authenticator-credentials-to-a-new-android-phone-or-tablet/