This document provides a streamlined integration guide for the Android and iOS native SDKs. The core objective is to integrate only the necessary components based on your actual product solution while meeting functional and security compliance requirements, thereby minimizing the SDK package size.
SDK module thinning guide
1. Purpose of thinning
The SDK adopts a modular architecture that includes a base module, an OCR module, a face liveness module, and an NFC module. Because different verification solutions require different functional components, we recommend that you follow the principle of minimal necessity during integration to avoid introducing unnecessary components.
2. Thinning strategy
Base module (required): Handles SDK initialization, device information collection, network communication, and basic security capabilities. This module must be retained.
Business modules (on demand): Retain only the OCR, face liveness, or NFC modules required by your current product solution. Remove unused modules from your project dependencies to reduce the application package size and dependency complexity.
FaceGuard module (recommended to retain): This module is a trimmable on-device security component. In production environments that involve facial recognition, we recommend retaining this module to ensure continuous protection against facial recognition environment risks.
3. Notes
Build-time behavior: Module thinning is a build-time dependency selection and does not affect the normal functionality of retained modules.
Testing requirements: Before releasing a version, complete real-device regression testing based on the actual verification flow to ensure proper functionality.
Module classification and thinning rules
Module category | Main capabilities | Applicable solutions | Thinning impact |
Base module | SDK initialization, device information, encryption, general runtime capabilities | All solutions | Cannot be removed |
OCR module | Document capture, text recognition, OCR auto-scan | OCR solutions, real-person verification solutions | OCR becomes unavailable after removal; real-person verification is also affected |
Face liveness module | Face capture, liveness detection, face quality detection | Liveness detection solutions, real-person verification solutions | Face liveness becomes unavailable after removal |
NFC module | Read and parse document chip information | NFC solutions | NFC document reading becomes unavailable after removal |
Face device security module | On-device authentication environment security protection during facial recognition | Solutions that involve face liveness | Can be removed, but weakens security protection capabilities; recommended to retain in production environments |
Android modules
Module capability | Component name | Compiled size | Description | ||
Dual-arch | ARM64 | ARMv7 | |||
Base module |
| 0.10 MB | Cannot be removed | ||
Base module |
| 0.13 MB | Cannot be removed | ||
Base module |
| 0.44 MB | 0.25MB | 0.19MB | Cannot be removed |
MNN module |
| 2.20 MB | 1.2MB | 1.04MB | Can be removed. Base component for face liveness, face quality, and OCR auto-scan. Required if any of these features are used. |
OCR basic recognition |
| 0.23 MB | Can be removed. Required for OCR and real-person verification solutions. | ||
OCR auto-scan capability |
| 0.61 MB | 0.47MB | 0.42MB | Can be removed. Required for OCR auto-scan capability. |
Face UI |
| 0.05 MB | Can be removed. Required for face liveness solutions. | ||
Face liveness |
| 0.80 MB | 0.59MB | 0.54MB | Can be removed. Required for face liveness solutions. |
Face liveness blink detection |
| 0.20 MB | Can be removed. Required for blink-based liveness scenarios. | ||
Strict face quality detection |
| 0.20 MB | Can be removed. Can be removed when strict quality detection is not enabled on the server side. After removal, face quality and occlusion detection will not work. | ||
Face device security module |
| 3.30 MB | 2.80MB | 2.00MB | Can be removed. This module protects on-device authentication environment security during facial recognition. Removal weakens security protection. Recommended to retain in production environments. |
NFC service module |
| 5.20 MB | Can be removed. Required for NFC solutions. | ||
NFC business module |
| 0.14 MB | Can be removed. Required for NFC solutions. | ||
tygerservice has been removed in version 1.3.4 and later. It should not be included as a required dependency for current versions.
iOS modules
Module Features | Component name | Size increase | Description |
Basic module |
| 0.03 MB | Not clippable |
Basic module |
| 0.03 MB | Not clippable |
Basic module |
| 0.23 MB | Clipping is not supported |
Network communication |
| 0.03 MB | Not clippable |
Region adaptation |
| 0.01 MB | Cannot be clipped |
Crash monitoring |
| 0.06 MB | Not clippable |
MNN module |
| 0.09 MB | Optional. Required for face liveness detection, face quality assessment, and automatic OCR scanning. |
Basic OCR |
| 0.76 MB | Optional. Required for OCR and ID Verification solutions. |
Face liveness detection |
| 2.20 MB | Optional. Required for the face liveness detection solution. |
Facial Recognition Device Security Module |
| 0.74 MB | Optional. This module secures the on-device authentication environment during face scanning. Removing it weakens security. Keep this module for optimal security. |
NFC |
| 3.70 MB | Optional. Required for the NFC solution. |
ToygerService, ToygerNative, and DTFUtility have been removed in version 1.3.5 and later. They should not be included as required dependencies for current versions.
Recommended integration combinations and SDK size estimation
The following table summarizes the minimum feature set per solution. Android sizes are compiled dual-architecture sizes as officially listed. iOS sizes are Framework package size increments. Recommended sets that include facial recognition retain FaceGuard by default.
Product solution | Retained modules | Android minimum set | Android recommended set (with device security) | iOS minimum set | iOS recommended set (with device security) |
OCR solution (basic recognition) | Base + OCR | ~0.90 MB | ~0.90 MB | ~1.15 MB | ~1.15 MB |
OCR solution (with auto-scan) | Base + OCR + OCR auto-scan + MNN | ~3.71 MB | ~3.71 MB | ~1.24 MB | ~1.24 MB |
NFC solution | Base + NFC | ~6.01 MB | ~6.01 MB | ~4.09 MB | ~4.09 MB |
Liveness detection solution | Base + face liveness and blink + MNN | ~3.92 MB | ~7.22 MB | ~2.68 MB | ~3.42 MB |
Real-person verification solution (OCR + liveness) | Base + OCR + OCR auto-scan + face liveness and blink + MNN | ~4.76 MB | ~8.06 MB | ~3.44 MB | ~4.18 MB |
1. Module removal conditions
If the OCR auto-scan feature is not enabled in the real-person verification flow, you can remove the related dependencies based on the following rules:
Android: The
idv-identityocrservicemodule can be removed.iOS: The MNN module can be removed, provided that the face liveness detection implementation does not depend on it.
2. Risk warning
The current standard face liveness solution typically still depends on the MNN module. Before removing it, strictly verify the underlying technical implementation to avoid affecting core verification functionality.
3. Final confirmation basis
The final result of module thinning must be based on the selected SDK version and the actual generated dependency list.
Integration recommendations
1. Dependency selection principles
Determine the solution before selecting dependencies: Identify the product solution before integration. Do not directly import the full SDK package across all business lines.
Trim based on underlying capabilities: Module selection should be based on underlying capabilities, not just the frontend UI. For example, if your business involves face liveness detection, you must retain its underlying dependencies and not just the UI component.
Security module retention strategy: In scenarios that involve facial recognition, retain the FaceGuard module by default. If it must be removed due to package size constraints, the business, security, and risk control teams must jointly assess and confirm the acceptable risk scope.
2. Testing and verification requirements
After changing the dependency configuration, you must perform comprehensive regression verification on critical business paths. Verification scenarios should cover: SDK initialization, permission denial, weak network conditions, user cancellation or retry operations, and core paths for successful and failed verification.
3. Package size evaluation notes
Based on the final artifact: Package size evaluation should be based on the final build artifact (APK/AAB/IPA).
Size influencing factors: The actual package size is not only affected by SDK module thinning, but also by ABI splitting, code compression, linker trimming, existing application dependencies, and build configurations.