Fix find&replace issue

This commit is contained in:
Sebastián Katzer 2017-01-18 17:11:46 +01:00
parent cbe2ab16f2
commit 4764ffe14c

View File

@ -233,21 +233,21 @@ NSString* const kAPPBackgroundEventFailure = @"failure";
{ {
if (!IsAtLeastiOSVersion(@"8.0")) if (!IsAtLeastiOSVersion(@"8.0"))
return; return;
Class wkWebViewEngineCls = NSClassFromString(@"CDVWKWebViewEngine"); Class wkWebViewEngineCls = NSClassFromString(@"CDVWKWebViewEngine");
SEL selector = NSSelectorFromString(@"createConfigurationFromSettings:"); SEL selector = NSSelectorFromString(@"createConfigurationFromSettings:");
if (!wkWebViewEngineCls) if (!wkWebViewEngineCls)
return; return;
SwizzleSelectorWithBlock_Begin(wkWebViewEngineCls, selector) SwizzleSelectorWithBlock_Begin(wkWebViewEngineCls, selector)
^(CDVPlugin *self, NSDictionary *settings) { ^(CDVPlugin *self, NSDictionary *settings) {
id obj = ((id (*)(id, SEL, NSDictionary*))_imp)(self, _cmd, settings); id obj = ((id (*)(id, SEL, NSDictionary*))_imp)(self, _cmd, settings);
SEL sel = NSSelectorFromString(@"_setAlwaysRunsAtForegroundPriority:"); SEL sel = NSSelectorFromString(@"_setAlwaysRunsAtForegroundPriority:");
((void (*)(id, SEL, BOOL))[obj methodForSelector:selector])(obj, sel, YES); ((void (*)(id, SEL, BOOL))[obj methodForSelector:sel])(obj, sel, YES);
return sel; return obj;
} }
SwizzleSelectorWithBlock_End; SwizzleSelectorWithBlock_End;
} }