当前位置: 首页 > news >正文

广州最大网站建设wordpress数字超市

广州最大网站建设,wordpress数字超市,wordpress更换域名更改数据库,百度推广费用多少目录 iOS代码混淆 功能分析 实现流程 类名修改 方法名修改 生成垃圾代码 替换png等静态资源MD5 info.plist文件添加垃圾字段 功能分析 实现流程 类名修改 方法名修改 生成垃圾代码 替换png等静态资源MD5 info.plist文件添加垃圾字段 混淆前后对比 iOS代码混淆 … 目录 iOS代码混淆 功能分析 实现流程 类名修改 方法名修改 生成垃圾代码 替换png等静态资源MD5 info.plist文件添加垃圾字段 功能分析 实现流程 类名修改 方法名修改 生成垃圾代码 替换png等静态资源MD5 info.plist文件添加垃圾字段 混淆前后对比 iOS代码混淆 目前公司产品线中存在大量功能类似的APP按照模块化方式开发项目核心模块业务代码是复用的使用同一个开发者账号下iOS上架流程中有些APP在苹果机审过程中惨遭被拒的下场通过更改部分页面UI效果也无济于事于是采用代码混淆的方式也就是马甲包方案去绕过机审 功能分析 二进制不同图标包名工程名代码静态资源等的修改。差异化UI风格产品功能页面布局等的修改 实现流程 核心模块类名修改 核心方法名修改 加入垃圾代码 替换png等静态资源MD5 info.plist文件添加垃圾字段 类名修改 遍历查找需要替换的核心模块目录 (主工程\Pods目录)找到所有需要替换的类名(项目专用前缀)将其存放到数组中遍历查找整个工程的所有目录查找所有.h、.m、.xib、.string文件逐行扫描文件找到需要替换的类名关键字替换成别的名字前缀如发现.h、.m、.xib、.string文件的文件名包含需要替换的类名替换之(xcodeproj工程需要重新引入文件通过脚本动态引入)遇到有号的分类文件筛选出号前面的类名然后替换之 applescript复制代码#遍历查找所有.h、.m、.xib、.strings文件逐行扫描文件找到需要替换的类名关键字替换成别的名字前缀 def do_replace_file_name(dir_path,need_name_list)Dir.foreach(dir_path) do |file|if file ! . and file ! ..file_path dir_path / fileif File.directory? file_pathdo_replace_file_name(file_path,need_name_list)elseif file.end_with?(.h) or file.end_with?(.m) or file.end_with?(.xib) or file.end_with?(.strings) #只查找.h .m .xib .strings文件批量修改aFile File.new(file_path, r)if aFilefile_content aFile.read()aFile.closelength need_name_list.length - 1for i in 0..length doneed_name need_name_list[i]file_content split_file_content(file_content,need_name)endaFile File.new(file_path, w)aFile.syswrite(file_content)aFile.rewindendend#如.h、.m、.xib、.string文件的文件名包含需要替换的类名替换之if file.include?.h or file.include?.m or file.include?.xib or file.include?.stringsfile_suffix file.split(.)[1]need_name_list.each { |need_name|need_file_name need_name . file_suffixif file.start_with?(need_file_name)new_file_name new_file_name(file)new_file_path dir_path / new_file_nameFile.rename(file_path, new_file_path) #文件名称替换end}endendendend end方法名修改 获取系统文件关键字并缓存主要是获取iOS SDK中Frameworks所有方法名和参数名作为忽略关键字遍历查找整个工程的所有.h、.m、.mm文件提取关键字主要提取方法名和参数名将系统关键字、IBAction方法的关键字、属性property的关键字防止懒加载方法名造成冲突去除将剩余的关键字进行方法混淆混淆方案是将名字用#define宏定义方式替换名称方法不能替换成随机字符串这样任然不能通过机审应替换成规律的单词拼接方法名将替换后方法名关键字宏名称写入到全局pch文件xcodeproj动态引入 pgsql复制代码 # 生成混淆文件staticmethoddef create_confuse_file(output_file, confused_dict):log_info(Start creating confuse file, file fullpath is {0}.format(os.path.realpath(output_file)), 2, True)f open(output_file, wb)f.write(bytes(#ifndef NEED_CONFUSE_h\n, encodingutf-8))f.write(bytes(#define NEED_CONFUSE_h\n, encodingutf-8))f.write(bytes(// 生成时间 {0}\n.format(datetime.now().strftime(%Y-%m-%d %H:%M:%S)), encodingutf-8))for (key, value) in confused_dict.items():f.write(bytes(#define {0} {1}\n.format(key, value), encodingutf-8))f.write(bytes(#endif, encodingutf-8))f.close()生成垃圾代码 遍历查找整个工程的所有.m、.mm文件为避免和混淆后的方法重名添加垃圾方法的时候使用 随机前缀 _ 规律单词 作为方法名随意在方法中添加日志代码在文件结尾end前插入这些方法 haxe复制代码#oc代码以end结尾在其前面添加text def appendTextToOCFile(file_path, text):with open(file_path, r) as fileObj:old_text fileObj.read()fileObj.close()end_mark_index old_text.rfind(end)if end_mark_index -1:print \t非法的结尾格式: file_pathreturnnew_text old_text[:end_mark_index]new_text new_text text \nnew_text new_text old_text[end_mark_index:]with open(file_path, w) as fileObj:fileObj.write(new_text)#处理单个OC文件添加垃圾函数。确保其对应头文件存在于相同目录 def dealWithOCFile(filename, file_path):global target_ios_folder,create_func_min,create_func_max,funcname_setfuncname_set.clear()end_index file_path.rfind(.)pre_name file_path[:end_index]header_path pre_name .hif not os.path.exists(header_path):print \t相应头文件不存在 file_pathreturnnew_func_num random.randint(create_func_min, create_func_max)print \t给%s添加%d个方法 %(filename, new_func_num)prefix_list [btt_, gym_, muut_, ora_, vend_, enyt_, qotb_, ldt_, zndy_, tim_, yar_, toa_, rewwy_, twof_, theg_, guis_, dui_ ]random_index_list random.sample(range(0,new_func_num), new_func_num)for i in range(new_func_num):prefix prefix_list[random_index_list[i]]header_text getOCHeaderFuncText(prefix)# print add %s to %s %(header_text, header_path.replace(target_ios_folder, ))appendTextToOCFile(header_path, header_text ;\n)funcText getOCFuncText(header_text)appendTextToOCFile(file_path, funcText)替换png等静态资源MD5 livecodeserver复制代码 if file_type .png:text .join(random.sample(string.ascii_letters, 11))elif file_type .jpg:text .join(random.sample(string.ascii_letters, 20))elif file_type .lua:text \n--#* .join(random.sample(string.ascii_letters, 10)) *#--else:text *random.randint(1, 100)fileObj.write(text)fileObj.close()info.plist文件添加垃圾字段 在info.plist中插入规律英文单词(已排除系统专用字段)值为随机字符串 scss复制代码def addPlistField(plist_file):global create_field_min,create_field_max,word_name_listcreate_field_num random.randint(create_field_min, create_field_max)random_index_list random.sample(word_name_list, create_field_num)tree ET.parse(plist_file)root tree.getroot()root_dict root.find(dict)for i in range(create_field_num):key_node ET.SubElement(root_dict,key)key_node.text random_index_list[i]string_node ET.SubElement(root_dict,string)string_node.text getOneName()tree.write(plist_file,UTF-8)目前公司产品线中存在大量功能类似的APP按照模块化方式开发项目核心模块业务代码是复用的使用同一个开发者账号下iOS上架流程中有些APP在苹果机审过程中惨遭被拒的下场通过更改部分页面UI效果也无济于事于是采用代码混淆的方式也就是马甲包方案去绕过机审 功能分析 二进制不同图标包名工程名代码静态资源等的修改。差异化UI风格产品功能页面布局等的修改 实现流程 核心模块类名修改 核心方法名修改 加入垃圾代码 替换png等静态资源MD5 info.plist文件添加垃圾字段 类名修改 遍历查找需要替换的核心模块目录 (主工程\Pods目录)找到所有需要替换的类名(项目专用前缀)将其存放到数组中遍历查找整个工程的所有目录查找所有.h、.m、.xib、.string文件逐行扫描文件找到需要替换的类名关键字替换成别的名字前缀如发现.h、.m、.xib、.string文件的文件名包含需要替换的类名替换之(xcodeproj工程需要重新引入文件通过脚本动态引入)遇到有号的分类文件筛选出号前面的类名然后替换之 applescript复制代码#遍历查找所有.h、.m、.xib、.strings文件逐行扫描文件找到需要替换的类名关键字替换成别的名字前缀 def do_replace_file_name(dir_path,need_name_list)Dir.foreach(dir_path) do |file|if file ! . and file ! ..file_path dir_path / fileif File.directory? file_pathdo_replace_file_name(file_path,need_name_list)elseif file.end_with?(.h) or file.end_with?(.m) or file.end_with?(.xib) or file.end_with?(.strings) #只查找.h .m .xib .strings文件批量修改aFile File.new(file_path, r)if aFilefile_content aFile.read()aFile.closelength need_name_list.length - 1for i in 0..length doneed_name need_name_list[i]file_content split_file_content(file_content,need_name)endaFile File.new(file_path, w)aFile.syswrite(file_content)aFile.rewindendend#如.h、.m、.xib、.string文件的文件名包含需要替换的类名替换之if file.include?.h or file.include?.m or file.include?.xib or file.include?.stringsfile_suffix file.split(.)[1]need_name_list.each { |need_name|need_file_name need_name . file_suffixif file.start_with?(need_file_name)new_file_name new_file_name(file)new_file_path dir_path / new_file_nameFile.rename(file_path, new_file_path) #文件名称替换end}endendendend end方法名修改 获取系统文件关键字并缓存主要是获取iOS SDK中Frameworks所有方法名和参数名作为忽略关键字遍历查找整个工程的所有.h、.m、.mm文件提取关键字主要提取方法名和参数名将系统关键字、IBAction方法的关键字、属性property的关键字防止懒加载方法名造成冲突去除将剩余的关键字进行方法混淆混淆方案是将名字用#define宏定义方式替换名称方法不能替换成随机字符串这样任然不能通过机审应替换成规律的单词拼接方法名将替换后方法名关键字宏名称写入到全局pch文件xcodeproj动态引入 pgsql复制代码 # 生成混淆文件staticmethoddef create_confuse_file(output_file, confused_dict):log_info(Start creating confuse file, file fullpath is {0}.format(os.path.realpath(output_file)), 2, True)f open(output_file, wb)f.write(bytes(#ifndef NEED_CONFUSE_h\n, encodingutf-8))f.write(bytes(#define NEED_CONFUSE_h\n, encodingutf-8))f.write(bytes(// 生成时间 {0}\n.format(datetime.now().strftime(%Y-%m-%d %H:%M:%S)), encodingutf-8))for (key, value) in confused_dict.items():f.write(bytes(#define {0} {1}\n.format(key, value), encodingutf-8))f.write(bytes(#endif, encodingutf-8))f.close()生成垃圾代码 遍历查找整个工程的所有.m、.mm文件为避免和混淆后的方法重名添加垃圾方法的时候使用 随机前缀 _ 规律单词 作为方法名随意在方法中添加日志代码在文件结尾end前插入这些方法 haxe复制代码#oc代码以end结尾在其前面添加text def appendTextToOCFile(file_path, text):with open(file_path, r) as fileObj:old_text fileObj.read()fileObj.close()end_mark_index old_text.rfind(end)if end_mark_index -1:print \t非法的结尾格式: file_pathreturnnew_text old_text[:end_mark_index]new_text new_text text \nnew_text new_text old_text[end_mark_index:]with open(file_path, w) as fileObj:fileObj.write(new_text)#处理单个OC文件添加垃圾函数。确保其对应头文件存在于相同目录 def dealWithOCFile(filename, file_path):global target_ios_folder,create_func_min,create_func_max,funcname_setfuncname_set.clear()end_index file_path.rfind(.)pre_name file_path[:end_index]header_path pre_name .hif not os.path.exists(header_path):print \t相应头文件不存在 file_pathreturnnew_func_num random.randint(create_func_min, create_func_max)print \t给%s添加%d个方法 %(filename, new_func_num)prefix_list [btt_, gym_, muut_, ora_, vend_, enyt_, qotb_, ldt_, zndy_, tim_, yar_, toa_, rewwy_, twof_, theg_, guis_, dui_ ]random_index_list random.sample(range(0,new_func_num), new_func_num)for i in range(new_func_num):prefix prefix_list[random_index_list[i]]header_text getOCHeaderFuncText(prefix)# print add %s to %s %(header_text, header_path.replace(target_ios_folder, ))appendTextToOCFile(header_path, header_text ;\n)funcText getOCFuncText(header_text)appendTextToOCFile(file_path, funcText)替换png等静态资源MD5 livecodeserver复制代码 if file_type .png:text .join(random.sample(string.ascii_letters, 11))elif file_type .jpg:text .join(random.sample(string.ascii_letters, 20))elif file_type .lua:text \n--#* .join(random.sample(string.ascii_letters, 10)) *#--else:text *random.randint(1, 100)fileObj.write(text)fileObj.close()info.plist文件添加垃圾字段 在info.plist中插入规律英文单词(已排除系统专用字段)值为随机字符串 scss复制代码def addPlistField(plist_file):global create_field_min,create_field_max,word_name_listcreate_field_num random.randint(create_field_min, create_field_max)random_index_list random.sample(word_name_list, create_field_num)tree ET.parse(plist_file)root tree.getroot()root_dict root.find(dict)for i in range(create_field_num):key_node ET.SubElement(root_dict,key)key_node.text random_index_list[i]string_node ET.SubElement(root_dict,string)string_node.text getOneName()tree.write(plist_file,UTF-8)混淆前后对比 代码混淆前 Hopper查看混淆前 代码混淆后 Hopper查看混淆后 假如你不知道如何代码混淆和如何创建文件混淆你可以参考下面这个教程来使用我们平台代码混淆和文件混淆以及重签名怎么保护苹果手机移动应用程序ios ipa中的代码 | ipaguard使用教程 Ipa Guard是一款功能强大的ipa混淆工具不需要ios app源码直接对ipa文件进行混淆加密。可对IOS ipa 文件的代码代码库资源文件等进行混淆保护。 可以根据设置对函数名、变量名、类名等关键代码进行重命名和混淆处理降低代码的可读性增加ipa破解反编译难度。可以对图片资源配置等进行修改名称修改md5。只要是ipa都可以不限制OCSwiftFlutterReact NativeH5类app。 总结 在移动互联网时代代码混淆越来越受到开发者的重视。 iOS代码混淆可以提高难度从而防止应用程序被盗用或反编译保护开发者的权益。但是同时也带来了一些问题例如混淆后的函数名可能会影响代码的可维护性。因此在使用代码混淆时需要进行合理规划。 参考资料 IpaGuard文档 - 代码混淆iOS代码混淆方案iOS文件混淆方案iOS重签名与测试
http://www.pierceye.com/news/467717/

相关文章:

  • 公司网站建设吧个好wordpress增加搜索
  • 温州网站推广排名哪家购物网站建设好
  • 宿迁做网站公司哪家好中国建设监理协会化工监理协会网站
  • 网站建设广州天河常州企业自助建站系统
  • 厦门网站建设u贷款在线申请
  • 做肮脏交义的网站南宁住房和城乡建设局网站
  • 办网站需要什么my23777免费域名查询
  • 销售网站开发步骤网站域名到期了怎么办
  • 怎么做注册账号的网站网页打不开视频播放不了是什么问题
  • 江阴市住房和城乡建设局网站免费网页游戏poki
  • 个人网站设计网站建设的基本特点
  • 泉州专业做网站网站被k 原因
  • 18款禁用网站app直播建设部资质网站
  • 免费完整版的网站模板商丘行业网站建设开发公司
  • 网站与微网站区别推广通
  • 京东网站建设的意义wordpress美图
  • 佛山市外贸网站建设公司营销型网站建设 兼职
  • 四川省城乡与建设厅网站中国十大it培训机构排名
  • 国家高新技术企业查询网站汕头整站优化
  • asp网站生成静态在线网站软件免费下载
  • wordpress古腾堡编辑器广州建网站开发seo型企业网站
  • 易云巢做营销型网站wordpress下载视频播放器
  • google网站哪里找人做网站
  • 外贸网站建设如何做呢百度热搜风云榜
  • ASP网站建设实训报告总结山西建设公司网站
  • 网站建设使用的什么软件房屋设计风格
  • 厦门网站建设公司排名杭州小型网站建设服务
  • 西安建设主管部门官方网站中文搭建式软件开发工具
  • 南通网站建设论文网站首页导航栏怎么做
  • 建设网站的运行费包括什么北京市建设工程信息网安徽兴创