├── .DS_Store ├── Example ├── Podfile ├── Podfile.lock ├── Pods │ ├── Local Podspecs │ │ └── WKJavaScriptBridge.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ ├── project.pbxproj │ │ └── xcuserdata │ │ │ └── wangkai.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── Pods-WKJavaScriptBridge_Example.xcscheme │ │ │ ├── Pods-WKJavaScriptBridge_Tests.xcscheme │ │ │ ├── WKJavaScriptBridge.xcscheme │ │ │ └── xcschememanagement.plist │ └── Target Support Files │ │ ├── Pods-WKJavaScriptBridge_Example │ │ ├── Pods-WKJavaScriptBridge_Example-Info.plist │ │ ├── Pods-WKJavaScriptBridge_Example-acknowledgements.markdown │ │ ├── Pods-WKJavaScriptBridge_Example-acknowledgements.plist │ │ ├── Pods-WKJavaScriptBridge_Example-dummy.m │ │ ├── Pods-WKJavaScriptBridge_Example-frameworks.sh │ │ ├── Pods-WKJavaScriptBridge_Example-umbrella.h │ │ ├── Pods-WKJavaScriptBridge_Example.debug.xcconfig │ │ ├── Pods-WKJavaScriptBridge_Example.modulemap │ │ └── Pods-WKJavaScriptBridge_Example.release.xcconfig │ │ ├── Pods-WKJavaScriptBridge_Tests │ │ ├── Pods-WKJavaScriptBridge_Tests-Info.plist │ │ ├── Pods-WKJavaScriptBridge_Tests-acknowledgements.markdown │ │ ├── Pods-WKJavaScriptBridge_Tests-acknowledgements.plist │ │ ├── Pods-WKJavaScriptBridge_Tests-dummy.m │ │ ├── Pods-WKJavaScriptBridge_Tests-umbrella.h │ │ ├── Pods-WKJavaScriptBridge_Tests.debug.xcconfig │ │ ├── Pods-WKJavaScriptBridge_Tests.modulemap │ │ └── Pods-WKJavaScriptBridge_Tests.release.xcconfig │ │ └── WKJavaScriptBridge │ │ ├── WKJavaScriptBridge-Info.plist │ │ ├── WKJavaScriptBridge-dummy.m │ │ ├── WKJavaScriptBridge-prefix.pch │ │ ├── WKJavaScriptBridge-umbrella.h │ │ ├── WKJavaScriptBridge.debug.xcconfig │ │ ├── WKJavaScriptBridge.modulemap │ │ └── WKJavaScriptBridge.release.xcconfig ├── Tests │ ├── Tests-Info.plist │ ├── Tests-Prefix.pch │ ├── Tests.m │ └── en.lproj │ │ └── InfoPlist.strings ├── WKJavaScriptBridge.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── WKJavaScriptBridge-Example.xcscheme ├── WKJavaScriptBridge.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── wangkai.xcuserdatad │ │ ├── UserInterfaceState.xcuserstate │ │ └── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist └── WKJavaScriptBridge │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── NativePlugin │ ├── Security │ │ ├── TestSecurityPlugin.h │ │ ├── TestSecurityPlugin.m │ │ └── TestWebPluginSecurityConfig.h │ ├── TestPlugin.h │ ├── TestPlugin.m │ ├── WKCommonPlugin.h │ └── WKCommonPlugin.m │ ├── WKAppDelegate.h │ ├── WKAppDelegate.m │ ├── WKJSBridge.js │ ├── WKJavaScriptBridge-Info.plist │ ├── WKJavaScriptBridge-Prefix.pch │ ├── WKViewController.h │ ├── WKViewController.m │ ├── en.lproj │ └── InfoPlist.strings │ ├── index.html │ └── main.m ├── LICENSE ├── README.md ├── WKJavaScriptBridge.podspec ├── WKJavaScriptBridge ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ ├── Dispatcher │ ├── WKJavaScriptMessageDispatcher.h │ ├── WKJavaScriptMessageDispatcher.m │ ├── WKMsgCommand.h │ └── WKMsgCommand.m │ ├── Plugin │ ├── WKBasePlugin.h │ ├── WKBasePlugin.m │ ├── WKCommandImpl.h │ ├── WKCommandImpl.m │ ├── WKCommandProtocol.h │ ├── WKPluginProtocol.h │ ├── WKPluginResult.h │ └── WKPluginResult.m │ ├── Security │ ├── WKJavaScriptBridgePluginAnnotation.h │ ├── WKJavaScriptBridgePluginAnnotation.m │ └── WKPluginSecurityProtocol.h │ ├── Util │ ├── NSString+BridgeJSONPrivate.h │ ├── NSString+BridgeJSONPrivate.m │ ├── WKWeakScriptMessageHandlerDelegate.h │ └── WKWeakScriptMessageHandlerDelegate.m │ ├── WKJavaScriptBridge.h │ ├── WKJavaScriptBridge.m │ └── WKJavaScriptBridgeProtocol.h └── _Pods.xcodeproj /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/illusionspaces/WKJavaScriptBridge/54972b09d7ef602d77e6c3be23253ff81a189461/.DS_Store -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | 3 | platform :ios, '8.0' 4 | 5 | target 'WKJavaScriptBridge_Example' do 6 | pod 'WKJavaScriptBridge', :path => '../' 7 | 8 | target 'WKJavaScriptBridge_Tests' do 9 | inherit! :search_paths 10 | 11 | 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - WKJavaScriptBridge (0.1.0) 3 | 4 | DEPENDENCIES: 5 | - WKJavaScriptBridge (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | WKJavaScriptBridge: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | WKJavaScriptBridge: 002bd91f9541b23acba79c0c02345b0a8015e2b9 13 | 14 | PODFILE CHECKSUM: 7a8764f9ffcd97bedaf15694e9b25cdbdc128802 15 | 16 | COCOAPODS: 1.9.3 17 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/WKJavaScriptBridge.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "WKJavaScriptBridge", 3 | "version": "0.1.0", 4 | "summary": "A short description of WKJavaScriptBridge.", 5 | "description": "TODO: Add long description of the pod here.", 6 | "homepage": "https://github.com/GitWangKai/WKJavaScriptBridge", 7 | "license": { 8 | "type": "MIT", 9 | "file": "LICENSE" 10 | }, 11 | "authors": { 12 | "GitWangKai": "18500052382@163.com" 13 | }, 14 | "source": { 15 | "git": "https://github.com/GitWangKai/WKJavaScriptBridge.git", 16 | "tag": "0.1.0" 17 | }, 18 | "platforms": { 19 | "ios": "8.0" 20 | }, 21 | "source_files": "WKJavaScriptBridge/Classes/**/*" 22 | } 23 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - WKJavaScriptBridge (0.1.0) 3 | 4 | DEPENDENCIES: 5 | - WKJavaScriptBridge (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | WKJavaScriptBridge: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | WKJavaScriptBridge: 002bd91f9541b23acba79c0c02345b0a8015e2b9 13 | 14 | PODFILE CHECKSUM: 7a8764f9ffcd97bedaf15694e9b25cdbdc128802 15 | 16 | COCOAPODS: 1.9.3 17 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1214D8B1397FDFC7C68FA8FFB50530F4 /* Pods-WKJavaScriptBridge_Tests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = D0E106D87E4CA4077C0CCE709CE9EFCB /* Pods-WKJavaScriptBridge_Tests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | 1293AB8E8EB7A50E0E88A919E0DDDBFD /* NSString+BridgeJSONPrivate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13A78970988CA4F36A81329A9E972779 /* NSString+BridgeJSONPrivate.m */; }; 12 | 171DC50A236E09A8132C0B4C673D5F77 /* WKJavaScriptMessageDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 57F5480989137A1F843A39ABB204B7B7 /* WKJavaScriptMessageDispatcher.h */; settings = {ATTRIBUTES = (Public, ); }; }; 13 | 1D8253259DF2B6E2F0082CB663D3A041 /* WKJavaScriptBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E2C1968BB5BE0E59527E5A25FE29695 /* WKJavaScriptBridge.h */; settings = {ATTRIBUTES = (Public, ); }; }; 14 | 22D385E2DE1BAF7BCEE1B21EA43E451E /* NSString+BridgeJSONPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C9DDA9B68DBF1D38648A3D03CDA3A23 /* NSString+BridgeJSONPrivate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 15 | 2D41138DF9056CC39D030EDF28F05B6C /* WKJavaScriptBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = B1DC064D1CD4B1FB28A728AACF0FB75B /* WKJavaScriptBridge.m */; }; 16 | 3717D3C7A0B4ACC4D2A5062FD4CAF313 /* WKPluginResult.h in Headers */ = {isa = PBXBuildFile; fileRef = AEED66C6B14667D29D84B1294277C104 /* WKPluginResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; 17 | 3F31EE627449D5D691D5CC305AF9747A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3212113385A8FBBDB272BD23C409FF61 /* Foundation.framework */; }; 18 | 512B3EC0F988071A7671DD911723915F /* WKPluginResult.m in Sources */ = {isa = PBXBuildFile; fileRef = EA0A314C2063666AE3721D0A1C08A3BB /* WKPluginResult.m */; }; 19 | 51EC404A49947A5F1AD8EF9D8E248162 /* WKJavaScriptBridgePluginAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 4342E9F0CAF4E883E1B3EF0CD878E570 /* WKJavaScriptBridgePluginAnnotation.m */; }; 20 | 7222B424A724F9A62B1FE9A57A9AD967 /* WKPluginProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E9C5305656A340CA612DC00B409CB98 /* WKPluginProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; 21 | 7AED8BA97CB70766F574CD0C7513BB7C /* WKPluginSecurityProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 047C2E5FFE9EB6B8CBEF2A5881FDCEDA /* WKPluginSecurityProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; 22 | 83CE0F66AF2019A73B9242B96A3464CD /* WKCommandProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 32E02F3B0D69A23F1383711218528E0E /* WKCommandProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; 23 | 86EDF8A10C77F57FECEDE7F2138A8A5D /* WKJavaScriptBridge-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 09D49AA3ED3F4916C06CFAA153E114FF /* WKJavaScriptBridge-dummy.m */; }; 24 | 8B09A5F3B4704F865A363F6768964404 /* WKCommandImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = A2BEB5F6A9C161F963477CF238F93085 /* WKCommandImpl.h */; settings = {ATTRIBUTES = (Public, ); }; }; 25 | 8BEA8DFD94F03CD93F74545ADA8A52F2 /* WKJavaScriptBridgeProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = E6908A76FA49546874C3D68ADA9AA819 /* WKJavaScriptBridgeProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; 26 | 90A96B7A3F7A83BC37DBB7664798B620 /* WKJavaScriptBridge-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = C03D8F11A8C5BB7779925D6445FDB946 /* WKJavaScriptBridge-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 27 | 9A3EDDA49A04314A4EF4BA54AEA2419C /* Pods-WKJavaScriptBridge_Example-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 774A8A3926BCB3417C031CE14D3A5360 /* Pods-WKJavaScriptBridge_Example-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 28 | 9A991564D9A8F72EB40DDE3E027D848F /* WKMsgCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 14FB98A3715A8001CF83F96A6FC9905D /* WKMsgCommand.h */; settings = {ATTRIBUTES = (Public, ); }; }; 29 | B5CE477ED9D7579D378A9129160D2644 /* WKJavaScriptMessageDispatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = CC0AED92072FEE10655B3BBA742CB5CC /* WKJavaScriptMessageDispatcher.m */; }; 30 | B7C38F09FD332390AC6481A0ABEDAA69 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3212113385A8FBBDB272BD23C409FF61 /* Foundation.framework */; }; 31 | C25C0067D7EFB1A3D14518CEAA1FB048 /* WKBasePlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = F8C0A2AB178663D683E3DEAFB44F2F5B /* WKBasePlugin.h */; settings = {ATTRIBUTES = (Public, ); }; }; 32 | CF862D7D785F63AF909827ED6B00412A /* Pods-WKJavaScriptBridge_Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 710D65D9911916E575F5438DB13F6B03 /* Pods-WKJavaScriptBridge_Example-dummy.m */; }; 33 | D0C2A8753E68E6269A8FEBF342BE887D /* WKMsgCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 189E03A538517E791BA53A68C0142FEB /* WKMsgCommand.m */; }; 34 | DB5513079EBA66F6A8FAEEBEB7CFDA25 /* WKCommandImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 11872520D0F6BA1530F9F1323EDD9C93 /* WKCommandImpl.m */; }; 35 | E08B4DFEFC8D967A20D1CE0D379A2E0F /* Pods-WKJavaScriptBridge_Tests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = E8ABB81DF77B1BB5E92E6087E819D586 /* Pods-WKJavaScriptBridge_Tests-dummy.m */; }; 36 | F21D8143049F09FE7398C17FD21458EA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3212113385A8FBBDB272BD23C409FF61 /* Foundation.framework */; }; 37 | F33FEC77ED342948EA13A1F2E9BBEE9D /* WKJavaScriptBridgePluginAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = B00A422083F80D1D46F925A23DE8C6D6 /* WKJavaScriptBridgePluginAnnotation.h */; settings = {ATTRIBUTES = (Public, ); }; }; 38 | F9EAB73FF36E7D4708BAFB80A69F678A /* WKBasePlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = B71FF397D168F81B7C193881EC5546F9 /* WKBasePlugin.m */; }; 39 | FA739C948D5327E2B7C2CDB6375F399E /* WKWeakScriptMessageHandlerDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8661BBF543DAA0FFB45C16BA2A62A27E /* WKWeakScriptMessageHandlerDelegate.m */; }; 40 | FC788FFE91D6FA1861159BD3D0DB7B0A /* WKWeakScriptMessageHandlerDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 23E54793889C168FA3246C5BD1DCEBA0 /* WKWeakScriptMessageHandlerDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 41 | /* End PBXBuildFile section */ 42 | 43 | /* Begin PBXContainerItemProxy section */ 44 | 2E3A604F7A0CCAF6CFC2C58772DE835A /* PBXContainerItemProxy */ = { 45 | isa = PBXContainerItemProxy; 46 | containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; 47 | proxyType = 1; 48 | remoteGlobalIDString = 883FE4A98A39F65560738FF8ACC95D71; 49 | remoteInfo = "Pods-WKJavaScriptBridge_Example"; 50 | }; 51 | D5AD4AF2B33A181549ECC1C9E9D2C679 /* PBXContainerItemProxy */ = { 52 | isa = PBXContainerItemProxy; 53 | containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; 54 | proxyType = 1; 55 | remoteGlobalIDString = 8F8347086F8B20856E52922A9A74248D; 56 | remoteInfo = WKJavaScriptBridge; 57 | }; 58 | /* End PBXContainerItemProxy section */ 59 | 60 | /* Begin PBXFileReference section */ 61 | 047C2E5FFE9EB6B8CBEF2A5881FDCEDA /* WKPluginSecurityProtocol.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = WKPluginSecurityProtocol.h; sourceTree = ""; }; 62 | 09D49AA3ED3F4916C06CFAA153E114FF /* WKJavaScriptBridge-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "WKJavaScriptBridge-dummy.m"; sourceTree = ""; }; 63 | 0AB5A7C657210B3AABD198F5077B679C /* Pods_WKJavaScriptBridge_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_WKJavaScriptBridge_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 64 | 11872520D0F6BA1530F9F1323EDD9C93 /* WKCommandImpl.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = WKCommandImpl.m; sourceTree = ""; }; 65 | 13A78970988CA4F36A81329A9E972779 /* NSString+BridgeJSONPrivate.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "NSString+BridgeJSONPrivate.m"; sourceTree = ""; }; 66 | 14FB98A3715A8001CF83F96A6FC9905D /* WKMsgCommand.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = WKMsgCommand.h; sourceTree = ""; }; 67 | 1558DF69E71932C3C188D12669EB7F9A /* Pods-WKJavaScriptBridge_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-WKJavaScriptBridge_Tests.debug.xcconfig"; sourceTree = ""; }; 68 | 189E03A538517E791BA53A68C0142FEB /* WKMsgCommand.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = WKMsgCommand.m; sourceTree = ""; }; 69 | 23E54793889C168FA3246C5BD1DCEBA0 /* WKWeakScriptMessageHandlerDelegate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = WKWeakScriptMessageHandlerDelegate.h; sourceTree = ""; }; 70 | 2E497486D5B1997976CEBF772818DA49 /* WKJavaScriptBridge.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WKJavaScriptBridge.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 71 | 301FAB3A4368C3A3C2AD4B4C1322098D /* Pods-WKJavaScriptBridge_Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-WKJavaScriptBridge_Example-acknowledgements.plist"; sourceTree = ""; }; 72 | 31C031B651BCD53DC4CC88E15C6E6B40 /* Pods-WKJavaScriptBridge_Tests-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-WKJavaScriptBridge_Tests-Info.plist"; sourceTree = ""; }; 73 | 3212113385A8FBBDB272BD23C409FF61 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; 74 | 32E02F3B0D69A23F1383711218528E0E /* WKCommandProtocol.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = WKCommandProtocol.h; sourceTree = ""; }; 75 | 33A01A89445811495F46D66F82FC6B09 /* Pods-WKJavaScriptBridge_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-WKJavaScriptBridge_Tests.release.xcconfig"; sourceTree = ""; }; 76 | 38CA62BAB103D9DC9F68FB242E185A1E /* WKJavaScriptBridge.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = WKJavaScriptBridge.release.xcconfig; sourceTree = ""; }; 77 | 40A403073A77DD168268371A1976EFEC /* WKJavaScriptBridge-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "WKJavaScriptBridge-Info.plist"; sourceTree = ""; }; 78 | 4342E9F0CAF4E883E1B3EF0CD878E570 /* WKJavaScriptBridgePluginAnnotation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = WKJavaScriptBridgePluginAnnotation.m; sourceTree = ""; }; 79 | 4C63C3A44C45DA722C3C6A08B3BA5957 /* Pods-WKJavaScriptBridge_Tests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-WKJavaScriptBridge_Tests.modulemap"; sourceTree = ""; }; 80 | 51F1C41DAFF76B6A011C7B789AF6C36B /* WKJavaScriptBridge-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "WKJavaScriptBridge-prefix.pch"; sourceTree = ""; }; 81 | 54A03357C4B6319334F90C606F701E18 /* WKJavaScriptBridge.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; path = WKJavaScriptBridge.podspec; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 82 | 57F5480989137A1F843A39ABB204B7B7 /* WKJavaScriptMessageDispatcher.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = WKJavaScriptMessageDispatcher.h; sourceTree = ""; }; 83 | 5C9DDA9B68DBF1D38648A3D03CDA3A23 /* NSString+BridgeJSONPrivate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "NSString+BridgeJSONPrivate.h"; sourceTree = ""; }; 84 | 68ACD6FE7A95E5569C01F672A4B40D92 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 85 | 70EDE9F2D19F96B938CDAB814617DE74 /* Pods-WKJavaScriptBridge_Example-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-WKJavaScriptBridge_Example-Info.plist"; sourceTree = ""; }; 86 | 710D65D9911916E575F5438DB13F6B03 /* Pods-WKJavaScriptBridge_Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-WKJavaScriptBridge_Example-dummy.m"; sourceTree = ""; }; 87 | 774A8A3926BCB3417C031CE14D3A5360 /* Pods-WKJavaScriptBridge_Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-WKJavaScriptBridge_Example-umbrella.h"; sourceTree = ""; }; 88 | 7E2C1968BB5BE0E59527E5A25FE29695 /* WKJavaScriptBridge.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = WKJavaScriptBridge.h; path = WKJavaScriptBridge/Classes/WKJavaScriptBridge.h; sourceTree = ""; }; 89 | 834721C590C379A46A40ADBE82C4F15F /* Pods-WKJavaScriptBridge_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-WKJavaScriptBridge_Example.release.xcconfig"; sourceTree = ""; }; 90 | 8661BBF543DAA0FFB45C16BA2A62A27E /* WKWeakScriptMessageHandlerDelegate.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = WKWeakScriptMessageHandlerDelegate.m; sourceTree = ""; }; 91 | 8E9C5305656A340CA612DC00B409CB98 /* WKPluginProtocol.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = WKPluginProtocol.h; sourceTree = ""; }; 92 | 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 93 | A2BEB5F6A9C161F963477CF238F93085 /* WKCommandImpl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = WKCommandImpl.h; sourceTree = ""; }; 94 | A374EBE5CEE67BA43677B57A871EE9D4 /* Pods-WKJavaScriptBridge_Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-WKJavaScriptBridge_Example-frameworks.sh"; sourceTree = ""; }; 95 | A5F98B8E9357C9C1AACD2E07A72155FF /* WKJavaScriptBridge.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = WKJavaScriptBridge.debug.xcconfig; sourceTree = ""; }; 96 | A8210C3C7F352271AF9E1743C12D05EC /* Pods-WKJavaScriptBridge_Tests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-WKJavaScriptBridge_Tests-acknowledgements.plist"; sourceTree = ""; }; 97 | AEED66C6B14667D29D84B1294277C104 /* WKPluginResult.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = WKPluginResult.h; sourceTree = ""; }; 98 | B00A422083F80D1D46F925A23DE8C6D6 /* WKJavaScriptBridgePluginAnnotation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = WKJavaScriptBridgePluginAnnotation.h; sourceTree = ""; }; 99 | B1DC064D1CD4B1FB28A728AACF0FB75B /* WKJavaScriptBridge.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = WKJavaScriptBridge.m; path = WKJavaScriptBridge/Classes/WKJavaScriptBridge.m; sourceTree = ""; }; 100 | B4F8C3C490631E0B1EBC6EE9A0AFB053 /* Pods-WKJavaScriptBridge_Tests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-WKJavaScriptBridge_Tests-acknowledgements.markdown"; sourceTree = ""; }; 101 | B71FF397D168F81B7C193881EC5546F9 /* WKBasePlugin.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = WKBasePlugin.m; sourceTree = ""; }; 102 | BEE7AA5F42761CAE8BABAFAF34B582DB /* WKJavaScriptBridge.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = WKJavaScriptBridge.modulemap; sourceTree = ""; }; 103 | C03D8F11A8C5BB7779925D6445FDB946 /* WKJavaScriptBridge-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "WKJavaScriptBridge-umbrella.h"; sourceTree = ""; }; 104 | CA783533AC1F3556251D34C07F048287 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; 105 | CC0AED92072FEE10655B3BBA742CB5CC /* WKJavaScriptMessageDispatcher.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = WKJavaScriptMessageDispatcher.m; sourceTree = ""; }; 106 | D0E106D87E4CA4077C0CCE709CE9EFCB /* Pods-WKJavaScriptBridge_Tests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-WKJavaScriptBridge_Tests-umbrella.h"; sourceTree = ""; }; 107 | D5F895E0793700E5AF2EFE043A921DAA /* Pods-WKJavaScriptBridge_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-WKJavaScriptBridge_Example.debug.xcconfig"; sourceTree = ""; }; 108 | E2AE7FCD6E1BEBFC47748F31A33301F3 /* Pods-WKJavaScriptBridge_Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-WKJavaScriptBridge_Example-acknowledgements.markdown"; sourceTree = ""; }; 109 | E6908A76FA49546874C3D68ADA9AA819 /* WKJavaScriptBridgeProtocol.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = WKJavaScriptBridgeProtocol.h; path = WKJavaScriptBridge/Classes/WKJavaScriptBridgeProtocol.h; sourceTree = ""; }; 110 | E8ABB81DF77B1BB5E92E6087E819D586 /* Pods-WKJavaScriptBridge_Tests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-WKJavaScriptBridge_Tests-dummy.m"; sourceTree = ""; }; 111 | EA0A314C2063666AE3721D0A1C08A3BB /* WKPluginResult.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = WKPluginResult.m; sourceTree = ""; }; 112 | F4963E2EFFAAA15D91F010AD781B1684 /* Pods-WKJavaScriptBridge_Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-WKJavaScriptBridge_Example.modulemap"; sourceTree = ""; }; 113 | F8C0A2AB178663D683E3DEAFB44F2F5B /* WKBasePlugin.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = WKBasePlugin.h; sourceTree = ""; }; 114 | FC5F691569AFE0EFF406546F7B6F471A /* Pods_WKJavaScriptBridge_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_WKJavaScriptBridge_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 115 | /* End PBXFileReference section */ 116 | 117 | /* Begin PBXFrameworksBuildPhase section */ 118 | 00FDDD0BE9B6BF383866056C6F1DEFEF /* Frameworks */ = { 119 | isa = PBXFrameworksBuildPhase; 120 | buildActionMask = 2147483647; 121 | files = ( 122 | F21D8143049F09FE7398C17FD21458EA /* Foundation.framework in Frameworks */, 123 | ); 124 | runOnlyForDeploymentPostprocessing = 0; 125 | }; 126 | 05C928CEC9214F94234ABDBD0B969DF2 /* Frameworks */ = { 127 | isa = PBXFrameworksBuildPhase; 128 | buildActionMask = 2147483647; 129 | files = ( 130 | B7C38F09FD332390AC6481A0ABEDAA69 /* Foundation.framework in Frameworks */, 131 | ); 132 | runOnlyForDeploymentPostprocessing = 0; 133 | }; 134 | 239FD859A12EF8D7DD5765420748EF48 /* Frameworks */ = { 135 | isa = PBXFrameworksBuildPhase; 136 | buildActionMask = 2147483647; 137 | files = ( 138 | 3F31EE627449D5D691D5CC305AF9747A /* Foundation.framework in Frameworks */, 139 | ); 140 | runOnlyForDeploymentPostprocessing = 0; 141 | }; 142 | /* End PBXFrameworksBuildPhase section */ 143 | 144 | /* Begin PBXGroup section */ 145 | 184AF76C4404DA009A3D733DB7AC6AE4 /* Pods-WKJavaScriptBridge_Example */ = { 146 | isa = PBXGroup; 147 | children = ( 148 | F4963E2EFFAAA15D91F010AD781B1684 /* Pods-WKJavaScriptBridge_Example.modulemap */, 149 | E2AE7FCD6E1BEBFC47748F31A33301F3 /* Pods-WKJavaScriptBridge_Example-acknowledgements.markdown */, 150 | 301FAB3A4368C3A3C2AD4B4C1322098D /* Pods-WKJavaScriptBridge_Example-acknowledgements.plist */, 151 | 710D65D9911916E575F5438DB13F6B03 /* Pods-WKJavaScriptBridge_Example-dummy.m */, 152 | A374EBE5CEE67BA43677B57A871EE9D4 /* Pods-WKJavaScriptBridge_Example-frameworks.sh */, 153 | 70EDE9F2D19F96B938CDAB814617DE74 /* Pods-WKJavaScriptBridge_Example-Info.plist */, 154 | 774A8A3926BCB3417C031CE14D3A5360 /* Pods-WKJavaScriptBridge_Example-umbrella.h */, 155 | D5F895E0793700E5AF2EFE043A921DAA /* Pods-WKJavaScriptBridge_Example.debug.xcconfig */, 156 | 834721C590C379A46A40ADBE82C4F15F /* Pods-WKJavaScriptBridge_Example.release.xcconfig */, 157 | ); 158 | name = "Pods-WKJavaScriptBridge_Example"; 159 | path = "Target Support Files/Pods-WKJavaScriptBridge_Example"; 160 | sourceTree = ""; 161 | }; 162 | 1D7D3BF891A3217902AE92E6D9E78035 /* Pod */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | CA783533AC1F3556251D34C07F048287 /* LICENSE */, 166 | 68ACD6FE7A95E5569C01F672A4B40D92 /* README.md */, 167 | 54A03357C4B6319334F90C606F701E18 /* WKJavaScriptBridge.podspec */, 168 | ); 169 | name = Pod; 170 | sourceTree = ""; 171 | }; 172 | 3CAE51D0DAC28E1F2E199C9E03945F81 /* Development Pods */ = { 173 | isa = PBXGroup; 174 | children = ( 175 | 8D0B65DAFD19C55863D8EBB8612CDD98 /* WKJavaScriptBridge */, 176 | ); 177 | name = "Development Pods"; 178 | sourceTree = ""; 179 | }; 180 | 3D977E2076CC5E9426494538B9B1A8E5 /* Targets Support Files */ = { 181 | isa = PBXGroup; 182 | children = ( 183 | 184AF76C4404DA009A3D733DB7AC6AE4 /* Pods-WKJavaScriptBridge_Example */, 184 | 6807E6C8FAC5F90048B5C8929C8466E5 /* Pods-WKJavaScriptBridge_Tests */, 185 | ); 186 | name = "Targets Support Files"; 187 | sourceTree = ""; 188 | }; 189 | 4C660FD0908F60750AE50E75D4F01086 /* Dispatcher */ = { 190 | isa = PBXGroup; 191 | children = ( 192 | 57F5480989137A1F843A39ABB204B7B7 /* WKJavaScriptMessageDispatcher.h */, 193 | CC0AED92072FEE10655B3BBA742CB5CC /* WKJavaScriptMessageDispatcher.m */, 194 | 14FB98A3715A8001CF83F96A6FC9905D /* WKMsgCommand.h */, 195 | 189E03A538517E791BA53A68C0142FEB /* WKMsgCommand.m */, 196 | ); 197 | name = Dispatcher; 198 | path = WKJavaScriptBridge/Classes/Dispatcher; 199 | sourceTree = ""; 200 | }; 201 | 61BDF114AF6E651E40E09A6EE617C424 /* Support Files */ = { 202 | isa = PBXGroup; 203 | children = ( 204 | BEE7AA5F42761CAE8BABAFAF34B582DB /* WKJavaScriptBridge.modulemap */, 205 | 09D49AA3ED3F4916C06CFAA153E114FF /* WKJavaScriptBridge-dummy.m */, 206 | 40A403073A77DD168268371A1976EFEC /* WKJavaScriptBridge-Info.plist */, 207 | 51F1C41DAFF76B6A011C7B789AF6C36B /* WKJavaScriptBridge-prefix.pch */, 208 | C03D8F11A8C5BB7779925D6445FDB946 /* WKJavaScriptBridge-umbrella.h */, 209 | A5F98B8E9357C9C1AACD2E07A72155FF /* WKJavaScriptBridge.debug.xcconfig */, 210 | 38CA62BAB103D9DC9F68FB242E185A1E /* WKJavaScriptBridge.release.xcconfig */, 211 | ); 212 | name = "Support Files"; 213 | path = "Example/Pods/Target Support Files/WKJavaScriptBridge"; 214 | sourceTree = ""; 215 | }; 216 | 6807E6C8FAC5F90048B5C8929C8466E5 /* Pods-WKJavaScriptBridge_Tests */ = { 217 | isa = PBXGroup; 218 | children = ( 219 | 4C63C3A44C45DA722C3C6A08B3BA5957 /* Pods-WKJavaScriptBridge_Tests.modulemap */, 220 | B4F8C3C490631E0B1EBC6EE9A0AFB053 /* Pods-WKJavaScriptBridge_Tests-acknowledgements.markdown */, 221 | A8210C3C7F352271AF9E1743C12D05EC /* Pods-WKJavaScriptBridge_Tests-acknowledgements.plist */, 222 | E8ABB81DF77B1BB5E92E6087E819D586 /* Pods-WKJavaScriptBridge_Tests-dummy.m */, 223 | 31C031B651BCD53DC4CC88E15C6E6B40 /* Pods-WKJavaScriptBridge_Tests-Info.plist */, 224 | D0E106D87E4CA4077C0CCE709CE9EFCB /* Pods-WKJavaScriptBridge_Tests-umbrella.h */, 225 | 1558DF69E71932C3C188D12669EB7F9A /* Pods-WKJavaScriptBridge_Tests.debug.xcconfig */, 226 | 33A01A89445811495F46D66F82FC6B09 /* Pods-WKJavaScriptBridge_Tests.release.xcconfig */, 227 | ); 228 | name = "Pods-WKJavaScriptBridge_Tests"; 229 | path = "Target Support Files/Pods-WKJavaScriptBridge_Tests"; 230 | sourceTree = ""; 231 | }; 232 | 7F07F4DECFE76D5BAF98AA9BB5D5352D /* Security */ = { 233 | isa = PBXGroup; 234 | children = ( 235 | B00A422083F80D1D46F925A23DE8C6D6 /* WKJavaScriptBridgePluginAnnotation.h */, 236 | 4342E9F0CAF4E883E1B3EF0CD878E570 /* WKJavaScriptBridgePluginAnnotation.m */, 237 | 047C2E5FFE9EB6B8CBEF2A5881FDCEDA /* WKPluginSecurityProtocol.h */, 238 | ); 239 | name = Security; 240 | path = WKJavaScriptBridge/Classes/Security; 241 | sourceTree = ""; 242 | }; 243 | 8D0B65DAFD19C55863D8EBB8612CDD98 /* WKJavaScriptBridge */ = { 244 | isa = PBXGroup; 245 | children = ( 246 | 7E2C1968BB5BE0E59527E5A25FE29695 /* WKJavaScriptBridge.h */, 247 | B1DC064D1CD4B1FB28A728AACF0FB75B /* WKJavaScriptBridge.m */, 248 | E6908A76FA49546874C3D68ADA9AA819 /* WKJavaScriptBridgeProtocol.h */, 249 | 4C660FD0908F60750AE50E75D4F01086 /* Dispatcher */, 250 | C5F9BAA5404EE0F752066D47F6FA4AB6 /* Plugin */, 251 | 1D7D3BF891A3217902AE92E6D9E78035 /* Pod */, 252 | 7F07F4DECFE76D5BAF98AA9BB5D5352D /* Security */, 253 | 61BDF114AF6E651E40E09A6EE617C424 /* Support Files */, 254 | E55614D061D7B7B0A91F62C55E9A34E7 /* Util */, 255 | ); 256 | name = WKJavaScriptBridge; 257 | path = ../..; 258 | sourceTree = ""; 259 | }; 260 | C0834CEBB1379A84116EF29F93051C60 /* iOS */ = { 261 | isa = PBXGroup; 262 | children = ( 263 | 3212113385A8FBBDB272BD23C409FF61 /* Foundation.framework */, 264 | ); 265 | name = iOS; 266 | sourceTree = ""; 267 | }; 268 | C5F9BAA5404EE0F752066D47F6FA4AB6 /* Plugin */ = { 269 | isa = PBXGroup; 270 | children = ( 271 | F8C0A2AB178663D683E3DEAFB44F2F5B /* WKBasePlugin.h */, 272 | B71FF397D168F81B7C193881EC5546F9 /* WKBasePlugin.m */, 273 | A2BEB5F6A9C161F963477CF238F93085 /* WKCommandImpl.h */, 274 | 11872520D0F6BA1530F9F1323EDD9C93 /* WKCommandImpl.m */, 275 | 32E02F3B0D69A23F1383711218528E0E /* WKCommandProtocol.h */, 276 | 8E9C5305656A340CA612DC00B409CB98 /* WKPluginProtocol.h */, 277 | AEED66C6B14667D29D84B1294277C104 /* WKPluginResult.h */, 278 | EA0A314C2063666AE3721D0A1C08A3BB /* WKPluginResult.m */, 279 | ); 280 | name = Plugin; 281 | path = WKJavaScriptBridge/Classes/Plugin; 282 | sourceTree = ""; 283 | }; 284 | CF1408CF629C7361332E53B88F7BD30C = { 285 | isa = PBXGroup; 286 | children = ( 287 | 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */, 288 | 3CAE51D0DAC28E1F2E199C9E03945F81 /* Development Pods */, 289 | D210D550F4EA176C3123ED886F8F87F5 /* Frameworks */, 290 | F24CBC1171C32BB22C4A0B91B3D187A4 /* Products */, 291 | 3D977E2076CC5E9426494538B9B1A8E5 /* Targets Support Files */, 292 | ); 293 | sourceTree = ""; 294 | }; 295 | D210D550F4EA176C3123ED886F8F87F5 /* Frameworks */ = { 296 | isa = PBXGroup; 297 | children = ( 298 | C0834CEBB1379A84116EF29F93051C60 /* iOS */, 299 | ); 300 | name = Frameworks; 301 | sourceTree = ""; 302 | }; 303 | E55614D061D7B7B0A91F62C55E9A34E7 /* Util */ = { 304 | isa = PBXGroup; 305 | children = ( 306 | 5C9DDA9B68DBF1D38648A3D03CDA3A23 /* NSString+BridgeJSONPrivate.h */, 307 | 13A78970988CA4F36A81329A9E972779 /* NSString+BridgeJSONPrivate.m */, 308 | 23E54793889C168FA3246C5BD1DCEBA0 /* WKWeakScriptMessageHandlerDelegate.h */, 309 | 8661BBF543DAA0FFB45C16BA2A62A27E /* WKWeakScriptMessageHandlerDelegate.m */, 310 | ); 311 | name = Util; 312 | path = WKJavaScriptBridge/Classes/Util; 313 | sourceTree = ""; 314 | }; 315 | F24CBC1171C32BB22C4A0B91B3D187A4 /* Products */ = { 316 | isa = PBXGroup; 317 | children = ( 318 | FC5F691569AFE0EFF406546F7B6F471A /* Pods_WKJavaScriptBridge_Example.framework */, 319 | 0AB5A7C657210B3AABD198F5077B679C /* Pods_WKJavaScriptBridge_Tests.framework */, 320 | 2E497486D5B1997976CEBF772818DA49 /* WKJavaScriptBridge.framework */, 321 | ); 322 | name = Products; 323 | sourceTree = ""; 324 | }; 325 | /* End PBXGroup section */ 326 | 327 | /* Begin PBXHeadersBuildPhase section */ 328 | 377CC4D7EE9A563D1C8E6F49B86C5BCD /* Headers */ = { 329 | isa = PBXHeadersBuildPhase; 330 | buildActionMask = 2147483647; 331 | files = ( 332 | 1214D8B1397FDFC7C68FA8FFB50530F4 /* Pods-WKJavaScriptBridge_Tests-umbrella.h in Headers */, 333 | ); 334 | runOnlyForDeploymentPostprocessing = 0; 335 | }; 336 | 7111D6F7B7E24EF901A505A680E5F266 /* Headers */ = { 337 | isa = PBXHeadersBuildPhase; 338 | buildActionMask = 2147483647; 339 | files = ( 340 | 9A3EDDA49A04314A4EF4BA54AEA2419C /* Pods-WKJavaScriptBridge_Example-umbrella.h in Headers */, 341 | ); 342 | runOnlyForDeploymentPostprocessing = 0; 343 | }; 344 | C2BAAF8BE4874D46706178FB38601793 /* Headers */ = { 345 | isa = PBXHeadersBuildPhase; 346 | buildActionMask = 2147483647; 347 | files = ( 348 | 22D385E2DE1BAF7BCEE1B21EA43E451E /* NSString+BridgeJSONPrivate.h in Headers */, 349 | C25C0067D7EFB1A3D14518CEAA1FB048 /* WKBasePlugin.h in Headers */, 350 | 8B09A5F3B4704F865A363F6768964404 /* WKCommandImpl.h in Headers */, 351 | 83CE0F66AF2019A73B9242B96A3464CD /* WKCommandProtocol.h in Headers */, 352 | 90A96B7A3F7A83BC37DBB7664798B620 /* WKJavaScriptBridge-umbrella.h in Headers */, 353 | 1D8253259DF2B6E2F0082CB663D3A041 /* WKJavaScriptBridge.h in Headers */, 354 | F33FEC77ED342948EA13A1F2E9BBEE9D /* WKJavaScriptBridgePluginAnnotation.h in Headers */, 355 | 8BEA8DFD94F03CD93F74545ADA8A52F2 /* WKJavaScriptBridgeProtocol.h in Headers */, 356 | 171DC50A236E09A8132C0B4C673D5F77 /* WKJavaScriptMessageDispatcher.h in Headers */, 357 | 9A991564D9A8F72EB40DDE3E027D848F /* WKMsgCommand.h in Headers */, 358 | 7222B424A724F9A62B1FE9A57A9AD967 /* WKPluginProtocol.h in Headers */, 359 | 3717D3C7A0B4ACC4D2A5062FD4CAF313 /* WKPluginResult.h in Headers */, 360 | 7AED8BA97CB70766F574CD0C7513BB7C /* WKPluginSecurityProtocol.h in Headers */, 361 | FC788FFE91D6FA1861159BD3D0DB7B0A /* WKWeakScriptMessageHandlerDelegate.h in Headers */, 362 | ); 363 | runOnlyForDeploymentPostprocessing = 0; 364 | }; 365 | /* End PBXHeadersBuildPhase section */ 366 | 367 | /* Begin PBXNativeTarget section */ 368 | 755E204626CE89F863FB451307F6642E /* Pods-WKJavaScriptBridge_Tests */ = { 369 | isa = PBXNativeTarget; 370 | buildConfigurationList = 80D2A0FC26D66A0040A8D5D8E162C4EA /* Build configuration list for PBXNativeTarget "Pods-WKJavaScriptBridge_Tests" */; 371 | buildPhases = ( 372 | 377CC4D7EE9A563D1C8E6F49B86C5BCD /* Headers */, 373 | 9B4AC8FEA1BDA86065E4F7437ADC167F /* Sources */, 374 | 05C928CEC9214F94234ABDBD0B969DF2 /* Frameworks */, 375 | D3293D74D80998F50E914DF00AAE6387 /* Resources */, 376 | ); 377 | buildRules = ( 378 | ); 379 | dependencies = ( 380 | DCCC250130921A9DDBE74F6AAB211177 /* PBXTargetDependency */, 381 | ); 382 | name = "Pods-WKJavaScriptBridge_Tests"; 383 | productName = "Pods-WKJavaScriptBridge_Tests"; 384 | productReference = 0AB5A7C657210B3AABD198F5077B679C /* Pods_WKJavaScriptBridge_Tests.framework */; 385 | productType = "com.apple.product-type.framework"; 386 | }; 387 | 883FE4A98A39F65560738FF8ACC95D71 /* Pods-WKJavaScriptBridge_Example */ = { 388 | isa = PBXNativeTarget; 389 | buildConfigurationList = D0549A0003E838F487D5BAA25A287FBA /* Build configuration list for PBXNativeTarget "Pods-WKJavaScriptBridge_Example" */; 390 | buildPhases = ( 391 | 7111D6F7B7E24EF901A505A680E5F266 /* Headers */, 392 | AF03383C78837EC02542E07405E9D57D /* Sources */, 393 | 00FDDD0BE9B6BF383866056C6F1DEFEF /* Frameworks */, 394 | DB3BEA9121B49ECE4BFE8E0503002132 /* Resources */, 395 | ); 396 | buildRules = ( 397 | ); 398 | dependencies = ( 399 | 3A05FA48375D1FB1BCC889DBA6C375C4 /* PBXTargetDependency */, 400 | ); 401 | name = "Pods-WKJavaScriptBridge_Example"; 402 | productName = "Pods-WKJavaScriptBridge_Example"; 403 | productReference = FC5F691569AFE0EFF406546F7B6F471A /* Pods_WKJavaScriptBridge_Example.framework */; 404 | productType = "com.apple.product-type.framework"; 405 | }; 406 | 8F8347086F8B20856E52922A9A74248D /* WKJavaScriptBridge */ = { 407 | isa = PBXNativeTarget; 408 | buildConfigurationList = 51A3D4460D5810FD144D7DF820AFECD7 /* Build configuration list for PBXNativeTarget "WKJavaScriptBridge" */; 409 | buildPhases = ( 410 | C2BAAF8BE4874D46706178FB38601793 /* Headers */, 411 | DA0361B8FA00128D614E0A8CEC28E089 /* Sources */, 412 | 239FD859A12EF8D7DD5765420748EF48 /* Frameworks */, 413 | 28C2609870EA5AC93F94F45A1B7D82C0 /* Resources */, 414 | ); 415 | buildRules = ( 416 | ); 417 | dependencies = ( 418 | ); 419 | name = WKJavaScriptBridge; 420 | productName = WKJavaScriptBridge; 421 | productReference = 2E497486D5B1997976CEBF772818DA49 /* WKJavaScriptBridge.framework */; 422 | productType = "com.apple.product-type.framework"; 423 | }; 424 | /* End PBXNativeTarget section */ 425 | 426 | /* Begin PBXProject section */ 427 | BFDFE7DC352907FC980B868725387E98 /* Project object */ = { 428 | isa = PBXProject; 429 | attributes = { 430 | LastSwiftUpdateCheck = 1100; 431 | LastUpgradeCheck = 1100; 432 | }; 433 | buildConfigurationList = 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */; 434 | compatibilityVersion = "Xcode 3.2"; 435 | developmentRegion = en; 436 | hasScannedForEncodings = 0; 437 | knownRegions = ( 438 | en, 439 | Base, 440 | ); 441 | mainGroup = CF1408CF629C7361332E53B88F7BD30C; 442 | productRefGroup = F24CBC1171C32BB22C4A0B91B3D187A4 /* Products */; 443 | projectDirPath = ""; 444 | projectRoot = ""; 445 | targets = ( 446 | 883FE4A98A39F65560738FF8ACC95D71 /* Pods-WKJavaScriptBridge_Example */, 447 | 755E204626CE89F863FB451307F6642E /* Pods-WKJavaScriptBridge_Tests */, 448 | 8F8347086F8B20856E52922A9A74248D /* WKJavaScriptBridge */, 449 | ); 450 | }; 451 | /* End PBXProject section */ 452 | 453 | /* Begin PBXResourcesBuildPhase section */ 454 | 28C2609870EA5AC93F94F45A1B7D82C0 /* Resources */ = { 455 | isa = PBXResourcesBuildPhase; 456 | buildActionMask = 2147483647; 457 | files = ( 458 | ); 459 | runOnlyForDeploymentPostprocessing = 0; 460 | }; 461 | D3293D74D80998F50E914DF00AAE6387 /* Resources */ = { 462 | isa = PBXResourcesBuildPhase; 463 | buildActionMask = 2147483647; 464 | files = ( 465 | ); 466 | runOnlyForDeploymentPostprocessing = 0; 467 | }; 468 | DB3BEA9121B49ECE4BFE8E0503002132 /* Resources */ = { 469 | isa = PBXResourcesBuildPhase; 470 | buildActionMask = 2147483647; 471 | files = ( 472 | ); 473 | runOnlyForDeploymentPostprocessing = 0; 474 | }; 475 | /* End PBXResourcesBuildPhase section */ 476 | 477 | /* Begin PBXSourcesBuildPhase section */ 478 | 9B4AC8FEA1BDA86065E4F7437ADC167F /* Sources */ = { 479 | isa = PBXSourcesBuildPhase; 480 | buildActionMask = 2147483647; 481 | files = ( 482 | E08B4DFEFC8D967A20D1CE0D379A2E0F /* Pods-WKJavaScriptBridge_Tests-dummy.m in Sources */, 483 | ); 484 | runOnlyForDeploymentPostprocessing = 0; 485 | }; 486 | AF03383C78837EC02542E07405E9D57D /* Sources */ = { 487 | isa = PBXSourcesBuildPhase; 488 | buildActionMask = 2147483647; 489 | files = ( 490 | CF862D7D785F63AF909827ED6B00412A /* Pods-WKJavaScriptBridge_Example-dummy.m in Sources */, 491 | ); 492 | runOnlyForDeploymentPostprocessing = 0; 493 | }; 494 | DA0361B8FA00128D614E0A8CEC28E089 /* Sources */ = { 495 | isa = PBXSourcesBuildPhase; 496 | buildActionMask = 2147483647; 497 | files = ( 498 | 1293AB8E8EB7A50E0E88A919E0DDDBFD /* NSString+BridgeJSONPrivate.m in Sources */, 499 | F9EAB73FF36E7D4708BAFB80A69F678A /* WKBasePlugin.m in Sources */, 500 | DB5513079EBA66F6A8FAEEBEB7CFDA25 /* WKCommandImpl.m in Sources */, 501 | 86EDF8A10C77F57FECEDE7F2138A8A5D /* WKJavaScriptBridge-dummy.m in Sources */, 502 | 2D41138DF9056CC39D030EDF28F05B6C /* WKJavaScriptBridge.m in Sources */, 503 | 51EC404A49947A5F1AD8EF9D8E248162 /* WKJavaScriptBridgePluginAnnotation.m in Sources */, 504 | B5CE477ED9D7579D378A9129160D2644 /* WKJavaScriptMessageDispatcher.m in Sources */, 505 | D0C2A8753E68E6269A8FEBF342BE887D /* WKMsgCommand.m in Sources */, 506 | 512B3EC0F988071A7671DD911723915F /* WKPluginResult.m in Sources */, 507 | FA739C948D5327E2B7C2CDB6375F399E /* WKWeakScriptMessageHandlerDelegate.m in Sources */, 508 | ); 509 | runOnlyForDeploymentPostprocessing = 0; 510 | }; 511 | /* End PBXSourcesBuildPhase section */ 512 | 513 | /* Begin PBXTargetDependency section */ 514 | 3A05FA48375D1FB1BCC889DBA6C375C4 /* PBXTargetDependency */ = { 515 | isa = PBXTargetDependency; 516 | name = WKJavaScriptBridge; 517 | target = 8F8347086F8B20856E52922A9A74248D /* WKJavaScriptBridge */; 518 | targetProxy = D5AD4AF2B33A181549ECC1C9E9D2C679 /* PBXContainerItemProxy */; 519 | }; 520 | DCCC250130921A9DDBE74F6AAB211177 /* PBXTargetDependency */ = { 521 | isa = PBXTargetDependency; 522 | name = "Pods-WKJavaScriptBridge_Example"; 523 | target = 883FE4A98A39F65560738FF8ACC95D71 /* Pods-WKJavaScriptBridge_Example */; 524 | targetProxy = 2E3A604F7A0CCAF6CFC2C58772DE835A /* PBXContainerItemProxy */; 525 | }; 526 | /* End PBXTargetDependency section */ 527 | 528 | /* Begin XCBuildConfiguration section */ 529 | 2D8002AAF2E228D2CEA3CAA635A14CFC /* Debug */ = { 530 | isa = XCBuildConfiguration; 531 | baseConfigurationReference = 1558DF69E71932C3C188D12669EB7F9A /* Pods-WKJavaScriptBridge_Tests.debug.xcconfig */; 532 | buildSettings = { 533 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 534 | CODE_SIGN_IDENTITY = ""; 535 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 536 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 537 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 538 | CURRENT_PROJECT_VERSION = 1; 539 | DEFINES_MODULE = YES; 540 | DYLIB_COMPATIBILITY_VERSION = 1; 541 | DYLIB_CURRENT_VERSION = 1; 542 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 543 | INFOPLIST_FILE = "Target Support Files/Pods-WKJavaScriptBridge_Tests/Pods-WKJavaScriptBridge_Tests-Info.plist"; 544 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 545 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 546 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 547 | MACH_O_TYPE = staticlib; 548 | MODULEMAP_FILE = "Target Support Files/Pods-WKJavaScriptBridge_Tests/Pods-WKJavaScriptBridge_Tests.modulemap"; 549 | OTHER_LDFLAGS = ""; 550 | OTHER_LIBTOOLFLAGS = ""; 551 | PODS_ROOT = "$(SRCROOT)"; 552 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 553 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 554 | SDKROOT = iphoneos; 555 | SKIP_INSTALL = YES; 556 | TARGETED_DEVICE_FAMILY = "1,2"; 557 | VERSIONING_SYSTEM = "apple-generic"; 558 | VERSION_INFO_PREFIX = ""; 559 | }; 560 | name = Debug; 561 | }; 562 | 3F108DF09AC5FBD618780D2CD91B634C /* Debug */ = { 563 | isa = XCBuildConfiguration; 564 | baseConfigurationReference = D5F895E0793700E5AF2EFE043A921DAA /* Pods-WKJavaScriptBridge_Example.debug.xcconfig */; 565 | buildSettings = { 566 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 567 | CODE_SIGN_IDENTITY = ""; 568 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 569 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 570 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 571 | CURRENT_PROJECT_VERSION = 1; 572 | DEFINES_MODULE = YES; 573 | DYLIB_COMPATIBILITY_VERSION = 1; 574 | DYLIB_CURRENT_VERSION = 1; 575 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 576 | INFOPLIST_FILE = "Target Support Files/Pods-WKJavaScriptBridge_Example/Pods-WKJavaScriptBridge_Example-Info.plist"; 577 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 578 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 579 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 580 | MACH_O_TYPE = staticlib; 581 | MODULEMAP_FILE = "Target Support Files/Pods-WKJavaScriptBridge_Example/Pods-WKJavaScriptBridge_Example.modulemap"; 582 | OTHER_LDFLAGS = ""; 583 | OTHER_LIBTOOLFLAGS = ""; 584 | PODS_ROOT = "$(SRCROOT)"; 585 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 586 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 587 | SDKROOT = iphoneos; 588 | SKIP_INSTALL = YES; 589 | TARGETED_DEVICE_FAMILY = "1,2"; 590 | VERSIONING_SYSTEM = "apple-generic"; 591 | VERSION_INFO_PREFIX = ""; 592 | }; 593 | name = Debug; 594 | }; 595 | 47248B9EF369065BF8C8C1F720E5DD1E /* Release */ = { 596 | isa = XCBuildConfiguration; 597 | baseConfigurationReference = 33A01A89445811495F46D66F82FC6B09 /* Pods-WKJavaScriptBridge_Tests.release.xcconfig */; 598 | buildSettings = { 599 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 600 | CODE_SIGN_IDENTITY = ""; 601 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 602 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 603 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 604 | CURRENT_PROJECT_VERSION = 1; 605 | DEFINES_MODULE = YES; 606 | DYLIB_COMPATIBILITY_VERSION = 1; 607 | DYLIB_CURRENT_VERSION = 1; 608 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 609 | INFOPLIST_FILE = "Target Support Files/Pods-WKJavaScriptBridge_Tests/Pods-WKJavaScriptBridge_Tests-Info.plist"; 610 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 611 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 612 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 613 | MACH_O_TYPE = staticlib; 614 | MODULEMAP_FILE = "Target Support Files/Pods-WKJavaScriptBridge_Tests/Pods-WKJavaScriptBridge_Tests.modulemap"; 615 | OTHER_LDFLAGS = ""; 616 | OTHER_LIBTOOLFLAGS = ""; 617 | PODS_ROOT = "$(SRCROOT)"; 618 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 619 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 620 | SDKROOT = iphoneos; 621 | SKIP_INSTALL = YES; 622 | TARGETED_DEVICE_FAMILY = "1,2"; 623 | VALIDATE_PRODUCT = YES; 624 | VERSIONING_SYSTEM = "apple-generic"; 625 | VERSION_INFO_PREFIX = ""; 626 | }; 627 | name = Release; 628 | }; 629 | 4BE66A09A74FD25164AAB3C2645B9B93 /* Release */ = { 630 | isa = XCBuildConfiguration; 631 | buildSettings = { 632 | ALWAYS_SEARCH_USER_PATHS = NO; 633 | CLANG_ANALYZER_NONNULL = YES; 634 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 635 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 636 | CLANG_CXX_LIBRARY = "libc++"; 637 | CLANG_ENABLE_MODULES = YES; 638 | CLANG_ENABLE_OBJC_ARC = YES; 639 | CLANG_ENABLE_OBJC_WEAK = YES; 640 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 641 | CLANG_WARN_BOOL_CONVERSION = YES; 642 | CLANG_WARN_COMMA = YES; 643 | CLANG_WARN_CONSTANT_CONVERSION = YES; 644 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 645 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 646 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 647 | CLANG_WARN_EMPTY_BODY = YES; 648 | CLANG_WARN_ENUM_CONVERSION = YES; 649 | CLANG_WARN_INFINITE_RECURSION = YES; 650 | CLANG_WARN_INT_CONVERSION = YES; 651 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 652 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 653 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 654 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 655 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 656 | CLANG_WARN_STRICT_PROTOTYPES = YES; 657 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 658 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 659 | CLANG_WARN_UNREACHABLE_CODE = YES; 660 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 661 | COPY_PHASE_STRIP = NO; 662 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 663 | ENABLE_NS_ASSERTIONS = NO; 664 | ENABLE_STRICT_OBJC_MSGSEND = YES; 665 | GCC_C_LANGUAGE_STANDARD = gnu11; 666 | GCC_NO_COMMON_BLOCKS = YES; 667 | GCC_PREPROCESSOR_DEFINITIONS = ( 668 | "POD_CONFIGURATION_RELEASE=1", 669 | "$(inherited)", 670 | ); 671 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 672 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 673 | GCC_WARN_UNDECLARED_SELECTOR = YES; 674 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 675 | GCC_WARN_UNUSED_FUNCTION = YES; 676 | GCC_WARN_UNUSED_VARIABLE = YES; 677 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 678 | MTL_ENABLE_DEBUG_INFO = NO; 679 | MTL_FAST_MATH = YES; 680 | PRODUCT_NAME = "$(TARGET_NAME)"; 681 | STRIP_INSTALLED_PRODUCT = NO; 682 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 683 | SWIFT_VERSION = 5.0; 684 | SYMROOT = "${SRCROOT}/../build"; 685 | }; 686 | name = Release; 687 | }; 688 | 6C025F14181343F6BD4E02560339318C /* Release */ = { 689 | isa = XCBuildConfiguration; 690 | baseConfigurationReference = 38CA62BAB103D9DC9F68FB242E185A1E /* WKJavaScriptBridge.release.xcconfig */; 691 | buildSettings = { 692 | CODE_SIGN_IDENTITY = ""; 693 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 694 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 695 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 696 | CURRENT_PROJECT_VERSION = 1; 697 | DEFINES_MODULE = YES; 698 | DYLIB_COMPATIBILITY_VERSION = 1; 699 | DYLIB_CURRENT_VERSION = 1; 700 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 701 | GCC_PREFIX_HEADER = "Target Support Files/WKJavaScriptBridge/WKJavaScriptBridge-prefix.pch"; 702 | INFOPLIST_FILE = "Target Support Files/WKJavaScriptBridge/WKJavaScriptBridge-Info.plist"; 703 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 704 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 705 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 706 | MODULEMAP_FILE = "Target Support Files/WKJavaScriptBridge/WKJavaScriptBridge.modulemap"; 707 | PRODUCT_MODULE_NAME = WKJavaScriptBridge; 708 | PRODUCT_NAME = WKJavaScriptBridge; 709 | SDKROOT = iphoneos; 710 | SKIP_INSTALL = YES; 711 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; 712 | SWIFT_VERSION = 4.0; 713 | TARGETED_DEVICE_FAMILY = "1,2"; 714 | VALIDATE_PRODUCT = YES; 715 | VERSIONING_SYSTEM = "apple-generic"; 716 | VERSION_INFO_PREFIX = ""; 717 | }; 718 | name = Release; 719 | }; 720 | 7EF7227D9B20A1D549000096ACCB23D7 /* Debug */ = { 721 | isa = XCBuildConfiguration; 722 | buildSettings = { 723 | ALWAYS_SEARCH_USER_PATHS = NO; 724 | CLANG_ANALYZER_NONNULL = YES; 725 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 726 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 727 | CLANG_CXX_LIBRARY = "libc++"; 728 | CLANG_ENABLE_MODULES = YES; 729 | CLANG_ENABLE_OBJC_ARC = YES; 730 | CLANG_ENABLE_OBJC_WEAK = YES; 731 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 732 | CLANG_WARN_BOOL_CONVERSION = YES; 733 | CLANG_WARN_COMMA = YES; 734 | CLANG_WARN_CONSTANT_CONVERSION = YES; 735 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 736 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 737 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 738 | CLANG_WARN_EMPTY_BODY = YES; 739 | CLANG_WARN_ENUM_CONVERSION = YES; 740 | CLANG_WARN_INFINITE_RECURSION = YES; 741 | CLANG_WARN_INT_CONVERSION = YES; 742 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 743 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 744 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 745 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 746 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 747 | CLANG_WARN_STRICT_PROTOTYPES = YES; 748 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 749 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 750 | CLANG_WARN_UNREACHABLE_CODE = YES; 751 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 752 | COPY_PHASE_STRIP = NO; 753 | DEBUG_INFORMATION_FORMAT = dwarf; 754 | ENABLE_STRICT_OBJC_MSGSEND = YES; 755 | ENABLE_TESTABILITY = YES; 756 | GCC_C_LANGUAGE_STANDARD = gnu11; 757 | GCC_DYNAMIC_NO_PIC = NO; 758 | GCC_NO_COMMON_BLOCKS = YES; 759 | GCC_OPTIMIZATION_LEVEL = 0; 760 | GCC_PREPROCESSOR_DEFINITIONS = ( 761 | "POD_CONFIGURATION_DEBUG=1", 762 | "DEBUG=1", 763 | "$(inherited)", 764 | ); 765 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 766 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 767 | GCC_WARN_UNDECLARED_SELECTOR = YES; 768 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 769 | GCC_WARN_UNUSED_FUNCTION = YES; 770 | GCC_WARN_UNUSED_VARIABLE = YES; 771 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 772 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 773 | MTL_FAST_MATH = YES; 774 | ONLY_ACTIVE_ARCH = YES; 775 | PRODUCT_NAME = "$(TARGET_NAME)"; 776 | STRIP_INSTALLED_PRODUCT = NO; 777 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 778 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 779 | SWIFT_VERSION = 5.0; 780 | SYMROOT = "${SRCROOT}/../build"; 781 | }; 782 | name = Debug; 783 | }; 784 | 919A9CECC1A835592B9AA58FC24FAD96 /* Debug */ = { 785 | isa = XCBuildConfiguration; 786 | baseConfigurationReference = A5F98B8E9357C9C1AACD2E07A72155FF /* WKJavaScriptBridge.debug.xcconfig */; 787 | buildSettings = { 788 | CODE_SIGN_IDENTITY = ""; 789 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 790 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 791 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 792 | CURRENT_PROJECT_VERSION = 1; 793 | DEFINES_MODULE = YES; 794 | DYLIB_COMPATIBILITY_VERSION = 1; 795 | DYLIB_CURRENT_VERSION = 1; 796 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 797 | GCC_PREFIX_HEADER = "Target Support Files/WKJavaScriptBridge/WKJavaScriptBridge-prefix.pch"; 798 | INFOPLIST_FILE = "Target Support Files/WKJavaScriptBridge/WKJavaScriptBridge-Info.plist"; 799 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 800 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 801 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 802 | MODULEMAP_FILE = "Target Support Files/WKJavaScriptBridge/WKJavaScriptBridge.modulemap"; 803 | PRODUCT_MODULE_NAME = WKJavaScriptBridge; 804 | PRODUCT_NAME = WKJavaScriptBridge; 805 | SDKROOT = iphoneos; 806 | SKIP_INSTALL = YES; 807 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; 808 | SWIFT_VERSION = 4.0; 809 | TARGETED_DEVICE_FAMILY = "1,2"; 810 | VERSIONING_SYSTEM = "apple-generic"; 811 | VERSION_INFO_PREFIX = ""; 812 | }; 813 | name = Debug; 814 | }; 815 | BAC2DACE965431330E545661AE5098E7 /* Release */ = { 816 | isa = XCBuildConfiguration; 817 | baseConfigurationReference = 834721C590C379A46A40ADBE82C4F15F /* Pods-WKJavaScriptBridge_Example.release.xcconfig */; 818 | buildSettings = { 819 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 820 | CODE_SIGN_IDENTITY = ""; 821 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 822 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 823 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 824 | CURRENT_PROJECT_VERSION = 1; 825 | DEFINES_MODULE = YES; 826 | DYLIB_COMPATIBILITY_VERSION = 1; 827 | DYLIB_CURRENT_VERSION = 1; 828 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 829 | INFOPLIST_FILE = "Target Support Files/Pods-WKJavaScriptBridge_Example/Pods-WKJavaScriptBridge_Example-Info.plist"; 830 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 831 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 832 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 833 | MACH_O_TYPE = staticlib; 834 | MODULEMAP_FILE = "Target Support Files/Pods-WKJavaScriptBridge_Example/Pods-WKJavaScriptBridge_Example.modulemap"; 835 | OTHER_LDFLAGS = ""; 836 | OTHER_LIBTOOLFLAGS = ""; 837 | PODS_ROOT = "$(SRCROOT)"; 838 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 839 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 840 | SDKROOT = iphoneos; 841 | SKIP_INSTALL = YES; 842 | TARGETED_DEVICE_FAMILY = "1,2"; 843 | VALIDATE_PRODUCT = YES; 844 | VERSIONING_SYSTEM = "apple-generic"; 845 | VERSION_INFO_PREFIX = ""; 846 | }; 847 | name = Release; 848 | }; 849 | /* End XCBuildConfiguration section */ 850 | 851 | /* Begin XCConfigurationList section */ 852 | 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */ = { 853 | isa = XCConfigurationList; 854 | buildConfigurations = ( 855 | 7EF7227D9B20A1D549000096ACCB23D7 /* Debug */, 856 | 4BE66A09A74FD25164AAB3C2645B9B93 /* Release */, 857 | ); 858 | defaultConfigurationIsVisible = 0; 859 | defaultConfigurationName = Release; 860 | }; 861 | 51A3D4460D5810FD144D7DF820AFECD7 /* Build configuration list for PBXNativeTarget "WKJavaScriptBridge" */ = { 862 | isa = XCConfigurationList; 863 | buildConfigurations = ( 864 | 919A9CECC1A835592B9AA58FC24FAD96 /* Debug */, 865 | 6C025F14181343F6BD4E02560339318C /* Release */, 866 | ); 867 | defaultConfigurationIsVisible = 0; 868 | defaultConfigurationName = Release; 869 | }; 870 | 80D2A0FC26D66A0040A8D5D8E162C4EA /* Build configuration list for PBXNativeTarget "Pods-WKJavaScriptBridge_Tests" */ = { 871 | isa = XCConfigurationList; 872 | buildConfigurations = ( 873 | 2D8002AAF2E228D2CEA3CAA635A14CFC /* Debug */, 874 | 47248B9EF369065BF8C8C1F720E5DD1E /* Release */, 875 | ); 876 | defaultConfigurationIsVisible = 0; 877 | defaultConfigurationName = Release; 878 | }; 879 | D0549A0003E838F487D5BAA25A287FBA /* Build configuration list for PBXNativeTarget "Pods-WKJavaScriptBridge_Example" */ = { 880 | isa = XCConfigurationList; 881 | buildConfigurations = ( 882 | 3F108DF09AC5FBD618780D2CD91B634C /* Debug */, 883 | BAC2DACE965431330E545661AE5098E7 /* Release */, 884 | ); 885 | defaultConfigurationIsVisible = 0; 886 | defaultConfigurationName = Release; 887 | }; 888 | /* End XCConfigurationList section */ 889 | }; 890 | rootObject = BFDFE7DC352907FC980B868725387E98 /* Project object */; 891 | } 892 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcuserdata/wangkai.xcuserdatad/xcschemes/Pods-WKJavaScriptBridge_Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcuserdata/wangkai.xcuserdatad/xcschemes/Pods-WKJavaScriptBridge_Tests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcuserdata/wangkai.xcuserdatad/xcschemes/WKJavaScriptBridge.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcuserdata/wangkai.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Pods-WKJavaScriptBridge_Example.xcscheme 8 | 9 | isShown 10 | 11 | 12 | Pods-WKJavaScriptBridge_Tests.xcscheme 13 | 14 | isShown 15 | 16 | 17 | WKJavaScriptBridge.xcscheme 18 | 19 | isShown 20 | 21 | 22 | 23 | SuppressBuildableAutocreation 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-WKJavaScriptBridge_Example/Pods-WKJavaScriptBridge_Example-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-WKJavaScriptBridge_Example/Pods-WKJavaScriptBridge_Example-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## WKJavaScriptBridge 5 | 6 | Copyright (c) 2020 GitWangKai <18500052382@163.com> 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - https://cocoapods.org 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-WKJavaScriptBridge_Example/Pods-WKJavaScriptBridge_Example-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2020 GitWangKai <18500052382@163.com> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | WKJavaScriptBridge 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - https://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-WKJavaScriptBridge_Example/Pods-WKJavaScriptBridge_Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_WKJavaScriptBridge_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_WKJavaScriptBridge_Example 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-WKJavaScriptBridge_Example/Pods-WKJavaScriptBridge_Example-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | function on_error { 7 | echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" 8 | } 9 | trap 'on_error $LINENO' ERR 10 | 11 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 12 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 13 | # frameworks to, so exit 0 (signalling the script phase was successful). 14 | exit 0 15 | fi 16 | 17 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 18 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 19 | 20 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 21 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 22 | 23 | # Used as a return value for each invocation of `strip_invalid_archs` function. 24 | STRIP_BINARY_RETVAL=0 25 | 26 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 27 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 28 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 29 | 30 | # Copies and strips a vendored framework 31 | install_framework() 32 | { 33 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 34 | local source="${BUILT_PRODUCTS_DIR}/$1" 35 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 36 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 37 | elif [ -r "$1" ]; then 38 | local source="$1" 39 | fi 40 | 41 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 42 | 43 | if [ -L "${source}" ]; then 44 | echo "Symlinked..." 45 | source="$(readlink "${source}")" 46 | fi 47 | 48 | # Use filter instead of exclude so missing patterns don't throw errors. 49 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 50 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 51 | 52 | local basename 53 | basename="$(basename -s .framework "$1")" 54 | binary="${destination}/${basename}.framework/${basename}" 55 | 56 | if ! [ -r "$binary" ]; then 57 | binary="${destination}/${basename}" 58 | elif [ -L "${binary}" ]; then 59 | echo "Destination binary is symlinked..." 60 | dirname="$(dirname "${binary}")" 61 | binary="${dirname}/$(readlink "${binary}")" 62 | fi 63 | 64 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 65 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 66 | strip_invalid_archs "$binary" 67 | fi 68 | 69 | # Resign the code if required by the build settings to avoid unstable apps 70 | code_sign_if_enabled "${destination}/$(basename "$1")" 71 | 72 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 73 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 74 | local swift_runtime_libs 75 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u) 76 | for lib in $swift_runtime_libs; do 77 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 78 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 79 | code_sign_if_enabled "${destination}/${lib}" 80 | done 81 | fi 82 | } 83 | 84 | # Copies and strips a vendored dSYM 85 | install_dsym() { 86 | local source="$1" 87 | warn_missing_arch=${2:-true} 88 | if [ -r "$source" ]; then 89 | # Copy the dSYM into the targets temp dir. 90 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 91 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 92 | 93 | local basename 94 | basename="$(basename -s .dSYM "$source")" 95 | binary_name="$(ls "$source/Contents/Resources/DWARF")" 96 | binary="${DERIVED_FILES_DIR}/${basename}.dSYM/Contents/Resources/DWARF/${binary_name}" 97 | 98 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 99 | if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then 100 | strip_invalid_archs "$binary" "$warn_missing_arch" 101 | fi 102 | 103 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 104 | # Move the stripped file into its final destination. 105 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 106 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 107 | else 108 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 109 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.dSYM" 110 | fi 111 | fi 112 | } 113 | 114 | # Copies the bcsymbolmap files of a vendored framework 115 | install_bcsymbolmap() { 116 | local bcsymbolmap_path="$1" 117 | local destination="${BUILT_PRODUCTS_DIR}" 118 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"" 119 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}" 120 | } 121 | 122 | # Signs a framework with the provided identity 123 | code_sign_if_enabled() { 124 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 125 | # Use the current code_sign_identity 126 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 127 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 128 | 129 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 130 | code_sign_cmd="$code_sign_cmd &" 131 | fi 132 | echo "$code_sign_cmd" 133 | eval "$code_sign_cmd" 134 | fi 135 | } 136 | 137 | # Strip invalid architectures 138 | strip_invalid_archs() { 139 | binary="$1" 140 | warn_missing_arch=${2:-true} 141 | # Get architectures for current target binary 142 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 143 | # Intersect them with the architectures we are building for 144 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 145 | # If there are no archs supported by this binary then warn the user 146 | if [[ -z "$intersected_archs" ]]; then 147 | if [[ "$warn_missing_arch" == "true" ]]; then 148 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 149 | fi 150 | STRIP_BINARY_RETVAL=0 151 | return 152 | fi 153 | stripped="" 154 | for arch in $binary_archs; do 155 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 156 | # Strip non-valid architectures in-place 157 | lipo -remove "$arch" -output "$binary" "$binary" 158 | stripped="$stripped $arch" 159 | fi 160 | done 161 | if [[ "$stripped" ]]; then 162 | echo "Stripped $binary of architectures:$stripped" 163 | fi 164 | STRIP_BINARY_RETVAL=1 165 | } 166 | 167 | install_artifact() { 168 | artifact="$1" 169 | base="$(basename "$artifact")" 170 | case $base in 171 | *.framework) 172 | install_framework "$artifact" 173 | ;; 174 | *.dSYM) 175 | # Suppress arch warnings since XCFrameworks will include many dSYM files 176 | install_dsym "$artifact" "false" 177 | ;; 178 | *.bcsymbolmap) 179 | install_bcsymbolmap "$artifact" 180 | ;; 181 | *) 182 | echo "error: Unrecognized artifact "$artifact"" 183 | ;; 184 | esac 185 | } 186 | 187 | copy_artifacts() { 188 | file_list="$1" 189 | while read artifact; do 190 | install_artifact "$artifact" 191 | done <$file_list 192 | } 193 | 194 | ARTIFACT_LIST_FILE="${BUILT_PRODUCTS_DIR}/cocoapods-artifacts-${CONFIGURATION}.txt" 195 | if [ -r "${ARTIFACT_LIST_FILE}" ]; then 196 | copy_artifacts "${ARTIFACT_LIST_FILE}" 197 | fi 198 | 199 | if [[ "$CONFIGURATION" == "Debug" ]]; then 200 | install_framework "${BUILT_PRODUCTS_DIR}/WKJavaScriptBridge/WKJavaScriptBridge.framework" 201 | fi 202 | if [[ "$CONFIGURATION" == "Release" ]]; then 203 | install_framework "${BUILT_PRODUCTS_DIR}/WKJavaScriptBridge/WKJavaScriptBridge.framework" 204 | fi 205 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 206 | wait 207 | fi 208 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-WKJavaScriptBridge_Example/Pods-WKJavaScriptBridge_Example-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_WKJavaScriptBridge_ExampleVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_WKJavaScriptBridge_ExampleVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-WKJavaScriptBridge_Example/Pods-WKJavaScriptBridge_Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/WKJavaScriptBridge" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/WKJavaScriptBridge/WKJavaScriptBridge.framework/Headers" 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_LDFLAGS = $(inherited) -framework "WKJavaScriptBridge" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-WKJavaScriptBridge_Example/Pods-WKJavaScriptBridge_Example.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_WKJavaScriptBridge_Example { 2 | umbrella header "Pods-WKJavaScriptBridge_Example-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-WKJavaScriptBridge_Example/Pods-WKJavaScriptBridge_Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/WKJavaScriptBridge" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/WKJavaScriptBridge/WKJavaScriptBridge.framework/Headers" 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_LDFLAGS = $(inherited) -framework "WKJavaScriptBridge" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-WKJavaScriptBridge_Tests/Pods-WKJavaScriptBridge_Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-WKJavaScriptBridge_Tests/Pods-WKJavaScriptBridge_Tests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-WKJavaScriptBridge_Tests/Pods-WKJavaScriptBridge_Tests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-WKJavaScriptBridge_Tests/Pods-WKJavaScriptBridge_Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_WKJavaScriptBridge_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_WKJavaScriptBridge_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-WKJavaScriptBridge_Tests/Pods-WKJavaScriptBridge_Tests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_WKJavaScriptBridge_TestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_WKJavaScriptBridge_TestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-WKJavaScriptBridge_Tests/Pods-WKJavaScriptBridge_Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/WKJavaScriptBridge" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/WKJavaScriptBridge/WKJavaScriptBridge.framework/Headers" 4 | OTHER_LDFLAGS = $(inherited) -framework "WKJavaScriptBridge" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-WKJavaScriptBridge_Tests/Pods-WKJavaScriptBridge_Tests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_WKJavaScriptBridge_Tests { 2 | umbrella header "Pods-WKJavaScriptBridge_Tests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-WKJavaScriptBridge_Tests/Pods-WKJavaScriptBridge_Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/WKJavaScriptBridge" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/WKJavaScriptBridge/WKJavaScriptBridge.framework/Headers" 4 | OTHER_LDFLAGS = $(inherited) -framework "WKJavaScriptBridge" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/WKJavaScriptBridge/WKJavaScriptBridge-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/WKJavaScriptBridge/WKJavaScriptBridge-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_WKJavaScriptBridge : NSObject 3 | @end 4 | @implementation PodsDummy_WKJavaScriptBridge 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/WKJavaScriptBridge/WKJavaScriptBridge-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/WKJavaScriptBridge/WKJavaScriptBridge-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "WKJavaScriptMessageDispatcher.h" 14 | #import "WKMsgCommand.h" 15 | #import "WKBasePlugin.h" 16 | #import "WKCommandImpl.h" 17 | #import "WKCommandProtocol.h" 18 | #import "WKPluginProtocol.h" 19 | #import "WKPluginResult.h" 20 | #import "WKJavaScriptBridgePluginAnnotation.h" 21 | #import "WKPluginSecurityProtocol.h" 22 | #import "NSString+BridgeJSONPrivate.h" 23 | #import "WKWeakScriptMessageHandlerDelegate.h" 24 | #import "WKJavaScriptBridge.h" 25 | #import "WKJavaScriptBridgeProtocol.h" 26 | 27 | FOUNDATION_EXPORT double WKJavaScriptBridgeVersionNumber; 28 | FOUNDATION_EXPORT const unsigned char WKJavaScriptBridgeVersionString[]; 29 | 30 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/WKJavaScriptBridge/WKJavaScriptBridge.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/WKJavaScriptBridge 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_ROOT = ${SRCROOT} 6 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 7 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 8 | SKIP_INSTALL = YES 9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/WKJavaScriptBridge/WKJavaScriptBridge.modulemap: -------------------------------------------------------------------------------- 1 | framework module WKJavaScriptBridge { 2 | umbrella header "WKJavaScriptBridge-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/WKJavaScriptBridge/WKJavaScriptBridge.release.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/WKJavaScriptBridge 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_ROOT = ${SRCROOT} 6 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 7 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 8 | SKIP_INSTALL = YES 9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 10 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // The contents of this file are implicitly included at the beginning of every test case source file. 2 | 3 | #ifdef __OBJC__ 4 | 5 | 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /Example/Tests/Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // WKJavaScriptBridgeTests.m 3 | // WKJavaScriptBridgeTests 4 | // 5 | // Created by GitWangKai on 09/14/2020. 6 | // Copyright (c) 2020 GitWangKai. All rights reserved. 7 | // 8 | 9 | @import XCTest; 10 | 11 | @interface Tests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation Tests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | 36 | -------------------------------------------------------------------------------- /Example/Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1EDAA9BE5DCF363024F58224 /* Pods_WKJavaScriptBridge_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 86A22B218D3CFD606912451D /* Pods_WKJavaScriptBridge_Tests.framework */; }; 11 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 12 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; 13 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 14 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; 15 | 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; 16 | 6003F59E195388D20070C39A /* WKAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* WKAppDelegate.m */; }; 17 | 6003F5A7195388D20070C39A /* WKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* WKViewController.m */; }; 18 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; }; 19 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; 20 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 21 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 22 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; 23 | 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; 24 | 631ECE893F6CFF6B28B3E7B1 /* Pods_WKJavaScriptBridge_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C81FD33F66658FB090696698 /* Pods_WKJavaScriptBridge_Example.framework */; }; 25 | 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */; }; 26 | 83F53EFD250EFFB3008B0321 /* TestSecurityPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 83F53EF7250EFFB3008B0321 /* TestSecurityPlugin.m */; }; 27 | 83F53EFE250EFFB3008B0321 /* TestPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 83F53EFA250EFFB3008B0321 /* TestPlugin.m */; }; 28 | 83F53EFF250EFFB3008B0321 /* WKCommonPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 83F53EFB250EFFB3008B0321 /* WKCommonPlugin.m */; }; 29 | 83F53F01250EFFC5008B0321 /* index.html in Resources */ = {isa = PBXBuildFile; fileRef = 83F53F00250EFFC5008B0321 /* index.html */; }; 30 | 83F53F03250F0136008B0321 /* WKJSBridge.js in Resources */ = {isa = PBXBuildFile; fileRef = 83F53F02250F0136008B0321 /* WKJSBridge.js */; }; 31 | 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; }; 32 | /* End PBXBuildFile section */ 33 | 34 | /* Begin PBXContainerItemProxy section */ 35 | 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = { 36 | isa = PBXContainerItemProxy; 37 | containerPortal = 6003F582195388D10070C39A /* Project object */; 38 | proxyType = 1; 39 | remoteGlobalIDString = 6003F589195388D20070C39A; 40 | remoteInfo = WKJavaScriptBridge; 41 | }; 42 | /* End PBXContainerItemProxy section */ 43 | 44 | /* Begin PBXFileReference section */ 45 | 03D8C67F75C319920C51C1F5 /* WKJavaScriptBridge.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = WKJavaScriptBridge.podspec; path = ../WKJavaScriptBridge.podspec; sourceTree = ""; }; 46 | 1676BACDF544EC174D2EE1C3 /* Pods-WKJavaScriptBridge_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WKJavaScriptBridge_Tests.release.xcconfig"; path = "Target Support Files/Pods-WKJavaScriptBridge_Tests/Pods-WKJavaScriptBridge_Tests.release.xcconfig"; sourceTree = ""; }; 47 | 3DE9B6B533B90FF6E2EEDC2F /* Pods-WKJavaScriptBridge_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WKJavaScriptBridge_Tests.debug.xcconfig"; path = "Target Support Files/Pods-WKJavaScriptBridge_Tests/Pods-WKJavaScriptBridge_Tests.debug.xcconfig"; sourceTree = ""; }; 48 | 3FE1E5AD60555277E56091E2 /* Pods-WKJavaScriptBridge_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WKJavaScriptBridge_Example.release.xcconfig"; path = "Target Support Files/Pods-WKJavaScriptBridge_Example/Pods-WKJavaScriptBridge_Example.release.xcconfig"; sourceTree = ""; }; 49 | 6003F58A195388D20070C39A /* WKJavaScriptBridge_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WKJavaScriptBridge_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 51 | 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 52 | 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 53 | 6003F595195388D20070C39A /* WKJavaScriptBridge-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "WKJavaScriptBridge-Info.plist"; sourceTree = ""; }; 54 | 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 55 | 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 56 | 6003F59B195388D20070C39A /* WKJavaScriptBridge-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "WKJavaScriptBridge-Prefix.pch"; sourceTree = ""; }; 57 | 6003F59C195388D20070C39A /* WKAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKAppDelegate.h; sourceTree = ""; }; 58 | 6003F59D195388D20070C39A /* WKAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WKAppDelegate.m; sourceTree = ""; }; 59 | 6003F5A5195388D20070C39A /* WKViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKViewController.h; sourceTree = ""; }; 60 | 6003F5A6195388D20070C39A /* WKViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WKViewController.m; sourceTree = ""; }; 61 | 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 62 | 6003F5AE195388D20070C39A /* WKJavaScriptBridge_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WKJavaScriptBridge_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 63 | 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 64 | 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; 65 | 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 66 | 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = ""; }; 67 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; 68 | 61FCBE622911F16EAE21EEDC /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 69 | 71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 70 | 83F53EF5250EFFB3008B0321 /* WKCommonPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKCommonPlugin.h; sourceTree = ""; }; 71 | 83F53EF7250EFFB3008B0321 /* TestSecurityPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestSecurityPlugin.m; sourceTree = ""; }; 72 | 83F53EF8250EFFB3008B0321 /* TestWebPluginSecurityConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestWebPluginSecurityConfig.h; sourceTree = ""; }; 73 | 83F53EF9250EFFB3008B0321 /* TestSecurityPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestSecurityPlugin.h; sourceTree = ""; }; 74 | 83F53EFA250EFFB3008B0321 /* TestPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestPlugin.m; sourceTree = ""; }; 75 | 83F53EFB250EFFB3008B0321 /* WKCommonPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WKCommonPlugin.m; sourceTree = ""; }; 76 | 83F53EFC250EFFB3008B0321 /* TestPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestPlugin.h; sourceTree = ""; }; 77 | 83F53F00250EFFC5008B0321 /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = index.html; sourceTree = ""; }; 78 | 83F53F02250F0136008B0321 /* WKJSBridge.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = WKJSBridge.js; sourceTree = ""; }; 79 | 86A22B218D3CFD606912451D /* Pods_WKJavaScriptBridge_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_WKJavaScriptBridge_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 80 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 81 | 92142D68D116C7CE45F4713A /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 82 | BC1335159DC9AD10901908FC /* Pods-WKJavaScriptBridge_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WKJavaScriptBridge_Example.debug.xcconfig"; path = "Target Support Files/Pods-WKJavaScriptBridge_Example/Pods-WKJavaScriptBridge_Example.debug.xcconfig"; sourceTree = ""; }; 83 | C81FD33F66658FB090696698 /* Pods_WKJavaScriptBridge_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_WKJavaScriptBridge_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 84 | /* End PBXFileReference section */ 85 | 86 | /* Begin PBXFrameworksBuildPhase section */ 87 | 6003F587195388D20070C39A /* Frameworks */ = { 88 | isa = PBXFrameworksBuildPhase; 89 | buildActionMask = 2147483647; 90 | files = ( 91 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, 92 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, 93 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, 94 | 631ECE893F6CFF6B28B3E7B1 /* Pods_WKJavaScriptBridge_Example.framework in Frameworks */, 95 | ); 96 | runOnlyForDeploymentPostprocessing = 0; 97 | }; 98 | 6003F5AB195388D20070C39A /* Frameworks */ = { 99 | isa = PBXFrameworksBuildPhase; 100 | buildActionMask = 2147483647; 101 | files = ( 102 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, 103 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, 104 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, 105 | 1EDAA9BE5DCF363024F58224 /* Pods_WKJavaScriptBridge_Tests.framework in Frameworks */, 106 | ); 107 | runOnlyForDeploymentPostprocessing = 0; 108 | }; 109 | /* End PBXFrameworksBuildPhase section */ 110 | 111 | /* Begin PBXGroup section */ 112 | 6003F581195388D10070C39A = { 113 | isa = PBXGroup; 114 | children = ( 115 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */, 116 | 6003F593195388D20070C39A /* Example for WKJavaScriptBridge */, 117 | 6003F5B5195388D20070C39A /* Tests */, 118 | 6003F58C195388D20070C39A /* Frameworks */, 119 | 6003F58B195388D20070C39A /* Products */, 120 | C74692C90E0E9C0B97DAA53D /* Pods */, 121 | ); 122 | sourceTree = ""; 123 | }; 124 | 6003F58B195388D20070C39A /* Products */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 6003F58A195388D20070C39A /* WKJavaScriptBridge_Example.app */, 128 | 6003F5AE195388D20070C39A /* WKJavaScriptBridge_Tests.xctest */, 129 | ); 130 | name = Products; 131 | sourceTree = ""; 132 | }; 133 | 6003F58C195388D20070C39A /* Frameworks */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | 6003F58D195388D20070C39A /* Foundation.framework */, 137 | 6003F58F195388D20070C39A /* CoreGraphics.framework */, 138 | 6003F591195388D20070C39A /* UIKit.framework */, 139 | 6003F5AF195388D20070C39A /* XCTest.framework */, 140 | C81FD33F66658FB090696698 /* Pods_WKJavaScriptBridge_Example.framework */, 141 | 86A22B218D3CFD606912451D /* Pods_WKJavaScriptBridge_Tests.framework */, 142 | ); 143 | name = Frameworks; 144 | sourceTree = ""; 145 | }; 146 | 6003F593195388D20070C39A /* Example for WKJavaScriptBridge */ = { 147 | isa = PBXGroup; 148 | children = ( 149 | 83F53EF4250EFFB3008B0321 /* NativePlugin */, 150 | 6003F59C195388D20070C39A /* WKAppDelegate.h */, 151 | 6003F59D195388D20070C39A /* WKAppDelegate.m */, 152 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */, 153 | 6003F5A5195388D20070C39A /* WKViewController.h */, 154 | 6003F5A6195388D20070C39A /* WKViewController.m */, 155 | 83F53F00250EFFC5008B0321 /* index.html */, 156 | 83F53F02250F0136008B0321 /* WKJSBridge.js */, 157 | 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */, 158 | 6003F5A8195388D20070C39A /* Images.xcassets */, 159 | 6003F594195388D20070C39A /* Supporting Files */, 160 | ); 161 | name = "Example for WKJavaScriptBridge"; 162 | path = WKJavaScriptBridge; 163 | sourceTree = ""; 164 | }; 165 | 6003F594195388D20070C39A /* Supporting Files */ = { 166 | isa = PBXGroup; 167 | children = ( 168 | 6003F595195388D20070C39A /* WKJavaScriptBridge-Info.plist */, 169 | 6003F596195388D20070C39A /* InfoPlist.strings */, 170 | 6003F599195388D20070C39A /* main.m */, 171 | 6003F59B195388D20070C39A /* WKJavaScriptBridge-Prefix.pch */, 172 | ); 173 | name = "Supporting Files"; 174 | sourceTree = ""; 175 | }; 176 | 6003F5B5195388D20070C39A /* Tests */ = { 177 | isa = PBXGroup; 178 | children = ( 179 | 6003F5BB195388D20070C39A /* Tests.m */, 180 | 6003F5B6195388D20070C39A /* Supporting Files */, 181 | ); 182 | path = Tests; 183 | sourceTree = ""; 184 | }; 185 | 6003F5B6195388D20070C39A /* Supporting Files */ = { 186 | isa = PBXGroup; 187 | children = ( 188 | 6003F5B7195388D20070C39A /* Tests-Info.plist */, 189 | 6003F5B8195388D20070C39A /* InfoPlist.strings */, 190 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */, 191 | ); 192 | name = "Supporting Files"; 193 | sourceTree = ""; 194 | }; 195 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { 196 | isa = PBXGroup; 197 | children = ( 198 | 03D8C67F75C319920C51C1F5 /* WKJavaScriptBridge.podspec */, 199 | 61FCBE622911F16EAE21EEDC /* README.md */, 200 | 92142D68D116C7CE45F4713A /* LICENSE */, 201 | ); 202 | name = "Podspec Metadata"; 203 | sourceTree = ""; 204 | }; 205 | 83F53EF4250EFFB3008B0321 /* NativePlugin */ = { 206 | isa = PBXGroup; 207 | children = ( 208 | 83F53EF6250EFFB3008B0321 /* Security */, 209 | 83F53EFA250EFFB3008B0321 /* TestPlugin.m */, 210 | 83F53EFC250EFFB3008B0321 /* TestPlugin.h */, 211 | 83F53EF5250EFFB3008B0321 /* WKCommonPlugin.h */, 212 | 83F53EFB250EFFB3008B0321 /* WKCommonPlugin.m */, 213 | ); 214 | path = NativePlugin; 215 | sourceTree = ""; 216 | }; 217 | 83F53EF6250EFFB3008B0321 /* Security */ = { 218 | isa = PBXGroup; 219 | children = ( 220 | 83F53EF8250EFFB3008B0321 /* TestWebPluginSecurityConfig.h */, 221 | 83F53EF7250EFFB3008B0321 /* TestSecurityPlugin.m */, 222 | 83F53EF9250EFFB3008B0321 /* TestSecurityPlugin.h */, 223 | ); 224 | path = Security; 225 | sourceTree = ""; 226 | }; 227 | C74692C90E0E9C0B97DAA53D /* Pods */ = { 228 | isa = PBXGroup; 229 | children = ( 230 | BC1335159DC9AD10901908FC /* Pods-WKJavaScriptBridge_Example.debug.xcconfig */, 231 | 3FE1E5AD60555277E56091E2 /* Pods-WKJavaScriptBridge_Example.release.xcconfig */, 232 | 3DE9B6B533B90FF6E2EEDC2F /* Pods-WKJavaScriptBridge_Tests.debug.xcconfig */, 233 | 1676BACDF544EC174D2EE1C3 /* Pods-WKJavaScriptBridge_Tests.release.xcconfig */, 234 | ); 235 | path = Pods; 236 | sourceTree = ""; 237 | }; 238 | /* End PBXGroup section */ 239 | 240 | /* Begin PBXNativeTarget section */ 241 | 6003F589195388D20070C39A /* WKJavaScriptBridge_Example */ = { 242 | isa = PBXNativeTarget; 243 | buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "WKJavaScriptBridge_Example" */; 244 | buildPhases = ( 245 | 2A5D66C0B451A8F7B6EA9130 /* [CP] Check Pods Manifest.lock */, 246 | 6003F586195388D20070C39A /* Sources */, 247 | 6003F587195388D20070C39A /* Frameworks */, 248 | 6003F588195388D20070C39A /* Resources */, 249 | 0557EFF8257E8E021A35371A /* [CP] Embed Pods Frameworks */, 250 | ); 251 | buildRules = ( 252 | ); 253 | dependencies = ( 254 | ); 255 | name = WKJavaScriptBridge_Example; 256 | productName = WKJavaScriptBridge; 257 | productReference = 6003F58A195388D20070C39A /* WKJavaScriptBridge_Example.app */; 258 | productType = "com.apple.product-type.application"; 259 | }; 260 | 6003F5AD195388D20070C39A /* WKJavaScriptBridge_Tests */ = { 261 | isa = PBXNativeTarget; 262 | buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "WKJavaScriptBridge_Tests" */; 263 | buildPhases = ( 264 | 0657025DFA32CED84D3527AD /* [CP] Check Pods Manifest.lock */, 265 | 6003F5AA195388D20070C39A /* Sources */, 266 | 6003F5AB195388D20070C39A /* Frameworks */, 267 | 6003F5AC195388D20070C39A /* Resources */, 268 | ); 269 | buildRules = ( 270 | ); 271 | dependencies = ( 272 | 6003F5B4195388D20070C39A /* PBXTargetDependency */, 273 | ); 274 | name = WKJavaScriptBridge_Tests; 275 | productName = WKJavaScriptBridgeTests; 276 | productReference = 6003F5AE195388D20070C39A /* WKJavaScriptBridge_Tests.xctest */; 277 | productType = "com.apple.product-type.bundle.unit-test"; 278 | }; 279 | /* End PBXNativeTarget section */ 280 | 281 | /* Begin PBXProject section */ 282 | 6003F582195388D10070C39A /* Project object */ = { 283 | isa = PBXProject; 284 | attributes = { 285 | CLASSPREFIX = WK; 286 | LastUpgradeCheck = 0720; 287 | ORGANIZATIONNAME = GitWangKai; 288 | TargetAttributes = { 289 | 6003F5AD195388D20070C39A = { 290 | TestTargetID = 6003F589195388D20070C39A; 291 | }; 292 | }; 293 | }; 294 | buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "WKJavaScriptBridge" */; 295 | compatibilityVersion = "Xcode 3.2"; 296 | developmentRegion = English; 297 | hasScannedForEncodings = 0; 298 | knownRegions = ( 299 | English, 300 | en, 301 | Base, 302 | ); 303 | mainGroup = 6003F581195388D10070C39A; 304 | productRefGroup = 6003F58B195388D20070C39A /* Products */; 305 | projectDirPath = ""; 306 | projectRoot = ""; 307 | targets = ( 308 | 6003F589195388D20070C39A /* WKJavaScriptBridge_Example */, 309 | 6003F5AD195388D20070C39A /* WKJavaScriptBridge_Tests */, 310 | ); 311 | }; 312 | /* End PBXProject section */ 313 | 314 | /* Begin PBXResourcesBuildPhase section */ 315 | 6003F588195388D20070C39A /* Resources */ = { 316 | isa = PBXResourcesBuildPhase; 317 | buildActionMask = 2147483647; 318 | files = ( 319 | 83F53F03250F0136008B0321 /* WKJSBridge.js in Resources */, 320 | 83F53F01250EFFC5008B0321 /* index.html in Resources */, 321 | 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */, 322 | 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */, 323 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */, 324 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, 325 | ); 326 | runOnlyForDeploymentPostprocessing = 0; 327 | }; 328 | 6003F5AC195388D20070C39A /* Resources */ = { 329 | isa = PBXResourcesBuildPhase; 330 | buildActionMask = 2147483647; 331 | files = ( 332 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, 333 | ); 334 | runOnlyForDeploymentPostprocessing = 0; 335 | }; 336 | /* End PBXResourcesBuildPhase section */ 337 | 338 | /* Begin PBXShellScriptBuildPhase section */ 339 | 0557EFF8257E8E021A35371A /* [CP] Embed Pods Frameworks */ = { 340 | isa = PBXShellScriptBuildPhase; 341 | buildActionMask = 2147483647; 342 | files = ( 343 | ); 344 | inputPaths = ( 345 | "${PODS_ROOT}/Target Support Files/Pods-WKJavaScriptBridge_Example/Pods-WKJavaScriptBridge_Example-frameworks.sh", 346 | "${BUILT_PRODUCTS_DIR}/WKJavaScriptBridge/WKJavaScriptBridge.framework", 347 | ); 348 | name = "[CP] Embed Pods Frameworks"; 349 | outputPaths = ( 350 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/WKJavaScriptBridge.framework", 351 | ); 352 | runOnlyForDeploymentPostprocessing = 0; 353 | shellPath = /bin/sh; 354 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-WKJavaScriptBridge_Example/Pods-WKJavaScriptBridge_Example-frameworks.sh\"\n"; 355 | showEnvVarsInLog = 0; 356 | }; 357 | 0657025DFA32CED84D3527AD /* [CP] Check Pods Manifest.lock */ = { 358 | isa = PBXShellScriptBuildPhase; 359 | buildActionMask = 2147483647; 360 | files = ( 361 | ); 362 | inputFileListPaths = ( 363 | ); 364 | inputPaths = ( 365 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 366 | "${PODS_ROOT}/Manifest.lock", 367 | ); 368 | name = "[CP] Check Pods Manifest.lock"; 369 | outputFileListPaths = ( 370 | ); 371 | outputPaths = ( 372 | "$(DERIVED_FILE_DIR)/Pods-WKJavaScriptBridge_Tests-checkManifestLockResult.txt", 373 | ); 374 | runOnlyForDeploymentPostprocessing = 0; 375 | shellPath = /bin/sh; 376 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 377 | showEnvVarsInLog = 0; 378 | }; 379 | 2A5D66C0B451A8F7B6EA9130 /* [CP] Check Pods Manifest.lock */ = { 380 | isa = PBXShellScriptBuildPhase; 381 | buildActionMask = 2147483647; 382 | files = ( 383 | ); 384 | inputFileListPaths = ( 385 | ); 386 | inputPaths = ( 387 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 388 | "${PODS_ROOT}/Manifest.lock", 389 | ); 390 | name = "[CP] Check Pods Manifest.lock"; 391 | outputFileListPaths = ( 392 | ); 393 | outputPaths = ( 394 | "$(DERIVED_FILE_DIR)/Pods-WKJavaScriptBridge_Example-checkManifestLockResult.txt", 395 | ); 396 | runOnlyForDeploymentPostprocessing = 0; 397 | shellPath = /bin/sh; 398 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 399 | showEnvVarsInLog = 0; 400 | }; 401 | /* End PBXShellScriptBuildPhase section */ 402 | 403 | /* Begin PBXSourcesBuildPhase section */ 404 | 6003F586195388D20070C39A /* Sources */ = { 405 | isa = PBXSourcesBuildPhase; 406 | buildActionMask = 2147483647; 407 | files = ( 408 | 6003F59E195388D20070C39A /* WKAppDelegate.m in Sources */, 409 | 83F53EFF250EFFB3008B0321 /* WKCommonPlugin.m in Sources */, 410 | 6003F5A7195388D20070C39A /* WKViewController.m in Sources */, 411 | 83F53EFD250EFFB3008B0321 /* TestSecurityPlugin.m in Sources */, 412 | 6003F59A195388D20070C39A /* main.m in Sources */, 413 | 83F53EFE250EFFB3008B0321 /* TestPlugin.m in Sources */, 414 | ); 415 | runOnlyForDeploymentPostprocessing = 0; 416 | }; 417 | 6003F5AA195388D20070C39A /* Sources */ = { 418 | isa = PBXSourcesBuildPhase; 419 | buildActionMask = 2147483647; 420 | files = ( 421 | 6003F5BC195388D20070C39A /* Tests.m in Sources */, 422 | ); 423 | runOnlyForDeploymentPostprocessing = 0; 424 | }; 425 | /* End PBXSourcesBuildPhase section */ 426 | 427 | /* Begin PBXTargetDependency section */ 428 | 6003F5B4195388D20070C39A /* PBXTargetDependency */ = { 429 | isa = PBXTargetDependency; 430 | target = 6003F589195388D20070C39A /* WKJavaScriptBridge_Example */; 431 | targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */; 432 | }; 433 | /* End PBXTargetDependency section */ 434 | 435 | /* Begin PBXVariantGroup section */ 436 | 6003F596195388D20070C39A /* InfoPlist.strings */ = { 437 | isa = PBXVariantGroup; 438 | children = ( 439 | 6003F597195388D20070C39A /* en */, 440 | ); 441 | name = InfoPlist.strings; 442 | sourceTree = ""; 443 | }; 444 | 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { 445 | isa = PBXVariantGroup; 446 | children = ( 447 | 6003F5B9195388D20070C39A /* en */, 448 | ); 449 | name = InfoPlist.strings; 450 | sourceTree = ""; 451 | }; 452 | 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */ = { 453 | isa = PBXVariantGroup; 454 | children = ( 455 | 71719F9E1E33DC2100824A3D /* Base */, 456 | ); 457 | name = LaunchScreen.storyboard; 458 | sourceTree = ""; 459 | }; 460 | /* End PBXVariantGroup section */ 461 | 462 | /* Begin XCBuildConfiguration section */ 463 | 6003F5BD195388D20070C39A /* Debug */ = { 464 | isa = XCBuildConfiguration; 465 | buildSettings = { 466 | ALWAYS_SEARCH_USER_PATHS = NO; 467 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 468 | CLANG_CXX_LIBRARY = "libc++"; 469 | CLANG_ENABLE_MODULES = YES; 470 | CLANG_ENABLE_OBJC_ARC = YES; 471 | CLANG_WARN_BOOL_CONVERSION = YES; 472 | CLANG_WARN_CONSTANT_CONVERSION = YES; 473 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 474 | CLANG_WARN_EMPTY_BODY = YES; 475 | CLANG_WARN_ENUM_CONVERSION = YES; 476 | CLANG_WARN_INT_CONVERSION = YES; 477 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 478 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 479 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 480 | COPY_PHASE_STRIP = NO; 481 | ENABLE_TESTABILITY = YES; 482 | GCC_C_LANGUAGE_STANDARD = gnu99; 483 | GCC_DYNAMIC_NO_PIC = NO; 484 | GCC_OPTIMIZATION_LEVEL = 0; 485 | GCC_PREPROCESSOR_DEFINITIONS = ( 486 | "DEBUG=1", 487 | "$(inherited)", 488 | ); 489 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 490 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 491 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 492 | GCC_WARN_UNDECLARED_SELECTOR = YES; 493 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 494 | GCC_WARN_UNUSED_FUNCTION = YES; 495 | GCC_WARN_UNUSED_VARIABLE = YES; 496 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 497 | ONLY_ACTIVE_ARCH = YES; 498 | SDKROOT = iphoneos; 499 | TARGETED_DEVICE_FAMILY = "1,2"; 500 | }; 501 | name = Debug; 502 | }; 503 | 6003F5BE195388D20070C39A /* Release */ = { 504 | isa = XCBuildConfiguration; 505 | buildSettings = { 506 | ALWAYS_SEARCH_USER_PATHS = NO; 507 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 508 | CLANG_CXX_LIBRARY = "libc++"; 509 | CLANG_ENABLE_MODULES = YES; 510 | CLANG_ENABLE_OBJC_ARC = YES; 511 | CLANG_WARN_BOOL_CONVERSION = YES; 512 | CLANG_WARN_CONSTANT_CONVERSION = YES; 513 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 514 | CLANG_WARN_EMPTY_BODY = YES; 515 | CLANG_WARN_ENUM_CONVERSION = YES; 516 | CLANG_WARN_INT_CONVERSION = YES; 517 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 518 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 519 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 520 | COPY_PHASE_STRIP = YES; 521 | ENABLE_NS_ASSERTIONS = NO; 522 | GCC_C_LANGUAGE_STANDARD = gnu99; 523 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 524 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 525 | GCC_WARN_UNDECLARED_SELECTOR = YES; 526 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 527 | GCC_WARN_UNUSED_FUNCTION = YES; 528 | GCC_WARN_UNUSED_VARIABLE = YES; 529 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 530 | SDKROOT = iphoneos; 531 | TARGETED_DEVICE_FAMILY = "1,2"; 532 | VALIDATE_PRODUCT = YES; 533 | }; 534 | name = Release; 535 | }; 536 | 6003F5C0195388D20070C39A /* Debug */ = { 537 | isa = XCBuildConfiguration; 538 | baseConfigurationReference = BC1335159DC9AD10901908FC /* Pods-WKJavaScriptBridge_Example.debug.xcconfig */; 539 | buildSettings = { 540 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 541 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 542 | GCC_PREFIX_HEADER = "WKJavaScriptBridge/WKJavaScriptBridge-Prefix.pch"; 543 | INFOPLIST_FILE = "WKJavaScriptBridge/WKJavaScriptBridge-Info.plist"; 544 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 545 | MODULE_NAME = ExampleApp; 546 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 547 | PRODUCT_NAME = "$(TARGET_NAME)"; 548 | SWIFT_VERSION = 4.0; 549 | WRAPPER_EXTENSION = app; 550 | }; 551 | name = Debug; 552 | }; 553 | 6003F5C1195388D20070C39A /* Release */ = { 554 | isa = XCBuildConfiguration; 555 | baseConfigurationReference = 3FE1E5AD60555277E56091E2 /* Pods-WKJavaScriptBridge_Example.release.xcconfig */; 556 | buildSettings = { 557 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 558 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 559 | GCC_PREFIX_HEADER = "WKJavaScriptBridge/WKJavaScriptBridge-Prefix.pch"; 560 | INFOPLIST_FILE = "WKJavaScriptBridge/WKJavaScriptBridge-Info.plist"; 561 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 562 | MODULE_NAME = ExampleApp; 563 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 564 | PRODUCT_NAME = "$(TARGET_NAME)"; 565 | SWIFT_VERSION = 4.0; 566 | WRAPPER_EXTENSION = app; 567 | }; 568 | name = Release; 569 | }; 570 | 6003F5C3195388D20070C39A /* Debug */ = { 571 | isa = XCBuildConfiguration; 572 | baseConfigurationReference = 3DE9B6B533B90FF6E2EEDC2F /* Pods-WKJavaScriptBridge_Tests.debug.xcconfig */; 573 | buildSettings = { 574 | BUNDLE_LOADER = "$(TEST_HOST)"; 575 | FRAMEWORK_SEARCH_PATHS = ( 576 | "$(PLATFORM_DIR)/Developer/Library/Frameworks", 577 | "$(inherited)", 578 | "$(DEVELOPER_FRAMEWORKS_DIR)", 579 | ); 580 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 581 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 582 | GCC_PREPROCESSOR_DEFINITIONS = ( 583 | "DEBUG=1", 584 | "$(inherited)", 585 | ); 586 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 587 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 588 | PRODUCT_NAME = "$(TARGET_NAME)"; 589 | SWIFT_VERSION = 4.0; 590 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WKJavaScriptBridge_Example.app/WKJavaScriptBridge_Example"; 591 | WRAPPER_EXTENSION = xctest; 592 | }; 593 | name = Debug; 594 | }; 595 | 6003F5C4195388D20070C39A /* Release */ = { 596 | isa = XCBuildConfiguration; 597 | baseConfigurationReference = 1676BACDF544EC174D2EE1C3 /* Pods-WKJavaScriptBridge_Tests.release.xcconfig */; 598 | buildSettings = { 599 | BUNDLE_LOADER = "$(TEST_HOST)"; 600 | FRAMEWORK_SEARCH_PATHS = ( 601 | "$(PLATFORM_DIR)/Developer/Library/Frameworks", 602 | "$(inherited)", 603 | "$(DEVELOPER_FRAMEWORKS_DIR)", 604 | ); 605 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 606 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 607 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 608 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 609 | PRODUCT_NAME = "$(TARGET_NAME)"; 610 | SWIFT_VERSION = 4.0; 611 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WKJavaScriptBridge_Example.app/WKJavaScriptBridge_Example"; 612 | WRAPPER_EXTENSION = xctest; 613 | }; 614 | name = Release; 615 | }; 616 | /* End XCBuildConfiguration section */ 617 | 618 | /* Begin XCConfigurationList section */ 619 | 6003F585195388D10070C39A /* Build configuration list for PBXProject "WKJavaScriptBridge" */ = { 620 | isa = XCConfigurationList; 621 | buildConfigurations = ( 622 | 6003F5BD195388D20070C39A /* Debug */, 623 | 6003F5BE195388D20070C39A /* Release */, 624 | ); 625 | defaultConfigurationIsVisible = 0; 626 | defaultConfigurationName = Release; 627 | }; 628 | 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "WKJavaScriptBridge_Example" */ = { 629 | isa = XCConfigurationList; 630 | buildConfigurations = ( 631 | 6003F5C0195388D20070C39A /* Debug */, 632 | 6003F5C1195388D20070C39A /* Release */, 633 | ); 634 | defaultConfigurationIsVisible = 0; 635 | defaultConfigurationName = Release; 636 | }; 637 | 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "WKJavaScriptBridge_Tests" */ = { 638 | isa = XCConfigurationList; 639 | buildConfigurations = ( 640 | 6003F5C3195388D20070C39A /* Debug */, 641 | 6003F5C4195388D20070C39A /* Release */, 642 | ); 643 | defaultConfigurationIsVisible = 0; 644 | defaultConfigurationName = Release; 645 | }; 646 | /* End XCConfigurationList section */ 647 | }; 648 | rootObject = 6003F582195388D10070C39A /* Project object */; 649 | } 650 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge.xcodeproj/xcshareddata/xcschemes/WKJavaScriptBridge-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 85 | 91 | 92 | 93 | 94 | 96 | 97 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge.xcworkspace/xcuserdata/wangkai.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/illusionspaces/WKJavaScriptBridge/54972b09d7ef602d77e6c3be23253ff81a189461/Example/WKJavaScriptBridge.xcworkspace/xcuserdata/wangkai.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge.xcworkspace/xcuserdata/wangkai.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge/NativePlugin/Security/TestSecurityPlugin.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestSecurityPlugin.h 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2020/6/2. 6 | // Copyright © 2020 王凯. All rights reserved. 7 | // 8 | 9 | #import "WKBasePlugin.h" 10 | #import "TestWebPluginSecurityConfig.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface TestSecurityPlugin : WKBasePlugin 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge/NativePlugin/Security/TestSecurityPlugin.m: -------------------------------------------------------------------------------- 1 | // 2 | // TestSecurityPlugin.m 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2020/6/2. 6 | // Copyright © 2020 王凯. All rights reserved. 7 | // 8 | 9 | #import "TestSecurityPlugin.h" 10 | 11 | @interface TestSecurityPlugin () 12 | 13 | @property (nonatomic, strong) NSMutableDictionary *securityConfig;//白名单注册表 14 | @property (nonatomic, strong) NSRecursiveLock *lock; 15 | 16 | @end 17 | 18 | NSString *const kPluginSecurityActionKey = @"action"; 19 | NSString *const kPluginSecuritylevelKey = @"level"; 20 | 21 | @implementation TestSecurityPlugin 22 | 23 | #pragma mark - Override 24 | 25 | - (void)pluginInitialize { 26 | self.securityConfig = [[NSMutableDictionary alloc] initWithCapacity:20]; 27 | self.lock = [[NSRecursiveLock alloc] init]; 28 | } 29 | 30 | #pragma mark - Privite 31 | /* 32 | 解析配置表 33 | */ 34 | - (void)pluginSecurityInfomation:(NSArray*)secInfo { 35 | for (NSString *map in secInfo) { 36 | NSData *jsonData = [map dataUsingEncoding:NSUTF8StringEncoding]; 37 | NSError *error = nil; 38 | id json = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:&error]; 39 | if (error) { 40 | return; 41 | } 42 | 43 | if (![json isKindOfClass:[NSArray class]] || [json allObjects].count < 3) { 44 | return; 45 | } 46 | 47 | NSString *service = [json objectAtIndex:0]; 48 | NSString *action = [json objectAtIndex:1]; 49 | NSString *level = [json objectAtIndex:2]; 50 | 51 | if (service && action && level) { 52 | [self.lock lock]; 53 | if (!self.securityConfig[service]) { 54 | self.securityConfig[service] = [NSMutableArray new]; 55 | } 56 | 57 | NSMutableArray *whiteListForService = self.securityConfig[service]; 58 | NSMutableDictionary *whiteListForActions = [NSMutableDictionary new]; 59 | if (action) whiteListForActions[kPluginSecurityActionKey] = [action copy]; 60 | if (level) whiteListForActions[kPluginSecuritylevelKey] = [level copy]; 61 | [whiteListForService addObject:whiteListForActions]; 62 | self.securityConfig[service] = whiteListForService; 63 | [self.lock unlock]; 64 | } 65 | } 66 | } 67 | 68 | #pragma mark - PHPluginSecurityProtocol 69 | 70 | /** 71 | 判断权限 72 | */ 73 | - (void)applyAuthorityWithService:(NSString *)serviceName action:(NSString *)actionName securityInfomation:(nonnull NSArray *)secInfo complete:(PHJudgeAuthorityComplete)completionHandler { 74 | // 获取到了service、action和安全配置信息,具体怎么处理按照业务逻辑定 75 | // 获取当前加载的url 76 | WKWebView *webview = [self.commandDelegate webView]; 77 | NSURL *url = webview.URL; 78 | NSString *webUri = url.absoluteString; 79 | NSLog(@"uri : %@",webUri); 80 | // 获取url权限等级 81 | // ... 82 | NSInteger auth = 4; 83 | 84 | // 解析 85 | [self pluginSecurityInfomation:secInfo]; 86 | 87 | [self.lock lock]; 88 | NSArray *securityConfigForService = [self.securityConfig[serviceName] copy]; 89 | [self.lock unlock]; 90 | NSLog(@"whiteListForService:%@",securityConfigForService); 91 | 92 | //service不在配置名单内,默认不允许访问 93 | if (!securityConfigForService || 94 | ![securityConfigForService isKindOfClass:[NSArray class]] || 95 | securityConfigForService.count < 1) { 96 | 97 | if (completionHandler) completionHandler(NO); 98 | return ; 99 | } 100 | 101 | BOOL isRegist = NO; 102 | for (NSDictionary *plugin in securityConfigForService) { 103 | 104 | NSString *registerAction = plugin[kPluginSecurityActionKey]; 105 | NSString *registerLevel = plugin[kPluginSecuritylevelKey]; 106 | NSLog(@"%@",plugin); 107 | if ([registerAction isEqualToString:actionName]) { 108 | // 注册了看级别,级别越小权限越大 109 | if (completionHandler) { 110 | (auth > [registerLevel integerValue]) ? completionHandler(NO) : completionHandler(YES); 111 | } 112 | isRegist = YES; 113 | break; 114 | } 115 | } 116 | // action不在配置名单内,默认不允许访问 117 | if (!isRegist) { 118 | if (completionHandler) completionHandler(NO); 119 | } 120 | } 121 | 122 | 123 | @end 124 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge/NativePlugin/Security/TestWebPluginSecurityConfig.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestWebPluginSecurityConfig.h 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2020/6/2. 6 | // Copyright © 2020 王凯. All rights reserved. 7 | // 8 | 9 | #import "WKJavaScriptBridgePluginAnnotation.h" 10 | 11 | #ifndef TestWebPluginSecurityConfig_h 12 | #define TestWebPluginSecurityConfig_h 13 | 14 | // 配置安全插件 15 | //@WKConfigSafePlugin(TestSecurityPlugin) 16 | 17 | // 配置插件白名单:类名 方法名 安全级别 18 | // B级 19 | @WKConfigPluginSafeLevel(WKCommonPlugin,asyncTestSecurity,2) 20 | // C级 21 | @WKConfigPluginSafeLevel(WKCommonPlugin,asynDisplayCommon,3) 22 | 23 | #endif /* TestWebPluginSecurityConfig_h */ 24 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge/NativePlugin/TestPlugin.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestPlugin.h 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2020/6/2. 6 | // Copyright © 2020 王凯. All rights reserved. 7 | // 8 | 9 | #import "WKBasePlugin.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TestPlugin : WKBasePlugin 14 | 15 | - (void)testSecurity:(WKMsgCommand *)command; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge/NativePlugin/TestPlugin.m: -------------------------------------------------------------------------------- 1 | // 2 | // TestPlugin.m 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2020/6/2. 6 | // Copyright © 2020 王凯. All rights reserved. 7 | // 8 | 9 | #import "TestPlugin.h" 10 | 11 | @implementation TestPlugin 12 | 13 | - (void)testSecurity:(WKMsgCommand *)command { 14 | 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge/NativePlugin/WKCommonPlugin.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKCommonPlugin.h 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2019/10/22. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "WKBasePlugin.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface WKCommonPlugin : WKBasePlugin 14 | 15 | - (void)asynDisplayCommon:(WKMsgCommand *)command; 16 | 17 | - (void)asyncTestSecurity:(WKMsgCommand *)command; 18 | 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge/NativePlugin/WKCommonPlugin.m: -------------------------------------------------------------------------------- 1 | // 2 | // WKCommonPlugin.m 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2019/10/22. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "WKCommonPlugin.h" 10 | 11 | @implementation WKCommonPlugin 12 | 13 | - (void)asynDisplayCommon:(WKMsgCommand *)command { 14 | NSString *string = [command.arguments objectForKey:@"url"]; 15 | NSLog(@"url : %@", string); 16 | 17 | WKPluginResult *result = [WKPluginResult resultWithStatus:WKJavaScriptBridgeCommandStatus_ERROR messageAsDictionary:@{@"result": @"success!!"}]; 18 | [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; 19 | } 20 | 21 | 22 | - (void)asyncTestSecurity:(WKMsgCommand *)command { 23 | NSString *string = [command.arguments objectForKey:@"security"]; 24 | NSLog(@"security : %@", string); 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge/WKAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKAppDelegate.h 3 | // WKJavaScriptBridge 4 | // 5 | // Created by GitWangKai on 09/14/2020. 6 | // Copyright (c) 2020 GitWangKai. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface WKAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge/WKAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // WKAppDelegate.m 3 | // WKJavaScriptBridge 4 | // 5 | // Created by GitWangKai on 09/14/2020. 6 | // Copyright (c) 2020 GitWangKai. All rights reserved. 7 | // 8 | 9 | #import "WKAppDelegate.h" 10 | 11 | @implementation WKAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge/WKJSBridge.js: -------------------------------------------------------------------------------- 1 | ; 2 | (function (window) { 3 | ; 4 | var WKJSBridge = /** @class */ (function () { 5 | function WKJSBridge() { 6 | this.uniqueId = 1; 7 | this.callbackCache = {}; 8 | this.eventCallbackCache = {}; 9 | } 10 | /** 11 | * 调用 Natvie 方法 12 | * @param service 模块 13 | * @param action 方法 14 | * @param actionArgs 数据 15 | * @param callback 调用回调 16 | */ 17 | WKJSBridge.prototype.callNative = function (service, action, actionArgs, successCallback, failCallback) { 18 | var message = { 19 | service: service || 'default', 20 | action: action, 21 | actionArgs: actionArgs, 22 | callbackId: null 23 | }; 24 | if (successCallback || failCallback) { 25 | // 拼装 callbackId 26 | var callbackId = 'cb_' + message.service + '_' + action + '_' + (this.uniqueId++) + '_' + new Date().getTime(); // 缓存 callback,用于在 Native 处理完消息后,通知 H5 27 | this.callbackCache[callbackId] = {success:successCallback, fail:failCallback};; 28 | // 追加 callbackId 属性 29 | message.callbackId = callbackId; 30 | } 31 | // 发送消息给 Native 32 | window.webkit.messageHandlers.WKJSBridgeMessageName.postMessage(JSON.stringify(message)); 33 | }; 34 | /** 35 | * 用于处理来自 Native 的消息 36 | * @param callbackMessage 回调消息 37 | */ 38 | WKJSBridge.prototype._handleMessageFromNative = function (messageString) { 39 | var callbackMessage = JSON.parse(messageString); 40 | var status = callbackMessage.status; 41 | var callback = this.callbackCache[callbackMessage.callbackId]; 42 | if (callback) { // 执行 callback 回调,并删除缓存的 callback 43 | if (status == 1) {//失败回调 44 | callback.fail(callbackMessage.data); 45 | }else {//成功回调 46 | callback.success(callbackMessage.data); 47 | } 48 | this.callbackCache[callbackMessage.callbackId] = null; 49 | delete this.callbackCache[callbackMessage.callbackId]; 50 | } 51 | 52 | }; 53 | return WKJSBridge; 54 | }()); 55 | // 初始化 KKJSBridge 56 | window.WKJSBridge = new WKJSBridge(); // 设置新的 JSBridge 作为全局对象 57 | })(window); 58 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge/WKJavaScriptBridge-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge/WKJavaScriptBridge-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | @import UIKit; 15 | @import Foundation; 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge/WKViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKViewController.h 3 | // WKJavaScriptBridge 4 | // 5 | // Created by GitWangKai on 09/14/2020. 6 | // Copyright (c) 2020 GitWangKai. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface WKViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge/WKViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // WKViewController.m 3 | // WKJavaScriptBridge 4 | // 5 | // Created by GitWangKai on 09/14/2020. 6 | // Copyright (c) 2020 GitWangKai. All rights reserved. 7 | // 8 | 9 | #import "WKViewController.h" 10 | #import 11 | #import "WKJavaScriptBridge.h" 12 | 13 | @interface WKViewController () 14 | @property (nonatomic, strong) WKJavaScriptBridge *bridge; 15 | @property (nonatomic, strong) WKWebView *webView; 16 | @property (nonatomic, strong) WKProcessPool *processPool; 17 | @property (nonatomic, assign, getter=loadFinished) BOOL isLoadFinished; 18 | @end 19 | 20 | @implementation WKViewController 21 | 22 | - (void)viewDidLoad 23 | { 24 | [super viewDidLoad]; 25 | // Do any additional setup after loading the view, typically from a nib. 26 | 27 | self.isLoadFinished = NO; 28 | /* 29 | 由于WKWebView在请求过程中用户可能退出界面销毁对象,当请求回调时由于接收处理对象不存在,造成Bad Access crash,所以可将WKProcessPool设为单例 30 | */ 31 | static WKProcessPool *_sharedWKProcessPoolInstance = nil; 32 | static dispatch_once_t onceToken; 33 | dispatch_once(&onceToken, ^{ 34 | _sharedWKProcessPoolInstance = [[WKProcessPool alloc] init]; 35 | }); 36 | self.processPool = _sharedWKProcessPoolInstance; 37 | 38 | WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init]; 39 | WKPreferences *preferences = [WKPreferences new]; 40 | preferences.javaScriptCanOpenWindowsAutomatically = YES; 41 | preferences.minimumFontSize = 40.0; 42 | configuration.preferences = preferences; 43 | configuration.processPool = self.processPool; 44 | WKWebView *webView = [[WKWebView alloc] initWithFrame:self.view.frame configuration:configuration]; 45 | self.webView = webView; 46 | webView.navigationDelegate = self; 47 | // [self addUserScript:webView]; 48 | /***/ 49 | self.bridge = [WKJavaScriptBridge bindBridgeWithWebView:webView]; 50 | /***/ 51 | [self.view addSubview:webView]; 52 | 53 | /* 54 | //解决首个请求cookie带不上的问题可以使用如下方式 55 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@""]]; 56 | [WKWebViewCookieMgr syncRequestCookie:request]; 57 | [webView loadRequest:request]; 58 | */ 59 | 60 | NSString *urlStr = [[NSBundle mainBundle] pathForResource:@"index.html" ofType:nil]; 61 | NSURL *fileURL = [NSURL fileURLWithPath:urlStr]; 62 | if (@available(iOS 9.0, *)) { 63 | [webView loadFileURL:fileURL allowingReadAccessToURL:fileURL]; 64 | } else { 65 | // Fallback on earlier versions 66 | } 67 | } 68 | 69 | - (void)viewWillAppear:(BOOL)animated { 70 | [super viewWillAppear:animated]; 71 | /* 72 | 解决调用系统相机等产生白屏,导致内存紧张,WebContent Process 被系统挂起,此时不会执行webViewWebContentProcessDidTerminate:函数 73 | */ 74 | if (!self.webView.title) { 75 | [self.webView reload]; 76 | } 77 | } 78 | 79 | - (void)viewDidAppear:(BOOL)animated { 80 | [super viewDidAppear:animated]; 81 | self.isLoadFinished = YES; 82 | } 83 | 84 | 85 | #pragma mark - WKNavigationDelegate 86 | 87 | - (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView { 88 | /* 89 | 解决内存过大引起的白屏问题 90 | */ 91 | [webView reload]; 92 | } 93 | 94 | - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler{ 95 | 96 | /* 97 | //如果是302重定向请求,此处拦截带上cookie重新request 98 | NSMutableURLRequest *newRequest = [WKWebViewCookieMgr newRequest:navigationAction.request]; 99 | [webView loadRequest:newRequest]; 100 | */ 101 | decisionHandler(WKNavigationActionPolicyAllow); 102 | } 103 | 104 | - (void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler { 105 | 106 | //解决window.alert() 时 completionHandler 没有被调用导致崩溃问题 107 | if (!self.isLoadFinished) { 108 | completionHandler(); 109 | return; 110 | } 111 | UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"" message:message preferredStyle:UIAlertControllerStyleAlert]; 112 | [alertController addAction:[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { completionHandler(); }]]; 113 | if (self) 114 | [self presentViewController:alertController animated:YES completion:^{}]; 115 | else 116 | completionHandler(); 117 | } 118 | 119 | 120 | @end 121 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | WKJSBridge 4 | 5 | 6 | 26 | 27 | 28 | 29 |

按钮调用

30 | 31 | 32 | 33 |

回调结果展示区

34 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Example/WKJavaScriptBridge/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // WKJavaScriptBridge 4 | // 5 | // Created by GitWangKai on 09/14/2020. 6 | // Copyright (c) 2020 GitWangKai. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | #import "WKAppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) 13 | { 14 | @autoreleasepool { 15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([WKAppDelegate class])); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 GitWangKai <18500052382@163.com> 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WKJavaScriptBridge 2 | 3 | 4 | [![Version](https://img.shields.io/cocoapods/v/WKJavaScriptBridge.svg?style=flat)](http://cocoapods.org/pods/WKJavaScriptBridge) 5 | [![Pod License](http://img.shields.io/cocoapods/l/WKJavaScriptBridge.svg?style=flat)](https://opensource.org/licenses/Apache-2.0) 6 | ![iOS 8.0+](https://img.shields.io/badge/iOS-8.0%2B-blue.svg) 7 | ![](https://img.shields.io/badge/language-objc-orange.svg) 8 | ![ARC](https://img.shields.io/badge/ARC-orange.svg) 9 | 10 | 11 | ## Link 12 | * Blog : 13 | 14 | [《写一个易于维护使用方便性能可靠的Hybrid框架》](https://juejin.im/post/5c07d95ee51d451d930b04c7) 15 | 16 | * v1.1.0 : 强化安全管理,增加安全插件,不配置不影响正常使用。配置方式参照DEMO。 17 | 18 | 19 | ## 特性 20 | 21 | - 一行代码集成。 22 | - 异步调用。 23 | - 支持业务模块化分离。 24 | - 支持业务模块白名单机制,提升安全性。 25 | 26 | 27 | ## 安装 28 | 29 | ### 方法一:Cocoapods 30 | - 1、: 31 | 32 | ```objc 33 | 在Podfile文件里面添加:pod 'WKJavaScriptBridge' 34 | ``` 35 | - 2、:对应文件添加头文件 36 | 37 | ```objc 38 | #import "WKJavaScriptBridge.h" 39 | ``` 40 | 41 | ### 方法二:手动添加 42 | - 1、下载WKJavaScriptBridge,将WKJavaScriptBridge文件夹拖入到你的工程中 43 | 44 | - 2、引入头文件: 45 | 46 | ```objc 47 | #import "WKJavaScriptBridge.h" 48 | ``` 49 | 50 | 51 | ## 用法 52 | - 1、: 53 | 54 | ```objc 55 | //在使用Bridge的类扩展中加入 56 | @property (nonatomic, strong) WKJavaScriptBridge *bridge; 57 | ``` 58 | - 2、: 59 | 60 | ```objc 61 | //在创建WKWebView的地方调用此方法,绑定你的WebView 62 | self.bridge = [WKJavaScriptBridge bindBridgeWithWebView:yourwebView]; 63 | ``` 64 | - 3、: 65 | 66 | ```objc 67 | h5页面引入: 68 | ``` 69 | - 4、: 70 | 71 | ```objc 72 | //H5调用Native: 73 | window.WKJSBridge.callNative(service, action, command, function success(res) {}, function fail(res) {}); 74 | service:Native类名 75 | action:Native方法名 76 | command:参数 77 | function success(res) {}:成功回调函数 78 | function fail(res) {}:失败回调函数 79 | 80 | //Native回调H5: 81 | - (void)sendPluginResult:(WKPluginResult *)result callbackId:(NSString*)callbackId; 82 | result:参数 83 | callbackId:H5传过来的回调ID 84 | ``` 85 | 86 | ## 延伸 87 | 88 | ```objc 89 | 构建小程序 90 | ``` 91 | 92 | ## License 93 | 94 | WKJavaScriptBridge is available under the Apache License 2.0. See the [LICENSE](https://github.com/GitWangKai/WKJavaScriptBridge/blob/master/LICENSE) file for more info. 95 | 96 | 97 | -------------------------------------------------------------------------------- /WKJavaScriptBridge.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |spec| 2 | spec.name = "WKJavaScriptBridge" 3 | spec.version = "1.1.1" 4 | spec.summary = "基于WKWebView构建的JSBridge,支持iOS8+。" 5 | spec.homepage = "https://github.com/GitWangKai/WKJavaScriptBridge" 6 | spec.license = { :type => "Apache License 2.0", :file => "LICENSE" } 7 | spec.author = { "王凯" => "18500052382@163.com" } 8 | spec.source = { :git => "https://github.com/GitWangKai/WKJavaScriptBridge.git", :tag => "#{spec.version}" } 9 | spec.source_files = "WKJavaScriptBridge-demo/WKJavaScriptBridge-demo/WKJavaScriptBridge/**/*" 10 | spec.platform = :ios, '8.0' 11 | spec.resources = "WKJavaScriptBridge/WKJSBridge.js" 12 | spec.frameworks = "WebKit" 13 | end 14 | -------------------------------------------------------------------------------- /WKJavaScriptBridge/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/illusionspaces/WKJavaScriptBridge/54972b09d7ef602d77e6c3be23253ff81a189461/WKJavaScriptBridge/Assets/.gitkeep -------------------------------------------------------------------------------- /WKJavaScriptBridge/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/illusionspaces/WKJavaScriptBridge/54972b09d7ef602d77e6c3be23253ff81a189461/WKJavaScriptBridge/Classes/.gitkeep -------------------------------------------------------------------------------- /WKJavaScriptBridge/Classes/Dispatcher/WKJavaScriptMessageDispatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKJavaScriptMessageDispatcher.h 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2019/10/22. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @class WKJavaScriptBridge; 14 | 15 | @interface WKJavaScriptMessageDispatcher : NSObject 16 | - (void)handleMsgCommand:(NSString *)arguments; 17 | - (instancetype)initWithBridge:(WKJavaScriptBridge *)bridge; 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /WKJavaScriptBridge/Classes/Dispatcher/WKJavaScriptMessageDispatcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // WKJavaScriptMessageDispatcher.m 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2019/10/22. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "WKJavaScriptMessageDispatcher.h" 10 | #import "WKMsgCommand.h" 11 | #import "WKJavaScriptBridge.h" 12 | #import "WKBasePlugin.h" 13 | #import "NSString+BridgeJSONPrivate.h" 14 | #import 15 | 16 | static const NSInteger JSON_SIZE_FOR_MAIN_THREAD = 4 * 1024; // Chosen arbitrarily. 17 | 18 | @implementation WKJavaScriptMessageDispatcher { 19 | __weak WKJavaScriptBridge *_bridge; 20 | NSDictionary *_commandDictionary; 21 | } 22 | 23 | - (instancetype)initWithBridge:(WKJavaScriptBridge *)bridge { 24 | if (self = [super init]) { 25 | _bridge = bridge; 26 | _commandDictionary = [NSDictionary dictionary]; 27 | } 28 | return self; 29 | } 30 | 31 | - (void)handleMsgCommand:(NSString *)arguments { 32 | [self handleCommand:arguments]; 33 | } 34 | 35 | #pragma mark - handle 36 | 37 | - (void)handleCommand:(NSString *)commandJson { 38 | if (commandJson.length > 0) { 39 | [self fetchCommands:commandJson]; 40 | } 41 | } 42 | 43 | - (void)fetchCommands:(NSString *)command { 44 | 45 | if ([command length] < JSON_SIZE_FOR_MAIN_THREAD) { 46 | _commandDictionary = [command bridge_JSONObject]; 47 | [self executePending]; 48 | } else { 49 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^() { 50 | self->_commandDictionary = [command bridge_JSONObject]; 51 | [self performSelectorOnMainThread:@selector(executePending) withObject:nil waitUntilDone:NO]; 52 | }); 53 | } 54 | } 55 | 56 | - (void)executePending { 57 | if (_commandDictionary.allKeys.count > 0) { 58 | WKMsgCommand *msgCommand = [WKMsgCommand commandFromJson:_commandDictionary]; 59 | [_bridge pluginSecurityVerityWithCommand:msgCommand completionHandler:^(BOOL passed) { 60 | if (!passed) { 61 | NSLog(@"WKJavaScriptBridge Error : 模块: (%@) 方法:(%@) 权限验证未通过,如需使用请申请配置。",msgCommand.className, msgCommand.methodName); 62 | return ; 63 | } 64 | #ifdef DEBUG 65 | NSLog(@"PHJavaScriptBridge(%@): Calling %@.%@", msgCommand.callbackId, msgCommand.className, msgCommand.methodName); 66 | #endif 67 | if (![self execute:msgCommand]) { 68 | #ifdef DEBUG 69 | NSString *commandJson = [NSString stringWithFormat:@"%@",self->_commandDictionary]; 70 | static NSUInteger maxLogLength = 1024; 71 | NSString *commandString = ([commandJson length] > maxLogLength) ? 72 | [NSString stringWithFormat : @"%@[...]", [commandJson substringToIndex:maxLogLength]] : 73 | commandJson; 74 | 75 | NSLog(@"PHJavaScriptBridge Error : FAILED pluginJSON = %@", commandString); 76 | #endif 77 | } 78 | }]; 79 | } 80 | } 81 | 82 | - (BOOL)execute:(WKMsgCommand *)command { 83 | if (command.className == nil || command.methodName == nil) { 84 | #ifdef DEBUG 85 | NSLog(@"WKJavaScriptBridge Error : 调用的类名或方法名不存在。"); 86 | #endif 87 | return NO; 88 | } 89 | 90 | BOOL retVal = YES; 91 | double started = [[NSDate date] timeIntervalSince1970] * 1000.0; 92 | 93 | WKBasePlugin *instance = [_bridge getCommandInstance:command.className]; 94 | 95 | if (!([instance isKindOfClass:[WKBasePlugin class]])) { 96 | #ifdef DEBUG 97 | NSLog(@"WKJavaScriptBridge Error : 模块 '%@' 异常, 检查此模块是否继承于(WKBasePlugin)", command.className); 98 | #endif 99 | return NO; 100 | } 101 | 102 | NSString* methodName = [NSString stringWithFormat:@"%@:", command.methodName]; 103 | SEL normalSelector = NSSelectorFromString(methodName); 104 | if ([instance respondsToSelector:normalSelector]) { 105 | ((void (*)(id, SEL, id))objc_msgSend)(instance, normalSelector, command); 106 | } else { 107 | #ifdef DEBUG 108 | NSLog(@"WKJavaScriptBridge Error : 函数 '%@' 在类 '%@' 中没有找到。", methodName, command.className); 109 | #endif 110 | retVal = NO; 111 | } 112 | double elapsed = [[NSDate date] timeIntervalSince1970] * 1000.0 - started; 113 | if (elapsed > 10) { 114 | #ifdef DEBUG 115 | NSLog(@"WKJavaScriptBridge THREAD WARNING: ['%@'] 占用了 '%f' ms。请使用(runInBackground:)将此插件放到后台执行。", command.className, elapsed); 116 | #endif 117 | } 118 | return retVal; 119 | } 120 | 121 | - (void)dealloc { 122 | _bridge = nil; 123 | } 124 | @end 125 | -------------------------------------------------------------------------------- /WKJavaScriptBridge/Classes/Dispatcher/WKMsgCommand.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKMsgCommand.h 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2019/10/22. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "WKJavaScriptBridgePluginAnnotation.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface WKMsgCommand : NSObject 15 | @property (nonatomic, readonly) NSDictionary *arguments; 16 | @property (nonatomic, readonly) NSString *callbackId; 17 | @property (nonatomic, readonly) NSString *className; 18 | @property (nonatomic, readonly) NSString *methodName; 19 | + (WKMsgCommand *)commandFromJson:(NSDictionary *)jsonEntry; 20 | @end 21 | 22 | NS_ASSUME_NONNULL_END 23 | -------------------------------------------------------------------------------- /WKJavaScriptBridge/Classes/Dispatcher/WKMsgCommand.m: -------------------------------------------------------------------------------- 1 | // 2 | // WKMsgCommand.m 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2019/10/22. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "WKMsgCommand.h" 10 | 11 | static const NSString const * kMessageCallbackId = @"callbackId"; 12 | static const NSString const * kMessageService = @"service"; 13 | static const NSString const * kMessageAction = @"action"; 14 | static const NSString const * kMessageActionArgs = @"actionArgs"; 15 | 16 | @interface WKMsgCommand () 17 | @property (nonatomic, readwrite) NSDictionary* arguments; 18 | @property (nonatomic, readwrite) NSString* callbackId; 19 | @property (nonatomic, readwrite) NSString* className; 20 | @property (nonatomic, readwrite) NSString* methodName; 21 | @end 22 | 23 | @implementation WKMsgCommand 24 | 25 | + (WKMsgCommand *)commandFromJson:(NSDictionary *)jsonEntry { 26 | return [[WKMsgCommand alloc] initFromJson:jsonEntry]; 27 | } 28 | 29 | - (id)initFromJson:(NSDictionary *)jsonEntry { 30 | 31 | id tmp = [jsonEntry objectForKey:kMessageCallbackId]; 32 | NSString *callbackId = tmp == [NSNull null] ? nil : tmp; 33 | NSString *className = [jsonEntry objectForKey:kMessageService]; 34 | NSString *methodName = [jsonEntry objectForKey:kMessageAction]; 35 | NSDictionary *arguments = [jsonEntry objectForKey:kMessageActionArgs]; 36 | 37 | return [self initWithArguments:arguments 38 | callbackId:callbackId 39 | className:className 40 | methodName:methodName]; 41 | } 42 | 43 | - (id)initWithArguments:(NSDictionary *)arguments 44 | callbackId:(NSString *)callbackId 45 | className:(NSString *)className 46 | methodName:(NSString *)methodName { 47 | self = [super init]; 48 | if (self != nil) { 49 | _arguments = arguments; 50 | _callbackId = callbackId; 51 | _className = className; 52 | _methodName = methodName; 53 | } 54 | return self; 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /WKJavaScriptBridge/Classes/Plugin/WKBasePlugin.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKBasePlugin.h 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2019/10/22. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "WKCommandProtocol.h" 12 | #import "WKPluginProtocol.h" 13 | #import "WKMsgCommand.h" 14 | #import "WKJavaScriptBridgePluginAnnotation.h" 15 | #import "WKPluginSecurityProtocol.h" 16 | 17 | NS_ASSUME_NONNULL_BEGIN 18 | 19 | @class WKJavaScriptBridge; 20 | 21 | @interface WKBasePlugin : NSObject 22 | 23 | @property (nonatomic, weak) id commandDelegate; 24 | 25 | /** 26 | 插件实例化调用 27 | */ 28 | - (void)pluginInitialize; 29 | 30 | /** 31 | APP 应用终止调用 32 | */ 33 | - (void)onAppTerminate; 34 | 35 | /** 36 | APP 内存警告调用 37 | */ 38 | - (void)onMemoryWarning; 39 | 40 | /** 41 | 插件销毁,bridge生命周期结束调用 42 | */ 43 | - (void)dispose; 44 | 45 | @end 46 | 47 | NS_ASSUME_NONNULL_END 48 | -------------------------------------------------------------------------------- /WKJavaScriptBridge/Classes/Plugin/WKBasePlugin.m: -------------------------------------------------------------------------------- 1 | // 2 | // WKBasePlugin.m 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2019/10/22. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "WKBasePlugin.h" 10 | 11 | @implementation WKBasePlugin 12 | 13 | #pragma mark - Override 14 | 15 | - (instancetype)init { 16 | if (self = [super init]) { 17 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppTerminate) name:UIApplicationWillTerminateNotification object:nil]; 18 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onMemoryWarning) name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; 19 | } 20 | return self; 21 | } 22 | 23 | - (void)dealloc { 24 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 25 | } 26 | 27 | #pragma mark - Public 28 | 29 | - (void)pluginInitialize { 30 | 31 | } 32 | 33 | - (void)onAppTerminate { 34 | 35 | } 36 | 37 | - (void)onMemoryWarning { 38 | 39 | } 40 | 41 | - (void)dispose { 42 | 43 | } 44 | 45 | #pragma mark - WKPluginProtocol 46 | 47 | + (BOOL)shouldCache { 48 | return YES; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /WKJavaScriptBridge/Classes/Plugin/WKCommandImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKCommandImpl.h 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2019/10/22. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "WKCommandProtocol.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @class WKJavaScriptBridge; 15 | 16 | @interface WKCommandImpl : NSObject 17 | - (instancetype)initWithBridge:(WKJavaScriptBridge *)bridge; 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /WKJavaScriptBridge/Classes/Plugin/WKCommandImpl.m: -------------------------------------------------------------------------------- 1 | // 2 | // WKCommandImpl.m 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2019/10/22. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "WKCommandImpl.h" 10 | #import "WKJavaScriptBridge.h" 11 | #import "WKPluginResult.h" 12 | 13 | @implementation WKCommandImpl { 14 | __weak WKJavaScriptBridge *_bridge; 15 | NSRegularExpression* _callbackIdPattern; 16 | } 17 | 18 | - (instancetype)initWithBridge:(WKJavaScriptBridge *)bridge { 19 | if (self = [super init]) { 20 | _bridge = bridge; 21 | NSError* err = nil; 22 | 23 | _callbackIdPattern = [NSRegularExpression regularExpressionWithPattern:@"[^A-Za-z0-9._-]" options:0 error:&err]; 24 | if (err != nil) { 25 | // Couldn't initialize Regex 26 | #ifdef DEBUG 27 | NSLog(@"WKJavaScriptBridge Error : Couldn't initialize regex"); 28 | #endif 29 | _callbackIdPattern = nil; 30 | } 31 | } 32 | return self; 33 | } 34 | 35 | - (void)evalJs:(NSString *)js { 36 | [_bridge evaluateJavaScript:js completionHandler:^(id obj, NSError * error) { 37 | if (error) { 38 | #ifdef DEBUG 39 | NSLog(@"WKJavaScriptBridge Error : 调用JS函数报错 : %@",error.localizedDescription); 40 | #endif 41 | } 42 | }]; 43 | } 44 | 45 | - (id)getCommandInstance:(NSString*)pluginName { 46 | return [_bridge getCommandInstance:pluginName]; 47 | } 48 | 49 | - (BOOL)isValidCallbackId:(NSString*)callbackId { 50 | if ((callbackId == nil) || (_callbackIdPattern == nil)) { 51 | return NO; 52 | } 53 | 54 | // 如果太长或发现任何无效字符,则禁用 55 | if (([callbackId length] > 100) || [_callbackIdPattern firstMatchInString:callbackId options:0 range:NSMakeRange(0, [callbackId length])]) { 56 | return NO; 57 | } 58 | return YES; 59 | } 60 | 61 | #pragma mark - WKCommandProtocol 62 | 63 | - (void)sendPluginResult:(WKPluginResult *)result callbackId:(NSString*)callbackId { 64 | #ifdef DEBUG 65 | NSLog(@"WKJavaScriptBridge (%@): Sending result. Status=%@", callbackId, result.status); 66 | #endif 67 | // 当本次交互JS侧没有回调时 68 | if ([@"INVALID" isEqualToString:callbackId]) { 69 | return; 70 | } 71 | // 回调id格式不正确 72 | if (![self isValidCallbackId:callbackId]) { 73 | #ifdef DEBUG 74 | NSLog(@"WKJavaScriptBridge Error : 通信ID格式不正确,去除无效字符,或检查ID是否过长,限制不得超过100字符。"); 75 | #endif 76 | return; 77 | } 78 | 79 | NSMutableDictionary *messageDict = [NSMutableDictionary dictionary]; 80 | messageDict[@"status"] = result.status; 81 | messageDict[@"callbackId"] = callbackId; 82 | messageDict[@"data"] = result.message; 83 | 84 | NSString* argumentsAsJSON = [WKPluginResult jsSerializeWithJson:messageDict]; 85 | NSString* js = [NSString stringWithFormat:@"window.WKJSBridge._handleMessageFromNative('%@')", argumentsAsJSON]; 86 | 87 | if (![NSThread isMainThread]) { 88 | //不使用GCD是防止js页面死锁产生卡死 89 | [self performSelectorOnMainThread:@selector(evalJs:) withObject:js waitUntilDone:NO]; 90 | } else { 91 | [self evalJs:js]; 92 | } 93 | } 94 | 95 | - (void)runInBackground:(void (^)(void))block { 96 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block); 97 | } 98 | 99 | - (WKWebView *)webView { 100 | return _bridge.webView; 101 | } 102 | 103 | @end 104 | -------------------------------------------------------------------------------- /WKJavaScriptBridge/Classes/Plugin/WKCommandProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKCommandProtocol.h 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2019/10/22. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "WKPluginResult.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @protocol WKCommandProtocol 16 | 17 | /** 18 | 原生模块回调js 19 | 20 | @param result simulate data 21 | @param callbackId callbackId 22 | */ 23 | - (void)sendPluginResult:(WKPluginResult *)result callbackId:(NSString*)callbackId; 24 | 25 | /** 26 | 原生模块执行耗时操作 27 | 28 | @param block long running 29 | */ 30 | - (void)runInBackground:(void (^)(void))block; 31 | 32 | /** 33 | 和Bridge绑定的webView 34 | 35 | @return WKWebView 36 | */ 37 | - (WKWebView *)webView; 38 | 39 | @end 40 | 41 | NS_ASSUME_NONNULL_END 42 | -------------------------------------------------------------------------------- /WKJavaScriptBridge/Classes/Plugin/WKPluginProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKPluginProtocol.h 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2019/10/22. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @protocol WKPluginProtocol 14 | 15 | @optional 16 | 17 | /** 18 | 设置插件为多例 19 | 20 | @return 默认YES 21 | */ 22 | + (BOOL)singleton; 23 | 24 | /** 25 | 设置插件为单例 26 | 27 | @return 默认NO 28 | */ 29 | + (id)shareInstance; 30 | 31 | /** 32 | 设置插件缓存 33 | 34 | @return 默认YES,为YES时生命周期跟随Bridge 35 | */ 36 | + (BOOL)shouldCache; 37 | 38 | @end 39 | 40 | NS_ASSUME_NONNULL_END 41 | -------------------------------------------------------------------------------- /WKJavaScriptBridge/Classes/Plugin/WKPluginResult.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKPluginResult.h 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2019/10/22. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | typedef NS_ENUM(NSInteger, WKJavaScriptBridgeCommandStatus) { 14 | WKJavaScriptBridgeCommandStatus_NO_RESULT = 0, 15 | WKJavaScriptBridgeCommandStatus_ERROR = 1, 16 | WKJavaScriptBridgeCommandStatus_OK = 2 17 | }; 18 | 19 | @interface WKPluginResult : NSObject 20 | 21 | @property (nonatomic, strong, readonly) NSNumber* status; 22 | @property (nonatomic, strong, readonly) id message; 23 | 24 | + (WKPluginResult*)resultWithStatus:(WKJavaScriptBridgeCommandStatus)statusOrdinal messageAsDictionary:(NSDictionary*)theMessage; 25 | 26 | + (WKPluginResult *)resultWithStatus:(WKJavaScriptBridgeCommandStatus)statusOrdinal messageAsString:(NSString *)theMessage; 27 | 28 | + (NSString *)jsSerializeWithJson:(NSDictionary * _Nullable)json; 29 | 30 | @end 31 | 32 | NS_ASSUME_NONNULL_END 33 | -------------------------------------------------------------------------------- /WKJavaScriptBridge/Classes/Plugin/WKPluginResult.m: -------------------------------------------------------------------------------- 1 | // 2 | // WKPluginResult.m 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2019/10/22. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "WKPluginResult.h" 10 | 11 | @interface WKPluginResult () 12 | 13 | @property (nonatomic, strong, readwrite) NSNumber* status; 14 | @property (nonatomic, strong, readwrite) id message; 15 | 16 | @end 17 | 18 | @implementation WKPluginResult 19 | 20 | + (WKPluginResult *)resultWithStatus:(WKJavaScriptBridgeCommandStatus)statusOrdinal messageAsDictionary:(NSDictionary *)theMessage { 21 | return [[self alloc] initWithStatus:statusOrdinal message:theMessage]; 22 | } 23 | 24 | + (WKPluginResult *)resultWithStatus:(WKJavaScriptBridgeCommandStatus)statusOrdinal messageAsString:(NSString *)theMessage { 25 | return [[self alloc] initWithStatus:statusOrdinal message:theMessage]; 26 | } 27 | 28 | - (WKPluginResult*)initWithStatus:(WKJavaScriptBridgeCommandStatus)statusOrdinal message:(id)theMessage { 29 | self = [super init]; 30 | if (self) { 31 | self.status = [NSNumber numberWithInt:statusOrdinal]; 32 | self.message = theMessage; 33 | } 34 | return self; 35 | } 36 | 37 | + (NSString *)jsSerializeWithJson:(NSDictionary * _Nullable)json { 38 | NSString *messageJSON = [self serializeWithJson:json ? json : @{} pretty:NO]; 39 | messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\\" withString:@"\\\\"]; 40 | messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""]; 41 | messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\'" withString:@"\\\'"]; 42 | messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\n" withString:@"\\n"]; 43 | messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\r" withString:@"\\r"]; 44 | messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\f" withString:@"\\f"]; 45 | messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\u2028" withString:@"\\u2028"]; 46 | messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\u2029" withString:@"\\u2029"]; 47 | 48 | return messageJSON; 49 | } 50 | 51 | + (NSString *)serializeWithJson:(NSDictionary * _Nullable)json pretty:(BOOL)pretty { 52 | NSError *error = nil; 53 | NSString *str = [[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:json ? json : @{} options:(NSJSONWritingOptions)(pretty ? NSJSONWritingPrettyPrinted : 0) error:&error] encoding:NSUTF8StringEncoding]; 54 | #ifdef DEBUG 55 | if (error) { 56 | NSLog(@"WKJSBridge Error: format json error %@", error.localizedDescription); 57 | } 58 | #endif 59 | 60 | return str ? str : @""; 61 | } 62 | 63 | @end 64 | 65 | -------------------------------------------------------------------------------- /WKJavaScriptBridge/Classes/Security/WKJavaScriptBridgePluginAnnotation.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKJavaScriptBridgePluginAnnotation.h 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2019/10/22. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //@class WKJavaScriptBridge; 12 | // 13 | //#define WKWebPlugins "WKWebPlugins" 14 | // 15 | //#define WKWebPluginDATA(sectname) __attribute((used, section("__DATA,"#sectname" "))) 16 | //#define WKRegisterWhiteList(name) \ 17 | //class WKJavaScriptBridge; char * k##name##_mod WKWebPluginDATA(WKWebPlugins) = ""#name""; 18 | 19 | 20 | 21 | @class WKJavaScriptBridge; 22 | 23 | #define SecurityConfig "SecurityConfig" 24 | 25 | #define SecurityPlugin "SecurityPlugin" 26 | 27 | #define WKWebPluginDATA(sectname) __attribute((used, section("__DATA,"#sectname" "))) 28 | 29 | #define WKConfigPluginSafeLevel(service,action,level) \ 30 | class WKJavaScriptBridge;char * k##service##_##action##_plu WKWebPluginDATA(SecurityConfig) = "[\""#service"\",\""#action"\",\""#level"\"]"; 31 | 32 | #define WKConfigSafePlugin(name) \ 33 | class PHJavaScriptBridge;char * k##name##_plu WKWebPluginDATA(SecurityPlugin) = ""#name""; 34 | 35 | NS_ASSUME_NONNULL_BEGIN 36 | 37 | @interface WKJavaScriptBridgePluginAnnotation : NSObject 38 | - (instancetype)initWithBridge:(WKJavaScriptBridge *)bridge; 39 | - (void)getAllRegisterPluginName; 40 | @end 41 | 42 | NS_ASSUME_NONNULL_END 43 | -------------------------------------------------------------------------------- /WKJavaScriptBridge/Classes/Security/WKJavaScriptBridgePluginAnnotation.m: -------------------------------------------------------------------------------- 1 | // 2 | // WKJavaScriptBridgePluginAnnotation.m 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2019/10/22. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "WKJavaScriptBridgePluginAnnotation.h" 10 | #import "WKJavaScriptBridge.h" 11 | #include 12 | #include 13 | #include 14 | #include 15 | #import 16 | #import 17 | #include 18 | 19 | @interface WKJavaScriptBridgePluginAnnotation () 20 | 21 | @property (nonatomic, weak) WKJavaScriptBridge *bridge; 22 | 23 | @end 24 | 25 | @implementation WKJavaScriptBridgePluginAnnotation 26 | 27 | - (instancetype)initWithBridge:(WKJavaScriptBridge *)bridge { 28 | if (self = [super init]) { 29 | self.bridge = bridge; 30 | } 31 | return self; 32 | } 33 | 34 | - (void)getAllRegisterPluginName { 35 | [self registedAnnotationModules]; 36 | } 37 | 38 | - (void)registedAnnotationModules { 39 | NSArray *whiteListPlugin = [WKJavaScriptBridgePluginAnnotation AnnotationWhiteListPlugin]; 40 | if (whiteListPlugin.count > 0) { 41 | NSString *plugin = whiteListPlugin[0]; 42 | if (plugin.length) { 43 | [self.bridge registerSecurityPlugin:plugin]; 44 | } 45 | } 46 | 47 | NSArray *securityInfo = [WKJavaScriptBridgePluginAnnotation AnnotationPlugins]; 48 | [self.bridge registerPluginSecurityInfomation:securityInfo]; 49 | } 50 | 51 | + (NSArray *)AnnotationPlugins { 52 | static NSArray *securityInfo = nil; 53 | static dispatch_once_t onceToken; 54 | dispatch_once(&onceToken, ^{ 55 | securityInfo = BHReadConfiguration(SecurityConfig); 56 | }); 57 | return securityInfo; 58 | } 59 | 60 | + (NSArray *)AnnotationWhiteListPlugin { 61 | static NSArray *plugin = nil; 62 | static dispatch_once_t onceToken; 63 | dispatch_once(&onceToken, ^{ 64 | plugin = BHReadConfiguration(SecurityPlugin); 65 | }); 66 | return plugin; 67 | } 68 | 69 | static NSArray* BHReadConfiguration(char *section) { 70 | NSMutableArray *configs = [NSMutableArray array]; 71 | 72 | Dl_info info; 73 | dladdr(BHReadConfiguration, &info); 74 | 75 | #ifndef __LP64__ 76 | const struct mach_header *mhp = (struct mach_header*)info.dli_fbase; 77 | unsigned long size = 0; 78 | uint32_t *memory = (uint32_t*)getsectiondata(mhp, "__DATA", section, & size); 79 | #else /* defined(__LP64__) */ 80 | const struct mach_header_64 *mhp = (struct mach_header_64*)info.dli_fbase; 81 | unsigned long size = 0; 82 | uint64_t *memory = (uint64_t*)getsectiondata(mhp, "__DATA", section, & size); 83 | #endif /* defined(__LP64__) */ 84 | for(int idx = 0; idx < size/sizeof(void*); ++idx){ 85 | char *string = (char*)memory[idx]; 86 | 87 | NSString *str = [NSString stringWithUTF8String:string]; 88 | if(!str)continue; 89 | #ifdef DEBUG 90 | NSLog(@"config = %@", str); 91 | #endif 92 | if(str) [configs addObject:str]; 93 | } 94 | 95 | return configs; 96 | } 97 | 98 | @end 99 | -------------------------------------------------------------------------------- /WKJavaScriptBridge/Classes/Security/WKPluginSecurityProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKPluginSecurityProtocol.h 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2020/6/2. 6 | // Copyright © 2020 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void(^PHJudgeAuthorityComplete)(BOOL allowed); 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @protocol WKPluginSecurityProtocol 16 | 17 | @required 18 | 19 | /** 20 | 插件是否符合使用权限 21 | 22 | @param serviceName 类名 23 | @param actionName 方法名 24 | @param completionHandler 校验结果,异步返回 25 | */ 26 | - (void)applyAuthorityWithService:(NSString *)serviceName action:(NSString *)actionName securityInfomation:(NSArray*)secInfo complete:(PHJudgeAuthorityComplete)completionHandler; 27 | 28 | @end 29 | 30 | NS_ASSUME_NONNULL_END 31 | -------------------------------------------------------------------------------- /WKJavaScriptBridge/Classes/Util/NSString+BridgeJSONPrivate.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+BridgeJSONPrivate.h 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2019/10/22. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface NSString (BridgeJSONPrivate) 14 | - (id)bridge_JSONObject; 15 | - (id)bridge_JSONFragment; 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /WKJavaScriptBridge/Classes/Util/NSString+BridgeJSONPrivate.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+BridgeJSONPrivate.m 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2019/10/22. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "NSString+BridgeJSONPrivate.h" 10 | 11 | @implementation NSString (BridgeJSONPrivate) 12 | 13 | - (id)bridge_JSONObject { 14 | @autoreleasepool { 15 | NSError* error = nil; 16 | id object = [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding] 17 | options:NSJSONReadingMutableContainers 18 | error:&error]; 19 | 20 | if (error != nil) { 21 | NSLog(@"NSString JSONObject error: %@, Malformed Data: %@", [error localizedDescription], self); 22 | } 23 | return object; 24 | } 25 | } 26 | 27 | - (id)bridge_JSONFragment { 28 | @autoreleasepool { 29 | NSError* error = nil; 30 | id object = [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding] 31 | options:NSJSONReadingAllowFragments 32 | error:&error]; 33 | 34 | if (error != nil) { 35 | NSLog(@"NSString JSONObject error: %@", [error localizedDescription]); 36 | } 37 | return object; 38 | } 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /WKJavaScriptBridge/Classes/Util/WKWeakScriptMessageHandlerDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKWeakScriptMessageHandlerDelegate.h 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2019/10/22. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface WKWeakScriptMessageHandlerDelegate : NSObject 15 | 16 | @property (nonatomic, weak, readonly) id scriptDelegate; 17 | 18 | - (instancetype)initWithDelegate:(id)scriptDelegate; 19 | 20 | @end 21 | 22 | NS_ASSUME_NONNULL_END 23 | -------------------------------------------------------------------------------- /WKJavaScriptBridge/Classes/Util/WKWeakScriptMessageHandlerDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // WKWeakScriptMessageHandlerDelegate.m 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2019/10/22. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "WKWeakScriptMessageHandlerDelegate.h" 10 | 11 | @interface WKWeakScriptMessageHandlerDelegate () 12 | 13 | @property (nonatomic, weak, readwrite) id scriptDelegate; 14 | 15 | @end 16 | 17 | @implementation WKWeakScriptMessageHandlerDelegate 18 | 19 | - (instancetype)initWithDelegate:(id)scriptDelegate { 20 | self = [super init]; 21 | if (self) { 22 | _scriptDelegate = scriptDelegate; 23 | } 24 | return self; 25 | } 26 | 27 | - (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message { 28 | [self.scriptDelegate userContentController:userContentController didReceiveScriptMessage:message]; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /WKJavaScriptBridge/Classes/WKJavaScriptBridge.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKJavaScriptBridge.h 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2019/10/22. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "WKJavaScriptBridgeProtocol.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface WKJavaScriptBridge : NSObject 16 | 17 | /** 外部提供的webView,只读 */ 18 | @property (nonatomic, readonly, weak) WKWebView *webView; 19 | 20 | /** 21 | 初始化绑定方法 22 | 23 | @param webView webView 24 | @return bridge 25 | */ 26 | + (instancetype)bindBridgeWithWebView:(WKWebView *)webView; 27 | 28 | @end 29 | 30 | NS_ASSUME_NONNULL_END 31 | -------------------------------------------------------------------------------- /WKJavaScriptBridge/Classes/WKJavaScriptBridge.m: -------------------------------------------------------------------------------- 1 | // 2 | // WKJavaScriptBridge.m 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2019/10/22. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import "WKJavaScriptBridge.h" 10 | #import "WKCommandImpl.h" 11 | #import "WKWeakScriptMessageHandlerDelegate.h" 12 | #import "WKJavaScriptMessageDispatcher.h" 13 | #import "WKJavaScriptBridgePluginAnnotation.h" 14 | #import "WKBasePlugin.h" 15 | #import "WKCommandProtocol.h" 16 | #import "WKPluginSecurityProtocol.h" 17 | 18 | static NSString * const WKJSBridge = @"WKJSBridgeMessageName"; 19 | 20 | @interface WKJavaScriptBridge () 21 | 22 | @property (nonatomic, strong) WKJavaScriptBridgePluginAnnotation *annotation;//模块注册白名单 23 | @property (nonatomic, strong) WKJavaScriptMessageDispatcher *dispatcher;//插件模块派发 24 | @property (nonatomic, strong) WKCommandImpl *commandDelegate;//插件模块可执行函数实现 25 | @property (nonatomic, strong) NSMutableDictionary *pluginsByName;//插件模块实例对象 26 | @property (nonatomic, weak, readwrite) WKWebView *webView; 27 | //安全相关 28 | @property (nonatomic, strong) id securityPlugin;//白名单插件 29 | @property (nonatomic, strong) NSArray *secInfo;//业务注册的安全信息 30 | 31 | @end 32 | 33 | @implementation WKJavaScriptBridge 34 | 35 | - (void)dealloc { 36 | #ifdef DEBUG 37 | NSLog(@"WKJavaScriptBridge dealloc"); 38 | #endif 39 | WKWebView *webView = (WKWebView *)self.webView; 40 | [webView.configuration.userContentController removeScriptMessageHandlerForName:WKJSBridge]; 41 | [[self.pluginsByName allValues] makeObjectsPerformSelector:@selector(dispose)]; 42 | [self.pluginsByName removeAllObjects]; 43 | } 44 | 45 | #pragma mark - Public 46 | 47 | + (instancetype)bindBridgeWithWebView:(WKWebView *)webView { 48 | if ([webView isKindOfClass:[WKWebView class]]) { 49 | WKJavaScriptBridge *bridge = [[self alloc] initBridgeWithWebView:webView]; 50 | return bridge; 51 | } 52 | [NSException raise:@"BadWebView" format:@"Unknown web view."]; 53 | return nil; 54 | } 55 | 56 | #pragma mark - Init 57 | 58 | - (instancetype)initBridgeWithWebView:(WKWebView *)webView { 59 | if (self = [super init]) { 60 | self.webView = webView; 61 | [self commonInit]; 62 | [self setup]; 63 | } 64 | return self; 65 | } 66 | 67 | - (void)commonInit { 68 | self.secInfo = [NSArray array]; 69 | self.dispatcher = [[WKJavaScriptMessageDispatcher alloc] initWithBridge:self]; 70 | self.annotation = [[WKJavaScriptBridgePluginAnnotation alloc] initWithBridge:self]; 71 | self.commandDelegate = [[WKCommandImpl alloc] initWithBridge:self]; 72 | } 73 | 74 | #pragma mark - Privite 75 | 76 | - (void)setup { 77 | [self setupJSBridge]; 78 | [self setupPlugin]; 79 | } 80 | 81 | - (void)setupJSBridge { 82 | WKWebViewConfiguration *webViewConfiguration = self.webView.configuration; 83 | if (webViewConfiguration && !webViewConfiguration.userContentController) { 84 | self.webView.configuration.userContentController = [WKUserContentController new]; 85 | } 86 | // 防止内存泄露 87 | [self.webView.configuration.userContentController addScriptMessageHandler:[[WKWeakScriptMessageHandlerDelegate alloc] initWithDelegate:self] name:WKJSBridge]; 88 | } 89 | 90 | - (void)setupPlugin { 91 | [self.annotation getAllRegisterPluginName]; 92 | } 93 | 94 | - (void)registerPlugin:(WKBasePlugin *)plugin { 95 | if ([plugin respondsToSelector:@selector(setCommandDelegate:)]) { 96 | [plugin setCommandDelegate:_commandDelegate]; 97 | } 98 | } 99 | 100 | - (Class)pluginImplClass:(NSString *)pluginName { 101 | if (pluginName.length > 0) { 102 | return NSClassFromString(pluginName); 103 | } 104 | return nil; 105 | } 106 | 107 | - (BOOL)pluginShouldCache:(Class)implClass { 108 | BOOL shouldCache = NO; 109 | if ([[implClass class] respondsToSelector:@selector(shouldCache)]) { 110 | if ([[implClass class] shouldCache]) { 111 | shouldCache = YES; 112 | } 113 | } 114 | return shouldCache; 115 | } 116 | 117 | - (void)pluginInstall:(WKBasePlugin *)plugin { 118 | [plugin pluginInitialize]; 119 | [self registerPlugin:plugin]; 120 | } 121 | 122 | #pragma mark - WKJavaScriptBridgeProtocol 123 | 124 | - (void)registerSecurityPlugin:(NSString *)name { 125 | idsecurityPlugin = [self getCommandInstance:name]; 126 | if ([securityPlugin isKindOfClass:[WKBasePlugin class]] && 127 | [securityPlugin conformsToProtocol:@protocol(WKPluginSecurityProtocol)]) { 128 | self.securityPlugin = securityPlugin; 129 | } 130 | } 131 | 132 | - (void)registerPluginSecurityInfomation:(NSArray*)secInfo { 133 | self.secInfo = secInfo; 134 | } 135 | 136 | - (void)pluginSecurityVerityWithCommand:(WKMsgCommand *)command completionHandler:(void (^)(BOOL passed))completionHandler { 137 | if (self.securityPlugin && [self.securityPlugin respondsToSelector:@selector(applyAuthorityWithService:action:securityInfomation:complete:)]) { 138 | [self.securityPlugin applyAuthorityWithService:command.className action:command.methodName securityInfomation:self.secInfo complete:^(BOOL allowed) { 139 | completionHandler(allowed); 140 | }]; 141 | }else { 142 | completionHandler(YES); 143 | } 144 | } 145 | 146 | - (id)getCommandInstance:(NSString*)pluginName { 147 | 148 | WKBasePlugin *plugin = nil; 149 | Class implClass = [self pluginImplClass:pluginName]; 150 | 151 | BOOL shouldCache = [self pluginShouldCache:implClass]; 152 | if (shouldCache) { 153 | plugin = [self.pluginsByName objectForKey:pluginName]; 154 | if (plugin) { 155 | return plugin; 156 | } 157 | } 158 | 159 | if ([[implClass class] respondsToSelector:@selector(singleton)]) { 160 | if ([[implClass class] singleton]) { 161 | if ([[implClass class] respondsToSelector:@selector(shareInstance)]) 162 | plugin = [[implClass class] shareInstance]; 163 | else 164 | plugin = [[implClass alloc] init]; 165 | 166 | if (plugin) { 167 | [self pluginInstall:plugin]; 168 | if (shouldCache) { 169 | [self.pluginsByName setObject:plugin forKey:pluginName]; 170 | } 171 | }else { 172 | #ifdef DEBUG 173 | NSLog(@"PHJavaScriptBridge Error : 模块: (%@) 不存在。", pluginName); 174 | #endif 175 | } 176 | return plugin; 177 | } 178 | } 179 | 180 | plugin = [[implClass alloc] init]; 181 | if (plugin) { 182 | [self pluginInstall:plugin]; 183 | if (shouldCache) { 184 | [self.pluginsByName setObject:plugin forKey:pluginName]; 185 | } 186 | }else { 187 | #ifdef DEBUG 188 | NSLog(@"PHJavaScriptBridge Error : 模块: (%@) 不存在。", pluginName); 189 | #endif 190 | } 191 | return plugin; 192 | } 193 | 194 | - (void)evaluateJavaScript:(NSString *)javaScriptString completionHandler:(void (^)(id , NSError *))completionHandler { 195 | WKWebView *webView = (WKWebView *)self.webView; 196 | [webView evaluateJavaScript:javaScriptString completionHandler:^(id obj, NSError * _Nullable error) { 197 | if (completionHandler) { 198 | completionHandler(obj, error); 199 | } 200 | }]; 201 | } 202 | 203 | #pragma mark - WKScriptMessageHandler 204 | 205 | - (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message { 206 | if ([message.name isEqualToString:WKJSBridge]) { 207 | if ([message.body isKindOfClass:[NSString class]]) { 208 | [self.dispatcher handleMsgCommand:message.body]; 209 | }else { 210 | #ifdef DEBUG 211 | NSLog(@"WKJavaScriptBridge Error : 通信参数不合法,请将JS侧参数转为字符串通信。"); 212 | #endif 213 | } 214 | }else { 215 | #ifdef DEBUG 216 | NSLog(@"WKJavaScriptBridge Error : 本次调用所使用的JS函数非(WKJavaScriptBridge)注入。请使用(%@)",WKJSBridge); 217 | #endif 218 | } 219 | } 220 | 221 | #pragma mark - Set or Get 222 | 223 | - (NSMutableDictionary *)pluginsByName { 224 | if (!_pluginsByName) { 225 | _pluginsByName = [[NSMutableDictionary alloc] initWithCapacity:1]; 226 | } 227 | return _pluginsByName; 228 | } 229 | 230 | @end 231 | -------------------------------------------------------------------------------- /WKJavaScriptBridge/Classes/WKJavaScriptBridgeProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // WKJavaScriptBridgeProtocol.h 3 | // WKJavaScriptBridge-demo 4 | // 5 | // Created by Kevin on 2019/10/22. 6 | // Copyright © 2019 王凯. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @class WKMsgCommand; 14 | 15 | @protocol WKJavaScriptBridgeProtocol 16 | 17 | /** 18 | 注册权限管理插件 19 | 20 | @param name class name 21 | */ 22 | - (void)registerSecurityPlugin:(NSString *)name; 23 | 24 | /** 25 | 注册插件安全配置信息 26 | 27 | @param secInfo 配置信息 28 | */ 29 | - (void)registerPluginSecurityInfomation:(NSArray*)secInfo; 30 | 31 | /** 32 | 插件安全校验 33 | 34 | @param command 插件信息 35 | @param completionHandler 结果回调 36 | */ 37 | - (void)pluginSecurityVerityWithCommand:(WKMsgCommand *)command completionHandler:(void (^)(BOOL passed))completionHandler; 38 | 39 | /** 40 | 获取模块实例 41 | 42 | @param pluginName 模块名称 43 | @return 模块实例 44 | */ 45 | - (id)getCommandInstance:(NSString*)pluginName; 46 | 47 | /** 48 | 执行JavaScript 49 | 50 | @param javaScriptString JS函数 51 | @param completionHandler 结果回调 52 | */ 53 | - (void)evaluateJavaScript:(NSString *)javaScriptString completionHandler:(void (^)(id, NSError *))completionHandler; 54 | 55 | @end 56 | 57 | NS_ASSUME_NONNULL_END 58 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj --------------------------------------------------------------------------------