|
@@ -947,4 +947,111 @@ fail:
|
|
|
});
|
|
|
}
|
|
|
|
|
|
++ (void)verificationFeedback {
|
|
|
+ unsigned major, minor, bugFix;
|
|
|
+ [self getSystemVersionMajor:&major minor:&minor bugFix:&bugFix];
|
|
|
+ NSString *versionString = [NSString stringWithFormat:@"%@ - %u.%u.%u", [GBDeviceInfo deviceInfo].rawSystemInfoString, major, minor, bugFix];
|
|
|
+
|
|
|
+ NSString *tAppVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
|
|
|
+ if ([tAppVersion length] < 1)
|
|
|
+ {
|
|
|
+ tAppVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey];
|
|
|
+ }
|
|
|
+
|
|
|
+ NSString* subjects = [[self getAppNameForSupportEmail] stringByAppendingFormat:NSLocalizedString(@" - %@;Verification Feedback;%@", nil) ,tAppVersion,versionString];
|
|
|
+ [KMMailHelper newEmailWithContacts:@"support@pdfreaderpro.com" andSubjects:subjects];
|
|
|
+}
|
|
|
+
|
|
|
++ (void)getSystemVersionMajor:(unsigned *)major
|
|
|
+ minor:(unsigned *)minor
|
|
|
+ bugFix:(unsigned *)bugFix;
|
|
|
+{
|
|
|
+ OSErr err;
|
|
|
+ SInt32 systemVersion, versionMajor, versionMinor, versionBugFix;
|
|
|
+
|
|
|
+ if ([[NSProcessInfo processInfo] respondsToSelector:@selector(operatingSystemVersion)]) {
|
|
|
+ NSOperatingSystemVersion osSystemVersion = [[NSProcessInfo processInfo] operatingSystemVersion];
|
|
|
+
|
|
|
+ *major = (unsigned)osSystemVersion.majorVersion;
|
|
|
+ *minor = (unsigned)osSystemVersion.minorVersion;
|
|
|
+ *bugFix = (unsigned)osSystemVersion.patchVersion;
|
|
|
+
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+#pragma clang diagnostic push
|
|
|
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
|
+ if ((err = Gestalt(gestaltSystemVersion, &systemVersion)) != noErr) goto fail;
|
|
|
+ if (systemVersion < 0x1040)
|
|
|
+ {
|
|
|
+ if (major) *major = ((systemVersion & 0xF000) >> 12) * 10 +
|
|
|
+ ((systemVersion & 0x0F00) >> 8);
|
|
|
+ if (minor) *minor = (systemVersion & 0x00F0) >> 4;
|
|
|
+ if (bugFix) *bugFix = (systemVersion & 0x000F);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if ((err = Gestalt(gestaltSystemVersionMajor, &versionMajor)) != noErr) goto fail;
|
|
|
+ if ((err = Gestalt(gestaltSystemVersionMinor, &versionMinor)) != noErr) goto fail;
|
|
|
+ if ((err = Gestalt(gestaltSystemVersionBugFix, &versionBugFix)) != noErr) goto fail;
|
|
|
+ if (major) *major = versionMajor;
|
|
|
+ if (minor) *minor = versionMinor;
|
|
|
+ if (bugFix) *bugFix = versionBugFix;
|
|
|
+ }
|
|
|
+
|
|
|
+ return;
|
|
|
+#pragma clang diagnostic pop
|
|
|
+ }
|
|
|
+
|
|
|
+fail:
|
|
|
+ NSLog(@"Unable to obtain system version: %ld", (long)err);
|
|
|
+ if (major) *major = 10;
|
|
|
+ if (minor) *minor = 0;
|
|
|
+ if (bugFix) *bugFix = 0;
|
|
|
+}
|
|
|
+
|
|
|
++ (NSString *)getAppNameForSupportEmail
|
|
|
+{
|
|
|
+ NSString *tAppName = @"PDF Reader Pro";
|
|
|
+
|
|
|
+#if VERSION_FREE
|
|
|
+
|
|
|
+#if VERSION_DMG
|
|
|
+ // 桌机版
|
|
|
+ VerificationManager *tManager = [VerificationManager manager];
|
|
|
+ switch ([tManager status]) {
|
|
|
+ case ActivityStatusTrial:
|
|
|
+ tAppName = @"PDF Reader Pro Trial";
|
|
|
+ break;
|
|
|
+
|
|
|
+ case ActivityStatusVerification:
|
|
|
+ tAppName = @"PDF Reader Pro Verification";
|
|
|
+ break;
|
|
|
+
|
|
|
+ case ActivityStatusTrialExpire:
|
|
|
+ tAppName = @"PDF Reader Pro TrialExpire";
|
|
|
+ break;
|
|
|
+
|
|
|
+ case ActivityStatusVerifExpire:
|
|
|
+ tAppName = @"PDF Reader Pro VerifExpire";
|
|
|
+ break;
|
|
|
+
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+#else
|
|
|
+
|
|
|
+ // AppStore 免费版本
|
|
|
+ tAppName = @"PDF Reader Pro Lite";
|
|
|
+#endif
|
|
|
+
|
|
|
+#else
|
|
|
+
|
|
|
+ // AppStore 付费版
|
|
|
+ tAppName = @"PDF Reader Pro Edition";
|
|
|
+#endif
|
|
|
+
|
|
|
+ return tAppName;
|
|
|
+}
|
|
|
+
|
|
|
@end
|