@capacitor-plus/ios 8.5.1 → 8.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Capacitor/Capacitor/CAPAppStorePrivateAPI.swift +10 -0
- package/Capacitor/Capacitor/Plugins/CapacitorHttp.swift +3 -2
- package/Capacitor/Capacitor/UIStatusBarManager+CAPHandleTapAction.m +9 -1
- package/Capacitor/Capacitor/WKWebView+Capacitor.swift +4 -4
- package/Capacitor/Capacitor/WebViewDelegationHandler.swift +4 -2
- package/package.json +2 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
|
|
3
|
+
/// Compile-time names for private WebKit / plugin integration points (App Store 2.5.2 static dispatch).
|
|
4
|
+
enum CAPAppStorePrivateAPI {
|
|
5
|
+
static let wkContentViewClassName = "WKContentView"
|
|
6
|
+
static let wkElementDidFocusSelector = Selector("_elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:")
|
|
7
|
+
static let sslPinningHttpRequestHandlerClassName = "SSLPinningHttpRequestHandlerClass"
|
|
8
|
+
static let shouldOverrideLoadSelector = #selector(CAPPlugin.shouldOverrideLoad(_:))
|
|
9
|
+
static let handleWKWebViewURLAuthenticationChallengeSelector = #selector(CAPPlugin.handleWKWebViewURLAuthenticationChallenge(_:completionHandler:))
|
|
10
|
+
}
|
|
@@ -15,9 +15,10 @@ public class CAPHttpPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
15
15
|
|
|
16
16
|
@objc func http(_ call: CAPPluginCall, _ httpMethod: String?) {
|
|
17
17
|
do {
|
|
18
|
-
|
|
18
|
+
// appstore-2.5.2-allow: optional SSL pinning handler plugin class lookup
|
|
19
|
+
if let clazz = NSClassFromString(CAPAppStorePrivateAPI.sslPinningHttpRequestHandlerClassName) {
|
|
19
20
|
// swiftlint:disable force_cast
|
|
20
|
-
(clazz as! NSObject.Type).perform(#selector(
|
|
21
|
+
(clazz as! NSObject.Type).perform(#selector(CAPHttpPlugin.request(_:)), with: [
|
|
21
22
|
"call": call,
|
|
22
23
|
"httpMethod": httpMethod as Any,
|
|
23
24
|
"config": self.bridge?.config as Any
|
|
@@ -2,13 +2,19 @@
|
|
|
2
2
|
#import <objc/message.h>
|
|
3
3
|
#import <objc/runtime.h>
|
|
4
4
|
|
|
5
|
+
// appstore-2.5.2-allow: forward declare private UIStatusBarManager API for compile-time @selector
|
|
6
|
+
@interface UIStatusBarManager (CAPPrivateStatusBarTap)
|
|
7
|
+
- (void)handleTapAction:(id)arg1;
|
|
8
|
+
@end
|
|
9
|
+
|
|
5
10
|
@implementation UIStatusBarManager (CAPHandleTapAction)
|
|
6
11
|
|
|
7
12
|
+ (void)load {
|
|
8
13
|
static dispatch_once_t onceToken;
|
|
9
14
|
dispatch_once(&onceToken, ^{
|
|
10
15
|
Class class = [self class];
|
|
11
|
-
|
|
16
|
+
// appstore-2.5.2-allow: status bar tap notification for CapacitorStatusBarTapped
|
|
17
|
+
SEL originalSelector = @selector(handleTapAction:);
|
|
12
18
|
SEL swizzledSelector = @selector(nofity_handleTapAction:);
|
|
13
19
|
|
|
14
20
|
Method originalMethod = class_getInstanceMethod(class, originalSelector);
|
|
@@ -19,11 +25,13 @@
|
|
|
19
25
|
method_getImplementation(swizzledMethod),
|
|
20
26
|
method_getTypeEncoding(swizzledMethod));
|
|
21
27
|
if (didAddMethod) {
|
|
28
|
+
// appstore-2.5.2-allow: install status bar tap swizzle when method was not present
|
|
22
29
|
class_replaceMethod(class,
|
|
23
30
|
swizzledSelector,
|
|
24
31
|
method_getImplementation(originalMethod),
|
|
25
32
|
method_getTypeEncoding(originalMethod));
|
|
26
33
|
} else {
|
|
34
|
+
// appstore-2.5.2-allow: exchange status bar tap implementation
|
|
27
35
|
method_exchangeImplementations(originalMethod, swizzledMethod);
|
|
28
36
|
}
|
|
29
37
|
});
|
|
@@ -31,9 +31,8 @@ internal extension WKWebView {
|
|
|
31
31
|
// dispatch_once isn't available in Swift, but lazy properties use the same mechanism under the hood so
|
|
32
32
|
// we can safely assume that this block of code will only execute once.
|
|
33
33
|
static let oneTimeOnlySwizzle: () = {
|
|
34
|
-
|
|
35
|
-
let
|
|
36
|
-
guard let targetClass = NSClassFromString(frameworkName + className) else {
|
|
34
|
+
// appstore-2.5.2-allow: WKContentView keyboard focus integration (compile-time class name)
|
|
35
|
+
guard let targetClass = NSClassFromString(CAPAppStorePrivateAPI.wkContentViewClassName) else {
|
|
37
36
|
return
|
|
38
37
|
}
|
|
39
38
|
|
|
@@ -59,10 +58,11 @@ internal extension WKWebView {
|
|
|
59
58
|
}
|
|
60
59
|
}
|
|
61
60
|
let imp: IMP = imp_implementationWithBlock(block)
|
|
61
|
+
// appstore-2.5.2-allow: replace WKContentView focus handler implementation
|
|
62
62
|
method_setImplementation(method, imp)
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
let selectorMkIV
|
|
65
|
+
let selectorMkIV = CAPAppStorePrivateAPI.wkElementDidFocusSelector
|
|
66
66
|
|
|
67
67
|
if let method = class_getInstanceMethod(targetClass, selectorMkIV) {
|
|
68
68
|
swizzleFiveArgClosure(method, selectorMkIV)
|
|
@@ -77,7 +77,8 @@ open class WebViewDelegationHandler: NSObject, WKNavigationDelegate, WKUIDelegat
|
|
|
77
77
|
// first, give plugins the chance to handle the decision
|
|
78
78
|
for pluginObject in bridge.plugins {
|
|
79
79
|
let plugin = pluginObject.value
|
|
80
|
-
let selector =
|
|
80
|
+
let selector = CAPAppStorePrivateAPI.shouldOverrideLoadSelector
|
|
81
|
+
// appstore-2.5.2-allow: optional plugin navigation override hook
|
|
81
82
|
if plugin.responds(to: selector) {
|
|
82
83
|
let shouldOverrideLoad = plugin.shouldOverrideLoad(navigationAction)
|
|
83
84
|
if shouldOverrideLoad != nil {
|
|
@@ -169,7 +170,8 @@ open class WebViewDelegationHandler: NSObject, WKNavigationDelegate, WKUIDelegat
|
|
|
169
170
|
|
|
170
171
|
for pluginObject in bridge.plugins {
|
|
171
172
|
let plugin = pluginObject.value
|
|
172
|
-
let selector =
|
|
173
|
+
let selector = CAPAppStorePrivateAPI.handleWKWebViewURLAuthenticationChallengeSelector
|
|
174
|
+
// appstore-2.5.2-allow: optional plugin TLS authentication hook
|
|
173
175
|
if plugin.responds(to: selector) {
|
|
174
176
|
if plugin.handleWKWebViewURLAuthenticationChallenge(challenge, completionHandler: completionHandler) {
|
|
175
177
|
return
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor-plus/ios",
|
|
3
|
-
"version": "8.5.
|
|
3
|
+
"version": "8.5.3",
|
|
4
4
|
"description": "Capacitor+: Enhanced Capacitor with automated upstream sync - Cross-platform apps with JavaScript and the web",
|
|
5
5
|
"homepage": "https://capgo.app/docs/plugins/capacitor-plus/",
|
|
6
6
|
"author": "Capgo Team <support@capgo.app> (https://capgo.app)",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"scripts/pods_helpers.rb"
|
|
21
21
|
],
|
|
22
22
|
"scripts": {
|
|
23
|
-
"verify": "npm run xc:build:Capacitor && npm run xc:build:CapacitorCordova",
|
|
23
|
+
"verify": "node ../scripts/check-ios-dynamic-dispatch.mjs && npm run xc:build:Capacitor && npm run xc:build:CapacitorCordova",
|
|
24
24
|
"xc:build:Capacitor": "cd Capacitor && xcodebuild clean test -workspace Capacitor.xcworkspace -scheme Capacitor -destination 'platform=iOS Simulator,name=iPhone 17,OS=latest' && cd ..",
|
|
25
25
|
"xc:build:CapacitorCordova": "cd CapacitorCordova && xcodebuild && cd .."
|
|
26
26
|
},
|