├── example ├── .gitignore ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── twigbit │ │ │ │ └── identsdk │ │ │ │ └── example │ │ │ │ ├── .gitignore │ │ │ │ ├── MainActivity.kt │ │ │ │ └── IndependentIdentificationActivity.kt │ │ ├── ic_launcher-web.png │ │ ├── res │ │ │ ├── font │ │ │ │ └── nexa_bold.ttf │ │ │ ├── drawable │ │ │ │ ├── twigbit_logo.png │ │ │ │ ├── illu_twigbit_ident.png │ │ │ │ ├── twigbit_logo_text.png │ │ │ │ └── ic_launcher_background.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ ├── activity_independent_identification.xml │ │ │ │ └── activity_main.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── twigbit │ │ │ └── identsdk │ │ │ └── ExampleUnitTest.kt │ └── androidTest │ │ └── java │ │ └── com │ │ └── twigbit │ │ └── identsdk │ │ └── ExampleInstrumentedTest.kt ├── proguard-rules.pro └── build.gradle ├── identsdk ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable │ │ │ │ ├── twigbit_ident_header_logo.png │ │ │ │ ├── twigbit_ident_icon_arrow_right.xml │ │ │ │ ├── twigbit_ident_icon_back.xml │ │ │ │ ├── twigbit_ident_icon_info.xml │ │ │ │ ├── twigbit_ident_icon_service_provider.xml │ │ │ │ └── twigbit_ident_icon_purpose.xml │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── styles.xml │ │ │ │ └── strings.xml │ │ │ └── layout │ │ │ │ ├── holder_access_right.xml │ │ │ │ ├── fragment_loader.xml │ │ │ │ ├── fragment_insert_card.xml │ │ │ │ ├── activity_dropin_identification.xml │ │ │ │ ├── fragment_intro.xml │ │ │ │ ├── fragment_error.xml │ │ │ │ ├── fragment_success.xml │ │ │ │ ├── fragment_authorisation.xml │ │ │ │ ├── fragment_certificate.xml │ │ │ │ └── fragment_access_rights.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── twigbit │ │ │ │ └── identsdk │ │ │ │ ├── util │ │ │ │ ├── Tags.kt │ │ │ │ ├── Extensions.kt │ │ │ │ ├── NfcInterceptorActivity.kt │ │ │ │ ├── ForegroundDispatcher.kt │ │ │ │ └── StringUtil.kt │ │ │ │ ├── core │ │ │ │ ├── IdentificationManagerProvider.kt │ │ │ │ ├── AccessRights.kt │ │ │ │ ├── IdentificationActivity.kt │ │ │ │ ├── IdentificationFragment.kt │ │ │ │ ├── IdentificationUtil.kt │ │ │ │ └── IdentificationManager.kt │ │ │ │ ├── dropinui │ │ │ │ ├── DropInRequest.kt │ │ │ │ ├── LoaderFragment.kt │ │ │ │ ├── IntroFragment.kt │ │ │ │ ├── ErrorFragment.kt │ │ │ │ ├── SuccessFragment.kt │ │ │ │ ├── InsertCardFragment.kt │ │ │ │ ├── CertificateFragment.kt │ │ │ │ ├── AccessRightsFragment.kt │ │ │ │ ├── AuthorisationFragment.kt │ │ │ │ └── DropInIdentificationActivity.kt │ │ │ │ └── ausweisident │ │ │ │ ├── AusweisIdentScopes.kt │ │ │ │ ├── UserInfo.kt │ │ │ │ ├── AusweisIdentBuilder.kt │ │ │ │ ├── AusweisIdentResultHandler.kt │ │ │ │ └── InMemoryCookieJar.kt │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── twigbit │ │ │ └── identsdk │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── twigbit │ │ └── identsdk │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── docs ├── images │ ├── header.png │ ├── logos.png │ ├── logo-twigbit.png │ ├── logo-governikus.png │ └── logo-ausweisident.png ├── Architecture.md ├── STYLEGUIDE.md └── README.md ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .idea ├── encodings.xml ├── codeStyles │ ├── codeStyleConfig.xml │ └── Project.xml ├── markdown-navigator │ └── profiles_settings.xml ├── vcs.xml ├── markdown-exported-files.xml ├── runConfigurations.xml ├── gradle.xml ├── markdown-navigator.xml ├── misc.xml ├── markdown-navigator-enh.xml └── assetWizardSettings.xml ├── .gitignore ├── gradle.properties ├── gradlew.bat ├── gradlew └── LICENSE /example/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /identsdk/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':example', ':identsdk' 2 | -------------------------------------------------------------------------------- /example/src/main/java/com/twigbit/identsdk/example/.gitignore: -------------------------------------------------------------------------------- 1 | Secrets.kt 2 | -------------------------------------------------------------------------------- /docs/images/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/docs/images/header.png -------------------------------------------------------------------------------- /docs/images/logos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/docs/images/logos.png -------------------------------------------------------------------------------- /docs/images/logo-twigbit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/docs/images/logo-twigbit.png -------------------------------------------------------------------------------- /docs/images/logo-governikus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/docs/images/logo-governikus.png -------------------------------------------------------------------------------- /docs/images/logo-ausweisident.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/docs/images/logo-ausweisident.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/example/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /example/src/main/res/font/nexa_bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/example/src/main/res/font/nexa_bold.ttf -------------------------------------------------------------------------------- /example/src/main/res/drawable/twigbit_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/example/src/main/res/drawable/twigbit_logo.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/example/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/example/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/example/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/example/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Twigbit Ident SDK Example Application 3 | 4 | -------------------------------------------------------------------------------- /example/src/main/res/drawable/illu_twigbit_ident.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/example/src/main/res/drawable/illu_twigbit_ident.png -------------------------------------------------------------------------------- /example/src/main/res/drawable/twigbit_logo_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/example/src/main/res/drawable/twigbit_logo_text.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/example/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/example/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/example/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/example/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /example/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/example/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/example/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/example/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/example/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/example/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /identsdk/src/main/res/drawable/twigbit_ident_header_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/identsdk/src/main/res/drawable/twigbit_ident_header_logo.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/example/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twigbit/ident-sdk/HEAD/example/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /identsdk/src/main/java/com/twigbit/identsdk/util/Tags.kt: -------------------------------------------------------------------------------- 1 | package com.twigbit.identsdk.util 2 | 3 | object Tags { 4 | val TAG_IDENT_DEBUG = "TwigbitIdent::DEBUG"; 5 | } 6 | -------------------------------------------------------------------------------- /example/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #F8FDFF 4 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/markdown-navigator/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /identsdk/src/main/java/com/twigbit/identsdk/core/IdentificationManagerProvider.kt: -------------------------------------------------------------------------------- 1 | package com.twigbit.identsdk.core 2 | 3 | interface IdentificationManagerProvider { 4 | val identificationManager: IdentificationManager?; 5 | } -------------------------------------------------------------------------------- /.idea/markdown-exported-files.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /identsdk/src/main/java/com/twigbit/identsdk/util/Extensions.kt: -------------------------------------------------------------------------------- 1 | package com.twigbit.identsdk.util 2 | 3 | import android.app.Activity 4 | import androidx.fragment.app.Fragment 5 | import com.twigbit.identsdk.dropinui.DropInIdentificationActivity 6 | -------------------------------------------------------------------------------- /example/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #2A4769 4 | #273F57 5 | #87BD49 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Jan 27 14:31:07 CET 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 7 | -------------------------------------------------------------------------------- /identsdk/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #4C4E7C 4 | #37354B 5 | #2AD785 6 | #0D141D 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /example/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Android Studio Settings 2 | /.idea/caches/build_file_checksums.ser 3 | /.idea/libraries 4 | /.idea/modules.xml 5 | /.idea/workspace.xml 6 | \.idea/markdown-exported-files\.xml 7 | 8 | *.iml 9 | .gradle 10 | /local.properties 11 | 12 | /build 13 | /captures 14 | .externalNativeBuild 15 | 16 | # other 17 | .DS_Store 18 | -------------------------------------------------------------------------------- /identsdk/src/main/res/drawable/twigbit_ident_icon_arrow_right.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /identsdk/src/main/res/drawable/twigbit_ident_icon_back.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /example/src/test/java/com/twigbit/identsdk/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.twigbit.identsdk 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /identsdk/src/test/java/com/twigbit/identsdk/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.twigbit.identsdk; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /docs/Architecture.md: -------------------------------------------------------------------------------- 1 | # twigbit ident sdk 2 | ## Architecture considerations 3 | 4 | The SDK consists of several modules: 5 | 6 | | module | description | 7 | | ------ | ----------- | 8 | | core | - bundles `com.governikus.ausweisapp`
- capability checks (nfc / nfc extended length support)
- handle ident state machine | 9 | | ui | - drop-in ui | 10 | | compat | - compat activity that wraps activity lifecycle | 11 | | ausweisident | - AusweisIdentBuilder class for building AusweisIdent tcTokenUrls | 12 | 13 | -------------------------------------------------------------------------------- /identsdk/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /identsdk/src/main/res/drawable/twigbit_ident_icon_info.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /identsdk/src/main/java/com/twigbit/identsdk/dropinui/DropInRequest.kt: -------------------------------------------------------------------------------- 1 | package com.twigbit.identsdk.dropinui 2 | 3 | import android.content.Context 4 | import android.content.Intent 5 | 6 | class DropInRequest(private val tcTokenUrl: String){ 7 | fun getIntent(context: Context): Intent{ 8 | val intent = Intent(context, DropInIdentificationActivity::class.java) 9 | intent.putExtra(EXTRA_TC_TOKEN_URL, tcTokenUrl) 10 | return intent 11 | } 12 | 13 | companion object { 14 | val EXTRA_TC_TOKEN_URL = "twigbit-ident-extra-tc-token-url" 15 | } 16 | } -------------------------------------------------------------------------------- /identsdk/src/main/res/layout/holder_access_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /identsdk/src/main/res/layout/fragment_loader.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /identsdk/src/main/res/drawable/twigbit_ident_icon_service_provider.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /identsdk/src/main/res/drawable/twigbit_ident_icon_purpose.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /example/src/androidTest/java/com/twigbit/identsdk/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.twigbit.identsdk 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getTargetContext() 22 | assertEquals("com.twigbit.identsdk", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /example/src/main/res/layout/activity_independent_identification.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /identsdk/src/main/java/com/twigbit/identsdk/ausweisident/AusweisIdentScopes.kt: -------------------------------------------------------------------------------- 1 | package com.twigbit.identsdk.ausweisident 2 | 3 | object AusweisIdentScopes { 4 | const val BIRTH_NAME = "BirthName" 5 | const val FAMILY_NAMES = "FamilyNames" 6 | const val GIVEN_NAMES = "GivenNames" 7 | const val DATE_OF_BIRTH = "DateOfBirth" 8 | const val PLACE_OF_RESIDENCE = "PlaceOfResidence" 9 | const val NATIONALITY = "Nationality" 10 | const val ACADEMIC_TITLE = "AcademicTitle" 11 | const val ARTISTIC_NAME = "ArtisticName" 12 | const val ISSUING_STATE = "IssuingState" 13 | const val RESTRICTED_ID = "RestrictedID" 14 | const val PLACE_OF_BIRTH = "PlaceOfBirth" 15 | const val DOCUMENT_TYPE = "DocumentType" 16 | const val RESIDENCE_PERMIT_I = "ResidencePermitI" 17 | const val DATE_OF_EXPIRY = "DateOfExpiry" 18 | } -------------------------------------------------------------------------------- /example/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /identsdk/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /example/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 15 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /identsdk/src/androidTest/java/com/twigbit/identsdk/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.twigbit.identsdk; 2 | 3 | import android.content.Context; 4 | import androidx.test.platform.app.InstrumentationRegistry; 5 | import androidx.test.ext.junit.runners.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.twigbit.identsdk.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # Kotlin code style for this project: "official" or "obsolete": 15 | kotlin.code.style=official 16 | android.useAndroidX=true 17 | android.enableJetifier=true 18 | -------------------------------------------------------------------------------- /identsdk/src/main/java/com/twigbit/identsdk/dropinui/LoaderFragment.kt: -------------------------------------------------------------------------------- 1 | package com.twigbit.identsdk.dropinui 2 | 3 | 4 | import android.os.Bundle 5 | import androidx.fragment.app.Fragment 6 | import android.view.LayoutInflater 7 | import android.view.View 8 | import android.view.ViewGroup 9 | 10 | import com.twigbit.identsdk.R 11 | 12 | // TODO: Rename parameter arguments, choose names that match 13 | // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER 14 | private const val ARG_PARAM1 = "param1" 15 | private const val ARG_PARAM2 = "param2" 16 | 17 | /** 18 | * A simple [Fragment] subclass. 19 | * 20 | */ 21 | class LoaderFragment : androidx.fragment.app.Fragment() { 22 | 23 | override fun onCreateView( 24 | inflater: LayoutInflater, container: ViewGroup?, 25 | savedInstanceState: Bundle? 26 | ): View? { 27 | // Inflate the layout for this fragment 28 | return inflater.inflate(R.layout.fragment_loader, container, false) 29 | } 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /identsdk/src/main/java/com/twigbit/identsdk/core/AccessRights.kt: -------------------------------------------------------------------------------- 1 | package com.twigbit.identsdk.core 2 | 3 | object AccessRights{ 4 | const val ADDRESS = "Address" 5 | const val BIRTH_NAME = "BirthName" 6 | const val FAMILY_NAME = "FamilyName" 7 | const val GIVEN_NAMES = "GivenNames" 8 | const val PLACE_OF_BIRTH = "PlaceOfBirth" 9 | const val DATE_OF_BIRTH = "DateOfBirth" 10 | const val DOCTORAL_DEGREE = "DoctoralDegree" 11 | const val ARTISTIC_NAME = "ArtisticName" 12 | const val PSEUDONYM = "Pseudonym" 13 | const val VALID_UNTIL = "ValidUntil" 14 | const val NATIONALITY = "Nationality" 15 | const val ISSUING_COUNTRY = "IssuingCountry" 16 | const val DOCUMENT_TYPE = "DocumentType" 17 | const val RESIDENCE_PERMIT_I = "ResidencePermitI" 18 | const val RESIDENCE_PERMIT_II = "ResidencePermitII" 19 | const val COMMUNITY_ID = "CommunityID" 20 | const val ADDRESS_VERIFICATION = "AddressVerification" 21 | const val AGE_VERIFICATION = "AgeVerification" 22 | } 23 | 24 | -------------------------------------------------------------------------------- /example/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /identsdk/src/main/java/com/twigbit/identsdk/dropinui/IntroFragment.kt: -------------------------------------------------------------------------------- 1 | package com.twigbit.identsdk.dropinui 2 | 3 | 4 | import android.os.Bundle 5 | import androidx.fragment.app.Fragment 6 | import android.view.LayoutInflater 7 | import android.view.View 8 | import android.view.ViewGroup 9 | 10 | import com.twigbit.identsdk.R 11 | import kotlinx.android.synthetic.main.fragment_intro.view.* 12 | 13 | /** 14 | * A simple [Fragment] subclass. 15 | * 16 | */ 17 | class IntroFragment : androidx.fragment.app.Fragment() { 18 | 19 | override fun onCreateView( 20 | inflater: LayoutInflater, container: ViewGroup?, 21 | savedInstanceState: Bundle? 22 | ): View? { 23 | // Inflate the layout for this fragment 24 | val v = inflater.inflate(R.layout.fragment_intro, container, false) 25 | v.buttonStart.setOnClickListener { 26 | activity?.asIdentificationUI()!!.startIdent() 27 | activity!!.asIdentificationUI()!!.showLoader() 28 | } 29 | return v; 30 | } 31 | 32 | 33 | } 34 | -------------------------------------------------------------------------------- /identsdk/src/main/java/com/twigbit/identsdk/dropinui/ErrorFragment.kt: -------------------------------------------------------------------------------- 1 | package com.twigbit.identsdk.dropinui 2 | 3 | 4 | import android.os.Bundle 5 | import androidx.fragment.app.Fragment 6 | import android.view.LayoutInflater 7 | import android.view.View 8 | import android.view.ViewGroup 9 | 10 | import com.twigbit.identsdk.R 11 | import kotlinx.android.synthetic.main.fragment_success.view.* 12 | 13 | // TODO: Rename parameter arguments, choose names that match 14 | // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER 15 | private const val ARG_PARAM1 = "param1" 16 | private const val ARG_PARAM2 = "param2" 17 | 18 | /** 19 | * A simple [Fragment] subclass. 20 | * 21 | */ 22 | class ErrorFragment : androidx.fragment.app.Fragment() { 23 | 24 | override fun onCreateView( 25 | inflater: LayoutInflater, container: ViewGroup?, 26 | savedInstanceState: Bundle? 27 | ): View? { 28 | // Inflate the layout for this fragment 29 | val v = inflater.inflate(R.layout.fragment_error, container, false) 30 | v.buttonFinish.setOnClickListener { activity!!.finish() } 31 | return v 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /identsdk/src/main/java/com/twigbit/identsdk/dropinui/SuccessFragment.kt: -------------------------------------------------------------------------------- 1 | package com.twigbit.identsdk.dropinui 2 | 3 | 4 | import android.os.Bundle 5 | import androidx.fragment.app.Fragment 6 | import android.view.LayoutInflater 7 | import android.view.View 8 | import android.view.ViewGroup 9 | 10 | import com.twigbit.identsdk.R 11 | import kotlinx.android.synthetic.main.fragment_success.view.* 12 | 13 | // TODO: Rename parameter arguments, choose names that match 14 | // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER 15 | private const val ARG_PARAM1 = "param1" 16 | private const val ARG_PARAM2 = "param2" 17 | 18 | /** 19 | * A simple [Fragment] subclass. 20 | * 21 | */ 22 | class SuccessFragment : androidx.fragment.app.Fragment() { 23 | 24 | override fun onCreateView( 25 | inflater: LayoutInflater, container: ViewGroup?, 26 | savedInstanceState: Bundle? 27 | ): View? { 28 | // Inflate the layout for this fragment 29 | val v = inflater.inflate(R.layout.fragment_success, container, false) 30 | v.buttonFinish.setOnClickListener { activity!!.finish() } 31 | return v 32 | } 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /identsdk/src/main/java/com/twigbit/identsdk/dropinui/InsertCardFragment.kt: -------------------------------------------------------------------------------- 1 | package com.twigbit.identsdk.dropinui 2 | 3 | import android.content.Context 4 | import android.net.Uri 5 | import android.os.Bundle 6 | import androidx.fragment.app.Fragment 7 | import android.view.LayoutInflater 8 | import android.view.View 9 | import android.view.ViewGroup 10 | 11 | import com.twigbit.identsdk.R 12 | 13 | /** 14 | * A simple [Fragment] subclass. 15 | * Activities that contain this fragment must implement the 16 | * [InsertCardFragment.OnFragmentInteractionListener] interface 17 | * to handle interaction events. 18 | * Use the [InsertCardFragment.newInstance] factory method to 19 | * create an instance of this fragment. 20 | * 21 | */ 22 | class InsertCardFragment : androidx.fragment.app.Fragment() { 23 | // TODO: Rename and change types of parameters 24 | 25 | override fun onCreate(savedInstanceState: Bundle?) { 26 | super.onCreate(savedInstanceState) 27 | arguments?.let { 28 | } 29 | } 30 | 31 | override fun onCreateView( 32 | inflater: LayoutInflater, container: ViewGroup?, 33 | savedInstanceState: Bundle? 34 | ): View? { 35 | // Inflate the layout for this fragment 36 | val v = inflater.inflate(R.layout.fragment_insert_card, container, false) 37 | return v 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /identsdk/src/main/java/com/twigbit/identsdk/util/NfcInterceptorActivity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018. Moritz Morgenroth- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * Proprietary and confidential 5 | * Written by Moritz Morgenroth 6 | */ 7 | 8 | package com.twigbit.identsdk.util 9 | 10 | import android.os.Bundle 11 | import androidx.appcompat.app.AppCompatActivity 12 | 13 | /* 14 | 15 | Additional layer for NFC dispatcher that allows manifest configuration for NFC Intent filter 16 | 17 | This does not appear to be necessary. Should be implemented for good measure later though. 18 | 19 | Elsewise tell Governikus to move from their docs. 20 | 21 | Currently Unused 22 | 23 | // TODO: Check under which conditions the NFC filter maifest configuration is needed. Maybe unnecessarry in activities filterin for other intents? 24 | 25 | */ 26 | open class NfcInterceptorActivity : AppCompatActivity() { 27 | var mDispatcher: ForegroundDispatcher? = null; 28 | 29 | override fun onCreate(savedInstanceState: Bundle?) { 30 | super.onCreate(savedInstanceState) 31 | mDispatcher = ForegroundDispatcher(this) 32 | } 33 | 34 | public override fun onResume() { 35 | super.onResume() 36 | mDispatcher!!.enable() 37 | } 38 | 39 | public override fun onPause() { 40 | super.onPause() 41 | mDispatcher!!.disable() 42 | } 43 | } -------------------------------------------------------------------------------- /identsdk/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 15 | 18 | 21 | 23 | 25 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /identsdk/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-android-extensions' 4 | 5 | android { 6 | compileSdkVersion 28 7 | 8 | 9 | defaultConfig { 10 | minSdkVersion 21 11 | targetSdkVersion 29 12 | versionCode 3 13 | versionName "0.2.1" 14 | 15 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 16 | 17 | } 18 | 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | 26 | } 27 | 28 | dependencies { 29 | implementation fileTree(dir: 'libs', include: ['*.jar']) 30 | 31 | implementation 'androidx.appcompat:appcompat:1.1.0' 32 | 33 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 34 | implementation 'androidx.legacy:legacy-support-v4:1.0.0' 35 | testImplementation 'junit:junit:4.12' 36 | androidTestImplementation 'androidx.test.ext:junit:1.1.1' 37 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' 38 | 39 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 40 | 41 | implementation 'com.governikus:ausweisapp:1.20.0' 42 | implementation 'com.google.code.gson:gson:2.8.5' 43 | implementation 'com.squareup.okhttp3:okhttp:3.11.0' 44 | 45 | implementation 'com.google.android.material:material:1.0.0' 46 | } 47 | repositories { 48 | mavenCentral() 49 | } 50 | -------------------------------------------------------------------------------- /identsdk/src/main/res/layout/fragment_insert_card.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /identsdk/src/main/java/com/twigbit/identsdk/util/ForegroundDispatcher.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018. Moritz Morgenroth, Inc - All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * Proprietary and confidential 5 | * Written by Moritz Morgenroth 6 | */ 7 | 8 | package com.twigbit.identsdk.util 9 | 10 | import android.app.Activity 11 | import android.app.PendingIntent 12 | import android.content.Intent 13 | import android.content.IntentFilter 14 | import android.nfc.NfcAdapter 15 | import android.nfc.tech.IsoDep 16 | 17 | class ForegroundDispatcher(private val mActivity: Activity) { 18 | private val mAdapter: NfcAdapter? 19 | private val mPendingIntent: PendingIntent 20 | private val mFilters: Array 21 | private val mTechLists: Array> 22 | 23 | init { 24 | mAdapter = NfcAdapter.getDefaultAdapter(mActivity) 25 | val intent = Intent(mActivity, mActivity.javaClass).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP) 26 | mPendingIntent = PendingIntent.getActivity(mActivity, 0, intent, 0) 27 | 28 | mFilters = arrayOf(IntentFilter(NfcAdapter.ACTION_TECH_DISCOVERED)) 29 | mTechLists = arrayOf(arrayOf(IsoDep::class.java.name)) 30 | } 31 | 32 | fun enable() { 33 | mAdapter?.enableForegroundDispatch(mActivity, 34 | mPendingIntent, 35 | mFilters, 36 | mTechLists) 37 | } 38 | 39 | fun disable() { 40 | mAdapter?.disableForegroundDispatch(mActivity) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /identsdk/src/main/java/com/twigbit/identsdk/core/IdentificationActivity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018. Moritz Morgenroth- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * Proprietary and confidential 5 | * Written by Moritz Morgenroth 6 | */ 7 | 8 | package com.twigbit.identsdk.core 9 | 10 | import android.content.Intent 11 | import android.nfc.NfcAdapter 12 | import android.nfc.Tag 13 | import android.os.Bundle 14 | import com.twigbit.identsdk.util.NfcInterceptorActivity 15 | 16 | abstract class IdentificationActivity : NfcInterceptorActivity() { 17 | var identificationManager = IdentificationManager() 18 | 19 | override fun onNewIntent(intent: Intent?) { 20 | super.onNewIntent(intent) 21 | val tag = intent!!.getParcelableExtra(NfcAdapter.EXTRA_TAG) 22 | if (tag != null) { 23 | identificationManager.dispatchNfcTag(tag) 24 | } 25 | } 26 | 27 | override fun onCreate(savedInstanceState: Bundle?) { 28 | super.onCreate(savedInstanceState) 29 | identificationManager.bind(applicationContext) 30 | 31 | } 32 | override fun onStart() { 33 | super.onStart() 34 | // identificationManager.bind(applicationContext) 35 | } 36 | 37 | override fun onDestroy() { 38 | super.onDestroy() 39 | identificationManager.unBind(applicationContext) 40 | } 41 | override fun onStop() { 42 | super.onStop() 43 | // identificationManager.unBind(applicationContext) 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /identsdk/src/main/res/layout/activity_dropin_identification.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 20 | 21 | 30 | 31 | -------------------------------------------------------------------------------- /example/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | apply plugin: 'kotlin-android' 4 | 5 | apply plugin: 'kotlin-android-extensions' 6 | 7 | android { 8 | signingConfigs { 9 | alpha { 10 | storeFile file('/Users/moritzmorgenroth/Documents/alpha.jks') 11 | storePassword 'bm6NJLHnFBcse5Yn9k' 12 | keyPassword 'bm6NJLHnFBcse5Yn9k' 13 | keyAlias = 'key0' 14 | } 15 | } 16 | compileSdkVersion 28 17 | defaultConfig { 18 | applicationId "com.twigbit.identsdk.example" 19 | minSdkVersion 21 20 | targetSdkVersion 28 21 | versionCode 1 22 | versionName "1.0" 23 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 24 | } 25 | buildTypes { 26 | release { 27 | minifyEnabled false 28 | signingConfig signingConfigs.alpha 29 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 30 | } 31 | } 32 | } 33 | 34 | dependencies { 35 | implementation fileTree(dir: 'libs', include: ['*.jar']) 36 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 37 | implementation 'androidx.appcompat:appcompat:1.0.0' 38 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 39 | // implementation 'com.github.twigbit:ident-sdk:0.1.5' 40 | implementation project(path: ':identsdk') 41 | 42 | testImplementation 'junit:junit:4.12' 43 | androidTestImplementation 'androidx.test.ext:junit:1.1.1' 44 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' 45 | 46 | implementation 'com.google.android.material:material:1.0.0' 47 | } 48 | -------------------------------------------------------------------------------- /identsdk/src/main/res/layout/fragment_intro.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 21 | 22 |