diff --git a/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Constants.java b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Constants.java index c9ed2137..db7d16f7 100644 --- a/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Constants.java +++ b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Constants.java @@ -106,6 +106,7 @@ public class Constants { /** Default Mobile BKU URL */ public static final URI MOBILE_BKU_URL = URI.create("https://service.a-trust.at/mobile/https-security-layer-request/default.aspx"); + public static final URI MOBILE_BKU_URL_TEST = URI.create("https://hs-abnahme.a-trust.at/mobile/https-security-layer-request/default.aspx"); /** How far to displace the signature with the arrow keys */ public static final int SIGNATURE_KEYBOARD_POSITIONING_OFFSET = 15; diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Main.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Main.java index 5ccfa80b..75f34fa7 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Main.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Main.java @@ -32,7 +32,28 @@ */ @Slf4j public class Main { -// private static URL url=null; + + public static StateMachine setup(String[] args) { + log.info("This is " + Constants.APP_NAME_VERSION + ", " + + "running on " + System.getProperty("os.arch") + " " + System.getProperty("os.name") + ", " + + "powered by "+ System.getProperty("java.vendor") + " Java " + System.getProperty("java.version") + "."); + File configDir = new File(Constants.CONFIG_DIRECTORY); + + if (!configDir.exists()) { + configDir.mkdir(); + } + + // force loading the IAIK JCE (cf. #95) + IAIK.addAsProvider(); + + // force keystore type (Adoptium JRE 17 still ships with JKS, cf. #95) + System.setProperty("javax.net.ssl.trustStoreType", "jks"); + + // disable display scaling for AWT components embedded in SWT (cf. #106) + System.setProperty("sun.java2d.uiScale", "1"); + + return new StateMachine(args); + } /** * @param args @@ -40,26 +61,9 @@ public class Main { */ public static void main(String[] args) throws IOException { try { - log.info("This is " + Constants.APP_NAME_VERSION + ", " + - "running on " + System.getProperty("os.arch") + " " + System.getProperty("os.name") + ", " + - "powered by "+ System.getProperty("java.vendor") + " Java " + System.getProperty("java.version") + "."); - File configDir = new File(Constants.CONFIG_DIRECTORY); - - if (!configDir.exists()) { - configDir.mkdir(); - } - - // force loading the IAIK JCE (cf. #95) - IAIK.addAsProvider(); - - // force keystore type (Adoptium JRE 17 still ships with JKS, cf. #95) - System.setProperty("javax.net.ssl.trustStoreType", "jks"); - - // disable display scaling for AWT components embedded in SWT (cf. #106) - System.setProperty("sun.java2d.uiScale", "1"); - + StateMachine sm = setup(args); log.debug("Starting stateMachine ..."); - (new StateMachine(args)).start(); + sm.start(); log.debug("Ended stateMachine ..."); } catch (Throwable e) { diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUEnterNumberComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUEnterNumberComposite.java index e9c6e85c..2ef43b46 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUEnterNumberComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUEnterNumberComposite.java @@ -153,15 +153,15 @@ public MobileBKUEnterNumberComposite(Composite parent, int style, State state) { containerComposite.setLayout(new FormLayout()); SWTUtils.anchor(containerComposite).top(50, -120).bottom(50, 120).left(50, -200).right(50, 200); + this.lbl_number = new Label(containerComposite, SWT.NATIVE); + this.lbl_number.setAlignment(SWT.RIGHT); + SWTUtils.anchor(lbl_number).bottom(50, -10).right(50, -10); + this.txt_number = new Text(containerComposite, SWT.SINGLE | SWT.NATIVE | SWT.BORDER); SWTUtils.anchor(txt_number).bottom(50, -10).left(50, 10).right(100, -20); this.txt_number.setEditable(true); SWTUtils.addFocusGainedListener(txt_number, () -> { txt_number.selectAll(); }); - this.lbl_number = new Label(containerComposite, SWT.NATIVE); - this.lbl_number.setAlignment(SWT.RIGHT); - SWTUtils.anchor(lbl_number).bottom(50, -10).right(50, -10); - ImageData mobileIconData = new ImageData(this.getClass().getResourceAsStream(Constants.RES_IMG_MOBILE)).scaledTo(90, 90); Image mobileIcon = new Image(getDisplay(), mobileIconData); @@ -169,15 +169,15 @@ public MobileBKUEnterNumberComposite(Composite parent, int style, State state) { SWTUtils.anchor(lbl_image).top(20, -1 * (mobileIconData.width / 2)).bottom(20, mobileIconData.width / 2).left(0, 10).width(mobileIconData.width); lbl_image.setImage(mobileIcon); + this.lbl_password = new Label(containerComposite, SWT.NATIVE); + SWTUtils.anchor(lbl_password).top(50, 10).right(50, -10); + this.lbl_password.setAlignment(SWT.RIGHT); + this.txt_password = new Text(containerComposite, SWT.SINGLE | SWT.PASSWORD | SWT.BORDER | SWT.NATIVE); SWTUtils.anchor(txt_password).top(50, 10).left(50, 10).right(100, -20); this.txt_password.setEditable(true); SWTUtils.addFocusGainedListener(txt_password, () -> { txt_password.selectAll(); }); - this.lbl_password = new Label(containerComposite, SWT.NATIVE); - SWTUtils.anchor(lbl_password).top(50, 10).right(50, -10); - this.lbl_password.setAlignment(SWT.RIGHT); - this.btn_ok = new Button(containerComposite, SWT.NATIVE); SWTUtils.anchor(btn_ok).bottom(100, -20).right(100, -20); this.btn_ok.addSelectionListener(this.okListener);