feat:引入人脸识别sdk

This commit is contained in:
ctw committed 2025-11-29 01:17:29 +08:00
1 parent ce16eaf82e
commit 158d012eff
331 files changed
+13539

No files matched your search

@@ -0,0 +1,69 @@
//
// APBProtocol.h
// BioAuthEngine
//
// Created by yukun.tyk on 3/15/16.
// Copyright © 2016 DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
//若不支持pb
#ifndef SUPPORT_PB
@interface BisClientConfigContent : NSObject
@property (nonatomic,strong) NSString* token;
@property (nonatomic,strong) NSString* type;
@property (nonatomic,strong) NSString* sampleMode;
@property (nonatomic,strong) NSString* androidcfg;
@property (nonatomic,strong) NSString* ioscfg;
@property (nonatomic,strong) NSString* h5cfg;
@end
@interface BisClientConfig : NSObject
@property (nonatomic,strong) BisClientConfigContent* content;
@property (nonatomic,strong) NSString* sign;
@end
//若支持PB
#else
#ifdef __cplusplus
extern "C"{
#endif
#import <APProtocolBuffers/ProtocolBuffers.h>
#ifdef __cplusplus
}
#endif
@interface BisClientConfigContent : APDPBGeneratedMessage
@property (readonly) BOOL hasToken;
@property (readonly) BOOL hasType;
@property (readonly) BOOL hasSampleMode;
@property (readonly) BOOL hasAndroidcfg;
@property (readonly) BOOL hasIoscfg;
@property (readonly) BOOL hasH5cfg;
@property (nonatomic,strong) NSString* token ;
@property (nonatomic) SInt32 type ;
@property (nonatomic) SInt32 sampleMode ;
@property (nonatomic,strong) NSString* androidcfg ;
@property (nonatomic,strong) NSString* ioscfg ;
@property (nonatomic,strong) NSString* h5cfg ;
@end
@interface BisClientConfig : APDPBGeneratedMessage
@property (readonly) BOOL hasContent;
@property (readonly) BOOL hasContentBytes;
@property (readonly) BOOL hasSign;
@property (nonatomic,strong) NSString* content ;
@property (nonatomic,strong) BisClientConfigContent* contentBytes ;
@property (nonatomic,strong) NSString* sign ;
@end
#endif
@@ -0,0 +1,47 @@
//com..bis.common.service.facade.gw.model.upload.BisJsonUploadGwRequest
/*
*generation date:Mon Mar 14 10:35:56 CST 2016
*tool version:5.0.2
*template version:4.1.1
*/
#ifndef SUPPORT_PB
#import "ToygerData.h"
@interface APBBisUploadGwRequest : NSObject
@property(nonatomic, strong) NSString *bisToken;
@property(nonatomic, strong) ToygerUploadContent *content;
@property(nonatomic, strong) NSString *contentSig;
@property(nonatomic, strong) NSString *behavLog;
@property(nonatomic, strong) NSString *behavLogSig;
@end
#else
#ifdef __cplusplus
extern "C"{
#endif
#import <APProtocolBuffers/ProtocolBuffers.h>
#ifdef __cplusplus
}
#endif
@interface APBBisUploadGwRequest : APDPBGeneratedMessage
@property (readonly) BOOL hasBisToken;
@property (readonly) BOOL hasContent;
@property (readonly) BOOL hasContentSig;
@property (readonly) BOOL hasBehavLog;
@property (readonly) BOOL hasBehavLogSig;
@property (nonatomic,strong) NSString* bisToken ;
@property (nonatomic,strong) NSData* content ;
@property (nonatomic,strong) NSData* contentSig ;
@property (nonatomic,strong) NSData* behavLog ;
@property (nonatomic,strong) NSData* behavLogSig ;
@end
#endif
@@ -0,0 +1,18 @@
//
// APBSystem.h
// BioAuthService
//
// Created by yukun.tyk on 12/14/15.
// Copyright © 2015 DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface APBSystem : NSObject
+ (double)systemVer;
+ (NSString *)modelString;
@end
@@ -0,0 +1,42 @@
//
// APBioBisConfigManager.h
// APFaceDetectBiz
//
// Created by 晗羽 on 1/7/16.
// Copyright © 2016 DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "APBToygerRemoteConfig.h"
@interface APBToygerBioBisConfigManager : NSObject
/**
* 初始化biscfg
*
* @param biscfg pb/json格式
*
* @return 生成一个配置对象
*/
- (instancetype)initWithBisConfig:(NSString *)biscfg;
@property(nonatomic, copy) NSString *protocol;
/**
* bisToken
*
* @return 服务端下放的bistoken,每次人脸识别服务端的ID
*/
- (NSString * )bisToken;
- (NSString * )iosvoicecfg;
- (APBToygerSoluCfg *)solucfg;
- (APBToygerRemoteConfig *)bisConfig;
- (int) sampleMode;
- (NSString *) apBioSecPublicKey;
+ (NSDictionary *)getDictfrom:(NSString *) jsonStr;
@end
@@ -0,0 +1,261 @@
//
// APFRemoteConfig.h
// AppArch
//
// Created by yukun.tyk on 8/29/16.
// Copyright © 2016 DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "ToygerAlgorithmConfig.h"
@class APBToygerSceneEnv, APBToygerVideo, APFRemoteConfig, APBToygerCollect, APBDragonflyLivenessConfig,APBGeminiLivenessConfig;
@class APBToygerNavigatePage, APBToygerAlgorithm, APBToygerTips, APBToygerUploadConfig;
@interface APBToygerSoluCfg: NSObject
@property(nonatomic, copy) NSArray *order;
@property(nonatomic, strong) APBToygerNavigatePage *navi;
@end
/**
* 协议配置
*/
@interface APBToygerRemoteConfig : NSObject
@property(nonatomic, strong)APBToygerSceneEnv *sceneEnv;
@property(nonatomic, strong)APBToygerNavigatePage *navi;
@property(nonatomic, copy) NSDictionary *suitable;
@property(nonatomic, strong)APBToygerCollect *coll;
@property(nonatomic, strong) APBToygerUploadConfig *upload;
@property(nonatomic, strong) ToygerAlgorithmConfig *algorithm;
@property(nonatomic, copy) NSArray *scanAlgorithm;
@property(nonatomic, strong)APBToygerTips * faceTips;
@property(nonatomic, copy) NSNumber *env;
@property(nonatomic, assign)NSInteger ui;
@property(nonatomic, copy)NSString *sdkVersion;
@property(nonatomic, strong)APBToygerVideo * video;
@property(nonatomic, copy)NSString *verifyMode;
@property(nonatomic, copy)NSString *token;
@property(nonatomic, copy) NSDictionary *controlConfig;
@property(nonatomic, copy) NSArray *sdkActionList;
@property(nonatomic, copy) NSDictionary *simpleFlags;
+(APBToygerRemoteConfig *)defaultConfig;
+ (void)loadFromJSON:(NSString *)json toObject:(NSObject*) obj;
//是否包含ocrTask
- (BOOL)containOCRTask;
@end
/**
* 场景配置
*/
@interface APBToygerSceneEnv : NSObject
@property(nonatomic, copy)NSString *sceneCode;
@property(nonatomic, copy)NSString *sceneType;
@property(nonatomic, copy)NSString *sysTime;
+(APBToygerSceneEnv *)defaultConfig;
@end
/**
* 引导页配置
*/
@interface APBToygerNavigatePage : NSObject
@property(nonatomic, assign)BOOL enable;
@property(nonatomic, copy)NSString *url;
@property(nonatomic, assign)BOOL needRareCharUi;
+ (APBToygerNavigatePage *)defaultConfig;
@end
/**
* ocr回填确认页相关
*/
@interface APBToygerFillBack : NSObject
@property(nonatomic, assign)BOOL enable;
@property(nonatomic, assign)BOOL editable;
+ (APBToygerFillBack *)defaultConfig;
@end
/**
* 采集场景配置
*/
@interface APBToygerCollect : NSObject
@property(nonatomic, assign)NSInteger retry;
@property(nonatomic, assign)CGFloat minangle;
@property(nonatomic, assign)CGFloat maxangle;
@property(nonatomic, assign)CGFloat near;
@property(nonatomic, assign)CGFloat far;
@property(nonatomic, assign)NSInteger minlight;
@property(nonatomic, assign)NSInteger time;
@property(nonatomic, assign)NSInteger light;
@property(nonatomic, assign)NSInteger imageIndex;
@property(nonatomic, assign)BOOL uploadLivePic;
@property(nonatomic, assign)NSInteger uploadMonitorPic;
@property(nonatomic, assign)BOOL progressbar;
@property(nonatomic, assign)BOOL uploadBestPic;
@property(nonatomic, assign)BOOL uploadPoseOkPic;
@property(nonatomic, assign)BOOL uploadBigPic;
@property(nonatomic, assign)BOOL authorization;
@property(nonatomic, assign)NSInteger mineDscore;
@property(nonatomic, assign)NSInteger mineVideo;
@property(nonatomic, strong)NSArray<NSString *> *actionMode;
@property(nonatomic, assign) NSInteger pageNo;
@property(nonatomic, copy) NSString *docType;
@property(nonatomic, assign) NSInteger retryLimit;
@property(nonatomic, assign) NSInteger scanTimeout;
@property(nonatomic, copy) NSString *uiType;
@property(nonatomic, copy) NSString *docInputMode;
@property(nonatomic, assign) CGFloat docUIRatio;
@property(nonatomic, copy) NSString *multiLangVer;
@property(nonatomic, strong) NSMutableDictionary *chameleon;
@property(nonatomic, assign) NSInteger captureFrameLimit;
+ (APBToygerCollect *)defaulConfig;
@end
/**
* 视频设置
*/
@interface APBToygerVideo : NSObject
@property(nonatomic, assign)NSInteger width;
@property(nonatomic, assign)NSInteger height;
@property(nonatomic, assign)NSInteger duration;
@property(nonatomic, assign)NSInteger bitrate;
@property(nonatomic, assign)NSInteger fps;
@property(nonatomic, assign)BOOL enable; ;
+(APBToygerVideo *)defaultConfig;
@end
@interface APBToygerAlertConfig : NSObject
@property(nonatomic, copy)NSString * title;
@property(nonatomic, copy)NSString * message;
@property(nonatomic, copy)NSString * leftButtonText;
@property(nonatomic, copy)NSString * rightButtonText;
@property(nonatomic, assign)NSInteger returnCode;
@end
@interface APBToygerTips : NSObject
//required
@property(nonatomic, strong)APBToygerAlertConfig * timeoutAlert;
@property(nonatomic, strong)APBToygerAlertConfig * failAlert;
@property(nonatomic, strong)APBToygerAlertConfig * limitAlert;
@property(nonatomic, strong)APBToygerAlertConfig * networkErrorAlert;
@property(nonatomic, strong)APBToygerAlertConfig * interruptAlert;
@property (nonatomic, copy) NSString *sceneText;
@property (nonatomic, copy) NSString *bottomText;
@property (nonatomic, copy) NSString *topText_rectwidth;
@property (nonatomic, copy) NSString *topText_noface;
@property (nonatomic, copy) NSString *topText_face_too_more;
@property (nonatomic, copy) NSString *topText_blur;
@property (nonatomic, copy) NSString *topText_light;
@property (nonatomic, copy) NSString *topText_pitch;
@property (nonatomic, copy) NSString *topText_yaw;
@property (nonatomic, copy) NSString *topText_quality;
@property (nonatomic, copy) NSString *topText_integrity;
@property (nonatomic, copy) NSString *topText_max_rectwidth;
@property (nonatomic, copy) NSString *topText_stay;
@property (nonatomic, copy) NSString *topText_openness;
@property (nonatomic, copy) NSString *topText_blink;
@property (nonatomic, copy) NSString *topText_left_yaw;
@property (nonatomic, copy) NSString *topText_right_yaw;
@property (nonatomic, copy) NSString *topText_mouth_open;
@property (nonatomic, copy) NSString *topText_target_too_far;
@property (nonatomic, copy) NSString *topText_target_too_close;
@property (nonatomic, copy) NSString *topText_calibrate_too_far;
@property (nonatomic, copy) NSString *topText_calibrate_too_close;
@property (nonatomic, copy) NSString *topText_nearFar_collect;
@property (nonatomic, copy) NSString *topText_face_not_in_postion;
@property (nonatomic, copy) NSString *brandTip;
@property (nonatomic, copy) NSString *stopScanTip;
@property (nonatomic, copy) NSString *garfield_guideTitle;
@property (nonatomic, copy) NSString *garfield_guideMsg;
//optional
@property(nonatomic, strong)APBToygerAlertConfig * unsurpportAlert;
@property(nonatomic, strong)APBToygerAlertConfig * systemVersionErrorAlert;
@property(nonatomic, strong)APBToygerAlertConfig * systemErrorAlert;
@property(nonatomic, strong)APBToygerAlertConfig * cameraNoPermissionAlert;
@property(nonatomic, strong)APBToygerAlertConfig * exitAlert;
@property(nonatomic, strong)APBToygerAlertConfig * exitAlertForPermission;
@property(nonatomic, strong)APBToygerAlertConfig * authorizationAlert;
@property(nonatomic, strong)APBToygerAlertConfig * failNoRetryAlert;
@end
@interface APBToygerBaseConfig: NSObject
@property(nonatomic, copy) NSDictionary *rawData;
- (instancetype)initWithDictionary:(NSDictionary *)dictionary;
- (void)parseProperty;
- (NSString *)stringValueForKey:(NSString *)key;
- (NSNumber *)numberValueForKey:(NSString *)key;
- (NSArray<NSNumber *> *)numberArrayForKey:(NSString *)key;
@end
@interface APBToygerUploadConfig: APBToygerBaseConfig
- (instancetype)initWithDictionary:(NSDictionary *)dictionary;
@property(nonatomic, copy) NSDictionary *rawData;
@property(nonatomic, strong) NSNumber *desiredWidth;
@property(nonatomic, strong) NSNumber *minquality;
@property(nonatomic, strong) NSNumber *upload_compress_rate;
@property(nonatomic, strong) NSNumber *log_classifier;
@property(nonatomic, strong) NSNumber *enableSmoothTransition;
@property(nonatomic, strong) NSNumber *photinusType;
@property(nonatomic, assign) BOOL photinusVideo;
@property(nonatomic, strong) NSNumber *chameleonFrameEnable;
@property(nonatomic, strong) NSNumber *chameleonUploadCompressRate;
@property(nonatomic, copy) NSString *chameleonFileNamePrefix;
@property(nonatomic, copy) NSString *bucket;
@property(nonatomic, copy) NSString *securityToken;
@property(nonatomic, copy) NSString *endpoint;
@property(nonatomic, copy) NSString *accessKeyId;
@property(nonatomic, copy) NSString *accessKeySecret;
@property(nonatomic, copy) NSString *fileNamePrefix;
@property(nonatomic, copy) NSString *mode;
@property(nonatomic, copy) NSString *collectFileNamePrefix;
@property(nonatomic, strong) NSArray<NSString *> *collection;
@property(nonatomic, strong) NSArray *captureConfig;
@property(nonatomic, strong) NSDictionary *captureConfigItem;
@property(nonatomic, strong) NSDictionary *blobConfig;
@end
@@ -0,0 +1,220 @@
//
// APBUtils.h
// BioAuthEngine
//
// Created by richard on 27/08/2017.
// Copyright © 2017 DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#include <sys/param.h>
#include <sys/mount.h>
#define SCREEN_WIDTH [[UIScreen mainScreen]bounds].size.width //屏幕宽度
#define SCREEN_HEIGHT [[UIScreen mainScreen]bounds].size.height //屏幕高度
//获取document目录
#define DOCUMENT_PATH [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]
//资源文件目录
#define ASSET_PATH [DOCUMENT_PATH stringByAppendingPathComponent:@"BioAuth"]
//返回不为nil的string
#define NONE_NIL_STRING(str) (str ? str : @"")
#define SafeRelease(obj) if(obj){obj=nil;}
//主线程同步操作
#define SYNC_MAINTHREAD_BEGIN [APBUtils APBMainThread:^{
#define SYNC_MAINTHREAD_END }];
//pipeInfo线程安全操作
static NSString *const kAPBPipeInfoMutexToken = @"";
static id __apb_thread_safe_object_for_key(NSMutableDictionary *pipeInfo, NSString *key){
id ret;
@synchronized(kAPBPipeInfoMutexToken){
if ([pipeInfo isKindOfClass:[NSMutableDictionary class]] && [pipeInfo objectForKey: key]) {
ret = [pipeInfo objectForKey:key];
}
}
return ret;
}
//从pipeInfo中获取Object,线程安全
#define THREAD_SAFE_OBJECT_FOR_KEY(pipeInfo, key) __apb_thread_safe_object_for_key(pipeInfo, key)
//向pipeInfo中添加或修改Object,线程安全
#define THREAD_SAFE_SET_OBJECT_FOR_KEY(pipeInfo, key, value) \
@synchronized(kAPBPipeInfoMutexToken){ \
if ([pipeInfo isKindOfClass:[NSMutableDictionary class]] && key && value) { \
[pipeInfo setObject:value forKey:key];}}
//删除PipeInfo中某个Object,线程安全
#define THREAD_SAFE_REMOVE_OBJECT_FOR_KEY(pipeInfo, key) \
@synchronized(kAPBPipeInfoMutexToken){ \
if ([pipeInfo isKindOfClass:[NSMutableDictionary class]] && [pipeInfo objectForKey: key]) { \
[pipeInfo removeObjectForKey: key];}}
//将dict中对应value增加1
#define INCREASE_BY_ONE(pipeInfo, key){ \
NSInteger num = [[pipeInfo objectForKey:key]integerValue]+1; \
THREAD_SAFE_SET_OBJECT_FOR_KEY(pipeInfo, key, [NSNumber numberWithInteger:num]);}
//将dict中对应value减1
#define DECREASE_BY_ONE(pipeInfo, key){ \
NSInteger num = [[pipeInfo objectForKey:key]integerValue]-1; \
THREAD_SAFE_SET_OBJECT_FOR_KEY(pipeInfo, key, [NSNumber numberWithInteger:--num]);}
#define LOCK(locker, ...) dispatch_semaphore_wait(locker, DISPATCH_TIME_FOREVER); \
__VA_ARGS__; \
dispatch_semaphore_signal(locker);
@interface DTFAlertTextModel : NSObject
@property(nonatomic, copy) NSString *title;
@property(nonatomic, strong) UIColor *titleColor;
@property(nonatomic, copy) NSString *msg;
@property(nonatomic, strong) UIColor *msgColor;
@property(nonatomic, copy) NSString *confirm;
@property(nonatomic, strong) UIColor *confirmColor;
@property(nonatomic, copy) NSString *cancel;
@property(nonatomic, strong) NSString *cancelColor;
@end
NS_ASSUME_NONNULL_BEGIN
@interface APBUtils : NSObject
+ (NSString *)MD5WithData:(NSData *)data;
+ (NSString *)randomString:(NSInteger)len;
+ (BOOL)isWifi;
+ (UIColor*)getColorFromNSString:(NSString*) cString;
+ (NSArray<NSNumber *> *)getRGBFromHexColor:(NSString *)cString;
+ (NSString *)getColorStrFromUIColor:(UIColor *)color;
/**
* 主线程同步操作,请调用宏版本
*/
+ (void)APBMainThread:(dispatch_block_t)block;
+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString;
+ (NSString*)convertToJSONString:(NSDictionary *)infoDict;
+ (NSString *)currentLanguage;
+ (NSString *)localizedStringForKey:(NSString *)key inBundle:(NSString *)bundle;
+ (NSString *)localizedStringForKey:(NSString *)key;
+ (NSString *)localizedStringForKeyNew:(NSString *)key;
+ (long long)getTotalDiskSize;
+ (long long)getAvailableDiskSize;
+ (NSString*)deviceVersion;
+ (NSString *)osVersion;
+ (NSString *)appName;
+ (NSString *)appVersion;
+ (NSURL *)returnContentDir;
+ (NSURL *)cacheFileDir;
+ (CGRect)setX:(CGFloat)x forFrame:(CGRect)frame;
+ (CGRect)setY:(CGFloat)y forFrame:(CGRect)frame;
+ (CGRect)setW:(CGFloat)w forFrame:(CGRect)frame;
+ (CGRect)setH:(CGFloat)h forFrame:(CGRect)frame;
+ (UIImage *)flipImage:(UIImage *)image;
+ (NSArray<NSString *> *)supportedActionLivenessArray;
+ (void)removePairInDictionary:(NSMutableDictionary *)dictionary withCheck:(BOOL(^)(NSString *, NSObject*))checker;
+ (CMVideoDimensions)maxResolution:(AVCaptureDevicePosition) position;
+ (NSDictionary *)evidenceVideoCompressionProperties;
/// 创建支持修改颜色的 alertVc
+ (UIAlertController *)buildAlertWithAlertModel:(DTFAlertTextModel *)model
confirmHandler:(void (^ __nullable)(UIAlertAction * _Nonnull action))confirmHandler
cancelHandler:(void (^ __nullable)(UIAlertAction * _Nonnull action))cancelHandler;
+ (void)alertWithAlertModel:(DTFAlertTextModel *)model
confirmHandler:(void (^ __nullable)(UIAlertAction * _Nonnull action))confirmHandler
cancelHandler:(void (^ __nullable)(UIAlertAction * _Nonnull action))cancelHandler
presentHandler:(void (^ __nullable)(UIAlertController * _Nonnull alertController))presentHandler;
+ (NSString *)retSubMessageForKey:(NSString *)key;
+ (NSString *)codeForKey:(NSString *)key;
+ (NSString *)getAppDisplayName;
+ (void)generateVideoFileWithFileName:(NSString *)fileName
imageArray:(NSArray *)imageArr
filePath:(NSURL *)filePath
outputSize:(CGSize)outputSize
compressionProperties:(NSDictionary *)compressionProperties
handler:(void (^)(NSURL *))handler;
+ (void)genVideoWithFileURL:(NSURL *)url
imageArray:(NSArray *)imageArray
size:(CGSize)size
compressionProperties:(NSDictionary *)compressionProperties
handler:(void (^)(void))handler;
+ (void)genVideoWithFileURL:(NSURL *)url
pixcelArray:(NSArray *)pixcelArray
size:(CGSize)size
compressionProperties:(NSDictionary *)compressionProperties
handler:(void (^)(void))handler;
+ (void)createWorkingDirectoryWithPath:(NSURL *)filePath error:(NSError **)error;
+ (CVPixelBufferRef)pixelBufferFromCGImage:(UIImage *)image size:(CGSize)size;
+ (NSError *)errorWithErrorDomian:(NSString *)errorDomian extInfo:(NSDictionary *)extInfo errMsgWithFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(3,4);
/// 是否是合法的颜色字符串
/// - Parameter hexString: 16进制数据6位颜色数据,以#号开头
+ (BOOL)validColorHex:(nullable NSString *)hexString;
+ (NSString *)getFaceGuardToken:(NSString *)certifyID;
/// 计算文字宽度
+ (CGFloat)widthForText:(NSString *)text
withFont:(UIFont *)font
containerHeight:(CGFloat)containerHeight;
/// 计算文字高度
+ (CGFloat)HeightForText:(NSString *)text
withFont:(UIFont *)font
containerWidth:(CGFloat)containerWidth;
/// 是否是中文环境(简体,繁体)
+ (BOOL)isChineseLanguage;
/// 根据语言环境 调整字体大小
+ (CGFloat)fixFontByLanguage:(CGFloat)fontSize;
+ (NSString *)getFaceGuardVersion;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,199 @@
//
// CameraService.h
// DTFCameraService
//
// Created by Tommy Li on 2017/8/23.
// Copyright © 2017年 EyeVerify. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import "DTFChameleonUtilsModel.h"
#if defined(__cplusplus)
#define DTF_EXPORT extern "C"
#else
#define DTF_EXPORT extern
#endif
/// NSString keys that are used to specify configuration in DTFCameraService initialization.
typedef NSString* const DTFCameraInitKey;
/// NSString keys that are used to change configurations of DTFCameraService;
typedef NSString* const DTFCameraConfigKey;
/**
Funtion type signature that is used for -takePicture: callbacks after a still image is captured.
@param imageDataSampleBuffer The sample buffer of the still image. It is nil if any error occurred.
@param error NSError that indicates any error during the capture process. It is nil if no error occurred.
*/
typedef void(^DTFCameraTakePhotoCompletion)(CMSampleBufferRef imageDataSampleBuffer, NSError *error);
/// Initialization Key for specifying device position during initialization. Associated value must be a AVCaptureDevicePosition.
DTF_EXPORT DTFCameraInitKey DTFCameraInitKeyCaptureDevicePosition;
/// Initialization Key for specifying quality preset during initialization. Associated value must be a AVCaptureSessionPreset.
DTF_EXPORT DTFCameraInitKey DTFCameraInitKeySessionPreset;
/// Initialization Key for specifying video orientation during initialization. Associated value must be a AVCaptureVideoOrientation.
DTF_EXPORT DTFCameraInitKey DTFCameraInitKeyVideoOutputOrientation;
/// Initialization Key for specifying video mode during initialization. Associated value must be a DTFCameraMode
DTF_EXPORT DTFCameraInitKey DTFCameraInitKeyMode;
/**
Configuration Key for specifying focus point of interest. Associated value must be a CGPoint (converted to an NSString).
Note that the associated value will be directly applied to camera without transformations, so regarding valid inputs please review focusPointOfInterest of AVCaptureDevice;
*/
DTF_EXPORT DTFCameraConfigKey DTFCameraConfigKeyFocusPointOfInterest;
/// Error domain name for DTFCameraService
DTF_EXPORT NSString *const kDTFCameraErrorDomain;
/// Error codes used by DTFCameraService to indicate the type of errors occured.
typedef NS_ENUM(NSInteger, DTFCameraErrorCode) {
/// Error code indicates that an invalid preset string is given during initialization.
DTFCameraUnsupportedPreset,
/// Error code indicates that no devices are available with the specified configuration.
DTFCameraNotAvailable,
/// Error code indicates that the capture session has failed.
DTFCameraSessionFailure,
};
/// Modes that DTFCameraService supports
typedef NS_ENUM(NSInteger, DTFCameraMode) {
/// Video
DTFCameraModeVideo,
/// Still Image
DTFCameraModeStillImage
};
/**
A structure that stores camera configuration for associated camera service
*/
typedef struct camera_configuration_t{
/// Focus Point of Interest
CGPoint focusPointOfInterest;
}camera_configuration;
/**
Delegate to comply in order to receive camera output.
*/
@protocol DTFCameraServiceDelegate <NSObject>
@optional
/**
This function will be called by DTFCameraService to pass capture device output to the delegate.
Implement this optional function and call -setDelegate: if you have set DTFCameraModeVideo and wish to receive output.
@param captureOutput Output source that triggered this delegation.
@param sampleBuffer A CMSampleBuffer output from said output source.
@param connection The AVCaptureConnection related to the output.
*/
- (void)cameraControllerCaptureOutput:(AVCaptureOutput *)captureOutput
didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
fromConnection:(AVCaptureConnection *)connection;
@end
/**
Main interface of DTFCameraService.
*/
@interface DTFCameraService : NSObject <AVCaptureVideoDataOutputSampleBufferDelegate>
/// Property that allows inspections the current configuration of DTFCameraService
@property(nonatomic, assign, readonly)camera_configuration configuration;
/// Preview layer of the capture session. Add this layer as a sublayer to a view to inspect the device output.
@property(nonatomic, strong) AVCaptureVideoPreviewLayer *previewLayer;
/// Get current video output size
@property (nonatomic, assign, readonly) CGSize videoOutputSize;
@property (nonatomic, assign) BOOL isCameraStop;
/**
Do not use default NSObject initializer. Use initWithConfig:error: instead.
*/
- (instancetype)init NS_UNAVAILABLE;
/**
Initialize the camera service.
If DTFCameraInitKeyCaptureDevicePosition is not specified in config, AVCaptureDevicePositionFront will be used as camera position.
If DTFCameraInitKeySessionPreset is not specified in config, AVCaptureSessionPresetHigh will be used as quality preset.
If DTFCameraInitKeyVideoOutputOrientation is not specified in config, output orientation will not be set. Video will be AVCaptureVideoOrientationLandscapeRight, and StillImage will be AVCaptureVideoOrientationPortrait.
If DTFCameraInitKeyMode is not specified in config, DTFCameraModeVideo will be used as video output.
@param config An NSDictionary that contains configuration keys and associated values to specify initialization requirements.
@param errPtr An optional error receiver for initialization failures. Use nil if error information is not needed.
@return If initialization is successful, a instance of DTFCameraService is returned. Anything failture during initialization would cause this initialzer to return nil.
*/
- (instancetype)initWithConfig:(NSDictionary *)config error:(NSError **)errPtr;
/**
Set delegate that DTFCameraService can service
@param delegate An instance of class that implements DTFCameraServiceDelegate
*/
- (void)setDelegate:(id<DTFCameraServiceDelegate>) delegate;
/**
Change one configuration value in camera_configuration.
@param key Configuration key
@param value Properly formatted in-range value as a string
@return YES if configuration was successfully changed. NO otherwise.
*/
- (BOOL)changeConfiguration:(NSString *)key
desiredValue:(NSString *)value;
- (BOOL)setWhiteBalanceMode:(AVCaptureWhiteBalanceMode)mode;
- (BOOL)setExposureMode:(AVCaptureExposureMode)mode;
- (void)setWhiteBalanceParam:(DTFChameleonUtilsModel *)cameraParam completionHandler:(void (^ _Nullable)(NSError *error))handler;
- (void)resetVideoZoom;
/**
Start the capture session.
The capture session needs to be started manually. This is a synchronous operation.
*/
- (void)startCameraCompletion:(void (^)(void))completionBlock;
/**
Stop the capture session.
This is a synchronous operation.
*/
- (void)stopCamera;
/**
Capture a still image asynchronously.
@param completion Completion delegate when the capture process finishes. For required parameters see DTFCameraTakePhotoCompletion.
*/
- (void)takePicture:(DTFCameraTakePhotoCompletion)completion;
//切换闪光灯状态
- (void)flashOff;
- (void)flashOn;
@end
@@ -0,0 +1,31 @@
//
// DTFAuthorityUtils.h
// DTFUtility
//
// Created by 程佳兵(威琦) on 2025/5/21.
// Copyright © 2025 com.alipay.iphoneclient.zoloz. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import <Photos/PHPhotoLibrary.h>
NS_ASSUME_NONNULL_BEGIN
@interface DTFAuthorityUtils : NSObject
/// 请求相册权限
+ (void)checkAlbumAuthorityGranted:(void (^)(void))grantedBlock notPermission:(void (^)(void))notPermissionBlock;
///获取当前相册权限
+ (PHAuthorizationStatus)getCurrenAlbmAuthorityStatus;
///获取当前拍摄权限
+ (AVAuthorizationStatus)getCurrentVideoMediaTypeoStatus;
/// 请求 拍摄权限
+ (void)requestAccessForVideoMediaType:(void (^)(void))grantedBlock notPermission:(void (^)(void))notPermissionBlock;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,41 @@
//
// DTFBaseAuthFacade.h
// DTFUtility
//
// Created by mengbingchuan on 2024/1/19.
// Copyright © 2024 com.alipay.iphoneclient.zoloz. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "ZIMResponse.h"
@interface DTFBaseAuthFacade : NSObject
+ (void)initSDK;
/* IPV6的初始化接口 只有你的网络环境强制要求是IPV6的时候,才调用initIPv6。
*/
+ (void)initIPv6;
+ (NSString *)getVersion;
+ (NSDictionary *)getMetaInfo;
+ (void)preloadWithCompletion:(void (^)(BOOL))completion;
+ (void)preloadWithExtParams:(NSDictionary *)params
onCompletion:(void (^)(BOOL))completion;
+ (void)setCustomUI:(nonnull NSString *)configuration
type:(nonnull NSString *)type
completion:(void(^)(BOOL success, NSError *error))completion;
+ (void)setCustomLanguage:(nonnull NSString *)configuration
type:(nonnull NSString *)type
completion:(void(^)(BOOL success, NSError *error))completion;
+ (void)verifyWith:(NSString *)certifyId
extParams:(NSDictionary *)params
onCompletion:(void (^)(ZIMResponse *response))callback;
@end
@@ -0,0 +1,26 @@
//
// DTFBeanService.h
// DTFUtility
//
// Created by mengbingchuan on 2023/6/8.
// Copyright © 2023 com.alipay.iphoneclient.zoloz. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DTFFaceIdentityProtocol.h"
#import "DTFNFCIdentityProtocol.h"
NS_ASSUME_NONNULL_BEGIN
@interface DTFBeanService : NSObject
@property(nonatomic, strong) id<DTFFaceIdentityProtocol> faceIdentity;
@property(nonatomic, strong) id<DTFNFCIdentityProtocol> nfcIdentity;
+ (DTFBeanService *)sharedInstance;
- (void)setup;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,21 @@
//
// DTFChameleonUtilsModel.h
// DTFUtility
//
// Created by 汪澌哲 on 2023/10/21.
// Copyright © 2023 com.alipay.iphoneclient.zoloz. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface DTFChameleonUtilsModel : NSObject
@property (nonatomic, assign) float red;
@property (nonatomic, assign) float green;
@property (nonatomic, assign) float blue;
@property (nonatomic, assign) float videoZoom;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,68 @@
//
// DTFConfiguration.h
// DTFSensorServices
//
// Created by sanyuan.he on 2020/2/25.
// Copyright © 2020 DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIDevice.h>
#import <UIKit/UIKit.h>
#import "ZimModelDownloader.h"
#import "DTFSDKConfiguration.h"
#import "DTFUICustomConfig.h"
#import "DTFLanguageCustomConfig.h"
NS_ASSUME_NONNULL_BEGIN
#define ZIM_PLATFORM_SETTING_INFO_ALIYUN @"aliyun"
#define ZIM_PLATFORM_SETTING_INFO_ALITECH @"alitech"
@interface DTFConfiguration : NSObject
@property(nonatomic, strong, nullable) NSString *forceDirection;
@property(nonatomic, strong ,nullable) NSData *imageContent;
@property(nonatomic, strong ,nullable) NSString *platformInfo;
@property(nonatomic, strong ,nullable) NSURL *photinusPath;
@property(nonatomic, strong ,nullable) NSURL *photinusInfo;
@property(nonatomic, strong, nullable) UIColor *buttonColor;
@property(nonatomic, strong, nullable) UIColor *clickedColor;
@property(nonatomic, strong, nullable) NSString *ocrInfo;
@property(nonatomic, strong, nullable) NSData *faceData; // add for OCR
@property(nonatomic, strong, nullable) NSData *countryData; // add for OCR
/// 埋点的额外信息
@property(nonatomic, copy, nullable) NSDictionary *flowCodeInfo;
@property(nonatomic, strong, nullable) NSString *imageCount;
@property(nonatomic, strong, nullable) UIColor *themeColor;
@property(nonatomic, strong, nullable) UIColor *circleColor;
@property(nonatomic, strong, nullable) NSString *languageURL;
@property(nonatomic, strong, nullable) NSString *languageDocPath;
@property(nonatomic, strong, nullable) NSString *languageFacePath;
@property(nonatomic, strong, nullable) NSString *languageGuidePath;
@property(nonatomic, strong, nullable) NSString *languageFromApp; //宿主App设置的语言
@property(nonatomic, strong, nullable) NSString *logUploadServerURL;
@property(nonatomic, strong, nullable) NSString *facadeBundlePath;
@property(nonatomic, assign) BOOL replayPermission;
@property(nonatomic, assign) BOOL isReadLocal;
@property(nonatomic, strong, nullable) DTFUICustomConfig *uiCustomConfig;
@property(nonatomic, strong, nullable) DTFLanguageCustomConfig *languageCustomConfig;
@property(nonatomic, assign) BOOL isShowTipView;
@property(nonatomic, assign) UIDeviceOrientation orientation;
@property(nonatomic, assign) BOOL returnContent;
@property(nonatomic, strong, nullable) NSMutableArray *EKYCImageArray;
@property(nonatomic, strong, nullable) NSMutableArray *faceImageArray;
@property(nonatomic, assign) BOOL simpleFlags; //安全SDK的Flags
@property(nonatomic, assign) BOOL tempddsFlags;//是否需要做安全加密
@property(nonatomic, assign) BOOL iPv6Flags;
@property(nonatomic, assign) BOOL needPermissionToast;//是否需要弹出权限toast
@property(nonatomic, assign) double permissionToastDuration;//弹出权限toast时间
@property(nonatomic, copy, nullable) NSDictionary *responseExtInfo;
@property(nonatomic, strong) DTFSDKConfiguration *remoteConfig;
+ (DTFConfiguration *)sharedInstance;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,56 @@
//
// DTFConstant.h
// DTFIdentityManager
//
// Created by mengbingchuan on 2022/11/24.
// Copyright © 2022 DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
//ext params keys
extern NSString *const kZIMInitOperationTypeKey; //init operation type
extern NSString *const kZIMValidateOperationTypeKey; //validate operation type
extern NSString *const kZIMGatewayURLKey; //rpc gateway url
extern NSString *const kZIMRpcHeaderKey; //ext rpc header
extern NSString *const kZIMCurrentViewControllerKey; // current view controller
extern NSString *const kZIMViewProviderKey;
extern NSString *const kZIMFastUploadKey;
extern NSString *const kZIMBisProtocolKey;
extern NSString *const kZIMResponseKey;
extern NSString *const kZIMValidateResponseKey;
extern NSString *const kZIMCertNoKey;
extern NSString *const kZIMCertNameKey;
extern NSString *const kZIMRareCharCertNoKey;
extern NSString *const kZIMRareCharCertNameKey;
extern NSString *const ZIM_EXT_PARAMS_KEY_OCR_BOTTOM_BUTTON_COLOR; //设置颜色的值,值内容为:#FFFFFF 格式,必须为6位
extern NSString *const ZIM_EXT_PARAMS_KEY_OCR_BOTTOM_BUTTON_CLICKED_COLOR; //设置按钮点击颜色的值,值内容为:#FFFFFF 格式 ,必须为6位
extern NSString *const ZIM_EXT_PARAMS_KEY_USE_VIDEO; //返回本地视频的key
extern NSString *const ZIM_EXT_PARAMS_KEY_OCR_FACE_CIRCLE_COLOR;
extern NSString *const ZIM_EXT_PARAMS_KEY_OCR_FACE_THEME_COLOR;
extern NSString *const ZIM_EXT_PARAMS_KEY_NFC_THEME_COLOR;
extern NSString *const ZIM_EXT_PARAMS_KEY_MODEL_FILE_PATH; //设置文件路径
extern NSString *const ZIM_EXT_PARAMS_KEY_ACTIVITYINDICATOR_COLOR;
extern NSString *const ZIM_EXT_PARAMS_KEY_PRELOAD_MODEL_URL;
extern NSString *const ZIM_EXT_PARAMS_KEY_TIMEOUT_FOR_INIT;
extern NSString *const ZIM_EXT_PARAMS_KEY_TIMEOUT_FOR_VERIFY;
extern NSString *const ZIM_EXT_PARAMS_KEY_RETURN_OCR_IMAGE;
extern NSString *const ZIM_EXT_PARAMS_KEY_LANGUAGE;
extern NSString *const ZIM_EXT_PARAMS_KEY_NEED_PERMISSION_TOAST;
extern NSString *const ZIM_EXT_PARAMS_KEY_NEED_FACE_NOTICE;
extern NSString *const ZIM_EXT_PARAMS_KEY_PERMISSION_TOAST_DURATION;
extern NSString *const kDTFOSSErrorDomain;
extern NSString *const kDTFEvidenceVideoName;
extern NSString *const kDTFPhotinusDataName;
extern NSString *const kDTFNOLivenessName;
extern NSString *const kDTFBlinkLivenessName;
extern NSString *const kDTFLeftYawLivenessName;
extern NSString *const kDTFRightYawLivenessName;
extern NSString *const kDTFLipMovementLivenessName;
extern NSString *const kDTFPhotinusLivenessName;
extern NSString *const kDTFNearFarLivenessName;
extern NSString *const kDTFBlinkLivenessName;
extern NSString *const kDTFEquipmentLivenessName;
@@ -0,0 +1,156 @@
//
// DTFErrorCodeConfig.h
// DTFUtility
//
// Created by 汪澌哲 on 2023/2/1.
// Copyright © 2023 com.DTF.iphoneclient.zoloz. All rights reserved.
//
#ifndef DTFErrorCodeConfig_h
#define DTFErrorCodeConfig_h
#endif /* DTFErrorCodeConfig_h */
static NSString *const kDTFSystemFailedErrorCode = @"Z1000";
static NSString *const kDTFSystemFailedErrorMessage = @"";
static NSString *const kBioAuthEngineSystemFailedErrorMessage = @"抱歉,系统出错了,请您稍后再试(Z1000)";
static NSString *const kBioAuthEngineSystemFailedErrorReason = @"协议base64解析失败";
static NSString *const kDTFDenyCameraPermissionErrorCode = @"Z1001";
static NSString *const kDTFDenyCameraPermissionErrorMessage = @"";
static NSString *const kAPBDenyCameraPermissionErrorMessage = @"拒绝开通授权";
static NSString *const kDTFUnableStartCameraErrorCode = @"Z1002";
static NSString *const kDTFUnableStartCameraErrorMessage = @"无法启动相机(Z1002)";
static NSString *const kDTFUnableStartCameraErrorReason = @"无法启动相机";
static NSString *const kDTFOldVersionErrorCode = @"Z1004";
static NSString *const kDTFOldVersionErrorMessage = @"iOS系统版本过低(Z1004)";
static NSString *const kDTFOldVersionErrorReason = @"iOS系统版本过低";
static NSString *const kDTFOperationTimeoutErrorCode = @"Z1005";
static NSString *const kDTFOperationTimeoutErrorMessage = @"操作超时(Z1005)";
static NSString *const kDTFOperationFailedErrorCode = @"Z1006";
static NSString *const kDTFOperationFailedErrorMessage = @"本次操作失败(Z1006)";
static NSString *const kDTFLocalAuthenticationFailedErrorCode = @"Z1007";
static NSString *const kDTFLocalAuthenticationFailedErrorMessage = @"";
static NSString *const kDTFActivelyExitErrorCode = @"Z1008";
static NSString *const kDTFActivelyExitErrorMessage = @"用户主动退出(Z1008)";
static NSString *const kDTFActivelyExitErrorReason = @"用户主动退出";
static NSString *const kDTFVerificationInterruptErrorCode = @"Z1009";
static NSString *const kDTFVerificationInterruptErrorMessage = @"验证中断(Z1009)";
static NSString *const kDTFNotVerifyTemporarilyErrorCode = @"Z1009";
static NSString *const kDTFNotVerifyTemporarilyErrorMessage = @"用户暂不认证(Z1009)";
static NSString *const kNotVerifyTemporarilyReason = @"用户暂不认证";
static NSString *const kGuideViewLoadFailedErrorCode = @"2002";
static NSString *const kGuideViewLoadFailedErrorMessage = @"引导页加载失败";
static NSString *const kGuideViewLoadFailedReason = @"网络错误";
static NSString *const kDTFParameterFailedErrorCode = @"Z1010";
static NSString *const kDTFParameterFailedErrorMessage = @"业务参数错误(Z1010)";
static NSString *const kDTFParameterFailedErrorReason = @"currentCtr isEmpty";
static NSString *const kDTFInitFailedErrorCode = @"Z1012";
static NSString *const kDTFInitFailedErrorMessage = @"";
static NSString *const kDTFAlgorithmInitFailedErrorCode = @"Z1014";
static NSString *const kDTFAlgorithmInitFailedErrorMessage = @"(Z1014)";
static NSString *const kDTFOpenCameraFailedErrorCode = @"Z1020";
static NSString *const kDTFOpenCameraFailedErrorMessage= @"(Z1020)";
static NSString *const kDTFModelFileErrorCode = @"Z1023";
static NSString *const kDTFModelFileErrorMessage = @"(Z1023)";
static NSString *const kDTFZimBusyErrorCode = @"Z1024";
static NSString *const kDTFZimBusyErrorMessage = @"(Z1024)";
static NSString *const kDTFZimBusyErrorReason = @"认证进行中重复调用认证";
static NSString *const kDTFProcessInterruptionErrorCode = @"Z1055";
static NSString *const kDTFProcessInterruptionErrorMessage = @"流程被中断(Z1055)";
static NSString *const kDTUploadImageFailedErrorCode = @"Z1026";
static NSString *const kDTFUploadImageFailedErrorMessage = @"";
static NSString *const kDTFVerifyFailedErrorCode = @"Z1027";
static NSString *const kDTFVerifyFailedErrorMessage = @"网络不给力(Z1027)";
static NSString *const kDTFVerifyLimitFailedErrorCode = @"Z1028";
static NSString *const kDTFVerifyLimitFailedErrorMessage = @"网络错误(network error)(2002)";
static NSString *const kDTFMultiFactorFacadeVersionNotSupportedErrorCode = @"Z1029";
static NSString *const kDTFMultiFactorFacadeVersionNotSupportedErrorMessage = @"网络错误(network error)(2002)";
static NSString *const kDTFRecordingPermissionErrorCode = @"Z1030";
static NSString *const kDTFRecordingPermissionErrorMessage = @"录音权限未赋予(Z1030)";
static NSString *const kDTFRecordingPermissionErrorReason = @"录音权限未赋予";
static NSString *const kDTFReplayKitPermissionErrorCode = @"Z1031";
static NSString *const kDTFReplayKitPermissionErrorMessage = @"录屏权限未赋予(Z1031)";
static NSString *const kDTFReplayKitPermissionErrorReason = @"录屏权限未赋予";
static NSString *const kDTFMicPermissionErrorCode = @"Z1032";
static NSString *const kDTFMicPermissionErrorMessage = @"麦克风打开失败(Z1032)";
static NSString *const kDTFMicPermissionErrorReason = @"麦克风打开失败";
static NSString *const kDTFReplayKitOpenFailedErrorCode = @"Z1033";
static NSString *const kDTFReplayKitOpenFailedErrorMessage = @"录屏打开失败(Z1033)";
static NSString *const kDTFReplayKitOpenFailedErrorReason = @"录屏打开失败";
static NSString *const kDTFInsufficientDiskErrorCode = @"Z1034";
static NSString *const kDTFInsufficientDiskErrorMessage = @"本地存储空间过小(Z1034)";
static NSString *const kDTFInsufficientDiskErrorReason = @"本地存储空间过小";
static NSString *const kDTFMultiFactorFacadeRotationErrorCode = @"Z1035";
static NSString *const kDTFMultiFactorFacadeRotationErrorMessage = @"";
static NSString *const kDTFZimidIsEmptyErrorCode = @"Z1037";
static NSString *const kDTFZimidIsEmptyErrorMessage = @"业务参数错误(Z1037)";
static NSString *const kDTFZimidIsEmptyErrorReason = @"ZimID isEmpty";
static NSString *const kDTFProtocolIsEmptyErrorCode = @"Z1038";
static NSString *const kDTFProtocolIsEmptyErrorMessage = @"";
static NSString *const kDTFMaxRetryErrorCode = @"Z1041";
static NSString *const kDTFMaxRetryErrorMessage = @"";
static NSString *const kDTFOCRConfirmationResultsErrorCode = @"Z1042";
static NSString *const kDTFOCRConfirmationResultsErrorMessage = @"";
static NSString *const kDTFOcrUserQuitInAuthenticationCompletedErrorCode = @"Z2000";
static NSString *const kDTFOcrOcrUserQuitInAuthenticationCompletedErrorReason = @"身份证认证完成,未进入刷脸,用户点击了退出";
static NSString *const kDTFOcrOcrUserQuitInAuthenticationCompletedErrorMessage = @"用户OCR主动退出(Z2000)";
static NSString *const kDTFOcrActivelyExitErrorCode = @"Z2001";
static NSString *const kDTFOcrActivelyExitErrorReason = @"用户未认证,直接点击了退出";
static NSString *const kDTFOcrActivelyExitErrorMessage = @"用户OCR主动退出(Z2001)";
static NSString *const kDTFOcrUserQuitInPortraitAuthenticationErrorCode = @"Z2002";
static NSString *const kDTFOcrUserQuitInPortraitAuthenticationErrorReason = @"人像面证面认证后退出";
static NSString *const kDTFOcrUserQuitInPortraitAuthenticationErrorMessage = @"用户OCR主动退出(Z2002)";
static NSString *const kDTFOcrUserQuitInEmblemAuthenticationErrorCode = @"Z2003";
static NSString *const kDTFOcrUserQuitInEmblemAuthenticationErrorReason = @"国徽面证面认证后退出";
static NSString *const kDTFOcrUserQuitInEmblemAuthenticationErrorMessage = @"用户OCR主动退出(Z2003)";
static NSString *const kDTFOcrInterruptionErrorCode = @"Z2004";
static NSString *const kDTFOcrInterruptionErrorReason = @"OCR过程被中断";
static NSString *const kDTFOcrInterruptionErrorMessage = @"OCR过程被中断(Z2004))";
static NSString *const kDTFFaceDetectNotImportErrorCode = @"I4001";
static NSString *const kDTFFaceDetectNotImportErrorMessage = @"刷脸模块接入异常";
static NSString *const kDTFOcrNotImportErrorCode = @"I4003";
static NSString *const kDTFOcrNotImportErrorMessage = @"OCR模块接入异常";
static NSString *const kDTFNFCNotImportErrorCode = @"I4004";
static NSString *const kDTFNFCNotImportErrorMessage = @"NFC模块接入异常";
static NSString *const kDTFMultiFactorNotImportErrorCode = @"I4005";
static NSString *const kDTFMultiFactorNotImportErrorMessage = @"意愿模块接入异常";
static NSString *const kDTFAudioIsEmptyErrorCode = @"Z5116";
static NSString *const kDTFAudioIsEmptyErrorMessage = @"Z5116 - 音频文件上传失败";
static NSString *const kDTFOcrNetworkFailedErrorCode = @"Z6002";
static NSString *const kDTFOcrNetworkFailedErrorMessage = @"";
static NSString *const kDTFFaceImageIsEmptyErrorCode = @"Z6004";
static NSString *const kDTFFaceImageIsEmptyErrorMessage = @"(Z6004)";
static NSString *const kProtocolErrorCode = @"Z7001";
static NSString *const kProtocolErrorErrorMessage = @"内部错误(Z7001)";
static NSString *const kProtocolErrorReason = @"ZIMInternalError";
static NSString *const kNetworkErrorCode = @"2002";
static NSString *const kNetworkErrorMessage = @"网络错误(network error)(2002)";
static NSString *const kNetworkErrorReason = @"ZIMNetworkfail";
static NSString *const kTimeExpiredNetworkErrorCode = @"2003";
static NSString *const kTimeExpiredNetworkErrorMessage = @"设备时间不对,请确认时间。";
static NSString *const kTimeExpiredNetworkErrorReason = @"ZIMTIMEError";
static NSString *const kLimitTrafficErrorCode = @"1006";
static NSString *const kColorParamErrorCode = @"2006";
static NSString *const kColorParamErrorMessage = @"业务参数错误(2006)";
static NSString *const kColorParamErrorReason = @"颜色值位数不是6位";
static NSString *const kModelFileErrorCode = @"2006";
static NSString *const kModelFileErrorMessage = @"模型文件不存在(2006)";
static NSString *const kModelFileErrorReason = @"传入的模型文件路径不正确";
static NSString *const kModelFileDownloadErrorCode = @"Z1040";
static NSString *const kInitFailErrorReason = @"InitFail";
static NSString *const kZIMValidationSuccessReason = @"ZIMValidationSuccess";
static NSString *const kZIMValidationRetryReason = @"ZIMValidationRetry";
static NSString *const kZIMValidationFailReason = @"ZIMValidationFail";
static NSString *const kZIMInternalErrorReason = @"ZIMInternalError";
static NSString *const kInvalidValidateCodeReason = @"InvalidValidateCode";
static NSString *const kSystemErrorMessage = @"系统错误,请稍候再试。";
static NSString *const kSkippingPhotinusReason = @"skippingPhotinus";
static NSString *const kSkippingPhotinusMessage = @"initializationFailure";
static NSString *const kCameraGivesNoInputMessage = @"cameraGivesNoInput";
static NSString *const kInterruptedMessage = @"interrupted";
@@ -0,0 +1,32 @@
//
// DTFIdentityProtocol.h
// DTFUtility
//
// Created by mengbingchuan on 2023/6/7.
// Copyright © 2023 com.alipay.iphoneclient.zoloz. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "ZIMResponse.h"
#import "DTFRPCProxyProtocol.h"
@protocol DTFFaceIdentityProtocol <NSObject>
- (void)initSDK;
- (void)initIPv6;
- (NSString *)getVersion;
- (void)setDataProtocolVersion:(NSString *)version;
- (void)setRpcProxy:(id<DTFRPCProxyProtocol>)proxy;
- (NSDictionary *)getMetaInfo;
- (void)preload:(NSDictionary *)param completion:(void (^)(BOOL success))completion;
- (void)verifyWith:(NSString *)zimId
extParams:(NSDictionary *)params
onCompletion:(void (^)(ZIMResponse *response))callback;
@end
@@ -0,0 +1,27 @@
//
// DTFImageUtils.h
// DTFUtility
//
// Created by 程佳兵(威琦) on 2025/5/21.
// Copyright © 2025 com.alipay.iphoneclient.zoloz. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef enum : NSUInteger {
DTFImageSourceCamera,
DTFImageSourcePhoto
} DTFImageSource;
@interface DTFImageUtils : NSObject
/// 图片压缩
+ (NSData *)compressImage:(UIImage *)image toByte:(NSUInteger)maxLength;
/// 图片裁剪
+ (UIImage *)cropedImageData:(CGRect)cropRect data:(UIImage *)image;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,288 @@
//
// DTFLanguageCustomConfig.h
// DTFUtility
//
// Created by 汪澌哲 on 2024/1/8.
// Copyright © 2024 com.alipay.iphoneclient.zoloz. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface DTFLanguageCustomGuideConfig : NSObject
@property (nonatomic, copy) NSString *titleText;
@property (nonatomic, copy) NSString *agrtTopTipsText;
@property (nonatomic, copy) NSString *agrtAgreeText;
@property (nonatomic, copy) NSString *agrtText;
@property (nonatomic, copy) NSString *agrtBotTipsText;
@property (nonatomic, copy) NSString *startBtnText;
@property (nonatomic, copy) NSString *elderBtnText;
@property (nonatomic, copy) NSString *exitBtnText;
@property (nonatomic, copy) NSString *rareFormNameText;
@property (nonatomic, copy) NSString *rareFormIDText;
@property (nonatomic, copy) NSString *rareFormEntBtnText;
@property (nonatomic, copy) NSString *authPermissionCamera;
@property (nonatomic, copy) NSString *authPermissionAudio;
@property (nonatomic, copy) NSString *authPermissionScreenEvidence;
@property (nonatomic, copy) NSString *authPermissionToastTitle;
@property (nonatomic, copy) NSString *authPermissionToastMsg;
@property (nonatomic, copy) NSString *authPermissionAPPName;
@property (nonatomic, copy) NSString *authPermissionToastAlbumTitle;
@property (nonatomic, copy) NSString *authPermissionToastAlbumMsg;
@property (nonatomic, copy) NSString *authPermissionSDKName;
@property (nonatomic, copy) NSString *dialogExitTitle;
@property (nonatomic, copy) NSString *dialogExitMsg;
@property (nonatomic, copy) NSString *dialogExitConfirm;
@property (nonatomic, copy) NSString *dialogExitCancel;
@property (nonatomic, copy) NSString *dialogPermissionFailedTitle;
@property (nonatomic, copy) NSString *dialogPermissionFailedMsg;
@property (nonatomic, copy) NSString *dialogPermissionFailedConfirm;
@property (nonatomic, copy) NSString *dialogPermissionFailedCancel;
@property (nonatomic, copy) NSString *dialogNetworkFailedTitle;
@property (nonatomic, copy) NSString *dialogNetworkFailedMsg;
@property (nonatomic, copy) NSString *dialogNetworkFailedConfirm;
@property (nonatomic, copy) NSString *dialogSupportFailedTitle;
@property (nonatomic, copy) NSString *dialogSupportFailedMsg;
@property (nonatomic, copy) NSString *dialogSupportFailedConfirm;
@property (nonatomic, copy) NSString *settingFailReason;
@property (nonatomic, copy) NSDictionary *originMap;
@end
@interface DTFLanguageCustomFaceConfig : NSObject
@property (nonatomic, copy) NSString *faceNotFound;
@property (nonatomic, copy) NSString *faceTooFar;
@property (nonatomic, copy) NSString *faceTooClose;
@property (nonatomic, copy) NSString *faceNotIn;
@property (nonatomic, copy) NSString *badPitch;
@property (nonatomic, copy) NSString *badYaw;
@property (nonatomic, copy) NSString *faceTooMore;
@property (nonatomic, copy) NSString *faceIsMoving;
@property (nonatomic, copy) NSString *faceBrightless;
@property (nonatomic, copy) NSString *faceBadQuality;
@property (nonatomic, copy) NSString *eyesOnScreen;
@property (nonatomic, copy) NSString *blink;
@property (nonatomic, copy) NSString *leftYaw;
@property (nonatomic, copy) NSString *rightYaw;
@property (nonatomic, copy) NSString *stackTime;
@property (nonatomic, copy) NSString *isBlur;
@property (nonatomic, copy) NSString *faceInitTxt;
@property (nonatomic, copy) NSString *faceTitleBlink;
@property (nonatomic, copy) NSString *leftYawLiveness;
@property (nonatomic, copy) NSString *rightYawLiveness;
@property (nonatomic, copy) NSString *photinusCommTips;
@property (nonatomic, copy) NSString *processing;
@property (nonatomic, copy) NSString *dialogTimeOutTitle;
@property (nonatomic, copy) NSString *dialogTimeOutMsg;
@property (nonatomic, copy) NSString *dialogTimeOutConfirm;
@property (nonatomic, copy) NSString *dialogInterruptTitle;
@property (nonatomic, copy) NSString *dialogInterruptConfirm;
@property (nonatomic, copy) NSString *dialogInterruptCancel;
@property (nonatomic, copy) NSString *dialogTooManyRetriesTitle;
@property (nonatomic, copy) NSString *dialogTooManyRetriesMsg;
@property (nonatomic, copy) NSString *dialogTooManyRetriesConfirm;
@property (nonatomic, copy) NSString *dialogExitTitle;
@property (nonatomic, copy) NSString *dialogExitMsg;
@property (nonatomic, copy) NSString *dialogExitConfirm;
@property (nonatomic, copy) NSString *dialogExitCancel;
@property (nonatomic, copy) NSString *dialogCamOpenFailedTitle;
@property (nonatomic, copy) NSString *dialogCamOpenFailedMsg;
@property (nonatomic, copy) NSString *dialogCamOpenFailedCancel;
@property (nonatomic, copy) NSString *dialogCamOpenFailedConfirm;
@property (nonatomic, copy) NSString *dialogArchSysFailedTitle;
@property (nonatomic, copy) NSString *dialogArchSysFailedMsg;
@property (nonatomic, copy) NSString *dialogArchSysFailedConfirm;
@property (nonatomic, copy) NSString *dialogSDKErrTitle;
@property (nonatomic, copy) NSString *dialogSDKErrMsg;
@property (nonatomic, copy) NSString *dialogSDKErrConfirm;
@property (nonatomic, copy) NSString *dialogNetworkFailedTitle;
@property (nonatomic, copy) NSString *dialogNetworkFailedMsg;
@property (nonatomic, copy) NSString *dialogNetworkFailedConfirm;
@property (nonatomic, copy) NSString *settingFailReason;
@property (nonatomic, copy) NSString *verifyNotice;
@property (nonatomic, copy) NSString *suitableExit;
@end
@interface DTFLanguageCustomDocConfig : NSObject
@property (nonatomic, copy) NSString *stageFrontTips;//人像面
@property (nonatomic, copy) NSString *stageBackTips;//国徽面
@property (nonatomic, copy) NSString *stageLivenessTips;//实人认证
@property (nonatomic, copy) NSString *frontInfoTips;//拍摄人像面
@property (nonatomic, copy) NSString *frontInfoBottomTips;//证件人像面
@property (nonatomic, copy) NSString *backInfoBottomTips;//证件国徽面
@property (nonatomic, copy) NSString *backInfoTips;//拍摄国徽面
@property (nonatomic, copy) NSString *takeRequireTxt;//拍摄要求
@property (nonatomic, copy) NSString *takeRequireTitle;//拍摄要求
@property (nonatomic, copy) NSString *resultCheckTips;//请确认以下身份信息,如有误请点击修改
@property (nonatomic, copy) NSString *certNameTitle;//姓名
@property (nonatomic, copy) NSString *certNameHint;//请输入姓名
@property (nonatomic, copy) NSString *certNoTitle;//身份证号
@property (nonatomic, copy) NSString *certNoHint;//请输入身份证号
@property (nonatomic, copy) NSString *nextTxt;//下一步
@property (nonatomic, copy) NSString *confirmTxt;//确认身份信息无误
@property (nonatomic, copy) NSString *livenessTips;//实人认证
@property (nonatomic, copy) NSString *livenessMsg;//拍摄您本人人脸,请确保正对手机,光线充足
@property (nonatomic, copy) NSString *livenessLoadingMsg;//即将进入刷脸页...
@property (nonatomic, copy) NSString *dialogIdentityFailTitle;//识别失败
@property (nonatomic, copy) NSString *dialogIdentityFailRequireTitle;//证件图像未符合要求
@property (nonatomic, copy) NSString *dialogIdentityFailRequireMsg;//请按要求拍摄本人有效身份证
@property (nonatomic, copy) NSString *dialogIdentityFailRetry;//重新拍摄
@property (nonatomic, copy) NSString *dialogIdentityFailReUpload;//重新上传
@property (nonatomic, copy) NSString *dialogNetworkTimeOutTitle;//识别超时
@property (nonatomic, copy) NSString *dialogNetworkTimeOutMsg;//网络连接超时,请重新识别
@property (nonatomic, copy) NSString *dialogNetworkTimeOutConfirm;//重新识别
@property (nonatomic, copy) NSString *dialogNetworkTimeOutCancel;//退出
@property (nonatomic, copy) NSString *identityLoadingMsg;//识别中
@property (nonatomic, copy) NSString *dialogExitTitle;//确定退出吗?
@property (nonatomic, copy) NSString *dialogExitMsg;//拍张照就能通过
@property (nonatomic, copy) NSString *dialogExitCancel;//取消
@property (nonatomic, copy) NSString *dialogExitConfirm;//确定
@property (nonatomic, copy) NSString *dialogTooManyRetriesTitle;//识别失败次数过多
@property (nonatomic, copy) NSString *dialogTooManyRetriesMsg;//请退出后重试
@property (nonatomic, copy) NSString *dialogTooManyRetriesConfirm;//退出
@property (nonatomic, copy) NSString *dialogNoPermissionTitle;//温馨提示
@property (nonatomic, copy) NSString *dialogNoPermissionMsg;//请打开摄像头权限
@property (nonatomic, copy) NSString *dialogNoPermissionCancel;//取消
@property (nonatomic, copy) NSString *dialogNoPermissionToSet;//去设置
@property (nonatomic, copy) NSString *takeFrontTips;//拍摄身份证人像面
@property (nonatomic, copy) NSString *takeBackTips;//拍摄身份证国徽面
/// 图片来源弹框“拍照”文案
@property (nonatomic, copy) NSString *chooseTakePhoto;
//图片来源弹框“从相册中选择”文案
@property (nonatomic, copy) NSString *chooseFromAlbum;
/// 图片来源弹框“取消”文案
@property (nonatomic, copy) NSString *chooseCancel;
/// 请打开相册权限
@property (nonatomic, copy) NSString *dialogNoAlbumPermissionMsg;
@property (nonatomic, assign) BOOL successConfigFlag;//配置成功标志
- (instancetype)initWithDictionary:(NSDictionary *)dictionary;
@end
/// NFC 自定义文案
@interface DTFLanguageCustomNFCConfig : NSObject
- (instancetype)initWithDictionary:(NSDictionary *)dictionary;
@property (nonatomic, assign) BOOL successConfigFlag;//配置成功标志
/// NFC识别
@property (nonatomic, copy) NSString *configTitle;
///证件号码
@property (nonatomic, copy) NSString *cardNo;
/// 请输入9位证件号码
@property (nonatomic, copy) NSString *cardNoHint;
/// 出生日期
@property (nonatomic, copy) NSString *birthday;
/// 有效期
@property (nonatomic, copy) NSString *validity;
/// 请选择
@property (nonatomic, copy) NSString *validityHint;
/// 请选择
@property (nonatomic, copy) NSString *birthdayHint;
///下一步
@property (nonatomic, copy) NSString *nextStep;
/// 确认
@property (nonatomic, copy) NSString *datePickerConfirm;
/// 取消
@property (nonatomic, copy) NSString *datePickerCancel;
///证件有效截止日期必须大于出生日期
@property (nonatomic, copy) NSString *dialogConfigErrMsg;
///提示
@property (nonatomic, copy) NSString *dialogConfigErrTitle;
/// 确定
@property (nonatomic, copy) NSString *dialogConfigErrConfirm;
/// 开始识别
@property (nonatomic, copy) NSString *readTitle;
/// 请准备好证件,点击开始读卡
@property (nonatomic, copy) NSString *readHint;
/// 开始读取
@property (nonatomic, copy) NSString *beginRead;
/// 已准备好扫描
@property (nonatomic, copy) NSString *readDialogTitle;
/// 取消
@property (nonatomic, copy) NSString *readDialogCancel;
/// 请将证件放在图示位置,静置%d秒
@property (nonatomic, copy) NSString *readDialogHint;
/// 读取证件失败,请重试
@property (nonatomic, copy) NSString *readDialogTimeOut;
/// 读取证件失败
@property (nonatomic, copy) NSString *readDialogOutOfLimit;
/// 证件认证失败
@property (nonatomic, copy) NSString *authenticationError;
/// 网络状况不佳,请检查网络后重试
@property (nonatomic, copy) NSString *readDialogCheckNetworkAndRetry;
/// 读卡失败
@property (nonatomic, copy) NSString *readDialogNFCServiceError;
/// 还需 %d 秒,请勿移动证件
@property (nonatomic, copy) NSString *needTimeToRead;
/// 读取失败,请勿移动
@property (nonatomic, copy) NSString *readDialogCardMove;
/// 您的证件信息填写有误\r\n请修改正确后重试
@property (nonatomic, copy) NSString *readDialogDocConfigError;
/// 读取异常,当前设备不支持此功能
@property (nonatomic, copy) NSString *readDialogDeviceNotSupported;
/// 不支持此类证件
@property (nonatomic, copy) NSString *readDialogDocNotSupported;
/// 读取成功
@property (nonatomic, copy) NSString *readDialogSuccess;
/// 正在处理
@property (nonatomic, copy) NSString *verifyLoading;
/// 提示
@property (nonatomic, copy) NSString *dialogReadCardTitle;
/// 确定
@property (nonatomic, copy) NSString *dialogReadCardConfirm;
/// 配置key 失败原因
@property (nonatomic, copy) NSString *settingFailReason;
@end
@interface DTFLanguageCustomConfig : NSObject
@property (strong, nonatomic) DTFLanguageCustomGuideConfig *guideConfig;
@property (strong, nonatomic) DTFLanguageCustomFaceConfig *faceConfig;
@property (strong, nonatomic) DTFLanguageCustomDocConfig *docConfig;
@property (strong, nonatomic) DTFLanguageCustomNFCConfig *nfcConfig;
- (instancetype)initWithString:(NSString *)string type:(NSString *)type error:(NSError **)error;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,40 @@
//
// DTFLanguageManager.h
// DTFUtility
//
// Created by 汪澌哲 on 2023/8/3.
// Copyright © 2023 com.alipay.iphoneclient.zoloz. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef void (^DTFLanguageDownloadCompletionBlock)(NSError * _Nullable error);
NS_ASSUME_NONNULL_BEGIN
@interface DTFLanguageManager : NSObject
@property (nonatomic, strong)NSString *ocrResultStr;
@property (nonatomic, strong)NSString *languageType;
+ (instancetype)sharedInstance;
- (BOOL)checkNeedPreload;
- (BOOL)checkUpdateDocWithVersion:(NSString *)version;
- (BOOL)checkUpdateFaceWithVersion:(NSString *)version;
- (BOOL)checkUpdateGuideWithVersion:(NSString *)version;
- (void)startFaceDownloadWithCompletion:(DTFLanguageDownloadCompletionBlock)completion;
- (void)startDocDownloadWithCompletion:(DTFLanguageDownloadCompletionBlock)completion;
- (void)startGuideDownloadWithCompletion:(DTFLanguageDownloadCompletionBlock)completion;
- (NSString *)getCurrentLanguage;
- (NSString *)getCurrentFullLanguage;
- (NSString *)getFileWithPath:(NSString *)path fileName:(NSString *)fileName;
- (void)initializeLanguageDictionary;
- (NSString *)faceStringWithKey:(NSString *)key;
- (NSString *)docStringWithKey:(NSString *)key;
- (NSString *)guideStringWithKey:(NSString *)key;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,66 @@
//
// MPLogAdditions.h
// MPRemoteLogging
//
// Created by tashigaofei on 15/10/13.
// Copyright © 2015年. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface DTFLogAdditions : NSObject
/**
* UUID、UTDID、clientID、deviceModel,language,接入方无须重写,由mPaaS自动获取。
*/
@property (nonatomic, strong, readonly) NSString *UUID; // 默认实现为从DTFMobileIdentifier获取,如果没有DTFMobileIdentifier,会调用系统方法获取UUID
@property (nonatomic, strong, readonly) NSString *UTDID; // 默认实现为从DTFMobileIdentifier获取,如果没有DTFMobileIdentifier,会反射式调用UTDID库的[UTDevice utdid]方法
@property (nonatomic, strong, readonly) NSString *clientID; // 默认实现为从DTFMobileIdentifier获取,如果没有DTFMobileIdentifier,会返回@""
@property (nonatomic, strong) NSString *deviceModel; // 默认实现为从DTFMobileIdentifier获取,如果没有DTFMobileIdentifier,会调用系统方法获取设备型号
@property (nonatomic, strong) NSString *language; // 默认实现为读取NSUserDefaults中kAPLanguageSettingKey。如果使用钱包或mPaaS多语言模块,该方法不需要重写
/**
* userID为可选参数,当前登录的用户,接入方在Category中覆盖实现。
*/
@property (nonatomic, strong) NSString *userID;
/**
* log日志服务器地址,默认返回@"",需要接入方在Category中覆盖。格式为https://mdap.xxxlog.com/loggw/log.do
*/
@property (nonatomic, strong) NSString *logServerURL;
/**
* log日志服务器配置地址,默认返回@"",需要接入方在Category中覆盖。格式为https://mdap.xxxlog.com/loggw/config.do
* 一般只需要重写logServerURL即可,configServerURL系统会自动根据logServerURL进行修改。
*/
@property (nonatomic, strong) NSString *configServerURL;
/**
* 客户端日志产品ID,默认返回[[NSBundle mainBundle] objectForInfoDictionaryKey:@"Product ID"],如果不同需要接入方在Category中覆盖。
*/
@property (nonatomic, strong) NSString *platformID;
+ (instancetype)sharedInstance;
/**
* 默认进行上传的日志类型。哪些类型的日志在什么网络下进行上传,是由服务端下发配置来设置。
* 但当服务端配置不存在时,可以覆盖这个方法返回一定进行上传的日志类型。
* 默认实现为返回 @[@(MPLogTypeBehavior), @(MPLogTypeCrash), @(MPLogTypeAuto), @(MPLogTypeMonitor), @(MPLogTypeKeyBizTrace)]
*
* @return @[@(MPLogTypeXXX), @(MPLogTypeYYY)]数组。数组元素为NSNumber类型
*/
- (NSArray*)defaultUploadLogTypes;
/**
* 输出诊断日志到本地日志文件,方便定位问题。
* 该方法默认实现为空,由外部覆盖实现为指定日志方法。
*/
- (void)logToFile:(NSString*)logStr;
/**
* 触发本地日志上传的最小条数,默认为40。
* 即默认本地未上传的日志到达40条时,会自动触发上传,业务可根据需求修改
*/
- (NSInteger )numberOfSyncLogs;
@end
@@ -0,0 +1,49 @@
//
// APMmMPLogFile.h
// MPRemoteLogging
//
// Created by tashigaofei on 14-6-16.
// Copyright (c) 2014年 Alpay. All rights reserved.
//
#import <Foundation/Foundation.h>
@class DTFLogIndex;
typedef BOOL (^FileFilter) (CFTimeInterval time);
@interface DTFLogFile : NSObject
@property (nonatomic, assign) BOOL uploadable;
@property (nonatomic, assign) unsigned long triggerCount;
@property (nonatomic, copy) FileFilter timeFilter;
@property (nonatomic, assign) off_t size;
@property (nonatomic, assign) unsigned long unSyncCount;
+(instancetype) logFileWithName:(NSString *) name;
-(DTFLogIndex*) writeLog:(NSString *)logString;
-(NSData *) dataForIndex:(DTFLogIndex *) index;
-(void) markIndex:(DTFLogIndex *) index;
-(NSArray *) makeUnSyncLogIndex;
-(void) removeWeakCache;
-(NSString *)description;
-(void) markFile;
-(BOOL) isMarked;
+(char*)checkCode;
-(BOOL)shouldFlush;
-(BOOL) isUsing;
-(BOOL)isExist;
@end
@interface DTFLogIndex : NSObject
@property (nonatomic, assign) char flag;
@property (nonatomic, assign) NSUInteger offset;
@property (nonatomic, assign) NSUInteger length;
@property (nonatomic, assign) CFTimeInterval time;
@property (nonatomic, strong) DTFLogFile *file;
- (NSString*)uniqueId;
@end
@@ -0,0 +1,23 @@
//
// APLogFormater.h
// APRemoteLogging
//
// Created by tashigaofei on 14-6-23.
// Copyright (c) 2014年 DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DTFMonitorPointDataDefines.h"
#import "DTFLogSetting.h"
@interface DTFLogFormatter : NSObject
@property (nonatomic, strong) NSString *sdkVersion;
- (NSString *)stringFromLog:(NSDictionary *) logDict;
+ (NSString *)timestampString;
+ (NSString *)getDatetimeString:(NSTimeInterval)time;
+ (NSString *)resolutionString;
+ (NSArray *)keyPaths;
@end
@@ -0,0 +1,62 @@
//
// APRemoteLogManager.h
// APRemoteLogging
//
// Created by tashigaofei on 14-6-23.
// Copyright (c) 2014年 DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DTFLogFile.h"
#import "DTFLogFormatter.h"
typedef void (^NetworkUploadCompletion)(BOOL);
typedef void (^NetworkUploadBlock)(NSDictionary *,NetworkUploadCompletion);
@class MPLoggingContext;
@interface DTFLogManager : NSObject
@property(nonatomic, copy) NetworkUploadBlock networkUploadBlock;
typedef void (^LogCallback)(NSDictionary *logData);
+(instancetype)sharedInstance;
+ (void)setLogCallback:(LogCallback)logCallback;
-(void)writeLogWithContext:(MPLoggingContext *) context;
-(void)flushAllLog;
-(void)setupTimeForCheckFileSize;
- (void)startUploadLog;
@end
@interface MPLoggingContext : NSObject
@property (nonatomic, assign) MPLogType logType;
@property (nonatomic, strong) DTFLogFormatter *formatter;
@property (nonatomic, strong) NSMutableDictionary * logDict;
@property (nonatomic, strong) NSString *bizType;
@end
NSString * MPLogPathForFile(NSString * name);
DTFLogFile* DTFLogFileForContext(MPLoggingContext *context);
NSData* MPLogRSAEncrypt(NSData * data);
NSString*MPLogAESEncrypt(NSString *key, NSString *data);
NSString* MPLogBase64EncodedString(NSData *data, int wrapWidth);
NSData*MPLogBase64DecodedString(NSString *string);
NSString* MPLogMD5String(NSString *string);
NSData* MPLogGZipCompress(NSData *data);
NSString* MPLogGetNetworkName();
NSString *MPLogGetCarrierName();
typedef enum : NSInteger {
MPLogNotReachable = 0,
MPLogReachableViaWiFi,
MPLogReachableViaWWAN
} MPLogNetworkStatus;
@interface MPSafeMap : NSObject
- (id)objectForKeyedSubscript:(id <NSCopying>)key;
- (void)setObject:(id)obj forKeyedSubscript:(id <NSCopying>)key;
- (void)removeObjectForKey:(id)aKey;
@end
@@ -0,0 +1,53 @@
//
// DTFLogMonitor.h
// BioAuthEngine
//
// Created by richard on 22/03/2018.
// Copyright © 2018 DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
static NSString *kPrivateUCID = @"UC-YWRLSB-160425-02";
static NSString *kPrivateSeedId = @"techSeed";
@interface DTFLogMonitor : NSObject
+(instancetype)getInstance;
+ (void)setSDKVersion:(NSString *)version;
+ (void)setUploadBlock:(void (^) (NSDictionary *,void (^)(BOOL)))block;
- (void)addPublicLog:(NSDictionary *)logDic;
- (void)setupBaseExtInfo;
- (void)addDebugMonitorLogWithSeedId:(NSString *)seedId
extParam:(NSDictionary *)extParam;
- (void)addMonitorLogWithSeedId:(NSString *)seedId
extParam:(NSDictionary *)extParam;
- (void)addMonitorLogWithSeedId:(NSString *)seedId
ucId:(NSString *)ucId
extParam:(NSDictionary *)extParam;
- (void)addMonitorLogWithSeedId:(NSString *)seedId
param:(NSString *)param
extParam:(NSDictionary *)extParam;
// param: 可搜索
- (void)addMonitorLogWithSeedId:(NSString *)seedId
ucId:(NSString *)ucId
param:(NSString *)param
extParam:(NSDictionary *)extParam;
+(NSDictionary *)getPublicLogDic:(NSDictionary *)publicParam;
+(NSDictionary *)getExtLogDic:(NSDictionary *)p4;
+ (void)distantUploadlog;
@end
@@ -0,0 +1,32 @@
//
// MPLogSetting.h
// APRemoteLogging
//
// Created by tashigaofei on 15/3/16.
// Copyright (c) 2015年 DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
NSString * MPLogGetUUID();
NSString * MPLogGetUTDID();
NSString * MPLogGetClientID();
NSString * MPLogGetSystemType();
NSString * MPLogGetSystemVersion();
NSString * MPLogGetDeviceMode();
NSString * MPLogGetUserID();
NSString * MPLogGetPlatformID();
NSString * MPLogGetConfigServerURL();
NSString * MPLogGetLogServerURL();
NSString * MPLogGetNetwork();
NSString * MPLogGetLanguage();
NSString * MPLogGetVoiceOver();
NSString * MPLogGetCarrier();
void MPLogSetClientVersion(NSString * clientVersion);
void MPLogSetPlatformID(NSString * platformID);
void MPLogSetConfigServerURL(NSString * url);
void MPLogSetLogServerURL(NSString * url);
void MPLogSetClientID(NSString * clientID);
void MPLogSetLanguage(NSString * language);
@@ -0,0 +1,38 @@
//
// DTFMonitorCommonData.h
// BioAuthEngine
//
// Created by richard on 19/03/2018.
// Copyright © 2018 DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface DTFMonitorCommonData : NSObject
@property (nonatomic,strong) NSString* serviceLevel;
// 端侧上报UUID: init、verify、OCR
@property (nonatomic,strong) NSString* beginTraceIDValue;
@property (nonatomic,strong) NSString* verifyTraceIDValue;
@property (nonatomic,strong) NSString* ocrTraceIDValue;
@property (nonatomic,strong) NSString* beginTraceIDKey;
@property (nonatomic,strong) NSString* verifyTraceIDKey;
@property (nonatomic,strong) NSString* ocrTraceIDKey;
+ (instancetype)getInstance;
- (NSString *)getToken;
- (NSInteger)getIndex;
- (void)resetValue;
- (NSDictionary *)getCommonMonitorData;
- (NSDictionary *)getBase64CommonMonitorData;
@end
@@ -0,0 +1,153 @@
//
// MPMonitorPointDataDefines.h
//
//
// Created by tudou on 12-1-5.
// Copyright (c) 2012年 DTF. All rights reserved.
//
/**
* 埋点预定义的可用actionID,只可以用预设的,否则服务器不识别
*/
static NSString * const kValue_CrashLogFlag = @"MonitorPoint_Crash";
//static NSString * const kActionID_Manual_perf = @"monitorPerf"; //性能监控标志
//static NSString * const kActionID_Clicked = @"clicked";
//static NSString * const kActionID_LongClicked = @"longClicked";
//static NSString * const kActionID_Submtted = @"submited";
//static NSString * const kActionID_BizLaunched = @"bizLaunched";
//static NSString * const kActionID_SetGesture = @"setGesture";
//static NSString * const kActionID_CheckGesture = @"checkGesture";
//static NSString * const kActionID_NetBroken = @"netBroken";
//static NSString * const kActionID_Monitor = @"monitor";
//static NSString * const KActionID_Slided = @"slided";
//static NSString * const KActionID_None = @"none";
//static NSString * const kActionID_OPENPAGE = @"openPage";
//static NSString * const KActionID_AutoClicked = @"auto_clicked";
//static NSString * const KActionID_AutoClick = @"auto_click";
//static NSString * const KActionID_AutoOpenPage = @"auto_openPage";
//static NSString * const KActionID_AutoEvent = @"auto_event";
//static NSString * const KActionID_Event = @"event";
//static NSString * const KActionID_FingerIdenty = @"fingerIdenty";
//static NSString * const KActionID_MonitorReport = @"MonitorReport";
//static NSString * const KActionID_Exposure = @"exposure";
//static NSString * const KActionID_Page_monitor = @"page_monitor";
//
//
//static NSString * const kActionID_Exception = @"exception";
//static NSString * const KActionID_Error = @"error";
//static NSString * const kActionID_FlashBroken = @"flashBroken";
//性能埋点的actionID
static NSString * const KActionID_PerformanceNetwork = @"network";
static NSString * const KActionID_PerformanceMobSDK = @"mobsdk";
static NSString * const KActionID_PerformanceWebApp = @"webapp";
static NSString * const KActionID_PerformancePackage = @"package";
static NSString * const KActionID_PerformancePage = @"page";
static NSString * const KActionID_PerformanceInterface = @"interface";
static NSString * const KActionID_PerformanceMemory = @"memory";
static NSString * const KActionID_PerformanceSdkMonitor = @"sdkmonitor";
#pragma mark -
#pragma mark 埋点id
#pragma mark -
static NSString * const kRecordTime = @"timestamp";
static NSString * const kPlatformID = @"platformID"; //客户端ID
static NSString * const kClientVersion = @"clientVersion";//客户端版本
static NSString * const kInternalVersion = @"InternalVersion";//内部版本
static NSString * const kLogModleVersion = @"logModelVersion";//日志版本
static NSString * const kClientId = @"clientId"; //设备ID
static NSString * const kUUID = @"UUID"; //会话ID
static NSString * const kUserID = @"userID";
static NSString * const kActionID = @"actionID";//行为id (clicked,submited,bizLaunched)
static NSString * const kActionStatus = @"actionStatus";
static NSString * const kStatusMsg = @"statusMsg";
static NSString * const kBizID = @"bizID";
static NSString * const kBizVersion = @"bizVersion";
static NSString * const kCurrentViewID = @"currentViewID";
static NSString * const kLastViewID = @"lastViewID";
static NSString * const kActionSeed = @"logID"; //埋点ID
static NSString * const kWapURL = @"wapURL";
static NSString * const kActionOwnerType = @"actionType";
static NSString * const kLogOwnerType = @"logType";
static NSString * const kExArg1 = @"stayDuration";
static NSString * const kExArg2 = @"arg2";
static NSString * const kExArg3 = @"renderConsume";
static NSString * const kExArg4 = @"arg4";
static NSString * const kExArg5 = @"sourceID";
static NSString * const kRequestid = @"unitID"; //流水号
static NSString * const UTDID = @"utdID"; //cookie
static NSString * const ucID = @"ucID";
static NSString * const kIndex = @"index";
static NSString * const kLogLastViewID = @"logLastViewID";
static NSString * const kLogCurrentViewID = @"logCurrentViewID";
static NSString * const kExceptionType = @"ExceptionType";
static NSString * const kAppStack = @"AppStack";
static NSString * const kVcStack = @"VcStack";
static NSString * const kAppPackageType = @"AppPackageType";
static NSString * const kAttachment = @"Attachment"; //附加信息
static NSString * const kHeader = @"header";
static NSString * const kExtension = @"extension";
static NSString * const kResolution = @"resolution";
static NSString * const kSessionid = @"session_id";
static NSString * const kHotpatchVersion = @"HotpatchVersion";
#pragma mark -
#pragma mark Performance Log Key
static NSString * const kActionControlID = @"ActionControlID";
static NSString * const kActionToken = @"ActionToken";
static NSString * const kActionDescription = @"ActionDescription";
static NSString * const kMonitorType = @"MonitorType";
static NSString * const kMonitorSubType = @"MonitorSubType";
static NSString * const kSystemType = @"SystemType";
static NSString * const kMPSystemVersion = @"MPSystemVersion";
static NSString * const kNetworkType = @"NetworkType";
static NSString * const kDeviceModel = @"kDeviceModel";
static NSString * const kInnerVersion = @"InnerVersion";
static NSString * const kDistributionChannel = @"DistributionChannel";
static NSString * const kLanguage = @"Language";
#pragma mark -
#pragma mark other keys
// android only 仅仅是为了和安卓保持日志模型一致,此字段留空
static NSString * const kCPUCoreNum = @"CPUCoreNum";
static NSString * const kCPUMaxFreq = @"CPUMaxFreq";
static NSString * const kTotalMem = @"TotalMem";
static NSString * const kAPK = @"apk";
static NSString * const kExtendedArg = @"extendedArgument";// for server @尚清
//9.6.6之后行为埋点的基础扩展字段,字典类型,后续其它日志模型也可以用这个key
static NSString * const kFoundationExtended = @"FoundationExtended";
static NSString * const kFoundationExtendedVoiceOver = @"VoiceOver";
#pragma mark -
#pragma mark Diagnose Log Key
static NSString * const kChannelID = @"ChannelID";
static NSString * const kDiagnoseType = @"DiagnoseType";
static NSString * const kDiagnoseMessage = @"DiagnoseMessage";
//日志级别
static NSString * const kLoggerLevel = @"loggerLevel";
//关键业务日志级别
static NSString * const LoggerLevelHigh = @"loggerLevelHigh";
//普通业务日志级别
static NSString * const LoggerLevelMedium = @"loggerLevelMedium";
//诊断业务日志级别
static NSString * const LoggerLevelLow = @"loggerLevelLow";
typedef NS_ENUM(int, MPLogType){
MPLogTypeNone = 0,
MPLogTypeBehavior,
MPLogTypeCount
};
@@ -0,0 +1,38 @@
//
// DTFMutableSetting.h
// BioAuthEngine
//
// Created by richard on 24/02/2018.
// Copyright © 2018 DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface DTFMutableSetting : NSObject
+ (instancetype)getInstance;
- (NSString *)gatewayURL;
- (NSArray *)backupURL;
- (NSDictionary *)headConfig;
- (NSString *)DTFInitRequestOperationType;
- (NSString *)validateRequestOperationType;
- (NSString *)SMSVerifyRequestOperationType;
- (NSString *)SMSCodeRequestOperationType;
- (NSString *)zimOCRIdentifyRequestOperationType;
- (NSString *)bioAuthEngineVersion;
- (NSString *)onlinePubKey;
- (NSString *)testPubKey;
@end
@@ -0,0 +1,34 @@
//
// DTFNFCIdentityProtocol.h
// DTFUtility
//
// Created by mengbingchuan on 2023/6/8.
// Copyright © 2023 com.alipay.iphoneclient.zoloz. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DTFRPCProxyProtocol.h"
#import "ZIMResponse.h"
NS_ASSUME_NONNULL_BEGIN
@protocol DTFNFCIdentityProtocol <NSObject>
- (void)initSDK;
- (NSString *)getVersion;
- (void)setDataProtocolVersion:(NSString *)version;
- (void)setRpcProxy:(id<DTFRPCProxyProtocol>)proxy;
- (NSDictionary *)getMetaInfo;
- (void)verifyWith:(NSString *)zimId
extParams:(NSDictionary *)params
onCompletion:(void (^)(ZIMResponse *response))callback;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,25 @@
//
// DTFOSSManager.h
// DTFUtility
//
// Created by mengbingchuan on 2024/6/25.
// Copyright © 2024 com.alipay.iphoneclient.zoloz. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "ToygerData.h"
#define kDTFOSSFileNameKey @"fileName"
#define kDTFOSSFileDataKey @"fileData"
NS_ASSUME_NONNULL_BEGIN
@interface DTFOSSManager : NSObject
+ (NSDictionary * )buildUploadData:(NSData *)data fileName:(NSString *)fileName fileNamePrefix:(NSString *)fileNamePrefix fileType:(NSString *)fileType;
+ (void)uploadWithParams:(NSDictionary *)params completionBlock:(void (^)(NSError *error, NSDictionary *result))blk;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,33 @@
//
// DTFOSSModel.h
// DTFUtility
//
// Created by 汪澌哲 on 2023/10/22.
// Copyright © 2023 com.alipay.iphoneclient.zoloz. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface DTFOSSModel : NSObject
@property (nonatomic, copy) NSString *accessKeyId;
@property (nonatomic, copy) NSString *accessKeySecret;
@property (nonatomic, copy) NSString *securityToken;
@property (nonatomic, copy) NSString *endpoint;
@property (nonatomic, copy) NSString *bucket;
@property (nonatomic, copy) NSString *fileNamePrefix;
@property (nonatomic, strong) NSNumber *useBackup;
@property (nonatomic, copy) NSString *backupOssEndPoint;
@property (nonatomic, copy) NSString *backupBucketName;
+ (instancetype)defaultModel;
- initWithId:(NSString *)keyId keySecret:(NSString *)keySecret token:(NSString *)token endpoint:(NSString *)endpoint bucket:(NSString *)bucket prefix:(NSString *)prefix backupEndpoint:(NSString *)backupEndpoint backupBucket:(NSString *)backupBucket;
- initWithDictionary:(NSDictionary *)dictionary;
- (NSDictionary *)dictionary;
- (BOOL)supportedBackup;
@end
@@ -0,0 +1,71 @@
//
// DTFRPCProxyProtocol.h
// DTFUtility
//
// Created by mengbingchuan on 2023/6/7.
// Copyright © 2023 com.alipay.iphoneclient.zoloz. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef void (^rpcCompletionBlock)(NSError *error, NSObject *result);
typedef void (^DTFRpcCompletionBlock)(NSError *error, NSDictionary *data);
@protocol DTFRPCProxyProtocol <NSObject>
@required
/**
* ZimID初始化协议
* key: data
* value: jsonString
*/
- (void)zimInit:(NSDictionary *)params completionBlock:(DTFRpcCompletionBlock)blk;
/**
* 结果认证
* key: data
* value: jsonString
*/
- (void)zimValidate:(NSDictionary *)params completionBlock:(DTFRpcCompletionBlock)blk;
@optional
/**
* NFC结果认证
* key: data
* value: jsonString
*/
- (void)zimNFCValidate:(NSDictionary *)params completionBlock:(DTFRpcCompletionBlock)blk;
/**
* 请求发送验证码
*/
- (void)requestSMSVerifyCode:(NSDictionary *)params completionBlock:(DTFRpcCompletionBlock)blk;
/**
* 验证码结果验证
*/
- (void)checkSMSCode:(NSDictionary *)params completionBlock:(DTFRpcCompletionBlock)blk;
/**
* OCR识别认证
*/
- (void)zimOCRIdentify:(NSDictionary *)params completionBlock:(DTFRpcCompletionBlock)blk;
/**
* EKYC OCR识别认证
*/
- (void)zimEKYCOCRIdentify:(NSDictionary *)params completionBlock:(DTFRpcCompletionBlock)blk;
/**
* EKYC OCR确认认证
*/
- (void)zimEKYCOCRConfirmIdentify:(NSDictionary *)params completionBlock:(DTFRpcCompletionBlock)blk;
/**
* oss上传
*/
- (void)zimFileUpload:(NSDictionary *)params completionBlock:(DTFRpcCompletionBlock)blk;
@end
@@ -0,0 +1,44 @@
//
// DTFSDKConfiguration.h
// DTFUtility
//
// Created by 汪澌哲 on 2023/5/22.
// Copyright © 2023 com.alipay.iphoneclient.zoloz. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface DTFSDKConfiguration : NSObject
//原数据
@property (nonatomic, copy) NSString *NEED_BACKUP_URL;
@property (nonatomic, copy) NSString *LOG_UPLOAD;
@property (nonatomic, copy) NSString *LOG_DEBUG_UPLOAD;
@property (nonatomic, copy) NSString *FORCE_MODEL_DOWNLOAD;
@property (nonatomic, copy) NSString *URLSESSION_DEGRADE;
@property (nonatomic, copy) NSString *MULTI_PICTURE_COLLECT;
@property (nonatomic, copy) NSString *EQUIPMENT_LIVENESS_THRESHOLD;
@property (nonatomic, copy) NSString *GEN_VIDEO_DEGRADE;
@property (nonatomic, copy) NSArray *MODEL_FILES;
@property (nonatomic, copy) NSString *PRESENT_VC_USE_COMPLETION;
@property (nonatomic, copy) NSString *BIO_USE_DELEGATE_REPLACE_KVO;
@property (nonatomic, copy) NSString *USE_BACKUP_DOMAIN_WHEN_TIMEOUT;//为@"1"时打开
@property (nonatomic, copy) NSString *NEED_OBSERVER_CAPTURE_SESSION;//是否需要监听session错误
@property (nonatomic, copy) NSString *SESSION_INTERRUPT_PROMPT;//摄像头无法录制提示信息
@property (nonatomic, copy) NSString *ROTATION_OLD_STYLE;//是否使用老代码处理旋转
@property (nonatomic, copy) NSString *CLIENT_NATIVE_PHOTINUS;
@property (nonatomic, copy) NSString *LOG_UPLOAD_TIMER;
@property (nonatomic, copy) NSString *GEN_VIDEO_WITH_IMAGE;
/// 是否支持从相册选择
@property (nonatomic, copy) NSString *OCR_SOURCE_ALBUM;
/// iOS 改变屏幕亮度的方式是否为突变 (默认为渐变)
@property (nonatomic, copy) NSString *SET_BRIGHTNESS_DIRECTLY;
//处理后数据
@property (nonatomic, assign) BOOL urlSessionDegrade;
- (void)setConfigString:(NSString *)string;
- (void)updateConfig;
@end
@@ -0,0 +1,31 @@
//
// DTFServerError.h
// DTFUtility
//
// Created by mengbingchuan on 2023/7/27.
// Copyright © 2023 com.alipay.iphoneclient.zoloz. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
static NSString *const DTFServerEmptyDataError = @"DTFServerErrorEmptyData";
static NSString *const DTFServerOSSError = @"DTFServerOSSError";
@interface DTFServerError : NSError
@property(nonatomic, copy) NSString *retCode;
@property(nonatomic, copy) NSString *retcodeSub;
@property(nonatomic, copy) NSString *reason;
@property(nonatomic, copy) NSString *comment;
+ (instancetype)errorWithReason:(NSString *)reason comment:(nullable NSString *)comment;
+ (instancetype)errorWithRetCode:(NSString *)code;
+ (instancetype)errorWithRetCodeSub:(NSString *)code;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,22 @@
//
// DTFStringsManager.h
// DTFUtility
//
// Created by mengbingchuan on 2024/1/23.
// Copyright © 2024 com.alipay.iphoneclient.zoloz. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface DTFStringsUtils : NSObject
+ (NSString *)faceStringWithKey:(NSString *)key;
+ (NSString *)docStringWithKey:(NSString *)key;
+ (NSString *)guideStringWithKey:(NSString *)key;
+ (NSString *)getAbsolutePathWithBundle:(NSString *)bundleName class:(Class)cls fileName:(NSString *)fileName;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,405 @@
//
// DTFUICustomConfig.h
// DTFUtility
//
// Created by 汪澌哲 on 2024/1/7.
// Copyright © 2024 com.alipay.iphoneclient.zoloz. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface DTFGuideConfig : NSObject
@property (copy, nonatomic) NSString *titleColor;
@property (copy, nonatomic) NSString *titleBackPath;
@property (copy, nonatomic) NSString *titleBackBase64;
@property (copy, nonatomic) NSString *titleClosePath;
@property (copy, nonatomic) NSString *titleCloseBase64;
@property (copy, nonatomic) NSString *bannerImg;
@property (copy, nonatomic) NSString *agrtTopTipsColor;
@property (copy, nonatomic) NSString *agrtUnSelColor;
@property (copy, nonatomic) NSString *agrtSelBgColor;
@property (copy, nonatomic) NSString *agrtAgreeColor;
@property (copy, nonatomic) NSString *agrtColor;
@property (copy, nonatomic) NSString *startBtnColor;
@property (copy, nonatomic) NSString *agrtBotTipsColor;
@property (copy, nonatomic) NSString *startBtnDisColor;
@property (copy, nonatomic) NSString *startBtnBgColor;
@property (copy, nonatomic) NSString *startBtnDisBgColor;
@property (copy, nonatomic) NSString *elderBtnDisColor;
@property (copy, nonatomic) NSString *elderBtnBgColor;
@property (copy, nonatomic) NSString *elderBtnDisBgColor;
@property (copy, nonatomic) NSString *exitBtnColor;
@property (copy, nonatomic) NSString *exitBtnBgColor;
@property (copy, nonatomic) NSString *rareFormNameColor;
@property (copy, nonatomic) NSString *rareFormIDColor;
@property (copy, nonatomic) NSString *elderBtnColor;
@property (copy, nonatomic) NSString *rareFormEntBtnColor;
@property (copy, nonatomic) NSString *permissionDialogConfirmColor;
@property (copy, nonatomic) NSString *permissionToastTitleColor;
@property (copy, nonatomic) NSString *permissionToastMsgColor;
@property (copy, nonatomic) NSString *permissionToastBgColor;
@property (copy, nonatomic) NSString *dialogExitTitleColor;
@property (copy, nonatomic) NSString *dialogExitMsgColor;
@property (copy, nonatomic) NSString *dialogExitCancelColor;
@property (copy, nonatomic) NSString *dialogExitConfirmColor;
@property (copy, nonatomic) NSString *dialogPermissionFailedTitleColor;
@property (copy, nonatomic) NSString *dialogPermissionFailedMsgColor;
@property (copy, nonatomic) NSString *dialogPermissionFailedConfirmColor;
@property (copy, nonatomic) NSString *dialogPermissionFailedCancelColor;
@property (copy, nonatomic) NSString *dialogSupportFailedTitleColor;
@property (copy, nonatomic) NSString *dialogSupportFailedMsgColor;
@property (copy, nonatomic) NSString *dialogSupportFailedConfirmColor;
@property (copy, nonatomic) NSString *dialogNetworkFailedTitleColor;
@property (copy, nonatomic) NSString *dialogNetworkFailedMsgColor;
@property (copy, nonatomic) NSString *dialogNetworkFailedConfirmColor;
@property (copy, nonatomic) NSString *settingFailReason;
@property (copy, nonatomic) NSDictionary *originMap;
@end
@interface DTFFaceConfig : NSObject
@property (copy, nonatomic) NSString *faceBgColor;
@property (copy, nonatomic) NSString *faceTitleColor;
@property (copy, nonatomic) NSString *circleTxtBgAlpha;
@property (copy, nonatomic) NSString *dialogBgAlpha;
@property (copy, nonatomic) NSString *faceProgressStartColor;
@property (copy, nonatomic) NSString *faceProgressEndColor;
@property (copy, nonatomic) NSString *circleTxtColor;
@property (copy, nonatomic) NSString *exitIconPath;
@property (copy, nonatomic) NSString *exitIconBase64;
@property (copy, nonatomic) NSString *submitTextColor;
@property (copy, nonatomic) NSString *submitLoadingIconBase64;
@property (copy, nonatomic) NSString *submitLoadingIconPath;
@property (copy, nonatomic) NSString *dialogExitTitleColor;
@property (copy, nonatomic) NSString *dialogExitMsgColor;
@property (copy, nonatomic) NSString *dialogExitCancelColor;
@property (copy, nonatomic) NSString *dialogExitConfirmColor;
@property (copy, nonatomic) NSString *dialogTimeOutTitleColor;
@property (copy, nonatomic) NSString *dialogTimeOutMsgColor;
@property (copy, nonatomic) NSString *dialogTimeOutConfirmColor;
@property (copy, nonatomic) NSString *dialogNetworkFailedTitleColor;
@property (copy, nonatomic) NSString *dialogNetworkFailedMsgColor;
@property (copy, nonatomic) NSString *dialogNetworkFailedConfirmColor;
@property (copy, nonatomic) NSString *dialogArchSysFailedTitleColor;
@property (copy, nonatomic) NSString *dialogArchSysFailedMsgColor;
@property (copy, nonatomic) NSString *dialogArchSysFailedConfirmColor;
@property (copy, nonatomic) NSString *dialogTooManyRetriesTitleColor;
@property (copy, nonatomic) NSString *dialogTooManyRetriesMsgColor;
@property (copy, nonatomic) NSString *dialogTooManyRetriesConfirmColor;
@property (copy, nonatomic) NSString *dialogInterruptTitleColor;
@property (copy, nonatomic) NSString *dialogInterruptMsgColor;
@property (copy, nonatomic) NSString *dialogInterruptConfirmColor;
@property (copy, nonatomic) NSString *dialogInterruptCancelColor;
@property (copy, nonatomic) NSString *dialogSDKErrTitleColor;
@property (copy, nonatomic) NSString *dialogSDKErrMsgColor;
@property (copy, nonatomic) NSString *dialogSDKErrConfirmColor;
@property (copy, nonatomic) NSString *dialogCamOpenFailedTitleColor;
@property (copy, nonatomic) NSString *dialogCamOpenFailedMsgColor;
@property (copy, nonatomic) NSString *dialogCamOpenFailedConfirmColor;
@property (copy, nonatomic) NSString *dialogCamOpenFailedCancelColor;
@property (copy, nonatomic) NSString *noticeIconPath;
@property (copy, nonatomic) NSString *noticeIconBase64;
@property (copy, nonatomic) NSString *noticeTxtColor;
@property (copy, nonatomic) NSString *noticeBgColor;
@property (copy, nonatomic) NSString *suitableExitBtnColor;
@property (copy, nonatomic) NSString *suitableExitTxtColor;
@property (copy, nonatomic) NSString *audioOnIconBase64;
@property (copy, nonatomic) NSString *audioOnIconPath;
@property (copy, nonatomic) NSString *audioOffIconBase64;
@property (copy, nonatomic) NSString *audioOffIconPath;
@property (copy, nonatomic) NSString *settingFailReason;
@property (copy, nonatomic) NSString *dialogConfirmBgColor;//弹框确认按钮背景颜色
@property (copy, nonatomic) NSString *dialogCancelBgColor;//弹框取消按钮背景颜色
@end
@interface DTFDocConfig : NSObject
//@property (copy, nonatomic) NSString *infoPageBgColor;//ocr识别信息页背景色0
//@property (copy, nonatomic) NSString *infoDeviderColor;//分隔条颜色(默认灰色)0
@property (copy, nonatomic) NSString *exitIconPath;//关闭按钮路径
@property (copy, nonatomic) NSString *exitIconBase64;//关闭按钮base64
@property (copy, nonatomic) NSString *stageSelectedBgPath;//进度条节点选中背景图片
@property (copy, nonatomic) NSString *stageSelectedBgBase64;//进度条节点选中背景图片base64
@property (copy, nonatomic) NSString *stageDefaultBgPath;//进度条节点默认背景图片
@property (copy, nonatomic) NSString *stageDefaultBgBase64;//进度条节点默认背景图片base64
@property (copy, nonatomic) NSString *stageDoneBgPath;//进度条完成节点背景图片路径
@property (copy, nonatomic) NSString *stageDoneBgBase64;//进度条完成节点背景图片base64
@property (copy, nonatomic) NSString *stageLineDefaultColor;//进度条横线默认颜色
@property (copy, nonatomic) NSString *stageLineSelectedColor;//进度条横线颜色
@property (copy, nonatomic) NSString *stageSelectedTxtColor;//进度条文字选中状态颜色
@property (copy, nonatomic) NSString *stageDefaultTxtColor;//进度条文字默认状态颜色
@property (copy, nonatomic) NSString *infoTipsColor;//图片显示框上方提示文案颜色
@property (copy, nonatomic) NSString *bottomTipsColor;//图片显示框下方提示文案颜色
@property (copy, nonatomic) NSString *takeRequestColor;//“拍摄要求”文字颜色
@property (copy, nonatomic) NSString *takeRequestTitleColor;//“拍摄要求”弹框标题颜色
@property (copy, nonatomic) NSString *takeRequestExitIconPath;//拍摄要求弹框关闭按钮图片
@property (copy, nonatomic) NSString *takeRequestExitIconBase64;//拍摄要求弹框关闭按钮图片base64
@property (copy, nonatomic) NSString *takeRequestImgPath;//拍摄要求图片
@property (copy, nonatomic) NSString *takeRequestImgBase64;//拍摄要求图片base64
@property (copy, nonatomic) NSString *takeEnterIconPath;//拍摄图标(拍摄页面入口)
@property (copy, nonatomic) NSString *takeEnterIconBase64;//拍摄图标(拍摄页面入口)base64
@property (copy, nonatomic) NSString *frontDefaultImgPath;//身份证正面(人像面)默认图片
@property (copy, nonatomic) NSString *frontDefaultImgBase64;//身份证正面(人像面)默认图片base64
@property (copy, nonatomic) NSString *backDefaultImgPath;//身份证反面(国徽面)默认图片
@property (copy, nonatomic) NSString *backDefaultImgBase64;//身份证反面(国徽面)默认图片base64
@property (copy, nonatomic) NSString *infoNoticeIconPath;//识别信息确认提示图标
@property (copy, nonatomic) NSString *infoNoticeIconBase64;//识别信息确认提示图标base64
@property (copy, nonatomic) NSString *infoNoticeBgColor;//识别信息确认提示”背景色
@property (copy, nonatomic) NSString *infoNoticeTxtColor;//“识别信息确认提示”文字颜色
@property (copy, nonatomic) NSString *infoCertNameColor;//“姓名”颜色
@property (copy, nonatomic) NSString *infoCertNoColor;//“身份证号”颜色
@property (copy, nonatomic) NSString *resultCertNameColor;//识别结果姓名颜色
@property (copy, nonatomic) NSString *resultCertNoColor;//识别结果身份证号颜色
@property (copy, nonatomic) NSString *infoHintColor;//姓名/身份证号未填写提示颜色
//@property (copy, nonatomic) NSString *cleanIconPath;//删除图标路径🚨iOS不用
//@property (copy, nonatomic) NSString *cleanIconBase64;//删除图标base64🚨iOS不用
@property (copy, nonatomic) NSString *nextBgColor;//页面底部按钮背景色
@property (copy, nonatomic) NSString *nextTxtColor;//页面底部按钮文案背景色
@property (copy, nonatomic) NSString *nextDisableBgColor;//页面底部按钮不可用时背景色
@property (copy, nonatomic) NSString *nextDisableTxtColor;//页面底部按钮不可用时文字颜色
@property (copy, nonatomic) NSString *dialogIdentifyFailTitleColor;//识别失败弹框title颜色
@property (copy, nonatomic) NSString *dialogIdentifyFailExitIconPath;//识别失败弹框关闭按钮图标
@property (copy, nonatomic) NSString *dialogIdentifyFailExitIconBase64;//识别失败弹框关闭按钮图标base64
@property (copy, nonatomic) NSString *dialogIdentifyFailImgPath;//识别失败弹框图片
@property (copy, nonatomic) NSString *dialogIdentifyFailImgBase64;//识别失败弹框图片base64
@property (copy, nonatomic) NSString *dialogIdentifyFailTxtColor;//识别失败弹框中“证件图像未符合要求”文字颜色
@property (copy, nonatomic) NSString *dialogIdentifyFailHintColor;//识别失败弹框中“请按要求拍摄...”文字颜色
@property (copy, nonatomic) NSString *dialogIdentifyFailConfirmColor;//识别失败弹框,"重新拍摄"按钮文字颜色
//@property (copy, nonatomic) NSString *dialogNetworkErrTitleColor;//"网络异常"弹框标题颜色0
//@property (copy, nonatomic) NSString *dialogNetworkErrMsgColor;//dialogNetworkErrMsgColor 0
//@property (copy, nonatomic) NSString *dialogNetworkErrConfirmColor; //0
//@property (copy, nonatomic) NSString *dialogNetworkErrCancelColor; //0
//@property (copy, nonatomic) NSString *dialogExitTitleColor;//退出弹框标题颜色0
//@property (copy, nonatomic) NSString *dialogExitMsgColor;//0
@property (copy, nonatomic) NSString *dialogExitConfirmColor;
//@property (copy, nonatomic) NSString *dialogExitCancelColor;//0
//@property (copy, nonatomic) NSString *dialogFailTooManyTitleColor;//0
//@property (copy, nonatomic) NSString *dialogFailTooManyMsgColor;//0
//@property (copy, nonatomic) NSString *dialogFailTooManyConfirmColor;//0
//@property (copy, nonatomic) NSString *dialogNoPermissionTitleColor;//摄像头🚨0
//@property (copy, nonatomic) NSString *dialogNoPermissionMsgColor;//0
//@property (copy, nonatomic) NSString *dialogNoPermissionCancelColor;//0
//@property (copy, nonatomic) NSString *dialogNoPermissionToSureColor;//0
@property (copy, nonatomic) NSString *livenessTipsColor;
@property (copy, nonatomic) NSString *livenessMsgColor;
@property (copy, nonatomic) NSString *livenessImgPath;//实人认证过渡图片
@property (copy, nonatomic) NSString *livenessImgBase64;//实人认证过渡图片base64
//@property (copy, nonatomic) NSString *livenessLoadingImgPath;//loading图片
//@property (copy, nonatomic) NSString *livenessLoadingImgBase64;//loading图片base64
@property (copy, nonatomic) NSString *livenessLoadingMsgColor;//loading 文字颜色00
@property (copy, nonatomic) NSString *livenessLoadingBgColor;//loading 背景色00
@property (copy, nonatomic) NSString *takePhotoCoverAlpha;//拍照页蒙层透明度
@property (copy, nonatomic) NSString *takePhotoExitIconPath;//关闭拍照页按钮图标
@property (copy, nonatomic) NSString *takePhotoExitIconBase64;//关闭拍照页按钮图标base64
@property (copy, nonatomic) NSString *flashOnIconPath;//闪光灯打开状态图标
@property (copy, nonatomic) NSString *flashOnIconBase64;//闪光灯打开状态图标base64
@property (copy, nonatomic) NSString *flashOffIconPath;//闪光灯关闭状态图标
@property (copy, nonatomic) NSString *flashOffIconBase64;//闪光灯关闭状态图标base64
@property (copy, nonatomic) NSString *takeTipsColor;//拍照提示文案颜色
@property (copy, nonatomic) NSString *takePhotoIconPath;//拍摄按钮图标
@property (copy, nonatomic) NSString *takePhotoIconBase64;//拍摄按钮图标base64
@property (copy, nonatomic) NSString *photoRetakeIconPath;//重拍按钮
@property (copy, nonatomic) NSString *photoRetakeIconBase64;//重拍按钮base64
@property (copy, nonatomic) NSString *photoConfirmIconPath;//确认照片图标
@property (copy, nonatomic) NSString *photoConfirmIconBase64;//确认图标base64
@property (copy, nonatomic) NSString *takePhotoRectPath;//证件框图片
@property (copy, nonatomic) NSString *takePhotoRectBase64;//证件框图片base64
/// 图片来源弹框“取消”字体颜色
@property (copy, nonatomic) NSString *chooseCancelColor;
/// 图片来源弹框“拍照”字体颜色
@property (copy, nonatomic) NSString *chooseTakePhotoColor;
/// 图片来源弹框“从相册中选择”字体颜色
@property (copy, nonatomic) NSString *chooseFromAlbumColor;
/// 弹窗遮罩的颜色
@property (copy, nonatomic) NSString *ocrActionSheetMaskColor;
@property (copy, nonatomic) NSString *settingFailReason;
@end
@interface DTFNFCConfig : NSObject
@property (copy, nonatomic) NSString *settingFailReason;
@property (copy, nonatomic) NSString *configTitleColor;
@property (copy, nonatomic) NSString *passportNoColor;
@property (copy, nonatomic) NSString *passportHintColor;
@property (copy, nonatomic) NSString *passportNoValueColor;
@property (copy, nonatomic) NSString *birthdayColor;
@property (copy, nonatomic) NSString *birthdayHintColor;
@property (copy, nonatomic) NSString *birthdayValueColor;
@property (copy, nonatomic) NSString *validityColor;
@property (copy, nonatomic) NSString *validityHintColor;
@property (copy, nonatomic) NSString *validityValueColor;
@property (copy, nonatomic) NSString *chooseIconPath;
@property (copy, nonatomic) NSString *chooseIconBase64;
@property (copy, nonatomic) NSString *nextBtnDisableBgColor;
@property (copy, nonatomic) NSString *nextBtnDisableTxtColor;
@property (copy, nonatomic) NSString *configExitIconBase64;
@property (copy, nonatomic) NSString *configExitIconPath;
@property (copy, nonatomic) NSString *nextBtnEnableBgColor;
@property (copy, nonatomic) NSString *nextBtnEnableTxtColor;
@property (copy, nonatomic) NSString *datePickerConfirmColor;
@property (copy, nonatomic) NSString *datePickerCancelColor;
@property (copy, nonatomic) NSString *datePickerSelectedColor;
@property (copy, nonatomic) NSString *datePickerBgColor;
@property (copy, nonatomic) NSString *dialogConfigErrTitleColor;
@property (copy, nonatomic) NSString *dialogConfigErrMsgColor;
@property (copy, nonatomic) NSString *dialogConfigErrConfirmColor;
@property (copy, nonatomic) NSString *readTitleColor;
@property (copy, nonatomic) NSString *readExitIconPath;
@property (copy, nonatomic) NSString *readExitIconBase64;
@property (copy, nonatomic) NSString *readBackIconPath;
@property (copy, nonatomic) NSString *readBackIconBase64;
@property (copy, nonatomic) NSString *readHintColor;
@property (copy, nonatomic) NSString *readBtnTxtColor;
@property (copy, nonatomic) NSString *readBtnBgColor;
@property (copy, nonatomic) NSString *readDialogTitleColor;
@property (copy, nonatomic) NSString *readDialogBgColor;
@property (copy, nonatomic) NSString *readDialogBtnTxtColor;
@property (copy, nonatomic) NSString *readDialogBtnBgColor;
@property (copy, nonatomic) NSString *readDialogHintColor;
@property (copy, nonatomic) NSString *readingAnimBgPath;
@property (copy, nonatomic) NSString *readingAnimBgBase64;
@property (copy, nonatomic) NSString *animSignLightColor;
@property (copy, nonatomic) NSString *animSignDarkColor;
@property (copy, nonatomic) NSString *animIDCardPath;
@property (copy, nonatomic) NSString *animIDCardBase64;
@property (copy, nonatomic) NSString *animPassportPath;
@property (copy, nonatomic) NSString *animPassportBase64;
@property (copy, nonatomic) NSString *animFingerPath;
@property (copy, nonatomic) NSString *animFingerBase64;
@property (copy, nonatomic) NSString *phoneFrameColor;
@property (copy, nonatomic) NSString *phoneBgColor;
@property (copy, nonatomic) NSString *dialogReadCardTitleColor;
@property (copy, nonatomic) NSString *dialogReadCardMsgColor;
@property (copy, nonatomic) NSString *dialogReadCardConfirmColor;
@end
@interface DTFUICustomConfig : NSObject
@property (strong, nonatomic) DTFGuideConfig *guideConfig;
@property (strong, nonatomic) DTFFaceConfig *faceConfig;
@property (strong, nonatomic) DTFDocConfig *docConfig;
@property (strong, nonatomic) DTFNFCConfig *nfcConfig;
- (instancetype)initWithString:(NSString *)string type:(NSString *)type error:(NSError **)error;
+ (NSString *)checkValueFailt:(NSString *)value key:(NSString *)key;
+ (void)setDefaultForKey:(NSString *)key object:(NSObject *)object ;
+ (void)checkKeyFaultWithDict:(NSDictionary *)dict propertyName:(NSMutableSet *)propertyName settingFailReason:(NSString *)settingFailReason;
+ (NSString *)setValueForKeyWithClass:(NSObject *)object params:(NSDictionary *)params;
+ (UIImage *)getImageWithBse64:(NSString *)base64Str path:(NSString *)path;
+ (UIImage *)submitLoadingIcon;
+ (UIImage *)noticeIcon;
+ (UIImage *)titleCloseIcon;
+ (UIImage *)titleBackIcon;
+ (UIImage *)exitIcon;
+ (UIImage *)audioOnIcon;
+ (UIImage *)audioOffIcon;
+ (UIImage *)ocrExitIcon;//ocr 退出exitIconPath
+ (UIImage *)ocrStageSelectedBgIcon;// stageSelectedBgPath
+ (UIImage *)ocrStageDefaultBgIcon;//stageDefaultBgPath
+ (UIImage *)ocrStageDoneBgIcon;//stageDoneBgPath
+ (UIImage *)ocrTakeRequestIcon;//takeRequestImgPath
+ (UIImage *)ocrTakeEnterIcon;//takeEnterIconPath
+ (UIImage *)ocrFrontDefaultIcon;//frontDefaultImgPath
+ (UIImage *)ocrBackDefaultIcon;//backDefaultImgPath
+ (UIImage *)ocrInfoNoticeIcon;//infoNoticeIconPath
+ (UIImage *)ocrDialogIdentifyFailExitIcon;//dialogIdentifyFailExitIconPath
+ (UIImage *)ocrDialogIdentifyFailIcon;//dialogIdentifyFailImgPath
+ (UIImage *)ocrLivenessIcon;//livenessImgPath
+ (UIImage *)ocrTakePhotoExitIcon;//takePhotoExitIconPath
+ (UIImage *)ocrFlashOnIcon;//flashOnIconPath
+ (UIImage *)ocrFlashOffIcon;//flashOffIconPath
+ (UIImage *)ocrTakePhotoIcon;//takePhotoIconPath
+ (UIImage *)ocrPhotoRetakeIcon;//photoRetakeIconPath
+ (UIImage *)ocrPhotoConfirmIcon;//photoConfirmIconPath
+ (UIImage *)ocrTakePhotoRectIcon;//takePhotoRectPath
+ (UIImage *)ocrTakeRequestExitIcon;//takeRequestExitIconPath
/// 护照 选择日期
+ (UIImage *)nfcChooseIcon;
/// 护照 退出按钮
+ (UIImage *)nfcConfigExitIcon;
/// 证件识别Vc 退出 (护照)
+ (UIImage *)nfcReadExitIcon;
/// 证件识别Vc 退出 (身份证)
+ (UIImage *)nfcReadBackIcon;
/// nfc 图片
+ (UIImage *)nfcReadingAnimBgIcon;
/// 身份证图片
+ (UIImage *)nfcAnimIDCardIcon;
/// 护照图片
+ (UIImage *)nfcAnimPassportIcon;
/// 手指图片
+ (UIImage *)nfcAnimFingerIcon;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,42 @@
//
// DTFUtility.h
// DTFUtility
//
// Created by richard on 2018/8/10.
// Copyright © 2018 com. .iphoneclient.DTF. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for DTFUtility.
FOUNDATION_EXPORT double DTFUtilityVersionNumber;
//! Project version string for DTFUtility.
FOUNDATION_EXPORT const unsigned char DTFUtilityVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <DTFUtility/PublicHeader.h>
#import <DTFUtility/APBSystem.h>
#import <DTFUtility/NSObject+APBJSON.h>
#import <DTFUtility/NSObject+DTFUtilityJsonString.h>
#import <DTFUtility/APBUtils.h>
#import <DTFUtility/DTFLogMonitor.h>
#import <DTFUtility/DTFMonitorCommonData.h>
#import <DTFUtility/DTFConfiguration.h>
#import <DTFUtility/DTFMutableSetting.h>
#import <DTFUtility/ZimInitRequest.h>
#import <DTFUtility/ZimInitResponse.h>
#import <DTFUtility/ZimValidateRequest.h>
#import <DTFUtility/ZimValidateResponse.h>
#import <DTFUtility/ZFaceVerifyInfo.h>
#import <DTFUtility/ZimModelDownloader.h>
#import <DTFUtility/ZIMResponse.h>
#import <DTFUtility/CameraService.h>
#import <DTFUtility/NSString+DTFBase64.h>
#import <DTFUtility/DTFConstant.h>
#import <DTFUtility/DTFServerError.h>
#import <DTFUtility/APBToygerBioBisConfigManager.h>
#import <DTFUtility/APBToygerRemoteConfig.h>
#import <DTFUtility/APBBisProtocol.h>
#import <DTFUtility/ToygerBaseModel.h>
@@ -0,0 +1,21 @@
//
// NSData+DTFJSON.h
// DTFUtility
//
// Created by mengbingchuan on 2024/7/10.
// Copyright © 2024 com.alipay.iphoneclient.zoloz. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface NSData (DTFJSON)
- (NSDictionary *)dtf_jsonDictionaryError:(NSError **)error;
- (NSMutableDictionary *)dtf_jsonMutableDictionaryError:(NSError **)error;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,20 @@
//
// NSDictionary+DTFJSON.h
// DTFUtility
//
// Created by mengbingchuan on 2024/7/15.
// Copyright © 2024 com.alipay.iphoneclient.zoloz. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface NSDictionary (DTFJSON)
- (NSString *)dtf_jsonStringError:(NSError **)error;
- (NSData *)dtf_jsonDataError:(NSError **)error;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,55 @@
//
// NSObject+APBJSON.h
// BioAuthEngine
//
// Created by yukun.tyk on 9/13/16.
// Copyright © 2016 DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSObject (APBJSON)
/**
* JSON encoder
*
* NSarray只支持一级列表,原生类型只支持NSInteger, CGFloat, BOOL
*
* 如果编码失败,会抛异常
*
* @return JSON string
*/
- (NSString *)APBToJSON;
- (NSDictionary *)APBToDict;
- (NSDictionary *)APBToDict:(BOOL)valueCanBeNil;
/**
* JSON decoder
*
* @param json JSON string
*
* NSarray只支持一级列表,原生类型只支持NSInteger, CGFloat, BOOL
*
* 如果解析失败,会抛异常
*
* @return JSON object
*/
+ (instancetype)APBLoadFromJSON:(NSString *)json;
+ (instancetype)APBLoadFrom:(NSDictionary *)dict forObject:(id) obj;
- (void)APBOverrideFromJSON:(NSString *)json;
- (void)APBOverrideFromJSONData:(NSData *)json;
/**
* JSON encoder
*
* NSarray只支持一级列表,原生类型只支持NSInteger, CGFloat, BOOL
* canTolerateNil为YES ,如果value值不存在,表示该key所对应的字段做序列化是不存在,但其他字段继续做序列化
* 如果为NO,表示不容忍任何value值为nil,直接返回序列化结果为nil
* 如果value值为NSData类型,那么在做序列话时,该字段会被删掉,这是为了兼容,而不是直接抛异常
* @return JSON string
*/
- (NSString *)classObjectToJSONWithTolerateNilChoice:(BOOL)canTolerateNil;
@end
@@ -0,0 +1,16 @@
//
// NSObject+DTFUtilityJsonString.h
// DTFUtility
//
// Created by richard on 2018/8/15.
// Copyright © 2018 com. .iphoneclient.DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSObject (DTFUtilityJsonString)
- (NSMutableDictionary *_Nonnull)dictionary;
- (id _Nonnull )idFromObject:(nonnull id)object;
@end
@@ -0,0 +1,16 @@
//
// NSObject+Toyger.h
// ToygerService
//
// Created by 王伟伟 on 2018/2/28.
// Copyright © 2018年 DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSObject (Toyger)
- (NSDictionary *_Nonnull)propertyOfClass:(Class _Nullable )aclass;
//- (NSMutableDictionary *_Nonnull)dictionary;
//- (id _Nonnull )idFromObject:(nonnull id)object;
@end
@@ -0,0 +1,26 @@
//
// NSString+DTFBase64.h
// DTFUtility
//
// Created by 汪澌哲 on 2023/1/3.
// Copyright © 2023 com.DTF.iphoneclient.zoloz. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface NSString (DTFBase64)
/**
* 转换为Base64编码
*/
- (NSString *)dtf_base64EncodedString;
/**
* 将Base64解码
*/
- (NSString *)dtf_base64DecodedString;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,21 @@
//
// NSString+DTFJSON.h
// DTFUtility
//
// Created by mengbingchuan on 2024/7/10.
// Copyright © 2024 com.alipay.iphoneclient.zoloz. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface NSString (DTFJSON)
- (NSDictionary *)dtf_jsonDictionaryError:(NSError **)error;
- (NSMutableDictionary *)dtf_jsonMutableDictionaryError:(NSError **)error;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,54 @@
//
// ToygerAlgorithmConfig.h
// ToygerService
//
// Created by 王伟伟 on 2018/2/2.
// Copyright © 2018年 DTF. All rights reserved.
//
#import <DTFUtility/ToygerBaseModel.h>
@interface ToygerAlgorithmConfig : ToygerBaseModel
@property (nonatomic, copy) NSString *stack_time;
@property (nonatomic, copy) NSString *blink_openness;
@property (nonatomic, copy) NSString *eye_openness;
@property (nonatomic, copy) NSString *eye_occlusion;
@property (nonatomic, copy) NSString *pose_pitch;
@property (nonatomic, copy) NSString *pose_yaw;
@property (nonatomic, copy) NSString *pose_gaussian;
@property (nonatomic, copy) NSString *pose_motion;
@property (nonatomic, copy) NSString *pose_pitchMin;
@property (nonatomic, copy) NSString *pose_rectwidth;
@property (nonatomic, copy) NSString *pose_integrity;
@property (nonatomic, copy) NSString *pose_light;
@property (nonatomic, copy) NSString *pose_yawMin;
@property (nonatomic, copy) NSString *lip_motion;
@property (nonatomic, copy) NSString *log_level;
@property (nonatomic, copy) NSString *min_iod;
@property (nonatomic, copy) NSString *max_iod;
@property (nonatomic, copy) NSString *quality_min_quality;
@property (nonatomic, copy) NSArray<NSString *> *liveness_combination;
@property (nonatomic, copy) NSArray *liveness_combination_retries;
@property (nonatomic, copy) NSArray *photinus_colour;
@property (nonatomic, copy) NSDictionary *threshold;
@property (nonatomic, copy) NSString *max_face_num;
@property (nonatomic, copy) NSString *detect_face_num;
@property (nonatomic, copy) NSString *speed;
@property (nonatomic, copy) NSDictionary *near_far;
@property (nonatomic, strong) NSArray <NSArray *>* photinus_colours;//随机炫彩下发序列
@property (nonatomic, assign) NSInteger algoType;
@property (nonatomic, copy) NSString * docType;
@property (nonatomic, assign) NSInteger pageNo;
@property (nonatomic, assign) CGRect rectInPic;
@property (nonatomic, assign) NSInteger rotateTimes;
@property (nonatomic, assign) NSInteger blur;
@property (nonatomic, assign) NSInteger exposure;
@property (nonatomic, copy) NSString *secProtocol;
-(void)addDragonflyDefaultConfig;
-(void)addLocalVerifyDefaultConfig;
@end
@@ -0,0 +1,21 @@
//
// ToygerBaseObject.h
// Toyger
//
// Created by 王伟伟 on 2018/1/25.
// Copyright © 2018年 DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface ToygerBaseModel : NSObject
+ (instancetype)defaultModel;
+ (instancetype)model:(id)dict;
- (NSMutableDictionary *)dictionary;
- (void)copyFromModel:(ToygerBaseModel *)model;
@end
@@ -0,0 +1,37 @@
//
// ToygerBlob.h
// ToygerAlgorithm
//
// Created by 王伟伟 on 2018/1/23.
// Copyright © 2018年 DTF. All rights reserved.
//
#ifndef USE_PB
#import <Foundation/Foundation.h>
#import "ToygerBlobElem.h"
@interface ToygerBlob : ToygerBaseModel
@property (nonatomic, copy) NSString *blobVersion;
@property (nonatomic, strong) NSMutableArray<ToygerBlobElem *> *blobElem;
@end
#else
#import <APProtocolBuffers/ProtocolBuffers.h>
@class ToygerBlobElem;
@class ToygerBlob;
@interface ToygerBlob : APDPBGeneratedMessage
@property (readonly) BOOL hasBlobVersion;
@property (nonatomic,strong) NSString* blobVersion ;
@property (nonatomic,strong) NSMutableArray<ToygerBlobElem*>* blobElem ;
@end
#endif
@@ -0,0 +1,113 @@
//
// ToygerBlobElem.h
// ToygerAlgorithm
//
// Created by 王伟伟 on 2018/1/23.
// Copyright © 2018年 DTF. All rights reserved.
//
#import "ToygerFaceInfo.h"
#ifndef USE_PB
#import <Foundation/Foundation.h>
@interface ToygerBlobElemCapture: ToygerBaseModel
@property(nonatomic, copy) NSString *action;
@property(nonatomic, strong) NSData *video;
@property(nonatomic, copy) NSString *videoMD5;
@property(nonatomic, strong) NSData *videoMeta;
@property(nonatomic, copy) NSArray *picture;
@property(nonatomic, copy) NSArray *pictureToApp;
@property(nonatomic, strong) NSNumber *isVideoEvidence;
@end
@interface ToygerBlobElem : ToygerBaseModel
/**
类型:face | doc
*/
@property (nonatomic, copy) NSString *type;
/**
子类型:pano | live | dark | depth | facefeature | surveillance | facefeature | gongan | docface
*/
@property (nonatomic, copy) NSString *subType;
///**
// 当前数据在Type中的索引
// */
//@property (nonatomic, assign) int32_t idx;
/**
当前数据在Type中的索引
*/
@property (nonatomic, strong) NSNumber *idx;
/**
数据版本,图片要求是正向的
*/
@property (nonatomic, copy) NSString *version;
/**
数据Buffer,大部分是jpeg
*/
//@property (nonatomic, strong) NSData *content;
@property (nonatomic, copy) NSString *content;
/**
多图数据
*/
@property (nonatomic, copy) NSArray<NSString *> *optionalContent;
/**
人脸信息,与content对应
*/
@property (nonatomic, strong) NSArray<ToygerFaceInfo *> *faceInfos;
@property (nonatomic, strong) NSArray<ToygerBlobElemCapture *> *capture;
/**
证件信息
*/
+ (ToygerBlobElem *)blobElemFrom:(NSString *)imageContent type:(NSString *)type subType:(NSString *)subType idx:(NSString *)idx faceInfo:(NSArray *)faceInfo;
@end
#else
#import <APProtocolBuffers/ProtocolBuffers.h>
@class ToygerBlobElem;
@class ToygerDocInfo;
@class ToygerFaceInfo;
@interface ToygerBlobElem : APDPBGeneratedMessage
@property (readonly) BOOL hasType;
@property (readonly) BOOL hasSubType;
@property (readonly) BOOL hasIdx;
@property (readonly) BOOL hasVersion;
@property (readonly) BOOL hasContent;
@property (readonly) BOOL hasDocInfo;
@property (nonatomic,strong) NSString* type ;
@property (nonatomic,strong) NSString* subType ;
@property (nonatomic) SInt32 idx ;
@property (nonatomic,strong) NSString* version ;
@property (nonatomic,strong) NSData* content ;
@property (nonatomic,strong) NSArray<ToygerFaceInfo*>* faceInfos ;
@property (nonatomic,strong) ToygerDocInfo* docInfo ;
+ (ToygerBlobElem *)blobElemFrom:(NSData *)imageContent type:(NSString *)type subType:(NSString *)subType idx:(NSString *)idx faceInfo:(NSArray *)faceInfo docInfo:(ToygerDocInfo *)docInfo;
@end
#endif
@@ -0,0 +1,120 @@
//
// BioAuthCryptoManager.hpp
// BioAuthEngine
//
// Created by yukun.tyk on 5/16/16.
// Copyright © 2016 DTF. All rights reserved.
//
#ifndef BioAuthCryptoManager_hpp
#define BioAuthCryptoManager_hpp
#import <Foundation/Foundation.h>
#include <stdio.h>
#import <functional>
#import <Foundation/NSData.h>
#import <Foundation/NSString.h>
namespace DTF {
/**
* 业务加密结果回调
*
* @param success: 加密是否成功
* @param cipher: 密文
* @param encryptedKey: RSA公钥加密的AES密钥
*/
typedef std::function<void(bool, NSData *, NSData *)> completionCallback;
class ToygerCryptoManager{
public:
/**
* 1. 随机生成128位AES私钥
* 2. 利用ASE私钥加密业务数据
* 3. 利用RSA公钥加密AES密钥
*
* @param content 代价密数据
* @param pubKey RSA公钥
* @param callback 加密成功后callback
*/
static void mixEncrypt(NSData *content, NSString *pubKey, completionCallback callback);
/**
* AES加密
*
* @param content 业务数据
* @param aesKey AES密钥
*
* @return 密文,失败则返回Nil
*/
static NSData *AESEncrypt(NSData *content, NSString *aesKey ,NSUInteger value=0);
//获取md5值
static NSString *MD5WithData(NSData *data);
/**
* AES解密
*
* @param content 业务数据
* @param aesKey AES密钥
*
* @return 解密后数据,失败则返回Nil
*/
static NSData *AESDecrypt(NSData *content, NSString *aesKey);
/**
* 1024位RSA加密
*
* @param content 待加密数据,不得超过128位
* @param pubKey RSA公钥
*
* @return 密文,失败返回nil
*/
static NSData *RSAEncrypt(NSData *content, NSString *pubKey);
/**
* 检查数据签名
*
* @param content 业务数据
* @param signature 签名信息
* @param pubKey RSA公钥
*
* @return 签名是够正确
*/
static BOOL checkSign(NSData *content, NSData *signature, NSString *pubKey);
/**
* 计算MD5
*
* @param str 业务数据
*
* @return MD5值
*/
static NSString *calculateMD5(NSString *str);
/**
* 生成UUID
*/
static NSString *generateUUID();
// /**
// * RC4编码
// */
// static NSData *RC4Crypt(NSData *data, int code);
// private:
/**
* 生成随机字符串
*
* @param len 随机字符串长度,最长32个字节
*
* @return 生成的随机字符串
*/
static NSString *generateToken(NSInteger len);
private:
static NSData *stripPublicKeyHeader(NSData *pubKey);
static SecKeyRef addPublicKey(NSString *pubKey);
};
}
#endif /* BioAuthCryptoManager_hpp */
@@ -0,0 +1,22 @@
//
// ToygerData.h
// BioAuthEngine
//
// Created by 晗羽 on 25/04/2018.
// Copyright © 2018 DTF. All rights reserved.
//
#ifndef ToygerData_h
#define ToygerData_h
#endif /* ToygerData_h */
#import "ToygerBlob.h"
#import "ToygerBlobElem.h"
#import "ToygerFaceInfo.h"
#import "ToygerMeta.h"
#import "ToygerPoint.h"
#import "ToygerRect.h"
#import "ToygerUploadContent.h"
@@ -0,0 +1,85 @@
//
// ToygerFaceInfo.h
// ToygerAlgorithm
//
// Created by 王伟伟 on 2018/1/23.
// Copyright © 2018年 DTF. All rights reserved.
//
#import "ToygerPoint.h"
#import "ToygerRect.h"
//#include "Toyger.h"
#ifndef USE_PB
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface ToygerFaceInfo : ToygerBaseModel
/**
人脸框,绝对坐标:左上右下
*/
@property (nonatomic, copy) ToygerRect *rect;
/**
人脸关键点信息,绝对坐标
*/
@property (nonatomic, copy) NSArray<ToygerPoint *> *points;
/**
置信度
*/
@property (nonatomic, copy) NSString *confidence;
/**
质量分
*/
@property (nonatomic, copy) NSString *quality;
/**
<#Description#>
*/
@property (nonatomic, copy) NSString *feature;
/**
<#Description#>
*/
@property (nonatomic, copy) NSString *feaVersion;
//- (instancetype)initWithFaceAttr:(TGFaceAttr)attr image:(UIImage *)image;
@end
#else
#import <APProtocolBuffers/ProtocolBuffers.h>
@class ToygerPoint;
@class ToygerFaceInfo;
@class ToygerRect;
@interface ToygerFaceInfo : APDPBGeneratedMessage
@property (readonly) BOOL hasRect;
@property (readonly) BOOL hasConfidence;
@property (readonly) BOOL hasQuality;
@property (readonly) BOOL hasFeature;
@property (readonly) BOOL hasFeaVersion;
@property (nonatomic,strong) ToygerRect* rect ;
@property (nonatomic,strong) NSArray<ToygerPoint*>* points ;
@property (nonatomic) Float32 confidence ;
@property (nonatomic) Float32 quality ;
@property (nonatomic,strong) NSString* feature ;
@property (nonatomic,strong) NSString* feaVersion ;
//- (instancetype)initWithFaceAttr:(TGFaceAttr)attr image:(UIImage *)image;
@end
#endif
@@ -0,0 +1,65 @@
//
// ToygerMeta.h
// ToygerService
//
// Created by 王伟伟 on 2018/2/1.
// Copyright © 2018年 DTF. All rights reserved.
//
#ifndef USE_PB
#import <DTFUtility/ToygerBaseModel.h>
@interface ToygerMeta : ToygerBaseModel
/**
比对算法类型:fpp|zface|zdoc
*/
@property (nonatomic, copy) NSString *type;
/**
客户端比对模式中,客户端比对分数和活体分数
*/
@property (nonatomic, copy) NSDictionary *score;
/**
客户端采集数据的信息:主要是证件宝使用:
@{
@"docType": @"00860001",
@"pageNo": @"1"
}
*/
@property (nonatomic, copy) NSDictionary *collectInfo;
@property (nonatomic, copy) NSString *collectInfoSig;
/**
blob数据序列化类型
*/
@property (nonatomic, strong) NSNumber *serialize;
@end
#else
#import <APProtocolBuffers/ProtocolBuffers.h>
@class ToygerMeta;
@interface ToygerMeta : APDPBGeneratedMessage
@property (readonly) BOOL hasVersion;
@property (readonly) BOOL hasType;
@property (readonly) BOOL hasScoreStr;
@property (readonly) BOOL hasCollectInfoStr;
@property (readonly) BOOL hasSerialize;
@property (nonatomic,strong) NSString* version ;
@property (nonatomic,strong) NSString* type ;
@property (nonatomic,strong) NSString* scoreStr ;
@property (nonatomic,strong) NSString* collectInfoStr ;
@property (nonatomic) SInt32 serialize ;
@end
#endif
@@ -0,0 +1,34 @@
//
// ToygerPoint.h
// ToygerService
//
// Created by 王伟伟 on 2018/3/24.
// Copyright © 2018年 DTF. All rights reserved.
//
#ifndef USE_PB
#import <DTFUtility/ToygerBaseModel.h>
@interface ToygerPoint : ToygerBaseModel
@property (nonatomic, assign) NSInteger x;
@property (nonatomic, assign) NSInteger y;
@end
#else
#import <APProtocolBuffers/ProtocolBuffers.h>
@class ToygerPoint;
@interface ToygerPoint : APDPBGeneratedMessage
@property (readonly) BOOL hasX;
@property (readonly) BOOL hasY;
@property (nonatomic) Float32 x ;
@property (nonatomic) Float32 y ;
@end
#endif
@@ -0,0 +1,41 @@
//
// ToygerRect.h
// ToygerService
//
// Created by 王伟伟 on 2018/3/24.
// Copyright © 2018年 DTF. All rights reserved.
//
#ifndef USE_PB
#import <DTFUtility/ToygerBaseModel.h>
@interface ToygerRect : ToygerBaseModel
@property (nonatomic, assign) NSInteger left;
@property (nonatomic, assign) NSInteger top;
@property (nonatomic, assign) NSInteger right;
@property (nonatomic, assign) NSInteger bottom;
@end
#else
#import <APProtocolBuffers/ProtocolBuffers.h>
@class ToygerRect;
@interface ToygerRect : APDPBGeneratedMessage
@property (readonly) BOOL hasLeft;
@property (readonly) BOOL hasTop;
@property (readonly) BOOL hasRight;
@property (readonly) BOOL hasBottom;
@property (nonatomic) SInt32 left ;
@property (nonatomic) SInt32 top ;
@property (nonatomic) SInt32 right ;
@property (nonatomic) SInt32 bottom ;
@end
#endif
@@ -0,0 +1,18 @@
//
// ToygerUploadConfig.h
// ToygerService
//
// Created by 王伟伟 on 2018/2/2.
// Copyright © 2018年 DTF. All rights reserved.
//
#import <DTFUtility/ToygerBaseModel.h>
@interface ToygerUploadConfig : ToygerBaseModel
@property (nonatomic, copy) NSString *minquality; //TODO:delete
@property (nonatomic, copy) NSString *upload_compress_rate;
@property (nonatomic, copy) NSString *mode;
@property (nonatomic, strong) NSNumber *desiredWidth;
@property (nonatomic, copy) NSString *log_classifier;
@property (nonatomic, copy) NSArray *collection;
@end
@@ -0,0 +1,47 @@
//
// ToygerUploadContent.h
// ToygerService
//
// Created by 王伟伟 on 2018/2/1.
// Copyright © 2018年 DTF. All rights reserved.
//
#import "ToygerMeta.h"
#import "ToygerBlob.h"
#ifndef USE_PB
#import <DTFUtility/ToygerBaseModel.h>
@interface ToygerUploadContent : ToygerBaseModel
@property (nonatomic, strong) ToygerMeta *meta;
@property (nonatomic, strong) ToygerBlob *blob;
- (NSData *)uploadData;
- (NSString *)uploadString;
- (BOOL)loadMap:(NSDictionary *)map;
@end
#else
#import <APProtocolBuffers/ProtocolBuffers.h>
@class ToygerUploadContent;
@class ToygerBlob;
@class ToygerMeta;
@interface ToygerUploadContent : APDPBGeneratedMessage
@property (readonly) BOOL hasMeta;
@property (readonly) BOOL hasBlob;
@property (nonatomic,strong) ToygerMeta* meta ;
@property (nonatomic,strong) ToygerBlob* blob ;
@end
#endif
@@ -0,0 +1,31 @@
//
// ZFaceVerifyInfo.h
// DTFOpenPlatformBuild
//
// Created by richard on 26/02/2018.
// Copyright © 2018 com. .iphoneclient.DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface ZFaceVerifyInfo : NSObject
@property(nonatomic, strong) NSString *secretToken;
@property(nonatomic, strong) NSString *wWORKSPACEID;
@property(nonatomic, assign) NSNumber *isSecuritySDKNumber;
+(instancetype)getInstance;
- (NSString *)getTokenContent;
- (NSString *)securityVersion;
- (void)ActivityToken;
- (void)ActivityTokenWithParam:(NSDictionary*)param;
- (NSString *)ApperceptRiskwith:(NSInteger)action extParams:(NSDictionary *)args;
- (NSString *)getSecurityChannel;
//是否支持deepSec
- (BOOL)securitySDKSupportDeepSec;
@end
@@ -0,0 +1,47 @@
//
// ZIMResponse.h
// DTFIdentityManager
//
// Created by yukun.tyk on 28/06/2017.
// Copyright © 2017 DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef NS_ENUM(NSUInteger, ZIMResponseCode) {
ZIMResponseSuccess = 1000, //采集成功并且服务端成功(人脸比对成功,或者证件宝服务端OCR/质量检测成功)[zim不会弹框处理]
ZIMInternalError = 1001, //用户被动退出(极简核身没有取到协议、toyger启动失败、协议解析失败)[zim不会弹框处理]
ZIMInterrupt = 1003, //用户主动退出(无相机权限、超时、用户取消)[zim会弹框处理]
ZIMNetworkfail = 2002, //网络失败(标准zim流程,请求协议错误,oss上传失败)[zim不会弹框处理]
ZIMTIMEError = 2003, //设备时间设置不对
ZIMResponseFail = 2006 //服务端validate失败(人脸比对失败或者证件宝OCR/质量检测失败)[zim不会弹框处理]
};
@interface ZIMResponse : NSObject
@property(nonatomic, assign, readonly)ZIMResponseCode code;
@property(nonatomic, assign, readonly)ZIMResponseCode retCode;
@property(nonatomic, copy, readonly)NSString * _Nullable reason;
@property(nonatomic, copy, readonly)NSString * _Nullable retCodeSub;
@property(nonatomic, copy, readonly)NSString * _Nullable retMessageSub;
@property(nonatomic, strong)NSDictionary * _Nullable extInfo;
@property(nonatomic, strong, readonly)NSString * _Nullable bizData;
@property(nonatomic, strong) NSString* _Nullable deviceToken; //设备token
@property(nonatomic, strong, nullable) NSString *videoFilePath; //如果采用视频返照,这个字段返回视频的路径
@property(nonatomic, strong ,nullable) NSData *imageContent; //这个字段返回采集照片
@property(nonatomic, strong ,nullable) NSMutableArray *cardImageContent; //ekyc返回证件array
@property(nonatomic, strong ,nullable) NSMutableArray *faceImageContent;
@property(nonatomic , strong ,nullable)NSData *faceData; //OCR身份证人像面照片 ,只有在OCR模式下,才有值
@property(nonatomic , strong ,nullable)NSData *countryData; //OCR身份证国徽面照片,只有在OCR模式下,才有值
-(instancetype _Nullable )initWithResponseCode:(ZIMResponseCode) code
retCode:(ZIMResponseCode) retCode
retCodeSub:(NSString *_Nullable) retCodeSub
retMessageSub:(NSString *_Nullable) retMessageSub
reason:(NSString *_Nullable) reason
extParam:(NSDictionary *_Nullable) extInfo
bizData:(NSString *_Nullable) bizData;
@end
@@ -0,0 +1,49 @@
//
// ZimInitRequest.h
// DTFIdentityManager
//
// Created by richard on 27/08/2017.
// Copyright © 2017 All rights reserved.
//
#import <Foundation/Foundation.h>
#ifndef SUPPORT_PB
@interface ZimInitRequest:NSObject
@property (nonatomic,strong) NSString* zimId ;
@property (nonatomic,strong) NSString* channel ;
@property (nonatomic,strong) NSString* merchant ;
@property (nonatomic,strong) NSString* productName ;
@property (nonatomic,strong) NSString* produceNode ;
@property (nonatomic,strong) NSString* bizData ;
@property (nonatomic,strong) NSString* metaInfo ;
@property (nonatomic,strong) NSString* originAliyunEncToken ;
@end
#else
#import <APProtocolBuffers/ProtocolBuffers.h>
@interface ZimInitRequest : APDPBGeneratedMessage
@property (readonly) BOOL hasZimId;
@property (readonly) BOOL hasChannel;
@property (readonly) BOOL hasMerchant;
@property (readonly) BOOL hasProductName;
@property (readonly) BOOL hasProduceNode;
@property (readonly) BOOL hasBizData;
@property (readonly) BOOL hasMetaInfo;
@property (nonatomic,strong) NSString* zimId ;
@property (nonatomic,strong) NSString* channel ;
@property (nonatomic,strong) NSString* merchant ;
@property (nonatomic,strong) NSString* productName ;
@property (nonatomic,strong) NSString* produceNode ;
@property (nonatomic,strong) NSString* bizData ;
@property (nonatomic,strong) NSString* metaInfo ;
@end
#endif
@@ -0,0 +1,51 @@
//
// ZimInitResponse.h
// DTFIdentityManager
//
// Created by richard on 27/08/2017.
// Copyright © 2017 DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
@class ZimInitResponse;
@class PBMapStringString;
#ifndef SUPPORT_PB
@interface ZimInitResponse:NSObject
@property (nonatomic) SInt32 retCode ;
@property (nonatomic,strong) NSString *message ;
@property (nonatomic,strong) NSString *zimId ;
@property (nonatomic,strong) NSString *protocol ;
@property (nonatomic,strong) NSDictionary *extParams ;
@property (nonatomic,strong) NSString *retCodeSub ;
@property (nonatomic,strong) NSString *retMessageSub ;
@property (nonatomic,strong) NSString *WishContent;//retMessageSub ;
@property (nonatomic,strong) NSString *ControlConfig;//retMessageSub ;
@property (nonatomic,strong) NSString *ImageCount;
@property (nonatomic,strong) NSDictionary *ossConfig;
+ (Class)extParamsElementClass;
@end
#else
#import <APProtocolBuffers/ProtocolBuffers.h>
@interface ZimInitResponse : APDPBGeneratedMessage
@property (readonly) BOOL hasRetCode;
@property (readonly) BOOL hasMessage;
@property (readonly) BOOL hasZimId;
@property (readonly) BOOL hasProtocol;
@property (readonly) BOOL hasExtParams;
@property (nonatomic) SInt32 retCode ;
@property (nonatomic,strong) NSString* message ;
@property (nonatomic,strong) NSString* zimId ;
@property (nonatomic,strong) NSString* protocol ;
@property (nonatomic,strong) PBMapStringString* extParams ;
@property (nonatomic,strong) NSString* retCodeSub ;
@property (nonatomic,strong) NSString* retMessageSub ;
@end
#endif
@@ -0,0 +1,34 @@
//
// ModelDownloader.h
// DTFIdentityManager
//
// Created by mengbingchuan on 2022/9/7.
// Copyright © 2022 DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DTFLogMonitor.h"
NS_ASSUME_NONNULL_BEGIN
@interface ZimModelDownloader : NSObject
@property(nonatomic, assign) BOOL preload; //preload, fallback
@property(nonatomic, copy) NSString *hostModelURL; //宿主传入的模型链接
+ (ZimModelDownloader *)sharedInstance;
- (void)setModelDownloadURL:(NSArray *)array;
- (NSString *)modelPath;
- (BOOL)needDownload;
- (void)processForceDownload:(NSString *)downloadId;
- (void)startDownloadCompletion:(void (^)(BOOL success))completion;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,51 @@
//
// ZimValidateRequest.h
// DTFIdentityManager
//
// Created by richard on 27/08/2017.
// Copyright © 2017 DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "ToygerData.h"
#import "APBBisUploadGwRequest.h"
@class ZimValidateRequest;
#ifndef SUPPORT_PB
@interface ZimValidateRequest:NSObject
@property (nonatomic,strong) NSString *zimId ;
@property (nonatomic,strong) APBBisUploadGwRequest *zimData ;
@property(nonatomic, strong) NSDictionary *bizData;
@property (nonatomic,strong)NSString *idString;
@property (nonatomic,strong)NSString *nameString;
@property (nonatomic,strong)NSString *externParam;
@property(nonatomic, strong) NSDictionary *wishDict;
@property(nonatomic, strong) NSDictionary *chameleon;
@property(nonatomic, strong) NSArray *wishVideoUrl;
@property(nonatomic, strong) NSArray *wishAudioUrl;
@property (nonatomic,strong) NSString *originAliyunEncToken;
@property (nonatomic,strong) NSString *rareCharIdString;
@property (nonatomic,strong) NSString *rareCharNameString;
@property (nonatomic, copy) NSDictionary *evidenceVideo;
@property(nonatomic, strong) NSString *sysTime;
@property(nonatomic, assign) BOOL useBackupOSS;
+ (Class)bizDataElementClass;
@end
#else
#import <APProtocolBuffers/ProtocolBuffers.h>
@interface ZimValidateRequest : APDPBGeneratedMessage
@property (readonly) BOOL hasZimId;
@property (readonly) BOOL hasZimData;
@property (readonly) BOOL hasBizData;
@property (nonatomic,strong) NSString* zimId ;
@property (nonatomic,strong) NSData* zimData ;
@property (nonatomic,strong) PBMapStringString* bizData;
@end
#endif
@@ -0,0 +1,47 @@
//
// ZimValidateResponse.h
// DTFIdentityManager
//
// Created by richard on 27/08/2017.
// Copyright © 2017 DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
@class ZimValidateResponse;
@class PBMapStringString;
#ifndef SUPPORT_PB
@interface ZimValidateResponse:NSObject
@property (nonatomic) SInt32 validationRetCode ;
@property (nonatomic) SInt32 productRetCode ;
@property (nonatomic) BOOL pb_hasNext ;
@property (nonatomic,strong) NSString* nextProtocol ;
@property (nonatomic,strong) NSDictionary* extParams ;
@property (nonatomic,strong) NSString* retCodeSub ;
@property (nonatomic,strong) NSString* retMessageSub ;
+ (Class)extParamsElementClass;
@end
#else
#import <APProtocolBuffers/ProtocolBuffers.h>
@interface ZimValidateResponse : APDPBGeneratedMessage
@property (readonly) BOOL hasValidationRetCode;
@property (readonly) BOOL hasProductRetCode;
@property (readonly) BOOL hasPb_hasNext;
@property (readonly) BOOL hasNextProtocol;
@property (readonly) BOOL hasExtParams;
@property (nonatomic) SInt32 validationRetCode ;
@property (nonatomic) SInt32 productRetCode ;
@property (nonatomic) BOOL pb_hasNext ;
@property (nonatomic,strong) NSString* nextProtocol ;
@property (nonatomic,strong) PBMapStringString* extParams ;
@property (nonatomic,strong) NSString* retCodeSub ;
@property (nonatomic,strong) NSString* retMessageSub;
@end
#endif
@@ -0,0 +1,24 @@
//
// ZolozSimpleValueContent.h
// DTFUtility
//
// Created by 053508 on 2021/6/9.
// Copyright © 2021 com. .iphoneclient.DTF. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface ZolozSimpleValueContent : NSObject
@property(nonatomic,strong,nullable)NSString * simpleValue;//用于存放Md5值。
@property(nonatomic,assign)NSUInteger length;//用于存放Md5值。
@property(nonatomic,strong,nullable)NSString * simpleOutValue;//用于存放Md5值。
@property(nonatomic,strong,nullable)NSString * simpleEnValue;//用于存放加密后的Md5值。
+ (ZolozSimpleValueContent *)sharedInstance;
@end
NS_ASSUME_NONNULL_END