Skip to content

Commit

Permalink
Add technology to support meID provided by lib.omw
Browse files Browse the repository at this point in the history
  • Loading branch information
GovernikusAusweisApp2 committed Jun 4, 2019
1 parent 9484181 commit 0d563e6
Show file tree
Hide file tree
Showing 36 changed files with 1,581 additions and 6 deletions.
2 changes: 2 additions & 0 deletions resources/ausweisapp.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@
<file>images/icon_nfc.svg</file>
<file>images/icon_remote.svg</file>
<file>images/icon_bluetooth.svg</file>
<file>images/icon_omapi.svg</file>
<file>images/phone_nfc.svg</file>
<file>images/phone_remote.svg</file>
<file>images/phone_bluetooth.svg</file>
<file>images/phone_omapi.svg</file>
<file>images/location_flag_de.svg</file>
<file>images/location_flag_en.svg</file>
<file>images/siteWithLogo.png</file>
Expand Down
16 changes: 16 additions & 0 deletions resources/images/icon_omapi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions resources/images/phone_omapi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions resources/packaging/android/AndroidManifest.xml.apk.in
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,17 @@
</intent-filter>
</service>


<!-- IVID / OMAPI activity used for authentication -->

<activity
android:name="com.governikus.ausweisapp2.omapi.impl.OmapiSecretFetcherImpl"
android:label="IVID" />

<!-- used libraries, possibly obsolete -->
<uses-library android:name="org.simalliance.openmobileapi" android:required="false" />
</application>

<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>

Expand All @@ -173,6 +183,9 @@
<!-- Dangerous Permissions -->
<uses-permission-sdk-23 android:name="android.permission.ACCESS_COARSE_LOCATION" />

<uses-permission android:name="org.simalliance.openmobileapi.SMARTCARD" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />

<!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
Remove the comment if you do not require these default features. -->
<!-- %%INSERT_FEATURES -->
Expand Down
4 changes: 4 additions & 0 deletions resources/packaging/android/build.gradle.append
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ task sourcesJar(type: Jar) {

dependencies {
compile "com.android.support:support-v4:21.0.3"
compile 'net.vx4:lib.omw.ivid:0.0.1-SNAPSHOT'
provided 'net.vx4:lib.omw.omapi:0.0.1-SNAPSHOT'
}

allprojects {
repositories {
mavenLocal()

maven {
url "https://maven.google.com"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ Item {
}
break
case "StateConnectCard":
setPinWorkflowStateAndContinue(ChangePinController.WorkflowStates.Card)
if (d.readerPlugInType === ReaderPlugIn.OMAPI) {
controller.workflowState = IdentifyController.WorkflowStates.Card
} else {
setIdentifyWorkflowStateAndContinue(IdentifyController.WorkflowStates.Card)
}
break
case "StatePreparePace":
fireReplace(pinProgressView)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ Item {
}
break
case "StateConnectCard":
setIdentifyWorkflowStateAndContinue(IdentifyController.WorkflowStates.Card)
if (d.readerPlugInType === ReaderPlugIn.OMAPI) {
controller.workflowState = IdentifyController.WorkflowStates.Card
} else {
setIdentifyWorkflowStateAndContinue(IdentifyController.WorkflowStates.Card)
}
break
case "StatePreparePace":
fireReplace(identifyProgressView)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,12 @@ Rectangle {
imageSource: "qrc:///images/icon_bluetooth.svg"
text: qsTr("Bluetooth") + settingsModel.translationTrigger
}

TechnologySwitchButton {
buttonActive: selectedTechnology !== ReaderPlugIn.OMAPI
onClicked: baseItem.requestPluginType(ReaderPlugIn.OMAPI)
imageSource: "qrc:///images/icon_omapi.svg"
text: qsTr("meID") + settingsModel.translationTrigger
}
}
}
8 changes: 8 additions & 0 deletions resources/qml/Governikus/Workflow/+mobile/GeneralWorkflow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,12 @@ SectionPage
onContinueWorkflow: workflowModel.continueWorkflow()
onRequestPluginType: workflowModel.readerPlugInType = pReaderPlugInType;
}

OmapiWorkflow
{
anchors.fill: parent
waitingFor: baseItem.waitingFor
visible: d.readerPlugInType === ReaderPlugIn.OMAPI
onRequestPluginType: workflowModel.readerPlugInType = pReaderPlugInType;
}
}
55 changes: 55 additions & 0 deletions resources/qml/Governikus/Workflow/+mobile/OmapiWorkflow.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import QtQuick 2.10
import QtQuick.Layouts 1.1

import Governikus.Global 1.0
import Governikus.TechnologyInfo 1.0
import Governikus.Type.ApplicationModel 1.0
import Governikus.Type.ReaderPlugIn 1.0
import Governikus.Type.NumberModel 1.0


Item {
id: baseItem
signal requestPluginType(int pReaderPlugInType)
property int waitingFor: 0
clip: true

ProgressIndicator {
id: progressIndicator
anchors.left: parent.left
anchors.top: parent.top
anchors.right: parent.right
height: parent.height / 2
imageIconSource: "qrc:///images/icon_omapi.svg"
imagePhoneSource: "qrc:///images/phone_omapi.svg"
state: baseItem.waitingFor === Workflow.WaitingFor.Reader ? "off" : "one"
}

TechnologyInfo {
id: technologyInfo

anchors.left: parent.left
anchors.leftMargin: Utils.dp(5)
anchors.right: parent.right
anchors.rightMargin: anchors.leftMargin
anchors.top: progressIndicator.bottom
anchors.bottom: technologySwitch.top
clip: true

enableButtonVisible: baseItem.waitingFor !== Workflow.WaitingFor.Reader
enableButtonText: qsTr("Continue") + settingsModel.translationTrigger
enableText: (enableButtonVisible ? qsTr("Please confirm the usage of your mobile eID.") : "") + settingsModel.translationTrigger
onEnableClicked: workflowModel.continueWorkflow()
titleText: qsTr("No mobile eID found") + settingsModel.translationTrigger
subTitleText: qsTr("Please ensure that a SIM card is inserted and a suitable mobile eID is stored there.") + settingsModel.translationTrigger
}

TechnologySwitch {
id: technologySwitch
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
selectedTechnology: ReaderPlugIn.OMAPI
onRequestPluginType: parent.requestPluginType(pReaderPlugInType)
}
}
1 change: 1 addition & 0 deletions resources/qml/Governikus/Workflow/qmldir
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ internal BusyImageIndicator BusyImageIndicator.qml
internal CardReader CardReader.qml
internal NfcProgressIndicator NfcProgressIndicator.qml
internal NfcWorkflow NfcWorkflow.qml
internal OmapiWorkflow OmapiWorkflow.qml
internal ProgressCircle ProgressCircle.qml
internal ProgressIndicator ProgressIndicator.qml
internal RemoteWorkflow RemoteWorkflow.qml
Expand Down
23 changes: 23 additions & 0 deletions resources/translations/ausweisapp2_de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,25 @@
<translation>Bitte platzieren Sie Ihr Gerät&lt;br/&gt;über Ihrem Personalausweis.</translation>
</message>
</context>
<context>
<name>OmapiWorkflow</name>
<message>
<source>Continue</source>
<translation>Fortsetzen</translation>
</message>
<message>
<source>Please confirm the usage of your mobile eID.</source>
<translation>Bitte bestätigen Sie die Verwendung ihrer mobilen eID.</translation>
</message>
<message>
<source>No mobile eID found</source>
<translation>Keine mobile eID gefunden</translation>
</message>
<message>
<source>Please ensure that a SIM card is inserted and a suitable mobile eID is stored there.</source>
<translation>Bitte stellen Sie sicher, dass eine SIM-Karte eingelegt ist und eine passende mobile eID hinterlegt ist.</translation>
</message>
</context>
<context>
<name>PinSettingsWidget</name>
<message>
Expand Down Expand Up @@ -2126,6 +2145,10 @@ Bitte beachten Sie, dass Sie mit Ihrer PUK lediglich Ihren Online-Ausweis entspe
<source>Use Bluetooth card reader instead&lt;br/&gt;of remote card reader</source>
<translation>Bluetooth Kartenlesegerät anstelle &lt;br/&gt;vom WLAN Kartenlesegerät verwenden</translation>
</message>
<message>
<source>meID</source>
<translation>meID</translation>
</message>
</context>
<context>
<name>TitleBar</name>
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ IF(ANDROID)
TARGET_LINK_LIBRARIES(AusweisApp AusweisAppCardNfc)
IF(NOT ANDROID_BUILD_AAR)
TARGET_LINK_LIBRARIES(AusweisApp AusweisAppActivationIntent)
TARGET_LINK_LIBRARIES(AusweisApp AusweisAppCardOmapi)
ENDIF()
ENDIF()

Expand Down
4 changes: 4 additions & 0 deletions src/card/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ IF(TARGET Qt5::Bluetooth)
ADD_SUBDIRECTORY(bluetooth)
ENDIF()

IF(ANDROID)
ADD_SUBDIRECTORY(omapi)
ENDIF()

ADD_SUBDIRECTORY(drivers)
2 changes: 1 addition & 1 deletion src/card/base/ReaderManagerPlugInInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
namespace governikus
{

defineEnumType(ReaderManagerPlugInType, UNKNOWN, PCSC, BLUETOOTH, NFC, REMOTE)
defineEnumType(ReaderManagerPlugInType, UNKNOWN, PCSC, BLUETOOTH, NFC, REMOTE, OMAPI)


class ReaderManagerPlugInInfo
Expand Down
15 changes: 15 additions & 0 deletions src/card/omapi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#####################################################################
# The ReaderManagerPlugin for OMAPI.
#
# This plugin is a wrapper for the Virtual eID on a SIM card.
# Supported: Android.
#####################################################################

ADD_PLATFORM_LIBRARY(AusweisAppCardOmapi)

TARGET_LINK_LIBRARIES(AusweisAppCardOmapi Qt5::Core AusweisAppGlobal AusweisAppCard)
TARGET_COMPILE_DEFINITIONS(AusweisAppCardOmapi PRIVATE QT_STATICPLUGIN)

IF(ANDROID)
TARGET_LINK_LIBRARIES(AusweisAppCardOmapi Qt5::AndroidExtras)
ENDIF()
51 changes: 51 additions & 0 deletions src/card/omapi/Omapi.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*!
* \copyright Copyright (c) 2019 Governikus GmbH & Co. KG, Germany
*/

package com.governikus.ausweisapp2.omapi;

import java.io.Closeable;
import java.util.List;

import com.governikus.ausweisapp2.omapi.OmapiError;
import com.governikus.ausweisapp2.omapi.OmapiReader;

/**
*
*/
public interface Omapi extends Closeable // AutoClosable requires min. API level 19
{
/**
* Initialize omapi layer.
* This must be called if isAvailable() = false
*
* @return Null on success, otherwise an error.
*/
OmapiError init();

/**
* Check if omapi layer is available.
*
* @return True if omapi layer exists, otherwise false.
*/
boolean isAvailable();

/**
* Check if omapi layer is enabled.
*
* @return True if omapi layer is enabled, otherwise false.
*/
boolean isEnabled();

/**
* Get all enabled reader.
*
* @return List of reader, otherwise empty list.
*/
List<OmapiReader> getReader();

/**
* Closes and destroys the currently allocated implementation instance.
*/
void close();
}
Loading

0 comments on commit 0d563e6

Please sign in to comment.