The real answer is to not use SMS as a 2FA. That was never ever a good idea.
adb backup com.google.android.apps.authenticator2
all the codes are stored in the sqlite3 database which you can open with standard command line tools.there are also more user friendly backup apps such as helium, but adb works quite nicely.
If you're into cryptocurrency, the Trezor will also act as a U2F device.
Mobile signature (SIM-based)(0) is the most secure method as far as I've seen in banks. Citing wiki: "supporting the authentication on the Internet with a parallel closed network like mobile/GSM and a digital signature enabled SIM card is the most secure method today against the man in the middle attack."