Browse Source

【综合】整理代码

tangchao 1 year ago
parent
commit
b135089267
22 changed files with 5122 additions and 256 deletions
  1. 72 0
      PDF Office/PDF Master.xcodeproj/project.pbxproj
  2. 50 0
      PDF Office/PDF Master.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  3. 251 0
      PDF Office/PDF Master/Class/Common/OC/JSONKit/JSONKit.h
  4. 3059 0
      PDF Office/PDF Master/Class/Common/OC/JSONKit/JSONKit.m
  5. 17 0
      PDF Office/PDF Master/Class/Common/OC/NSNULL+Filtration/NSNULL+Filtration.h
  6. 60 0
      PDF Office/PDF Master/Class/Common/OC/NSNULL+Filtration/NSNULL+Filtration.m
  7. 20 0
      PDF Office/PDF Master/Class/Common/OC/NSObject+DeviceInfo/NSObject+DeviceInfo.h
  8. 108 0
      PDF Office/PDF Master/Class/Common/OC/NSObject+DeviceInfo/NSObject+DeviceInfo.m
  9. 4 2
      PDF Office/PDF Master/Class/KMLightMember/KMRequestServer/KMRequestServer.swift
  10. 56 56
      PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseCompareDMGWindowController.m
  11. 25 25
      PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseLimitWindowController.swift
  12. 1 1
      PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMRepeatTrialAlertController.m
  13. 6 6
      PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMUnlockAlertViewController.m
  14. 5 5
      PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationExpiredViewController.m
  15. 5 5
      PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationInfoViewController.m
  16. 1 1
      PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationViewController.m
  17. 153 155
      PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationWindowController.m
  18. 162 0
      PDF Office/PDF Master/Class/Purchase/DMG/Verification/VerificationManager/VerificationManager.h
  19. 1064 0
      PDF Office/PDF Master/Class/Purchase/DMG/Verification/VerificationManager/VerificationManager.m
  20. 1 0
      PDF Office/PDF Master/PDF_Master DMG-Bridging-Header.h
  21. 1 0
      PDF Office/PDF Master/PDF_Master Pro-Bridging-Header.h
  22. 1 0
      PDF Office/PDF Master/PDF_Master-Bridging-Header.h

+ 72 - 0
PDF Office/PDF Master.xcodeproj/project.pbxproj

@@ -3424,6 +3424,18 @@
 		BB8810BE2B4F872500AFA63E /* KMVerificationWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = BB8810B92B4F872400AFA63E /* KMVerificationWindowController.m */; };
 		BB8810BF2B4F872500AFA63E /* KMVerificationWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = BB8810B92B4F872400AFA63E /* KMVerificationWindowController.m */; };
 		BB8810C02B4F872500AFA63E /* KMVerificationWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = BB8810B92B4F872400AFA63E /* KMVerificationWindowController.m */; };
+		BB8810C42B4F95A900AFA63E /* NSObject+DeviceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = BB8810C22B4F95A900AFA63E /* NSObject+DeviceInfo.m */; };
+		BB8810C52B4F95A900AFA63E /* NSObject+DeviceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = BB8810C22B4F95A900AFA63E /* NSObject+DeviceInfo.m */; };
+		BB8810C62B4F95A900AFA63E /* NSObject+DeviceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = BB8810C22B4F95A900AFA63E /* NSObject+DeviceInfo.m */; };
+		BB8810CA2B4F97D000AFA63E /* VerificationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BB8810C92B4F97CF00AFA63E /* VerificationManager.m */; };
+		BB8810CB2B4F97D000AFA63E /* VerificationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BB8810C92B4F97CF00AFA63E /* VerificationManager.m */; };
+		BB8810CC2B4F97D000AFA63E /* VerificationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BB8810C92B4F97CF00AFA63E /* VerificationManager.m */; };
+		BB8810D02B4F980E00AFA63E /* NSNULL+Filtration.m in Sources */ = {isa = PBXBuildFile; fileRef = BB8810CF2B4F980E00AFA63E /* NSNULL+Filtration.m */; };
+		BB8810D12B4F980E00AFA63E /* NSNULL+Filtration.m in Sources */ = {isa = PBXBuildFile; fileRef = BB8810CF2B4F980E00AFA63E /* NSNULL+Filtration.m */; };
+		BB8810D22B4F980E00AFA63E /* NSNULL+Filtration.m in Sources */ = {isa = PBXBuildFile; fileRef = BB8810CF2B4F980E00AFA63E /* NSNULL+Filtration.m */; };
+		BB8810D62B4F984000AFA63E /* JSONKit.m in Sources */ = {isa = PBXBuildFile; fileRef = BB8810D42B4F984000AFA63E /* JSONKit.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+		BB8810D72B4F984000AFA63E /* JSONKit.m in Sources */ = {isa = PBXBuildFile; fileRef = BB8810D42B4F984000AFA63E /* JSONKit.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+		BB8810D82B4F984000AFA63E /* JSONKit.m in Sources */ = {isa = PBXBuildFile; fileRef = BB8810D42B4F984000AFA63E /* JSONKit.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
 		BB88401E2A132C6B0062446B /* ObjectiveDropboxOfficial.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BBB9B335299A5F35004F3235 /* ObjectiveDropboxOfficial.framework */; };
 		BB88401F2A132C6B0062446B /* ObjectiveDropboxOfficial.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = BBB9B335299A5F35004F3235 /* ObjectiveDropboxOfficial.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		BB88E43B294023CB002B3655 /* KMDocumentModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB88E43A294023CB002B3655 /* KMDocumentModel.swift */; };
@@ -5928,6 +5940,14 @@
 		BB8810B82B4F872400AFA63E /* KMVerificationWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KMVerificationWindowController.xib; sourceTree = "<group>"; };
 		BB8810B92B4F872400AFA63E /* KMVerificationWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KMVerificationWindowController.m; sourceTree = "<group>"; };
 		BB8810BA2B4F872500AFA63E /* KMVerificationWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KMVerificationWindowController.h; sourceTree = "<group>"; };
+		BB8810C22B4F95A900AFA63E /* NSObject+DeviceInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+DeviceInfo.m"; sourceTree = "<group>"; };
+		BB8810C32B4F95A900AFA63E /* NSObject+DeviceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+DeviceInfo.h"; sourceTree = "<group>"; };
+		BB8810C82B4F97CF00AFA63E /* VerificationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VerificationManager.h; sourceTree = "<group>"; };
+		BB8810C92B4F97CF00AFA63E /* VerificationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VerificationManager.m; sourceTree = "<group>"; };
+		BB8810CE2B4F980E00AFA63E /* NSNULL+Filtration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSNULL+Filtration.h"; sourceTree = "<group>"; };
+		BB8810CF2B4F980E00AFA63E /* NSNULL+Filtration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSNULL+Filtration.m"; sourceTree = "<group>"; };
+		BB8810D42B4F984000AFA63E /* JSONKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSONKit.m; sourceTree = "<group>"; };
+		BB8810D52B4F984000AFA63E /* JSONKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONKit.h; sourceTree = "<group>"; };
 		BB88E43A294023CB002B3655 /* KMDocumentModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMDocumentModel.swift; sourceTree = "<group>"; };
 		BB88E453294045B4002B3655 /* KMPDFConvertManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMPDFConvertManager.swift; sourceTree = "<group>"; };
 		BB88E45729404752002B3655 /* KMPDFConvert.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMPDFConvert.swift; sourceTree = "<group>"; };
@@ -9562,6 +9582,7 @@
 		BB183DD72B4EBDD300F99C7E /* Verification */ = {
 			isa = PBXGroup;
 			children = (
+				BB8810C72B4F97CF00AFA63E /* VerificationManager */,
 				BB8810BA2B4F872500AFA63E /* KMVerificationWindowController.h */,
 				BB8810B92B4F872400AFA63E /* KMVerificationWindowController.m */,
 				BB8810B82B4F872400AFA63E /* KMVerificationWindowController.xib */,
@@ -10268,6 +10289,9 @@
 		BB5F8A0329BB04EF00365ADB /* OC */ = {
 			isa = PBXGroup;
 			children = (
+				BB8810D32B4F984000AFA63E /* JSONKit */,
+				BB8810CD2B4F980E00AFA63E /* NSNULL+Filtration */,
+				BB8810C12B4F95A900AFA63E /* NSObject+DeviceInfo */,
 				BB4A94942B04B62800940F8B /* OCR */,
 				BBC4F9FD2AEBC62D0098A1A8 /* Batch */,
 				BBA93D3029BF0ECD0044E0DD /* KeyChain */,
@@ -10582,6 +10606,42 @@
 			path = CPDFListViewExtension;
 			sourceTree = "<group>";
 		};
+		BB8810C12B4F95A900AFA63E /* NSObject+DeviceInfo */ = {
+			isa = PBXGroup;
+			children = (
+				BB8810C22B4F95A900AFA63E /* NSObject+DeviceInfo.m */,
+				BB8810C32B4F95A900AFA63E /* NSObject+DeviceInfo.h */,
+			);
+			path = "NSObject+DeviceInfo";
+			sourceTree = "<group>";
+		};
+		BB8810C72B4F97CF00AFA63E /* VerificationManager */ = {
+			isa = PBXGroup;
+			children = (
+				BB8810C82B4F97CF00AFA63E /* VerificationManager.h */,
+				BB8810C92B4F97CF00AFA63E /* VerificationManager.m */,
+			);
+			path = VerificationManager;
+			sourceTree = "<group>";
+		};
+		BB8810CD2B4F980E00AFA63E /* NSNULL+Filtration */ = {
+			isa = PBXGroup;
+			children = (
+				BB8810CE2B4F980E00AFA63E /* NSNULL+Filtration.h */,
+				BB8810CF2B4F980E00AFA63E /* NSNULL+Filtration.m */,
+			);
+			path = "NSNULL+Filtration";
+			sourceTree = "<group>";
+		};
+		BB8810D32B4F984000AFA63E /* JSONKit */ = {
+			isa = PBXGroup;
+			children = (
+				BB8810D42B4F984000AFA63E /* JSONKit.m */,
+				BB8810D52B4F984000AFA63E /* JSONKit.h */,
+			);
+			path = JSONKit;
+			sourceTree = "<group>";
+		};
 		BB88E439294023B5002B3655 /* Model */ = {
 			isa = PBXGroup;
 			children = (
@@ -13444,6 +13504,7 @@
 				F359916929261F0D000D25DE /* CPDFListView+Tool.m in Sources */,
 				9F3D819329A33A290087B5AD /* KMDesignDropdown.swift in Sources */,
 				9F0CB47F2967F64D00007028 /* KMPropertiesPanelReadOnlySubVC.swift in Sources */,
+				BB8810C42B4F95A900AFA63E /* NSObject+DeviceInfo.m in Sources */,
 				BB2EDF76296ECE17003BCF58 /* KMPageEditInsertPageSizeItemView.swift in Sources */,
 				9F1FE49F29406E4700E952CA /* HoverButton.m in Sources */,
 				ADE86AA42B031FF000414DFA /* KMCompareView.swift in Sources */,
@@ -13702,6 +13763,7 @@
 				BBFEF71B2B3A784200C28AC0 /* KMSystemEditMenu.swift in Sources */,
 				ADBC374129CAB1C300D93208 /* KMComparativeOutlineCell.swift in Sources */,
 				9FDD0F802952FC36000C4DAD /* KMDesignToken.swift in Sources */,
+				BB8810CA2B4F97D000AFA63E /* VerificationManager.m in Sources */,
 				BBFE6E582930724B00142C01 /* KMMergePageModel.swift in Sources */,
 				BBBF68842A3C3AF10058E14E /* NSDocumentController+KMExtension.swift in Sources */,
 				ADA9102A2A272CE2003352F0 /* KMEditPDFTextManager.swift in Sources */,
@@ -13861,6 +13923,7 @@
 				ADBC174F2A2991F700959CEE /* KMPurchaseManager.swift in Sources */,
 				BB4DD043299B291A00E80DF6 /* KMCloudNoNetworkView.swift in Sources */,
 				BB49ECF6293F44DC00C82CA2 /* KMConvertExcelWindowController.swift in Sources */,
+				BB8810D62B4F984000AFA63E /* JSONKit.m in Sources */,
 				BBC4F9F62AEB69940098A1A8 /* NSArray+Extension.swift in Sources */,
 				BBC348432956A638008D2CD1 /* KMEditBackgroundController.swift in Sources */,
 				9F0CB49F29683E2600007028 /* KMPropertiesPanelSizeSubVC.swift in Sources */,
@@ -14269,6 +14332,7 @@
 				BBEC00B7295C2C1600A26C98 /* KMBatesPropertyHomeController.swift in Sources */,
 				9F78EFC228F7E395001E66F4 /* KMHomeViewController+Action.swift in Sources */,
 				BBFEF72B2B3A791B00C28AC0 /* KMSystemWindowMenu.swift in Sources */,
+				BB8810D02B4F980E00AFA63E /* NSNULL+Filtration.m in Sources */,
 				BBF7299B2B1961E800576AC5 /* KMAddWatermarkOprationQueue.swift in Sources */,
 				BB8F4576295AFA2D0037EA22 /* KMHeaderFooterAdjectiveInfoBaseView.swift in Sources */,
 				9F0CB4E12986556400007028 /* KMDesignToken+PaddingTop.swift in Sources */,
@@ -14407,6 +14471,7 @@
 				BBE9D0982AF0CECB002E83CE /* KMBatchOperateCompressViewController.swift in Sources */,
 				BB8F4566295AA3ED0037EA22 /* KMHeaderFooterManager.swift in Sources */,
 				BB183DDE2B4EBE1B00F99C7E /* KMTrialSuccessController.swift in Sources */,
+				BB8810C52B4F95A900AFA63E /* NSObject+DeviceInfo.m in Sources */,
 				ADE86A9E2B031FDB00414DFA /* KMCompareWindowController.swift in Sources */,
 				BB99ACC3292DE22E0048AFD9 /* KMMergeViewController.swift in Sources */,
 				9F78EFC728F7E965001E66F4 /* KMHomeViewController+UI.swift in Sources */,
@@ -14535,6 +14600,7 @@
 				BBF245592AE78D0300037D08 /* KMBatchOperateWindowController.swift in Sources */,
 				9F81ADC729B9B12C002251F4 /* NSButton+DesignToken.swift in Sources */,
 				BB671A022AD2D2A0003D44D5 /* CPDFStampAnnotation+PDFListView.swift in Sources */,
+				BB8810D12B4F980E00AFA63E /* NSNULL+Filtration.m in Sources */,
 				AD58F4202B1DC29100299EE0 /* KMPrintViewModel.swift in Sources */,
 				BB65A0552AF8B90F003A27A0 /* KMDisplayPreferences.swift in Sources */,
 				BB74DA7C2AC41DE9006EDFE7 /* NSString+KMExtension.swift in Sources */,
@@ -14608,6 +14674,7 @@
 				BB853C702AF879C1009C20C1 /* KMBatchRemoveWatermarkOperation.swift in Sources */,
 				9FBC48B9299B44C600CA39D7 /* KMSecondaryViewController.m in Sources */,
 				ADDF832D2B391A5C00A81A4E /* NSEvent+PDFListView.m in Sources */,
+				BB8810CB2B4F97D000AFA63E /* VerificationManager.m in Sources */,
 				ADAFD9F42AE68A7400F084BC /* KMCreatPDFView.swift in Sources */,
 				BBC348152955920B008D2CD1 /* KMBackgroundPropertyController.swift in Sources */,
 				BBFDFA9F2AF3814000E08AA2 /* KMTextHintWindowController.swift in Sources */,
@@ -14946,6 +15013,7 @@
 				BB4A94A12B04D8EC00940F8B /* KMGOCRManager.m in Sources */,
 				BBB9B32F299A5D6D004F3235 /* GTMAppAuthFetcherAuthorization.m in Sources */,
 				BB3EAEAE293E3D6000D92407 /* KMConvertBaseWindowController.swift in Sources */,
+				BB8810D72B4F984000AFA63E /* JSONKit.m in Sources */,
 				ADDF83242B391A5C00A81A4E /* CDSDrawView.m in Sources */,
 				BB1BFF5E2AE9F1FF003EB179 /* KMBatchOperateBaseWindowController.swift in Sources */,
 				894A00F32976314C0070ED83 /* KMPDFViewPanelSetViewController.swift in Sources */,
@@ -15644,6 +15712,7 @@
 				BBC8A76A2B05EB8000FA9377 /* KMThumbnailTableviewCell.swift in Sources */,
 				BBC8A76F2B05EDDF00FA9377 /* KMThumbnail.swift in Sources */,
 				9FCFEC762AC56ECE00EAD2CB /* CPDFListStampAnnotation.swift in Sources */,
+				BB8810D22B4F980E00AFA63E /* NSNULL+Filtration.m in Sources */,
 				BBA388152AEF9A42004FE93F /* NSWindow+KMExtension.swift in Sources */,
 				9FD0D2A92AD4EFB000DA3FF8 /* KMSavePanelAccessoryController.swift in Sources */,
 				9F1FE4D129406E4700E952CA /* CTTabController.m in Sources */,
@@ -15859,6 +15928,7 @@
 				BB146FE9299DC0D100784A6A /* GTLRQuery.m in Sources */,
 				BBFEF7152B3A766C00C28AC0 /* KMSystemMenu.swift in Sources */,
 				BB147016299DC0D100784A6A /* OIDAuthState.m in Sources */,
+				BB8810D82B4F984000AFA63E /* JSONKit.m in Sources */,
 				BBF8A3FF2AE8B04400788BAC /* KMBatchOperateFile.swift in Sources */,
 				BB897258294C559F0045787C /* KMWatermarkPropertyCreateController.swift in Sources */,
 				9FE0BBE62B0EFBA300CD1CAC /* KMAnnotationFontWindowController.swift in Sources */,
@@ -15887,6 +15957,7 @@
 				BB6719FB2AD2CC05003D44D5 /* CPDFSignatureWidgetAnnotation+PDFListView.swift in Sources */,
 				BB2F9AAD2AFCADA900F9DD93 /* KMProfileCellView.swift in Sources */,
 				BBF729912B1960FF00576AC5 /* KMCompressOperationQueue.swift in Sources */,
+				BB8810C62B4F95A900AFA63E /* NSObject+DeviceInfo.m in Sources */,
 				9F221ED129A85D3700978A59 /* KMDesignBase.swift in Sources */,
 				ADB5E51B2A3711CB007110A8 /* KMSubscribeWaterMarkView.swift in Sources */,
 				BBBE209D2B21E5F100509C4E /* KMAlertTool.swift in Sources */,
@@ -16209,6 +16280,7 @@
 				9F0CB4F3298655BC00007028 /* KMDesignToken+ItemSpacing.swift in Sources */,
 				8942F819292B678100389627 /* KMAnnotationTableCellView.swift in Sources */,
 				AD3AAD6F2B0DCC6800DE5FE7 /* KMCompareSaveWindow.swift in Sources */,
+				BB8810CC2B4F97D000AFA63E /* VerificationManager.m in Sources */,
 				BB162E99295062CD0088E9D1 /* KMPageRangeTools.swift in Sources */,
 				9FD0FA3329CD947000F2AB0D /* KMOpacityPanel.swift in Sources */,
 				9FBC489D2996500300CA39D7 /* KMDocumentController.swift in Sources */,

+ 50 - 0
PDF Office/PDF Master.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -18,6 +18,56 @@
             endingLineNumber = "217"
             landmarkName = "register(userName:password:verifyCode:complete:)"
             landmarkType = "7">
+<<<<<<< HEAD
+=======
+            <Locations>
+               <Location
+                  uuid = "5A10F6CA-8EFB-4226-8DC2-0DBAC5057198 - 2cd1d6808644180d"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Master.KMRequestServerManager.register(userName: Swift.String, password: Swift.String, verifyCode: Swift.String, complete: (Swift.Bool, Swift.Optional&lt;PDF_Master.KMLightMemberToken&gt;, PDF_Master.Result) -&gt; ()) -&gt; ()"
+                  moduleName = "PDF Master"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/KMLightMember/Manager/KMRequestServerManager.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "217"
+                  endingLineNumber = "217"
+                  offsetFromSymbolStart = "324">
+               </Location>
+               <Location
+                  uuid = "5A10F6CA-8EFB-4226-8DC2-0DBAC5057198 - 51ad9ae3b2ba8d96"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Master_DMG.KMRequestServerManager.register(userName: Swift.String, password: Swift.String, verifyCode: Swift.String, complete: (Swift.Bool, Swift.Optional&lt;PDF_Master_DMG.KMLightMemberToken&gt;, PDF_Master_DMG.Result) -&gt; ()) -&gt; ()"
+                  moduleName = "PDF Master DMG"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/KMLightMember/Manager/KMRequestServerManager.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "218"
+                  endingLineNumber = "218"
+                  offsetFromSymbolStart = "144">
+               </Location>
+               <Location
+                  uuid = "5A10F6CA-8EFB-4226-8DC2-0DBAC5057198 - 2cd1d6808644180d"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "PDF_Master.KMRequestServerManager.register(userName: Swift.String, password: Swift.String, verifyCode: Swift.String, complete: (Swift.Bool, Swift.Optional&lt;PDF_Master.KMLightMemberToken&gt;, PDF_Master.Result) -&gt; ()) -&gt; ()"
+                  moduleName = "PDF Master"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/KMLightMember/Manager/KMRequestServerManager.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "217"
+                  endingLineNumber = "217"
+                  offsetFromSymbolStart = "336">
+               </Location>
+            </Locations>
+>>>>>>> 5c10c72e84523435ed376b7f28e93a6d66284817
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy

+ 251 - 0
PDF Office/PDF Master/Class/Common/OC/JSONKit/JSONKit.h

@@ -0,0 +1,251 @@
+//
+//  JSONKit.h
+//  http://github.com/johnezang/JSONKit
+//  Dual licensed under either the terms of the BSD License, or alternatively
+//  under the terms of the Apache License, Version 2.0, as specified below.
+//
+
+/*
+ Copyright (c) 2011, John Engelhart
+ 
+ All rights reserved.
+ 
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ 
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 
+ * Neither the name of the Zang Industries nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+ 
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/*
+ Copyright 2011 John Engelhart
+ 
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+#include <stddef.h>
+#include <stdint.h>
+#include <limits.h>
+#include <TargetConditionals.h>
+#include <AvailabilityMacros.h>
+
+#ifdef    __OBJC__
+#import <Foundation/NSArray.h>
+#import <Foundation/NSData.h>
+#import <Foundation/NSDictionary.h>
+#import <Foundation/NSError.h>
+#import <Foundation/NSObjCRuntime.h>
+#import <Foundation/NSString.h>
+#endif // __OBJC__
+ 
+#ifdef __cplusplus
+extern "C" {
+#endif
+  
+
+// For Mac OS X < 10.5.
+#ifndef   NSINTEGER_DEFINED
+#define   NSINTEGER_DEFINED
+#if       defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
+typedef long           NSInteger;
+typedef unsigned long  NSUInteger;
+#define NSIntegerMin   LONG_MIN
+#define NSIntegerMax   LONG_MAX
+#define NSUIntegerMax  ULONG_MAX
+#else  // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
+typedef int            NSInteger;
+typedef unsigned int   NSUInteger;
+#define NSIntegerMin   INT_MIN
+#define NSIntegerMax   INT_MAX
+#define NSUIntegerMax  UINT_MAX
+#endif // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
+#endif // NSINTEGER_DEFINED
+
+
+#ifndef _JSONKIT_H_
+#define _JSONKIT_H_
+
+#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__APPLE_CC__) && (__APPLE_CC__ >= 5465)
+#define JK_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
+#else
+#define JK_DEPRECATED_ATTRIBUTE
+#endif
+  
+#define JSONKIT_VERSION_MAJOR 1
+#define JSONKIT_VERSION_MINOR 4
+
+typedef NSUInteger JKFlags;
+
+/*
+  JKParseOptionComments        : Allow C style // and /_* ... *_/ (without a _, obviously) comments in JSON.
+  JKParseOptionUnicodeNewlines : Allow Unicode recommended (?:\r\n|[\n\v\f\r\x85\p{Zl}\p{Zp}]) newlines.
+  JKParseOptionLooseUnicode    : Normally the decoder will stop with an error at any malformed Unicode.
+                                 This option allows JSON with malformed Unicode to be parsed without reporting an error.
+                                 Any malformed Unicode is replaced with \uFFFD, or "REPLACEMENT CHARACTER".
+ */
+
+enum {
+  JKParseOptionNone                     = 0,
+  JKParseOptionStrict                   = 0,
+  JKParseOptionComments                 = (1 << 0),
+  JKParseOptionUnicodeNewlines          = (1 << 1),
+  JKParseOptionLooseUnicode             = (1 << 2),
+  JKParseOptionPermitTextAfterValidJSON = (1 << 3),
+  JKParseOptionValidFlags               = (JKParseOptionComments | JKParseOptionUnicodeNewlines | JKParseOptionLooseUnicode | JKParseOptionPermitTextAfterValidJSON),
+};
+typedef JKFlags JKParseOptionFlags;
+
+enum {
+  JKSerializeOptionNone                 = 0,
+  JKSerializeOptionPretty               = (1 << 0),
+  JKSerializeOptionEscapeUnicode        = (1 << 1),
+  JKSerializeOptionEscapeForwardSlashes = (1 << 4),
+  JKSerializeOptionValidFlags           = (JKSerializeOptionPretty | JKSerializeOptionEscapeUnicode | JKSerializeOptionEscapeForwardSlashes),
+};
+typedef JKFlags JKSerializeOptionFlags;
+
+#ifdef    __OBJC__
+
+typedef struct JKParseState JKParseState; // Opaque internal, private type.
+
+// As a general rule of thumb, if you use a method that doesn't accept a JKParseOptionFlags argument, it defaults to JKParseOptionStrict
+
+@interface JSONDecoder : NSObject {
+  JKParseState *parseState;
+}
++ (id)decoder;
++ (id)decoderWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
+- (id)initWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
+- (void)clearCache;
+
+// The parse... methods were deprecated in v1.4 in favor of the v1.4 objectWith... methods.
+- (id)parseUTF8String:(const unsigned char *)string length:(size_t)length                         JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4.  Use objectWithUTF8String:length:        instead.
+- (id)parseUTF8String:(const unsigned char *)string length:(size_t)length error:(NSError **)error JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4.  Use objectWithUTF8String:length:error:  instead.
+// The NSData MUST be UTF8 encoded JSON.
+- (id)parseJSONData:(NSData *)jsonData                                                            JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4.  Use objectWithData:                     instead.
+- (id)parseJSONData:(NSData *)jsonData error:(NSError **)error                                    JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4.  Use objectWithData:error:               instead.
+
+// Methods that return immutable collection objects.
+- (id)objectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length;
+- (id)objectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length error:(NSError **)error;
+// The NSData MUST be UTF8 encoded JSON.
+- (id)objectWithData:(NSData *)jsonData;
+- (id)objectWithData:(NSData *)jsonData error:(NSError **)error;
+
+// Methods that return mutable collection objects.
+- (id)mutableObjectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length;
+- (id)mutableObjectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length error:(NSError **)error;
+// The NSData MUST be UTF8 encoded JSON.
+- (id)mutableObjectWithData:(NSData *)jsonData;
+- (id)mutableObjectWithData:(NSData *)jsonData error:(NSError **)error;
+
+@end
+
+////////////
+#pragma mark Deserializing methods
+////////////
+
+@interface NSString (JSONKitDeserializing)
+- (id)objectFromJSONString;
+- (id)objectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
+- (id)objectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;
+- (id)mutableObjectFromJSONString;
+- (id)mutableObjectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
+- (id)mutableObjectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;
+@end
+
+@interface NSData (JSONKitDeserializing)
+// The NSData MUST be UTF8 encoded JSON.
+- (id)objectFromJSONData;
+- (id)objectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
+- (id)objectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;
+- (id)mutableObjectFromJSONData;
+- (id)mutableObjectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
+- (id)mutableObjectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;
+@end
+
+////////////
+#pragma mark Serializing methods
+////////////
+  
+@interface NSString (JSONKitSerializing)
+// Convenience methods for those that need to serialize the receiving NSString (i.e., instead of having to serialize a NSArray with a single NSString, you can "serialize to JSON" just the NSString).
+// Normally, a string that is serialized to JSON has quotation marks surrounding it, which you may or may not want when serializing a single string, and can be controlled with includeQuotes:
+// includeQuotes:YES `a "test"...` -> `"a \"test\"..."`
+// includeQuotes:NO  `a "test"...` -> `a \"test\"...`
+- (NSData *)JSONData;     // Invokes JSONDataWithOptions:JKSerializeOptionNone   includeQuotes:YES
+- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions includeQuotes:(BOOL)includeQuotes error:(NSError **)error;
+- (NSString *)JSONString; // Invokes JSONStringWithOptions:JKSerializeOptionNone includeQuotes:YES
+- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions includeQuotes:(BOOL)includeQuotes error:(NSError **)error;
+@end
+
+@interface NSArray (JSONKitSerializing)
+- (NSData *)JSONData;
+- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;
+- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;
+- (NSString *)JSONString;
+- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;
+- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;
+@end
+
+@interface NSDictionary (JSONKitSerializing)
+- (NSData *)JSONData;
+- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;
+- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;
+- (NSString *)JSONString;
+- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;
+- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;
+@end
+
+#ifdef __BLOCKS__
+
+@interface NSArray (JSONKitSerializingBlockAdditions)
+- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;
+- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;
+@end
+
+@interface NSDictionary (JSONKitSerializingBlockAdditions)
+- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;
+- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;
+@end
+  
+#endif
+
+
+#endif // __OBJC__
+
+#endif // _JSONKIT_H_
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif

File diff suppressed because it is too large
+ 3059 - 0
PDF Office/PDF Master/Class/Common/OC/JSONKit/JSONKit.m


+ 17 - 0
PDF Office/PDF Master/Class/Common/OC/NSNULL+Filtration/NSNULL+Filtration.h

@@ -0,0 +1,17 @@
+//
+//  NSNULL+Filtration.h
+//  InAppPurchase-Mac
+//
+//  Created by zhudongyong on 14-7-11.
+//  Copyright (c) 2014年 kdanmobile. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface NSObject (NSNULL_Filtration)
+
+- (BOOL)isNSNULL;
+
+- (id)filterNullObject;
+
+@end

+ 60 - 0
PDF Office/PDF Master/Class/Common/OC/NSNULL+Filtration/NSNULL+Filtration.m

@@ -0,0 +1,60 @@
+//
+//  JSONKit+NSNULL.m
+//  InAppPurchase-Mac
+//
+//  Created by zhudongyong on 14-7-11.
+//  Copyright (c) 2014年 kdanmobile. All rights reserved.
+//
+
+#import "NSNULL+Filtration.h"
+
+
+@implementation NSObject (NSNULL)
+
+- (BOOL)isNSNULL {
+    return [self isKindOfClass:[NSNull class]];
+}
+
+
+
+- (id)filterNullObject {
+    if ([self isKindOfClass:[NSArray class]]) {
+        NSMutableArray *array = [NSMutableArray array];
+        
+        for (id item in (NSArray*)self) {
+            if (![item isNSNULL]) {
+                if ([item respondsToSelector:@selector(filterNullObject)]) {
+                    [array addObject:[item filterNullObject]];
+                }else {
+                    [array addObject:item];
+                }
+            }
+        }
+        return array;
+    }else if ([self isKindOfClass:[NSDictionary class]]) {
+        NSMutableDictionary *dicInfo = [NSMutableDictionary dictionary];
+        
+        id value = nil;
+        for (NSString *key in [(NSDictionary*)self allKeys]) {
+            if (![key isNSNULL]) {
+                value = ((NSDictionary*)self)[key];
+                
+                if (![value isNSNULL]) {
+                    if ([value respondsToSelector:@selector(filterNullObject)]) {
+                        [dicInfo setValue:[value filterNullObject]
+                                   forKey:key];
+                    }else {
+                        [dicInfo setValue:value
+                                   forKey:key];
+                    }
+                }
+            }
+        }
+        return dicInfo;
+    }
+    
+    return self;
+}
+
+
+@end

+ 20 - 0
PDF Office/PDF Master/Class/Common/OC/NSObject+DeviceInfo/NSObject+DeviceInfo.h

@@ -0,0 +1,20 @@
+//
+//  NSObject+DeviceInfo.h
+//  Connect
+//
+//  Created by 朱东勇 on 2017/5/25.
+//  Copyright © 2017年 innovator. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <IOKit/IOKitLib.h>
+
+NSString *GetProductName();
+
+NSString *GetHardwareUUID();
+
+NSString *GetHardwareSerialNumber();
+
+NSString *GetCompatible();
+
+NSString *GetSystemVersion();

+ 108 - 0
PDF Office/PDF Master/Class/Common/OC/NSObject+DeviceInfo/NSObject+DeviceInfo.m

@@ -0,0 +1,108 @@
+//
+//  NSObject+DeviceInfo.m
+//  Connect
+//
+//  Created by 朱东勇 on 2017/5/25.
+//  Copyright © 2017年 innovator. All rights reserved.
+//
+
+/**
+ "compatible" = <"iMac9,1">
+ "version" = <"1.0">
+ "board-id" = <"Mac-F2218EA9">
+ "IOInterruptSpecifiers" = (<0900000005000000>)
+ "IOPolledInterface" = "SMCPolledInterface is not serializable"
+ "serial-number" = <30544600000000000000000000313739343330303430544600000000000000000$
+ "IOInterruptControllers" = ("io-apic-0")
+ "IOPlatformUUID" = "D0XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXFB"
+ "IOPlatformArgs" = <0060880280ffffff0010880280ffffff18de8c0280ffffff0000000000000000$
+ "clock-frequency" = <005a6b3f>
+ "manufacturer" = <"Apple Inc.">
+ "IOConsoleSecurityInterest" = "IOCommand is not serializable"
+ "IOPlatformSerialNumber" = "17XXXXXXXTF"
+ "system-type" = <01>
+ "product-name" = <"iMac9,1">
+ "model" = <"iMac9,1">
+ "name" = <"/">
+ "IOBusyInterest" = "IOCommand is not serializable"
+ */
+
+#import "NSObject+DeviceInfo.h"
+
+NSString* GetDeviceInfo(NSString *key) {
+    NSString *ret = nil;
+    io_service_t platformExpert ;
+    platformExpert = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice")) ;
+    
+    if (platformExpert) {
+        CFTypeRef serialNumberAsCFString ;
+        serialNumberAsCFString = IORegistryEntryCreateCFProperty(platformExpert, (__bridge CFStringRef)(key), kCFAllocatorDefault, 0) ;
+        if (serialNumberAsCFString) {
+            ret = [(__bridge NSString *)(serialNumberAsCFString) copy];
+            CFRelease(serialNumberAsCFString);
+            serialNumberAsCFString = NULL;
+        }
+        IOObjectRelease(platformExpert);
+//        platformExpert = 0;
+    }
+    
+    return ret;
+}
+
+NSString *GetProductName() {
+    NSData *data = (NSData*)GetDeviceInfo(@"product-name");
+    if ([data isKindOfClass:[NSString class]])
+        return (NSString*)data;
+    return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
+}
+
+NSString *GetHardwareUUID() {
+    NSData *data = (NSData*)GetDeviceInfo(@"IOPlatformUUID");
+    if ([data isKindOfClass:[NSString class]])
+        return (NSString*)data;
+    return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
+}
+
+NSString *GetHardwareSerialNumber() {
+    NSData *data = (NSData*)GetDeviceInfo(@"IOPlatformSerialNumber");
+    if ([data isKindOfClass:[NSString class]])
+        return (NSString*)data;
+    return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
+}
+
+NSString *GetCompatible() {
+    NSData *data = (NSData*)GetDeviceInfo(@"compatible");
+    if ([data isKindOfClass:[NSString class]])
+        return (NSString*)data;
+    return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
+}
+
+NSString *GetSystemVersion() {
+    NSTask *task;
+    task = [[NSTask alloc] init];
+    [task setLaunchPath: @"/usr/bin/sw_vers"];
+    
+    NSArray *arguments;
+    arguments = [NSArray arrayWithObjects: @"-productVersion", nil];
+    [task setArguments: arguments];
+    
+    NSPipe *pipe;
+    pipe = [NSPipe pipe];
+    [task setStandardOutput: pipe];
+    
+    NSFileHandle *file;
+    file = [pipe fileHandleForReading];
+    
+    [task launch];
+    
+    NSData *data;
+    data = [file readDataToEndOfFile];
+    
+    NSString *string;
+    string = [[NSString alloc] initWithData: data
+                                   encoding: NSUTF8StringEncoding];
+//    NSLog (@"got\n%@", string);
+    string = [string stringByReplacingOccurrencesOfString:@"\r\0" withString:@""];
+    string = [string stringByReplacingOccurrencesOfString:@"\n" withString:@""];
+    return string;
+}

+ 4 - 2
PDF Office/PDF Master/Class/KMLightMember/KMRequestServer/KMRequestServer.swift

@@ -16,12 +16,14 @@ enum KMRequestServerMethodType: String, CaseIterable {
 }
 
 typealias KMHttpRequestServerComplete = (_ task: URLSessionDataTask?, _ responseObject: AnyObject?, _ error: NSError?) -> Void
-class KMRequestServer {
+@objcMembers class KMRequestServer: NSObject {
     var sessionManager: AFHTTPSessionManager!
     static let requestServer = KMRequestServer()
     var task: URLSessionTask?
     
-    init() {
+    override init() {
+        super.init()
+        
         let configuration: URLSessionConfiguration = URLSessionConfiguration.default
         sessionManager = AFHTTPSessionManager.init(sessionConfiguration: configuration)
         sessionManager.securityPolicy = AFSecurityPolicy.default()

+ 56 - 56
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseCompareDMGWindowController.m

@@ -15,9 +15,9 @@
 
 //#import "HyperLinkButton.h"
 
-//#import "KMVerificationWindowController.h"
+#import "KMVerificationWindowController.h"
 //#import "KMPurchaseCompareWindowController.h"
-//#import "VerificationManager.h"
+#import "VerificationManager.h"
 //#import "GAIManager.h"
 //#import "NSImage_SKExtensions.h"
 //#import "KMButton.h"
@@ -405,24 +405,24 @@ static NSString *const KMPurchaseCompareDMGCellIdentifier       = @"KMPurchaseCo
     [self.freeTrialButton setTitle:NSLocalizedString(@"7-day Free Trial", nil)];
 //    [self.freeTrialButton setBaseLineOffset:2];
 //    
-//    if (ActivityStatusVerification == [VerificationManager manager].status) {
-//        self.freeTrialBox.hidden = YES;
-//    } else if (ActivityStatusNone == [VerificationManager manager].status) {
-//        
-//    } else if (ActivityStatusTrialExpire == [VerificationManager manager].status) {
-//        self.freeTrialBox.hidden = YES;
-//        if ([VerificationManager manager].secondTrialEnabled) {
-//            self.freeTrialBox.hidden = NO;
-//        }
-//    } else {
-//        self.freeTrialBox.hidden = YES;
-//    }
-//    if ([KMAppearance isDarkMode]) {
-//        [self.freeTrialButton setTitleColor:[NSColor colorWithRed:178/255. green:165/255. blue:1 alpha:1]];
-//    } else {
-//        [self.freeTrialButton setTitleColor:[NSColor colorWithRed:160/255. green:40/255. blue:1 alpha:1]];
-//    }
-//    [self.buyNowButton setTitleColor:[NSColor whiteColor]];
+    if (ActivityStatusVerification == [VerificationManager manager].status) {
+        self.freeTrialBox.hidden = YES;
+    } else if (ActivityStatusNone == [VerificationManager manager].status) {
+        
+    } else if (ActivityStatusTrialExpire == [VerificationManager manager].status) {
+        self.freeTrialBox.hidden = YES;
+        if ([VerificationManager manager].secondTrialEnabled) {
+            self.freeTrialBox.hidden = NO;
+        }
+    } else {
+        self.freeTrialBox.hidden = YES;
+    }
+    if ([KMAppearance isDarkMode]) {
+        [self.freeTrialButton setTitleColor:[NSColor colorWithRed:178/255. green:165/255. blue:1 alpha:1]];
+    } else {
+        [self.freeTrialButton setTitleColor:[NSColor colorWithRed:160/255. green:40/255. blue:1 alpha:1]];
+    }
+    [self.buyNowButton setTitleColor:[NSColor whiteColor]];
 //    [self.buyNowButton setBaseLineOffset:2];
 //    
 //    if ([KMRecommondManager manager].discountRecommond.recommondInfoArrM.count > 0) {
@@ -487,22 +487,22 @@ static NSString *const KMPurchaseCompareDMGCellIdentifier       = @"KMPurchaseCo
 }
 
 - (IBAction)enterLicenseAction:(id)sender {
-//    [self close];
-//    KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];
-//    vc.callback = ^{
-//        [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
-//    };
-//    [vc showWindow:nil];
-//
+    [self close];
+    KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];
+    vc.callback = ^{
+        [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
+    };
+    [vc showWindow:nil];
+
 }
 
 - (IBAction)buttonItemClicked_Buy:(id)sender {
 #if VERSION_DMG
-//    NSURL *url = [NSURL URLWithString:@"https://www.pdfreaderpro.com/store?utm_source=app_dmg&utm_medium=dmg_puw_comparison"];
+    NSURL *url = [NSURL URLWithString:@"https://www.pdfreaderpro.com/store?utm_source=app_dmg&utm_medium=dmg_puw_comparison"];
 //    if([SKInspectPublicTool currentisLanguageHans]) {
 //        url = [NSURL URLWithString:@"https://www.pdfreaderpro.com/zh-cn/store?utm_source=app_dmg&utm_medium=dmg_puw_comparison"];
 //    }
-//    [[NSWorkspace sharedWorkspace] openURL:url];
+    [[NSWorkspace sharedWorkspace] openURL:url];
 //    [[FMTrackEventManager manager] trackEvent:@"PUW" withProperties:@{@"PUW_Btn":@"PUW_Btn_UpgradeBuyNow"}];
 #endif
     
@@ -513,34 +513,34 @@ static NSString *const KMPurchaseCompareDMGCellIdentifier       = @"KMPurchaseCo
 }
 
 - (void)buttonItemClicked_License:(id)sender {
-//    if ([VerificationManager manager].secondTrialEnabled) {
+    if ([VerificationManager manager].secondTrialEnabled) {
 //        [[FMTrackEventManager manager] trackEvent:@"Tbr" withProperties:@{@"Tbr_Btn":@"Btn_Tbr_SecondTrial"}];
-//        [[VerificationManager manager] trialForDays:7
-//                                              email:[VerificationManager manager].email
-//                                               name:[VerificationManager manager].accountName
-//                                        complention:^(ActivityStatus status, NSDictionary *info, NSError *error) {
-//            if (error ||
-//                status != ActivityStatusTrial) {
-//                NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Activation Error", nil)
-//                                                 defaultButton:NSLocalizedString(@"Try Again", nil)
-//                                               alternateButton:nil
-//                                                   otherButton:nil
-//                                     informativeTextWithFormat:NSLocalizedString(@"Failed to sign up for the free trial. Please make sure your internet connection is available and try again later.", nil), nil];
-//                [alert runModal];
-//            } else {
-//                KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeRepeatTrialSuccess];
-//                [vc showWindow:nil];
-//            }
-//        }];
-//        [self close];
-//    } else {
-//        [self close];
-//        KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeTrial];
-//        vc.callback = ^{
-//            [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
-//        };
-//        [vc showWindow:nil];
-//    }
+        [[VerificationManager manager] trialForDays:7
+                                              email:[VerificationManager manager].email
+                                               name:[VerificationManager manager].accountName
+                                        complention:^(ActivityStatus status, NSDictionary *info, NSError *error) {
+            if (error ||
+                status != ActivityStatusTrial) {
+                NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Activation Error", nil)
+                                                 defaultButton:NSLocalizedString(@"Try Again", nil)
+                                               alternateButton:nil
+                                                   otherButton:nil
+                                     informativeTextWithFormat:NSLocalizedString(@"Failed to sign up for the free trial. Please make sure your internet connection is available and try again later.", nil), nil];
+                [alert runModal];
+            } else {
+                KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeRepeatTrialSuccess];
+                [vc showWindow:nil];
+            }
+        }];
+        [self close];
+    } else {
+        [self close];
+        KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeTrial];
+        vc.callback = ^{
+            [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
+        };
+        [vc showWindow:nil];
+    }
 }
 
 #pragma mark - Noti

+ 25 - 25
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseLimitWindowController.swift

@@ -69,18 +69,18 @@ class KMPurchaseLimitWindowController: NSWindowController {
         self.desLabel2.stringValue = NSLocalizedString("Get converted files in high quality", comment: "")
         self.desLabel3.stringValue = NSLocalizedString("Batch Convert PDFs", comment: "")
         
-//        self.subTitleLabel.textColor = KMAppearance.kmColor_Layout_H0()
-//        self.infoTitleLabel.textColor = KMAppearance.kmColor_Layout_H0()
-//        self.desLabel1.textColor = KMAppearance.kmColor_Layout_H0()
-//        self.desLabel2.textColor = KMAppearance.kmColor_Layout_H0()
-//        self.desLabel3.textColor = KMAppearance.kmColor_Layout_H0()
-//        
-//        self.titleLbl.font = NSFont.ubuntuBoldFont(withSize: 21)
-//        self.subTitleLabel.font = NSFont.sfRegularFont(withSize: 14)
-//        self.infoTitleLabel.font = NSFont.sfMediumFont(withSize: 16)
-//        self.desLabel1.font = NSFont.sfRegularFont(withSize: 14)
-//        self.desLabel2.font = NSFont.sfRegularFont(withSize: 14)
-//        self.desLabel3.font = NSFont.sfRegularFont(withSize: 14)
+        self.subTitleLabel.textColor = KMAppearance.KMColor_Layout_H0()
+        self.infoTitleLabel.textColor = KMAppearance.KMColor_Layout_H0()
+        self.desLabel1.textColor = KMAppearance.KMColor_Layout_H0()
+        self.desLabel2.textColor = KMAppearance.KMColor_Layout_H0()
+        self.desLabel3.textColor = KMAppearance.KMColor_Layout_H0()
+        
+        self.titleLbl.font = NSFont.UbuntuBoldFontWithSize(21)
+        self.subTitleLabel.font = NSFont.SFProTextRegularFont(14)
+        self.infoTitleLabel.font = NSFont.SFMediumFontWithSize(16)
+        self.desLabel1.font = NSFont.SFProTextRegularFont(14)
+        self.desLabel2.font = NSFont.SFProTextRegularFont(14)
+        self.desLabel3.font = NSFont.SFProTextRegularFont(14)
         
         
         self.purchaseBox.wantsLayer = true
@@ -99,7 +99,7 @@ class KMPurchaseLimitWindowController: NSWindowController {
 //                self.purchaseBtn.layer?.backgroundColor = NSColor.clear.cgColor
 //            }
 //        }
-//        self.purchaseBtn.setTitleFont(NSFont.ubuntuBoldFont(withSize: 16))
+//        self.purchaseBtn.setTitleFont(NSFont.UbuntuBoldFontWithSize(16)
         
         self.convertButton.title = NSLocalizedString("Refresh Purchase Status", comment: "")
 //        self.convertButton.mouseMoveCallback = { mouseEntered in
@@ -154,28 +154,28 @@ class KMPurchaseLimitWindowController: NSWindowController {
     
     //MARK: IBAction
     @IBAction func unlimitConvertAction(_ sender: Any) {
-//        var url = URL(string:"https://www.pdfreaderpro.com/store?product_code=product_2&utm_source=MacAppDmg&utm_campaign=OfficeStoreLink&utm_medium=PdfOfficeStore")!
+        var url = URL(string:"https://www.pdfreaderpro.com/store?product_code=product_2&utm_source=MacAppDmg&utm_campaign=OfficeStoreLink&utm_medium=PdfOfficeStore")!
 //        if SKInspectPublicTool.currentisLanguageHans() == true {
 //            url = URL(string: "https://www.pdfreaderpro.com/zh-cn/store?product_code=product_2&utm_source=MacAppDmg&utm_campaign=OfficeStoreLink&utm_medium=PdfOfficeStore")!
 //        }
-//        NSWorkspace.shared.open(url)
+        NSWorkspace.shared.open(url)
 //        FMTrackEventManager.default().trackOnceEvent("PUW", withProperties: ["PUW_Btn":"Btn_PUW_PDFtoOffice_Buy"])
     }
     
     @IBAction func continueConvertAction(_ sender: Any) {
-//        VerificationManager.default().verification { status, info, error in
-//            if (error != nil) {
-//                let alert = NSAlert.init()
-//                alert.messageText = NSLocalizedString("Failed to Refresh", comment: "")
-//                alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
-//                alert.runModal()
-//            }
-//            self.removeWaitingView(self.contendView)
-//            
+        VerificationManager.default().verification { status, info, error in
+            if (error != nil) {
+                let alert = NSAlert.init()
+                alert.messageText = NSLocalizedString("Failed to Refresh", comment: "")
+                alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
+                alert.runModal()
+            }
+            self.removeWaitingView(self.contendView)
+            
 //            if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
 //                self.close()
 //            }
-//        }
+        }
         self.addWaingView(self.contendView)
     }
     

+ 1 - 1
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMRepeatTrialAlertController.m

@@ -72,7 +72,7 @@
 - (void)refreshUI {
     
     __weak typeof(self) weakSelf = self;
-//
+
     self.titleLbl.stringValue = NSLocalizedString(@"Unlock All Features for Free", nil);
     self.infoTitleLabel.stringValue = [@"👋🏻 " stringByAppendingString:NSLocalizedString(@"7-day Free Trial", nil)];
     self.infoSubTitleLabel.stringValue = NSLocalizedString(@"PDF Reader Pro offers a 7-day free trial of the full functions.", nil);

+ 6 - 6
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMUnlockAlertViewController.m

@@ -13,7 +13,7 @@
 #import <PDF_Master-Swift.h>
 #endif
 
-//#import "VerificationManager.h"
+#import "VerificationManager.h"
 
 @interface KMUnlockAlertViewController ()
 
@@ -113,11 +113,11 @@
     } else {
         self.subTitleLbl.textColor = [KMAppearance KMColor_Layout_H2];
     }
-//    if (ActivityStatusTrialExpire == [VerificationManager manager].status &&
-//        [VerificationManager manager].secondTrialEnabled == false) {
-//        self.subTitleLbl.stringValue = NSLocalizedString(@"Free trial expired. Upgrade PDF Reader Pro to enjoy the full functions.", nil);
-//        self.subTitleLbl.textColor = [KMAppearance KMColor_Status_Err];
-//    }
+    if (ActivityStatusTrialExpire == [VerificationManager manager].status &&
+        [VerificationManager manager].secondTrialEnabled == false) {
+        self.subTitleLbl.stringValue = NSLocalizedString(@"Free trial expired. Upgrade PDF Reader Pro to enjoy the full functions.", nil);
+        self.subTitleLbl.textColor = [KMAppearance KMColor_Status_Err];
+    }
     
     self.titleLbl.textColor = [KMAppearance KMColor_Layout_H0];
     self.deslbl1.textColor = self.desLbl2.textColor = self.desLbl3.textColor = self.desLbl4.textColor = self.desLbl5.textColor = [KMAppearance KMColor_Layout_H0];

+ 5 - 5
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationExpiredViewController.m

@@ -13,7 +13,7 @@
 #import <PDF_Master-Swift.h>
 #endif
 
-//#import "VerificationManager.h"
+#import "VerificationManager.h"
 
 @interface KMVerificationExpiredViewController ()
 
@@ -73,10 +73,10 @@
     [self.licenseButton setTitleColor:[KMAppearance KMColor_Layout_H0]];
     [self.contactUsButton setTitleColor:[NSColor whiteColor]];
     
-//    NSString *cdkey = [VerificationManager manager].detailInfo[@"device"][@"cdkey"];
-//    NSString *unique_sn = [VerificationManager manager].detailInfo[@"device"][@"unique_sn"];
-//    self.license.stringValue = cdkey ? : @"";
-//    self.device.stringValue = unique_sn ? : @"";
+    NSString *cdkey = [VerificationManager manager].detailInfo[@"device"][@"cdkey"];
+    NSString *unique_sn = [VerificationManager manager].detailInfo[@"device"][@"unique_sn"];
+    self.license.stringValue = cdkey ? : @"";
+    self.device.stringValue = unique_sn ? : @"";
     
     self.contactUsButtonLayer = [CALayer layer];
     [self.contactUsButton.layer addSublayer:self.contactUsButtonLayer];

+ 5 - 5
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationInfoViewController.m

@@ -13,7 +13,7 @@
 #import <PDF_Master-Swift.h>
 #endif
 
-//#import "VerificationManager.h"
+#import "VerificationManager.h"
 
 @interface KMVerificationInfoViewController ()
 
@@ -65,10 +65,10 @@
     
     self.unbindButton.title = NSLocalizedString(@"Unbind License Code", nil);
     
-//    NSString *cdkey = [VerificationManager manager].detailInfo[@"device"][@"cdkey"];
-//    NSString *unique_sn = [VerificationManager manager].detailInfo[@"device"][@"unique_sn"];
-//    self.license.stringValue = cdkey ? : @"";
-//    self.device.stringValue = unique_sn ? : @"";
+    NSString *cdkey = [VerificationManager manager].detailInfo[@"device"][@"cdkey"];
+    NSString *unique_sn = [VerificationManager manager].detailInfo[@"device"][@"unique_sn"];
+    self.license.stringValue = cdkey ? : @"";
+    self.device.stringValue = unique_sn ? : @"";
     
     self.continueButtonLayer = [CALayer layer];
     [self.continueButton.layer addSublayer:self.continueButtonLayer];

+ 1 - 1
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationViewController.m

@@ -13,7 +13,7 @@
 #import <PDF_Master-Swift.h>
 #endif
 
-//#import "VerificationManager.h"
+#import "VerificationManager.h"
 
 @interface KMVerificationViewController ()
 

+ 153 - 155
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationWindowController.m

@@ -13,7 +13,7 @@
 #import "KMVerificationAlertViewController.h"
 #import "KMActivityALertViewController.h"
 #import "KMVerificationInfoViewController.h"
-//#import "VerificationManager.h"
+#import "VerificationManager.h"
 //#import "KMMailHelper.h"
 #import "GBDeviceInfo.h"
 #import "Reachability.h"
@@ -46,72 +46,70 @@
 @implementation KMVerificationWindowController
 
 + (void)launching {
-//    [VerificationManager manager];
+    [VerificationManager manager];
 }
 
 + (BOOL)allowsShowExpired {
-//#if VERSION_DMG
-//    if ([VerificationManager manager].status == ActivityStatusTrialExpire &&
-//        [VerificationManager manager].secondTrialEnabled == NO) {
-//        if (![[NSUserDefaults standardUserDefaults] objectForKey:@"allowTrialExpireShowKeyDMG"]) {
-//            [[NSUserDefaults standardUserDefaults] setObject:@"YES" forKey:@"allowTrialExpireShowKeyDMG"];
-//            return YES;
-//        }
-//    }
-//    return NO;
-//#else
-//    NSDate *lastTimeDate = [[NSUserDefaults standardUserDefaults] objectForKey:@"kVerificationExpiredShowLastTimeDateKay"];
-//    if (lastTimeDate) {
-//        NSDate *date = [NSDate date];
-//        NSTimeInterval time = [date timeIntervalSinceDate:lastTimeDate];
-//        int days = ((int)time)/(3600*24);
-//        if (days < 15) {
-//            return NO;
-//        }
-//    }
-//#endif
+#if VERSION_DMG
+    if ([VerificationManager manager].status == ActivityStatusTrialExpire &&
+        [VerificationManager manager].secondTrialEnabled == NO) {
+        if (![[NSUserDefaults standardUserDefaults] objectForKey:@"allowTrialExpireShowKeyDMG"]) {
+            [[NSUserDefaults standardUserDefaults] setObject:@"YES" forKey:@"allowTrialExpireShowKeyDMG"];
+            return YES;
+        }
+    }
+    return NO;
+#else
+    NSDate *lastTimeDate = [[NSUserDefaults standardUserDefaults] objectForKey:@"kVerificationExpiredShowLastTimeDateKay"];
+    if (lastTimeDate) {
+        NSDate *date = [NSDate date];
+        NSTimeInterval time = [date timeIntervalSinceDate:lastTimeDate];
+        int days = ((int)time)/(3600*24);
+        if (days < 15) {
+            return NO;
+        }
+    }
+#endif
     return YES;
 }
 
 + (void)showExpiredInfo {
-//    if (ActivityStatusTrialExpire == [VerificationManager manager].status) {
-//        if ([KMVerificationWindowController allowsShowExpired]) {
-//            KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeTrialExpired];
-//            [vc showWindow:nil];
-//            [vc release];
-//            
-//            [[NSUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:@"kVerificationExpiredShowLastTimeDateKay"];
-//            [[NSUserDefaults standardUserDefaults] synchronize];
-//        }
-//    } else if (ActivityStatusVerifExpire == [VerificationManager manager].status) {
-//        if ([KMVerificationWindowController allowsShowExpired]) {
-//            KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivateExpired];
-//            [vc showWindow:nil];
-//            [vc release];
-//            
-//            [[NSUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:@"kVerificationExpiredShowLastTimeDateKay"];
-//            [[NSUserDefaults standardUserDefaults] synchronize];
-//        }
-//    }
+    if (ActivityStatusTrialExpire == [VerificationManager manager].status) {
+        if ([KMVerificationWindowController allowsShowExpired]) {
+            KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeTrialExpired];
+            [vc showWindow:nil];
+            
+            [[NSUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:@"kVerificationExpiredShowLastTimeDateKay"];
+            [[NSUserDefaults standardUserDefaults] synchronize];
+        }
+    } else if (ActivityStatusVerifExpire == [VerificationManager manager].status) {
+        if ([KMVerificationWindowController allowsShowExpired]) {
+            KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivateExpired];
+            [vc showWindow:nil];
+            
+            [[NSUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:@"kVerificationExpiredShowLastTimeDateKay"];
+            [[NSUserDefaults standardUserDefaults] synchronize];
+        }
+    }
 }
 
 + (BOOL)allowRepeatTrialAlertShow {
-//    //是否在开启APP时弹出二次试用弹窗提示框
-//    if ([VerificationManager manager].secondTrialEnabled) {
-//        if (![[NSUserDefaults standardUserDefaults] objectForKey:@"allowRepeatTrialAlertShowKey"]) {
-//            return YES;
-//        }
-//    }
+    //是否在开启APP时弹出二次试用弹窗提示框
+    if ([VerificationManager manager].secondTrialEnabled) {
+        if (![[NSUserDefaults standardUserDefaults] objectForKey:@"allowRepeatTrialAlertShowKey"]) {
+            return YES;
+        }
+    }
     return NO;
 }
 
 + (BOOL)allowRepeatTrialExpireShow {
-//    if ([VerificationManager manager].status == ActivityStatusTrialExpire &&
-//        [VerificationManager manager].trialTimes == 2) {
-//        if (![[NSUserDefaults standardUserDefaults] objectForKey:@"allowRepeatTrialExpireShowKey"]) {
-//            return YES;
-//        }
-//    }
+    if ([VerificationManager manager].status == ActivityStatusTrialExpire &&
+        [VerificationManager manager].trialTimes == 2) {
+        if (![[NSUserDefaults standardUserDefaults] objectForKey:@"allowRepeatTrialExpireShowKey"]) {
+            return YES;
+        }
+    }
     return NO;
 }
 
@@ -286,8 +284,8 @@ static KMVerificationWindowController *_currentWindowController = nil;
         _repeatTrialAlertController.callback = ^(NSInteger clickIndex, KMRepeatTrialAlertController * _Nonnull tRController) {
             if (clickIndex == 0) {
                 //免费试用
-//                [blockSelf verificationTrialForEmail:[VerificationManager manager].email
-//                                                name:[VerificationManager manager].accountName] ;
+                [blockSelf verificationTrialForEmail:[VerificationManager manager].email
+                                                name:[VerificationManager manager].accountName] ;
             } else if (clickIndex == 1) {
                 //了解更多
                 NSURL *url = [NSURL URLWithString:@"https://www.pdfreaderpro.com/store?utm_source=app_dmg&utm_medium=dmg_puw_sec_free_trial"];
@@ -455,23 +453,23 @@ static KMVerificationWindowController *_currentWindowController = nil;
     self.progressIndicator.hidden = NO;
     [self.progressIndicator startAnimation:nil];
     [self.trialViewController setEnabled:NO];
-//    [[VerificationManager manager] trialForDays:7 email:email name:name complention:^(ActivityStatus status, NSDictionary *info, NSError *error) {
-//        blockSelf.progressIndicator.hidden = YES;
-//        [blockSelf.progressIndicator stopAnimation:nil];
-//        [blockSelf.trialViewController setEnabled:YES];
-//        if (error ||
-//            status != ActivityStatusTrial) {
-//            NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Activation Error", nil)
-//                                             defaultButton:NSLocalizedString(@"Try Again", nil)
-//                                           alternateButton:nil
-//                                               otherButton:nil
-//                                 informativeTextWithFormat:NSLocalizedString(@"Failed to sign up for the free trial. Please make sure your internet connection is available and try again later.", nil), nil];
-//            [alert runModal];
-//        } else {
-//            blockSelf.type = KMVerificationTypeTrialSuccess;
-//            [blockSelf updateViewInfo];
-//        }
-//    }];
+    [[VerificationManager manager] trialForDays:7 email:email name:name complention:^(ActivityStatus status, NSDictionary *info, NSError *error) {
+        blockSelf.progressIndicator.hidden = YES;
+        [blockSelf.progressIndicator stopAnimation:nil];
+        [blockSelf.trialViewController setEnabled:YES];
+        if (error ||
+            status != ActivityStatusTrial) {
+            NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Activation Error", nil)
+                                             defaultButton:NSLocalizedString(@"Try Again", nil)
+                                           alternateButton:nil
+                                               otherButton:nil
+                                 informativeTextWithFormat:NSLocalizedString(@"Failed to sign up for the free trial. Please make sure your internet connection is available and try again later.", nil), nil];
+            [alert runModal];
+        } else {
+            blockSelf.type = KMVerificationTypeTrialSuccess;
+            [blockSelf updateViewInfo];
+        }
+    }];
 }
 
 - (void)verificationActivate:(NSString *)license {
@@ -512,88 +510,88 @@ static KMVerificationWindowController *_currentWindowController = nil;
     [self.progressIndicator startAnimation:nil];
     [self.activateViewController setEnabled:NO];
     NSDictionary *infoDic = @{@"cdkey":license};
-//    [[VerificationManager manager] activateDeviceWithInfo:infoDic complention:^(ActivityStatus status, NSDictionary *info, NSError *error) {
-//        blockSelf.progressIndicator.hidden = YES;
-//        [blockSelf.progressIndicator stopAnimation:nil];
-//        [blockSelf.activateViewController setEnabled:YES];
-//        if (error) {
-//
-//            NSString *tTitle0 = NSLocalizedString(@"The license you have entered is not correct. Please enter valid license.", nil);
-//            NSString *tTitle1 = NSLocalizedString(@"If you have already purchased PDF Reader Pro for Mac, you should find your license in an email confirmation.", nil);
-//
-//            NSString *message = [NSString stringWithFormat:@"%@\n\n%@", tTitle0, tTitle1];
-//
-//            if (ActivityErrorTypeCDKeyEmpty == error.code) {
-//                message = [NSString stringWithFormat:@"%@\n\n%@", NSLocalizedString(@"License number can not be empty.", nil), @""];
-//            } else if (ActivityErrorTypeCDKeyNotExist == error.code) {
-//                message = [NSString stringWithFormat:@"%@\n\n%@", NSLocalizedString(@"License number does not exist.", nil), @""];
-//            } else if (ActivityErrorTypeOutNumber == error.code) {
-//                NSString *tMsg0 = NSLocalizedString(@"The devices connected to the license number has outnumbered.", nil);
-//                NSString *tMsg1 = NSLocalizedString(@"Please deactivate license on one of them, to use PDF Reader Pro on this computer", nil);
-//                message = [NSString stringWithFormat:@"%@\n\n%@", tMsg0, tMsg1];
-//            } else if (ActivityErrorTypeNetworkDisable == error.code) {
-//                message = NSLocalizedString(@"The network is unavailable.", nil);
-//            } else if (ActivityErrorTypeCDKeyExpire == error.code) {
-//                message = NSLocalizedString(@"The license number expired.", nil);
-//            } else if (ActivityErrorTypeInvalidInfo == error.code) {
-//                message = NSLocalizedString(@"Activation error. Please try to input correct license, or contact us.", nil);
-//            } else if (ActivityErrorTypeNotMatchProduct == error.code) {
-//                message = NSLocalizedString(@"The license number is wrong, please input right license which is for this app.", nil);
-//            } else if (ActivityErrorTypeFormatError == error.code) {
-//                message = NSLocalizedString(@"The license format is wrong. Please input correct license.", nil);
-//            }
-//
-//            if ((ActivityErrorTypeUnknow == error.code) || (ActivityErrorTypeOutNumber == error.code) || (ActivityErrorTypeInvalidInfo == error.code)) {
-//                NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Activation Error", nil)
-//                                                 defaultButton:NSLocalizedString(@"Contact Us", nil)
-//                                               alternateButton:NSLocalizedString(@"Try Again", nil)
-//                                                   otherButton:nil
-//                                     informativeTextWithFormat:message, nil];
-//                if ([alert runModal]) {
-//                    [blockSelf verificationFeedback];
-//                }
-//            } else {
-//                if (ActivityErrorTypeNetworkDisable == error.code) {
-//                    NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Connection Error", nil)
-//                                                     defaultButton:NSLocalizedString(@"OK", nil)
-//                                                   alternateButton:nil
-//                                                       otherButton:nil
-//                                         informativeTextWithFormat:@"", nil];
-//                    
-//                    NSButton *accessryBtn = [[NSButton alloc] initWithFrame:CGRectMake(0, 0, 180, 44)];
-//                    accessryBtn.autoresizingMask = NSViewMaxXMargin | NSViewMinYMargin | NSViewMaxYMargin;
-//                    accessryBtn.bezelStyle = NSBezelStyleRegularSquare;
-//                    accessryBtn.bordered = NO;
-//                    accessryBtn.target = self;
-//                    accessryBtn.action = @selector(accessryBtnClicked:);
-//                    NSMutableAttributedString *mutAttrString = [[[NSMutableAttributedString alloc] initWithString:NSLocalizedString(@"Please make sure your internet connection is available.", nil)] autorelease];
-//                    [mutAttrString addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:12] range:NSMakeRange(0, [mutAttrString length])];
-//                    [mutAttrString addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:NSMakeRange(0, [mutAttrString length])];
-//                    [mutAttrString addAttribute:NSForegroundColorAttributeName value:[KMAppearance KMColor_Interactive_M0] range:NSMakeRange(0, [mutAttrString length])];
-//                    
-//                    accessryBtn.attributedTitle = mutAttrString;
-//                    NSRect rect = [mutAttrString boundingRectWithSize:CGSizeMake(180, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading];
-//                    CGRect frame = accessryBtn.frame;
-//                    frame.size.height = rect.size.height;
-//                    accessryBtn.frame = frame;
-//                    alert.accessoryView = accessryBtn;
-//                    
-//                    [alert runModal];
-//                } else {
-//                    NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Activation Error", nil)
-//                                                     defaultButton:NSLocalizedString(@"Try Again", nil)
-//                                                   alternateButton:nil
-//                                                       otherButton:nil
-//                                         informativeTextWithFormat:message, nil];
-//                    [alert runModal];
-//                }
-//            }
-//        } else {
-//            blockSelf.activityAlertViewController.alertTitle = NSLocalizedString(@"Successful activation!", nil);
-//            blockSelf.activityAlertViewController.alertMessage = NSLocalizedString(@"Congrats! You can start enjoying the advanced features of PDF Reader Pro.", nil);
-//            [blockSelf setContentView:blockSelf.activityAlertViewController.view];
-//        }
-//    }];
+    [[VerificationManager manager] activateDeviceWithInfo:infoDic complention:^(ActivityStatus status, NSDictionary *info, NSError *error) {
+        blockSelf.progressIndicator.hidden = YES;
+        [blockSelf.progressIndicator stopAnimation:nil];
+        [blockSelf.activateViewController setEnabled:YES];
+        if (error) {
+
+            NSString *tTitle0 = NSLocalizedString(@"The license you have entered is not correct. Please enter valid license.", nil);
+            NSString *tTitle1 = NSLocalizedString(@"If you have already purchased PDF Reader Pro for Mac, you should find your license in an email confirmation.", nil);
+
+            NSString *message = [NSString stringWithFormat:@"%@\n\n%@", tTitle0, tTitle1];
+
+            if (ActivityErrorTypeCDKeyEmpty == error.code) {
+                message = [NSString stringWithFormat:@"%@\n\n%@", NSLocalizedString(@"License number can not be empty.", nil), @""];
+            } else if (ActivityErrorTypeCDKeyNotExist == error.code) {
+                message = [NSString stringWithFormat:@"%@\n\n%@", NSLocalizedString(@"License number does not exist.", nil), @""];
+            } else if (ActivityErrorTypeOutNumber == error.code) {
+                NSString *tMsg0 = NSLocalizedString(@"The devices connected to the license number has outnumbered.", nil);
+                NSString *tMsg1 = NSLocalizedString(@"Please deactivate license on one of them, to use PDF Reader Pro on this computer", nil);
+                message = [NSString stringWithFormat:@"%@\n\n%@", tMsg0, tMsg1];
+            } else if (ActivityErrorTypeNetworkDisable == error.code) {
+                message = NSLocalizedString(@"The network is unavailable.", nil);
+            } else if (ActivityErrorTypeCDKeyExpire == error.code) {
+                message = NSLocalizedString(@"The license number expired.", nil);
+            } else if (ActivityErrorTypeInvalidInfo == error.code) {
+                message = NSLocalizedString(@"Activation error. Please try to input correct license, or contact us.", nil);
+            } else if (ActivityErrorTypeNotMatchProduct == error.code) {
+                message = NSLocalizedString(@"The license number is wrong, please input right license which is for this app.", nil);
+            } else if (ActivityErrorTypeFormatError == error.code) {
+                message = NSLocalizedString(@"The license format is wrong. Please input correct license.", nil);
+            }
+
+            if ((ActivityErrorTypeUnknow == error.code) || (ActivityErrorTypeOutNumber == error.code) || (ActivityErrorTypeInvalidInfo == error.code)) {
+                NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Activation Error", nil)
+                                                 defaultButton:NSLocalizedString(@"Contact Us", nil)
+                                               alternateButton:NSLocalizedString(@"Try Again", nil)
+                                                   otherButton:nil
+                                     informativeTextWithFormat:message, nil];
+                if ([alert runModal]) {
+                    [blockSelf verificationFeedback];
+                }
+            } else {
+                if (ActivityErrorTypeNetworkDisable == error.code) {
+                    NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Connection Error", nil)
+                                                     defaultButton:NSLocalizedString(@"OK", nil)
+                                                   alternateButton:nil
+                                                       otherButton:nil
+                                         informativeTextWithFormat:@"", nil];
+                    
+                    NSButton *accessryBtn = [[NSButton alloc] initWithFrame:CGRectMake(0, 0, 180, 44)];
+                    accessryBtn.autoresizingMask = NSViewMaxXMargin | NSViewMinYMargin | NSViewMaxYMargin;
+                    accessryBtn.bezelStyle = NSBezelStyleRegularSquare;
+                    accessryBtn.bordered = NO;
+                    accessryBtn.target = self;
+                    accessryBtn.action = @selector(accessryBtnClicked:);
+                    NSMutableAttributedString *mutAttrString = [[NSMutableAttributedString alloc] initWithString:NSLocalizedString(@"Please make sure your internet connection is available.", nil)];
+                    [mutAttrString addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:12] range:NSMakeRange(0, [mutAttrString length])];
+                    [mutAttrString addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:NSMakeRange(0, [mutAttrString length])];
+                    [mutAttrString addAttribute:NSForegroundColorAttributeName value:[KMAppearance KMColor_Interactive_M0] range:NSMakeRange(0, [mutAttrString length])];
+                    
+                    accessryBtn.attributedTitle = mutAttrString;
+                    NSRect rect = [mutAttrString boundingRectWithSize:CGSizeMake(180, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading];
+                    CGRect frame = accessryBtn.frame;
+                    frame.size.height = rect.size.height;
+                    accessryBtn.frame = frame;
+                    alert.accessoryView = accessryBtn;
+                    
+                    [alert runModal];
+                } else {
+                    NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Activation Error", nil)
+                                                     defaultButton:NSLocalizedString(@"Try Again", nil)
+                                                   alternateButton:nil
+                                                       otherButton:nil
+                                         informativeTextWithFormat:message, nil];
+                    [alert runModal];
+                }
+            }
+        } else {
+            blockSelf.activityAlertViewController.alertTitle = NSLocalizedString(@"Successful activation!", nil);
+            blockSelf.activityAlertViewController.alertMessage = NSLocalizedString(@"Congrats! You can start enjoying the advanced features of PDF Reader Pro.", nil);
+            [blockSelf setContentView:blockSelf.activityAlertViewController.view];
+        }
+    }];
     
 }
 
@@ -639,7 +637,7 @@ static KMVerificationWindowController *_currentWindowController = nil;
     subjects = [subjects stringByAppendingString:[NSString stringWithFormat:@"%@;",tAppVersion]];
     subjects = [subjects stringByAppendingString:[NSString stringWithFormat:@" %@;",versionString]];
     subjects = [subjects stringByAppendingString:[NSString stringWithFormat:@" %@",NSLocalizedString(@"Unbind License Code:", nil)]];
-//    subjects = [subjects stringByAppendingString:[NSString stringWithFormat:@"%@",[VerificationManager manager].detailInfo[@"device"][@"unique_sn"]?:@""]];
+    subjects = [subjects stringByAppendingString:[NSString stringWithFormat:@"%@",[VerificationManager manager].detailInfo[@"device"][@"unique_sn"]?:@""]];
     
     NSString *mailtoAddress = [NSString stringWithFormat:@"mailto:%@?Subject=%@&body=%@",@"support@pdfreaderpro.com",[self URLEncodedString:subjects],[self URLEncodedString:NSLocalizedString(@"Hi PDF Reader Pro Team, I need to unbind my license code, thanks!\nNotice: Please do not modify the subtitle content", nil)]];
     [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:mailtoAddress]];

+ 162 - 0
PDF Office/PDF Master/Class/Purchase/DMG/Verification/VerificationManager/VerificationManager.h

@@ -0,0 +1,162 @@
+//
+//  VerificationManager.h
+//  Filmage Screen
+//
+//  Version 1.0.1
+//
+//  Created by 朱东勇 on 2018/2/8.
+//  Copyright © 2018年 kdan mobile. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "PDF_Master-Bridging-Header.h"
+#if VERSION_DMG
+#import <PDF_Master-Swift.h>
+#else
+#import <PDF_Master-Swift.h>
+#endif
+
+
+#define kTestMode   0
+
+#if kTestMode
+#define kVerificationServer         @"http://test-store.kdan.cn:3018/"
+#define kWebServerLink              NSLocalizedString(@"http://test-pdf-pro.kdan.cn:3021", nil)
+#else
+#define kVerificationServer         @"https://store.pdfreaderpro.com/"
+#define kWebServerLink              NSLocalizedString(@"http://www.pdfreaderpro.com/store", nil)
+#endif
+
+#define kFetchLicenseCodeString     [NSString stringWithFormat:@"%@/%@", kWebServerLink, @"store"]
+#define kLicenseRetrievalCodeString [NSString stringWithFormat:@"%@/%@", kWebServerLink, @"license_retrieval"]
+#define kFAQString [NSString stringWithFormat:@"%@/%@", kWebServerLink, @"faq"]
+#define kCheckUpdateURLString       [NSString stringWithFormat:@"%@api/auth_devices/latest_version?lang=en&app_code=%@", kVerificationServer, [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"]?:@""]
+#define kFetchSysConfigInfoString   [NSString stringWithFormat:@"%@/%@", kVerificationServer, @"api/sys_configs"]
+
+///激活
+typedef enum {
+    ActivityErrorTypeCDKeyEmpty,//CD Key为空
+    ActivityErrorTypeCDKeyNotExist,//CD Key不存在
+    ActivityErrorTypeNetworkDisable,//网络不可用
+    ActivityErrorTypeOutNumber,//CD Key超出绑定数量,被其他设备使用
+    ActivityErrorTypeCDKeyExpire,//序列码过期
+    ActivityErrorTypeInvalidInfo,//激活错误,联系我们或查看FAQ
+    ActivityErrorTypeNotMatchProduct,//CDkey是其他产品的
+    ActivityErrorTypeFormatError,//格式错误
+    ActivityErrorTypeUnknow,//未知错误
+}ActivityErrorType;
+
+typedef enum {
+    ActivityStatusNone,
+    ActivityStatusTrial,        //试用
+    ActivityStatusVerification, //激活
+    ActivityStatusTrialExpire,  //试用过期
+    ActivityStatusVerifExpire,  //过期
+    ActivityStatusLicenseExpire,//序列号过期
+}ActivityStatus;
+
+typedef void(^ActivityComplention)(ActivityStatus status, NSDictionary *info, NSError *error);
+@interface VerificationManager : NSObject
+@property (nonatomic) BOOL autoVerification; //激活码定期自动校验,默认隔一小时校验一次
+@property (nonatomic, readonly) ActivityStatus status;
+@property (nonatomic, readonly) BOOL needUpgradeLicense;
+@property (nonatomic, readonly) NSString *licenseCode;
+@property (nonatomic, readonly) NSDictionary *detailInfo;
+
+@property (nonatomic, readonly) BOOL secondTrialEnabled;
+
+@property (nonatomic, readonly) NSInteger trialTimes;
+
+@property (nonatomic, readonly) NSString *email;
+
+@property (nonatomic, readonly) NSString *accountName;
+
+
++ (VerificationManager *)manager;
+
++ (VerificationManager *)defaultManager;
+
+///** 跳转到 Built to Connect 官网商城购买界面,各App可自行跳转到对应激活购买界面
+// */
+//- (void)fetchVerificationCode;
+
+/** 激活设备
+ @params info
+    email           用户Email,可选
+    cdkey           用户用于激活设备的激活码,必选
+ */
+- (void)activateDeviceWithInfo:(NSDictionary*)info
+                   complention:(ActivityComplention)complention;
+
+/** 验证设备信息
+ */
+- (void)verificationWithComplention:(ActivityComplention)complention;
+
+/** 提交试用
+ @param  days    申请试用天数,由App端指定,Server端会限定最大试用天数
+ @param  email   option, 申请人Email信息
+ */
+- (void)trialForDays:(float)days
+               email:(NSString*)email
+                name:(NSString*)name
+         complention:(ActivityComplention)complention;
+- (void)trialForDays:(float)days
+         complention:(ActivityComplention)complention;
+
+/** 邀请部分
+ @param email 当前App使用的email 地址,用于接由试用体验邮件
+ */
+- (void)getCodeWithEmail:(NSString*)email
+             complention:(ActivityComplention)complention;
+
+/** 使用好友的邀请码
+ 
+ */
+- (void)userCode:(NSString*)code
+     complention:(ActivityComplention)complention;
+
+/** 修改用户email
+ 
+ */
+- (void)modifyEmail:(NSString*)email
+        complention:(ActivityComplention)complention;
+
+/** 给好友发送邀请email, 多个email 使用 , 号分隔
+ 
+ */
+- (void)sendInvateEmails:(NSString*)emails
+                    code:(NSString*)code
+             complention:(ActivityComplention)complention;
+
+
+@end
+
+#pragma mark - Data Parse
+@interface NSDictionary (ActivityInfo)
+@property (nonatomic, readonly) ActivityStatus status;
+@property (nonatomic, readonly) NSDate *createDate;
+@property (nonatomic, readonly) NSDate *expireDate;
+@property (nonatomic, readonly) NSString *licenseCode;
+
+@property (nonatomic, readonly) NSString *shareCode;
+@property (nonatomic, readonly) NSUInteger invateUsersCount;
+
+@property (nonatomic, readonly) NSDate *fetchInvateDate;
+@property (nonatomic, readonly) NSString *fromCode;
+
+@property (nonatomic, readonly) NSUInteger maxFreeDays;
+
+@property (nonatomic, readonly) BOOL repeatTrial;
+
+@property (nonatomic, readonly) NSString *email;
+
+@property (nonatomic, readonly) NSString *accountName;
+
+@property (nonatomic, readonly) NSUInteger trialTimes;
+
+@end
+
+/// Notification
+extern NSString *kDeviceVerifyFinishNotification;//调用验证接口结束后发送通知
+
+extern NSString *kDeviceActivateStatusChangeNotification;

File diff suppressed because it is too large
+ 1064 - 0
PDF Office/PDF Master/Class/Purchase/DMG/Verification/VerificationManager/VerificationManager.m


+ 1 - 0
PDF Office/PDF Master/PDF_Master DMG-Bridging-Header.h

@@ -78,4 +78,5 @@
 //文件权限
 #import "AppSandboxFileAccess.h"
 
+#import "VerificationManager.h"
 #import "KMPurchaseCompareWindowController.h"

+ 1 - 0
PDF Office/PDF Master/PDF_Master Pro-Bridging-Header.h

@@ -62,4 +62,5 @@
 //文件权限
 #import "AppSandboxFileAccess.h"
 
+#import "VerificationManager.h"
 #import "KMPurchaseCompareWindowController.h"

+ 1 - 0
PDF Office/PDF Master/PDF_Master-Bridging-Header.h

@@ -74,4 +74,5 @@
 //文件权限
 #import "AppSandboxFileAccess.h"
 
+#import "VerificationManager.h"
 #import "KMPurchaseCompareWindowController.h"