Merge pull request #869 from RandomRoot/feature-yandexotp

Feature: Add Yandex OTP support
This commit is contained in:
Alexander Bakker 2022-02-02 13:40:48 +01:00 committed by GitHub
commit 76c89f0fcc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 541 additions and 61 deletions

View file

@ -28,6 +28,7 @@ import com.beemdevelopment.aegis.encoding.Base32;
import com.beemdevelopment.aegis.otp.HotpInfo;
import com.beemdevelopment.aegis.otp.SteamInfo;
import com.beemdevelopment.aegis.otp.TotpInfo;
import com.beemdevelopment.aegis.otp.YandexInfo;
import com.beemdevelopment.aegis.ui.MainActivity;
import com.beemdevelopment.aegis.vault.VaultEntry;
import com.beemdevelopment.aegis.vault.VaultManager;
@ -68,7 +69,8 @@ public class OverallTest extends AegisTest {
generateEntry(TotpInfo.class, "Frank", "Google"),
generateEntry(HotpInfo.class, "John", "GitHub"),
generateEntry(TotpInfo.class, "Alice", "Office 365"),
generateEntry(SteamInfo.class, "Gaben", "Steam")
generateEntry(SteamInfo.class, "Gaben", "Steam"),
generateEntry(YandexInfo.class, "Ivan", "Yandex")
);
for (VaultEntry entry : entries) {
addEntry(entry);
@ -171,6 +173,8 @@ public class OverallTest extends AegisTest {
otpType = "Steam";
} else if (entry.getInfo() instanceof TotpInfo) {
otpType = "TOTP";
} else if (entry.getInfo() instanceof YandexInfo) {
otpType = "Yandex";
} else {
throw new RuntimeException(String.format("Unexpected entry type: %s", entry.getInfo().getClass().getSimpleName()));
}