All Products
Search
Document Center

ID Verification:SDK thinning instructions

Last Updated:Jul 27, 2026

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

idv-identitybase-sdk

0.10 MB

Cannot be removed

Base module

idv-identityplatform

0.13 MB

Cannot be removed

Base module

idv-identitycrypto

0.44 MB

0.25MB

0.19MB

Cannot be removed

MNN module

idv-identitymnn

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

idv-identityocr

0.23 MB

Can be removed. Required for OCR and real-person verification solutions.

OCR auto-scan capability

idv-identityocrservice

0.61 MB

0.47MB

0.42MB

Can be removed. Required for OCR auto-scan capability.

Face UI

idv-identityface

0.05 MB

Can be removed. Required for face liveness solutions.

Face liveness

idv-identityservice-sdk

0.80 MB

0.59MB

0.54MB

Can be removed. Required for face liveness solutions.

Strict face quality detection

idv-identityquality-sdk

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

Android-AliyunFaceGuard

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

IDOCR_PubSDK_Android

5.20 MB

Can be removed. Required for NFC solutions.

NFC business module

idv-identitynfc

0.14 MB

Can be removed. Required for NFC solutions.

Note

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

AliyunIdentityPlatform

0.03 MB

Not clippable

Basic module

AliyunIdentityUtils

0.03 MB

Not clippable

Basic module

AliyunOSSiOS

0.23 MB

Clipping is not supported

Network communication

AliyunIdentityNetwork

0.03 MB

Not clippable

Region adaptation

AliyunIdentityAdapter

0.01 MB

Cannot be clipped

Crash monitoring

AliyunCrashKit

0.06 MB

Not clippable

MNN module

MNN

0.09 MB

Optional. Required for face liveness detection, face quality assessment, and automatic OCR scanning.

Basic OCR

AliyunIdentityOcr

0.76 MB

Optional. Required for OCR and ID Verification solutions.

Face liveness detection

AliyunIdentityFace

2.20 MB

Optional. Required for the face liveness detection solution.

Facial Recognition Device Security Module

faceguard

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

AliyunIdentityNFC, OpenSSL

3.70 MB

Optional. Required for the NFC solution.

Note

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.

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.