Swiftpack.co - shalva97/google-auth-decode as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by shalva97.
shalva97/google-auth-decode v0.0.9
Decode Google Authenticator URI
⭐️ 9
🕓 3 weeks ago
macOS
.package(url: "https://github.com/shalva97/google-auth-decode.git", from: "v0.0.9")

About

This library will help you to decode Google Auth's URI which looks like this

otpauth-migration://offline?data=ChsKApHREgphc3M6dG9pbGV0GgNhc3MgASgBMAIQARgBIAAo05KP1%2F3%2F%2F%2F%2F%2FAQ%3D%3D

CLI

Download the executables and run them or use the web version from about section. For example download jar from the latest release page and run it:

$ java -jar google-auth-decode-0.0.12-all.jar "otpauth-migration://offline?data=Cj8KFD3GyqSCSm0oh2eyMx4gtDFmy4XZEhhBQ01FIENvOmpvaG5AZXhhbXBsZS5jb20aB0FDTUUgQ28gASgBMAIKWQoUmWnif8JDwjlbrmF6aCME%2FSEWkVkSJUtvdGxpbiBnb29kIGphdmEgYmFkOmpvaG5AZXhhbXBsZS5jb20aFEtvdGxpbiBnb29kIGphdmEgYmFkIAEoATACCjkKFE62Apiv1fDVj9%2Fm5dEtIK60BBmfEhVCbGFoOmpvaG5AZXhhbXBsZS5jb20aBEJsYWggASgBMAIKOQoU%2FPHoXjuc6zFhB5ahA9TzNUCu7SwSFWFzZGY6am9obkBleGFtcGxlLmNvbRoEYXNkZiABKAEwAhABGAEgACiHg9OF%2Bf%2F%2F%2F%2F8B"
OTPData(name=ACME Co:[email protected], algorithm=ALGORITHM_SHA1, issuer=ACME Co, secret=HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ, type=TOTP)
OTPData(name=Kotlin good java bad:[email protected], algorithm=ALGORITHM_SHA1, issuer=Kotlin good java bad, secret=TFU6E76CIPBDSW5OMF5GQIYE7UQRNEKZ, type=TOTP)
OTPData(name=Blah:[email protected], algorithm=ALGORITHM_SHA1, issuer=Blah, secret=J23AFGFP2XYNLD6743S5CLJAV22AIGM7, type=TOTP)
OTPData(name=asdf:[email protected], algorithm=ALGORITHM_SHA1, issuer=asdf, secret=7TY6QXR3TTVTCYIHS2QQHVHTGVAK53JM, type=TOTP)

Install

Step 1. Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

or in settings.gradle

dependencyResolutionManagement {
    ...
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}

Step 2. Add the dependency

implementation("com.github.shalva97:google-auth-decode:0.0.19")

Usage

There is an extension fun String.decodeGoogleAuthMigrationURI(), which you can use like this

val listOfOTPs = "otpauth-migration://offline?data=...".decodeGoogleAuthMigrationURI()
listOfOTPs // will be a list of all the OTP data contained in the URI

// java
String uriText = "otpauth-migration://offline?data=...";
var listOfOTPs = GoogleAuthDecoderKt.decodeGoogleAuthMigrationURI(uriText);

Build from source

clone the repository and in the project directory run ./gradlew shadowjar then inside build/libs folder should be a jar file which you can run with java -jar filename-all.jar "otpauth-..."

Similar projects

GitHub

link
Stars: 9
Last commit: 16 hours ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

version v0.0.19
19 hours ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics