diff options
Diffstat (limited to 'pdf-over-gui')
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java | 3 | ||||
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustParser.java | 14 |
2 files changed, 17 insertions, 0 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java index f9108b7d..779e24c6 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java @@ -312,6 +312,9 @@ public class MobileBKUConnector implements BkuSlConnector { return new HttpGet(html.fido2Link); } + if (html.autoSkipBlock != null) { + return buildFormSubmit(html, html.autoSkipBlock.submitButton); + } if (html.interstitialBlock != null) { this.state.showInformationMessage(html.interstitialBlock.interstitialMessage); return buildFormSubmit(html, html.interstitialBlock.submitButton); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustParser.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustParser.java index 843a1881..89f53629 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustParser.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustParser.java @@ -74,6 +74,17 @@ public class ATrustParser { } } + public static class AutoSkipBlock extends TopLevelFormBlock { + public final @Nonnull String submitButton; + + private AutoSkipBlock(@Nonnull org.jsoup.nodes.Document htmlDocument, @Nonnull Map<String, String> formOptions) throws ComponentParseFailed { + super(htmlDocument, formOptions); + if (htmlDocument.baseUri().contains("/tanAppInfo.aspx")) { + this.submitButton = "#NextBtn"; + } else { throw new ComponentParseFailed(); } + } + } + public static class InterstitialBlock extends TopLevelFormBlock { public final @Nonnull String submitButton; public final @Nonnull String interstitialMessage; @@ -223,6 +234,7 @@ public class ATrustParser { public final @CheckForNull URI fido2Link; /* top-level blocks (exactly one is not null) */ + public final @CheckForNull AutoSkipBlock autoSkipBlock; public final @CheckForNull InterstitialBlock interstitialBlock; public final @CheckForNull ErrorBlock errorBlock; public final @CheckForNull UsernamePasswordBlock usernamePasswordBlock; @@ -235,6 +247,7 @@ public class ATrustParser { private void validate() { Set<String> populated = new HashSet<>(); + if (autoSkipBlock != null) populated.add("autoSkipBlock"); if (interstitialBlock != null) populated.add("interstitialBlock"); if (errorBlock != null) populated.add("errorBlock"); if (usernamePasswordBlock != null) populated.add("usernamePasswordBlock"); @@ -321,6 +334,7 @@ public class ATrustParser { this.smsTanLink = getHrefIfExists("#SmsButton"); this.fido2Link = getHrefIfExists("#FidoButton"); // TODO hide the button if unsupported? + this.autoSkipBlock = TryParseMainBlock(AutoSkipBlock.class); this.interstitialBlock = TryParseMainBlock(InterstitialBlock.class); this.errorBlock = TryParseMainBlock(ErrorBlock.class); this.usernamePasswordBlock = TryParseMainBlock(UsernamePasswordBlock.class); |