[INJI-195] Upgrade React native version to 0.71.8 (#824)

* chore(INJI-195): upgrade react native version and dependencies

* chore(INJI-195): upgrade expo version and dependencies

* chore(INJI-195): modify associated files on version upgrade

* chore(INJI-295): fixed react native flipper and patch packages

* chore(INJI-195): fix for expo prebuild

* chore(INJI-195): expo linked to android/ios projects

* chore(INJI-195): update metro config

* chore(INJI-195): fix ios build with mmkv storage patch

* chore(INJI-195): gradle version modified

* chore(INJI-195): fixed rn version 0.71.8 due to mmkv library issue

* chore(INJI-195): removed files in android

* chore(INJI-195): fix 0.71.8 for iOS project through pods with expo linking

* chore(INJI-195): fix for custom fonts added through pods due to rn linkage

* chore(INJI-195): fix for removing assets.car generated from pods

* Modify Node version in pipeline (#806)

* chore(INJI-195): fix for android splash screen not shown up

* chore(INJI-195): upgraded to node 18 in pipeline

* chore(INJI-195): add the pod install twice to remove duplicates via script workaround (#807)

Signed-off-by: dhivya0413 <120356578+dhivya0413@users.noreply.github.com>

* INJI-195 Set the signing team for iOS  (#810)

* chore(INJI-195): add the pod install twice to remove duplicates via script workaround

* chore(INJI-195): set the signing team for ios build

---------

Signed-off-by: dhivya0413 <120356578+dhivya0413@users.noreply.github.com>

* Modify github runner to self hosted runner (#811)

* chore(INJI-195): add the pod install twice to remove duplicates via script workaround

* chore(INJI-195): set the signing team for ios build

* chore(INJI-195): set the self hosted runner for ios build

---------

Signed-off-by: dhivya0413 <120356578+dhivya0413@users.noreply.github.com>

* Modify self hosted runner to github hosted runner  (#813)

* chore(INJI-195): add the pod install twice to remove duplicates via script workaround

* chore(INJI-195): set the signing team for ios build

* chore(INJI-195): set the self hosted runner for ios build

* chore(INJI-195): modify the self hosted to github hosted runner

---------

Signed-off-by: dhivya0413 <120356578+dhivya0413@users.noreply.github.com>

* chore(INJI-195): modify the self hosted to github hosted runner

* chore(INJI-195): set the code signing identity for ios build

* chore(INJI-195): assigned app icon files to asset

---------

Signed-off-by: dhivya0413 <120356578+dhivya0413@users.noreply.github.com>
Signed-off-by: Swati Goel <meet2swati@gmail.com>
Co-authored-by: Swati Goel <meet2swati@gmail.com>
This commit is contained in:
dhivya0413
2023-09-13 11:53:59 +05:30
committed by GitHub
parent 27efaf6cdd
commit 769ed54bcf
116 changed files with 25252 additions and 27912 deletions

2
.bundle/config Normal file
View File

@@ -0,0 +1,2 @@
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1

4
.eslintrc.js Normal file
View File

@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: '@react-native',
};

View File

@@ -1,6 +1,6 @@
name: Inji iOS build
on:
on:
workflow_dispatch:
inputs:
mimotoBackendServiceUrl:
@@ -50,22 +50,23 @@ jobs:
build_ios:
name: Deploying to Testflight
runs-on: macos-13
steps:
- uses: actions/checkout@v3.1.0
- uses: actions/setup-node@v3
with:
node-version: '16.x'
node-version: '18.x'
- name: Install npm dependencies
run: |
npm install
- name: Install Pod
run: |
cd ios
pod install
pod install
- name: Deploy iOS Beta to TestFlight
run: |
cd ios
@@ -89,3 +90,11 @@ jobs:
APPLICATION_THEME: ${{ github.event.inputs.theme }}
TESTFLIGHT_INTERNAL_TESTERS_GROUP: ${{ github.event.inputs.internal-testers }}
TESTFLIGHT_BETA_APP_DESCRIPTION: ${{ github.event.inputs.buildDescription }}
- name: Upload Runner Log on Failure
if: failure() # Only run this step if the previous steps failed
uses: actions/upload-artifact@v3.1.1
with:
name: runner-log
path: /Users/runner/Library/Logs/gym/
retention-days: 1

32
.gitignore vendored
View File

@@ -41,6 +41,7 @@ DerivedData
*.ipa
*.xcuserstate
project.xcworkspace
ios/.xcode.env.local
# Android/IntelliJ
#
@@ -50,6 +51,10 @@ build/
local.properties
*.iml
*.hprof
*.hprof
.cxx/
*.keystore
!debug.keystore
# node.js
#
@@ -57,6 +62,18 @@ node_modules/
npm-debug.log
yarn-error.log
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/
**/fastlane/report.xml
**/fastlane/Preview.html
**/fastlane/screenshots
**/fastlane/test_output
# BUCK
buck-out/
\.buckd/
@@ -64,9 +81,15 @@ buck-out/
# Bundle artifacts
*.jsbundle
# CocoaPods
ios/Pods/
# Ruby / CocoaPods
/ios/Pods/
/vendor/bundle/
# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*
# testing
/coverage
c
# OS X temporary files that should never be committed
.DS_Store
src/components/.DS_Store
@@ -94,3 +117,8 @@ temp/
yalc.lock
android/app/debug.keystore
# Expo
.expo
dist/
web-build/

7
.prettierrc.js Normal file
View File

@@ -0,0 +1,7 @@
module.exports = {
arrowParens: 'avoid',
bracketSameLine: true,
bracketSpacing: false,
singleQuote: true,
trailingComma: 'all',
};

View File

@@ -1,13 +0,0 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"bracketSameLine": true,
"jsxSingleQuote": false,
"quoteProps": "consistent",
"printWidth": 80,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false
}

5
.watchmanconfig Normal file
View File

@@ -0,0 +1,5 @@
{
"ignore_dirs": [],
"fsevents_latency": 0.5,
"fsevents_try_resync": true
}

View File

@@ -174,3 +174,26 @@ More info here:
## Credits
Credits listed [here](/Credits.md)
## Congratulations! :tada:
You've successfully run and modified your React Native App. :partying_face:
### Now what?
- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
- If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started).
# Troubleshooting
If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
# Learn More
To learn more about React Native, take a look at the following resources:
- [React Native Website](https://reactnative.dev) - learn more about React Native.
- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment.
- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**.
- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts.
- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native.

View File

@@ -1,13 +0,0 @@
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=C\:/Program Files/OpenJDK/openjdk-11.0.12_7
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true

View File

@@ -1,55 +0,0 @@
# To learn about Buck see [Docs](https://buckbuild.com/).
# To run your application with Buck:
# - install Buck
# - `npm start` - to start the packager
# - `cd android`
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
# - `buck install -r android/app` - compile, install and run application
#
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
lib_deps = []
create_aar_targets(glob(["libs/*.aar"]))
create_jar_targets(glob(["libs/*.jar"]))
android_library(
name = "all-libs",
exported_deps = lib_deps,
)
android_library(
name = "app-code",
srcs = glob([
"src/main/java/**/*.java",
]),
deps = [
":all-libs",
":build_config",
":res",
],
)
android_build_config(
name = "build_config",
package = "io.mosip.residentapp",
)
android_resource(
name = "res",
package = "io.mosip.residentapp",
res = "src/main/res",
)
android_binary(
name = "app",
keystore = "//android/keystores:debug",
manifest = "src/main/AndroidManifest.xml",
package_type = "debug",
deps = [
":app-code",
],
)

View File

@@ -5,131 +5,87 @@ plugins {
apply plugin: "com.android.application"
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: "com.facebook.react"
import com.android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation. If none specified and
* // "index.android.js" exists, it will be used. Otherwise "index.js" is
* // default. Can be overridden with ENTRY_FILE environment variable.
* entryFile: "index.android.js",
*
* // https://reactnative.dev/docs/performance#enable-the-ram-format
* bundleCommand: "ram-bundle",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
project.ext.react = [
enableHermes: (findProperty('expo.jsEngine') ?: "jsc") == "hermes",
bundleInDebug: true,
bundleInRelease: true,
devDisabledInRelease: true,
cliPath: new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/cli.js",
hermesCommand: new File(["node", "--print", "require.resolve('hermes-engine/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/%OS-BIN%/hermesc",
composeSourceMapsPath: new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/scripts/compose-source-maps.js",
]
apply from: new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), "../react.gradle")
react {
/* Folders */
// The root of your project, i.e. where "package.json" lives. Default is '..'
// root = file("../")
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
// reactNativeDir = file("../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
// codegenDir = file("../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
// cliFile = file("../node_modules/react-native/cli.js")
/* Variants */
// The list of variants to that are debuggable. For those we're going to
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
// debuggableVariants = ["liteDebug", "prodDebug"]
/* Bundling */
// A list containing the node command and its flags. Default is just 'node'.
// nodeExecutableAndArgs = ["node"]
//
// The command to run when bundling. By default is 'bundle'
// bundleCommand = "ram-bundle"
//
// The path to the CLI configuration file. Default is empty.
// bundleConfig = file(../rn-cli.config.js)
//
// The name of the generated asset file containing your JS bundle
// bundleAssetName = "MyApplication.android.bundle"
//
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
// entryFile = file("../js/MyApplication.android.js")
//
// A list of extra flags to pass to the 'bundle' commands.
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
// extraPackagerArgs = []
/* Hermes Commands */
// The hermes compiler command to run. By default it is 'hermesc'
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]
}
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
* Set this to true to create four separate APKs instead of one,
* one for each native architecture. This is useful if you don't
* use App Bundles (https://developer.android.com/guide/app-bundle/)
* and want to have separate APKs to upload to the Play Store.
*/
def enableSeparateBuildPerCPUArchitecture = true
/**
* Run Proguard to shrink the Java bytecode in release builds.
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
*/
def enableProguardInReleaseBuilds = false
/**
* The preferred build flavor of JavaScriptCore.
* The preferred build flavor of JavaScriptCore (JSC)
*
* For example, to use the international variant, you can use:
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'
/**
* Whether to enable the Hermes VM.
*
* This should be set on project.ext.react and mirrored here. If it is not set
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
* and the benefits of using Hermes will therefore be sharply reduced.
* Private function to get the list of Native Architectures you want to build.
* This reads the value from reactNativeArchitectures in your gradle.properties
* file and works together with the --active-arch-only flag of react-native run-android.
*/
def enableHermes = project.ext.react.get("enableHermes", false);
def reactNativeArchitectures() {
def value = project.getProperties().get("reactNativeArchitectures")
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
}
androidGitVersion {
baseCode 0
@@ -138,19 +94,20 @@ androidGitVersion {
}
android {
ndkVersion rootProject.ext.ndkVersion
compileSdkVersion rootProject.ext.compileSdkVersion
ext {
APP_NAME_RELEASE = "@string/app_name"
APP_NAME_PH = "@string/app_name_ph"
APP_NAME_MOSIP = "@string/app_name_mosip"
APP_NAME_BETA = "@string/app_name_beta"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
namespace 'io.mosip.residentapp'
namespace 'io.mosip.residentapp'
defaultConfig {
applicationId 'io.mosip.residentapp'
@@ -175,6 +132,7 @@ android {
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
signingConfigs {
release {
def keystore = file('release.keystore')
@@ -233,13 +191,6 @@ android {
]
dimension "inji"
}
ph {
versionName defaultConfig.versionName + "-ph"
manifestPlaceholders = [
APP_NAME: APP_NAME_PH
]
dimension "inji"
}
}
android.applicationVariants.all { variant ->
@@ -252,9 +203,10 @@ android {
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+"// From node_modules
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
implementation 'com.facebook.soloader:soloader:0.10.1+'
def isGifEnabled = (findProperty('expo.gif.enabled') ?: "") == "true";
@@ -283,9 +235,7 @@ dependencies {
}
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.squareup.okhttp3', module:'okhttp'
@@ -294,9 +244,8 @@ dependencies {
exclude group:'com.facebook.flipper'
}
if (enableHermes) {
debugImplementation files(new File(["node", "--print", "require.resolve('hermes-engine/package.json')"].execute(null, rootDir).text.trim(), "../android/hermes-debug.aar"))
releaseImplementation files(new File(["node", "--print", "require.resolve('hermes-engine/package.json')"].execute(null, rootDir).text.trim(), "../android/hermes-release.aar"))
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}
@@ -306,15 +255,7 @@ dependencies {
implementation 'com.jakewharton.timber:timber:4.7.1'
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json')"].execute(null, rootDir).text.trim(), "../native_modules.gradle");
applyNativeModulesAppBuildGradle(project)
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
apply from: "./eas-build.gradle"
try {

View File

@@ -1,19 +0,0 @@
"""Helper definitions to glob .aar and .jar targets"""
def create_aar_targets(aarfiles):
for aarfile in aarfiles:
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
lib_deps.append(":" + name)
android_prebuilt_aar(
name = name,
aar = aarfile,
)
def create_jar_targets(jarfiles):
for jarfile in jarfiles:
name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
lib_deps.append(":" + name)
prebuilt_jar(
name = name,
binary_jar = jarfile,
)

View File

@@ -12,5 +12,8 @@
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30"/>
<!-- from Android 12, Location permission isn't required as we aren't using it to determine location -->
<application tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" android:usesCleartextTraffic="true" />
<application tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" android:usesCleartextTraffic="true" >
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
</application>
</manifest>

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
@@ -17,22 +17,27 @@ import com.facebook.flipper.plugins.inspector.DescriptorMapping;
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
import com.facebook.react.ReactInstanceEventListener;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.modules.network.NetworkingModule;
import okhttp3.OkHttpClient;
/**
* Class responsible of loading Flipper inside your React Native application. This is the debug
* flavor of it. Here you can add your own plugins and customize the Flipper setup.
*/
public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
if (FlipperUtils.shouldEnableFlipper(context)) {
final FlipperClient client = AndroidFlipperClient.getInstance(context);
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
client.addPlugin(new ReactFlipperPlugin());
client.addPlugin(new DatabasesFlipperPlugin(context));
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
client.addPlugin(CrashReporterPlugin.getInstance());
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
NetworkingModule.setCustomClientBuilder(
new NetworkingModule.CustomClientBuilder() {
@@ -43,12 +48,13 @@ public class ReactNativeFlipper {
});
client.addPlugin(networkFlipperPlugin);
client.start();
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
// Hence we run if after all native modules have been initialized
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
if (reactContext == null) {
reactInstanceManager.addReactInstanceEventListener(
new ReactInstanceManager.ReactInstanceEventListener() {
new ReactInstanceEventListener() {
@Override
public void onReactContextInitialized(ReactContext reactContext) {
reactInstanceManager.removeReactInstanceEventListener(this);

View File

@@ -1,54 +1,51 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="io.mosip.residentapp">
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="28" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="28"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30"/>
<!-- from Android 12, Location permission isn't required as we aren't using it to determine location -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"
android:usesPermissionFlags="neverForLocation" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE"/>
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.NFC"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.USE_BIOMETRIC"/>
<uses-permission android:name="android.permission.USE_FINGERPRINT"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="https"/>
</intent>
</queries>
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" android:theme="@style/AppTheme">
<meta-data android:name="expo.modules.updates.ENABLED" android:value="true" />
<meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="43.0.0" />
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS" />
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0" />
<meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://exp.host/@nlpaolo/mosip-resident-app" />
<meta-data android:name="com.google.android.nearby.messages.API_KEY" android:value="${GOOGLE_NEARBY_MESSAGES_API_KEY}" />
<activity android:name=".MainActivity" android:exported="true" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustPan" android:theme="@style/Theme.App.SplashScreen" android:screenOrientation="portrait">
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="true" android:theme="@style/AppTheme">
<meta-data android:name="com.google.android.nearby.messages.API_KEY" android:value="${GOOGLE_NEARBY_MESSAGES_API_KEY}"/>
<meta-data android:name="expo.modules.updates.ENABLED" android:value="true"/>
<meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="48.0.0"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://exp.host/@anonymous/inji"/>
<activity android:name=".MainActivity" android:exported="true" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|locale|layoutDirection" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="io.mosip.residentapp" />
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="io.mosip.residentapp"/>
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
</application>
</manifest>
</manifest>

View File

@@ -1,4 +1,5 @@
package io.mosip.residentapp;
import expo.modules.ReactActivityDelegateWrapper;
import android.Manifest;
import android.content.Context;
@@ -13,6 +14,9 @@ import androidx.core.content.ContextCompat;
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
import com.facebook.react.defaults.DefaultReactActivityDelegate;
import expo.modules.ReactActivityDelegateWrapper;
/**
@@ -108,4 +112,20 @@ public class MainActivity extends ReactActivity {
}
recreate();
}
/**
* Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link
* DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React
* (aka React 18) with two boolean flags.
*/
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, new DefaultReactActivityDelegate( this,
getMainComponentName(),
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled
// If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18).
DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled
));
}
}

View File

@@ -1,42 +0,0 @@
package io.mosip.residentapp;
import android.os.Bundle;
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
import expo.modules.ReactActivityDelegateWrapper;
public class MainActivity extends ReactActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// Set the theme to AppTheme BEFORE onCreate to support
// coloring the background, status bar, and navigation bar.
// This is required for expo-splash-screen.
setTheme(R.style.AppTheme);
super.onCreate(null);
}
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "main";
}
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegateWrapper(
this,
new ReactActivityDelegate(this, getMainComponentName()) {
@Override
protected ReactRootView createRootView() {
return new RNGestureHandlerEnabledRootView(MainActivity.this);
}
});
}
}

View File

@@ -1,4 +1,6 @@
package io.mosip.residentapp;
import expo.modules.ApplicationLifecycleDispatcher;
import expo.modules.ReactNativeHostWrapper;
import android.app.Application;
import android.content.Context;
@@ -12,10 +14,10 @@ import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
import com.facebook.react.defaults.DefaultReactNativeHost;
import com.facebook.soloader.SoLoader;
import expo.modules.ApplicationLifecycleDispatcher;
import expo.modules.ReactNativeHostWrapper;
import timber.log.Timber;
import com.facebook.react.bridge.JSIModulePackage;
@@ -26,9 +28,8 @@ import java.lang.reflect.InvocationTargetException;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(
this,
new ReactNativeHost(this) {
private final ReactNativeHost mReactNativeHost =
new ReactNativeHostWrapper(this, new DefaultReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
@@ -47,6 +48,14 @@ public class MainApplication extends Application implements ReactApplication {
protected String getJSMainModuleName() {
return "index";
}
@Override
protected boolean isNewArchEnabled() {
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
}
@Override
protected Boolean isHermesEnabled() {
return BuildConfig.IS_HERMES_ENABLED;
}
});
@Override
@@ -59,8 +68,11 @@ public class MainApplication extends Application implements ReactApplication {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
ApplicationLifecycleDispatcher.onApplicationCreate(this);
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
DefaultNewArchitectureEntryPoint.load();
}
ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
if (BuildConfig.DEBUG) {
Timber.plant(new Timber.DebugTree());
@@ -68,44 +80,10 @@ public class MainApplication extends Application implements ReactApplication {
// Setup Firebase
FirebaseAnalytics.getInstance(this);
Timber.plant(new CrashReportingTree());
ApplicationLifecycleDispatcher.onApplicationCreate(this);
}
@Override
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);
}
/**
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
*
* @param context
* @param reactInstanceManager
*/
private static void initializeFlipper(
Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("io.mosip.residentapp.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
/**
* A tree which logs important information for crash reporting.
*/
@@ -128,4 +106,10 @@ public class MainApplication extends Application implements ReactApplication {
}
}
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);
}
}

View File

@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="@color/splashscreen_background"/>

View File

@@ -1,2 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resources/>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resources>
<color name="splashscreen_background">#FFFFFF</color>
<color name="splashscreen_background">#ffffff</color>
<color name="iconBackground">#FFFFFF</color>
<color name="colorPrimary">#023c69</color>
<color name="colorPrimaryDark">#ffffff</color>

View File

@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resources>
<string name="app_name">Inji</string>
<string name="app_name_mosip">MOSIP Resident App - Mosip/Inji</string>
@@ -6,4 +5,5 @@
<string name="app_name_ph">MOSIP Resident App - PH</string>
<string name="expo_splash_screen_resize_mode" translatable="false">cover</string>
<string name="expo_splash_screen_status_bar_translucent" translatable="false">false</string>
<string name="ExpoLocalization_supportsRTL" translatable="false">undefined</string>
</resources>

View File

@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:textColor">@android:color/black</item>

View File

@@ -0,0 +1,20 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package io.mosip.residentapp;
import android.content.Context;
import com.facebook.react.ReactInstanceManager;
/**
* Class responsible of loading Flipper inside your React Native application. This is the release
* flavor of it so it's empty as we don't want to load Flipper.
*/
public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
// Do nothing as we don't want to initialize Flipper on Release.
}
}

View File

@@ -2,53 +2,29 @@
buildscript {
ext {
buildToolsVersion = "29.0.3"
buildToolsVersion = "33.0.0"
minSdkVersion = 23
compileSdkVersion = 33
targetSdkVersion = 33
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "21.4.7075529"
kotlinVersion = "1.9.0"
}
repositories {
google()
gradlePluginPortal()
mavenCentral()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.2")
classpath("com.android.tools.build:gradle:7.3.1")
classpath 'com.google.gms:google-services:4.3.5'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url(new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), "../android"))
}
maven {
// Android JSC is installed from npm
url(new File(["node", "--print", "require.resolve('jsc-android/package.json')"].execute(null, rootDir).text.trim(), "../dist"))
}
configurations.all {
resolutionStrategy {
force "com.facebook.soloader:soloader:0.10.1"
}
}
google()
gradlePluginPortal()
mavenCentral()
maven { url 'https://www.jitpack.io' }
jcenter()
classpath("com.facebook.react:react-native-gradle-plugin")
}
}
allprojects { repositories { maven { url "$rootDir/../node_modules/expo-camera/android/maven" } } }
// @generated begin expo-camera-import - expo prebuild (DO NOT MODIFY) sync-f244f4f3d8bf7229102e8f992b525b8602c74770
def expoCameraMavenPath = new File(["node", "--print", "require.resolve('expo-camera/package.json')"].execute(null, rootDir).text.trim(), "../android/maven")
allprojects { repositories { maven { url(expoCameraMavenPath) } } }
// @generated end expo-camera-import

View File

@@ -9,7 +9,7 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
@@ -26,19 +26,35 @@ android.useAndroidX=true
android.enableJetifier=true
# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.99.0
FLIPPER_VERSION=0.125.0
# The hosted JavaScript engine
# Supported values: expo.jsEngine = "hermes" | "jsc"
expo.jsEngine=jsc
# # The hosted JavaScript engine
# # Supported values: expo.jsEngine = "hermes" | "jsc"
# expo.jsEngine=jsc
# Enable GIF support in React Native images (~200 B increase)
expo.gif.enabled=true
# Enable webp support in React Native images (~85 KB increase)
expo.webp.enabled=true
# Enable animated webp support (~3.4 MB increase)
# Disabled by default because iOS doesn't support animated webp
expo.webp.animated=false
# # Enable GIF support in React Native images (~200 B increase)
# expo.gif.enabled=true
# # Enable webp support in React Native images (~85 KB increase)
# expo.webp.enabled=true
# # Enable animated webp support (~3.4 MB increase)
# # Disabled by default because iOS doesn't support animated webp
# expo.webp.animated=false
# If the AsyncStorage_db_size_in_MB is not configured, Default DB_MAX_SIZE is 6MB in Android
AsyncStorage_db_size_in_MB=30
# # If the AsyncStorage_db_size_in_MB is not configured, Default DB_MAX_SIZE is 6MB in Android
# AsyncStorage_db_size_in_MB=30
# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
# ./gradlew <task> -PreactNativeArchitectures=x86_64
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# Use this property to enable support to the new architecture.
# This will allow you to use TurboModules and the Fabric render in
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false
# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
hermesEnabled=true
expo.jsEngine=hermes

Binary file not shown.

View File

@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

269
android/gradlew vendored
View File

@@ -1,7 +1,7 @@
#!/usr/bin/env sh
#!/bin/sh
#
# Copyright 2015 the original author or authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,78 +17,113 @@
#
##############################################################################
##
## Gradle start up script for UN*X
##
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
MAX_FD=maximum
warn () {
echo "$*"
}
} >&2
die () {
echo
echo "$*"
echo
exit 1
}
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -97,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
@@ -105,79 +140,95 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

37
android/gradlew.bat vendored
View File

@@ -14,7 +14,7 @@
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -54,7 +55,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -64,40 +65,28 @@ echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
:omega

View File

@@ -1,9 +1,8 @@
rootProject.name = 'Inji'
apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle");
useExpoModules()
apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json')"].execute(null, rootDir).text.trim(), "../native_modules.gradle");
applyNativeModulesSettingsGradle(settings)
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/react-native-gradle-plugin')
apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle")
useExpoModules()

View File

@@ -14,7 +14,7 @@ export default {
},
assetBundlePatterns: ['**/*'],
ios: {
bundleIdentifier: 'io.mosip.residentapp',
bundleIdentifier: 'io.mosip.inji.mobileid',
buildNumber: '1.0.0',
supportsTablet: true,
},
@@ -28,4 +28,5 @@ export default {
},
platforms: ['android', 'ios'],
privacy: 'hidden',
plugins: ['expo-localization'],
};

4
app.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "inji",
"displayName": "Inji"
}

View File

@@ -1,5 +1,5 @@
import React, { useCallback, useContext, useEffect, useRef } from 'react';
import { Camera } from 'expo-camera';
import React, {useCallback, useContext, useEffect, useRef} from 'react';
import {Camera} from 'expo-camera';
import {
Platform,
StyleSheet,
@@ -7,9 +7,9 @@ import {
View,
Image,
} from 'react-native';
import { Button, Centered, Column, Row, Text } from './ui';
import { useInterpret, useSelector } from '@xstate/react';
import { useTranslation } from 'react-i18next';
import {Button, Centered, Column, Row, Text} from './ui';
import {useInterpret, useSelector} from '@xstate/react';
import {useTranslation} from 'react-i18next';
import {
FaceScannerEvents,
selectIsCheckingPermission,
@@ -22,14 +22,14 @@ import {
selectIsCapturing,
selectIsVerifying,
} from '../machines/faceScanner';
import { GlobalContext } from '../shared/GlobalContext';
import { selectIsActive } from '../machines/app';
import { RotatingIcon } from './RotatingIcon';
import { Theme } from './ui/styleUtils';
import {GlobalContext} from '../shared/GlobalContext';
import {selectIsActive} from '../machines/app';
import {RotatingIcon} from './RotatingIcon';
import {Theme} from './ui/styleUtils';
export const FaceScanner: React.FC<FaceScannerProps> = (props) => {
const { t } = useTranslation('FaceScanner');
const { appService } = useContext(GlobalContext);
export const FaceScanner: React.FC<FaceScannerProps> = props => {
const {t} = useTranslation('FaceScanner');
const {appService} = useContext(GlobalContext);
const isActive = useSelector(appService, selectIsActive);
const machine = useRef(createFaceScannerMachine(props.vcImage));
@@ -51,7 +51,7 @@ export const FaceScanner: React.FC<FaceScannerProps> = (props) => {
service.send(FaceScannerEvents.READY(node));
}
},
[isScanning]
[isScanning],
);
useEffect(() => {
@@ -104,7 +104,7 @@ export const FaceScanner: React.FC<FaceScannerProps> = (props) => {
{isCapturing || isVerifying ? (
<RotatingIcon name="sync" size={64} />
) : (
<Row align="center" style={{ marginTop: 42 }}>
<Row align="center" style={{marginTop: 42}}>
<Centered style={Theme.Styles.imageCaptureButton}>
<TouchableOpacity
onPress={() => service.send(FaceScannerEvents.CAPTURE())}>

View File

@@ -1,16 +1,14 @@
import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Pressable } from 'react-native';
import { Modal } from './ui/Modal';
import { ScrollView } from 'react-native-gesture-handler';
import { MainRouteProps } from '../routes/main';
import { Column, Text } from './ui';
import { Theme } from './ui/styleUtils';
import React, {useState} from 'react';
import {useTranslation} from 'react-i18next';
import {Pressable} from 'react-native';
import {Modal} from './ui/Modal';
import {ScrollView} from 'react-native-gesture-handler';
import {MainRouteProps} from '../routes/main';
import {Column, Text} from './ui';
import {Theme} from './ui/styleUtils';
export const HelpScreen: React.FC<HelpScreenProps & MainRouteProps> = (
props
) => {
const { t } = useTranslation('HelpScreen');
export const HelpScreen: React.FC<HelpScreenProps & MainRouteProps> = props => {
const {t} = useTranslation('HelpScreen');
const [showHelpPage, setShowHelpPage] = useState(false);

View File

@@ -1,21 +1,21 @@
import React from 'react';
import { Icon, ListItem, Overlay } from 'react-native-elements';
import { Theme } from '../components/ui/styleUtils';
import { Column, Row, Text } from '../components/ui';
import { WalletBinding } from '../screens/Home/MyVcs/WalletBinding';
import { Pressable, View } from 'react-native';
import { useKebabPopUp } from './KebabPopUpController';
import { ActorRefFrom } from 'xstate';
import { vcItemMachine } from '../machines/vcItem';
import { useTranslation } from 'react-i18next';
import { HistoryTab } from '../screens/Home/MyVcs/HistoryTab';
import { RemoveVcWarningOverlay } from '../screens/Home/MyVcs/RemoveVcWarningOverlay';
import { ScrollView } from 'react-native-gesture-handler';
import {Icon, ListItem, Overlay} from 'react-native-elements';
import {Theme} from '../components/ui/styleUtils';
import {Column, Row, Text} from '../components/ui';
import {WalletBinding} from '../screens/Home/MyVcs/WalletBinding';
import {Pressable, View} from 'react-native';
import {useKebabPopUp} from './KebabPopUpController';
import {ActorRefFrom} from 'xstate';
import {vcItemMachine} from '../machines/vcItem';
import {useTranslation} from 'react-i18next';
import {HistoryTab} from '../screens/Home/MyVcs/HistoryTab';
import {RemoveVcWarningOverlay} from '../screens/Home/MyVcs/RemoveVcWarningOverlay';
import {ScrollView} from 'react-native-gesture-handler';
import testIDProps from '../shared/commonUtil';
export const KebabPopUp: React.FC<KebabPopUpProps> = (props) => {
export const KebabPopUp: React.FC<KebabPopUpProps> = props => {
const controller = useKebabPopUp(props);
const { t } = useTranslation('HomeScreenKebabPopUp');
const {t} = useTranslation('HomeScreenKebabPopUp');
return (
<Column>
<Icon

View File

@@ -1,16 +1,16 @@
import React from 'react';
import { SUPPORTED_LANGUAGES } from '../i18n';
import { I18nManager, View } from 'react-native';
import { Picker } from './ui/Picker';
import {SUPPORTED_LANGUAGES} from '../i18n';
import {I18nManager, View} from 'react-native';
import {Picker} from './ui/Picker';
import Storage from '../shared/storage';
import { useTranslation } from 'react-i18next';
import {useTranslation} from 'react-i18next';
import i18next from 'i18next';
import RNRestart from 'react-native-restart';
export const LanguageSelector: React.FC<LanguageSelectorProps> = (props) => {
const { i18n } = useTranslation();
export const LanguageSelector: React.FC<LanguageSelectorProps> = props => {
const {i18n} = useTranslation();
const languages = Object.entries(SUPPORTED_LANGUAGES).map(
([value, label]) => ({ label, value })
([value, label]) => ({label, value}),
);
const changeLanguage = async (language: string) => {

View File

@@ -1,13 +1,13 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import {useTranslation} from 'react-i18next';
import { Dimensions } from 'react-native';
import { Overlay, LinearProgress } from 'react-native-elements';
import { Button, Column, Text } from './ui';
import { Theme } from './ui/styleUtils';
import {Dimensions} from 'react-native';
import {Overlay, LinearProgress} from 'react-native-elements';
import {Button, Column, Text} from './ui';
import {Theme} from './ui/styleUtils';
export const MessageOverlay: React.FC<MessageOverlayProps> = (props) => {
const { t } = useTranslation('common');
export const MessageOverlay: React.FC<MessageOverlayProps> = props => {
const {t} = useTranslation('common');
return (
<Overlay
isVisible={props.isVisible}
@@ -19,7 +19,7 @@ export const MessageOverlay: React.FC<MessageOverlayProps> = (props) => {
style={
!props.progress
? Theme.MessageOverlayStyles.popupOverLay
: { height: 100 }
: {height: 100}
}>
<Column padding="21" crossAlign="center">
{props.title && (
@@ -71,7 +71,7 @@ export const ErrorMessageOverlay: React.FC<ErrorMessageOverlayProps> = ({
onDismiss,
translationPath,
}) => {
const { t } = useTranslation(translationPath);
const {t} = useTranslation(translationPath);
return (
<MessageOverlay
@@ -90,7 +90,7 @@ export interface ErrorMessageOverlayProps {
translationPath: string;
}
const Progress: React.FC<Pick<MessageOverlayProps, 'progress'>> = (props) => {
const Progress: React.FC<Pick<MessageOverlayProps, 'progress'>> = props => {
return typeof props.progress === 'boolean' ? (
props.progress && (
<LinearProgress variant="indeterminate" color={Theme.Colors.Loading} />

View File

@@ -1,13 +1,13 @@
import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { PinInput } from './PinInput';
import { hashData } from '../shared/commonUtil';
import { argon2iConfig } from '../shared/constants';
import React, {useEffect, useState} from 'react';
import {useTranslation} from 'react-i18next';
import {PinInput} from './PinInput';
import {hashData} from '../shared/commonUtil';
import {argon2iConfig} from '../shared/constants';
export const MAX_PIN = 6;
export const PasscodeVerify: React.FC<PasscodeVerifyProps> = (props) => {
const { t } = useTranslation('PasscodeVerify');
export const PasscodeVerify: React.FC<PasscodeVerifyProps> = props => {
const {t} = useTranslation('PasscodeVerify');
const [isVerified, setIsVerified] = useState(false);
useEffect(() => {

View File

@@ -1,13 +1,13 @@
import React, { useEffect } from 'react';
import { TextInput } from 'react-native';
import { usePinInput } from '../machines/pinInput';
import { Row } from './ui';
import { Theme } from './ui/styleUtils';
import React, {useEffect} from 'react';
import {TextInput} from 'react-native';
import {usePinInput} from '../machines/pinInput';
import {Row} from './ui';
import {Theme} from './ui/styleUtils';
export const PinInput: React.FC<PinInputProps> = (props) => {
const { state, send, events } = usePinInput(props.length);
const { inputRefs, values } = state.context;
const { UPDATE_INPUT, FOCUS_INPUT, KEY_PRESS } = events;
export const PinInput: React.FC<PinInputProps> = props => {
const {state, send, events} = usePinInput(props.length);
const {inputRefs, values} = state.context;
const {UPDATE_INPUT, FOCUS_INPUT, KEY_PRESS} = events;
useEffect(() => {
if (props.onDone && values.filter(Boolean).length === inputRefs.length) {
@@ -29,7 +29,7 @@ export const PinInput: React.FC<PinInputProps> = (props) => {
ref={input}
value={values[index]}
// KNOWN ISSUE: https://github.com/facebook/react-native/issues/19507
onKeyPress={({ nativeEvent }) => send(KEY_PRESS(nativeEvent.key))}
onKeyPress={({nativeEvent}) => send(KEY_PRESS(nativeEvent.key))}
onChangeText={(value: string) =>
send(UPDATE_INPUT(value.replace(/\D/g, ''), index))
}

View File

@@ -1,13 +1,13 @@
import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Button, Centered, Column, Text } from './ui';
import { Modal } from './ui/Modal';
import { Image } from 'react-native';
import { Theme } from './ui/styleUtils';
import React, {useState} from 'react';
import {useTranslation} from 'react-i18next';
import {Button, Centered, Column, Text} from './ui';
import {Modal} from './ui/Modal';
import {Image} from 'react-native';
import {Theme} from './ui/styleUtils';
import PaginationDot from 'react-native-animated-pagination-dot';
export const ProgressingModal: React.FC<ProgressingModalProps> = (props) => {
const { t } = useTranslation('ScanScreen');
export const ProgressingModal: React.FC<ProgressingModalProps> = props => {
const {t} = useTranslation('ScanScreen');
let n = 0;
const [curPage, setCurPage] = useState(n);
@@ -29,7 +29,7 @@ export const ProgressingModal: React.FC<ProgressingModalProps> = (props) => {
source={Theme.InjiProgressingLogo}
height={2}
width={2}
style={{ marginBottom: 15, marginLeft: -6 }}
style={{marginBottom: 15, marginLeft: -6}}
/>
{props.progress && (
<PaginationDot

View File

@@ -1,14 +1,14 @@
import React, { useEffect, useState } from 'react';
import { Dimensions, Pressable } from 'react-native';
import { Icon, Overlay } from 'react-native-elements';
import { Centered, Column, Row, Text } from './ui';
import React, {useEffect, useState} from 'react';
import {Dimensions, Pressable} from 'react-native';
import {Icon, Overlay} from 'react-native-elements';
import {Centered, Column, Row, Text} from './ui';
import QRCode from 'react-native-qrcode-svg';
import { Theme } from './ui/styleUtils';
import { Image } from 'react-native';
import { useTranslation } from 'react-i18next';
import {Theme} from './ui/styleUtils';
import {Image} from 'react-native';
import {useTranslation} from 'react-i18next';
export const QrCodeOverlay: React.FC<QrCodeOverlayProps> = (props) => {
const { t } = useTranslation('VcDetails');
export const QrCodeOverlay: React.FC<QrCodeOverlayProps> = props => {
const {t} = useTranslation('VcDetails');
const [isQrOverlayVisible, setIsQrOverlayVisible] = useState(false);
@@ -33,7 +33,7 @@ export const QrCodeOverlay: React.FC<QrCodeOverlayProps> = (props) => {
<Overlay
isVisible={isQrOverlayVisible}
onBackdropPress={toggleQrOverlay}
overlayStyle={{ padding: 1, borderRadius: 21 }}>
overlayStyle={{padding: 1, borderRadius: 21}}>
<Column style={Theme.QrCodeStyles.expandedQrCode}>
<Row pY={20} style={Theme.QrCodeStyles.QrCodeHeader}>
<Text

View File

@@ -1,25 +1,19 @@
import React, { useContext, useEffect, useState } from 'react';
import React, {useContext, useEffect, useState} from 'react';
import Icon from 'react-native-vector-icons/MaterialIcons';
import { Camera } from 'expo-camera';
import { BarCodeEvent, BarCodeScanner } from 'expo-barcode-scanner';
import {
Linking,
TouchableOpacity,
View,
Image,
Pressable,
} from 'react-native';
import { Theme } from './ui/styleUtils';
import { Column, Button, Text, Centered, Row } from './ui';
import { GlobalContext } from '../shared/GlobalContext';
import { useSelector } from '@xstate/react';
import { selectIsActive } from '../machines/app';
import { useTranslation } from 'react-i18next';
import { useScanLayout } from '../screens/Scan/ScanLayoutController';
import {Camera} from 'expo-camera';
import {BarCodeEvent, BarCodeScanner} from 'expo-barcode-scanner';
import {Linking, TouchableOpacity, View, Image, Pressable} from 'react-native';
import {Theme} from './ui/styleUtils';
import {Column, Button, Text, Centered, Row} from './ui';
import {GlobalContext} from '../shared/GlobalContext';
import {useSelector} from '@xstate/react';
import {selectIsActive} from '../machines/app';
import {useTranslation} from 'react-i18next';
import {useScanLayout} from '../screens/Scan/ScanLayoutController';
export const QrScanner: React.FC<QrScannerProps> = (props) => {
const { t } = useTranslation('QrScanner');
const { appService } = useContext(GlobalContext);
export const QrScanner: React.FC<QrScannerProps> = props => {
const {t} = useTranslation('QrScanner');
const {appService} = useContext(GlobalContext);
const [hasPermission, setHasPermission] = useState(null);
const [scanned, setScanned] = useState(false);
const [cameraType, setCameraType] = useState(Camera.Constants.Type.back);
@@ -106,7 +100,7 @@ export const QrScanner: React.FC<QrScannerProps> = (props) => {
setCameraType(
cameraType === Camera.Constants.Type.back
? Camera.Constants.Type.front
: Camera.Constants.Type.back
: Camera.Constants.Type.back,
);
}}>
<Image

View File

@@ -1,21 +1,21 @@
import { formatDistanceToNow } from 'date-fns';
import {formatDistanceToNow} from 'date-fns';
import React from 'react';
import * as DateFnsLocale from 'date-fns/locale';
import { useTranslation } from 'react-i18next';
import { Image, ImageBackground, View } from 'react-native';
import { Icon } from 'react-native-elements';
import { VC, CredentialSubject } from '../types/vc';
import { Button, Column, Row, Text } from './ui';
import { Theme } from './ui/styleUtils';
import { TextItem } from './ui/TextItem';
import { VcItemTags } from './VcItemTags';
import {useTranslation} from 'react-i18next';
import {Image, ImageBackground, View} from 'react-native';
import {Icon} from 'react-native-elements';
import {VC, CredentialSubject} from '../types/vc';
import {Button, Column, Row, Text} from './ui';
import {Theme} from './ui/styleUtils';
import {TextItem} from './ui/TextItem';
import {VcItemTags} from './VcItemTags';
import VerifiedIcon from './VerifiedIcon';
import { getLocalizedField } from '../i18n';
import { CREDENTIAL_REGISTRY_EDIT } from 'react-native-dotenv';
import { QrCodeOverlay } from './QrCodeOverlay';
import {getLocalizedField} from '../i18n';
import {CREDENTIAL_REGISTRY_EDIT} from 'react-native-dotenv';
import {QrCodeOverlay} from './QrCodeOverlay';
export const VcDetails: React.FC<VcDetailsProps> = (props) => {
const { t, i18n } = useTranslation('VcDetails');
export const VcDetails: React.FC<VcDetailsProps> = props => {
const {t, i18n} = useTranslation('VcDetails');
//Assigning the UIN and VID from the VC details to display the idtype label
const uin = props.vc?.verifiableCredential.credentialSubject.UIN;
@@ -36,7 +36,7 @@ export const VcDetails: React.FC<VcDetailsProps> = (props) => {
<Image
source={
props.vc?.credential.biometrics?.face
? { uri: props.vc?.credential.biometrics.face }
? {uri: props.vc?.credential.biometrics.face}
: Theme.ProfileIcon
}
style={Theme.Styles.openCardImage}
@@ -62,7 +62,7 @@ export const VcDetails: React.FC<VcDetailsProps> = (props) => {
size="smaller"
color={Theme.Colors.Details}>
{getLocalizedField(
props.vc?.verifiableCredential.credentialSubject.fullName
props.vc?.verifiableCredential.credentialSubject.fullName,
)}
</Text>
</Column>
@@ -137,8 +137,8 @@ export const VcDetails: React.FC<VcDetailsProps> = (props) => {
{new Date(
getLocalizedField(
props.vc?.verifiableCredential.credentialSubject
.dateOfBirth
)
.dateOfBirth,
),
).toLocaleDateString()}
</Text>
</Column>
@@ -158,7 +158,7 @@ export const VcDetails: React.FC<VcDetailsProps> = (props) => {
size="smaller"
color={Theme.Colors.Details}>
{getLocalizedField(
props.vc?.verifiableCredential.credentialSubject.gender
props.vc?.verifiableCredential.credentialSubject.gender,
)}
</Text>
</Column>
@@ -211,7 +211,7 @@ export const VcDetails: React.FC<VcDetailsProps> = (props) => {
size="smaller"
color={Theme.Colors.Details}>
{getLocalizedField(
props.vc?.verifiableCredential.credentialSubject.phone
props.vc?.verifiableCredential.credentialSubject.phone,
)}
</Text>
</Column>
@@ -235,14 +235,14 @@ export const VcDetails: React.FC<VcDetailsProps> = (props) => {
style={
props.vc?.verifiableCredential.credentialSubject.email
.length > 25
? { flex: 1 }
: { flex: 0 }
? {flex: 1}
: {flex: 0}
}
weight="semibold"
size="smaller"
color={Theme.Colors.Details}>
{getLocalizedField(
props.vc?.verifiableCredential.credentialSubject.email
props.vc?.verifiableCredential.credentialSubject.email,
)}
</Text>
</Row>
@@ -259,12 +259,12 @@ export const VcDetails: React.FC<VcDetailsProps> = (props) => {
<Row>
<Text
testID="addressValue"
style={{ flex: 1 }}
style={{flex: 1}}
weight="semibold"
size="smaller"
color={Theme.Colors.Details}>
{getFullAddress(
props.vc?.verifiableCredential.credentialSubject
props.vc?.verifiableCredential.credentialSubject,
)}
</Text>
</Row>
@@ -325,7 +325,7 @@ export const VcDetails: React.FC<VcDetailsProps> = (props) => {
/>
<Text
testID="offlineAuthDisabledHeader"
style={{ flex: 1 }}
style={{flex: 1}}
weight="semibold"
size="small"
margin={'0 0 5 0'}
@@ -335,7 +335,7 @@ export const VcDetails: React.FC<VcDetailsProps> = (props) => {
</Row>
<Text
testID="offlineAuthDisabledMessage"
style={{ flex: 1 }}
style={{flex: 1}}
weight="regular"
size="small"
margin={'0 0 5 0'}
@@ -357,7 +357,7 @@ export const VcDetails: React.FC<VcDetailsProps> = (props) => {
name="verified-user"
color={Theme.Colors.VerifiedIcon}
size={28}
containerStyle={{ marginStart: 4, bottom: 1 }}
containerStyle={{marginStart: 4, bottom: 1}}
/>
<Text
testID="profileAuthenticated"
@@ -399,7 +399,7 @@ function getFullAddress(credential: CredentialSubject) {
];
return fields
.map((field) => getLocalizedField(credential[field]))
.map(field => getLocalizedField(credential[field]))
.concat(credential.postalCode)
.filter(Boolean)
.join(', ');

View File

@@ -1,7 +1,7 @@
import React, { useContext, useRef } from 'react';
import { useInterpret, useSelector } from '@xstate/react';
import { Pressable } from 'react-native';
import { ActorRefFrom } from 'xstate';
import React, {useContext, useRef} from 'react';
import {useInterpret, useSelector} from '@xstate/react';
import {Pressable} from 'react-native';
import {ActorRefFrom} from 'xstate';
import {
createVcItemMachine,
selectVerifiableCredential,
@@ -13,26 +13,26 @@ import {
selectIsSavingFailedInIdle,
selectKebabPopUp,
} from '../machines/vcItem';
import { VcItemEvents } from '../machines/vcItem';
import { ErrorMessageOverlay } from './MessageOverlay';
import { Theme } from './ui/styleUtils';
import { GlobalContext } from '../shared/GlobalContext';
import { VcItemContent } from './VcItemContent';
import { VcItemActivationStatus } from './VcItemActivationStatus';
import { Row } from './ui';
import { KebabPopUp } from './KebabPopUp';
import { logState } from '../machines/app';
import {VcItemEvents} from '../machines/vcItem';
import {ErrorMessageOverlay} from './MessageOverlay';
import {Theme} from './ui/styleUtils';
import {GlobalContext} from '../shared/GlobalContext';
import {VcItemContent} from './VcItemContent';
import {VcItemActivationStatus} from './VcItemActivationStatus';
import {Row} from './ui';
import {KebabPopUp} from './KebabPopUp';
import {logState} from '../machines/app';
export const VcItem: React.FC<VcItemProps> = (props) => {
const { appService } = useContext(GlobalContext);
export const VcItem: React.FC<VcItemProps> = props => {
const {appService} = useContext(GlobalContext);
const machine = useRef(
createVcItemMachine(
appService.getSnapshot().context.serviceRefs,
props.vcKey
)
props.vcKey,
),
);
const service = useInterpret(machine.current, { devTools: __DEV__ });
const service = useInterpret(machine.current, {devTools: __DEV__});
service.subscribe(logState);
const context = useSelector(service, selectContext);
const verifiableCredential = useSelector(service, selectVerifiableCredential);

View File

@@ -1,12 +1,12 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Dimensions } from 'react-native';
import { Icon } from 'react-native-elements';
import { ActorRefFrom } from 'xstate';
import { vcItemMachine } from '../machines/vcItem';
import { VerifiableCredential } from '../types/vc';
import { Row, Text } from './ui';
import { Theme } from './ui/styleUtils';
import {useTranslation} from 'react-i18next';
import {Dimensions} from 'react-native';
import {Icon} from 'react-native-elements';
import {ActorRefFrom} from 'xstate';
import {vcItemMachine} from '../machines/vcItem';
import {VerifiableCredential} from '../types/vc';
import {Row, Text} from './ui';
import {Theme} from './ui/styleUtils';
const WalletUnverifiedIcon: React.FC = () => {
return (
@@ -15,7 +15,7 @@ const WalletUnverifiedIcon: React.FC = () => {
color={Theme.Colors.Icon}
size={28}
type="material-community"
containerStyle={{ marginStart: 4, bottom: 1 }}
containerStyle={{marginStart: 4, bottom: 1}}
/>
);
};
@@ -26,15 +26,15 @@ const WalletVerifiedIcon: React.FC = () => {
name="verified-user"
color={Theme.Colors.VerifiedIcon}
size={28}
containerStyle={{ marginStart: 4, bottom: 1 }}
containerStyle={{marginStart: 4, bottom: 1}}
/>
);
};
const WalletUnverifiedActivationDetails: React.FC<
WalletUnVerifiedDetailsProps
> = (props) => {
const { t } = useTranslation('VcDetails');
> = props => {
const {t} = useTranslation('VcDetails');
return (
<Row
width={Dimensions.get('screen').width * 0.8}
@@ -63,10 +63,10 @@ const WalletUnverifiedActivationDetails: React.FC<
);
};
const WalletVerifiedActivationDetails: React.FC<WalletVerifiedDetailsProps> = (
props
) => {
const { t } = useTranslation('VcDetails');
const WalletVerifiedActivationDetails: React.FC<
WalletVerifiedDetailsProps
> = props => {
const {t} = useTranslation('VcDetails');
return (
<Row
width={Dimensions.get('screen').width * 0.8}
@@ -95,9 +95,9 @@ const WalletVerifiedActivationDetails: React.FC<WalletVerifiedDetailsProps> = (
);
};
export const VcItemActivationStatus: React.FC<VcItemActivationStatusProps> = (
props
) => {
export const VcItemActivationStatus: React.FC<
VcItemActivationStatusProps
> = props => {
return (
<Row>
{props.emptyWalletBindingId ? (

View File

@@ -1,13 +1,13 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Image, ImageBackground, View } from 'react-native';
import { getLocalizedField } from '../i18n';
import { VerifiableCredential } from '../types/vc';
import { VcItemTags } from './VcItemTags';
import {useTranslation} from 'react-i18next';
import {Image, ImageBackground, View} from 'react-native';
import {getLocalizedField} from '../i18n';
import {VerifiableCredential} from '../types/vc';
import {VcItemTags} from './VcItemTags';
import VerifiedIcon from './VerifiedIcon';
import { Column, Row, Text } from './ui';
import { Theme } from './ui/styleUtils';
import { CheckBox, Icon } from 'react-native-elements';
import {Column, Row, Text} from './ui';
import {Theme} from './ui/styleUtils';
import {CheckBox, Icon} from 'react-native-elements';
const getDetails = (arg1, arg2, verifiableCredential) => {
if (arg1 === 'Status') {
@@ -73,14 +73,14 @@ const getDetails = (arg1, arg2, verifiableCredential) => {
}
};
export const VcItemContent: React.FC<VcItemContentProps> = (props) => {
export const VcItemContent: React.FC<VcItemContentProps> = props => {
//Assigning the UIN and VID from the VC details to display the idtype label
const uin = props.verifiableCredential?.credentialSubject.UIN;
const vid = props.verifiableCredential?.credentialSubject.VID;
const fullName = !props.verifiableCredential
? ''
: getLocalizedField(props.verifiableCredential.credentialSubject.fullName);
const { t } = useTranslation('VcDetails');
const {t} = useTranslation('VcDetails');
const isvalid = !props.verifiableCredential ? '' : t('valid');
const selectableOrCheck = props.selectable ? (
<CheckBox
@@ -108,7 +108,7 @@ export const VcItemContent: React.FC<VcItemContentProps> = (props) => {
source={
!props.verifiableCredential
? Theme.ProfileIcon
: { uri: props.context.credential.biometrics.face }
: {uri: props.context.credential.biometrics.face}
}
style={Theme.Styles.closeCardImage}>
{props.iconName && (
@@ -116,7 +116,7 @@ export const VcItemContent: React.FC<VcItemContentProps> = (props) => {
name={props.iconName}
type={props.iconType}
color={Theme.Colors.Icon}
style={{ marginLeft: -80 }}
style={{marginLeft: -80}}
/>
)}
</ImageBackground>
@@ -260,7 +260,7 @@ export const VcItemContent: React.FC<VcItemContentProps> = (props) => {
</Column>
<Column
testID="logo"
style={{ display: props.verifiableCredential ? 'flex' : 'none' }}>
style={{display: props.verifiableCredential ? 'flex' : 'none'}}>
<Image
source={Theme.MosipLogo}
style={Theme.Styles.logo}

View File

@@ -1,13 +1,13 @@
import React from 'react';
import { I18nManager, Modal as RNModal, View } from 'react-native';
import { Icon } from 'react-native-elements';
import { Column, Row, Text } from '.';
import { useSendVcScreen } from '../../screens/Scan/SendVcScreenController';
import { DeviceInfoList } from '../DeviceInfoList';
import { ElevationLevel, Theme } from './styleUtils';
import {I18nManager, Modal as RNModal, View} from 'react-native';
import {Icon} from 'react-native-elements';
import {Column, Row, Text} from '.';
import {useSendVcScreen} from '../../screens/Scan/SendVcScreenController';
import {DeviceInfoList} from '../DeviceInfoList';
import {ElevationLevel, Theme} from './styleUtils';
import testIDProps from '../../shared/commonUtil';
export const Modal: React.FC<ModalProps> = (props) => {
export const Modal: React.FC<ModalProps> = props => {
const controller = useSendVcScreen();
return (

View File

@@ -1,8 +1,8 @@
import React, { useEffect, useState } from 'react';
import { Dimensions, Pressable } from 'react-native';
import { Icon, ListItem, Overlay } from 'react-native-elements';
import { Column } from './Layout';
import { Text } from './Text';
import React, {useEffect, useState} from 'react';
import {Dimensions, Pressable} from 'react-native';
import {Icon, ListItem, Overlay} from 'react-native-elements';
import {Column} from './Layout';
import {Text} from './Text';
interface Picker extends React.VFC<PickerProps<unknown>> {
<T>(props: PickerProps<T>): ReturnType<React.FC>;
@@ -14,7 +14,7 @@ export const Picker: Picker = (props: PickerProps<unknown>) => {
useEffect(() => {
setSelectedIndex(
props.items.findIndex(({ value }) => value === props.selectedValue)
props.items.findIndex(({value}) => value === props.selectedValue),
);
}, [props.selectedValue]);
@@ -32,7 +32,7 @@ export const Picker: Picker = (props: PickerProps<unknown>) => {
<Overlay
isVisible={isContentVisible}
onBackdropPress={toggleContent}
overlayStyle={{ padding: 1 }}>
overlayStyle={{padding: 1}}>
<Column
testID={props.testID}
width={Dimensions.get('window').width * 0.8}>

View File

@@ -1,9 +1,9 @@
import React, { useEffect, useState } from 'react';
import { Dimensions } from 'react-native';
import { Icon, ListItem } from 'react-native-elements';
import { Column } from './Layout';
import { Text } from './Text';
import { Theme } from './styleUtils';
import React, {useEffect, useState} from 'react';
import {Dimensions} from 'react-native';
import {Icon, ListItem} from 'react-native-elements';
import {Column} from './Layout';
import {Text} from './Text';
import {Theme} from './styleUtils';
interface Picker extends React.VFC<PickerProps<unknown>> {
<T>(props: PickerProps<T>): ReturnType<React.FC>;
@@ -15,7 +15,7 @@ export const SetupPicker: Picker = (props: PickerProps<unknown>) => {
useEffect(() => {
setSelectedIndex(
props.items.findIndex(({ value }) => value === props.selectedValue)
props.items.findIndex(({value}) => value === props.selectedValue),
);
}, [props.selectedValue]);

View File

@@ -1,9 +1,9 @@
import React from 'react';
import { Column, Text } from '.';
import { Theme } from './styleUtils';
import {Column, Text} from '.';
import {Theme} from './styleUtils';
import testIDProps from '../../shared/commonUtil';
export const TextItem: React.FC<TextItemProps> = (props) => {
export const TextItem: React.FC<TextItemProps> = props => {
return (
<Column
{...testIDProps(props.testID)}
@@ -20,7 +20,7 @@ export const TextItem: React.FC<TextItemProps> = (props) => {
<Text
color={Theme.Colors.textValue}
weight={props.label ? 'semibold' : 'regular'}
style={{ textAlign: 'left' }}>
style={{textAlign: 'left'}}>
{props.text}
</Text>
{props.label && (
@@ -28,7 +28,7 @@ export const TextItem: React.FC<TextItemProps> = (props) => {
size="smaller"
color={Theme.Colors.textLabel}
weight="semibold"
style={{ textAlign: 'left' }}>
style={{textAlign: 'left'}}>
{props.label}
</Text>
)}

View File

@@ -1,6 +1,6 @@
/* eslint-disable sonarjs/no-duplicate-string */
import { Dimensions, StyleSheet, ViewStyle } from 'react-native';
import { Spacing } from '../styleUtils';
import {Dimensions, StyleSheet, ViewStyle} from 'react-native';
import {Spacing} from '../styleUtils';
const Colors = {
Black: '#000000',
@@ -195,7 +195,7 @@ export const DefaultTheme = {
margin: 8,
backgroundColor: '#fff',
shadowColor: '#000',
shadowOffset: { width: -1, height: 1 },
shadowOffset: {width: -1, height: 1},
shadowOpacity: 0.4,
shadowRadius: 3,
elevation: 4,
@@ -257,7 +257,7 @@ export const DefaultTheme = {
margin: 8,
backgroundColor: '#fff',
shadowColor: '#000',
shadowOffset: { width: -1, height: 1 },
shadowOffset: {width: -1, height: 1},
shadowOpacity: 0.4,
shadowRadius: 3,
elevation: 4,
@@ -808,9 +808,9 @@ export const DefaultTheme = {
flex: 1,
width: Dimensions.get('screen').width,
},
revokeView: { padding: 20 },
flexRow: { flexDirection: 'row', margin: 0, padding: 0 },
rowStyle: { flexDirection: 'column', justifyContent: 'space-between' },
revokeView: {padding: 20},
flexRow: {flexDirection: 'row', margin: 0, padding: 0},
rowStyle: {flexDirection: 'column', justifyContent: 'space-between'},
viewContainer: {
backgroundColor: 'rgba(0,0,0,.6)',
width: Dimensions.get('screen').width,

View File

@@ -1,6 +1,6 @@
/* eslint-disable sonarjs/no-duplicate-string */
import { Dimensions, StyleSheet, ViewStyle } from 'react-native';
import { Spacing } from '../styleUtils';
import {Dimensions, StyleSheet, ViewStyle} from 'react-native';
import {Spacing} from '../styleUtils';
const Colors = {
Black: '#231F20',
@@ -197,7 +197,7 @@ export const PurpleTheme = {
margin: 8,
backgroundColor: '#fff',
shadowColor: '#000',
shadowOffset: { width: -1, height: 1 },
shadowOffset: {width: -1, height: 1},
shadowOpacity: 0.4,
shadowRadius: 3,
elevation: 4,
@@ -259,7 +259,7 @@ export const PurpleTheme = {
margin: 8,
backgroundColor: '#fff',
shadowColor: '#000',
shadowOffset: { width: -1, height: 1 },
shadowOffset: {width: -1, height: 1},
shadowOpacity: 0.4,
shadowRadius: 3,
elevation: 4,
@@ -810,9 +810,9 @@ export const PurpleTheme = {
flex: 1,
width: Dimensions.get('screen').width,
},
revokeView: { padding: 20 },
flexRow: { flexDirection: 'row', margin: 0, padding: 0 },
rowStyle: { flexDirection: 'column', justifyContent: 'space-between' },
revokeView: {padding: 20},
flexRow: {flexDirection: 'row', margin: 0, padding: 0},
rowStyle: {flexDirection: 'column', justifyContent: 'space-between'},
viewContainer: {
backgroundColor: 'rgba(0,0,0,.6)',
width: Dimensions.get('screen').width,

View File

@@ -1,5 +1,5 @@
import i18next from 'i18next';
import { locale } from 'expo-localization';
import * as Localization from 'expo-localization';
import { initReactI18next } from 'react-i18next';
import en from './locales/en.json';
@@ -16,7 +16,7 @@ import { LocalizedField } from './types/vc';
import { APPLICATION_LANGUAGE } from 'react-native-dotenv';
const resources = { en, fil, ar, hi, kn, ta };
const locale = Localization.locale;
const languageCodeMap = {};
export const SUPPORTED_LANGUAGES = {

30
ios/.gitignore vendored Normal file
View File

@@ -0,0 +1,30 @@
# OSX
#
.DS_Store
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace
.xcode.env.local
# Bundle artifacts
*.jsbundle
# CocoaPods
/Pods/

11
ios/.xcode.env Normal file
View File

@@ -0,0 +1,11 @@
# This `.xcode.env` file is versioned and is used to source the environment
# used when running script phases inside Xcode.
# To customize your local environment, you can create an `.xcode.env.local`
# file that is not versioned.
# NODE_BINARY variable contains the PATH to the node executable.
#
# Customize the NODE_BINARY variable here.
# For example, to use nvm with brew, add the following line
# . "$(brew --prefix nvm)/nvm.sh" --no-use
export NODE_BINARY=$(command -v node)

View File

@@ -1,3 +1,6 @@
source "https://rubygems.org"
source 'https://rubygems.org'
gem "fastlane"
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"
gem 'cocoapods', '~> 1.12'

View File

@@ -3,16 +3,16 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
3E461D99554A48A4959DE609 /* SplashScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */; };
510157BBABB44471B56F17BD /* noop-file.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AB20D6FD6E0431BB5A6B1BF /* noop-file.swift */; };
6EC198FEB3D4CE20C451C9C8 /* libPods-Inji.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F7F3091673D4A20E778B48BF /* libPods-Inji.a */; };
73295844242A4AD3AA52D0BE /* noop-file.swift in Sources */ = {isa = PBXBuildFile; fileRef = D98B96A488E54CBDB286B26F /* noop-file.swift */; };
96905EF65AED1B983A6B3ABC /* libPods-Inji.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58EEBF8E8E6FB1BC6CAF49B5 /* libPods-Inji.a */; };
B18059E884C0ABDD17F3DC3D /* ExpoModulesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAC715A2D49A985799AEE119 /* ExpoModulesProvider.swift */; };
BB2F792D24A3F905000567C9 /* Expo.plist in Resources */ = {isa = PBXBuildFile; fileRef = BB2F792C24A3F905000567C9 /* Expo.plist */; };
/* End PBXBuildFile section */
@@ -21,18 +21,17 @@
008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = "<group>"; };
13B07F961A680F5B00A75B9A /* Inji.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Inji.app; sourceTree = BUILT_PRODUCTS_DIR; };
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = Inji/AppDelegate.h; sourceTree = "<group>"; };
13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = Inji/AppDelegate.m; sourceTree = "<group>"; };
13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = Inji/AppDelegate.mm; sourceTree = "<group>"; };
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Inji/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Inji/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Inji/main.m; sourceTree = "<group>"; };
3AB20D6FD6E0431BB5A6B1BF /* noop-file.swift */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = "noop-file.swift"; path = "Inji/noop-file.swift"; sourceTree = "<group>"; };
58EEBF8E8E6FB1BC6CAF49B5 /* libPods-Inji.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Inji.a"; sourceTree = BUILT_PRODUCTS_DIR; };
6C2E3173556A471DD304B334 /* Pods-Inji.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Inji.debug.xcconfig"; path = "Target Support Files/Pods-Inji/Pods-Inji.debug.xcconfig"; sourceTree = "<group>"; };
7A4D352CD337FB3A3BF06240 /* Pods-Inji.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Inji.release.xcconfig"; path = "Target Support Files/Pods-Inji/Pods-Inji.release.xcconfig"; sourceTree = "<group>"; };
AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = SplashScreen.storyboard; path = Inji/SplashScreen.storyboard; sourceTree = "<group>"; };
BB2F792C24A3F905000567C9 /* Expo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Expo.plist; sourceTree = "<group>"; };
EBEDDC56BF724D17A326B9EC /* Inji-Bridging-Header.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = "Inji-Bridging-Header.h"; path = "Inji/Inji-Bridging-Header.h"; sourceTree = "<group>"; };
D98B96A488E54CBDB286B26F /* noop-file.swift */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = "noop-file.swift"; path = "Inji/noop-file.swift"; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
F4401A7A527915991104FE89 /* Pods-Inji.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Inji.release.xcconfig"; path = "Target Support Files/Pods-Inji/Pods-Inji.release.xcconfig"; sourceTree = "<group>"; };
F7F3091673D4A20E778B48BF /* libPods-Inji.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Inji.a"; sourceTree = BUILT_PRODUCTS_DIR; };
F842436D5AA4BFDC9B080787 /* Pods-Inji.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Inji.debug.xcconfig"; path = "Target Support Files/Pods-Inji/Pods-Inji.debug.xcconfig"; sourceTree = "<group>"; };
FAC715A2D49A985799AEE119 /* ExpoModulesProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpoModulesProvider.swift; path = "Pods/Target Support Files/Pods-Inji/ExpoModulesProvider.swift"; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -41,7 +40,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
6EC198FEB3D4CE20C451C9C8 /* libPods-Inji.a in Frameworks */,
96905EF65AED1B983A6B3ABC /* libPods-Inji.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -54,13 +53,12 @@
BB2F792B24A3F905000567C9 /* Supporting */,
008F07F21AC5B25A0029DE68 /* main.jsbundle */,
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
13B07FB01A68108700A75B9A /* AppDelegate.m */,
13B07FB01A68108700A75B9A /* AppDelegate.mm */,
13B07FB51A68108700A75B9A /* Images.xcassets */,
13B07FB61A68108700A75B9A /* Info.plist */,
13B07FB71A68108700A75B9A /* main.m */,
AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */,
3AB20D6FD6E0431BB5A6B1BF /* noop-file.swift */,
EBEDDC56BF724D17A326B9EC /* Inji-Bridging-Header.h */,
D98B96A488E54CBDB286B26F /* noop-file.swift */,
);
name = Inji;
sourceTree = "<group>";
@@ -69,7 +67,7 @@
isa = PBXGroup;
children = (
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
F7F3091673D4A20E778B48BF /* libPods-Inji.a */,
58EEBF8E8E6FB1BC6CAF49B5 /* libPods-Inji.a */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -124,8 +122,8 @@
D65327D7A22EEC0BE12398D9 /* Pods */ = {
isa = PBXGroup;
children = (
F842436D5AA4BFDC9B080787 /* Pods-Inji.debug.xcconfig */,
F4401A7A527915991104FE89 /* Pods-Inji.release.xcconfig */,
6C2E3173556A471DD304B334 /* Pods-Inji.debug.xcconfig */,
7A4D352CD337FB3A3BF06240 /* Pods-Inji.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
@@ -145,13 +143,15 @@
isa = PBXNativeTarget;
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Inji" */;
buildPhases = (
5C9927E01935CFEBE538B2C3 /* [CP] Check Pods Manifest.lock */,
08A4A3CD28434E44B6B9DE2E /* [CP] Check Pods Manifest.lock */,
FD10A7F022414F080027D42C /* Start Packager */,
654269ECFA0A4BA5DD24AB2B /* [Expo] Configure project */,
13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
8DF8339253592BA8967F2133 /* [CP] Copy Pods Resources */,
800E24972A6A228C8D4807E9 /* [CP] Copy Pods Resources */,
D11A8C363B4A5B625DB10379 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -168,12 +168,10 @@
83CBB9F71A601CBA00E9B192 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1340;
LastUpgradeCheck = 1130;
TargetAttributes = {
13B07F861A680F5B00A75B9A = {
DevelopmentTeam = F7JDUR6578;
LastSwiftMigration = 1250;
ProvisioningStyle = Automatic;
};
};
};
@@ -221,9 +219,9 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export NODE_BINARY=node\n\n# The project root by default is one level up from the ios directory\nexport PROJECT_ROOT=\"$PROJECT_DIR\"/..\n\n`node --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\"`\n";
shellScript = "if [[ -f \"$PODS_ROOT/../.xcode.env\" ]]; then\n source \"$PODS_ROOT/../.xcode.env\"\nfi\nif [[ -f \"$PODS_ROOT/../.xcode.env.local\" ]]; then\n source \"$PODS_ROOT/../.xcode.env.local\"\nfi\n\n# The project root by default is one level up from the ios directory\nexport PROJECT_ROOT=\"$PROJECT_DIR\"/..\n\nif [[ \"$CONFIGURATION\" = *Debug* ]]; then\n export SKIP_BUNDLING=1\nfi\nif [[ -z \"$ENTRY_FILE\" ]]; then\n # Set the entry JS file using the bundler's entry resolution.\n export ENTRY_FILE=\"$(\"$NODE_BINARY\" -e \"require('expo/scripts/resolveAppEntry')\" $PROJECT_ROOT ios relative | tail -n 1)\"\nfi\n\n`\"$NODE_BINARY\" --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\"`\n\n";
};
5C9927E01935CFEBE538B2C3 /* [CP] Check Pods Manifest.lock */ = {
08A4A3CD28434E44B6B9DE2E /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -245,21 +243,69 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
8DF8339253592BA8967F2133 /* [CP] Copy Pods Resources */ = {
654269ECFA0A4BA5DD24AB2B /* [Expo] Configure project */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "[Expo] Configure project";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# This script configures Expo modules and generates the modules provider file.\nbash -l -c \"./Pods/Target\\ Support\\ Files/Pods-Inji/expo-configure-project.sh\"\n";
};
800E24972A6A228C8D4807E9 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Inji/Pods-Inji-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/EXConstants.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/EXUpdates/EXUpdates.bundle",
"${PODS_ROOT}/NearbyMessages/Resources/resources/GNSSharedResources.bundle",
"${PODS_ROOT}/NearbyMessages/Resources/resources/ic_expand_more.xcassets",
"${PODS_ROOT}/NearbyMessages/Resources/resources/ic_nearby_48pt.xcassets",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXConstants.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXUpdates.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GNSSharedResources.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Inji/Pods-Inji-resources.sh\"\n";
showEnvVarsInLog = 0;
};
D11A8C363B4A5B625DB10379 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Inji/Pods-Inji-frameworks.sh",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/Pre-built/hermes.framework/hermes",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Inji/Pods-Inji-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
FD10A7F022414F080027D42C /* Start Packager */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -276,7 +322,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > `node --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/.packager.env'\"`\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open `node --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/launchPackager.command'\"` || echo \"Can't start packager automatically\"\n fi\nfi\n";
shellScript = "if [[ -f \"$PODS_ROOT/../.xcode.env\" ]]; then\n source \"$PODS_ROOT/../.xcode.env\"\nfi\nif [[ -f \"$PODS_ROOT/../.xcode.env.local\" ]]; then\n source \"$PODS_ROOT/../.xcode.env.local\"\nfi\n\nexport RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > `$NODE_BINARY --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/.packager.env'\"`\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open `$NODE_BINARY --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/launchPackager.command'\"` || echo \"Can't start packager automatically\"\n fi\nfi\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
@@ -286,10 +332,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */,
13B07FC11A68108700A75B9A /* main.m in Sources */,
B18059E884C0ABDD17F3DC3D /* ExpoModulesProvider.swift in Sources */,
510157BBABB44471B56F17BD /* noop-file.swift in Sources */,
73295844242A4AD3AA52D0BE /* noop-file.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -298,34 +344,38 @@
/* Begin XCBuildConfiguration section */
13B07F941A680F5B00A75B9A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = F842436D5AA4BFDC9B080787 /* Pods-Inji.debug.xcconfig */;
baseConfigurationReference = 6C2E3173556A471DD304B334 /* Pods-Inji.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Inji/Inji.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 8;
DEVELOPMENT_TEAM = F7JDUR6578;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = LD7H4CQ5P9;
ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"FB_SONARKIT_ENABLED=1",
);
INFOPLIST_FILE = Inji/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Inji;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.9.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG";
PRODUCT_BUNDLE_IDENTIFIER = io.mosip.inji.mobileid;
PRODUCT_NAME = Inji;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Inji/Inji-Bridging-Header.h";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development io.mosip.inji.mobileid";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
@@ -335,32 +385,34 @@
};
13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = F4401A7A527915991104FE89 /* Pods-Inji.release.xcconfig */;
baseConfigurationReference = 7A4D352CD337FB3A3BF06240 /* Pods-Inji.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Inji/Inji.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 8;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = LD7H4CQ5P9;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
INFOPLIST_FILE = Inji/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Inji;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.9.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE";
PRODUCT_BUNDLE_IDENTIFIER = io.mosip.inji.mobileid;
PRODUCT_NAME = Inji;
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore io.mosip.inji.mobileid";
SWIFT_OBJC_BRIDGING_HEADER = "Inji/Inji-Bridging-Header.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
@@ -372,7 +424,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
@@ -390,18 +442,17 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = Inji/Inji.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
@@ -418,10 +469,14 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)";
LIBRARY_SEARCH_PATHS = "\"$(inherited)\"";
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
);
LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift\"$(inherited)\"";
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
};
name = Debug;
@@ -431,7 +486,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
@@ -449,18 +504,18 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = Inji/Inji.entitlements;
CODE_SIGN_IDENTITY = "Apple Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@@ -470,11 +525,14 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)";
LIBRARY_SEARCH_PATHS = "\"$(inherited)\"";
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
);
LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift\"$(inherited)\"";
MTL_ENABLE_DEBUG_INFO = NO;
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
VALIDATE_PRODUCT = YES;
};
name = Release;

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1340"
LastUpgradeVersion = "1130"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -60,13 +60,6 @@
ReferencedContainer = "container:Inji.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "BACKEND_SERVICE_URL"
value = "https://api.qa4.mosip.net/residentmobileapp"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"

View File

@@ -1,9 +1,7 @@
#import <Foundation/Foundation.h>
#import <React/RCTBridgeDelegate.h>
#import <RCTAppDelegate.h>
#import <UIKit/UIKit.h>
#import <Expo/Expo.h>
@interface AppDelegate : EXAppDelegateWrapper <RCTBridgeDelegate>
@interface AppDelegate : EXAppDelegateWrapper
@end

View File

@@ -1,91 +0,0 @@
#import "AppDelegate.h"
#if RCT_DEV
#import <React/RCTDevLoadingView.h>
#endif
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <React/RCTLinkingManager.h>
#import <React/RCTConvert.h>
#if defined(FB_SONARKIT_ENABLED) && __has_include(<FlipperKit/FlipperClient.h>)
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>
static void InitializeFlipper(UIApplication *application) {
FlipperClient *client = [FlipperClient sharedClient];
SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
[client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
[client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
[client addPlugin:[FlipperKitReactPlugin new]];
[client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
[client start];
}
#endif
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
#if defined(FB_SONARKIT_ENABLED) && __has_include(<FlipperKit/FlipperClient.h>)
InitializeFlipper(application);
#endif
RCTBridge *bridge = [self.reactDelegate createBridgeWithDelegate:self launchOptions:launchOptions];
#if RCT_DEV
[bridge moduleForClass:[RCTDevLoadingView class]];
#endif
RCTRootView *rootView = [self.reactDelegate createRootViewWithBridge:bridge moduleName:@"main" initialProperties:nil];
id rootViewBackgroundColor = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"RCTRootViewBackgroundColor"];
if (rootViewBackgroundColor != nil) {
rootView.backgroundColor = [RCTConvert UIColor:rootViewBackgroundColor];
} else {
rootView.backgroundColor = [UIColor whiteColor];
}
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [self.reactDelegate createRootViewController];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
[super application:application didFinishLaunchingWithOptions:launchOptions];
return YES;
}
- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge
{
// If you'd like to export some custom RCTBridgeModules, add them here!
return @[];
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {
#ifdef DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
// Linking API
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
return [RCTLinkingManager application:application openURL:url options:options];
}
// Universal Links
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
return [RCTLinkingManager application:application
continueUserActivity:userActivity
restorationHandler:restorationHandler];
}
@end

67
ios/Inji/AppDelegate.mm Normal file
View File

@@ -0,0 +1,67 @@
#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h>
#import <React/RCTLinkingManager.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.moduleName = @"main";
// You can add your custom initial props in the dictionary below.
// They will be passed down to the ViewController used by React Native.
self.initialProps = @{};
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
///
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`.
- (BOOL)concurrentRootEnabled
{
return true;
}
// Linking API
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
return [super application:application openURL:url options:options] || [RCTLinkingManager application:application openURL:url options:options];
}
// Universal Links
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
BOOL result = [RCTLinkingManager application:application continueUserActivity:userActivity restorationHandler:restorationHandler];
return [super application:application continueUserActivity:userActivity restorationHandler:restorationHandler] || result;
}
// Explicitly define remote notification delegates to ensure compatibility with some third-party libraries
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
return [super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}
// Explicitly define remote notification delegates to ensure compatibility with some third-party libraries
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
return [super application:application didFailToRegisterForRemoteNotificationsWithError:error];
}
// Explicitly define remote notification delegates to ensure compatibility with some third-party libraries
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
return [super application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}
@end

View File

@@ -1,158 +1,158 @@
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "icon-20@2x.png",
"scale" : "2x"
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "icon-20@3x.png",
"scale" : "3x"
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "icon-29@1x.png",
"scale" : "1x"
"idiom" : "iphone",
"scale" : "1x",
"size" : "29x29"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "icon-29@2x.png",
"scale" : "2x"
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "icon-29@3x.png",
"scale" : "3x"
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "icon-40@2x.png",
"scale" : "2x"
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "icon-40@3x.png",
"scale" : "3x"
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"size" : "57x57",
"idiom" : "iphone",
"filename" : "icon-57@1x.png",
"scale" : "1x"
"idiom" : "iphone",
"scale" : "1x",
"size" : "57x57"
},
{
"size" : "57x57",
"idiom" : "iphone",
"filename" : "icon-57@2x.png",
"scale" : "2x"
"idiom" : "iphone",
"scale" : "2x",
"size" : "57x57"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "icon-60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "icon-60@3x.png",
"scale" : "3x"
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "icon-20@1x.png",
"scale" : "1x"
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "icon-20@2x.png",
"scale" : "2x"
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "icon-29@1x.png",
"scale" : "1x"
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "icon-29@2x.png",
"scale" : "2x"
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "icon-40@1x.png",
"scale" : "1x"
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "icon-40@2x.png",
"scale" : "2x"
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"size" : "50x50",
"idiom" : "ipad",
"filename" : "icon-50@1x.png",
"scale" : "1x"
"idiom" : "ipad",
"scale" : "1x",
"size" : "50x50"
},
{
"size" : "50x50",
"idiom" : "ipad",
"filename" : "icon-50@2x.png",
"scale" : "2x"
"idiom" : "ipad",
"scale" : "2x",
"size" : "50x50"
},
{
"size" : "72x72",
"idiom" : "ipad",
"filename" : "icon-72@1x.png",
"scale" : "1x"
"idiom" : "ipad",
"scale" : "1x",
"size" : "72x72"
},
{
"size" : "72x72",
"idiom" : "ipad",
"filename" : "icon-72@2x.png",
"scale" : "2x"
"idiom" : "ipad",
"scale" : "2x",
"size" : "72x72"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "icon-76@1x.png",
"scale" : "1x"
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "icon-76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "icon-83.5@2x.png",
"scale" : "2x"
"scale" : "2x",
"size" : "76x76"
},
{
"filename" : "icon-83.5@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "icon-1024@1x.png",
"scale" : "1x"
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

@@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>5</string>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>

View File

@@ -1,4 +0,0 @@
#import <Expo/Expo.h>
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>
<dict>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist>

View File

@@ -9,8 +9,8 @@
<key>EXUpdatesLaunchWaitMs</key>
<integer>0</integer>
<key>EXUpdatesSDKVersion</key>
<string>43.0.0</string>
<string>48.0.0</string>
<key>EXUpdatesURL</key>
<string>https://exp.host/@anonymous/mosip-resident-app</string>
<string>https://exp.host/@anonymous/inji</string>
</dict>
</plist>

View File

@@ -1,48 +1,83 @@
install! 'cocoapods', :disable_input_output_paths => true
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
require File.join(File.dirname(`node --print "require.resolve('@react-native-community/cli-platform-ios/package.json')"`), "native_modules")
platform :ios, '13.0'
require 'json'
podfile_properties = JSON.parse(File.read('./Podfile.properties.json')) rescue {}
podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}
ENV['RCT_NEW_ARCH_ENABLED'] = podfile_properties['newArchEnabled'] == 'true' ? '1' : '0'
ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = '1' if podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR'] == 'true'
platform :ios, podfile_properties['ios.deploymentTarget'] || '13.0'
install! 'cocoapods',
:deterministic_uuids => false
prepare_react_native_project!
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
# because `react-native-flipper` depends on (FlipperKit,...), which will be excluded. To fix this,
# you can also exclude `react-native-flipper` in `react-native.config.js`
#
# ```js
# module.exports = {
# dependencies: {
# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
# }
# }
# ```
flipper_config = FlipperConfiguration.disabled
if ENV['NO_FLIPPER'] == '1' then
# Explicitly disabled through environment variables
flipper_config = FlipperConfiguration.disabled
elsif podfile_properties.key?('ios.flipper') then
# Configure Flipper in Podfile.properties.json
if podfile_properties['ios.flipper'] == 'true' then
flipper_config = FlipperConfiguration.enabled(["Debug", "Release"])
elsif podfile_properties['ios.flipper'] != 'false' then
flipper_config = FlipperConfiguration.enabled(["Debug", "Release"], { 'Flipper' => podfile_properties['ios.flipper'] })
end
end
target 'Inji' do
use_expo_modules!
post_integrate do |installer|
begin
expo_patch_react_imports!(installer)
rescue => e
Pod::UI.warn e
end
begin
expo_patch_react_imports!(installer)
rescue => e
Pod::UI.warn e
end
begin
expo_patch_react_imports!(installer)
rescue => e
Pod::UI.warn e
end
end
config = use_native_modules!
use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']
# Flags change depending on the env values.
flags = get_default_flags()
use_react_native!(
:path => config[:reactNativePath],
:hermes_enabled => podfile_properties['expo.jsEngine'] == 'hermes'
:hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',
:fabric_enabled => flags[:fabric_enabled],
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/..",
# Note that if you have use_frameworks! enabled, Flipper will not work if enabled
:flipper_configuration => flipper_config
)
# Uncomment to opt-in to using Flipper
#
# if !ENV['CI']
# use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1')
# end
post_install do |installer|
react_native_post_install(installer)
react_native_post_install(
installer,
config[:reactNativePath],
# Set `mac_catalyst_enabled` to `true` in order to apply patches
# necessary for Mac Catalyst builds
:mac_catalyst_enabled => false
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
# This is necessary for Xcode 14, because it signs resource bundles by default
# when building for devices.
installer.target_installation_results.pod_target_installation_results
.each do |pod_name, target_installation_result|
target_installation_result.resource_bundle_targets.each do |resource_bundle_target|
resource_bundle_target.build_configurations.each do |config|
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
end
end
end
# Workaround `Cycle inside FBReactNativeSpec` error for react-native 0.64
# Reference: https://github.com/software-mansion/react-native-screens/issues/842#issuecomment-812543933
@@ -56,6 +91,7 @@ target 'Inji' do
end
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
# get team-id from project's first target
@@ -77,6 +113,28 @@ target 'Inji' do
end
end
# https://github.com/CocoaPods/CocoaPods/issues/8122#issuecomment-428677119
# Workaround for removing the multiple Assets added to the project due to react native auto-linkage
project_path = './Inji.xcodeproj'
project = Xcodeproj::Project.open(project_path)
project.targets.each do |target|
puts target
if target.name == "Inji"
phase = target.shell_script_build_phases.find { |bp| bp.name == '[CP] Copy Pods Resources' }
if !phase.nil?
phase.output_paths.delete('${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Assets.car')
end
end
end
project.save(project_path)
end
post_integrate do |installer|
begin
expo_patch_react_imports!(installer)
rescue => e
Pod::UI.warn e
end
end
permissions_path = '../node_modules/react-native-permissions/ios'

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,5 @@
{
"expo.jsEngine": "jsc"
"expo.jsEngine": "hermes",
"newArchEnabled": false,
"EX_DEV_CLIENT_NETWORK_INSPECTOR": false
}

3
jest.config.js Normal file
View File

@@ -0,0 +1,3 @@
module.exports = {
preset: 'react-native',
};

View File

@@ -22,7 +22,10 @@ export interface Typegen0 {
loadCredentialRegistryHostFromStorage: 'READY';
loadCredentialRegistryInConstants: 'STORE_RESPONSE';
logServiceEvents: 'READY';
logStoreEvents: 'xstate.init';
logStoreEvents:
| 'KEY_INVALIDATE_ERROR'
| 'RESET_KEY_INVALIDATE_ERROR_DISMISS'
| 'xstate.init';
requestDeviceInfo: 'REQUEST_DEVICE_INFO';
resetKeyInvalidateError: 'READY' | 'RESET_KEY_INVALIDATE_ERROR_DISMISS';
setAppInfo: 'APP_INFO_RECEIVED';
@@ -30,7 +33,10 @@ export interface Typegen0 {
setIsDecryptError: 'DECRYPT_ERROR';
setIsReadError: 'ERROR';
spawnServiceActors: 'READY';
spawnStoreActor: 'xstate.init';
spawnStoreActor:
| 'KEY_INVALIDATE_ERROR'
| 'RESET_KEY_INVALIDATE_ERROR_DISMISS'
| 'xstate.init';
unsetIsDecryptError: 'DECRYPT_ERROR_DISMISS' | 'READY';
unsetIsReadError: 'READY';
updateKeyInvalidateError: 'ERROR' | 'KEY_INVALIDATE_ERROR';
@@ -59,6 +65,7 @@ export interface Typegen0 {
| 'ready.network.checking'
| 'ready.network.offline'
| 'ready.network.online'
| 'waiting'
| {
init?: 'credentialRegistry' | 'devinfo' | 'info' | 'services' | 'store';
ready?:

View File

@@ -1,33 +1,33 @@
import tuvali from 'react-native-tuvali';
import BluetoothStateManager from 'react-native-bluetooth-state-manager';
import { EmitterSubscription, Linking, Platform } from 'react-native';
import {EmitterSubscription, Linking, Platform} from 'react-native';
import {
checkMultiple,
PERMISSIONS,
requestMultiple,
RESULTS,
} from 'react-native-permissions';
import { assign, EventFrom, send, StateFrom } from 'xstate';
import { createModel } from 'xstate/lib/model';
import { DeviceInfo } from '../../../components/DeviceInfoList';
import { getDeviceNameSync } from 'react-native-device-info';
import { StoreEvents } from '../../store';
import { VC } from '../../../types/vc';
import { AppServices } from '../../../shared/GlobalContext';
import {assign, EventFrom, send, StateFrom} from 'xstate';
import {createModel} from 'xstate/lib/model';
import {DeviceInfo} from '../../../components/DeviceInfoList';
import {getDeviceNameSync} from 'react-native-device-info';
import {StoreEvents} from '../../store';
import {VC} from '../../../types/vc';
import {AppServices} from '../../../shared/GlobalContext';
import {
RECEIVED_VCS_STORE_KEY,
VC_ITEM_STORE_KEY,
} from '../../../shared/constants';
import { ActivityLogEvents, ActivityLogType } from '../../activityLog';
import { VcEvents } from '../../vc';
import { subscribe } from '../../../shared/openIdBLE/verifierEventHandler';
import { log } from 'xstate/lib/actions';
import { VerifierDataEvent } from 'react-native-tuvali/src/types/events';
import { BLEError } from '../types';
import {ActivityLogEvents, ActivityLogType} from '../../activityLog';
import {VcEvents} from '../../vc';
import {subscribe} from '../../../shared/openIdBLE/verifierEventHandler';
import {log} from 'xstate/lib/actions';
import {VerifierDataEvent} from 'react-native-tuvali/src/types/events';
import {BLEError} from '../types';
import Storage from '../../../shared/storage';
// import { verifyPresentation } from '../shared/vcjs/verifyPresentation';
const { verifier, EventTypes, VerificationStatus } = tuvali;
const {verifier, EventTypes, VerificationStatus} = tuvali;
const model = createModel(
{
@@ -50,12 +50,12 @@ const model = createModel(
CANCEL: () => ({}),
RESET: () => ({}),
DISMISS: () => ({}),
VC_RECEIVED: (vc: VC) => ({ vc }),
ADV_STARTED: (openId4VpUri: string) => ({ openId4VpUri }),
VC_RECEIVED: (vc: VC) => ({vc}),
ADV_STARTED: (openId4VpUri: string) => ({openId4VpUri}),
CONNECTED: () => ({}),
DISCONNECT: () => ({}),
BLE_ERROR: (bleError: BLEError) => ({ bleError }),
EXCHANGE_DONE: (senderInfo: DeviceInfo) => ({ senderInfo }),
BLE_ERROR: (bleError: BLEError) => ({bleError}),
EXCHANGE_DONE: (senderInfo: DeviceInfo) => ({senderInfo}),
SCREEN_FOCUS: () => ({}),
SCREEN_BLUR: () => ({}),
BLUETOOTH_STATE_ENABLED: () => ({}),
@@ -63,18 +63,18 @@ const model = createModel(
NEARBY_ENABLED: () => ({}),
NEARBY_DISABLED: () => ({}),
STORE_READY: () => ({}),
STORE_RESPONSE: (response: unknown) => ({ response }),
STORE_ERROR: (error: Error) => ({ error }),
RECEIVE_DEVICE_INFO: (info: DeviceInfo) => ({ info }),
STORE_RESPONSE: (response: unknown) => ({response}),
STORE_ERROR: (error: Error) => ({error}),
RECEIVE_DEVICE_INFO: (info: DeviceInfo) => ({info}),
RECEIVED_VCS_UPDATED: () => ({}),
VC_RESPONSE: (response: unknown) => ({ response }),
VC_RESPONSE: (response: unknown) => ({response}),
GOTO_SETTINGS: () => ({}),
APP_ACTIVE: () => ({}),
FACE_VALID: () => ({}),
FACE_INVALID: () => ({}),
RETRY_VERIFICATION: () => ({}),
},
}
},
);
export const RequestEvents = model.events;
@@ -514,7 +514,7 @@ export const requestMachine =
},
requestReceivedVcs: send(VcEvents.GET_RECEIVED_VCS(), {
to: (context) => context.serviceRefs.vc,
to: context => context.serviceRefs.vc,
}),
setReadyForBluetoothStateCheck: model.assign({
@@ -541,13 +541,13 @@ export const requestMachine =
setSenderInfo: assign({
senderInfo: () => {
return { name: 'Wallet', deviceName: 'Wallet', deviceId: '' };
return {name: 'Wallet', deviceName: 'Wallet', deviceId: ''};
},
}),
setReceiverInfo: assign({
receiverInfo: () => {
return { name: 'Verifier', deviceName: 'Verifier', deviceId: '' };
return {name: 'Verifier', deviceName: 'Verifier', deviceId: ''};
},
}),
@@ -559,11 +559,11 @@ export const requestMachine =
loggers: () => {
if (__DEV__) {
return [
verifier.handleDataEvents((event) => {
verifier.handleDataEvents(event => {
console.log(
getDeviceNameSync(),
'<Receiver.Event>',
JSON.stringify(event).slice(0, 100)
JSON.stringify(event).slice(0, 100),
);
}),
];
@@ -574,24 +574,24 @@ export const requestMachine =
}),
removeLoggers: assign({
loggers: ({ loggers }) => {
loggers?.forEach((logger) => logger.remove());
loggers: ({loggers}) => {
loggers?.forEach(logger => logger.remove());
return null;
},
}),
prependReceivedVc: send(
(context) =>
context =>
StoreEvents.PREPEND(
RECEIVED_VCS_STORE_KEY,
VC_ITEM_STORE_KEY(context.incomingVc)
VC_ITEM_STORE_KEY(context.incomingVc),
),
{ to: (context) => context.serviceRefs.store }
{to: context => context.serviceRefs.store},
),
requestExistingVc: send(
(context) => StoreEvents.GET(VC_ITEM_STORE_KEY(context.incomingVc)),
{ to: (context) => context.serviceRefs.store }
context => StoreEvents.GET(VC_ITEM_STORE_KEY(context.incomingVc)),
{to: context => context.serviceRefs.store},
),
mergeIncomingVc: send(
@@ -603,16 +603,16 @@ export const requestMachine =
};
return StoreEvents.SET(VC_ITEM_STORE_KEY(updated), updated);
},
{ to: (context) => context.serviceRefs.store }
{to: context => context.serviceRefs.store},
),
storeVc: send(
(context) =>
context =>
StoreEvents.SET(
VC_ITEM_STORE_KEY(context.incomingVc),
context.incomingVc
context.incomingVc,
),
{ to: (context) => context.serviceRefs.store }
{to: context => context.serviceRefs.store},
),
setReceiveLogTypeRegular: model.assign({
@@ -632,7 +632,7 @@ export const requestMachine =
}),
logReceived: send(
(context) =>
context =>
ActivityLogEvents.LOG_ACTIVITY({
_vcKey: VC_ITEM_STORE_KEY(context.incomingVc),
type: context.receiveLogType,
@@ -641,18 +641,18 @@ export const requestMachine =
context.senderInfo.name || context.senderInfo.deviceName,
vcLabel: context.incomingVc.tag || context.incomingVc.id,
}),
{ to: (context) => context.serviceRefs.activityLog }
{to: context => context.serviceRefs.activityLog},
),
sendVcReceived: send(
(context) => {
context => {
return VcEvents.VC_RECEIVED(VC_ITEM_STORE_KEY(context.incomingVc));
},
{ to: (context) => context.serviceRefs.vc }
{to: context => context.serviceRefs.vc},
),
clearShouldVerifyPresence: assign({
incomingVc: (context) => ({
incomingVc: context => ({
...context.incomingVc,
shouldVerifyPresence: false,
}),
@@ -668,8 +668,8 @@ export const requestMachine =
}
},
checkBluetoothService: () => (callback) => {
const subscription = BluetoothStateManager.onStateChange((state) => {
checkBluetoothService: () => callback => {
const subscription = BluetoothStateManager.onStateChange(state => {
if (state === 'PoweredOn') {
callback(model.events.BLUETOOTH_STATE_ENABLED());
} else {
@@ -679,31 +679,31 @@ export const requestMachine =
return () => subscription.remove();
},
requestBluetooth: () => (callback) => {
requestBluetooth: () => callback => {
BluetoothStateManager.requestToEnable()
.then(() => callback(model.events.BLUETOOTH_STATE_ENABLED()))
.catch(() => callback(model.events.BLUETOOTH_STATE_DISABLED()));
},
advertiseDevice: () => (callback) => {
advertiseDevice: () => callback => {
const openId4VpUri = verifier.startAdvertisement('OVPMOSIP');
callback({ type: 'ADV_STARTED', openId4VpUri });
callback({type: 'ADV_STARTED', openId4VpUri});
const statusCallback = (event: VerifierDataEvent) => {
if (event.type === EventTypes.onSecureChannelEstablished) {
callback({ type: 'CONNECTED' });
callback({type: 'CONNECTED'});
}
};
const subscription = subscribe(statusCallback);
return () => subscription?.remove();
},
requestNearByDevicesPermission: () => (callback) => {
requestNearByDevicesPermission: () => callback => {
requestMultiple([
PERMISSIONS.ANDROID.BLUETOOTH_ADVERTISE,
PERMISSIONS.ANDROID.BLUETOOTH_CONNECT,
])
.then((response) => {
.then(response => {
if (
response[PERMISSIONS.ANDROID.BLUETOOTH_ADVERTISE] ===
RESULTS.GRANTED &&
@@ -715,19 +715,19 @@ export const requestMachine =
callback(model.events.NEARBY_DISABLED());
}
})
.catch((err) => {
.catch(err => {
callback(model.events.NEARBY_DISABLED());
});
},
checkNearByDevicesPermission: () => (callback) => {
checkNearByDevicesPermission: () => callback => {
if (Platform.OS === 'android' && Platform.Version >= 31) {
const result = checkMultiple([
PERMISSIONS.ANDROID.BLUETOOTH_ADVERTISE,
PERMISSIONS.ANDROID.BLUETOOTH_CONNECT,
PERMISSIONS.ANDROID.BLUETOOTH_SCAN,
])
.then((response) => {
.then(response => {
if (
response[PERMISSIONS.ANDROID.BLUETOOTH_ADVERTISE] ===
RESULTS.GRANTED &&
@@ -739,7 +739,7 @@ export const requestMachine =
callback(model.events.NEARBY_DISABLED());
}
})
.catch((err) => {
.catch(err => {
callback(model.events.NEARBY_DISABLED());
});
} else {
@@ -747,16 +747,16 @@ export const requestMachine =
}
},
monitorConnection: () => (callback) => {
const subscription = verifier.handleDataEvents((event) => {
monitorConnection: () => callback => {
const subscription = verifier.handleDataEvents(event => {
if (event.type === EventTypes.onDisconnected) {
callback({ type: 'DISCONNECT' });
callback({type: 'DISCONNECT'});
}
if (event.type === EventTypes.onError) {
callback({
type: 'BLE_ERROR',
bleError: { message: event.message, code: event.code },
bleError: {message: event.message, code: event.code},
});
console.log('BLE Exception: ' + event.message);
}
@@ -765,10 +765,10 @@ export const requestMachine =
return () => subscription.remove();
},
receiveVc: () => (callback) => {
receiveVc: () => callback => {
const statusCallback = (event: VerifierDataEvent) => {
if (event.type === EventTypes.onDataReceived) {
callback({ type: 'VC_RECEIVED', vc: JSON.parse(event.data) });
callback({type: 'VC_RECEIVED', vc: JSON.parse(event.data)});
}
};
const subscription = subscribe(statusCallback);
@@ -780,7 +780,7 @@ export const requestMachine =
verifier.sendVerificationStatus(meta.data.status);
},
verifyVp: (context) => async () => {
verifyVp: context => async () => {
const vp = context.incomingVc.verifiablePresentation;
// TODO
@@ -798,7 +798,7 @@ export const requestMachine =
checkStorageAvailability: () => async () => {
return Promise.resolve(
Storage.isMinimumLimitReached('minStorageRequired')
Storage.isMinimumLimitReached('minStorageRequired'),
);
},
},
@@ -817,7 +817,7 @@ export const requestMachine =
DESTROY_TIMEOUT: 500,
SHARING_TIMEOUT: 15 * 1000,
},
}
},
);
type State = StateFrom<typeof requestMachine>;

View File

@@ -2,8 +2,8 @@
export interface Typegen0 {
'@@xstate/typegen': true;
'internalEvents': {
'': { type: '' };
internalEvents: {
'': {type: ''};
'done.invoke.request.checkStorage:invocation[0]': {
type: 'done.invoke.request.checkStorage:invocation[0]';
data: unknown;
@@ -20,10 +20,10 @@ export interface Typegen0 {
'xstate.after(SHARING_TIMEOUT)#request.waitingForVc.inProgress': {
type: 'xstate.after(SHARING_TIMEOUT)#request.waitingForVc.inProgress';
};
'xstate.init': { type: 'xstate.init' };
'xstate.stop': { type: 'xstate.stop' };
'xstate.init': {type: 'xstate.init'};
'xstate.stop': {type: 'xstate.stop'};
};
'invokeSrcNameMap': {
invokeSrcNameMap: {
advertiseDevice: 'done.invoke.request.waitingForConnection:invocation[0]';
checkBluetoothService: 'done.invoke.request.checkingBluetoothService.checking:invocation[0]';
checkNearByDevicesPermission: 'done.invoke.request.checkNearbyDevicesPermission.checking:invocation[0]';
@@ -42,13 +42,13 @@ export interface Typegen0 {
| 'done.invoke.request.reviewing.savingFailed:invocation[0]';
verifyVp: 'done.invoke.request.reviewing.verifyingVp:invocation[0]';
};
'missingImplementations': {
missingImplementations: {
actions: never;
delays: never;
guards: never;
services: never;
};
'eventsCausingActions': {
eventsCausingActions: {
clearShouldVerifyPresence:
| 'ACCEPT'
| 'BLE_ERROR'
@@ -94,15 +94,15 @@ export interface Typegen0 {
setSenderInfo: 'CONNECTED';
storeVc: 'STORE_RESPONSE';
};
'eventsCausingDelays': {
eventsCausingDelays: {
DESTROY_TIMEOUT: '' | 'DISMISS';
SHARING_TIMEOUT: 'CONNECTED';
};
'eventsCausingGuards': {
eventsCausingGuards: {
hasExistingVc: 'VC_RESPONSE';
isMinimumStorageLimitReached: 'done.invoke.request.checkStorage:invocation[0]';
};
'eventsCausingServices': {
eventsCausingServices: {
advertiseDevice:
| 'DISCONNECT'
| 'DISMISS'
@@ -121,7 +121,7 @@ export interface Typegen0 {
sendVcResponse: 'CANCEL' | 'REJECT' | 'STORE_ERROR' | 'STORE_RESPONSE';
verifyVp: never;
};
'matchesStates':
matchesStates:
| 'bluetoothDenied'
| 'cancelling'
| 'checkNearbyDevicesPermission'
@@ -189,5 +189,5 @@ export interface Typegen0 {
};
waitingForVc?: 'inProgress' | 'timeout';
};
'tags': never;
tags: never;
}

View File

@@ -1,5 +1,5 @@
import { StateFrom } from 'xstate';
import { requestMachine } from './requestMachine';
import {StateFrom} from 'xstate';
import {requestMachine} from './requestMachine';
type State = StateFrom<typeof requestMachine>;

View File

@@ -10,18 +10,15 @@ import {
spawn,
StateFrom,
} from 'xstate';
import { createModel } from 'xstate/lib/model';
import { EmitterSubscription, Linking, Platform } from 'react-native';
import { DeviceInfo } from '../../../components/DeviceInfoList';
import { getDeviceNameSync } from 'react-native-device-info';
import { VC, VerifiablePresentation } from '../../../types/vc';
import { AppServices } from '../../../shared/GlobalContext';
import { ActivityLogEvents, ActivityLogType } from '../../activityLog';
import {
MY_LOGIN_STORE_KEY,
VC_ITEM_STORE_KEY,
} from '../../../shared/constants';
import { subscribe } from '../../../shared/openIdBLE/walletEventHandler';
import {createModel} from 'xstate/lib/model';
import {EmitterSubscription, Linking, Platform} from 'react-native';
import {DeviceInfo} from '../../../components/DeviceInfoList';
import {getDeviceNameSync} from 'react-native-device-info';
import {VC, VerifiablePresentation} from '../../../types/vc';
import {AppServices} from '../../../shared/GlobalContext';
import {ActivityLogEvents, ActivityLogType} from '../../activityLog';
import {MY_LOGIN_STORE_KEY, VC_ITEM_STORE_KEY} from '../../../shared/constants';
import {subscribe} from '../../../shared/openIdBLE/walletEventHandler';
import {
check,
checkMultiple,
@@ -34,16 +31,16 @@ import {
checkLocationPermissionStatus,
requestLocationPermission,
} from '../../../shared/location';
import { CameraCapturedPicture } from 'expo-camera';
import { log } from 'xstate/lib/actions';
import { createQrLoginMachine, qrLoginMachine } from '../../QrLoginMachine';
import { StoreEvents } from '../../store';
import { WalletDataEvent } from 'react-native-tuvali/lib/typescript/types/events';
import { BLEError } from '../types';
import {CameraCapturedPicture} from 'expo-camera';
import {log} from 'xstate/lib/actions';
import {createQrLoginMachine, qrLoginMachine} from '../../QrLoginMachine';
import {StoreEvents} from '../../store';
import {WalletDataEvent} from 'react-native-tuvali/lib/typescript/types/events';
import {BLEError} from '../types';
import Storage from '../../../shared/storage';
import { logState } from '../../app';
import {logState} from '../../app';
const { wallet, EventTypes, VerificationStatus } = tuvali;
const {wallet, EventTypes, VerificationStatus} = tuvali;
const model = createModel(
{
@@ -66,8 +63,8 @@ const model = createModel(
},
{
events: {
SELECT_VC: (vc: VC) => ({ vc }),
SCAN: (params: string) => ({ params }),
SELECT_VC: (vc: VC) => ({vc}),
SCAN: (params: string) => ({params}),
ACCEPT_REQUEST: () => ({}),
VERIFY_AND_ACCEPT_REQUEST: () => ({}),
VC_ACCEPTED: () => ({}),
@@ -79,7 +76,7 @@ const model = createModel(
DISMISS: () => ({}),
CONNECTED: () => ({}),
DISCONNECT: () => ({}),
BLE_ERROR: (bleError: BLEError) => ({ bleError }),
BLE_ERROR: (bleError: BLEError) => ({bleError}),
CONNECTION_DESTROYED: () => ({}),
SCREEN_BLUR: () => ({}),
SCREEN_FOCUS: () => ({}),
@@ -91,21 +88,21 @@ const model = createModel(
NEARBY_DISABLED: () => ({}),
GOTO_SETTINGS: () => ({}),
START_PERMISSION_CHECK: () => ({}),
UPDATE_REASON: (reason: string) => ({ reason }),
UPDATE_REASON: (reason: string) => ({reason}),
LOCATION_ENABLED: () => ({}),
LOCATION_DISABLED: () => ({}),
LOCATION_REQUEST: () => ({}),
UPDATE_VC_NAME: (vcName: string) => ({ vcName }),
STORE_RESPONSE: (response: any) => ({ response }),
UPDATE_VC_NAME: (vcName: string) => ({vcName}),
STORE_RESPONSE: (response: any) => ({response}),
APP_ACTIVE: () => ({}),
FACE_VALID: () => ({}),
FACE_INVALID: () => ({}),
RETRY_VERIFICATION: () => ({}),
VP_CREATED: (vp: VerifiablePresentation) => ({ vp }),
VP_CREATED: (vp: VerifiablePresentation) => ({vp}),
TOGGLE_USER_CONSENT: () => ({}),
RESET: () => ({}),
},
}
},
);
const QR_LOGIN_REF_ID = 'QrLogin';
export const ScanEvents = model.events;
@@ -681,17 +678,17 @@ export const scanMachine =
{
actions: {
setChildRef: assign({
QrLoginRef: (context) => {
QrLoginRef: context => {
const service = spawn(
createQrLoginMachine(context.serviceRefs),
QR_LOGIN_REF_ID
QR_LOGIN_REF_ID,
);
service.subscribe(logState);
return service;
},
}),
sendScanData: (context) =>
sendScanData: context =>
context.QrLoginRef.send({
type: 'GET',
value: context.linkCode,
@@ -714,13 +711,13 @@ export const scanMachine =
setSenderInfo: assign({
senderInfo: () => {
return { name: 'Wallet', deviceName: 'Wallet', deviceId: '' };
return {name: 'Wallet', deviceName: 'Wallet', deviceId: ''};
},
}),
setReceiverInfo: assign({
receiverInfo: () => {
return { name: 'Verifier', deviceName: 'Verifier', deviceId: '' };
return {name: 'Verifier', deviceName: 'Verifier', deviceId: ''};
},
}),
@@ -736,7 +733,7 @@ export const scanMachine =
reason: (_context, event) => event.reason,
}),
clearReason: assign({ reason: '' }),
clearReason: assign({reason: ''}),
setSelectedVc: assign({
selectedVc: (context, event) => {
@@ -759,11 +756,11 @@ export const scanMachine =
loggers: () => {
if (__DEV__) {
return [
wallet.handleDataEvents((event) => {
wallet.handleDataEvents(event => {
console.log(
getDeviceNameSync(),
'<Sender.Event>',
JSON.stringify(event).slice(0, 100)
JSON.stringify(event).slice(0, 100),
);
}),
];
@@ -774,8 +771,8 @@ export const scanMachine =
}),
removeLoggers: assign({
loggers: ({ loggers }) => {
loggers?.forEach((logger) => logger.remove());
loggers: ({loggers}) => {
loggers?.forEach(logger => logger.remove());
return [];
},
}),
@@ -789,7 +786,7 @@ export const scanMachine =
}),
logShared: send(
(context) =>
context =>
ActivityLogEvents.LOG_ACTIVITY({
_vcKey: VC_ITEM_STORE_KEY(context.selectedVc),
type: context.selectedVc.shouldVerifyPresence
@@ -800,11 +797,11 @@ export const scanMachine =
context.receiverInfo.name || context.receiverInfo.deviceName,
vcLabel: context.selectedVc.tag || context.selectedVc.id,
}),
{ to: (context) => context.serviceRefs.activityLog }
{to: context => context.serviceRefs.activityLog},
),
logFailedVerification: send(
(context) =>
context =>
ActivityLogEvents.LOG_ACTIVITY({
_vcKey: VC_ITEM_STORE_KEY(context.selectedVc),
type: 'PRESENCE_VERIFICATION_FAILED',
@@ -813,11 +810,11 @@ export const scanMachine =
context.receiverInfo.name || context.receiverInfo.deviceName,
vcLabel: context.selectedVc.tag || context.selectedVc.id,
}),
{ to: (context) => context.serviceRefs.activityLog }
{to: context => context.serviceRefs.activityLog},
),
toggleShouldVerifyPresence: assign({
selectedVc: (context) => ({
selectedVc: context => ({
...context.selectedVc,
shouldVerifyPresence: !context.selectedVc.shouldVerifyPresence,
}),
@@ -827,20 +824,20 @@ export const scanMachine =
linkCode: (_context, event) =>
event.params.substring(
event.params.indexOf('linkCode=') + 9,
event.params.indexOf('&')
event.params.indexOf('&'),
),
}),
setStayInProgress: assign({
stayInProgress: (context) => !context.stayInProgress,
stayInProgress: context => !context.stayInProgress,
}),
setCloseTimeoutHint: assign({
stayInProgress: (context) => (context.stayInProgress = false),
stayInProgress: context => (context.stayInProgress = false),
}),
resetShouldVerifyPresence: assign({
selectedVc: (context) => ({
selectedVc: context => ({
...context.selectedVc,
shouldVerifyPresence: false,
}),
@@ -850,10 +847,10 @@ export const scanMachine =
(_context, event) => {
return StoreEvents.PREPEND(
MY_LOGIN_STORE_KEY,
(event as DoneInvokeEvent<string>).data
(event as DoneInvokeEvent<string>).data,
);
},
{ to: (context) => context.serviceRefs.store }
{to: context => context.serviceRefs.store},
),
storingActivityLog: send(
@@ -866,15 +863,15 @@ export const scanMachine =
vcLabel: String(event.response.selectedVc.id),
}),
{
to: (context) => context.serviceRefs.activityLog,
}
to: context => context.serviceRefs.activityLog,
},
),
},
services: {
checkBluetoothPermission: () => async (callback) => {
checkBluetoothPermission: () => async callback => {
// wait a bit for animation to finish when app becomes active
await new Promise((resolve) => setTimeout(resolve, 250));
await new Promise(resolve => setTimeout(resolve, 250));
try {
// Passing Granted for android since permission status is always granted even if its denied.
let response: PermissionStatus = RESULTS.GRANTED;
@@ -893,8 +890,8 @@ export const scanMachine =
}
},
checkBluetoothState: () => (callback) => {
const subscription = BluetoothStateManager.onStateChange((state) => {
checkBluetoothState: () => callback => {
const subscription = BluetoothStateManager.onStateChange(state => {
if (state === 'PoweredOn') {
callback(model.events.BLUETOOTH_STATE_ENABLED());
} else {
@@ -904,28 +901,28 @@ export const scanMachine =
return () => subscription.remove();
},
requestBluetooth: () => (callback) => {
requestBluetooth: () => callback => {
BluetoothStateManager.requestToEnable()
.then(() => callback(model.events.BLUETOOTH_STATE_ENABLED()))
.catch(() => callback(model.events.BLUETOOTH_STATE_DISABLED()));
},
requestToEnableLocationPermission: () => (callback) => {
requestToEnableLocationPermission: () => callback => {
requestLocationPermission(
() => callback(model.events.LOCATION_ENABLED()),
() => callback(model.events.LOCATION_DISABLED())
() => callback(model.events.LOCATION_DISABLED()),
);
},
monitorConnection: () => (callback) => {
const subscription = wallet.handleDataEvents((event) => {
monitorConnection: () => callback => {
const subscription = wallet.handleDataEvents(event => {
if (event.type === EventTypes.onDisconnected) {
callback({ type: 'DISCONNECT' });
callback({type: 'DISCONNECT'});
}
if (event.type === EventTypes.onError) {
callback({
type: 'BLE_ERROR',
bleError: { message: event.message, code: event.code },
bleError: {message: event.message, code: event.code},
});
console.log('BLE Exception: ' + event.message);
}
@@ -934,12 +931,12 @@ export const scanMachine =
return () => subscription.remove();
},
checkNearByDevicesPermission: () => (callback) => {
checkNearByDevicesPermission: () => callback => {
checkMultiple([
PERMISSIONS.ANDROID.BLUETOOTH_CONNECT,
PERMISSIONS.ANDROID.BLUETOOTH_SCAN,
])
.then((response) => {
.then(response => {
if (
response[PERMISSIONS.ANDROID.BLUETOOTH_ADVERTISE] ===
RESULTS.GRANTED &&
@@ -951,17 +948,17 @@ export const scanMachine =
callback(model.events.NEARBY_DISABLED());
}
})
.catch((err) => {
.catch(err => {
callback(model.events.NEARBY_DISABLED());
});
},
requestNearByDevicesPermission: () => (callback) => {
requestNearByDevicesPermission: () => callback => {
requestMultiple([
PERMISSIONS.ANDROID.BLUETOOTH_SCAN,
PERMISSIONS.ANDROID.BLUETOOTH_CONNECT,
])
.then((response) => {
.then(response => {
if (
response[PERMISSIONS.ANDROID.BLUETOOTH_SCAN] ===
RESULTS.GRANTED &&
@@ -973,23 +970,23 @@ export const scanMachine =
callback(model.events.NEARBY_DISABLED());
}
})
.catch((err) => {
.catch(err => {
callback(model.events.NEARBY_DISABLED());
});
},
checkLocationPermission: () => (callback) => {
checkLocationPermission: () => callback => {
checkLocationPermissionStatus(
() => callback(model.events.LOCATION_ENABLED()),
() => callback(model.events.LOCATION_DISABLED())
() => callback(model.events.LOCATION_DISABLED()),
);
},
startConnection: (context) => (callback) => {
startConnection: context => callback => {
wallet.startConnection(context.openId4VpUri);
const statusCallback = (event: WalletDataEvent) => {
if (event.type === EventTypes.onSecureChannelEstablished) {
callback({ type: 'CONNECTED' });
callback({type: 'CONNECTED'});
}
};
@@ -997,7 +994,7 @@ export const scanMachine =
return () => subscription?.remove();
},
sendVc: (context) => (callback) => {
sendVc: context => callback => {
const vp = context.createdVp;
const vc = {
...(vp != null ? vp : context.selectedVc),
@@ -1006,12 +1003,12 @@ export const scanMachine =
const reason = [];
if (context.reason.trim() !== '') {
reason.push({ message: context.reason, timestamp: Date.now() });
reason.push({message: context.reason, timestamp: Date.now()});
}
const statusCallback = (event: WalletDataEvent) => {
if (event.type === EventTypes.onDataSent) {
callback({ type: 'VC_SENT' });
callback({type: 'VC_SENT'});
} else if (event.type === EventTypes.onVerificationStatusReceived) {
callback({
type:
@@ -1025,7 +1022,7 @@ export const scanMachine =
JSON.stringify({
...vc,
reason,
})
}),
);
const subscription = subscribe(statusCallback);
return () => subscription?.remove();
@@ -1039,14 +1036,14 @@ export const scanMachine =
}
},
createVp: (context) => async () => {
createVp: context => async () => {
// const verifiablePresentation = await createVerifiablePresentation(...);
const verifiablePresentation: VerifiablePresentation = {
'@context': [''],
'proof': null,
'type': 'VerifiablePresentation',
'verifiableCredential': [context.selectedVc.verifiableCredential],
proof: null,
type: 'VerifiablePresentation',
verifiableCredential: [context.selectedVc.verifiableCredential],
};
const vc: VC = {
@@ -1060,7 +1057,7 @@ export const scanMachine =
checkStorageAvailability: () => async () => {
return Promise.resolve(
Storage.isMinimumLimitReached('minStorageRequiredForAuditEntry')
Storage.isMinimumLimitReached('minStorageRequiredForAuditEntry'),
);
},
},
@@ -1073,7 +1070,7 @@ export const scanMachine =
try {
linkCode = event.params.substring(
event.params.indexOf('linkCode=') + 9,
event.params.indexOf('&')
event.params.indexOf('&'),
);
return linkCode !== null;
} catch (e) {
@@ -1094,7 +1091,7 @@ export const scanMachine =
CONNECTION_TIMEOUT: 5 * 1000,
SHARING_TIMEOUT: 15 * 1000,
},
}
},
);
type State = StateFrom<typeof scanMachine>;
@@ -1107,7 +1104,7 @@ export function createScanMachine(serviceRefs: AppServices) {
}
export function selectIsMinimumStorageRequiredForAuditEntryLimitReached(
state: State
state: State,
) {
return state.matches('restrictSharingVc');
}

View File

@@ -2,8 +2,8 @@
export interface Typegen0 {
'@@xstate/typegen': true;
'internalEvents': {
'': { type: '' };
internalEvents: {
'': {type: ''};
'done.invoke.QrLogin': {
type: 'done.invoke.QrLogin';
data: unknown;
@@ -28,10 +28,10 @@ export interface Typegen0 {
'xstate.after(SHARING_TIMEOUT)#scan.reviewing.sendingVc.inProgress': {
type: 'xstate.after(SHARING_TIMEOUT)#scan.reviewing.sendingVc.inProgress';
};
'xstate.init': { type: 'xstate.init' };
'xstate.stop': { type: 'xstate.stop' };
'xstate.init': {type: 'xstate.init'};
'xstate.stop': {type: 'xstate.stop'};
};
'invokeSrcNameMap': {
invokeSrcNameMap: {
checkBluetoothPermission: 'done.invoke.scan.checkBluetoothPermission.checking:invocation[0]';
checkBluetoothState:
| 'done.invoke.scan.checkBluetoothState.checking:invocation[0]'
@@ -50,13 +50,13 @@ export interface Typegen0 {
sendVc: 'done.invoke.scan.reviewing.sendingVc:invocation[0]';
startConnection: 'done.invoke.scan.connecting:invocation[0]';
};
'missingImplementations': {
missingImplementations: {
actions: never;
delays: never;
guards: never;
services: never;
};
'eventsCausingActions': {
eventsCausingActions: {
clearCreatedVp:
| ''
| 'BLE_ERROR'
@@ -118,7 +118,7 @@ export interface Typegen0 {
storingActivityLog: 'STORE_RESPONSE';
toggleShouldVerifyPresence: 'TOGGLE_USER_CONSENT';
};
'eventsCausingDelays': {
eventsCausingDelays: {
CONNECTION_TIMEOUT: 'SCAN';
DESTROY_TIMEOUT: '' | 'DISMISS' | 'LOCATION_ENABLED';
SHARING_TIMEOUT:
@@ -126,14 +126,14 @@ export interface Typegen0 {
| 'FACE_VALID'
| 'done.invoke.scan.reviewing.creatingVp:invocation[0]';
};
'eventsCausingGuards': {
eventsCausingGuards: {
isIOS: 'BLUETOOTH_STATE_DISABLED' | 'START_PERMISSION_CHECK';
isMinimumStorageRequiredForAuditEntryReached: 'done.invoke.scan.checkStorage:invocation[0]';
isOpenIdQr: 'SCAN';
isQrLogin: 'SCAN';
uptoAndroid11: '' | 'START_PERMISSION_CHECK';
};
'eventsCausingServices': {
eventsCausingServices: {
QrLogin: 'SCAN';
checkBluetoothPermission:
| ''
@@ -156,7 +156,7 @@ export interface Typegen0 {
| 'done.invoke.scan.reviewing.creatingVp:invocation[0]';
startConnection: 'SCAN';
};
'matchesStates':
matchesStates:
| 'bluetoothDenied'
| 'bluetoothPermissionDenied'
| 'checkBluetoothPermission'
@@ -228,8 +228,8 @@ export interface Typegen0 {
| 'selectingVc'
| 'sendingVc'
| 'verifyingIdentity'
| { sendingVc?: 'inProgress' | 'sent' | 'timeout' };
| {sendingVc?: 'inProgress' | 'sent' | 'timeout'};
showQrLogin?: 'idle' | 'navigatingToHistory' | 'storing';
};
'tags': never;
tags: never;
}

View File

@@ -1,5 +1,5 @@
import { StateFrom } from 'xstate';
import { scanMachine } from './scanMachine';
import {StateFrom} from 'xstate';
import {scanMachine} from './scanMachine';
type State = StateFrom<typeof scanMachine>;

View File

@@ -2,7 +2,7 @@
export interface Typegen0 {
'@@xstate/typegen': true;
'internalEvents': {
internalEvents: {
'done.invoke.settings.resetInjiProps:invocation[0]': {
type: 'done.invoke.settings.resetInjiProps:invocation[0]';
data: unknown;
@@ -12,18 +12,18 @@ export interface Typegen0 {
type: 'error.platform.settings.resetInjiProps:invocation[0]';
data: unknown;
};
'xstate.init': { type: 'xstate.init' };
'xstate.init': {type: 'xstate.init'};
};
'invokeSrcNameMap': {
invokeSrcNameMap: {
resetInjiProps: 'done.invoke.settings.resetInjiProps:invocation[0]';
};
'missingImplementations': {
missingImplementations: {
actions: 'injiTourGuide';
delays: never;
guards: never;
services: never;
};
'eventsCausingActions': {
eventsCausingActions: {
injiTourGuide:
| 'ACCEPT_HARDWARE_SUPPORT_NOT_EXISTS'
| 'BACK'
@@ -51,20 +51,20 @@ export interface Typegen0 {
updateUserShownWithHardwareKeystoreNotExists: 'ACCEPT_HARDWARE_SUPPORT_NOT_EXISTS';
updateVcLabel: 'UPDATE_VC_LABEL';
};
'eventsCausingDelays': {};
'eventsCausingGuards': {
eventsCausingDelays: {};
eventsCausingGuards: {
hasData: 'STORE_RESPONSE';
hasPartialData: 'STORE_RESPONSE';
};
'eventsCausingServices': {
eventsCausingServices: {
resetInjiProps: 'UPDATE_CREDENTIAL_REGISTRY';
};
'matchesStates':
matchesStates:
| 'idle'
| 'init'
| 'injiTourGuide'
| 'resetInjiProps'
| 'showInjiTourGuide'
| 'storingDefaults';
'tags': never;
tags: never;
}

View File

@@ -1,9 +1,19 @@
// Learn more https://docs.expo.io/guides/customizing-metro
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { getDefaultConfig } = require('@expo/metro-config');
const { getDefaultConfig } = require('expo/metro-config');
const defaultConfig = getDefaultConfig(__dirname);
defaultConfig.resolver.assetExts.push('md');
module.exports = defaultConfig;
// extra config is needed to enable `react-native-svg-transformer`
module.exports = (async () => {
const {
resolver: { sourceExts, assetExts },
} = await getDefaultConfig(__dirname);
return {
transformer: {
babelTransformerPath: require.resolve('react-native-svg-transformer'),
assetPlugins: ['expo-asset/tools/hashAssetFiles'],
},
resolver: {
assetExts: assetExts.filter((ext) => ext !== 'svg'),
sourceExts: [...sourceExts, 'svg'],
},
};
})();

48807
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,14 +3,11 @@
"prepare": "husky install",
"start": "react-native start",
"android:mosip": "react-native run-android --variant=mosipDebug",
"android:newlogic": "react-native run-android --variant=newlogicDebug",
"android:ph": "react-native run-android --variant=phDebug",
"ios": "react-native run-ios",
"build:android:mosip": "cd android && ./gradlew :app:assembleMosipRelease && cd ..",
"build:android:newlogic": "cd android && ./gradlew :app:assembleNewlogicRelease && cd ..",
"build:android:ph": "cd android && ./gradlew :app:assemblePhRelease && cd ..",
"i18n:compile-strings": "node scripts/compile-strings.js",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
"test": "jest",
"postinstall": "patch-package"
},
"dependencies": {
@@ -21,39 +18,39 @@
"@digitalcredentials/vc": "^1.1.2",
"@expo-google-fonts/inter": "^0.2.3",
"@expo-google-fonts/poppins": "^0.2.0",
"@expo/metro-config": "^0.3.12",
"@expo/metro-config": "~0.10.0",
"@idpass/smartshare-react-native": "0.2.3-beta.2",
"@react-native-clipboard/clipboard": "^1.11.2",
"@react-native-community/netinfo": "7.1.3",
"@react-native-picker/picker": "2.2.1",
"@react-native-clipboard/clipboard": "^1.10.0",
"@react-native-community/netinfo": "9.3.7",
"@react-native-picker/picker": "2.4.8",
"@react-navigation/bottom-tabs": "^6.0.7",
"@react-navigation/native": "^6.0.2",
"@react-navigation/native": "^6.0.8",
"@react-navigation/native-stack": "^6.1.0",
"@xstate/react": "^3.0.1",
"base64url-universal": "^1.1.0",
"buffer": "^6.0.3",
"crypto-js": "^3.3.0",
"date-fns": "^2.26.0",
"expo": "^44.0.0",
"expo": "~48.0.18",
"expo-app-loading": "~1.3.0",
"expo-barcode-scanner": "~11.2.0",
"expo-camera": "~12.1.2",
"expo-constants": "~13.0.1",
"expo-font": "~10.0.4",
"expo-local-authentication": "~12.0.1",
"expo-localization": "^12.0.1",
"expo-splash-screen": "~0.14.1",
"expo-status-bar": "~1.2.0",
"expo-updates": "~0.11.6",
"expo-barcode-scanner": "~12.3.2",
"expo-camera": "~13.2.1",
"expo-constants": "~14.2.1",
"expo-font": "~11.1.1",
"expo-local-authentication": "~13.3.0",
"expo-localization": "~14.1.1",
"expo-splash-screen": "~0.18.2",
"expo-status-bar": "~1.4.4",
"expo-updates": "~0.16.4",
"i18next": "^21.6.16",
"iso-639-3": "^3.0.1",
"mosip-inji-face-sdk": "^0.1.12",
"node-forge": "^1.3.1",
"patch-package": "^6.5.1",
"postinstall-postinstall": "^2.1.0",
"react": "17.0.1",
"react": "18.2.0",
"react-i18next": "^11.16.6",
"react-native": "0.64.4",
"react-native": "0.71.8",
"react-native-animated-pagination-dot": "^0.4.0",
"react-native-app-intro-slider": "^4.0.4",
"react-native-argon2": "^2.0.1",
@@ -62,48 +59,59 @@
"react-native-cli": "^2.0.1",
"react-native-device-info": "^8.4.8",
"react-native-dotenv": "^3.3.1",
"react-native-elements": "3.4.2",
"react-native-fs": "^2.20.0",
"react-native-gesture-handler": "2.5.0",
"react-native-elements": "3.4.3",
"react-native-fs": "^2.18.0",
"react-native-gesture-handler": "~2.9.0",
"react-native-keychain": "^8.0.0",
"react-native-linear-gradient": "^2.6.2",
"react-native-linear-gradient": "^2.8.0",
"react-native-location": "^2.5.0",
"react-native-mmkv-storage": "0.8.0",
"react-native-permissions": "^3.6.0",
"react-native-mmkv-storage": "^0.9.1",
"react-native-permissions": "^3.8.0",
"react-native-popable": "^0.4.3",
"react-native-qrcode-svg": "^6.1.1",
"react-native-qrcode-svg": "^6.2.0",
"react-native-restart": "^0.0.24",
"react-native-rsa-native": "^2.0.5",
"react-native-safe-area-context": "3.3.2",
"react-native-screens": "~3.10.1",
"react-native-safe-area-context": "4.5.0",
"react-native-screens": "~3.20.0",
"react-native-secure-key-store": "^2.0.10",
"react-native-secure-keystore": "github:mosip/secure-keystore#v0.1.1",
"react-native-securerandom": "^1.0.0",
"react-native-securerandom": "^1.0.1",
"react-native-simple-markdown": "^1.1.0",
"react-native-svg": "12.1.1",
"react-native-svg": "13.4.0",
"react-native-swipe-gestures": "^1.0.5",
"react-native-tuvali": "github:mosip/tuvali#v0.4.4",
"react-native-vector-icons": "^8.1.0",
"react-native-vector-icons": "^10.0.0",
"short-unique-id": "^4.4.4",
"xstate": "^4.35.0"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@types/react": "~17.0.21",
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@react-native-community/eslint-config": "^3.2.0",
"@react-native/metro-config": "^0.72.11",
"@tsconfig/react-native": "^2.0.2",
"@types/react": "^18.0.24",
"@types/react-native": "~0.64.12",
"@types/react-test-renderer": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"babel-jest": "^29.2.1",
"babel-plugin-inline-import": "^3.0.0",
"babel-plugin-module-resolver": "^4.1.0",
"eslint": "^8.12.0",
"eslint": "^8.19.0",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-sonarjs": "^0.13.0",
"expo-cli": "^5.3.1",
"glob": "^8.0.1",
"husky": "^7.0.4",
"jest": "^29.2.1",
"jetifier": "^2.0.0",
"lint-staged": "^12.3.7",
"metro-react-native-babel-preset": "0.73.9",
"prettier": "^2.6.1",
"typescript": "~4.3.5"
"react-native-svg-transformer": "^1.1.0",
"react-test-renderer": "18.2.0",
"typescript": "^4.9.4"
},
"private": true,
"name": "mosip-resident-app",
@@ -113,7 +121,10 @@
"*.strings.json": "node scripts/compile-strings.js"
},
"overrides": {
"react": "17.0.1",
"react-native": "0.64.4"
"react": "18.2.0",
"react-native": "0.71.8"
},
"engines": {
"node": ">=16"
}
}

View File

@@ -1,26 +0,0 @@
diff --git a/node_modules/react-native-elements/dist/tab/Tab.js b/node_modules/react-native-elements/dist/tab/Tab.js
index 1204a46..bcce099 100644
--- a/node_modules/react-native-elements/dist/tab/Tab.js
+++ b/node_modules/react-native-elements/dist/tab/Tab.js
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
return t;
};
import React from 'react';
-import { View, Animated, StyleSheet, } from 'react-native';
+import { View, Animated, StyleSheet, I18nManager } from 'react-native';
import Button from '../buttons/Button';
import { withTheme } from '../config';
import Color from 'color';
@@ -69,7 +69,11 @@ const TabContainer = (_a) => {
{
translateX: animation.interpolate({
inputRange: [0, 1],
- outputRange: [0, WIDTH],
+ /**
+ * The Fix has been raised as PR in the upstream, This patch has to removed once the fix is made in the upstream.
+ * PR : https://github.com/react-native-elements/react-native-elements/pull/3779
+ */
+ outputRange: [0, I18nManager.isRTL ? -WIDTH : WIDTH],
}),
},
],

View File

@@ -0,0 +1,22 @@
diff --git a/node_modules/react-native-elements/dist/tab/Tab.js b/node_modules/react-native-elements/dist/tab/Tab.js
index dd85468..ed4e635 100644
--- a/node_modules/react-native-elements/dist/tab/Tab.js
+++ b/node_modules/react-native-elements/dist/tab/Tab.js
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
return t;
};
import React from 'react';
-import { View, Animated, StyleSheet, } from 'react-native';
+import { View, Animated, StyleSheet, I18nManager} from 'react-native';
import Button from '../buttons/Button';
import { withTheme } from '../config';
import Color from 'color';
@@ -69,7 +69,7 @@ const TabContainer = (_a) => {
{
translateX: animation.interpolate({
inputRange: [0, 1],
- outputRange: [0, WIDTH],
+ outputRange: [0, I18nManager.isRTL ? -WIDTH : WIDTH],
}),
},
],

View File

@@ -0,0 +1,29 @@
diff --git a/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java b/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java
index 6dbdd3b..1a4de95 100644
--- a/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java
+++ b/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/RNPlayServicesLocationProvider.java
@@ -6,8 +6,9 @@ import android.content.Intent;
import android.content.IntentSender;
import android.content.pm.PackageManager;
import android.location.Location;
-import android.support.annotation.NonNull;
-import android.support.v4.app.ActivityCompat;
+
+import androidx.annotation.NonNull;
+import androidx.core.app.ActivityCompat;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.Promise;
diff --git a/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/Utils.java b/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/Utils.java
index 6059fdc..b66dd63 100644
--- a/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/Utils.java
+++ b/node_modules/react-native-location/android/src/main/java/com/github/reactnativecommunity/location/Utils.java
@@ -2,7 +2,7 @@ package com.github.reactnativecommunity.location;
import android.location.Location;
import android.os.Build;
-import android.support.annotation.Nullable;
+import androidx.annotation.Nullable;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.ReactApplicationContext;

View File

@@ -1,8 +1,8 @@
diff --git a/node_modules/react-native-mmkv-storage/ios/SecureStorage.m b/node_modules/react-native-mmkv-storage/ios/SecureStorage.m
index dbea26b..1b465af 100644
index dbea26b..623d894 100644
--- a/node_modules/react-native-mmkv-storage/ios/SecureStorage.m
+++ b/node_modules/react-native-mmkv-storage/ios/SecureStorage.m
@@ -224,7 +224,7 @@ NSString *serviceName = nil;
@@ -224,7 +224,7 @@ - (void) setServiceName:(NSString *)_serviceName
serviceName = _serviceName;
}

9
react-native.config.js Normal file
View File

@@ -0,0 +1,9 @@
module.exports = {
dependencies: {
'react-native-vector-icons': {
platforms: {
ios: null,
},
},
},
};

View File

@@ -3,13 +3,13 @@ import {
BottomTabNavigationOptions,
BottomTabScreenProps,
} from '@react-navigation/bottom-tabs';
import { Image } from 'react-native';
import { HomeScreen } from '../screens/Home/HomeScreen';
import { RootStackParamList } from './index';
import { ScanLayout } from '../screens/Scan/ScanLayout';
import { HistoryScreen } from '../screens/History/HistoryScreen';
import {Image} from 'react-native';
import {HomeScreen} from '../screens/Home/HomeScreen';
import {RootStackParamList} from './index';
import {ScanLayout} from '../screens/Scan/ScanLayout';
import {HistoryScreen} from '../screens/History/HistoryScreen';
import i18n from '../i18n';
import { BOTTOM_TAB_ROUTES } from './routesConstants';
import {BOTTOM_TAB_ROUTES} from './routesConstants';
const home: TabScreen = {
name: BOTTOM_TAB_ROUTES.home,
@@ -20,7 +20,7 @@ const home: TabScreen = {
headerLeft: () =>
React.createElement(Image, {
source: require('../assets/inji-home-logo.png'),
style: { width: 124, height: 27, resizeMode: 'contain' },
style: {width: 124, height: 27, resizeMode: 'contain'},
}),
},
};

View File

@@ -1,4 +1,4 @@
import { MainBottomTabParamList } from './main';
import {MainBottomTabParamList} from './main';
export const BOTTOM_TAB_ROUTES = {
home: 'home' as keyof MainBottomTabParamList,

View File

@@ -1,14 +1,14 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Icon } from 'react-native-elements';
import { MessageOverlay } from '../components/MessageOverlay';
import { Button, Column, Text } from '../components/ui';
import { Theme } from '../components/ui/styleUtils';
import { RootRouteProps } from '../routes';
import { useAuthScreen } from './AuthScreenController';
import {useTranslation} from 'react-i18next';
import {Icon} from 'react-native-elements';
import {MessageOverlay} from '../components/MessageOverlay';
import {Button, Column, Text} from '../components/ui';
import {Theme} from '../components/ui/styleUtils';
import {RootRouteProps} from '../routes';
import {useAuthScreen} from './AuthScreenController';
export const AuthScreen: React.FC<RootRouteProps> = (props) => {
const { t } = useTranslation('AuthScreen');
export const AuthScreen: React.FC<RootRouteProps> = props => {
const {t} = useTranslation('AuthScreen');
const controller = useAuthScreen(props);
return (

View File

@@ -1,17 +1,17 @@
import React, { useRef } from 'react';
import React, {useRef} from 'react';
import AppIntroSlider from 'react-native-app-intro-slider';
import { Dimensions, Image, StatusBar, View } from 'react-native';
import { Centered, Column, Row, Text, Button } from '../../components/ui';
import { Theme } from '../../components/ui/styleUtils';
import { useTranslation } from 'react-i18next';
import { RootRouteProps } from '../../routes';
import { useWelcomeScreen } from '../WelcomeScreenController';
import {Dimensions, Image, StatusBar, View} from 'react-native';
import {Centered, Column, Row, Text, Button} from '../../components/ui';
import {Theme} from '../../components/ui/styleUtils';
import {useTranslation} from 'react-i18next';
import {RootRouteProps} from '../../routes';
import {useWelcomeScreen} from '../WelcomeScreenController';
import LinearGradient from 'react-native-linear-gradient';
export const IntroSlidersScreen: React.FC<RootRouteProps> = (props) => {
export const IntroSlidersScreen: React.FC<RootRouteProps> = props => {
const slider = useRef<AppIntroSlider>();
const { t } = useTranslation('OnboardingOverlay');
const {t} = useTranslation('OnboardingOverlay');
const controller = useWelcomeScreen(props);
const slides = [
@@ -41,7 +41,7 @@ export const IntroSlidersScreen: React.FC<RootRouteProps> = (props) => {
},
];
const renderItem = ({ item }) => {
const renderItem = ({item}) => {
return (
<LinearGradient colors={Theme.Colors.gradientBtn}>
<Centered>
@@ -53,7 +53,7 @@ export const IntroSlidersScreen: React.FC<RootRouteProps> = (props) => {
marginRight: 75,
}}>
<Image
style={{ marginTop: 50, marginBottom: 30 }}
style={{marginTop: 50, marginBottom: 30}}
source={Theme.injiSmallLogo}
/>
</Column>
@@ -108,7 +108,7 @@ export const IntroSlidersScreen: React.FC<RootRouteProps> = (props) => {
<View>
<LinearGradient
colors={Theme.Colors.gradientBtn}
style={{ borderRadius: 10, height: 50, marginTop: -10 }}>
style={{borderRadius: 10, height: 50, marginTop: -10}}>
<Text
testID="next"
weight="semibold"
@@ -126,7 +126,7 @@ export const IntroSlidersScreen: React.FC<RootRouteProps> = (props) => {
<View>
<LinearGradient
colors={Theme.Colors.gradientBtn}
style={{ borderRadius: 10, height: 50, marginTop: -10 }}>
style={{borderRadius: 10, height: 50, marginTop: -10}}>
<Text
testID="getStarted"
weight="semibold"
@@ -140,7 +140,7 @@ export const IntroSlidersScreen: React.FC<RootRouteProps> = (props) => {
);
};
return (
<Column style={{ flex: 1 }}>
<Column style={{flex: 1}}>
<StatusBar translucent={true} backgroundColor="transparent" />
<AppIntroSlider
data={slides}
@@ -153,7 +153,7 @@ export const IntroSlidersScreen: React.FC<RootRouteProps> = (props) => {
width: 30,
marginBottom: 47,
}}
dotStyle={{ backgroundColor: Theme.Colors.dotColor, marginBottom: 47 }}
dotStyle={{backgroundColor: Theme.Colors.dotColor, marginBottom: 47}}
renderItem={renderItem}
onDone={() =>
controller.isPasscodeSet() ? controller.NEXT() : controller.BACK()

View File

@@ -1,18 +1,18 @@
import React from 'react';
import { Icon, ListItem } from 'react-native-elements';
import { useTranslation } from 'react-i18next';
import { Modal } from '../../../components/ui/Modal';
import { Centered, Column, Text } from '../../../components/ui';
import { ActivityLogText } from '../../../components/ActivityLogText';
import { ActorRefFrom } from 'xstate';
import { vcItemMachine } from '../../../machines/vcItem';
import { useKebabPopUp } from '../../../components/KebabPopUpController';
import { Theme } from '../../../components/ui/styleUtils';
import { isSameVC } from '../../../shared/constants';
import {Icon, ListItem} from 'react-native-elements';
import {useTranslation} from 'react-i18next';
import {Modal} from '../../../components/ui/Modal';
import {Centered, Column, Text} from '../../../components/ui';
import {ActivityLogText} from '../../../components/ActivityLogText';
import {ActorRefFrom} from 'xstate';
import {vcItemMachine} from '../../../machines/vcItem';
import {useKebabPopUp} from '../../../components/KebabPopUpController';
import {Theme} from '../../../components/ui/styleUtils';
import {isSameVC} from '../../../shared/constants';
import testIDProps from '../../../shared/commonUtil';
export const HistoryTab: React.FC<HistoryTabProps> = (props) => {
const { t } = useTranslation('HistoryTab');
export const HistoryTab: React.FC<HistoryTabProps> = props => {
const {t} = useTranslation('HistoryTab');
const controller = useKebabPopUp(props);
return (
<ListItem bottomDivider onPress={controller.SHOW_ACTIVITY}>
@@ -31,7 +31,7 @@ export const HistoryTab: React.FC<HistoryTabProps> = (props) => {
isVisible={controller.isShowActivities}
onDismiss={controller.DISMISS}>
<Column fill>
{controller.activities.map((activity) => {
{controller.activities.map(activity => {
const vcKeyMatch = isSameVC(activity._vcKey, props.vcKey);
if (vcKeyMatch) {
return (
@@ -46,7 +46,7 @@ export const HistoryTab: React.FC<HistoryTabProps> = (props) => {
<Centered fill>
<Icon
testID="sentiment-dissatisfied"
style={{ marginBottom: 20 }}
style={{marginBottom: 20}}
size={40}
name="sentiment-dissatisfied"
/>

View File

@@ -1,18 +1,18 @@
import React from 'react';
import { Icon, ListItem } from 'react-native-elements';
import { Row, Text } from '../../../components/ui';
import { Theme } from '../../../components/ui/styleUtils';
import { useTranslation } from 'react-i18next';
import { BindingVcWarningOverlay } from './BindingVcWarningOverlay';
import { OtpVerificationModal } from './OtpVerificationModal';
import { MessageOverlay } from '../../../components/MessageOverlay';
import { useKebabPopUp } from '../../../components/KebabPopUpController';
import { Dimensions } from 'react-native';
import { ActorRefFrom } from 'xstate';
import { vcItemMachine } from '../../../machines/vcItem';
import {Icon, ListItem} from 'react-native-elements';
import {Row, Text} from '../../../components/ui';
import {Theme} from '../../../components/ui/styleUtils';
import {useTranslation} from 'react-i18next';
import {BindingVcWarningOverlay} from './BindingVcWarningOverlay';
import {OtpVerificationModal} from './OtpVerificationModal';
import {MessageOverlay} from '../../../components/MessageOverlay';
import {useKebabPopUp} from '../../../components/KebabPopUpController';
import {Dimensions} from 'react-native';
import {ActorRefFrom} from 'xstate';
import {vcItemMachine} from '../../../machines/vcItem';
import testIDProps from '../../../shared/commonUtil';
export const WalletBinding: React.FC<WalletBindingProps> = (props) => {
export const WalletBinding: React.FC<WalletBindingProps> = props => {
const controller = useKebabPopUp(props);
const WalletVerified: React.FC = () => {
@@ -21,11 +21,11 @@ export const WalletBinding: React.FC<WalletBindingProps> = (props) => {
name="verified-user"
color={Theme.Colors.VerifiedIcon}
size={28}
containerStyle={{ marginStart: 4, bottom: 1 }}
containerStyle={{marginStart: 4, bottom: 1}}
/>
);
};
const { t } = useTranslation('WalletBinding');
const {t} = useTranslation('WalletBinding');
return controller.emptyWalletBindingId ? (
<ListItem bottomDivider onPress={controller.ADD_WALLET_BINDING_ID}>
@@ -83,7 +83,7 @@ export const WalletBinding: React.FC<WalletBindingProps> = (props) => {
width={Dimensions.get('screen').width * 0.8}
align="space-between"
crossAlign="center">
<Row crossAlign="center" style={{ flex: 1 }}>
<Row crossAlign="center" style={{flex: 1}}>
<WalletVerified />
<Text
color={Theme.Colors.Details}

View File

@@ -1,22 +1,22 @@
import React from 'react';
import { Button, Column, Row, Text } from '../../components/ui';
import { Theme } from '../../components/ui/styleUtils';
import { RefreshControl, Image, View } from 'react-native';
import { useMyVcsTab } from './MyVcsTabController';
import { HomeScreenTabProps } from './HomeScreen';
import { AddVcModal } from './MyVcs/AddVcModal';
import { GetVcModal } from './MyVcs/GetVcModal';
import { useTranslation } from 'react-i18next';
import { VcItem } from '../../components/VcItem';
import { GET_INDIVIDUAL_ID } from '../../shared/constants';
import {Button, Column, Row, Text} from '../../components/ui';
import {Theme} from '../../components/ui/styleUtils';
import {RefreshControl, Image, View} from 'react-native';
import {useMyVcsTab} from './MyVcsTabController';
import {HomeScreenTabProps} from './HomeScreen';
import {AddVcModal} from './MyVcs/AddVcModal';
import {GetVcModal} from './MyVcs/GetVcModal';
import {useTranslation} from 'react-i18next';
import {VcItem} from '../../components/VcItem';
import {GET_INDIVIDUAL_ID} from '../../shared/constants';
import {
ErrorMessageOverlay,
MessageOverlay,
} from '../../components/MessageOverlay';
import { Icon } from 'react-native-elements';
import {Icon} from 'react-native-elements';
export const MyVcsTab: React.FC<HomeScreenTabProps> = (props) => {
const { t } = useTranslation('MyVcsTab');
export const MyVcsTab: React.FC<HomeScreenTabProps> = props => {
const {t} = useTranslation('MyVcsTab');
const controller = useMyVcsTab(props);
const storeErrorTranslationPath = 'errors.savingFailed';
@@ -61,7 +61,7 @@ export const MyVcsTab: React.FC<HomeScreenTabProps> = (props) => {
return (
<React.Fragment>
<Column fill style={{ display: props.isVisible ? 'flex' : 'none' }}>
<Column fill style={{display: props.isVisible ? 'flex' : 'none'}}>
{controller.isRequestSuccessful && <DownloadingVcPopUp />}
<Column fill pY={18} pX={15}>
{controller.vcKeys.length > 0 && (

View File

@@ -1,7 +1,7 @@
import { useSelector } from '@xstate/react';
import { useContext } from 'react';
import { ActorRefFrom } from 'xstate';
import { selectIsTampered } from '../../machines/store';
import {useSelector} from '@xstate/react';
import {useContext} from 'react';
import {ActorRefFrom} from 'xstate';
import {selectIsTampered} from '../../machines/store';
import {
selectIsRefreshingMyVcs,
selectMyVcs,
@@ -11,9 +11,9 @@ import {
selectWalletBindingError,
selectShowWalletBindingError,
} from '../../machines/vcItem';
import { vcItemMachine } from '../../machines/vcItem';
import { GlobalContext } from '../../shared/GlobalContext';
import { HomeScreenTabProps } from './HomeScreen';
import {vcItemMachine} from '../../machines/vcItem';
import {GlobalContext} from '../../shared/GlobalContext';
import {HomeScreenTabProps} from './HomeScreen';
import {
MyVcsTabEvents,
MyVcsTabMachine,
@@ -30,7 +30,7 @@ import {
export function useMyVcsTab(props: HomeScreenTabProps) {
const service = props.service as ActorRefFrom<typeof MyVcsTabMachine>;
const { appService } = useContext(GlobalContext);
const {appService} = useContext(GlobalContext);
const vcService = appService.children.get('vc');
const storeService = appService.children.get('store');
const settingsService = appService.children.get('settings');
@@ -50,11 +50,11 @@ export function useMyVcsTab(props: HomeScreenTabProps) {
isBindingError: useSelector(service, selectShowWalletBindingError),
isMinimumStorageLimitReached: useSelector(
service,
selectIsMinimumStorageLimitReached
selectIsMinimumStorageLimitReached,
),
showHardwareKeystoreNotExistsAlert: useSelector(
settingsService,
selectShowHardwareKeystoreNotExistsAlert
selectShowHardwareKeystoreNotExistsAlert,
),
DISMISS: () => service.send(MyVcsTabEvents.DISMISS()),

View File

@@ -6,14 +6,14 @@ import {
sendParent,
StateFrom,
} from 'xstate';
import { createModel } from 'xstate/lib/model';
import { StoreEvents, StoreResponseEvent } from '../../machines/store';
import { VcEvents } from '../../machines/vc';
import { vcItemMachine } from '../../machines/vcItem';
import { AppServices } from '../../shared/GlobalContext';
import { MY_VCS_STORE_KEY } from '../../shared/constants';
import { AddVcModalMachine } from './MyVcs/AddVcModalMachine';
import { GetVcModalMachine } from './MyVcs/GetVcModalMachine';
import {createModel} from 'xstate/lib/model';
import {StoreEvents, StoreResponseEvent} from '../../machines/store';
import {VcEvents} from '../../machines/vc';
import {vcItemMachine} from '../../machines/vcItem';
import {AppServices} from '../../shared/GlobalContext';
import {MY_VCS_STORE_KEY} from '../../shared/constants';
import {AddVcModalMachine} from './MyVcs/AddVcModalMachine';
import {GetVcModalMachine} from './MyVcs/GetVcModalMachine';
import Storage from '../../shared/storage';
const model = createModel(
@@ -27,15 +27,15 @@ const model = createModel(
vcItemActor,
}),
DISMISS: () => ({}),
STORE_RESPONSE: (response?: unknown) => ({ response }),
STORE_ERROR: (error: Error) => ({ error }),
STORE_RESPONSE: (response?: unknown) => ({response}),
STORE_ERROR: (error: Error) => ({error}),
ADD_VC: () => ({}),
GET_VC: () => ({}),
STORAGE_AVAILABLE: () => ({}),
STORAGE_UNAVAILABLE: () => ({}),
IS_TAMPERED: () => ({}),
},
}
},
);
export const MyVcsTabEvents = model.events;
@@ -157,46 +157,46 @@ export const MyVcsTabMachine = model.createMachine(
services: {
checkStorageAvailability: () => async () => {
return Promise.resolve(
Storage.isMinimumLimitReached('minStorageRequired')
Storage.isMinimumLimitReached('minStorageRequired'),
);
},
},
actions: {
refreshMyVc: send((_context, event) => VcEvents.REFRESH_MY_VCS(), {
to: (context) => context.serviceRefs.vc,
to: context => context.serviceRefs.vc,
}),
resetIsTampered: send(() => StoreEvents.RESET_IS_TAMPERED(), {
to: (context) => context.serviceRefs.store,
to: context => context.serviceRefs.store,
}),
viewVcFromParent: sendParent((_context, event: ViewVcEvent) =>
model.events.VIEW_VC(event.vcItemActor)
model.events.VIEW_VC(event.vcItemActor),
),
storeVcItem: send(
(_context, event) => {
return StoreEvents.PREPEND(
MY_VCS_STORE_KEY,
(event as DoneInvokeEvent<string>).data
(event as DoneInvokeEvent<string>).data,
);
},
{ to: (context) => context.serviceRefs.store }
{to: context => context.serviceRefs.store},
),
sendVcAdded: send(
(_context, event) => VcEvents.VC_ADDED(event.response as string),
{
to: (context) => context.serviceRefs.vc,
}
to: context => context.serviceRefs.vc,
},
),
},
guards: {
isMinimumStorageLimitReached: (_context, event) => Boolean(event.data),
},
}
},
);
export function createMyVcsTabMachine(serviceRefs: AppServices) {

View File

@@ -2,7 +2,7 @@
export interface Typegen0 {
'@@xstate/typegen': true;
'internalEvents': {
internalEvents: {
'done.invoke.AddVcModal': {
type: 'done.invoke.AddVcModal';
data: unknown;
@@ -18,36 +18,36 @@ export interface Typegen0 {
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'xstate.init': { type: 'xstate.init' };
'xstate.init': {type: 'xstate.init'};
};
'invokeSrcNameMap': {
invokeSrcNameMap: {
checkStorageAvailability: 'done.invoke.MyVcsTab.addVc.checkStorage:invocation[0]';
};
'missingImplementations': {
missingImplementations: {
actions: never;
delays: never;
guards: never;
services: never;
};
'eventsCausingActions': {
eventsCausingActions: {
refreshMyVc: 'IS_TAMPERED';
resetIsTampered: 'IS_TAMPERED';
sendVcAdded: 'STORE_RESPONSE';
storeVcItem: 'done.invoke.AddVcModal';
viewVcFromParent: 'VIEW_VC';
};
'eventsCausingDelays': {};
'eventsCausingGuards': {
eventsCausingDelays: {};
eventsCausingGuards: {
isMinimumStorageLimitReached: 'done.invoke.MyVcsTab.addVc.checkStorage:invocation[0]';
};
'eventsCausingServices': {
eventsCausingServices: {
AddVcModal:
| 'done.invoke.GetVcModal'
| 'done.invoke.MyVcsTab.addVc.checkStorage:invocation[0]';
GetVcModal: 'GET_VC';
checkStorageAvailability: 'ADD_VC';
};
'matchesStates':
matchesStates:
| 'addVc'
| 'addVc.checkStorage'
| 'addVc.storageLimitReached'
@@ -68,8 +68,8 @@ export interface Typegen0 {
| 'savingFailed'
| 'storing'
| 'waitingForvcKey'
| { savingFailed?: 'idle' };
| {savingFailed?: 'idle'};
gettingVc?: 'waitingForvcKey';
};
'tags': never;
tags: never;
}

Some files were not shown because too many files have changed in this diff Show More