4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/core_blur/modify/modify_code.rb', line 4
def self.modify_fb
self.replace_str("Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/FBClassStrongLayout.mm",
"layoutCache[currentClass] = ivars;",
"layoutCache[(id<NSCopying>)currentClass] = ivars;")
self.replace_str("Pods/FBRetainCycleDetector/fishhook/fishhook.c",
"indirect_symbol_bindings[i] = cur->rebindings[j].replacement;",
"if(i < (sizeof(indirect_symbol_bindings) /sizeof(indirect_symbol_bindings[0]))) {indirect_symbol_bindings[i]=cur->rebindings[j].replacement;}")
new_string = "#import <objc/runtime.h>
#import <malloc/malloc.h>"
self.replace_str("Pods/FBRetainCycleDetector/FBRetainCycleDetector/Graph/FBObjectiveCGraphElement.mm",
"#import <objc/runtime.h>",
new_string)
new_string = "malloc_zone_t *zone = malloc_zone_from_ptr((__bridge void *)object); if (zone) { Class aCls=object_getClass(object);"
self.replace_str("Pods/FBRetainCycleDetector/FBRetainCycleDetector/Graph/FBObjectiveCGraphElement.mm",
"Class aCls = object_getClass(object);",
new_string)
new_string = "}
# endif"
self.replace_str("Pods/FBRetainCycleDetector/FBRetainCycleDetector/Graph/FBObjectiveCGraphElement.mm",
"#endif",
new_string)
end
|