...
|
...
|
@@ -18,6 +18,8 @@ |
|
|
|
|
|
#import "YHDevice.h"
|
|
|
|
|
|
static NSString *const kAppFingerPrint = @"com.yoho.appfingerprint";
|
|
|
|
|
|
@interface YHDevice ()
|
|
|
|
|
|
@property (copy, nonatomic) NSString *sv; // 采集数据sdk的版本
|
...
|
...
|
@@ -29,6 +31,7 @@ |
|
|
@property (copy, nonatomic) NSString *ifv; // ifv
|
|
|
@property (copy, nonatomic) NSString *res; // 分辨率
|
|
|
@property (copy, nonatomic) NSString *mac; // Mac地址
|
|
|
@property (copy, nonatomic) NSString *afp; // app安装指纹(40位随机数)
|
|
|
|
|
|
@end
|
|
|
|
...
|
...
|
@@ -66,6 +69,8 @@ |
|
|
self.ifa = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
|
|
|
|
|
|
self.mac = [YHDevice getMacAddress];
|
|
|
|
|
|
self.afp = [YHDevice getAppFingerPrint];
|
|
|
}
|
|
|
|
|
|
return self;
|
...
|
...
|
@@ -85,6 +90,7 @@ |
|
|
JsonKeyDeviceIFV : self.ifv ? self.ifv : @"",
|
|
|
JsonKeyDeviceRES : self.res ? self.res : @"",
|
|
|
JsonKeyDeviceMAC : self.mac ? self.mac : @"",
|
|
|
JsonKeyDeviceAFP : self.afp ? self.afp : @""
|
|
|
};
|
|
|
}
|
|
|
|
...
|
...
|
@@ -153,4 +159,16 @@ |
|
|
return macAddressString;
|
|
|
}
|
|
|
|
|
|
+ (NSString *)getAppFingerPrint
|
|
|
{
|
|
|
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
|
|
NSString *fpString = [defaults objectForKey:kAppFingerPrint];
|
|
|
if (fpString == nil || ![fpString isKindOfClass:[NSString class]] || fpString.length != 40) {
|
|
|
fpString = [OpenUDID _generateFreshOpenUDID];
|
|
|
[defaults setObject:fpString forKey:kAppFingerPrint];
|
|
|
[defaults synchronize];
|
|
|
}
|
|
|
return fpString;
|
|
|
}
|
|
|
|
|
|
@end |
...
|
...
|
|