
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碼或將您的憑據輸入新手機。 您的舊身份驗證應用將停止運行。

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驗證,則可能需要提前禁用兩步身份驗證。 為此,請點擊兩步驗證頁面上的刪除鏈接。 這將暫時禁用兩因素身份驗證。

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數據[僅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文件夾復制到計算機。 然后,您可以將其復制到新設備上,然后再還原。

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中獲取數據庫文件,并將其復制到計算機上

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密鑰,現在可以將其重新添加到另一臺設備。

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/