├── .editorconfig ├── .gitattributes ├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── android ├── README.md ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── reactlibrary │ ├── EidReaderModule.java │ └── EidReaderPackage.java ├── images └── logo.png ├── index.js ├── ios ├── EidReader.h ├── EidReader.m ├── EidReader.xcodeproj │ └── project.pbxproj └── EidReader.xcworkspace │ └── contents.xcworkspacedata ├── package.json └── react-native-eid-reader.podspec /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | charset = utf-8 6 | max_line_length = 80 7 | 8 | [*.vim] 9 | indent_style = space 10 | shiftwidth = 0 11 | indent_size = 2 12 | insert_final_newline = true 13 | trim_trailing_whitespace = true 14 | max_line_length = 80 15 | 16 | [*.rb] 17 | indent_style = space 18 | indent_size = 2 19 | insert_final_newline = true 20 | trim_trailing_whitespace = true 21 | max_line_length = 120 22 | 23 | [*.yml] 24 | indent_style = space 25 | indent_size = 2 26 | 27 | [*.{bat,vbs,ps1}] 28 | end_of_line = CRLF 29 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # node.js 6 | # 7 | node_modules/ 8 | npm-debug.log 9 | yarn-error.log 10 | 11 | # Xcode 12 | # 13 | build/ 14 | *.pbxuser 15 | !default.pbxuser 16 | *.mode1v3 17 | !default.mode1v3 18 | *.mode2v3 19 | !default.mode2v3 20 | *.perspectivev3 21 | !default.perspectivev3 22 | xcuserdata 23 | *.xccheckout 24 | *.moved-aside 25 | DerivedData 26 | *.hmap 27 | *.ipa 28 | *.xcuserstate 29 | project.xcworkspace 30 | 31 | # Android/IntelliJ 32 | # 33 | build/ 34 | .idea 35 | .gradle 36 | local.properties 37 | *.iml 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Boukhtam/react-native-eid-reader/deafa5adff20d78281f3330e9fdf8381dd863159/.npmignore -------------------------------------------------------------------------------- /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 2019 Hamza BOUKHTAM 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Contributors][contributors-shield]][contributors-url] 2 | [![Forks][forks-shield]][forks-url] 3 | [![Stargazers][stars-shield]][stars-url] 4 | [![Issues][issues-shield]][issues-url] 5 | [![MIT License][license-shield]][license-url] 6 | 7 | 8 | 9 | 10 |
11 |

12 | 13 | Logo 14 | 15 | 16 |

react-native-eid-reader

17 | 18 |

19 | A react-native module/tool to read the contents of ISO7816 Identification/Smart cards using the NFC chip. 20 |
21 | Explore the docs » 22 |
23 |
24 | View Demo 25 | · 26 | Report Bug 27 | · 28 | Request Feature 29 |

30 |

31 | 32 | 33 | 34 | 35 | ## Table of Contents 36 | 37 | 38 | * [About the Project](#about-the-project) 39 | * [Built With](#built-with) 40 | * [Getting Started](#getting-started) 41 | * [Prerequisites](#prerequisites) 42 | * [Mostly automatic installation](#mostly-automatic-installation) 43 | * [Manual installation](#manual-installation) 44 | * [Usage](#usage) 45 | * [Roadmap](#roadmap) 46 | * [Contributing](#contributing) 47 | * [License](#license) 48 | * [Contact](#contact) 49 | * [Acknowledgements](#acknowledgements) 50 | 51 | 52 | 53 | 54 | 55 | ## About The Project 56 | 57 | [![Product Name Screen Shot][product-screenshot]] 58 | 59 | 60 | 61 | The module/tool currently reads the contents of: 62 | 63 | * Electronic/Biometric passports in BAC security mode. 64 | * The Algerian eID card. 65 | 66 | A list of commonly used resources that I find helpful are listed in the acknowledgements. 67 | 68 | ### Built With 69 | * [jMRTD](http://jmrtd.org/) - The library for reading the epassport chip [LGPL 3.0 License][lgpl-license]. 70 | * [SCUBA](http://scuba.sourceforge.net/) - a Java based framework for programming smart card aware host applications [LGPL 3.0 License][lgpl-license]. 71 | 72 | 73 | 74 | ## Getting Started 75 | 76 | 77 | ### Prerequisites 78 | 79 | * [node & npm][nodejs-url] 80 | * [React Native][react-native-url] 81 | 82 | ### Mostly automatic installation 83 | 84 | 1. Within your React Native project, open up a new terminal window and install the module: 85 | ```sh 86 | $ npm install react-native-eid-reader --save 87 | ``` 88 | 89 | 2. React Native requires linking native dependencies, excute the following in the terminal: 90 | ```sh 91 | $ react-native link react-native-eid-reader 92 | ``` 93 | 94 | ### Manual installation 95 | 96 | 97 | #### iOS 98 | 99 | 1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]` 100 | 2. Go to `node_modules` ➜ `react-native-eid-reader` and add `EidReader.xcodeproj` 101 | 3. In XCode, in the project navigator, select your project. Add `libEidReader.a` to your project's `Build Phases` ➜ `Link Binary With Libraries` 102 | 4. Run your project (`Cmd+R`)< 103 | 104 | #### Android 105 | 106 | 1. Open up `android/app/src/main/java/[...]/MainApplication.java` 107 | - Add `import com.reactlibrary.EidReaderPackage;` to the imports at the top of the file 108 | - Add `new EidReaderPackage()` to the list returned by the `getPackages()` method 109 | 2. Append the following lines to `android/settings.gradle`: 110 | ``` 111 | include ':react-native-eid-reader' 112 | project(':react-native-eid-reader').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-eid-reader/android') 113 | ``` 114 | 3. Insert the following lines inside the dependencies block in `android/app/build.gradle`: 115 | ``` 116 | compile project(':react-native-eid-reader') 117 | ``` 118 | 119 | 120 | 121 | ## Usage 122 | ```javascript 123 | import EidReader from 'react-native-eid-reader'; 124 | 125 | // TODO: What to do with the module? 126 | EidReader; 127 | ``` 128 | 129 | 130 | ## Roadmap 131 | 132 | See the [open issues](https://github.com/Boukhtam/react-native-eid-reader/issues) for a list of proposed features (and known issues). 133 | 134 | 135 | 136 | ## Contributing 137 | 138 | Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**. 139 | 140 | 1. Fork the Project 141 | 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`) 142 | 3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`) 143 | 4. Push to the Branch (`git push origin feature/AmazingFeature`) 144 | 5. Open a Pull Request 145 | 146 | 147 | 148 | ## License 149 | 150 | Distributed under the [Apache License 2.0]() License. See `LICENSE` for more information. 151 | 152 | 153 | ## Contact 154 | 155 | Hamza BOUKHTAM - [@boukhtam_hamza](https://twitter.com/boukhtam_hamza) - xu@live.fr 156 | 157 | Project Link: [React Native Electronic-Identity-Documents Reader module](https://github.com/Boukhtam/react-native-eid-reader) 158 | 159 | 160 | 161 | ## Acknowledgements 162 | 163 | 164 | 165 | 166 | [contributors-shield]: https://img.shields.io/github/contributors/Boukhtam/react-native-eid-reader?style=plastic 167 | [contributors-url]: https://github.com/Boukhtam/react-native-eid-reader/graphs/contributors 168 | [forks-shield]: https://img.shields.io/github/forks/Boukhtam/react-native-eid-reader?style=plastic 169 | [forks-url]: https://github.com/Boukhtam/react-native-eid-reader/network/members 170 | [stars-shield]: https://img.shields.io/github/stars/Boukhtam/react-native-eid-reader?style=plastic 171 | [stars-url]: https://github.com/Boukhtam/react-native-eid-reader/stargazers 172 | [issues-shield]: https://img.shields.io/github/issues/Boukhtam/react-native-eid-reader?style=plastic 173 | [issues-url]: https://github.com/Boukhtam/react-native-eid-reader/issues 174 | [license-shield]: https://img.shields.io/github/license/Boukhtam/react-native-eid-reader?logo=apache&style=plastic 175 | [license-url]: https://github.com/Boukhtam/react-native-eid-reader/blob/master/LICENSE 176 | [sequence-diagram]: images/sequence_diagram.svg 177 | [lgpl-license]: https://www.gnu.org/licenses/lgpl-3.0.en.html 178 | [nodejs-url]: https://nodejs.org/en/ 179 | [react-native-url]: https://facebook.github.io/react-native/ 180 | 181 | -------------------------------------------------------------------------------- /android/README.md: -------------------------------------------------------------------------------- 1 | README 2 | ====== 3 | 4 | If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: 5 | 6 | 1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed 7 | 2. Be sure to have a `local.properties` file in this folder that points to the Android SDK and NDK 8 | ``` 9 | ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle 10 | sdk.dir=/Users/{username}/Library/Android/sdk 11 | ``` 12 | 3. Delete the `maven` folder 13 | 4. Run `./gradlew installArchives` 14 | 5. Verify that latest set of generated files is in the maven folder with the correct version number 15 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // android/build.gradle 2 | 3 | def safeExtGet(prop, fallback) { 4 | rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback 5 | } 6 | 7 | buildscript { 8 | // The Android Gradle plugin is only required when opening the android folder stand-alone. 9 | // This avoids unnecessary downloads and potential conflicts when the library is included as a 10 | // module dependency in an application project. 11 | if (project == rootProject) { 12 | repositories { 13 | google() 14 | jcenter() 15 | } 16 | dependencies { 17 | classpath 'com.android.tools.build:gradle:3.4.1' 18 | } 19 | } 20 | } 21 | 22 | apply plugin: 'com.android.library' 23 | apply plugin: 'maven' 24 | 25 | // Matches values in recent template from React Native 0.59 / 0.60 26 | // https://github.com/facebook/react-native/blob/0.59-stable/template/android/build.gradle#L5-L9 27 | // https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle#L5-L9 28 | def DEFAULT_COMPILE_SDK_VERSION = 28 29 | def DEFAULT_BUILD_TOOLS_VERSION = "28.0.3" 30 | def DEFAULT_MIN_SDK_VERSION = 16 31 | def DEFAULT_TARGET_SDK_VERSION = 28 32 | 33 | android { 34 | compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) 35 | buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) 36 | defaultConfig { 37 | minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) 38 | targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) 39 | versionCode 1 40 | versionName "1.0" 41 | } 42 | lintOptions { 43 | abortOnError false 44 | } 45 | } 46 | 47 | repositories { 48 | mavenLocal() 49 | maven { 50 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 51 | url "$rootDir/../node_modules/react-native/android" 52 | } 53 | maven { 54 | // Android JSC is installed from npm 55 | url "$rootDir/../node_modules/jsc-android/dist" 56 | } 57 | google() 58 | jcenter() 59 | } 60 | 61 | dependencies { 62 | // ref: 63 | // https://github.com/facebook/react-native/blob/0.61-stable/template/android/app/build.gradle#L192 64 | //noinspection GradleDynamicVersion 65 | implementation 'com.facebook.react:react-native:+' // From node_modules 66 | } 67 | 68 | def configureReactNativePom(def pom) { 69 | def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) 70 | 71 | pom.project { 72 | name packageJson.title 73 | artifactId packageJson.name 74 | version = packageJson.version 75 | group = "com.reactlibrary" 76 | description packageJson.description 77 | url packageJson.repository.baseUrl 78 | 79 | licenses { 80 | license { 81 | name packageJson.license 82 | url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename 83 | distribution 'repo' 84 | } 85 | } 86 | 87 | developers { 88 | developer { 89 | id packageJson.author.username 90 | name packageJson.author.name 91 | } 92 | } 93 | } 94 | } 95 | 96 | afterEvaluate { project -> 97 | // some Gradle build hooks ref: 98 | // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html 99 | task androidJavadoc(type: Javadoc) { 100 | source = android.sourceSets.main.java.srcDirs 101 | classpath += files(android.bootClasspath) 102 | classpath += files(project.getConfigurations().getByName('compile').asList()) 103 | include '**/*.java' 104 | } 105 | 106 | task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { 107 | classifier = 'javadoc' 108 | from androidJavadoc.destinationDir 109 | } 110 | 111 | task androidSourcesJar(type: Jar) { 112 | classifier = 'sources' 113 | from android.sourceSets.main.java.srcDirs 114 | include '**/*.java' 115 | } 116 | 117 | android.libraryVariants.all { variant -> 118 | def name = variant.name.capitalize() 119 | task "jar${name}"(type: Jar, dependsOn: variant.javaCompile) { 120 | from variant.javaCompile.destinationDir 121 | } 122 | } 123 | 124 | artifacts { 125 | archives androidSourcesJar 126 | archives androidJavadocJar 127 | } 128 | 129 | task installArchives(type: Upload) { 130 | configuration = configurations.archives 131 | repositories.mavenDeployer { 132 | // Deploy to react-native-event-bridge/maven, ready to publish to npm 133 | repository url: "file://${projectDir}/../android/maven" 134 | configureReactNativePom pom 135 | } 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/java/com/reactlibrary/EidReaderModule.java: -------------------------------------------------------------------------------- 1 | package com.reactlibrary; 2 | 3 | import com.facebook.react.bridge.ReactApplicationContext; 4 | import com.facebook.react.bridge.ReactContextBaseJavaModule; 5 | import com.facebook.react.bridge.ReactMethod; 6 | import com.facebook.react.bridge.Callback; 7 | 8 | public class EidReaderModule extends ReactContextBaseJavaModule { 9 | 10 | private final ReactApplicationContext reactContext; 11 | 12 | public EidReaderModule(ReactApplicationContext reactContext) { 13 | super(reactContext); 14 | this.reactContext = reactContext; 15 | } 16 | 17 | @Override 18 | public String getName() { 19 | return "EidReader"; 20 | } 21 | 22 | @ReactMethod 23 | public void sampleMethod(String stringArgument, int numberArgument, Callback callback) { 24 | // TODO: Implement some actually useful functionality 25 | callback.invoke("Received numberArgument: " + numberArgument + " stringArgument: " + stringArgument); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /android/src/main/java/com/reactlibrary/EidReaderPackage.java: -------------------------------------------------------------------------------- 1 | package com.reactlibrary; 2 | 3 | import java.util.Arrays; 4 | import java.util.Collections; 5 | import java.util.List; 6 | 7 | import com.facebook.react.ReactPackage; 8 | import com.facebook.react.bridge.NativeModule; 9 | import com.facebook.react.bridge.ReactApplicationContext; 10 | import com.facebook.react.uimanager.ViewManager; 11 | import com.facebook.react.bridge.JavaScriptModule; 12 | 13 | public class EidReaderPackage implements ReactPackage { 14 | @Override 15 | public List createNativeModules(ReactApplicationContext reactContext) { 16 | return Arrays.asList(new EidReaderModule(reactContext)); 17 | } 18 | 19 | @Override 20 | public List createViewManagers(ReactApplicationContext reactContext) { 21 | return Collections.emptyList(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Boukhtam/react-native-eid-reader/deafa5adff20d78281f3330e9fdf8381dd863159/images/logo.png -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import { NativeModules } from 'react-native'; 2 | 3 | const { EidReader } = NativeModules; 4 | 5 | export default EidReader; 6 | -------------------------------------------------------------------------------- /ios/EidReader.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface EidReader : NSObject 4 | 5 | @end 6 | -------------------------------------------------------------------------------- /ios/EidReader.m: -------------------------------------------------------------------------------- 1 | #import "EidReader.h" 2 | 3 | 4 | @implementation EidReader 5 | 6 | RCT_EXPORT_MODULE() 7 | 8 | RCT_EXPORT_METHOD(sampleMethod:(NSString *)stringArgument numberParameter:(nonnull NSNumber *)numberArgument callback:(RCTResponseSenderBlock)callback) 9 | { 10 | // TODO: Implement some actually useful functionality 11 | callback(@[[NSString stringWithFormat: @"numberArgument: %@ stringArgument: %@", numberArgument, stringArgument]]); 12 | } 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /ios/EidReader.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B3E7B58A1CC2AC0600A0062D /* EidReader.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* EidReader.m */; }; 11 | /* End PBXBuildFile section */ 12 | 13 | /* Begin PBXCopyFilesBuildPhase section */ 14 | 58B511D91A9E6C8500147676 /* CopyFiles */ = { 15 | isa = PBXCopyFilesBuildPhase; 16 | buildActionMask = 2147483647; 17 | dstPath = "include/$(PRODUCT_NAME)"; 18 | dstSubfolderSpec = 16; 19 | files = ( 20 | ); 21 | runOnlyForDeploymentPostprocessing = 0; 22 | }; 23 | /* End PBXCopyFilesBuildPhase section */ 24 | 25 | /* Begin PBXFileReference section */ 26 | 134814201AA4EA6300B7C361 /* libEidReader.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libEidReader.a; sourceTree = BUILT_PRODUCTS_DIR; }; 27 | B3E7B5881CC2AC0600A0062D /* EidReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EidReader.h; sourceTree = ""; }; 28 | B3E7B5891CC2AC0600A0062D /* EidReader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EidReader.m; sourceTree = ""; }; 29 | /* End PBXFileReference section */ 30 | 31 | /* Begin PBXFrameworksBuildPhase section */ 32 | 58B511D81A9E6C8500147676 /* Frameworks */ = { 33 | isa = PBXFrameworksBuildPhase; 34 | buildActionMask = 2147483647; 35 | files = ( 36 | ); 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXFrameworksBuildPhase section */ 40 | 41 | /* Begin PBXGroup section */ 42 | 134814211AA4EA7D00B7C361 /* Products */ = { 43 | isa = PBXGroup; 44 | children = ( 45 | 134814201AA4EA6300B7C361 /* libEidReader.a */, 46 | ); 47 | name = Products; 48 | sourceTree = ""; 49 | }; 50 | 58B511D21A9E6C8500147676 = { 51 | isa = PBXGroup; 52 | children = ( 53 | B3E7B5881CC2AC0600A0062D /* EidReader.h */, 54 | B3E7B5891CC2AC0600A0062D /* EidReader.m */, 55 | 134814211AA4EA7D00B7C361 /* Products */, 56 | ); 57 | sourceTree = ""; 58 | }; 59 | /* End PBXGroup section */ 60 | 61 | /* Begin PBXNativeTarget section */ 62 | 58B511DA1A9E6C8500147676 /* EidReader */ = { 63 | isa = PBXNativeTarget; 64 | buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "EidReader" */; 65 | buildPhases = ( 66 | 58B511D71A9E6C8500147676 /* Sources */, 67 | 58B511D81A9E6C8500147676 /* Frameworks */, 68 | 58B511D91A9E6C8500147676 /* CopyFiles */, 69 | ); 70 | buildRules = ( 71 | ); 72 | dependencies = ( 73 | ); 74 | name = EidReader; 75 | productName = RCTDataManager; 76 | productReference = 134814201AA4EA6300B7C361 /* libEidReader.a */; 77 | productType = "com.apple.product-type.library.static"; 78 | }; 79 | /* End PBXNativeTarget section */ 80 | 81 | /* Begin PBXProject section */ 82 | 58B511D31A9E6C8500147676 /* Project object */ = { 83 | isa = PBXProject; 84 | attributes = { 85 | LastUpgradeCheck = 0920; 86 | ORGANIZATIONNAME = Facebook; 87 | TargetAttributes = { 88 | 58B511DA1A9E6C8500147676 = { 89 | CreatedOnToolsVersion = 6.1.1; 90 | }; 91 | }; 92 | }; 93 | buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "EidReader" */; 94 | compatibilityVersion = "Xcode 3.2"; 95 | developmentRegion = English; 96 | hasScannedForEncodings = 0; 97 | knownRegions = ( 98 | en, 99 | ); 100 | mainGroup = 58B511D21A9E6C8500147676; 101 | productRefGroup = 58B511D21A9E6C8500147676; 102 | projectDirPath = ""; 103 | projectRoot = ""; 104 | targets = ( 105 | 58B511DA1A9E6C8500147676 /* EidReader */, 106 | ); 107 | }; 108 | /* End PBXProject section */ 109 | 110 | /* Begin PBXSourcesBuildPhase section */ 111 | 58B511D71A9E6C8500147676 /* Sources */ = { 112 | isa = PBXSourcesBuildPhase; 113 | buildActionMask = 2147483647; 114 | files = ( 115 | B3E7B58A1CC2AC0600A0062D /* EidReader.m in Sources */, 116 | ); 117 | runOnlyForDeploymentPostprocessing = 0; 118 | }; 119 | /* End PBXSourcesBuildPhase section */ 120 | 121 | /* Begin XCBuildConfiguration section */ 122 | 58B511ED1A9E6C8500147676 /* Debug */ = { 123 | isa = XCBuildConfiguration; 124 | buildSettings = { 125 | ALWAYS_SEARCH_USER_PATHS = NO; 126 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 127 | CLANG_CXX_LIBRARY = "libc++"; 128 | CLANG_ENABLE_MODULES = YES; 129 | CLANG_ENABLE_OBJC_ARC = YES; 130 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 131 | CLANG_WARN_BOOL_CONVERSION = YES; 132 | CLANG_WARN_COMMA = YES; 133 | CLANG_WARN_CONSTANT_CONVERSION = YES; 134 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 135 | CLANG_WARN_EMPTY_BODY = YES; 136 | CLANG_WARN_ENUM_CONVERSION = YES; 137 | CLANG_WARN_INFINITE_RECURSION = YES; 138 | CLANG_WARN_INT_CONVERSION = YES; 139 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 140 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 141 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 142 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 143 | CLANG_WARN_STRICT_PROTOTYPES = YES; 144 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 145 | CLANG_WARN_UNREACHABLE_CODE = YES; 146 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 147 | COPY_PHASE_STRIP = NO; 148 | ENABLE_STRICT_OBJC_MSGSEND = YES; 149 | ENABLE_TESTABILITY = YES; 150 | GCC_C_LANGUAGE_STANDARD = gnu99; 151 | GCC_DYNAMIC_NO_PIC = NO; 152 | GCC_NO_COMMON_BLOCKS = YES; 153 | GCC_OPTIMIZATION_LEVEL = 0; 154 | GCC_PREPROCESSOR_DEFINITIONS = ( 155 | "DEBUG=1", 156 | "$(inherited)", 157 | ); 158 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 159 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 160 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 161 | GCC_WARN_UNDECLARED_SELECTOR = YES; 162 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 163 | GCC_WARN_UNUSED_FUNCTION = YES; 164 | GCC_WARN_UNUSED_VARIABLE = YES; 165 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 166 | MTL_ENABLE_DEBUG_INFO = YES; 167 | ONLY_ACTIVE_ARCH = YES; 168 | SDKROOT = iphoneos; 169 | }; 170 | name = Debug; 171 | }; 172 | 58B511EE1A9E6C8500147676 /* Release */ = { 173 | isa = XCBuildConfiguration; 174 | buildSettings = { 175 | ALWAYS_SEARCH_USER_PATHS = NO; 176 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 177 | CLANG_CXX_LIBRARY = "libc++"; 178 | CLANG_ENABLE_MODULES = YES; 179 | CLANG_ENABLE_OBJC_ARC = YES; 180 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 181 | CLANG_WARN_BOOL_CONVERSION = YES; 182 | CLANG_WARN_COMMA = YES; 183 | CLANG_WARN_CONSTANT_CONVERSION = YES; 184 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 185 | CLANG_WARN_EMPTY_BODY = YES; 186 | CLANG_WARN_ENUM_CONVERSION = YES; 187 | CLANG_WARN_INFINITE_RECURSION = YES; 188 | CLANG_WARN_INT_CONVERSION = YES; 189 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 190 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 191 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 192 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 193 | CLANG_WARN_STRICT_PROTOTYPES = YES; 194 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 195 | CLANG_WARN_UNREACHABLE_CODE = YES; 196 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 197 | COPY_PHASE_STRIP = YES; 198 | ENABLE_NS_ASSERTIONS = NO; 199 | ENABLE_STRICT_OBJC_MSGSEND = YES; 200 | GCC_C_LANGUAGE_STANDARD = gnu99; 201 | GCC_NO_COMMON_BLOCKS = YES; 202 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 203 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 204 | GCC_WARN_UNDECLARED_SELECTOR = YES; 205 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 206 | GCC_WARN_UNUSED_FUNCTION = YES; 207 | GCC_WARN_UNUSED_VARIABLE = YES; 208 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 209 | MTL_ENABLE_DEBUG_INFO = NO; 210 | SDKROOT = iphoneos; 211 | VALIDATE_PRODUCT = YES; 212 | }; 213 | name = Release; 214 | }; 215 | 58B511F01A9E6C8500147676 /* Debug */ = { 216 | isa = XCBuildConfiguration; 217 | buildSettings = { 218 | HEADER_SEARCH_PATHS = ( 219 | "$(inherited)", 220 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 221 | "$(SRCROOT)/../../../React/**", 222 | "$(SRCROOT)/../../react-native/React/**", 223 | ); 224 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 225 | OTHER_LDFLAGS = "-ObjC"; 226 | PRODUCT_NAME = EidReader; 227 | SKIP_INSTALL = YES; 228 | }; 229 | name = Debug; 230 | }; 231 | 58B511F11A9E6C8500147676 /* Release */ = { 232 | isa = XCBuildConfiguration; 233 | buildSettings = { 234 | HEADER_SEARCH_PATHS = ( 235 | "$(inherited)", 236 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 237 | "$(SRCROOT)/../../../React/**", 238 | "$(SRCROOT)/../../react-native/React/**", 239 | ); 240 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 241 | OTHER_LDFLAGS = "-ObjC"; 242 | PRODUCT_NAME = EidReader; 243 | SKIP_INSTALL = YES; 244 | }; 245 | name = Release; 246 | }; 247 | /* End XCBuildConfiguration section */ 248 | 249 | /* Begin XCConfigurationList section */ 250 | 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "EidReader" */ = { 251 | isa = XCConfigurationList; 252 | buildConfigurations = ( 253 | 58B511ED1A9E6C8500147676 /* Debug */, 254 | 58B511EE1A9E6C8500147676 /* Release */, 255 | ); 256 | defaultConfigurationIsVisible = 0; 257 | defaultConfigurationName = Release; 258 | }; 259 | 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "EidReader" */ = { 260 | isa = XCConfigurationList; 261 | buildConfigurations = ( 262 | 58B511F01A9E6C8500147676 /* Debug */, 263 | 58B511F11A9E6C8500147676 /* Release */, 264 | ); 265 | defaultConfigurationIsVisible = 0; 266 | defaultConfigurationName = Release; 267 | }; 268 | /* End XCConfigurationList section */ 269 | }; 270 | rootObject = 58B511D31A9E6C8500147676 /* Project object */; 271 | } 272 | -------------------------------------------------------------------------------- /ios/EidReader.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-eid-reader", 3 | "title": "React Native Electronic Identity-docs Reader", 4 | "version": "0.0.0", 5 | "description": "React Native Electronic-Identity-Documents reader module for Android & iOS", 6 | "main": "index.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/Boukhtam/react-native-eid-reader.git", 13 | "baseUrl": "https://github.com/Boukhtam/react-native-eid-reader" 14 | }, 15 | "keywords": [ 16 | "react-native", 17 | "eid", 18 | "mrtd", 19 | "ePassport", 20 | "nfc", 21 | "BAC", 22 | "ios", 23 | "android" 24 | ], 25 | "author": { 26 | "name": "Hamza BOUKHTAM", 27 | "email": "xu@live.fr" 28 | }, 29 | "license": "Apache-2.0", 30 | "licenseFilename": "LICENSE", 31 | "publishConfig": { 32 | "registry": "https://npm.pkg.github.com/" 33 | }, 34 | "readmeFilename": "README.md", 35 | "peerDependencies": { 36 | "react": "^16.8.1", 37 | "react-native": ">=0.59.0-rc.0 <1.0.x" 38 | }, 39 | "files": [ 40 | "index.js", 41 | "android", 42 | "ios", 43 | "react-native-nfc-manager.podspec", 44 | "example" 45 | ], 46 | "devDependencies": { 47 | "react": "^16.8.3", 48 | "react-native": "^0.59.10" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /react-native-eid-reader.podspec: -------------------------------------------------------------------------------- 1 | require "json" 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, "package.json"))) 4 | 5 | Pod::Spec.new do |s| 6 | s.name = "react-native-eid-reader" 7 | s.version = package["version"] 8 | s.summary = package["description"] 9 | s.description = <<-DESC 10 | react-native-eid-reader 11 | DESC 12 | s.homepage = "https://github.com/github_account/react-native-eid-reader" 13 | s.license = "MIT" 14 | # s.license = { :type => "MIT", :file => "FILE_LICENSE" } 15 | s.authors = { "Your Name" => "yourname@email.com" } 16 | s.platforms = { :ios => "9.0", :tvos => "10.0" } 17 | s.source = { :git => "https://github.com/github_account/react-native-eid-reader.git", :tag => "#{s.version}" } 18 | 19 | s.source_files = "ios/**/*.{h,m,swift}" 20 | s.requires_arc = true 21 | 22 | s.dependency "React" 23 | 24 | # s.dependency "..." 25 | end 26 | 27 | --------------------------------------------------------------------------------