Changeset 246664 in webkit
- Timestamp:
- Jun 20, 2019 5:49:14 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r246655 r246664 1 2019-06-20 Daniel Bates <dabates@apple.com> 2 3 [iOS] Evernote crashes when creating a note 4 https://bugs.webkit.org/show_bug.cgi?id=199083 5 <rdar://problem/51759247> 6 7 Reviewed by Brent Fulgham. 8 9 Add runtime check whether WebKit is being used in Evernote. Evernote's bundle ID 10 references iPhone, but they use the same ID for their iPad app as well. 11 12 * platform/RuntimeApplicationChecks.h: 13 * platform/cocoa/RuntimeApplicationChecksCocoa.mm: 14 (WebCore::IOSApplication::isEvernote): Added. 15 1 16 2019-06-20 Greg Doolittle <gr3g@apple.com> 2 17 -
trunk/Source/WebCore/platform/RuntimeApplicationChecks.h
r244239 r246664 93 93 WEBCORE_EXPORT bool isFirefox(); 94 94 WEBCORE_EXPORT bool isAppleApplication(); 95 WEBCORE_EXPORT bool isEvernote(); 95 96 96 97 } // IOSApplication -
trunk/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm
r244239 r246664 295 295 } 296 296 297 bool IOSApplication::isEvernote() 298 { 299 static bool isEvernote = applicationBundleIsEqualTo("com.evernote.iPhone.Evernote"_s); 300 return isEvernote; 301 } 302 297 303 #endif 298 304 -
trunk/Source/WebKit/ChangeLog
r246660 r246664 1 2019-06-20 Daniel Bates <dabates@apple.com> 2 3 [iOS] Evernote crashes when creating a note 4 https://bugs.webkit.org/show_bug.cgi?id=199083 5 <rdar://problem/51759247> 6 7 Reviewed by Brent Fulgham. 8 9 Add a hack just for Evernote linked before iOS 13 that dynamically adds a placeholder -[WKContentView keyCommands] 10 method (it just calls super). Evernote swizzles the IPI -[WKContentView keyCommands], but this 11 method may not always be present in the WebKit binary following r240514. So, Evernote may end 12 up swizzling -[UIResponder keyCommands], but their implementation doesn't account for this 13 scenario and they end up crashing because they call an unrecognized selector. 14 15 * UIProcess/Cocoa/VersionChecks.h: Add version check. 16 * UIProcess/ios/WKContentView.mm: 17 (keyCommandsPlaceholderHackForEvernote): Added. 18 (-[WKContentView _commonInitializationWithProcessPool:configuration:]): Install the hack. 19 1 20 2019-06-20 Brady Eidson <beidson@apple.com> 2 21 -
trunk/Source/WebKit/UIProcess/Cocoa/VersionChecks.h
r246626 r246664 74 74 FirstWithModernCompabilityModeByDefault = DYLD_IOS_VERSION_FIRST_WITH_MODERN_COMPATIBILITY_MODE_BY_DEFAULT, 75 75 FirstThatHasUIContextMenuInteraction = DYLD_IOS_VERSION_13_0, 76 FirstWhereWKContentViewDoesNotOverrideKeyCommands = DYLD_IOS_VERSION_13_0, 76 77 #elif PLATFORM(MAC) 77 78 FirstWithNetworkCache = DYLD_MACOSX_VERSION_10_11, -
trunk/Source/WebKit/UIProcess/ios/WKContentView.mm
r246413 r246664 61 61 #import <WebCore/PlatformScreen.h> 62 62 #import <WebCore/Quirks.h> 63 #import <WebCore/RuntimeApplicationChecks.h> 63 64 #import <WebCore/VelocityData.h> 65 #import <objc/message.h> 64 66 #import <pal/spi/cocoa/QuartzCoreSPI.h> 65 67 #import <wtf/RetainPtr.h> … … 142 144 } 143 145 146 #if USE(UIKIT_KEYBOARD_ADDITIONS) 147 148 // Evernote expects to swizzle -keyCommands on WKContentView or they crash. Remove this hack 149 // as soon as reasonably possible. See <rdar://problem/51759247>. 150 static NSArray *keyCommandsPlaceholderHackForEvernote(id self, SEL _cmd) 151 { 152 struct objc_super super { 0 }; 153 super.receiver = self; 154 super.super_class = class_getSuperclass(object_getClass(self)); 155 156 using SuperKeyCommandsFunction = NSArray *(*)(struct objc_super*, SEL); 157 return reinterpret_cast<SuperKeyCommandsFunction>(&objc_msgSendSuper)(&super, @selector(keyCommands)); 158 } 159 160 #endif 161 144 162 - (instancetype)_commonInitializationWithProcessPool:(WebKit::WebProcessPool&)processPool configuration:(Ref<API::PageConfiguration>&&)configuration 145 163 { … … 187 205 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_applicationWillResignActive:) name:UIApplicationWillResignActiveNotification object:[UIApplication sharedApplication]]; 188 206 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_applicationDidBecomeActive:) name:UIApplicationDidBecomeActiveNotification object:[UIApplication sharedApplication]]; 207 208 #if USE(UIKIT_KEYBOARD_ADDITIONS) 209 if (WebCore::IOSApplication::isEvernote() && !linkedOnOrAfter(WebKit::SDKVersion::FirstWhereWKContentViewDoesNotOverrideKeyCommands)) 210 class_addMethod(self.class, @selector(keyCommands), reinterpret_cast<IMP>(&keyCommandsPlaceholderHackForEvernote), method_getTypeEncoding(class_getInstanceMethod(self.class, @selector(keyCommands)))); 211 #endif 189 212 190 213 return self;
Note: See TracChangeset
for help on using the changeset viewer.