iOS 查漏报错 模仿器瓦解indirect_symbol_bindings[i] = cur->rebinding FB

分享
藏宝库编辑 2024-9-2 08:41:36 34 0 来自 中国
pod 'MLeaksFinder', :configurations => ['Debug']  post_install do |installer|      ## Fix for XCode 12.5      find_and_replace("ods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/FBClassStrongLayout.mm",        "layoutCache[currentClass] = ivars;", "layoutCache[(id<NSCopying>)currentClass] = ivars;")      ## Fix for XCode 13.0        find_and_replace("ods/FBRetainCycleDetector/fishhook/fishhook.c",        "indirect_symbol_bindings = cur->rebindings[j].replacement;", "if (i < (sizeof(indirect_symbol_bindings) / sizeof(indirect_symbol_bindings[0]))) { \n indirect_symbol_bindings=cur->rebindings[j].replacement; \n }")  endpush end of the file:
def find_and_replace(dir, findstr, replacestr)  Dir[dir].each do |name|      text = File.read(name)      replace = text.gsub(findstr,replacestr)      if text != replace          puts "Fix: " + name          File.open(name, "w") { |file| file.puts replace }          STDOUT.flush      end  end  Dir[dir + '*/'].each(&method(:find_and_replace))endpod install 碰到终端报错:
[!] An error occurred while processing the post-install hook of the Podfile.
Permission denied @ rb_sysopen - Pods/FBRetainCycleDetector/fishhook/fishhook.c

  • 可以先不添加def find_and_replace(dir, findstr, replacestr)的更换,手动去 Pods/FBRetainCycleDetector/fishhook/fishhook.c文件中更换内容indirect_symbol_bindings = cur->rebindings[j].replacement;为if (i < (sizeof(indirect_symbol_bindings) / sizeof(indirect_symbol_bindings[0]))) { indirect_symbol_bindings=cur->rebindings[j].replacement; }
  • 也可以在Pods/FBRetainCycleDetector/fishhook/fishhook.c文件中随意修改点内容获取修改pods文件的权限。 然后添加上def find_and_replace(dir, findstr, replacestr)的更换 再去pod install
JCLeaksFinder 查漏方式: https://github.com/JerryChu/JCLeaksFinder
pod 'FBRetainCycleDetector', :configurations => ['Debug']pod 'JCLeaksFinder', :configurations => ['Debug']MLeaksFinder查漏方式:
pod 'FBRetainCycleDetector', :configurations => ['Debug']pod 'MLeaksFinder', :configurations => ['Debug']不报错的库

pod 'MLeaksFinder', :git => "https://github.com/Tencent/MLeaksFinder.git"
您需要登录后才可以回帖 登录 | 立即注册

Powered by CangBaoKu v1.0 小黑屋藏宝库It社区( 冀ICP备14008649号 )

GMT+8, 2024-10-19 17:34, Processed in 0.163597 second(s), 32 queries.© 2003-2025 cbk Team.

快速回复 返回顶部 返回列表