Browse Source

【广告】代码导入

lizhe 1 year ago
parent
commit
75aec73074

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

@@ -1761,6 +1761,12 @@
 		ADE8BC3329F9261900570F89 /* KMSearchCellView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADE8BC3229F9261900570F89 /* KMSearchCellView.xib */; };
 		ADE8BC3429F9261900570F89 /* KMSearchCellView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADE8BC3229F9261900570F89 /* KMSearchCellView.xib */; };
 		ADE8BC3529F9261900570F89 /* KMSearchCellView.xib in Resources */ = {isa = PBXBuildFile; fileRef = ADE8BC3229F9261900570F89 /* KMSearchCellView.xib */; };
+		ADE8BC3B29F9458700570F89 /* KMRecommondManager.m in Sources */ = {isa = PBXBuildFile; fileRef = ADE8BC3729F9458700570F89 /* KMRecommondManager.m */; };
+		ADE8BC3C29F9458700570F89 /* KMRecommondManager.m in Sources */ = {isa = PBXBuildFile; fileRef = ADE8BC3729F9458700570F89 /* KMRecommondManager.m */; };
+		ADE8BC3D29F9458700570F89 /* KMRecommondManager.m in Sources */ = {isa = PBXBuildFile; fileRef = ADE8BC3729F9458700570F89 /* KMRecommondManager.m */; };
+		ADE8BC3E29F9458700570F89 /* KMRecommondInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = ADE8BC3929F9458700570F89 /* KMRecommondInfo.m */; };
+		ADE8BC3F29F9458700570F89 /* KMRecommondInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = ADE8BC3929F9458700570F89 /* KMRecommondInfo.m */; };
+		ADE8BC4029F9458700570F89 /* KMRecommondInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = ADE8BC3929F9458700570F89 /* KMRecommondInfo.m */; };
 		ADEC7A7E299397F8009A8256 /* NSFont+SFProText.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADEC7A7B299397F8009A8256 /* NSFont+SFProText.swift */; };
 		ADEC7A7F299397F8009A8256 /* NSFont+SFProText.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADEC7A7B299397F8009A8256 /* NSFont+SFProText.swift */; };
 		ADEC7A80299397F8009A8256 /* NSFont+SFProText.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADEC7A7B299397F8009A8256 /* NSFont+SFProText.swift */; };
@@ -3918,6 +3924,10 @@
 		ADE8BC2929F7CDB000570F89 /* KMPageNumberDisplayView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMPageNumberDisplayView.xib; sourceTree = "<group>"; };
 		ADE8BC2E29F8CD7200570F89 /* KMPDFThumbnailModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMPDFThumbnailModel.swift; sourceTree = "<group>"; };
 		ADE8BC3229F9261900570F89 /* KMSearchCellView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMSearchCellView.xib; sourceTree = "<group>"; };
+		ADE8BC3729F9458700570F89 /* KMRecommondManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KMRecommondManager.m; sourceTree = "<group>"; };
+		ADE8BC3829F9458700570F89 /* KMRecommondManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KMRecommondManager.h; sourceTree = "<group>"; };
+		ADE8BC3929F9458700570F89 /* KMRecommondInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KMRecommondInfo.m; sourceTree = "<group>"; };
+		ADE8BC3A29F9458700570F89 /* KMRecommondInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KMRecommondInfo.h; sourceTree = "<group>"; };
 		ADEC7A7B299397F8009A8256 /* NSFont+SFProText.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSFont+SFProText.swift"; sourceTree = "<group>"; };
 		ADEC7A7C299397F8009A8256 /* SF-Pro-Text-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Text-Regular.otf"; sourceTree = "<group>"; };
 		ADEC7A7D299397F8009A8256 /* SF-Pro-Text-Semibold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-Pro-Text-Semibold.otf"; sourceTree = "<group>"; };
@@ -6822,6 +6832,17 @@
 			path = model;
 			sourceTree = "<group>";
 		};
+		ADE8BC3629F9453A00570F89 /* KMAdvertisement */ = {
+			isa = PBXGroup;
+			children = (
+				ADE8BC3A29F9458700570F89 /* KMRecommondInfo.h */,
+				ADE8BC3929F9458700570F89 /* KMRecommondInfo.m */,
+				ADE8BC3829F9458700570F89 /* KMRecommondManager.h */,
+				ADE8BC3729F9458700570F89 /* KMRecommondManager.m */,
+			);
+			path = KMAdvertisement;
+			sourceTree = "<group>";
+		};
 		ADEC7A7A299397F8009A8256 /* Fonts */ = {
 			isa = PBXGroup;
 			children = (
@@ -7177,6 +7198,7 @@
 		BB2C6A7128F2652500478A33 /* Class */ = {
 			isa = PBXGroup;
 			children = (
+				ADE8BC3629F9453A00570F89 /* KMAdvertisement */,
 				BB9807F829CA93A900BEEB81 /* Welcome */,
 				BB135C2629B6CD4500FD5965 /* Common */,
 				ADE3C1CB29A5A79E00793B13 /* KMLightMember */,
@@ -10414,6 +10436,7 @@
 				89752DEA293875FC003FF08E /* KMMainToolbarController.swift in Sources */,
 				BBA93D2D29BEBAA60044E0DD /* KMPreferenceEnum.swift in Sources */,
 				BB89DD7E2953F863007C3FFA /* KMWatermarkFileOutsideView.swift in Sources */,
+				ADE8BC3E29F9458700570F89 /* KMRecommondInfo.m in Sources */,
 				AD9527C6295295110039D2BC /* KMPrintPrinterModel.swift in Sources */,
 				BB146FE4299DC0D100784A6A /* GTLRURITemplate.m in Sources */,
 				9F1FE50D29407B2B00E952CA /* KMUploadFilePanel.swift in Sources */,
@@ -10494,6 +10517,7 @@
 				ADCB98D92924774F00B51A03 /* KMBatchProcessingOrderTableCell.swift in Sources */,
 				BB146FED299DC0D100784A6A /* GTLRBatchResult.m in Sources */,
 				9F8539C629430AC400DF644E /* KMToolbarRightView.swift in Sources */,
+				ADE8BC3B29F9458700570F89 /* KMRecommondManager.m in Sources */,
 				BB49ECED293F3B0D00C82CA2 /* KMConvertOCRSettingItemView.swift in Sources */,
 				9F0CB49729683E1000007028 /* KMPropertiesPanelTextSubVC.swift in Sources */,
 				9F1FE49929406E4700E952CA /* NewTabButton.m in Sources */,
@@ -11174,6 +11198,7 @@
 				9F1FE50E29407B2B00E952CA /* KMUploadFilePanel.swift in Sources */,
 				BBA93D2E29BEBAA60044E0DD /* KMPreferenceEnum.swift in Sources */,
 				F34BF94A295310AB002C25A2 /* NSUserDefaults+PDFListView.m in Sources */,
+				ADE8BC3F29F9458700570F89 /* KMRecommondInfo.m in Sources */,
 				89752DA02936EC50003FF08E /* KMToolbar.m in Sources */,
 				BB146FE5299DC0D100784A6A /* GTLRURITemplate.m in Sources */,
 				9F1FE4F129406E4700E952CA /* BackgroundGradientView.m in Sources */,
@@ -11254,6 +11279,7 @@
 				9F1FE49A29406E4700E952CA /* NewTabButton.m in Sources */,
 				BB146FEE299DC0D100784A6A /* GTLRBatchResult.m in Sources */,
 				ADCB98E22924776F00B51A03 /* KMBatchProcessingSizeTableCell.swift in Sources */,
+				ADE8BC3C29F9458700570F89 /* KMRecommondManager.m in Sources */,
 				BB897272294DB6BE0045787C /* KMWatermarkAdjectivePlainView.swift in Sources */,
 				9F0CB49829683E1000007028 /* KMPropertiesPanelTextSubVC.swift in Sources */,
 				9F1FE4AC29406E4700E952CA /* CTBrowserWindow.m in Sources */,
@@ -11707,6 +11733,7 @@
 				BB86C21628F560D1005AD968 /* NSGraphics_SKExtensions.m in Sources */,
 				BB146FF2299DC0D100784A6A /* GTLRUploadParameters.m in Sources */,
 				F373230A292DF9410013862C /* CPDFLineAnnotation+PDFListView.m in Sources */,
+				ADE8BC3D29F9458700570F89 /* KMRecommondManager.m in Sources */,
 				BBB9B330299A5D6D004F3235 /* GTMAppAuthFetcherAuthorization.m in Sources */,
 				89752DB52936F505003FF08E /* KMCustomButtonPopMenuViewController.m in Sources */,
 				BB16473B29E7A4C30044DFBE /* NSTextView+KMExtension.m in Sources */,
@@ -11796,6 +11823,7 @@
 				9FDD0F862952FC9C000C4DAD /* KMAliasLightParser.swift in Sources */,
 				BB49ED08293F461500C82CA2 /* KMConvertCSVWindowController.swift in Sources */,
 				F3B69897298B7F7500E0EB4D /* KMDocumentAIManager.m in Sources */,
+				ADE8BC4029F9458700570F89 /* KMRecommondInfo.m in Sources */,
 				ADB2D6E8294740F30029D2B3 /* KMPrintPaperSetWindowController.swift in Sources */,
 				AD867FC329DFC39400F00440 /* KMBOTAAnnotationItem.swift in Sources */,
 				89E4E7372964148E002DBA6F /* KMAnnotationPropertiesViewController.m in Sources */,

+ 79 - 0
PDF Office/PDF Master.xcodeproj/xcuserdata/lizhe.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -3479,6 +3479,21 @@
                   endingLineNumber = "854"
                   offsetFromSymbolStart = "496">
                </Location>
+               <Location
+                  uuid = "A9ECAAB1-38BB-4918-83CA-5C22F5C9553C - be8dfde593aa823a"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "closure #1 (PDF_Master.KMThumbnailViewController) -&gt; () in PDF_Master.KMThumbnailViewController.rotatePageItems(pageItems: Swift.Array&lt;PDF_Master.KMThumbnailPageItem&gt;, indexPaths: Swift.Set&lt;Foundation.IndexPath&gt;) -&gt; ()"
+                  moduleName = "PDF Master"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Volumes/Data/Company/kdan/Projects/PDF%20Office/PDF%20Office/PDF%20Master/Class/PDFWindowController/Side/LeftSide/Thumbnail/KMThumbnailViewController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "855"
+                  endingLineNumber = "855"
+                  offsetFromSymbolStart = "204">
+               </Location>
             </Locations>
          </BreakpointContent>
       </BreakpointProxy>
@@ -3833,5 +3848,69 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "CC6AD11B-07CC-495C-9E67-DAF6DFBA1EF1"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/KMAnnotationViewController.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "137"
+            endingLineNumber = "137"
+            landmarkName = "reloadData()"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "9CE3D2D3-00FC-4779-A3AF-EF8E47B7C822"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/KMAnnotationView/KMAnnotationOutlineView.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "81"
+            endingLineNumber = "81"
+            landmarkName = "outlineView(_:numberOfChildrenOfItem:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "8040E93A-F440-454A-BB85-36008321B2F0"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/KMAnnotationView/KMAnnotationOutlineView.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "55"
+            endingLineNumber = "55"
+            landmarkName = "reloadData(expandItemType:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "45AF52D1-DC90-426A-AE78-E51593214CC5"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/KMAnnotationViewController.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "256"
+            endingLineNumber = "256"
+            landmarkName = "updateExtempViewState()"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 12 - 13
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController.xib

@@ -1,12 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
-        <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMHomeViewController" customModule="PDF_Office" customModuleProvider="target">
+        <customObject id="-2" userLabel="File's Owner" customClass="KMHomeViewController" customModule="PDF_Master" customModuleProvider="target">
             <connections>
                 <outlet property="activitiesBox" destination="MFa-T5-0wb" id="hkR-Nv-9aL"/>
                 <outlet property="cloudDocumentsBox" destination="ntJ-b8-qxk" id="hNr-Vi-fYQ"/>
@@ -139,7 +138,7 @@ Gw
                                         </constraints>
                                         <color key="fillColor" name="systemRedColor" catalog="System" colorSpace="catalog"/>
                                     </box>
-                                    <box hidden="YES" boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="deA-td-u53" customClass="KMBox" customModule="PDF_Office" customModuleProvider="target">
+                                    <box hidden="YES" boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="deA-td-u53" customClass="KMBox" customModule="PDF_Master" customModuleProvider="target">
                                         <rect key="frame" x="16" y="676" width="238" height="36"/>
                                         <view key="contentView" id="RnK-oF-lcb">
                                             <rect key="frame" x="0.0" y="0.0" width="238" height="36"/>
@@ -199,7 +198,7 @@ Gw
                                                             <view translatesAutoresizingMaskIntoConstraints="NO" id="TNl-3V-JVe">
                                                                 <rect key="frame" x="0.0" y="-9" width="255" height="661"/>
                                                                 <subviews>
-                                                                    <box boxType="custom" borderWidth="0.0" cornerRadius="8" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="iRu-hZ-Eba" customClass="KMBox" customModule="PDF_Office" customModuleProvider="target">
+                                                                    <box boxType="custom" borderWidth="0.0" cornerRadius="8" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="iRu-hZ-Eba" customClass="KMBox" customModule="PDF_Master" customModuleProvider="target">
                                                                         <rect key="frame" x="16" y="549" width="238" height="112"/>
                                                                         <view key="contentView" id="Szn-qw-Fab">
                                                                             <rect key="frame" x="0.0" y="0.0" width="238" height="112"/>
@@ -266,7 +265,7 @@ Gw
                                                                         </view>
                                                                         <color key="fillColor" red="0.92156862745098034" green="0.92156862745098034" blue="0.92156862745098034" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                                                     </box>
-                                                                    <box boxType="custom" borderWidth="0.0" cornerRadius="8" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="MFa-T5-0wb" customClass="KMBox" customModule="PDF_Office" customModuleProvider="target">
+                                                                    <box boxType="custom" borderWidth="0.0" cornerRadius="8" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="MFa-T5-0wb" customClass="KMBox" customModule="PDF_Master" customModuleProvider="target">
                                                                         <rect key="frame" x="32" y="30" width="206" height="242"/>
                                                                         <view key="contentView" id="zIt-55-NjD">
                                                                             <rect key="frame" x="0.0" y="0.0" width="206" height="242"/>
@@ -299,7 +298,7 @@ Gw
                                                         <rect key="frame" x="-100" y="-100" width="253" height="15"/>
                                                         <autoresizingMask key="autoresizingMask"/>
                                                     </scroller>
-                                                    <scroller key="verticalScroller" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="eMA-3D-xnv" customClass="KMToolSetScroller" customModule="PDF_Office" customModuleProvider="target">
+                                                    <scroller key="verticalScroller" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="eMA-3D-xnv" customClass="KMToolSetScroller" customModule="PDF_Master" customModuleProvider="target">
                                                         <rect key="frame" x="255" y="0.0" width="15" height="652"/>
                                                         <autoresizingMask key="autoresizingMask"/>
                                                     </scroller>
@@ -432,7 +431,7 @@ Gw
                         <outlet property="delegate" destination="-2" id="Nyn-SM-8if"/>
                     </connections>
                 </splitView>
-                <customView translatesAutoresizingMaskIntoConstraints="NO" id="3Ej-3j-QZ3" customClass="KMHomeDragView" customModule="PDF_Office" customModuleProvider="target">
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="3Ej-3j-QZ3" customClass="KMHomeDragView" customModule="PDF_Master" customModuleProvider="target">
                     <rect key="frame" x="16" y="16" width="1042" height="788"/>
                     <subviews>
                         <customView translatesAutoresizingMaskIntoConstraints="NO" id="lTX-FO-7Ze">
@@ -480,10 +479,10 @@ Gw
             </constraints>
             <point key="canvasLocation" x="-58" y="-19"/>
         </customView>
-        <customObject id="O3f-x2-y6f" customClass="KMHomeFastToolViewController" customModule="PDF_Office" customModuleProvider="target"/>
-        <customObject id="UcW-Sh-zFW" customClass="KMHomeHistoryFileViewController" customModule="PDF_Office" customModuleProvider="target"/>
-        <customObject id="cEr-ez-OtI" customClass="KMPDFToolsViewController" customModule="PDF_Office" customModuleProvider="target"/>
-        <customObject id="icM-sk-XE7" customClass="KMCloudDocumentsViewController" customModule="PDF_Office" customModuleProvider="target"/>
+        <customObject id="O3f-x2-y6f" customClass="KMHomeFastToolViewController" customModule="PDF_Master" customModuleProvider="target"/>
+        <customObject id="UcW-Sh-zFW" customClass="KMHomeHistoryFileViewController" customModule="PDF_Master" customModuleProvider="target"/>
+        <customObject id="cEr-ez-OtI" customClass="KMPDFToolsViewController" customModule="PDF_Master" customModuleProvider="target"/>
+        <customObject id="icM-sk-XE7" customClass="KMCloudDocumentsViewController" customModule="PDF_Master" customModuleProvider="target"/>
     </objects>
     <resources>
         <image name="NSTouchBarGoForwardTemplate" width="12" height="17"/>

+ 4 - 5
PDF Office/PDF Master/Class/Home/WindowController/KMHomeWindowController.xib

@@ -1,12 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
-        <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMHomeWindowController" customModule="PDF_Office" customModuleProvider="target">
+        <customObject id="-2" userLabel="File's Owner" customClass="KMHomeWindowController" customModule="PDF_Master" customModuleProvider="target">
             <connections>
                 <outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
             </connections>
@@ -17,7 +16,7 @@
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="240" width="1280" height="800"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1800" height="1125"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
             <view key="contentView" id="se5-gp-TjO">
                 <rect key="frame" x="0.0" y="0.0" width="1280" height="800"/>
                 <autoresizingMask key="autoresizingMask"/>

+ 3 - 4
PDF Office/PDF Master/Class/Home/WindowController/KMURLToPDFWindowController.xib

@@ -1,12 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
-        <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMURLToPDFWindowController" customModule="PDF_Office" customModuleProvider="target">
+        <customObject id="-2" userLabel="File's Owner" customClass="KMURLToPDFWindowController" customModule="PDF_Master" customModuleProvider="target">
             <connections>
                 <outlet property="cancelView" destination="137-mQ-meg" id="IeR-yR-8Al"/>
                 <outlet property="fileButtonBox" destination="3Ww-O2-STf" id="9xj-nd-Itu"/>

+ 75 - 0
PDF Office/PDF Master/Class/KMAdvertisement/KMRecommondInfo.h

@@ -0,0 +1,75 @@
+//
+//  KMRecommondInfo.h
+//  PDF Reader Pro Edition
+//
+//  Created by Niehaoyu on 2023/4/11.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+typedef enum : NSUInteger {
+    KMRecommondShowType_None,
+    KMRecommondShowType_All,//免费版跟付费版都需要显示
+    KMRecommondShowType_Pro,//只有付费用户显示
+    KMRecommondShowType_Lite,//只有免费用户显示
+} KMRecommondShowType;
+
+@class KMRecommondInfo;
+@interface KMRecommond : NSObject
+
+- (id)initWithDict:(NSDictionary *)dict;
+
+@property (nonatomic, strong) NSString *versionKey;
+
+@property (nonatomic, strong) NSString *name;
+
+@property (nonatomic, strong, readonly) NSMutableArray <KMRecommondInfo *> *recommondInfoArrM;
+
+@end
+
+@interface KMRecommondInfo : NSObject
+
++ (NSString *)languageKey;
++ (NSString *)cacheDirs;
++ (BOOL)isDarkMode;
+
+- (id)initWithDict:(NSDictionary *)dict;
+
+- (void)updateValue:(NSString *)value forKey:(NSString *)key;
+
+@property (nonatomic, assign) BOOL show;//是否显示,内部有做了时间区间判断
+
+@property (nonatomic, assign) KMRecommondShowType showType;
+
+@property (nonatomic, strong) NSDate *startDate;
+
+@property (nonatomic, strong) NSDate *endDate;
+
+@property (nonatomic, strong) NSString *versionKey;//版本号,唯一标识符
+
+@property (nonatomic, assign) BOOL showCloseBtn;//是否显示关闭按钮,(左下角广告需要)
+
+@property (nonatomic, strong) NSImage *normalImage;//APP互推,常规状态下的图片
+
+@property (nonatomic, strong) NSImage *hoverImage;//APP互推悬浮状态下的图片
+
+@property (nonatomic, strong) NSImage *iconImage;//广告显示图片(自适应多语)
+
+@property (nonatomic, strong) NSString *title;//名称(自适应多语)
+
+@property (nonatomic, strong) NSString *tooltips;//提示语(自适应多语)
+
+@property (nonatomic, strong) NSString *linkURL;//跳转链接(自适应多语)
+
+//Firebase
+@property (nonatomic, strong) NSString *firebaseEvent;//
+
+@property (nonatomic, strong) NSString *firebasePropertyKey;//
+
+@property (nonatomic, strong) NSString *firebasePropertyValue;//
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 337 - 0
PDF Office/PDF Master/Class/KMAdvertisement/KMRecommondInfo.m

@@ -0,0 +1,337 @@
+//
+//  KMRecommondInfo.m
+//  PDF Reader Pro Edition
+//
+//  Created by Niehaoyu on 2023/4/11.
+//
+
+#import "KMRecommondInfo.h"
+#import <Cocoa/Cocoa.h>
+
+@interface KMRecommond ()
+
+@property (nonatomic, strong, readwrite) NSMutableArray <KMRecommondInfo *> *recommondInfoArrM;
+
+@property (nonatomic, copy) NSDictionary *infoDict;
+
+@end
+
+@implementation KMRecommond
+
+- (id)init {
+    self = [super init];
+    if (self) {
+        self.recommondInfoArrM = [[NSMutableArray alloc] init];
+    }
+    return self;
+}
+
+- (id)initWithDict:(NSDictionary *)dict {
+    self = [super init];
+    if (self) {
+        self.infoDict = dict;
+        self.recommondInfoArrM = [[NSMutableArray alloc] init];
+        if (self.infoDict[@"content"]) {
+            for (NSDictionary *contentDict in self.infoDict[@"content"]) {
+                KMRecommondInfo *info = [[KMRecommondInfo alloc] initWithDict:contentDict];
+                [self.recommondInfoArrM addObject:info];
+            }
+        }
+    }
+    return self;
+}
+
+#pragma mark - Setter and Getter
+- (NSString *)versionKey {
+    if (!_versionKey) {
+        if (self.infoDict[@"version"]) {
+            _versionKey = self.infoDict[@"version"];
+        }
+    }
+    return _versionKey;
+}
+
+- (NSString *)name {
+    if (!_name) {
+        if (self.infoDict[@"name"]) {
+            NSDictionary *valueDict = self.infoDict[@"name"];
+            _name = [valueDict objectForKey:[KMRecommondInfo languageKey]];
+        }
+    }
+    return _name;
+}
+
+@end
+
+
+#pragma mark - KMRecommondInfo
+@interface KMRecommondInfo ()
+
+@property (nonatomic, copy) NSDictionary *infoDict;
+
+@end
+
+@implementation KMRecommondInfo
+
++ (NSString *)languageKey {
+    NSString *language =  [[NSBundle mainBundle] preferredLocalizations][0];
+    if ([language isEqualToString:@"zh_CN"]) {
+        return @"zh_CN";
+    } else if ([language isEqualToString:@"zh_TW"]) {
+        return @"zh_TW";
+    }
+    return @"en";
+}
+
++ (NSString *)cacheDirs {
+    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
+    NSString *cachesDir = [paths objectAtIndex:0];
+    
+    if ([[NSFileManager defaultManager] fileExistsAtPath:[cachesDir stringByAppendingPathComponent:[NSBundle mainBundle].bundleIdentifier]]) {
+        cachesDir = [cachesDir stringByAppendingPathComponent:[NSBundle mainBundle].bundleIdentifier];
+    }
+    cachesDir = [cachesDir stringByAppendingPathComponent:@"Advertisement/ImageCache"];
+    if (![[NSFileManager defaultManager] fileExistsAtPath:cachesDir]) {
+        [[NSFileManager defaultManager] createDirectoryAtPath:cachesDir withIntermediateDirectories:YES attributes:nil error:nil];
+    }
+    return cachesDir;
+}
+
++ (BOOL)isDarkMode {
+    BOOL isDarkMode = NO;
+//    if (@available(macOS 10.14, *)) {
+//        NSAppearanceName appearanceName = [[NSApp effectiveAppearance] bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]];
+//        if ([appearanceName isEqualToString:NSAppearanceNameDarkAqua]) {
+//            isDarkMode = YES;
+//        }
+//    }
+    return isDarkMode;
+}
+
+- (id)initWithDict:(NSDictionary *)dict {
+    self = [super init];
+    if (self) {
+        self.infoDict = dict;
+    }
+    return self;
+}
+
+- (id)init {
+    self = [super init];
+    if (self) {
+        
+    }
+    return self;
+}
+
+- (BOOL)show {
+    if ([self.infoDict[@"show"] boolValue]) {
+        double startDateKey = [self.infoDict[@"startTime"] doubleValue];
+        double endDateKey = [self.infoDict[@"endTime"] doubleValue];
+        if (startDateKey > 1000000000) {
+            startDateKey = startDateKey/1000;
+        }
+        if (endDateKey > 1000000000) {
+            endDateKey = endDateKey/1000;
+        }
+        
+        NSDate *startDate = [NSDate dateWithTimeIntervalSince1970:startDateKey];
+        NSDate *endDate = [NSDate dateWithTimeIntervalSince1970:endDateKey];
+
+        if ([startDate compare:[NSDate date]] == NSOrderedAscending &&
+            [endDate compare:[NSDate date]] == NSOrderedDescending) {
+            return YES;
+        };
+    }
+    return NO;
+}
+
+- (KMRecommondShowType)showType {
+    KMRecommondShowType type = KMRecommondShowType_None;
+    if ([self.infoDict[@"subscriptionType"] isEqualToString:@"0"]) {
+        type = KMRecommondShowType_All;
+    } else if ([self.infoDict[@"subscriptionType"] isEqualToString:@"2"]) {
+        type = KMRecommondShowType_Pro;
+    } else if ([self.infoDict[@"subscriptionType"] isEqualToString:@"1"]) {
+        type = KMRecommondShowType_Lite;
+    }
+    return type;
+}
+
+- (NSDate *)startDate {
+    if ([self.infoDict[@"endTime"] boolValue]) {
+        double startDateKey = [self.infoDict[@"endTime"] doubleValue];
+        if (startDateKey > 1000000000) {
+            startDateKey = startDateKey/1000;
+        }
+        NSDate *startDate = [NSDate dateWithTimeIntervalSince1970:startDateKey];
+        return startDate;
+    }
+    return nil;
+}
+
+- (NSDate *)endDate {
+    if ([self.infoDict[@"startTime"] boolValue]) {
+        double startDateKey = [self.infoDict[@"startTime"] doubleValue];
+        if (startDateKey > 1000000000) {
+            startDateKey = startDateKey/1000;
+        }
+        NSDate *startDate = [NSDate dateWithTimeIntervalSince1970:startDateKey];
+        return startDate;
+    }
+    return nil;
+}
+
+- (NSString *)versionKey {
+    if (self.infoDict[@"version"]) {
+        return self.infoDict[@"version"];
+    }
+    return @"";
+}
+
+- (BOOL)showCloseBtn {
+    if ([self.infoDict[@"showCloseBtn"] boolValue]) {
+        return YES;
+    }
+    return NO;
+}
+
+- (NSString *)title {
+    if (self.infoDict[@"name"]) {
+        NSDictionary *valueDict = self.infoDict[@"name"];
+        return [valueDict objectForKey:[KMRecommondInfo languageKey]]?:@"";
+    }
+    return @"";
+}
+
+- (NSString *)tooltips {
+    if (self.infoDict[@"tooltip"]) {
+        NSDictionary *valueDict = self.infoDict[@"tooltip"];
+        return [valueDict objectForKey:[KMRecommondInfo languageKey]]?:@"";
+    }
+    return @"";
+}
+
+- (NSString *)linkURL {
+    if (self.infoDict[@"linkURL"]) {
+        NSDictionary *valueDict = self.infoDict[@"linkURL"];
+        return [valueDict objectForKey:[KMRecommondInfo languageKey]]?:@"";
+    }
+    return @"";
+}
+
+- (NSImage *)normalImage {
+    NSString *imageName = [self versionKey]?:@"";
+    if ([KMRecommondInfo isDarkMode]) {
+        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"normal_Dark"]];
+        imageName = [imageName stringByAppendingString:[NSString stringWithFormat:@"%@.%@",@"-normal_Dark",url.path.pathExtension]];
+    } else {
+        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"normal_Light"]];
+        imageName = [imageName stringByAppendingString:[NSString stringWithFormat:@"%@.%@",@"-normal_Light",url.path.pathExtension]];
+    }
+    NSString *imgSavePath = [[KMRecommondInfo cacheDirs] stringByAppendingPathComponent:imageName];
+    if ([[NSFileManager defaultManager] fileExistsAtPath:imgSavePath]) {
+        return [[NSImage alloc] initWithContentsOfFile:imgSavePath];
+    }
+
+    if ([KMRecommondInfo isDarkMode]) {
+        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"normal_Dark"]];
+        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+            NSData *data = [[NSData alloc] initWithContentsOfURL:url];
+            [data writeToFile:imgSavePath atomically:YES];
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"KMRecommondInfoUpdateNoti" object:@{@"unique":[self versionKey]}];
+        });
+    } else {
+        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"normal_Light"]];
+        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+            NSData *data = [[NSData alloc] initWithContentsOfURL:url];
+            [data writeToFile:imgSavePath atomically:YES];
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"KMRecommondInfoUpdateNoti" object:@{@"unique":[self versionKey]}];
+        });
+    }
+    
+    return nil;
+}
+
+- (NSImage *)hoverImage {
+    NSString *imageName = [self versionKey]?:@"";
+    if ([KMRecommondInfo isDarkMode]) {
+        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"hover_Dark"]];
+        imageName = [imageName stringByAppendingString:[NSString stringWithFormat:@"%@.%@",@"-hover_Dark",url.path.pathExtension]];
+    } else {
+        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"hover_Light"]];
+        imageName = [imageName stringByAppendingString:[NSString stringWithFormat:@"%@.%@",@"-hover_Light",url.path.pathExtension]];
+    }
+    NSString *imgSavePath = [[KMRecommondInfo cacheDirs] stringByAppendingPathComponent:imageName];
+    if ([[NSFileManager defaultManager] fileExistsAtPath:imgSavePath]) {
+        return [[NSImage alloc] initWithContentsOfFile:imgSavePath];
+    }
+
+    if ([KMRecommondInfo isDarkMode]) {
+        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"hover_Dark"]];
+        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+            NSData *data = [[NSData alloc] initWithContentsOfURL:url];
+            [data writeToFile:imgSavePath atomically:YES];
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"KMRecommondInfoUpdateNoti" object:@{@"unique":[self versionKey]}];
+        });
+    } else {
+        NSURL *url = [NSURL URLWithString:self.infoDict[@"image"][@"hover_Light"]];
+        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+            NSData *data = [[NSData alloc] initWithContentsOfURL:url];
+            [data writeToFile:imgSavePath atomically:YES];
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"KMRecommondInfoUpdateNoti" object:@{@"unique":[self versionKey]}];
+        });
+    }
+    return nil;
+}
+
+- (NSImage *)iconImage {
+    NSString *imageName = [self versionKey]?:@"";
+    NSURL *url = [NSURL URLWithString:[self.infoDict[@"image"] objectForKey:[KMRecommondInfo languageKey]]];
+    imageName = [imageName stringByAppendingString:[NSString stringWithFormat:@"%@.%@",@"-iconImage",url.path.pathExtension]];
+    
+    NSString *imgSavePath = [[KMRecommondInfo cacheDirs] stringByAppendingPathComponent:imageName];
+    if ([[NSFileManager defaultManager] fileExistsAtPath:imgSavePath]) {
+        return [[NSImage alloc] initWithContentsOfFile:imgSavePath];
+    }
+    
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        NSData *data = [[NSData alloc] initWithContentsOfURL:url];
+        [data writeToFile:imgSavePath atomically:YES];
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"KMRecommondInfoUpdateNoti" object:@{@"unique":[self versionKey]}];
+    });
+    
+    return nil;
+}
+
+- (NSString *)firebaseEvent {
+    if (self.infoDict[@"Firebase"]) {
+        return self.infoDict[@"Firebase"][@"Event"]?:@"";
+    }
+    return nil;
+}
+
+- (NSString *)firebasePropertyKey {
+    if (self.infoDict[@"Firebase"]) {
+        return self.infoDict[@"Firebase"][@"PropertyKey"]?:@"";
+    }
+    return nil;
+}
+
+- (NSString *)firebasePropertyValue {
+    if (self.infoDict[@"Firebase"]) {
+        return self.infoDict[@"Firebase"][@"PropertyValue"]?:@"";
+    }
+    return nil;
+}
+
+#pragma mark - Public Method
+- (void)updateValue:(NSString *)value forKey:(NSString *)key {
+    if (self.infoDict[key]) {
+        NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithDictionary:self.infoDict];
+        [dict setValue:value forKey:key];
+        self.infoDict = dict;
+    }
+}
+
+@end

+ 70 - 0
PDF Office/PDF Master/Class/KMAdvertisement/KMRecommondManager.h

@@ -0,0 +1,70 @@
+//
+//  KMRecommondManager.h
+//  PDF Reader Pro Edition
+//
+//  Created by Niehaoyu on 2023/4/11.
+//
+
+#import <Foundation/Foundation.h>
+#import "KMRecommondInfo.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+//接口文档:https://www.showdoc.com.cn/p/645bf52c14b161408feb760a6e0583b4
+//配置说明文档:https://docs.google.com/spreadsheets/d/1anoKSGpI2piMUbOXtRBSaKHg8uh3x6iYwe4x_pzrRbM/edit#gid=0
+
+#define kTestMode   1
+
+#if kTestMode
+#define kRecommondInfoURL         @"http://test-store.kdan.cn:3019"
+#else
+#define kRecommondInfoURL         @"https://store.filmagepro.com:3018"
+#endif
+
+#define KMRecommondDatasUpdateNoti @"KMRecommondDatasUpdateNoti"
+
+typedef enum : NSUInteger {
+    KMRecommondAPP_None,
+    KMRecommondAPP_PDFReaderProMacLite,//PDF Reader Pro
+    KMRecommondAPP_PDFReaderProMacDMG,
+    KMRecommondAPP_PDFReaderProMacPro,
+    KMRecommondAPP_RecordIt,//Record It
+    KMRecommondAPP_RecordItPro,
+    KMRecommondAPP_RecordItDMG,
+    KMRecommondAPP_FilmageScreen,//Filmage Screen
+    KMRecommondAPP_FilmageScreenPro,
+    KMRecommondAPP_FilmageScreenDMG,
+    KMRecommondAPP_FilmageEditorMac,//Filmage Editor
+    KMRecommondAPP_FilmageEditorMacDMG,
+    KMRecommondAPP_FilmageConverterMac,//Filmage Converter
+    KMRecommondAPP_FilmageConverterMacPro,
+    KMRecommondAPP_FilmageConverterMacDMG,
+    KMRecommondAPP_FilmagePlayerMac,//Filmage Player
+    KMRecommondAPP_FilmagePlayerMacPro,
+    KMRecommondAPP_FilmagePlayerMacDMG,
+    KMRecommondAPP_PDFReaderProIOS,//PDF Reader Pro iOS
+    KMRecommondAPP_PDFReaderProIOSPro,
+    KMRecommondAPP_PDFReaderProAndroid,
+    KMRecommondAPP_PDFMasterMac,//PDF Master
+    KMRecommondAPP_PDFMasterMacPro,
+    KMRecommondAPP_PDFMasterMacDMG
+} KMRecommondAPP;
+@interface KMRecommondManager : NSObject
+
+@property (nonatomic, strong, readonly) KMRecommond *pdfProRecommond;
+
+@property (nonatomic, strong, readonly) KMRecommond *othersRecommond;
+
+@property (nonatomic, strong, readonly) KMRecommond *advertisimentRecommond;
+
++ (KMRecommondManager *)manager;
+
+- (void)loadDataWithAppType:(KMRecommondAPP)appType completionHandler:(void (^)(NSError *error))handler;
+
+- (void)loadDataWithAppName:(NSString *)appName completionHandler:(void (^)(NSError *error))handler;
+
+
+@end
+
+
+NS_ASSUME_NONNULL_END

+ 175 - 0
PDF Office/PDF Master/Class/KMAdvertisement/KMRecommondManager.m

@@ -0,0 +1,175 @@
+//
+//  KMRecommondManager.m
+//  PDF Reader Pro Edition
+//
+//  Created by Niehaoyu on 2023/4/11.
+//
+
+#import "KMRecommondManager.h"
+
+@interface KMRecommondManager ()
+
+@property (nonatomic, strong, readwrite) KMRecommond *pdfProRecommond;
+
+@property (nonatomic, strong, readwrite) KMRecommond *othersRecommond;
+
+@property (nonatomic, strong, readwrite) KMRecommond *advertisimentRecommond;
+
+@property (nonatomic, assign) BOOL isLoading;
+
+@end
+
+
+@implementation KMRecommondManager
+
++ (KMRecommondManager *)manager {
+    static KMRecommondManager *__manager = nil;
+    if (!__manager) {
+        __manager = [[KMRecommondManager alloc] init];
+    }
+    return __manager;
+}
+
+- (id)init {
+    self = [super init];
+    if (self) {
+        
+    }
+    return self;
+}
+
+- (NSString *)appNameFromType:(KMRecommondAPP)appType {
+    if (appType == KMRecommondAPP_PDFReaderProMacLite) {
+        return @"PDFReaderProMac";
+    } else if (appType == KMRecommondAPP_PDFReaderProMacDMG) {
+        return @"PDFReaderProMacDMG";
+    } else if (appType == KMRecommondAPP_PDFReaderProMacPro) {
+        return @"PDFReaderProMacPro";
+    } else if (appType == KMRecommondAPP_RecordIt) {
+        return @"RecordIt";
+    } else if (appType == KMRecommondAPP_RecordItPro) {
+        return @"RecordItPro";
+    } else if (appType == KMRecommondAPP_RecordItDMG) {
+        return @"RecordItDMG";
+    } else if (appType == KMRecommondAPP_FilmageScreen) {
+        return @"FilmageScreen";
+    } else if (appType == KMRecommondAPP_FilmageScreenPro) {
+        return @"FilmageScreenPro";
+    } else if (appType == KMRecommondAPP_FilmageScreenDMG) {
+        return @"FilmageScreenDMG";
+    } else if (appType == KMRecommondAPP_FilmageEditorMac) {
+        return @"FilmageEditorMac";
+    } else if (appType == KMRecommondAPP_FilmageEditorMacDMG) {
+        return @"FilmageEditorMacDMG";
+    } else if (appType == KMRecommondAPP_FilmageConverterMac) {
+        return @"FilmageConverterMac";
+    } else if (appType == KMRecommondAPP_FilmageConverterMacPro) {
+        return @"FilmageConverterMacPro";
+    } else if (appType == KMRecommondAPP_FilmageConverterMacDMG) {
+        return @"FilmageConverterMacDMG";
+    } else if (appType == KMRecommondAPP_FilmagePlayerMac) {
+        return @"FilmagePlayerMac";
+    } else if (appType == KMRecommondAPP_FilmagePlayerMacPro) {
+        return @"FilmagePlayerMacPro";
+    } else if (appType == KMRecommondAPP_FilmagePlayerMacDMG) {
+        return @"FilmagePlayerMacDMG";
+    } else if (appType == KMRecommondAPP_PDFReaderProIOS) {
+        return @"PDFReaderProIOS";
+    } else if (appType == KMRecommondAPP_PDFReaderProIOSPro) {
+        return @"PDFReaderProIOSPro";
+    } else if (appType == KMRecommondAPP_PDFReaderProAndroid) {
+        return @"PDFReaderProAndroid";
+    } else if (appType == KMRecommondAPP_PDFMasterMac) {
+        return @"PDFMasterMac";
+    } else if (appType == KMRecommondAPP_PDFMasterMacPro) {
+        return @"PDFMasterMacPro";
+    } else if (appType == KMRecommondAPP_PDFMasterMacDMG) {
+        return @"PDFMasterMacDMG";
+    }
+    return @"";
+}
+
+
+
+- (void)loadDataWithAppType:(KMRecommondAPP)appType completionHandler:(void (^)(NSError * _Nonnull))handler {
+    if ([self appNameFromType:appType].length > 0) {
+        [self loadDataWithAppName:[self appNameFromType:appType] completionHandler:handler];
+    }
+}
+
+- (void)loadDataWithAppName:(NSString *)appName completionHandler:(void (^)(NSError *error))handler {
+    if (self.isLoading) {
+        return;
+    }
+    
+    if (self.pdfProRecommond ||
+        self.othersRecommond ||
+        self.advertisimentRecommond) {
+        if (handler) {
+            handler(nil);
+        }
+        [[NSNotificationCenter defaultCenter] postNotificationName:KMRecommondDatasUpdateNoti object:nil];
+        return;
+    }
+    
+    __weak typeof(self) weakSelf = self;
+    self.isLoading = YES;
+    //Send Request
+    NSString *urlString = [kRecommondInfoURL stringByAppendingString:[NSString stringWithFormat:@"/api/advertise-new?app_name=%@",appName?:@""]];
+
+    NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
+    configuration.requestCachePolicy = NSURLRequestReloadIgnoringLocalCacheData;
+    [configuration setURLCache:[NSURLCache sharedURLCache]];
+    
+    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlString]];
+    [request setHTTPMethod:@"GET"];
+    
+    [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
+
+    NSURLSession *session = [NSURLSession sessionWithConfiguration:configuration];
+    NSURLSessionDataTask *task = [session dataTaskWithRequest:request
+                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
+        self.isLoading = NO;
+        if (!error) {
+            NSDictionary *datas = [NSJSONSerialization JSONObjectWithData:data
+                                                             options:NSJSONReadingMutableContainers error:nil];
+            if ([datas isKindOfClass:[NSDictionary class]] && datas[@"list"]) {
+                NSArray *listArray = datas[@"list"];
+                
+                for (NSDictionary *listDict in listArray) {
+                    
+                    if ([listDict[@"status"] intValue] == 1) {
+                        NSString *detailString = listDict[@"detail"];
+                        NSData *jsonData = [detailString dataUsingEncoding:NSUTF8StringEncoding];
+                        NSDictionary *detailDic = [NSJSONSerialization JSONObjectWithData:jsonData
+                                                                            options:NSJSONReadingMutableContainers
+                                                                              error:nil];
+                        
+                        if (detailDic[@"recommondContent"]) {
+                            if (detailDic[@"recommondContent"][@"recommondContentPDFPro"]) {
+                                weakSelf.pdfProRecommond = [[KMRecommond alloc] initWithDict:detailDic[@"recommondContent"][@"recommondContentPDFPro"]];
+                             }
+                            if (detailDic[@"recommondContent"][@"recommondContentOther"]) {
+                                weakSelf.othersRecommond = [[KMRecommond alloc] initWithDict:detailDic[@"recommondContent"][@"recommondContentOther"]];
+                             }
+                        }
+                        
+                        if (detailDic[@"advertisement"]) {
+                            for (NSDictionary *adverDict in detailDic[@"advertisement"]) {
+                                weakSelf.advertisimentRecommond = [[KMRecommond alloc] initWithDict:detailDic[@"advertisement"]];
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        if (handler) {
+            handler(error);
+        }
+        [[NSNotificationCenter defaultCenter] postNotificationName:KMRecommondDatasUpdateNoti object:nil];
+    }];
+    
+    [task resume];
+}
+
+@end

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

@@ -54,3 +54,5 @@
 #import "SKKeychain.h"
 #import "WelcomeWindowController.h"
 #import "KMTools_OC.h"
+//广告
+#import "KMRecommondManager.h"

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

@@ -54,3 +54,5 @@
 #import "SKKeychain.h"
 #import "WelcomeWindowController.h"
 #import "KMTools_OC.h"
+//广告
+#import "KMRecommondManager.h"

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

@@ -78,3 +78,5 @@
 #import "CSelfSignAnnotation.h"
 #import "WelcomeWindowController.h"
 #import "KMTools_OC.h"
+//广告
+#import "KMRecommondManager.h"