• 检查库文件中是否有使用了uiwebview类


    可以检查静态库中是否带有 uiwebview 的字符串,以解决苹果要求的去掉 uiwebview 的需求。

    前提:

    1. 只能用于静态库。动态库需要改下。

    2. 没有检查源代码文件。

     1 #!/usr/bin/python
     2 # -*-coding:utf-8 -*-
     3 
     4 import os
     5 import commands
     6 
     7 def main():
     8 
     9     for path, dir_list, file_list in os.walk('./'):
    10 
    11         for file_name in file_list:
    12 
    13             # 略过 .DS_Store 文件
    14             if file_name.find('.DS_Store') != -1:
    15                 continue
    16 
    17             # 略过 没有framework  .a 的文件
    18             if path.find('.framework') == -1 and file_name.find('.a') == -1:
    19                 continue
    20 
    21             full_path = os.path.join(path, file_name)
    22             # print(full_path)
    23 
    24             if full_path.endswith('.h'):
    25                 continue
    26 
    27             (status, output) = commands.getstatusoutput('file %s' % full_path)
    28             index = output.find('Mach-O universal binary')
    29             if index != -1:
    30                 # print(full_path)
    31 
    32                 (status, output) = commands.getstatusoutput('strings %s | grep -ir "uiwebview"' % full_path)
    33                 if len(output) > 0:
    34                     print full_path
    35 
    36 
    37 
    38 if __name__ == "__main__":
    39     print('Start to check library')
    40     main()
  • 相关阅读:
    将aspx页面编译成dll
    Jquery 验证数字
    c#反编译生成DLL过程
    c#进制转换
    Spring Mvc 实例
    wamp phpMyAdmin error #1045
    Tomcat相关知识点总结(jsp)
    Java ---学习笔记(泛型)
    Java IO ---学习笔记(文件操作与随机访问文件)
    Java IO ---学习笔记(字符流)
  • 原文地址:https://www.cnblogs.com/huangzizhu/p/12202330.html
Copyright © 2020-2023  润新知