mirror of
https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background
synced 2024-11-24 16:24:53 +00:00
Decode private method name
This commit is contained in:
parent
e25beda8c9
commit
d7dd8a913c
@ -249,6 +249,17 @@ NSString* const kAPPBackgroundEventFailure = @"failure";
|
|||||||
#pragma mark -
|
#pragma mark -
|
||||||
#pragma mark Swizzling
|
#pragma mark Swizzling
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to swizzle.
|
||||||
|
*/
|
||||||
|
+ (NSString*) swizzleMethod
|
||||||
|
{
|
||||||
|
NSString* str = @"X3NldEFsd2F5c1J1bnNBdEZvcmVncm91bmRQcmlvcml0eTo=";
|
||||||
|
NSData* data = [[NSData alloc] initWithBase64EncodedString:str options:0];
|
||||||
|
|
||||||
|
return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Swizzle some implementations of CDVWKWebViewEngine.
|
* Swizzle some implementations of CDVWKWebViewEngine.
|
||||||
*/
|
*/
|
||||||
@ -264,7 +275,7 @@ NSString* const kAPPBackgroundEventFailure = @"failure";
|
|||||||
^(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([APPBackgroundMode swizzleMethod]);
|
||||||
((void (*)(id, SEL, BOOL))[obj methodForSelector:sel])(obj, sel, YES);
|
((void (*)(id, SEL, BOOL))[obj methodForSelector:sel])(obj, sel, YES);
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
|
Loading…
Reference in New Issue
Block a user