一、马甲包介绍
1、什么是马甲包
马甲包是利用APP Store规则漏洞,通过开发人员的技术手段,在多个地区平台上架同一产品。马甲包和主包内容功能是一样的。
2、为什么要制作马甲包
不同的产品定位,不同的产品需要,会需要一套代码上架多个产品。
- 产品定位不一样,马甲包用来做一些导量、刷分。
- 抗风险。先用马甲包测试新功能,看看市场反应,好的话再在主包上迭代。
- 需要上架到不同国家地区应用市场。
3、怎么制作马甲包
UI部分:
- icon和启动图替换
- 代码里面文案修改
代码部分:
- 修改工程名字
- 修改图片资源,改变图片的hash值,不要让检测到以前被拒的资源
- 修改类名
- 修改方法名
- 打乱方法顺序
- 添加混淆代码、垃圾代码
打包提审:
- 建议换一个开发者账号去提交,并且换一个ip
- 更换一台新电脑打包
- 项目描述、项目宣传不能和之前的一样
- 测试账号不能和之前一样
- 一个账号只提交一个包,一台电脑不能提交超过23个包
二、OC垃圾代码生成脚本
#!/usr/bin/env python
# _*_ coding:utf-8 _*_
#第一步:首先生成一个500位的数组 驼峰类型的元素 用作文件名 eg:AsdfdfGsd
import random
import os,sys
import string
first = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
second = "abcdefghijklmnopqrstuvwxyz"
number = "345"
index = 0
array = []
for i in range(500):
final=(random.choice(first))
index = random.randint(3, 5)
for i in range(index):
final+=(random.choice(second))
final += (random.choice(first))
for i in range(index):
final+=(random.choice(second))
array.append(final)
print (array)
#第二步:
#用上边生成的数组来创建对应的.h和.m文件
# -*- coding: utf-8 -*-
import random
import os
import string
#创建.h文件
def text_createH(fileNmae,msg,msg1,propertyNumber,methodArray,msg3):
full_path = sys.path[0] + '/OCFiles/' + fileNmae + '.h'
file = open(full_path, 'w')
file.write('//\n// '+fileNmae+'.h\n// SajiaoShopping\n\n// Created by 某 波 bo on 15/10/23.\n// Copyright © 2017年 阿里郎. All rights reserved.\n//\n\n')
file.write(msg)
file.write(msg1)
propryNameArray = []
for index in range(1,propertyNumber):
propryNameArray.append(random.choice(array))
propryNameArray = list(set(propryNameArray))
for propertyName in propryNameArray:
file.write('@property(nonatomic,strong)'+random.choice(classArray)+' * '+propertyName+';\n')
file.write('\n\n')
for methodName in methodArray:
file.write('- (void)pushTo'+methodName+'VC:(NSDictionary *)info;\n')
file.write(msg3)
file.close()
print('Done')
#创建.m文件
def text_createM(fileNmae,msg,msg1,methodArray,msg3):
full_path = sys.path[0] + '/OCFiles/' + fileNmae + '.m'
file = open(full_path, 'w')
file.write('//\n// '+fileNmae+'.m\n// SajiaoShopping\n\n// Created by 某 波 bo on 15/10/23.\n// Copyright © 2017年 阿里郎. All rights reserved.\n//\n\n')
file.write(msg)
file.write(msg1)
for methodName in methodArray:
file.write('- (void)pushTo'+methodName+'VC:(NSDictionary *)info\n{\n\n NSMutableArray *array = [NSMutableArray array];\n')
number = random.randint(3, 10)
for i in range(1,number):
file.write(' [array addObject:@"'+random.choice(array)+'"];\n')
file.write('\n}\n\n')
file.write(msg3)
file.close()
print('Done')
classArray = ['NSString','UILabel','NSDictionary','NSData','UIScrollView','UIView']
array = ['HwxrFvrj', 'QnzduQbtdd', 'PvcrwLtqhf', 'UvdhDbjn', 'SuntmyTxvyzg', 'CvlxwBipbp', 'GzrdyzIbimvz', 'CqsjqMmgsp', 'OxaaeuWjhasc', 'NjiardRvwgbi', 'NcculmLtpljq', 'ApoqQrll', 'GkgokDyvjb', 'EblldkVouplj', 'KfdrFvnw', 'SfhyhObftc', 'SmruByoc', 'YzcccvXmpmit', 'OmqvaHpxat', 'XzytsUyvyd', 'MjforNnnyi', 'ZvjhuIdogs', 'BzfrxzSeahxc', 'PycycwFjtpny', 'XvngtoSedljr', 'DktiaCbucd', 'AqbplNuodc', 'MzkvgZuala', 'KdwzIoej', 'AaynatUpqcfd', 'IyvwhZvtjc', 'UmijGmsy', 'AoayndXxghym']
array = list(set(array))
for name in array:
number = random.randint(3, 10)
methodArray = []
for i in range(1,5):
methodArray.append(random.choice(array))
methodArray = list(set(methodArray))#数组去重
text_createH(name+'ViewController', '#import <UIKit/UIKit.h>\n','@interface '+name+ 'ViewController:'+ 'UIViewController\n\n',number,methodArray,'\n\n@end')
text_createM(name+'ViewController', '#import "'+name+'ViewController.h"\n\n' '@interface '+ name+'ViewController()\n\n @end\n\n','@implementation '+name+'ViewController\n\n- (void)viewDidLoad { \n\n [super viewDidLoad];\n\n}\n\n',methodArray,'\n\n@end')
三、Swift垃圾代码生成脚本
#!/usr/bin/env python
# _*_ coding:utf-8 _*_
import random
import os,sys
import string
#创建.swift文件
def createSwift(fileNmae,propertyNumber,methodArray):
full_path = sys.path[0] + '/SwiftFiles/' + fileNmae + '.swift'
file = open(full_path, 'w')
file.write('//\n// '+fileNmae+'.swift\n// LinkMall\n\n// Created by Meng on 2018/9/17.\n// Copyright © 2018年 OneThing Ltd. All rights reserved.\n//\n\n')
file.write('import UIKit \n\n' + 'class '+fileNmae+': UIViewController {\n\n')
propryNameArray = []
for index in range(1,propertyNumber):
propryNameArray.append(random.choice(array))
propryNameArray = list(set(propryNameArray))
for propertyName in propryNameArray:
file.write(' public var '+propertyName+':'+random.choice(classArray)+'!\n')
file.write('\n\n')
file.write(' override func viewDidLoad() {\n super.viewDidLoad()\n }\n\n')
for methodName in methodArray:
file.write(' public func '+methodName+'TOVC() {\n\n var realArr = Array<String>()\n')
number = random.randint(10, 15)
for i in range(1,number):
file.write(' realArr.append("'+random.choice(array)+'")\n')
file.write('\n }\n\n')
file.write('}')
file.close()
print('Done')
def createClassName():
first = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
second = "abcdefghijklmnopqrstuvwxyz"
index = 0
array = []
# 设置生成多少个类
classNumber = 100
for i in range(classNumber):
final=(random.choice(first))
#字符串长度
index = random.randint(10, 15)
for i in range(index):
final+=(random.choice(second))
final += (random.choice(first))
for i in range(index):
final+=(random.choice(second))
array.append(final)
return array
#属性类型
classArray = ['UIColor','UILabel','UITableView','UISlider','UIScrollView','UIView','UIButton']
array = createClassName()
array = list(set(array))
for name in array:
number = random.randint(10, 15)
methodArray = []
for i in range(50,100):
methodArray.append(random.choice(array))
methodArray = list(set(methodArray))#数组去重
createSwift(name+'VController',number,methodArray)