Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 112 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,113 @@
# android-registration-client
Reference Android Registration Client Software - WIP

# Use of Java Packages:
1. Added all the java packages in android directory of the project: <package-name>
2. Add implementation in settings.gradle file of the project:
Eg: include(:<package-name>)
3. Set the server base url in android/build.gradle file.
4. Add implementation for packages in android/app/build.gradle files inside dependency block as:
implementation project(:<package-name>)

# Creation of Services in the project's java package.
1. Added all the required functions by creating individual services for each functionality.
2. Using AppComponent interface which inherits Dagger for dependecny injection.
3. Dependency injection performed in MainActivity.java file by calling inject() method.

# Creation of MethodChannels in dart classes.
1. Create MethodChannel with a constant string name in a dart class and try to invoke a method
provided by this channel.
2. This invoke method will take the function name and arguments which will be sent to native side
for getting a response.
3. The function name in invoke method and on native side should be the same as:
methodChannel.invokeMethod("fetchDetails");
4. On native side, in MainActivity file, inside MethodChennel() use a switch case to check for method name
call.method argument which checks "fetchDetails" case. On matching, it implements "fetchDetails" method.
case "fetchDetails:
Service().fetchDetails(result);
break;

# Fetch Machine Details
1. Method channel on Credential Page invokes "getMachineDetails" method and gets a response from
native side as a string.
2. Then this string can be decoded into a Map<String, dynamic> and the details can be displayed
on a page.
3. It also contains functionality to copy the details and save a file containing details in internal storage.

# Perform Online Login
1. First create a machine with given machine details in admin portal.
2. Try to login by providing correct userId and password.
3. After pressing login button, "login" method will be invoked from method channel.
3. If user is able to login with given credentials, perform master data sync by pressing the sync data button.
4. After that based on the roles of the user which is logged in, he will be prompted to a either home page or onboarding page.

# Performing Offline Login
1. After performing online login and master data sync, a hashed value of the password will be saved in the db.
2. So if the user provides offline login, then the hashed value for password will be checked and matched with the entered password value.
3. If the value matches, then the user is able to perform offline login, else screen will display required error messages.

The Android Registration Client is a tablet application that serves as a portable version of the existing desktop Registration Client. It has been developed to support accessibility on all Android devices. The creation of the Android Registration Client was driven by the need to meet the mobility requirements of countries adopting MOSIP.

# Developer Guide

The documentation here will guide you through the pre-requisites and the other necessary details required for Android Registration Client developer setup.

The android-registration-client repository contains the Android Registration Client software for MOSIP. The feature-flutter branch focuses on integrating Flutter into the client.

## Setup

To set up the Android Registration Client with Flutter and Android Studio, follow the steps below:

#### Prerequisites

* Flutter SDK (3.10.4): Install Flutter by following the official [Flutter installation guide](https://flutter.dev/docs/get-started/install).
* Android Studio (or Any IDE of your choice): Download and install Android Studio from the official [Android Studio website](https://developer.android.com/studio).

#### Step 1: Clone the Repository

The `develop` branch of android-reg-client is currently being actively developed. If you wish to access this branch, you can clone the repository by executing the following command in your terminal. Alternatively, you can download one of the releases available in the repository's release section.

```
git clone -b feature-flutter https://github.com/mosip/android-registration-client.git
```

**Active Branches**:

* [release-0.11.x](https://github.com/mosip/android-registration-client/tree/release-0.11.x)(developer release branch)
* [develop](https://github.com/mosip/android-registration-client/tree/develop)(active development branch)

#### Step 2: Set up Flutter in Android Studio

1. To begin, launch Android Studio.
2. Next, select **Open an existing Android Studio project** and navigate to the cloned repository.
3. Open the `android-registration-client` directory as a project in Android Studio.
4. In order to integrate Flutter with Android Studio, install the Flutter plugin by accessing `File > Settings > Plugins` and searching for **Flutter**. Proceed to click on **Install** to install the plugin.
5. To ensure proper functionality, configure the Flutter SDK path by navigating to `File > Settings > Languages & Frameworks > Flutter` and specifying the Flutter SDK path as the location where you have installed Flutter.
6. Finally, save the changes by clicking on the "Apply" button.

**Customizing the Registration Client**

* Styling of the application can be configured by modifying these files `lib/utils/app_style.dart, lib/utils/app_config.dart`
* Application language bundles can be added to this path `lib/l10n` After adding the bundle run the below command to generate Localization data (Required for the first time).

```
flutter gen-l10n
```

* The label and application logo can be changed here android/app/src/main/AndroidManifest.xml

#### Step 3: Build and Run the Application

* The `pigeon.sh` file consists of the necessary commands for downloading dependencies and generating Flutter - Android native communication code. Please execute the `pigeon.sh` file or execute the commands within the file separately.
* Ensure you have connected an Android device or initiated an Android emulator.
* Open the terminal within Android Studio or use an external terminal.
* Navigate to the `android-registration-client` directory.
* Run the following command to build and execute the application:

```
flutter run
```

#### Step 4: Build, debug, and release APK

Execute the commands below to debug and release the APK

```
// Debug APK
flutter build apk --debug

// Release APK
flutter build apk --release
```

### Set up Mock MDS for Biometric Scan

The Mock MDS tool can be utilized to simulate the functionalities of biometric devices. The Mock MDS application is compliant with CTK standards and can serve as a substitute for Android SBI modules during testing and validation.

1. Install the Mock MDS application.
2. Access the **Settings** menu.
3. Under Device Configuration, choose **Registration** from the dropdown menu.
4. In P12 Configuration:
* Enter the necessary credentials for the Device Key and upload the Device P12 file.
* Enter the required credentials for the FTM Key and upload the FTM P12 file.
* Complete all fields in MOSIP IDA Configuration.
5. In Modality Configuration, specify the quality score for Face, Finger, and Iris scans(these values can also be adjusted during testing).
6. Click on the **Save** button.
7. Go back to the Home Page and select `LOAD AND VALIDATE CERTIFICATES`.

A toast message will be displayed indicating the success of the validation process.

**Note**: To view the released version of the Mock SBI APK, click [here](https://github.com/mosip/android-camera-mds/releases/tag/vDP1).

To download the Mock SBI APK, click on `camera-mds.zip`.

### Contributions

If you would like to contribute to the Android Registration Client, please follow the guidelines outlined [here](https://docs.mosip.io/1.2.0/community/code-contributions).

### License

The Android Registration Client is licensed under the [MIT License](https://github.com/mosip/android-registration-client/blob/develop/LICENSE).

### Support

If you encounter any issues or have any questions, please open an issue on the [GitHub repository](https://github.com/mosip/android-registration-client/issues).

### Sources

* [Flutter- Get started: Install](https://flutter.dev/docs/get-started/install)
* [Android Studio- Download](https://developer.android.com/studio)
Binary file added docs/HandlesUserFlow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions docs/design/handle_flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Handles Feature
The Handles Feature is designed to streamline citizen registration and authentication. During registration, specific attributes such as email, phone number, or national ID—can be designated as a handle. This handle serves as a unique identifier that can later be used for authentication for various services. Handles can also be used to update data in case of data discrepancies. By allowing flexible and secure identification, the feature enhances the accuracy and integrity of citizen records while simplifying user interactions with government systems.

# Configuration Guide

It is important to acknowledge that all properties listed in this guide are automatically synchronized with the Android Registration Client. These properties are sourced from the `registration-default.properties` file.

## Configuration Steps

### 1. Update the Handle Fields in `registration-default.properties`

In the `registration-default.properties` file, update the following property to specify the field values on which you want to enable the handle. Ensure that these field values match the field values in the IDSchema.

```properties
mosip.registration.default-selected-handle-fields=email,phone
```

### 2. Update the Regex for Handle Validation in `id-authentication-default.properties`
In the `id-authentication-default.properties` file, update the Regex to validate handles with the provided key as the postfix:

```properties
mosip.ida.handle-types.regex={ '@email' : '.*@email$', '@phonenumber' : '.*@phonenumber$' }
```

### 3. Map Postfix Values in `id-repository-default.properties`
In the `id-repository-default.properties` file, map the postfix values with the corresponding field values:

```properties
mosip.identity.fieldid.handle-postfix.mapping={'email':'@email', 'phone':'@phonenumber'}
```

#### Configuration files

* `application-default.properties`
* `registration-default.properties`

## Sequence Diagram
The following sequence diagram illustrates the registration process, including the use of the Handles Feature:

![HandlesUserFlow.png](../HandlesUserFlow.png)
2 changes: 1 addition & 1 deletion ui-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.3</version>
<version>2.13.4.2</version>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
Expand Down