lkarus:PUA.AndroidOS.Spyloan
warnings on VirusTotal.Not-a-virus:HEUR:RiskTool.AndroidOS.SpyLoan.fk
warnings on VirusTotal.Change the dependency version number to2.2.1
:
xxxxxxxxxx
dependencies {
...
// version log:http://public-n3.advai.net/repository/maven-releases/ai/advance/mobile-sdk/android/liveness-detection/maven-metadata.xml
implementation 'ai.advance.mobile-sdk.android:liveness-detection:2.2.1'
}
lkarus:PUA.AndroidOS.Spyloan
warnings on VirusTotal.Change the dependency version number to2.2.0
:
xxxxxxxxxx
dependencies {
...
// version log:http://public-n3.advai.net/repository/maven-releases/ai/advance/mobile-sdk/android/liveness-detection/maven-metadata.xml
implementation 'ai.advance.mobile-sdk.android:liveness-detection:2.2.0'
}
Change the dependency version number to2.1.9
:
xxxxxxxxxx
dependencies {
...
// version log:http://public-n3.advai.net/repository/maven-releases/ai/advance/mobile-sdk/android/liveness-detection/maven-metadata.xml
implementation 'ai.advance.mobile-sdk.android:liveness-detection:2.1.9'
}
Open audit image list functionality.
xxxxxxxxxx
// The first boolean represents whether to enable this feature,
// The second value represents the image size. The size range is [50, 1000], with a default of 600.
// The third value is the image compress quality,The quality range is [30, 100], with a default of 30.
GuardianLivenessDetectionSDK.setAuditImageConfig(true,300,30);
Change the dependency version number to2.1.8
:
xxxxxxxxxx
dependencies {
...
// version log:http://public-n3.advai.net/repository/maven-releases/ai/advance/mobile-sdk/android/liveness-detection/maven-metadata.xml
implementation 'ai.advance.mobile-sdk.android:liveness-detection:2.1.8'
}
Open audit image list functionality.
xxxxxxxxxx
// The first boolean represents whether to enable this feature, and the second value represents the image size. The size range is [50, 1000], with a default of 600.
GuardianLivenessDetectionSDK.setAuditImageConfig(true,300);
Get the audit image list
xxxxxxxxxx
List<LivenessImageData> imageSequenceList = LivenessResult.getAuditImageList();
// LivenessImageData
public class LivenessImageData {
// base64 format image
public final String base64Image;
// Timestamp of image capture.
public final long timestamp;
// The action that this image is associated with.
public Detector.DetectionType detectionType;
}
Change the dependency version number to2.1.6
:
xxxxxxxxxx
dependencies {
...
// version log:http://public-n3.advai.net/repository/maven-releases/ai/advance/mobile-sdk/android/liveness-detection/maven-metadata.xml
implementation 'ai.advance.mobile-sdk.android:liveness-detection:2.1.6'
}
Change the dependency version number to2.1.5
:
xxxxxxxxxx
dependencies {
...
// version log:http://public-n3.advai.net/repository/maven-releases/ai/advance/mobile-sdk/android/liveness-detection/maven-metadata.xml
implementation 'ai.advance.mobile-sdk.android:liveness-detection:2.1.5'
}
Change the dependency version number to2.1.4
:
xxxxxxxxxx
dependencies {
...
// version log:http://public-n3.advai.net/repository/maven-releases/ai/advance/mobile-sdk/android/liveness-detection/maven-metadata.xml
implementation 'ai.advance.mobile-sdk.android:liveness-detection:2.1.4'
}
Change the dependency version number to2.1.3
:
xxxxxxxxxx
dependencies {
...
// version log:http://public-n3.advai.net/repository/maven-releases/ai/advance/mobile-sdk/android/liveness-detection/maven-metadata.xml
implementation 'ai.advance.mobile-sdk.android:liveness-detection:2.1.3'
}
Change the dependency version number to2.1.2
:
xxxxxxxxxx
dependencies {
...
// version log:http://public-n3.advai.net/repository/maven-releases/ai/advance/mobile-sdk/android/liveness-detection/maven-metadata.xml
implementation 'ai.advance.mobile-sdk.android:liveness-detection:2.1.2'
}
Change the dependency version number to2.1.1
:
xxxxxxxxxx
dependencies {
...
// Version log:http://public-n3.advai.net/repository/maven-releases/ai/advance/mobile-sdk/android/liveness-detection/maven-metadata.xml
implementation 'ai.advance.mobile-sdk.android:liveness-detection:2.1.1'
}
Change the dependency version number to1.4.0
:
xxxxxxxxxx
dependencies {
...
// Version log:http://public-n3.advai.net/repository/maven-releases/ai/advance/mobile-sdk/android/liveness-detection/maven-metadata.xml
implementation 'ai.advance.mobile-sdk.android:liveness-detection:1.4.0'
}
Change the dependency version number to2.0.2
:
xxxxxxxxxx
dependencies {
...
// Version log:http://public-n3.advai.net/repository/maven-releases/ai/advance/mobile-sdk/android/liveness-detection/maven-metadata.xml
implementation 'ai.advance.mobile-sdk.android:liveness-detection:2.0.2'
}
Change the dependency version number to 2.0.1
:
xxxxxxxxxx
dependencies {
...
// Version log:http://public-n3.advai.net/repository/maven-releases/ai/advance/mobile-sdk/android/liveness-detection/maven-metadata.xml
implementation 'ai.advance.mobile-sdk.android:liveness-detection:2.0.1'
}
Set movement difficulty level(Called before the setLicenseAndCheck() method, otherwise it does not take effect)
You can specify the difficulty of the action detection according to your business requirements (EASY,NORMAL,HARD),default level is NORMAL
xxxxxxxxxx
GuardianLivenessDetectionSDK.setDetectionLevel(GuardianLivenessDetectionSDK.DetectionLevel.EASY);
Change the dependency version number to 2.0.0
:
xxxxxxxxxx
dependencies {
...
// Version log:http://public-n3.advai.net/repository/maven-releases/ai/advance/mobile-sdk/android/liveness-detection/maven-metadata.xml
implementation 'ai.advance.mobile-sdk.android:liveness-detection:2.0.0'
}
Add new prompt and status code when detecting, add corresponding prompt in status code callback method, otherwise the page will prompt blank. For text resources, please refer to the integration documentation to download the UI source code.
xxxxxxxxxx
@Override
public void onDetectionFrameStateChanged(Detector.WarnCode warnCode) {
...
switch (warnCode) {
...
case WARN_WEAKLIGHT:
changeTipTextView(R.string.liveness_weak_light);
break;
case WARN_TOOLIGHT:
changeTipTextView(R.string.liveness_too_light);
break;
case WARN_FACE_BIAS_BOTTOM:
changeTipTextView(R.string.liveness_face_move_upper);
break;
case WARN_FACE_BIAS_UP:
changeTipTextView(R.string.liveness_face_move_down);
break;
case WARN_FACE_BIAS_RIGHT:
changeTipTextView(R.string.liveness_face_move_left);
break;
case WARN_FACE_BIAS_LEFT:
changeTipTextView(R.string.liveness_face_move_right);
break;
...
}
}
Add the following maven repository configuration to your project's build.gradle
:
xxxxxxxxxx
maven {
url 'http://public-n3.advai.net/repository/maven-releases/'
// If your gradle version is greater than 7.0, you need to add the following configuration to allow pulling aar via http
// allowInsecureProtocol = true
}
Add library dependencies to the liveness
module build.gradle
.
xxxxxxxxxx
dependencies {
...
// For the version update log, please see:http://public-n3.advai.net/repository/maven-releases/ai/advance/mobile-sdk/android/liveness-detection/maven-metadata.xml
implementation 'ai.advance.mobile-sdk.android:liveness-detection:1.3.9.1'
}
Delete liveness_lib_vx.x.x.aar ,guardian_core_vx.x.aar.
Synchronize gradle to start downloading dependencies
If you are unable to pull the aar, you can download the aar from the following link and manually depend on it for your project.
The links below are for lib 1.3.9.4 and core 3.3. Modify the version number in the link to download the corresponding version.
Replace the old version of aar with liveness_lib_v1.3.8.aar , guardian_core_v3.2.aar and modify the dependencies in gradle
Add an eye closure detection prompt to the Activity with the following sample code.
LivenessActivity.java
xxxxxxxxxx
private void updateTipUIView(Detector.WarnCode warnCode) {
...
switch (warnCode) {
...
case WARN_EYE_OCCLUSION:
changeTipTextView(R.string.liveness_open_eyes);
break;
...
}
}
R.string.liveness_open_eyes
The resources in each language are listed below, please add them manually tostrings.xml
:
please open your eyes
por favor abre tus ojos
कृपया अपनी आँखें खोलो
tolong buka matamu
sila buka mata anda
กรุณาเปิดตาของคุณ
làm ơn hãy mở mắt ra
请睁开眼
xxxxxxxxxx
// Sample codes
List<String> imageSequenceList = LivenessResult.getImageSequenceList();
for (String base64Img : imageSequenceList) {
byte[] decode = Base64.decode(base64Img, Base64.NO_WRAP);
Bitmap bmp = BitmapFactory.decodeByteArray(decode, 0, decode.length);
}
Add face occlusion detection feature, currently is mainly detecting whether are face mask blocking the face.
If you want to enable occlusion detection, please call the following method after initializing the SDK to set it
xxxxxxxxxx
GuardianLivenessDetectionSDK.isDetectOcclusion(true)
Replace the old version of aar with liveness_lib_v1.2.3.aar , guardian_core_v2.3.aar and modify the dependencies in gradle
Find the masking text in res/values/strings.xml and add it to your project.
Modify the updateTipUIView() method in LivenessFragment.java to add the following hint for masking:
xxxxxxxxxx
private void updateTipUIView(Detector.WarnCode warnCode) {
switch (warnCode) {
...
case WARN_MOUTH_OCCLUSION:
changeTipTextView(R.string.liveness_face_occ);
break;
...
}
}
liveness
moduleandroidx
and React Native
(0.61.3) version supportRemoved the method of initializing the SDK by reading the configuration from AndroidManifest.xml
Add the following method to the GuardianLivenessDetectionSDK class:
xxxxxxxxxx
```
// Pass in your own user unique ID to bind the user to the SDK collection. When encounter problems, be convenient to log with us. public static void bindUser(String userId)
xxxxxxxxxx
Replace the old version of aar with guardian_core_v1.5.aar and liveness_lib_v1.1.6.aar and modify the dependencies in gradle
It is recommended to use a full upgrade, the new version of the code is more concise, almost no code intrusion.
liveness
module and modify it according to the new acquisition method on the integration document.The original
handleResult(ResultEntity entity)
method is changed to the callback methodonGetFaceDataSuccess()
inonDetectionSuccess()
The method content is as follows :
xxxxxxxxxx
@Override
public void onDetectionSuccess() {
mLivenessView.getLivenessData(new LivenessGetFaceDataCallback() {
@Override
public void onGetFaceDataStart() {
...
}
@Override
public void onGetFaceDataSuccess(ResultEntity entity, String livenessId) {
toResultActivity(entity);
}
@Override
public void onGetFaceDataFailed(ResultEntity entity) {
...
}
});
}
Full Upgrade
liveness\_lib\_v1.1.4.aar
and guardian_core_v1.2.aar
files to the lives/libs directory and delete the corresponding old version aar. If you also integrate the picture_quality SDK
, please replace the SDK dependent guardian_core_vxx.aar with 1.2
Version to avoid version dependency conflicts. liveness/build.gradle
:xxxxxxxxxx
`implementation 'com.android.support.constraint:constraint-layout:1.1.3'`
Simple upgrade: This update is mainly to optimize the UI module, and solve a small number of bugs in aar. You can choose to replace only the aar file to fix the known problem in aar.
liveness_lib_v1.1.4.aar
and update the reference to 1.1.4 in gradle.Only after the liveness detection test is successful will there be a picture
xxxxxxxxxx
// get bitmap type picture
Bitmap bitmap = LivenessBitmapCache.getLivenessBitmap();
// get base64 type picture
String base64Str = LivenessBitmapCache.getLivenessBase64Str();
// release memory after get bitmap
LivenessBitmapCache.clearCache();
Replace the 1.1.2 version file with liveness_lib_v1.1.3.aar
and update the reference to 1.1.3 in gradle
The live SDK initialization method needs to increase the country category parameter
xxxxxxxxxx
GuardianLivenessDetectionSDK.init(this, "your accessKey","your secretKey",your market);
Market
Enumerate | Explanation |
---|---|
Indonesia | - |
Philippines | - |
Vietnam | - |
India | - |
Unsupported device judgment:
Replace the LivenessActivity's
onResume()
andonPause()
methods, and theR.string.liveness_device_not_support
text resource looks in the 1.1.3 SDK
xxxxxxxxxx
@Override
protected void onResume() {
if (GuardianLivenessDetectionSDK.isDeviceSupportLiveness()) {
mLivenessFragment = LivenessFragment.newInstance();
if (!mLivenessFragment.isAdded()) {
getSupportFragmentManager().beginTransaction().replace(R.id.container, mLivenessFragment).commitAllowingStateLoss();
}
} else {
new AlertDialog.Builder(this).setMessage(R.string.liveness_device_not_support).setPositiveButton(R.string.liveness_perform, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
}).create().show();
}
super.onResume();
}
@Override
protected void onPause() {
if (mLivenessFragment != null && mLivenessFragment.isAdded()) {
mLivenessFragment.release();
getSupportFragmentManager().beginTransaction().remove(mLivenessFragment).commitAllowingStateLoss();
}
super.onPause();
}
xxxxxxxxxx
private void handleResult(ResultEntity entity){
if (entity!=null && entity.success) {
String base64Bitmap = mDetector.getBase64Bitmap();//bitmap base64 type string
byte[] decode = Base64.decode(base64Bitmap, Base64.NO_WRAP);
Bitmap bitmap = BitmapFactory.decodeByteArray(decode, 0, decode.length);//convert base64 string to bitmap
}
}
There are two ways to upgrade the SDK to version 1.1.2, you can choose one of them according to actual needs. The new version aar already contains the armeabi schema. If you copied libaailiveness_v1.0.0.so to the libs/armeabi directory during the 1.0 integration process, please delete this .so
Applicable for no custom changes or minor changes to the liveness module code.
Suitable for changing the liveness module。No need to delete the old version of the liveness module.
liveness_lib_v1.1.2.aar
fileguardian_core_v1.0.aar
to the libs directory and add a dependency on this aar rebuild project.tips: If you have not changed the res directory, you can overwrite the old one with the res direct copy in the new liveness library project.