-
Notifications
You must be signed in to change notification settings - Fork 181
[SELF-772] feat: consolidate qr / mrz logic into a folder #1134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
transphorm
wants to merge
2
commits into
dev
from
justin/feat-consolidate-qr-mrz-scanner-logic-into-module
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| apply plugin: 'com.android.library' | ||
| apply plugin: 'kotlin-android' | ||
|
|
||
| android { | ||
| compileSdkVersion 33 | ||
| namespace "com.selfxyz.mrzqrscanner" | ||
|
|
||
| defaultConfig { | ||
| minSdkVersion 21 | ||
| targetSdkVersion 33 | ||
| versionCode 1 | ||
| versionName "1.0" | ||
| } | ||
| buildTypes { | ||
| release { | ||
| minifyEnabled false | ||
| proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
| } | ||
| } | ||
| compileOptions { | ||
| sourceCompatibility JavaVersion.VERSION_17 | ||
| targetCompatibility JavaVersion.VERSION_17 | ||
| } | ||
| kotlinOptions { | ||
| jvmTarget = '17' | ||
| } | ||
| buildFeatures { | ||
| viewBinding true | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation 'com.google.android.gms:play-services-mlkit-text-recognition:18.0.2' | ||
| implementation 'com.google.mlkit:text-recognition:16.0.0' | ||
| implementation 'com.google.zxing:core:3.5.2' | ||
| implementation 'com.google.zxing:android-core:3.3.0' | ||
| implementation "com.github.fotoapparat:fotoapparat:2.7.0" | ||
| implementation 'org.jmrtd:jmrtd:0.7.35' | ||
| implementation 'io.reactivex.rxjava2:rxandroid:2.1.1' | ||
| implementation 'io.reactivex.rxjava2:rxjava:2.2.19' | ||
| implementation 'androidx.appcompat:appcompat:1.6.1' | ||
| implementation 'com.google.android.material:material:1.12.0' | ||
| implementation 'androidx.constraintlayout:constraintlayout:2.1.4' | ||
| implementation 'androidx.fragment:fragment-ktx:1.5.7' | ||
| implementation 'com.github.mhshams:jnbis:2.0.2' | ||
| compileOnly 'edu.ucar:jj2000:5.2' | ||
|
|
||
| // Camera dependencies | ||
| implementation "androidx.camera:camera-core:1.3.2" | ||
| implementation "androidx.camera:camera-camera2:1.3.2" | ||
| implementation "androidx.camera:camera-lifecycle:1.3.2" | ||
| implementation "androidx.camera:camera-view:1.3.2" | ||
|
|
||
| // Utility dependencies | ||
| implementation 'com.google.guava:guava:31.1-android' | ||
| implementation 'androidx.core:core-ktx:1.12.0' | ||
|
|
||
| // React Native dependencies | ||
| implementation 'com.facebook.react:react-native:+' | ||
| } | ||
Empty file.
3 changes: 3 additions & 0 deletions
3
app/android/android-mrz-qr-scanner/src/main/AndroidManifest.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| package="com.selfxyz.mrzqrscanner"> | ||
| </manifest> |
15 changes: 15 additions & 0 deletions
15
...oid/android-mrz-qr-scanner/src/main/java/com/selfxyz/mrzqrscanner/MRZQRScannerModule.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| package com.selfxyz.mrzqrscanner; | ||
|
|
||
| import com.facebook.react.bridge.ReactApplicationContext; | ||
| import com.facebook.react.bridge.ReactContextBaseJavaModule; | ||
|
|
||
| public class MRZQRScannerModule extends ReactContextBaseJavaModule { | ||
| public MRZQRScannerModule(ReactApplicationContext reactContext) { | ||
| super(reactContext); | ||
| } | ||
|
|
||
| @Override | ||
| public String getName() { | ||
| return "MRZQRScannerModule"; | ||
| } | ||
| } |
28 changes: 28 additions & 0 deletions
28
...id/android-mrz-qr-scanner/src/main/java/com/selfxyz/mrzqrscanner/MRZQRScannerPackage.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| package com.selfxyz.mrzqrscanner; | ||
|
|
||
| import com.facebook.react.ReactPackage; | ||
| import com.facebook.react.bridge.NativeModule; | ||
| import com.facebook.react.bridge.ReactApplicationContext; | ||
| import com.facebook.react.uimanager.ViewManager; | ||
| import com.selfxyz.mrzqrscanner.ui.PassportOCRViewManager; | ||
| import com.selfxyz.mrzqrscanner.ui.QRCodeScannerViewManager; | ||
|
|
||
| import java.util.ArrayList; | ||
| import java.util.List; | ||
|
|
||
| public class MRZQRScannerPackage implements ReactPackage { | ||
| @Override | ||
| public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { | ||
| List<ViewManager> viewManagers = new ArrayList<>(); | ||
| viewManagers.add(new PassportOCRViewManager(reactContext)); | ||
| viewManagers.add(new QRCodeScannerViewManager(reactContext)); | ||
| return viewManagers; | ||
| } | ||
|
|
||
| @Override | ||
| public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { | ||
| List<NativeModule> modules = new ArrayList<>(); | ||
| modules.add(new MRZQRScannerModule(reactContext)); | ||
| return modules; | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pin the React Native artifact version
com.facebook.react:react-native:+lets Gradle pick an arbitrary version at build time. That breaks reproducibility, risks silently pulling insecure releases, and can desynchronize this library from the app’s pinned React Native runtime. Please align this dependency with the exact version the app already ships with.(Replace the property with whatever constant the app module already uses for the pinned React Native coordinate.)
📝 Committable suggestion
🤖 Prompt for AI Agents