├── .gitignore ├── entrypoint.sh ├── docs ├── Screenshot_1.png ├── LPA Simulator.docx ├── LPA Simulator_0.1.2.11.pdf ├── LPA Simulator_0.1.2.18.pdf ├── LPA Simulator_0.1.2.11.docx ├── LPA Simulator_0.1.2.14.docx └── LPA Simulator_0.1.2.18.docx ├── src └── main │ ├── resources │ ├── info.jpg │ ├── scan.jpg │ ├── scanqr.png │ ├── wait.gif │ ├── wait_2.gif │ ├── question.png │ ├── refresh.png │ ├── tru_logo.ico │ ├── tru_logo.png │ ├── gsma_esim.png │ ├── tru_logo.icns │ ├── wait_small.gif │ ├── filtered │ │ └── build.properties │ ├── truphone-brand-small.png │ ├── iconfinder_qrcode_1608801.png │ ├── iconfinder_qrcode_1608801-2.png │ ├── mac │ │ └── logging.properties │ ├── windows │ │ └── logging.properties │ └── logback.xml │ └── java │ └── com │ └── truphone │ └── lpap │ ├── TableMouseListener.java │ ├── qrcode │ ├── WebcamHandler.java │ ├── WebcamQRCodeScanner.java │ └── QRCodeComponent.java │ ├── HexHelper.java │ ├── card │ ├── CardTerminalHandler.java │ └── ApduChannelImpl.java │ ├── DialogHelper.java │ ├── info │ ├── InfoProvider.java │ ├── AboutDialog.form │ └── AboutDialog.java │ ├── WaitingDialog.form │ ├── mainUI.java │ ├── LpaSrc.java │ ├── WaitingDialog.java │ ├── MessageDialog.java │ ├── MessageDialog.form │ ├── ConfirmDialog.java │ ├── ConfirmDialog.form │ ├── InputDialog.form │ ├── InputDialog.java │ ├── InputActivationCodeDialog.form │ ├── InputActivationCodeDialog.java │ └── LPAUI.form ├── docker-compose.yaml ├── Dockerfile ├── .github └── workflows │ └── docker-compose.yml ├── nbactions.xml ├── nbactions-release-profile.xml ├── README.md ├── pom.xml └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | target/ -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd /usr/src/LPAdesktop 3 | mvn install 4 | -------------------------------------------------------------------------------- /docs/Screenshot_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparkcyf/LPAdesktop/HEAD/docs/Screenshot_1.png -------------------------------------------------------------------------------- /docs/LPA Simulator.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparkcyf/LPAdesktop/HEAD/docs/LPA Simulator.docx -------------------------------------------------------------------------------- /src/main/resources/info.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparkcyf/LPAdesktop/HEAD/src/main/resources/info.jpg -------------------------------------------------------------------------------- /src/main/resources/scan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparkcyf/LPAdesktop/HEAD/src/main/resources/scan.jpg -------------------------------------------------------------------------------- /src/main/resources/scanqr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparkcyf/LPAdesktop/HEAD/src/main/resources/scanqr.png -------------------------------------------------------------------------------- /src/main/resources/wait.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparkcyf/LPAdesktop/HEAD/src/main/resources/wait.gif -------------------------------------------------------------------------------- /src/main/resources/wait_2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparkcyf/LPAdesktop/HEAD/src/main/resources/wait_2.gif -------------------------------------------------------------------------------- /docs/LPA Simulator_0.1.2.11.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparkcyf/LPAdesktop/HEAD/docs/LPA Simulator_0.1.2.11.pdf -------------------------------------------------------------------------------- /docs/LPA Simulator_0.1.2.18.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparkcyf/LPAdesktop/HEAD/docs/LPA Simulator_0.1.2.18.pdf -------------------------------------------------------------------------------- /src/main/resources/question.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparkcyf/LPAdesktop/HEAD/src/main/resources/question.png -------------------------------------------------------------------------------- /src/main/resources/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparkcyf/LPAdesktop/HEAD/src/main/resources/refresh.png -------------------------------------------------------------------------------- /src/main/resources/tru_logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparkcyf/LPAdesktop/HEAD/src/main/resources/tru_logo.ico -------------------------------------------------------------------------------- /src/main/resources/tru_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparkcyf/LPAdesktop/HEAD/src/main/resources/tru_logo.png -------------------------------------------------------------------------------- /docs/LPA Simulator_0.1.2.11.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparkcyf/LPAdesktop/HEAD/docs/LPA Simulator_0.1.2.11.docx -------------------------------------------------------------------------------- /docs/LPA Simulator_0.1.2.14.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparkcyf/LPAdesktop/HEAD/docs/LPA Simulator_0.1.2.14.docx -------------------------------------------------------------------------------- /docs/LPA Simulator_0.1.2.18.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparkcyf/LPAdesktop/HEAD/docs/LPA Simulator_0.1.2.18.docx -------------------------------------------------------------------------------- /src/main/resources/gsma_esim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparkcyf/LPAdesktop/HEAD/src/main/resources/gsma_esim.png -------------------------------------------------------------------------------- /src/main/resources/tru_logo.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparkcyf/LPAdesktop/HEAD/src/main/resources/tru_logo.icns -------------------------------------------------------------------------------- /src/main/resources/wait_small.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparkcyf/LPAdesktop/HEAD/src/main/resources/wait_small.gif -------------------------------------------------------------------------------- /src/main/resources/filtered/build.properties: -------------------------------------------------------------------------------- 1 | build.version=${pom.version} 2 | build.date=${timestamp} 3 | build.name=${pom.name} 4 | -------------------------------------------------------------------------------- /src/main/resources/truphone-brand-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparkcyf/LPAdesktop/HEAD/src/main/resources/truphone-brand-small.png -------------------------------------------------------------------------------- /src/main/resources/iconfinder_qrcode_1608801.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparkcyf/LPAdesktop/HEAD/src/main/resources/iconfinder_qrcode_1608801.png -------------------------------------------------------------------------------- /src/main/resources/iconfinder_qrcode_1608801-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sparkcyf/LPAdesktop/HEAD/src/main/resources/iconfinder_qrcode_1608801-2.png -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | lpadesktop: 4 | build: 5 | context: . 6 | dockerfile: Dockerfile 7 | volumes: 8 | - ./target:/usr/src/LPAdesktop/target 9 | 10 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8 2 | COPY . /usr/src/LPAdesktop 3 | RUN apt update 4 | RUN apt install maven genisoimage -y 5 | 6 | WORKDIR /usr/src/ 7 | RUN git clone https://github.com/Truphone/LPAd_SM-DPPlus_Connector.git 8 | WORKDIR /usr/src/LPAd_SM-DPPlus_Connector 9 | RUN mvn install 10 | WORKDIR /usr/src/LPAdesktop 11 | RUN mvn install 12 | RUN chmod +x /usr/src/LPAdesktop/entrypoint.sh 13 | CMD ["/usr/src/LPAdesktop/entrypoint.sh"] 14 | -------------------------------------------------------------------------------- /src/main/resources/mac/logging.properties: -------------------------------------------------------------------------------- 1 | handlers= java.util.logging.ConsoleHandler,java.util.logging.FileHandler 2 | 3 | java.util.logging.ConsoleHandler.level = INFO 4 | java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter 5 | java.util.logging.SimpleFormatter.format=[%1$tF %1$tT] [%4$-7s] %5$s %n 6 | 7 | 8 | java.util.logging.FileHandler.level = INFO 9 | java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter 10 | java.util.logging.FileHandler.format=[%1$tF %1$tT] [%4$-7s] %5$s %n 11 | java.util.logging.FileHandler.append = true 12 | java.util.logging.FileHandler.pattern = /tmp/lpa_log.txt -------------------------------------------------------------------------------- /src/main/resources/windows/logging.properties: -------------------------------------------------------------------------------- 1 | handlers= java.util.logging.ConsoleHandler,java.util.logging.FileHandler 2 | 3 | java.util.logging.ConsoleHandler.level = INFO 4 | java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter 5 | java.util.logging.SimpleFormatter.format=[%1$tF %1$tT] [%4$-7s] %5$s %n 6 | 7 | 8 | java.util.logging.FileHandler.level = INFO 9 | java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter 10 | java.util.logging.FileHandler.format=[%1$tF %1$tT] [%4$-7s] %5$s %n 11 | java.util.logging.FileHandler.append = true 12 | java.util.logging.FileHandler.pattern = lpa_log.txt -------------------------------------------------------------------------------- /.github/workflows/docker-compose.yml: -------------------------------------------------------------------------------- 1 | name: build LPADesktop 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: [ "master" ] 7 | pull_request: 8 | branches: [ "master" ] 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v3 15 | 16 | - name: install depdency 17 | run: sudo apt update && sudo apt-get -y install zip 18 | 19 | - name: docker-compose 20 | run: docker-compose up 21 | 22 | - name: zip artifacts 23 | run: zip lpadesktop.zip -r target 24 | 25 | - name: Release 26 | uses: softprops/action-gh-release@v1 27 | with: 28 | tag_name: lpad 29 | name: ${{ github.sha }} 30 | files: lpadesktop.zip 31 | 32 | -------------------------------------------------------------------------------- /src/main/java/com/truphone/lpap/TableMouseListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package com.truphone.lpap; 7 | 8 | import java.awt.Point; 9 | import java.awt.event.MouseAdapter; 10 | import java.awt.event.MouseEvent; 11 | 12 | import javax.swing.JTable; 13 | 14 | /** 15 | * A mouse listener for a JTable component. 16 | * @author www.codejava.neet 17 | * 18 | */ 19 | public class TableMouseListener extends MouseAdapter { 20 | 21 | private JTable table; 22 | 23 | public TableMouseListener(JTable table) { 24 | this.table = table; 25 | } 26 | 27 | @Override 28 | public void mousePressed(MouseEvent event) { 29 | // selects the row at which point the mouse is clicked 30 | Point point = event.getPoint(); 31 | int currentRow = table.rowAtPoint(point); 32 | table.setRowSelectionInterval(currentRow, currentRow); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/com/truphone/lpap/qrcode/WebcamHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package com.truphone.lpap.qrcode; 7 | 8 | import com.github.sarxos.webcam.Webcam; 9 | import java.util.HashMap; 10 | import java.util.LinkedList; 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | /** 15 | * 16 | * @author frederico.palma 17 | */ 18 | public class WebcamHandler { 19 | 20 | private static final String NO_CAMERA = "No Camera"; 21 | 22 | private static final Map webcamByNameMap = new HashMap<>(); 23 | 24 | private static final List webcamNames = new LinkedList<>(); 25 | 26 | private WebcamHandler() {} 27 | 28 | public static List getWebcamNames(final boolean forceRefresh) { 29 | if (forceRefresh || webcamNames.isEmpty()) { 30 | refreshList(); 31 | } 32 | return new LinkedList<>(webcamNames); 33 | } 34 | 35 | private static void refreshList() { 36 | final List webcams = Webcam.getWebcams(); 37 | 38 | webcamByNameMap.clear(); 39 | webcamNames.clear(); 40 | 41 | webcamNames.add(NO_CAMERA); 42 | 43 | for (Webcam webcam : webcams) { 44 | String name = webcam.getName(); 45 | webcamByNameMap.put(name, webcam); 46 | webcamNames.add(name); 47 | } 48 | } 49 | 50 | public static Webcam getWebcamByName(final String name) { 51 | return webcamByNameMap.get(name); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/truphone/lpap/HexHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package com.truphone.lpap; 7 | 8 | /** 9 | * 10 | * @author frederico.palma 11 | */ 12 | public class HexHelper { 13 | 14 | public static String swapNibblesOnString(final String in) { 15 | final StringBuilder result = new StringBuilder(); 16 | 17 | for (int i = 0; i < in.length(); i += 2) { 18 | result.append(in.charAt(i + 1)); 19 | result.append(in.charAt(i)); 20 | } 21 | 22 | return result.toString(); 23 | } 24 | 25 | public static String byteArrayToHex(final byte[] bytes) { 26 | final StringBuilder sb = new StringBuilder(); 27 | 28 | for (byte b : bytes) { 29 | sb.append(String.format("%02x", b)); 30 | } 31 | 32 | return sb.toString(); 33 | } 34 | 35 | public static byte[] hexStringToByteArray(final String hex) { 36 | if (hex == null) { 37 | return null; 38 | } 39 | 40 | String prepared = hex.replaceAll(" ", "").replaceAll(":", "").replaceAll("0x", "").replaceAll("0X", ""); 41 | if (prepared.length() % 2 != 0){ 42 | throw new IllegalArgumentException("The Hex String length cannot be odd."); 43 | } 44 | 45 | final byte[] output = new byte[prepared.length() / 2]; 46 | for (int i = 0; i < prepared.length(); i += 2) { 47 | output[(i / 2)] = ((byte) Integer.parseInt(prepared.substring(i, i + 2), 16)); 48 | } 49 | return output; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | %d{ISO8601}|%X{sessionId}|%t|%p|%m|%throwable{1}%n 11 | 12 | 13 | 14 | 15 | 16 | true 17 | 18 | 19 | 20 | ${LOG_PATH}/logFile.%d{yyyyMMdd}.log 21 | 22 | 23 | 30 24 | 3GB 25 | 26 | 27 | 28 | %d{ISO8601}|%X{sessionId}|%t|%p|%c{1}|%m|%throwable{1}%n 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /nbactions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | run 5 | 6 | jar 7 | 8 | 9 | process-classes 10 | org.codehaus.mojo:exec-maven-plugin:1.2.1:exec 11 | 12 | 13 | -classpath %classpath com.truphone.lpap.mainUI 14 | java 15 | 16 | 17 | 18 | debug 19 | 20 | jar 21 | 22 | 23 | process-classes 24 | org.codehaus.mojo:exec-maven-plugin:1.2.1:exec 25 | 26 | 27 | -Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath com.truphone.lpap.mainUI 28 | java 29 | true 30 | 31 | 32 | 33 | profile 34 | 35 | jar 36 | 37 | 38 | process-classes 39 | org.codehaus.mojo:exec-maven-plugin:1.2.1:exec 40 | 41 | 42 | -classpath %classpath com.truphone.lpap.mainUI 43 | java 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /nbactions-release-profile.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | run 5 | 6 | jar 7 | 8 | 9 | process-classes 10 | org.codehaus.mojo:exec-maven-plugin:1.2.1:exec 11 | 12 | 13 | -classpath %classpath com.truphone.lpap.main 14 | java 15 | 16 | 17 | 18 | debug 19 | 20 | jar 21 | 22 | 23 | process-classes 24 | org.codehaus.mojo:exec-maven-plugin:1.2.1:exec 25 | 26 | 27 | -Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath com.truphone.lpap.main 28 | java 29 | true 30 | 31 | 32 | 33 | profile 34 | 35 | jar 36 | 37 | 38 | process-classes 39 | org.codehaus.mojo:exec-maven-plugin:1.2.1:exec 40 | 41 | 42 | -classpath %classpath com.truphone.lpap.main 43 | java 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/main/java/com/truphone/lpap/card/CardTerminalHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package com.truphone.lpap.card; 7 | 8 | import java.util.LinkedList; 9 | import java.util.List; 10 | import java.util.logging.Logger; 11 | import javax.smartcardio.CardException; 12 | import javax.smartcardio.CardTerminal; 13 | import javax.smartcardio.CardTerminals; 14 | import javax.smartcardio.TerminalFactory; 15 | 16 | /** 17 | * 18 | * @author frederico.palma 19 | */ 20 | public class CardTerminalHandler { 21 | 22 | private static final java.util.logging.Logger LOG = Logger.getLogger(CardTerminalHandler.class.getName()); 23 | 24 | private static final List cardTerminalNames = new LinkedList<>(); 25 | 26 | private static CardTerminals cardTerminals = null; 27 | 28 | private CardTerminalHandler() {} 29 | 30 | public static List getCardTerminalNames(final boolean forceRefresh) throws CardException { 31 | if (forceRefresh || cardTerminals == null) { 32 | refreshList(); 33 | } 34 | return cardTerminalNames; 35 | } 36 | 37 | private static void refreshList() throws CardException { 38 | cardTerminalNames.clear(); 39 | 40 | final TerminalFactory terminalFactory = TerminalFactory.getDefault(); 41 | cardTerminals = terminalFactory.terminals(); 42 | 43 | for (CardTerminal terminal : cardTerminals.list()) { 44 | cardTerminalNames.add(terminal.getName()); 45 | } 46 | } 47 | 48 | public static CardTerminal getCardTerminalByName(final String name) throws CardException { 49 | if (cardTerminals == null) { 50 | 51 | refreshList(); 52 | } 53 | return cardTerminals.getTerminal(name); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/truphone/lpap/DialogHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package com.truphone.lpap; 7 | 8 | import java.awt.event.KeyEvent; 9 | import java.util.Optional; 10 | import javax.swing.JFrame; 11 | import javax.swing.KeyStroke; 12 | import javax.swing.text.DefaultEditorKit; 13 | 14 | /** 15 | * 16 | * @author amilcar.pereira 17 | */ 18 | public class DialogHelper { 19 | 20 | public static void setUpMacShortcuts(javax.swing.InputMap im) { 21 | im.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.META_DOWN_MASK), DefaultEditorKit.copyAction); 22 | im.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.META_DOWN_MASK), DefaultEditorKit.pasteAction); 23 | im.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.META_DOWN_MASK), DefaultEditorKit.cutAction); 24 | } 25 | 26 | public static Optional showInputDialog(JFrame parent, String text, String predefinedValue) { 27 | InputDialog id = new InputDialog(parent); 28 | id.setText(text); 29 | id.setPredefinedValue(predefinedValue); 30 | id.setVisible(true); 31 | 32 | return Optional.ofNullable(id.isOkPressed() ? id.getValue() : null); 33 | } 34 | 35 | 36 | public static Optional showInputActivationCodeDialog(JFrame parent, String text, String predefinedValue) { 37 | InputActivationCodeDialog id = new InputActivationCodeDialog(parent); 38 | 39 | id.setPredefinedMatchingId(predefinedValue); 40 | id.setVisible(true); 41 | 42 | String matchingID = id.getMatchingId(); 43 | String server = id.getServerURL(); 44 | 45 | //returns the activation code 46 | return Optional.ofNullable(id.isOkPressed() ? String.format("1$%s$%s", server, matchingID) : null); 47 | } 48 | 49 | public static void showMessageDialog(JFrame parent, String text) { 50 | MessageDialog d = new MessageDialog(parent); 51 | d.setText(text); 52 | 53 | d.setVisible(true); 54 | } 55 | 56 | public static int showConfirmDialog(JFrame parent, String text, String title) { 57 | ConfirmDialog d = new ConfirmDialog(parent); 58 | d.setTitle(title); 59 | d.setText(text); 60 | 61 | d.setVisible(true); 62 | return d.getResult(); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/truphone/lpap/info/InfoProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package com.truphone.lpap.info; 7 | 8 | import com.truphone.lpap.LPAUI; 9 | import java.io.IOException; 10 | import java.io.InputStream; 11 | import java.util.Properties; 12 | import java.util.logging.Level; 13 | import java.util.logging.Logger; 14 | 15 | /** 16 | * 17 | * @author frederico.palma 18 | */ 19 | public class InfoProvider { 20 | 21 | private static java.util.logging.Logger LOG = null; 22 | 23 | private String version = null; 24 | 25 | public InfoProvider() { 26 | LOG = Logger.getLogger(LPAUI.class.getName()); 27 | } 28 | 29 | public String getAppVersion() { 30 | if (version == null) { 31 | version = getClass().getPackage().getImplementationVersion(); 32 | if (version == null) { 33 | final InputStream propertiesStream = getClass().getClassLoader().getResourceAsStream("build.properties"); 34 | if (propertiesStream != null) { 35 | try { 36 | Properties properties = new Properties(); 37 | properties.load(propertiesStream); 38 | propertiesStream.close(); 39 | version = properties.getProperty("build.version"); 40 | } catch (IOException ex) { 41 | LOG.log(Level.WARNING, "Unable to load build.properties file", ex); 42 | } 43 | } 44 | } 45 | } 46 | return version == null ? "0.0.0" : version; 47 | } 48 | 49 | public String getAboutInfo() { 50 | final StringBuilder aboutStringBuilder = new StringBuilder(""); 51 | aboutStringBuilder.append("

Truphone LPAdesktop V").append(getAppVersion()).append("

"); 52 | 53 | aboutStringBuilder.append("

Copyright 2019 Truphone

"); 54 | aboutStringBuilder.append("

Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

"); 55 | aboutStringBuilder.append("

http://www.apache.org/licenses/LICENSE-2.0

"); 56 | aboutStringBuilder.append("

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

"); 57 | aboutStringBuilder.append(""); 58 | return aboutStringBuilder.toString(); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/truphone/lpap/qrcode/WebcamQRCodeScanner.java: -------------------------------------------------------------------------------- 1 | package com.truphone.lpap.qrcode; 2 | 3 | import java.awt.FlowLayout; 4 | import java.awt.event.TextEvent; 5 | import java.awt.event.TextListener; 6 | import java.awt.event.WindowAdapter; 7 | import java.awt.event.WindowEvent; 8 | import javax.swing.JButton; 9 | import javax.swing.JDialog; 10 | 11 | public class WebcamQRCodeScanner extends JDialog { 12 | 13 | private static final long serialVersionUID = 6441489157408381878L; 14 | 15 | private QRCodeComponent qrCodeComponent = null; 16 | 17 | private boolean loop = true; 18 | 19 | public int result; 20 | 21 | private String activationCode = ""; 22 | 23 | public String getActivationCode() { 24 | return activationCode; 25 | 26 | } 27 | 28 | public WebcamQRCodeScanner() { 29 | super(); 30 | init(); 31 | } 32 | 33 | public boolean init() { 34 | setLayout(new FlowLayout()); 35 | setTitle("Read QR / Bar Code With Webcam"); 36 | 37 | qrCodeComponent = new QRCodeComponent(); 38 | 39 | this.addWindowListener(new WindowAdapter() { 40 | @Override 41 | public void windowClosed(WindowEvent e) { 42 | qrCodeComponent.dispose(); 43 | } 44 | 45 | @Override 46 | public void windowClosing(WindowEvent e) { 47 | 48 | } 49 | }); 50 | 51 | qrCodeComponent.addTextListener(new TextListener() { 52 | @Override 53 | public void textValueChanged(TextEvent e) { 54 | testInput(); 55 | } 56 | }); 57 | 58 | this.add(qrCodeComponent); 59 | this.setSize(500,500); 60 | // pack(); 61 | 62 | this.setModal(true); 63 | this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); 64 | 65 | return true; 66 | } 67 | 68 | private void testInput() { 69 | final String fullInput = qrCodeComponent.getFullInput(); 70 | final String qrAddress = qrCodeComponent.getAddress(); 71 | final String qrMatchingId= qrCodeComponent.getMatchingId(); 72 | 73 | if (qrAddress != null && qrMatchingId != null) { 74 | final StringBuilder sb = new StringBuilder(); 75 | sb.append("Server address: ").append(qrAddress).append("\n"); 76 | sb.append("MatchingId: ").append(qrMatchingId).append("\n"); 77 | System.out.println(sb); 78 | activationCode = fullInput.substring(4); 79 | System.out.println("CLOSING"); 80 | System.out.println("ACTIVATION CODE: " + activationCode); 81 | 82 | this.dispose(); 83 | 84 | } else { 85 | System.out.println(String.format("Invalid Activation Code (%s)", fullInput)); 86 | } 87 | } 88 | 89 | @Override 90 | public void dispose() { 91 | qrCodeComponent.dispose(); 92 | System.exit(0); 93 | } 94 | 95 | public static void main(String[] args) { 96 | final WebcamQRCodeScanner scanner = new WebcamQRCodeScanner(); 97 | scanner.setVisible(true); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Application screensho](/docs/Screenshot_1.png) 2 | 3 | # LPAdesktop 4 | 5 | LPA Simulator is an application for managing eSIM profiles on removable eUICCs. 6 | 7 | The current version supports the following features: 8 | - List installed profiles 9 | - Download new profile 10 | - Enable profile 11 | - Disable profile 12 | - Delete profile 13 | - Retrieve EID 14 | - Retrieve Root SM-DS and Default SM-DP+ addresses 15 | - Set SM-DP+ address 16 | 17 | Using this tool you can deliver eSIM profile on the removable eUICC (plastic eSIM) 18 | 19 | # How to build 20 | 1. `git clone https://github.com/Truphone/LPAdesktop.git` 21 | 2. `docker-compose up` 22 | 3. Binaries will be in the `/target` folder 23 | 24 | # How to use 25 | 1. Connect SmartCard reader 26 | 2. Insert eUICC into the card reader 27 | 3. Open LPAdesktop 28 | 4. Insert RSP URL or scan QR via camera 29 | 5. eSIM profile will be delivired to connected eUICC 30 | 31 | ## ARM (M1) known issue 32 | Plugin launch4j-maven-plugin is nor support ARM, to disable it comment section in pom.xml. 33 | 34 | As a result - no exe file will be generated. 35 | 36 | ``` 37 | 38 | com.akathist.maven.plugins.launch4j 39 | launch4j-maven-plugin 40 | 2.1.1 41 | 42 | 43 | l4j-clui 44 | package 45 | 46 | launch4j 47 | 48 | 49 | console 50 | target/TruLPA_${project.version}/lpa.exe 51 | target/LPA-${project.version}-jar-with-dependencies.jar 52 | ${basedir}/src/main/resources/tru_logo.ico 53 | LPA 54 | 55 | com.truphone.lpap.mainUI 56 | true 57 | anything 58 | 59 | 60 | 61 | 1.8.0 --> 62 | 65 | 106 | 107 | ${basedir}/src/main/resources/windows 108 | 109 | logging.properties 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | maven-assembly-plugin 121 | 3.0.0 122 | 123 | 124 | 125 | jar-with-dependencies 126 | package 127 | 128 | single 129 | 130 | 131 | 132 | jar-with-dependencies 133 | 134 | 135 | 136 | com.truphone.lpap.mainUI 137 | true 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 171 | 172 | com.akathist.maven.plugins.launch4j 173 | launch4j-maven-plugin 174 | 2.1.1 175 | 176 | 177 | l4j-clui 178 | package 179 | 180 | launch4j 181 | 182 | 183 | console 184 | target/TruLPA_${project.version}/lpa.exe 185 | target/LPA-${project.version}-jar-with-dependencies.jar 186 | ${basedir}/src/main/resources/tru_logo.ico 187 | LPA 188 | 189 | com.truphone.lpap.mainUI 190 | true 191 | anything 192 | 193 | 194 | 195 | 1.8.0 196 | 199 | 200 | 201 | ${project.version} 202 | ${project.version} 203 | Truphone LPA Simulator 204 | Truphone 2019 205 | ${project.version} 206 | ${project.version} 207 | Tru LPA 208 | LPA 209 | lpa.exe 210 | 211 | 212 | 213 | 214 | 215 | 216 | sh.tak.appbundler 217 | appbundle-maven-plugin 218 | 1.2.0 219 | 220 | com.truphone.lpap.mainUI 221 | /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk 222 | true 223 | Truphone LPA 224 | tru_logo.icns 225 | 226 | 227 | 228 | ${basedir}/src/main/resources/mac 229 | 230 | logging.properties 231 | 232 | 233 | 234 | 235 | 236 | 237 | package 238 | 239 | bundle 240 | 241 | 242 | 243 | 244 | 245 | 246 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /src/main/java/com/truphone/lpap/InputActivationCodeDialog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package com.truphone.lpap; 7 | 8 | //import com.truphone.lpap.qrcode.QRCodeComponent; 9 | import java.awt.event.TextEvent; 10 | import javax.swing.DefaultComboBoxModel; 11 | 12 | /** 13 | * 14 | * @author amilcar.pereira 15 | */ 16 | public class InputActivationCodeDialog extends javax.swing.JDialog { 17 | 18 | private boolean okPressed = false; 19 | 20 | private String value = null; 21 | 22 | // private final QRCodeComponent qrCodeComponent = new QRCodeComponent(); 23 | 24 | /** 25 | * Creates new form InputDialog 26 | */ 27 | public InputActivationCodeDialog(java.awt.Frame parent) { 28 | super(parent, true); 29 | initComponents(); 30 | // panCamera.add(qrCodeComponent); 31 | // qrCodeComponent.addTextListener(new java.awt.event.TextListener() { 32 | // @Override 33 | // public void textValueChanged(TextEvent evt) { 34 | // qrCodeProcessorTextValueChanged(evt); 35 | // } 36 | // }); 37 | 38 | setLocationRelativeTo(parent); 39 | 40 | //SET SHORTCUTS ON MAC 41 | boolean isMacOs = (System.getProperty("os.name").toLowerCase().contains("mac")); 42 | if (isMacOs) { 43 | DialogHelper.setUpMacShortcuts(txtMatchingId.getInputMap()); 44 | } 45 | } 46 | 47 | public void setPredefinedMatchingId(String text) { 48 | txtMatchingId.setText(text); 49 | } 50 | 51 | public String getMatchingId() { 52 | return value; 53 | } 54 | 55 | public String getServerURL() { 56 | return (String)cmbServer.getSelectedItem(); 57 | } 58 | 59 | public boolean isOkPressed() { 60 | return okPressed; 61 | } 62 | 63 | 64 | protected void qrCodeProcessorTextValueChanged(final TextEvent event) { 65 | // final String qrAddress = qrCodeComponent.getAddress(); 66 | // final String qrMatchingId= qrCodeComponent.getMatchingId(); 67 | 68 | // if (qrAddress != null && qrMatchingId != null) { 69 | // txtMatchingId.setText(qrMatchingId); 70 | // if (((DefaultComboBoxModel)cmbServer.getModel()).getIndexOf(qrAddress) == -1) { 71 | // ((DefaultComboBoxModel)cmbServer.getModel()).addElement(qrAddress); 72 | // } 73 | // cmbServer.setSelectedItem(qrAddress); 74 | // } 75 | } 76 | 77 | /** 78 | * This method is called from within the constructor to initialize the form. 79 | * WARNING: Do NOT modify this code. The content of this method is always 80 | * regenerated by the Form Editor. 81 | */ 82 | @SuppressWarnings("unchecked") 83 | // //GEN-BEGIN:initComponents 84 | private void initComponents() { 85 | 86 | jPanel1 = new javax.swing.JPanel(); 87 | jLabel1 = new javax.swing.JLabel(); 88 | lblText = new javax.swing.JLabel(); 89 | txtMatchingId = new javax.swing.JTextField(); 90 | btnOK = new javax.swing.JButton(); 91 | btnCancel = new javax.swing.JButton(); 92 | cmbServer = new javax.swing.JComboBox<>(); 93 | lblServerURL = new javax.swing.JLabel(); 94 | // panCamera = new javax.swing.JPanel(); 95 | lblMatchingId = new javax.swing.JLabel(); 96 | 97 | setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); 98 | setTitle("Download Profile"); 99 | setBackground(new java.awt.Color(255, 255, 255)); 100 | addWindowListener(new java.awt.event.WindowAdapter() { 101 | public void windowClosed(java.awt.event.WindowEvent evt) { 102 | formWindowClosed(evt); 103 | } 104 | }); 105 | 106 | jPanel1.setBackground(new java.awt.Color(255, 255, 255)); 107 | 108 | jLabel1.setFont(new java.awt.Font("Arial Black", 1, 48)); // NOI18N 109 | jLabel1.setForeground(new java.awt.Color(0, 50, 63)); 110 | jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); 111 | jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/question.png"))); // NOI18N 112 | 113 | lblText.setForeground(new java.awt.Color(0, 50, 63)); 114 | 115 | btnOK.setText("OK"); 116 | btnOK.addActionListener(new java.awt.event.ActionListener() { 117 | public void actionPerformed(java.awt.event.ActionEvent evt) { 118 | btnOKActionPerformed(evt); 119 | } 120 | }); 121 | 122 | btnCancel.setText("Cancel"); 123 | btnCancel.addActionListener(new java.awt.event.ActionListener() { 124 | public void actionPerformed(java.awt.event.ActionEvent evt) { 125 | btnCancelActionPerformed(evt); 126 | } 127 | }); 128 | 129 | cmbServer.setEditable(true); 130 | cmbServer.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "rsp.truphone.com", "smdp.io", "rsp-staging.truphone.com", "rsp-sandbox.truphone.com", "rsp-ams.smdp.io", "rsp-mow.smdp.io" })); 131 | cmbServer.setToolTipText(""); 132 | 133 | lblServerURL.setText("Server URL"); 134 | 135 | // panCamera.setBackground(new java.awt.Color(255, 255, 255)); 136 | // panCamera.setMinimumSize(new java.awt.Dimension(300, 0)); 137 | // panCamera.setPreferredSize(new java.awt.Dimension(300, 0)); 138 | // panCamera.setSize(new java.awt.Dimension(300, 100)); 139 | // panCamera.setLayout(new java.awt.GridLayout(1, 1)); 140 | 141 | lblMatchingId.setText("Matching Id"); 142 | 143 | javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); 144 | jPanel1.setLayout(jPanel1Layout); 145 | jPanel1Layout.setHorizontalGroup( 146 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 147 | .addGroup(jPanel1Layout.createSequentialGroup() 148 | .addContainerGap() 149 | .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) 150 | .addGap(18, 18, 18) 151 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 152 | .addComponent(lblMatchingId) 153 | .addComponent(txtMatchingId, javax.swing.GroupLayout.DEFAULT_SIZE, 313, Short.MAX_VALUE) 154 | .addComponent(lblServerURL) 155 | .addComponent(cmbServer, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 156 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 26, Short.MAX_VALUE) 157 | // .addComponent(panCamera, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 158 | .addContainerGap()) 159 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() 160 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 161 | .addComponent(btnCancel) 162 | .addGap(18, 18, 18) 163 | .addComponent(btnOK) 164 | .addGap(3, 3, 3)) 165 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 166 | .addGroup(jPanel1Layout.createSequentialGroup() 167 | .addGap(77, 77, 77) 168 | .addComponent(lblText, javax.swing.GroupLayout.PREFERRED_SIZE, 307, javax.swing.GroupLayout.PREFERRED_SIZE) 169 | .addGap(120, 120, 120))) 170 | ); 171 | jPanel1Layout.setVerticalGroup( 172 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 173 | .addGroup(jPanel1Layout.createSequentialGroup() 174 | .addGap(27, 27, 27) 175 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 176 | // .addComponent(panCamera, javax.swing.GroupLayout.DEFAULT_SIZE, 252, Short.MAX_VALUE) 177 | .addGroup(jPanel1Layout.createSequentialGroup() 178 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 179 | .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE) 180 | .addGroup(jPanel1Layout.createSequentialGroup() 181 | .addComponent(lblMatchingId) 182 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 183 | .addComponent(txtMatchingId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) 184 | .addGap(21, 21, 21) 185 | .addComponent(lblServerURL) 186 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 187 | .addComponent(cmbServer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 188 | .addGap(0, 0, Short.MAX_VALUE))) 189 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 190 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 191 | .addComponent(btnCancel) 192 | .addComponent(btnOK)) 193 | .addGap(8, 8, 8)) 194 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 195 | .addGroup(jPanel1Layout.createSequentialGroup() 196 | .addGap(4, 4, 4) 197 | .addComponent(lblText, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) 198 | .addContainerGap(299, Short.MAX_VALUE))) 199 | ); 200 | 201 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 202 | getContentPane().setLayout(layout); 203 | layout.setHorizontalGroup( 204 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 205 | .addGroup(layout.createSequentialGroup() 206 | .addGap(0, 0, Short.MAX_VALUE) 207 | .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 208 | .addGap(0, 0, Short.MAX_VALUE)) 209 | ); 210 | layout.setVerticalGroup( 211 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 212 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 213 | ); 214 | 215 | pack(); 216 | }// //GEN-END:initComponents 217 | 218 | private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelActionPerformed 219 | dispose(); 220 | }//GEN-LAST:event_btnCancelActionPerformed 221 | 222 | private void btnOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOKActionPerformed 223 | value=txtMatchingId.getText(); 224 | okPressed = true; 225 | dispose(); 226 | }//GEN-LAST:event_btnOKActionPerformed 227 | 228 | private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed 229 | // qrCodeComponent.dispose(); 230 | }//GEN-LAST:event_formWindowClosed 231 | 232 | // Variables declaration - do not modify//GEN-BEGIN:variables 233 | private javax.swing.JButton btnCancel; 234 | private javax.swing.JButton btnOK; 235 | private javax.swing.JComboBox cmbServer; 236 | private javax.swing.JLabel jLabel1; 237 | private javax.swing.JPanel jPanel1; 238 | private javax.swing.JLabel lblMatchingId; 239 | private javax.swing.JLabel lblServerURL; 240 | private javax.swing.JLabel lblText; 241 | // private javax.swing.JPanel panCamera; 242 | private javax.swing.JTextField txtMatchingId; 243 | // End of variables declaration//GEN-END:variables 244 | } 245 | -------------------------------------------------------------------------------- /src/main/java/com/truphone/lpap/LPAUI.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | --------------------------------------------------------------------------------