I am trying to get this to work using the Core Foundation library on OSX.
However, I see a really inconsistent license check, sometimes it checks the correctness, and sometimes others, using the exact same file.
Here is the code I'm currently using:
- (void)checkApexProcess{
CFMutableStringRef key = CFStringCreateMutable(NULL, 0);
CFStringAppend(key, CFSTR("0xB57B7D0E180"));
CFStringAppend(key, CFSTR("E"));
CFStringAppend(key, CFSTR("E"));
CFStringAppend(key, CFSTR("C4FD9AAAFC389F8"));
CFStringAppend(key, CFSTR("438903BC20D0"));
CFStringAppend(key, CFSTR("E"));
CFStringAppend(key, CFSTR("E"));
CFStringAppend(key, CFSTR("1F02C25010F8F47C"));
CFStringAppend(key, CFSTR("86"));
CFStringAppend(key, CFSTR("C"));
CFStringAppend(key, CFSTR("C"));
CFStringAppend(key, CFSTR("4FABF44A4376945C6F8F92292B"));
CFStringAppend(key, CFSTR("D45043012F6959BD6D3E1D246D1C1B"));
CFStringAppend(key, CFSTR("6F4A53FA1C023B4A91BC4578504B1D"));
CFStringAppend(key, CFSTR("9BEA69A53FAE91FD36ACA165CA57"));
CFStringAppend(key, CFSTR("B"));
CFStringAppend(key, CFSTR("B"));
CFStringAppend(key, CFSTR(""));
CFStringAppend(key, CFSTR("B"));
CFStringAppend(key, CFSTR("4"));
CFStringAppend(key, CFSTR("4"));
CFStringAppend(key, CFSTR("C30A925FAFBB1CA595D5011DA0E"));
CFStringAppend(key, CFSTR("BF819BC6A909861DE8C5121FCA06AF"));
CFStringAppend(key, CFSTR("FB3290875E3ED23D1F"));
APSetKey(key);
NSURL* filePath;
NSOpenPanel* openDlg = [NSOpenPanel openPanel];
[openDlg setCanChooseFiles:YES];
[openDlg setCanChooseDirectories:NO];
CFURLRef filePathUrl;
bool Valid;
NSDictionary* apexDict;
if ( [openDlg runModal] == NSOKButton )
{
for( NSURL* URL in [openDlg URLs] )
{
filePath = URL;
NSString* filePathString = [URL path];
filePathUrl = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, (CFStringRef) filePathString, kCFURLPOSIXPathStyle, FALSE);
Valid = APVerifyLicenseFile(filePathUrl);
DDLogCVerbose( @"%@", filePath );
DDLogCVerbose( @"%@", filePathUrl );
DDLogCVerbose( @"%@", [URL path] );
}
if(Valid == true){
[self enableApexButtons];
} else {
[self displayApexAlertInvalid];
[self removeApexFile];
}
}
}
I really got stuck on what is happening here, I really donβt understand how this can be verified, and not others?
Does anyone have any ideas?
thank
Gareth
Change 1
If I comment on the lines:
CFDictionaryRef cfUserLicenseInfo;
NSDictionary* apexDict;
Then the check passes, if not, then itβs not, itβs super weird, who has any ideas?