iOS-jumao/AnXuanApp/TOOL/MyJmTool.m

40 lines
1.3 KiB
Objective-C

//
// MyJmTool.m
// AnXuanApp
//
#import "MyJmTool.h"
#import <AdSupport/AdSupport.h>
#import "sys/utsname.h"
#import <CoreTelephony/CTTelephonyNetworkInfo.h>
#import <CoreTelephony/CTCarrier.h>
#import <UIKit/UIDevice.h>
#import <UIKit/UIScreen.h>
#import "SAMKeychain.h"
@implementation MyJmTool
+(NSString *)getJmDeviceNumber{
// 首先获取钥匙串中的设备号
NSString *deviceJmSheBeiNumber = [SAMKeychain passwordForService:[NSBundle mainBundle].bundleIdentifier account:@"uuid"];
if (0 == deviceJmSheBeiNumber.length) {
// 获取设别id
deviceJmSheBeiNumber = [[UIDevice currentDevice] identifierForVendor].UUIDString;
// 将-去掉
deviceJmSheBeiNumber = [deviceJmSheBeiNumber stringByReplacingOccurrencesOfString:@"-" withString:@""];
[SAMKeychain setPassword:deviceJmSheBeiNumber forService:[NSBundle mainBundle].bundleIdentifier account:@"uuid"];
}
return deviceJmSheBeiNumber;
}
+ (NSURL *)getJmsharedLogUrl{
NSURL * NSFileManagerJmurl = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier: @"group.com.taizi.vpn"];
NSURL * URLByAppendingPathJmpathUrl = [NSFileManagerJmurl URLByAppendingPathComponent:@"tunnel.log"];
return URLByAppendingPathJmpathUrl;
}
@end