Migration Guides
From 4.0.0, we've introduced significant API improvements and feature enhancements. To make upgrading easier, here’s what you need to know:
Some APIs in the table below are now removed. You’ll need to update your code accordingly.
Due to numerous API changes this time, if you haven't made significant changes to the LivenessActivity.java
code, it's recommended that you re-download the UI source code module and its dependencies.
GuardianLivenessDetectionSDK
GuardianLivenessDetectionSDK
Method/Property | Alternative | Notes |
---|---|---|
setRecordVideoSwitch | - | No need to call. |
letSDKHandleCameraPermission | - | No need to call. |
setMaxRecordVideoSeconds | LivenessConfig#setMaxRecordVideoSeconds() | Record if greater than 0, otherwise recording. |
setRecordVideoQuality | - | No need to call. |
isDetectOcclusion | LivenessConfig#setDetectOcclusion() | - |
setResultPictureSize | LivenessConfig#setResultPictureSize() | - |
bindUser | LivenessConfig#setUserId() | - |
set3DLivenessTimeoutMills | LivenessConfig#setDistantNearTimeout() | - |
setActionSequence | - | No need to call. |
setActionTimeoutMills | LivenessConfig#setActionTimeout() | - |
setAuditImageConfig | LivenessConfig#setAuditImageConfig() | - |
setCameraType | LivenessConfig#setCameraType() | - |
setDetectionLevel | - | No need to call. |
setDeviceType | - | Not support. |
setPrepareTimeoutMills | LivenessConfig#setPrepareMillSeconds() | - |
setSignatureId | LivenessConfig#setSignatureId() | - |
setQueryId | LivenessConfig#setQueryId() | - |
setTicket | LivenessConfig#setTicket() | - |
clearTicketAndQueryId | - | LivenessConfig#setQueryId(""), LivenessConfig#setTicket("") |
isSDKHandleCameraPermission | - | No need to call. |
LivenessView
LivenessView
Method/Property | Alternative | Notes |
---|---|---|
setLivenssCallback | LivenessView$startDetection(configs, livenessCallback); | The set method has been removed, and configs and callback need to be set each time the liveness detection is started. |
onResume | - | No need to call. |
onPause | - | No need to call. |
onDestroy | - | No need to call. |
isNotOnLoadingFaceData | - | No need to call. |
getLivenessData | - | No need to call. |
playSound(resID, true, 1500); | LivenessConfig#setSoundRawId(), LivenessConfig#playSound() | The playSound method is divided into two methods: setSoundRawId for setting the resource ID and playSound for playing the sound. |
getCurrentDetectionType | Removed | Liveness stage cannot be obtained from the view. Please retrieve the LivenessStage through the callback onLivenessStageChanged provided by the view. |
Detector
Detector
The
Detector
class is no longer visible, and the related enumerations are replaced as follows
Method/Property | Alternative | Notes |
---|---|---|
Detector.DetectionType | aai.liveness.enums.LivenessStage | - |
Detector.WarnCode | aai.liveness.enums.WarnCode | - |
Detector.DetectionFailedType | aai.liveness.enums.DetectionFailedType | - |
DetectionFailedType
DetectionFailedType
Alternative | Method/Property | Notes |
---|---|---|
- | NO_BEST_IMAGE | A new error code has been added. It belongs to internal SDK errors and does not require user notification. Please contact us if this code appears. |
- | UNDEFINED | A new error code has been added. It belongs to internal SDK errors and does not require user notification. Please contact us if this code appears. |
LivenessCallback
LivenessCallback
Method/Property | Alternative | Notes |
---|---|---|
onDetectionActionChanged() | onLivenessStageChanged(LivenessStage livenessStage) | |
onDetectionFrameStateChanged(Detector.WarnCode warnCode) | onDetectionFrameStateChanged(LivenessStage livenessStage, WarnCode warnCode) | |
onDetectionFailed(Detector.DetectionFailedType failedType, Detector.DetectionType detectionType) | onDetectionFailed(DetectionFailedType failedType, LivenessStage livenessStage) | |
onDetectionSuccess() | Removed | New methods onUploadFaceDataStart and onUploadFaceDataComplete have replaced the onDetectionSuccess method. |
- | onUploadFaceDataStart() | Start uploading face data; please execute your loading here. |
- | onUploadFaceDataComplete() | Face data upload completed; hide your loading. You can obtain the results through LivenessResult . |
aai.liveness.impl.LivenessGetFaceDataCallback
aai.liveness.impl.LivenessGetFaceDataCallback
Removed
Updated 12 days ago