Aegis icon indicating copy to clipboard operation
Aegis copied to clipboard

Import Battle.net Codes from various sources

Open yoshimo opened this issue 4 years ago • 7 comments

It would be great if you could handle

  • The official Battle.net Authenticator ( https://play.google.com/store/apps/details?id=com.blizzard.bma )
  • The Restore code from https://account.blizzard.com/security
  • The backup xml from https://bitbucket.org/sednogmah/foobma/src

yoshimo avatar Jun 21 '20 08:06 yoshimo

The official Battle.net Authenticator ( https://play.google.com/store/apps/details?id=com.blizzard.bma )

Someone could look into whether that's possible. It'll require root access, just like the other importers that read from other app's internal storage.

The Restore code from https://account.blizzard.com/security

Is it possible to derive the secret from this restore code, without connecting to the internet? My guess would be no.

The backup xml from https://bitbucket.org/sednogmah/foobma/src

This seems like too much of a niche tool to add support for.

alexbakker avatar Jun 21 '20 11:06 alexbakker

If you turn Wifi Off, the Battle-net Mobile App can't finish the restore Process.

https://github.com/winauth/winauth/blob/6af095b4d405563190e26c5ec1b129755d2cdf23/Authenticator/BattleNetAuthenticator.cs has the restore Process which involves some requests and calculations.

Maybe to niche that particular tool, but it seems rather straight forward

  • Serial, Clockskew and a token.

This is similiar to what winauth stores, which i just labeled differently secretdata, servertimediff&Lastservertime is the winauth version, and they do not seem to store the serial number. So it comes down to just parsing different fields.

The winauth export file gives a totp url

otpauth://totp/BattleNet:Battle.net?secret=X&digits=8&issuer=BattleNet&serial=EUXXX

yoshimo avatar Jun 22 '20 10:06 yoshimo

Blizzards Mobile App stores it in /data/data/com.Blizzard.bma/sharred_prefs/com.blizzard.bma.AUTH_STORE.xml

The secret to decoding this can be found at https://gist.github.com/stbuehler/8616943 https://github.com/jleclanche/python-bna

yoshimo avatar Jun 22 '20 18:06 yoshimo

Another good source: https://github.com/andOTP/andOTP/wiki/Shared-secrets#battlenet

beerisgood avatar Nov 14 '20 00:11 beerisgood

@07416 Don't quote me out of context. I was obviously talking about https://bitbucket.org/sednogmah/foobma/src, not Battle.net Authenticator itself.

alexbakker avatar Apr 19 '21 10:04 alexbakker

@alexbakker I apologize, to be frank the main reason for commenting was to bring more attention towards the feature request.

I'll delete the comment.

ghost avatar Apr 19 '21 11:04 ghost

We currently don't have plans to implement this feature ourselves, but if anyone is interested in picking this up, let us know. Note that we're just talking about importing from the Battle.net Authenticator Android app here.

alexbakker avatar Aug 25 '21 12:08 alexbakker

I have made a solution for importing Battle.net Authenticator and would like to know if you are still interested in having the importer, if so, I can make the importer, here is the repository of the java implementation https://github.com/JordanPlayz158/BMA-TOTP

JordanPlayz158 avatar Nov 21 '22 06:11 JordanPlayz158

Does that read a file from the internal storage of the Battle.net Authenticator app? If so, sure! A pull request would be welcome.

alexbakker avatar Nov 21 '22 08:11 alexbakker

It is implemented to read the AUTH_STORE file (which is located at /data/data/com.blizzard.bma/shared_prefs/com.blizzard.bma.AUTH_STORE.xml) so all I need to do is rather than have it ask for a file, have it grab the file using root although will the apache codec dependency be an issue (or perhaps android has base 16 to base 32 classes like it appears it has an xml parser)

JordanPlayz158 avatar Nov 21 '22 17:11 JordanPlayz158

It is implemented to read the AUTH_STORE file (which is located at /data/data/com.blizzard.bma/shared_prefs/com.blizzard.bma.AUTH_STORE.xml)

Sounds good.

will the apache codec dependency be an issue (or perhaps android has base 16 to base 32 classes like it appears it has an xml parser)

Let's try to avoid adding additional dependencies. You can use Aegis' Hex and Base32 wrapper classes. With regards to XML, try to see if the utility function we have for parsing shared preferences files suffice. Otherwise, please directly use the XML parser package included with Android (org.xmlpull).

alexbakker avatar Nov 21 '22 17:11 alexbakker