diff --git a/tool/src/main/java/com/fidesmo/fdsm/CommandLineInterface.java b/tool/src/main/java/com/fidesmo/fdsm/CommandLineInterface.java index 35c5ca9..2a6e271 100644 --- a/tool/src/main/java/com/fidesmo/fdsm/CommandLineInterface.java +++ b/tool/src/main/java/com/fidesmo/fdsm/CommandLineInterface.java @@ -75,8 +75,7 @@ abstract class CommandLineInterface { final static protected OptionSpec OPT_APP_ID = parser.accepts("app-id", "Application identifier") .availableIf(OPT_STORE_DATA, OPT_SECURE_APDU, OPT_UNINSTALL, OPT_INSTALL, OPT_UPLOAD, OPT_CLEANUP, OPT_LIST_APPLETS, OPT_FLUSH_APPLETS, OPT_DELETE) - .withRequiredArg().describedAs("appId"); - final static protected OptionSpec OPT_QA = parser.accepts("qa", "Run a QA support session").withOptionalArg().ofType(Integer.class).describedAs("QA number"); + .withRequiredArg().describedAs("appId"); final static protected OptionSpec OPT_TIMEOUT = parser.accepts("timeout", "Timeout for services").withRequiredArg().ofType(Integer.class).describedAs("minutes"); final static protected OptionSpec OPT_IGNORE_IMPLICIT_BATCHING = parser.accepts("ignore-implicit-batching", "Require explicit batching if not a Fidesmo device"); @@ -152,7 +151,7 @@ protected static OptionSet parseArguments(String[] argv) throws IOException { public static boolean requiresCard() { OptionSpec[] commands = new OptionSpec[]{ - OPT_INSTALL, OPT_UNINSTALL, OPT_STORE_DATA, OPT_SECURE_APDU, OPT_RUN, OPT_CARD_APPS, OPT_CARD_INFO, OPT_QA + OPT_INSTALL, OPT_UNINSTALL, OPT_STORE_DATA, OPT_SECURE_APDU, OPT_RUN, OPT_CARD_APPS, OPT_CARD_INFO }; return Arrays.stream(commands).anyMatch(args::has); } diff --git a/tool/src/main/java/com/fidesmo/fdsm/Main.java b/tool/src/main/java/com/fidesmo/fdsm/Main.java index 5056bfc..f560261 100644 --- a/tool/src/main/java/com/fidesmo/fdsm/Main.java +++ b/tool/src/main/java/com/fidesmo/fdsm/Main.java @@ -60,8 +60,6 @@ import java.util.stream.StreamSupport; public class Main extends CommandLineInterface { - static final String FDSM_SP = "8e5cdaae"; - public static void main(String[] argv) { System.setProperty("org.slf4j.simpleLogger.showThreadName", "true"); System.setProperty("org.slf4j.simpleLogger.levelInBrackets", "true"); @@ -292,28 +290,6 @@ public static void main(String[] argv) { APDUBIBO bibo = new APDUBIBO(CardBIBO.wrap(card)); Optional fidesmoMetadata = (args.has(OPT_OFFLINE) || args.has(OPT_IGNORE_IMPLICIT_BATCHING)) ? FidesmoCard.detectOffline(bibo) : FidesmoCard.detectOnline(bibo, client); - // Allows to run with any card - if (args.has(OPT_QA)) { - String number = Integer.toString(ThreadLocalRandom.current().nextInt(900000) + 100000).substring(0, 6); - if (args.valueOf(OPT_QA) != null) { - number = args.valueOf(OPT_QA).toString(); - } else { - System.out.printf("Your QA number is %s-%s%n", number.substring(0, 3), number.substring(3, 6)); - } - FormHandler formHandler = getCommandLineFormHandler(); - - ServiceDeliverySession cardSession = ServiceDeliverySession.getInstance(() -> bibo, fidesmoMetadata.orElseGet(FidesmoCard::dummy), client, FDSM_SP, number, formHandler); - - if (args.has(OPT_TIMEOUT)) - cardSession.setTimeoutMinutes(args.valueOf(OPT_TIMEOUT)); - CancellationWaitingFuture deliveryTask = new CancellationWaitingFuture<>(cardSession); - - if (!ServiceDeliverySession.deliverService(deliveryTask).isSuccess()) { - fail("Failed to run service"); - } else { - success(); - } - } System.out.println("Using card in " + terminal.getName()); // Can be used always