From 03b9af56efaec1adecfadc09327a14dc116a9c3a Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Tue, 5 Nov 2019 16:20:44 +0100 Subject: support of all cases when pressing the sms tan button --- .../asit/pdfover/gui/bku/mobile/ATrustHandler.java | 20 ++++++++++---------- .../at/asit/pdfover/gui/bku/mobile/IAIKHandler.java | 3 ++- .../pdfover/gui/bku/mobile/MobileBKUHandler.java | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java index 2c6f0e55..7d3f986a 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java @@ -452,11 +452,10 @@ public class ATrustHandler extends MobileBKUHandler { public Boolean handleWaitforAppResponse(String responseData) { getStatus().setErrorMessage(null); - if (!responseData.contains("Bitte starten Sie Ihre")) { //$NON-NLS-1$ - //getSigningState().setSignatureResponse( - // new SLResponse(responseData, getStatus().getServer(), null, null)); + if (!responseData.toLowerCase().contains("Bitte starten Sie Ihre Handy-Signatur App!".toLowerCase())/* || //$NON-NLS-1$ + responseData.toLowerCase().contains("TAN (Handy-Signatur App)".toLowerCase())*/) { //$NON-NLS-1$ + return true; - } return false; } @@ -497,14 +496,15 @@ public class ATrustHandler extends MobileBKUHandler { * */ @Override - public void handlePolling(String responseData) throws ATrustConnectionException { - + public boolean handlePolling() throws ATrustConnectionException { + ATrustStatus status = getStatus(); URLConnection urlconnection = null; String isReady = null; Status serverStatus = null; int waits = 0; final String ERROR = "Error: Server is not responding"; //$NON-NLS-1$ + try { do { @@ -527,11 +527,11 @@ public class ATrustHandler extends MobileBKUHandler { if (serverStatus.isFin()) { String response = getSignaturePage(); handleCredentialsResponse(response); - } else { - status.setErrorMessage("Server reponded ERROR during polling"); //$NON-NLS-1$ - log.error("Server reponded ERROR during polling"); //$NON-NLS-1$ - throw new ATrustConnectionException(); + return true; } + status.setErrorMessage("Server reponded ERROR during polling"); //$NON-NLS-1$ + log.error("Server reponded ERROR during polling"); //$NON-NLS-1$ + throw new ATrustConnectionException(); } catch (Exception e) { log.error("handle polling failed" + e.getMessage()); //$NON-NLS-1$ diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/IAIKHandler.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/IAIKHandler.java index efb2b37d..2595de44 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/IAIKHandler.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/IAIKHandler.java @@ -362,7 +362,8 @@ public class IAIKHandler extends MobileBKUHandler { } @Override - public void handlePolling(String responseData) { + public boolean handlePolling() { //nothing todo + return true; } } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/MobileBKUHandler.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/MobileBKUHandler.java index 3ab47941..4c09c02d 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/MobileBKUHandler.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/MobileBKUHandler.java @@ -356,5 +356,5 @@ public abstract class MobileBKUHandler { /** * @param responseData */ - public abstract void handlePolling(String responseData) throws ATrustConnectionException; + public abstract boolean handlePolling() throws ATrustConnectionException; } -- cgit v1.2.3