Browse Source

【2025】【综合】
1、删除google跟Dropbox相关SDK
2、代码整理

niehaoyu 2 months ago
parent
commit
62369bd148
100 changed files with 6 additions and 22419 deletions
  1. 0 3
      PDF Office/PDF Master/AppDelegate.swift
  2. 1 1
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AIConfigWindowController.swift
  3. 1 1
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIInfoInputView/AIInfoInputView.swift
  4. 1 1
      PDF Office/PDF Master/Class/AIInfo/AIUserInfoController/AIUserInfoController.swift
  5. 3 3
      PDF Office/PDF Master/Class/ChromiumTabs/src/Tab/CTTabController.m
  6. 0 596
      PDF Office/PDF Master/Class/ComponentLibrary/Category/KMDesignToken+Action.swift
  7. 0 92
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuth.h
  8. 0 192
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuth/macOS/LoopbackHTTPServer/OIDLoopbackHTTPServer.h
  9. 0 618
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuth/macOS/LoopbackHTTPServer/OIDLoopbackHTTPServer.m
  10. 0 92
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuth/macOS/OIDAuthState+Mac.h
  11. 0 62
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuth/macOS/OIDAuthState+Mac.m
  12. 0 78
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuth/macOS/OIDAuthorizationService+Mac.h
  13. 0 64
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuth/macOS/OIDAuthorizationService+Mac.m
  14. 0 54
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuth/macOS/OIDExternalUserAgentMac.h
  15. 0 170
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuth/macOS/OIDExternalUserAgentMac.m
  16. 0 90
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuth/macOS/OIDRedirectHTTPHandler.h
  17. 0 177
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuth/macOS/OIDRedirectHTTPHandler.m
  18. 0 44
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore.h
  19. 0 272
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDAuthState.h
  20. 0 570
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDAuthState.m
  21. 0 39
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDAuthStateChangeDelegate.h
  22. 0 62
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDAuthStateErrorDelegate.h
  23. 0 250
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDAuthorizationRequest.h
  24. 0 351
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDAuthorizationRequest.m
  25. 0 128
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDAuthorizationResponse.h
  26. 0 210
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDAuthorizationResponse.m
  27. 0 170
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDAuthorizationService.h
  28. 0 790
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDAuthorizationService.m
  29. 0 51
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDClientMetadataParameters.h
  30. 0 33
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDClientMetadataParameters.m
  31. 0 51
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDDefines.h
  32. 0 107
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDEndSessionRequest.h
  33. 0 190
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDEndSessionRequest.m
  34. 0 64
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDEndSessionResponse.h
  35. 0 118
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDEndSessionResponse.m
  36. 0 393
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDError.h
  37. 0 45
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDError.m
  38. 0 107
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDErrorUtilities.h
  39. 0 172
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDErrorUtilities.m
  40. 0 53
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDExternalUserAgent.h
  41. 0 37
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDExternalUserAgentRequest.h
  42. 0 65
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDExternalUserAgentSession.h
  43. 0 126
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDFieldMapping.h
  44. 0 132
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDFieldMapping.m
  45. 0 40
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDGrantTypes.h
  46. 0 27
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDGrantTypes.m
  47. 0 91
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDIDToken.h
  48. 0 149
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDIDToken.m
  49. 0 141
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDRegistrationRequest.h
  50. 0 248
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDRegistrationRequest.m
  51. 0 126
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDRegistrationResponse.h
  52. 0 164
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDRegistrationResponse.m
  53. 0 31
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDResponseTypes.h
  54. 0 25
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDResponseTypes.m
  55. 0 48
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDScopeUtilities.h
  56. 0 58
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDScopeUtilities.m
  57. 0 46
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDScopes.h
  58. 0 29
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDScopes.m
  59. 0 118
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDServiceConfiguration.h
  60. 0 232
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDServiceConfiguration.m
  61. 0 364
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDServiceDiscovery.h
  62. 0 393
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDServiceDiscovery.m
  63. 0 167
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDTokenRequest.h
  64. 0 312
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDTokenRequest.m
  65. 0 110
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDTokenResponse.h
  66. 0 163
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDTokenResponse.m
  67. 0 67
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDTokenUtilities.h
  68. 0 89
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDTokenUtilities.m
  69. 0 93
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDURLQueryComponent.h
  70. 0 219
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDURLQueryComponent.m
  71. 0 40
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDURLSessionProvider.h
  72. 0 39
      PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDURLSessionProvider.m
  73. 0 61
      PDF Office/PDF Master/Class/Home/NSObject/Services/DropboxModel.h
  74. 0 385
      PDF Office/PDF Master/Class/Home/NSObject/Services/DropboxModel.m
  75. 0 14
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/Drive/GTLRDrive.h
  76. 0 3148
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/Drive/GTLRDriveObjects.h
  77. 0 977
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/Drive/GTLRDriveObjects.m
  78. 0 2712
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/Drive/GTLRDriveQuery.h
  79. 0 1181
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/Drive/GTLRDriveQuery.m
  80. 0 121
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/Drive/GTLRDriveService.h
  81. 0 80
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/Drive/GTLRDriveService.m
  82. 0 29
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRBase64.h
  83. 0 143
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRBase64.m
  84. 0 85
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRBatchQuery.h
  85. 0 180
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRBatchQuery.m
  86. 0 78
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRBatchResult.h
  87. 0 168
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRBatchResult.m
  88. 0 114
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRDateTime.h
  89. 0 370
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRDateTime.m
  90. 0 40
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRDefines.h
  91. 0 82
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRDuration.h
  92. 0 221
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRDuration.m
  93. 0 116
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRErrorObject.h
  94. 0 141
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRErrorObject.m
  95. 0 32
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRFramework.h
  96. 0 41
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRFramework.m
  97. 0 325
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRObject.h
  98. 0 770
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRObject.m
  99. 0 252
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRQuery.h
  100. 0 0
      PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRQuery.m

+ 0 - 3
PDF Office/PDF Master/AppDelegate.swift

@@ -125,10 +125,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, iRateDelegate{
         
         
         self.initMainMenu()
-        /// pro
-        //    [DBClientsManager setupWithAppKeyDesktop:@"amipzwtlg9lrwyl"];
         
-        DBClientsManager.setup(withAppKeyDesktop: "jxjlqfm1cfp2mjj")
         
         reopenDocument(forPaths: [])
         KMPreference.shared.initDataForAppLaunch()

+ 1 - 1
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AIConfigWindowController.swift

@@ -681,7 +681,7 @@ import Cocoa
     
     @IBAction func startAIFunction(_ sender: KMButton) {
         
-        let newStatus: Bool = KMCloudServer.isConnectionAvailable()
+        let newStatus: Bool = KMServerConfig.isConnectionAvailable()
         if !newStatus {
             let alert = NSAlert()
             alert.alertStyle = .critical

+ 1 - 1
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIInfoInputView/AIInfoInputView.swift

@@ -605,7 +605,7 @@ class AIInfoInputView: NSView, NibLoadable, NSTextFieldDelegate, NSTextViewDeleg
     }
     
     @IBAction func startAIAction(_ sender: NSButton) {
-        let newStatus: Bool = KMCloudServer.isConnectionAvailable()
+        let newStatus: Bool = KMServerConfig.isConnectionAvailable()
         if !newStatus {
             let alert = NSAlert()
             alert.alertStyle = .critical

+ 1 - 1
PDF Office/PDF Master/Class/AIInfo/AIUserInfoController/AIUserInfoController.swift

@@ -325,7 +325,7 @@ import Cocoa
             return
         }
         
-        let newStatus: Bool = KMCloudServer.isConnectionAvailable()
+        let newStatus: Bool = KMServerConfig.isConnectionAvailable()
         if !newStatus {
             let alert = NSAlert()
             alert.alertStyle = .critical

+ 3 - 3
PDF Office/PDF Master/Class/ChromiumTabs/src/Tab/CTTabController.m

@@ -112,9 +112,9 @@ static NSString* const kBrowserThemeDidChangeNotification =
 
 // Called when the tab's nib is done loading and all outlets are hooked up.
 - (void)awakeFromNib {
-    [self multiTabWithBg:@"multi-tab.bg.norm" text:@"multi-tab.mac-text.def" height:[[NSLayoutConstraint alloc] init] state:KMDesignTokenStateNorm];
-    [self multiTabWithBg:@"multi-tab.bg.hov" text:@"multi-tab.mac-text.def" height:[[NSLayoutConstraint alloc] init] state:KMDesignTokenStateHov];
-    [self multiTabWithBg:@"multi-tab.bg.sel" text:@"multi-tab.mac-text.sel" height:[[NSLayoutConstraint alloc] init] state:KMDesignTokenStateSel];
+//    [self multiTabWithBg:@"multi-tab.bg.norm" text:@"multi-tab.mac-text.def" height:[[NSLayoutConstraint alloc] init] state:KMDesignTokenStateNorm];
+//    [self multiTabWithBg:@"multi-tab.bg.hov" text:@"multi-tab.mac-text.def" height:[[NSLayoutConstraint alloc] init] state:KMDesignTokenStateHov];
+//    [self multiTabWithBg:@"multi-tab.bg.sel" text:@"multi-tab.mac-text.sel" height:[[NSLayoutConstraint alloc] init] state:KMDesignTokenStateSel];
 
 	// Remember the icon's frame, so that if the icon is ever removed, a new
 	// one can later replace it in the proper location.

+ 0 - 596
PDF Office/PDF Master/Class/ComponentLibrary/Category/KMDesignToken+Action.swift

@@ -22,599 +22,3 @@ import Foundation
     case Checked
     case Checked_dis
 }
-
-extension KMDesignToken {
-    
-    // MARK: - Button
-
-    func buttonDesignToken(bgToken: String, textToken: String = "", heightConstraint: NSLayoutConstraint = NSLayoutConstraint(), control: KMDesignButton, state: KMDesignTokenState = .Norm) -> Void {
-        var height: String?
-        var horizontalPadding: String?
-        var borderColor: NSColor?
-        var borderRadius: String?
-        var borderWidth: String?
-        var itemSpacing: String?
-        var fill: NSColor?
-        var textTypography: KMTypographyValue?
-        var textFill: NSColor?
-        
-        if bgToken != "" {
-            height = self.height(withToken: bgToken)
-            horizontalPadding = self.horizontalPadding(withToken: bgToken)
-            borderColor = self.border(withToken: bgToken)
-            borderRadius = self.borderRadius(withToken: bgToken)
-            borderWidth = self.borderWidth(withToken: bgToken)
-            itemSpacing = self.itemSpacing(withToken: bgToken)
-            fill = self.fill(withToken: bgToken)
-        }
-        if textToken != "" {
-            textTypography = self.typography(withToken: textToken)
-            textFill = self.fill(withToken: textToken)
-        }
-
-//            if bgToken == "btn.sec.m.bg.norm" {
-//                print("12321")
-//            }
-        if height != nil {
-            if heightConstraint.shouldBeArchived {
-                heightConstraint.constant = height!.stringToCGFloat()
-            }
-        }
-        if itemSpacing != nil {}
-        if horizontalPadding != nil {}
-        if textTypography != nil {
-            var fontFamily: String = textTypography!.fontFamily
-            let fontWeight: String = textTypography!.fontWeight
-            if fontFamily.contains(" ") {
-                fontFamily = fontFamily.replacingOccurrences(of: " ", with: "")
-            }
-            if fontWeight != "" {
-                fontFamily = String(format: "%@-%@", fontFamily,fontWeight)
-            }
-            if state == .Norm {
-                control.font = NSFont(name: fontFamily, size: textTypography!.fontSize.stringToCGFloat()) ?? NSFont.systemFont(ofSize: textTypography!.fontSize.stringToCGFloat())
-                control.lineHeight = textTypography!.lineHeight.stringToCGFloat()
-            } else if (state == .Hov) {
-                control.font_hov = NSFont(name: fontFamily, size: textTypography!.fontSize.stringToCGFloat()) ?? NSFont.systemFont(ofSize: textTypography!.fontSize.stringToCGFloat())
-                control.lineHeight_hov = textTypography!.lineHeight.stringToCGFloat()
-            } else if (state == .Act) {
-                control.font_act = NSFont(name: fontFamily, size: textTypography!.fontSize.stringToCGFloat()) ?? NSFont.systemFont(ofSize: textTypography!.fontSize.stringToCGFloat())
-                control.lineHeight_act = textTypography!.lineHeight.stringToCGFloat()
-            } else if (state == .Disabled) {
-                control.font_disabled = NSFont(name: fontFamily, size: textTypography!.fontSize.stringToCGFloat()) ?? NSFont.systemFont(ofSize: textTypography!.fontSize.stringToCGFloat())
-                control.lineHeight_disabled = textTypography!.lineHeight.stringToCGFloat()
-            } 
-        }
-        if fill != nil {
-            if state == .Norm {
-                control.background = fill!
-            } else if (state == .Hov) {
-                control.background_hov = fill!
-            } else if (state == .Act) {
-                control.background_act = fill!
-            } else if (state == .Disabled) {
-                control.background_disabled = fill!
-            }
-        }
-        if textFill != nil {
-            if state == .Norm {
-                control.textColor = textFill!
-            } else if (state == .Hov) {
-                control.textColor_hov = textFill!
-            } else if (state == .Act) {
-                control.textColor_act = textFill!
-            } else if (state == .Disabled) {
-                control.textColor_disabled = textFill!
-            }
-        }
-        if borderRadius != nil {
-            if state == .Norm {
-                control.cornerRadius = Float(borderRadius!.stringToCGFloat())
-            } else if (state == .Hov) {
-                control.cornerRadius_hov = Float(borderRadius!.stringToCGFloat())
-            } else if (state == .Act) {
-                control.cornerRadius_act = Float(borderRadius!.stringToCGFloat())
-            } else if (state == .Disabled) {
-                control.cornerRadius_disabled = Float(borderRadius!.stringToCGFloat())
-            }
-        }
-        if borderWidth != nil {
-            if state == .Norm {
-                control.borderWidth = Float(borderWidth!.stringToCGFloat())
-            } else if (state == .Hov) {
-                control.borderWidth_hov = Float(borderWidth!.stringToCGFloat())
-            } else if (state == .Act) {
-                control.borderWidth_act = Float(borderWidth!.stringToCGFloat())
-            } else if (state == .Disabled) {
-                control.borderWidth_disabled = Float(borderWidth!.stringToCGFloat())
-            }
-        }
-        if borderWidth != nil {
-            if state == .Norm {
-                control.borderColor = borderColor!
-            } else if (state == .Hov) {
-                control.borderColor_hov = borderColor!
-            } else if (state == .Act) {
-                control.borderColor_act = borderColor!
-            } else if (state == .Disabled) {
-                control.borderColor_disabled = borderColor!
-            }
-        }
-        control.updateUI()
-    }
-    
-    // MARK: - Dropdown
-    
-    func dropdownDesignToken(bgToken: String = "", textToken: String = "", heightConstraint: NSLayoutConstraint = NSLayoutConstraint(), control: KMDesignDropdown, state: KMDesignTokenState = .Norm) -> Void {
-        var height: String?
-        var horizontalPadding: String?
-        var fill: NSColor?
-        var borderRadius: String?
-        var textTypography: KMTypographyValue?
-        var textFill: NSColor?
-        
-        if bgToken != "" {
-            height = self.height(withToken: bgToken)
-            horizontalPadding = self.horizontalPadding(withToken: bgToken)
-            borderRadius = self.borderRadius(withToken: bgToken)
-            fill = self.fill(withToken: bgToken)
-        }
-        if textToken != "" {
-            textTypography = self.typography(withToken: textToken)
-            textFill = self.fill(withToken: textToken)
-        }
-        
-        if height != nil {
-            if heightConstraint.shouldBeArchived {
-                heightConstraint.constant = height!.stringToCGFloat()
-            }
-        }
-        if horizontalPadding != nil {
-            control.horizontalPadding_spacing = Float((horizontalPadding?.stringToCGFloat())!)
-        }
-        if fill != nil {
-            if state == .Norm {
-                control.background = fill!
-            } else if (state == .Hov) {
-                control.background_hov = fill!
-            } else if (state == .Sel) {
-                control.background_sel = fill!
-            } else if (state == .Disabled) {
-                control.background_disabled = fill!
-            }
-        }
-        if borderRadius != nil {
-            if state == .Norm {
-                control.background = fill!
-            } else if (state == .Hov) {
-                control.background_hov = fill!
-            } else if (state == .Sel) {
-                control.background_sel = fill!
-            } else if (state == .Disabled) {
-                control.background_disabled = fill!
-            }
-        }
-        if textTypography != nil {
-            var fontFamily: String = textTypography!.fontFamily
-            let fontWeight: String = textTypography!.fontWeight
-            if fontFamily.contains(" ") {
-                fontFamily = fontFamily.replacingOccurrences(of: " ", with: "")
-            }
-            if fontWeight != "" {
-                fontFamily = String(format: "%@-%@", fontFamily, fontWeight)
-            }
-            if state == .Norm {
-                control.font = NSFont(name: fontFamily, size: textTypography!.fontSize.stringToCGFloat()) ?? NSFont.systemFont(ofSize: textTypography!.fontSize.stringToCGFloat())
-            } else if (state == .Hov) {
-                control.font_hov = NSFont(name: fontFamily, size: textTypography!.fontSize.stringToCGFloat()) ?? NSFont.systemFont(ofSize: textTypography!.fontSize.stringToCGFloat())
-            } else if (state == .Sel) {
-                control.font_sel = NSFont(name: fontFamily, size: textTypography!.fontSize.stringToCGFloat()) ?? NSFont.systemFont(ofSize: textTypography!.fontSize.stringToCGFloat())
-            } else if (state == .Disabled) {
-                control.font_disabled = NSFont(name: fontFamily, size: textTypography!.fontSize.stringToCGFloat()) ?? NSFont.systemFont(ofSize: textTypography!.fontSize.stringToCGFloat())
-            }
-        }
-        if textFill != nil {
-            if state == .Norm {
-                control.textColor = textFill!
-            } else if (state == .Hov) {
-                control.textColor_hov = textFill!
-            } else if (state == .Sel) {
-                control.textColor_sel = textFill!
-            } else if (state == .Disabled) {
-                control.textColor_disabled = textFill!
-            }
-        }
-    }
-    
-    // MARK: - MultiTab
-    
-    func multiTabDesignToken(bgToken: String = "", textToken: String = "", heightConstraint: NSLayoutConstraint = NSLayoutConstraint(), control: CTTabController, state: KMDesignTokenState = .Norm) -> Void {
-        var height: String?
-        var horizontalPadding: String?
-        var itemSpacing: String?
-        var fill: NSColor?
-        var borderColor: NSColor?
-        var borderRadiusTopLeft: String?
-        var borderRadiusTopRight: String?
-        var borderWidthBottom: String?
-        var textTypography: KMTypographyValue?
-        var textFill: NSColor?
-                        
-        if bgToken != "" {
-            height = self.height(withToken: bgToken)
-            horizontalPadding = self.horizontalPadding(withToken: bgToken)
-            itemSpacing = self.itemSpacing(withToken: bgToken)
-            fill = self.fill(withToken: bgToken)
-            borderColor = self.border(withToken: bgToken)
-            borderRadiusTopLeft = self.borderRadiusTopLeft(withToken: bgToken)
-            borderRadiusTopRight = self.borderRadiusTopRight(withToken: bgToken)
-            borderWidthBottom = self.borderWidthBottom(withToken: bgToken)
-        }
-        if textToken != "" {
-            textTypography = self.typography(withToken: textToken)
-            textFill = self.fill(withToken: textToken)
-        }
-        
-        if height != nil {
-            if heightConstraint.shouldBeArchived {
-                heightConstraint.constant = height!.stringToCGFloat()
-            }
-        }
-        if horizontalPadding != nil {
-            control.horizontalPadding = horizontalPadding!.stringToCGFloat()
-        }
-        if itemSpacing != nil {
-            control.itemSpacing = itemSpacing!.stringToCGFloat()
-        }
-        if fill != nil {
-            if state == .Norm {
-                control.fill = fill!
-            } else if (state == .Hov) {
-                control.fill_hov = fill!
-            } else if (state == .Sel) {
-                control.fill_sel = fill!
-            }
-        }
-        if borderColor != nil {
-            if state == .Norm {
-                control.borderColor = borderColor!
-            } else if (state == .Hov) {
-                control.borderColor_hov = borderColor!
-            } else if (state == .Sel) {
-                control.borderColor_sel = borderColor!
-            }
-        }
-        if borderRadiusTopLeft != nil {
-            if state == .Norm {
-                control.borderRadiusTopLeft = borderRadiusTopLeft!.stringToCGFloat()
-            } else if (state == .Hov) {
-                control.borderRadiusTopLeft_hov = borderRadiusTopLeft!.stringToCGFloat()
-            } else if (state == .Sel) {
-                control.borderRadiusTopLeft_sel = borderRadiusTopLeft!.stringToCGFloat()
-            }
-        }
-        if borderRadiusTopRight != nil {
-            if state == .Norm {
-                control.borderRadiusTopRight = borderRadiusTopRight!.stringToCGFloat()
-            } else if (state == .Hov) {
-                control.borderRadiusTopRight_hov = borderRadiusTopRight!.stringToCGFloat()
-            } else if (state == .Sel) {
-                control.borderRadiusTopRight_sel = borderRadiusTopRight!.stringToCGFloat()
-            }
-        }
-        if borderWidthBottom != nil {
-            if state == .Norm {
-                control.borderWidthBottom = borderWidthBottom!.stringToCGFloat()
-            } else if (state == .Hov) {
-                control.borderWidthBottom_hov = borderWidthBottom!.stringToCGFloat()
-            } else if (state == .Sel) {
-                control.borderWidthBottom_sel = borderWidthBottom!.stringToCGFloat()
-            }
-        }
-        if textTypography != nil {
-            var fontFamily: String = textTypography!.fontFamily
-            let fontWeight: String = textTypography!.fontWeight
-            if fontFamily.contains(" ") {
-                fontFamily = fontFamily.replacingOccurrences(of: " ", with: "")
-            }
-            if fontWeight != "" {
-                fontFamily = String(format: "%@-%@", fontFamily, fontWeight)
-            }
-            if state == .Norm {
-                control.font = NSFont(name: fontFamily, size: textTypography!.fontSize.stringToCGFloat()) ?? NSFont.systemFont(ofSize: textTypography!.fontSize.stringToCGFloat())
-            } else if (state == .Hov) {
-                control.font_hov = NSFont(name: fontFamily, size: textTypography!.fontSize.stringToCGFloat()) ?? NSFont.systemFont(ofSize: textTypography!.fontSize.stringToCGFloat())
-            } else if (state == .Sel) {
-                control.font_sel = NSFont(name: fontFamily, size: textTypography!.fontSize.stringToCGFloat()) ?? NSFont.systemFont(ofSize: textTypography!.fontSize.stringToCGFloat())
-            }
-        }
-        if textFill != nil {
-            if state == .Norm {
-                control.textFill = textFill!
-            } else if (state == .Hov) {
-                control.textFill_hov = textFill!
-            } else if (state == .Sel) {
-                control.textFill_sel = textFill!
-            }
-        }
-        control.updateUI()
-    }
- 
-    // MARK: navMenu
-    
-    func navMenuDesignToken(bgToken: String = "", textToken: String = "", heightConstraint: NSLayoutConstraint = NSLayoutConstraint(), control: KMTextImageButtonVC, state: KMDesignTokenState = .Norm) -> Void {
-        let height = self.height(withToken: bgToken)
-        var horizontalPadding = self.horizontalPadding(withToken: bgToken)
-        let itemSpacing = self.itemSpacing(withToken: bgToken)
-        let borderRadius = self.borderRadius(withToken: bgToken)
-        let bgFill = self.fill(withToken: bgToken)
-        let paddingLeft = self.paddingLeft(withToken: bgToken)
-        let typography = self.typography(withToken: textToken)
-        let textFill = self.fill(withToken: textToken)
-        if paddingLeft.stringToCGFloat() > 0 {
-            horizontalPadding = paddingLeft
-        }
-        
-        if heightConstraint.shouldBeArchived {
-            heightConstraint.constant = height.stringToCGFloat()
-        }
-        control.paddingSpacing = Float(horizontalPadding.stringToCGFloat())
-        control.itemSpacing = Float(itemSpacing.stringToCGFloat())
-        var fontFamily: String = typography.fontFamily
-        let fontWeight: String = typography.fontWeight
-        if fontFamily.contains(" ") {
-            fontFamily = fontFamily.replacingOccurrences(of: " ", with: "")
-        }
-        if fontWeight != "" {
-            fontFamily = String(format: "%@-%@", fontFamily,fontWeight)
-        }
-        control.font = NSFont(name: fontFamily, size: typography.fontSize.stringToCGFloat()) ?? NSFont.systemFont(ofSize: typography.fontSize.stringToCGFloat())
-        if state == .Norm {
-            control.background = bgFill
-            control.textColor = textFill
-            control.cornerRadius = Float(borderRadius.stringToCGFloat())
-            control.lineHeight = typography.lineHeight.stringToCGFloat()
-        } else if state == .Hov {
-            control.background_hover = bgFill
-            control.textColor_hover = textFill
-            control.cornerRadius_hover = Float(borderRadius.stringToCGFloat())
-            control.lineHeight_hover = typography.lineHeight.stringToCGFloat()
-        } else if state == .Sel {
-            control.background_click = bgFill
-            control.textColor_click = textFill
-            control.cornerRadius_click = Float(borderRadius.stringToCGFloat())
-            control.lineHeight_click = typography.lineHeight.stringToCGFloat()
-        }
-        
-        control.updateUI()
-    }
-    
-    // MARK: - Select
-    
-    func selectDesignToken(bgToken: String = "", textToken: String = "", textbgToken: String = "", heightConstraint: NSLayoutConstraint = NSLayoutConstraint(), control: KMDesignSelect, state: KMDesignTokenState = .Norm) -> Void {
-        var height: String?
-        var horizontalPadding: String?
-        var borderColor: NSColor?
-        var borderRadius: String?
-        var borderWidth: String?
-        var boxShadow: KMBoxShadowValue?
-        var fill: NSColor?
-        var itemSpacing: String?
-        
-        var textTypography: KMTypographyValue?
-        var textFill: NSColor?
-        
-        var textbgHeight: String?
-        var textbgSpacing: String?
-        var textbgFill: NSColor?
-        var textbgItemSpacing: String?
-                        
-        if bgToken != "" {
-            height = self.height(withToken: bgToken)
-            horizontalPadding = self.horizontalPadding(withToken: bgToken)
-            borderColor = self.border(withToken: bgToken)
-            borderRadius = self.borderRadius(withToken: bgToken)
-            borderWidth = self.borderWidth(withToken: bgToken)
-//            boxShadow = self.boxShadow(withToken: bgToken)
-            fill = self.fill(withToken: bgToken)
-            itemSpacing = self.itemSpacing(withToken: bgToken)
-        }
-        if textToken != "" {
-            textTypography = self.typography(withToken: textToken)
-            textFill = self.fill(withToken: textToken)
-        }
-        if textbgToken != "" {
-            textbgHeight = self.height(withToken: textbgToken)
-            textbgSpacing = self.spacing(withToken: textbgToken)
-            textbgFill = self.fill(withToken: textbgToken)
-            textbgItemSpacing = self.itemSpacing(withToken: textbgToken)
-        }
-        
-        if height != nil {
-            if heightConstraint.shouldBeArchived {
-                heightConstraint.constant = height!.stringToCGFloat()
-            }
-        }
-        if horizontalPadding != nil {
-            control.horizontalPadding = Float(horizontalPadding!.stringToCGFloat())
-        }
-        if itemSpacing != nil {
-            control.itemSpacing = Float(itemSpacing!.stringToCGFloat())
-        }
-
-        if borderColor != nil {
-            if state == .Norm {
-                control.borderColor = borderColor!
-            } else if (state == .Hov) {
-                control.borderColor_hov = borderColor!
-            } else if (state == .Focus) {
-                control.borderColor_focus = borderColor!
-            } else if (state == .Disabled) {
-                control.borderColor_disabled = borderColor!
-            } else if (state == .Error_def) {
-                control.borderColor_errordef = borderColor!
-            } else if (state == .Error_focus) {
-                control.borderColor_errorfocus = borderColor!
-            }
-        }
-        if borderRadius != nil {
-            if state == .Norm {
-                control.cornerRadius = Float(borderRadius!.stringToCGFloat())
-            } else if (state == .Hov) {
-                control.cornerRadius_hov = Float(borderRadius!.stringToCGFloat())
-            } else if (state == .Focus) {
-                control.cornerRadius_focus = Float(borderRadius!.stringToCGFloat())
-            } else if (state == .Disabled) {
-                control.cornerRadius_disabled = Float(borderRadius!.stringToCGFloat())
-            } else if (state == .Error_def) {
-                control.cornerRadius_errordef = Float(borderRadius!.stringToCGFloat())
-            } else if (state == .Error_focus) {
-                control.cornerRadius_errorfocus = Float(borderRadius!.stringToCGFloat())
-            }
-        }
-        if borderWidth != nil {
-            if state == .Norm {
-                control.borderWidth = Float(borderWidth!.stringToCGFloat())
-            } else if (state == .Hov) {
-                control.borderWidth_hov = Float(borderWidth!.stringToCGFloat())
-            } else if (state == .Focus) {
-                control.borderWidth_focus = Float(borderWidth!.stringToCGFloat())
-            } else if (state == .Disabled) {
-                control.borderWidth_disabled = Float(borderWidth!.stringToCGFloat())
-            } else if (state == .Error_def) {
-                control.borderWidth_errordef = Float(borderWidth!.stringToCGFloat())
-            } else if (state == .Error_focus) {
-                control.borderWidth_errorfocus = Float(borderWidth!.stringToCGFloat())
-            }
-        }
-//        if boxShadow != nil {
-//            if state == .Norm {
-//                control.borderWidth = Float(borderWidth!.stringToCGFloat())
-//            } else if (state == .Hov) {
-//                control.borderWidth_hov = Float(borderWidth!.stringToCGFloat())
-//            } else if (state == .Focus) {
-//                control.borderWidth_focus = Float(borderWidth!.stringToCGFloat())
-//            } else if (state == .Disabled) {
-//                control.borderWidth_disabled = Float(borderWidth!.stringToCGFloat())
-//            } else if (state == .Error_def) {
-//                control.borderWidth_errordef = Float(borderWidth!.stringToCGFloat())
-//            } else if (state == .Error_focus) {
-//                control.borderWidth_errorfocus = Float(borderWidth!.stringToCGFloat())
-//            }
-//        }
-        if fill != nil {
-            if state == .Norm {
-                control.background = fill!
-            } else if (state == .Hov) {
-                control.background_hov = fill!
-            } else if (state == .Focus) {
-                control.background_focus = fill!
-            } else if (state == .Disabled) {
-                control.background_disabled = fill!
-            } else if (state == .Error_def) {
-                control.background_errordef = fill!
-            } else if (state == .Error_focus) {
-                control.background_errorfocus = fill!
-            }
-        }
-        
-        if textTypography != nil {
-            var fontFamily: String = textTypography!.fontFamily
-            let fontWeight: String = textTypography!.fontWeight
-            if fontFamily.contains(" ") {
-                fontFamily = fontFamily.replacingOccurrences(of: " ", with: "")
-            }
-            if fontWeight != "" {
-                fontFamily = String(format: "%@-%@", fontFamily, fontWeight)
-            }
-            if state == .Norm {
-                control.font = NSFont(name: fontFamily, size: textTypography!.fontSize.stringToCGFloat()) ?? NSFont.systemFont(ofSize: textTypography!.fontSize.stringToCGFloat())
-            } else if (state == .Hov) {
-                control.font_hov = NSFont(name: fontFamily, size: textTypography!.fontSize.stringToCGFloat()) ?? NSFont.systemFont(ofSize: textTypography!.fontSize.stringToCGFloat())
-            } else if (state == .Focus) {
-                control.font_focus = NSFont(name: fontFamily, size: textTypography!.fontSize.stringToCGFloat()) ?? NSFont.systemFont(ofSize: textTypography!.fontSize.stringToCGFloat())
-            } else if (state == .Disabled) {
-                control.font_disabled = NSFont(name: fontFamily, size: textTypography!.fontSize.stringToCGFloat()) ?? NSFont.systemFont(ofSize: textTypography!.fontSize.stringToCGFloat())
-            } else if (state == .Error_def) {
-                control.font_errordef = NSFont(name: fontFamily, size: textTypography!.fontSize.stringToCGFloat()) ?? NSFont.systemFont(ofSize: textTypography!.fontSize.stringToCGFloat())
-            } else if (state == .Error_focus) {
-                control.font_errorfocus = NSFont(name: fontFamily, size: textTypography!.fontSize.stringToCGFloat()) ?? NSFont.systemFont(ofSize: textTypography!.fontSize.stringToCGFloat())
-            }
-        }
-        if textFill != nil {
-            if state == .Norm {
-                control.textColor = textFill!
-            } else if (state == .Hov) {
-                control.textColor_hov = textFill!
-            } else if (state == .Focus) {
-                control.textColor_focus = textFill!
-            } else if (state == .Disabled) {
-                control.textColor_disabled = textFill!
-            } else if (state == .Error_def) {
-                control.textColor_errordef = textFill!
-            } else if (state == .Error_focus) {
-                control.textColor_errorfocus = textFill!
-            }
-        }
-        
-        if textbgFill != nil {
-            if (state == .Error_focus) {
-                control.textbg_errorfocus = textbgFill!
-            }
-        }
-        control.updateUI()
-    }
-    
-    // MARK: Property Selector 阅读页
-    
-    func propertySelectorDesignToken(bgToken: String = "", textToken: String = "", itemSpacingToken: String = "", textMainToken: String = "", textDescToken: String = "", fillToken: String = "", highlightToken: String = "", heightConstraint: NSLayoutConstraint = NSLayoutConstraint(), control: KMDesignPropertySelector, state: KMDesignTokenState = .Norm) -> Void {
-        var borderColor: NSColor?
-        var borderRadius: String?
-        var borderWidth: String?
-        var fill: NSColor?
-        
-        if bgToken != "" {
-            borderColor = self.border(withToken: bgToken)
-            borderRadius = self.borderRadius(withToken: bgToken)
-            borderWidth = self.borderWidth(withToken: bgToken)
-            fill = self.fill(withToken: bgToken)
-        }
-        if borderColor != nil {
-            if state == .Norm {
-                control.borderColor = borderColor!
-            } else if (state == .Hov) {
-                control.borderColor_hov = borderColor!
-            } else if (state == .Sel) {
-                control.borderColor_sel = borderColor!
-            }
-        }
-        if borderRadius != nil {
-            if state == .Norm {
-                control.cornerRadius = Float(borderRadius!.stringToCGFloat())
-            } else if (state == .Hov) {
-                control.cornerRadius_hov = Float(borderRadius!.stringToCGFloat())
-            } else if (state == .Sel) {
-                control.cornerRadius_sel = Float(borderRadius!.stringToCGFloat())
-            }
-        }
-        if borderWidth != nil {
-            if state == .Norm {
-                control.borderWidth = Float(borderWidth!.stringToCGFloat())
-            } else if (state == .Hov) {
-                control.borderWidth_hov = Float(borderWidth!.stringToCGFloat())
-            } else if (state == .Sel) {
-                control.borderWidth_sel = Float(borderWidth!.stringToCGFloat())
-            }
-        }
-        if fill != nil {
-            if state == .Norm {
-                control.background = fill!
-            } else if (state == .Hov) {
-                control.background_hov = fill!
-            } else if (state == .Sel) {
-                control.background_sel = fill!
-            }
-        }
-        control.updateUI()
-    }
-}

+ 0 - 92
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuth.h

@@ -1,92 +0,0 @@
-/*! @file AppAuth.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDAuthState.h"
-#import "OIDAuthStateChangeDelegate.h"
-#import "OIDAuthStateErrorDelegate.h"
-#import "OIDAuthorizationRequest.h"
-#import "OIDAuthorizationResponse.h"
-#import "OIDAuthorizationService.h"
-#import "OIDError.h"
-#import "OIDErrorUtilities.h"
-#import "OIDExternalUserAgent.h"
-#import "OIDExternalUserAgentRequest.h"
-#import "OIDExternalUserAgentSession.h"
-#import "OIDGrantTypes.h"
-#import "OIDIDToken.h"
-#import "OIDRegistrationRequest.h"
-#import "OIDRegistrationResponse.h"
-#import "OIDResponseTypes.h"
-#import "OIDScopes.h"
-#import "OIDScopeUtilities.h"
-#import "OIDServiceConfiguration.h"
-#import "OIDServiceDiscovery.h"
-#import "OIDTokenRequest.h"
-#import "OIDTokenResponse.h"
-#import "OIDTokenUtilities.h"
-#import "OIDURLSessionProvider.h"
-#import "OIDEndSessionRequest.h"
-#import "OIDEndSessionResponse.h"
-
-#if TARGET_OS_TV
-#elif TARGET_OS_WATCH
-#elif TARGET_OS_IOS || TARGET_OS_MACCATALYST
-#import "OIDAuthState+IOS.h"
-#import "OIDAuthorizationService+IOS.h"
-#import "OIDExternalUserAgentIOS.h"
-#import "OIDExternalUserAgentIOSCustomBrowser.h"
-#import "OIDExternalUserAgentCatalyst.h"
-#elif TARGET_OS_OSX
-#import "OIDAuthState+Mac.h"
-#import "OIDAuthorizationService+Mac.h"
-#import "OIDExternalUserAgentMac.h"
-#import "OIDRedirectHTTPHandler.h"
-#else
-#error "Platform Undefined"
-#endif
-
-/*! @mainpage AppAuth for iOS and macOS
-
-    @section introduction Introduction
-
-    AppAuth for iOS and macOS is a client SDK for communicating with [OAuth 2.0]
-    (https://tools.ietf.org/html/rfc6749) and [OpenID Connect]
-    (http://openid.net/specs/openid-connect-core-1_0.html) providers. It strives to
-    directly map the requests and responses of those specifications, while following
-    the idiomatic style of the implementation language. In addition to mapping the
-    raw protocol flows, convenience methods are available to assist with common
-    tasks like performing an action with fresh tokens.
-
-    It follows the best practices set out in 
-    [RFC 8252 - OAuth 2.0 for Native Apps](https://tools.ietf.org/html/rfc8252)
-    including using `SFAuthenticationSession` and `SFSafariViewController` on iOS
-    for the auth request. Web view and `WKWebView` are explicitly *not*
-    supported due to the security and usability reasons explained in
-    [Section 8.12 of RFC 8252](https://tools.ietf.org/html/rfc8252#section-8.12).
-
-    It also supports the [PKCE](https://tools.ietf.org/html/rfc7636) extension to
-    OAuth which was created to secure authorization codes in public clients when
-    custom URI scheme redirects are used. The library is friendly to other
-    extensions (standard or otherwise) with the ability to handle additional params
-    in all protocol requests and responses.
-
-    <b>Homepage</b>: http://openid.github.io/AppAuth-iOS/ <br>
-    <b>API Documentation</b>: http://openid.github.io/AppAuth-iOS/docs/latest <br>
-    <b>Git Repository</b>: https://github.com/openid/AppAuth-iOS <br>
-
- */

+ 0 - 192
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuth/macOS/LoopbackHTTPServer/OIDLoopbackHTTPServer.h

@@ -1,192 +0,0 @@
-/*! @file OIDLoopbackHTTPServer.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2016 The AppAuth Authors.
-    @copydetails
-        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.
- */
-
-// Based on the MiniSOAP Sample
-// https://developer.apple.com/library/mac/samplecode/MiniSOAP/Introduction/Intro.html
-// Modified to limit connections to the loopback interface only.
-
-#import <TargetConditionals.h>
-
-#if TARGET_OS_OSX
-
-#import <Foundation/Foundation.h>
-#import <CoreServices/CoreServices.h>
-
-@class HTTPConnection, HTTPServerRequest, TCPServer;
-
-extern NSString * const TCPServerErrorDomain;
-
-typedef enum {
-    kTCPServerCouldNotBindToIPv4Address = 1,
-    kTCPServerCouldNotBindToIPv6Address = 2,
-    kTCPServerNoSocketsAvailable = 3,
-} TCPServerErrorCode;
-
-@protocol TCPServerDelegate <NSObject>
-
-- (void)TCPServer:(TCPServer *)server
-    didReceiveConnectionFromAddress:(NSData *)addr
-                        inputStream:(NSInputStream *)istr
-                       outputStream:(NSOutputStream *)ostr;
-
-@end
-
-@interface TCPServer : NSObject {
-@private
-    __weak id<TCPServerDelegate> delegate;
-    NSString *domain;
-    NSString *name;
-    NSString *type;
-    uint16_t port;
-    CFSocketRef ipv4socket;
-    CFSocketRef ipv6socket;
-    NSNetService *netService;
-}
-
-- (id)delegate;
-- (void)setDelegate:(id)value;
-
-- (NSString *)domain;
-- (void)setDomain:(NSString *)value;
-
-- (NSString *)name;
-- (void)setName:(NSString *)value;
-
-- (NSString *)type;
-- (void)setType:(NSString *)value;
-
-- (uint16_t)port;
-- (void)setPort:(uint16_t)value;
-
-- (BOOL)start:(NSError **)error;
-- (BOOL)stop;
-
-- (BOOL)hasIPv4Socket;
-- (BOOL)hasIPv6Socket;
-
-// called when a new connection comes in; by default, informs the delegate
-- (void)handleNewConnectionFromAddress:(NSData *)addr
-                           inputStream:(NSInputStream *)istr
-                          outputStream:(NSOutputStream *)ostr;
-
-@end
-
-@interface HTTPServer : TCPServer {
-@private
-    Class connClass;
-    NSURL *docRoot;
-    // Currently active connections spawned from the HTTPServer.
-    NSMutableArray<HTTPConnection *> *connections;
-}
-
-- (Class)connectionClass;
-// used to configure the subclass of HTTPConnection to create when 
-// a new connection comes in; by default, this is HTTPConnection
-- (void)setConnectionClass:(Class)value;
-
-@end
-
-@interface HTTPServer (HTTPServerDelegateMethods)
-// If the delegate implements this method, this is called 
-// by an HTTPServer when a new connection comes in.  If the
-// delegate wishes to refuse the connection, then it should
-// invalidate the connection object from within this method.
-- (void)HTTPServer:(HTTPServer *)serv didMakeNewConnection:(HTTPConnection *)conn;
-@end
-
-
-// This class represents each incoming client connection.
-@interface HTTPConnection : NSObject <NSStreamDelegate> {
-@private
-    __weak id delegate;
-    NSData *peerAddress;
-    __weak HTTPServer *server;
-    NSMutableArray<HTTPServerRequest *> *requests;
-    NSInputStream *istream;
-    NSOutputStream *ostream;
-    NSMutableData *ibuffer;
-    NSMutableData *obuffer;
-    BOOL isValid;
-    BOOL firstResponseDone;
-}
-
-- (id)initWithPeerAddress:(NSData *)addr
-              inputStream:(NSInputStream *)istr
-             outputStream:(NSOutputStream *)ostr
-                forServer:(HTTPServer *)serv;
-
-- (id)delegate;
-- (void)setDelegate:(id)value;
-
-- (NSData *)peerAddress;
-
-- (HTTPServer *)server;
-
-// get the next request that needs to be responded to
-- (HTTPServerRequest *)nextRequest;
-
-- (BOOL)isValid;
-// shut down the connection
-- (void)invalidate;
-
-// perform the default handling action: GET and HEAD requests for files
-// in the local file system (relative to the documentRoot of the server)
-- (void)performDefaultRequestHandling:(HTTPServerRequest *)sreq;
-
-@end
-
-@interface HTTPConnection (HTTPConnectionDelegateMethods)
-// The "didReceiveRequest:" tells the delegate when a new request comes in.
-- (void)HTTPConnection:(HTTPConnection *)conn didReceiveRequest:(HTTPServerRequest *)mess;
-- (void)HTTPConnection:(HTTPConnection *)conn didSendResponse:(HTTPServerRequest *)mess;
-@end
-
-
-// As NSURLRequest and NSURLResponse are not entirely suitable for use from
-// the point of view of an HTTP server, we use CFHTTPMessageRef to encapsulate
-// requests and responses.  This class packages the (future) response with a
-// request and other info for convenience.
-@interface HTTPServerRequest : NSObject {
-@private
-    HTTPConnection *connection;
-    CFHTTPMessageRef request;
-    CFHTTPMessageRef response;
-    NSInputStream *responseStream;
-}
-
-- (id)initWithRequest:(CFHTTPMessageRef)req connection:(HTTPConnection *)conn;
-
-- (HTTPConnection *)connection;
-
-- (CFHTTPMessageRef)request;
-
-// The response may include a body.  As soon as the response is set,
-// the response may be written out to the network.
-- (CFHTTPMessageRef)response;
-- (void)setResponse:(CFHTTPMessageRef)value;
-
-- (NSInputStream *)responseBodyStream;
-// If there is to be a response body stream (when, say, a big
-// file is to be returned, rather than reading the whole thing
-// into memory), then it must be set on the request BEFORE the
-// response [headers] itself.
-- (void)setResponseBodyStream:(NSInputStream *)value;
-
-@end
-
-#endif // TARGET_OS_OSX

+ 0 - 618
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuth/macOS/LoopbackHTTPServer/OIDLoopbackHTTPServer.m

@@ -1,618 +0,0 @@
-/*! @file OIDLoopbackHTTPServer.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2016 The AppAuth Authors.
-    @copydetails
-        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.
- */
-
-#import <TargetConditionals.h>
-
-#if TARGET_OS_OSX
-
-#import "OIDLoopbackHTTPServer.h"
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <unistd.h>
-
-// We'll ignore the pointer arithmetic warnings for now.
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpointer-arith"
-
-@implementation HTTPServer
-
-- (id)init {
-    self = [super init];
-    connClass = [HTTPConnection self];
-    connections = [[NSMutableArray alloc] init];
-    return self;
-}
-
-- (Class)connectionClass {
-    return connClass;
-}
-
-- (void)setConnectionClass:(Class)value {
-    connClass = value;
-}
-
-// Removes the connection from the list of active connections.
-- (void)removeConnection:(HTTPConnection *)connection {
-    [connections removeObject:connection];
-}
-
-// Converts the TCPServer delegate notification into the HTTPServer delegate method.
-- (void)handleNewConnectionFromAddress:(NSData *)addr inputStream:(NSInputStream *)istr outputStream:(NSOutputStream *)ostr {
-    HTTPConnection *connection = [[connClass alloc] initWithPeerAddress:addr inputStream:istr outputStream:ostr forServer:self];
-    // Adds connection to the active connection list to retain it.
-    [connections addObject:connection];
-    [connection setDelegate:[self delegate]];
-    if ([self delegate] && [[self delegate] respondsToSelector:@selector(HTTPServer:didMakeNewConnection:)]) {
-        [[self delegate] HTTPServer:self didMakeNewConnection:connection];
-    }
-}
-
-@end
-
-
-@implementation HTTPConnection
-
-- (id)init {
-    return nil;
-}
-
-- (id)initWithPeerAddress:(NSData *)addr inputStream:(NSInputStream *)istr outputStream:(NSOutputStream *)ostr forServer:(HTTPServer *)serv {
-    peerAddress = [addr copy];
-    server = serv;
-    istream = istr;
-    ostream = ostr;
-    [istream setDelegate:self];
-    [ostream setDelegate:self];
-    [istream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:(id)kCFRunLoopCommonModes];
-    [ostream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:(id)kCFRunLoopCommonModes];
-    [istream open];
-    [ostream open];
-    isValid = YES;
-    return self;
-}
-
-- (void)dealloc {
-    [self invalidate];
-}
-
-- (id)delegate {
-    return delegate;
-}
-
-- (void)setDelegate:(id)value {
-    delegate = value;
-}
-
-- (NSData *)peerAddress {
-    return peerAddress;
-}
-
-- (HTTPServer *)server {
-    return server;
-}
-
-- (HTTPServerRequest *)nextRequest {
-  for (HTTPServerRequest *request in requests) {
-    if (![request response]) {
-      return request;
-    }
-  }
-  return nil;
-}
-
-- (BOOL)isValid {
-    return isValid;
-}
-
-- (void)invalidate {
-    if (isValid) {
-        isValid = NO;
-        [server removeConnection:self];
-        [istream setDelegate:nil];
-        [ostream setDelegate:nil];
-        [istream close];
-        [ostream close];
-        istream = nil;
-        ostream = nil;
-        ibuffer = nil;
-        obuffer = nil;
-        requests = nil;
-    }
-}
-
-// YES return means that a complete request was parsed, and the caller
-// should call again as the buffered bytes may have another complete
-// request available.
-- (BOOL)processIncomingBytes {
-    CFHTTPMessageRef working = CFHTTPMessageCreateEmpty(kCFAllocatorDefault, TRUE);
-    CFHTTPMessageAppendBytes(working, [ibuffer bytes], [ibuffer length]);
-
-    // This "try and possibly succeed" approach is potentially expensive
-    // (lots of bytes being copied around), but the only API available for
-    // the server to use, short of doing the parsing itself.
-
-    // HTTPConnection does not handle the chunked transfer encoding
-    // described in the HTTP spec.  And if there is no Content-Length
-    // header, then the request is the remainder of the stream bytes.
-
-    if (CFHTTPMessageIsHeaderComplete(working)) {
-        NSString *contentLengthValue = (__bridge_transfer NSString *)CFHTTPMessageCopyHeaderFieldValue(working, (CFStringRef)@"Content-Length");
-        
-        unsigned contentLength = contentLengthValue ? [contentLengthValue intValue] : 0;
-        NSData *body = (__bridge_transfer NSData *)CFHTTPMessageCopyBody(working);
-        NSUInteger bodyLength = [body length];
-        if (contentLength <= bodyLength) {
-            NSData *newBody = [NSData dataWithBytes:[body bytes] length:contentLength];
-            [ibuffer setLength:0];
-            [ibuffer appendBytes:([body bytes] + contentLength) length:(bodyLength - contentLength)];
-            CFHTTPMessageSetBody(working, (__bridge CFDataRef)newBody);
-        } else {
-            CFRelease(working);
-            return NO;
-        }
-    } else {
-        return NO;
-    }
-
-    HTTPServerRequest *request = [[HTTPServerRequest alloc] initWithRequest:working connection:self];
-    if (!requests) {
-        requests = [[NSMutableArray alloc] init];
-    }
-    [requests addObject:request];
-    if (delegate && [delegate respondsToSelector:@selector(HTTPConnection:didReceiveRequest:)]) {
-        // Schedules the delegate to be executed later on the main thread. Cannot call the delegate
-        // directly as this method is called in a loop in order to process multiple messages, and
-        // the delegate may choose to stop and dealloc the listener – so we need queue the messages
-        // and process them separately.
-        id myDelegate = delegate;
-        dispatch_async(dispatch_get_main_queue(), ^() {
-          [myDelegate HTTPConnection:self didReceiveRequest:request];
-        });
-    } else {
-        [self performDefaultRequestHandling:request];
-    }
-
-    CFRelease(working);
-    return YES;
-}
-
-- (void)processOutgoingBytes {
-    // The HTTP headers, then the body if any, then the response stream get
-    // written out, in that order.  The Content-Length: header is assumed to
-    // be properly set in the response.  Outgoing responses are processed in
-    // the order the requests were received (required by HTTP).
-
-    // Write as many bytes as possible, from buffered bytes, response
-    // headers and body, and response stream.
-
-    if (![ostream hasSpaceAvailable]) {
-        return;
-    }
-
-    NSUInteger olen = [obuffer length];
-    if (0 < olen) {
-        NSInteger writ = [ostream write:[obuffer bytes] maxLength:olen];
-        // buffer any unwritten bytes for later writing
-        if (writ < olen) {
-            memmove([obuffer mutableBytes], [obuffer mutableBytes] + writ, olen - writ);
-            [obuffer setLength:olen - writ];
-            return;
-        }
-        [obuffer setLength:0];
-    }
-
-    NSUInteger cnt = requests ? [requests count] : 0;
-    HTTPServerRequest *req = (0 < cnt) ? [requests objectAtIndex:0] : nil;
-
-    CFHTTPMessageRef cfresp = req ? [req response] : NULL;
-    if (!cfresp) return;
-
-    if (!obuffer) {
-        obuffer = [[NSMutableData alloc] init];
-    }
-
-    if (!firstResponseDone) {
-        firstResponseDone = YES;
-        NSData *serialized = (__bridge_transfer NSData *)CFHTTPMessageCopySerializedMessage(cfresp);
-        NSUInteger olen = [serialized length];
-        if (0 < olen) {
-            NSInteger writ = [ostream write:[serialized bytes] maxLength:olen];
-            if (writ < olen) {
-                // buffer any unwritten bytes for later writing
-                [obuffer setLength:(olen - writ)];
-                memmove([obuffer mutableBytes], [serialized bytes] + writ, olen - writ);
-                return;
-            }
-        }
-    }
-
-    NSInputStream *respStream = [req responseBodyStream];
-    if (respStream) {
-        if ([respStream streamStatus] == NSStreamStatusNotOpen) {
-            [respStream open];
-        }
-        // read some bytes from the stream into our local buffer
-        [obuffer setLength:16 * 1024];
-        NSInteger read = [respStream read:[obuffer mutableBytes] maxLength:[obuffer length]];
-        [obuffer setLength:read];
-    }
-
-    if (0 == [obuffer length]) {
-        // When we get to this point with an empty buffer, then the
-        // processing of the response is done. If the input stream
-        // is closed or at EOF, then no more requests are coming in.
-        if (delegate && [delegate respondsToSelector:@selector(HTTPConnection:didSendResponse:)]) {
-            [delegate HTTPConnection:self didSendResponse:req];
-        }
-        [requests removeObjectAtIndex:0];
-        firstResponseDone = NO;
-        if ([istream streamStatus] == NSStreamStatusAtEnd && [requests count] == 0) {
-            [self invalidate];
-        }
-        return;
-    }
-
-    olen = [obuffer length];
-    if (0 < olen) {
-        NSInteger writ = [ostream write:[obuffer bytes] maxLength:olen];
-        // buffer any unwritten bytes for later writing
-        if (writ < olen) {
-            memmove([obuffer mutableBytes], [obuffer mutableBytes] + writ, olen - writ);
-        }
-        [obuffer setLength:olen - writ];
-    }
-}
-
-- (void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)streamEvent {
-    switch(streamEvent) {
-    case NSStreamEventHasBytesAvailable:;
-        uint8_t buf[16 * 1024];
-        uint8_t *buffer = NULL;
-        NSUInteger len = 0;
-        if (![istream getBuffer:&buffer length:&len]) {
-            NSInteger amount = [istream read:buf maxLength:sizeof(buf)];
-            buffer = buf;
-            len = amount;
-        }
-        if (0 < len) {
-            if (!ibuffer) {
-                ibuffer = [[NSMutableData alloc] init];
-            }
-            [ibuffer appendBytes:buffer length:len];
-        }
-        do {} while ([self processIncomingBytes]);
-        break;
-    case NSStreamEventHasSpaceAvailable:;
-        [self processOutgoingBytes];
-        break;
-    case NSStreamEventEndEncountered:;
-        [self processIncomingBytes];
-        if (stream == ostream) {
-            // When the output stream is closed, no more writing will succeed and
-            // will abandon the processing of any pending requests and further
-            // incoming bytes.
-            [self invalidate];
-        }
-        break;
-    case NSStreamEventErrorOccurred:;
-        NSLog(@"HTTPServer stream error: %@", [stream streamError]);
-        break;
-    default:
-        break;
-    }
-}
-
-- (void)performDefaultRequestHandling:(HTTPServerRequest *)mess {
-    CFHTTPMessageRef request = [mess request];
-
-    NSString *vers = (__bridge_transfer id)CFHTTPMessageCopyVersion(request);
-    if (!vers || ![vers isEqual:(id)kCFHTTPVersion1_1]) {
-        CFHTTPMessageRef response = CFHTTPMessageCreateResponse(kCFAllocatorDefault, 505, NULL, (__bridge CFStringRef)vers); // Version Not Supported
-        [mess setResponse:response];
-        CFRelease(response);
-        return;
-    }
-
-    // 500s all requests when no delegate set to handle them.
-    CFHTTPMessageRef response = CFHTTPMessageCreateResponse(kCFAllocatorDefault, 500, NULL, kCFHTTPVersion1_1); // Bad Request
-    [mess setResponse:response];
-    CFRelease(response);
-}
-
-@end
-
-
-@implementation HTTPServerRequest
-
-- (id)init {
-    return nil;
-}
-
-- (id)initWithRequest:(CFHTTPMessageRef)req connection:(HTTPConnection *)conn {
-    connection = conn;
-    request = (CFHTTPMessageRef)CFRetain(req);
-    return self;
-}
-
-- (void)dealloc {
-    if (request) CFRelease(request);
-    if (response) CFRelease(response);
-}
-
-- (HTTPConnection *)connection {
-    return connection;
-}
-
-- (CFHTTPMessageRef)request {
-    return request;
-}
-
-- (CFHTTPMessageRef)response {
-    return response;
-}
-
-- (void)setResponse:(CFHTTPMessageRef)value {
-    if (value != response) {
-        if (response) CFRelease(response);
-        response = (CFHTTPMessageRef)CFRetain(value);
-        if (response) {
-            // check to see if the response can now be sent out
-            [connection processOutgoingBytes];
-        }
-    }
-}
-
-- (NSInputStream *)responseBodyStream {
-    return responseStream;
-}
-
-- (void)setResponseBodyStream:(NSInputStream *)value {
-    if (value != responseStream) {
-        responseStream = value;
-    }
-}
-
-@end
-
-NSString * const TCPServerErrorDomain = @"TCPServerErrorDomain";
-
-@implementation TCPServer
-
-- (id)init {
-    return self;
-}
-
-- (void)dealloc {
-    [self stop];
-}
-
-- (id)delegate {
-    return delegate;
-}
-
-- (void)setDelegate:(id)value {
-    delegate = value;
-}
-
-- (NSString *)domain {
-    return domain;
-}
-
-- (void)setDomain:(NSString *)value {
-    if (domain != value) {
-        domain = [value copy];
-    }
-}
-
-- (NSString *)name {
-    return name;
-}
-
-- (void)setName:(NSString *)value {
-    if (name != value) {
-        name = [value copy];
-    }
-}
-
-- (NSString *)type {
-    return type;
-}
-
-- (void)setType:(NSString *)value {
-    if (type != value) {
-        type = [value copy];
-    }
-}
-
-- (uint16_t)port {
-    return port;
-}
-
-- (void)setPort:(uint16_t)value {
-    port = value;
-}
-
-- (void)handleNewConnectionFromAddress:(NSData *)addr inputStream:(NSInputStream *)istr outputStream:(NSOutputStream *)ostr {
-    // if the delegate implements the delegate method, call it
-    if (delegate && [(NSObject*)delegate respondsToSelector:@selector(TCPServer:didReceiveConnectionFromAddress:inputStream:outputStream:)]) {
-        [delegate TCPServer:self didReceiveConnectionFromAddress:addr inputStream:istr outputStream:ostr];
-    }
-}
-
-// This function is called by CFSocket when a new connection comes in.
-// We gather some data here, and convert the function call to a method
-// invocation on TCPServer.
-static void TCPServerAcceptCallBack(CFSocketRef socket, CFSocketCallBackType type, CFDataRef address, const void *data, void *info) {
-    TCPServer *server = (__bridge TCPServer *)info;
-    if (kCFSocketAcceptCallBack == type) {
-        // for an AcceptCallBack, the data parameter is a pointer to a CFSocketNativeHandle
-        CFSocketNativeHandle nativeSocketHandle = *(CFSocketNativeHandle *)data;
-        uint8_t name[SOCK_MAXADDRLEN];
-        socklen_t namelen = sizeof(name);
-        NSData *peer = nil;
-        if (0 == getpeername(nativeSocketHandle, (struct sockaddr *)name, &namelen)) {
-            peer = [NSData dataWithBytes:name length:namelen];
-        }
-        CFReadStreamRef readStream = NULL;
-	CFWriteStreamRef writeStream = NULL;
-        CFStreamCreatePairWithSocket(kCFAllocatorDefault, nativeSocketHandle, &readStream, &writeStream);
-        if (readStream && writeStream) {
-            CFReadStreamSetProperty(readStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
-            CFWriteStreamSetProperty(writeStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
-            [server handleNewConnectionFromAddress:peer inputStream:(__bridge NSInputStream *)readStream outputStream:(__bridge NSOutputStream *)writeStream];
-        } else {
-            // on any failure, need to destroy the CFSocketNativeHandle
-            // since we are not going to use it any more
-            close(nativeSocketHandle);
-        }
-        if (readStream) CFRelease(readStream);
-        if (writeStream) CFRelease(writeStream);
-    }
-}
-
-- (BOOL)start:(NSError **)error {
-    CFSocketContext socketCtxt = {0, (__bridge void *)(self), NULL, NULL, NULL};
-    ipv4socket = CFSocketCreate(kCFAllocatorDefault, PF_INET, SOCK_STREAM, IPPROTO_TCP, kCFSocketAcceptCallBack, (CFSocketCallBack)&TCPServerAcceptCallBack, &socketCtxt);
-    ipv6socket = CFSocketCreate(kCFAllocatorDefault, PF_INET6, SOCK_STREAM, IPPROTO_TCP, kCFSocketAcceptCallBack, (CFSocketCallBack)&TCPServerAcceptCallBack, &socketCtxt);
-
-    if (NULL == ipv4socket || NULL == ipv6socket) {
-        if (error) *error = [[NSError alloc] initWithDomain:TCPServerErrorDomain code:kTCPServerNoSocketsAvailable userInfo:nil];
-        if (ipv4socket) CFRelease(ipv4socket);
-        if (ipv6socket) CFRelease(ipv6socket);
-        ipv4socket = NULL;
-        ipv6socket = NULL;
-        return NO;
-    }
-
-    int yes = 1;
-    setsockopt(CFSocketGetNative(ipv4socket), SOL_SOCKET, SO_REUSEADDR, (void *)&yes, sizeof(yes));
-    setsockopt(CFSocketGetNative(ipv6socket), SOL_SOCKET, SO_REUSEADDR, (void *)&yes, sizeof(yes));
-
-    // set up the IPv4 endpoint; if port is 0, this will cause the kernel to choose a port for us
-    struct sockaddr_in addr4;
-    memset(&addr4, 0, sizeof(addr4));
-    addr4.sin_len = sizeof(addr4);
-    addr4.sin_family = AF_INET;
-    addr4.sin_port = htons(port);
-    addr4.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
-    NSData *address4 = [NSData dataWithBytes:&addr4 length:sizeof(addr4)];
-
-    if (kCFSocketSuccess == CFSocketSetAddress(ipv4socket, (CFDataRef)address4)) {
-        if (0 == port) {
-            // now that the binding was successful, we get the port number
-            // -- we will need it for the v6 endpoint and for the NSNetService
-            NSData *addr = (__bridge_transfer NSData *)CFSocketCopyAddress(ipv4socket);
-            memcpy(&addr4, [addr bytes], [addr length]);
-            port = ntohs(addr4.sin_port);
-        }
-    } else {
-        if (ipv4socket) CFRelease(ipv4socket);
-        ipv4socket = NULL;
-    }
-
-    // set up the IPv6 endpoint
-    struct sockaddr_in6 addr6;
-    memset(&addr6, 0, sizeof(addr6));
-    addr6.sin6_len = sizeof(addr6);
-    addr6.sin6_family = AF_INET6;
-    addr6.sin6_port = htons(port);
-    memcpy(&(addr6.sin6_addr), &in6addr_loopback, sizeof(addr6.sin6_addr));
-    NSData *address6 = [NSData dataWithBytes:&addr6 length:sizeof(addr6)];
-
-    if (kCFSocketSuccess == CFSocketSetAddress(ipv6socket, (CFDataRef)address6)) {
-        if (0 == port) {
-            // In this case the IPv4 socket failed to bind but the IPv6 socket succeeded
-            // Get the port number of the IPv6 socket
-            NSData *addr = (__bridge_transfer NSData *)CFSocketCopyAddress(ipv6socket);
-            memcpy(&addr6, [addr bytes], [addr length]);
-            port = ntohs(addr6.sin6_port);
-        }
-    } else {
-        if (ipv6socket) CFRelease(ipv6socket);
-        ipv6socket = NULL;
-    }
-
-    if (!ipv4socket && !ipv6socket) {
-        // Couldn't bind an IPv4 or IPv6 socket, return an error
-        if (error) *error = [[NSError alloc] initWithDomain:TCPServerErrorDomain code:kTCPServerCouldNotBindToIPv4Address userInfo:nil];
-        return NO;
-    }
-
-    // set up the run loop sources for the sockets
-    CFRunLoopRef cfrl = CFRunLoopGetCurrent();
-
-    if (ipv4socket) {
-        CFRunLoopSourceRef source4 = CFSocketCreateRunLoopSource(kCFAllocatorDefault, ipv4socket, 0);
-        CFRunLoopAddSource(cfrl, source4, kCFRunLoopCommonModes);
-        CFRelease(source4);
-    }
-
-    if (ipv6socket) {
-        CFRunLoopSourceRef source6 = CFSocketCreateRunLoopSource(kCFAllocatorDefault, ipv6socket, 0);
-        CFRunLoopAddSource(cfrl, source6, kCFRunLoopCommonModes);
-        CFRelease(source6);
-    }
-
-    // we can only publish the service if we have a type to publish with
-    if (nil != type) {
-        NSString *publishingDomain = domain ? domain : @"";
-        NSString *publishingName = nil;
-        if (nil != name) {
-            publishingName = name;
-        } else {
-            NSString * thisHostName = [[NSProcessInfo processInfo] hostName];
-            if ([thisHostName hasSuffix:@".local"]) {
-                publishingName = [thisHostName substringToIndex:([thisHostName length] - 6)];
-            }
-        }
-        netService = [[NSNetService alloc] initWithDomain:publishingDomain type:type name:publishingName port:port];
-        [netService publish];
-    }
-
-    return YES;
-}
-
-- (BOOL)stop {
-    [netService stop];
-    netService = nil;
-    if (ipv4socket) {
-      CFSocketInvalidate(ipv4socket);
-      CFRelease(ipv4socket);
-      ipv4socket = NULL;
-    }
-    if (ipv6socket) {
-      CFSocketInvalidate(ipv6socket);
-      CFRelease(ipv6socket);
-      ipv6socket = NULL;
-    }
-    return YES;
-}
-
-- (BOOL)hasIPv4Socket {
-    return ipv4socket != nil;
-}
-
-- (BOOL)hasIPv6Socket {
-    return ipv6socket != nil;
-}
-
-@end
-
-#pragma GCC diagnostic pop
-
-#endif // TARGET_OS_OSX

+ 0 - 92
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuth/macOS/OIDAuthState+Mac.h

@@ -1,92 +0,0 @@
-/*! @file OIDAuthState+Mac.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2016 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <TargetConditionals.h>
-
-#if TARGET_OS_OSX
-
-#import <AppKit/AppKit.h>
-#import "OIDAuthState.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief macOS specific convenience methods for @c OIDAuthState.
- */
-@interface OIDAuthState (Mac)
-
-/*! @brief Convenience method to create a @c OIDAuthState by presenting an authorization request
-        and performing the authorization code exchange in the case of code flow requests. For
-        the hybrid flow, the caller should validate the id_token and c_hash, then perform the token
-        request (@c OIDAuthorizationService.performTokenRequest:callback:)
-        and update the OIDAuthState with the results (@c
-        OIDAuthState.updateWithTokenResponse:error:).
-    @param authorizationRequest The authorization request to present.
-    @param presentingWindow The window to present the authentication flow.
-    @param callback The method called when the request has completed or failed.
-    @return A @c OIDExternalUserAgentSession instance which will terminate when it
-        receives a @c OIDExternalUserAgentSession.cancel message, or after processing a
-        @c OIDExternalUserAgentSession.resumeExternalUserAgentFlowWithURL: message.
-    @discussion This method adopts @c ASWebAuthenticationSession for macOS 10.15 and above or the
-        default browser otherwise.
- */
-+ (id<OIDExternalUserAgentSession>)
-    authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest
-                             presentingWindow:(NSWindow *)presentingWindow
-                                     callback:(OIDAuthStateAuthorizationCallback)callback;
-
-/*! @brief Convenience method to create a @c OIDAuthState by presenting an authorization request
-        (optionally using an emphemeral browser session that shares no cookies or data with the
-        normal browser session) and performing the authorization code exchange in the case of code
-        flow requests. For the hybrid flow, the caller should validate the id_token and c_hash, then
-        perform the token request (@c OIDAuthorizationService.performTokenRequest:callback:)
-        and update the OIDAuthState with the results using
-        @c OIDAuthState.updateWithTokenResponse:error:.
-    @param authorizationRequest The authorization request to present.
-    @param presentingWindow The window to present the @c ASWebAuthenticationSession UI.
-    @param prefersEphemeralSession Whether the caller prefers to use a private authentication
-        session. See @c ASWebAuthenticationSession.prefersEphemeralWebBrowserSession for more.
-    @param callback The method called when the request has completed or failed.
-    @return A @c OIDExternalUserAgentSession instance which will terminate when it
-        receives a @c OIDExternalUserAgentSession.cancel message, or after processing a
-        @c OIDExternalUserAgentSession.resumeExternalUserAgentFlowWithURL: message.
- */
-+ (id<OIDExternalUserAgentSession>)
-    authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest
-                             presentingWindow:(NSWindow *)presentingWindow
-                      prefersEphemeralSession:(BOOL)prefersEphemeralSession
-                                     callback:(OIDAuthStateAuthorizationCallback)callback
-    API_AVAILABLE(macos(10.15));
-
-/*! @param authorizationRequest The authorization request to present.
-    @param callback The method called when the request has completed or failed.
-    @return A @c OIDExternalUserAgentSession instance which will terminate when it
-        receives a @c OIDExternalUserAgentSession.cancel message, or after processing a
-        @c OIDExternalUserAgentSession.resumeExternalUserAgentFlowWithURL: message.
-    @discussion This method uses the default browser to present the authentication flow.
- */
-+ (id<OIDExternalUserAgentSession>)
-    authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest
-                                     callback:(OIDAuthStateAuthorizationCallback)callback
-    __deprecated_msg("For macOS 10.15 and above please use "
-        "authStateByPresentingAuthorizationRequest:presentingWindow:callback:");
-
-@end
-
-NS_ASSUME_NONNULL_END
-
-#endif // TARGET_OS_OSX

+ 0 - 62
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuth/macOS/OIDAuthState+Mac.m

@@ -1,62 +0,0 @@
-/*! @file OIDAuthState+Mac.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2016 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <TargetConditionals.h>
-
-#if TARGET_OS_OSX
-
-#import "OIDAuthState+Mac.h"
-
-#import "OIDExternalUserAgentMac.h"
-
-@implementation OIDAuthState (Mac)
-
-+ (id<OIDExternalUserAgentSession>)
-    authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest
-                             presentingWindow:(NSWindow *)presentingWindow
-                                     callback:(OIDAuthStateAuthorizationCallback)callback {
-  OIDExternalUserAgentMac *externalUserAgent = [[OIDExternalUserAgentMac alloc] initWithPresentingWindow:presentingWindow];
-  return [self authStateByPresentingAuthorizationRequest:authorizationRequest
-                                       externalUserAgent:externalUserAgent
-                                                callback:callback];
-}
-+ (id<OIDExternalUserAgentSession>)
-    authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest
-                             presentingWindow:(NSWindow *)presentingWindow
-                      prefersEphemeralSession:(BOOL)prefersEphemeralSession
-                                     callback:(OIDAuthStateAuthorizationCallback)callback {
-  OIDExternalUserAgentMac *externalUserAgent =
-      [[OIDExternalUserAgentMac alloc] initWithPresentingWindow:presentingWindow
-                                        prefersEphemeralSession:prefersEphemeralSession];
-  return [self authStateByPresentingAuthorizationRequest:authorizationRequest
-                                       externalUserAgent:externalUserAgent
-                                                callback:callback];
-}
-
-+ (id<OIDExternalUserAgentSession>)
-    authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest
-                                     callback:(OIDAuthStateAuthorizationCallback)callback {
-  OIDExternalUserAgentMac *externalUserAgent = [[OIDExternalUserAgentMac alloc] init];
-  return [self authStateByPresentingAuthorizationRequest:authorizationRequest
-                                       externalUserAgent:externalUserAgent
-                                                callback:callback];
-}
-
-@end
-
-#endif // TARGET_OS_OSX

+ 0 - 78
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuth/macOS/OIDAuthorizationService+Mac.h

@@ -1,78 +0,0 @@
-/*! @file OIDAuthorizationService+Mac.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2016 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <TargetConditionals.h>
-
-#if TARGET_OS_OSX
-
-#import <AppKit/AppKit.h>
-#import "OIDAuthorizationService.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief Provides macOS specific authorization request handling.
- */
-@interface OIDAuthorizationService (Mac)
-
-/*! @brief Perform an authorization flow.
-    @param request The authorization request.
-    @param presentingWindow The window to present the authentication flow.
-    @param callback The method called when the request has completed or failed.
-    @return A @c OIDExternalUserAgentSession instance which will terminate when it
-        receives a @c OIDExternalUserAgentSession.cancel message, or after processing a
-        @c OIDExternalUserAgentSession.resumeExternalUserAgentFlowWithURL: message.
-    @discussion This method adopts @c ASWebAuthenticationSession for macOS 10.15 and above or the
-        default browser otherwise.
- */
-+ (id<OIDExternalUserAgentSession>) presentAuthorizationRequest:(OIDAuthorizationRequest *)request
-                                               presentingWindow:(NSWindow *)presentingWindow
-                                                       callback:(OIDAuthorizationCallback)callback;
-
-/*! @brief Perform an authorization flow using the @c ASWebAuthenticationSession optionally using an
-        emphemeral browser session that shares no cookies or data with the normal browser session.
-    @param request The authorization request.
-    @param presentingWindow The window to present the authentication flow.
-    @param prefersEphemeralSession Whether the caller prefers to use a private authentication
-        session. See @c ASWebAuthenticationSession.prefersEphemeralWebBrowserSession for more.
-    @param callback The method called when the request has completed or failed.
-    @return A @c OIDExternalUserAgentSession instance which will terminate when it
-        receives a @c OIDExternalUserAgentSession.cancel message, or after processing a
-        @c OIDExternalUserAgentSession.resumeExternalUserAgentFlowWithURL: message.
- */
-+ (id<OIDExternalUserAgentSession>) presentAuthorizationRequest:(OIDAuthorizationRequest *)request
-                                               presentingWindow:(NSWindow *)presentingWindow
-                                        prefersEphemeralSession:(BOOL)prefersEphemeralSession
-                                                       callback:(OIDAuthorizationCallback)callback
-    API_AVAILABLE(macos(10.15));
-
-/*! @brief Perform an authorization flow using the default browser.
-    @param request The authorization request.
-    @param callback The method called when the request has completed or failed.
-    @return A @c OIDExternalUserAgentSession instance which will terminate when it
-        receives a @c OIDExternalUserAgentSession.cancel message, or after processing a
-        @c OIDExternalUserAgentSession.resumeExternalUserAgentFlowWithURL: message.
- */
-+ (id<OIDExternalUserAgentSession>)presentAuthorizationRequest:(OIDAuthorizationRequest *)request
-                                                      callback:(OIDAuthorizationCallback)callback
-    __deprecated_msg("For macOS 10.15 and above please use presentAuthorizationRequest:presentingWindow:callback:");
-
-@end
-
-NS_ASSUME_NONNULL_END
-
-#endif // TARGET_OS_OSX

+ 0 - 64
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuth/macOS/OIDAuthorizationService+Mac.m

@@ -1,64 +0,0 @@
-/*! @file OIDAuthorizationService+Mac.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2016 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <TargetConditionals.h>
-
-#if TARGET_OS_OSX
-
-#import "OIDAuthorizationService+Mac.h"
-
-#import "OIDExternalUserAgentMac.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-@implementation OIDAuthorizationService (Mac)
-
-+ (id<OIDExternalUserAgentSession>) presentAuthorizationRequest:(OIDAuthorizationRequest *)request
-                                               presentingWindow:(NSWindow *)presentingWindow
-                                                       callback:(OIDAuthorizationCallback)callback {
-  OIDExternalUserAgentMac *externalUserAgent = [[OIDExternalUserAgentMac alloc] initWithPresentingWindow:presentingWindow];
-  return [self presentAuthorizationRequest:request
-                         externalUserAgent:externalUserAgent
-                                  callback:callback];
-}
-
-+ (id<OIDExternalUserAgentSession>) presentAuthorizationRequest:(OIDAuthorizationRequest *)request
-                                               presentingWindow:(NSWindow *)presentingWindow
-                                        prefersEphemeralSession:(BOOL)prefersEphemeralSession
-                                                       callback:(OIDAuthorizationCallback)callback {
-  OIDExternalUserAgentMac *externalUserAgent =
-      [[OIDExternalUserAgentMac alloc] initWithPresentingWindow:presentingWindow
-                                        prefersEphemeralSession:prefersEphemeralSession];
-  return [self presentAuthorizationRequest:request
-                         externalUserAgent:externalUserAgent
-                                  callback:callback];
-}
-
-+ (id<OIDExternalUserAgentSession>) presentAuthorizationRequest:(OIDAuthorizationRequest *)request
-                                                       callback:(OIDAuthorizationCallback)callback {
-  OIDExternalUserAgentMac *externalUserAgent = [[OIDExternalUserAgentMac alloc] init];
-  return [self presentAuthorizationRequest:request
-                         externalUserAgent:externalUserAgent
-                                  callback:callback];
-}
-
-@end
-
-NS_ASSUME_NONNULL_END
-
-#endif // TARGET_OS_OSX

+ 0 - 54
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuth/macOS/OIDExternalUserAgentMac.h

@@ -1,54 +0,0 @@
-/*! @file OIDExternalUserAgentMac.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2016 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <TargetConditionals.h>
-
-#if TARGET_OS_OSX
-
-#import <AppKit/AppKit.h>
-#import "OIDExternalUserAgent.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief A Mac-specific external user-agent UI Coordinator that uses the default browser to
-        present an external user-agent request.
- */
-@interface OIDExternalUserAgentMac : NSObject <OIDExternalUserAgent>
-
-/*! @brief The designated initializer.
-    @param presentingWindow The window from which to present the @c ASWebAuthenticationSession on
-        macOS 10.15 and above.  Older macOS versions use the system browser.
- */
-- (instancetype)initWithPresentingWindow:(NSWindow *)presentingWindow NS_DESIGNATED_INITIALIZER;
-
-/*! @brief Create an external user-agent which optionally uses a private authentication session.
- @param presentingWindow The window from which to present the @c ASWebAuthenticationSession.
- @param prefersEphemeralSession Whether the caller prefers to use a private authentication
- session. See @c ASWebAuthenticationSession.prefersEphemeralWebBrowserSession for more.
- */
-- (nullable instancetype)initWithPresentingWindow:(NSWindow *)presentingWindow
-                          prefersEphemeralSession:(BOOL)prefersEphemeralSession
-    API_AVAILABLE(macos(10.15));
-
-- (instancetype)init __deprecated_msg("Use initWithPresentingWindow for macOS 10.15 and above.");
-
-@end
-
-NS_ASSUME_NONNULL_END
-
-#endif // TARGET_OS_OSX

+ 0 - 170
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuth/macOS/OIDExternalUserAgentMac.m

@@ -1,170 +0,0 @@
-/*! @file OIDExternalUserAgentMac.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2016 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <TargetConditionals.h>
-
-#if TARGET_OS_OSX
-
-#import "OIDExternalUserAgentMac.h"
-
-#import <Cocoa/Cocoa.h>
-
-#import "OIDErrorUtilities.h"
-#import "OIDExternalUserAgentSession.h"
-#import "OIDExternalUserAgentRequest.h"
-#import <AuthenticationServices/AuthenticationServices.h>
-
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface OIDExternalUserAgentMac ()<ASWebAuthenticationPresentationContextProviding>
-@end
-
-@implementation OIDExternalUserAgentMac {
-  BOOL _externalUserAgentFlowInProgress;
-  __weak id<OIDExternalUserAgentSession> _session;
-  BOOL _prefersEphemeralSession;
-
-  NSWindow *_presentingWindow;
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
-  ASWebAuthenticationSession *_webAuthenticationSession;
-#pragma clang diagnostic pop
-}
-
-- (instancetype)initWithPresentingWindow:(NSWindow *)presentingWindow {
-  self = [super init];
-  if (self) {
-    _presentingWindow = presentingWindow;
-  }
-  return self;
-}
-
-- (nullable instancetype)initWithPresentingWindow:(NSWindow *)presentingWindow
-                          prefersEphemeralSession:(BOOL)prefersEphemeralSession {
-  self = [self initWithPresentingWindow:presentingWindow];
-  if (self) {
-    _prefersEphemeralSession = prefersEphemeralSession;
-  }
-  return self;
-}
-
-- (instancetype)init {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wnonnull"
-  return [self initWithPresentingWindow:nil];
-#pragma clang diagnostic pop
-}
-
-- (BOOL)presentExternalUserAgentRequest:(id<OIDExternalUserAgentRequest>)request
-                                session:(id<OIDExternalUserAgentSession>)session {
-  if (_externalUserAgentFlowInProgress) {
-    // TODO: Handle errors as authorization is already in progress.
-    return NO;
-  }
-
-  _externalUserAgentFlowInProgress = YES;
-  _session = session;
-  NSURL *requestURL = [request externalUserAgentRequestURL];
-
-  if (@available(macOS 10.15, *)) {
-    if (_presentingWindow) {
-      __weak OIDExternalUserAgentMac *weakSelf = self;
-      NSString *redirectScheme = request.redirectScheme;
-      ASWebAuthenticationSession *authenticationSession =
-        [[ASWebAuthenticationSession alloc] initWithURL:requestURL
-                                      callbackURLScheme:redirectScheme
-                                      completionHandler:^(NSURL * _Nullable callbackURL,
-                                                          NSError * _Nullable error) {
-        __strong OIDExternalUserAgentMac *strongSelf = weakSelf;
-        if (!strongSelf) {
-            return;
-        }
-        strongSelf->_webAuthenticationSession = nil;
-        if (callbackURL) {
-          [strongSelf->_session resumeExternalUserAgentFlowWithURL:callbackURL];
-        } else {
-          NSError *safariError =
-              [OIDErrorUtilities errorWithCode:OIDErrorCodeUserCanceledAuthorizationFlow
-                               underlyingError:error
-                                   description:nil];
-          [strongSelf->_session failExternalUserAgentFlowWithError:safariError];
-        }
-      }];
-
-      authenticationSession.presentationContextProvider = self;
-
-      _webAuthenticationSession = authenticationSession;
-      _webAuthenticationSession.prefersEphemeralWebBrowserSession = _prefersEphemeralSession;
-      return [authenticationSession start];
-    }
-  }
-
-  BOOL openedBrowser = [[NSWorkspace sharedWorkspace] openURL:requestURL];
-  if (!openedBrowser) {
-    [self cleanUp];
-    NSError *safariError = [OIDErrorUtilities errorWithCode:OIDErrorCodeBrowserOpenError
-                                            underlyingError:nil
-                                                description:@"Unable to open the browser."];
-    [session failExternalUserAgentFlowWithError:safariError];
-  }
-  return openedBrowser;
-}
-
-- (void)dismissExternalUserAgentAnimated:(BOOL)animated completion:(void (^)(void))completion {
-  if (!_externalUserAgentFlowInProgress) {
-    // Ignore this call if there is no authorization flow in progress.
-    if (completion) completion();
-    return;
-  }
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
-  ASWebAuthenticationSession *webAuthenticationSession = _webAuthenticationSession;
-#pragma clang diagnostic pop
-
-  // Ideally the browser tab with the URL should be closed here, but the AppAuth library does not
-  // control the browser.
-  [self cleanUp];
-  if (webAuthenticationSession) {
-    // dismiss the ASWebAuthenticationSession
-    [webAuthenticationSession cancel];
-    if (completion) completion();
-  } else if (completion) {
-    completion();
-  }
-}
-
-- (void)cleanUp {
-  _session = nil;
-  _externalUserAgentFlowInProgress = NO;
-  _webAuthenticationSession = nil;
-}
-
-#pragma mark - ASWebAuthenticationPresentationContextProviding
-
-- (ASPresentationAnchor)presentationAnchorForWebAuthenticationSession:(ASWebAuthenticationSession *)session
-    API_AVAILABLE(macosx(10.15)) {
-  return _presentingWindow;
-}
-
-@end
-
-NS_ASSUME_NONNULL_END
-
-#endif // TARGET_OS_OSX

+ 0 - 90
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuth/macOS/OIDRedirectHTTPHandler.h

@@ -1,90 +0,0 @@
-/*! @file OIDRedirectHTTPHandler.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2016 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <TargetConditionals.h>
-
-#if TARGET_OS_OSX
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@protocol OIDExternalUserAgentSession;
-
-/*! @brief Start a HTTP server on the loopback interface (i.e. @c 127.0.0.1) to receive the OAuth
-        response redirects on macOS.
- */
-@interface OIDRedirectHTTPHandler : NSObject
-
-/*! @brief The external user-agent request flow session which receives the return URL from the
-        browser.
-    @discussion The loopback HTTP server will try sending incoming request URLs to the OAuth
-        redirect handler to continue the flow. This should be set while an external user-agent
-        request flow is in progress.
- */
-@property(nonatomic, strong, nullable) id<OIDExternalUserAgentSession> currentAuthorizationFlow;
-
-/*! @brief Creates an a loopback HTTP redirect URI handler with the given success URL.
-    @param successURL The URL that the user is redirected to after the external user-agent request flow completes
-        either with a result of success or error. The contents of this page should instruct the user
-        to return to the app.
-    @discussion Once you have initiated the external user-agent request, be sure to set
-        @c currentAuthorizationFlow on this object so that any responses received by this listener will
-        be routed accordingly.
- */
-- (instancetype)initWithSuccessURL:(nullable NSURL *)successURL;
-
-/*! @brief Starts listening on the loopback interface on a specified port, and returns a URL
-        with the base address. Use the returned redirect URI to build a @c OIDExternalUserAgentRequest,
-        and once you initiate the request, set the resulting @c OIDExternalUserAgentSession to
-        @c currentAuthorizationFlow so the response can be handled.
-    @param returnError The error if an error occurred while starting the local HTTP server.
-    @param port The manually specified port, or 0 for a random available port.
-    @return The URL containing the address of the server with the specified port, or nil if there was an error.
-    @discussion Each instance of @c OIDRedirectHTTPHandler can only listen for a single response.
-        Calling this more than once will result in the previous listener being cancelled (equivalent
-        of @c cancelHTTPListener being called).
- */
-- (NSURL *)startHTTPListener:(NSError **)returnError withPort:(uint16_t)port;
-
-/*! @brief Starts listening on the loopback interface on a random available port, and returns a URL
-        with the base address. Use the returned redirect URI to build a @c OIDExternalUserAgentRequest,
-        and once you initiate the request, set the resulting @c OIDExternalUserAgentSession to
-        @c currentAuthorizationFlow so the response can be handled.
-    @param returnError The error if an error occurred while starting the local HTTP server.
-    @return The URL containing the address of the server with the randomly assigned available port.
-    @discussion Each instance of @c OIDRedirectHTTPHandler can only listen for a single response.
-        Calling this more than once will result in the previous listener being cancelled (equivalent
-        of @c cancelHTTPListener being called).
- */
-- (NSURL *)startHTTPListener:(NSError **)returnError;
-
-/*! @brief Stops listening the loopback interface and sends an cancellation error (in the domain
-        ::OIDGeneralErrorDomain, with the code ::OIDErrorCodeProgramCanceledAuthorizationFlow) to
-        the @c currentAuthorizationFlow.  Has no effect if called when no requests are pending.
-    @discussion The HTTP listener is stopped automatically on receiving a valid response (regardless
-        of whether the request succeeded or not), this method should not be called except when
-        abandoning the external user-agent request.
- */
-- (void)cancelHTTPListener;
-
-@end
-
-NS_ASSUME_NONNULL_END
-
-#endif // TARGET_OS_OSX

+ 0 - 177
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuth/macOS/OIDRedirectHTTPHandler.m

@@ -1,177 +0,0 @@
-/*! @file OIDRedirectHTTPHandler.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2016 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <TargetConditionals.h>
-
-#if TARGET_OS_OSX
-
-#import "OIDRedirectHTTPHandler.h"
-
-#import "OIDAuthorizationService.h"
-#import "OIDErrorUtilities.h"
-#import "OIDExternalUserAgentSession.h"
-#import "OIDLoopbackHTTPServer.h"
-
-/*! @brief Page that is returned following a completed authorization. Show your own page instead by
-        supplying a URL in @c initWithSuccessURL that the user will be redirected to.
- */
-static NSString *const kHTMLAuthorizationComplete =
-    @"<html><body>Authorization complete.<br> Return to the app.</body></html>";
-
-/*! @brief Error warning that the @c currentAuthorizationFlow is not set on this object (likely a
-        developer error, unless the user stumbled upon the loopback server before the authorization
-        had started completely).
-    @description An object conforming to @c OIDExternalUserAgentSession is returned when the
-        authorization is presented with
-        @c OIDAuthorizationService::presentAuthorizationRequest:callback:. It should be set to
-        @c currentAuthorization when using a loopback redirect.
- */
-static NSString *const kHTMLErrorMissingCurrentAuthorizationFlow =
-    @"<html><body>AppAuth Error: No <code>currentAuthorizationFlow</code> is set on the "
-     "<code>OIDRedirectHTTPHandler</code>. Cannot process redirect.</body></html>";
-
-/*! @brief Error warning that the URL does not represent a valid redirect. This should be rare, may
-        happen if the user stumbles upon the loopback server randomly.
- */
-static NSString *const kHTMLErrorRedirectNotValid =
-    @"<html><body>AppAuth Error: Not a valid redirect.</body></html>";
-
-@implementation OIDRedirectHTTPHandler {
-  HTTPServer *_httpServ;
-  NSURL *_successURL;
-}
-
-- (instancetype)init {
-  return [self initWithSuccessURL:nil];
-}
-
-- (instancetype)initWithSuccessURL:(nullable NSURL *)successURL {
-  self = [super init];
-  if (self) {
-    _successURL = [successURL copy];
-  }
-  return self;
-}
-
-- (NSURL *)startHTTPListener:(NSError **)returnError withPort:(uint16_t)port {
-  // Cancels any pending requests.
-  [self cancelHTTPListener];
-
-  // Starts a HTTP server on the loopback interface.
-  // By not specifying a port, a random available one will be assigned.
-  _httpServ = [[HTTPServer alloc] init];
-  [_httpServ setPort:port];
-  [_httpServ setDelegate:self];
-  NSError *error = nil;
-  if (![_httpServ start:&error]) {
-    if (returnError) {
-      *returnError = error;
-    }
-    return nil;
-  } else if ([_httpServ hasIPv4Socket]) {
-    // Prefer the IPv4 loopback address
-    NSString *serverURL = [NSString stringWithFormat:@"http://127.0.0.1:%d/", [_httpServ port]];
-    return [NSURL URLWithString:serverURL];
-  } else if ([_httpServ hasIPv6Socket]) {
-    // Use the IPv6 loopback address if IPv4 isn't available
-    NSString *serverURL = [NSString stringWithFormat:@"http://[::1]:%d/", [_httpServ port]];
-    return [NSURL URLWithString:serverURL];
-  }
-
-  return nil;
-}
-
-- (NSURL *)startHTTPListener:(NSError **)returnError {
-  // A port of 0 requests a random available port
-  return [self startHTTPListener:returnError withPort:0];
-}
-
-- (void)cancelHTTPListener {
-  [self stopHTTPListener];
-
-  // Cancels the pending authorization flow (if any) with error.
-  NSError *cancelledError =
-      [OIDErrorUtilities errorWithCode:OIDErrorCodeProgramCanceledAuthorizationFlow
-                       underlyingError:nil
-                           description:@"The HTTP listener was cancelled programmatically."];
-  [_currentAuthorizationFlow failExternalUserAgentFlowWithError:cancelledError];
-  _currentAuthorizationFlow = nil;
-}
-
-/*! @brief Stops listening on the loopback interface without modifying the state of the
-        @c currentAuthorizationFlow. Should be called when the authorization flow completes or is
-        cancelled.
- */
-- (void)stopHTTPListener {
-  _httpServ.delegate = nil;
-  [_httpServ stop];
-  _httpServ = nil;
-}
-
-- (void)HTTPConnection:(HTTPConnection *)conn didReceiveRequest:(HTTPServerRequest *)mess {
-  // Sends URL to AppAuth.
-  CFURLRef url = CFHTTPMessageCopyRequestURL(mess.request);
-  BOOL handled = [_currentAuthorizationFlow resumeExternalUserAgentFlowWithURL:(__bridge NSURL *)url];
-
-  // Stops listening to further requests after the first valid authorization response.
-  if (handled) {
-    _currentAuthorizationFlow = nil;
-    [self stopHTTPListener];
-  }
-
-  // Responds to browser request.
-  NSString *bodyText = kHTMLAuthorizationComplete;
-  NSInteger httpResponseCode = (_successURL) ? 302 : 200;
-  // Returns an error page if a URL other than the expected redirect is requested.
-  if (!handled) {
-    if (_currentAuthorizationFlow) {
-      bodyText = kHTMLErrorRedirectNotValid;
-      httpResponseCode = 404;
-    } else {
-      bodyText = kHTMLErrorMissingCurrentAuthorizationFlow;
-      httpResponseCode = 400;
-    }
-  }
-  NSData *data = [bodyText dataUsingEncoding:NSUTF8StringEncoding];
-
-  CFHTTPMessageRef response = CFHTTPMessageCreateResponse(kCFAllocatorDefault,
-                                                          httpResponseCode,
-                                                          NULL,
-                                                          kCFHTTPVersion1_1);
-  if (httpResponseCode == 302) {
-    CFHTTPMessageSetHeaderFieldValue(response,
-                                     (__bridge CFStringRef)@"Location",
-                                     (__bridge CFStringRef)_successURL.absoluteString);
-  }
-  CFHTTPMessageSetHeaderFieldValue(response,
-                                   (__bridge CFStringRef)@"Content-Length",
-                                   (__bridge CFStringRef)[NSString stringWithFormat:@"%lu",
-                                       (unsigned long)data.length]);
-  CFHTTPMessageSetBody(response, (__bridge CFDataRef)data);
-
-  [mess setResponse:response];
-  CFRelease(response);
-}
-
-- (void)dealloc {
-  [self cancelHTTPListener];
-}
-
-@end
-
-#endif // TARGET_OS_OSX

+ 0 - 44
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore.h

@@ -1,44 +0,0 @@
-/*! @file AppAuthCore.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDAuthState.h"
-#import "OIDAuthStateChangeDelegate.h"
-#import "OIDAuthStateErrorDelegate.h"
-#import "OIDAuthorizationRequest.h"
-#import "OIDAuthorizationResponse.h"
-#import "OIDAuthorizationService.h"
-#import "OIDError.h"
-#import "OIDErrorUtilities.h"
-#import "OIDExternalUserAgent.h"
-#import "OIDExternalUserAgentRequest.h"
-#import "OIDExternalUserAgentSession.h"
-#import "OIDGrantTypes.h"
-#import "OIDIDToken.h"
-#import "OIDRegistrationRequest.h"
-#import "OIDRegistrationResponse.h"
-#import "OIDResponseTypes.h"
-#import "OIDScopes.h"
-#import "OIDScopeUtilities.h"
-#import "OIDServiceConfiguration.h"
-#import "OIDServiceDiscovery.h"
-#import "OIDTokenRequest.h"
-#import "OIDTokenResponse.h"
-#import "OIDTokenUtilities.h"
-#import "OIDURLSessionProvider.h"
-#import "OIDEndSessionRequest.h"
-#import "OIDEndSessionResponse.h"

+ 0 - 272
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDAuthState.h

@@ -1,272 +0,0 @@
-/*! @file OIDAuthState.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-#import <Foundation/Foundation.h>
-
-@class OIDAuthorizationRequest;
-@class OIDAuthorizationResponse;
-@class OIDAuthState;
-@class OIDRegistrationResponse;
-@class OIDTokenResponse;
-@class OIDTokenRequest;
-@protocol OIDAuthStateChangeDelegate;
-@protocol OIDAuthStateErrorDelegate;
-@protocol OIDExternalUserAgent;
-@protocol OIDExternalUserAgentSession;
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief Represents a block used to call an action with a fresh access token.
-    @param accessToken A valid access token if available.
-    @param idToken A valid ID token if available.
-    @param error The error if an error occurred.
- */
-typedef void (^OIDAuthStateAction)(NSString *_Nullable accessToken,
-                                   NSString *_Nullable idToken,
-                                   NSError *_Nullable error);
-
-/*! @brief The method called when the @c
-        OIDAuthState.authStateByPresentingAuthorizationRequest:presentingViewController:callback:
-        method has completed or failed.
-    @param authState The auth state, if the authorization request succeeded.
-    @param error The error if an error occurred.
- */
-typedef void (^OIDAuthStateAuthorizationCallback)(OIDAuthState *_Nullable authState,
-                                                  NSError *_Nullable error);
-
-/*! @brief A convenience class that retains the auth state between @c OIDAuthorizationResponse%s
-        and @c OIDTokenResponse%s.
- */
-@interface OIDAuthState : NSObject <NSSecureCoding>
-
-/*! @brief The most recent refresh token received from the server.
-    @discussion Rather than using this property directly, you should call
-        @c OIDAuthState.performActionWithFreshTokens:.
-    @remarks refresh_token
-    @see https://tools.ietf.org/html/rfc6749#section-5.1
- */
-@property(nonatomic, readonly, nullable) NSString *refreshToken;
-
-/*! @brief The scope of the current authorization grant.
-    @discussion This represents the latest scope returned by the server and may be a subset of the
-        scope that was initially granted.
-    @remarks scope
- */
-@property(nonatomic, readonly, nullable) NSString *scope;
-
-/*! @brief The most recent authorization response used to update the authorization state. For the
-        implicit flow, this will contain the latest access token.
- */
-@property(nonatomic, readonly) OIDAuthorizationResponse *lastAuthorizationResponse;
-
-/*! @brief The most recent token response used to update this authorization state. This will
-        contain the latest access token.
- */
-@property(nonatomic, readonly, nullable) OIDTokenResponse *lastTokenResponse;
-
-/*! @brief The most recent registration response used to update this authorization state. This will
-        contain the latest client credentials.
- */
-@property(nonatomic, readonly, nullable) OIDRegistrationResponse *lastRegistrationResponse;
-
-/*! @brief The authorization error that invalidated this @c OIDAuthState.
-    @discussion The authorization error encountered by @c OIDAuthState or set by the user via
-        @c OIDAuthState.updateWithAuthorizationError: that invalidated this @c OIDAuthState.
-        Authorization errors from @c OIDAuthState will always have a domain of
-        @c ::OIDOAuthAuthorizationErrorDomain or @c ::OIDOAuthTokenErrorDomain. Note: that after
-        unarchiving the @c OIDAuthState object, the \NSError_userInfo property of this error will
-        be nil.
- */
-@property(nonatomic, readonly, nullable) NSError *authorizationError;
-
-/*! @brief Returns YES if the authorization state is not known to be invalid.
-    @discussion Returns YES if no OAuth errors have been received, and the last call resulted in a
-        successful access token or id token. This does not mean that the access is fresh - just
-        that it was valid the last time it was used. Note that network and other transient errors
-        do not invalidate the authorized state.  If NO, you should authenticate the user again,
-        using a fresh authorization request. Invalid @c OIDAuthState objects may still be useful in
-        that case, to hint at the previously authorized user and streamline the re-authentication
-        experience.
- */
-@property(nonatomic, readonly) BOOL isAuthorized;
-
-/*! @brief The @c OIDAuthStateChangeDelegate delegate.
-    @discussion Use the delegate to observe state changes (and update storage) as well as error
-        states.
- */
-@property(nonatomic, weak, nullable) id<OIDAuthStateChangeDelegate> stateChangeDelegate;
-
-/*! @brief The @c OIDAuthStateErrorDelegate delegate.
-    @discussion Use the delegate to observe state changes (and update storage) as well as error
-        states.
- */
-@property(nonatomic, weak, nullable) id<OIDAuthStateErrorDelegate> errorDelegate;
-
-/*! @brief Convenience method to create a @c OIDAuthState by presenting an authorization request
-        and performing the authorization code exchange in the case of code flow requests. For
-        the hybrid flow, the caller should validate the id_token and c_hash, then perform the token
-        request (@c OIDAuthorizationService.performTokenRequest:callback:)
-        and update the OIDAuthState with the results (@c
-        OIDAuthState.updateWithTokenResponse:error:).
-    @param authorizationRequest The authorization request to present.
-    @param externalUserAgent A external user agent that can present an external user-agent request.
-    @param callback The method called when the request has completed or failed.
-    @return A @c OIDExternalUserAgentSession instance which will terminate when it
-        receives a @c OIDExternalUserAgentSession.cancel message, or after processing a
-        @c OIDExternalUserAgentSession.resumeExternalUserAgentFlowWithURL: message.
- */
-+ (id<OIDExternalUserAgentSession>)
-    authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest
-                            externalUserAgent:(id<OIDExternalUserAgent>)externalUserAgent
-                                     callback:(OIDAuthStateAuthorizationCallback)callback;
-
-/*! @internal
-    @brief Unavailable. Please use @c initWithAuthorizationResponse:.
- */
-- (instancetype)init NS_UNAVAILABLE;
-
-/*! @brief Creates an auth state from an authorization response.
-    @param authorizationResponse The authorization response.
- */
-- (instancetype)initWithAuthorizationResponse:(OIDAuthorizationResponse *)authorizationResponse;
-
-/*! @brief Creates an auth state from an authorization and token response.
-    @param authorizationResponse The authorization response.
-    @param tokenResponse The token response.
- */
-- (instancetype)initWithAuthorizationResponse:(OIDAuthorizationResponse *)authorizationResponse
-                                tokenResponse:(nullable OIDTokenResponse *)tokenResponse;
-
-/*! @brief Creates an auth state from an registration response.
-    @param registrationResponse The registration response.
- */
-- (instancetype)initWithRegistrationResponse:(OIDRegistrationResponse *)registrationResponse;
-
-/*! @brief Creates an auth state from an authorization, token and registration response.
-    @param authorizationResponse The authorization response.
-    @param tokenResponse The token response.
-    @param registrationResponse The registration response.
- */
-- (instancetype)initWithAuthorizationResponse:
-    (nullable OIDAuthorizationResponse *)authorizationResponse
-           tokenResponse:(nullable OIDTokenResponse *)tokenResponse
-    registrationResponse:(nullable OIDRegistrationResponse *)registrationResponse
-    NS_DESIGNATED_INITIALIZER;
-
-/*! @brief Updates the authorization state based on a new authorization response.
-    @param authorizationResponse The new authorization response to update the state with.
-    @param error Any error encountered when performing the authorization request. Errors in the
-        domain @c ::OIDOAuthAuthorizationErrorDomain are reflected in the auth state, other errors
-        are assumed to be transient, and ignored.
-    @discussion Typically called with the response from an incremental authorization request,
-        or if using the implicit flow. Will clear the @c #lastTokenResponse property.
- */
-- (void)updateWithAuthorizationResponse:(nullable OIDAuthorizationResponse *)authorizationResponse
-                                  error:(nullable NSError *)error;
-
-/*! @brief Updates the authorization state based on a new token response.
-    @param tokenResponse The new token response to update the state from.
-    @param error Any error encountered when performing the authorization request. Errors in the
-        domain @c ::OIDOAuthTokenErrorDomain are reflected in the auth state, other errors
-        are assumed to be transient, and ignored.
-    @discussion Typically called with the response from an authorization code exchange, or a token
-        refresh.
- */
-- (void)updateWithTokenResponse:(nullable OIDTokenResponse *)tokenResponse
-                          error:(nullable NSError *)error;
-
-/*! @brief Updates the authorization state based on a new registration response.
-    @param registrationResponse The new registration response to update the state with.
-    @discussion Typically called with the response from a successful client registration
-        request. Will reset the auth state.
- */
-- (void)updateWithRegistrationResponse:(nullable OIDRegistrationResponse *)registrationResponse;
-
-/*! @brief Updates the authorization state based on an authorization error.
-    @param authorizationError The authorization error.
-    @discussion Call this method if you receive an authorization error during an API call to
-        invalidate the authentication state of this @c OIDAuthState. Don't call with errors
-        unrelated to authorization, such as transient network errors.
-        The OIDAuthStateErrorDelegate.authState:didEncounterAuthorizationError: method of
-        @c #errorDelegate will be called with the error.
-        You may optionally use the convenience method
-        OIDErrorUtilities.resourceServerAuthorizationErrorWithCode:errorResponse:underlyingError:
-        to create \NSError objects for use here.
-        The latest error received is stored in @c #authorizationError. Note: that after unarchiving
-        this object, the \NSError_userInfo property of this error will be nil.
- */
-- (void)updateWithAuthorizationError:(NSError *)authorizationError;
-
-/*! @brief Calls the block with a valid access token (refreshing it first, if needed), or if a
-        refresh was needed and failed, with the error that caused it to fail.
-    @param action The block to execute with a fresh token. This block will be executed on the main
-        thread.
- */
-- (void)performActionWithFreshTokens:(OIDAuthStateAction)action;
-
-/*! @brief Calls the block with a valid access token (refreshing it first, if needed), or if a
-        refresh was needed and failed, with the error that caused it to fail.
-    @param action The block to execute with a fresh token. This block will be executed on the main
-        thread.
-    @param additionalParameters Additional parameters for the token request if token is
-        refreshed.
- */
-- (void)performActionWithFreshTokens:(OIDAuthStateAction)action
-         additionalRefreshParameters:
-    (nullable NSDictionary<NSString *, NSString *> *)additionalParameters;
-
-/*! @brief Calls the block with a valid access token (refreshing it first, if needed), or if a
-        refresh was needed and failed, with the error that caused it to fail.
-    @param action The block to execute with a fresh token. This block will be executed on the main
-        thread.
-    @param additionalParameters Additional parameters for the token request if token is
-        refreshed.
-    @param dispatchQueue The dispatchQueue on which to dispatch the action block.
- */
-- (void)performActionWithFreshTokens:(OIDAuthStateAction)action
-         additionalRefreshParameters:
-    (nullable NSDictionary<NSString *, NSString *> *)additionalParameters
-                       dispatchQueue:(dispatch_queue_t)dispatchQueue;
-
-/*! @brief Forces a token refresh the next time @c OIDAuthState.performActionWithFreshTokens: is
-        called, even if the current tokens are considered valid.
- */
-- (void)setNeedsTokenRefresh;
-
-/*! @brief Creates a token request suitable for refreshing an access token.
-    @return A @c OIDTokenRequest suitable for using a refresh token to obtain a new access token.
-    @discussion After performing the refresh, call @c OIDAuthState.updateWithTokenResponse:error:
-        to update the authorization state based on the response. Rather than doing the token refresh
-        yourself, you should use @c OIDAuthState.performActionWithFreshTokens:.
-    @see https://tools.ietf.org/html/rfc6749#section-1.5
- */
-- (nullable OIDTokenRequest *)tokenRefreshRequest;
-
-/*! @brief Creates a token request suitable for refreshing an access token.
-    @param additionalParameters Additional parameters for the token request.
-    @return A @c OIDTokenRequest suitable for using a refresh token to obtain a new access token.
-    @discussion After performing the refresh, call @c OIDAuthState.updateWithTokenResponse:error:
-        to update the authorization state based on the response. Rather than doing the token refresh
-        yourself, you should use @c OIDAuthState.performActionWithFreshTokens:.
-    @see https://tools.ietf.org/html/rfc6749#section-1.5
- */
-- (nullable OIDTokenRequest *)tokenRefreshRequestWithAdditionalParameters:
-    (nullable NSDictionary<NSString *, NSString *> *)additionalParameters;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 570
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDAuthState.m

@@ -1,570 +0,0 @@
-/*! @file OIDAuthState.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDAuthState.h"
-
-#import "OIDAuthStateChangeDelegate.h"
-#import "OIDAuthStateErrorDelegate.h"
-#import "OIDAuthorizationRequest.h"
-#import "OIDAuthorizationResponse.h"
-#import "OIDAuthorizationService.h"
-#import "OIDDefines.h"
-#import "OIDError.h"
-#import "OIDErrorUtilities.h"
-#import "OIDRegistrationResponse.h"
-#import "OIDTokenRequest.h"
-#import "OIDTokenResponse.h"
-#import "OIDTokenUtilities.h"
-
-/*! @brief Key used to encode the @c refreshToken property for @c NSSecureCoding.
- */
-static NSString *const kRefreshTokenKey = @"refreshToken";
-
-/*! @brief Key used to encode the @c needsTokenRefresh property for @c NSSecureCoding.
- */
-static NSString *const kNeedsTokenRefreshKey = @"needsTokenRefresh";
-
-/*! @brief Key used to encode the @c scope property for @c NSSecureCoding.
- */
-static NSString *const kScopeKey = @"scope";
-
-/*! @brief Key used to encode the @c lastAuthorizationResponse property for @c NSSecureCoding.
- */
-static NSString *const kLastAuthorizationResponseKey = @"lastAuthorizationResponse";
-
-/*! @brief Key used to encode the @c lastTokenResponse property for @c NSSecureCoding.
- */
-static NSString *const kLastTokenResponseKey = @"lastTokenResponse";
-
-/*! @brief Key used to encode the @c lastOAuthError property for @c NSSecureCoding.
- */
-static NSString *const kAuthorizationErrorKey = @"authorizationError";
-
-/*! @brief The exception thrown when a developer tries to create a refresh request from an
-        authorization request with no authorization code.
- */
-static NSString *const kRefreshTokenRequestException =
-    @"Attempted to create a token refresh request from a token response with no refresh token.";
-
-/*! @brief Number of seconds the access token is refreshed before it actually expires.
- */
-static const NSUInteger kExpiryTimeTolerance = 60;
-
-/*! @brief Object to hold OIDAuthState pending actions.
- */
-@interface OIDAuthStatePendingAction : NSObject
-@property(nonatomic, readonly, nullable) OIDAuthStateAction action;
-@property(nonatomic, readonly, nullable) dispatch_queue_t dispatchQueue;
-@end
-@implementation OIDAuthStatePendingAction
-- (id)initWithAction:(OIDAuthStateAction)action andDispatchQueue:(dispatch_queue_t)dispatchQueue {
-  self = [super init];
-  if (self) {
-    _action = action;
-    _dispatchQueue = dispatchQueue;
-  }
-  return self;
-}
-@end
-
-@interface OIDAuthState ()
-
-/*! @brief The access token generated by the authorization server.
-    @discussion Rather than using this property directly, you should call
-        @c OIDAuthState.withFreshTokenPerformAction:.
- */
-@property(nonatomic, readonly, nullable) NSString *accessToken;
-
-/*! @brief The approximate expiration date & time of the access token.
-    @discussion Rather than using this property directly, you should call
-        @c OIDAuthState.withFreshTokenPerformAction:.
- */
-@property(nonatomic, readonly, nullable) NSDate *accessTokenExpirationDate;
-
-/*! @brief ID Token value associated with the authenticated session.
-    @discussion Rather than using this property directly, you should call
-        OIDAuthState.withFreshTokenPerformAction:.
- */
-@property(nonatomic, readonly, nullable) NSString *idToken;
-
-/*! @brief Private method, called when the internal state changes.
- */
-- (void)didChangeState;
-
-@end
-
-
-@implementation OIDAuthState {
-  /*! @brief Array of pending actions (use @c _pendingActionsSyncObject to synchronize access).
-   */
-  NSMutableArray *_pendingActions;
-
-  /*! @brief Object for synchronizing access to @c pendingActions.
-   */
-  id _pendingActionsSyncObject;
-
-  /*! @brief If YES, tokens will be refreshed on the next API call regardless of expiry.
-   */
-  BOOL _needsTokenRefresh;
-}
-
-#pragma mark - Convenience initializers
-
-+ (id<OIDExternalUserAgentSession>)
-    authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest
-                            externalUserAgent:(id<OIDExternalUserAgent>)externalUserAgent
-                                     callback:(OIDAuthStateAuthorizationCallback)callback {
-  // presents the authorization request
-  id<OIDExternalUserAgentSession> authFlowSession = [OIDAuthorizationService
-      presentAuthorizationRequest:authorizationRequest
-                externalUserAgent:externalUserAgent
-                         callback:^(OIDAuthorizationResponse *_Nullable authorizationResponse,
-                                    NSError *_Nullable authorizationError) {
-                           // inspects response and processes further if needed (e.g. authorization
-                           // code exchange)
-                           if (authorizationResponse) {
-                             if ([authorizationRequest.responseType
-                                     isEqualToString:OIDResponseTypeCode]) {
-                               // if the request is for the code flow (NB. not hybrid), assumes the
-                               // code is intended for this client, and performs the authorization
-                               // code exchange
-                               OIDTokenRequest *tokenExchangeRequest =
-                                   [authorizationResponse tokenExchangeRequest];
-                               [OIDAuthorizationService performTokenRequest:tokenExchangeRequest
-                                              originalAuthorizationResponse:authorizationResponse
-                                   callback:^(OIDTokenResponse *_Nullable tokenResponse,
-                                                         NSError *_Nullable tokenError) {
-                                                OIDAuthState *authState;
-                                                if (tokenResponse) {
-                                                  authState = [[OIDAuthState alloc]
-                                                      initWithAuthorizationResponse:
-                                                          authorizationResponse
-                                                                      tokenResponse:tokenResponse];
-                                                }
-                                                callback(authState, tokenError);
-                               }];
-                             } else {
-                               // hybrid flow (code id_token). Two possible cases:
-                               // 1. The code is not for this client, ie. will be sent to a
-                               //    webservice that performs the id token verification and token
-                               //    exchange
-                               // 2. The code is for this client and, for security reasons, the
-                               //    application developer must verify the id_token signature and
-                               //    c_hash before calling the token endpoint
-                               OIDAuthState *authState = [[OIDAuthState alloc]
-                                   initWithAuthorizationResponse:authorizationResponse];
-                               callback(authState, authorizationError);
-                             }
-                           } else {
-                             callback(nil, authorizationError);
-                           }
-                         }];
-  return authFlowSession;
-}
-
-#pragma mark - Initializers
-
-- (nonnull instancetype)init
-    OID_UNAVAILABLE_USE_INITIALIZER(@selector(initWithAuthorizationResponse:tokenResponse:))
-
-/*! @brief Creates an auth state from an authorization response.
-    @param authorizationResponse The authorization response.
- */
-- (instancetype)initWithAuthorizationResponse:(OIDAuthorizationResponse *)authorizationResponse {
-  return [self initWithAuthorizationResponse:authorizationResponse tokenResponse:nil];
-}
-
-
-/*! @brief Designated initializer.
-    @param authorizationResponse The authorization response.
-    @discussion Creates an auth state from an authorization response and token response.
- */
-- (instancetype)initWithAuthorizationResponse:(OIDAuthorizationResponse *)authorizationResponse
-                                         tokenResponse:(nullable OIDTokenResponse *)tokenResponse {
-  return [self initWithAuthorizationResponse:authorizationResponse
-                               tokenResponse:tokenResponse
-                        registrationResponse:nil];
-}
-
-/*! @brief Creates an auth state from an registration response.
-    @param registrationResponse The registration response.
- */
-- (instancetype)initWithRegistrationResponse:(OIDRegistrationResponse *)registrationResponse {
-  return [self initWithAuthorizationResponse:nil
-                               tokenResponse:nil
-                        registrationResponse:registrationResponse];
-}
-
-- (instancetype)initWithAuthorizationResponse:
-    (nullable OIDAuthorizationResponse *)authorizationResponse
-           tokenResponse:(nullable OIDTokenResponse *)tokenResponse
-    registrationResponse:(nullable OIDRegistrationResponse *)registrationResponse {
-  self = [super init];
-  if (self) {
-    _pendingActionsSyncObject = [[NSObject alloc] init];
-
-    if (registrationResponse) {
-      [self updateWithRegistrationResponse:registrationResponse];
-    }
-
-    if (authorizationResponse) {
-      [self updateWithAuthorizationResponse:authorizationResponse error:nil];
-    }
-
-    if (tokenResponse) {
-      [self updateWithTokenResponse:tokenResponse error:nil];
-    }
-  }
-  return self;
-}
-
-#pragma mark - NSObject overrides
-
-- (NSString *)description {
-  return [NSString stringWithFormat:@"<%@: %p, isAuthorized: %@, refreshToken: \"%@\", "
-                                     "scope: \"%@\", accessToken: \"%@\", "
-                                     "accessTokenExpirationDate: %@, idToken: \"%@\", "
-                                     "lastAuthorizationResponse: %@, lastTokenResponse: %@, "
-                                     "lastRegistrationResponse: %@, authorizationError: %@>",
-                                    NSStringFromClass([self class]),
-                                    (void *)self,
-                                    (self.isAuthorized) ? @"YES" : @"NO",
-                                    [OIDTokenUtilities redact:_refreshToken],
-                                    _scope,
-                                    [OIDTokenUtilities redact:self.accessToken],
-                                    self.accessTokenExpirationDate,
-                                    [OIDTokenUtilities redact:self.idToken],
-                                    _lastAuthorizationResponse,
-                                    _lastTokenResponse,
-                                    _lastRegistrationResponse,
-                                    _authorizationError];
-}
-
-#pragma mark - NSSecureCoding
-
-+ (BOOL)supportsSecureCoding {
-  return YES;
-}
-
-- (instancetype)initWithCoder:(NSCoder *)aDecoder {
-  _lastAuthorizationResponse = [aDecoder decodeObjectOfClass:[OIDAuthorizationResponse class]
-                                                      forKey:kLastAuthorizationResponseKey];
-  _lastTokenResponse = [aDecoder decodeObjectOfClass:[OIDTokenResponse class]
-                                              forKey:kLastTokenResponseKey];
-  self = [self initWithAuthorizationResponse:_lastAuthorizationResponse
-                               tokenResponse:_lastTokenResponse];
-  if (self) {
-    _authorizationError =
-        [aDecoder decodeObjectOfClass:[NSError class] forKey:kAuthorizationErrorKey];
-    _scope = [aDecoder decodeObjectOfClass:[NSString class] forKey:kScopeKey];
-    _refreshToken = [aDecoder decodeObjectOfClass:[NSString class] forKey:kRefreshTokenKey];
-    _needsTokenRefresh = [aDecoder decodeBoolForKey:kNeedsTokenRefreshKey];
-  }
-  return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)aCoder {
-  [aCoder encodeObject:_lastAuthorizationResponse forKey:kLastAuthorizationResponseKey];
-  [aCoder encodeObject:_lastTokenResponse forKey:kLastTokenResponseKey];
-  if (_authorizationError) {
-    NSError *codingSafeAuthorizationError = [NSError errorWithDomain:_authorizationError.domain
-                                                                code:_authorizationError.code
-                                                            userInfo:nil];
-    [aCoder encodeObject:codingSafeAuthorizationError forKey:kAuthorizationErrorKey];
-  }
-  [aCoder encodeObject:_scope forKey:kScopeKey];
-  [aCoder encodeObject:_refreshToken forKey:kRefreshTokenKey];
-  [aCoder encodeBool:_needsTokenRefresh forKey:kNeedsTokenRefreshKey];
-}
-
-#pragma mark - Private convenience getters
-
-- (NSString *)accessToken {
-  if (_authorizationError) {
-    return nil;
-  }
-  return _lastTokenResponse ? _lastTokenResponse.accessToken
-                            : _lastAuthorizationResponse.accessToken;
-}
-
-- (NSString *)tokenType {
-  if (_authorizationError) {
-    return nil;
-  }
-  return _lastTokenResponse ? _lastTokenResponse.tokenType
-                            : _lastAuthorizationResponse.tokenType;
-}
-
-- (NSDate *)accessTokenExpirationDate {
-  if (_authorizationError) {
-    return nil;
-  }
-  return _lastTokenResponse ? _lastTokenResponse.accessTokenExpirationDate
-                            : _lastAuthorizationResponse.accessTokenExpirationDate;
-}
-
-- (NSString *)idToken {
-  if (_authorizationError) {
-    return nil;
-  }
-  return _lastTokenResponse ? _lastTokenResponse.idToken
-                            : _lastAuthorizationResponse.idToken;
-}
-
-#pragma mark - Getters
-
-- (BOOL)isAuthorized {
-  return !self.authorizationError && (self.accessToken || self.idToken || self.refreshToken);
-}
-
-#pragma mark - Updating the state
-
-- (void)updateWithRegistrationResponse:(OIDRegistrationResponse *)registrationResponse {
-  _lastRegistrationResponse = registrationResponse;
-  _refreshToken = nil;
-  _scope = nil;
-  _lastAuthorizationResponse = nil;
-  _lastTokenResponse = nil;
-  _authorizationError = nil;
-  [self didChangeState];
-}
-
-- (void)updateWithAuthorizationResponse:(nullable OIDAuthorizationResponse *)authorizationResponse
-                                  error:(nullable NSError *)error {
-  // If the error is an OAuth authorization error, updates the state. Other errors are ignored.
-  if (error.domain == OIDOAuthAuthorizationErrorDomain) {
-    [self updateWithAuthorizationError:error];
-    return;
-  }
-  if (!authorizationResponse) {
-    return;
-  }
-
-  _lastAuthorizationResponse = authorizationResponse;
-
-  // clears the last token response and refresh token as these now relate to an old authorization
-  // that is no longer relevant
-  _lastTokenResponse = nil;
-  _refreshToken = nil;
-  _authorizationError = nil;
-
-  // if the response's scope is nil, it means that it equals that of the request
-  // see: https://tools.ietf.org/html/rfc6749#section-5.1
-  _scope = (authorizationResponse.scope) ? authorizationResponse.scope
-                                         : authorizationResponse.request.scope;
-
-  [self didChangeState];
-}
-
-- (void)updateWithTokenResponse:(nullable OIDTokenResponse *)tokenResponse
-                          error:(nullable NSError *)error {
-  if (_authorizationError) {
-    // Calling updateWithTokenResponse while in an error state probably means the developer obtained
-    // a new token and did the exchange without also calling updateWithAuthorizationResponse.
-    // Attempts to handle gracefully, but warns the developer that this is unexpected.
-    NSLog(@"OIDAuthState:updateWithTokenResponse should not be called in an error state [%@] call"
-         "updateWithAuthorizationResponse with the result of the fresh authorization response"
-         "first",
-         _authorizationError);
-
-    _authorizationError = nil;
-  }
-
-  // If the error is an OAuth authorization error, updates the state. Other errors are ignored.
-  if (error.domain == OIDOAuthTokenErrorDomain) {
-    [self updateWithAuthorizationError:error];
-    return;
-  }
-  if (!tokenResponse) {
-    return;
-  }
-
-  _lastTokenResponse = tokenResponse;
-
-  // updates the scope and refresh token if they are present on the TokenResponse.
-  // according to the spec, these may be changed by the server, including when refreshing the
-  // access token. See: https://tools.ietf.org/html/rfc6749#section-5.1 and
-  // https://tools.ietf.org/html/rfc6749#section-6
-  if (tokenResponse.scope) {
-    _scope = tokenResponse.scope;
-  }
-  if (tokenResponse.refreshToken) {
-    _refreshToken = tokenResponse.refreshToken;
-  }
-
-  [self didChangeState];
-}
-
-- (void)updateWithAuthorizationError:(NSError *)oauthError {
-  _authorizationError = oauthError;
-
-  [self didChangeState];
-
-  [_errorDelegate authState:self didEncounterAuthorizationError:oauthError];
-}
-
-#pragma mark - OAuth Requests
-
-- (OIDTokenRequest *)tokenRefreshRequest {
-  return [self tokenRefreshRequestWithAdditionalParameters:nil];
-}
-
-- (OIDTokenRequest *)tokenRefreshRequestWithAdditionalParameters:
-    (NSDictionary<NSString *, NSString *> *)additionalParameters {
-
-  // TODO: Add unit test to confirm exception is thrown when expected
-
-  if (!_refreshToken) {
-    [OIDErrorUtilities raiseException:kRefreshTokenRequestException];
-  }
-  return [[OIDTokenRequest alloc]
-      initWithConfiguration:_lastAuthorizationResponse.request.configuration
-                  grantType:OIDGrantTypeRefreshToken
-          authorizationCode:nil
-                redirectURL:nil
-                   clientID:_lastAuthorizationResponse.request.clientID
-               clientSecret:_lastAuthorizationResponse.request.clientSecret
-                      scope:nil
-               refreshToken:_refreshToken
-               codeVerifier:nil
-       additionalParameters:additionalParameters];
-}
-
-#pragma mark - Stateful Actions
-
-- (void)didChangeState {
-  [_stateChangeDelegate didChangeState:self];
-}
-
-- (void)setNeedsTokenRefresh {
-  _needsTokenRefresh = YES;
-}
-
-- (void)performActionWithFreshTokens:(OIDAuthStateAction)action {
-  [self performActionWithFreshTokens:action additionalRefreshParameters:nil];
-}
-
-- (void)performActionWithFreshTokens:(OIDAuthStateAction)action
-         additionalRefreshParameters:
-    (nullable NSDictionary<NSString *, NSString *> *)additionalParameters {
-  [self performActionWithFreshTokens:action
-         additionalRefreshParameters:additionalParameters
-                       dispatchQueue:dispatch_get_main_queue()];
-}
-
-- (void)performActionWithFreshTokens:(OIDAuthStateAction)action
-         additionalRefreshParameters:
-    (nullable NSDictionary<NSString *, NSString *> *)additionalParameters
-                       dispatchQueue:(dispatch_queue_t)dispatchQueue {
-
-  if ([self isTokenFresh]) {
-    // access token is valid within tolerance levels, perform action
-    dispatch_async(dispatchQueue, ^{
-      action(self.accessToken, self.idToken, nil);
-    });
-    return;
-  }
-
-  if (!_refreshToken) {
-    // no refresh token available and token has expired
-    NSError *tokenRefreshError = [
-      OIDErrorUtilities errorWithCode:OIDErrorCodeTokenRefreshError
-                      underlyingError:nil
-                          description:@"Unable to refresh expired token without a refresh token."];
-    dispatch_async(dispatchQueue, ^{
-        action(nil, nil, tokenRefreshError);
-    });
-    return;
-  }
-
-  // access token is expired, first refresh the token, then perform action
-  NSAssert(_pendingActionsSyncObject, @"_pendingActionsSyncObject cannot be nil", @"");
-  OIDAuthStatePendingAction* pendingAction =
-      [[OIDAuthStatePendingAction alloc] initWithAction:action andDispatchQueue:dispatchQueue];
-  @synchronized(_pendingActionsSyncObject) {
-    // if a token is already in the process of being refreshed, adds to pending actions
-    if (_pendingActions) {
-      [_pendingActions addObject:pendingAction];
-      return;
-    }
-
-    // creates a list of pending actions, starting with this one
-    _pendingActions = [NSMutableArray arrayWithObject:pendingAction];
-  }
-
-  // refresh the tokens
-  OIDTokenRequest *tokenRefreshRequest =
-      [self tokenRefreshRequestWithAdditionalParameters:additionalParameters];
-  [OIDAuthorizationService performTokenRequest:tokenRefreshRequest
-                 originalAuthorizationResponse:_lastAuthorizationResponse
-                                      callback:^(OIDTokenResponse *_Nullable response,
-                                                 NSError *_Nullable error) {
-    // update OIDAuthState based on response
-    if (response) {
-      self->_needsTokenRefresh = NO;
-      [self updateWithTokenResponse:response error:nil];
-    } else {
-      if (error.domain == OIDOAuthTokenErrorDomain) {
-        self->_needsTokenRefresh = NO;
-        [self updateWithAuthorizationError:error];
-      } else {
-        if ([self->_errorDelegate respondsToSelector:
-            @selector(authState:didEncounterTransientError:)]) {
-          [self->_errorDelegate authState:self didEncounterTransientError:error];
-        }
-      }
-    }
-
-    // nil the pending queue and process everything that was queued up
-    NSArray *actionsToProcess;
-    @synchronized(self->_pendingActionsSyncObject) {
-      actionsToProcess = self->_pendingActions;
-      self->_pendingActions = nil;
-    }
-    for (OIDAuthStatePendingAction* actionToProcess in actionsToProcess) {
-      dispatch_async(actionToProcess.dispatchQueue, ^{
-        actionToProcess.action(self.accessToken, self.idToken, error);
-      });
-    }
-  }];
-}
-
-#pragma mark -
-
-/*! @fn isTokenFresh
-    @brief Determines whether a token refresh request must be made to refresh the tokens.
- */
-- (BOOL)isTokenFresh {
-  if (_needsTokenRefresh) {
-    // forced refresh
-    return NO;
-  }
-
-  if (!self.accessTokenExpirationDate) {
-    // if there is no expiration time but we have an access token, it is assumed to never expire
-    return !!self.accessToken;
-  }
-
-  // has the token expired?
-  BOOL tokenFresh = [self.accessTokenExpirationDate timeIntervalSinceNow] > kExpiryTimeTolerance;
-  return tokenFresh;
-}
-
-@end
-
-

+ 0 - 39
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDAuthStateChangeDelegate.h

@@ -1,39 +0,0 @@
-/*! @file OIDAuthStateChangeDelegate.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <Foundation/Foundation.h>
-
-@class OIDAuthState;
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @protocol OIDAuthStateChangeDelegate
-    @brief Delegate of the OIDAuthState used to monitor various changes in state.
- */
-@protocol OIDAuthStateChangeDelegate <NSObject>
-
-/*! @brief Called when the authorization state changes and any backing storage needs to be updated.
-    @param state The @c OIDAuthState that changed.
-    @discussion If you are storing the authorization state, you should update the storage when the
-        state changes.
- */
-- (void)didChangeState:(OIDAuthState *)state;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 62
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDAuthStateErrorDelegate.h

@@ -1,62 +0,0 @@
-/*! @file OIDAuthStateErrorDelegate.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <Foundation/Foundation.h>
-
-@class OIDAuthState;
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @protocol OIDAuthStateErrorDelegate
-    @brief Delegate of the OIDAuthState used to monitor errors.
- */
-@protocol OIDAuthStateErrorDelegate <NSObject>
-
-/*! @brief Called when an authentication occurs, which indicates the auth session is invalid.
-    @param state The @c OIDAuthState on which the error occurred.
-    @param error The authorization error.
-    @discussion This is a hard error (not a transient network issue) that indicates a problem with
-        the authorization. You should stop using the @c OIDAuthState when such an error is
-        encountered. If the \NSError_code is @c ::OIDErrorCodeOAuthInvalidGrant then
-        the session may be recoverable with user interaction (i.e. re-authentication). In all cases
-        you should consider the user unauthorized, and remove locally cached resources that require
-        that authorization.  @c OIDAuthState will call this method automatically if it encounters
-        an OAuth error (that is, an HTTP 400 response with a valid OAuth error response) during
-        authorization or token refresh (such as performed automatically when using
-        @c OIDAuthState.performActionWithFreshTokens:). You can signal authorization errors with
-        @c OIDAuthState.updateWithAuthorizationError:.
-    @see https://tools.ietf.org/html/rfc6749#section-5.2
- */
-- (void)authState:(OIDAuthState *)state didEncounterAuthorizationError:(NSError *)error;
-
-@optional
-
-/*! @brief Called when a network or other transient error occurs.
-    @param state The @c OIDAuthState on which the error occurred.
-    @param error The transient error.
-    @discussion This is a soft error, typically network related. The @c OIDAuthState is likely
-        still valid, and should not be discarded. Retry the request using an incremental backoff
-        strategy. This is only called when using the @c OIDAuthState convenience methods such as
-        @c OIDAuthState.performActionWithFreshTokens:. If you are refreshing the tokens yourself
-        outside of @c OIDAuthState class, it will never be called.
- */
-- (void)authState:(OIDAuthState *)state didEncounterTransientError:(NSError *)error;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 250
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDAuthorizationRequest.h

@@ -1,250 +0,0 @@
-/*! @file OIDAuthorizationRequest.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <Foundation/Foundation.h>
-
-// These files only declare string constants useful for constructing a @c OIDAuthorizationRequest,
-// so they are imported here for convenience.
-#import "OIDExternalUserAgentRequest.h"
-#import "OIDResponseTypes.h"
-#import "OIDScopes.h"
-
-@class OIDServiceConfiguration;
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief The @c code_challenge_method  value for the S256 code challenge.
-    @see https://tools.ietf.org/html/rfc7636#section-4.3
- */
-extern NSString *const OIDOAuthorizationRequestCodeChallengeMethodS256;
-
-
-/*! @brief Represents an authorization request.
-    @see https://tools.ietf.org/html/rfc6749#section-4
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.1
- */
-@interface OIDAuthorizationRequest :
-    NSObject<NSCopying, NSSecureCoding, OIDExternalUserAgentRequest>
-
-/*! @brief The service's configuration.
-    @remarks This configuration specifies how to connect to a particular OAuth provider.
-        Configurations may be created manually, or via an OpenID Connect Discovery Document.
- */
-@property(nonatomic, readonly) OIDServiceConfiguration *configuration;
-
-/*! @brief The expected response type.
-    @remarks response_type
-    @discussion Generally 'code' if pure OAuth, otherwise a space-delimited list of of response
-        types including 'code', 'token', and 'id_token' for OpenID Connect.
-    @see https://tools.ietf.org/html/rfc6749#section-3.1.1
-    @see http://openid.net/specs/openid-connect-core-1_0.html#rfc.section.3
- */
-@property(nonatomic, readonly) NSString *responseType;
-
-/*! @brief The client identifier.
-    @remarks client_id
-    @see https://tools.ietf.org/html/rfc6749#section-2.2
- */
-@property(nonatomic, readonly) NSString *clientID;
-
-/*! @brief The client secret.
-    @remarks client_secret
-    @discussion The client secret is used to prove that identity of the client when exchaning an
-        authorization code for an access token.
-        The client secret is not passed in the authorizationRequestURL. It is only used when
-        exchanging the authorization code for an access token.
-    @see https://tools.ietf.org/html/rfc6749#section-2.3.1
- */
-@property(nonatomic, readonly, nullable) NSString *clientSecret;
-
-/*! @brief The value of the scope parameter is expressed as a list of space-delimited,
-        case-sensitive strings.
-    @remarks scope
-    @see https://tools.ietf.org/html/rfc6749#section-3.3
- */
-@property(nonatomic, readonly, nullable) NSString *scope;
-
-/*! @brief The client's redirect URI.
-    @remarks redirect_uri
-    @see https://tools.ietf.org/html/rfc6749#section-3.1.2
- */
-@property(nonatomic, readonly, nullable) NSURL *redirectURL;
-
-/*! @brief An opaque value used by the client to maintain state between the request and callback.
-    @remarks state
-    @discussion If this value is not explicitly set, this library will automatically add state and
-        perform appropriate validation of the state in the authorization response. It is recommended
-        that the default implementation of this parameter be used wherever possible. Typically used
-        to prevent CSRF attacks, as recommended in RFC6819 Section 5.3.5.
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.1
-    @see https://tools.ietf.org/html/rfc6819#section-5.3.5
- */
-@property(nonatomic, readonly, nullable) NSString *state;
-
-/*! @brief String value used to associate a Client session with an ID Token, and to mitigate replay
-        attacks. The value is passed through unmodified from the Authentication Request to the ID
-        Token. Sufficient entropy MUST be present in the nonce values used to prevent attackers from
-        guessing values.
-    @remarks nonce
-    @discussion If this value is not explicitly set, this library will automatically add nonce and
-        perform appropriate validation of the nonce in the ID Token.
-    @see https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest
- */
-@property(nonatomic, readonly, nullable) NSString *nonce;
-
-/*! @brief The PKCE code verifier.
-    @remarks code_verifier
-    @discussion The code verifier itself is not included in the authorization request that is sent
-        on the wire, but needs to be in the token exchange request.
-        @c OIDAuthorizationResponse.tokenExchangeRequest will create a @c OIDTokenRequest that
-        includes this parameter automatically.
-    @see https://tools.ietf.org/html/rfc7636#section-4.1
- */
-@property(nonatomic, readonly, nullable) NSString *codeVerifier;
-
-/*! @brief The PKCE code challenge, derived from #codeVerifier.
-    @remarks code_challenge
-    @see https://tools.ietf.org/html/rfc7636#section-4.2
- */
-@property(nonatomic, readonly, nullable) NSString *codeChallenge;
-
-/*! @brief The method used to compute the @c #codeChallenge
-    @remarks code_challenge_method
-    @see https://tools.ietf.org/html/rfc7636#section-4.3
- */
-@property(nonatomic, readonly, nullable) NSString *codeChallengeMethod;
-
-/*! @brief The client's additional authorization parameters.
-    @see https://tools.ietf.org/html/rfc6749#section-3.1
- */
-@property(nonatomic, readonly, nullable) NSDictionary<NSString *, NSString *> *additionalParameters;
-
-/*! @internal
-    @brief Unavailable. Please use
-        @c initWithConfiguration:clientId:scopes:redirectURL:responseType:additionalParameters:.
- */
-- (instancetype)init NS_UNAVAILABLE;
-
-/*! @brief Creates an authorization request with opinionated defaults (a secure @c state, and
-        PKCE with S256 as the @c code_challenge_method).
-    @param configuration The service's configuration.
-    @param clientID The client identifier.
-    @param scopes An array of scopes to combine into a single scope string per the OAuth2 spec.
-    @param redirectURL The client's redirect URI.
-    @param responseType The expected response type.
-    @param additionalParameters The client's additional authorization parameters.
-    @remarks This convenience initializer generates a state parameter and PKCE challenges
-        automatically.
- */
-- (instancetype)
-    initWithConfiguration:(OIDServiceConfiguration *)configuration
-                 clientId:(NSString *)clientID
-                   scopes:(nullable NSArray<NSString *> *)scopes
-              redirectURL:(NSURL *)redirectURL
-             responseType:(NSString *)responseType
-     additionalParameters:(nullable NSDictionary<NSString *, NSString *> *)additionalParameters;
-
-/*! @brief Creates an authorization request with opinionated defaults (a secure @c state, @c nonce,
-        and PKCE with S256 as the @c code_challenge_method).
-    @param configuration The service's configuration.
-    @param clientID The client identifier.
-    @param clientSecret The client secret.
-    @param scopes An array of scopes to combine into a single scope string per the OAuth2 spec.
-    @param redirectURL The client's redirect URI.
-    @param responseType The expected response type.
-    @param additionalParameters The client's additional authorization parameters.
-    @remarks This convenience initializer generates a state parameter and PKCE challenges
-        automatically.
- */
-- (instancetype)
-    initWithConfiguration:(OIDServiceConfiguration *)configuration
-                 clientId:(NSString *)clientID
-             clientSecret:(nullable NSString *)clientSecret
-                   scopes:(nullable NSArray<NSString *> *)scopes
-              redirectURL:(NSURL *)redirectURL
-             responseType:(NSString *)responseType
-     additionalParameters:(nullable NSDictionary<NSString *, NSString *> *)additionalParameters;
-
-/*! @brief Designated initializer.
-    @param configuration The service's configuration.
-    @param clientID The client identifier.
-    @param scope A scope string per the OAuth2 spec (a space-delimited set of scopes).
-    @param redirectURL The client's redirect URI.
-    @param responseType The expected response type.
-    @param state An opaque value used by the client to maintain state between the request and
-        callback.
-    @param nonce String value used to associate a Client session with an ID Token. Can be set to nil
-        if not using OpenID Connect, although pure OAuth servers should ignore params they don't
-        understand anyway.
-    @param codeVerifier The PKCE code verifier. See @c OIDAuthorizationRequest.generateCodeVerifier.
-    @param codeChallenge The PKCE code challenge, calculated from the code verifier such as with
-        @c OIDAuthorizationRequest.codeChallengeS256ForVerifier:.
-    @param codeChallengeMethod The PKCE code challenge method.
-        ::OIDOAuthorizationRequestCodeChallengeMethodS256 when
-        @c OIDAuthorizationRequest.codeChallengeS256ForVerifier: is used to create the code
-        challenge.
-    @param additionalParameters The client's additional authorization parameters.
- */
-- (instancetype)
-    initWithConfiguration:(OIDServiceConfiguration *)configuration
-                 clientId:(NSString *)clientID
-             clientSecret:(nullable NSString *)clientSecret
-                    scope:(nullable NSString *)scope
-              redirectURL:(nullable NSURL *)redirectURL
-             responseType:(NSString *)responseType
-                    state:(nullable NSString *)state
-                    nonce:(nullable NSString *)nonce
-             codeVerifier:(nullable NSString *)codeVerifier
-            codeChallenge:(nullable NSString *)codeChallenge
-      codeChallengeMethod:(nullable NSString *)codeChallengeMethod
-     additionalParameters:(nullable NSDictionary<NSString *, NSString *> *)additionalParameters
-    NS_DESIGNATED_INITIALIZER;
-
-/*! @brief Constructs the request URI by adding the request parameters to the query component of the
-        authorization endpoint URI using the "application/x-www-form-urlencoded" format.
-    @return A URL representing the authorization request.
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.1
- */
-- (NSURL *)authorizationRequestURL;
-
-/*! @brief Generates an OAuth state param using a random source.
-    @return The generated state.
-    @see https://tools.ietf.org/html/rfc6819#section-5.3.5
- */
-+ (nullable NSString *)generateState;
-
-/*! @brief Constructs a PKCE-compliant code verifier.
-    @return The generated code verifier.
-    @see https://tools.ietf.org/html/rfc7636#section-4.1
- */
-+ (nullable NSString *)generateCodeVerifier;
-
-/*! @brief Creates a PKCE S256 codeChallenge from the codeVerifier.
-    @param codeVerifier The code verifier from which the code challenge will be derived.
-    @return The generated code challenge.
-    @details Generate a secure code verifier to pass into this method with
-        @c OIDAuthorizationRequest.generateCodeVerifier. The matching @c #codeChallengeMethod for
-        @c #codeChallenge%s created by this method is
-        ::OIDOAuthorizationRequestCodeChallengeMethodS256.
-    @see https://tools.ietf.org/html/rfc7636#section-4.1
- */
-+ (nullable NSString *)codeChallengeS256ForVerifier:(nullable NSString *)codeVerifier;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 351
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDAuthorizationRequest.m

@@ -1,351 +0,0 @@
-/*! @file OIDAuthorizationRequest.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDAuthorizationRequest.h"
-
-#import "OIDDefines.h"
-#import "OIDScopeUtilities.h"
-#import "OIDServiceConfiguration.h"
-#import "OIDTokenUtilities.h"
-#import "OIDURLQueryComponent.h"
-
-/*! @brief The key for the @c configuration property for @c NSSecureCoding
- */
-static NSString *const kConfigurationKey = @"configuration";
-
-/*! @brief Key used to encode the @c responseType property for @c NSSecureCoding, and on the URL
-        request.
- */
-static NSString *const kResponseTypeKey = @"response_type";
-
-/*! @brief Key used to encode the @c clientID property for @c NSSecureCoding, and on the URL
-        request.
- */
-static NSString *const kClientIDKey = @"client_id";
-
-/*! @brief Key used to encode the @c clientSecret property for @c NSSecureCoding.
- */
-static NSString *const kClientSecretKey = @"client_secret";
-
-/*! @brief Key used to encode the @c scope property for @c NSSecureCoding, and on the URL request.
- */
-static NSString *const kScopeKey = @"scope";
-
-/*! @brief Key used to encode the @c redirectURL property for @c NSSecureCoding, and on the URL
-        request.
- */
-static NSString *const kRedirectURLKey = @"redirect_uri";
-
-/*! @brief Key used to encode the @c state property for @c NSSecureCoding, and on the URL request.
- */
-static NSString *const kStateKey = @"state";
-
-/*! @brief Key used to encode the @c nonce property for @c NSSecureCoding, and on the URL request.
- */
-static NSString *const kNonceKey = @"nonce";
-
-/*! @brief Key used to encode the @c codeVerifier property for @c NSSecureCoding.
- */
-static NSString *const kCodeVerifierKey = @"code_verifier";
-
-/*! @brief Key used to send the @c codeChallenge on the URL request.
- */
-static NSString *const kCodeChallengeKey = @"code_challenge";
-
-/*! @brief Key used to send the @c codeChallengeMethod on the URL request.
- */
-static NSString *const kCodeChallengeMethodKey = @"code_challenge_method";
-
-/*! @brief Key used to encode the @c additionalParameters property for
-        @c NSSecureCoding
- */
-static NSString *const kAdditionalParametersKey = @"additionalParameters";
-
-/*! @brief Number of random bytes generated for the @ state.
- */
-static NSUInteger const kStateSizeBytes = 32;
-
-/*! @brief Number of random bytes generated for the @ codeVerifier.
- */
-static NSUInteger const kCodeVerifierBytes = 32;
-
-/*! @brief Assertion text for unsupported response types.
- */
-static NSString *const OIDOAuthUnsupportedResponseTypeMessage =
-    @"The response_type \"%@\" isn't supported. AppAuth only supports the \"code\" or \"code id_token\" response_type.";
-
-/*! @brief Code challenge request method.
- */
-NSString *const OIDOAuthorizationRequestCodeChallengeMethodS256 = @"S256";
-
-@implementation OIDAuthorizationRequest
-
-- (instancetype)init
-    OID_UNAVAILABLE_USE_INITIALIZER(
-        @selector(initWithConfiguration:
-                               clientId:
-                                 scopes:
-                            redirectURL:
-                           responseType:
-                   additionalParameters:)
-    )
-
-/*! @brief Check if the response type is one AppAuth supports
-    @remarks AppAuth only supports the `code` and `code id_token` response types.
-    @see https://github.com/openid/AppAuth-iOS/issues/98
-    @see https://github.com/openid/AppAuth-iOS/issues/292
- */
-+ (BOOL)isSupportedResponseType:(NSString *)responseType
-{
-  NSString *codeIdToken = [@[OIDResponseTypeCode, OIDResponseTypeIDToken]
-                           componentsJoinedByString:@" "];
-  NSString *idTokenCode = [@[OIDResponseTypeIDToken, OIDResponseTypeCode]
-                           componentsJoinedByString:@" "];
-
-  return [responseType isEqualToString:OIDResponseTypeCode]
-         || [responseType isEqualToString:codeIdToken]
-         || [responseType isEqualToString:idTokenCode];
-}
-
-- (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration
-                clientId:(NSString *)clientID
-            clientSecret:(nullable NSString *)clientSecret
-                   scope:(nullable NSString *)scope
-             redirectURL:(NSURL *)redirectURL
-            responseType:(NSString *)responseType
-                   state:(nullable NSString *)state
-                   nonce:(nullable NSString *)nonce
-            codeVerifier:(nullable NSString *)codeVerifier
-           codeChallenge:(nullable NSString *)codeChallenge
-     codeChallengeMethod:(nullable NSString *)codeChallengeMethod
-    additionalParameters:(nullable NSDictionary<NSString *, NSString *> *)additionalParameters
-{
-  self = [super init];
-  if (self) {
-    _configuration = [configuration copy];
-    _clientID = [clientID copy];
-    _clientSecret = [clientSecret copy];
-    _scope = [scope copy];
-    _redirectURL = [redirectURL copy];
-    _responseType = [responseType copy];
-    if (![[self class] isSupportedResponseType:_responseType]) {
-      NSAssert(NO, OIDOAuthUnsupportedResponseTypeMessage, _responseType);
-      return nil;
-    }
-    _state = [state copy];
-    _nonce = [nonce copy];
-    _codeVerifier = [codeVerifier copy];
-    _codeChallenge = [codeChallenge copy];
-    _codeChallengeMethod = [codeChallengeMethod copy];
-
-    _additionalParameters =
-        [[NSDictionary alloc] initWithDictionary:additionalParameters copyItems:YES];
-  }
-  return self;
-}
-
-- (instancetype)
-   initWithConfiguration:(OIDServiceConfiguration *)configuration
-                clientId:(NSString *)clientID
-            clientSecret:(NSString *)clientSecret
-                  scopes:(nullable NSArray<NSString *> *)scopes
-             redirectURL:(NSURL *)redirectURL
-            responseType:(NSString *)responseType
-    additionalParameters:(nullable NSDictionary<NSString *, NSString *> *)additionalParameters {
-
-  // generates PKCE code verifier and challenge
-  NSString *codeVerifier = [[self class] generateCodeVerifier];
-  NSString *codeChallenge = [[self class] codeChallengeS256ForVerifier:codeVerifier];
-
-  return [self initWithConfiguration:configuration
-                            clientId:clientID
-                        clientSecret:clientSecret
-                               scope:[OIDScopeUtilities scopesWithArray:scopes]
-                         redirectURL:redirectURL
-                        responseType:responseType
-                               state:[[self class] generateState]
-                               nonce:[[self class] generateState]
-                        codeVerifier:codeVerifier
-                       codeChallenge:codeChallenge
-                 codeChallengeMethod:OIDOAuthorizationRequestCodeChallengeMethodS256
-                additionalParameters:additionalParameters];
-}
-
-- (instancetype)
-    initWithConfiguration:(OIDServiceConfiguration *)configuration
-                 clientId:(NSString *)clientID
-                   scopes:(nullable NSArray<NSString *> *)scopes
-              redirectURL:(NSURL *)redirectURL
-             responseType:(NSString *)responseType
-    additionalParameters:(nullable NSDictionary<NSString *, NSString *> *)additionalParameters {
-  return [self initWithConfiguration:configuration
-                            clientId:clientID
-                        clientSecret:nil
-                              scopes:scopes
-                         redirectURL:redirectURL
-                        responseType:responseType
-                additionalParameters:additionalParameters];
-}
-
-#pragma mark - NSCopying
-
-- (instancetype)copyWithZone:(nullable NSZone *)zone {
-  // The documentation for NSCopying specifically advises us to return a reference to the original
-  // instance in the case where instances are immutable (as ours is):
-  // "Implement NSCopying by retaining the original instead of creating a new copy when the class
-  // and its contents are immutable."
-  return self;
-}
-
-#pragma mark - NSSecureCoding
-
-+ (BOOL)supportsSecureCoding {
-  return YES;
-}
-
-- (instancetype)initWithCoder:(NSCoder *)aDecoder {
-  OIDServiceConfiguration *configuration =
-      [aDecoder decodeObjectOfClass:[OIDServiceConfiguration class]
-                             forKey:kConfigurationKey];
-  NSString *responseType = [aDecoder decodeObjectOfClass:[NSString class] forKey:kResponseTypeKey];
-  NSString *clientID = [aDecoder decodeObjectOfClass:[NSString class] forKey:kClientIDKey];
-  NSString *clientSecret = [aDecoder decodeObjectOfClass:[NSString class] forKey:kClientSecretKey];
-  NSString *scope = [aDecoder decodeObjectOfClass:[NSString class] forKey:kScopeKey];
-  NSURL *redirectURL = [aDecoder decodeObjectOfClass:[NSURL class] forKey:kRedirectURLKey];
-  NSString *state = [aDecoder decodeObjectOfClass:[NSString class] forKey:kStateKey];
-  NSString *nonce = [aDecoder decodeObjectOfClass:[NSString class] forKey:kNonceKey];
-  NSString *codeVerifier = [aDecoder decodeObjectOfClass:[NSString class] forKey:kCodeVerifierKey];
-  NSString *codeChallenge =
-      [aDecoder decodeObjectOfClass:[NSString class] forKey:kCodeChallengeKey];
-  NSString *codeChallengeMethod =
-      [aDecoder decodeObjectOfClass:[NSString class] forKey:kCodeChallengeMethodKey];
-  NSSet *additionalParameterCodingClasses = [NSSet setWithArray:@[
-    [NSDictionary class],
-    [NSString class]
-  ]];
-  NSDictionary *additionalParameters =
-      [aDecoder decodeObjectOfClasses:additionalParameterCodingClasses
-                               forKey:kAdditionalParametersKey];
-
-  self = [self initWithConfiguration:configuration
-                            clientId:clientID
-                        clientSecret:clientSecret
-                               scope:scope
-                         redirectURL:redirectURL
-                        responseType:responseType
-                               state:state
-                               nonce:nonce
-                        codeVerifier:codeVerifier
-                       codeChallenge:codeChallenge
-                 codeChallengeMethod:codeChallengeMethod
-                additionalParameters:additionalParameters];
-  return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)aCoder {
-  [aCoder encodeObject:_configuration forKey:kConfigurationKey];
-  [aCoder encodeObject:_responseType forKey:kResponseTypeKey];
-  [aCoder encodeObject:_clientID forKey:kClientIDKey];
-  [aCoder encodeObject:_clientSecret forKey:kClientSecretKey];
-  [aCoder encodeObject:_scope forKey:kScopeKey];
-  [aCoder encodeObject:_redirectURL forKey:kRedirectURLKey];
-  [aCoder encodeObject:_state forKey:kStateKey];
-  [aCoder encodeObject:_nonce forKey:kNonceKey];
-  [aCoder encodeObject:_codeVerifier forKey:kCodeVerifierKey];
-  [aCoder encodeObject:_codeChallenge forKey:kCodeChallengeKey];
-  [aCoder encodeObject:_codeChallengeMethod forKey:kCodeChallengeMethodKey];
-  [aCoder encodeObject:_additionalParameters forKey:kAdditionalParametersKey];
-}
-
-#pragma mark - NSObject overrides
-
-- (NSString *)description {
-  return [NSString stringWithFormat:@"<%@: %p, request: %@>",
-                                    NSStringFromClass([self class]),
-                                    (void *)self,
-                                    self.authorizationRequestURL];
-}
-
-#pragma mark - State and PKCE verifier/challenge generation Methods
-
-+ (nullable NSString *)generateCodeVerifier {
-  return [OIDTokenUtilities randomURLSafeStringWithSize:kCodeVerifierBytes];
-}
-
-+ (nullable NSString *)generateState {
-  return [OIDTokenUtilities randomURLSafeStringWithSize:kStateSizeBytes];
-}
-
-+ (nullable NSString *)codeChallengeS256ForVerifier:(NSString *)codeVerifier {
-  if (!codeVerifier) {
-    return nil;
-  }
-  // generates the code_challenge per spec https://tools.ietf.org/html/rfc7636#section-4.2
-  // code_challenge = BASE64URL-ENCODE(SHA256(ASCII(code_verifier)))
-  // NB. the ASCII conversion on the code_verifier entropy was done at time of generation.
-  NSData *sha256Verifier = [OIDTokenUtilities sha256:codeVerifier];
-  return [OIDTokenUtilities encodeBase64urlNoPadding:sha256Verifier];
-}
-
-#pragma mark -
-
-- (NSURL *)authorizationRequestURL {
-  OIDURLQueryComponent *query = [[OIDURLQueryComponent alloc] init];
-
-  // Required parameters.
-  [query addParameter:kResponseTypeKey value:_responseType];
-  [query addParameter:kClientIDKey value:_clientID];
-
-  // Add any additional parameters the client has specified.
-  [query addParameters:_additionalParameters];
-
-  // Add optional parameters, as applicable.
-  if (_redirectURL) {
-    [query addParameter:kRedirectURLKey value:_redirectURL.absoluteString];
-  }
-  if (_scope) {
-    [query addParameter:kScopeKey value:_scope];
-  }
-  if (_state) {
-    [query addParameter:kStateKey value:_state];
-  }
-  if (_nonce) {
-    [query addParameter:kNonceKey value:_nonce];
-  }
-  if (_codeChallenge) {
-    [query addParameter:kCodeChallengeKey value:_codeChallenge];
-  }
-  if (_codeChallengeMethod) {
-    [query addParameter:kCodeChallengeMethodKey value:_codeChallengeMethod];
-  }
-
-  // Construct the URL:
-  return [query URLByReplacingQueryInURL:_configuration.authorizationEndpoint];
-}
-
-#pragma mark - OIDExternalUserAgentRequest
-
-- (NSURL *)externalUserAgentRequestURL {
-  return [self authorizationRequestURL];
-}
-
-- (NSString *)redirectScheme {
-  return [[self redirectURL] scheme];
-}
-
-@end

+ 0 - 128
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDAuthorizationResponse.h

@@ -1,128 +0,0 @@
-/*! @file OIDAuthorizationResponse.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <Foundation/Foundation.h>
-
-@class OIDAuthorizationRequest;
-@class OIDTokenRequest;
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief Represents the response to an authorization request.
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.2
-    @see https://tools.ietf.org/html/rfc6749#section-5.1
-    @see http://openid.net/specs/openid-connect-core-1_0.html#ImplicitAuthResponse
- */
-@interface OIDAuthorizationResponse : NSObject <NSCopying, NSSecureCoding>
-
-/*! @brief The request which was serviced.
- */
-@property(nonatomic, readonly) OIDAuthorizationRequest *request;
-
-/*! @brief The authorization code generated by the authorization server.
-    @discussion Set when the response_type requested includes 'code'.
-    @remarks code
- */
-@property(nonatomic, readonly, nullable) NSString *authorizationCode;
-
-/*! @brief REQUIRED if the "state" parameter was present in the client authorization request. The
-        exact value received from the client.
-    @remarks state
- */
-@property(nonatomic, readonly, nullable) NSString *state;
-
-/*! @brief The access token generated by the authorization server.
-    @discussion Set when the response_type requested includes 'token'.
-    @remarks access_token
-    @see http://openid.net/specs/openid-connect-core-1_0.html#ImplicitAuthResponse
- */
-@property(nonatomic, readonly, nullable) NSString *accessToken;
-
-/*! @brief The approximate expiration date & time of the access token.
-    @discussion Set when the response_type requested includes 'token'.
-    @remarks expires_in
-    @seealso OIDAuthorizationResponse.accessToken
-    @see http://openid.net/specs/openid-connect-core-1_0.html#ImplicitAuthResponse
- */
-@property(nonatomic, readonly, nullable) NSDate *accessTokenExpirationDate;
-
-/*! @brief Typically "Bearer" when present. Otherwise, another token_type value that the Client has
-        negotiated with the Authorization Server.
-    @discussion Set when the response_type requested includes 'token'.
-    @remarks token_type
-    @see http://openid.net/specs/openid-connect-core-1_0.html#ImplicitAuthResponse
- */
-@property(nonatomic, readonly, nullable) NSString *tokenType;
-
-/*! @brief ID Token value associated with the authenticated session.
-    @discussion Set when the response_type requested includes 'id_token'.
-    @remarks id_token
-    @see http://openid.net/specs/openid-connect-core-1_0.html#IDToken
-    @see http://openid.net/specs/openid-connect-core-1_0.html#ImplicitAuthResponse
- */
-@property(nonatomic, readonly, nullable) NSString *idToken;
-
-/*! @brief The scope of the access token. OPTIONAL, if identical to the scopes requested, otherwise,
-        REQUIRED.
-    @remarks scope
-    @see https://tools.ietf.org/html/rfc6749#section-5.1
- */
-@property(nonatomic, readonly, nullable) NSString *scope;
-
-/*! @brief Additional parameters returned from the authorization server.
- */
-@property(nonatomic, readonly, nullable)
-    NSDictionary<NSString *, NSObject<NSCopying> *> *additionalParameters;
-
-/*! @internal
-    @brief Unavailable. Please use initWithRequest:parameters:.
- */
-- (instancetype)init NS_UNAVAILABLE;
-
-/*! @brief Designated initializer.
-    @param request The serviced request.
-    @param parameters The decoded parameters returned from the Authorization Server.
-    @remarks Known parameters are extracted from the @c parameters parameter and the normative
-        properties are populated. Non-normative parameters are placed in the
-        @c #additionalParameters dictionary.
- */
-- (instancetype)initWithRequest:(OIDAuthorizationRequest *)request
-    parameters:(NSDictionary<NSString *, NSObject<NSCopying> *> *)parameters
-    NS_DESIGNATED_INITIALIZER;
-
-/*! @brief Creates a token request suitable for exchanging an authorization code for an access
-        token.
-    @return A @c OIDTokenRequest suitable for exchanging an authorization code for an access
-        token.
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.3
- */
-- (nullable OIDTokenRequest *)tokenExchangeRequest;
-
-/*! @brief Creates a token request suitable for exchanging an authorization code for an access
-        token.
-    @param additionalParameters Additional parameters for the token request.
-    @return A @c OIDTokenRequest suitable for exchanging an authorization code for an access
-        token.
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.3
- */
-- (nullable OIDTokenRequest *)tokenExchangeRequestWithAdditionalParameters:
-    (nullable NSDictionary<NSString *, NSString *> *)additionalParameters;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 210
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDAuthorizationResponse.m

@@ -1,210 +0,0 @@
-/*! @file OIDAuthorizationResponse.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDAuthorizationResponse.h"
-
-#import "OIDAuthorizationRequest.h"
-#import "OIDDefines.h"
-#import "OIDError.h"
-#import "OIDFieldMapping.h"
-#import "OIDTokenRequest.h"
-#import "OIDTokenUtilities.h"
-
-/*! @brief The key for the @c authorizationCode property in the incoming parameters and for
-        @c NSSecureCoding.
- */
-static NSString *const kAuthorizationCodeKey = @"code";
-
-/*! @brief The key for the @c state property in the incoming parameters and for @c NSSecureCoding.
- */
-static NSString *const kStateKey = @"state";
-
-/*! @brief The key for the @c accessToken property in the incoming parameters and for
-        @c NSSecureCoding.
- */
-static NSString *const kAccessTokenKey = @"access_token";
-
-/*! @brief The key for the @c accessTokenExpirationDate property in the incoming parameters and for
-        @c NSSecureCoding.
- */
-static NSString *const kExpiresInKey = @"expires_in";
-
-/*! @brief The key for the @c tokenType property in the incoming parameters and for
-        @c NSSecureCoding.
- */
-static NSString *const kTokenTypeKey = @"token_type";
-
-/*! @brief The key for the @c idToken property in the incoming parameters and for @c NSSecureCoding.
- */
-static NSString *const kIDTokenKey = @"id_token";
-
-/*! @brief The key for the @c scope property in the incoming parameters and for @c NSSecureCoding.
- */
-static NSString *const kScopeKey = @"scope";
-
-/*! @brief Key used to encode the @c additionalParameters property for @c NSSecureCoding
- */
-static NSString *const kAdditionalParametersKey = @"additionalParameters";
-
-/*! @brief Key used to encode the @c request property for @c NSSecureCoding
- */
-static NSString *const kRequestKey = @"request";
-
-/*! @brief The exception thrown when a developer tries to create a token exchange request from an
-        authorization request with no authorization code.
- */
-static NSString *const kTokenExchangeRequestException =
-    @"Attempted to create a token exchange request from an authorization response with no "
-    "authorization code.";
-
-@implementation OIDAuthorizationResponse
-
-/*! @brief Returns a mapping of incoming parameters to instance variables.
-    @return A mapping of incoming parameters to instance variables.
- */
-+ (NSDictionary<NSString *, OIDFieldMapping *> *)fieldMap {
-  static NSMutableDictionary<NSString *, OIDFieldMapping *> *fieldMap;
-  static dispatch_once_t onceToken;
-  dispatch_once(&onceToken, ^{
-    fieldMap = [NSMutableDictionary dictionary];
-    fieldMap[kStateKey] =
-        [[OIDFieldMapping alloc] initWithName:@"_state" type:[NSString class]];
-    fieldMap[kAuthorizationCodeKey] =
-        [[OIDFieldMapping alloc] initWithName:@"_authorizationCode" type:[NSString class]];
-    fieldMap[kAccessTokenKey] =
-        [[OIDFieldMapping alloc] initWithName:@"_accessToken" type:[NSString class]];
-    fieldMap[kExpiresInKey] =
-        [[OIDFieldMapping alloc] initWithName:@"_accessTokenExpirationDate"
-                                         type:[NSDate class]
-                                   conversion:^id _Nullable(NSObject *_Nullable value) {
-          if (![value isKindOfClass:[NSNumber class]]) {
-            return value;
-          }
-          NSNumber *valueAsNumber = (NSNumber *)value;
-          return [NSDate dateWithTimeIntervalSinceNow:[valueAsNumber longLongValue]];
-        }];
-    fieldMap[kTokenTypeKey] =
-        [[OIDFieldMapping alloc] initWithName:@"_tokenType" type:[NSString class]];
-    fieldMap[kIDTokenKey] =
-        [[OIDFieldMapping alloc] initWithName:@"_idToken" type:[NSString class]];
-    fieldMap[kScopeKey] =
-        [[OIDFieldMapping alloc] initWithName:@"_scope" type:[NSString class]];
-  });
-  return fieldMap;
-}
-
-#pragma mark - Initializers
-
-- (instancetype)init
-    OID_UNAVAILABLE_USE_INITIALIZER(@selector(initWithRequest:parameters:))
-
-- (instancetype)initWithRequest:(OIDAuthorizationRequest *)request
-    parameters:(NSDictionary<NSString *, NSObject<NSCopying> *> *)parameters {
-  self = [super init];
-  if (self) {
-    _request = [request copy];
-    NSDictionary<NSString *, NSObject<NSCopying> *> *additionalParameters =
-        [OIDFieldMapping remainingParametersWithMap:[[self class] fieldMap]
-                                         parameters:parameters
-                                           instance:self];
-    _additionalParameters = additionalParameters;
-  }
-  return self;
-}
-
-#pragma mark - NSCopying
-
-- (instancetype)copyWithZone:(nullable NSZone *)zone {
-  // The documentation for NSCopying specifically advises us to return a reference to the original
-  // instance in the case where instances are immutable (as ours is):
-  // "Implement NSCopying by retaining the original instead of creating a new copy when the class
-  // and its contents are immutable."
-  return self;
-}
-
-#pragma mark - NSSecureCoding
-
-+ (BOOL)supportsSecureCoding {
-  return YES;
-}
-
-- (instancetype)initWithCoder:(NSCoder *)aDecoder {
-  OIDAuthorizationRequest *request =
-      [aDecoder decodeObjectOfClass:[OIDAuthorizationRequest class] forKey:kRequestKey];
-  self = [self initWithRequest:request parameters:@{ }];
-  if (self) {
-    [OIDFieldMapping decodeWithCoder:aDecoder map:[[self class] fieldMap] instance:self];
-    _additionalParameters = [aDecoder decodeObjectOfClasses:[OIDFieldMapping JSONTypes]
-                                                     forKey:kAdditionalParametersKey];
-  }
-  return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)aCoder {
-  [aCoder encodeObject:_request forKey:kRequestKey];
-  [OIDFieldMapping encodeWithCoder:aCoder map:[[self class] fieldMap] instance:self];
-  [aCoder encodeObject:_additionalParameters forKey:kAdditionalParametersKey];
-}
-
-#pragma mark - NSObject overrides
-
-- (NSString *)description {
-  return [NSString stringWithFormat:@"<%@: %p, authorizationCode: %@, state: \"%@\", accessToken: "
-                                     "\"%@\", accessTokenExpirationDate: %@, tokenType: %@, "
-                                     "idToken: \"%@\", scope: \"%@\", additionalParameters: %@, "
-                                     "request: %@>",
-                                    NSStringFromClass([self class]),
-                                    (void *)self,
-                                    _authorizationCode,
-                                    _state,
-                                    [OIDTokenUtilities redact:_accessToken],
-                                    _accessTokenExpirationDate,
-                                    _tokenType,
-                                    [OIDTokenUtilities redact:_idToken],
-                                    _scope,
-                                    _additionalParameters,
-                                    _request];
-}
-
-#pragma mark -
-
-- (OIDTokenRequest *)tokenExchangeRequest {
-  return [self tokenExchangeRequestWithAdditionalParameters:nil];
-}
-
-- (OIDTokenRequest *)tokenExchangeRequestWithAdditionalParameters:
-    (NSDictionary<NSString *, NSString *> *)additionalParameters {
-  // TODO: add a unit test to confirm exception is thrown when expected and the request is created
-  //       with the correct parameters.
-  if (!_authorizationCode) {
-    [NSException raise:kTokenExchangeRequestException
-                format:kTokenExchangeRequestException];
-  }
-  return [[OIDTokenRequest alloc] initWithConfiguration:_request.configuration
-                                              grantType:OIDGrantTypeAuthorizationCode
-                                      authorizationCode:_authorizationCode
-                                            redirectURL:_request.redirectURL
-                                               clientID:_request.clientID
-                                           clientSecret:_request.clientSecret
-                                                  scope:nil
-                                           refreshToken:nil
-                                           codeVerifier:_request.codeVerifier
-                                   additionalParameters:additionalParameters];
-}
-
-@end

+ 0 - 170
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDAuthorizationService.h

@@ -1,170 +0,0 @@
-/*! @file OIDAuthorizationService.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <Foundation/Foundation.h>
-
-@class OIDAuthorization;
-@class OIDAuthorizationRequest;
-@class OIDAuthorizationResponse;
-@class OIDEndSessionRequest;
-@class OIDEndSessionResponse;
-@class OIDRegistrationRequest;
-@class OIDRegistrationResponse;
-@class OIDServiceConfiguration;
-@class OIDTokenRequest;
-@class OIDTokenResponse;
-@protocol OIDExternalUserAgent;
-@protocol OIDExternalUserAgentSession;
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief Represents the type of block used as a callback for creating a service configuration from
-        a remote OpenID Connect Discovery document.
-    @param configuration The service configuration, if available.
-    @param error The error if an error occurred.
- */
-typedef void (^OIDDiscoveryCallback)(OIDServiceConfiguration *_Nullable configuration,
-                                     NSError *_Nullable error);
-
-/*! @brief Represents the type of block used as a callback for various methods of
-        @c OIDAuthorizationService.
-    @param authorizationResponse The authorization response, if available.
-    @param error The error if an error occurred.
- */
-typedef void (^OIDAuthorizationCallback)(OIDAuthorizationResponse *_Nullable authorizationResponse,
-                                         NSError *_Nullable error);
-
-/*! @brief Block used as a callback for the end-session request of @c OIDAuthorizationService.
-    @param endSessionResponse The end-session response, if available.
-    @param error The error if an error occurred.
- */
-typedef void (^OIDEndSessionCallback)(OIDEndSessionResponse *_Nullable endSessionResponse,
-                                      NSError *_Nullable error);
-
-/*! @brief Represents the type of block used as a callback for various methods of
-        @c OIDAuthorizationService.
-    @param tokenResponse The token response, if available.
-    @param error The error if an error occurred.
- */
-typedef void (^OIDTokenCallback)(OIDTokenResponse *_Nullable tokenResponse,
-                                 NSError *_Nullable error);
-
-/*! @brief Represents the type of dictionary used to specify additional querystring parameters
-        when making authorization or token endpoint requests.
- */
-typedef NSDictionary<NSString *, NSString *> *_Nullable OIDTokenEndpointParameters;
-
-/*! @brief Represents the type of block used as a callback for various methods of
-        @c OIDAuthorizationService.
-    @param registrationResponse The registration response, if available.
-    @param error The error if an error occurred.
-*/
-typedef void (^OIDRegistrationCompletion)(OIDRegistrationResponse *_Nullable registrationResponse,
-                                          NSError *_Nullable error);
-
-/*! @brief Performs various OAuth and OpenID Connect related calls via the user agent or
-        \NSURLSession.
- */
-@interface OIDAuthorizationService : NSObject
-
-/*! @brief The service's configuration.
-    @remarks Each authorization service is initialized with a configuration. This configuration
-        specifies how to connect to a particular OAuth provider. Clients should use separate
-        authorization service instances for each provider they wish to integrate with.
-        Configurations may be created manually, or via an OpenID Connect Discovery Document.
- */
-@property(nonatomic, readonly) OIDServiceConfiguration *configuration;
-
-/*! @internal
-    @brief Unavailable. This class should not be initialized.
- */
-- (instancetype)init NS_UNAVAILABLE;
-
-/*! @brief Convenience method for creating an authorization service configuration from an OpenID
-        Connect compliant issuer URL.
-    @param issuerURL The service provider's OpenID Connect issuer.
-    @param completion A block which will be invoked when the authorization service configuration has
-        been created, or when an error has occurred.
-    @see https://openid.net/specs/openid-connect-discovery-1_0.html
- */
-+ (void)discoverServiceConfigurationForIssuer:(NSURL *)issuerURL
-                                   completion:(OIDDiscoveryCallback)completion;
-
-
-/*! @brief Convenience method for creating an authorization service configuration from an OpenID
-        Connect compliant identity provider's discovery document.
-    @param discoveryURL The URL of the service provider's OpenID Connect discovery document.
-    @param completion A block which will be invoked when the authorization service configuration has
-        been created, or when an error has occurred.
-    @see https://openid.net/specs/openid-connect-discovery-1_0.html
- */
-+ (void)discoverServiceConfigurationForDiscoveryURL:(NSURL *)discoveryURL
-                                         completion:(OIDDiscoveryCallback)completion;
-
-/*! @brief Perform an authorization flow using a generic flow shim.
-    @param request The authorization request.
-    @param externalUserAgent Generic external user-agent that can present an authorization
-        request.
-    @param callback The method called when the request has completed or failed.
-    @return A @c OIDExternalUserAgentSession instance which will terminate when it
-        receives a @c OIDExternalUserAgentSession.cancel message, or after processing a
-        @c OIDExternalUserAgentSession.resumeExternalUserAgentFlowWithURL: message.
- */
-+ (id<OIDExternalUserAgentSession>) presentAuthorizationRequest:(OIDAuthorizationRequest *)request
-    externalUserAgent:(id<OIDExternalUserAgent>)externalUserAgent
-             callback:(OIDAuthorizationCallback)callback;
-
-/*! @brief Perform a logout request.
-    @param request The end-session logout request.
-    @param externalUserAgent Generic external user-agent that can present user-agent requests.
-    @param callback The method called when the request has completed or failed.
-    @return A @c OIDExternalUserAgentSession instance which will terminate when it
-        receives a @c OIDExternalUserAgentSession.cancel message, or after processing a
-        @c OIDExternalUserAgentSession.resumeExternalUserAgentFlowWithURL: message.
-    @see http://openid.net/specs/openid-connect-session-1_0.html#RPLogout
- */
-+ (id<OIDExternalUserAgentSession>)
-    presentEndSessionRequest:(OIDEndSessionRequest *)request
-           externalUserAgent:(id<OIDExternalUserAgent>)externalUserAgent
-                    callback:(OIDEndSessionCallback)callback;
-
-/*! @brief Performs a token request.
-    @param request The token request.
-    @param callback The method called when the request has completed or failed.
- */
-+ (void)performTokenRequest:(OIDTokenRequest *)request callback:(OIDTokenCallback)callback;
-
-/*! @brief Performs a token request.
-    @param request The token request.
-    @param authorizationResponse The original authorization response related to this token request.
-    @param callback The method called when the request has completed or failed.
- */
-+ (void)performTokenRequest:(OIDTokenRequest *)request
-    originalAuthorizationResponse:(OIDAuthorizationResponse *_Nullable)authorizationResponse
-                         callback:(OIDTokenCallback)callback;
-
-/*! @brief Performs a registration request.
-    @param request The registration request.
-    @param completion The method called when the request has completed or failed.
- */
-+ (void)performRegistrationRequest:(OIDRegistrationRequest *)request
-                        completion:(OIDRegistrationCompletion)completion;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 790
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDAuthorizationService.m

@@ -1,790 +0,0 @@
-/*! @file OIDAuthorizationService.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDAuthorizationService.h"
-
-#import "OIDAuthorizationRequest.h"
-#import "OIDAuthorizationResponse.h"
-#import "OIDDefines.h"
-#import "OIDEndSessionRequest.h"
-#import "OIDEndSessionResponse.h"
-#import "OIDErrorUtilities.h"
-#import "OIDExternalUserAgent.h"
-#import "OIDExternalUserAgentSession.h"
-#import "OIDIDToken.h"
-#import "OIDRegistrationRequest.h"
-#import "OIDRegistrationResponse.h"
-#import "OIDServiceConfiguration.h"
-#import "OIDServiceDiscovery.h"
-#import "OIDTokenRequest.h"
-#import "OIDTokenResponse.h"
-#import "OIDURLQueryComponent.h"
-#import "OIDURLSessionProvider.h"
-
-/*! @brief Path appended to an OpenID Connect issuer for discovery
-    @see https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfig
- */
-static NSString *const kOpenIDConfigurationWellKnownPath = @".well-known/openid-configuration";
-
-/*! @brief Max allowable iat (Issued At) time skew
-    @see https://openid.net/specs/openid-connect-core-1_0.html#IDTokenValidation
- */
-static int const kOIDAuthorizationSessionIATMaxSkew = 600;
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface OIDAuthorizationSession : NSObject<OIDExternalUserAgentSession>
-
-- (instancetype)init NS_UNAVAILABLE;
-
-- (instancetype)initWithRequest:(OIDAuthorizationRequest *)request
-    NS_DESIGNATED_INITIALIZER;
-
-@end
-
-@implementation OIDAuthorizationSession {
-  OIDAuthorizationRequest *_request;
-  id<OIDExternalUserAgent> _externalUserAgent;
-  OIDAuthorizationCallback _pendingauthorizationFlowCallback;
-}
-
-- (instancetype)initWithRequest:(OIDAuthorizationRequest *)request {
-  self = [super init];
-  if (self) {
-    _request = [request copy];
-  }
-  return self;
-}
-
-- (void)presentAuthorizationWithExternalUserAgent:(id<OIDExternalUserAgent>)externalUserAgent
-                                         callback:(OIDAuthorizationCallback)authorizationFlowCallback {
-  _externalUserAgent = externalUserAgent;
-  _pendingauthorizationFlowCallback = authorizationFlowCallback;
-  BOOL authorizationFlowStarted =
-      [_externalUserAgent presentExternalUserAgentRequest:_request session:self];
-  if (!authorizationFlowStarted) {
-    NSError *safariError = [OIDErrorUtilities errorWithCode:OIDErrorCodeSafariOpenError
-                                            underlyingError:nil
-                                                description:@"Unable to open Safari."];
-    [self didFinishWithResponse:nil error:safariError];
-  }
-}
-
-- (void)cancel {
-  [self cancelWithCompletion:nil];
-}
-
-- (void)cancelWithCompletion:(nullable void (^)(void))completion {
-  [_externalUserAgent dismissExternalUserAgentAnimated:YES completion:^{
-      NSError *error = [OIDErrorUtilities errorWithCode:OIDErrorCodeUserCanceledAuthorizationFlow
-                                        underlyingError:nil
-                                            description:@"Authorization flow was cancelled."];
-      [self didFinishWithResponse:nil error:error];
-      if (completion) completion();
-  }];
-}
-
-/*! @brief Does the redirection URL equal another URL down to the path component?
-    @param URL The first redirect URI to compare.
-    @param redirectionURL The second redirect URI to compare.
-    @return YES if the URLs match down to the path level (query params are ignored).
- */
-+ (BOOL)URL:(NSURL *)URL matchesRedirectionURL:(NSURL *)redirectionURL {
-  NSURL *standardizedURL = [URL standardizedURL];
-  NSURL *standardizedRedirectURL = [redirectionURL standardizedURL];
-
-  return [standardizedURL.scheme caseInsensitiveCompare:standardizedRedirectURL.scheme] == NSOrderedSame
-      && OIDIsEqualIncludingNil(standardizedURL.user, standardizedRedirectURL.user)
-      && OIDIsEqualIncludingNil(standardizedURL.password, standardizedRedirectURL.password)
-      && OIDIsEqualIncludingNil(standardizedURL.host, standardizedRedirectURL.host)
-      && OIDIsEqualIncludingNil(standardizedURL.port, standardizedRedirectURL.port)
-      && OIDIsEqualIncludingNil(standardizedURL.path, standardizedRedirectURL.path);
-}
-
-- (BOOL)shouldHandleURL:(NSURL *)URL {
-  return [[self class] URL:URL matchesRedirectionURL:_request.redirectURL];
-}
-
-- (BOOL)resumeExternalUserAgentFlowWithURL:(NSURL *)URL {
-  // rejects URLs that don't match redirect (these may be completely unrelated to the authorization)
-  if (![self shouldHandleURL:URL]) {
-    return NO;
-  }
-  
-  AppAuthRequestTrace(@"Authorization Response: %@", URL);
-  
-  // checks for an invalid state
-  if (!_pendingauthorizationFlowCallback) {
-    [NSException raise:OIDOAuthExceptionInvalidAuthorizationFlow
-                format:@"%@", OIDOAuthExceptionInvalidAuthorizationFlow, nil];
-  }
-
-  OIDURLQueryComponent *query = [[OIDURLQueryComponent alloc] initWithURL:URL];
-
-  NSError *error;
-  OIDAuthorizationResponse *response = nil;
-
-  // checks for an OAuth error response as per RFC6749 Section 4.1.2.1
-  if (query.dictionaryValue[OIDOAuthErrorFieldError]) {
-    error = [OIDErrorUtilities OAuthErrorWithDomain:OIDOAuthAuthorizationErrorDomain
-                                      OAuthResponse:query.dictionaryValue
-                                    underlyingError:nil];
-  }
-
-  // no error, should be a valid OAuth 2.0 response
-  if (!error) {
-    response = [[OIDAuthorizationResponse alloc] initWithRequest:_request
-                                                      parameters:query.dictionaryValue];
-      
-    // verifies that the state in the response matches the state in the request, or both are nil
-    if (!OIDIsEqualIncludingNil(_request.state, response.state)) {
-      NSMutableDictionary *userInfo = [query.dictionaryValue mutableCopy];
-      userInfo[NSLocalizedDescriptionKey] =
-        [NSString stringWithFormat:@"State mismatch, expecting %@ but got %@ in authorization "
-                                   "response %@",
-                                   _request.state,
-                                   response.state,
-                                   response];
-      response = nil;
-      error = [NSError errorWithDomain:OIDOAuthAuthorizationErrorDomain
-                                  code:OIDErrorCodeOAuthAuthorizationClientError
-                              userInfo:userInfo];
-      }
-  }
-
-  [_externalUserAgent dismissExternalUserAgentAnimated:YES completion:^{
-      [self didFinishWithResponse:response error:error];
-  }];
-
-  return YES;
-}
-
-- (void)failExternalUserAgentFlowWithError:(NSError *)error {
-  [self didFinishWithResponse:nil error:error];
-}
-
-/*! @brief Invokes the pending callback and performs cleanup.
-    @param response The authorization response, if any to return to the callback.
-    @param error The error, if any, to return to the callback.
- */
-- (void)didFinishWithResponse:(nullable OIDAuthorizationResponse *)response
-                        error:(nullable NSError *)error {
-  OIDAuthorizationCallback callback = _pendingauthorizationFlowCallback;
-  _pendingauthorizationFlowCallback = nil;
-  _externalUserAgent = nil;
-  if (callback) {
-    callback(response, error);
-  }
-}
-
-@end
-
-@interface OIDEndSessionImplementation : NSObject<OIDExternalUserAgentSession> {
-  // private variables
-  OIDEndSessionRequest *_request;
-  id<OIDExternalUserAgent> _externalUserAgent;
-  OIDEndSessionCallback _pendingEndSessionCallback;
-}
-- (instancetype)init NS_UNAVAILABLE;
-
-- (instancetype)initWithRequest:(OIDEndSessionRequest *)request
-    NS_DESIGNATED_INITIALIZER;
-@end
-
-
-@implementation OIDEndSessionImplementation
-
-- (instancetype)initWithRequest:(OIDEndSessionRequest *)request {
-  self = [super init];
-  if (self) {
-    _request = [request copy];
-  }
-  return self;
-}
-
-- (void)presentAuthorizationWithExternalUserAgent:(id<OIDExternalUserAgent>)externalUserAgent
-                                         callback:(OIDEndSessionCallback)authorizationFlowCallback {
-  _externalUserAgent = externalUserAgent;
-  _pendingEndSessionCallback = authorizationFlowCallback;
-  BOOL authorizationFlowStarted =
-      [_externalUserAgent presentExternalUserAgentRequest:_request session:self];
-  if (!authorizationFlowStarted) {
-    NSError *safariError = [OIDErrorUtilities errorWithCode:OIDErrorCodeSafariOpenError
-                                            underlyingError:nil
-                                                description:@"Unable to open Safari."];
-    [self didFinishWithResponse:nil error:safariError];
-  }
-}
-
-- (void)cancel {
-  [self cancelWithCompletion:nil];
-}
-
-- (void)cancelWithCompletion:(nullable void (^)(void))completion {
-  [_externalUserAgent dismissExternalUserAgentAnimated:YES completion:^{
-    NSError *error = [OIDErrorUtilities
-                      errorWithCode:OIDErrorCodeUserCanceledAuthorizationFlow
-                      underlyingError:nil
-                      description:nil];
-    [self didFinishWithResponse:nil error:error];
-    if (completion) completion();
-  }];
-}
-
-- (BOOL)shouldHandleURL:(NSURL *)URL {
-  // The logic of when to handle the URL is the same as for authorization requests: should match
-  // down to the path component.
-  return [[OIDAuthorizationSession class] URL:URL
-                        matchesRedirectionURL:_request.postLogoutRedirectURL];
-}
-
-- (BOOL)resumeExternalUserAgentFlowWithURL:(NSURL *)URL {
-  // rejects URLs that don't match redirect (these may be completely unrelated to the authorization)
-  if (![self shouldHandleURL:URL]) {
-    return NO;
-  }
-  // checks for an invalid state
-  if (!_pendingEndSessionCallback) {
-    [NSException raise:OIDOAuthExceptionInvalidAuthorizationFlow
-                format:@"%@", OIDOAuthExceptionInvalidAuthorizationFlow, nil];
-  }
-  
-  
-  NSError *error;
-  OIDEndSessionResponse *response = nil;
-
-  OIDURLQueryComponent *query = [[OIDURLQueryComponent alloc] initWithURL:URL];
-  response = [[OIDEndSessionResponse alloc] initWithRequest:_request
-                                                 parameters:query.dictionaryValue];
-  
-  // verifies that the state in the response matches the state in the request, or both are nil
-  if (!OIDIsEqualIncludingNil(_request.state, response.state)) {
-    NSMutableDictionary *userInfo = [query.dictionaryValue mutableCopy];
-    userInfo[NSLocalizedDescriptionKey] =
-    [NSString stringWithFormat:@"State mismatch, expecting %@ but got %@ in authorization "
-     "response %@",
-     _request.state,
-     response.state,
-     response];
-    response = nil;
-    error = [NSError errorWithDomain:OIDOAuthAuthorizationErrorDomain
-                                code:OIDErrorCodeOAuthAuthorizationClientError
-                            userInfo:userInfo];
-  }
-  
-  [_externalUserAgent dismissExternalUserAgentAnimated:YES completion:^{
-    [self didFinishWithResponse:response error:error];
-  }];
-  
-  return YES;
-}
-
-- (void)failExternalUserAgentFlowWithError:(NSError *)error {
-  [self didFinishWithResponse:nil error:error];
-}
-
-/*! @brief Invokes the pending callback and performs cleanup.
- @param response The authorization response, if any to return to the callback.
- @param error The error, if any, to return to the callback.
- */
-- (void)didFinishWithResponse:(nullable OIDEndSessionResponse *)response
-                        error:(nullable NSError *)error {
-  OIDEndSessionCallback callback = _pendingEndSessionCallback;
-  _pendingEndSessionCallback = nil;
-  _externalUserAgent = nil;
-  if (callback) {
-    callback(response, error);
-  }
-}
-
-@end
-
-@implementation OIDAuthorizationService
-
-+ (void)discoverServiceConfigurationForIssuer:(NSURL *)issuerURL
-                                   completion:(OIDDiscoveryCallback)completion {
-  NSURL *fullDiscoveryURL =
-      [issuerURL URLByAppendingPathComponent:kOpenIDConfigurationWellKnownPath];
-
-  [[self class] discoverServiceConfigurationForDiscoveryURL:fullDiscoveryURL
-                                                 completion:completion];
-}
-
-+ (void)discoverServiceConfigurationForDiscoveryURL:(NSURL *)discoveryURL
-    completion:(OIDDiscoveryCallback)completion {
-
-  NSURLSession *session = [OIDURLSessionProvider session];
-  NSURLSessionDataTask *task =
-      [session dataTaskWithURL:discoveryURL
-             completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
-    // If we got any sort of error, just report it.
-    if (error || !data) {
-      NSString *errorDescription =
-          [NSString stringWithFormat:@"Connection error fetching discovery document '%@': %@.",
-                                     discoveryURL,
-                                     error.localizedDescription];
-      error = [OIDErrorUtilities errorWithCode:OIDErrorCodeNetworkError
-                               underlyingError:error
-                                   description:errorDescription];
-      dispatch_async(dispatch_get_main_queue(), ^{
-        completion(nil, error);
-      });
-      return;
-    }
-
-    NSHTTPURLResponse *urlResponse = (NSHTTPURLResponse *)response;
-
-    // Check for non-200 status codes.
-    // https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfigurationResponse
-    if (urlResponse.statusCode != 200) {
-      NSError *URLResponseError = [OIDErrorUtilities HTTPErrorWithHTTPResponse:urlResponse
-                                                                          data:data];
-      NSString *errorDescription =
-          [NSString stringWithFormat:@"Non-200 HTTP response (%d) fetching discovery document "
-                                     "'%@'.",
-                                     (int)urlResponse.statusCode,
-                                     discoveryURL];
-      error = [OIDErrorUtilities errorWithCode:OIDErrorCodeNetworkError
-                               underlyingError:URLResponseError
-                                   description:errorDescription];
-      dispatch_async(dispatch_get_main_queue(), ^{
-        completion(nil, error);
-      });
-      return;
-    }
-
-    // Construct an OIDServiceDiscovery with the received JSON.
-    OIDServiceDiscovery *discovery =
-        [[OIDServiceDiscovery alloc] initWithJSONData:data error:&error];
-    if (error || !discovery) {
-      NSString *errorDescription =
-          [NSString stringWithFormat:@"JSON error parsing document at '%@': %@",
-                                     discoveryURL,
-                                     error.localizedDescription];
-      error = [OIDErrorUtilities errorWithCode:OIDErrorCodeNetworkError
-                               underlyingError:error
-                                   description:errorDescription];
-      dispatch_async(dispatch_get_main_queue(), ^{
-        completion(nil, error);
-      });
-      return;
-    }
-
-    // Create our service configuration with the discovery document and return it.
-    OIDServiceConfiguration *configuration =
-        [[OIDServiceConfiguration alloc] initWithDiscoveryDocument:discovery];
-    dispatch_async(dispatch_get_main_queue(), ^{
-      completion(configuration, nil);
-    });
-  }];
-  [task resume];
-}
-
-#pragma mark - Authorization Endpoint
-
-+ (id<OIDExternalUserAgentSession>) presentAuthorizationRequest:(OIDAuthorizationRequest *)request
-    externalUserAgent:(id<OIDExternalUserAgent>)externalUserAgent
-             callback:(OIDAuthorizationCallback)callback {
-  
-  AppAuthRequestTrace(@"Authorization Request: %@", request);
-  
-  OIDAuthorizationSession *flowSession = [[OIDAuthorizationSession alloc] initWithRequest:request];
-  [flowSession presentAuthorizationWithExternalUserAgent:externalUserAgent callback:callback];
-  return flowSession;
-}
-
-+ (id<OIDExternalUserAgentSession>)
-    presentEndSessionRequest:(OIDEndSessionRequest *)request
-           externalUserAgent:(id<OIDExternalUserAgent>)externalUserAgent
-                    callback:(OIDEndSessionCallback)callback {
-  OIDEndSessionImplementation *flowSession =
-      [[OIDEndSessionImplementation alloc] initWithRequest:request];
-  [flowSession presentAuthorizationWithExternalUserAgent:externalUserAgent callback:callback];
-  return flowSession;
-}
-
-#pragma mark - Token Endpoint
-
-+ (void)performTokenRequest:(OIDTokenRequest *)request callback:(OIDTokenCallback)callback {
-  [[self class] performTokenRequest:request
-      originalAuthorizationResponse:nil
-                           callback:callback];
-}
-
-+ (void)performTokenRequest:(OIDTokenRequest *)request
-    originalAuthorizationResponse:(OIDAuthorizationResponse *_Nullable)authorizationResponse
-                         callback:(OIDTokenCallback)callback {
-
-  NSURLRequest *URLRequest = [request URLRequest];
-  
-  AppAuthRequestTrace(@"Token Request: %@\nHeaders:%@\nHTTPBody: %@",
-                      URLRequest.URL,
-                      URLRequest.allHTTPHeaderFields,
-                      [[NSString alloc] initWithData:URLRequest.HTTPBody
-                                            encoding:NSUTF8StringEncoding]);
-
-  NSURLSession *session = [OIDURLSessionProvider session];
-  [[session dataTaskWithRequest:URLRequest
-              completionHandler:^(NSData *_Nullable data,
-                                  NSURLResponse *_Nullable response,
-                                  NSError *_Nullable error) {
-    if (error) {
-      // A network error or server error occurred.
-      NSString *errorDescription =
-          [NSString stringWithFormat:@"Connection error making token request to '%@': %@.",
-                                     URLRequest.URL,
-                                     error.localizedDescription];
-      NSError *returnedError =
-          [OIDErrorUtilities errorWithCode:OIDErrorCodeNetworkError
-                           underlyingError:error
-                               description:errorDescription];
-      dispatch_async(dispatch_get_main_queue(), ^{
-        callback(nil, returnedError);
-      });
-      return;
-    }
-
-    NSHTTPURLResponse *HTTPURLResponse = (NSHTTPURLResponse *)response;
-    NSInteger statusCode = HTTPURLResponse.statusCode;
-    AppAuthRequestTrace(@"Token Response: HTTP Status %d\nHTTPBody: %@",
-                        (int)statusCode,
-                        [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);
-    if (statusCode != 200) {
-      // A server error occurred.
-      NSError *serverError =
-          [OIDErrorUtilities HTTPErrorWithHTTPResponse:HTTPURLResponse data:data];
-
-      // HTTP 4xx may indicate an RFC6749 Section 5.2 error response, attempts to parse as such.
-      if (statusCode >= 400 && statusCode < 500) {
-        NSError *jsonDeserializationError;
-        NSDictionary<NSString *, NSObject<NSCopying> *> *json =
-            [NSJSONSerialization JSONObjectWithData:data options:0 error:&jsonDeserializationError];
-
-        // If the HTTP 4xx response parses as JSON and has an 'error' key, it's an OAuth error.
-        // These errors are special as they indicate a problem with the authorization grant.
-        if (json[OIDOAuthErrorFieldError]) {
-          NSError *oauthError =
-            [OIDErrorUtilities OAuthErrorWithDomain:OIDOAuthTokenErrorDomain
-                                      OAuthResponse:json
-                                    underlyingError:serverError];
-          dispatch_async(dispatch_get_main_queue(), ^{
-            callback(nil, oauthError);
-          });
-          return;
-        }
-      }
-
-      // Status code indicates this is an error, but not an RFC6749 Section 5.2 error.
-      NSString *errorDescription =
-          [NSString stringWithFormat:@"Non-200 HTTP response (%d) making token request to '%@'.",
-                                     (int)statusCode,
-                                      URLRequest.URL];
-      NSError *returnedError =
-          [OIDErrorUtilities errorWithCode:OIDErrorCodeServerError
-                           underlyingError:serverError
-                               description:errorDescription];
-      dispatch_async(dispatch_get_main_queue(), ^{
-        callback(nil, returnedError);
-      });
-      return;
-    }
-
-    NSError *jsonDeserializationError;
-    NSDictionary<NSString *, NSObject<NSCopying> *> *json =
-        [NSJSONSerialization JSONObjectWithData:data options:0 error:&jsonDeserializationError];
-    if (jsonDeserializationError) {
-      // A problem occurred deserializing the response/JSON.
-      NSString *errorDescription =
-          [NSString stringWithFormat:@"JSON error parsing token response: %@",
-                                     jsonDeserializationError.localizedDescription];
-      NSError *returnedError =
-          [OIDErrorUtilities errorWithCode:OIDErrorCodeJSONDeserializationError
-                           underlyingError:jsonDeserializationError
-                               description:errorDescription];
-      dispatch_async(dispatch_get_main_queue(), ^{
-        callback(nil, returnedError);
-      });
-      return;
-    }
-
-    OIDTokenResponse *tokenResponse =
-        [[OIDTokenResponse alloc] initWithRequest:request parameters:json];
-    if (!tokenResponse) {
-      // A problem occurred constructing the token response from the JSON.
-      NSError *returnedError =
-          [OIDErrorUtilities errorWithCode:OIDErrorCodeTokenResponseConstructionError
-                           underlyingError:jsonDeserializationError
-                               description:@"Token response invalid."];
-      dispatch_async(dispatch_get_main_queue(), ^{
-        callback(nil, returnedError);
-      });
-      return;
-    }
-
-    // If an ID Token is included in the response, validates the ID Token following the rules
-    // in OpenID Connect Core Section 3.1.3.7 for features that AppAuth directly supports
-    // (which excludes rules #1, #4, #5, #7, #8, #12, and #13). Regarding rule #6, ID Tokens
-    // received by this class are received via direct communication between the Client and the Token
-    // Endpoint, thus we are exercising the option to rely only on the TLS validation. AppAuth
-    // has a zero dependencies policy, and verifying the JWT signature would add a dependency.
-    // Users of the library are welcome to perform the JWT signature verification themselves should
-    // they wish.
-    if (tokenResponse.idToken) {
-      OIDIDToken *idToken = [[OIDIDToken alloc] initWithIDTokenString:tokenResponse.idToken];
-      if (!idToken) {
-        NSError *invalidIDToken =
-          [OIDErrorUtilities errorWithCode:OIDErrorCodeIDTokenParsingError
-                           underlyingError:nil
-                               description:@"ID Token parsing failed"];
-        dispatch_async(dispatch_get_main_queue(), ^{
-          callback(nil, invalidIDToken);
-        });
-        return;
-      }
-      
-      // OpenID Connect Core Section 3.1.3.7. rule #1
-      // Not supported: AppAuth does not support JWT encryption.
-
-      // OpenID Connect Core Section 3.1.3.7. rule #2
-      // Validates that the issuer in the ID Token matches that of the discovery document.
-      NSURL *issuer = tokenResponse.request.configuration.issuer;
-      if (issuer && ![idToken.issuer isEqual:issuer]) {
-        NSError *invalidIDToken =
-          [OIDErrorUtilities errorWithCode:OIDErrorCodeIDTokenFailedValidationError
-                           underlyingError:nil
-                               description:@"Issuer mismatch"];
-        dispatch_async(dispatch_get_main_queue(), ^{
-          callback(nil, invalidIDToken);
-        });
-        return;
-      }
-
-      // OpenID Connect Core Section 3.1.3.7. rule #3 & Section 2 azp Claim
-      // Validates that the aud (audience) Claim contains the client ID, or that the azp
-      // (authorized party) Claim matches the client ID.
-      NSString *clientID = tokenResponse.request.clientID;
-      if (![idToken.audience containsObject:clientID] &&
-          ![idToken.claims[@"azp"] isEqualToString:clientID]) {
-        NSError *invalidIDToken =
-          [OIDErrorUtilities errorWithCode:OIDErrorCodeIDTokenFailedValidationError
-                           underlyingError:nil
-                               description:@"Audience mismatch"];
-        dispatch_async(dispatch_get_main_queue(), ^{
-          callback(nil, invalidIDToken);
-        });
-        return;
-      }
-      
-      // OpenID Connect Core Section 3.1.3.7. rules #4 & #5
-      // Not supported.
-
-      // OpenID Connect Core Section 3.1.3.7. rule #6
-      // As noted above, AppAuth only supports the code flow which results in direct communication
-      // of the ID Token from the Token Endpoint to the Client, and we are exercising the option to
-      // use TSL server validation instead of checking the token signature. Users may additionally
-      // check the token signature should they wish.
-
-      // OpenID Connect Core Section 3.1.3.7. rules #7 & #8
-      // Not applicable. See rule #6.
-
-      // OpenID Connect Core Section 3.1.3.7. rule #9
-      // Validates that the current time is before the expiry time.
-      NSTimeInterval expiresAtDifference = [idToken.expiresAt timeIntervalSinceNow];
-      if (expiresAtDifference < 0) {
-        NSError *invalidIDToken =
-            [OIDErrorUtilities errorWithCode:OIDErrorCodeIDTokenFailedValidationError
-                             underlyingError:nil
-                                 description:@"ID Token expired"];
-        dispatch_async(dispatch_get_main_queue(), ^{
-          callback(nil, invalidIDToken);
-        });
-        return;
-      }
-      
-      // OpenID Connect Core Section 3.1.3.7. rule #10
-      // Validates that the issued at time is not more than +/- 10 minutes on the current time.
-      NSTimeInterval issuedAtDifference = [idToken.issuedAt timeIntervalSinceNow];
-      if (fabs(issuedAtDifference) > kOIDAuthorizationSessionIATMaxSkew) {
-        NSString *message =
-            [NSString stringWithFormat:@"Issued at time is more than %d seconds before or after "
-                                        "the current time",
-                                       kOIDAuthorizationSessionIATMaxSkew];
-        NSError *invalidIDToken =
-          [OIDErrorUtilities errorWithCode:OIDErrorCodeIDTokenFailedValidationError
-                           underlyingError:nil
-                               description:message];
-        dispatch_async(dispatch_get_main_queue(), ^{
-          callback(nil, invalidIDToken);
-        });
-        return;
-      }
-
-      // Only relevant for the authorization_code response type
-      if ([tokenResponse.request.grantType isEqual:OIDGrantTypeAuthorizationCode]) {
-        // OpenID Connect Core Section 3.1.3.7. rule #11
-        // Validates the nonce.
-        NSString *nonce = authorizationResponse.request.nonce;
-        if (nonce && ![idToken.nonce isEqual:nonce]) {
-          NSError *invalidIDToken =
-          [OIDErrorUtilities errorWithCode:OIDErrorCodeIDTokenFailedValidationError
-                           underlyingError:nil
-                               description:@"Nonce mismatch"];
-          dispatch_async(dispatch_get_main_queue(), ^{
-            callback(nil, invalidIDToken);
-          });
-          return;
-        }
-      }
-      
-      // OpenID Connect Core Section 3.1.3.7. rules #12
-      // ACR is not directly supported by AppAuth.
-
-      // OpenID Connect Core Section 3.1.3.7. rules #12
-      // max_age is not directly supported by AppAuth.
-    }
-
-    // Success
-    dispatch_async(dispatch_get_main_queue(), ^{
-      callback(tokenResponse, nil);
-    });
-  }] resume];
-}
-
-
-#pragma mark - Registration Endpoint
-
-+ (void)performRegistrationRequest:(OIDRegistrationRequest *)request
-                          completion:(OIDRegistrationCompletion)completion {
-  NSURLRequest *URLRequest = [request URLRequest];
-  if (!URLRequest) {
-    // A problem occurred deserializing the response/JSON.
-    NSError *returnedError = [OIDErrorUtilities errorWithCode:OIDErrorCodeJSONSerializationError
-                                              underlyingError:nil
-                                                  description:@"The registration request could not "
-                                                               "be serialized as JSON."];
-    dispatch_async(dispatch_get_main_queue(), ^{
-      completion(nil, returnedError);
-    });
-    return;
-  }
-
-  NSURLSession *session = [OIDURLSessionProvider session];
-  [[session dataTaskWithRequest:URLRequest
-              completionHandler:^(NSData *_Nullable data,
-                                  NSURLResponse *_Nullable response,
-                                  NSError *_Nullable error) {
-    if (error) {
-      // A network error or server error occurred.
-      NSString *errorDescription =
-          [NSString stringWithFormat:@"Connection error making registration request to '%@': %@.",
-                                     URLRequest.URL,
-                                     error.localizedDescription];
-      NSError *returnedError = [OIDErrorUtilities errorWithCode:OIDErrorCodeNetworkError
-                                                underlyingError:error
-                                                    description:errorDescription];
-      dispatch_async(dispatch_get_main_queue(), ^{
-        completion(nil, returnedError);
-      });
-      return;
-    }
-
-    NSHTTPURLResponse *HTTPURLResponse = (NSHTTPURLResponse *) response;
-
-    if (HTTPURLResponse.statusCode != 201 && HTTPURLResponse.statusCode != 200) {
-      // A server error occurred.
-      NSError *serverError = [OIDErrorUtilities HTTPErrorWithHTTPResponse:HTTPURLResponse
-                                                                     data:data];
-
-      // HTTP 400 may indicate an OpenID Connect Dynamic Client Registration 1.0 Section 3.3 error
-      // response, checks for that
-      if (HTTPURLResponse.statusCode == 400) {
-        NSError *jsonDeserializationError;
-        NSDictionary<NSString *, NSObject <NSCopying> *> *json =
-            [NSJSONSerialization JSONObjectWithData:data options:0 error:&jsonDeserializationError];
-
-        // if the HTTP 400 response parses as JSON and has an 'error' key, it's an OAuth error
-        // these errors are special as they indicate a problem with the authorization grant
-        if (json[OIDOAuthErrorFieldError]) {
-          NSError *oauthError =
-              [OIDErrorUtilities OAuthErrorWithDomain:OIDOAuthRegistrationErrorDomain
-                                        OAuthResponse:json
-                                      underlyingError:serverError];
-          dispatch_async(dispatch_get_main_queue(), ^{
-            completion(nil, oauthError);
-          });
-          return;
-        }
-      }
-
-      // not an OAuth error, just a generic server error
-      NSString *errorDescription =
-          [NSString stringWithFormat:@"Non-200/201 HTTP response (%d) making registration request "
-                                     "to '%@'.",
-                                     (int)HTTPURLResponse.statusCode,
-                                     URLRequest.URL];
-      NSError *returnedError = [OIDErrorUtilities errorWithCode:OIDErrorCodeServerError
-                                                underlyingError:serverError
-                                                    description:errorDescription];
-      dispatch_async(dispatch_get_main_queue(), ^{
-        completion(nil, returnedError);
-      });
-      return;
-    }
-
-    NSError *jsonDeserializationError;
-    NSDictionary<NSString *, NSObject <NSCopying> *> *json =
-        [NSJSONSerialization JSONObjectWithData:data options:0 error:&jsonDeserializationError];
-    if (jsonDeserializationError) {
-      // A problem occurred deserializing the response/JSON.
-      NSString *errorDescription =
-          [NSString stringWithFormat:@"JSON error parsing registration response: %@",
-                                     jsonDeserializationError.localizedDescription];
-      NSError *returnedError = [OIDErrorUtilities errorWithCode:OIDErrorCodeJSONDeserializationError
-                                                underlyingError:jsonDeserializationError
-                                                    description:errorDescription];
-      dispatch_async(dispatch_get_main_queue(), ^{
-        completion(nil, returnedError);
-      });
-      return;
-    }
-
-    OIDRegistrationResponse *registrationResponse =
-        [[OIDRegistrationResponse alloc] initWithRequest:request
-                                              parameters:json];
-    if (!registrationResponse) {
-      // A problem occurred constructing the registration response from the JSON.
-      NSError *returnedError =
-          [OIDErrorUtilities errorWithCode:OIDErrorCodeRegistrationResponseConstructionError
-                           underlyingError:nil
-                               description:@"Registration response invalid."];
-      dispatch_async(dispatch_get_main_queue(), ^{
-        completion(nil, returnedError);
-      });
-      return;
-    }
-
-    // Success
-    dispatch_async(dispatch_get_main_queue(), ^{
-      completion(registrationResponse, nil);
-    });
-  }] resume];
-}
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 51
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDClientMetadataParameters.h

@@ -1,51 +0,0 @@
-/*! @file OIDClientMetadataParameters.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2016 The AppAuth for iOS Authors. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief Parameter name for the token endpoint authentication method.
- */
-extern NSString *const OIDTokenEndpointAuthenticationMethodParam;
-
-/*! @brief Parameter name for the application type.
- */
-extern NSString *const OIDApplicationTypeParam;
-
-/*! @brief Parameter name for the redirect URI values.
- */
-extern NSString *const OIDRedirectURIsParam;
-
-/*! @brief Parameter name for the response type values.
- */
-extern NSString *const OIDResponseTypesParam;
-
-/*! @brief Parameter name for the grant type values.
- */
-extern NSString *const OIDGrantTypesParam;
-
-/*! @brief Parameter name for the subject type.
- */
-extern NSString *const OIDSubjectTypeParam;
-
-/*! @brief Application type that indicates this client is a native (not a web) application.
- */
-extern NSString *const OIDApplicationTypeNative;
-
-NS_ASSUME_NONNULL_END

+ 0 - 33
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDClientMetadataParameters.m

@@ -1,33 +0,0 @@
-/*! @file OIDClientMetadataParameters.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2016 The AppAuth for iOS Authors. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDClientMetadataParameters.h"
-
-NSString *const OIDTokenEndpointAuthenticationMethodParam = @"token_endpoint_auth_method";
-
-NSString *const OIDApplicationTypeParam = @"application_type";
-
-NSString *const OIDRedirectURIsParam = @"redirect_uris";
-
-NSString *const OIDResponseTypesParam = @"response_types";
-
-NSString *const OIDGrantTypesParam = @"grant_types";
-
-NSString *const OIDSubjectTypeParam = @"subject_type";
-
-NSString *const OIDApplicationTypeNative = @"native";

+ 0 - 51
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDDefines.h

@@ -1,51 +0,0 @@
-/*! @file OIDDefines.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-/*! @def OIDIsEqualIncludingNil(x, y)
-    @brief Returns YES if x and y are equal by reference or value.
-    @discussion NOTE: parameters may be evaluated multiple times. Be careful if using this check
-        with expressions - especially if the expressions have side effects.
-    @param x An object.
-    @param y An object.
- */
-#define OIDIsEqualIncludingNil(x, y) (((x) == (y)) || [(x) isEqual:(y)])
-
-/*! @def OID_UNAVAILABLE_USE_INITIALIZER(designatedInitializer)
-    @brief Provides a template implementation for init-family methods which have been marked as
-        NS_UNAVILABLE. Stops the compiler from giving a warning when it's the super class'
-        designated initializer, and gives callers useful feedback telling them what the
-        new designated initializer is.
-    @remarks Takes a SEL as a parameter instead of a string so that we get compiler warnings if the
-        designated intializer's signature changes.
-    @param designatedInitializer A SEL referencing the designated initializer.
- */
-#define OID_UNAVAILABLE_USE_INITIALIZER(designatedInitializer) { \
-  NSString *reason = [NSString stringWithFormat:@"Called: %@\nDesignated Initializer:%@", \
-                                                NSStringFromSelector(_cmd), \
-                                                NSStringFromSelector(designatedInitializer)]; \
-  @throw [NSException exceptionWithName:@"Attempt to call unavailable initializer." \
-                                 reason:reason \
-                               userInfo:nil]; \
-}
-
-#ifdef _APPAUTHTRACE
-#   define AppAuthRequestTrace(fmt, ...) NSLog(fmt, ##__VA_ARGS__);
-#else // _APPAUTHTRACE
-#   define AppAuthRequestTrace(...)
-#endif // _APPAUTHTRACE
-

+ 0 - 107
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDEndSessionRequest.h

@@ -1,107 +0,0 @@
-/*! @file OIDEndSessionRequest.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2017 The AppAuth Authors. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <Foundation/Foundation.h>
-
-#import "OIDExternalUserAgentRequest.h"
-
-@class OIDServiceConfiguration;
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface OIDEndSessionRequest : NSObject
-    <NSCopying, NSSecureCoding, OIDExternalUserAgentRequest>
-
-/*! @brief The service's configuration.
-    @remarks This configuration specifies how to connect to a particular OAuth provider.
-        Configurations may be created manually, or via an OpenID Connect Discovery Document.
- */
-@property(nonatomic, readonly) OIDServiceConfiguration *configuration;
-
-/*! @brief The client's redirect URI.
-    @remarks post_logout_redirect_uri
-    @see http://openid.net/specs/openid-connect-session-1_0.html#RPLogout
- */
-@property(nonatomic, readonly, nullable) NSURL *postLogoutRedirectURL;
-
-/*! @brief Previously issued ID Token passed to the end session endpoint as a hint about the End-User's current authenticated
-        session with the Client
-    @remarks id_token_hint
-    @see http://openid.net/specs/openid-connect-session-1_0.html#RPLogout
- */
-@property(nonatomic, readonly, nullable) NSString *idTokenHint;
-
-/*! @brief An opaque value used by the client to maintain state between the request and callback.
-    @remarks state
-    @discussion If this value is not explicitly set, this library will automatically add state and
-        perform appropriate validation of the state in the authorization response. It is recommended
-        that the default implementation of this parameter be used wherever possible. Typically used
-        to prevent CSRF attacks, as recommended in RFC6819 Section 5.3.5.
-    @see http://openid.net/specs/openid-connect-session-1_0.html#RPLogout
- */
-@property(nonatomic, readonly, nullable) NSString *state;
-
-/*! @brief The client's additional authorization parameters.
-    @see https://tools.ietf.org/html/rfc6749#section-3.1
- */
-@property(nonatomic, readonly, nullable) NSDictionary<NSString *, NSString *> *additionalParameters;
-
-/*! @internal
-    @brief Unavailable. Please use @c initWithConfiguration:clientId:scopes:redirectURL:additionalParameters:.
- */
-- (instancetype)init NS_UNAVAILABLE;
-
-/*! @brief Creates an authorization request with opinionated defaults (a secure @c state).
-    @param configuration The service's configuration.
-    @param idTokenHint The previously issued ID Token
-    @param postLogoutRedirectURL The client's post-logout redirect URI.
-        callback.
-    @param additionalParameters The client's additional authorization parameters.
-*/
-- (instancetype)
-    initWithConfiguration:(OIDServiceConfiguration *)configuration
-              idTokenHint:(NSString *)idTokenHint
-    postLogoutRedirectURL:(NSURL *)postLogoutRedirectURL
-     additionalParameters:(nullable NSDictionary<NSString *, NSString *> *)additionalParameters;
-
-/*! @brief Designated initializer.
-    @param configuration The service's configuration.
-    @param idTokenHint The previously issued ID Token
-    @param postLogoutRedirectURL The client's post-logout redirect URI.
-    @param state An opaque value used by the client to maintain state between the request and
-        callback.
-    @param additionalParameters The client's additional authorization parameters.
- */
-- (instancetype)
-    initWithConfiguration:(OIDServiceConfiguration *)configuration
-              idTokenHint:(NSString *)idTokenHint
-    postLogoutRedirectURL:(NSURL *)postLogoutRedirectURL
-                    state:(NSString *)state
-     additionalParameters:(nullable NSDictionary<NSString *, NSString *> *)additionalParameters
-    NS_DESIGNATED_INITIALIZER;
-
-/*! @brief Constructs the request URI by adding the request parameters to the query component of the
-        authorization endpoint URI using the "application/x-www-form-urlencoded" format.
-    @return A URL representing the authorization request.
-    @see http://openid.net/specs/openid-connect-session-1_0.html#RPLogout
- */
-- (NSURL *)endSessionRequestURL;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 190
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDEndSessionRequest.m

@@ -1,190 +0,0 @@
-/*! @file OIDEndSessionRequest.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2017 The AppAuth Authors. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDEndSessionRequest.h"
-
-#import "OIDDefines.h"
-#import "OIDTokenUtilities.h"
-#import "OIDServiceConfiguration.h"
-#import "OIDServiceDiscovery.h"
-#import "OIDURLQueryComponent.h"
-
-/*! @brief The key for the @c configuration property for @c NSSecureCoding
- */
-static NSString *const kConfigurationKey = @"configuration";
-
-/*! @brief Key used to encode the @c state property for @c NSSecureCoding, and on the URL request.
- */
-static NSString *const kStateKey = @"state";
-
-/*! @brief Key used to encode the @c postLogoutRedirectURL property for @c NSSecureCoding, and on the URL request.
- */
-static NSString *const kPostLogoutRedirectURLKey = @"post_logout_redirect_uri";
-
-/*! @brief Key used to encode the @c idTokenHint property for @c NSSecureCoding, and on the URL request.
- */
-static NSString *const kIdTokenHintKey = @"id_token_hint";
-
-/*! @brief Key used to encode the @c additionalParameters property for @c NSSecureCoding
- */
-static NSString *const kAdditionalParametersKey = @"additionalParameters";
-
-/*! @brief Number of random bytes generated for the @state.
- */
-static NSUInteger const kStateSizeBytes = 32;
-
-/*! @brief Assertion text for missing end_session_endpoint.
- */
-static NSString *const OIDMissingEndSessionEndpointMessage =
-@"The service configuration is missing an end_session_endpoint.";
-
-@implementation OIDEndSessionRequest
-
-- (instancetype)init
-    OID_UNAVAILABLE_USE_INITIALIZER(
-        @selector(initWithConfiguration:
-                            idTokenHint:
-                  postLogoutRedirectURL:
-                   additionalParameters:)
-    )
-
-- (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration
-                          idTokenHint:(NSString *)idTokenHint
-                postLogoutRedirectURL:(NSURL *)postLogoutRedirectURL
-                                state:(NSString *)state
-                 additionalParameters:(NSDictionary<NSString *,NSString *> *)additionalParameters
-{
-  self = [super init];
-  if (self) {
-      _configuration = [configuration copy];
-      _idTokenHint = [idTokenHint copy];
-      _postLogoutRedirectURL = [postLogoutRedirectURL copy];
-      _state = [state copy];
-      _additionalParameters =
-          [[NSDictionary alloc] initWithDictionary:additionalParameters copyItems:YES];
-  }
-  return self;
-}
-
-- (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration
-                          idTokenHint:(NSString *)idTokenHint
-                postLogoutRedirectURL:(NSURL *)postLogoutRedirectURL
-                 additionalParameters:(NSDictionary<NSString *,NSString *> *)additionalParameters
-{
-  return [self initWithConfiguration:configuration
-                         idTokenHint:idTokenHint
-               postLogoutRedirectURL:postLogoutRedirectURL
-                               state:[[self class] generateState]
-                additionalParameters:additionalParameters];
-}
-#pragma mark - NSCopying
-
-- (instancetype)copyWithZone:(nullable NSZone *)zone {
-  // The documentation for NSCopying specifically advises us to return a reference to the original
-  // instance in the case where instances are immutable (as ours is):
-  // "Implement NSCopying by retaining the original instead of creating a new copy when the class
-  // and its contents are immutable."
-  return self;
-}
-
-#pragma mark - NSSecureCoding
-
-+ (BOOL)supportsSecureCoding {
-  return YES;
-}
-
-- (instancetype)initWithCoder:(NSCoder *)aDecoder {
-  OIDServiceConfiguration *configuration = [aDecoder decodeObjectOfClass:[OIDServiceConfiguration class] forKey:kConfigurationKey];
-
-  NSString *idTokenHint = [aDecoder decodeObjectOfClass:[NSString class] forKey:kIdTokenHintKey];
-  NSURL *postLogoutRedirectURL = [aDecoder decodeObjectOfClass:[NSURL class] forKey:kPostLogoutRedirectURLKey];
-  NSString *state = [aDecoder decodeObjectOfClass:[NSString class] forKey:kStateKey];
-  NSSet *additionalParameterCodingClasses = [NSSet setWithArray:@[
-                                                                  [NSDictionary class],
-                                                                  [NSString class]
-                                                                  ]];
-  NSDictionary *additionalParameters = [aDecoder decodeObjectOfClasses:additionalParameterCodingClasses
-                           forKey:kAdditionalParametersKey];
-
-  self = [self initWithConfiguration:configuration
-                         idTokenHint:idTokenHint
-               postLogoutRedirectURL:postLogoutRedirectURL
-                               state:state
-                additionalParameters:additionalParameters];
-  return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)aCoder {
-  [aCoder encodeObject:_configuration forKey:kConfigurationKey];
-  [aCoder encodeObject:_idTokenHint forKey:kIdTokenHintKey];
-  [aCoder encodeObject:_postLogoutRedirectURL forKey:kPostLogoutRedirectURLKey];
-  [aCoder encodeObject:_state forKey:kStateKey];
-  [aCoder encodeObject:_additionalParameters forKey:kAdditionalParametersKey];
-}
-
-#pragma mark - NSObject overrides
-
-- (NSString *)description {
-  return [NSString stringWithFormat:@"<%@: %p, request: %@>",
-          NSStringFromClass([self class]),
-          (void *)self,
-          self.endSessionRequestURL];
-}
-
-+ (nullable NSString *)generateState {
-  return [OIDTokenUtilities randomURLSafeStringWithSize:kStateSizeBytes];
-}
-
-#pragma mark - OIDExternalUserAgentRequest
-
-- (NSURL*)externalUserAgentRequestURL {
-  return [self endSessionRequestURL];
-}
-
-- (NSString *)redirectScheme {
-  return [_postLogoutRedirectURL scheme];
-}
-
-#pragma mark -
-
-- (NSURL *)endSessionRequestURL {
-  OIDURLQueryComponent *query = [[OIDURLQueryComponent alloc] init];
-
-  // Add any additional parameters the client has specified.
-  [query addParameters:_additionalParameters];
-
-  // Add optional parameters, as applicable.
-  if (_idTokenHint) {
-    [query addParameter:kIdTokenHintKey value:_idTokenHint];
-  }
-
-  if (_postLogoutRedirectURL) {
-    [query addParameter:kPostLogoutRedirectURLKey value:_postLogoutRedirectURL.absoluteString];
-  }
-
-  if (_state) {
-    [query addParameter:kStateKey value:_state];
-  }
-
-  NSAssert(_configuration.endSessionEndpoint, OIDMissingEndSessionEndpointMessage);
-
-  // Construct the URL
-  return [query URLByReplacingQueryInURL:_configuration.endSessionEndpoint];
-}
-
-@end

+ 0 - 64
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDEndSessionResponse.h

@@ -1,64 +0,0 @@
-/*! @file OIDEndSessionResponse.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2017 The AppAuth Authors. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <Foundation/Foundation.h>
-
-@class OIDEndSessionRequest;
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief Represents the response to an End Session request.
-    @see http://openid.net/specs/openid-connect-session-1_0.html#RPLogout
- */
-
-@interface OIDEndSessionResponse : NSObject <NSCopying, NSSecureCoding>
-
-/*! @brief The request which was serviced.
- */
-@property(nonatomic, readonly) OIDEndSessionRequest *request;
-
-/*! @brief REQUIRED if the "state" parameter was present in the client end-session request. The
-        exact value received from the client.
-    @remarks state
- */
-@property(nonatomic, readonly, nullable) NSString *state;
-
-/*! @brief Additional parameters returned from the end session endpoint.
- */
-@property(nonatomic, readonly, nullable)
-    NSDictionary<NSString *, NSObject<NSCopying> *> *additionalParameters;
-
-/*! @internal
-    @brief Unavailable. Please use initWithParameters:.
- */
-- (instancetype)init NS_UNAVAILABLE;
-
-/*! @brief Designated initializer.
-    @param request The serviced request.
-    @param parameters The decoded parameters returned from the End Session Endpoint.
-    @remarks Known parameters are extracted from the @c parameters parameter and the normative
-        properties are populated. Non-normative parameters are placed in the
-        @c #additionalParameters dictionary.
- */
-- (instancetype)initWithRequest:(OIDEndSessionRequest *)request
-                     parameters:(NSDictionary<NSString *, NSObject<NSCopying> *> *)parameters
-    NS_DESIGNATED_INITIALIZER;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 118
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDEndSessionResponse.m

@@ -1,118 +0,0 @@
-/*! @file OIDEndSessionResponse.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2017 The AppAuth Authors. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDEndSessionResponse.h"
-
-#import "OIDDefines.h"
-#import "OIDEndSessionRequest.h"
-#import "OIDFieldMapping.h"
-
-/*! @brief The key for the @c state property in the incoming parameters and for @c NSSecureCoding.
- */
-static NSString *const kStateKey = @"state";
-
-/*! @brief Key used to encode the @c request property for @c NSSecureCoding
- */
-static NSString *const kRequestKey = @"request";
-
-/*! @brief Key used to encode the @c additionalParameters property for
- @c NSSecureCoding
- */
-static NSString *const kAdditionalParametersKey = @"additionalParameters";
-
-@implementation OIDEndSessionResponse
-
-#pragma mark - Initializers
-
-- (instancetype)init
-    OID_UNAVAILABLE_USE_INITIALIZER(@selector(initWithRequest:parameters:))
-
-- (instancetype)initWithRequest:(OIDEndSessionRequest *)request
-                     parameters:(NSDictionary<NSString *,NSObject<NSCopying> *> *)parameters {
-  self = [super init];
-  if (self) {
-    _request = [request copy];
-    NSDictionary<NSString *, NSObject<NSCopying> *> *additionalParameters =
-    [OIDFieldMapping remainingParametersWithMap:[[self class] fieldMap]
-                                     parameters:parameters
-                                       instance:self];
-    _additionalParameters = additionalParameters;
-  }
-  return self;
-}
-
-/*! @brief Returns a mapping of incoming parameters to instance variables.
-    @return A mapping of incoming parameters to instance variables.
- */
-+ (NSDictionary<NSString *, OIDFieldMapping *> *)fieldMap {
-  static NSMutableDictionary<NSString *, OIDFieldMapping *> *fieldMap;
-  static dispatch_once_t onceToken;
-  dispatch_once(&onceToken, ^{
-    fieldMap = [NSMutableDictionary dictionary];
-    fieldMap[kStateKey] =
-        [[OIDFieldMapping alloc] initWithName:@"_state" type:[NSString class]];
-  });
-  return fieldMap;
-}
-
-#pragma mark - NSCopying
-
-- (instancetype)copyWithZone:(nullable NSZone *)zone {
-  // The documentation for NSCopying specifically advises us to return a reference to the original
-  // instance in the case where instances are immutable (as ours is):
-  // "Implement NSCopying by retaining the original instead of creating a new copy when the class
-  // and its contents are immutable."
-  return self;
-}
-
-#pragma mark - NSSecureCoding
-
-+ (BOOL)supportsSecureCoding {
-  return YES;
-}
-
-- (instancetype)initWithCoder:(NSCoder *)aDecoder {
-  OIDEndSessionRequest *request =
-      [aDecoder decodeObjectOfClass:[OIDEndSessionRequest class] forKey:kRequestKey];
-  self = [self initWithRequest:request parameters:@{ }];
-  if (self) {
-    [OIDFieldMapping decodeWithCoder:aDecoder map:[[self class] fieldMap] instance:self];
-    _additionalParameters = [aDecoder decodeObjectOfClasses:[OIDFieldMapping JSONTypes]
-                                                     forKey:kAdditionalParametersKey];
-  }
-  return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)aCoder {
-  [aCoder encodeObject:_request forKey:kRequestKey];
-  [OIDFieldMapping encodeWithCoder:aCoder map:[[self class] fieldMap] instance:self];
-  [aCoder encodeObject:_additionalParameters forKey:kAdditionalParametersKey];
-}
-
-#pragma mark - NSObject overrides
-
-- (NSString *)description {
-  return [NSString stringWithFormat:@"<%@: %p, state: \"%@\", "
-          "additionalParameters: %@, request: %@>",
-          NSStringFromClass([self class]),
-          (void *)self,
-          _state,
-          _additionalParameters,
-          _request];
-}
-@end

+ 0 - 393
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDError.h

@@ -1,393 +0,0 @@
-/*! @file OIDError.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief The error domain for all NSErrors returned from the AppAuth library.
- */
-extern NSString *const OIDGeneralErrorDomain;
-
-/*! @brief The error domain for OAuth specific errors on the authorization endpoint.
-    @discussion This error domain is used when the server responds to an authorization request
-        with an explicit OAuth error, as defined by RFC6749 Section 4.1.2.1. If the authorization
-        response is invalid and not explicitly an error response, another error domain will be used.
-        The error response parameter dictionary is available in the
-        \NSError_userInfo dictionary using the @c ::OIDOAuthErrorResponseErrorKey key.
-        The \NSError_code will be one of the @c ::OIDErrorCodeOAuthAuthorization enum values.
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.2.1
- */
-extern NSString *const OIDOAuthAuthorizationErrorDomain;
-
-/*! @brief The error domain for OAuth specific errors on the token endpoint.
-    @discussion This error domain is used when the server responds with HTTP 400 and an OAuth error,
-        as defined RFC6749 Section 5.2. If an HTTP 400 response does not parse as an OAuth error
-        (i.e. no 'error' field is present or the JSON is invalid), another error domain will be
-        used. The entire OAuth error response dictionary is available in the \NSError_userInfo
-        dictionary using the @c ::OIDOAuthErrorResponseErrorKey key. Unlike transient network
-        errors, errors in this domain invalidate the authentication state, and either indicate a
-        client error or require user interaction (i.e. reauthentication) to resolve.
-        The \NSError_code will be one of the @c ::OIDErrorCodeOAuthToken enum values.
-    @see https://tools.ietf.org/html/rfc6749#section-5.2
- */
-extern NSString *const OIDOAuthTokenErrorDomain;
-
-/*! @brief The error domain for dynamic client registration errors.
-    @discussion This error domain is used when the server responds with HTTP 400 and an OAuth error,
-         as defined in OpenID Connect Dynamic Client Registration 1.0 Section 3.3. If an HTTP 400
-         response does not parse as an OAuth error (i.e. no 'error' field is present or the JSON is
-         invalid), another error domain will be  used. The entire OAuth error response dictionary is
-         available in the \NSError_userInfo dictionary using the @c ::OIDOAuthErrorResponseErrorKey
-         key. Unlike transient network errors, errors in this domain invalidate the authentication
-         state, and indicates a client error.
-         The \NSError_code will be one of the @c ::OIDErrorCodeOAuthToken enum values.
-     @see https://openid.net/specs/openid-connect-registration-1_0.html#RegistrationError
- */
-extern NSString *const OIDOAuthRegistrationErrorDomain;
-
-/*! @brief The error domain for authorization errors encountered out of band on the resource server.
- */
-extern NSString *const OIDResourceServerAuthorizationErrorDomain;
-
-/*! @brief An error domain representing received HTTP errors.
- */
-extern NSString *const OIDHTTPErrorDomain;
-
-/*! @brief An error key for the original OAuth error response (if any).
- */
-extern NSString *const OIDOAuthErrorResponseErrorKey;
-
-/*! @brief The key of the 'error' response field in a RFC6749 Section 5.2 response.
-    @remark error
-    @see https://tools.ietf.org/html/rfc6749#section-5.2
- */
-extern NSString *const OIDOAuthErrorFieldError;
-
-/*! @brief The key of the 'error_description' response field in a RFC6749 Section 5.2 response.
-    @remark error_description
-    @see https://tools.ietf.org/html/rfc6749#section-5.2
- */
-extern NSString *const OIDOAuthErrorFieldErrorDescription;
-
-/*! @brief The key of the 'error_uri' response field in a RFC6749 Section 5.2 response.
-    @remark error_uri
-    @see https://tools.ietf.org/html/rfc6749#section-5.2
- */
-extern NSString *const OIDOAuthErrorFieldErrorURI;
-
-/*! @brief The various error codes returned from the AppAuth library.
- */
-typedef NS_ENUM(NSInteger, OIDErrorCode) {
-  /*! @brief Indicates a problem parsing an OpenID Connect Service Discovery document.
-   */
-  OIDErrorCodeInvalidDiscoveryDocument = -2,
-
-  /*! @brief Indicates the user manually canceled the OAuth authorization code flow.
-   */
-  OIDErrorCodeUserCanceledAuthorizationFlow = -3,
-
-  /*! @brief Indicates an OAuth authorization flow was programmatically cancelled.
-   */
-  OIDErrorCodeProgramCanceledAuthorizationFlow = -4,
-
-  /*! @brief Indicates a network error or server error occurred.
-   */
-  OIDErrorCodeNetworkError = -5,
-
-  /*! @brief Indicates a server error occurred.
-   */
-  OIDErrorCodeServerError = -6,
-
-  /*! @brief Indicates a problem occurred deserializing the response/JSON.
-   */
-  OIDErrorCodeJSONDeserializationError = -7,
-
-  /*! @brief Indicates a problem occurred constructing the token response from the JSON.
-   */
-  OIDErrorCodeTokenResponseConstructionError = -8,
-
-  /*! @brief @c UIApplication.openURL: returned NO when attempting to open the authorization
-          request in mobile Safari.
-   */
-  OIDErrorCodeSafariOpenError = -9,
-
-  /*! @brief @c NSWorkspace.openURL returned NO when attempting to open the authorization
-          request in the default browser.
-   */
-  OIDErrorCodeBrowserOpenError = -10,
-
-  /*! @brief Indicates a problem when trying to refresh the tokens.
-   */
-  OIDErrorCodeTokenRefreshError = -11,
-
-  /*! @brief Indicates a problem occurred constructing the registration response from the JSON.
-   */
-  OIDErrorCodeRegistrationResponseConstructionError = -12,
-
-  /*! @brief Indicates a problem occurred deserializing the response/JSON.
-   */
-  OIDErrorCodeJSONSerializationError = -13,
-
-  /*! @brief The ID Token did not parse.
-   */
-  OIDErrorCodeIDTokenParsingError = -14,
-
-  /*! @brief The ID Token did not pass validation (e.g. issuer, audience checks).
-   */
-  OIDErrorCodeIDTokenFailedValidationError = -15,
-};
-
-/*! @brief Enum of all possible OAuth error codes as defined by RFC6749
-    @discussion Used by @c ::OIDErrorCodeOAuthAuthorization and @c ::OIDErrorCodeOAuthToken
-        which define endpoint-specific subsets of OAuth codes. Those enum types are down-castable
-        to this one.
-    @see https://tools.ietf.org/html/rfc6749#section-11.4
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.2.1
-    @see https://tools.ietf.org/html/rfc6749#section-5.2
- */
-typedef NS_ENUM(NSInteger, OIDErrorCodeOAuth) {
-
-  /*! @remarks invalid_request
-      @see https://tools.ietf.org/html/rfc6749#section-4.1.2.1
-      @see https://tools.ietf.org/html/rfc6749#section-5.2
-   */
-  OIDErrorCodeOAuthInvalidRequest = -2,
-
-  /*! @remarks unauthorized_client
-      @see https://tools.ietf.org/html/rfc6749#section-4.1.2.1
-      @see https://tools.ietf.org/html/rfc6749#section-5.2
-   */
-  OIDErrorCodeOAuthUnauthorizedClient = -3,
-
-  /*! @remarks access_denied
-      @see https://tools.ietf.org/html/rfc6749#section-4.1.2.1
-   */
-  OIDErrorCodeOAuthAccessDenied = -4,
-
-  /*! @remarks unsupported_response_type
-      @see https://tools.ietf.org/html/rfc6749#section-4.1.2.1
-   */
-  OIDErrorCodeOAuthUnsupportedResponseType = -5,
-
-  /*! @remarks invalid_scope
-      @see https://tools.ietf.org/html/rfc6749#section-4.1.2.1
-      @see https://tools.ietf.org/html/rfc6749#section-5.2
-   */
-  OIDErrorCodeOAuthInvalidScope = -6,
-
-  /*! @remarks server_error
-      @see https://tools.ietf.org/html/rfc6749#section-4.1.2.1
-   */
-  OIDErrorCodeOAuthServerError = -7,
-
-  /*! @remarks temporarily_unavailable
-      @see https://tools.ietf.org/html/rfc6749#section-4.1.2.1
-   */
-  OIDErrorCodeOAuthTemporarilyUnavailable = -8,
-
-  /*! @remarks invalid_client
-      @see https://tools.ietf.org/html/rfc6749#section-5.2
-   */
-  OIDErrorCodeOAuthInvalidClient = -9,
-
-  /*! @remarks invalid_grant
-      @see https://tools.ietf.org/html/rfc6749#section-5.2
-   */
-  OIDErrorCodeOAuthInvalidGrant = -10,
-
-  /*! @remarks unsupported_grant_type
-      @see https://tools.ietf.org/html/rfc6749#section-5.2
-   */
-  OIDErrorCodeOAuthUnsupportedGrantType = -11,
-
-  /*! @remarks invalid_redirect_uri
-      @see https://openid.net/specs/openid-connect-registration-1_0.html#RegistrationError
-   */
-  OIDErrorCodeOAuthInvalidRedirectURI = -12,
-
-  /*! @remarks invalid_client_metadata
-      @see https://openid.net/specs/openid-connect-registration-1_0.html#RegistrationError
-   */
-  OIDErrorCodeOAuthInvalidClientMetadata = -13,
-
-  /*! @brief An authorization error occurring on the client rather than the server. For example,
-        due to a state mismatch or misconfiguration. Should be treated as an unrecoverable
-        authorization error.
-   */
-  OIDErrorCodeOAuthClientError = -0xEFFF,
-
-  /*! @brief An OAuth error not known to this library
-      @discussion Indicates an OAuth error as per RFC6749, but the error code was not in our
-          list. It could be a custom error code, or one from an OAuth extension. See the "error" key
-          of the \NSError_userInfo property. Such errors are assumed to invalidate the
-          authentication state
-   */
-  OIDErrorCodeOAuthOther = -0xF000,
-};
-
-/*! @brief The error codes for the @c ::OIDOAuthAuthorizationErrorDomain error domain
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.2.1
- */
-typedef NS_ENUM(NSInteger, OIDErrorCodeOAuthAuthorization) {
-  /*! @remarks invalid_request
-      @see https://tools.ietf.org/html/rfc6749#section-4.1.2.1
-   */
-  OIDErrorCodeOAuthAuthorizationInvalidRequest = OIDErrorCodeOAuthInvalidRequest,
-
-  /*! @remarks unauthorized_client
-      @see https://tools.ietf.org/html/rfc6749#section-4.1.2.1
-   */
-  OIDErrorCodeOAuthAuthorizationUnauthorizedClient = OIDErrorCodeOAuthUnauthorizedClient,
-
-  /*! @remarks access_denied
-      @see https://tools.ietf.org/html/rfc6749#section-4.1.2.1
-   */
-  OIDErrorCodeOAuthAuthorizationAccessDenied =
-      OIDErrorCodeOAuthAccessDenied,
-
-  /*! @remarks unsupported_response_type
-      @see https://tools.ietf.org/html/rfc6749#section-4.1.2.1
-   */
-  OIDErrorCodeOAuthAuthorizationUnsupportedResponseType =
-      OIDErrorCodeOAuthUnsupportedResponseType,
-
-  /*! @brief Indicates a network error or server error occurred.
-      @remarks invalid_scope
-      @see https://tools.ietf.org/html/rfc6749#section-4.1.2.1
-   */
-  OIDErrorCodeOAuthAuthorizationAuthorizationInvalidScope = OIDErrorCodeOAuthInvalidScope,
-
-  /*! @brief Indicates a server error occurred.
-      @remarks server_error
-      @see https://tools.ietf.org/html/rfc6749#section-4.1.2.1
-   */
-  OIDErrorCodeOAuthAuthorizationServerError = OIDErrorCodeOAuthServerError,
-
-  /*! @remarks temporarily_unavailable
-      @see https://tools.ietf.org/html/rfc6749#section-4.1.2.1
-   */
-  OIDErrorCodeOAuthAuthorizationTemporarilyUnavailable = OIDErrorCodeOAuthTemporarilyUnavailable,
-
-  /*! @brief An authorization error occurring on the client rather than the server. For example,
-        due to a state mismatch or client misconfiguration. Should be treated as an unrecoverable
-        authorization error.
-   */
-  OIDErrorCodeOAuthAuthorizationClientError = OIDErrorCodeOAuthClientError,
-
-  /*! @brief An authorization OAuth error not known to this library
-      @discussion this indicates an OAuth error as per RFC6749, but the error code was not in our
-          list. It could be a custom error code, or one from an OAuth extension. See the "error" key
-          of the \NSError_userInfo property. We assume such errors are not transient.
-      @see https://tools.ietf.org/html/rfc6749#section-4.1.2.1
-   */
-  OIDErrorCodeOAuthAuthorizationOther = OIDErrorCodeOAuthOther,
-};
-
-
-/*! @brief The error codes for the @c ::OIDOAuthTokenErrorDomain error domain
-    @see https://tools.ietf.org/html/rfc6749#section-5.2
- */
-typedef NS_ENUM(NSInteger, OIDErrorCodeOAuthToken) {
-  /*! @remarks invalid_request
-      @see https://tools.ietf.org/html/rfc6749#section-5.2
-   */
-  OIDErrorCodeOAuthTokenInvalidRequest = OIDErrorCodeOAuthInvalidRequest,
-
-  /*! @remarks invalid_client
-      @see https://tools.ietf.org/html/rfc6749#section-5.2
-   */
-  OIDErrorCodeOAuthTokenInvalidClient = OIDErrorCodeOAuthInvalidClient,
-
-  /*! @remarks invalid_grant
-      @see https://tools.ietf.org/html/rfc6749#section-5.2
-   */
-  OIDErrorCodeOAuthTokenInvalidGrant = OIDErrorCodeOAuthInvalidGrant,
-
-  /*! @remarks unauthorized_client
-      @see https://tools.ietf.org/html/rfc6749#section-5.2
-   */
-  OIDErrorCodeOAuthTokenUnauthorizedClient = OIDErrorCodeOAuthUnauthorizedClient,
-
-  /*! @remarks unsupported_grant_type
-      @see https://tools.ietf.org/html/rfc6749#section-5.2
-   */
-  OIDErrorCodeOAuthTokenUnsupportedGrantType = OIDErrorCodeOAuthUnsupportedGrantType,
-
-  /*! @remarks invalid_scope
-      @see https://tools.ietf.org/html/rfc6749#section-5.2
-   */
-  OIDErrorCodeOAuthTokenInvalidScope = OIDErrorCodeOAuthInvalidScope,
-
-  /*! @brief An unrecoverable token error occurring on the client rather than the server.
-   */
-  OIDErrorCodeOAuthTokenClientError = OIDErrorCodeOAuthClientError,
-
-  /*! @brief A token endpoint OAuth error not known to this library
-      @discussion this indicates an OAuth error as per RFC6749, but the error code was not in our
-          list. It could be a custom error code, or one from an OAuth extension. See the "error" key
-          of the \NSError_userInfo property. We assume such errors are not transient.
-      @see https://tools.ietf.org/html/rfc6749#section-5.2
-   */
-  OIDErrorCodeOAuthTokenOther = OIDErrorCodeOAuthOther,
-};
-
-/*! @brief The error codes for the @c ::OIDOAuthRegistrationErrorDomain error domain
-    @see https://openid.net/specs/openid-connect-registration-1_0.html#RegistrationError
- */
-typedef NS_ENUM(NSInteger, OIDErrorCodeOAuthRegistration) {
-  /*! @remarks invalid_request
-      @see http://tools.ietf.org/html/rfc6750#section-3.1
-   */
-  OIDErrorCodeOAuthRegistrationInvalidRequest = OIDErrorCodeOAuthInvalidRequest,
-
-  /*! @remarks invalid_redirect_uri
-      @see https://openid.net/specs/openid-connect-registration-1_0.html#RegistrationError
-   */
-  OIDErrorCodeOAuthRegistrationInvalidRedirectURI = OIDErrorCodeOAuthInvalidRedirectURI,
-
-  /*! @remarks invalid_client_metadata
-      @see https://openid.net/specs/openid-connect-registration-1_0.html#RegistrationError
-   */
-  OIDErrorCodeOAuthRegistrationInvalidClientMetadata = OIDErrorCodeOAuthInvalidClientMetadata,
-
-  /*! @brief An unrecoverable token error occurring on the client rather than the server.
-   */
-  OIDErrorCodeOAuthRegistrationClientError = OIDErrorCodeOAuthClientError,
-
-  /*! @brief A registration endpoint OAuth error not known to this library
-      @discussion this indicates an OAuth error, but the error code was not in our
-          list. It could be a custom error code, or one from an OAuth extension. See the "error" key
-          of the \NSError_userInfo property. We assume such errors are not transient.
-      @see https://tools.ietf.org/html/rfc6749#section-5.2
-   */
-  OIDErrorCodeOAuthRegistrationOther = OIDErrorCodeOAuthOther,
-};
-
-
-/*! @brief The exception text for the exception which occurs when a
-        @c OIDExternalUserAgentSession receives a message after it has already completed.
- */
-extern NSString *const OIDOAuthExceptionInvalidAuthorizationFlow;
-
-/*! @brief The text for the exception which occurs when a Token Request is constructed
-        with a null redirectURL for a grant_type that requires a nonnull Redirect
- */
-extern NSString *const OIDOAuthExceptionInvalidTokenRequestNullRedirectURL;
-
-NS_ASSUME_NONNULL_END

+ 0 - 45
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDError.m

@@ -1,45 +0,0 @@
-/*! @file OIDError.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDError.h"
-
-NSString *const OIDGeneralErrorDomain = @"org.openid.appauth.general";
-
-NSString *const OIDOAuthTokenErrorDomain = @"org.openid.appauth.oauth_token";
-
-NSString *const OIDOAuthAuthorizationErrorDomain = @"org.openid.appauth.oauth_authorization";
-
-NSString *const OIDOAuthRegistrationErrorDomain = @"org.openid.appauth.oauth_registration";
-
-NSString *const OIDResourceServerAuthorizationErrorDomain = @"org.openid.appauth.resourceserver";
-
-NSString *const OIDHTTPErrorDomain = @"org.openid.appauth.remote-http";
-
-NSString *const OIDOAuthExceptionInvalidAuthorizationFlow = @"An OAuth redirect was sent to a "
-    "OIDExternalUserAgentSession after it already completed.";
-
-NSString *const OIDOAuthExceptionInvalidTokenRequestNullRedirectURL = @"A OIDTokenRequest was "
-    "created with a grant_type that requires a redirectURL, but a null redirectURL was given";
-
-NSString *const OIDOAuthErrorResponseErrorKey = @"OIDOAuthErrorResponseErrorKey";
-
-NSString *const OIDOAuthErrorFieldError = @"error";
-
-NSString *const OIDOAuthErrorFieldErrorDescription = @"error_description";
-
-NSString *const OIDOAuthErrorFieldErrorURI = @"error_uri";

+ 0 - 107
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDErrorUtilities.h

@@ -1,107 +0,0 @@
-/*! @file OIDErrorUtilities.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <Foundation/Foundation.h>
-
-#import "OIDError.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief Convenience methods for creating standardized \NSError instances.
- */
-@interface OIDErrorUtilities : NSObject
-
-/*! @brief Creates a standard \NSError from an @c ::OIDErrorCode and custom user info.
-        Automatically populates the localized error description.
-    @param code The error code.
-    @param underlyingError The underlying error which occurred, if applicable.
-    @param description A custom description, if applicable.
-    @return An \NSError representing the error code.
- */
-+ (NSError *)errorWithCode:(OIDErrorCode)code
-           underlyingError:(nullable NSError *)underlyingError
-               description:(nullable NSString *)description;
-
-/*! @brief Creates a standard \NSError from an @c ::OIDErrorCode and custom user info.
-        Automatically populates the localized error description.
-    @param OAuthErrorDomain The OAuth error domain. Must be @c ::OIDOAuthAuthorizationErrorDomain or
-        @c ::OIDOAuthTokenErrorDomain.
-    @param errorResponse The dictionary from an OAuth error response (as per RFC6749 Section 5.2).
-    @param underlyingError The underlying error which occurred, if applicable.
-    @return An \NSError representing the OAuth error.
-    @see https://tools.ietf.org/html/rfc6749#section-5.2
- */
-+ (NSError *)OAuthErrorWithDomain:(NSString *)OAuthErrorDomain
-                    OAuthResponse:(NSDictionary *)errorResponse
-                  underlyingError:(nullable NSError *)underlyingError;
-
-/*! @brief Creates a \NSError indicating that the resource server responded with an authorization
-        error.
-    @param code Your error code.
-    @param errorResponse The resource server error response, if any.
-    @param underlyingError The underlying error which occurred, if applicable.
-    @return An \NSError representing the authorization error from the resource server.
- */
-+ (NSError *)resourceServerAuthorizationErrorWithCode:(NSInteger)code
-                                        errorResponse:(nullable NSDictionary *)errorResponse
-                                      underlyingError:(nullable NSError *)underlyingError;
-
-
-/*! @brief Creates a standard \NSError from an \NSHTTPURLResponse. Automatically
-        populates the localized error description with the response data associated with the
-        \NSHTTPURLResponse, if available.
-    @param HTTPURLResponse The response which indicates an error occurred.
-    @param data The response data associated with the response which should be converted to an
-        @c NSString assuming a UTF-8 encoding, if available.
-    @return An \NSError representing the error.
- */
-+ (NSError *)HTTPErrorWithHTTPResponse:(NSHTTPURLResponse *)HTTPURLResponse
-                                  data:(nullable NSData *)data;
-
-/*! @brief Raises an exception with the given name as both the name, and the message.
-    @param name The name of the exception.
- */
-+ (void)raiseException:(NSString *)name;
-
-/*! @brief Raises an exception with the given name and message.
-    @param name The name of the exception.
-    @param message The message of the exception.
- */
-+ (void)raiseException:(NSString *)name message:(NSString *)message;
-
-/*! @brief Converts an OAuth error code into an @c ::OIDErrorCodeOAuth error code.
-    @param errorCode The OAuth error code.
-    @discussion Returns @c ::OIDErrorCodeOAuthOther if the string is not in AppAuth's list.
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.2.1
-    @see https://tools.ietf.org/html/rfc6749#section-5.2
- */
-+ (OIDErrorCodeOAuth)OAuthErrorCodeFromString:(NSString *)errorCode;
-
-/*! @brief Returns true if the given error domain is an OAuth error domain.
-    @param errorDomain The error domain to test.
-    @discussion An OAuth error domain is used for errors returned per RFC6749 sections 4.1.2.1 and
-        5.2. Other errors, such as network errors can also occur but they will not have an OAuth
-        error domain.
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.2.1
-    @see https://tools.ietf.org/html/rfc6749#section-5.2
- */
-+ (BOOL)isOAuthErrorDomain:(NSString*)errorDomain;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 172
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDErrorUtilities.m

@@ -1,172 +0,0 @@
-/*! @file OIDErrorUtilities.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDErrorUtilities.h"
-
-@implementation OIDErrorUtilities
-
-+ (NSError *)errorWithCode:(OIDErrorCode)code
-           underlyingError:(NSError *)underlyingError
-               description:(NSString *)description {
-  NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
-  if (underlyingError) {
-    userInfo[NSUnderlyingErrorKey] = underlyingError;
-  }
-  if (description) {
-    userInfo[NSLocalizedDescriptionKey] = description;
-  }
-  // TODO: Populate localized description based on code.
-  NSError *error = [NSError errorWithDomain:OIDGeneralErrorDomain
-                                       code:code
-                                   userInfo:userInfo];
-  return error;
-}
-
-+ (BOOL)isOAuthErrorDomain:(NSString *)errorDomain {
-  return errorDomain == OIDOAuthRegistrationErrorDomain
-      || errorDomain == OIDOAuthAuthorizationErrorDomain
-      || errorDomain == OIDOAuthTokenErrorDomain;
-}
-
-+ (NSError *)resourceServerAuthorizationErrorWithCode:(NSInteger)code
-      errorResponse:(nullable NSDictionary *)errorResponse
-    underlyingError:(nullable NSError *)underlyingError {
-  // builds the userInfo dictionary with the full OAuth response and other information
-  NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
-  if (errorResponse) {
-    userInfo[OIDOAuthErrorResponseErrorKey] = errorResponse;
-  }
-  if (underlyingError) {
-    userInfo[NSUnderlyingErrorKey] = underlyingError;
-  }
-  NSError *error = [NSError errorWithDomain:OIDResourceServerAuthorizationErrorDomain
-                                       code:code
-                                   userInfo:userInfo];
-  return error;
-}
-
-+ (NSError *)OAuthErrorWithDomain:(NSString *)oAuthErrorDomain
-                    OAuthResponse:(NSDictionary *)errorResponse
-                  underlyingError:(NSError *)underlyingError {
-  // not a valid OAuth error
-  if (![self isOAuthErrorDomain:oAuthErrorDomain]
-      || !errorResponse
-      || !errorResponse[OIDOAuthErrorFieldError]
-      || ![errorResponse[OIDOAuthErrorFieldError] isKindOfClass:[NSString class]]) {
-    return [[self class] errorWithCode:OIDErrorCodeNetworkError
-                       underlyingError:underlyingError
-                           description:underlyingError.localizedDescription];
-  }
-
-  // builds the userInfo dictionary with the full OAuth response and other information
-  NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
-  userInfo[OIDOAuthErrorResponseErrorKey] = errorResponse;
-  if (underlyingError) {
-    userInfo[NSUnderlyingErrorKey] = underlyingError;
-  }
-
-  NSString *oauthErrorCodeString = errorResponse[OIDOAuthErrorFieldError];
-  NSString *oauthErrorMessage = nil;
-  if ([errorResponse[OIDOAuthErrorFieldErrorDescription] isKindOfClass:[NSString class]]) {
-    oauthErrorMessage = errorResponse[OIDOAuthErrorFieldErrorDescription];
-  } else {
-    oauthErrorMessage = [errorResponse[OIDOAuthErrorFieldErrorDescription] description];
-  }
-  NSString *oauthErrorURI = nil;
-  if ([errorResponse[OIDOAuthErrorFieldErrorURI] isKindOfClass:[NSString class]]) {
-    oauthErrorURI = errorResponse[OIDOAuthErrorFieldErrorURI];
-  } else {
-    oauthErrorURI = [errorResponse[OIDOAuthErrorFieldErrorURI] description];
-  }
-
-  // builds the error description, using the information supplied by the server if possible
-  NSMutableString *description = [NSMutableString string];
-  [description appendString:oauthErrorCodeString];
-  if (oauthErrorMessage) {
-    [description appendString:@": "];
-    [description appendString:oauthErrorMessage];
-  }
-  if (oauthErrorURI) {
-    if ([description length] > 0) {
-      [description appendString:@" - "];
-    }
-    [description appendString:oauthErrorURI];
-  }
-  if ([description length] == 0) {
-    // backup description
-    [description appendFormat:@"OAuth error: %@ - https://tools.ietf.org/html/rfc6749#section-5.2",
-                              oauthErrorCodeString];
-  }
-  userInfo[NSLocalizedDescriptionKey] = description;
-
-  // looks up the error code based on the "error" response param
-  OIDErrorCodeOAuth code = [[self class] OAuthErrorCodeFromString:oauthErrorCodeString];
-
-  NSError *error = [NSError errorWithDomain:oAuthErrorDomain
-                                       code:code
-                                   userInfo:userInfo];
-  return error;
-}
-
-+ (NSError *)HTTPErrorWithHTTPResponse:(NSHTTPURLResponse *)HTTPURLResponse
-                                  data:(nullable NSData *)data {
-  NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
-  if (data) {
-    NSString *serverResponse =
-        [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
-    if (serverResponse) {
-      userInfo[NSLocalizedDescriptionKey] = serverResponse;
-    }
-  }
-  NSError *serverError =
-      [NSError errorWithDomain:OIDHTTPErrorDomain
-                          code:HTTPURLResponse.statusCode
-                      userInfo:userInfo];
-  return serverError;
-}
-
-+ (OIDErrorCodeOAuth)OAuthErrorCodeFromString:(NSString *)errorCode {
-  NSDictionary *errorCodes = @{
-      @"invalid_request": @(OIDErrorCodeOAuthInvalidRequest),
-      @"unauthorized_client": @(OIDErrorCodeOAuthUnauthorizedClient),
-      @"access_denied": @(OIDErrorCodeOAuthAccessDenied),
-      @"unsupported_response_type": @(OIDErrorCodeOAuthUnsupportedResponseType),
-      @"invalid_scope": @(OIDErrorCodeOAuthInvalidScope),
-      @"server_error": @(OIDErrorCodeOAuthServerError),
-      @"temporarily_unavailable": @(OIDErrorCodeOAuthTemporarilyUnavailable),
-      @"invalid_client": @(OIDErrorCodeOAuthInvalidClient),
-      @"invalid_grant": @(OIDErrorCodeOAuthInvalidGrant),
-      @"unsupported_grant_type": @(OIDErrorCodeOAuthUnsupportedGrantType),
-      };
-  NSNumber *code = errorCodes[errorCode];
-  if (code) {
-    return [code integerValue];
-  } else {
-    return OIDErrorCodeOAuthOther;
-  }
-}
-
-+ (void)raiseException:(NSString *)name {
-  [[self class] raiseException:name message:name];
-}
-
-+ (void)raiseException:(NSString *)name message:(NSString *)message {
-  [NSException raise:name format:@"%@", message];
-}
-
-@end

+ 0 - 53
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDExternalUserAgent.h

@@ -1,53 +0,0 @@
-/*! @file OIDExternalUserAgent.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2016 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <Foundation/Foundation.h>
-
-@protocol OIDExternalUserAgentSession;
-@protocol OIDExternalUserAgentRequest;
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @protocol OIDExternalUserAgent
-    @brief An external user-agent UI that presents displays the request to the user. Clients may
-        provide custom implementations of an external user-agent to customize the way the requests
-        are presented to the end user.
- */
-@protocol OIDExternalUserAgent<NSObject>
-
-/*! @brief Presents the request in the external user-agent.
-    @param request The request to be presented in the external user-agent.
-    @param session The @c OIDExternalUserAgentSession instance that initiates presenting the UI.
-        Concrete implementations of a @c OIDExternalUserAgent may call
-        resumeExternalUserAgentFlowWithURL or failExternalUserAgentFlowWithError on session to either
-        resume or fail the request.
-    @return YES If the request UI was successfully presented to the user.
- */
-- (BOOL)presentExternalUserAgentRequest:(id<OIDExternalUserAgentRequest> )request
-                                session:(id<OIDExternalUserAgentSession>)session;
-
-/*! @brief Dimisses the external user-agent and calls completion when the dismiss operation ends.
-    @param animated Whether or not the dismiss operation should be animated.
-    @remarks Has no effect if no UI is presented.
-    @param completion The block to be called when the dismiss operations ends
- */
-- (void)dismissExternalUserAgentAnimated:(BOOL)animated completion:(void (^)(void))completion;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 37
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDExternalUserAgentRequest.h

@@ -1,37 +0,0 @@
-/*! @file OIDExternalUserAgent.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2017 The AppAuth Authors. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-/*! @protocol OIDExternalUserAgent
-    @brief An interface that any external user-agent request may implement to use the
-        @c OIDExternalUserAgent flow.
- */
-@protocol OIDExternalUserAgentRequest
-
-/*! @brief Method to create and return the complete request URL instance.
-    @return A @c NSURL instance which contains the URL to be opened in an external UI (i.e. browser)
- */
-- (NSURL*)externalUserAgentRequestURL;
-
-/*! @brief If this external user-agent request has a redirect URL, this should return its scheme.
-        Since some external requests have optional callbacks (such as the end session endpoint), the
-        return value of this method is nullable.
-    @return A @c NSString instance that contains the scheme of a callback url, or nil if there is
-        no callback url for this request.
- */
-- (NSString*)redirectScheme;
-@end

+ 0 - 65
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDExternalUserAgentSession.h

@@ -1,65 +0,0 @@
-/*! @file OIDExternalUserAgentSession.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2017 The AppAuth Authors. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief Represents an in-flight external user-agent session.
- */
-@protocol OIDExternalUserAgentSession <NSObject>
-
-/*! @brief Cancels the code flow session, invoking the request's callback with a cancelled error.
-    @remarks Has no effect if called more than once, or after a
-        @c OIDExternalUserAgentSession.resumeExternalUserAgentFlowWithURL: message was received.
-        Will cause an error with code: @c ::OIDErrorCodeProgramCanceledAuthorizationFlow to be
-        passed to the @c callback block passed to
-        @c OIDAuthorizationService.presentAuthorizationRequest:presentingViewController:callback:
- */
-- (void)cancel;
-
-/*! @brief Cancels the code flow session, invoking the request's callback with a cancelled error.
-    @remarks Has no effect if called more than once, or after a
-        @c OIDExternalUserAgentSession.resumeExternalUserAgentFlowWithURL: message was received.
-        Will cause an error with code: @c ::OIDErrorCodeProgramCanceledAuthorizationFlow to be
-        passed to the @c callback block passed to
-        @c OIDAuthorizationService.presentAuthorizationRequest:presentingViewController:callback:
-    @param completion The block to be called when the cancel operation ends
- */
-- (void)cancelWithCompletion:(nullable void (^)(void))completion;
-
-/*! @brief Clients should call this method with the result of the external user-agent code flow if
-        it becomes available.
-    @param URL The redirect URL invoked by the server.
-    @discussion When the URL represented a valid response, implementations should clean up any
-        left-over UI state from the request, for example by closing the
-        \SFSafariViewController or loopback HTTP listener if those were used. The completion block
-        of the pending request should then be invoked.
-    @remarks Has no effect if called more than once, or after a @c cancel message was received.
-    @return YES if the passed URL matches the expected redirect URL and was consumed, NO otherwise.
- */
-- (BOOL)resumeExternalUserAgentFlowWithURL:(NSURL *)URL;
-
-/*! @brief @c OIDExternalUserAgent or clients should call this method when the
-        external user-agent flow failed with a non-OAuth error.
-    @param error The error that is the reason for the failure of this external flow.
-    @remarks Has no effect if called more than once, or after a @c cancel message was received.
- */
-- (void)failExternalUserAgentFlowWithError:(NSError *)error;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 126
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDFieldMapping.h

@@ -1,126 +0,0 @@
-/*! @file OIDFieldMapping.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief Represents a function which transforms incoming source values into instance variable
-        values.
- */
-typedef _Nullable id(^OIDFieldMappingConversionFunction)(NSObject *_Nullable value);
-
-/*! @brief Describes the mapping of a key/value pair to an iVar with an optional conversion
-        function.
- */
-@interface OIDFieldMapping : NSObject
-
-/*! @brief The name of the instance variable the field should be mapped to.
- */
-@property(nonatomic, readonly) NSString *name;
-
-/*! @brief The type of the instance variable.
- */
-@property(nonatomic, readonly) Class expectedType;
-
-/*! @brief An optional conversion function which specifies a transform from the incoming data to the
-        instance variable value.
- */
-@property(nonatomic, readonly, nullable) OIDFieldMappingConversionFunction conversion;
-
-/*! @internal
-    @brief Unavailable. Please use initWithName:type:conversion:.
- */
-- (instancetype)init NS_UNAVAILABLE;
-
-/*! @brief The designated initializer.
-    @param name The name of the instance variable the field should be mapped to.
-    @param type The type of the instance variable.
-    @param conversion An optional conversion function which specifies a transform from the incoming
-        data to the instance variable value. Used during the process performed by
-        @c OIDFieldMapping.remainingParametersWithMap:parameters:instance: but not during
-        encoding/decoding, since the encoded and decoded values should already be of the type
-        specified by the @c type parameter.
- */
-- (instancetype)initWithName:(NSString *)name
-                        type:(Class)type
-                  conversion:(nullable OIDFieldMappingConversionFunction)conversion
-    NS_DESIGNATED_INITIALIZER;
-
-/*! @brief A convenience initializer.
-    @param name The name of the instance variable the field should be mapped to.
-    @param type The type of the instance variable.
- */
-- (instancetype)initWithName:(NSString *)name
-                        type:(Class)type;
-
-/*! @brief Performs a mapping of key/value pairs in an incoming parameters dictionary to instance
-        variables, returning a dictionary of parameter key/values which didn't map to instance
-        variables.
-    @param map A mapping of incoming keys to instance variables.
-    @param parameters Incoming key value pairs to map to an instance's variables.
-    @param instance The instance whose variables should be set based on the mapping.
-    @return A dictionary of parameter key/values which didn't map to instance variables.
- */
-+ (NSDictionary<NSString *, NSObject<NSCopying> *> *)remainingParametersWithMap:
-    (NSDictionary<NSString *, OIDFieldMapping *> *)map
-    parameters:(NSDictionary<NSString *, NSObject<NSCopying> *> *)parameters
-      instance:(id)instance;
-
-/*! @brief This helper method for @c NSCoding implementations performs a serialization of fields
-        defined in a field mapping.
-    @param aCoder An @c NSCoder instance to serialize instance variable values to.
-    @param map A mapping of keys to instance variables.
-    @param instance The instance whose variables should be serialized based on the mapping.
- */
-+ (void)encodeWithCoder:(NSCoder *)aCoder
-                    map:(NSDictionary<NSString *, OIDFieldMapping *> *)map
-               instance:(id)instance;
-
-/*! @brief This helper method for @c NSCoding implementations performs a deserialization of
-        fields defined in a field mapping.
-    @param aCoder An @c NSCoder instance from which to deserialize instance variable values from.
-    @param map A mapping of keys to instance variables.
-    @param instance The instance whose variables should be deserialized based on the mapping.
- */
-+ (void)decodeWithCoder:(NSCoder *)aCoder
-                    map:(NSDictionary<NSString *, OIDFieldMapping *> *)map
-               instance:(id)instance;
-
-/*! @brief Returns an @c NSSet of classes suitable for deserializing JSON content in an
-        @c NSSecureCoding context.
- */
-+ (NSSet *)JSONTypes;
-
-/*! @brief Returns a function for converting an @c NSString to an @c NSURL.
- */
-+ (OIDFieldMappingConversionFunction)URLConversion;
-
-/*! @brief Returns a function for converting an @c NSNumber number of seconds from now to an
-        @c NSDate.
- */
-+ (OIDFieldMappingConversionFunction)dateSinceNowConversion;
-
-/*! @brief Returns a function for converting an @c NSNumber representing a unix time stamp to an
-        @c NSDate.
- */
-+ (OIDFieldMappingConversionFunction)dateEpochConversion;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 132
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDFieldMapping.m

@@ -1,132 +0,0 @@
-/*! @file OIDFieldMapping.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDFieldMapping.h"
-
-#import "OIDDefines.h"
-
-@implementation OIDFieldMapping
-
-- (nonnull instancetype)init
-    OID_UNAVAILABLE_USE_INITIALIZER(@selector(initWithName:type:conversion:))
-
-- (instancetype)initWithName:(NSString *)name
-                                 type:(Class)type {
-  return [self initWithName:name type:type conversion:nil];
-}
-
-- (instancetype)initWithName:(NSString *)name
-                                 type:(Class)type
-                           conversion:(nullable OIDFieldMappingConversionFunction)conversion {
-  self = [super init];
-  if (self) {
-    _name = [name copy];
-    _expectedType = type;
-    _conversion = conversion;
-  }
-  return self;
-}
-
-+ (NSDictionary<NSString *, NSObject<NSCopying> *> *)remainingParametersWithMap:
-    (NSDictionary<NSString *, OIDFieldMapping *> *)map
-    parameters:(NSDictionary<NSString *, NSObject<NSCopying> *> *)parameters
-      instance:(id)instance {
-  NSMutableDictionary *additionalParameters = [NSMutableDictionary dictionary];
-  for (NSString *key in parameters) {
-    NSObject<NSCopying> *value = [parameters[key] copy];
-    OIDFieldMapping *mapping = map[key];
-    // If the field doesn't appear in the mapping, we add it to the additional parameters
-    // dictionary.
-    if (!mapping) {
-      additionalParameters[key] = value;
-      continue;
-    }
-    // If the field mapping specifies a conversion function, apply the conversion to the value.
-    if (mapping.conversion) {
-      value = mapping.conversion(value);
-    }
-    // Check the type of the value and make sure it matches the type we expected. If it doesn't we
-    // add the value to the additional parameters dictionary but don't assign the instance variable.
-    if (![value isKindOfClass:mapping.expectedType]) {
-      additionalParameters[key] = value;
-      continue;
-    }
-    // Assign the instance variable.
-    [instance setValue:value forKey:mapping.name];
-  }
-  return additionalParameters;
-}
-
-+ (void)encodeWithCoder:(NSCoder *)aCoder
-                    map:(NSDictionary<NSString *, OIDFieldMapping *> *)map
-               instance:(id)instance {
-  for (NSString *key in map) {
-    id value = [instance valueForKey:map[key].name];
-    [aCoder encodeObject:value forKey:key];
-  }
-}
-
-+ (void)decodeWithCoder:(NSCoder *)aCoder
-                    map:(NSDictionary<NSString *, OIDFieldMapping *> *)map
-               instance:(id)instance {
-  for (NSString *key in map) {
-    OIDFieldMapping *mapping = map[key];
-    id value = [aCoder decodeObjectOfClass:mapping.expectedType forKey:key];
-    [instance setValue:value forKey:mapping.name];
-  }
-}
-
-+ (NSSet *)JSONTypes {
-  return [NSSet setWithArray:@[
-    [NSDictionary class],
-    [NSArray class],
-    [NSString class],
-    [NSNumber class]
-  ]];
-}
-
-+ (OIDFieldMappingConversionFunction)URLConversion {
-  return ^id _Nullable(NSObject *_Nullable value) {
-    if ([value isKindOfClass:[NSString class]]) {
-      return [NSURL URLWithString:(NSString *)value];
-    }
-    return value;
-  };
-}
-
-+ (OIDFieldMappingConversionFunction)dateSinceNowConversion {
-  return ^id _Nullable(NSObject *_Nullable value) {
-    if (![value isKindOfClass:[NSNumber class]]) {
-      return value;
-    }
-    NSNumber *valueAsNumber = (NSNumber *)value;
-    return [NSDate dateWithTimeIntervalSinceNow:[valueAsNumber longLongValue]];
-  };
-}
-
-+ (OIDFieldMappingConversionFunction)dateEpochConversion {
-  return ^id _Nullable(NSObject *_Nullable value) {
-    if (![value isKindOfClass:[NSNumber class]]) {
-      return value;
-    }
-    NSNumber *valueAsNumber = (NSNumber *) value;
-    return [NSDate dateWithTimeIntervalSince1970:[valueAsNumber longLongValue]];
-  };
-}
-
-@end

+ 0 - 40
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDGrantTypes.h

@@ -1,40 +0,0 @@
-/*! @file OIDGrantTypes.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <Foundation/Foundation.h>
-
-/*! @brief For exchanging an authorization code for an access token.
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.3
- */
-extern NSString *const OIDGrantTypeAuthorizationCode;
-
-/*! @brief For refreshing an access token with a refresh token.
-    @see https://tools.ietf.org/html/rfc6749#section-6
- */
-extern NSString *const OIDGrantTypeRefreshToken;
-
-/*! @brief For obtaining an access token with a username and password.
-    @see https://tools.ietf.org/html/rfc6749#section-4.3.2
- */
-extern NSString *const OIDGrantTypePassword;
-
-/*! @brief For obtaining an access token from the token endpoint using client credentials.
-    @see https://tools.ietf.org/html/rfc6749#section-3.2.1
-    @see https://tools.ietf.org/html/rfc6749#section-4.4.2
- */
-extern NSString *const OIDGrantTypeClientCredentials;

+ 0 - 27
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDGrantTypes.m

@@ -1,27 +0,0 @@
-/*! @file OIDGrantTypes.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDGrantTypes.h"
-
-NSString *const OIDGrantTypeAuthorizationCode = @"authorization_code";
-
-NSString *const OIDGrantTypeRefreshToken = @"refresh_token";
-
-NSString *const OIDGrantTypePassword = @"password";
-
-NSString *const OIDGrantTypeClientCredentials = @"client_credentials";

+ 0 - 91
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDIDToken.h

@@ -1,91 +0,0 @@
-/*! @file OIDIDToken.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2017 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief A convenience class that parses an ID Token and extracts the claims _but does not_
-           verify its signature. AppAuth only supports the OpenID Code flow, meaning ID Tokens
-           received by AppAuth are sent from the token endpoint on a TLS protected channel,
-           offering some assurances as to the origin of the token. You may wish to additionally
-           verify the ID Token signature using a JWT signature verification library of your
-           choosing.
-    @see http://openid.net/specs/openid-connect-core-1_0.html#IDToken
-    @see https://tools.ietf.org/html/rfc7519
-    @see https://jwt.io/
- */
-@interface OIDIDToken : NSObject
-
-/*! @internal
-    @brief Unavailable. Please use @c initWithAuthorizationResponse:.
- */
-- (instancetype)init NS_UNAVAILABLE;
-
-/*! @brief Parses the given ID Token string.
-    @param idToken The ID Token spring.
- */
-- (nullable instancetype)initWithIDTokenString:(NSString *)idToken;
-
-/*! @brief The header JWT values.
- */
-@property(nonatomic, readonly) NSDictionary *header;
-
-/*! @brief All ID Token claims.
- */
-@property(nonatomic, readonly) NSDictionary *claims;
-
-/*! @brief Issuer Identifier for the Issuer of the response.
-    @remarks iss
-    @see http://openid.net/specs/openid-connect-core-1_0.html#IDToken
- */
-@property(nonatomic, readonly) NSURL *issuer;
-
-/*! @brief Subject Identifier.
-    @remarks sub
-    @see http://openid.net/specs/openid-connect-core-1_0.html#IDToken
- */
-@property(nonatomic, readonly) NSString *subject;
-
-/*! @brief Audience(s) that this ID Token is intended for.
-    @remarks aud
-    @see http://openid.net/specs/openid-connect-core-1_0.html#IDToken
- */
-@property(nonatomic, readonly) NSArray *audience;
-
-/*! @brief Expiration time on or after which the ID Token MUST NOT be accepted for processing.
-    @remarks exp
-    @see http://openid.net/specs/openid-connect-core-1_0.html#IDToken
- */
-@property(nonatomic, readonly) NSDate *expiresAt;
-
-/*! @brief Time at which the JWT was issued.
-    @remarks iat
-    @see http://openid.net/specs/openid-connect-core-1_0.html#IDToken
- */
-@property(nonatomic, readonly) NSDate *issuedAt;
-
-/*! @brief String value used to associate a Client session with an ID Token, and to mitigate replay
-        attacks.
-    @remarks nonce
-    @see http://openid.net/specs/openid-connect-core-1_0.html#IDToken
- */
-@property(nonatomic, readonly, nullable) NSString *nonce;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 149
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDIDToken.m

@@ -1,149 +0,0 @@
-/*! @file OIDIDToken.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2017 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDIDToken.h"
-
-/*! Field keys associated with an ID Token. */
-static NSString *const kIssKey = @"iss";
-static NSString *const kSubKey = @"sub";
-static NSString *const kAudKey = @"aud";
-static NSString *const kExpKey = @"exp";
-static NSString *const kIatKey = @"iat";
-static NSString *const kNonceKey = @"nonce";
-
-#import "OIDFieldMapping.h"
-
-@implementation OIDIDToken
-
-- (instancetype)initWithIDTokenString:(NSString *)idToken {
-  self = [super init];
-  NSArray *sections = [idToken componentsSeparatedByString:@"."];
-  
-  // The header and claims sections are required.
-  if (sections.count <= 1) {
-    return nil;
-  }
-  
-  _header = [[self class] parseJWTSection:sections[0]];
-  _claims = [[self class] parseJWTSection:sections[1]];
-  if (!_header || !_claims) {
-    return nil;
-  }
-
-  [OIDFieldMapping remainingParametersWithMap:[[self class] fieldMap]
-                                   parameters:_claims
-                                     instance:self];
-
-  // Required fields.
-  if (!_issuer || !_audience || !_subject || !_expiresAt || !_issuedAt) {
-    return nil;
-  }
-
-  return self;
-}
-
-/*! @brief Returns a mapping of incoming parameters to instance variables.
-    @return A mapping of incoming parameters to instance variables.
- */
-+ (NSDictionary<NSString *, OIDFieldMapping *> *)fieldMap {
-  static NSMutableDictionary<NSString *, OIDFieldMapping *> *fieldMap;
-  static dispatch_once_t onceToken;
-  dispatch_once(&onceToken, ^{
-    fieldMap = [NSMutableDictionary dictionary];
-
-    fieldMap[kIssKey] =
-        [[OIDFieldMapping alloc] initWithName:@"_issuer"
-                                         type:[NSURL class]
-                                   conversion:[OIDFieldMapping URLConversion]];
-    fieldMap[kSubKey] =
-        [[OIDFieldMapping alloc] initWithName:@"_subject" type:[NSString class]];
-    fieldMap[kAudKey] =
-        [[OIDFieldMapping alloc] initWithName:@"_audience"
-                                         type:[NSArray class]
-                                   conversion:^id _Nullable(NSObject *_Nullable value) {
-          if ([value isKindOfClass:[NSArray class]]) {
-            return value;
-          }
-          if ([value isKindOfClass:[NSString class]]) {
-            return @[value];
-          }
-          return nil;
-        }];
-    fieldMap[kExpKey] =
-        [[OIDFieldMapping alloc] initWithName:@"_expiresAt"
-                                         type:[NSDate class]
-                                   conversion:^id _Nullable(NSObject *_Nullable value) {
-          if (![value isKindOfClass:[NSNumber class]]) {
-            return value;
-          }
-          NSNumber *valueAsNumber = (NSNumber *)value;
-          return [NSDate dateWithTimeIntervalSince1970:valueAsNumber.longLongValue];
-        }];
-    fieldMap[kIatKey] =
-        [[OIDFieldMapping alloc] initWithName:@"_issuedAt"
-                                         type:[NSDate class]
-                                   conversion:^id _Nullable(NSObject *_Nullable value) {
-          if (![value isKindOfClass:[NSNumber class]]) {
-            return value;
-          }
-          NSNumber *valueAsNumber = (NSNumber *)value;
-          return [NSDate dateWithTimeIntervalSince1970:valueAsNumber.longLongValue];
-        }];
-    fieldMap[kNonceKey] =
-        [[OIDFieldMapping alloc] initWithName:@"_nonce" type:[NSString class]];
-  });
-  return fieldMap;
-}
-
-+ (NSDictionary *)parseJWTSection:(NSString *)sectionString {
-  NSData *decodedData = [[self class] base64urlNoPaddingDecode:sectionString];
-
-  // Parses JSON.
-  NSError *error;
-  id object = [NSJSONSerialization JSONObjectWithData:decodedData options:0 error:&error];
-  if (error) {
-    NSLog(@"Error %@ parsing token payload %@", error, sectionString);
-  }
-  if ([object isKindOfClass:[NSDictionary class]]) {
-    return (NSDictionary *)object;
-  }
-
-  return nil;
-}
-
-+ (NSData *)base64urlNoPaddingDecode:(NSString *)base64urlNoPaddingString {
-    NSMutableString *body = [base64urlNoPaddingString mutableCopy];
-
-    // Converts base64url to base64.
-    NSRange range = NSMakeRange(0, base64urlNoPaddingString.length);
-    [body replaceOccurrencesOfString:@"-" withString:@"+" options:NSLiteralSearch range:range];
-    [body replaceOccurrencesOfString:@"_" withString:@"/" options:NSLiteralSearch range:range];
-
-    // Converts base64 no padding to base64 with padding
-    while (body.length % 4 != 0) {
-      [body appendString:@"="];
-    }
-
-    // Decodes base64 string.
-    NSData *decodedData = [[NSData alloc] initWithBase64EncodedString:body options:0];
-    return decodedData;
-}
-
-@end
-
-

+ 0 - 141
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDRegistrationRequest.h

@@ -1,141 +0,0 @@
-/*! @file OIDRegistrationRequest.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2016 The AppAuth for iOS Authors. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <Foundation/Foundation.h>
-
-@class OIDAuthorizationResponse;
-@class OIDServiceConfiguration;
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief Represents a registration request.
-    @see https://openid.net/specs/openid-connect-registration-1_0.html#RegistrationRequest
- */
-@interface OIDRegistrationRequest : NSObject <NSCopying, NSSecureCoding>
-
-/*! @brief The service's configuration.
-    @remarks This configuration specifies how to connect to a particular OAuth provider.
-        Configurations may be created manually, or via an OpenID Connect Discovery Document.
- */
-@property(nonatomic, readonly) OIDServiceConfiguration *configuration;
-
-/*! @brief The initial access token to access the Client Registration Endpoint
-        (if required by the OpenID Provider).
-    @remarks OAuth 2.0 Access Token optionally issued by an Authorization Server granting
-        access to its Client Registration Endpoint. This token (if required) is
-        provisioned out of band.
-    @see Section 3 of OpenID Connect Dynamic Client Registration 1.0
-        https://openid.net/specs/openid-connect-registration-1_0.html#ClientRegistration
- */
-@property(nonatomic, readonly) NSString *initialAccessToken;
-
-/*! @brief The application type to register, will always be 'native'.
-    @remarks application_type
-    @see https://openid.net/specs/openid-connect-registration-1_0.html#ClientMetadata
- */
-@property(nonatomic, readonly) NSString *applicationType;
-
-/*! @brief The client's redirect URI's.
-    @remarks redirect_uris
-    @see https://tools.ietf.org/html/rfc6749#section-3.1.2
- */
-@property(nonatomic, readonly) NSArray<NSURL *> *redirectURIs;
-
-/*! @brief The response types to register for usage by this client.
-    @remarks response_types
-    @see http://openid.net/specs/openid-connect-core-1_0.html#Authentication
- */
-@property(nonatomic, readonly, nullable) NSArray<NSString *> *responseTypes;
-
-/*! @brief The grant types to register for usage by this client.
-    @remarks grant_types
- @see https://openid.net/specs/openid-connect-registration-1_0.html#ClientMetadata
- */
-@property(nonatomic, readonly, nullable) NSArray<NSString *> *grantTypes;
-
-/*! @brief The subject type to to request.
-    @remarks subject_type
-    @see http://openid.net/specs/openid-connect-core-1_0.html#SubjectIDTypes
- */
-@property(nonatomic, readonly, nullable) NSString *subjectType;
-
-/*! @brief The client authentication method to use at the token endpoint.
-    @remarks token_endpoint_auth_method
-    @see http://openid.net/specs/openid-connect-core-1_0.html#ClientAuthentication
- */
-@property(nonatomic, readonly, nullable) NSString *tokenEndpointAuthenticationMethod;
-
-/*! @brief The client's additional token request parameters.
- */
-@property(nonatomic, readonly, nullable) NSDictionary<NSString *, NSString *> *additionalParameters;
-
-/*! @internal
-    @brief Unavailable. Please use initWithConfiguration
- */
-- (instancetype)init NS_UNAVAILABLE;
-
-/*! @brief Create a Client Registration Request to an OpenID Provider that supports open Dynamic
-        Registration.
-    @param configuration The service's configuration.
-    @param redirectURIs The redirect URIs to register for the client.
-    @param responseTypes The response types to register for the client.
-    @param grantTypes The grant types to register for the client.
-    @param subjectType The subject type to register for the client.
-    @param tokenEndpointAuthMethod The token endpoint authentication method to register for the
-        client.
-    @param additionalParameters The client's additional registration request parameters.
- */
-- (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration
-               redirectURIs:(NSArray<NSURL *> *)redirectURIs
-              responseTypes:(nullable NSArray<NSString *> *)responseTypes
-                 grantTypes:(nullable NSArray<NSString *> *)grantTypes
-                subjectType:(nullable NSString *)subjectType
-    tokenEndpointAuthMethod:(nullable NSString *)tokenEndpointAuthMethod
-       additionalParameters:(nullable NSDictionary<NSString *, NSString *> *)additionalParameters;
-
-/*! @brief Designated initializer.
-    @param configuration The service's configuration.
-    @param redirectURIs The redirect URIs to register for the client.
-    @param responseTypes The response types to register for the client.
-    @param grantTypes The grant types to register for the client.
-    @param subjectType The subject type to register for the client.
-    @param tokenEndpointAuthMethod The token endpoint authentication method to register for the
-        client.
-    @param initialAccessToken The initial access token to access the Client Registration Endpoint
-        (if required by the OpenID Provider).
-    @param additionalParameters The client's additional registration request parameters.
-    @see https://openid.net/specs/openid-connect-registration-1_0.html#ClientRegistration
- */
-- (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration
-               redirectURIs:(NSArray<NSURL *> *)redirectURIs
-              responseTypes:(nullable NSArray<NSString *> *)responseTypes
-                 grantTypes:(nullable NSArray<NSString *> *)grantTypes
-                subjectType:(nullable NSString *)subjectType
-    tokenEndpointAuthMethod:(nullable NSString *)tokenEndpointAuthMethod
-         initialAccessToken:(nullable NSString *)initialAccessToken
-       additionalParameters:(nullable NSDictionary<NSString *, NSString *> *)additionalParameters
-    NS_DESIGNATED_INITIALIZER;
-
-/*! @brief Constructs an @c NSURLRequest representing the registration request.
-    @return An @c NSURLRequest representing the registration request.
- */
-- (NSURLRequest *)URLRequest;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 248
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDRegistrationRequest.m

@@ -1,248 +0,0 @@
-/*! @file OIDRegistrationRequest.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2016 The AppAuth for iOS Authors. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDRegistrationRequest.h"
-
-#import "OIDClientMetadataParameters.h"
-#import "OIDDefines.h"
-#import "OIDServiceConfiguration.h"
-
-/*! @brief The key for the @c configuration property for @c NSSecureCoding
- */
-static NSString *const kConfigurationKey = @"configuration";
-
-/*! @brief The key for the @c initialAccessToken property for @c NSSecureCoding
- */
-static NSString *const kInitialAccessToken  = @"initial_access_token";
-
-/*! @brief Key used to encode the @c redirectURIs property for @c NSSecureCoding
- */
-static NSString *const kRedirectURIsKey = @"redirect_uris";
-
-/*! @brief The key for the @c responseTypes property for @c NSSecureCoding.
- */
-static NSString *const kResponseTypesKey = @"response_types";
-
-/*! @brief Key used to encode the @c grantType property for @c NSSecureCoding
- */
-static NSString *const kGrantTypesKey = @"grant_types";
-
-/*! @brief Key used to encode the @c subjectType property for @c NSSecureCoding
- */
-static NSString *const kSubjectTypeKey = @"subject_type";
-
-/*! @brief Key used to encode the @c additionalParameters property for
-        @c NSSecureCoding
- */
-static NSString *const kAdditionalParametersKey = @"additionalParameters";
-
-@implementation OIDRegistrationRequest
-
-#pragma mark - Initializers
-
-- (instancetype)init
-    OID_UNAVAILABLE_USE_INITIALIZER(
-        @selector(initWithConfiguration:
-                           redirectURIs:
-                          responseTypes:
-                             grantTypes:
-                            subjectType:
-                tokenEndpointAuthMethod:
-                   additionalParameters:)
-    )
-
-- (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration
-            redirectURIs:(NSArray<NSURL *> *)redirectURIs
-           responseTypes:(nullable NSArray<NSString *> *)responseTypes
-              grantTypes:(nullable NSArray<NSString *> *)grantTypes
-             subjectType:(nullable NSString *)subjectType
- tokenEndpointAuthMethod:(nullable NSString *)tokenEndpointAuthenticationMethod
-    additionalParameters:(nullable NSDictionary<NSString *, NSString *> *)additionalParameters {
-  return [self initWithConfiguration:configuration
-                        redirectURIs:redirectURIs
-                       responseTypes:responseTypes
-                          grantTypes:grantTypes
-                         subjectType:subjectType
-             tokenEndpointAuthMethod:tokenEndpointAuthenticationMethod
-                  initialAccessToken:nil
-                additionalParameters:additionalParameters];
-}
-
-- (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration
-               redirectURIs:(NSArray<NSURL *> *)redirectURIs
-              responseTypes:(nullable NSArray<NSString *> *)responseTypes
-                 grantTypes:(nullable NSArray<NSString *> *)grantTypes
-                subjectType:(nullable NSString *)subjectType
-    tokenEndpointAuthMethod:(nullable NSString *)tokenEndpointAuthenticationMethod
-         initialAccessToken:(nullable NSString *)initialAccessToken
-       additionalParameters:(nullable NSDictionary<NSString *, NSString *> *)additionalParameters {
-  self = [super init];
-  if (self) {
-    _configuration = [configuration copy];
-    _initialAccessToken = [initialAccessToken copy];
-    _redirectURIs = [redirectURIs copy];
-    _responseTypes = [responseTypes copy];
-    _grantTypes = [grantTypes copy];
-    _subjectType = [subjectType copy];
-    _tokenEndpointAuthenticationMethod = [tokenEndpointAuthenticationMethod copy];
-    _additionalParameters =
-        [[NSDictionary alloc] initWithDictionary:additionalParameters copyItems:YES];
-
-    _applicationType = OIDApplicationTypeNative;
-  }
-  return self;
-}
-
-#pragma mark - NSCopying
-
-- (instancetype)copyWithZone:(nullable NSZone *)zone {
-  // The documentation for NSCopying specifically advises us to return a reference to the original
-  // instance in the case where instances are immutable (as ours is):
-  // "Implement NSCopying by retaining the original instead of creating a new copy when the class
-  // and its contents are immutable."
-  return self;
-}
-
-#pragma mark - NSSecureCoding
-
-+ (BOOL)supportsSecureCoding {
-  return YES;
-}
-
-- (instancetype)initWithCoder:(NSCoder *)aDecoder {
-  OIDServiceConfiguration *configuration =
-  [aDecoder decodeObjectOfClass:[OIDServiceConfiguration class]
-                         forKey:kConfigurationKey];
-  NSString *initialAccessToken = [aDecoder decodeObjectOfClass:[NSString class]
-                                                        forKey:kInitialAccessToken];
-  NSArray<NSURL *> *redirectURIs = [aDecoder decodeObjectOfClass:[NSArray<NSURL *> class]
-                                                          forKey:kRedirectURIsKey];
-  NSArray<NSString *> *responseTypes = [aDecoder decodeObjectOfClass:[NSArray<NSString *> class]
-                                                              forKey:kResponseTypesKey];
-  NSArray<NSString *> *grantTypes = [aDecoder decodeObjectOfClass:[NSArray<NSString *> class]
-                                                           forKey:kGrantTypesKey];
-  NSString *subjectType = [aDecoder decodeObjectOfClass:[NSString class]
-                                                 forKey:kSubjectTypeKey];
-  NSString *tokenEndpointAuthenticationMethod =
-      [aDecoder decodeObjectOfClass:[NSString class]
-                             forKey:OIDTokenEndpointAuthenticationMethodParam];
-  NSSet *additionalParameterCodingClasses = [NSSet setWithArray:@[ [NSDictionary class],
-                                                                   [NSString class] ]];
-  NSDictionary *additionalParameters =
-      [aDecoder decodeObjectOfClasses:additionalParameterCodingClasses
-                               forKey:kAdditionalParametersKey];
-  self = [self initWithConfiguration:configuration
-                        redirectURIs:redirectURIs
-                       responseTypes:responseTypes
-                          grantTypes:grantTypes
-                         subjectType:subjectType
-             tokenEndpointAuthMethod:tokenEndpointAuthenticationMethod
-                  initialAccessToken:initialAccessToken
-                additionalParameters:additionalParameters];
-  return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)aCoder {
-  [aCoder encodeObject:_configuration forKey:kConfigurationKey];
-  [aCoder encodeObject:_initialAccessToken forKey:kInitialAccessToken];
-  [aCoder encodeObject:_redirectURIs forKey:kRedirectURIsKey];
-  [aCoder encodeObject:_responseTypes forKey:kResponseTypesKey];
-  [aCoder encodeObject:_grantTypes forKey:kGrantTypesKey];
-  [aCoder encodeObject:_subjectType forKey:kSubjectTypeKey];
-  [aCoder encodeObject:_tokenEndpointAuthenticationMethod
-                forKey:OIDTokenEndpointAuthenticationMethodParam];
-  [aCoder encodeObject:_additionalParameters forKey:kAdditionalParametersKey];
-}
-
-#pragma mark - NSObject overrides
-
-- (NSString *)description {
-  NSURLRequest *request = [self URLRequest];
-  NSString *requestBody = [[NSString alloc] initWithData:request.HTTPBody
-                                                encoding:NSUTF8StringEncoding];
-  return [NSString stringWithFormat:@"<%@: %p, request: <URL: %@, HTTPBody: %@>>",
-                                    NSStringFromClass([self class]),
-                                    (void *)self,
-                                    request.URL,
-                                    requestBody];
-}
-
-- (NSURLRequest *)URLRequest {
-  static NSString *const kHTTPPost = @"POST";
-  static NSString *const kBearer = @"Bearer";
-  static NSString *const kHTTPContentTypeHeaderKey = @"Content-Type";
-  static NSString *const kHTTPContentTypeHeaderValue = @"application/json";
-  static NSString *const kHTTPAuthorizationHeaderKey = @"Authorization";
-
-  NSData *postBody = [self JSONString];
-  if (!postBody) {
-    return nil;
-  }
-
-  NSURL *registrationRequestURL = _configuration.registrationEndpoint;
-  NSMutableURLRequest *URLRequest =
-      [[NSURLRequest requestWithURL:registrationRequestURL] mutableCopy];
-  URLRequest.HTTPMethod = kHTTPPost;
-  [URLRequest setValue:kHTTPContentTypeHeaderValue forHTTPHeaderField:kHTTPContentTypeHeaderKey];
-  if (_initialAccessToken) {
-    NSString *value = [NSString stringWithFormat:@"%@ %@", kBearer, _initialAccessToken];
-    [URLRequest setValue:value forHTTPHeaderField:kHTTPAuthorizationHeaderKey];
-  }
-  URLRequest.HTTPBody = postBody;
-  return URLRequest;
-}
-
-- (NSData *)JSONString {
-  // Dictionary with several kay/value pairs and the above array of arrays
-  NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
-  NSMutableArray<NSString *> *redirectURIStrings =
-  [NSMutableArray arrayWithCapacity:[_redirectURIs count]];
-  for (id obj in _redirectURIs) {
-    [redirectURIStrings addObject:[obj absoluteString]];
-  }
-  dict[OIDRedirectURIsParam] = redirectURIStrings;
-  dict[OIDApplicationTypeParam] = _applicationType;
-
-  if (_additionalParameters) {
-    // Add any additional parameters first to allow them
-    // to be overwritten by instance values
-    [dict addEntriesFromDictionary:_additionalParameters];
-  }
-  if (_responseTypes) {
-    dict[OIDResponseTypesParam] = _responseTypes;
-  }
-  if (_grantTypes) {
-    dict[OIDGrantTypesParam] = _grantTypes;
-  }
-  if (_subjectType) {
-    dict[OIDSubjectTypeParam] = _subjectType;
-  }
-  if (_tokenEndpointAuthenticationMethod) {
-    dict[OIDTokenEndpointAuthenticationMethodParam] = _tokenEndpointAuthenticationMethod;
-  }
-
-  NSError *error;
-  NSData *json = [NSJSONSerialization dataWithJSONObject:dict options:kNilOptions error:&error];
-  if (json == nil || error != nil) {
-    return nil;
-  }
-
-  return json;
-}
-
-@end

+ 0 - 126
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDRegistrationResponse.h

@@ -1,126 +0,0 @@
-/*! @file OIDRegistrationResponse.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2016 The AppAuth for iOS Authors. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-
-#import <Foundation/Foundation.h>
-
-@class OIDRegistrationRequest;
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief Parameter name for the client id.
- */
-extern NSString *const OIDClientIDParam;
-
-/*! @brief Parameter name for the client id issuance timestamp.
- */
-extern NSString *const OIDClientIDIssuedAtParam;
-
-/*! @brief Parameter name for the client secret.
- */
-extern NSString *const OIDClientSecretParam;
-
-/*! @brief Parameter name for the client secret expiration time.
- */
-extern NSString *const OIDClientSecretExpirestAtParam;
-
-/*! @brief Parameter name for the registration access token.
- */
-extern NSString *const OIDRegistrationAccessTokenParam;
-
-/*! @brief Parameter name for the client configuration URI.
- */
-extern NSString *const OIDRegistrationClientURIParam;
-
-/*! @brief Represents a registration response.
-    @see https://openid.net/specs/openid-connect-registration-1_0.html#RegistrationResponse
- */
-@interface OIDRegistrationResponse : NSObject <NSCopying, NSSecureCoding>
-
-/*! @brief The request which was serviced.
- */
-@property(nonatomic, readonly) OIDRegistrationRequest *request;
-
-/*! @brief The registered client identifier.
-    @remarks client_id
-    @see https://tools.ietf.org/html/rfc6749#section-4
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.1
- */
-@property(nonatomic, readonly) NSString *clientID;
-
-/*! @brief Timestamp of when the client identifier was issued, if provided.
-    @remarks client_id_issued_at
-    @see https://openid.net/specs/openid-connect-registration-1_0.html#RegistrationResponse
- */
-@property(nonatomic, readonly, nullable) NSDate *clientIDIssuedAt;
-
-/*! @brief TThe client secret, which is part of the client credentials, if provided.
-    @remarks client_secret
-    @see https://openid.net/specs/openid-connect-registration-1_0.html#RegistrationResponse
- */
-@property(nonatomic, readonly, nullable) NSString *clientSecret;
-
-/*! @brief Timestamp of when the client credentials expires, if provided.
-    @remarks client_secret_expires_at
-    @see https://openid.net/specs/openid-connect-registration-1_0.html#RegistrationResponse
- */
-@property(nonatomic, readonly, nullable) NSDate *clientSecretExpiresAt;
-
-/*! @brief Client registration access token that can be used for subsequent operations upon the
-        client registration.
-    @remarks registration_access_token
-    @see https://openid.net/specs/openid-connect-registration-1_0.html#RegistrationResponse
- */
-@property(nonatomic, readonly, nullable) NSString *registrationAccessToken;
-
-/*! @brief Location of the client configuration endpoint, if provided.
-    @remarks registration_client_uri
-    @see https://openid.net/specs/openid-connect-registration-1_0.html#RegistrationResponse
- */
-@property(nonatomic, readonly, nullable) NSURL *registrationClientURI;
-
-/*! @brief Client authentication method to use at the token endpoint, if provided.
-    @remarks token_endpoint_auth_method
-    @see http://openid.net/specs/openid-connect-core-1_0.html#ClientAuthentication
- */
-@property(nonatomic, readonly, nullable) NSString *tokenEndpointAuthenticationMethod;
-
-/*! @brief Additional parameters returned from the token server.
- */
-@property(nonatomic, readonly, nullable) NSDictionary<NSString *, NSObject <NSCopying> *>
-    *additionalParameters;
-
-/*! @internal
-    @brief Unavailable. Please use initWithRequest
- */
-- (instancetype)init NS_UNAVAILABLE;
-
-/*! @brief Designated initializer.
-    @param request The serviced request.
-    @param parameters The decoded parameters returned from the Authorization Server.
-    @remarks Known parameters are extracted from the @c parameters parameter and the normative
-        properties are populated. Non-normative parameters are placed in the
-        @c #additionalParameters dictionary.
- */
-- (instancetype)initWithRequest:(OIDRegistrationRequest *)request
-                     parameters:(NSDictionary<NSString *, NSObject <NSCopying> *> *)parameters
-                     NS_DESIGNATED_INITIALIZER;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 164
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDRegistrationResponse.m

@@ -1,164 +0,0 @@
-/*! @file OIDRegistrationResponse.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2016 The AppAuth for iOS Authors. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDRegistrationResponse.h"
-
-#import "OIDClientMetadataParameters.h"
-#import "OIDDefines.h"
-#import "OIDFieldMapping.h"
-#import "OIDRegistrationRequest.h"
-#import "OIDTokenUtilities.h"
-
-NSString *const OIDClientIDParam = @"client_id";
-NSString *const OIDClientIDIssuedAtParam = @"client_id_issued_at";
-NSString *const OIDClientSecretParam = @"client_secret";
-NSString *const OIDClientSecretExpirestAtParam = @"client_secret_expires_at";
-NSString *const OIDRegistrationAccessTokenParam = @"registration_access_token";
-NSString *const OIDRegistrationClientURIParam = @"registration_client_uri";
-
-/*! @brief Key used to encode the @c request property for @c NSSecureCoding
- */
-static NSString *const kRequestKey = @"request";
-
-/*! @brief Key used to encode the @c additionalParameters property for @c NSSecureCoding
- */
-static NSString *const kAdditionalParametersKey = @"additionalParameters";
-
-@implementation OIDRegistrationResponse
-
-/*! @brief Returns a mapping of incoming parameters to instance variables.
-    @return A mapping of incoming parameters to instance variables.
- */
-+ (NSDictionary<NSString *, OIDFieldMapping *> *)fieldMap {
-  static NSMutableDictionary<NSString *, OIDFieldMapping *> *fieldMap;
-  static dispatch_once_t onceToken;
-  dispatch_once(&onceToken, ^{
-    fieldMap = [NSMutableDictionary dictionary];
-    fieldMap[OIDClientIDParam] = [[OIDFieldMapping alloc] initWithName:@"_clientID"
-                                                                  type:[NSString class]];
-    fieldMap[OIDClientIDIssuedAtParam] =
-    [[OIDFieldMapping alloc] initWithName:@"_clientIDIssuedAt"
-                                     type:[NSDate class]
-                               conversion:[OIDFieldMapping dateEpochConversion]];
-    fieldMap[OIDClientSecretParam] =
-    [[OIDFieldMapping alloc] initWithName:@"_clientSecret"
-                                     type:[NSString class]];
-    fieldMap[OIDClientSecretExpirestAtParam] =
-    [[OIDFieldMapping alloc] initWithName:@"_clientSecretExpiresAt"
-                                     type:[NSDate class]
-                               conversion:[OIDFieldMapping dateEpochConversion]];
-    fieldMap[OIDRegistrationAccessTokenParam] =
-    [[OIDFieldMapping alloc] initWithName:@"_registrationAccessToken"
-                                     type:[NSString class]];
-    fieldMap[OIDRegistrationClientURIParam] =
-    [[OIDFieldMapping alloc] initWithName:@"_registrationClientURI"
-                                     type:[NSURL class]
-                               conversion:[OIDFieldMapping URLConversion]];
-    fieldMap[OIDTokenEndpointAuthenticationMethodParam] =
-    [[OIDFieldMapping alloc] initWithName:@"_tokenEndpointAuthenticationMethod"
-                                     type:[NSString class]];
-  });
-  return fieldMap;
-}
-
-
-#pragma mark - Initializers
-
-- (nonnull instancetype)init
-  OID_UNAVAILABLE_USE_INITIALIZER(@selector(initWithRequest:parameters:))
-
-- (instancetype)initWithRequest:(OIDRegistrationRequest *)request
-                              parameters:(NSDictionary<NSString *, NSObject <NSCopying> *> *)parameters {
-  self = [super init];
-  if (self) {
-    _request = [request copy];
-    NSDictionary<NSString *, NSObject <NSCopying> *> *additionalParameters =
-    [OIDFieldMapping remainingParametersWithMap:[[self class] fieldMap]
-                                     parameters:parameters
-                                       instance:self];
-    _additionalParameters = additionalParameters;
-
-    if ((_clientSecret && !_clientSecretExpiresAt)
-        || (!!_registrationClientURI != !!_registrationAccessToken)) {
-      // If client_secret is issued, client_secret_expires_at is REQUIRED,
-      // and the response MUST contain "[...] both a Client Configuration Endpoint
-      // and a Registration Access Token or neither of them"
-      return nil;
-    }
-  }
-  return self;
-}
-
-#pragma mark - NSCopying
-
-- (instancetype)copyWithZone:(nullable NSZone *)zone {
-  // The documentation for NSCopying specifically advises us to return a reference to the original
-  // instance in the case where instances are immutable (as ours is):
-  // "Implement NSCopying by retaining the original instead of creating a new copy when the class
-  // and its contents are immutable."
-  return self;
-}
-
-#pragma mark - NSSecureCoding
-
-+ (BOOL)supportsSecureCoding {
-  return YES;
-}
-
-- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder {
-  OIDRegistrationRequest *request = [aDecoder decodeObjectOfClass:[OIDRegistrationRequest class]
-                                                           forKey:kRequestKey];
-  self = [self initWithRequest:request
-                    parameters:@{}];
-  if (self) {
-    [OIDFieldMapping decodeWithCoder:aDecoder
-                                 map:[[self class] fieldMap]
-                            instance:self];
-    _additionalParameters = [aDecoder decodeObjectOfClasses:[OIDFieldMapping JSONTypes]
-                                                     forKey:kAdditionalParametersKey];
-  }
-  return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)aCoder {
-  [OIDFieldMapping encodeWithCoder:aCoder map:[[self class] fieldMap] instance:self];
-  [aCoder encodeObject:_request forKey:kRequestKey];
-  [aCoder encodeObject:_additionalParameters forKey:kAdditionalParametersKey];
-}
-
-#pragma mark - NSObject overrides
-
-- (NSString *)description {
-  return [NSString stringWithFormat:@"<%@: %p, clientID: \"%@\", clientIDIssuedAt: %@, "
-          "clientSecret: %@, clientSecretExpiresAt: \"%@\", "
-          "registrationAccessToken: \"%@\", "
-          "registrationClientURI: \"%@\", "
-          "additionalParameters: %@, request: %@>",
-          NSStringFromClass([self class]),
-          (void *)self,
-          _clientID,
-          _clientIDIssuedAt,
-          [OIDTokenUtilities redact:_clientSecret],
-          _clientSecretExpiresAt,
-          [OIDTokenUtilities redact:_registrationAccessToken],
-          _registrationClientURI,
-          _additionalParameters,
-          _request];
-}
-
-@end

+ 0 - 31
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDResponseTypes.h

@@ -1,31 +0,0 @@
-/*! @file OIDResponseTypes.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <Foundation/Foundation.h>
-
-/*! @brief A constant for the standard OAuth2 Response Type of 'code'.
- */
-extern NSString *const OIDResponseTypeCode;
-
-/*! @brief A constant for the standard OAuth2 Response Type of 'token'.
- */
-extern NSString *const OIDResponseTypeToken;
-
-/*! @brief A constant for the standard OAuth2 Response Type of 'id_token'.
- */
-extern NSString *const OIDResponseTypeIDToken;

+ 0 - 25
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDResponseTypes.m

@@ -1,25 +0,0 @@
-/*! @file OIDResponseTypes.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDResponseTypes.h"
-
-NSString *const OIDResponseTypeCode = @"code";
-
-NSString *const OIDResponseTypeToken = @"token";
-
-NSString *const OIDResponseTypeIDToken = @"id_token";

+ 0 - 48
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDScopeUtilities.h

@@ -1,48 +0,0 @@
-/*! @file OIDScopeUtilities.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief Provides convenience methods for dealing with scope strings.
- */
-@interface OIDScopeUtilities : NSObject
-
-/*! @internal
-    @brief Unavailable. This class should not be initialized.
- */
-- (instancetype)init NS_UNAVAILABLE;
-
-/*! @brief Converts an array of scope strings to a single scope string per the OAuth 2 spec.
-    @param scopes An array of scope strings.
-    @return A space-delimited string of scopes.
-    @see https://tools.ietf.org/html/rfc6749#section-3.3
- */
-+ (NSString *)scopesWithArray:(NSArray<NSString *> *)scopes;
-
-/*! @brief Converts an OAuth 2 spec-compliant scope string to an array of scopes.
-    @param scopes An OAuth 2 spec-compliant scope string.
-    @return An array of scope strings.
-    @see https://tools.ietf.org/html/rfc6749#section-3.3
- */
-+ (NSArray<NSString *> *)scopesArrayWithString:(NSString *)scopes;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 58
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDScopeUtilities.m

@@ -1,58 +0,0 @@
-/*! @file OIDScopeUtilities.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDScopeUtilities.h"
-
-@implementation OIDScopeUtilities
-
-/*! @brief A character set with the characters NOT allowed in a scope name.
-    @see https://tools.ietf.org/html/rfc6749#section-3.3
- */
-+ (NSCharacterSet *)disallowedScopeCharacters {
-  static NSCharacterSet *disallowedCharacters;
-  static dispatch_once_t onceToken;
-  dispatch_once(&onceToken, ^{
-    NSMutableCharacterSet *allowedCharacters;
-    allowedCharacters =
-        [NSMutableCharacterSet characterSetWithRange:NSMakeRange(0x23, 0x5B - 0x23 + 1)];
-    [allowedCharacters addCharactersInRange:NSMakeRange(0x5D, 0x7E - 0x5D + 1)];
-    [allowedCharacters addCharactersInString:@"\x21"];
-    disallowedCharacters = [allowedCharacters invertedSet];
-  });
-  return disallowedCharacters;
-}
-
-+ (NSString *)scopesWithArray:(NSArray<NSString *> *)scopes {
-#if !defined(NS_BLOCK_ASSERTIONS)
-  NSCharacterSet *disallowedCharacters = [self disallowedScopeCharacters];
-  for (NSString *scope in scopes) {
-    NSAssert(scope.length, @"Found illegal empty scope string.");
-    NSAssert([scope rangeOfCharacterFromSet:disallowedCharacters].location == NSNotFound,
-             @"Found illegal character in scope string.");
-  }
-#endif // !defined(NS_BLOCK_ASSERTIONS)
-
-  NSString *scopeString = [scopes componentsJoinedByString:@" "];
-  return scopeString;
-}
-
-+ (NSArray<NSString *> *)scopesArrayWithString:(NSString *)scopes {
-  return [scopes componentsSeparatedByString:@" "];
-}
-
-@end

+ 0 - 46
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDScopes.h

@@ -1,46 +0,0 @@
-/*! @file OIDScopes.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <Foundation/Foundation.h>
-
-/*! @brief Scope that indicates this request is an OpenID Connect request.
-    @see http://openid.net/specs/openid-connect-core-1_0.html#AuthRequestValidation
- */
-extern NSString *const OIDScopeOpenID;
-
-/*! @brief This scope value requests access to the End-User's default profile Claims, which are:
-        name, family_name, given_name, middle_name, nickname, preferred_username, profile, picture,
-        website, gender, birthdate, zoneinfo, locale, and updated_at.
-    @see http://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims
- */
-extern NSString *const OIDScopeProfile;
-
-/*! @brief This scope value requests access to the email and email_verified Claims.
-    @see http://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims
- */
-extern NSString *const OIDScopeEmail;
-
-/*! @brief This scope value requests access to the address Claim.
-    @see http://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims
- */
-extern NSString *const OIDScopeAddress;
-
-/*! @brief This scope value requests access to the phone_number and phone_number_verified Claims.
-    @see http://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims
- */
-extern NSString *const OIDScopePhone;

+ 0 - 29
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDScopes.m

@@ -1,29 +0,0 @@
-/*! @file OIDScopes.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDScopes.h"
-
-NSString *const OIDScopeOpenID = @"openid";
-
-NSString *const OIDScopeProfile = @"profile";
-
-NSString *const OIDScopeEmail = @"email";
-
-NSString *const OIDScopeAddress = @"address";
-
-NSString *const OIDScopePhone = @"phone";

+ 0 - 118
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDServiceConfiguration.h

@@ -1,118 +0,0 @@
-/*! @file OIDServiceConfiguration.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <Foundation/Foundation.h>
-
-@class OIDServiceConfiguration;
-@class OIDServiceDiscovery;
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief The type of block called when a @c OIDServiceConfiguration has been created
-        by loading a @c OIDServiceDiscovery from an @c NSURL.
- */
-typedef void (^OIDServiceConfigurationCreated)
-    (OIDServiceConfiguration *_Nullable serviceConfiguration,
-     NSError *_Nullable error);
-
-/*! @brief Represents the information needed to construct a @c OIDAuthorizationService.
- */
-@interface OIDServiceConfiguration : NSObject <NSCopying, NSSecureCoding>
-
-/*! @brief The authorization endpoint URI.
- */
-@property(nonatomic, readonly) NSURL *authorizationEndpoint;
-
-/*! @brief The token exchange and refresh endpoint URI.
- */
-@property(nonatomic, readonly) NSURL *tokenEndpoint;
-
-/*! @brief The OpenID Connect issuer.
- */
-@property(nonatomic, readonly, nullable) NSURL *issuer;
-
-/*! @brief The dynamic client registration endpoint URI.
- */
-@property(nonatomic, readonly, nullable) NSURL *registrationEndpoint;
-
-/*! @brief The end session logout endpoint URI.
- */
-@property(nonatomic, readonly, nullable) NSURL *endSessionEndpoint;
-
-/*! @brief The discovery document.
- */
-@property(nonatomic, readonly, nullable) OIDServiceDiscovery *discoveryDocument;
-
-/*! @internal
-    @brief Unavailable. Please use @c initWithAuthorizationEndpoint:tokenEndpoint: or
-        @c initWithDiscoveryDocument:.
- */
-- (instancetype)init NS_UNAVAILABLE;
-
-/*! @param authorizationEndpoint The authorization endpoint URI.
-    @param tokenEndpoint The token exchange and refresh endpoint URI.
- */
-- (instancetype)initWithAuthorizationEndpoint:(NSURL *)authorizationEndpoint
-                                tokenEndpoint:(NSURL *)tokenEndpoint;
-
-/*! @param authorizationEndpoint The authorization endpoint URI.
-    @param tokenEndpoint The token exchange and refresh endpoint URI.
-    @param registrationEndpoint The dynamic client registration endpoint URI.
- */
-- (instancetype)initWithAuthorizationEndpoint:(NSURL *)authorizationEndpoint
-                                tokenEndpoint:(NSURL *)tokenEndpoint
-                         registrationEndpoint:(nullable NSURL *)registrationEndpoint;
-
-/*! @param authorizationEndpoint The authorization endpoint URI.
-    @param tokenEndpoint The token exchange and refresh endpoint URI.
-    @param issuer The OpenID Connect issuer.
- */
-- (instancetype)initWithAuthorizationEndpoint:(NSURL *)authorizationEndpoint
-                                tokenEndpoint:(NSURL *)tokenEndpoint
-                                       issuer:(nullable NSURL *)issuer;
-
-/*! @param authorizationEndpoint The authorization endpoint URI.
-    @param tokenEndpoint The token exchange and refresh endpoint URI.
-    @param issuer The OpenID Connect issuer.
-    @param registrationEndpoint The dynamic client registration endpoint URI.
- */
-- (instancetype)initWithAuthorizationEndpoint:(NSURL *)authorizationEndpoint
-                                tokenEndpoint:(NSURL *)tokenEndpoint
-                                       issuer:(nullable NSURL *)issuer
-                         registrationEndpoint:(nullable NSURL *)registrationEndpoint;
-
-/*! @param authorizationEndpoint The authorization endpoint URI.
-    @param tokenEndpoint The token exchange and refresh endpoint URI.
-    @param issuer The OpenID Connect issuer.
-    @param registrationEndpoint The dynamic client registration endpoint URI.
-    @param endSessionEndpoint The end session endpoint (logout) URI.
- */
-- (instancetype)initWithAuthorizationEndpoint:(NSURL *)authorizationEndpoint
-                                tokenEndpoint:(NSURL *)tokenEndpoint
-                                       issuer:(nullable NSURL *)issuer
-                         registrationEndpoint:(nullable NSURL *)registrationEndpoint
-                           endSessionEndpoint:(nullable NSURL *)endSessionEndpoint;
-
-/*! @param discoveryDocument The discovery document from which to extract the required OAuth
-        configuration.
- */
-- (instancetype)initWithDiscoveryDocument:(OIDServiceDiscovery *)discoveryDocument;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 232
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDServiceConfiguration.m

@@ -1,232 +0,0 @@
-/*! @file OIDServiceConfiguration.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDServiceConfiguration.h"
-
-#import "OIDDefines.h"
-#import "OIDErrorUtilities.h"
-#import "OIDServiceDiscovery.h"
-
-/*! @brief The key for the @c authorizationEndpoint property.
- */
-static NSString *const kAuthorizationEndpointKey = @"authorizationEndpoint";
-
-/*! @brief The key for the @c tokenEndpoint property.
- */
-static NSString *const kTokenEndpointKey = @"tokenEndpoint";
-
-/*! @brief The key for the @c issuer property.
- */
-static NSString *const kIssuerKey = @"issuer";
-
-/*! @brief The key for the @c registrationEndpoint property.
- */
-static NSString *const kRegistrationEndpointKey = @"registrationEndpoint";
-
-/*! @brief The key for the @c endSessionEndpoint property.
- */
-static NSString *const kEndSessionEndpointKey = @"endSessionEndpoint";
-
-/*! @brief The key for the @c discoveryDocument property.
- */
-static NSString *const kDiscoveryDocumentKey = @"discoveryDocument";
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface OIDServiceConfiguration ()
-
-- (instancetype)initWithAuthorizationEndpoint:(NSURL *)authorizationEndpoint
-                                tokenEndpoint:(NSURL *)tokenEndpoint
-                                       issuer:(nullable NSURL *)issuer
-                         registrationEndpoint:(nullable NSURL *)registrationEndpoint
-                           endSessionEndpoint:(nullable NSURL *)endSessionEndpoint
-                            discoveryDocument:(nullable OIDServiceDiscovery *)discoveryDocument
-                            NS_DESIGNATED_INITIALIZER;
-
-@end
-
-@implementation OIDServiceConfiguration
-
-- (instancetype)init
-    OID_UNAVAILABLE_USE_INITIALIZER(@selector(
-        initWithAuthorizationEndpoint:
-                        tokenEndpoint:)
-    )
-
-- (instancetype)initWithAuthorizationEndpoint:(NSURL *)authorizationEndpoint
-        tokenEndpoint:(NSURL *)tokenEndpoint
-               issuer:(nullable NSURL *)issuer
- registrationEndpoint:(nullable NSURL *)registrationEndpoint
-   endSessionEndpoint:(nullable NSURL *)endSessionEndpoint
-    discoveryDocument:(nullable OIDServiceDiscovery *)discoveryDocument {
-
-  self = [super init];
-  if (self) {
-    _authorizationEndpoint = [authorizationEndpoint copy];
-    _tokenEndpoint = [tokenEndpoint copy];
-    _issuer = [issuer copy];
-    _registrationEndpoint = [registrationEndpoint copy];
-    _endSessionEndpoint = [endSessionEndpoint copy];
-    _discoveryDocument = [discoveryDocument copy];
-  }
-  return self;
-}
-
-- (instancetype)initWithAuthorizationEndpoint:(NSURL *)authorizationEndpoint
-                                tokenEndpoint:(NSURL *)tokenEndpoint {
-  return [self initWithAuthorizationEndpoint:authorizationEndpoint
-                               tokenEndpoint:tokenEndpoint
-                                      issuer:nil
-                        registrationEndpoint:nil
-                          endSessionEndpoint:nil
-                           discoveryDocument:nil];
-}
-
-- (instancetype)initWithAuthorizationEndpoint:(NSURL *)authorizationEndpoint
-                                tokenEndpoint:(NSURL *)tokenEndpoint
-                         registrationEndpoint:(nullable NSURL *)registrationEndpoint {
-  return [self initWithAuthorizationEndpoint:authorizationEndpoint
-                               tokenEndpoint:tokenEndpoint
-                                      issuer:nil
-                        registrationEndpoint:registrationEndpoint
-                          endSessionEndpoint:nil
-                           discoveryDocument:nil];
-}
-
-- (instancetype)initWithAuthorizationEndpoint:(NSURL *)authorizationEndpoint
-                                tokenEndpoint:(NSURL *)tokenEndpoint
-                                       issuer:(nullable NSURL *)issuer {
-  return [self initWithAuthorizationEndpoint:authorizationEndpoint
-                               tokenEndpoint:tokenEndpoint
-                                      issuer:issuer
-                        registrationEndpoint:nil
-                          endSessionEndpoint:nil
-                           discoveryDocument:nil];
-}
-
-- (instancetype)initWithAuthorizationEndpoint:(NSURL *)authorizationEndpoint
-                                tokenEndpoint:(NSURL *)tokenEndpoint
-                                       issuer:(nullable NSURL *)issuer
-                         registrationEndpoint:(nullable NSURL *)registrationEndpoint {
-  return [self initWithAuthorizationEndpoint:authorizationEndpoint
-                               tokenEndpoint:tokenEndpoint
-                                      issuer:issuer
-                        registrationEndpoint:registrationEndpoint
-                          endSessionEndpoint:nil
-                           discoveryDocument:nil];
-}
-
-- (instancetype)initWithAuthorizationEndpoint:(NSURL *)authorizationEndpoint
-                                tokenEndpoint:(NSURL *)tokenEndpoint
-                                       issuer:(nullable NSURL *)issuer
-                         registrationEndpoint:(nullable NSURL *)registrationEndpoint
-                           endSessionEndpoint:(nullable NSURL *)endSessionEndpoint {
-  return [self initWithAuthorizationEndpoint:authorizationEndpoint
-                               tokenEndpoint:tokenEndpoint
-                                      issuer:issuer
-                        registrationEndpoint:registrationEndpoint
-                          endSessionEndpoint:endSessionEndpoint
-                           discoveryDocument:nil];
-}
-
-- (instancetype)initWithDiscoveryDocument:(OIDServiceDiscovery *) discoveryDocument {
-  return [self initWithAuthorizationEndpoint:discoveryDocument.authorizationEndpoint
-                               tokenEndpoint:discoveryDocument.tokenEndpoint
-                                      issuer:discoveryDocument.issuer
-                        registrationEndpoint:discoveryDocument.registrationEndpoint
-                          endSessionEndpoint:discoveryDocument.endSessionEndpoint
-                           discoveryDocument:discoveryDocument];
-}
-
-#pragma mark - NSCopying
-
-- (instancetype)copyWithZone:(nullable NSZone *)zone {
-  // The documentation for NSCopying specifically advises us to return a reference to the original
-  // instance in the case where instances are immutable (as ours is):
-  // "Implement NSCopying by retaining the original instead of creating a new copy when the class
-  // and its contents are immutable."
-  return self;
-}
-
-#pragma mark - NSSecureCoding
-
-+ (BOOL)supportsSecureCoding {
-  return YES;
-}
-
-- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder {
-  NSURL *authorizationEndpoint = [aDecoder decodeObjectOfClass:[NSURL class]
-                                                        forKey:kAuthorizationEndpointKey];
-  NSURL *tokenEndpoint = [aDecoder decodeObjectOfClass:[NSURL class]
-                                                forKey:kTokenEndpointKey];
-  NSURL *issuer = [aDecoder decodeObjectOfClass:[NSURL class]
-                                         forKey:kIssuerKey];
-  NSURL *registrationEndpoint = [aDecoder decodeObjectOfClass:[NSURL class]
-                                                       forKey:kRegistrationEndpointKey];
-  NSURL *endSessionEndpoint = [aDecoder decodeObjectOfClass:[NSURL class]
-                                                       forKey:kEndSessionEndpointKey];
-  // We don't accept nil authorizationEndpoints or tokenEndpoints.
-  if (!authorizationEndpoint || !tokenEndpoint) {
-    return nil;
-  }
-
-  NSSet<Class> *allowedClasses = [NSSet setWithArray:@[[OIDServiceDiscovery class],
-                                                       // The following classes are required in
-                                                       // order to support secure decoding of the
-                                                       // old OIDServiceDiscovery encoding.
-                                                       [NSDictionary class],
-                                                       [NSArray class],
-                                                       [NSString class],
-                                                       [NSNumber class],
-                                                       [NSNull class]]];
-  OIDServiceDiscovery *discoveryDocument = [aDecoder decodeObjectOfClasses:allowedClasses
-                                                                    forKey:kDiscoveryDocumentKey];
-
-  return [self initWithAuthorizationEndpoint:authorizationEndpoint
-                               tokenEndpoint:tokenEndpoint
-                                      issuer:issuer
-                        registrationEndpoint:registrationEndpoint
-                          endSessionEndpoint:endSessionEndpoint
-                           discoveryDocument:discoveryDocument];
-}
-
-- (void)encodeWithCoder:(NSCoder *)aCoder {
-  [aCoder encodeObject:_authorizationEndpoint forKey:kAuthorizationEndpointKey];
-  [aCoder encodeObject:_tokenEndpoint forKey:kTokenEndpointKey];
-  [aCoder encodeObject:_issuer forKey:kIssuerKey];
-  [aCoder encodeObject:_registrationEndpoint forKey:kRegistrationEndpointKey];
-  [aCoder encodeObject:_discoveryDocument forKey:kDiscoveryDocumentKey];
-  [aCoder encodeObject:_endSessionEndpoint forKey:kEndSessionEndpointKey];
-}
-
-#pragma mark - description
-
-- (NSString *)description {
-  return [NSString stringWithFormat:
-      @"OIDServiceConfiguration authorizationEndpoint: %@, tokenEndpoint: %@, "
-          "registrationEndpoint: %@, endSessionEndpoint: %@, discoveryDocument: [%@]",
-      _authorizationEndpoint,
-      _tokenEndpoint,
-      _registrationEndpoint,
-      _endSessionEndpoint,
-      _discoveryDocument];
-}
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 364
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDServiceDiscovery.h

@@ -1,364 +0,0 @@
-/*! @file OIDServiceDiscovery.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief Represents an OpenID Connect 1.0 Discovery Document
-    @see https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata
- */
-@interface OIDServiceDiscovery : NSObject <NSCopying, NSSecureCoding>
-
-/*! @brief The decoded OpenID Connect 1.0 Discovery Document as a dictionary.
- */
-@property(nonatomic, readonly) NSDictionary<NSString *, id> *discoveryDictionary;
-
-/*! @brief REQUIRED. URL using the @c https scheme with no query or fragment component that the OP
-        asserts as its Issuer Identifier. If Issuer discovery is supported, this value MUST be
-        identical to the issuer value returned by WebFinger. This also MUST be identical to the
-        @c iss Claim value in ID Tokens issued from this Issuer.
-    @remarks issuer
-    @seealso https://openid.net/specs/openid-connect-discovery-1_0.html#IssuerDiscovery
- */
-@property(nonatomic, readonly) NSURL *issuer;
-
-/*! @brief REQUIRED. URL of the OP's OAuth 2.0 Authorization Endpoint.
-    @remarks authorization_endpoint
-    @seealso http://openid.net/specs/openid-connect-core-1_0.html#AuthorizationEndpoint
- */
-@property(nonatomic, readonly) NSURL *authorizationEndpoint;
-
-/*! @brief OPTIONAL. URL of the OP's OAuth 2.0 Device Authorization Endpoint.
-    @remarks device_authorization_endpoint
-    @seealso https://tools.ietf.org/html/rfc8628#section-4
- */
-@property(nonatomic, readonly, nullable) NSURL *deviceAuthorizationEndpoint;
-
-/*! @brief URL of the OP's OAuth 2.0 Token Endpoint. This is REQUIRED unless only the Implicit Flow
-        is used.
-    @remarks token_endpoint
-    @seealso http://openid.net/specs/openid-connect-core-1_0.html#TokenEndpoint
- */
-@property(nonatomic, readonly) NSURL *tokenEndpoint;
-
-/*! @brief RECOMMENDED. URL of the OP's UserInfo Endpoint. This URL MUST use the https scheme and
-        MAY contain port, path, and query parameter components.
-    @remarks userinfo_endpoint
-    @seealso http://openid.net/specs/openid-connect-core-1_0.html#UserInfo
- */
-@property(nonatomic, readonly, nullable) NSURL *userinfoEndpoint;
-
-/*! @brief REQUIRED. URL of the OP's JSON Web Key Set document. This contains the signing key(s) the
-        RP uses to validate signatures from the OP. The JWK Set MAY also contain the Server's
-        encryption key(s), which are used by RPs to encrypt requests to the Server. When both
-        signing and encryption keys are made available, a use (Key Use) parameter value is REQUIRED
-        for all keys in the referenced JWK Set to indicate each key's intended usage. Although some
-        algorithms allow the same key to be used for both signatures and encryption, doing so is NOT
-        RECOMMENDED, as it is less secure. The JWK x5c parameter MAY be used to provide X.509
-        representations of keys provided. When used, the bare key values MUST still be present and
-        MUST match those in the certificate.
-    @remarks jwks_uri
-    @seealso http://tools.ietf.org/html/rfc7517
- */
-@property(nonatomic, readonly) NSURL *jwksURL;
-
-/*! @brief RECOMMENDED. URL of the OP's Dynamic Client Registration Endpoint.
-    @remarks registration_endpoint
-    @seealso http://openid.net/specs/openid-connect-registration-1_0.html
- */
-@property(nonatomic, readonly, nullable) NSURL *registrationEndpoint;
-
-/* @brief OPTIONAL. URL of the OP's RP-Initiated Logout endpoint.
-   @remarks end_session_endpoint
-   @seealso http://openid.net/specs/openid-connect-session-1_0.html#OPMetadata
- */
-@property(nonatomic, readonly, nullable) NSURL *endSessionEndpoint;
-
-/*! @brief RECOMMENDED. JSON array containing a list of the OAuth 2.0 [RFC6749] scope values that
-        this server supports. The server MUST support the openid scope value. Servers MAY choose not
-        to advertise some supported scope values even when this parameter is used, although those
-        defined in [OpenID.Core] SHOULD be listed, if supported.
-    @remarks scopes_supported
-    @seealso http://tools.ietf.org/html/rfc6749#section-3.3
- */
-@property(nonatomic, readonly, nullable) NSArray<NSString *> *scopesSupported;
-
-/*! @brief REQUIRED. JSON array containing a list of the OAuth 2.0 @c response_type values that this
-        OP supports. Dynamic OpenID Providers MUST support the @c code, @c id_token, and the token
-        @c id_token Response Type values.
-    @remarks response_types_supported
- */
-@property(nonatomic, readonly) NSArray<NSString *> *responseTypesSupported;
-
-/*! @brief OPTIONAL. JSON array containing a list of the OAuth 2.0 @c response_mode values that this
-        OP supports, as specified in OAuth 2.0 Multiple Response Type Encoding Practices. If
-        omitted, the default for Dynamic OpenID Providers is @c ["query", "fragment"].
-    @remarks response_modes_supported
-    @seealso http://openid.net/specs/oauth-v2-multiple-response-types-1_0.html
- */
-@property(nonatomic, readonly, nullable) NSArray<NSString *> *responseModesSupported;
-
-/*! @brief OPTIONAL. JSON array containing a list of the OAuth 2.0 Grant Type values that this OP
-        supports. Dynamic OpenID Providers MUST support the @c authorization_code and @c implicit
-        Grant Type values and MAY support other Grant Types. If omitted, the default value is
-        @c ["authorization_code", "implicit"].
-    @remarks grant_types_supported
- */
-@property(nonatomic, readonly, nullable) NSArray<NSString *> *grantTypesSupported;
-
-/*! @brief OPTIONAL. JSON array containing a list of the Authentication Context Class References
-        that this OP supports.
-    @remarks acr_values_supported
- */
-@property(nonatomic, readonly, nullable) NSArray<NSString *> *acrValuesSupported;
-
-/*! @brief REQUIRED. JSON array containing a list of the Subject Identifier types that this OP
-        supports. Valid types include @c pairwise and @c public.
-    @remarks subject_types_supported
- */
-@property(nonatomic, readonly) NSArray<NSString *> *subjectTypesSupported;
-
-/*! @brief REQUIRED. JSON array containing a list of the JWS signing algorithms (@c alg values)
-        supported by the OP for the ID Token to encode the Claims in a JWT. The algorithm @c RS256
-        MUST be included. The value @c none MAY be supported, but MUST NOT be used unless the
-        Response Type used returns no ID Token from the Authorization Endpoint (such as when using
-        the Authorization Code Flow).
-    @remarks id_token_signing_alg_values_supported
-    @seealso https://tools.ietf.org/html/rfc7519
- */
-@property(nonatomic, readonly) NSArray<NSString *> *IDTokenSigningAlgorithmValuesSupported;
-
-/*! @brief OPTIONAL. JSON array containing a list of the JWE encryption algorithms (@c alg values)
-        supported by the OP for the ID Token to encode the Claims in a JWT.
-    @remarks id_token_encryption_alg_values_supported
-    @seealso https://tools.ietf.org/html/rfc7519
- */
-@property(nonatomic, readonly, nullable)
-    NSArray<NSString *> *IDTokenEncryptionAlgorithmValuesSupported;
-
-/*! @brief OPTIONAL. JSON array containing a list of the JWE encryption algorithms (@c enc values)
-        supported by the OP for the ID Token to encode the Claims in a JWT.
-    @remarks id_token_encryption_enc_values_supported
-    @seealso https://tools.ietf.org/html/rfc7519
- */
-@property(nonatomic, readonly, nullable)
-    NSArray<NSString *> *IDTokenEncryptionEncodingValuesSupported;
-
-/*! @brief OPTIONAL. JSON array containing a list of the JWS signing algorithms (@c alg values)
-        supported by the UserInfo Endpoint to encode the Claims in a JWT. The value none MAY be
-        included.
-    @remarks userinfo_signing_alg_values_supported
-    @seealso https://tools.ietf.org/html/rfc7515
-    @seealso https://tools.ietf.org/html/rfc7518
-    @seealso https://tools.ietf.org/html/rfc7519
- */
-@property(nonatomic, readonly, nullable)
-    NSArray<NSString *> *userinfoSigningAlgorithmValuesSupported;
-
-/*! @brief OPTIONAL. JSON array containing a list of the JWE encryption algorithms (alg values)
-        supported by the UserInfo Endpoint to encode the Claims in a JWT.
-    @remarks userinfo_encryption_alg_values_supported
-    @seealso https://tools.ietf.org/html/rfc7516
-    @seealso https://tools.ietf.org/html/rfc7518
-    @seealso https://tools.ietf.org/html/rfc7519
- */
-@property(nonatomic, readonly, nullable)
-    NSArray<NSString *> *userinfoEncryptionAlgorithmValuesSupported;
-
-/*! @brief OPTIONAL. JSON array containing a list of the JWE encryption algorithms (@c enc values)
-        supported by the UserInfo Endpoint to encode the Claims in a JWT.
-    @remarks userinfo_encryption_enc_values_supported
-    @seealso https://tools.ietf.org/html/rfc7519
- */
-@property(nonatomic, readonly, nullable)
-    NSArray<NSString *> *userinfoEncryptionEncodingValuesSupported;
-
-/*! @brief OPTIONAL. JSON array containing a list of the JWS signing algorithms (@c alg values)
-        supported by the OP for Request Objects, which are described in Section 6.1 of OpenID
-        Connect Core 1.0. These algorithms are used both when the Request Object is passed by value
-        (using the request parameter) and when it is passed by reference (using the @c request_uri
-        parameter). Servers SHOULD support @c none and @c RS256.
-    @remarks request_object_signing_alg_values_supported
-    @seealso http://openid.net/specs/openid-connect-core-1_0.html
- */
-@property(nonatomic, readonly, nullable)
-    NSArray<NSString *> *requestObjectSigningAlgorithmValuesSupported;
-
-/*! @brief OPTIONAL. JSON array containing a list of the JWE encryption algorithms (@c alg values)
-        supported by the OP for Request Objects. These algorithms are used both when the Request
-        Object is passed by value and when it is passed by reference.
-    @remarks request_object_encryption_alg_values_supported
- */
-@property(nonatomic, readonly, nullable)
-    NSArray<NSString *> *requestObjectEncryptionAlgorithmValuesSupported;
-
-/*! @brief OPTIONAL. JSON array containing a list of the JWE encryption algorithms (@c enc values)
-        supported by the OP for Request Objects. These algorithms are used both when the Request
-        Object is passed by value and when it is passed by reference.
-    @remarks request_object_encryption_enc_values_supported
- */
-@property(nonatomic, readonly, nullable)
-    NSArray<NSString *> *requestObjectEncryptionEncodingValuesSupported;
-
-/*! @brief OPTIONAL. JSON array containing a list of Client Authentication methods supported by this
-        Token Endpoint. The options are @c client_secret_post, @c client_secret_basic,
-        @c client_secret_jwt, and @c private_key_jwt, as described in Section 9 of OpenID Connect
-        Core 1.0. Other authentication methods MAY be defined by extensions. If omitted, the default
-        is @c client_secret_basic -- the HTTP Basic Authentication Scheme specified in Section 2.3.1
-        of OAuth 2.0.
-    @remarks token_endpoint_auth_methods_supported
-    @seealso http://openid.net/specs/openid-connect-core-1_0.html
-    @seealso http://tools.ietf.org/html/rfc6749#section-2.3.1
- */
-@property(nonatomic, readonly, nullable) NSArray<NSString *> *tokenEndpointAuthMethodsSupported;
-
-/*! @brief OPTIONAL. JSON array containing a list of the JWS signing algorithms (@c alg values)
-        supported by the Token Endpoint for the signature on the JWT used to authenticate the Client
-        at the Token Endpoint for the @c private_key_jwt and @c client_secret_jwt authentication
-        methods. Servers SHOULD support @c RS256. The value @c none MUST NOT be used.
-    @remarks token_endpoint_auth_signing_alg_values_supported
-    @seealso https://tools.ietf.org/html/rfc7519
- */
-@property(nonatomic, readonly, nullable)
-    NSArray<NSString *> *tokenEndpointAuthSigningAlgorithmValuesSupported;
-
-/*! @brief OPTIONAL. JSON array containing a list of the @c display parameter values that the OpenID
-        Provider supports. These values are described in Section 3.1.2.1 of OpenID Connect Core 1.0.
-    @remarks display_values_supported
-    @seealso http://openid.net/specs/openid-connect-core-1_0.html
- */
-@property(nonatomic, readonly, nullable) NSArray<NSString *> *displayValuesSupported;
-
-/*! @brief OPTIONAL. JSON array containing a list of the Claim Types that the OpenID Provider
-        supports. These Claim Types are described in Section 5.6 of OpenID Connect Core 1.0. Values
-        defined by this specification are @c normal, @c aggregated, and @c distributed. If omitted,
-        the implementation supports only @c normal Claims.
-    @remarks claim_types_supported
-    @seealso http://openid.net/specs/openid-connect-core-1_0.html
- */
-@property(nonatomic, readonly, nullable) NSArray<NSString *> *claimTypesSupported;
-
-/*! @brief RECOMMENDED. JSON array containing a list of the Claim Names of the Claims that the
-        OpenID Provider MAY be able to supply values for. Note that for privacy or other reasons,
-        this might not be an exhaustive list.
-    @remarks claims_supported
- */
-@property(nonatomic, readonly, nullable) NSArray<NSString *> *claimsSupported;
-
-/*! @brief OPTIONAL. URL of a page containing human-readable information that developers might want
-        or need to know when using the OpenID Provider. In particular, if the OpenID Provider does
-        not support Dynamic Client Registration, then information on how to register Clients needs
-        to be provided in this documentation.
-    @remarks service_documentation
- */
-@property(nonatomic, readonly, nullable) NSURL *serviceDocumentation;
-
-/*! @brief OPTIONAL. Languages and scripts supported for values in Claims being returned,
-        represented as a JSON array of BCP47 language tag values. Not all languages and scripts are
-        necessarily supported for all Claim values.
-    @remarks claims_locales_supported
-    @seealso http://tools.ietf.org/html/rfc5646
- */
-@property(nonatomic, readonly, nullable) NSArray<NSString *> *claimsLocalesSupported;
-
-/*! @brief OPTIONAL. Languages and scripts supported for the user interface, represented as a JSON
-        array of BCP47 language tag values.
-    @remarks ui_locales_supported
-    @seealso http://tools.ietf.org/html/rfc5646
- */
-@property(nonatomic, readonly, nullable) NSArray<NSString *> *UILocalesSupported;
-
-/*! @brief OPTIONAL. Boolean value specifying whether the OP supports use of the claims parameter,
-        with @c true indicating support. If omitted, the default value is @c false.
-    @remarks claims_parameter_supported
- */
-@property(nonatomic, readonly) BOOL claimsParameterSupported;
-
-/*! @brief OPTIONAL. Boolean value specifying whether the OP supports use of the request parameter,
-        with @c true indicating support. If omitted, the default value is @c false.
-    @remarks request_parameter_supported
- */
-@property(nonatomic, readonly) BOOL requestParameterSupported;
-
-/*! @brief OPTIONAL. Boolean value specifying whether the OP supports use of the @c request_uri
-        parameter, with true indicating support. If omitted, the default value is @c true.
-    @remarks request_uri_parameter_supported
- */
-@property(nonatomic, readonly) BOOL requestURIParameterSupported;
-
-/*! @brief OPTIONAL. Boolean value specifying whether the OP requires any @c request_uri values used
-        to be pre-registered using the @c request_uris registration parameter. Pre-registration is
-        REQUIRED when the value is @c true. If omitted, the default value is @c false.
-    @remarks require_request_uri_registration
- */
-@property(nonatomic, readonly) BOOL requireRequestURIRegistration;
-
-/*! @brief OPTIONAL. URL that the OpenID Provider provides to the person registering the Client to
-        read about the OP's requirements on how the Relying Party can use the data provided by the
-        OP. The registration process SHOULD display this URL to the person registering the Client if
-        it is given.
-    @remarks op_policy_uri
- */
-@property(nonatomic, readonly, nullable) NSURL *OPPolicyURI;
-
-/*! @brief OPTIONAL. URL that the OpenID Provider provides to the person registering the Client to
-        read about OpenID Provider's terms of service. The registration process SHOULD display this
-        URL to the person registering the Client if it is given.
-    @remarks op_tos_uri
- */
-@property(nonatomic, readonly, nullable) NSURL *OPTosURI;
-
-/*! @internal
-    @brief Unavailable. Please use @c initWithDictionary:error:, @c initWithJSON:error, or the
-        @c discoverServiceConfigurationForDiscoveryURL:callback: from @c OIDAuthorizationService.
- */
-- (nonnull instancetype)init NS_UNAVAILABLE;
-
-/*! @brief Decodes a OpenID Connect Discovery 1.0 JSON document.
-    @param serviceDiscoveryJSON An OpenID Connect Service Discovery document.
-    @param error If a required field is missing from the dictionary, an error with domain
-        @c ::OIDGeneralErrorDomain and code @c ::OIDErrorCodeInvalidDiscoveryDocument will be
-        returned.
- */
-- (nullable instancetype)initWithJSON:(NSString *)serviceDiscoveryJSON
-                                error:(NSError **_Nullable)error;
-
-/*! @brief Decodes a OpenID Connect Discovery 1.0 JSON document.
-    @param serviceDiscoveryJSONData An OpenID Connect Service Discovery document.
-    @param error If a required field is missing from the dictionary, an error with domain
-        @c ::OIDGeneralErrorDomain and code @c ::OIDErrorCodeInvalidDiscoveryDocument will be
-        returned.
- */
-- (nullable instancetype)initWithJSONData:(NSData *)serviceDiscoveryJSONData
-                                    error:(NSError **_Nullable)error;
-
-/*! @brief Designated initializer. The dictionary keys should match the keys defined in the OpenID
-        Connect Discovery 1.0 standard for OpenID Provider Metadata.
-    @param serviceDiscoveryDictionary A dictionary representing an OpenID Connect Service Discovery
-        document.
-    @param error If a required field is missing from the dictionary, an error with domain
-        @c ::OIDGeneralErrorDomain and code @c ::OIDErrorCodeInvalidDiscoveryDocument will be
-        returned.
- */
-- (nullable instancetype)initWithDictionary:(NSDictionary *)serviceDiscoveryDictionary
-                                      error:(NSError **_Nullable)error NS_DESIGNATED_INITIALIZER;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 393
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDServiceDiscovery.m

@@ -1,393 +0,0 @@
-/*! @file OIDServiceDiscovery.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDServiceDiscovery.h"
-
-#import "OIDDefines.h"
-#import "OIDErrorUtilities.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief The key for the @c discoveryDictionary property.
- */
-static NSString *const kDiscoveryDictionaryKey = @"discoveryDictionary";
-
-/*! Field keys associated with an OpenID Connect Discovery Document. */
-static NSString *const kIssuerKey = @"issuer";
-static NSString *const kAuthorizationEndpointKey = @"authorization_endpoint";
-static NSString *const kDeviceAuthorizationEndpointKey = @"device_authorization_endpoint";
-static NSString *const kTokenEndpointKey = @"token_endpoint";
-static NSString *const kUserinfoEndpointKey = @"userinfo_endpoint";
-static NSString *const kJWKSURLKey = @"jwks_uri";
-static NSString *const kRegistrationEndpointKey = @"registration_endpoint";
-static NSString *const kEndSessionEndpointKey = @"end_session_endpoint";
-static NSString *const kScopesSupportedKey = @"scopes_supported";
-static NSString *const kResponseTypesSupportedKey = @"response_types_supported";
-static NSString *const kResponseModesSupportedKey = @"response_modes_supported";
-static NSString *const kGrantTypesSupportedKey = @"grant_types_supported";
-static NSString *const kACRValuesSupportedKey = @"acr_values_supported";
-static NSString *const kSubjectTypesSupportedKey = @"subject_types_supported";
-static NSString *const kIDTokenSigningAlgorithmValuesSupportedKey =
-    @"id_token_signing_alg_values_supported";
-static NSString *const kIDTokenEncryptionAlgorithmValuesSupportedKey =
-    @"id_token_encryption_alg_values_supported";
-static NSString *const kIDTokenEncryptionEncodingValuesSupportedKey =
-    @"id_token_encryption_enc_values_supported";
-static NSString *const kUserinfoSigningAlgorithmValuesSupportedKey =
-    @"userinfo_signing_alg_values_supported";
-static NSString *const kUserinfoEncryptionAlgorithmValuesSupportedKey =
-    @"userinfo_encryption_alg_values_supported";
-static NSString *const kUserinfoEncryptionEncodingValuesSupportedKey =
-    @"userinfo_encryption_enc_values_supported";
-static NSString *const kRequestObjectSigningAlgorithmValuesSupportedKey =
-    @"request_object_signing_alg_values_supported";
-static NSString *const kRequestObjectEncryptionAlgorithmValuesSupportedKey =
-    @"request_object_encryption_alg_values_supported";
-static NSString *const kRequestObjectEncryptionEncodingValuesSupported =
-    @"request_object_encryption_enc_values_supported";
-static NSString *const kTokenEndpointAuthMethodsSupportedKey =
-    @"token_endpoint_auth_methods_supported";
-static NSString *const kTokenEndpointAuthSigningAlgorithmValuesSupportedKey =
-    @"token_endpoint_auth_signing_alg_values_supported";
-static NSString *const kDisplayValuesSupportedKey = @"display_values_supported";
-static NSString *const kClaimTypesSupportedKey = @"claim_types_supported";
-static NSString *const kClaimsSupportedKey = @"claims_supported";
-static NSString *const kServiceDocumentationKey = @"service_documentation";
-static NSString *const kClaimsLocalesSupportedKey = @"claims_locales_supported";
-static NSString *const kUILocalesSupportedKey = @"ui_locales_supported";
-static NSString *const kClaimsParameterSupportedKey = @"claims_parameter_supported";
-static NSString *const kRequestParameterSupportedKey = @"request_parameter_supported";
-static NSString *const kRequestURIParameterSupportedKey = @"request_uri_parameter_supported";
-static NSString *const kRequireRequestURIRegistrationKey = @"require_request_uri_registration";
-static NSString *const kOPPolicyURIKey = @"op_policy_uri";
-static NSString *const kOPTosURIKey = @"op_tos_uri";
-
-@implementation OIDServiceDiscovery {
-  NSDictionary *_discoveryDictionary;
-}
-
-- (nonnull instancetype)init OID_UNAVAILABLE_USE_INITIALIZER(@selector(initWithDictionary:error:))
-
-- (nullable instancetype)initWithJSON:(NSString *)serviceDiscoveryJSON error:(NSError **)error {
-  NSData *jsonData = [serviceDiscoveryJSON dataUsingEncoding:NSUTF8StringEncoding];
-  return [self initWithJSONData:jsonData error:error];
-}
-
-- (nullable instancetype)initWithJSONData:(NSData *)serviceDiscoveryJSONData
-                                    error:(NSError **_Nullable)error {
-  NSError *jsonError;
-  NSDictionary *json =
-      [NSJSONSerialization JSONObjectWithData:serviceDiscoveryJSONData options:0 error:&jsonError];
-  if (!json || jsonError) {
-    *error = [OIDErrorUtilities errorWithCode:OIDErrorCodeJSONDeserializationError
-                              underlyingError:jsonError
-                                  description:jsonError.localizedDescription];
-    return nil;
-  }
-  if (![json isKindOfClass:[NSDictionary class]]) {
-    *error = [OIDErrorUtilities errorWithCode:OIDErrorCodeInvalidDiscoveryDocument
-                              underlyingError:nil
-                                  description:@"Discovery document isn't a dictionary"];
-    return nil;
-  }
-
-  return [self initWithDictionary:json error:error];
-}
-
-- (nullable instancetype)initWithDictionary:(NSDictionary *)serviceDiscoveryDictionary
-                                      error:(NSError **_Nullable)error {
-  if (![[self class] dictionaryHasRequiredFields:serviceDiscoveryDictionary error:error]) {
-    return nil;
-  }
-  self = [super init];
-  if (self) {
-    _discoveryDictionary = [serviceDiscoveryDictionary copy];
-  }
-  return self;
-}
-
-#pragma mark -
-
-/*! @brief Checks to see if the specified dictionary contains the required fields.
-    @discussion This test is not meant to provide semantic analysis of the document (eg. fields
-        where the value @c none is not an allowed option would not cause this method to fail if
-        their value was @c none.) We are just testing to make sure we can meet the nullability
-        contract we promised in the header.
- */
-+ (BOOL)dictionaryHasRequiredFields:(NSDictionary<NSString *, id> *)dictionary
-                              error:(NSError **_Nullable)error {
-  static NSString *const kMissingFieldErrorText = @"Missing field: %@";
-  static NSString *const kInvalidURLFieldErrorText = @"Invalid URL: %@";
-
-  NSArray *requiredFields = @[
-    kIssuerKey,
-    kAuthorizationEndpointKey,
-    kTokenEndpointKey,
-    kJWKSURLKey,
-    kResponseTypesSupportedKey,
-    kSubjectTypesSupportedKey,
-    kIDTokenSigningAlgorithmValuesSupportedKey
-  ];
-
-  for (NSString *field in requiredFields) {
-    if (!dictionary[field]) {
-      if (error) {
-        NSString *errorText = [NSString stringWithFormat:kMissingFieldErrorText, field];
-        *error = [OIDErrorUtilities errorWithCode:OIDErrorCodeInvalidDiscoveryDocument
-                                  underlyingError:nil
-                                      description:errorText];
-      }
-      return NO;
-    }
-  }
-
-  // Check required URL fields are valid URLs.
-  NSArray *requiredURLFields = @[
-    kIssuerKey,
-    kTokenEndpointKey,
-    kJWKSURLKey
-  ];
-
-  for (NSString *field in requiredURLFields) {
-    if (![NSURL URLWithString:dictionary[field]]) {
-      if (error) {
-        NSString *errorText = [NSString stringWithFormat:kInvalidURLFieldErrorText, field];
-        *error = [OIDErrorUtilities errorWithCode:OIDErrorCodeInvalidDiscoveryDocument
-                                  underlyingError:nil
-                                      description:errorText];
-      }
-      return NO;
-    }
-  }
-
-  return YES;
-}
-
-#pragma mark - NSCopying
-
-- (instancetype)copyWithZone:(nullable NSZone *)zone {
-  // The documentation for NSCopying specifically advises us to return a reference to the original
-  // instance in the case where instances are immutable (as ours is):
-  // "Implement NSCopying by retaining the original instead of creating a new copy when the class
-  // and its contents are immutable."
-  return self;
-}
-
-#pragma mark - NSSecureCoding
-
-+ (BOOL)supportsSecureCoding {
-  return YES;
-}
-
-- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder {
-  NSError *error;
-  NSDictionary *dictionary;
-  if ([aDecoder containsValueForKey:kDiscoveryDictionaryKey]) {
-    // We're decoding a collection type (NSDictionary) from NSJSONSerialization's
-    // +JSONObjectWithData, so we need to include all classes that could potentially be contained
-    // within.
-    NSSet<Class> *allowedClasses = [NSSet setWithArray:@[[NSDictionary class],
-                                                         [NSArray class],
-                                                         [NSString class],
-                                                         [NSNumber class],
-                                                         [NSNull class]]];
-    dictionary = [aDecoder decodeObjectOfClasses:allowedClasses
-                                          forKey:kDiscoveryDictionaryKey];
-  } else {
-    // Decode using the old encoding which delegated to NSDictionary's encodeWithCoder:
-    // implementation:
-    //
-    // - (void)encodeWithCoder:(NSCoder *)aCoder {
-    //   [_discoveryDictionary encodeWithCoder:aCoder];
-    // }
-    dictionary = [[NSDictionary alloc] initWithCoder:aDecoder];
-  }
-  self = [self initWithDictionary:dictionary error:&error];
-  if (error) {
-    return nil;
-  }
-  return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)aCoder {
-  [aCoder encodeObject:_discoveryDictionary forKey:kDiscoveryDictionaryKey];
-  // Provide forward compatibilty by continuing to add the old encoding.
-  [_discoveryDictionary encodeWithCoder:aCoder];
-}
-
-#pragma mark - Properties
-
-- (NSDictionary<NSString *, NSString *> *)discoveryDictionary {
-  return _discoveryDictionary;
-}
-
-- (NSURL *)issuer {
-  return [NSURL URLWithString:_discoveryDictionary[kIssuerKey]];
-}
-
-- (NSURL *)authorizationEndpoint {
-  return [NSURL URLWithString:_discoveryDictionary[kAuthorizationEndpointKey]];
-}
-
-- (nullable NSURL *)deviceAuthorizationEndpoint {
-  return [NSURL URLWithString:_discoveryDictionary[kDeviceAuthorizationEndpointKey]];
-}
-
-- (NSURL *)tokenEndpoint {
-  return [NSURL URLWithString:_discoveryDictionary[kTokenEndpointKey]];
-}
-
-- (nullable NSURL *)userinfoEndpoint {
-  return [NSURL URLWithString:_discoveryDictionary[kUserinfoEndpointKey]];
-}
-
-- (NSURL *)jwksURL {
-  return [NSURL URLWithString:_discoveryDictionary[kJWKSURLKey]];
-}
-
-- (nullable NSURL *)registrationEndpoint {
-  return [NSURL URLWithString:_discoveryDictionary[kRegistrationEndpointKey]];
-}
-
-- (nullable NSURL *)endSessionEndpoint {
-    return [NSURL URLWithString:_discoveryDictionary[kEndSessionEndpointKey]];
-}
-
-- (nullable NSArray<NSString *> *)scopesSupported {
-  return _discoveryDictionary[kScopesSupportedKey];
-}
-
-- (NSArray<NSString *> *)responseTypesSupported {
-  return _discoveryDictionary[kResponseTypesSupportedKey];
-}
-
-- (nullable NSArray<NSString *> *)responseModesSupported {
-  return _discoveryDictionary[kResponseModesSupportedKey];
-}
-
-- (nullable NSArray<NSString *> *)grantTypesSupported {
-  return _discoveryDictionary[kGrantTypesSupportedKey];
-}
-
-- (nullable NSArray<NSString *> *)acrValuesSupported {
-  return _discoveryDictionary[kACRValuesSupportedKey];
-}
-
-- (NSArray<NSString *> *)subjectTypesSupported {
-  return _discoveryDictionary[kSubjectTypesSupportedKey];
-}
-
-- (NSArray<NSString *> *) IDTokenSigningAlgorithmValuesSupported {
-  return _discoveryDictionary[kIDTokenSigningAlgorithmValuesSupportedKey];
-}
-
-- (nullable NSArray<NSString *> *)IDTokenEncryptionAlgorithmValuesSupported {
-  return _discoveryDictionary[kIDTokenEncryptionAlgorithmValuesSupportedKey];
-}
-
-- (nullable NSArray<NSString *> *)IDTokenEncryptionEncodingValuesSupported {
-  return _discoveryDictionary[kIDTokenEncryptionEncodingValuesSupportedKey];
-}
-
-- (nullable NSArray<NSString *> *)userinfoSigningAlgorithmValuesSupported {
-  return _discoveryDictionary[kUserinfoSigningAlgorithmValuesSupportedKey];
-}
-
-- (nullable NSArray<NSString *> *)userinfoEncryptionAlgorithmValuesSupported {
-  return _discoveryDictionary[kUserinfoEncryptionAlgorithmValuesSupportedKey];
-}
-
-- (nullable NSArray<NSString *> *)userinfoEncryptionEncodingValuesSupported {
-  return _discoveryDictionary[kUserinfoEncryptionEncodingValuesSupportedKey];
-}
-
-- (nullable NSArray<NSString *> *)requestObjectSigningAlgorithmValuesSupported {
-  return _discoveryDictionary[kRequestObjectSigningAlgorithmValuesSupportedKey];
-}
-
-- (nullable NSArray<NSString *> *) requestObjectEncryptionAlgorithmValuesSupported {
-  return _discoveryDictionary[kRequestObjectEncryptionAlgorithmValuesSupportedKey];
-}
-
-- (nullable NSArray<NSString *> *) requestObjectEncryptionEncodingValuesSupported {
-  return _discoveryDictionary[kRequestObjectEncryptionEncodingValuesSupported];
-}
-
-- (nullable NSArray<NSString *> *)tokenEndpointAuthMethodsSupported {
-  return _discoveryDictionary[kTokenEndpointAuthMethodsSupportedKey];
-}
-
-- (nullable NSArray<NSString *> *)tokenEndpointAuthSigningAlgorithmValuesSupported {
-  return _discoveryDictionary[kTokenEndpointAuthSigningAlgorithmValuesSupportedKey];
-}
-
-- (nullable NSArray<NSString *> *)displayValuesSupported {
-  return _discoveryDictionary[kDisplayValuesSupportedKey];
-}
-
-- (nullable NSArray<NSString *> *)claimTypesSupported {
-  return _discoveryDictionary[kClaimTypesSupportedKey];
-}
-
-- (nullable NSArray<NSString *> *)claimsSupported {
-  return _discoveryDictionary[kClaimsSupportedKey];
-}
-
-- (nullable NSURL *)serviceDocumentation {
-  return [NSURL URLWithString:_discoveryDictionary[kServiceDocumentationKey]];
-}
-
-- (nullable NSArray<NSString *> *)claimsLocalesSupported {
-  return _discoveryDictionary[kClaimsLocalesSupportedKey];
-}
-
-- (nullable NSArray<NSString *> *)UILocalesSupported {
-  return _discoveryDictionary[kUILocalesSupportedKey];
-}
-
-- (BOOL)claimsParameterSupported {
-  return [_discoveryDictionary[kClaimsParameterSupportedKey] boolValue];
-}
-
-- (BOOL)requestParameterSupported {
-  return [_discoveryDictionary[kRequestParameterSupportedKey] boolValue];
-}
-
-- (BOOL)requestURIParameterSupported {
-  // Default is true/YES.
-  if (!_discoveryDictionary[kRequestURIParameterSupportedKey]) {
-    return YES;
-  }
-  return [_discoveryDictionary[kRequestURIParameterSupportedKey] boolValue];
-}
-
-- (BOOL)requireRequestURIRegistration {
-  return [_discoveryDictionary[kRequireRequestURIRegistrationKey] boolValue];
-}
-
-- (nullable NSURL *)OPPolicyURI {
-  return [NSURL URLWithString:_discoveryDictionary[kOPPolicyURIKey]];
-}
-
-- (nullable NSURL *)OPTosURI {
-  return [NSURL URLWithString:_discoveryDictionary[kOPTosURIKey]];
-}
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 167
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDTokenRequest.h

@@ -1,167 +0,0 @@
-/*! @file OIDTokenRequest.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <Foundation/Foundation.h>
-
-// This file only declares string constants useful for constructing a @c OIDTokenRequest, so it is
-// imported here for convenience.
-#import "OIDGrantTypes.h"
-
-@class OIDAuthorizationResponse;
-@class OIDServiceConfiguration;
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief Represents a token request.
-    @see https://tools.ietf.org/html/rfc6749#section-3.2
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.3
- */
-@interface OIDTokenRequest : NSObject <NSCopying, NSSecureCoding>
-
-/*! @brief The service's configuration.
-    @remarks This configuration specifies how to connect to a particular OAuth provider.
-        Configurations may be created manually, or via an OpenID Connect Discovery Document.
- */
-@property(nonatomic, readonly) OIDServiceConfiguration *configuration;
-
-/*! @brief The type of token being sent to the token endpoint, i.e. "authorization_code" for the
-        authorization code exchange, or "refresh_token" for an access token refresh request.
-    @remarks grant_type
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.3
-    @see https://www.google.com/url?sa=D&q=https%3A%2F%2Ftools.ietf.org%2Fhtml%2Frfc6749%23section-6
- */
-@property(nonatomic, readonly) NSString *grantType;
-
-/*! @brief The authorization code received from the authorization server.
-    @remarks code
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.3
- */
-@property(nonatomic, readonly, nullable) NSString *authorizationCode;
-
-/*! @brief The client's redirect URI.
-    @remarks redirect_uri
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.3
- */
-@property(nonatomic, readonly, nullable) NSURL *redirectURL;
-
-/*! @brief The client identifier.
-    @remarks client_id
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.3
- */
-@property(nonatomic, readonly) NSString *clientID;
-
-/*! @brief The client secret.
-    @remarks client_secret
-    @see https://tools.ietf.org/html/rfc6749#section-2.3.1
- */
-@property(nonatomic, readonly, nullable) NSString *clientSecret;
-
-/*! @brief The value of the scope parameter is expressed as a list of space-delimited,
-        case-sensitive strings.
-    @remarks scope
-    @see https://tools.ietf.org/html/rfc6749#section-3.3
- */
-@property(nonatomic, readonly, nullable) NSString *scope;
-
-/*! @brief The refresh token, which can be used to obtain new access tokens using the same
-        authorization grant.
-    @remarks refresh_token
-    @see https://tools.ietf.org/html/rfc6749#section-5.1
- */
-@property(nonatomic, readonly, nullable) NSString *refreshToken;
-
-/*! @brief The PKCE code verifier used to redeem the authorization code.
-    @remarks code_verifier
-    @see https://tools.ietf.org/html/rfc7636#section-4.3
- */
-@property(nonatomic, readonly, nullable) NSString *codeVerifier;
-
-/*! @brief The client's additional token request parameters.
- */
-@property(nonatomic, readonly, nullable) NSDictionary<NSString *, NSString *> *additionalParameters;
-
-/*! @internal
-    @brief Unavailable. Please use
-        initWithConfiguration:grantType:code:redirectURL:clientID:additionalParameters:.
- */
-- (instancetype)init NS_UNAVAILABLE;
-
-/*! @param configuration The service's configuration.
-    @param grantType the type of token being sent to the token endpoint, i.e. "authorization_code"
-        for the authorization code exchange, or "refresh_token" for an access token refresh request.
-        @see OIDGrantTypes.h
-    @param code The authorization code received from the authorization server.
-    @param redirectURL The client's redirect URI.
-    @param clientID The client identifier.
-    @param clientSecret The client secret.
-    @param scopes An array of scopes to combine into a single scope string per the OAuth2 spec.
-    @param refreshToken The refresh token.
-    @param codeVerifier The PKCE code verifier.
-    @param additionalParameters The client's additional token request parameters.
- */
-- (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration
-               grantType:(NSString *)grantType
-       authorizationCode:(nullable NSString *)code
-             redirectURL:(nullable NSURL *)redirectURL
-                clientID:(NSString *)clientID
-            clientSecret:(nullable NSString *)clientSecret
-                  scopes:(nullable NSArray<NSString *> *)scopes
-            refreshToken:(nullable NSString *)refreshToken
-            codeVerifier:(nullable NSString *)codeVerifier
-    additionalParameters:(nullable NSDictionary<NSString *, NSString *> *)additionalParameters;
-
-/*! @brief Designated initializer.
-    @param configuration The service's configuration.
-    @param grantType the type of token being sent to the token endpoint, i.e. "authorization_code"
-        for the authorization code exchange, or "refresh_token" for an access token refresh request.
-        @see OIDGrantTypes.h
-    @param code The authorization code received from the authorization server.
-    @param redirectURL The client's redirect URI.
-    @param clientID The client identifier.
-    @param clientSecret The client secret.
-    @param scope The value of the scope parameter is expressed as a list of space-delimited,
-        case-sensitive strings.
-    @param refreshToken The refresh token.
-    @param codeVerifier The PKCE code verifier.
-    @param additionalParameters The client's additional token request parameters.
- */
-- (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration
-               grantType:(NSString *)grantType
-       authorizationCode:(nullable NSString *)code
-             redirectURL:(nullable NSURL *)redirectURL
-                clientID:(NSString *)clientID
-            clientSecret:(nullable NSString *)clientSecret
-                   scope:(nullable NSString *)scope
-            refreshToken:(nullable NSString *)refreshToken
-            codeVerifier:(nullable NSString *)codeVerifier
-    additionalParameters:(nullable NSDictionary<NSString *, NSString *> *)additionalParameters
-    NS_DESIGNATED_INITIALIZER;
-
-/*! @brief Designated initializer for NSSecureCoding.
-    @param aDecoder Unarchiver object to decode
- */
-- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER;
-
-/*! @brief Constructs an @c NSURLRequest representing the token request.
-    @return An @c NSURLRequest representing the token request.
- */
-- (NSURLRequest *)URLRequest;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 312
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDTokenRequest.m

@@ -1,312 +0,0 @@
-/*! @file OIDTokenRequest.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDTokenRequest.h"
-
-#import "OIDDefines.h"
-#import "OIDError.h"
-#import "OIDScopeUtilities.h"
-#import "OIDServiceConfiguration.h"
-#import "OIDURLQueryComponent.h"
-#import "OIDTokenUtilities.h"
-
-/*! @brief The key for the @c configuration property for @c NSSecureCoding
- */
-static NSString *const kConfigurationKey = @"configuration";
-
-/*! @brief Key used to encode the @c grantType property for @c NSSecureCoding
- */
-static NSString *const kGrantTypeKey = @"grant_type";
-
-/*! @brief The key for the @c authorizationCode property for @c NSSecureCoding.
- */
-static NSString *const kAuthorizationCodeKey = @"code";
-
-/*! @brief Key used to encode the @c clientID property for @c NSSecureCoding
- */
-static NSString *const kClientIDKey = @"client_id";
-
-/*! @brief Key used to encode the @c clientSecret property for @c NSSecureCoding
- */
-static NSString *const kClientSecretKey = @"client_secret";
-
-/*! @brief Key used to encode the @c redirectURL property for @c NSSecureCoding
- */
-static NSString *const kRedirectURLKey = @"redirect_uri";
-
-/*! @brief Key used to encode the @c scopes property for @c NSSecureCoding
- */
-static NSString *const kScopeKey = @"scope";
-
-/*! @brief Key used to encode the @c refreshToken property for @c NSSecureCoding
- */
-static NSString *const kRefreshTokenKey = @"refresh_token";
-
-/*! @brief Key used to encode the @c codeVerifier property for @c NSSecureCoding and to build the
-        request URL.
- */
-static NSString *const kCodeVerifierKey = @"code_verifier";
-
-/*! @brief Key used to encode the @c additionalParameters property for
-        @c NSSecureCoding
- */
-static NSString *const kAdditionalParametersKey = @"additionalParameters";
-
-@implementation OIDTokenRequest
-
-- (instancetype)init
-    OID_UNAVAILABLE_USE_INITIALIZER(
-        @selector(initWithConfiguration:
-                              grantType:
-                      authorizationCode:
-                            redirectURL:
-                               clientID:
-                           clientSecret:
-                                  scope:
-                           refreshToken:
-                           codeVerifier:
-                   additionalParameters:)
-    )
-
-- (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration
-               grantType:(NSString *)grantType
-       authorizationCode:(nullable NSString *)code
-             redirectURL:(nullable NSURL *)redirectURL
-                clientID:(NSString *)clientID
-            clientSecret:(nullable NSString *)clientSecret
-                  scopes:(nullable NSArray<NSString *> *)scopes
-            refreshToken:(nullable NSString *)refreshToken
-            codeVerifier:(nullable NSString *)codeVerifier
-    additionalParameters:(nullable NSDictionary<NSString *, NSString *> *)additionalParameters {
-  return [self initWithConfiguration:configuration
-                           grantType:grantType
-                   authorizationCode:code
-                         redirectURL:redirectURL
-                            clientID:clientID
-                        clientSecret:clientSecret
-                               scope:[OIDScopeUtilities scopesWithArray:scopes]
-                        refreshToken:refreshToken
-                        codeVerifier:(NSString *)codeVerifier
-                additionalParameters:additionalParameters];
-}
-
-- (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration
-               grantType:(NSString *)grantType
-       authorizationCode:(nullable NSString *)code
-             redirectURL:(nullable NSURL *)redirectURL
-                clientID:(NSString *)clientID
-            clientSecret:(nullable NSString *)clientSecret
-                   scope:(nullable NSString *)scope
-            refreshToken:(nullable NSString *)refreshToken
-            codeVerifier:(nullable NSString *)codeVerifier
-    additionalParameters:(nullable NSDictionary<NSString *, NSString *> *)additionalParameters {
-  self = [super init];
-  if (self) {
-    _configuration = [configuration copy];
-    _grantType = [grantType copy];
-    _authorizationCode = [code copy];
-    _redirectURL = [redirectURL copy];
-    _clientID = [clientID copy];
-    _clientSecret = [clientSecret copy];
-    _scope = [scope copy];
-    _refreshToken = [refreshToken copy];
-    _codeVerifier = [codeVerifier copy];
-    _additionalParameters =
-        [[NSDictionary alloc] initWithDictionary:additionalParameters copyItems:YES];
-    
-    // Additional validation for the authorization_code grant type
-    if ([_grantType isEqual:OIDGrantTypeAuthorizationCode]) {
-      // redirect URI must not be nil
-      if (!_redirectURL) {
-        [NSException raise:OIDOAuthExceptionInvalidTokenRequestNullRedirectURL
-                    format:@"%@", OIDOAuthExceptionInvalidTokenRequestNullRedirectURL, nil];
-
-      }
-    }
-  }
-  return self;
-}
-
-#pragma mark - NSCopying
-
-- (instancetype)copyWithZone:(nullable NSZone *)zone {
-  // The documentation for NSCopying specifically advises us to return a reference to the original
-  // instance in the case where instances are immutable (as ours is):
-  // "Implement NSCopying by retaining the original instead of creating a new copy when the class
-  // and its contents are immutable."
-  return self;
-}
-
-#pragma mark - NSSecureCoding
-
-+ (BOOL)supportsSecureCoding {
-  return YES;
-}
-
-- (instancetype)initWithCoder:(NSCoder *)aDecoder {
-  OIDServiceConfiguration *configuration =
-      [aDecoder decodeObjectOfClass:[OIDServiceConfiguration class]
-                             forKey:kConfigurationKey];
-  NSString *grantType = [aDecoder decodeObjectOfClass:[NSString class] forKey:kGrantTypeKey];
-  NSString *code = [aDecoder decodeObjectOfClass:[NSString class] forKey:kAuthorizationCodeKey];
-  NSString *clientID = [aDecoder decodeObjectOfClass:[NSString class] forKey:kClientIDKey];
-  NSString *clientSecret = [aDecoder decodeObjectOfClass:[NSString class] forKey:kClientSecretKey];
-  NSString *scope = [aDecoder decodeObjectOfClass:[NSString class] forKey:kScopeKey];
-  NSString *refreshToken = [aDecoder decodeObjectOfClass:[NSString class] forKey:kRefreshTokenKey];
-  NSString *codeVerifier = [aDecoder decodeObjectOfClass:[NSString class] forKey:kCodeVerifierKey];
-  NSURL *redirectURL = [aDecoder decodeObjectOfClass:[NSURL class] forKey:kRedirectURLKey];
-  NSSet *additionalParameterCodingClasses = [NSSet setWithArray:@[
-    [NSDictionary class],
-    [NSString class]
-  ]];
-  NSDictionary *additionalParameters =
-      [aDecoder decodeObjectOfClasses:additionalParameterCodingClasses
-                               forKey:kAdditionalParametersKey];
-  
-  self = [super init];
-  if (self) {
-    _configuration = [configuration copy];
-    _grantType = [grantType copy];
-    _authorizationCode = [code copy];
-    _redirectURL = [redirectURL copy];
-    _clientID = [clientID copy];
-    _clientSecret = [clientSecret copy];
-    _scope = [scope copy];
-    _refreshToken = [refreshToken copy];
-    _codeVerifier = [codeVerifier copy];
-    _additionalParameters =
-        [[NSDictionary alloc] initWithDictionary:additionalParameters copyItems:YES];
-  }
-  return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)aCoder {
-  [aCoder encodeObject:_configuration forKey:kConfigurationKey];
-  [aCoder encodeObject:_grantType forKey:kGrantTypeKey];
-  [aCoder encodeObject:_authorizationCode forKey:kAuthorizationCodeKey];
-  [aCoder encodeObject:_clientID forKey:kClientIDKey];
-  [aCoder encodeObject:_clientSecret forKey:kClientSecretKey];
-  [aCoder encodeObject:_redirectURL forKey:kRedirectURLKey];
-  [aCoder encodeObject:_scope forKey:kScopeKey];
-  [aCoder encodeObject:_refreshToken forKey:kRefreshTokenKey];
-  [aCoder encodeObject:_codeVerifier forKey:kCodeVerifierKey];
-  [aCoder encodeObject:_additionalParameters forKey:kAdditionalParametersKey];
-}
-
-#pragma mark - NSObject overrides
-
-- (NSString *)description {
-  NSURLRequest *request = self.URLRequest;
-  NSString *requestBody =
-      [[NSString alloc] initWithData:request.HTTPBody encoding:NSUTF8StringEncoding];
-  return [NSString stringWithFormat:@"<%@: %p, request: <URL: %@, HTTPBody: %@>>",
-                                    NSStringFromClass([self class]),
-                                    (void *)self,
-                                    request.URL,
-                                    requestBody];
-}
-
-#pragma mark -
-
-/*! @brief Constructs the request URI.
-    @return A URL representing the token request.
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.3
- */
-- (NSURL *)tokenRequestURL {
-  return _configuration.tokenEndpoint;
-}
-
-/*! @brief Constructs the request body data by combining the request parameters using the
-        "application/x-www-form-urlencoded" format.
-    @return The data to pass to the token request URL.
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.3
- */
-- (OIDURLQueryComponent *)tokenRequestBody {
-  OIDURLQueryComponent *query = [[OIDURLQueryComponent alloc] init];
-
-  // Add parameters, as applicable.
-  if (_grantType) {
-    [query addParameter:kGrantTypeKey value:_grantType];
-  }
-  if (_scope) {
-    [query addParameter:kScopeKey value:_scope];
-  }
-  if (_redirectURL) {
-    [query addParameter:kRedirectURLKey value:_redirectURL.absoluteString];
-  }
-  if (_refreshToken) {
-    [query addParameter:kRefreshTokenKey value:_refreshToken];
-  }
-  if (_authorizationCode) {
-    [query addParameter:kAuthorizationCodeKey value:_authorizationCode];
-  }
-  if (_codeVerifier) {
-    [query addParameter:kCodeVerifierKey value:_codeVerifier];
-  }
-
-  // Add any additional parameters the client has specified.
-  [query addParameters:_additionalParameters];
-
-  return query;
-}
-
-- (NSURLRequest *)URLRequest {
-  static NSString *const kHTTPPost = @"POST";
-  static NSString *const kHTTPContentTypeHeaderKey = @"Content-Type";
-  static NSString *const kHTTPContentTypeHeaderValue =
-      @"application/x-www-form-urlencoded; charset=UTF-8";
-
-  NSURL *tokenRequestURL = [self tokenRequestURL];
-  NSMutableURLRequest *URLRequest = [[NSURLRequest requestWithURL:tokenRequestURL] mutableCopy];
-  URLRequest.HTTPMethod = kHTTPPost;
-  [URLRequest setValue:kHTTPContentTypeHeaderValue forHTTPHeaderField:kHTTPContentTypeHeaderKey];
-
-  OIDURLQueryComponent *bodyParameters = [self tokenRequestBody];
-  NSMutableDictionary *httpHeaders = [[NSMutableDictionary alloc] init];
-
-  if (_clientSecret) {
-    // The client id and secret are encoded using the "application/x-www-form-urlencoded" 
-    // encoding algorithm per RFC 6749 Section 2.3.1.
-    // https://tools.ietf.org/html/rfc6749#section-2.3.1
-    NSString *encodedClientID = [OIDTokenUtilities formUrlEncode:_clientID];
-    NSString *encodedClientSecret = [OIDTokenUtilities formUrlEncode:_clientSecret];
-    
-    NSString *credentials =
-        [NSString stringWithFormat:@"%@:%@", encodedClientID, encodedClientSecret];
-    NSData *plainData = [credentials dataUsingEncoding:NSUTF8StringEncoding];
-    NSString *basicAuth = [plainData base64EncodedStringWithOptions:kNilOptions];
-
-    NSString *authValue = [NSString stringWithFormat:@"Basic %@", basicAuth];
-    [httpHeaders setObject:authValue forKey:@"Authorization"];
-  } else  {
-    [bodyParameters addParameter:kClientIDKey value:_clientID];
-  }
-
-  // Constructs request with the body string and headers.
-  NSString *bodyString = [bodyParameters URLEncodedParameters];
-  NSData *body = [bodyString dataUsingEncoding:NSUTF8StringEncoding];
-  URLRequest.HTTPBody = body;
-
-  for (id header in httpHeaders) {
-    [URLRequest setValue:httpHeaders[header] forHTTPHeaderField:header];
-  }
-
-  return URLRequest;
-}
-
-@end

+ 0 - 110
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDTokenResponse.h

@@ -1,110 +0,0 @@
-/*! @file OIDTokenResponse.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <Foundation/Foundation.h>
-
-@class OIDTokenRequest;
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief Represents the response to an token request.
-    @see https://tools.ietf.org/html/rfc6749#section-3.2
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.3
- */
-@interface OIDTokenResponse : NSObject <NSCopying, NSSecureCoding>
-
-/*! @brief The request which was serviced.
- */
-@property(nonatomic, readonly) OIDTokenRequest *request;
-
-/*! @brief The access token generated by the authorization server.
-    @remarks access_token
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.4
-    @see https://tools.ietf.org/html/rfc6749#section-5.1
- */
-@property(nonatomic, readonly, nullable) NSString *accessToken;
-
-/*! @brief The approximate expiration date & time of the access token.
-    @remarks expires_in
-    @seealso OIDTokenResponse.accessToken
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.4
-    @see https://tools.ietf.org/html/rfc6749#section-5.1
- */
-@property(nonatomic, readonly, nullable) NSDate *accessTokenExpirationDate;
-
-/*! @brief Typically "Bearer" when present. Otherwise, another token_type value that the Client has
-        negotiated with the Authorization Server.
-    @remarks token_type
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.4
-    @see https://tools.ietf.org/html/rfc6749#section-5.1
- */
-@property(nonatomic, readonly, nullable) NSString *tokenType;
-
-/*! @brief ID Token value associated with the authenticated session. Always present for the
-        authorization code grant exchange when OpenID Connect is used, optional for responses to
-        access token refresh requests. Note that AppAuth does NOT verify the JWT signature. Users
-        of AppAuth are encouraged to verifying the JWT signature using the validation library of
-        their choosing.
-    @remarks id_token
-    @see http://openid.net/specs/openid-connect-core-1_0.html#TokenResponse
-    @see http://openid.net/specs/openid-connect-core-1_0.html#RefreshTokenResponse
-    @see http://openid.net/specs/openid-connect-core-1_0.html#IDToken
-    @see https://jwt.io
-    @discussion @c OIDIDToken can be used to parse the ID Token and extract the claims. As noted,
-        this class does not verify the JWT signature.
-*/
-@property(nonatomic, readonly, nullable) NSString *idToken;
-
-/*! @brief The refresh token, which can be used to obtain new access tokens using the same
-        authorization grant
-    @remarks refresh_token
-    @see https://tools.ietf.org/html/rfc6749#section-5.1
- */
-@property(nonatomic, readonly, nullable) NSString *refreshToken;
-
-/*! @brief The scope of the access token. OPTIONAL, if identical to the scopes requested, otherwise,
-        REQUIRED.
-    @remarks scope
-    @see https://tools.ietf.org/html/rfc6749#section-5.1
- */
-@property(nonatomic, readonly, nullable) NSString *scope;
-
-/*! @brief Additional parameters returned from the token server.
- */
-@property(nonatomic, readonly, nullable)
-    NSDictionary<NSString *, NSObject<NSCopying> *> *additionalParameters;
-
-/*! @internal
-    @brief Unavailable. Please use initWithParameters:.
- */
-- (instancetype)init NS_UNAVAILABLE;
-
-/*! @brief Designated initializer.
-    @param request The serviced request.
-    @param parameters The decoded parameters returned from the Authorization Server.
-    @remarks Known parameters are extracted from the @c parameters parameter and the normative
-        properties are populated. Non-normative parameters are placed in the
-        @c #additionalParameters dictionary.
- */
-- (instancetype)initWithRequest:(OIDTokenRequest *)request
-                     parameters:(NSDictionary<NSString *, NSObject<NSCopying> *> *)parameters
-                     NS_DESIGNATED_INITIALIZER;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 163
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDTokenResponse.m

@@ -1,163 +0,0 @@
-/*! @file OIDTokenResponse.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDTokenResponse.h"
-
-#import "OIDDefines.h"
-#import "OIDFieldMapping.h"
-#import "OIDTokenRequest.h"
-#import "OIDTokenUtilities.h"
-
-/*! @brief Key used to encode the @c request property for @c NSSecureCoding
- */
-static NSString *const kRequestKey = @"request";
-
-/*! @brief The key for the @c accessToken property in the incoming parameters and for
-        @c NSSecureCoding.
- */
-static NSString *const kAccessTokenKey = @"access_token";
-
-/*! @brief The key for the @c accessTokenExpirationDate property in the incoming parameters and for
-        @c NSSecureCoding.
- */
-static NSString *const kExpiresInKey = @"expires_in";
-
-/*! @brief The key for the @c tokenType property in the incoming parameters and for
-        @c NSSecureCoding.
- */
-static NSString *const kTokenTypeKey = @"token_type";
-
-/*! @brief The key for the @c idToken property in the incoming parameters and for @c NSSecureCoding.
- */
-static NSString *const kIDTokenKey = @"id_token";
-
-/*! @brief The key for the @c refreshToken property in the incoming parameters and for
-        @c NSSecureCoding.
- */
-static NSString *const kRefreshTokenKey = @"refresh_token";
-
-/*! @brief The key for the @c scope property in the incoming parameters and for @c NSSecureCoding.
- */
-static NSString *const kScopeKey = @"scope";
-
-/*! @brief Key used to encode the @c additionalParameters property for @c NSSecureCoding
- */
-static NSString *const kAdditionalParametersKey = @"additionalParameters";
-
-@implementation OIDTokenResponse
-
-/*! @brief Returns a mapping of incoming parameters to instance variables.
-    @return A mapping of incoming parameters to instance variables.
- */
-+ (NSDictionary<NSString *, OIDFieldMapping *> *)fieldMap {
-  static NSMutableDictionary<NSString *, OIDFieldMapping *> *fieldMap;
-  static dispatch_once_t onceToken;
-  dispatch_once(&onceToken, ^{
-    fieldMap = [NSMutableDictionary dictionary];
-    fieldMap[kAccessTokenKey] =
-        [[OIDFieldMapping alloc] initWithName:@"_accessToken" type:[NSString class]];
-    fieldMap[kExpiresInKey] =
-        [[OIDFieldMapping alloc] initWithName:@"_accessTokenExpirationDate"
-                                         type:[NSDate class]
-                                   conversion:[OIDFieldMapping dateSinceNowConversion]];
-    fieldMap[kTokenTypeKey] =
-        [[OIDFieldMapping alloc] initWithName:@"_tokenType" type:[NSString class]];
-    fieldMap[kIDTokenKey] =
-        [[OIDFieldMapping alloc] initWithName:@"_idToken" type:[NSString class]];
-    fieldMap[kRefreshTokenKey] =
-        [[OIDFieldMapping alloc] initWithName:@"_refreshToken" type:[NSString class]];
-    fieldMap[kScopeKey] =
-        [[OIDFieldMapping alloc] initWithName:@"_scope" type:[NSString class]];
-  });
-  return fieldMap;
-}
-
-#pragma mark - Initializers
-
-- (instancetype)init
-    OID_UNAVAILABLE_USE_INITIALIZER(@selector(initWithRequest:parameters:))
-
-- (instancetype)initWithRequest:(OIDTokenRequest *)request
-    parameters:(NSDictionary<NSString *, NSObject<NSCopying> *> *)parameters {
-  self = [super init];
-  if (self) {
-    _request = [request copy];
-    NSDictionary<NSString *, NSObject<NSCopying> *> *additionalParameters =
-        [OIDFieldMapping remainingParametersWithMap:[[self class] fieldMap]
-                                         parameters:parameters
-                                           instance:self];
-    _additionalParameters = additionalParameters;
-  }
-  return self;
-}
-
-#pragma mark - NSCopying
-
-- (instancetype)copyWithZone:(nullable NSZone *)zone {
-  // The documentation for NSCopying specifically advises us to return a reference to the original
-  // instance in the case where instances are immutable (as ours is):
-  // "Implement NSCopying by retaining the original instead of creating a new copy when the class
-  // and its contents are immutable."
-  return self;
-}
-
-#pragma mark - NSSecureCoding
-
-+ (BOOL)supportsSecureCoding {
-  return YES;
-}
-
-- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder {
-  OIDTokenRequest *request =
-      [aDecoder decodeObjectOfClass:[OIDTokenRequest class] forKey:kRequestKey];
-  self = [self initWithRequest:request parameters:@{ }];
-  if (self) {
-    [OIDFieldMapping decodeWithCoder:aDecoder map:[[self class] fieldMap] instance:self];
-    _additionalParameters = [aDecoder decodeObjectOfClasses:[OIDFieldMapping JSONTypes]
-                                                     forKey:kAdditionalParametersKey];
-  }
-  return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)aCoder {
-  [OIDFieldMapping encodeWithCoder:aCoder map:[[self class] fieldMap] instance:self];
-  [aCoder encodeObject:_request forKey:kRequestKey];
-  [aCoder encodeObject:_additionalParameters forKey:kAdditionalParametersKey];
-}
-
-#pragma mark - NSObject overrides
-
-- (NSString *)description {
-  return [NSString stringWithFormat:@"<%@: %p, accessToken: \"%@\", accessTokenExpirationDate: %@, "
-                                     "tokenType: %@, idToken: \"%@\", refreshToken: \"%@\", "
-                                     "scope: \"%@\", additionalParameters: %@, request: %@>",
-                                    NSStringFromClass([self class]),
-                                    (void *)self,
-                                    [OIDTokenUtilities redact:_accessToken],
-                                    _accessTokenExpirationDate,
-                                    _tokenType,
-                                    [OIDTokenUtilities redact:_idToken],
-                                    [OIDTokenUtilities redact:_refreshToken],
-                                    _scope,
-                                    _additionalParameters,
-                                    _request];
-}
-
-#pragma mark -
-
-@end

+ 0 - 67
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDTokenUtilities.h

@@ -1,67 +0,0 @@
-/*! @file OIDTokenUtilities.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief Provides data encoding/decoding methods, random string generators, etc.
- */
-@interface OIDTokenUtilities : NSObject
-
-/*! @internal
-    @brief Unavailable. This class should not be initialized.
- */
-- (instancetype)init NS_UNAVAILABLE;
-
-/*! @brief Base64url-nopadding encodes the given data.
-    @param data The input data.
-    @return The base64url encoded data as a NSString.
-    @discussion Base64url-nopadding is used in several identity specs such as PKCE and
-        OpenID Connect.
- */
-+ (NSString *)encodeBase64urlNoPadding:(NSData *)data;
-
-/*! @brief Generates a URL-safe string of random data.
-    @param size The number of random bytes to encode. NB. the length of the output string will be
-        greater than the number of random bytes, due to the URL-safe encoding.
-    @return Random data encoded with base64url.
- */
-+ (nullable NSString *)randomURLSafeStringWithSize:(NSUInteger)size;
-
-/*! @brief SHA256 hashes the input string.
-    @param inputString The input string.
-    @return The SHA256 data.
- */
-+ (NSData *)sha256:(NSString *)inputString;
-
-/*! @brief Truncated intput string after first 6 characters followed by ellipses
-    @param inputString The input string.
-    @return Truncated string.
- */
-+ (nullable NSString *)redact:(nullable NSString *)inputString;
-
-/*! @brief Form url encode the input string by applying application/x-www-form-urlencoded algorithm
-    @param inputString The input string.
-    @return The encoded string.
- */
-+ (NSString*)formUrlEncode:(NSString*)inputString;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 89
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDTokenUtilities.m

@@ -1,89 +0,0 @@
-/*! @file OIDTokenUtilities.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDTokenUtilities.h"
-
-#import <CommonCrypto/CommonDigest.h>
-
-/*! @brief String representing the set of characters that are allowed as is for the
-        application/x-www-form-urlencoded encoding algorithm.
- */
-static NSString *const kFormUrlEncodedAllowedCharacters =
-    @" *-._0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
-
-@implementation OIDTokenUtilities
-
-+ (NSString *)encodeBase64urlNoPadding:(NSData *)data {
-  NSString *base64string = [data base64EncodedStringWithOptions:0];
-  // converts base64 to base64url
-  base64string = [base64string stringByReplacingOccurrencesOfString:@"+" withString:@"-"];
-  base64string = [base64string stringByReplacingOccurrencesOfString:@"/" withString:@"_"];
-  // strips padding
-  base64string = [base64string stringByReplacingOccurrencesOfString:@"=" withString:@""];
-  return base64string;
-}
-
-+ (nullable NSString *)randomURLSafeStringWithSize:(NSUInteger)size {
-  NSMutableData *randomData = [NSMutableData dataWithLength:size];
-  int result = SecRandomCopyBytes(kSecRandomDefault, randomData.length, randomData.mutableBytes);
-  if (result != 0) {
-    return nil;
-  }
-  return [[self class] encodeBase64urlNoPadding:randomData];
-}
-
-+ (NSData *)sha256:(NSString *)inputString {
-  NSData *verifierData = [inputString dataUsingEncoding:NSUTF8StringEncoding];
-  NSMutableData *sha256Verifier = [NSMutableData dataWithLength:CC_SHA256_DIGEST_LENGTH];
-  CC_SHA256(verifierData.bytes, (CC_LONG)verifierData.length, sha256Verifier.mutableBytes);
-  return sha256Verifier;
-}
-
-+ (NSString *)redact:(NSString *)inputString {
-  if (inputString == nil) {
-    return nil;
-  }
-  switch(inputString.length){
-    case 0:
-      return @"";
-    case 1 ... 8:
-      return @"[redacted]";
-    case 9:
-    default:
-      return [[inputString substringToIndex:6] stringByAppendingString:@"...[redacted]"];
-  }
-}
-
-+ (NSString*)formUrlEncode:(NSString*)inputString {
-  // https://www.w3.org/TR/html5/sec-forms.html#application-x-www-form-urlencoded-encoding-algorithm
-  // Following the spec from the above link, application/x-www-form-urlencoded percent encode all
-  // the characters except *-._A-Za-z0-9
-  // Space character is replaced by + in the resulting bytes sequence
-  if (inputString.length == 0) {
-    return inputString;
-  }
-  NSCharacterSet *allowedCharacters =
-      [NSCharacterSet characterSetWithCharactersInString:kFormUrlEncodedAllowedCharacters];
-  // Percent encode all characters not present in the provided set.
-  NSString *encodedString =
-      [inputString stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacters];
-  // Replace occurences of space by '+' character
-  return [encodedString stringByReplacingOccurrencesOfString:@" " withString:@"+"];
-}
-
-@end

+ 0 - 93
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDURLQueryComponent.h

@@ -1,93 +0,0 @@
-/*! @file OIDURLQueryComponent.h
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import <Foundation/Foundation.h>
-
-@class OIDAuthorizationRequest;
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief If set to YES, will force the iOS 7-only code for @c OIDURLQueryComponent to be used,
-        even on non-iOS 7 devices and simulators. Useful for testing the iOS 7 code paths on the
-        simulator. Defaults to NO.
- */
-extern BOOL gOIDURLQueryComponentForceIOS7Handling;
-
-/*! @brief A utility class for creating and parsing URL query components encoded with the
-        application/x-www-form-urlencoded format.
-    @description Supports application/x-www-form-urlencoded encoding and decoding, specifically
-        '+' is replaced with space before percent decoding. For encoding, simply percent encodes
-        space, as this is valid application/x-www-form-urlencoded.
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.2
-    @see https://tools.ietf.org/html/rfc6749#section-4.1.3
-    @see https://tools.ietf.org/html/rfc6749#appendix-B
-    @see https://url.spec.whatwg.org/#urlencoded-parsing
- */
-@interface OIDURLQueryComponent : NSObject
-
-/*! @brief The parameter names in the query.
- */
-@property(nonatomic, readonly) NSArray<NSString *> *parameters;
-
-/*! @brief The parameters represented as a dictionary.
-    @remarks All values are @c NSString except for parameters which contain multiple values, in
-        which case the value is an @c NSArray<NSString *> *.
- */
-@property(nonatomic, readonly) NSDictionary<NSString *, NSObject<NSCopying> *> *dictionaryValue;
-
-/*! @brief Creates an @c OIDURLQueryComponent by parsing the query string in a URL.
-    @param URL The URL from which to extract a query component.
- */
-- (nullable instancetype)initWithURL:(NSURL *)URL;
-
-/*! @brief The value (or values) for a named parameter in the query.
-    @param parameter The parameter name. Case sensitive.
-    @return The value (or values) for a named parameter in the query.
- */
-- (NSArray<NSString *> *)valuesForParameter:(NSString *)parameter;
-
-/*! @brief Adds a parameter value to the query.
-    @param parameter The name of the parameter. Case sensitive.
-    @param value The value to add.
- */
-- (void)addParameter:(NSString *)parameter value:(NSString *)value;
-
-/*! @brief Adds multiple parameters with associated values to the query.
-    @param parameters The parameter name value pairs to add to the query.
- */
-- (void)addParameters:(NSDictionary<NSString *, NSString *> *)parameters;
-
-/*! @param URL The URL to add the query component to.
-    @return The original URL with the query component replaced by the parameters from this query.
- */
-- (NSURL *)URLByReplacingQueryInURL:(NSURL *)URL;
-
-/*! @brief Builds an x-www-form-urlencoded string representing the parameters.
-    @return The x-www-form-urlencoded string representing the parameters.
- */
-- (NSString *)URLEncodedParameters;
-
-/*! @brief A NSMutableCharacterSet containing allowed characters in URL parameter values (that is
-        the "value" part of "?key=value"). This has less allowed characters than
-        @c URLQueryAllowedCharacterSet, as the query component includes both the key & value.
- */
-+ (NSMutableCharacterSet *)URLParamValueAllowedCharacters;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 219
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDURLQueryComponent.m

@@ -1,219 +0,0 @@
-/*! @file OIDURLQueryComponent.m
-    @brief AppAuth iOS SDK
-    @copyright
-        Copyright 2015 Google Inc. All Rights Reserved.
-    @copydetails
-        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.
- */
-
-#import "OIDURLQueryComponent.h"
-
-BOOL gOIDURLQueryComponentForceIOS7Handling = NO;
-
-/*! @brief String representing the set of characters that are valid for the URL query
-        (per @ NSCharacterSet.URLQueryAllowedCharacterSet), but are disallowed in URL query
-        parameters and values.
- */
-static NSString *const kQueryStringParamAdditionalDisallowedCharacters = @"=&+";
-
-@implementation OIDURLQueryComponent {
-  /*! @brief A dictionary of parameter names and values representing the contents of the query.
-   */
-  NSMutableDictionary<NSString *, NSMutableArray<NSString *> *> *_parameters;
-}
-
-- (nullable instancetype)init {
-  self = [super init];
-  if (self) {
-    _parameters = [NSMutableDictionary dictionary];
-  }
-  return self;
-}
-
-- (nullable instancetype)initWithURL:(NSURL *)URL {
-  self = [self init];
-  if (self) {
-    if (@available(iOS 8.0, macOS 10.10, *)) {
-      // If NSURLQueryItem is available, use it for deconstructing the new URL. (iOS 8+)
-      if (!gOIDURLQueryComponentForceIOS7Handling) {
-        NSURLComponents *components =
-            [NSURLComponents componentsWithURL:URL resolvingAgainstBaseURL:NO];
-        // As OAuth uses application/x-www-form-urlencoded encoding, interprets '+' as a space
-        // in addition to regular percent decoding. https://url.spec.whatwg.org/#urlencoded-parsing
-        components.percentEncodedQuery =
-            [components.percentEncodedQuery stringByReplacingOccurrencesOfString:@"+"
-                                                                      withString:@"%20"];
-        // NB. @c queryItems are already percent decoded
-        NSArray<NSURLQueryItem *> *queryItems = components.queryItems;
-        for (NSURLQueryItem *queryItem in queryItems) {
-          [self addParameter:queryItem.name value:queryItem.value];
-        }
-        return self;
-      }
-    }
-    
-    // Fallback for iOS 7
-    NSString *query = URL.query;
-    // As OAuth uses application/x-www-form-urlencoded encoding, interprets '+' as a space
-    // in addition to regular percent decoding. https://url.spec.whatwg.org/#urlencoded-parsing
-    query = [query stringByReplacingOccurrencesOfString:@"+" withString:@"%20"];
-
-    NSArray<NSString *> *queryParts = [query componentsSeparatedByString:@"&"];
-    for (NSString *queryPart in queryParts) {
-      NSRange equalsRange = [queryPart rangeOfString:@"="];
-      if (equalsRange.location == NSNotFound) {
-        continue;
-      }
-      NSString *name = [queryPart substringToIndex:equalsRange.location];
-      name = name.stringByRemovingPercentEncoding;
-      NSString *value = [queryPart substringFromIndex:equalsRange.location + equalsRange.length];
-      value = value.stringByRemovingPercentEncoding;
-      [self addParameter:name value:value];
-    }
-    return self;
-  }
-  return self;
-}
-
-- (NSArray<NSString *> *)parameters {
-  return _parameters.allKeys;
-}
-
-- (NSDictionary<NSString *, NSObject<NSCopying> *> *)dictionaryValue {
-  // This method will flatten arrays in our @c _parameters' values if only one value exists.
-  NSMutableDictionary<NSString *, NSObject<NSCopying> *> *values = [NSMutableDictionary dictionary];
-  for (NSString *parameter in _parameters.allKeys) {
-    NSArray<NSString *> *value = _parameters[parameter];
-    if (value.count == 1) {
-      values[parameter] = [value.firstObject copy];
-    } else {
-      values[parameter] = [value copy];
-    }
-  }
-  return values;
-}
-
-- (NSArray<NSString *> *)valuesForParameter:(NSString *)parameter {
-  return _parameters[parameter];
-}
-
-- (void)addParameter:(NSString *)parameter value:(NSString *)value {
-  NSMutableArray<NSString *> *parameterValues = _parameters[parameter];
-  if (!parameterValues) {
-    parameterValues = [NSMutableArray array];
-    _parameters[parameter] = parameterValues;
-  }
-  [parameterValues addObject:value];
-}
-
-- (void)addParameters:(NSDictionary<NSString *, NSString *> *)parameters {
-  for (NSString *parameterName in parameters.allKeys) {
-    [self addParameter:parameterName value:parameters[parameterName]];
-  }
-}
-
-/*! @brief Builds a query items array that can be set to @c NSURLComponents.queryItems
-    @discussion The parameter names and values are NOT URL encoded.
-    @return An array of unencoded @c NSURLQueryItem objects.
- */
-- (NSMutableArray<NSURLQueryItem *> *)queryItems NS_AVAILABLE(10.10, 8.0) {
-  NSMutableArray<NSURLQueryItem *> *queryParameters = [NSMutableArray array];
-  for (NSString *parameterName in _parameters.allKeys) {
-    NSArray<NSString *> *values = _parameters[parameterName];
-    for (NSString *value in values) {
-      NSURLQueryItem *item = [NSURLQueryItem queryItemWithName:parameterName value:value];
-      [queryParameters addObject:item];
-    }
-  }
-  return queryParameters;
-}
-
-+ (NSMutableCharacterSet *)URLParamValueAllowedCharacters {
-  // Starts with the standard URL-allowed character set.
-  NSMutableCharacterSet *allowedParamCharacters =
-      [[NSCharacterSet URLQueryAllowedCharacterSet] mutableCopy];
-  // Removes additional characters we don't want to see in the query component.
-  [allowedParamCharacters removeCharactersInString:kQueryStringParamAdditionalDisallowedCharacters];
-  return allowedParamCharacters;
-}
-
-/*! @brief Builds a query string that can be set to @c NSURLComponents.percentEncodedQuery
-    @discussion This string is percent encoded, and shouldn't be used with
-        @c NSURLComponents.query.
-    @return An percentage encoded query string.
- */
-- (NSString *)percentEncodedQueryString {
-  NSMutableArray<NSString *> *parameterizedValues = [NSMutableArray array];
-
-  // Starts with the standard URL-allowed character set.
-  NSMutableCharacterSet *allowedParamCharacters = [[self class] URLParamValueAllowedCharacters];
-
-  for (NSString *parameterName in _parameters.allKeys) {
-    NSString *encodedParameterName =
-        [parameterName stringByAddingPercentEncodingWithAllowedCharacters:allowedParamCharacters];
-
-    NSArray<NSString *> *values = _parameters[parameterName];
-    for (NSString *value in values) {
-      NSString *encodedValue =
-          [value stringByAddingPercentEncodingWithAllowedCharacters:allowedParamCharacters];
-      NSString *parameterizedValue =
-          [NSString stringWithFormat:@"%@=%@", encodedParameterName, encodedValue];
-      [parameterizedValues addObject:parameterizedValue];
-    }
-  }
-
-  NSString *queryString = [parameterizedValues componentsJoinedByString:@"&"];
-  return queryString;
-}
-
-- (NSString *)URLEncodedParameters {
-  // If NSURLQueryItem is available, uses it for constructing the encoded parameters. (iOS 8+)
-  if (@available(iOS 8.0, macOS 10.10, *)) {
-    if (!gOIDURLQueryComponentForceIOS7Handling) {
-      NSURLComponents *components = [[NSURLComponents alloc] init];
-      components.queryItems = [self queryItems];
-      NSString *encodedQuery = components.percentEncodedQuery;
-      // NSURLComponents.percentEncodedQuery creates a validly escaped URL query component, but
-      // doesn't encode the '+' leading to potential ambiguity with application/x-www-form-urlencoded
-      // encoding. Percent encodes '+' to avoid this ambiguity.
-      encodedQuery = [encodedQuery stringByReplacingOccurrencesOfString:@"+" withString:@"%2B"];
-      return encodedQuery;
-    }
-  }
-
-  // else, falls back to building query string manually (iOS 7)
-  return [self percentEncodedQueryString];
-}
-
-- (NSURL *)URLByReplacingQueryInURL:(NSURL *)URL {
-  NSURLComponents *components =
-      [NSURLComponents componentsWithURL:URL resolvingAgainstBaseURL:NO];
-
-  // Replaces encodedQuery component
-  NSString *queryString = [self URLEncodedParameters];
-  components.percentEncodedQuery = queryString;
-
-  NSURL *URLWithParameters = components.URL;
-  return URLWithParameters;
-}
-
-#pragma mark - NSObject overrides
-
-- (NSString *)description {
-  return [NSString stringWithFormat:@"<%@: %p, parameters: %@>",
-                                    NSStringFromClass([self class]),
-                                    (void *)self,
-                                    _parameters];
-}
-
-@end

+ 0 - 40
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDURLSessionProvider.h

@@ -1,40 +0,0 @@
-/*! @file OIDURLSessionProvider.h
- @brief AppAuth iOS SDK
- @copyright
- Copyright 2015 Google Inc. All Rights Reserved.
- @copydetails
- 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.
- */
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-/*! @brief A NSURLSession provider that allows clients to provide custom implementation
-        for NSURLSession
- */
-@interface OIDURLSessionProvider : NSObject
-
-/*! @brief Obtains the current @c NSURLSession; using the +[NSURLSession sharedSession] if
-        no custom implementation is provided.
-    @return NSURLSession object to be used for making network requests.
- */
-+ (NSURLSession *)session;
-
-/*! @brief Allows library consumers to change the @c NSURLSession instance used to make
-        network requests.
-    @param session The @c NSURLSession instance that should be used for making network requests.
- */
-+ (void)setSession:(NSURLSession *)session;
-@end
-NS_ASSUME_NONNULL_END

+ 0 - 39
PDF Office/PDF Master/Class/Home/NSObject/Services/AppAuthClass/AppAuthCore/OIDURLSessionProvider.m

@@ -1,39 +0,0 @@
-/*! @file OIDURLSessionProvider.m
- @brief AppAuth iOS SDK
- @copyright
- Copyright 2015 Google Inc. All Rights Reserved.
- @copydetails
- 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.
- */
-
-#import "OIDURLSessionProvider.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-static NSURLSession *__nullable gURLSession;
-
-@implementation OIDURLSessionProvider
-
-+ (NSURLSession *)session {
-    if (!gURLSession) {
-        gURLSession = [NSURLSession sharedSession];
-    }
-    return gURLSession;
-}
-
-+ (void)setSession:(NSURLSession *)session {
-    NSAssert(session, @"Parameter: |session| must be non-nil.");
-    gURLSession = session;
-}
-@end
-NS_ASSUME_NONNULL_END

+ 0 - 61
PDF Office/PDF Master/Class/Home/NSObject/Services/DropboxModel.h

@@ -1,61 +0,0 @@
-//
-//  DropboxModel.h
-//  PDF Reader
-//
-//  Created by HuFeng on 13-3-27.
-//  Copyright (c) 2013年 zhangjie. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-static NSString* kUpdateUserName = @"updateUserName";
-
-@protocol DropboxModelDelegate <NSObject>
-
-@optional
-
-- (void)updateAccountInfo:(NSString *)userName;
-
-- (void)cancelUpLoadProgressBar;
-
-- (void)updateUploadProgressBar:(float)value
-                    withMessage:(NSString *)message
-                leftFilesString:(NSString *)filesString;
-
-@end
-
-@class DBOAuthResult;
-@interface DropboxModel : NSObject
-{
-//    id <DropboxModelDelegate> objectDelegate;
-    NSString *_appKey;
-    NSString *_appSecret;
-    NSString *_root;
-    NSArray *_filePathArray;
-    NSString   *_currentUploadPath;
-    float      _progressValue;
-    NSString *_userName;
-    NSString *_syncDate;
-}
-
-@property (assign) id <DropboxModelDelegate> objectDelegate;
-@property (nonatomic,retain) NSArray *filePathArray;
-@property (nonatomic,retain) NSString *currentUploadPath;
-@property (nonatomic,retain) NSString *userName;
-@property (nonatomic,retain) NSString *syncDate;
-@property (nonatomic,retain) NSString *userEmail;
-
-+ (DropboxModel *)shared;
-
-- (void)handleAppleEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent;
-
-- (void)handleAuthResult:(DBOAuthResult * _Nullable)authResult;
-
-// 上传文件到 Dropbox 根目录
-- (BOOL)uploadFile:(NSArray *)filePathArray;
-- (void)cancleUploadFile;
-- (void)unlinkAll;
-- (BOOL)isLinked;
-- (void)linkServer;
-
-@end

+ 0 - 385
PDF Office/PDF Master/Class/Home/NSObject/Services/DropboxModel.m

@@ -1,385 +0,0 @@
-//
-//  DropboxModel.m
-//  PDF Reader
-//
-//  Created by HuFeng on 13-3-27.
-//  Copyright (c) 2013年 zhangjie. All rights reserved.
-// __MAC_10_9
-
-#import "DropboxModel.h"
-
-#if __MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_9
-#import <ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.h>
-#endif
-
-#define UserNameKey       @"GetUserName"
-#define FileSyncDateKey   @"FileSyncDate"
-#define UserEmailKey       @"GetEmailName"
-
-@interface DropboxModel ()
-@property(nonatomic, copy) NSString *appKey;
-@property(nonatomic, copy) NSString *appSecret;
-@property(nonatomic, copy) NSString *root;
-
-#if __MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_9
-@property (nonatomic,retain) DBUploadTask *uploadTask;
-#endif
-
-@end
-
-@implementation DropboxModel
-@synthesize objectDelegate;
-@synthesize appKey           = _appKey;
-@synthesize appSecret        = _appSecret;
-@synthesize root             = _root;
-@synthesize filePathArray     = _filePathArray;
-@synthesize currentUploadPath = _currentUploadPath;
-@synthesize userName          = _userName;
-@synthesize syncDate          = _syncDate;
-
-+ (DropboxModel *)shared {
-    static DropboxModel *sharedModel = nil;
-    static dispatch_once_t predicate;
-    dispatch_once(&predicate, ^{
-        sharedModel = [[DropboxModel alloc] init];
-    });
-    return sharedModel;
-}
-
-- (id)init {
-    self = [super init];
-    if (self) {
-        // 设置 Dropbox 的app参数,由彦忠管理,
-#if VERSION_PRO
-        self.appKey = @"amipzwtlg9lrwyl";
-#else
-        self.appKey = @"jxjlqfm1cfp2mjj";
-#endif
-
-        NSString *registeredUrlToHandle = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleURLTypes"][0][@"CFBundleURLSchemes"][0];
-        if (!self.appKey ||
-            [registeredUrlToHandle rangeOfString:@"<"].location != NSNotFound) {
-            NSString *message = @"You need to set `appKey` variable in `AppDelegate.m`, as well as add to `Info.plist`, before you can use DBRoulette.";
-            NSLog(@"%@", message);
-            NSLog(@"Terminating...");
-            exit(1);
-        }
-
-        self.userName = [[NSUserDefaults standardUserDefaults] objectForKey:UserNameKey];
-        self.syncDate = [[NSUserDefaults standardUserDefaults] objectForKey:FileSyncDateKey];
-        self.userEmail = [[NSUserDefaults standardUserDefaults] objectForKey:UserEmailKey];
-    }
-    return self;
-}
-
-#pragma mark -
-#pragma mark ===== User Login =====
-- (void)handleAppleEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent
-{
-    NSURL *url = [NSURL URLWithString:[[event paramDescriptorForKeyword:keyDirectObject] stringValue]];
- 
-}
-
-- (void)handleAuthResult:(DBOAuthResult *)authResult {
-    if (authResult != nil) {
-        if ([authResult isSuccess]) {
-            NSLog(@"Success! User is logged into Dropbox.");
-            if( [self isLinked]){
-                [self loadAccountInfomation];
-                
-                if (nil != self.filePathArray) {
-                    [self uploadFileToServer];
-                }
-            }
-            
-        } else if ([authResult isCancel]) {
-            if ([objectDelegate respondsToSelector:@selector(cancelUpLoadProgressBar)]) {
-                [objectDelegate cancelUpLoadProgressBar];
-            }
-        } else if ([authResult isError]) {
-            if ([objectDelegate respondsToSelector:@selector(cancelUpLoadProgressBar)]) {
-                [objectDelegate cancelUpLoadProgressBar];
-            }
-            
-            NSAlert *alert = [[NSAlert alloc] init];
-            [alert setAlertStyle:NSAlertStyleCritical];
-            [alert setMessageText:authResult.errorDescription];
-            [alert runModal];
-            NSLog(@"Error: %@", authResult);
-        }
-    }
-}
-
-- (void)loadAccountInfomation
-{
-    DBUserClient *client = [DBClientsManager authorizedClient];
-    [[client.usersRoutes getCurrentAccount] setResponseBlock:^(DBUSERSFullAccount * _Nullable result, DBNilObject * _Nullable routeError, DBRequestError * _Nullable networkError) {
-        
-        if (![_userName isEqualToString:result.name.givenName]) {
-            self.userName = result.name.givenName;
-            [[NSUserDefaults standardUserDefaults] setObject:self.userName forKey:UserNameKey];
-            [[NSUserDefaults standardUserDefaults] synchronize];
-            
-        }
-        self.userEmail = result.email;
-        [[NSUserDefaults standardUserDefaults] setObject:self.userEmail forKey:UserEmailKey];
-        [[NSNotificationCenter defaultCenter] postNotificationName:kUpdateUserName object:self.userName];
-        
-    }];
-}
-
-#pragma mark -
-#pragma mark ===== authenticate =====
-- (void)linkServer
-{
-    [DBClientsManager authorizeFromControllerDesktop:[NSWorkspace sharedWorkspace]
-                                          controller:nil
-                                             openURL:^(NSURL *url){
-        [[NSWorkspace sharedWorkspace] openURL:url];
-    }];
-}
-
-- (void)unlinkAll
-{
-    if ([DBClientsManager authorizedClient])
-    {
-        [DBClientsManager unlinkAndResetClients];
-        self.userName = NSLocalizedString(@"Invalid Username",nil);
-        [[NSUserDefaults standardUserDefaults] setObject:self.userName forKey:UserNameKey];
-        [[NSUserDefaults standardUserDefaults] synchronize];
-        [[NSNotificationCenter defaultCenter] postNotificationName:kUpdateUserName object:self.userName];
-    }
-}
-
-- (BOOL)isLinked
-{
-    return ([DBClientsManager authorizedClient] ? YES : NO);
-}
-
-- (void)getUrl:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent
-{
-    // This gets called when the user clicks Show "App name". You don't need to do anything for Dropbox here
-}
-
-#define FreeVersion_UploadInformation @"FreeVersionUploadInformation"
-#define FreeVersion_UploadInformation_UploadDate @"UploadDate"
-#define FreeVersion_UploadInformation_FileCount @"UploadFileCount"
-- (void)updateNumberOfUploadFile
-{
-    if ([[NSUserDefaults standardUserDefaults] objectForKey:FreeVersion_UploadInformation]) {
-        if ([self numberOfUploadFile] != 0) {
-            NSDictionary *dic = [[NSUserDefaults standardUserDefaults] objectForKey:FreeVersion_UploadInformation];
-            NSNumber *number = [dic objectForKey:FreeVersion_UploadInformation_FileCount];
-            NSInteger count = [number integerValue];
-            count++;
-            NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:
-                                        [NSDate date],FreeVersion_UploadInformation_UploadDate,
-                                        [NSNumber numberWithInteger:count],FreeVersion_UploadInformation_FileCount,nil];
-            [[NSUserDefaults standardUserDefaults] setObject:dictionary forKey:FreeVersion_UploadInformation];
-            [[NSUserDefaults standardUserDefaults] synchronize];
-            return;
-        }
-    }
-    NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:
-                         [NSDate date],FreeVersion_UploadInformation_UploadDate,
-                         [NSNumber numberWithInteger:1],FreeVersion_UploadInformation_FileCount,nil];
-    [[NSUserDefaults standardUserDefaults] setObject:dic forKey:FreeVersion_UploadInformation];
-    [[NSUserDefaults standardUserDefaults] synchronize];
-}
-
-- (NSInteger)numberOfUploadFile
-{
-    NSDateComponents *ccomps = [[NSCalendar currentCalendar] components:(NSYearCalendarUnit | NSMonthCalendarUnit |NSDayCalendarUnit)
-                                                               fromDate:[NSDate date]];
-    NSInteger cyear = [ccomps year];
-    NSInteger cmonth = [ccomps month];
-    NSInteger cday = [ccomps day];
-    if ([[NSUserDefaults standardUserDefaults] objectForKey:FreeVersion_UploadInformation]) {
-        NSDictionary *dic = [[NSUserDefaults standardUserDefaults] objectForKey:FreeVersion_UploadInformation];
-        
-        NSDate *date = [dic objectForKey:FreeVersion_UploadInformation_UploadDate];
-        NSNumber *number = [dic objectForKey:FreeVersion_UploadInformation_FileCount];
-        
-        if (date) {
-            NSDateComponents *comps = [[NSCalendar currentCalendar] components:(NSYearCalendarUnit | NSMonthCalendarUnit |NSDayCalendarUnit)
-                                                                      fromDate:date];
-            NSInteger year = [comps year];
-            NSInteger month = [comps month];
-            NSInteger day = [comps day];
-            if (year == cyear &&
-                month == cmonth &&
-                day == cday) {
-                return [number integerValue];
-            } else {
-                return 0;
-            }
-        } else {
-            return 0;
-        }
-    }
-    return 0;
-}
-
-#pragma mark -
-#pragma mark ===== UPload files =====
-- (BOOL)uploadFile:(NSArray *)filePathArray
-{
-    self.filePathArray = filePathArray;
-//    if (![IAPProductsManager defaultManager].isAvailableAllFunction) {
-        //免費版當天只能限制dropbox 10個檔案同步
-        NSUInteger count = [self numberOfUploadFile];
-//        if (10 <= count) {
-//            [KMPurchaseCompareTool showPurchaseCompareWindowController];
-//            return NO;
-//        } else if (count<10 && count > 0) {
-            if (self.filePathArray.count > (10-count)) {
-                self.filePathArray = [filePathArray subarrayWithRange:NSMakeRange(0, 10-count)];
-            }
-//        }
-//    }
-    if ([self isLinked]) {
-        [self uploadFileToServer];
-    } else {
-        if ([objectDelegate respondsToSelector:@selector(updateUploadProgressBar:withMessage:leftFilesString:)]) {
-            [objectDelegate updateUploadProgressBar:0
-                                        withMessage:NSLocalizedString(@"Authenticating...", nil)
-                                    leftFilesString:nil];
-        }
-        [self linkServer];
-    }
-    return YES;
-}
-
-- (void)uploadFileToServer
-{
-    _currentUploadPath = [_filePathArray objectAtIndex:0];
-    [self newUploatFile];
-}
-
-- (void)newUploatFile
-{
-    [self updateNumberOfUploadFile];
-    
-    NSData *fileData = [[NSData alloc] initWithContentsOfURL:[NSURL fileURLWithPath:_currentUploadPath]];
-    NSString * path = [NSString stringWithFormat:@"/%@",[_currentUploadPath lastPathComponent]];
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-        DBUserClient * client = [DBClientsManager authorizedClient];
-        self.uploadTask = [client.filesRoutes uploadData:path inputData:fileData];
-        
-        [[self.uploadTask setResponseBlock:^(DBFILESFileMetadata *result, DBFILESUploadError *routeError, DBRequestError *networkError) {
-            if (result) {
-                NSLog(@"---上传成功");
-                self.syncDate = [self fileSyncDateStr];
-                [[NSUserDefaults standardUserDefaults] setObject:self.syncDate forKey:FileSyncDateKey];
-                [[NSUserDefaults standardUserDefaults] synchronize];
-                
-                NSInteger cnt = [_filePathArray count];
-                NSInteger index = [_filePathArray indexOfObject:_currentUploadPath];
-                if (1 == _progressValue && index < cnt - 1) {
-                    _currentUploadPath = [_filePathArray objectAtIndex:index + 1];
-                    [self newUploatFile];
-                } else {
-                    self.filePathArray = nil;
-                }
-            } else {
-                NSLog(@"---上传失败");
-                [self newUploadFileState:networkError.statusCode.integerValue];
-            }
-        }] setProgressBlock:^(int64_t bytesUploaded, int64_t totalBytesUploaded, int64_t totalBytesExpectedToUploaded) {
-            NSInteger cnt = [_filePathArray count];
-            NSInteger index = [_filePathArray indexOfObject:_currentUploadPath];
-            _progressValue = totalBytesUploaded/(CGFloat)(totalBytesExpectedToUploaded);
-            float totalProgress = (index + _progressValue)/cnt;
-            if ([objectDelegate respondsToSelector:@selector(updateUploadProgressBar:withMessage:leftFilesString:)]) {
-                NSString * contenxtString = nil;
-                if (self.filePathArray.count > 1) {
-                    contenxtString = [NSString stringWithFormat:NSLocalizedString(@"%ld files left", nil),cnt - index];
-                } else {
-                    contenxtString = [NSString stringWithFormat:NSLocalizedString(@"%ld file left", nil),cnt - index];
-                }
-                [objectDelegate updateUploadProgressBar:totalProgress
-                                            withMessage:NSLocalizedString(@"Uploading...", nil)
-                                        leftFilesString:contenxtString];
-            }
-        }];
-    });
-}
-
-- (void)newUploadFileState:(NSInteger)code
-{
-    NSLog(@"---上传失败");
-    self.filePathArray = nil;
-    
-    if ([objectDelegate respondsToSelector:@selector(cancelUpLoadProgressBar)]) {
-        [objectDelegate cancelUpLoadProgressBar];
-    }
-    
-    NSAlert *alert = [[NSAlert alloc] init];
-    [alert setAlertStyle:NSAlertStyleCritical];
-    
-    NSString *tStrMessage = NSLocalizedString(@"Server Error", nil);
-    
-    switch (code) {
-        case 400:
-        {
-            NSLog(@"Bad input parameter.");
-            tStrMessage = NSLocalizedString(@"Upload Failed!", nil);
-        }
-            break;
-        case 401:
-            NSLog(@"Bad or expired token.");
-            tStrMessage = NSLocalizedString(@"Authentication Failed!", nil);
-            break;
-        case 403:
-            NSLog(@"Bad OAuth request.");
-            tStrMessage = NSLocalizedString(@"Authentication Failed!", nil);
-            break;
-        case 404:
-            NSLog(@"The file or folder is not found at the specified path.");
-            tStrMessage = NSLocalizedString(@"Upload Failed!", nil);
-            break;
-        case 405:
-            NSLog(@"Request method not expected (generally should be GET or POST).");
-            tStrMessage = NSLocalizedString(@"Upload Failed!", nil);
-            break;
-        case 409:
-            NSLog(@"Unlike many other error codes, it doesn’t have any specific meaning in the HTTP spec.");
-            tStrMessage = NSLocalizedString(@"Unlike many other error codes, it doesn’t have any specific meaning in the HTTP spec.", nil);
-            break;
-        case 503:
-            NSLog(@"Your app is making too many requests and is being rate limited.");
-            tStrMessage = NSLocalizedString(@"Upload Failed!", nil);
-            break;
-        case 507:
-            NSLog(@"User is over Dropbox storage quota.");
-            tStrMessage = NSLocalizedString(@"Upload Failed!", nil);
-            break;
-        default:
-            tStrMessage = NSLocalizedString(@"Server Error", nil);
-            break;
-    }
-    
-    [alert setMessageText:tStrMessage];
-    
-    [alert runModal];
-}
-
-- (void)cancleUploadFile
-{
-    self.filePathArray = nil;
-    if ([self isLinked]) {
-        [self.uploadTask cancel];
-    }
-}
-
-#pragma mark -
-
-- (NSString *)fileSyncDateStr
-{
-    NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init];
-    [dateFormatter setDateStyle:(kCFDateFormatterShortStyle)];
-    [dateFormatter setTimeStyle:(kCFDateFormatterShortStyle)];
-    return [dateFormatter stringFromDate:[NSDate date]];
-}
-
-@end

+ 0 - 14
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/Drive/GTLRDrive.h

@@ -1,14 +0,0 @@
-// NOTE: This file was generated by the ServiceGenerator.
-
-// ----------------------------------------------------------------------------
-// API:
-//   Drive API (drive/v3)
-// Description:
-//   Manages files in Drive including uploading, downloading, searching,
-//   detecting changes, and updating sharing permissions.
-// Documentation:
-//   https://developers.google.com/drive/
-
-#import "GTLRDriveObjects.h"
-#import "GTLRDriveQuery.h"
-#import "GTLRDriveService.h"

File diff suppressed because it is too large
+ 0 - 3148
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/Drive/GTLRDriveObjects.h


+ 0 - 977
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/Drive/GTLRDriveObjects.m

@@ -1,977 +0,0 @@
-// NOTE: This file was generated by the ServiceGenerator.
-
-// ----------------------------------------------------------------------------
-// API:
-//   Drive API (drive/v3)
-// Description:
-//   Manages files in Drive including uploading, downloading, searching,
-//   detecting changes, and updating sharing permissions.
-// Documentation:
-//   https://developers.google.com/drive/
-
-//#import <GoogleAPIClientForREST/GTLRDriveObjects.h>
-#import "GTLRDriveObjects.h"
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_About
-//
-
-@implementation GTLRDrive_About
-@dynamic appInstalled, canCreateDrives, canCreateTeamDrives, driveThemes,
-         exportFormats, folderColorPalette, importFormats, kind, maxImportSizes,
-         maxUploadSize, storageQuota, teamDriveThemes, user;
-
-+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
-  NSDictionary<NSString *, Class> *map = @{
-    @"driveThemes" : [GTLRDrive_About_DriveThemes_Item class],
-    @"folderColorPalette" : [NSString class],
-    @"teamDriveThemes" : [GTLRDrive_About_TeamDriveThemes_Item class]
-  };
-  return map;
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_About_DriveThemes_Item
-//
-
-@implementation GTLRDrive_About_DriveThemes_Item
-@dynamic backgroundImageLink, colorRgb, identifier;
-
-+ (NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap {
-  return @{ @"identifier" : @"id" };
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_About_ExportFormats
-//
-
-@implementation GTLRDrive_About_ExportFormats
-
-+ (Class)classForAdditionalProperties {
-  return [NSString class];
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_About_ImportFormats
-//
-
-@implementation GTLRDrive_About_ImportFormats
-
-+ (Class)classForAdditionalProperties {
-  return [NSString class];
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_About_MaxImportSizes
-//
-
-@implementation GTLRDrive_About_MaxImportSizes
-
-+ (Class)classForAdditionalProperties {
-  return [NSNumber class];
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_About_StorageQuota
-//
-
-@implementation GTLRDrive_About_StorageQuota
-@dynamic limit, usage, usageInDrive, usageInDriveTrash;
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_About_TeamDriveThemes_Item
-//
-
-@implementation GTLRDrive_About_TeamDriveThemes_Item
-@dynamic backgroundImageLink, colorRgb, identifier;
-
-+ (NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap {
-  return @{ @"identifier" : @"id" };
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_Change
-//
-
-@implementation GTLRDrive_Change
-@dynamic changeType, drive, driveId, file, fileId, kind, removed, teamDrive,
-         teamDriveId, time, type;
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_ChangeList
-//
-
-@implementation GTLRDrive_ChangeList
-@dynamic changes, kind, newStartPageToken, nextPageToken;
-
-+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
-  NSDictionary<NSString *, Class> *map = @{
-    @"changes" : [GTLRDrive_Change class]
-  };
-  return map;
-}
-
-+ (NSString *)collectionItemsKey {
-  return @"changes";
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_Channel
-//
-
-@implementation GTLRDrive_Channel
-@dynamic address, expiration, identifier, kind, params, payload, resourceId,
-         resourceUri, token, type;
-
-+ (NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap {
-  return @{ @"identifier" : @"id" };
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_Channel_Params
-//
-
-@implementation GTLRDrive_Channel_Params
-
-+ (Class)classForAdditionalProperties {
-  return [NSString class];
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_Comment
-//
-
-@implementation GTLRDrive_Comment
-@dynamic anchor, author, content, createdTime, deleted, htmlContent, identifier,
-         kind, modifiedTime, quotedFileContent, replies, resolved;
-
-+ (NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap {
-  return @{ @"identifier" : @"id" };
-}
-
-+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
-  NSDictionary<NSString *, Class> *map = @{
-    @"replies" : [GTLRDrive_Reply class]
-  };
-  return map;
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_Comment_QuotedFileContent
-//
-
-@implementation GTLRDrive_Comment_QuotedFileContent
-@dynamic mimeType, value;
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_CommentList
-//
-
-@implementation GTLRDrive_CommentList
-@dynamic comments, kind, nextPageToken;
-
-+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
-  NSDictionary<NSString *, Class> *map = @{
-    @"comments" : [GTLRDrive_Comment class]
-  };
-  return map;
-}
-
-+ (NSString *)collectionItemsKey {
-  return @"comments";
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_ContentRestriction
-//
-
-@implementation GTLRDrive_ContentRestriction
-@dynamic readOnly, reason, restrictingUser, restrictionTime, type;
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_Drive
-//
-
-@implementation GTLRDrive_Drive
-@dynamic backgroundImageFile, backgroundImageLink, capabilities, colorRgb,
-         createdTime, hidden, identifier, kind, name, orgUnitId, restrictions,
-         themeId;
-
-+ (NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap {
-  return @{ @"identifier" : @"id" };
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_Drive_BackgroundImageFile
-//
-
-@implementation GTLRDrive_Drive_BackgroundImageFile
-@dynamic identifier, width, xCoordinate, yCoordinate;
-
-+ (NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap {
-  return @{ @"identifier" : @"id" };
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_Drive_Capabilities
-//
-
-@implementation GTLRDrive_Drive_Capabilities
-@dynamic canAddChildren, canChangeCopyRequiresWriterPermissionRestriction,
-         canChangeDomainUsersOnlyRestriction, canChangeDriveBackground,
-         canChangeDriveMembersOnlyRestriction, canComment, canCopy,
-         canDeleteChildren, canDeleteDrive, canDownload, canEdit,
-         canListChildren, canManageMembers, canReadRevisions, canRename,
-         canRenameDrive, canResetDriveRestrictions, canShare, canTrashChildren;
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_Drive_Restrictions
-//
-
-@implementation GTLRDrive_Drive_Restrictions
-@dynamic adminManagedRestrictions, copyRequiresWriterPermission,
-         domainUsersOnly, driveMembersOnly;
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_DriveList
-//
-
-@implementation GTLRDrive_DriveList
-@dynamic drives, kind, nextPageToken;
-
-+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
-  NSDictionary<NSString *, Class> *map = @{
-    @"drives" : [GTLRDrive_Drive class]
-  };
-  return map;
-}
-
-+ (NSString *)collectionItemsKey {
-  return @"drives";
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_File
-//
-
-@implementation GTLRDrive_File
-@dynamic appProperties, capabilities, contentHints, contentRestrictions,
-         copyRequiresWriterPermission, createdTime, descriptionProperty,
-         driveId, explicitlyTrashed, exportLinks, fileExtension, folderColorRgb,
-         fullFileExtension, hasAugmentedPermissions, hasThumbnail,
-         headRevisionId, iconLink, identifier, imageMediaMetadata,
-         isAppAuthorized, kind, labelInfo, lastModifyingUser, linkShareMetadata,
-         md5Checksum, mimeType, modifiedByMe, modifiedByMeTime, modifiedTime,
-         name, originalFilename, ownedByMe, owners, parents, permissionIds,
-         permissions, properties, quotaBytesUsed, resourceKey, sha1Checksum,
-         sha256Checksum, shared, sharedWithMeTime, sharingUser, shortcutDetails,
-         size, spaces, starred, teamDriveId, thumbnailLink, thumbnailVersion,
-         trashed, trashedTime, trashingUser, version, videoMediaMetadata,
-         viewedByMe, viewedByMeTime, viewersCanCopyContent, webContentLink,
-         webViewLink, writersCanShare;
-
-+ (NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap {
-  NSDictionary<NSString *, NSString *> *map = @{
-    @"descriptionProperty" : @"description",
-    @"identifier" : @"id"
-  };
-  return map;
-}
-
-+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
-  NSDictionary<NSString *, Class> *map = @{
-    @"contentRestrictions" : [GTLRDrive_ContentRestriction class],
-    @"owners" : [GTLRDrive_User class],
-    @"parents" : [NSString class],
-    @"permissionIds" : [NSString class],
-    @"permissions" : [GTLRDrive_Permission class],
-    @"spaces" : [NSString class]
-  };
-  return map;
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_File_AppProperties
-//
-
-@implementation GTLRDrive_File_AppProperties
-
-+ (Class)classForAdditionalProperties {
-  return [NSString class];
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_File_Capabilities
-//
-
-@implementation GTLRDrive_File_Capabilities
-@dynamic canAcceptOwnership, canAddChildren, canAddFolderFromAnotherDrive,
-         canAddMyDriveParent, canChangeCopyRequiresWriterPermission,
-         canChangeSecurityUpdateEnabled, canChangeViewersCanCopyContent,
-         canComment, canCopy, canDelete, canDeleteChildren, canDownload,
-         canEdit, canListChildren, canModifyContent,
-         canModifyContentRestriction, canModifyLabels,
-         canMoveChildrenOutOfDrive, canMoveChildrenOutOfTeamDrive,
-         canMoveChildrenWithinDrive, canMoveChildrenWithinTeamDrive,
-         canMoveItemIntoTeamDrive, canMoveItemOutOfDrive,
-         canMoveItemOutOfTeamDrive, canMoveItemWithinDrive,
-         canMoveItemWithinTeamDrive, canMoveTeamDriveItem, canReadDrive,
-         canReadLabels, canReadRevisions, canReadTeamDrive, canRemoveChildren,
-         canRemoveMyDriveParent, canRename, canShare, canTrash,
-         canTrashChildren, canUntrash;
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_File_ContentHints
-//
-
-@implementation GTLRDrive_File_ContentHints
-@dynamic indexableText, thumbnail;
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_File_ExportLinks
-//
-
-@implementation GTLRDrive_File_ExportLinks
-
-+ (Class)classForAdditionalProperties {
-  return [NSString class];
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_File_ImageMediaMetadata
-//
-
-@implementation GTLRDrive_File_ImageMediaMetadata
-@dynamic aperture, cameraMake, cameraModel, colorSpace, exposureBias,
-         exposureMode, exposureTime, flashUsed, focalLength, height, isoSpeed,
-         lens, location, maxApertureValue, meteringMode, rotation, sensor,
-         subjectDistance, time, whiteBalance, width;
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_File_LabelInfo
-//
-
-@implementation GTLRDrive_File_LabelInfo
-@dynamic labels;
-
-+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
-  NSDictionary<NSString *, Class> *map = @{
-    @"labels" : [GTLRDrive_Label class]
-  };
-  return map;
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_File_LinkShareMetadata
-//
-
-@implementation GTLRDrive_File_LinkShareMetadata
-@dynamic securityUpdateEligible, securityUpdateEnabled;
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_File_Properties
-//
-
-@implementation GTLRDrive_File_Properties
-
-+ (Class)classForAdditionalProperties {
-  return [NSString class];
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_File_ShortcutDetails
-//
-
-@implementation GTLRDrive_File_ShortcutDetails
-@dynamic targetId, targetMimeType, targetResourceKey;
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_File_VideoMediaMetadata
-//
-
-@implementation GTLRDrive_File_VideoMediaMetadata
-@dynamic durationMillis, height, width;
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_File_ContentHints_Thumbnail
-//
-
-@implementation GTLRDrive_File_ContentHints_Thumbnail
-@dynamic image, mimeType;
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_File_ImageMediaMetadata_Location
-//
-
-@implementation GTLRDrive_File_ImageMediaMetadata_Location
-@dynamic altitude, latitude, longitude;
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_FileList
-//
-
-@implementation GTLRDrive_FileList
-@dynamic files, incompleteSearch, kind, nextPageToken;
-
-+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
-  NSDictionary<NSString *, Class> *map = @{
-    @"files" : [GTLRDrive_File class]
-  };
-  return map;
-}
-
-+ (NSString *)collectionItemsKey {
-  return @"files";
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_GeneratedIds
-//
-
-@implementation GTLRDrive_GeneratedIds
-@dynamic ids, kind, space;
-
-+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
-  NSDictionary<NSString *, Class> *map = @{
-    @"ids" : [NSString class]
-  };
-  return map;
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_Label
-//
-
-@implementation GTLRDrive_Label
-@dynamic fields, identifier, kind, revisionId;
-
-+ (NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap {
-  return @{ @"identifier" : @"id" };
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_Label_Fields
-//
-
-@implementation GTLRDrive_Label_Fields
-
-+ (Class)classForAdditionalProperties {
-  return [GTLRDrive_LabelField class];
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_LabelField
-//
-
-@implementation GTLRDrive_LabelField
-@dynamic dateString, identifier, integer, kind, selection, text, user,
-         valueType;
-
-+ (NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap {
-  return @{ @"identifier" : @"id" };
-}
-
-+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
-  NSDictionary<NSString *, Class> *map = @{
-    @"dateString" : [GTLRDateTime class],
-    @"integer" : [NSNumber class],
-    @"selection" : [NSString class],
-    @"text" : [NSString class],
-    @"user" : [GTLRDrive_User class]
-  };
-  return map;
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_LabelFieldModification
-//
-
-@implementation GTLRDrive_LabelFieldModification
-@dynamic fieldId, kind, setDateValues, setIntegerValues, setSelectionValues,
-         setTextValues, setUserValues, unsetValues;
-
-+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
-  NSDictionary<NSString *, Class> *map = @{
-    @"setDateValues" : [GTLRDateTime class],
-    @"setIntegerValues" : [NSNumber class],
-    @"setSelectionValues" : [NSString class],
-    @"setTextValues" : [NSString class],
-    @"setUserValues" : [NSString class]
-  };
-  return map;
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_LabelList
-//
-
-@implementation GTLRDrive_LabelList
-@dynamic kind, labels, nextPageToken;
-
-+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
-  NSDictionary<NSString *, Class> *map = @{
-    @"labels" : [GTLRDrive_Label class]
-  };
-  return map;
-}
-
-+ (NSString *)collectionItemsKey {
-  return @"labels";
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_LabelModification
-//
-
-@implementation GTLRDrive_LabelModification
-@dynamic fieldModifications, kind, labelId, removeLabel;
-
-+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
-  NSDictionary<NSString *, Class> *map = @{
-    @"fieldModifications" : [GTLRDrive_LabelFieldModification class]
-  };
-  return map;
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_ModifyLabelsRequest
-//
-
-@implementation GTLRDrive_ModifyLabelsRequest
-@dynamic kind, labelModifications;
-
-+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
-  NSDictionary<NSString *, Class> *map = @{
-    @"labelModifications" : [GTLRDrive_LabelModification class]
-  };
-  return map;
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_ModifyLabelsResponse
-//
-
-@implementation GTLRDrive_ModifyLabelsResponse
-@dynamic kind, modifiedLabels;
-
-+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
-  NSDictionary<NSString *, Class> *map = @{
-    @"modifiedLabels" : [GTLRDrive_Label class]
-  };
-  return map;
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_Permission
-//
-
-@implementation GTLRDrive_Permission
-@dynamic allowFileDiscovery, deleted, displayName, domain, emailAddress,
-         expirationTime, identifier, kind, pendingOwner, permissionDetails,
-         photoLink, role, teamDrivePermissionDetails, type, view;
-
-+ (NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap {
-  return @{ @"identifier" : @"id" };
-}
-
-+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
-  NSDictionary<NSString *, Class> *map = @{
-    @"permissionDetails" : [GTLRDrive_Permission_PermissionDetails_Item class],
-    @"teamDrivePermissionDetails" : [GTLRDrive_Permission_TeamDrivePermissionDetails_Item class]
-  };
-  return map;
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_Permission_PermissionDetails_Item
-//
-
-@implementation GTLRDrive_Permission_PermissionDetails_Item
-@dynamic inherited, inheritedFrom, permissionType, role;
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_Permission_TeamDrivePermissionDetails_Item
-//
-
-@implementation GTLRDrive_Permission_TeamDrivePermissionDetails_Item
-@dynamic inherited, inheritedFrom, role, teamDrivePermissionType;
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_PermissionList
-//
-
-@implementation GTLRDrive_PermissionList
-@dynamic kind, nextPageToken, permissions;
-
-+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
-  NSDictionary<NSString *, Class> *map = @{
-    @"permissions" : [GTLRDrive_Permission class]
-  };
-  return map;
-}
-
-+ (NSString *)collectionItemsKey {
-  return @"permissions";
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_Reply
-//
-
-@implementation GTLRDrive_Reply
-@dynamic action, author, content, createdTime, deleted, htmlContent, identifier,
-         kind, modifiedTime;
-
-+ (NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap {
-  return @{ @"identifier" : @"id" };
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_ReplyList
-//
-
-@implementation GTLRDrive_ReplyList
-@dynamic kind, nextPageToken, replies;
-
-+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
-  NSDictionary<NSString *, Class> *map = @{
-    @"replies" : [GTLRDrive_Reply class]
-  };
-  return map;
-}
-
-+ (NSString *)collectionItemsKey {
-  return @"replies";
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_Revision
-//
-
-@implementation GTLRDrive_Revision
-@dynamic exportLinks, identifier, keepForever, kind, lastModifyingUser,
-         md5Checksum, mimeType, modifiedTime, originalFilename, publishAuto,
-         published, publishedLink, publishedOutsideDomain, size;
-
-+ (NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap {
-  return @{ @"identifier" : @"id" };
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_Revision_ExportLinks
-//
-
-@implementation GTLRDrive_Revision_ExportLinks
-
-+ (Class)classForAdditionalProperties {
-  return [NSString class];
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_RevisionList
-//
-
-@implementation GTLRDrive_RevisionList
-@dynamic kind, nextPageToken, revisions;
-
-+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
-  NSDictionary<NSString *, Class> *map = @{
-    @"revisions" : [GTLRDrive_Revision class]
-  };
-  return map;
-}
-
-+ (NSString *)collectionItemsKey {
-  return @"revisions";
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_StartPageToken
-//
-
-@implementation GTLRDrive_StartPageToken
-@dynamic kind, startPageToken;
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_TeamDrive
-//
-
-@implementation GTLRDrive_TeamDrive
-@dynamic backgroundImageFile, backgroundImageLink, capabilities, colorRgb,
-         createdTime, identifier, kind, name, orgUnitId, restrictions, themeId;
-
-+ (NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap {
-  return @{ @"identifier" : @"id" };
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_TeamDrive_BackgroundImageFile
-//
-
-@implementation GTLRDrive_TeamDrive_BackgroundImageFile
-@dynamic identifier, width, xCoordinate, yCoordinate;
-
-+ (NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap {
-  return @{ @"identifier" : @"id" };
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_TeamDrive_Capabilities
-//
-
-@implementation GTLRDrive_TeamDrive_Capabilities
-@dynamic canAddChildren, canChangeCopyRequiresWriterPermissionRestriction,
-         canChangeDomainUsersOnlyRestriction, canChangeTeamDriveBackground,
-         canChangeTeamMembersOnlyRestriction, canComment, canCopy,
-         canDeleteChildren, canDeleteTeamDrive, canDownload, canEdit,
-         canListChildren, canManageMembers, canReadRevisions, canRemoveChildren,
-         canRename, canRenameTeamDrive, canResetTeamDriveRestrictions, canShare,
-         canTrashChildren;
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_TeamDrive_Restrictions
-//
-
-@implementation GTLRDrive_TeamDrive_Restrictions
-@dynamic adminManagedRestrictions, copyRequiresWriterPermission,
-         domainUsersOnly, teamMembersOnly;
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_TeamDriveList
-//
-
-@implementation GTLRDrive_TeamDriveList
-@dynamic kind, nextPageToken, teamDrives;
-
-+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
-  NSDictionary<NSString *, Class> *map = @{
-    @"teamDrives" : [GTLRDrive_TeamDrive class]
-  };
-  return map;
-}
-
-+ (NSString *)collectionItemsKey {
-  return @"teamDrives";
-}
-
-@end
-
-
-// ----------------------------------------------------------------------------
-//
-//   GTLRDrive_User
-//
-
-@implementation GTLRDrive_User
-@dynamic displayName, emailAddress, kind, me, permissionId, photoLink;
-@end

File diff suppressed because it is too large
+ 0 - 2712
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/Drive/GTLRDriveQuery.h


File diff suppressed because it is too large
+ 0 - 1181
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/Drive/GTLRDriveQuery.m


+ 0 - 121
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/Drive/GTLRDriveService.h

@@ -1,121 +0,0 @@
-// NOTE: This file was generated by the ServiceGenerator.
-
-// ----------------------------------------------------------------------------
-// API:
-//   Drive API (drive/v3)
-// Description:
-//   Manages files in Drive including uploading, downloading, searching,
-//   detecting changes, and updating sharing permissions.
-// Documentation:
-//   https://developers.google.com/drive/
-
-//#import <GoogleAPIClientForREST/GTLRService.h>
-#import "GTLRService.h"
-
-#if GTLR_RUNTIME_VERSION != 3000
-#error This file was generated by a different version of ServiceGenerator which is incompatible with this GTLR library source.
-#endif
-
-// Generated comments include content from the discovery document; avoid them
-// causing warnings since clang's checks are some what arbitrary.
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdocumentation"
-
-NS_ASSUME_NONNULL_BEGIN
-
-// ----------------------------------------------------------------------------
-// Authorization scopes
-
-/**
- *  Authorization scope: See, edit, create, and delete all of your Google Drive
- *  files
- *
- *  Value "https://www.googleapis.com/auth/drive"
- */
-FOUNDATION_EXTERN NSString * const kGTLRAuthScopeDrive;
-/**
- *  Authorization scope: See, create, and delete its own configuration data in
- *  your Google Drive
- *
- *  Value "https://www.googleapis.com/auth/drive.appdata"
- */
-FOUNDATION_EXTERN NSString * const kGTLRAuthScopeDriveAppdata;
-/**
- *  Authorization scope: See, edit, create, and delete only the specific Google
- *  Drive files you use with this app
- *
- *  Value "https://www.googleapis.com/auth/drive.file"
- */
-FOUNDATION_EXTERN NSString * const kGTLRAuthScopeDriveFile;
-/**
- *  Authorization scope: View and manage metadata of files in your Google Drive
- *
- *  Value "https://www.googleapis.com/auth/drive.metadata"
- */
-FOUNDATION_EXTERN NSString * const kGTLRAuthScopeDriveMetadata;
-/**
- *  Authorization scope: See information about your Google Drive files
- *
- *  Value "https://www.googleapis.com/auth/drive.metadata.readonly"
- */
-FOUNDATION_EXTERN NSString * const kGTLRAuthScopeDriveMetadataReadonly;
-/**
- *  Authorization scope: View the photos, videos and albums in your Google
- *  Photos
- *
- *  Value "https://www.googleapis.com/auth/drive.photos.readonly"
- */
-FOUNDATION_EXTERN NSString * const kGTLRAuthScopeDrivePhotosReadonly;
-/**
- *  Authorization scope: See and download all your Google Drive files
- *
- *  Value "https://www.googleapis.com/auth/drive.readonly"
- */
-FOUNDATION_EXTERN NSString * const kGTLRAuthScopeDriveReadonly;
-/**
- *  Authorization scope: Modify your Google Apps Script scripts' behavior
- *
- *  Value "https://www.googleapis.com/auth/drive.scripts"
- */
-FOUNDATION_EXTERN NSString * const kGTLRAuthScopeDriveScripts;
-
-// ----------------------------------------------------------------------------
-//   GTLRDriveService
-//
-
-/**
- *  Service for executing Drive API queries.
- *
- *  Manages files in Drive including uploading, downloading, searching,
- *  detecting changes, and updating sharing permissions.
- */
-@interface GTLRDriveService : GTLRService
-
-// No new methods
-
-// Clients should create a standard query with any of the class methods in
-// GTLRDriveQuery.h. The query can the be sent with GTLRService's execute
-// methods,
-//
-//   - (GTLRServiceTicket *)executeQuery:(GTLRQuery *)query
-//                     completionHandler:(void (^)(GTLRServiceTicket *ticket,
-//                                                 id object, NSError *error))handler;
-// or
-//   - (GTLRServiceTicket *)executeQuery:(GTLRQuery *)query
-//                              delegate:(id)delegate
-//                     didFinishSelector:(SEL)finishedSelector;
-//
-// where finishedSelector has a signature of:
-//
-//   - (void)serviceTicket:(GTLRServiceTicket *)ticket
-//      finishedWithObject:(id)object
-//                   error:(NSError *)error;
-//
-// The object passed to the completion handler or delegate method
-// is a subclass of GTLRObject, determined by the query method executed.
-
-@end
-
-NS_ASSUME_NONNULL_END
-
-#pragma clang diagnostic pop

+ 0 - 80
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/Drive/GTLRDriveService.m

@@ -1,80 +0,0 @@
-// NOTE: This file was generated by the ServiceGenerator.
-
-// ----------------------------------------------------------------------------
-// API:
-//   Drive API (drive/v3)
-// Description:
-//   Manages files in Drive including uploading, downloading, searching,
-//   detecting changes, and updating sharing permissions.
-// Documentation:
-//   https://developers.google.com/drive/
-
-//#import <GoogleAPIClientForREST/GTLRDrive.h>
-#import "GTLRDrive.h"
-
-// ----------------------------------------------------------------------------
-// Authorization scopes
-
-NSString * const kGTLRAuthScopeDrive                 = @"https://www.googleapis.com/auth/drive";
-NSString * const kGTLRAuthScopeDriveAppdata          = @"https://www.googleapis.com/auth/drive.appdata";
-NSString * const kGTLRAuthScopeDriveFile             = @"https://www.googleapis.com/auth/drive.file";
-NSString * const kGTLRAuthScopeDriveMetadata         = @"https://www.googleapis.com/auth/drive.metadata";
-NSString * const kGTLRAuthScopeDriveMetadataReadonly = @"https://www.googleapis.com/auth/drive.metadata.readonly";
-NSString * const kGTLRAuthScopeDrivePhotosReadonly   = @"https://www.googleapis.com/auth/drive.photos.readonly";
-NSString * const kGTLRAuthScopeDriveReadonly         = @"https://www.googleapis.com/auth/drive.readonly";
-NSString * const kGTLRAuthScopeDriveScripts          = @"https://www.googleapis.com/auth/drive.scripts";
-
-// ----------------------------------------------------------------------------
-//   GTLRDriveService
-//
-
-@implementation GTLRDriveService
-
-- (instancetype)init {
-  self = [super init];
-  if (self) {
-    // From discovery.
-    self.rootURLString = @"https://www.googleapis.com/";
-    self.servicePath = @"drive/v3/";
-    self.resumableUploadPath = @"resumable/upload/";
-    self.simpleUploadPath = @"upload/";
-    self.batchPath = @"batch/drive/v3";
-    self.prettyPrintQueryParameterNames = @[ @"prettyPrint" ];
-  }
-  return self;
-}
-
-+ (NSDictionary<NSString *, Class> *)kindStringToClassMap {
-  return @{
-    @"api#channel" : [GTLRDrive_Channel class],
-    @"drive#about" : [GTLRDrive_About class],
-    @"drive#change" : [GTLRDrive_Change class],
-    @"drive#changeList" : [GTLRDrive_ChangeList class],
-    @"drive#comment" : [GTLRDrive_Comment class],
-    @"drive#commentList" : [GTLRDrive_CommentList class],
-    @"drive#drive" : [GTLRDrive_Drive class],
-    @"drive#driveList" : [GTLRDrive_DriveList class],
-    @"drive#file" : [GTLRDrive_File class],
-    @"drive#fileList" : [GTLRDrive_FileList class],
-    @"drive#generatedIds" : [GTLRDrive_GeneratedIds class],
-    @"drive#label" : [GTLRDrive_Label class],
-    @"drive#labelField" : [GTLRDrive_LabelField class],
-    @"drive#labelFieldModification" : [GTLRDrive_LabelFieldModification class],
-    @"drive#labelList" : [GTLRDrive_LabelList class],
-    @"drive#labelModification" : [GTLRDrive_LabelModification class],
-    @"drive#modifyLabelsRequest" : [GTLRDrive_ModifyLabelsRequest class],
-    @"drive#modifyLabelsResponse" : [GTLRDrive_ModifyLabelsResponse class],
-    @"drive#permission" : [GTLRDrive_Permission class],
-    @"drive#permissionList" : [GTLRDrive_PermissionList class],
-    @"drive#reply" : [GTLRDrive_Reply class],
-    @"drive#replyList" : [GTLRDrive_ReplyList class],
-    @"drive#revision" : [GTLRDrive_Revision class],
-    @"drive#revisionList" : [GTLRDrive_RevisionList class],
-    @"drive#startPageToken" : [GTLRDrive_StartPageToken class],
-    @"drive#teamDrive" : [GTLRDrive_TeamDrive class],
-    @"drive#teamDriveList" : [GTLRDrive_TeamDriveList class],
-    @"drive#user" : [GTLRDrive_User class],
-  };
-}
-
-@end

+ 0 - 29
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRBase64.h

@@ -1,29 +0,0 @@
-/* Copyright (c) 2012 Google Inc.
- *
- * 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.
- */
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-NSData * _Nullable GTLRDecodeBase64(NSString * _Nullable base64Str);
-NSString * _Nullable GTLREncodeBase64(NSData * _Nullable data);
-
-// "Web-safe" encoding substitutes - and _ for + and / in the encoding table,
-// per http://www.ietf.org/rfc/rfc4648.txt section 5.
-
-NSData * _Nullable GTLRDecodeWebSafeBase64(NSString * _Nullable base64Str);
-NSString * _Nullable GTLREncodeWebSafeBase64(NSData * _Nullable data);
-
-NS_ASSUME_NONNULL_END

+ 0 - 143
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRBase64.m

@@ -1,143 +0,0 @@
-/* Copyright (c) 2012 Google Inc.
- *
- * 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.
- */
-
-//#import <GoogleAPIClientForREST/GTLRBase64.h>
-#import "GTLRBase64.h"
-
-// Based on Cyrus Najmabadi's elegent little encoder and decoder from
-// http://www.cocoadev.com/index.pl?BaseSixtyFour
-
-static char gStandardEncodingTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-static char gWebSafeEncodingTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
-
-#pragma mark Encode
-
-static NSString *EncodeBase64StringCommon(NSData *data, const char *table) {
-  if (data == nil) return nil;
-
-  const uint8_t* input = data.bytes;
-  NSUInteger length = data.length;
-
-  NSUInteger bufferSize = ((length + 2) / 3) * 4;
-  NSMutableData* buffer = [NSMutableData dataWithLength:bufferSize];
-
-  int8_t *output = buffer.mutableBytes;
-
-  for (NSUInteger i = 0; i < length; i += 3) {
-    NSUInteger value = 0;
-    for (NSUInteger j = i; j < (i + 3); j++) {
-      value <<= 8;
-
-      if (j < length) {
-        value |= (0xFF & input[j]);
-      }
-    }
-
-    NSInteger idx = (i / 3) * 4;
-    output[idx + 0] =                    table[(value >> 18) & 0x3F];
-    output[idx + 1] =                    table[(value >> 12) & 0x3F];
-    output[idx + 2] = (i + 1) < length ? table[(value >> 6)  & 0x3F] : '=';
-    output[idx + 3] = (i + 2) < length ? table[(value >> 0)  & 0x3F] : '=';
-  }
-
-  NSString *result = [[NSString alloc] initWithData:buffer
-                                           encoding:NSASCIIStringEncoding];
-  return result;
-}
-
-NSString *GTLREncodeBase64(NSData *data) {
-  return EncodeBase64StringCommon(data, gStandardEncodingTable);
-}
-
-NSString *GTLREncodeWebSafeBase64(NSData *data) {
-  return EncodeBase64StringCommon(data, gWebSafeEncodingTable);
-}
-
-#pragma mark Decode
-
-static void CreateDecodingTable(const char *encodingTable,
-                                size_t encodingTableSize, char *decodingTable) {
-  memset(decodingTable, 0, 128);
-  for (unsigned int i = 0; i < encodingTableSize; i++) {
-    decodingTable[(unsigned int) encodingTable[i]] = (char)i;
-  }
-}
-
-static NSData *DecodeBase64StringCommon(NSString *base64Str,
-                                        char *decodingTable,
-                                        BOOL requirePadding) {
-  // The input string should be plain ASCII
-  const char *cString = [base64Str cStringUsingEncoding:NSASCIIStringEncoding];
-  if (cString == nil) return nil;
-
-  NSInteger inputLength = (NSInteger)strlen(cString);
-  if (requirePadding && (inputLength % 4 != 0)) return nil;
-  if (inputLength == 0) return [NSData data];
-
-  NSInteger numEquals = 0;
-  while (inputLength > 0 && cString[inputLength - 1] == '=') {
-    inputLength--;
-    if (++numEquals > 2) return nil;  // malformed input
-  }
-
-  NSInteger outputLength = inputLength * 3 / 4;
-  NSMutableData* data = [NSMutableData dataWithLength:(NSUInteger)outputLength];
-  uint8_t *output = data.mutableBytes;
-
-  NSInteger inputPoint = 0;
-  NSInteger outputPoint = 0;
-  char *table = decodingTable;
-
-  while (inputPoint < inputLength) {
-    int i0 = cString[inputPoint++];
-    int i1 = cString[inputPoint++];
-    int i2 = inputPoint < inputLength ? cString[inputPoint++] : 'A'; // 'A' will decode to \0
-    int i3 = inputPoint < inputLength ? cString[inputPoint++] : 'A';
-
-    output[outputPoint++] = (uint8_t)((table[i0] << 2) | (table[i1] >> 4));
-    if (outputPoint < outputLength) {
-      output[outputPoint++] = (uint8_t)(((table[i1] & 0xF) << 4) | (table[i2] >> 2));
-    }
-    if (outputPoint < outputLength) {
-      output[outputPoint++] = (uint8_t)(((table[i2] & 0x3) << 6) | table[i3]);
-    }
-  }
-
-  return data;
-}
-
-NSData *GTLRDecodeBase64(NSString *base64Str) {
-  static char decodingTable[128];
-  static BOOL hasInited = NO;
-
-  if (!hasInited) {
-    CreateDecodingTable(gStandardEncodingTable, sizeof(gStandardEncodingTable),
-                        decodingTable);
-    hasInited = YES;
-  }
-  return DecodeBase64StringCommon(base64Str, decodingTable, YES /* requirePadding */ );
-}
-
-NSData *GTLRDecodeWebSafeBase64(NSString *base64Str) {
-  static char decodingTable[128];
-  static BOOL hasInited = NO;
-
-  if (!hasInited) {
-    CreateDecodingTable(gWebSafeEncodingTable, sizeof(gWebSafeEncodingTable),
-                        decodingTable);
-    hasInited = YES;
-  }
-  return DecodeBase64StringCommon(base64Str, decodingTable, NO /* requirePadding */);
-}

+ 0 - 85
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRBatchQuery.h

@@ -1,85 +0,0 @@
-/* Copyright (c) 2011 Google Inc.
- *
- * 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.
- */
-
-//  Batch query documentation:
-//  https://github.com/google/google-api-objectivec-client-for-rest/blob/main/USING.md#batch-operations
-
-#import "GTLRQuery.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface GTLRBatchQuery : NSObject <GTLRQueryProtocol>
-
-/**
- *  Queries included in this batch.  Each query should have a unique @c requestID.
- */
-@property(atomic, copy, nullable) NSArray<GTLRQuery *> *queries;
-
-/**
- *  Flag indicating if query execution should skip authorization. Defaults to NO.
- */
-@property(atomic, assign) BOOL shouldSkipAuthorization;
-
-/**
- *  Any additional HTTP headers for this batch.
- *
- *  These headers override the same keys from the service object's
- *  @c additionalHTTPHeaders.
- */
-@property(atomic, copy, nullable) NSDictionary<NSString *, NSString *> *additionalHTTPHeaders;
-
-/**
- *  Any additional URL query parameters to add to the batch query.
- *
- *  These query parameters override the same keys from the service object's
- *  @c additionalURLQueryParameters
- */
-@property(atomic, copy, nullable) NSDictionary<NSString *, NSString *> *additionalURLQueryParameters;
-
-/**
- *  The batch request multipart boundary, once determined.
- */
-@property(atomic, copy, nullable) NSString *boundary;
-
-/**
- *  The brief string to identify this query in @c GTMSessionFetcher http logs.
- *
- *  The default logging name for batch requests includes the API method names.
- */
-@property(atomic, copy, nullable) NSString *loggingName;
-
-/**
- *  Constructor for a batch query, for use with @c addQuery:
- */
-+ (instancetype)batchQuery;
-
-/**
- *  Constructor for a batch query, from an array of @c GTLRQuery objects.
- */
-+ (instancetype)batchQueryWithQueries:(NSArray<GTLRQuery *> *)array;
-
-/**
- *  Add a single @c GTLRQuery to the batch.
- */
-- (void)addQuery:(GTLRQuery *)query;
-
-/**
- *  Search the batch for a query with the specified ID.
- */
-- (nullable GTLRQuery *)queryForRequestID:(NSString *)requestID;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 180
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRBatchQuery.m

@@ -1,180 +0,0 @@
-/* Copyright (c) 2011 Google Inc.
- *
- * 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.
- */
-
-//#import <GoogleAPIClientForREST/GTLRBatchQuery.h>
-//
-//#import <GoogleAPIClientForREST/GTLRService.h>
-#import "GTLRBatchQuery.h"
-
-#import "GTLRService.h"
-
-#import "GTLRDefines.h"
-
-#if DEBUG
-static void DebugAssertValidBatchQueryItem(GTLRQuery *query) {
-  GTLR_DEBUG_ASSERT([query isKindOfClass:[GTLRQuery class]],
-                    @"unexpected query class: %@", [query class]);
-  GTLR_DEBUG_ASSERT(query.uploadParameters == nil,
-                    @"batch may not contain upload: %@", query);
-  GTLR_DEBUG_ASSERT(!query.hasExecutionParameters,
-                    @"queries added to a batch may not contain executionParameters: %@", query);
-  GTLR_DEBUG_ASSERT(!query.queryInvalid,
-                    @"batch may not contain query already executed: %@", query);
-}
-#else
-static void DebugAssertValidBatchQueryItem(GTLRQuery *query) { }
-#endif
-
-@implementation GTLRBatchQuery {
-  NSMutableArray<GTLRQuery *> *_queries;
-  NSMutableDictionary *_requestIDMap;
-  GTLRServiceExecutionParameters *_executionParameters;
-}
-
-@synthesize shouldSkipAuthorization = _shouldSkipAuthorization,
-            additionalHTTPHeaders = _additionalHTTPHeaders,
-            additionalURLQueryParameters = _additionalURLQueryParameters,
-            boundary = _boundary,
-            loggingName = _loggingName;
-
-+ (instancetype)batchQuery {
-  GTLRBatchQuery *obj = [[self alloc] init];
-  return obj;
-}
-
-+ (instancetype)batchQueryWithQueries:(NSArray<GTLRQuery *> *)queries {
-  GTLRBatchQuery *obj = [self batchQuery];
-  obj.queries = queries;
-
-#if DEBUG
-  for (GTLRQuery *query in queries) {
-    DebugAssertValidBatchQueryItem(query);
-  }
-#endif
-  return obj;
-}
-
-- (id)copyWithZone:(NSZone *)zone {
-  // Deep copy the list of queries
-  GTLRBatchQuery *newBatch = [[[self class] allocWithZone:zone] init];
-  if (_queries) {
-    newBatch.queries = [[NSArray alloc] initWithArray:_queries
-                                            copyItems:YES];
-  }
-
-  // Using the executionParameters ivar avoids creating the object.
-  newBatch.executionParameters = _executionParameters;
-
-  // Copied in the same order as synthesized above.
-  newBatch.shouldSkipAuthorization = _shouldSkipAuthorization;
-  newBatch.additionalHTTPHeaders = _additionalHTTPHeaders;
-  newBatch.additionalURLQueryParameters = _additionalURLQueryParameters;
-  newBatch.boundary = _boundary;
-  newBatch.loggingName = _loggingName;
-
-  // No need to copy _requestIDMap as it's created on demand.
-  return newBatch;
-}
-
-- (NSString *)description {
-  NSArray *queries = self.queries;
-  NSArray *loggingNames = [queries valueForKey:@"loggingName"];
-  NSMutableSet *dedupedNames = [NSMutableSet setWithArray:loggingNames]; // de-dupe
-  [dedupedNames removeObject:[NSNull null]];  // In case any didn't have a loggingName.
-  NSString *namesStr = [[dedupedNames allObjects] componentsJoinedByString:@","];
-
-  return [NSString stringWithFormat:@"%@ %p (queries:%lu - %@)",
-          [self class], self, (unsigned long)queries.count, namesStr];
-}
-
-#pragma mark -
-
-- (BOOL)isBatchQuery {
-  return YES;
-}
-
-- (GTLRUploadParameters *)uploadParameters {
-  // File upload is not supported for batches
-  return nil;
-}
-
-- (void)invalidateQuery {
-  NSArray *queries = self.queries;
-  [queries makeObjectsPerformSelector:@selector(invalidateQuery)];
-
-  _executionParameters = nil;
-}
-
-- (GTLRQuery *)queryForRequestID:(NSString *)requestID {
-  GTLRQuery *result = [_requestIDMap objectForKey:requestID];
-  if (result) return result;
-
-  // We've not before tried to look up a query, or the map is stale
-  _requestIDMap = [[NSMutableDictionary alloc] init];
-
-  for (GTLRQuery *query in _queries) {
-    [_requestIDMap setObject:query forKey:query.requestID];
-  }
-
-  result = [_requestIDMap objectForKey:requestID];
-  return result;
-}
-
-#pragma mark -
-
-- (void)setQueries:(NSArray<GTLRQuery *> *)array {
-#if DEBUG
-  for (GTLRQuery *query in array) {
-    DebugAssertValidBatchQueryItem(query);
-  }
-#endif
-
-  _queries = [array mutableCopy];
-}
-
-- (NSArray<GTLRQuery *> *)queries {
-  return _queries;
-}
-
-- (void)addQuery:(GTLRQuery *)query {
-  DebugAssertValidBatchQueryItem(query);
-
-  if (_queries == nil) {
-    _queries = [[NSMutableArray alloc] init];
-  }
-
-  [_queries addObject:query];
-}
-
-- (GTLRServiceExecutionParameters *)executionParameters {
-  @synchronized(self) {
-    if (!_executionParameters) {
-      _executionParameters = [[GTLRServiceExecutionParameters alloc] init];
-    }
-  }
-  return _executionParameters;
-}
-
-- (void)setExecutionParameters:(GTLRServiceExecutionParameters *)executionParameters {
-  @synchronized(self) {
-    _executionParameters = executionParameters;
-  }
-}
-
-- (BOOL)hasExecutionParameters {
-  return _executionParameters.hasParameters;
-}
-
-@end

+ 0 - 78
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRBatchResult.h

@@ -1,78 +0,0 @@
-/* Copyright (c) 2011 Google Inc.
-*
-* 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.
-*/
-
-#import "GTLRObject.h"
-
-#import "GTLRErrorObject.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-/**
- *  A batch result includes a dictionary of successes, a dictionary of failures, and a dictionary of
- *  HTTP response headers.
- *
- *  Dictionary keys are request ID strings; dictionary values are @c GTLRObject for
- *  successes, @c GTLRErrorObject for failures, @c NSDictionary for responseHeaders.
- *
- *  For successes with no returned object (such as from delete operations),
- *  the object for the dictionary entry is @c NSNull.
- *
- *  The original query for each result is available from the service ticket, as shown in
- *  the code snippet here.
- *
- *  When the queries in the batch are unrelated, adding a @c completionBlock to each of
- *  the queries may be a simpler way to handle the batch results.
- *
- *  @code
- *  NSDictionary *successes = batchResults.successes;
- *  for (NSString *requestID in successes) {
- *    GTLRObject *obj = successes[requestID];
- *    GTLRQuery *query = [ticket queryForRequestID:requestID];
- *    NSLog(@"Query %@ returned object %@", query, obj);
- *  }
- *
- *  NSDictionary *failures = batchResults.failures;
- *  for (NSString *requestID in failures) {
- *    GTLRErrorObject *errorObj = failures[requestID];
- *    GTLRQuery *query = [ticket queryForRequestID:requestID];
- *    NSLog(@"Query %@ failed with error %@", query, errorObj);
- *  }
- *  @endcode
- */
-@interface GTLRBatchResult : GTLRObject
-
-/**
- *  Object results of successful queries in the batch, keyed by request ID.
- *
- *  Queries which do not return an object when successful have a @c NSNull value.
- */
-@property(atomic, strong, nullable) NSDictionary<NSString *, __kindof GTLRObject *> *successes;
-
-/**
- *  Object results of unsuccessful queries in the batch, keyed by request ID.
- */
-@property(atomic, strong, nullable) NSDictionary<NSString *, GTLRErrorObject *> *failures;
-
-/**
- * Any HTTP response headers that were returned for a query request. Headers are optional therefore
- * not all queries will have them. Query request with response headers are stored in a
- * dictionary and keyed by request ID.
- */
-@property(atomic, strong, nullable)
-    NSDictionary<NSString *, NSDictionary *> *responseHeaders;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 168
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRBatchResult.m

@@ -1,168 +0,0 @@
-/* Copyright (c) 2011 Google Inc.
-*
-* 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.
-*/
-
-//#import <GoogleAPIClientForREST/GTLRBatchResult.h>
-//
-//#import <GoogleAPIClientForREST/GTLRUtilities.h>
-#import "GTLRBatchResult.h"
-
-#import "GTLRUtilities.h"
-
-static NSString *const kGTLRBatchResultSuccessesKeys = @"successesKeys";
-static NSString *const kGTLRBatchResultSuccessKeyPrefix = @"Success-";
-static NSString *const kGTLRBatchResultFailuresKeys = @"failuresKeys";
-static NSString *const kGTLRBatchResultFailurKeyPrefix = @"Failure-";
-static NSString *const kGTLRBatchResultResponseHeaders = @"responseHeaders";
-
-@implementation GTLRBatchResult
-
-@synthesize successes = _successes,
-            failures = _failures,
-            responseHeaders = _responseHeaders;
-
-// Since this class doesn't use the json property, provide the basic NSObject
-// methods needed to ensure proper behaviors.
-
-- (id)copyWithZone:(NSZone *)zone {
-  GTLRBatchResult* newObject = [super copyWithZone:zone];
-  newObject.successes = [self.successes copyWithZone:zone];
-  newObject.failures = [self.failures copyWithZone:zone];
-  newObject.responseHeaders = [self.responseHeaders copyWithZone:zone];
-  return newObject;
-}
-
-- (NSUInteger)hash {
-  NSUInteger result = [super hash];
-  result += result * 13 + [self.successes hash];
-  result += result * 13 + [self.failures hash];
-  result += result * 13 + [self.responseHeaders hash];
-  return result;
-}
-
-- (BOOL)isEqual:(id)object {
-  if (self == object) return YES;
-
-  if (![super isEqual:object]) {
-    return NO;
-  }
-
-  if (![object isKindOfClass:[GTLRBatchResult class]]) {
-    return NO;
-  }
-
-  GTLRBatchResult *other = (GTLRBatchResult *)object;
-  if (!GTLR_AreEqualOrBothNil(self.successes, other.successes)) {
-    return NO;
-  }
-  if (!GTLR_AreEqualOrBothNil(self.failures, other.failures)) {
-    return NO;
-  }
-  return GTLR_AreEqualOrBothNil(self.responseHeaders, other.responseHeaders);
-}
-
-- (NSString *)description {
-  return [NSString stringWithFormat:@"%@ %p (successes:%lu failures:%lu responseHeaders:%lu)",
-          [self class], self,
-          (unsigned long)self.successes.count,
-          (unsigned long)self.failures.count,
-          (unsigned long)self.responseHeaders.count];
-}
-
-// This class is a subclass of GTLRObject, which declares NSSecureCoding
-// conformance. Since this class does't really use the json property, provide
-// a custom implementation to maintain the contract.
-//
-// For success/failures, one could do:
-//    [encoder encodeObject:self.successes forKey:kGTLRBatchResultSuccesses];
-//    [encoder encodeObject:self.failures forKey:kGTLRBatchResultFailuresKeys];
-// and then use -decodeObjectOfClasses:forKey:, but nothing actually checks the
-// structure of the dictionary, so instead the dicts are blown out to provide
-// better validation by the encoder/decoder.
-
-+ (BOOL)supportsSecureCoding {
-  return YES;
-}
-
-- (instancetype)initWithCoder:(NSCoder *)decoder {
-  self = [super initWithCoder:decoder];
-  if (self) {
-    NSArray<NSString *> *keys =
-        [decoder decodeObjectOfClass:[NSArray class]
-                              forKey:kGTLRBatchResultSuccessesKeys];
-    if (keys.count) {
-      NSMutableDictionary *dict =
-          [NSMutableDictionary dictionaryWithCapacity:keys.count];
-      for (NSString *key in keys) {
-        NSString *storageKey =
-            [kGTLRBatchResultSuccessKeyPrefix stringByAppendingString:key];
-        GTLRObject *obj = [decoder decodeObjectOfClass:[GTLRObject class]
-                                                forKey:storageKey];
-        if (obj) {
-          [dict setObject:obj forKey:key];
-        }
-      }
-      self.successes = dict;
-    }
-
-    keys = [decoder decodeObjectOfClass:[NSArray class]
-                                 forKey:kGTLRBatchResultFailuresKeys];
-    if (keys.count) {
-      NSMutableDictionary *dict =
-          [NSMutableDictionary dictionaryWithCapacity:keys.count];
-      for (NSString *key in keys) {
-        NSString *storageKey =
-            [kGTLRBatchResultFailurKeyPrefix stringByAppendingString:key];
-        GTLRObject *obj = [decoder decodeObjectOfClass:[GTLRObject class]
-                                                forKey:storageKey];
-        if (obj) {
-          [dict setObject:obj forKey:key];
-        }
-      }
-      self.failures = dict;
-    }
-
-    self.responseHeaders =
-        [decoder decodeObjectOfClass:[NSDictionary class]
-                              forKey:kGTLRBatchResultResponseHeaders];
-  }
-  return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)encoder {
-  [super encodeWithCoder:encoder];
-  [encoder encodeObject:self.successes.allKeys
-                 forKey:kGTLRBatchResultSuccessesKeys];
-  [self.successes enumerateKeysAndObjectsUsingBlock:^(NSString *key,
-                                                      GTLRObject * obj,
-                                                      BOOL * stop) {
-    NSString *storageKey =
-        [kGTLRBatchResultSuccessKeyPrefix stringByAppendingString:key];
-    [encoder encodeObject:obj forKey:storageKey];
-  }];
-
-  [encoder encodeObject:self.failures.allKeys forKey:kGTLRBatchResultFailuresKeys];
-  [self.failures enumerateKeysAndObjectsUsingBlock:^(NSString *key,
-                                                     GTLRObject * obj,
-                                                     BOOL * stop) {
-    NSString *storageKey =
-        [kGTLRBatchResultFailurKeyPrefix stringByAppendingString:key];
-    [encoder encodeObject:obj forKey:storageKey];
-  }];
-
-  [encoder encodeObject:self.responseHeaders
-                 forKey:kGTLRBatchResultResponseHeaders];
-}
-
-@end

+ 0 - 114
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRDateTime.h

@@ -1,114 +0,0 @@
-/* Copyright (c) 2011 Google Inc.
-*
-* 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.
-*/
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-/**
- *  An immutable class representing a date and optionally a time in UTC.
- */
-@interface GTLRDateTime : NSObject <NSCopying>
-
-/**
- *  Constructor from a string representation.
- */
-+ (nullable instancetype)dateTimeWithRFC3339String:(nullable NSString *)str;
-
-/**
- *  Constructor from a date and time representation.
- */
-+ (instancetype)dateTimeWithDate:(NSDate *)date;
-
-/**
- *  Constructor from a date and time representation, along with an offset
- *  minutes value used when creating a RFC3339 string representation.
- *
- *  The date value is independent of time zone; the offset affects how the
- *  date will be rendered as a string.
- *
- *  The offsetMinutes may be initialized from a NSTimeZone as
- *  (timeZone.secondsFromGMT / 60)
- */
-+ (instancetype)dateTimeWithDate:(NSDate *)date
-                   offsetMinutes:(NSInteger)offsetMinutes;
-
-/**
- *  Constructor from a date for an all-day event.
- *
- *  Use this constructor to create a @c GTLRDateTime that is "date only".
- *
- *  @note @c hasTime will be set to NO.
- */
-+ (instancetype)dateTimeForAllDayWithDate:(NSDate *)date;
-
-/**
- *  Constructor from date components.
- */
-+ (instancetype)dateTimeWithDateComponents:(NSDateComponents *)date;
-
-/**
- *  The represented date and time.
- *
- *  If @c hasTime is NO, the time is set to noon GMT so the date is valid for all time zones.
- */
-@property(nonatomic, readonly) NSDate *date;
-
-/**
- *  The date and time as a RFC3339 string representation.
- */
-@property(nonatomic, readonly) NSString *RFC3339String;
-
-/**
- *  The date and time as a RFC3339 string representation.
- *
- *  This returns the same string as @c RFC3339String.
- */
-@property(nonatomic, readonly) NSString *stringValue;
-
-/**
- *  The represented date and time as date components.
- */
-@property(nonatomic, readonly, copy) NSDateComponents *dateComponents;
-
-/**
- *  The fraction of seconds represented, 0-999.
- */
-@property(nonatomic, readonly) NSInteger milliseconds;
-
-/**
- *  The time offset displayed in the string representation, if any.
- *
- *  If the offset is not nil, the date and time will be rendered as a string
- *  for the time zone indicated by the offset.
- *
- *  An app may create a NSTimeZone for this with
- *  [NSTimeZone timeZoneForSecondsFromGMT:(offsetMinutes.integerValue * 60)]
- */
-@property(nonatomic, readonly, nullable) NSNumber *offsetMinutes;
-
-/**
- *  Flag indicating if the object represents date only, or date with time.
- */
-@property(nonatomic, readonly) BOOL hasTime;
-
-/**
- *  The calendar used by this class, Gregorian and UTC.
- */
-+ (NSCalendar *)calendar;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 370
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRDateTime.m

@@ -1,370 +0,0 @@
-/* Copyright (c) 2011 Google Inc.
- *
- * 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.
- */
-
-//#import <GoogleAPIClientForREST/GTLRDateTime.h>
-#import "GTLRDateTime.h"
-
-static NSUInteger const kGTLRDateComponentBits = (NSCalendarUnitYear | NSCalendarUnitMonth
-    | NSCalendarUnitDay | NSCalendarUnitHour | NSCalendarUnitMinute
-    | NSCalendarUnitSecond);
-
-@interface GTLRDateTime ()
-
-- (void)setFromDate:(NSDate *)date;
-- (void)setFromRFC3339String:(NSString *)str;
-
-@property(nonatomic, copy, readwrite) NSDateComponents *dateComponents;
-@property(nonatomic, assign, readwrite) NSInteger milliseconds;
-@property(nonatomic, strong, readwrite, nullable) NSNumber *offsetMinutes;
-
-@property(nonatomic, assign, readwrite) BOOL hasTime;
-
-@end
-
-
-@implementation GTLRDateTime {
-  NSDate *_cachedDate;
-  NSString *_cachedRFC3339String;
-}
-
-// A note about _milliseconds:
-// RFC 3339 has support for fractions of a second.  NSDateComponents is all
-// NSInteger based, so it can't handle a fraction of a second.  NSDate is
-// built on NSTimeInterval so it has sub-millisecond precision.  GTLR takes
-// the compromise of supporting the RFC's optional fractional second support
-// by maintaining a number of milliseconds past what fits in the
-// NSDateComponents.  The parsing and string conversions will include
-// 3 decimal digits (hence milliseconds).  When going to a string, the decimal
-// digits are only included if the milliseconds are non zero.
-
-@dynamic date;
-@dynamic RFC3339String;
-@dynamic stringValue;
-@dynamic hasTime;
-
-@synthesize dateComponents = _dateComponents,
-            milliseconds = _milliseconds,
-            offsetMinutes = _offsetMinutes;
-
-+ (instancetype)dateTimeWithRFC3339String:(NSString *)str {
-  if (str == nil) return nil;
-
-  GTLRDateTime *result = [[self alloc] init];
-  [result setFromRFC3339String:str];
-  return result;
-}
-
-+ (instancetype)dateTimeWithDate:(NSDate *)date {
-  if (date == nil) return nil;
-
-  GTLRDateTime *result = [[self alloc] init];
-  [result setFromDate:date];
-  return result;
-}
-
-+ (instancetype)dateTimeWithDate:(NSDate *)date
-                   offsetMinutes:(NSInteger)offsetMinutes {
-  GTLRDateTime *result = [self dateTimeWithDate:date];
-  result.offsetMinutes = @(offsetMinutes);
-  return result;
-}
-
-+ (instancetype)dateTimeForAllDayWithDate:(NSDate *)date {
-  if (date == nil) return nil;
-
-  GTLRDateTime *result = [[self alloc] init];
-  [result setFromDate:date];
-  result.hasTime = NO;
-  return result;
-}
-
-+ (instancetype)dateTimeWithDateComponents:(NSDateComponents *)components {
-  NSCalendar *cal = components.calendar ?: [self calendar];
-  NSDate *date = [cal dateFromComponents:components];
-
-  return [self dateTimeWithDate:date];
-}
-
-- (id)copyWithZone:(NSZone *)zone {
-  // Object is immutable
-  return self;
-}
-
-- (BOOL)isEqual:(GTLRDateTime *)other {
-  if (self == other) return YES;
-  if (![other isKindOfClass:[GTLRDateTime class]]) return NO;
-
-  BOOL areDateComponentsEqual = [self.dateComponents isEqual:other.dateComponents];
-  if (!areDateComponentsEqual) return NO;
-
-  NSNumber *offsetMinutes = self.offsetMinutes;
-  NSNumber *otherOffsetMinutes = other.offsetMinutes;
-  if ((offsetMinutes == nil) != (otherOffsetMinutes == nil)
-      || (offsetMinutes.integerValue != otherOffsetMinutes.integerValue)) return NO;
-
-  return (self.milliseconds == other.milliseconds);
-}
-
-- (NSUInteger)hash {
-  return [[self date] hash];
-}
-
-- (NSString *)description {
-  return [NSString stringWithFormat:@"%@ %p: {%@}",
-    [self class], self, self.RFC3339String];
-}
-
-- (NSDate *)date {
-  @synchronized(self) {
-    if (_cachedDate) return _cachedDate;
-  }
-
-  NSDateComponents *dateComponents = self.dateComponents;
-  NSTimeInterval extraMillisecondsAsSeconds = 0.0;
-  NSCalendar *cal = [[self class] calendar];
-
-  if (!self.hasTime) {
-    // We're not keeping track of a time, but NSDate always is based on
-    // an absolute time. We want to avoid returning an NSDate where the
-    // calendar date appears different from what was used to create our
-    // date-time object.
-    //
-    // We'll make a copy of the date components, setting the time on our
-    // copy to noon GMT, since that ensures the date renders correctly for
-    // any time zone.
-    NSDateComponents *noonDateComponents = [dateComponents copy];
-    [noonDateComponents setHour:12];
-    [noonDateComponents setMinute:0];
-    [noonDateComponents setSecond:0];
-    dateComponents = noonDateComponents;
-  } else {
-    // Add in the fractional seconds that don't fit into NSDateComponents.
-    extraMillisecondsAsSeconds = ((NSTimeInterval)self.milliseconds) / 1000.0;
-  }
-
-  NSDate *date = [cal dateFromComponents:dateComponents];
-
-  // Add in any milliseconds that didn't fit into the dateComponents.
-  if (extraMillisecondsAsSeconds > 0.0) {
-    date = [date dateByAddingTimeInterval:extraMillisecondsAsSeconds];
-  }
-
-  @synchronized(self) {
-    _cachedDate = date;
-  }
-  return date;
-}
-
-- (NSString *)stringValue {
-  return self.RFC3339String;
-}
-
-- (NSString *)RFC3339String {
-  @synchronized(self) {
-    if (_cachedRFC3339String) return _cachedRFC3339String;
-  }
-
-  NSDateComponents *dateComponents = self.dateComponents;
-
-  NSString *timeString = @""; // timeString like "T15:10:46-08:00"
-
-  if (self.hasTime) {
-    NSString *fractionalSecondsString = @"";
-    if (self.milliseconds > 0.0) {
-      fractionalSecondsString = [NSString stringWithFormat:@".%03ld", (long)self.milliseconds];
-    }
-
-    // If the dateTime was created from a string with a time offset, render that back in
-    // and adjust the time.
-    NSString *offsetStr = @"Z";
-    NSNumber *offsetMinutes = self.offsetMinutes;
-    if (offsetMinutes != nil) {
-      BOOL isNegative = NO;
-      NSInteger offsetVal = offsetMinutes.integerValue;
-      if (offsetVal < 0) {
-        isNegative = YES;
-        offsetVal = -offsetVal;
-      }
-      NSInteger mins = offsetVal % 60;
-      NSInteger hours = (offsetVal - mins) / 60;
-      offsetStr = [NSString stringWithFormat:@"%c%02ld:%02ld",
-                   isNegative ? '-' : '+', (long)hours, (long)mins];
-
-      // Adjust date components back to account for the offset.
-      //
-      // This is the inverse of the adjustment done in setFromRFC3339String:.
-      if (offsetVal != 0) {
-        NSDate *adjustedDate =
-            [self.date dateByAddingTimeInterval:(offsetMinutes.integerValue * 60)];
-        NSCalendar *calendar = [[self class] calendar];
-        dateComponents = [calendar components:kGTLRDateComponentBits
-                                     fromDate:adjustedDate];
-      }
-    }
-
-    timeString = [NSString stringWithFormat:@"T%02ld:%02ld:%02ld%@%@",
-                  (long)dateComponents.hour, (long)dateComponents.minute,
-                  (long)dateComponents.second, fractionalSecondsString,
-                  offsetStr];
-  }
-
-  // full dateString like "2006-11-17T15:10:46-08:00"
-  NSString *dateString = [NSString stringWithFormat:@"%04ld-%02ld-%02ld%@",
-    (long)dateComponents.year, (long)dateComponents.month,
-    (long)dateComponents.day, timeString];
-
-  @synchronized(self) {
-    _cachedRFC3339String = dateString;
-  }
-  return dateString;
-}
-
-- (void)setFromDate:(NSDate *)date {
-  NSCalendar *cal = [[self class] calendar];
-
-  NSDateComponents *components = [cal components:kGTLRDateComponentBits
-                                        fromDate:date];
-  self.dateComponents = components;
-
-  // Extract the fractional seconds.
-  NSTimeInterval asTimeInterval = [date timeIntervalSince1970];
-  NSTimeInterval worker = asTimeInterval - trunc(asTimeInterval);
-  self.milliseconds = (NSInteger)round(worker * 1000.0);
-}
-
-- (void)setFromRFC3339String:(NSString *)str {
-  static NSCharacterSet *gDashSet;
-  static NSCharacterSet *gTSet;
-  static NSCharacterSet *gColonSet;
-  static NSCharacterSet *gPlusMinusZSet;
-
-  static dispatch_once_t onceToken;
-  dispatch_once(&onceToken, ^{
-    gDashSet = [NSCharacterSet characterSetWithCharactersInString:@"-"];
-    gTSet = [NSCharacterSet characterSetWithCharactersInString:@"Tt "];
-    gColonSet = [NSCharacterSet characterSetWithCharactersInString:@":"];
-    gPlusMinusZSet = [NSCharacterSet characterSetWithCharactersInString:@"+-zZ"];
-  });
-
-  NSInteger year = NSDateComponentUndefined;
-  NSInteger month = NSDateComponentUndefined;
-  NSInteger day = NSDateComponentUndefined;
-  NSInteger hour = NSDateComponentUndefined;
-  NSInteger minute = NSDateComponentUndefined;
-  NSInteger sec = NSDateComponentUndefined;
-  NSInteger milliseconds = 0;
-  double secDouble = -1.0;
-  NSString* sign = nil;
-  NSInteger offsetHour = 0;
-  NSInteger offsetMinute = 0;
-
-  if (str.length > 0) {
-    NSScanner* scanner = [NSScanner scannerWithString:str];
-    // There should be no whitespace, so no skip characters.
-    [scanner setCharactersToBeSkipped:nil];
-
-    // for example, scan 2006-11-17T15:10:46-08:00
-    //                or 2006-11-17T15:10:46Z
-    if (// yyyy-mm-dd
-        [scanner scanInteger:&year] &&
-        [scanner scanCharactersFromSet:gDashSet intoString:NULL] &&
-        [scanner scanInteger:&month] &&
-        [scanner scanCharactersFromSet:gDashSet intoString:NULL] &&
-        [scanner scanInteger:&day] &&
-        // Thh:mm:ss
-        [scanner scanCharactersFromSet:gTSet intoString:NULL] &&
-        [scanner scanInteger:&hour] &&
-        [scanner scanCharactersFromSet:gColonSet intoString:NULL] &&
-        [scanner scanInteger:&minute] &&
-        [scanner scanCharactersFromSet:gColonSet intoString:NULL] &&
-        [scanner scanDouble:&secDouble]) {
-
-      // At this point we got secDouble, pull it apart.
-      sec = (NSInteger)secDouble;
-      double worker = secDouble - ((double)sec);
-      milliseconds = (NSInteger)round(worker * 1000.0);
-
-      // Finish parsing, now the offset info.
-      if (// Z or +hh:mm
-          [scanner scanCharactersFromSet:gPlusMinusZSet intoString:&sign] &&
-          [scanner scanInteger:&offsetHour] &&
-          [scanner scanCharactersFromSet:gColonSet intoString:NULL] &&
-          [scanner scanInteger:&offsetMinute]) {
-      }
-    }
-  }
-
-  NSDateComponents *dateComponents = [[NSDateComponents alloc] init];
-  [dateComponents setYear:year];
-  [dateComponents setMonth:month];
-  [dateComponents setDay:day];
-  [dateComponents setHour:hour];
-  [dateComponents setMinute:minute];
-  [dateComponents setSecond:sec];
-
-  BOOL isMinusOffset = [sign isEqual:@"-"];
-  if (isMinusOffset || [sign isEqual:@"+"]) {
-    NSInteger totalOffsetMinutes = ((offsetHour * 60) + offsetMinute) * (isMinusOffset ? -1 : 1);
-    self.offsetMinutes = @(totalOffsetMinutes);
-
-    // Minus offset means Universal time is that many hours and minutes ahead.
-    //
-    // This is the inverse of the adjustment done above in RFC3339String.
-    NSTimeInterval deltaOffsetSeconds = -totalOffsetMinutes * 60;
-    NSCalendar *calendar = [[self class] calendar];
-    NSDate *scannedDate = [calendar dateFromComponents:dateComponents];
-    NSDate *offsetDate = [scannedDate dateByAddingTimeInterval:deltaOffsetSeconds];
-
-    dateComponents = [calendar components:kGTLRDateComponentBits
-                                 fromDate:offsetDate];
-  }
-
-  self.dateComponents = dateComponents;
-  self.milliseconds = milliseconds;
-}
-
-- (BOOL)hasTime {
-  NSDateComponents *dateComponents = self.dateComponents;
-
-  BOOL hasTime = ([dateComponents hour] != NSDateComponentUndefined
-                  && [dateComponents minute] != NSDateComponentUndefined);
-
-  return hasTime;
-}
-
-- (void)setHasTime:(BOOL)shouldHaveTime {
-  // We'll set time values to zero or kUndefinedDateComponent as appropriate.
-  BOOL hadTime = self.hasTime;
-
-  if (shouldHaveTime && !hadTime) {
-    [_dateComponents setHour:0];
-    [_dateComponents setMinute:0];
-    [_dateComponents setSecond:0];
-    _milliseconds = 0;
-  } else if (hadTime && !shouldHaveTime) {
-    [_dateComponents setHour:NSDateComponentUndefined];
-    [_dateComponents setMinute:NSDateComponentUndefined];
-    [_dateComponents setSecond:NSDateComponentUndefined];
-    _milliseconds = 0;
-  }
-}
-
-+ (NSCalendar *)calendar {
-  NSCalendar *cal = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
-  cal.timeZone = (NSTimeZone * _Nonnull)[NSTimeZone timeZoneWithName:@"Universal"];
-  return cal;
-}
-
-@end

+ 0 - 40
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRDefines.h

@@ -1,40 +0,0 @@
-/* Copyright (c) 2011 Google Inc.
- *
- * 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.
- */
-
-//
-// GTLRDefines.h
-//
-
-#import <Foundation/Foundation.h>
-
-#ifndef GTLR_DEBUG_ASSERT
-  #if DEBUG && !defined(NS_BLOCK_ASSERTIONS)
-    // NSCAssert to avoid capturing self if used in a block.
-    #define GTLR_DEBUG_ASSERT(condition, ...) NSCAssert(condition, __VA_ARGS__)
-  #elif DEBUG
-    // In DEBUG builds with assertions blocked, log to avoid unused variable warnings.
-    #define GTLR_DEBUG_ASSERT(condition, ...) if (!(condition)) { NSLog(__VA_ARGS__); }
-  #else
-    #define GTLR_DEBUG_ASSERT(condition, ...) do { } while (0)
-  #endif
-#endif
-
-#ifndef GTLR_DEBUG_LOG
-  #if DEBUG
-    #define GTLR_DEBUG_LOG(...) NSLog(__VA_ARGS__)
-  #else
-    #define GTLR_DEBUG_LOG(...) do { } while (0)
-  #endif
-#endif

+ 0 - 82
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRDuration.h

@@ -1,82 +0,0 @@
-/* Copyright (c) 2016 Google Inc.
-*
-* 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.
-*/
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-/**
- *  An immutable class representing a string data type 'google-duration'.
- *  It is based off the protocol buffers definition:
- *  https://github.com/google/protobuf/blob/master/src/google/protobuf/duration.proto
- */
-@interface GTLRDuration : NSObject <NSCopying>
-
-/**
- *  Signed seconds of the span of time. Must be from -315,576,000,000
- *  to +315,576,000,000 inclusive.
- **/
-@property(nonatomic, readonly) int64_t seconds;
-
-/**
- *  Signed fractions of a second at nanosecond resolution of the span
- *  of time. Durations less than one second are represented with a 0
- *  `seconds` field and a positive or negative `nanos` field. For durations
- *  of one second or more, a non-zero value for the `nanos` field must be
- *  of the same sign as the `seconds` field. Must be from -999,999,999
- *  to +999,999,999 inclusive.
- **/
-@property(nonatomic, readonly) int32_t nanos;
-
-/**
- *  This duration expressed as a NSTimeInterval.
- *
- *  @note: Not all second/nanos combinations can be represented in a
- *  NSTimeInterval, so this could be a lossy transform.
- **/
-@property(nonatomic, readonly) NSTimeInterval timeInterval;
-
-/**
- * Returns the string form used to send this data type in a JSON payload.
- */
-@property(nonatomic, readonly) NSString *jsonString;
-
-/**
- *  Constructor for a new duration with the given seconds and nanoseconds.
- *
- *  Will fail if seconds/nanos differ in sign or if nanos is more than one
- *  second.
- **/
-+ (nullable instancetype)durationWithSeconds:(int64_t)seconds
-                                       nanos:(int32_t)nanos;
-
-/**
- *  Constructor for a new duration from the given string form.
- *
- *  Will return nil if jsonString is invalid.
- **/
-+ (nullable instancetype)durationWithJSONString:(nullable NSString *)jsonString;
-
-/**
- *  Constructor for a new duration from the NSTimeInterval.
- *
- *  @note NSTimeInterval doesn't always express things as exactly as one might
- *  expect, so coverting from to integer seconds & nanos can reveal this.
- **/
-+ (instancetype)durationWithTimeInterval:(NSTimeInterval)timeInterval;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 221
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRDuration.m

@@ -1,221 +0,0 @@
-/* Copyright (c) 2016 Google Inc.
- *
- * 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.
- */
-
-//#import <GoogleAPIClientForREST/GTLRDuration.h>
-#import "GTLRDuration.h"
-
-#import "GTLRDefines.h"
-
-static const int32_t kNanosPerMillisecond = 1000000;
-static const int32_t kNanosPerMicrosecond = 1000;
-static const int32_t kNanosPerSecond = 1000000000;
-
-static int32_t IntPow10(int x) {
-  int32_t result = 1;
-  for (int i = 0; i < x; ++i) {
-    result *= 10;
-  }
-  return result;
-}
-
-@implementation GTLRDuration
-
-@dynamic timeInterval;
-
-@synthesize seconds = _seconds,
-            nanos = _nanos,
-            jsonString = _jsonString;
-
-+ (instancetype)durationWithSeconds:(int64_t)seconds nanos:(int32_t)nanos {
-  if (seconds < 0) {
-    if (nanos > 0) {
-      // secs was -, nanos was +
-      return nil;
-    }
-  } else if (seconds > 0) {
-    if (nanos < 0) {
-      // secs was +, nanos was -
-      return nil;
-    }
-  }
-  if ((nanos <= -kNanosPerSecond) || (nanos >= kNanosPerSecond)) {
-    // more than a seconds worth
-    return nil;
-  }
-  return [[self alloc] initWithSeconds:seconds nanos:nanos jsonString:NULL];
-}
-
-+ (instancetype)durationWithJSONString:(NSString *)jsonString {
-  // It has to end in "s", so it needs >1 character.
-  if (jsonString.length <= 1) {
-    return nil;
-  }
-
-  static NSCharacterSet *gNumberSet;
-  static dispatch_once_t onceToken;
-  dispatch_once(&onceToken, ^{
-    gNumberSet = [NSCharacterSet characterSetWithCharactersInString:@"0123456789"];
-  });
-
-  NSScanner* scanner = [NSScanner scannerWithString:jsonString];
-  // There should be no whitespace, so no skip characters.
-  [scanner setCharactersToBeSkipped:nil];
-
-  // Can start with a '-'.
-  BOOL isNeg = [scanner scanString:@"-" intoString:NULL];
-
-  int64_t seconds;
-  if (![scanner scanLongLong:&seconds]) {
-    return nil;
-  }
-
-  // Since the sign was manually scanned, seconds should be positive
-  // (i.e. no "--#" in the put).
-  if (seconds < 0) {
-    return nil;
-  }
-
-  // See if it has a ".[nanos]".  Spec seems to say it is required, but play
-  // it safe and make it optional.
-  int32_t nanos = 0;
-  if ([scanner scanString:@"." intoString:NULL]) {
-    NSString *nanosStr;
-    if (![scanner scanCharactersFromSet:gNumberSet intoString:&nanosStr]) {
-      return nil;
-    }
-    // Ensure not too many digits (also ensure it is within range).
-    if (nanosStr.length > 9) {
-      return nil;
-    }
-    // Can use NSString's intValue since the character set was controlled.
-    nanos = [nanosStr intValue];
-    // Scale based on length.
-    nanos *= IntPow10(9 - (int)nanosStr.length);
-  }
-
-  // And must have the final 's'.
-  if (![scanner scanString:@"s" intoString:NULL]) {
-    return nil;
-  }
-
-  // Better be the end...
-  if (![scanner isAtEnd]) {
-    return nil;
-  }
-
-  if (isNeg) {
-    seconds = -seconds;
-    nanos = -nanos;
-  }
-
-  // Pass on the json string so it will be reflected back out as it came in
-  // (incase it had a different number of digits, etc).
-  return [[self alloc] initWithSeconds:seconds
-                                 nanos:nanos
-                            jsonString:jsonString];
-}
-
-+ (instancetype)durationWithTimeInterval:(NSTimeInterval)timeInterval {
-  NSTimeInterval seconds;
-  NSTimeInterval nanos = modf(timeInterval, &seconds);
-  nanos *= (NSTimeInterval)kNanosPerSecond;
-
-  return [[self alloc] initWithSeconds:(int64_t)seconds
-                                 nanos:(int32_t)nanos
-                            jsonString:NULL];
-}
-
-- (instancetype)init {
-  return [self initWithSeconds:0 nanos:0 jsonString:NULL];
-}
-
-- (instancetype)initWithSeconds:(int64_t)seconds
-                          nanos:(int32_t)nanos
-                     jsonString:(NSString *)jsonString {
-  self = [super init];
-  if (self) {
-    // Sanity asserts, the class methods should make sure this doesn't happen.
-    GTLR_DEBUG_ASSERT((((seconds <= 0) && (nanos <= 0)) ||
-                       ((seconds >= 0) && (nanos >= 0))),
-                      @"Seconds and nanos must have the same sign (%lld & %d)",
-                      seconds, nanos);
-    GTLR_DEBUG_ASSERT(((nanos < kNanosPerSecond) &&
-                       (nanos > -kNanosPerSecond)),
-                      @"Nanos is a second or more (%d)", nanos);
-
-    _seconds = seconds;
-    _nanos = nanos;
-
-    if (jsonString.length) {
-      _jsonString = [jsonString copy];
-    } else {
-      // Based off the JSON serialization code in protocol buffers
-      // ( https://github.com/google/protobuf/ ).
-      NSString *sign = @"";
-      if ((seconds < 0) || (nanos < 0)) {
-        sign = @"-";
-        seconds = -seconds;
-        nanos = -nanos;
-      }
-      int nanoDigts;
-      int32_t nanoDivider;
-      if (nanos % kNanosPerMillisecond == 0) {
-        nanoDigts = 3;
-        nanoDivider = kNanosPerMillisecond;
-      } else if (nanos % kNanosPerMicrosecond == 0) {
-        nanoDigts = 6;
-        nanoDivider = kNanosPerMicrosecond;
-      } else {
-        nanoDigts = 9;
-        nanoDivider = 1;
-      }
-      _jsonString = [NSString stringWithFormat:@"%@%lld.%0*ds",
-                     sign, seconds, nanoDigts, (nanos / nanoDivider)];
-    }
-  }
-  return self;
-}
-
-- (NSTimeInterval)timeInterval {
-  NSTimeInterval result = self.seconds;
-  result += (NSTimeInterval)self.nanos / (NSTimeInterval)kNanosPerSecond;
-  return result;
-}
-
-- (id)copyWithZone:(NSZone *)zone {
-  // Object is immutable
-  return self;
-}
-
-- (BOOL)isEqual:(GTLRDuration *)other {
-  if (self == other) return YES;
-  if (![other isKindOfClass:[GTLRDuration class]]) return NO;
-
-  BOOL result = ((self.seconds == other.seconds) &&
-                 (self.nanos == other.nanos));
-  return result;
-}
-
-- (NSUInteger)hash {
-  NSUInteger result = (NSUInteger)((self.seconds * 13) + self.nanos);
-  return result;
-}
-
-- (NSString *)description {
-  return [NSString stringWithFormat:@"%@ %p: {%@}",
-          [self class], self, self.jsonString];
-}
-
-@end

+ 0 - 116
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRErrorObject.h

@@ -1,116 +0,0 @@
-/* Copyright (c) 2011 Google Inc.
- *
- * 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.
- */
-
-#import "GTLRObject.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class GTLRErrorObjectErrorItem;
-@class GTLRErrorObjectDetail;
-
-/**
- *  This class wraps JSON responses (both V1 and V2 of Google JSON errors) and NSErrors.
- *
- *  A GTLRErrorObject can be created using +objectWithJSON: or +objectWithFoundationError:
- */
-@interface GTLRErrorObject : GTLRObject
-
-/**
- *  Convenience method for creating an error object from an NSError.
- *
- *  @param error The @c NSError to be encapsulated by the @c GTLRErrorObject
- *
- *  @return A @c GTLRErrorObject wrapping the NSError.
- */
-+ (instancetype)objectWithFoundationError:(NSError *)error;
-
-/**
- *  Convenience utility for extracting the GTLRErrorObject that was used to create an NSError.
- *
- *  @param foundationError The NSError that may have been obtained from a GTLRErrorObject.
- *
- *  @return The GTLRErrorObject, nil if the error was not originally from a GTLRErrorObject.
- */
-+ (nullable GTLRErrorObject *)underlyingObjectForError:(NSError *)foundationError;
-
-//
-// V1 & V2 properties.
-//
-
-/**
- *  The numeric error code.
- */
-@property(nonatomic, strong, nullable) NSNumber *code;
-
-/**
- *  An error message string, typically provided by the API server.  This is not localized,
- *  and its reliability depends on the API server.
- */
-@property(nonatomic, strong, nullable) NSString *message;
-
-//
-// V1 properties.
-//
-
-/**
- *  Underlying errors that occurred on the server.
- */
-@property(nonatomic, strong, nullable) NSArray<GTLRErrorObjectErrorItem *> *errors;
-
-//
-// V2 properties
-//
-
-/**
- *  A status error string, defined by the API server, such as "NOT_FOUND".
- */
-@property(nonatomic, strong, nullable) NSString *status;
-
-/**
- *  Additional diagnostic error details provided by the API server.
- */
-@property(nonatomic, strong, nullable) NSArray<GTLRErrorObjectDetail *> *details;
-
-/**
- *  An NSError, either underlying the error object or manufactured from the error object's
- *  properties.
- */
-@property(nonatomic, readonly) NSError *foundationError;
-
-@end
-
-/**
- *  Class representing the items of the "errors" array inside the Google V1 error JSON.
- *
- *  Client applications should not rely on the property values of these items.
- */
-@interface GTLRErrorObjectErrorItem : GTLRObject
-@property(nonatomic, strong, nullable) NSString *domain;
-@property(nonatomic, strong, nullable) NSString *reason;
-@property(nonatomic, strong, nullable) NSString *message;
-@property(nonatomic, strong, nullable) NSString *location;
-@end
-
-/**
- *  Class representing the items of the "details" array inside the Google V2 error JSON.
- *
- *  Client applications should not rely on the property values of these items.
- */
-@interface GTLRErrorObjectDetail : GTLRObject
-@property(nonatomic, strong, nullable) NSString *type;
-@property(nonatomic, strong, nullable) NSString *detail;
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 141
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRErrorObject.m

@@ -1,141 +0,0 @@
-/* Copyright (c) 2011 Google Inc.
- *
- * 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.
- */
-
-//#import <GoogleAPIClientForREST/GTLRErrorObject.h>
-//
-//#import <GoogleAPIClientForREST/GTLRUtilities.h>
-//#import <GoogleAPIClientForREST/GTLRService.h>
-
-#import "GTLRErrorObject.h"
-
-#import "GTLRUtilities.h"
-#import "GTLRService.h"
-
-static NSString *const kGTLRErrorObjectFoundationErrorKey = @"foundationError";
-
-@implementation GTLRErrorObject {
-  NSError *_originalFoundationError;
-}
-
-// V1 & V2 properties.
-@dynamic code;
-@dynamic message;
-
-// V1 properties.
-@dynamic errors;
-
-// V2 properties.
-@dynamic status;
-@dynamic details;
-
-// Implemented below.
-@dynamic foundationError;
-
-+ (instancetype)objectWithFoundationError:(NSError *)error {
-  GTLRErrorObject *object = [self object];
-  object->_originalFoundationError = error;
-  object.code = @(error.code);
-  object.message = error.localizedDescription;
-  return object;
-}
-
-+ (NSDictionary *)arrayPropertyToClassMap {
-  return @{
-    @"errors" : [GTLRErrorObjectErrorItem class],
-    @"details" : [GTLRErrorObjectDetail class]
-  };
-}
-
-- (NSError *)foundationError {
-  // If there was an original foundation error, copy its userInfo as the basis for ours.
-  NSMutableDictionary *userInfo =
-      [NSMutableDictionary dictionaryWithDictionary:_originalFoundationError.userInfo];
-
-  // This structured GTLRErrorObject will be available in the error's userInfo
-  // dictionary.
-  userInfo[kGTLRStructuredErrorKey]  = self;
-
-  NSError *error;
-  if (_originalFoundationError) {
-    error = [NSError errorWithDomain:_originalFoundationError.domain
-                                code:_originalFoundationError.code
-                            userInfo:userInfo];
-  } else {
-    NSString *reasonStr = self.message;
-    if (reasonStr) {
-      userInfo[NSLocalizedDescriptionKey] = reasonStr;
-    }
-
-    error = [NSError errorWithDomain:kGTLRErrorObjectDomain
-                                code:self.code.integerValue
-                            userInfo:userInfo];
-  }
-  return error;
-}
-
-+ (GTLRErrorObject *)underlyingObjectForError:(NSError *)foundationError {
-  NSDictionary *userInfo = [foundationError userInfo];
-  GTLRErrorObject *errorObj = [userInfo objectForKey:kGTLRStructuredErrorKey];
-  return errorObj;
-}
-
-- (BOOL)isEqual:(id)object {
-  // Include the underlying foundation error in equality checks.
-  if (self == object) return YES;
-  if (![super isEqual:object]) return NO;
-  if (![object isKindOfClass:[GTLRErrorObject class]]) return NO;
-  GTLRErrorObject *other = (GTLRErrorObject *)object;
-  return GTLR_AreEqualOrBothNil(_originalFoundationError,
-                                other->_originalFoundationError);
-}
-
-+ (BOOL)supportsSecureCoding {
-  return YES;
-}
-
-- (instancetype)initWithCoder:(NSCoder *)decoder {
-  self = [super initWithCoder:decoder];
-  if (self) {
-    _originalFoundationError =
-        [decoder decodeObjectOfClass:[NSError class]
-                              forKey:kGTLRErrorObjectFoundationErrorKey];
-  }
-  return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)encoder {
-  [super encodeWithCoder:encoder];
-  [encoder encodeObject:_originalFoundationError
-                 forKey:kGTLRErrorObjectFoundationErrorKey];
-}
-
-@end
-
-@implementation GTLRErrorObjectErrorItem
-@dynamic domain;
-@dynamic reason;
-@dynamic message;
-@dynamic location;
-@end
-
-@implementation GTLRErrorObjectDetail
-@dynamic type;
-@dynamic detail;
-
-+ (NSDictionary *)propertyToJSONKeyMap {
-  return @{ @"type" : @"@type" };
-}
-
-@end

+ 0 - 32
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRFramework.h

@@ -1,32 +0,0 @@
-/* Copyright (c) 2011 Google Inc.
- *
- * 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.
- */
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-// Returns the version of the framework.  Major and minor should
-// match the bundle version in the Info.plist file.
-//
-// Pass NULL to ignore any of the parameters.
-
-void GTLRFrameworkVersion(NSUInteger * _Nullable major,
-                          NSUInteger * _Nullable minor,
-                          NSUInteger * _Nullable release);
-
-// Returns the version in @"a.b" or @"a.b.c" format
-NSString *GTLRFrameworkVersionString(void);
-
-NS_ASSUME_NONNULL_END

+ 0 - 41
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRFramework.m

@@ -1,41 +0,0 @@
-/* Copyright (c) 2011 Google Inc.
- *
- * 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.
- */
-
-//#import <GoogleAPIClientForREST/GTLRFramework.h>
-#import "GTLRFramework.h"
-
-void GTLRFrameworkVersion(NSUInteger* major, NSUInteger* minor, NSUInteger* release) {
-  // version 3.0.0
-  if (major)   *major = 3;
-  if (minor)   *minor = 0;
-  if (release) *release = 0;
-}
-
-NSString *GTLRFrameworkVersionString(void) {
-  NSUInteger major, minor, release;
-  NSString *libVersionString;
-
-  GTLRFrameworkVersion(&major, &minor, &release);
-
-  // most library releases will have a release value of zero
-  if (release != 0) {
-    libVersionString = [NSString stringWithFormat:@"%d.%d.%d",
-                        (int)major, (int)minor, (int)release];
-  } else {
-    libVersionString = [NSString stringWithFormat:@"%d.%d",
-                        (int)major, (int)minor];
-  }
-  return libVersionString;
-}

+ 0 - 325
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRObject.h

@@ -1,325 +0,0 @@
-/* Copyright (c) 2011 Google Inc.
- *
- * 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.
- */
-
-// GTLRObject documentation:
-// https://github.com/google/google-api-objectivec-client-for-rest/blob/main/USING.md#objects-and-queries
-
-#import <Foundation/Foundation.h>
-
-#import "GTLRDateTime.h"
-#import "GTLRDuration.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-/**
- *  Protocol that can be implemented to provide custom logic for what class
- *  should be created out of the given JSON.
- */
-@protocol GTLRObjectClassResolver <NSObject>
-- (Class)classForJSON:(NSDictionary *)json
-         defaultClass:(Class)defaultClass;
-@end
-
-/**
- *  Standard GTLRObjectClassResolver used by the core library.
- */
-@interface GTLRObjectClassResolver : NSObject<GTLRObjectClassResolver>
-
-/**
- *  Returns a resolver that will look up the 'kind' properties to find classes
- *  based on the JSON.
- *
- *  The generated service classes provide a +kindStringToClassMap method for any
- *  mappings that were found from discovery when generating the service.
- */
-+ (instancetype)resolverWithKindMap:(NSDictionary<NSString *, Class> *)kindStringToClassMap;
-
-/**
- *  Returns a resolver that will look up the 'kind' properties to find classes
- *  based on the JSON and then applies mapping of surrogate classes to swap out
- *  specific classes.
- *
- *  Surrogates are subclasses to be instantiated instead of standard classes
- *  when creating objects from the JSON. For example, this code will, for one query's
- *  execution, swap a service's default resolver for one that will then use
- *  MyCalendarEventSubclass instead of GTLRCalendarEvent and
- *  MyCalendarReminderSubclass instead of GTLRCalendarReminder.
- *
- * @code
- *  NSDictionary *surrogates = @{
- *    [GTLRCalendarEvent class] : [MyCalendarEventSubclass class]
- *    [GTLRCalendarReminder class] : [MyCalendarReminderSubclass class],
- *  };
- *  NSDictionary *serviceKindMap = [[calendarService class] kindStringToClassMap];
- *  GTLRObjectClassResolver *updatedResolver =
- *    [GTLRObjectClassResolver resolverWithKindMap:serviceKindMap
- *                                       surrogates:surrogates];
- *  query.executionParameters.objectClassResolver = updatedResolver;
- * @endcode
- *
- * @note To install surrogates for all queries executed by the service, use
- *       the service's @c -setSurrogates method.
- */
-+ (instancetype)resolverWithKindMap:(NSDictionary<NSString *, Class> *)kindStringToClassMap
-                         surrogates:(NSDictionary<Class, Class> *)surrogates;
-
-@end
-
-/**
- * @c GTLRObject serves as the common superclass for classes wrapping JSON, errors, and other data
- * passed in server requests and responses.
- *
- * @note This class is @em not safe for simultaneous use from multiple threads. Applications should
- *       serialize or protect access to a @c GTLRObject instance as they would for any standard
- *       Cocoa mutable container.
- */
-@interface GTLRObject : NSObject <NSCopying, NSSecureCoding>
-
-/**
- *  The JSON underlying the property values for this object.
- *
- *  The JSON should be accessed or set using the generated properties of a
- *  class derived from GTLRObject or with the methods @c setJSONValue:forKey:
- *  and @c JSONValueForKey:
- *
- *  @note: Applications should use @c additionalPropertyForKey: when accessing
- *         API object properties that do not have generated @c \@property accessors.
- */
-@property(nonatomic, strong, nullable) NSMutableDictionary *JSON;
-
-/**
- *  A dictionary retained by the object for the convenience of the client application.
- *
- *  A client application may use this to retain any dictionary.
- *
- *  The values of the user properties dictionary will not be sent to the server during
- *  query execution, and will not be copied by NSCopying or encoded by NSSecureCoding.
- */
-@property(nonatomic, strong) NSDictionary *userProperties;
-
-/////////////////////////////////////////////////////////////////////////////////////////////
-//
-// Public methods
-//
-// These methods are intended for users of the library
-//
-/////////////////////////////////////////////////////////////////////////////////////////////
-
-/**
- *  Constructor for an empty object.
- */
-+ (instancetype)object;
-
-/**
- *  Constructor for an object including JSON.
- */
-+ (instancetype)objectWithJSON:(nullable NSDictionary *)dict;
-
-/**
- *  Constructor for an object including JSON and providing a resolver to help
- *  select the correct classes for sub objects within the json.
- *
- *  The generated services provide a default resolver (-objectClassResolver)
- *  that covers the kinds for that service. They also expose the kind mappings
- *  via the +kindStringToClassMap method.
- */
-+ (instancetype)objectWithJSON:(nullable NSDictionary *)dict
-           objectClassResolver:(id<GTLRObjectClassResolver>)objectClassResolver;
-
-/**
- *  The JSON for the object, or an empty string if there is no JSON or if the JSON
- *  dictionary cannot be represented as JSON.
- */
-- (NSString *)JSONString;
-
-/**
- *  Generic access for setting entries in the JSON dictionary.  This creates the JSON dictionary
- *  if necessary.
- *
- *  @note: Applications should use @c setAdditionalProperty:forKey: when setting
- *         API object properties that do not have generated @c \@property accessors.
- */
-- (void)setJSONValue:(nullable id)obj forKey:(nonnull NSString *)key;
-
-/**
- *  Generic access to the JSON dictionary.
- *
- *  @note: Applications should use @c additionalPropertyForKey: when accessing
- *         API object properties that do not have generated @c \@property accessors.
- */
-- (nullable id)JSONValueForKey:(NSString *)key;
-
-/**
- *  The list of keys in this object's JSON that are not listed as properties on the object.
- */
-- (nullable NSArray<NSString *> *)additionalJSONKeys;
-
-/**
- *  Setter for any key in the JSON that is not listed as a @c \@property in the class declaration.
- */
-- (void)setAdditionalProperty:(id)obj forName:(NSString *)name;
-
-/**
- *  Accessor for any key in the JSON that is not listed as a @c \@property in the class
- *  declaration.
- */
-- (nullable id)additionalPropertyForName:(NSString *)name;
-
-/**
- *  A dictionary of all keys in the JSON that is not listed as a @c \@property in the class
- *  declaration.
- */
-- (NSDictionary<NSString *, id> *)additionalProperties;
-
-/**
- *  A string for a partial query describing the fields present.
- *
- *  @note Only the first element of any array is examined.
- *
- *  @see https://developers.google.com/google-apps/tasks/performance?csw=1#partial
- *
- *  @return A @c fields string describing the fields present in the object.
- */
-- (NSString *)fieldsDescription;
-
-/**
- *  An object containing only the changes needed to do a partial update (patch),
- *  where the patch would be to change an object from the original to the receiver,
- *  such as
- *    @c GTLRSomeObject *patchObject = [newVersion patchObjectFromOriginal:oldVersion];
- *
- *  @note This method returns nil if there are no changes between the original and the receiver.
- *
- *  @see https://developers.google.com/google-apps/tasks/performance?csw=1#patch
- *
- *  @param original The original object from which to create the patch object.
- *
- *  @return The object used for the patch body.
- */
-- (nullable id)patchObjectFromOriginal:(GTLRObject *)original;
-
-/**
- *  A null value to set object properties for patch queries that delete fields.
- *
- *  Do not use this except when setting an object property for a patch query.
- *
- *  @return The null value object.
- */
-+ (id)nullValue;
-
-#pragma mark Internal
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// Protected methods
-//
-// These methods are intended for subclasses of GTLRObject
-//
-
-// Creation of objects from a JSON dictionary. The class created depends on
-// the content of the JSON, not the class messaged.
-+ (nullable GTLRObject *)objectForJSON:(NSMutableDictionary *)json
-                          defaultClass:(nullable Class)defaultClass
-                   objectClassResolver:(id<GTLRObjectClassResolver>)objectClassResolver;
-
-// Property-to-key mapping (for JSON keys which are not used as method names)
-+ (nullable NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap;
-
-// property-to-Class mapping for array properties (to say what is in the array)
-+ (nullable NSDictionary<NSString *, Class> *)arrayPropertyToClassMap;
-
-// The default class for additional JSON keys
-+ (nullable Class)classForAdditionalProperties;
-
-// Indicates if a "kind" property on this class can be used for the class
-// registry or if it appears to be non standard.
-+ (BOOL)isKindValidForClassRegistry;
-
-@end
-
-/**
- *  Collection results have a property containing an array of @c GTLRObject
- *
- *  This provides support for @c NSFastEnumeration and for indexed subscripting to
- *  access the objects in the array.
- */
-@interface GTLRCollectionObject : GTLRObject<NSFastEnumeration>
-
-/**
- *  The property name that holds the collection.
- *
- *  @return The key for the property holding the array of @c GTLRObject items.
- */
-+ (NSString *)collectionItemsKey;
-
-// objectAtIndexedSubscript: will throw if the index is out of bounds (like
-// NSArray does).
-- (nullable id)objectAtIndexedSubscript:(NSUInteger)idx;
-
-@end
-
-/**
- *  A GTLRDataObject holds media data and the MIME type of the data returned by a media
- *  download query.
- *
- *  The JSON for the object may be nil.
- */
-@interface GTLRDataObject : GTLRObject
-
-/**
- *  The downloaded media data.
- */
-@property(atomic, strong) NSData *data;
-
-/**
- *  The MIME type of the downloaded media data.
- */
-@property(atomic, copy) NSString *contentType;
-
-@end
-
-/**
- *  Base class used when a service method directly returns an array instead
- *  of a JSON object. This exists for the methods not up to spec.
- */
-@interface GTLRResultArray : GTLRCollectionObject
-
-/**
- *  This method should only be called by subclasses.
- */
-- (nullable NSArray *)itemsWithItemClass:(Class)itemClass;
-@end
-
-// ----------------------------------------------------------------------------
-
-/**
- *  Helper to call the resolver and find the class to use for the given JSON.
- *  Intended for internal library use only.
- */
-Class GTLRObjectResolveClass(
-    id<GTLRObjectClassResolver> objectClassResolver,
-    NSDictionary *json,
-    Class defaultClass);
-
-// ----------------------------------------------------------------------------
-
-// Version marker used to validate the generated sources against the library
-// version. The will be changed any time the library makes a change that means
-// sources need to be regenerated.
-#define GTLR_RUNTIME_VERSION 3000
-
-// ----------------------------------------------------------------------------
-
-NS_ASSUME_NONNULL_END

+ 0 - 770
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRObject.m

@@ -1,770 +0,0 @@
-/* Copyright (c) 2011 Google Inc.
- *
- * 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 <objc/runtime.h>
-
-//#import <GoogleAPIClientForREST/GTLRObject.h>
-//#import <GoogleAPIClientForREST/GTLRRuntimeCommon.h>
-//#import <GoogleAPIClientForREST/GTLRUtilities.h>
-
-#import "GTLRObject.h"
-#import "GTLRRuntimeCommon.h"
-#import "GTLRUtilities.h"
-
-#import "GTLRDefines.h"
-
-static NSString *const kUserDataPropertyKey = @"_userData";
-
-static NSString *const kGTLRObjectJSONCoderKey = @"json";
-
-static NSMutableDictionary *DeepMutableCopyOfJSONDictionary(NSDictionary *initialJSON);
-
-@interface GTLRObject () <GTLRRuntimeCommon>
-
-@property(nonatomic, strong) id<GTLRObjectClassResolver>objectClassResolver;
-
-@end
-
-@implementation GTLRObject {
-  // Any complex object hung off this object goes into the cache so the
-  // next fetch will get the same object back instead of having to recreate
-  // it.
-  NSMutableDictionary *_childCache;
-}
-
-@synthesize JSON = _json,
-            objectClassResolver = _objectClassResolver,
-            userProperties = _userProperties;
-
-+ (instancetype)object {
-  return [[self alloc] init];
-}
-
-+ (instancetype)objectWithJSON:(NSDictionary *)dict {
-  GTLRObject *obj = [self object];
-  obj->_json = DeepMutableCopyOfJSONDictionary(dict);
-  return obj;
-}
-
-+ (instancetype)objectWithJSON:(nullable NSDictionary *)dict
-           objectClassResolver:(id<GTLRObjectClassResolver>)objectClassResolver {
-  GTLRObject *obj = [self objectWithJSON:dict];
-  obj->_objectClassResolver = objectClassResolver;
-  return obj;
-}
-
-+ (NSDictionary<NSString *, NSString *> *)propertyToJSONKeyMap {
-  return nil;
-}
-
-+ (NSDictionary<NSString *, Class> *)arrayPropertyToClassMap {
-  return nil;
-}
-
-+ (Class)classForAdditionalProperties {
-  return Nil;
-}
-
-+ (BOOL)isKindValidForClassRegistry {
-  return YES;
-}
-
-- (BOOL)isEqual:(GTLRObject *)other {
-  if (self == other) return YES;
-  if (other == nil) return NO;
-
-  // The objects should be the same class, or one should be a subclass of the
-  // other's class
-  if (![other isKindOfClass:[self class]]
-      && ![self isKindOfClass:[other class]]) return NO;
-
-  // What we're not comparing here:
-  //   properties
-  return GTLR_AreEqualOrBothNil(_json, [other JSON]);
-}
-
-// By definition, for two objects to potentially be considered equal,
-// they must have the same hash value.  The hash is mostly ignored,
-// but removeObjectsInArray: in Leopard does seem to check the hash,
-// and NSObject's default hash method just returns the instance pointer.
-// We'll define hash here for all of our GTLRObjects.
-- (NSUInteger)hash {
-  return (NSUInteger) (__bridge void *) [GTLRObject class];
-}
-
-- (id)copyWithZone:(NSZone *)zone {
-  GTLRObject *newObject = [[[self class] allocWithZone:zone] init];
-  newObject.JSON = DeepMutableCopyOfJSONDictionary(self.JSON);
-  newObject.objectClassResolver = self.objectClassResolver;
-
-  // What we're not copying:
-  //   userProperties
-  return newObject;
-}
-
-- (NSString *)descriptionWithLocale:(id)locale {
-  return self.description;
-}
-
-+ (BOOL)supportsSecureCoding {
-  return YES;
-}
-
-- (instancetype)initWithCoder:(NSCoder *)decoder {
-  self = [super init];
-  if (self) {
-    // NSDictionary/NSArray seem to allow strings and numbers with secure coding
-    // just fine, but to allow sub arrays or dictionaries (or an null) the
-    // classes have to be explicitly listed to decode correctly.
-    NSSet *expectedClasses =
-        [NSSet setWithObjects:
-           [NSMutableDictionary class], [NSMutableArray class], [NSNull class], nil];
-    _json = [decoder decodeObjectOfClasses:expectedClasses
-                                    forKey:kGTLRObjectJSONCoderKey];
-  }
-  return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)encoder {
-  [encoder encodeObject:_json forKey:kGTLRObjectJSONCoderKey];
-}
-
-#pragma mark JSON values
-
-- (void)setJSONValue:(id)obj forKey:(NSString *)key {
-  NSMutableDictionary *dict = self.JSON;
-  if (dict == nil && obj != nil) {
-    dict = [NSMutableDictionary dictionaryWithCapacity:1];
-    self.JSON = dict;
-  }
-  [dict setValue:obj forKey:key];
-}
-
-- (id)JSONValueForKey:(NSString *)key {
-  id obj = [self.JSON objectForKey:key];
-  return obj;
-}
-
-- (NSString *)JSONString {
-  NSError *error;
-  NSDictionary *json = self.JSON;
-  if (json) {
-    NSData *data = [NSJSONSerialization dataWithJSONObject:json
-                                                   options:NSJSONWritingPrettyPrinted
-                                                     error:&error];
-    GTLR_DEBUG_ASSERT(data != nil, @"JSONString generate failed: %@\n JSON: %@", error, json);
-    if (data) {
-      NSString *jsonStr = [[NSString alloc] initWithData:data
-                                                encoding:NSUTF8StringEncoding];
-      if (jsonStr) return jsonStr;
-    }
-  }
-  return @"";
-}
-
-- (NSArray<NSString *> *)additionalJSONKeys {
-  NSArray *knownKeys = [[self class] allKnownKeys];
-  NSMutableArray *result;
-  NSArray *allKeys = _json.allKeys;
-  if (allKeys) {
-    result = [NSMutableArray arrayWithArray:allKeys];
-    [result removeObjectsInArray:knownKeys];
-    // Return nil instead of an empty array.
-    if (result.count == 0) {
-      result = nil;
-    }
-  }
-  return result;
-}
-
-#pragma mark Partial - Fields
-
-- (NSString *)fieldsDescription {
-  NSString *str = [GTLRObject fieldsDescriptionForJSON:self.JSON];
-  return str;
-}
-
-+ (NSString *)fieldsDescriptionForJSON:(NSDictionary *)targetJSON {
-  // Internal routine: recursively generate a string field description
-  // by joining elements
-  NSArray *array = [self fieldsElementsForJSON:targetJSON];
-  NSString *str = [array componentsJoinedByString:@","];
-  return str;
-}
-
-+ (NSArray *)fieldsElementsForJSON:(NSDictionary *)targetJSON {
-  // Internal routine: recursively generate an array of field description
-  // element strings
-  NSMutableArray *resultFields = [NSMutableArray array];
-
-  // Sorting the dictionary keys gives us deterministic results when iterating
-  NSArray *sortedKeys = [targetJSON.allKeys sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
-  for (NSString *key in sortedKeys) {
-    // We'll build a comma-separated list of fields
-    id value = [targetJSON objectForKey:key];
-    if ([value isKindOfClass:[NSString class]]
-        || [value isKindOfClass:[NSNumber class]]) {
-      // Basic type (string, number), so the key is what we want
-      [resultFields addObject:key];
-    } else if ([value isKindOfClass:[NSDictionary class]]) {
-      // Object (dictionary): "parent/child1,parent/child2,parent/child3"
-      NSArray *subElements = [self fieldsElementsForJSON:value];
-      for (NSString *subElem in subElements) {
-        NSString *prepended = [NSString stringWithFormat:@"%@/%@",
-                               key, subElem];
-        [resultFields addObject:prepended];
-      }
-    } else if ([value isKindOfClass:[NSArray class]]) {
-      // Array; we'll generate from the first array entry:
-      // "parent(child1,child2,child3)"
-      //
-      // Open question: should this instead create the union of elements for
-      // all items in the array, rather than just get fields from the first
-      // array object?
-      if (((NSArray *)value).count > 0) {
-        id firstObj = [value objectAtIndex:0];
-        if ([firstObj isKindOfClass:[NSDictionary class]]) {
-          // An array of objects
-          NSString *contentsStr = [self fieldsDescriptionForJSON:firstObj];
-          NSString *encapsulated = [NSString stringWithFormat:@"%@(%@)",
-                                    key, contentsStr];
-          [resultFields addObject:encapsulated];
-        } else {
-          // An array of some basic type, or of arrays
-          [resultFields addObject:key];
-        }
-      }
-    } else {
-      NSAssert(0, @"GTLRObject unknown field element for %@ (%@)",
-               key, NSStringFromClass([value class]));
-    }
-  }
-  return resultFields;
-}
-
-#pragma mark Partial - Patch
-
-- (id)patchObjectFromOriginal:(GTLRObject *)original {
-  GTLRObject *resultObj;
-  NSMutableDictionary *resultJSON = [GTLRObject patchDictionaryForJSON:self.JSON
-                                                      fromOriginalJSON:original.JSON];
-  if (resultJSON.count > 0) {
-    // Avoid an extra copy by assigning the JSON directly rather than using +objectWithJSON:
-    resultObj = [[self class] object];
-    resultObj.JSON = resultJSON;
-  } else {
-    // Client apps should not attempt to patch with an object containing
-    // empty JSON
-    resultObj = nil;
-  }
-  return resultObj;
-}
-
-+ (NSMutableDictionary *)patchDictionaryForJSON:(NSDictionary *)newJSON
-                               fromOriginalJSON:(NSDictionary *)originalJSON {
-  // Internal recursive routine to create an object suitable for
-  // our patch semantics
-  NSMutableDictionary *resultJSON = [NSMutableDictionary dictionary];
-
-  // Iterate through keys present in the old object
-  NSArray *originalKeys = originalJSON.allKeys;
-  for (NSString *key in originalKeys) {
-    id originalValue = [originalJSON objectForKey:key];
-    id newValue = [newJSON valueForKey:key];
-    if (newValue == nil) {
-      // There is no new value for this key, so set the value to NSNull
-      [resultJSON setValue:[NSNull null] forKey:key];
-    } else if (!GTLR_AreEqualOrBothNil(originalValue, newValue)) {
-      // The values for this key differ
-      if ([originalValue isKindOfClass:[NSDictionary class]]
-          && [newValue isKindOfClass:[NSDictionary class]]) {
-        // Both are objects; recurse
-        NSMutableDictionary *subDict = [self patchDictionaryForJSON:newValue
-                                                   fromOriginalJSON:originalValue];
-        [resultJSON setValue:subDict forKey:key];
-      } else {
-        // They are non-object values; the new replaces the old. Per the
-        // documentation for patch, this replaces entire arrays.
-        [resultJSON setValue:newValue forKey:key];
-      }
-    } else {
-      // The values are the same; omit this key-value pair
-    }
-  }
-
-  // Iterate through keys present only in the new object, and add them to the
-  // result
-  NSMutableArray *newKeys = [NSMutableArray arrayWithArray:newJSON.allKeys];
-  [newKeys removeObjectsInArray:originalKeys];
-
-  for (NSString *key in newKeys) {
-    id value = [newJSON objectForKey:key];
-    [resultJSON setValue:value forKey:key];
-  }
-  return resultJSON;
-}
-
-+ (id)nullValue {
-  return [NSNull null];
-}
-
-#pragma mark Additional Properties
-
-- (id)additionalPropertyForName:(NSString *)name {
-  // Return the cached object, if any, before creating one.
-  id result = [self cacheChildForKey:name];
-  if (result != nil) {
-    return result;
-  }
-
-  Class defaultClass = [[self class] classForAdditionalProperties];
-  id jsonObj = [self JSONValueForKey:name];
-  BOOL shouldCache = NO;
-  if (jsonObj != nil) {
-    id<GTLRObjectClassResolver>objectClassResolver = self.objectClassResolver;
-    result = [GTLRRuntimeCommon objectFromJSON:jsonObj
-                                  defaultClass:defaultClass
-                           objectClassResolver:objectClassResolver
-                                   isCacheable:&shouldCache];
-  }
-
-  [self setCacheChild:(shouldCache ? result : nil)
-               forKey:name];
-  return result;
-}
-
-- (void)setAdditionalProperty:(id)obj forName:(NSString *)name {
-  BOOL shouldCache = NO;
-  Class defaultClass = [[self class] classForAdditionalProperties];
-  id json = [GTLRRuntimeCommon jsonFromAPIObject:obj
-                                   expectedClass:defaultClass
-                                     isCacheable:&shouldCache];
-  [self setJSONValue:json forKey:name];
-  [self setCacheChild:(shouldCache ? obj : nil)
-               forKey:name];
-}
-
-- (NSDictionary<NSString *, id> *)additionalProperties {
-  NSMutableDictionary *result = [NSMutableDictionary dictionary];
-
-  NSArray *propertyNames = [self additionalJSONKeys];
-  for (NSString *name in propertyNames) {
-    id obj = [self additionalPropertyForName:name];
-    [result setObject:obj forKey:name];
-  }
-
-  return result;
-}
-
-#pragma mark Child Cache methods
-
-// There is no property for _childCache as there shouldn't be KVC/KVO
-// support for it, it's an implementation detail.
-
-- (void)setCacheChild:(id)obj forKey:(NSString *)key {
-  if (_childCache == nil && obj != nil) {
-    _childCache = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
-                   obj, key, nil];
-  } else {
-    [_childCache setValue:obj forKey:key];
-  }
-}
-
-- (id)cacheChildForKey:(NSString *)key {
-  id obj = [_childCache objectForKey:key];
-  return obj;
-}
-
-#pragma mark Support methods
-
-+ (NSMutableArray *)allDeclaredProperties {
-  NSMutableArray *array = [NSMutableArray array];
-
-  // walk from this class up the hierarchy to GTLRObject
-  Class topClass = class_getSuperclass([GTLRObject class]);
-  for (Class currClass = self;
-       currClass != topClass;
-       currClass = class_getSuperclass(currClass)) {
-    // step through this class's properties, and add the property names to the
-    // array
-    objc_property_t *properties = class_copyPropertyList(currClass, NULL);
-    if (properties) {
-      for (objc_property_t *prop = properties;
-           *prop != NULL;
-           ++prop) {
-        const char *propName = property_getName(*prop);
-        // We only want dynamic properties; their attributes contain ",D".
-        const char *attr = property_getAttributes(*prop);
-        const char *dynamicMarker = strstr(attr, ",D");
-        if (dynamicMarker &&
-            (dynamicMarker[2] == 0 || dynamicMarker[2] == ',' )) {
-          [array addObject:(id _Nonnull)@(propName)];
-        }
-      }
-      free(properties);
-    }
-  }
-  return array;
-}
-
-+ (NSArray *)allKnownKeys {
-  NSArray *allProps = [self allDeclaredProperties];
-  NSMutableArray *knownKeys = [NSMutableArray arrayWithArray:allProps];
-
-  NSDictionary *propMap = [GTLRObject propertyToJSONKeyMapForClass:[self class]];
-
-  NSUInteger idx = 0;
-  for (NSString *propName in allProps) {
-    NSString *jsonKey = [propMap objectForKey:propName];
-    if (jsonKey) {
-      [knownKeys replaceObjectAtIndex:idx
-                           withObject:jsonKey];
-    }
-    ++idx;
-  }
-  return knownKeys;
-}
-
-- (NSString *)description {
-  NSString *jsonDesc = [self JSONDescription];
-
-  NSString *str = [NSString stringWithFormat:@"%@ %p: %@",
-                   [self class], self, jsonDesc];
-  return str;
-}
-
-// Internal utility for creating an appropriate description summary for the object's JSON.
-- (NSString *)JSONDescription {
-  // Find the list of declared and otherwise known JSON keys for this class.
-  NSArray *knownKeys = [[self class] allKnownKeys];
-
-  NSMutableString *descStr = [NSMutableString stringWithString:@"{"];
-
-  NSString *spacer = @"";
-  for (NSString *key in [[_json allKeys] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]) {
-    NSString *value = nil;
-    // show question mark for JSON keys not supported by a declared property:
-    //   foo?:"Hi mom."
-    NSString *qmark = [knownKeys containsObject:key] ? @"" : @"?";
-
-    // determine property value to dislay
-    id rawValue = [_json valueForKey:key];
-    if ([rawValue isKindOfClass:[NSDictionary class]]) {
-      // for dictionaries, show the list of keys:
-      //   {key1,key2,key3}
-      NSArray *subKeys = [((NSDictionary *)rawValue).allKeys sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
-      NSString *subkeyList = [subKeys componentsJoinedByString:@","];
-      value = [NSString stringWithFormat:@"{%@}", subkeyList];
-    } else if ([rawValue isKindOfClass:[NSArray class]]) {
-      // for arrays, show the number of items in the array:
-      //   [3]
-      value = [NSString stringWithFormat:@"[%lu]",
-               (unsigned long)((NSArray *)rawValue).count];
-    } else if ([rawValue isKindOfClass:[NSString class]]) {
-      // for strings, show the string in quotes:
-      //   "Hi mom."
-      value = [NSString stringWithFormat:@"\"%@\"", rawValue];
-    } else {
-      // for numbers, show just the number
-      value = [rawValue description];
-    }
-    [descStr appendFormat:@"%@%@%@:%@", spacer, key, qmark, value];
-    spacer = @" ";
-  }
-  [descStr appendString:@"}"];
-  return descStr;
-}
-
-#pragma mark Object Instantiation
-
-+ (GTLRObject *)objectForJSON:(NSMutableDictionary *)json
-                 defaultClass:(Class)defaultClass
-          objectClassResolver:(id<GTLRObjectClassResolver>)objectClassResolver {
-  if (((id)json == [NSNull null]) || json.count == 0) {
-    if (json != nil && defaultClass != Nil) {
-      // The JSON included an empty dictionary, just create the object.
-      Class classToCreate =
-        GTLRObjectResolveClass(objectClassResolver,
-                               [NSDictionary dictionary],
-                               defaultClass);
-      return [classToCreate object];
-    }
-    // No actual result, such as the response from a delete.
-    return nil;
-  }
-
-  if (defaultClass == Nil) {
-    defaultClass = self;
-  }
-
-  Class classToCreate =
-    GTLRObjectResolveClass(objectClassResolver, json, defaultClass);
-
-  // now instantiate the GTLRObject
-  GTLRObject *parsedObject = [classToCreate object];
-  parsedObject.objectClassResolver = objectClassResolver;
-  parsedObject.JSON = json;
-  return parsedObject;
-}
-
-#pragma mark Runtime Utilities
-
-static NSMutableDictionary *gJSONKeyMapCache = nil;
-static NSMutableDictionary *gArrayPropertyToClassMapCache = nil;
-
-+ (void)initialize {
-  // Note that initialize is guaranteed by the runtime to be called in a
-  // thread-safe manner
-  if (gJSONKeyMapCache == nil) {
-    gJSONKeyMapCache = [[NSMutableDictionary alloc] init];
-  }
-  if (gArrayPropertyToClassMapCache == nil) {
-    gArrayPropertyToClassMapCache = [[NSMutableDictionary alloc] init];
-  }
-}
-
-+ (NSDictionary *)propertyToJSONKeyMapForClass:(Class<GTLRRuntimeCommon>)aClass {
-  NSDictionary *resultMap =
-    [GTLRRuntimeCommon mergedClassDictionaryForSelector:@selector(propertyToJSONKeyMap)
-                                             startClass:aClass
-                                          ancestorClass:[GTLRObject class]
-                                                  cache:gJSONKeyMapCache];
-  return resultMap;
-}
-
-+ (NSDictionary *)arrayPropertyToClassMapForClass:(Class<GTLRRuntimeCommon>)aClass {
-  NSDictionary *resultMap =
-    [GTLRRuntimeCommon mergedClassDictionaryForSelector:@selector(arrayPropertyToClassMap)
-                                             startClass:aClass
-                                          ancestorClass:[GTLRObject class]
-                                                  cache:gArrayPropertyToClassMapCache];
-  return resultMap;
-}
-
-#pragma mark Runtime Support
-
-+ (Class<GTLRRuntimeCommon>)ancestorClass {
-  return [GTLRObject class];
-}
-
-+ (BOOL)resolveInstanceMethod:(SEL)sel {
-  BOOL resolved = [GTLRRuntimeCommon resolveInstanceMethod:sel onClass:self];
-  if (resolved)
-    return YES;
-
-  return [super resolveInstanceMethod:sel];
-}
-
-@end
-
-@implementation GTLRCollectionObject
-
-+ (NSString *)collectionItemsKey {
-  // GTLRCollectionObject fast enumeration, indexed access, and automatic pagination
-  // (when shouldFetchNextPages is enabled) applies to the object array property "items".
-  // The array property's key may be different if subclasses override this method.
-  return @"items";
-}
-
-- (id)objectAtIndexedSubscript:(NSUInteger)idx {
-  NSString *key = [[self class] collectionItemsKey];
-  NSArray *items = [self valueForKey:key];
-  if (items == nil) {
-    [NSException raise:NSRangeException
-                format:@"index %lu beyond bounds (%@ property \"%@\" is nil)",
-                       (unsigned long)idx, [self class], key];
-  }
-  id result = [items objectAtIndexedSubscript:idx];
-  return result;
-}
-
-// NSFastEnumeration protocol
-- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state
-                                  objects:(__unsafe_unretained id _Nonnull *)stackbuf
-                                    count:(NSUInteger)len {
-  NSString *key = [[self class] collectionItemsKey];
-  NSArray *items = [self valueForKey:key];
-  NSUInteger result = [items countByEnumeratingWithState:state
-                                                 objects:stackbuf
-                                                   count:len];
-  return result;
-}
-
-@end
-
-@implementation GTLRDataObject
-
-@synthesize data = _data,
-            contentType = _contentType;
-
-- (NSString *)description {
-  NSString *jsonDesc = @"";
-  if (self.JSON.count > 0) {
-    jsonDesc = [self JSONDescription];
-  }
-  return [NSString stringWithFormat:@"%@ %p: %lu bytes, contentType:%@ %@",
-          [self class], self, (unsigned long)self.data.length, self.contentType,
-          jsonDesc];
-}
-
-- (id)copyWithZone:(NSZone *)zone {
-  GTLRDataObject *newObj = [super copyWithZone:zone];
-  newObj.data = [self.data copy];
-  newObj.contentType = self.contentType;
-  return newObj;
-}
-
-@end
-
-@implementation GTLRResultArray
-
-- (NSArray *)itemsWithItemClass:(Class)itemClass {
-  // Return the cached array before creating on demand.
-  NSString *cacheKey = @"result_array_items";
-  NSMutableArray *cachedArray = [self cacheChildForKey:cacheKey];
-  if (cachedArray != nil) {
-    return cachedArray;
-  }
-  NSArray *result = nil;
-  NSArray *array = (NSArray *)self.JSON;
-  if (array != nil) {
-    if ([array isKindOfClass:[NSArray class]]) {
-      id<GTLRObjectClassResolver>objectClassResolver = self.objectClassResolver;
-      result = [GTLRRuntimeCommon objectFromJSON:array
-                                    defaultClass:itemClass
-                             objectClassResolver:objectClassResolver
-                                     isCacheable:NULL];
-    } else {
-#if DEBUG
-      if (![array isKindOfClass:[NSNull class]]) {
-        GTLR_DEBUG_LOG(@"GTLRObject: unexpected JSON: %@ should be an array, actually is a %@:\n%@",
-                       NSStringFromClass([self class]),
-                       NSStringFromClass([array class]),
-                       array);
-      }
-#endif
-      result = array;
-    }
-  }
-
-  [self setCacheChild:result forKey:cacheKey];
-  return result;
-}
-
-- (NSString *)JSONDescription {
-  // Just like GTLRObject's handing of arrays, just return the count.
-  return [NSString stringWithFormat:@"[%lu]", (unsigned long)self.JSON.count];
-}
-
-@end
-
-Class GTLRObjectResolveClass(
-    id<GTLRObjectClassResolver>objectClassResolver,
-    NSDictionary *json,
-    Class defaultClass) {
-  Class result = [objectClassResolver classForJSON:json
-                                      defaultClass:defaultClass];
-  if (result == Nil) {
-    result = defaultClass;
-  }
-  return result;
-}
-
-@implementation GTLRObjectClassResolver {
-  NSDictionary<NSString *, Class> *_kindToClassMap;
-  NSDictionary<Class, Class> *_surrogates;
-}
-
-+ (instancetype)resolverWithKindMap:(NSDictionary<NSString *, Class> *)kindStringToClassMap {
-  GTLRObjectClassResolver *result = [[self alloc] initWithKindMap:kindStringToClassMap
-                                                       surrogates:nil];
-  return result;
-}
-
-+ (instancetype)resolverWithKindMap:(NSDictionary<NSString *, Class> *)kindStringToClassMap
-                         surrogates:(NSDictionary<Class, Class> *)surrogates {
-  GTLRObjectClassResolver *result = [[self alloc] initWithKindMap:kindStringToClassMap
-                                                       surrogates:surrogates];
-  return result;
-}
-
-- (instancetype)initWithKindMap:(NSDictionary<NSString *, Class> *)kindStringToClassMap
-                     surrogates:(NSDictionary<Class, Class> *)surrogates {
-  self = [super init];
-  if (self) {
-    _kindToClassMap = [kindStringToClassMap copy];
-    _surrogates = [surrogates copy];
-  }
-  return self;
-}
-
-- (Class)classForJSON:(NSDictionary *)json
-         defaultClass:(Class)defaultClass {
-  Class result = defaultClass;
-
-  // Apply kind map.
-  BOOL shouldUseKind = (result == Nil) || [result isKindValidForClassRegistry];
-  if (shouldUseKind && [json isKindOfClass:[NSDictionary class]]) {
-    NSString *kind = [json valueForKey:@"kind"];
-    if ([kind isKindOfClass:[NSString class]] && kind.length > 0) {
-      Class dynamicClass = [_kindToClassMap objectForKey:kind];
-      if (dynamicClass) {
-        result = dynamicClass;
-      }
-    }
-  }
-
-  // Apply surrogate map.
-  Class surrogate = [_surrogates objectForKey:result];
-  if (surrogate) {
-    result = surrogate;
-  }
-
-  return result;
-}
-
-@end
-
-static NSMutableDictionary *DeepMutableCopyOfJSONDictionary(NSDictionary *initialJSON) {
-  if (!initialJSON) return nil;
-
-  NSMutableDictionary *result;
-  CFPropertyListRef ref = CFPropertyListCreateDeepCopy(kCFAllocatorDefault,
-                                                       (__bridge CFPropertyListRef)(initialJSON),
-                                                       kCFPropertyListMutableContainers);
-  if (ref) {
-    result = CFBridgingRelease(ref);
-  } else {
-    // Failed to copy, probably due to a non-plist type such as NSNull.
-    //
-    // As a fallback, round-trip through NSJSONSerialization.
-    NSError *serializationError;
-    NSData *data = [NSJSONSerialization dataWithJSONObject:initialJSON
-                                                   options:0
-                                                     error:&serializationError];
-    if (!data) {
-      GTLR_DEBUG_ASSERT(0, @"Copy failed due to serialization: %@\nJSON: %@",
-                        serializationError, initialJSON);
-    } else {
-      result = [NSJSONSerialization JSONObjectWithData:data
-                                                options:NSJSONReadingMutableContainers
-                                                  error:&serializationError];
-      GTLR_DEBUG_ASSERT(result != nil, @"Copy failed due to deserialization: %@\nJSON: %@",
-                        serializationError,
-                        [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);
-    }
-  }
-  return result;
-}

+ 0 - 252
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRQuery.h

@@ -1,252 +0,0 @@
-/* Copyright (c) 2011 Google Inc.
- *
- * 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.
- */
-
-// Query documentation:
-// https://github.com/google/google-api-objectivec-client-for-rest/blob/main/USING.md#query-operations
-
-#import "GTLRObject.h"
-#import "GTLRUploadParameters.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-@class GTLRServiceTicket;
-@class GTLRServiceExecutionParameters;
-
-/**
- * This protocol is just to support passing of either a batch or a single query
- * to a GTLRService instance. The library does not expect or support client app
- * implementations of this protocol.
- */
-@protocol GTLRQueryProtocol <NSObject, NSCopying>
-
-/**
- *  Service ticket values may be set in the execution parameters for an individual query
- *  prior to executing the query.
- */
-@property(atomic, strong, null_resettable) GTLRServiceExecutionParameters *executionParameters;
-
-- (BOOL)isBatchQuery;
-- (BOOL)hasExecutionParameters;
-- (BOOL)shouldSkipAuthorization;
-- (void)invalidateQuery;
-- (nullable NSDictionary<NSString *, NSString *> *)additionalHTTPHeaders;
-- (nullable NSDictionary<NSString *, NSString *> *)additionalURLQueryParameters;
-- (nullable NSString *)loggingName;
-- (nullable GTLRUploadParameters *)uploadParameters;
-
-@end
-
-@protocol GTLRQueryCollectionProtocol
-@optional
-@property(nonatomic, strong) NSString *pageToken;
-@end
-
-/**
- *  A block called when a query completes executing.
- *
- *  Errors passed to the completionBlock will have an "underlying" GTLRErrorObject
- *  when the server returned an error for this specific query:
- *
- *    GTLRErrorObject *errorObj = [GTLRErrorObject underlyingObjectForError:callbackError];
- *    if (errorObj) {
- *      // The server returned this error for this specific query.
- *    } else {
- *      // The query execution fetch failed.
- *    }
- *
- *  @param callbackTicket The ticket that tracked query execution.
- *  @param object         The result of query execution. This will be derived from
- *                        GTLRObject.
- *  @param callbackError  If non-nil, the query execution failed.
- */
-typedef void (^GTLRQueryCompletionBlock)(GTLRServiceTicket *callbackTicket,
-                                         id _Nullable object,
-                                         NSError * _Nullable callbackError);
-
-/**
- *  Class for a single query.
- */
-@interface GTLRQuery : NSObject <GTLRQueryProtocol, NSCopying>
-
-/**
- *  The object to be uploaded with the query. The JSON of this object becomes
- *  the body for PUT and POST requests.
- */
-@property(atomic, strong, nullable) GTLRObject *bodyObject;
-
-/**
- *  Each query must have a request ID string. The client app may replace the
- *  default assigned request ID with a custom string, provided that if
- *  used in a batch query, all request IDs in the batch must be unique.
- */
-@property(atomic, copy) NSString *requestID;
-
-/**
- *  For queries which support file upload, the MIME type and file URL
- *  or data must be provided.
- */
-@property(atomic, copy, nullable) GTLRUploadParameters *uploadParameters;
-
-/**
- *  Any additional URL query parameters for this query.
- *
- *  These query parameters override the same keys from the service object's
- *  additionalURLQueryParameters
- */
-@property(atomic, copy, nullable) NSDictionary<NSString *, NSString *> *additionalURLQueryParameters;
-
-/**
- *  Any additional HTTP headers for this query.
- *
- *  These headers override the same keys from the service object's additionalHTTPHeaders
- */
-@property(atomic, copy, nullable) NSDictionary<NSString *, NSString *> *additionalHTTPHeaders;
-
-/**
- *  If set, when the query is executed, an @c "alt" query parameter is added
- *  with this value and the raw result of the query is returned in a
- *  GTLRDataObject. This is useful when the server documents result datatypes
- *  other than JSON ("csv", for example).
- */
-@property(atomic, copy) NSString *downloadAsDataObjectType;
-
-/**
- * If set, and the query also has a non-empty @c downloadAsDataObjectType, the
- * URL to download from will be modified to include "download/". This extra path
- * component avoids the need for a server redirect to the download URL.
- */
-@property(atomic, assign) BOOL useMediaDownloadService;
-
-/**
- *  Clients may set this to YES to disallow authorization. Defaults to NO.
- */
-@property(atomic, assign) BOOL shouldSkipAuthorization;
-
-/**
- *  An optional callback block to be called immediately before the executeQuery: completion handler.
- *
- *  The completionBlock property is particularly useful for queries executed in a batch.
- */
-@property(atomic, copy, nullable) GTLRQueryCompletionBlock completionBlock;
-
-/**
- *  The brief string to identify this query in GTMSessionFetcher http logs.
- *
- *  A default logging name is set by the code generator, but may be overridden by the client app.
- */
-@property(atomic, copy, nullable) NSString *loggingName;
-
-#pragma mark Internal
-/////////////////////////////////////////////////////////////////////////////////////////////
-//
-// Properties below are used by the library and aren't typically needed by client apps.
-//
-/////////////////////////////////////////////////////////////////////////////////////////////
-
-/**
- *  The URITemplate path segment. This is initialized in by the service generator.
- */
-@property(atomic, readonly) NSString *pathURITemplate;
-
-/**
- *  The HTTP method to use for this query. This is initialized in by the service generator.
- */
-@property(atomic, readonly, nullable) NSString *httpMethod;
-
-/**
- *  The parameters names that are in the URI Template.
- *  This is initialized in by the service generator.
- *
- *  The service generator collects these via the discovery info instead of having to parse the
- *  template to figure out what is part of the path.
- */
-@property(atomic, readonly, nullable) NSArray<NSString *> *pathParameterNames;
-
-/**
- *  The JSON dictionary of all the parameters set on this query.
- *
- *  The JSON values are set by setting the query's properties.
- */
-@property(nonatomic, strong, nullable) NSMutableDictionary<NSString *, id> *JSON;
-
-/**
- *  A custom URI template for resumable uploads.  This is initialized by the service generator
- *  if needed.
- */
-@property(atomic, copy, nullable) NSString *resumableUploadPathURITemplateOverride;
-
-/**
- *  A custom URI template for simple and multipart media uploads.  This is initialized
- *  by the service generator.
- */
-@property(atomic, copy, nullable) NSString *simpleUploadPathURITemplateOverride;
-
-/**
- *  The GTLRObject subclass expected for results.  This is initialized by the service generator.
- *
- *  This is needed if the object returned by the server lacks a known "kind" string.
- */
-@property(atomic, assign, nullable) Class expectedObjectClass;
-
-/**
- *  Set when the query has been invalidated, meaning it was slated for execution so it's been copied
- *  and its callbacks were released, or it's a copy that has finished executing.
- *
- *  Once a query has been invalidated, it cannot be executed, added to a batch, or copied.
- */
-@property(atomic, assign, getter=isQueryInvalid) BOOL queryInvalid;
-
-/**
- *  Internal query init method.
- *
- *  @param pathURITemplate    URI template to be filled in with parameters.
- *  @param httpMethod         The requests's http method. A nil method will execute as GET.
- *  @param pathParameterNames Names of parameters to be replaced in the template.
- */
-- (instancetype)initWithPathURITemplate:(NSString *)pathURITemplate
-                             HTTPMethod:(nullable NSString *)httpMethod
-                     pathParameterNames:(nullable NSArray<NSString *> *)pathParameterNames NS_DESIGNATED_INITIALIZER;
-
-/**
- *  @return Auto-generated request ID string.
- */
-+ (NSString *)nextRequestID;
-
-/**
- *  Overridden by subclasses.
- *
- *  @return Substitute parameter names where needed for Objective-C or library compatibility.
- */
-+ (nullable NSDictionary<NSString *, NSString *> *)parameterNameMap;
-
-/**
- *  Overridden by subclasses.
- *
- *  @return Map of property keys to specifying the class of objects to be instantiated in arrays.
- */
-+ (nullable NSDictionary<NSString *, Class> *)arrayPropertyToClassMap;
-
-- (instancetype)init NS_UNAVAILABLE;
-
-@end
-
-/**
- *  The library doesn't use GTLRQueryCollectionImpl, but it provides a concrete implementation
- *  of the protocol so the methods do not cause private method errors in Xcode/AppStore review.
- */
-@interface GTLRQueryCollectionImpl : GTLRQuery <GTLRQueryCollectionProtocol>
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 0
PDF Office/PDF Master/Class/Home/NSObject/Services/GTLRClass/GTLRQuery.m


Some files were not shown because too many files changed in this diff