diff options
author | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-11-21 10:35:14 +0100 |
---|---|---|
committer | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-11-21 10:35:14 +0100 |
commit | 57fabe17efe887abc14affaa8fb008e98499493f (patch) | |
tree | c880cdfeb667f7a7ea961e3a46afad6f7279fa91 /pdf-over-gui/src | |
parent | b12aa661dda123c764de0e0cc6753daba070e6df (diff) | |
download | pdf-over-57fabe17efe887abc14affaa8fb008e98499493f.tar.gz pdf-over-57fabe17efe887abc14affaa8fb008e98499493f.tar.bz2 pdf-over-57fabe17efe887abc14affaa8fb008e98499493f.zip |
auto-skip app interstitial
Diffstat (limited to 'pdf-over-gui/src')
-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); |