Commit f5231139 by liuxiaoxing

init

parent 9d76115f
# Default ignored files
/shelf/
/workspace.xml
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 2.7" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/tkio-test-case.iml" filepath="$PROJECT_DIR$/.idea/tkio-test-case.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
import requests
import json
import time
import random
from jiami.pdj import encryptorForAES
headers = {'Content-Type': 'application/json'}
# URL = 'https://log.analysis.com/receive/analysis/'
URL = 'http://119.3.252.134/receive/analysis/'
#时间戳
current_time_13 = int(round(time.time() * 1000))
#时间和日期
when = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
#日期
ds = time.strftime('%Y-%m-%d', time.localtime(time.time()))
#设备品牌
manufacturer = 'HUAWEI'
#设备系统
ryos = 'Android'
#设备类型
rydevicetype = 'vivox9'
#网络类型
network='wifi'
#分辨率
resolution='1344*750'
#运行商
op='中国移动'
channelid = 'aaa'
event = 'event1126'
page = 'page_26'
session = '3224232'
class allEvent:
# 激活
def installUpload(self, i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"ds": ds,
"what": "install",
"where": "install",
"who": i,
"context": {
"_manufacturer": manufacturer,
"_istablet": "phone",
"_network_type": network,
"_timestamp": current_time_13,
"_ipv6": "unknown",
"_tz": "+8",
"_ry_ts": "1572490307682",
"_pkgname": "com.example.reyunsdkdemo",
"_audio_volume": "0",
"_app_version": "2.0",
# "_ry_origin_when": "2019-10-31 10:51:48",
"_model": "DIG-AL00",
"_ip": IP,
"_lib": "Android",
"_androidid": i,
"_mac": "0C:8F:FF:A6:E5:20",
"_ryos": ryos,
"_oaid": "fd95eefb-abe9-4fa5-efe5-3f9b5bfd0128",
"_ryosversion": "6.0",
"_imei": i,
"_resolution": resolution,
# "_region": "北京",
"_lib_version": "a1.0.0",
"_rydevicetype": "DIG-AL00",
"_deviceid": i,
"_carrier": "unknown",
"_screen_brightness": "102",
"_channelid": channelid
},
})
s = encryptorForAES(s,JDClass)
p = requests.post(url=URL+'install', data=s, headers=headers, timeout=10)
print("激活:"+p.text)
# print(ds)
# print(p.url)
# 启动
def startupUpload(self, i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"ds": ds,
"what": "startup",
"where": "startup",
"who": i,
"context": {
"_manufacturer": manufacturer,
"_istablet": "phone",
"_network_type": network,
"_timestamp": current_time_13,
"_ipv6": "unknown",
"_tz": "+8",
"_ry_ts": "1572490307682",
"_pkgname": "com.example.reyunsdkdemo",
"_audio_volume": "0",
"_app_version": "2.0",
# "_ry_origin_when": "2019-10-31 10:51:48",
"_model": "DIG-AL00",
"_ip": IP,
"_lib": "Android",
"_androidid": i,
"_mac": "0C:8F:FF:A6:E5:20",
"_ryos": ryos,
"_oaid": "fd95eefb-abe9-4fa5-efe5-3f9b5bfd0128",
"_ryosversion": "6.0",
"_imei": i,
"_resolution": resolution,
# "_region": "北京",
"_lib_version": "a1.0.0",
"_rydevicetype": "DIG-AL00",
"_deviceid": i,
"_carrier": "unknown",
"_screen_brightness": "102",
"_channelid": channelid
},
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'startup', data=s, headers=headers, timeout=10)
print("启动:"+p.text)
# print(p.url)
# 事件
def eventUpload(self, i, IP, appkey,interface_type,JDClass):
s =json.dumps({
"appid": appkey,
"context": {
"_ry_origin_when": when,
"_idfv": "0B7B677B-47C6-4615-B938-983EB8C09B28",
"_ip": IP,
"_lib": "iOS",
"_session": session,
"_interface_type": interface_type,
"_timestamp": current_time_13,
"_create_timestamp": time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
"_imei": i,
"_androidid": i,
"_mac": "0C:8F:FF:A6:E5:20",
"_oaid": "fd95eefb-abe9-4fa5-efe5-3f9b5bfd0128",
"_lib_version": "a1.0.0",
"_deviceid": i,
"_tz": "+8",
"_channelid": channelid,
"_ry_ts": "1572335394441",
"_app_version": "1.0"
},
"ds": ds,
"what": event,
"where": 'event',
"who": i
})
s = encryptorForAES(s,JDClass)
p = requests.post(url=URL + 'event', data=s, headers=headers, timeout=10)
print("事件:" + p.text)
# print(p.url)
# page
def pageUpload(self, i, IP, appkey,interface_type,JDClass):
s = json.dumps({
"appid": appkey,
"ds": ds,
"what": page,
"where": "page",
"who": i,
"context": {
"_idfv": i,
"_ip":IP,
"_lib": "Android",
"_batch_type": "pagebatch",
"_session": session,
"_interface_type": interface_type,
"_timestamp": current_time_13,
"_create_timestamp": time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
"_imei": i,
"_androidid": i,
"_mac": "0C:8F:FF:A6:E5:20",
"_oaid": "fd95eefb-abe9-4fa5-efe5-3f9b5bfd0128",
"_lib_version": "a1.0.0",
"_deviceid": i,
"_tz": "+8",
"_channelid": channelid,
"_ry_ts": "1572342341972",
"_app_version": "1.0"
},
})
s = encryptorForAES(s,JDClass)
p = requests.post(url=URL + 'page', data=s, headers=headers, timeout=10)
print("page:" + p.text)
# print(p.url)
# 退出
def exitUpload(self, i, IP, appkey,JDClass):
s = json.dumps({
"appid": appkey,
"ds": ds,
"what": "exit",
"who": i,
"context": {
"_ry_origin_when": when,
"_triger": "terminate",
"_idfv": i,
"_ip": IP,
"_exit_page": page,
"_lib": "Android",
"_session": session,
"_timestamp": current_time_13,
"_create_timestamp": time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
"_imei": i,
"_androidid": i,
"_mac": "0C:8F:FF:A6:E5:20",
"_oaid": "fd95eefb-abe9-4fa5-efe5-3f9b5bfd0128",
"_lib_version": "a1.0.0",
"_deviceid": i,
"_tz": "+8",
"_channelid": channelid,
"_ry_ts": "1572343547238",
"_app_version": "1.0"
},
})
s = encryptorForAES(s,JDClass)
p = requests.post(url=URL + 'exit', data=s, headers=headers, timeout=10)
print("退出:" + p.text)
# print(p.url)
from analysis_ios_event.android_script import allEvent
import struct
import socket
import random
import time
import os
from jpype import *
appkey = 'd1d0b4495591467b694862497ed1fb2b'
current_path = os.path.dirname("../jiami/AESEncryptor.jar")
jvmPath = getDefaultJVMPath()
jars = [current_path + "/AESEncryptor.jar"]
jvm_cp = "-Djava.class.path={}".format(":".join(jars))
startJVM(jvmPath, jvm_cp)
JDClass = JClass("AESEncryptor")
lst = []
newList = ['364112464174', '987448857634', '823325548389', '774510604807', '502635795343', '456715648969', '049741445905', '374937339654', '155308535923', '601640865016']
# 遍历已有列表数据 发请求
# for i in newList:
# ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# # allEvent().startupUpload(i,ip,appkey,JDClass)
# allEvent().eventUpload(i,ip,appkey,'2',JDClass)
# # allEvent().pageUpload(i,ip,appkey,'1',JDClass)
# # allEvent().exitUpload(i,ip,appkey,JDClass)
for _ in range(1):
# 随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '103.23.28.70'
allEvent().installUpload(i,ip,appkey,JDClass)
allEvent().startupUpload(i,ip,appkey,JDClass)
allEvent().eventUpload(i,ip,appkey,'0',JDClass)
allEvent().pageUpload(i,ip,appkey,'0',JDClass)
allEvent().exitUpload(i,ip,appkey,JDClass)
lst.append(i)
print(lst)
from analysis_ios_event.ios_script import allEvent
import struct
import socket
import random
import os
import datetime
import time
from jpype import *
appkey = '30b0a4c2a44633f1e233436b277eae31'
# 123c0cb882d3dbec4f7f66251a84d123
# 30b0a4c2a44633f1e233436b277eae31
current_path = os.path.dirname("../jiami/AESEncryptor.jar")
jvmPath = getDefaultJVMPath()
jars = [current_path + "/AESEncryptor.jar"]
jvm_cp = "-Djava.class.path={}".format(":".join(jars))
startJVM(jvmPath, jvm_cp)
JDClass = JClass("AESEncryptor")
lst = []
newList = ['959442093969', '957622214463', '940056993368', '278010757900', '633693870464']
# 遍历已有列表数据 发请求
for i in newList:
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# allEvent().installUpload(i,ip,appkey,JDClass)
# time.sleep(1)
allEvent().startupUpload(i, ip, appkey, JDClass)
time.sleep(1)
allEvent().eventUpload(i, ip, appkey, '2', JDClass)
time.sleep(1)
allEvent().pageUpload(i, ip, appkey, '1', JDClass)
time.sleep(1)
allEvent().exitUpload(i, ip, appkey, JDClass)
# for _ in range(1):
# # 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
# # i = ''
# # 随机生成ip
# ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# # ip = '103.23.28.70'
# allEvent().installUpload(i, ip, appkey, JDClass)
# time.sleep(1)
# allEvent().startupUpload(i, ip, appkey, JDClass)
# time.sleep(1)
# allEvent().eventUpload(i, ip, appkey, '0', JDClass)
# time.sleep(1)
# allEvent().pageUpload(i, ip, appkey, '0', JDClass)
# time.sleep(1)
# allEvent().exitUpload(i, ip, appkey, JDClass)
allEvent().batchUpload(i, ip, appkey, JDClass)
# lst.append(i)
# print(lst)
# from numpy import long
from android_event.android_script import allEvent
import random
import requests
import socket
import struct
import time
import datetime
#导入hashlib模块进行md5操作
import hashlib
# from jiami.md5 import get_str_sha1_secret_str
#向短链发送点击数据
# 广告创意ID
ry_adcreative_id = '3336453253'
# 广告组ID
ry_adgroup_id = '33387645342536'
# 广告计划ID
ry_adplan_id = '333543213423'
# 广告组名称
ry_adgroup_name = 'ry_adgroup_name'
# 广告计划名称
ry_adplan_name = 'ry_adplan_name'
# 广告创意名称
ry_adcreative_name = 'ry_adcreative_name'
# bytedance_int 今日头条,kuaishou_int 快手,tencentams_int (新)广点通,rryingxiao_int 人人营销
pid = 'rryingxiao_int'
# 精准
# NvqIJfa
# 模糊
# Af2qIfa
# 3aAnAfa
URL = 'http://10.2.20.42:8083/tkio/vEBV7ra?preorder=true&noredirect=true'
# URL = 'http://uri6.com/adapt/encryp/love.match.set-bytedance?noredirect=true&pid=rryingxiao_int&callback=D8311DBF28D751F327B83F7CEE5B8850B88CC74C8C3FF628EB3A48CAE2212EE260EE347E1771382C5F1B2C0FC9E8921CB5245576D7E5C1EF680315AAA98DCFB189F66FBA49CC7BCB8E4B4726D6D363B816BB2133CADC80B1C12D9FE464A05ED974A70A646BAB1D4D78E2A75361676D5A0D3D4E52B7E7C6B72E9388C17FE9384BE1A47503AABEFB9423727DBAC7B7275AAD237E0E2774D2A8C3D0FDC895CE10C0CCE38F8FEDBC24AF2E23B2B5E742B50C07744361334E148979087917DFFFC445A74B9F939412DEF8D060474E1D353ED7E2EB636B32CADF29842BB90E2131BD3ED05D1A0438EA0EA8577613780B3D64377D85E758A2B20507A034A2C8A96077C7E200C410188C78F76B9B5E7F3E5E4AC3'
# URL = 'http://10.2.20.42:8083/tkio/encryp/uENNrya?noredirect=true&callback=D8311DBF28D751F327B83F7CEE5B885033E9390C927C9AD11DC560E284B8264F60EE347E1771382C5F1B2C0FC9E8921C232AEE9605803A05F03F2A37DB5C2A0434FE8EE58085C8DDC10A4729E93BB9141C43D64DC2E32BEC4D1B48617B15534E53B56C07040DD7816303D25B54BD99B71B7AC9BB6E733CC072F5E0D45835629E8EFE86BB75F2BE5F492CFC06DA04724949E0A13E33C6D8C40DEE1DC9555FA7477E02BB73108BFA234880D3CD8D7697FA7E1B63FE21DE5A9ACA0FB3D40AC484521879464AE0DC1C68B8D7FFE3092368685569A64D495EF6BB5C5A3388F0717412AE787A124F4643FD29A3789413FB6A09010841EA49F0C7D7606A56DF28BE20C6FA34BAEC6B57024C66B5322DF24281FA'
# ?impression=true
# ?noredirect=true
# ?preorder=true
# 234565656
# 16dc0cb882d3dbec4f7f66251a84d6dd
# 7e3aa681f68435b3f74de790d6424690
# 4eab4be709defbfc2cc85826b09caea0
# 6ba2b016f280004d10a1a354e426eceb
appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
event = 'event_1'
lst = []
nowTime = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
s = 0
w = 0
for _ in range(2):
# print("开始时间"+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
#随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = '862918037762069'
o = ''.join(str(random.choice(range(10))) for _ in range(12))
m = ''.join(str(random.choice(range(10))) for _ in range(12))
se = ''.join(str(random.choice(range(10))) for _ in range(12))
adid = ''.join(str(random.choice(range(10))) for _ in range(12))
# adid = '5011813780042235'
p1 = ''.join(str(random.choice(range(10))) for _ in range(12))
# p1 = '测试一下'
# "idfa": 'B5588C9C-4534-43FB-935D-F17C91622C83',
# "idfa": '00000000-0000-0000-0000-000000000000',
# sh1 = "track_click:"+appkey+":"+get_str_sha1_secret_str(i)
# print(sh1)
# i = '091508889907'
#md5加密
# 创建md5对象
# m = hashlib.md5()
# b = i.encode(encoding='utf-8')
# m.update(b)
# str_md5 = m.hexdigest().upper()
# print("md5加密:"+str_md5)
###########
#md16加密(截取md5加密的字符串)
# imei_16 = str_md5[8:24]
# print("md16加密:"+imei_16)
#随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '88.88.85.2'
try:
parms = {
# 'androidid': i,
# 'imei': i,
# "idfa": '8C297900-EE26-4501-94B5-DDE6F83E1496',
# 'gxid': '78B5382F687FAD16E75F5DDDC7745013',
# 'caid': '00_A0FF634AEDF1403205A4A6A1118CDA61_A66338F33BEBB40F5CD65F198AF2F40C',
# 'oaid': '00000000000000000000000000000000',
'ip': ip,
# 'ua':'Mozilla/5.0 (Linux; U; Android 7.0; zh-CN; Nexus 5X Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/40.0.2214.89 UCBrowser/11.4.5.937 Mobile Safari/537.36',
# 'pid': pid,
# 'vid': '7653236654354534rffdvdv!@#¥%@测试测试'
# 'cached_caid': '00_A2FF034AEDF1403205A4A6A1118CDA67_A66338F33BEBB40F5CD65F198AF2F44C',
# "idfv": 'CB389725-0029-4A35-8E38-D142F836B626',
# "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3",
# 'creativeId':'21321321312123',
# 'requestId':'312321321312',
# 'adId': long('21231'),
# 'ry_adgroup_name': ry_adgroup_name,
# 'ry_adplan_name': ry_adplan_name,
# 'ry_adcreative_name': ry_adcreative_name,
# "ry_adgroup_id": ry_adgroup_id,
# "ry_adplan_id": ry_adplan_id,
# "ry_adcreative_id": ry_adcreative_id,
# 'imei2': 'null',
# 'meid': i
# 'bd_vid': i
# 'oaid': "9f80c84a559f573636a47ff8daed0d32",
# 'muid': "00000000-0000-0000-0000-000000000000",
# 'mac': "5432453241421",
# 'subchannel': '333',
# 'aid': '111',
# 'siteid': '222',
# 流量来源
# 'csite': '40006',
# "timestamp": "1569141628027",
# "creative": "31096865315",
# "deviceid": 'null',
# "tz": "+8",
# "wx_campaign_id":ry_adgroup_id,
# 'wx_adgroup_id':ry_adplan_id,
# 'ry_adcreative_id':ry_adcreative_id
# "ry_channel_fake": "false",
# "ry_ts": "1569141628025",
# "type": '1222',
# "ctype": '4232323',
# "campaign_id": '123',
# "adgroup_id": '123',
# "creative_id": '123'
# 'sysfsize': '111',
# '_model': '1',
# 'sysram': '1',
# '_ryosversion': '1',
# 'sysutime': '1',
# 'sysuname': '1',
# '_carrier': '1',
# 'syscountryc': '1',
# 'sysrtime': '1',
# "accountid": '990099'
}
time.sleep(5)
#timeout可以超时四秒
# verify = False
p = requests.get(url=URL, params=parms, timeout=5, verify=False)
# p = requests.post(url=URL, params=parms, timeout=30, verify= False)
print('imei:', i)
print("ip:", ip)
# print(p.text)
print(p.url)
# print("oaid:",o)
print('success:', s)
print(p.status_code)
print(p.content)
# print('androidid:',a)
# print(nowTime)
s = s+1
except Exception as err:
print(err)
print('wrong:', w)
print('imei:', i)
print("ip:", ip)
# print(p.status_code)
#print('androidid', a)
w = w+1
# time.sleep(10)
# try:
# allEvent().installUpload(i, ip, appkey)
# # allEvent().formevent(i, ip, appkey)
#
# except Exception:
# print('install_wrong:', w)
# w = w + 1
# time.sleep(3)
# try:
# allEvent().retentionEvent(i,ip,appkey)
# except Exception:
# print('retention',w)
# w = w + 1
# time.sleep(3)
# try:
# allEvent().adshow(i, ip, appkey,adid)
# # allEvent().formevent(i, ip, appkey)
# except Exception:
# print('adshow_wrong:', w)
# w = w + 1
# time.sleep(3)
# try:
# allEvent().adclick(i, ip, appkey, adid)
# # allEvent().formevent(i, ip, appkey)
# except Exception:
# print('adshow_wrong:', w)
# w = w + 1
# time.sleep(5)
# try:
# allEvent().appduration(i, ip, appkey,se)
# # allEvent().formevent(i, ip, appkey)
# print("session:"+se)
# except Exception:
# print('install_wrong:', w)
# w = w + 1
# time.sleep(5)
# try:
# allEvent().pageduration(i, ip, appkey, se, p1)
# # allEvent().formevent(i, ip, appkey)
# except Exception:
# print('pageduration_wrong:', w)
# w = w + 1
# time.sleep(3)
# try:
# allEvent().startupEvent(i, ip, appkey)
#
# except Exception:
# print('install_wrong:', w)
# w = w + 1
# time.sleep(5)
# try:
# allEvent().registerEvent(i, ip, appkey)
# except Exception as e:
# print('注册_wrong:', w)
# print(e)
# time.sleep(4)
# try:
# allEvent().loginEvent(i, ip, appkey)
# except Exception:
# print('登录_wrong:', w)
# time.sleep(5)
# try:
# allEvent().ziding_event(i, ip, appkey, event)
# except Exception as err:
# print(err)
# print('自定义_wrong:', w)
# # #
# time.sleep(2)
# try:
# allEvent().payEvent(i, ip, appkey)
# except Exception as err:
# print(err)
# print('付费_wrong:', w)
# time.sleep(3)
# try:
# allEvent().payorder(i, ip, appkey)
# except Exception:
# print('订单_wrong:', w)
# print("结束时间" + datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
#
#
#
# lst.append(i)
# print(lst)
from android_event.android_script import allEvent
import random
import requests
import socket
import struct
import time
import datetime
#向短链发送点击数据
#测试环境
URL = 'http://10.3.20.42:8083/tkio/j2M3Yra?callback=__CALLBACK__'
appkey = '77611aaa17bcaafe889e3fac2c3e6855'
# event = 'ry_wake'
nowTime = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
s = 0
w = 0
for _ in range(1):
print("开始时间"+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
#随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
#i = '9845632344'
#随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
#ip = '148.206.254.57'
try:
parms = {
#'androidid'18888888888:a,
'imei': i,
'ip': ip,
#'cid': '2093'
#'subchannel': '123456789',
#'aid': '54676',
#'siteid': '68793',
#'csite': '4355743'
}
#timeout可以超时四秒
p = requests.get(url=URL,params=parms,timeout=10)
print('imei:',i)
print("ip:",ip)
print('success:',s)
#print('androidid:',a)
s=s+1
except Exception as err:
print(err)
print('wrong:',w)
print('imei:', i)
print("ip:",ip)
#print('androidid', a)
w=w+1
#continue
time.sleep(5)
try:
allEvent().installUpload(i, ip, appkey)
except Exception:
print('install_wrong:', w)
w = w + 1
# continue
# time.sleep(1)
# try:
# allEvent().registerEvent(i, ip, appkey)
# except Exception as e:
# print('注册_wrong:', w)
# print(e)
# continue
# # time.sleep(1)
# try:
# allEvent().loginEvent(i, ip, appkey)
# except Exception:
# print('登录_wrong:', w)
# continue
# # time. sleep(3)
# try:
# allEvent().payEvent(i, ip, appkey)
# except Exception as err:
# print(err)
# print('付费_wrong:', w)
print("结束时间" + datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
from android_event.android_script import allEvent
import struct
import socket
import random
import time
import hashlib
#安卓常规渠道激活
appkey = '6bc175c5f1ffa1fb8dce2196cb644de2'
# 线上预约app
# 7f64fbd64513bc74aa6b5bf753ae0953
# 16dc0cb882d3dbec4f7f66251a84d6dd
# 7e3aa681f68435b3f74de790d6424690
event = 'event_1'
# ------------周六测试内容-----------------,已写好的是分包的deeplink和分包
# 6bc175c5f1ffa1fb8dce2196cb644de2
# deeplink设备
# 150143490356
lst = []
newList = ['150143490356']
# 遍历已有列表数据 发请求
for i in newList:
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().payEvent(i, ip, appkey)
# for _ in range(1):
# # 随机生成12为数组
# s = ''.join(str(random.choice(range(10))) for _ in range(18))
# p = ''.join(str(random.choice(range(10))) for _ in range(12))
# se = ''.join(str(random.choice(range(10))) for _ in range(12))
# adid = ''.join(str(random.choice(range(10))) for _ in range(12))
# # adid = '598471615567'
#
# # p = '987654321234567'
# # s = '2321321312h8ro321'
# # i = ''.join(str(random.choice(range(10))) for _ in range(12))
# # i = '93.55.87.164'
# # i = '00000000-0000-0000-0000-000000000000'
# i = '150143490356'
# # 随机生成ipXXXX XXCB489741-0029-4A35-8E38-D142F836B623
# ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# # ip = '13.114.105.112'
# # 地域测试ip
# # 60.13.148.23 新疆维吾尔自治区吐鲁番市
# # 61.139.239.255 广西壮族自治区北海市
# # 119.60.0.0 宁夏回族自治区银川市
#
# # allEvent().installUpload(i, ip, appkey)
# # time.sleep(5)
# # allEvent().startupEvent(i, ip, appkey)
# # allEvent().loginEvent(i, ip, appkey)
# # allEvent().registerEvent(i, ip, appkey)
# allEvent().payEvent(i, ip, appkey)
# # allEvent().ziding_event(i, ip, appkey, event)
# # allEvent().payorder(i, ip, appkey)
# # allEvent().adshow(i,ip,appkey,adid)
# # allEvent().adclick(i,ip,appkey,adid)
# # allEvent().pageduration(i,ip,appkey,se,p)
# # allEvent().appduration(i,ip,appkey,s)
# # allEvent().invoke_test(i,ip,appkey)
# # allEvent().retentionEvent(i, ip, appkey)
# #
# # allEvent().formevent(i,ip,appkey)
# # allEvent().batchUpload(i,ip,appkey)
# # allEvent().H5(i,ip,appkey)
# print("imei:"+i)
# # print("pageid:"+p)
# # print(s)
# print(ip)
from android_event.android_script import allEvent
import socket
import struct
import random
#安卓常规渠道登陆
appkey = '57ed2dd31596bb4682471e82c0c73c1a'
event = 'event_12'
for _ in range(1):
# 随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = '987654356743'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().loginEvent(i,ip,appkey)
allEvent().startupEvent(i,ip,appkey)
allEvent().registerEvent(i,ip,appkey)
allEvent().payEvent(i,ip,appkey)
allEvent().ziding_event(i,ip,appkey,event)
allEvent().payorder(i,ip,appkey)
\ No newline at end of file
from android_event.android_script import allEvent
import struct
import socket
import random
#安卓常规渠道付费
appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
for _ in range(1):
# 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '075618589103'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().payEvent(i, ip, appkey)
\ No newline at end of file
from android_event.android_script import allEvent
import struct
import socket
import random
import time
#安卓常规渠道注册
appkey = '5832ed4f6cba0813fcc923117f087581'
for _ in range(1):
# 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '930584053009'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().registerEvent(i,ip,appkey)
# time.sleep(2)
from android_event.android_script import allEvent
import struct
import socket
import random
#启动
appkey = '6b4393b7946d33f2e20af29d3b0b729e'
newList = ['762005025361']
# 遍历已有列表数据 发请求
for i in newList:
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().startupEvent(i,ip,appkey)
# for _ in range(1):
# # 随机生成12为数组
# # i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = '276416485474'
# # 随机生成ip
# ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# allEvent().startupEvent(i,ip,appkey)
# # print(i)
from android_event.android_script import allEvent
import socket
import struct
import random
#自定义事件
event = 'pageview'
appkey = 'b5df81cdf6adbfb65796d4f3e6fd9985'
# 404342484471
for _ in range(1):
# 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '597621803967'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '100.120.179.101'
allEvent().ziding_event(i,ip,appkey,event)
# allEvent().invoke_test(i, ip, appkey)
print(i)
from android_event.android_script import allEvent
import struct
import socket
import random
appkey = 'dc9ab82c4c31143cd2a21700235db969'
for _ in range(1):
# 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '179812685157'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().payorder(i,ip,appkey)
# allEvent().payEvent(i,ip,appkey)
\ No newline at end of file
from android_event.android_script import allEvent
import struct
import socket
import random
import time
import hashlib
import datetime
import requests
# 安卓常规渠道激活
appkey = 'f2eac430296318e22350a7031f29e2dd'
# 16dc0cb882d3dbec4f7f66251a84d6dd
# 57ed2dd31596bb4682471e82c0c73c1a
event = 'event_10'
URL = 'http://t.uri6.com/tkio/Iniymya'
s = 0
w = 0
while True:
time.sleep(0.3)
ts = int(time.time()) * 1000
# now = datetime.datetime.now()
startDate = datetime.datetime(2020, 8, 4, 23, 00, 00)
startTs = int(time.mktime(startDate.timetuple()))*1000
endDate = (startDate + datetime.timedelta(minutes=120))
endTs = int(time.mktime(endDate.timetuple()))*1000
if startTs <= ts <= endTs:
# 随机生成12为数组
# s = ''.join(str(random.choice(range(10))) for _ in range(18))
# p = ''.join(str(random.choice(range(10))) for _ in range(12))
# se = ''.join(str(random.choice(range(10))) for _ in range(12))
# adid = ''.join(str(random.choice(range(10))) for _ in range(12))
# # adid = '3011607722834533'
#
# # p = '170635529842'
# # s = '3425431432534231243321'
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
# # i = '357692523639'
# # 随机生成ipXXXXXX
# ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# # ip = '117.15.9.129'
#
# # 地域测试ip
# # 60.13.148.23 新疆维吾尔自治区吐鲁番市
# # 61.139.239.255 广西壮族自治区北海市
# # 119.60.0.0 宁夏回族自治区银川市
#
# allEvent().installUpload(i, ip, appkey)
# allEvent().startupEvent(i, ip, appkey)
# allEvent().loginEvent(i, ip, appkey)
# 随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = '1234567543243543214'
o = ''.join(str(random.choice(range(10))) for _ in range(12))
m = ''.join(str(random.choice(range(10))) for _ in range(12))
se = ''.join(str(random.choice(range(10))) for _ in range(12))
adid = ''.join(str(random.choice(range(10))) for _ in range(12))
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '39.134.146.208'
try:
parms = {
'imei': i,
'ip': ip,
}
# timeout可以超时四秒
# verify = False
p = requests.get(url=URL, params=parms, timeout=30, verify=False)
# p = requests.post(url=URL, params=parms, timeout=30, verify= False)
print('imei:', i)
print("ip:", ip)
# print(p.text)
# print("oaid:",o)
print('success:', s)
print(p.status_code)
# print('androidid:',a)
# print(nowTime)
s = s + 1
except Exception as err:
print(err)
print('wrong:', w)
print('imei:', i)
print("ip:", ip)
print(p.status_code)
# print('androidid', a)
w = w + 1
# continue
time.sleep(5)
try:
allEvent().installUpload(i, ip, appkey)
# allEvent().formevent(i, ip, appkey)
except Exception:
print('install_wrong:', w)
w = w + 1
time.sleep(5)
try:
allEvent().registerEvent(i, ip, appkey)
except Exception:
print('install_wrong:', w)
w = w + 1
print("ts:", ts)
elif ts > endTs:
print("ts:",ts)
print("endTs:",endTs)
break
from fenbao_android_event.android_script import allEvent
import random
import requests
import socket
import struct
import time
#向短链发送点击数据
#!!!!分包需要删掉https的s
URL = 'http://uri6.com/tkio/BbQZnqa?noredirect=true'
appkey = '74933b9c672979161123df2a4d67e8be'
event = 'invoke'
cmpaignid = '223344'
# 广告创意ID
ry_adcreative_id = '999'
# 广告组ID
ry_adgroup_id = '999'
# 广告计划ID
ry_adplan_id = '999'
# 广告组名称
ry_adgroup_name = '广告组'
# 广告计划名称
ry_adplan_name = '广告计划'
# 广告创意名称
ry_adcreative_name = '广告创意'
s = 0
w = 0
for _ in range(1):
#随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = '167070728336'
#随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '175.93.28.70'
try:
parms = {
# 'androidid': "43214532142142",
'imei': i,
# "idfa": 'DBC13622-E34B-440C-B7A7-FB6641D0D9AB',
'ip': ip,
# "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3",
# 'creativeId':'21321321312123',
# 'requestId':'312321321312',
# 'adId': long('21231'),
# 'ry_adgroup_name': ry_adgroup_name,
# 'ry_adplan_name': ry_adplan_name,
# 'ry_adcreative_name': ry_adcreative_name,
# "ry_adgroup_id": ry_adgroup_id,
# "ry_adplan_id": ry_adplan_id,
# "ry_adcreative_id": ry_adcreative_id,
}
#timeout可以超时四秒
# verify = False
p = requests.get(url=URL, params=parms, timeout=30, verify= False)
print('success:',s)
# print(p.text)
print('imei:',i)
#print('ip:',ip)
s=s+1
except requests.exceptions.RequestException:
print('wrong:',w)
print('imei:', i)
print('ip', ip)
w = w+1
time.sleep(15)
try:
allEvent().installUpload(i, ip, appkey, cmpaignid)
except Exception as err:
print('install_wrong:', w)
w = w + 1
print(err)
# time.sleep(1)
# try:
# allEvent().registerEvent(i, ip, appkey)
# except Exception as e:
# print('注册_wrong:', w)
# print(e)
# # continue
# time.sleep(2)
# try:
# allEvent().loginEvent(i, ip, appkey)
# except Exception:
# print('登录_wrong:', w)
# time.sleep(5)
# try:
# allEvent().payEvent(i, ip, appkey)
# except Exception:
# print('付费_wrong:', w)
# time.sleep(10)
# try:
# allEvent().ziding_event(i, ip, appkey,event)
# except Exception:
# print('自定义_wrong:', w)
import requests
import json
import time
import random
headers = {'Content-Type': 'application/json'}
# URL = 'http://10.2.20.42:8080/receive/tkio/'
URL = 'http://log.trackingio.com/receive/tkio/'
# URL = 'http://120.53.212.71/receive/tkio/'
# URL = 'http://tlog.trackingio.com/receive/tkio/'
# URL = 'http://jisulog.sortda.com/receive/tkio/'
#时间戳
current_time_13 = int(round(time.time() * 1000))
#时间和日期
when = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
#日期
ds = time.strftime('%Y-%m-%d', time.localtime(time.time()))
#设备品牌
manufacturer = 'vivo'
#设备系统
ryos = 'android'
#设备类型
rydevicetype = 'vivox9'
#网络类型
network='wifi'
#分辨率
resolution='1344*750'
#运行商
op='中国移动'
# 支付类型 支付宝(alipay),银联(unionpay),微信支付(weixinpay),易宝支付(yeepay)
paymenttype = 'alipay'
#货币类型
currencytype = 'CNY'
#支付的货币金额
currencyamount = '45'
when1 = '2020-06-04 10:00:00'
# (设备型号)
model = ''
# (操作系统版本)
ryosversion = ''
carrier = '中国联通'
lv = '1.5.0'
class allEvent:
# 激活
def installUpload(self,i,IP,appkey,cmpaignid):
s = json.dumps({
# "what":'install',
"appid":appkey,
"context":{
'_category': 'APPMARKET',
"_campaignid": cmpaignid,
# "_channelid": cmpaignid,
"_deviceid":i,
"_imei":i,
"_androidid":i,
"_ip":IP,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op':op,
'_timestamp':current_time_13,
'uniqueName': '2221',
"_model": model,
"_ryosversion": ryosversion,
# 'adgroupId': '324322'
# "_manufacturer": "OPPO",
# "_oaid_limited": "false",
# "_meid": "unknown",
# "_network_type": "4G",
# "_istablet": "phone",
# "_timestamp": "1589152752083",
# "_imei2": "unknown",
# "_ipv6": "2409:896a:3850:c1e0:2:1:d3ac:8c80",
# "_tz": "+8",
# "_ry_ts": "1589152758942",
# "_pkgname": "com.qmhd.game.gwgxq",
# "_audio_volume": "0",
# "_app_version": "1.0.5",
# "_model": "OPPO A83",
# "_ip": IP,
# "_ucid": "WsfjVbhuJTMDAHekTHFuIZ7c",
# "_ukid": "unknown",
# "_lib": "Android",
# "_androidid": "d24a4684afe476e",
# "_ryandroid8version": "25",
# "_mac": "9C:0C:DF:86:44:B1",
# "_ryos": "Android",
# "_oaid": "unknown",
# "_bd_vid": "unknown",
# "_create_timestamp": "1589152751924",
# "_ryosversion": "7.1.1",
# "_imei": i,
# "_resolution": "720*1360",
# "_lib_version": "1.5.4",
# "_deviceid": i,
# "_campaignid": cmpaignid,
# "_rydevicetype": "OPPO A83",
# "_carrier": "unknown",
# "_screen_brightness": "255"
},
'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
#time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL+'install',data=s,headers=headers,timeout=5)
print(p.text)
print(when)
#注册
def registerEvent(self,i,IP,appkey):
s = json.dumps({
'what':'register',
'appid':appkey,
'context':{
'_deviceid':i,
'_imei':i,
'_androidid':i,
'_ip':IP,
'_timestamp': current_time_13
},
'when':when,
'ds':ds,
'who':'lxx_test'
})
p = requests.post(url=URL+'register',data=s,headers=headers,timeout=5)
print(p.text)
#登陆
def loginEvent(self,i,IP,appkey):
s = json.dumps({
'what': 'loggedin',
'appid': appkey,
'context': {
'_deviceid': i,
'_imei': i,
'_androidid': i,
'_ip': IP,
'_timestamp': current_time_13
},
'when': when,
'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL+'loggedin', data=s, headers=headers, timeout=5)
print(p.text)
#付费
def payEvent(self,i,IP,appkey):
#订单号
transactionid = ''.join(str(random.choice(range(10))) for _ in range(19))
s = json.dumps({
'what': 'payment',
'appid': appkey,
'context': {
'_deviceid': i,
'_imei': i,
'_androidid': i,
'_ip': IP,
'_timestamp': current_time_13,
'_transactionid':transactionid,
'_paymenttype': paymenttype,
'_currencytype': currencytype,
'_currencyamount': currencyamount,
},
'when': when,
'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL+'payment', data=s, headers=headers, timeout=5)
print(p.text)
# 订单
def orderEvent(self, i, IP, appkey):
# 订单号
transactionid = ''.join(str(random.choice(range(10))) for _ in range(19))
s = json.dumps({
'what': 'order',
'appid': appkey,
'context': {
'_deviceid': i,
'_imei': i,
'_androidid': i,
'_ip': IP,
'_timestamp': current_time_13,
'_transactionid': transactionid,
'_paymenttype': paymenttype,
'_currencytype': currencytype,
'_currencyamount': currencyamount,
},
'when': when,
'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL+'order', data=s, headers=headers, timeout=5)
print(p.text)
#自定义事件
def ziding_event(self,i,IP,appkey,event):
s = json.dumps({
'what': event,
'appid': appkey,
'context': {
'_deviceid': i,
'_imei': i,
'_androidid': i,
'_ip': IP,
#识别是否为自定义事件,默认传1
'_isreyundefaultevent':'1'
},
'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL+'event', data=s, headers=headers, timeout=5)
print(p.text)
# 自定义事件
def invoke_test(self, i, IP, appkey,cmpaignid):
s = json.dumps({
"what": "invoke",
"appType": "",
"appid": appkey,
"context": {
"_campaignid": cmpaignid,
"_rydevicetype": "iPhone",
"_ip": IP,
"_ryosversion": ryosversion,
"_manufacturer": "苹果",
"frequency": "0.000",
"_app_version": "2.0",
"_isreyundefaultevent": "1",
"_deviceid": i,
"_device_gps": "unknown",
"_jbk": "0",
"_timestamp": "1565941809351",
"_imei": i,
# "_idfa": "DBC93722-E34B-440C-B7A7-FB6641D0D9AB",
"_idfv": i,
"_lib_version": lv,
"_carrier":carrier,
"_ry_ts": "1565941809416",
"_create_timestamp": "1565941809351",
"_tz": "+8",
"_pkgname": "com.reyun.sdktrackingtest",
"_ipv6": "fe80::1cf8:ea60:3508:1dc2",
"modify": "0",
"_ry_origin_when": "2019-08-16 15:50:09",
"_resolution": "736*414",
"_ryos": "ios",
"_model": model,
"_mac": "02:00:00:00:00:00",
"_network_type": "WIFI",
"_lats": "1"
},
"where": "event",
"when": time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
"ds": when,
"who": "unknown"
})
p = requests.post(url=URL+'event', data=s, headers=headers, timeout=5)
print("自定义" + p.text)
from fenbao_android_event.android_script import allEvent
import struct
import socket
import random
import time
import time
#安卓分包激活
appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
#57ed2dd31596bb4682471e82c0c73c1a
# 4b25b8a4dc584e63e9a7b81c3adedf2f
event = 'event_10'
cmpaignid = '12121'
for _ in range(1):
# 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '453829618586'
# 随机生成ip
# ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
ip = '143.205.125.236'
# allEvent().installUpload(i, ip, appkey, cmpaignid)
# time.sleep(3)
# allEvent().loginEvent(i, ip, appkey)
# allEvent().orderEvent(i, ip, appkey)
# allEvent().ziding_event(i, ip, appkey,event)
allEvent().payEvent(i, ip, appkey)
# allEvent().registerEvent(i, ip, appkey)
# allEvent().invoke_test(i, ip, appkey,cmpaignid)
print(i)
from fenbao_android_event.android_script import allEvent
import socket
import struct
import random
#安卓分包登陆
appkey = '4b25b8a4dc584e63e9a7b81c3adedf2f'
for _ in range(1):
# 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '824031087372'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().loginEvent(i,ip,appkey)
\ No newline at end of file
from fenbao_android_event.android_script import allEvent
import struct
import socket
import random
#付费
appkey = '4b25b8a4dc584e63e9a7b81c3adedf2f'
for _ in range(1):
# 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '075618589103'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().payEvent(i,ip,appkey)
# allEvent().orderEvent(i,ip,appkey)
\ No newline at end of file
from fenbao_android_event.android_script import allEvent
import struct
import socket
import random
#安卓分包注册
appkey = '4b25b8a4dc584e63e9a7b81c3adedf2f'
for _ in range(1):
# 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '075618589103'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().registerEvent(i,ip,appkey)
\ No newline at end of file
from fenbao_android_event.android_script import allEvent
import socket
import struct
import random
#自定义事件
event = 'event_11'
appkey = '4b25b8a4dc584e63e9a7b81c3adedf2f'
for _ in range(1):
# 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '075618589103'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().ziding_event(i,ip,appkey,event)
from game.game_event import allevent
import struct
import socket
import random
import time
lst = []
newList = ['195713813811']
appkey = '426fb8e0d9879ebe739cc2a48585bf14'
event = 'exception'
# 遍历已有列表数据 发请求
# for i in newList:
# # 随机生成ip
# ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# c = ''.join(str(random.choice(range(10))) for _ in range(12))
# # allevent().event_login(i,appkey)
# # time.sleep(2)
# allevent().event_economy(i,appkey,c)
for _ in range(5):
i = ''.join(str(random.choice(range(10))) for _ in range(12))
c = ''.join(str(random.choice(range(10))) for _ in range(12))
allevent().event_install(i, appkey)
time.sleep(2)
allevent().event_register(i, appkey)
time.sleep(2)
allevent().event_login(i, appkey)
time.sleep(2)
allevent().event_payment(i, appkey, c)
# time.sleep(2)
# allevent().event_event(i,appkey,event)
# allevent().event_economy(i,appkey,c)
lst.append(i)
print(lst)
import requests
import json
import time
import random
URL = 'http://log.reyun.com'
# URL = 'http://10.3.20.42:8080'
headers = {'Content-Type': 'application/json'}
URL_install = URL+'/receive/rest/install'
URL_startup = URL+'/receive/rest/startup'
URL_register = URL+'/receive/rest/register'
URL_payment = URL+'/receive/rest/payment'
URL_loggedin = URL+'/receive/rest/loggedin'
URL_event = URL+'/receive/rest/event'
URL_economy = URL+'/receive/rest/economy'
network = 'wifi'
os = 'android'
devicetype = 'iphone4s'
resolution = '123*456'
channelid = '111'
op = '中国移动'
itemname = '测试5'
itemtotalprice = '99'
serverid = 1
class allevent:
def event_install(self,i,appid):
s = json.dumps({
# "appid": appid,
# "context":
# {
# "deviceid": i,
# "idfa":i,
# "idfv":i,
# "os": os,
#
#
# "channelid":channelid
# }
"what": "install",
"appType": "",
"appid": appid,
"context": {
"rydevicetype": "iPhone",
"rybundleid": "com.reyun.sdktrackingtest",
"lats": "0",
"tz": "+8",
"ry_sdk_name": "ios_game",
"ip": "1.119.145.230",
"ry_origin_when": "2020-12-03 10:46:22",
# "idfa": "DBC93722-E34B-440C-B7A7-FB6641D0D9AB",
'imei':i,
"ry_ts": "1606963582173",
"deviceid": i,
"serverid": "unknown",
"openudid": "unknown",
"mac": "02:00:00:00:00:00",
"jbk": "0",
"_istf": "1",
"create_stamp": "1606963582097",
"ry_sdk_ver": "1.0.0",
"idfv": "9B02D5E5-D23F-4A0E-8B2D-970E632DC6B2",
"ryosversion": "14.0",
"ryos": os,
"channelid": "_testBDChannel",
"timestamp": "1606963582097"
},
"where": "install",
# "when": "2020-12-03 10:46:22",
# "ds": "2020-12-03",
"who": "unknown"
})
p = requests.post(url=URL_install,data=s,headers=headers,timeout=4)
print(p.text)
def event_startup(self,i,appid):
s = json.dumps({
"appid": appid,
"context":
{
"deviceid": i,
"idfa":i,
"idfv":i,
"channelid":channelid,
"network":network,
"os":os,
"devicetype":devicetype,
'resolution':resolution,
'op': op
}
})
p = requests.post(url=URL_startup,data=s,headers=headers,timeout=4)
print(p.text)
def event_register(self,i,appid):
s = json.dumps({
"appid": appid,
"who":i,
"context":
{
"deviceid": i,
#"idfa":i,
#"idfv":i,
"serverid": serverid,
"channelid":channelid
}
})
p = requests.post(url=URL_register, data=s, headers=headers, timeout=4)
print(p.text)
def event_login(self, i, appid):
s = json.dumps({
"appid": appid,
"who": i,
"context":
{
"deviceid": i,
# "idfa":i,
# "idfv":i,
"serverid": serverid,
"channelid": channelid
}
})
p = requests.post(url=URL_loggedin,data=s,headers=headers,timeout=4)
print(p.text)
def event_payment(self,i,appid,campId):
s = json.dumps({
"appid": appid,
"who":i,
"context":
{
"deviceid": i,
"imei":i,
"idfv":i,
"channelid":channelid,
"transactionid":"12323232131321",
"paymenttype":"支付宝",
"currencytype":"CNY",
"currencyamount":"100",
"virtualcoinamount":"500",
"iapname":"test",
"iapamount":"3",
"campId":campId
}
})
p = requests.post(url=URL_payment,data=s,headers=headers,timeout=4)
print(p.text)
def event_event(self,i,appid,event):
s = json.dumps({
"appid": appid,
"who": i,
"what": event,
"context":
{
"deviceid": i,
# "idfa":i,
# "idfv":i,
"serverid": serverid,
"channelid": channelid
}
})
p = requests.post(url=URL_event, data=s, headers=headers, timeout=4)
print(p.text)
def event_economy(self,i,appid,campId):
s = json.dumps({
"appid": appid,
"who":i,
"context":
{
"deviceid": i,
"idfa":i,
"idfv":i,
"channelid":channelid,
"itemamount": "1",
"itemname": itemname,
"itemtotalprice": itemtotalprice,
"campId": campId
}
})
p = requests.post(url=URL_economy,data=s,headers=headers,timeout=4)
print(p.text)
\ No newline at end of file
from android_event.android_script import allEvent
import random
import requests
import socket
import struct
import time
import datetime
#向短链发送点击数据
#海外线上环境
URL = 'http://enuri6.com/tkio/uaQ32aa'
appkey = '963727fdbc9f552761f3f30859230480'
event = 'ry_wake'
s = 0
w = 0
for _ in range(1):
#随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
#i = '9845632344'
#随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
#ip = '148.206.254.57'
try:
parms = {
#'androidid':a,
'imei': i,
'ip': ip,
# 海外版多的参数
'_gaid':i
# utc时间
#'cid': '2093'
#'subchannel': '123456789',
#'aid': '54676',
#'siteid': '68793',
#'csite': '4355743'
}
#timeout可以超时四秒
p = requests.get(url=URL,params=parms,timeout=10)
print('imei:',i)
print("ip:",ip)
print('success:',s)
#print('androidid:',a)
s=s+1
except Exception as err:
print(err)
print('wrong:',w)
print('imei:', i)
print("ip:",ip)
#print('androidid', a)
w=w+1
#continue
# time.sleep(4)
# try:
# allEvent().installUpload(i, ip, appkey)
# except Exception:
# print('install_wrong:', w)
# w = w + 1
#continue
# time.sleep(1)
# try:
# allEvent().registerEvent(i, ip, appkey)
# except Exception as e:
# print('注册_wrong:', w)
# print(e)
# #continue
# time.sleep(1)
# try:
# allEvent().loginEvent(i, ip, appkey)
# except Exception:
# print('登录_wrong:', w)
# #continue
# time.sleep(3)
# try:
# allEvent().ziding_event(i, ip, appkey, event)
# except Exception as err:
# print(err)
# print('自定义_wrong:', w)
class utc_time:
def local2utc(local_st):
'''本地时间转UTC时间(-8:00)'''
time_struct = time.mktime(local_st.timetuple())
utc_st = datetime.datetime.utcfromtimestamp(time_struct)
return utc_st
# #本地时间
localtime=datetime.datetime.fromtimestamp(time.time())
a=utc_time.local2utc(localtime).strftime('%Y-%m-%d %H:%M:%S')
print(a)
print(localtime)
\ No newline at end of file
import requests
import json
import time
import random
headers = {'Content-Type': 'application/json'}
#测试环境
URL = 'http://reyunlog.com/receive/tkio/event'
#时间戳
current_time_13 = int(round(time.time() * 1000))
#时间和日期
when = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
#日期
ds = time.strftime('%Y-%m-%d', time.localtime(time.time()))
#设备品牌
manufacturer = 'vivo'
#设备系统
ryos = 'android'
#设备类型
rydevicetype = 'vivox9'
#网络类型
network='wifi'
#分辨率
resolution='1344*750'
#运行商
op='中国移动'
# 支付类型 支付宝(alipay),银联(unionpay),微信支付(weixinpay),易宝支付(yeepay)
paymenttype = 'alipay'
#货币类型
currencytype = 'CNY'
#支付的货币金额
currencyamount = '45'
class allEvent:
# 激活
def installUpload(self,i,IP,appkey):
s = json.dumps({
"what":'install',
"appid":appkey,
"context":{
"_cmpaignid":'default',
"_deviceid":i,
"_imei":i,
"_androidid":i,
"_ip": IP,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op': op,
'_timestamp': current_time_13,
'_gaid': i
},
'when':time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
'ds':ds,
'who':'lxx_test'
})
p = requests.post(url=URL,data=s,headers=headers,timeout=10)
print("激活"+p.text)
# 启动
def startupEvent(self, i, IP, appkey):
s = json.dumps({
'what': 'startup',
'appid': appkey,
'context': {
'_deviceid': i,
'_imei': i,
'_androidid': i,
'_ip': IP,
'_timestamp': current_time_13,
'_gaid': i
},
'when': when,
'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL, data=s, headers=headers, timeout=10)
print("启动"+p.text)
#注册
def registerEvent(self,i,IP,appkey):
s = json.dumps({
'what':'register',
'appid':appkey,
'context':{
'_deviceid':i,
'_imei':i,
'_androidid':i,
'_ip':IP,
'_timestamp': current_time_13,
'_gaid': i
},
'when':time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
'ds':ds,
'who':'lxx_test'
})
p = requests.post(url=URL,data=s,headers=headers,timeout=10)
#print("注册时间戳"+current_time_13)
print("注册"+p.text)
#登陆
def loginEvent(self,i,IP,appkey):
s = json.dumps({
'what': 'loggedin',
'appid': appkey,
'context': {
'_deviceid': i,
'_imei': i,
'_androidid': i,
'_ip': IP,
'_ryos': ryos,
'_timestamp': current_time_13,
'_gaid': i
},
'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL, data=s, headers=headers, timeout=10)
print("登录"+p.text)
#付费
def payEvent(self,i,IP,appkey):
#订单号
transactionid = ''.join(str(random.choice(range(10))) for _ in range(19))
s = json.dumps({
'what': 'payment',
'appid': appkey,
'context': {
'_deviceid': i,
'_imei': i,
'_androidid': i,
'_ip': IP,
'_timestamp': current_time_13,
'_transactionid':transactionid,
'_paymenttype': paymenttype,
'_ryos': ryos,
'_currencytype': currencytype,
'_currencyamount': currencyamount,
'_gaid': i
},
'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL, data=s, headers=headers, timeout=5)
print("付费"+p.text)
# 订单
def payorder (self, i, IP, appkey):
# 订单号
transactionid = ''.join(str(random.choice(range(10))) for _ in range(19))
s = json.dumps({
'what': 'order',
'appid': appkey,
'context': {
'_deviceid': i,
'_imei': i,
'_androidid': i,
'_ip': IP,
'_timestamp': current_time_13,
'_transactionid': transactionid,
'_paymenttype': paymenttype,
'_currencytype': currencytype,
'_ryos': ryos,
'_currencyamount': currencyamount,
'_gaid': i
},
'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL, data=s, headers=headers, timeout=5)
print("订单"+p.text)
#自定义事件
def ziding_event(self,i,IP,appkey,event):
s = json.dumps({
'what': event,
'appid': appkey,
'context': {
'_deviceid': i,
'_imei': i,
'_androidid': i,
'_ip': IP,
'_ryos': ryos,
#识别是否为自定义事件,默认传1
'_isreyundefaultevent':'1',
'_gaid': i
},
'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL, data=s, headers=headers, timeout=5)
print("自定义"+p.text)
from hw_android_event.hw_android_script import allEvent
import struct
import socket
import random
#安卓常规渠道激活
appkey = '1a3a87d45fc8f11b48ba0e056d97a6dc'
for _ in range(1):
# 随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
#i = '059182787804'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
#ip = '64.41.203.197'
allEvent().installUpload(i,ip,appkey)
\ No newline at end of file
from hw_android_event.hw_android_script import allEvent
import socket
import struct
import random
#安卓常规渠道登陆
appkey = '396994fb037dff206dbcf1bbb747045e'
for _ in range(1):
# 随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
#i = '712257071375'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().loginEvent(i,ip,appkey)
\ No newline at end of file
from hw_android_event.hw_android_script import allEvent
import struct
import socket
import random
#安卓常规渠道付费
appkey = '9a64e5e67919ca6d5e56ccf0a3f323a6'
for _ in range(1):
# 随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
#i = '746559290881'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().payEvent(i, ip, appkey)
\ No newline at end of file
from hw_android_event.hw_android_script import allEvent
import struct
import socket
import random
import time
#安卓常规渠道注册
appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
for _ in range(5):
# 随机生成12为数组
#i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '984563234421111'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().registerEvent(i,ip,appkey)
time.sleep(2)
from hw_android_event.hw_android_script import allEvent
import struct
import socket
import random
#启动
appkey = '963727fdbc9f552761f3f30859230480'
for _ in range(1):
# 随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
#i = '633571473113'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().startupEvent(i,ip,appkey)
from hw_android_event.hw_android_script import allEvent
import socket
import struct
import random
#自定义事件
event = 'ry_wake'
appkey = '963727fdbc9f552761f3f30859230480'
for _ in range(1):
# 随机生成12为数组
#i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '990648693625'
# 随机生成ip
#ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
ip = '241.184.241.142'
allEvent().ziding_event(i,ip,appkey,event)
\ No newline at end of file
from hw_android_event.hw_android_script import allEvent
import struct
import socket
import random
appkey = '4e34db95fedf9ecd97978185a183b2ad'
for _ in range(10):
# 随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
#i = '155501486322'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().payEvent(i,ip,appkey)
\ No newline at end of file
from ios_event.ios_script import allEvent
import random
import requests
import socket
import struct
import time
import string
#向短链发送点击数据
#渠道短链
URL = 'http://10.2.20.42:8083/tkio/iEJrAra?noredirect=true'
appkey = '74b81be2432c029040e0b2bc375ce7fb'
# URL = 'http://172.31.19.255:8083/tkio/VNNjQra'
event = 'event_1'
# 广告创意ID
ry_adcreative_id = '8886453253'
# 广告组ID
ry_adgroup_id = '88887645342536'
# 广告计划ID
ry_adplan_id = '888543213423'
# 广告组名称
ry_adgroup_name = 'ry_adgroup_name'
# 广告计划名称
ry_adplan_name = 'ry_adplan_name'
# 广告创意名称
ry_adcreative_name = 'ry_adcreative_name'
s=0
w=0
for _ in range(1):
#随机生成12为数组
a = "".join(random.sample(string.ascii_letters+string.digits, 8))
b = "".join(random.sample(string.ascii_letters+string.digits, 4))
c = "".join(random.sample(string.ascii_letters+string.digits, 4))
d = "".join(random.sample(string.ascii_letters+string.digits, 4))
e = "".join(random.sample(string.ascii_letters+string.digits, 12))
i = (a+"-"+b+"-"+c+"-"+d+"-"+e).upper()
# i = '00000000-0000-0000-0000-000000000000'
# i = 'YEFVBQKJ-GZWT-LRVC-CX05-KNZRBB1P0WXQ'
adid = ''.join(str(random.choice(range(10))) for _ in range(12))
p1 = ''.join(str(random.choice(range(10))) for _ in range(12))
se = ''.join(str(random.choice(range(10))) for _ in range(12))
#随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '222.5.94.150'
# mac = '0f607264fc6318a92b9e13c65db7cd3c'
try:
parms = {
'idfa': i.upper(),
# 'muid':i,
# 'oaid':'00000000000000000000000000000000',
'ip': ip,
# 'ua': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 SP-engine/2.30.0 baiduboxapp/12.13.0.10 (Baidu; P2 13.6.1)',
# ios
# Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 SP-engine/2.30.0 baiduboxapp/12.13.0.10 (Baidu; P2 13.6.1)
# android
# Mozilla/5.0 (Linux; U; Android 7.0; zh-cn; Nexus 5X Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 Chrome/37.0.0.0 MQQBrowser/7.3 Mobile Safari/537.36
# 'ry_adgroup_name': ry_adgroup_name,
# 'ry_adplan_name': ry_adplan_name,
# 'ry_adcreative_name': ry_adcreative_name,
# "ry_adgroup_id": ry_adgroup_id,
# "ry_adplan_id": ry_adplan_id,
# "ry_adcreative_id": ry_adcreative_id,
#'mac': mac
}
#timeout可以超时四秒
p = requests.get(url=URL,params=parms,timeout=4, verify=False)
print('success:',s)
print('idfa:',i)
print('ip:',ip)
# print(p.content)
# print(p.url)
s=s+1
except Exception as err:
print(err)
print('wrong:',w)
print('idfa:', i)
print('ip', ip)
w=w+1
time.sleep(10)
try:
allEvent().installUpload(i, ip, appkey)
# allEvent().formevent(i, ip, appkey)
except Exception:
print('install_wrong:', w)
w = w + 1
# time.sleep(3)
# try:
# allEvent().adshow(i, ip, appkey,adid)
# # allEvent().formevent(i, ip, appkey)
# except Exception:
# print('adshow_wrong:', w)
# w = w + 1
# time.sleep(3)
# try:
# allEvent().adclick(i, ip, appkey, adid)
# # allEvent().formevent(i, ip, appkey)
# except Exception:
# print('adshow_wrong:', w)
# w = w + 1
# time.sleep(5)
# try:
# allEvent().appduration(i, ip, appkey,se)
# # allEvent().formevent(i, ip, appkey)
# print("session:"+se)
# except Exception:
# print('install_wrong:', w)
# w = w + 1
# time.sleep(5)
# try:
# allEvent().pageduration(i, ip, appkey, se, p1)
# # allEvent().formevent(i, ip, appkey)
# except Exception:
# print('pageduration_wrong:', w)
# w = w + 1
# time.sleep(3)
# try:
# allEvent().startupEvent(i, ip, appkey)
#
# except Exception:
# print('install_wrong:', w)
# w = w + 1
time.sleep(5)
try:
allEvent().registerEvent(i, ip, appkey)
except Exception as e:
print('注册_wrong:', w)
print(e)
time.sleep(4)
try:
allEvent().loginEvent(i, ip, appkey)
except Exception:
print('登录_wrong:', w)
# time.sleep(5)
# try:
# allEvent().ziding_event(i, ip, appkey, event)
# except Exception as err:
# print(err)
# print('自定义_wrong:', w)
#
# time.sleep(10)
# try:
# allEvent().payEvent(i, ip, appkey)
# except Exception as err:
# print(err)
# print('付费_wrong:', w)
# time.sleep(3)
# try:
# allEvent().payorder(i, ip, appkey)
# except Exception:
# print('订单_wrong:', w)
# print("结束时间" + datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
from ios_event.ios_script import allEvent
import struct
import socket
import random
import string
import time
#iOS常规渠道激活
appkey = '094673b49cbad98c811df7d7ba5b5d80'
event = 'event_1'
for _ in range(1):
# 随机生成12为数组
a = "".join(random.sample(string.ascii_letters + string.digits, 8))
b = "".join(random.sample(string.ascii_letters + string.digits, 4))
c = "".join(random.sample(string.ascii_letters + string.digits, 4))
d = "".join(random.sample(string.ascii_letters + string.digits, 4))
e = "".join(random.sample(string.ascii_letters + string.digits, 12))
i = (a + "-" + b + "-" + c + "-" + d + "-" + e).upper()
# i = 'UMY2TRHE-Y2OL-UDTI-4JV9-CX8BVT6LW3GF'
print(i)
adid = ''.join(str(random.choice(range(10))) for _ in range(12))
# 生成正常的idfa
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '191.156.121.201'
allEvent().installUpload(i,ip,appkey)
# allEvent().startupEvent(i, ip, appkey)
# time.sleep(10)
# allEvent().loginEvent(i, ip, appkey)
# allEvent().registerEvent(i, ip, appkey)
# allEvent().payEvent(i, ip, appkey)
# allEvent().payorder(i, ip, appkey)
# allEvent().ziding_event(i, ip, appkey, event)
# allEvent().adshow(i,ip,appkey,adid)
# allEvent().adclick(i,ip,appkey,adid)
# allEvent().pageduration(i,ip,appkey,se,p)
# allEvent().appduration(i,ip,appkey,s)
# allEvent().invoke_test(i,ip,appkey)
# allEvent().retentionEvent(i,ip,appkey)
from ios_event.ios_script import allEvent
import socket
import struct
import random
#ios常规渠道登陆
appkey = '0d401839250deff23daf62fd49a444cb'
for _ in range(1):
# 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '479829831633'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().loginEvent(i,ip,appkey)
\ No newline at end of file
from ios_event.ios_script import allEvent
import struct
import socket
import random
#ios常规渠道付费
appkey = '0d401839250deff23daf62fd49a444cb'
for _ in range(2):
# 随机生成12为数组
#i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '180366294778'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().payEvent(i,ip,appkey)
\ No newline at end of file
from ios_event.ios_script import allEvent
import struct
import socket
import random
#ios常规渠道注册
appkey = 'd53944d0a73f1d7cb2941f201b36db36'
for _ in range(5):
# 随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().registerEvent(i,ip,appkey)
\ No newline at end of file
#from ios_event.ios_script import allEvent
from ios_event.ios_script import allEvent
import struct
import socket
import random
#启动
appkey = '720a9d0628ececa45ccd7e3b307f170e'
for _ in range(5):
# 随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().startupevent(i,ip,appkey)
\ No newline at end of file
from ios_event.ios_script import allEvent
import socket
import struct
import random
#ios自定义事件
event = 'ry_wake'
appkey = '0d401839250deff23daf62fd49a444cb'
for _ in range(1):
# 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '694507434986'
# 随机生成ip
# ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
ip = '156.3.42.108'
allEvent().ziding_event(i,ip,appkey,event)
\ No newline at end of file
import os
from jpype import *
# 是否需要加密 True 加密 False 不需要
needEncryptor = False
def encryptorForAES(content,JDClass):
if needEncryptor:
signature = JDClass.getInstance().encrypt(str(content))
signature = str(signature)
else:
signature = content
return signature
def jiemiForAES(content):
current_path = os.path.dirname(__file__)
jvmPath = getDefaultJVMPath()
jars = [current_path + "/AESEncryptor.jar"]
jvm_cp = "-Djava.class.path={}".format(":".join(jars))
startJVM(jvmPath, jvm_cp)
JDClass = JClass("AESEncryptor")
signature = JDClass.getInstance().decrypt(content)
# shutdownJVM()
return signature
\ No newline at end of file
from jiami.pdj import jiemiForAES
from jpype import *
b= 'fNxZcPCEJXJkr+Jq+exUB1b6B7zFZuvnLhBrcUqNC/YYVn+lvq/XMQuVl/Cz6AEtHx4Di+luyh8qoxkoCVR2IZ7yKGv3pr1Fw2yk85wUZfSaMVh1qiBKDwpYx7IITA32MxY++37SHlczmyxQYRQbT8h3Llh7NuBa7+7j/EvBhAaWrE1D3BCr5czoSEDVQbZBZsxax2jzQW/S8hWl35Y/XmxFAOJLuWljS21LTUQFFXFWdQAMvMbOniAPVbxAefUN70V7op6y6F2cbnUdIMAIIFsNWF3yZTdHl39O8Gm38VKgHv4HREcDusNol3qxV1AMgGXPcLga5y8LYhRR+mvemSW44aAnG2keu7mgfPm3lNB6HvXk0EMvm406Xuu0yeqdlfjDVkMlf7fjnlfOTHTr40OeTfdKO/AvzmPZkP1Ygyq1y8QYu6wdzi5mnlzky7HIARb6c19mIgujCyJLJLnZgsmNcjPrbO+FVsa4XptzeaUKcQ9k4SbQf2X6/cxTcS2cBfOZ/jsiWTRhm8jFkJPuhWE+4HeTi7hYl7cS+gFZYa8/NLY/j89yrH9aiCCy0QIX4fn0g1FgUJ4FGoCZdFIURpJTFmB2ZH1k/TLIgw7NzWAWcGakd8GZzTc21A5jOCQm5ahXztrdLOtsZWJUv7fGcNyYN8zO+DCfV7SCrKXsBeTPjwymNUUKBpeIZ2BnDCb+gkPAwFLYi5LUjig2L7iijSNI13RVmoqs4a93yLMl5ekCHbfGspzdjvAACkBsAF/uiHaFbhBaVzqvtyNI8Syc5kurB42zUJVYK7DoW9E4aNnVkYHbExRxQ8+CCfcki4cCJlJ5eWPDE60XOW+MFAQ8fV1lxE8uK9hqJhKgX3SaK+T/3MVDyy7Z+xbutWWIqOWVyK+WaiLYTv6KhF4OcZKBY+IT7Wd+9bEKMr1egJHvbhqO9WXrwkng+aZO+ouZxOTC/UIo+4ml9RtZv8olBm0FfmUv7xRAmW/pdPJDQF+aH+jA34vxYcsz08F0dwcMYKYIP4jWVhkAVNqerDRpbIvAaktNCrmgTxc3nqvzp0CYT4P8JRAcaHWvm/nCcY42mQ6wwv9fyHH8g60ToJbYOF8VXyNZX0ypECcz7gd4cEXcgVY='
s = jiemiForAES(b)
print(s)
import random
import requests
import socket
import struct
import json
# test_url = "http://10.3.20.42:8083/tkioIdfa"
test_url = "http://idfa.trackingio.com/tkioIdfa"
s = json.dumps({
"idfa":"23212121",
"token":"5v7Ao9FF78dWW9Tx",
"appid":"1234557890"
})
p = requests.post(test_url,data=s)
print(p)
\ No newline at end of file
from kochava_test.install_ios import allEvent
import random
import socket
import struct
import time
appkey = 'kotest-s2s-android-noorganic-new-n5v3g'
lst = []
newList = ['194209209689', '612246691071', '808687133430', '478482107873', '217437594676', '295885889419', '525410985178', '963295644246', '202100808994', '206865837645']
# 遍历已有列表数据 发请求
for i in newList:
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().event_android(i,ip,appkey)
allEvent().install_android(i,ip,appkey)
# for _ in range(10):
# # 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
# # i= '005322103768'
# # 随机生成ip
# ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# # ip = '142.154.217.152'
# allEvent().install_android(i,ip,appkey)
# # time.sleep(2)
# # allEvent().event_android(i,ip,appkey)
# lst.append(i)
# print(lst)
# print(i)
# print(ip)
# print("-----------------------")
from kochava_test.install_ios import allEvent
import random
import requests
import socket
import struct
import time
import datetime
URL= 'http://imp.tkioglobal.com/track/impression?testparam=TestValue&campaign_id=koluka-android-1223-wb980otdf9ec5ab3cfeb&network_id=281&' \
'site_id=$BLINDED_SITE_ID'
# URL = 'https://control.kochava.com/v1/cpi/click?campaign_id=kotest-s2s-ios-20190826-3kv38krbd4c8fb106d428a&network_id=7820&' \
# 'site_id={subref}&creative_id={campaignid}&click_id={transactionid}'
s = 0
w = 0
for _ in range(1):
# print("开始时间"+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
#随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = '791075220624'
#随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '250.36.212.117'
try:
parms = {
'idfg': i,
'device_id': i,
'ip_address': ip
}
#timeout可以超时四秒
p = requests.get(url=URL,params=parms,timeout=30)
# time.sleep(10)
# allEvent().install_android(i,ip,appkey)
print('device_id:',i)
print("ip:",ip)
print('success:',s)
# print(p.text)
# print(p.status_code)
#print('androidid:',a)
s=s+1
except Exception as err:
print('wrong:', w)
print('imei:', i)
print("ip:",ip)
print(err)
# print(p.status_code)
#print('androidid', a)
w=w+1
import random
import requests
import socket
import struct
import time
import datetime
URL = 'https://imp.control.kochava.com/track/impression?testparam=TestValue&campaign_id=kolukatest1223-6x22b314c00b175e&' \
'network_id=280&event=view&ip_address=$USER_IP&device_ua=$UA&impression_id=$IMP_ID&creative_size=$AD_SLOT'
s = 0
w = 0
for _ in range(1):
# print("开始时间"+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
#随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = '1234567811'
#随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '192.168.2.86'
try:
parms = {
'idfg': i,
'device_id': i,
'ip_address': ip,
'impression_id': i
}
#timeout可以超时四秒
p = requests.get(url=URL,params=parms,timeout=30)
# time.sleep(10)
# allEvent().install_android(i,ip,appkey)
print('imei:',i)
print("ip:",ip)
print('success:',s)
print(p.text)
# print(p.status_code)
#print('androidid:',a)
s=s+1
except Exception as err:
print(err)
print('wrong:', w)
print('imei:', i)
print("ip:",ip)
# print(p.status_code)
#print('androidid', a)
w=w+1
\ No newline at end of file
from kochava_test.install_ios import allEvent
import random
import socket
import struct
import time
lst = []
newList = ['055697483229', '918086654565', '481174786484', '633879477909', '739298451969', '702051523468', '055230231898',
'204967762147', '208911146652', '427534910247','957899355828', '458078289526', '745829955616', '451411541631',
'231486194324', '242194917991', '783069062259', '671553562540', '369036624677', '154906620915']
appkey = 'kotest-s2s-ios-20190826-3kv38krbd'
# 遍历已有列表数据 发请求
# for i in newList:
# ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# allEvent().event_android(i,ip,appkey)
for _ in range(10):
# 随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = '589408861662'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '192.168.2.90'
allEvent().install_ios(i,ip,appkey)
time.sleep(2)
allEvent().event_ios(i,ip,appkey)
lst.append(i)
print(i)
print(ip)
print(lst)
print("-----------------------")
import requests
import json
import time
headers = {'Content-Type': 'application/json'}
URL = 'http://control.kochava.com/track/json'
URL1 = 'http://nmsl8.com/'
current_time_13 = int(round(time.time() * 1000))
class allEvent:
def install_ios(self,i,ip,appkey):
s = json.dumps({
"action": "install",
"kochava_app_id": appkey,
"kochava_device_id": i,
"data": {
"origination_ip": ip,
"device_ua": "Mozilla/5.0 (iPhone-iOS-9.3.4; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87",
"app_version": "3.3.0",
"device_ids": {
"idfa": i,
"idfv": i,
"imei": "",
"adid": "",
"android_id": ""
}
}
})
p = requests.post(url=URL,data=s,headers=headers)
print(p.text)
def event_ios(self,i,ip,appkey):
s = json.dumps({
"data": {
"usertime": current_time_13,
"app_version": "1.0.0",
"device_ver": "",
"device_ids": {
"idfa": i
},
"device_ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3",
"event_name": "lxxtest",
"origination_ip": ip,
"currency": "USD",
"event_data": {
"id": "123",
"name": "Skis",
"sum": 150
}
},
"action": "event",
"kochava_app_id": appkey
})
p = requests.post(url=URL,data=s,headers=headers)
print(p.text)
def install_android(self,i,ip,appkey):
s = json.dumps({
"action": "install",
"kochava_app_id": appkey,
"kochava_device_id": i,
"data": {
"origination_ip": ip,
"device_ua": "Mozilla/5.0 (iPhone-iOS-9.3.4; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87",
"app_version": "3.3.0",
"device_ids": {
"idfa": i,
"idfv": i,
"imei": i,
"adid": i,
"android_id": i
}
}
})
p = requests.post(url=URL,data=s,headers=headers)
print(p.text)
def event_android(self,i,ip,appkey):
s = json.dumps({
"data": {
"usertime": current_time_13,
"app_version": "1.0.0",
"device_ver": "",
"device_ids": {
"idfa": i
},
"device_ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3",
"event_name": "lxxtest",
"origination_ip": ip,
"currency": "USD",
"event_data": {
"id": "123",
"name": "Skis",
"sum": 150
}
},
"action": "event",
"kochava_app_id": appkey
})
p = requests.post(url=URL,data=s,headers=headers)
p1 = requests.post(url=URL1,data=s,headers=headers)
print(p.text)
# print("回调数据"+p1.text)
import requests
import json
import pytest
url = "http://tkiomicro-receive-788931749.cn-north-1.elb.amazonaws.com.cn/receive/tkiov2/sdk"
chaochang = '543214223221321321312131313133132131232131232132132543214223221321321312131313133132131232131232132132543214223221321321312131313133132131232131232132132'
headers = {
'Content-Type': 'application/json'
}
global data
data = [
{
"application_info": {
"appkey": "74b81be2432c029040e0b2bc375ce7fb",
"bundleid": "3423232",
"app_version": "1.9.0",
"channel_name": "default"
},
"timestamp_info": {
"time_zone": "GMT+08",
"install_time": "1637823377000",
"current_event_time": "1637823377000",
"report_time": "1637823377000"
},
"collector_info": {
"integration_type": "sdk",
"collector_version": "1.8.4",
"retried_times": ""
},
"device_info": {
"ryid": "8e4888e488a40a17aed2f6752f51382a4eafc",
"device_id":"c3381276ae145b3663c8e0f6dd9f628a",
"device_id_type": "idfa_md5",
"device_id_md5": "c3381276ae145b3663c8e0f6dd9f628a",
"device_id_md5_type": "idfa_md5",
"os": "ios",
"os_version": "19",
"manufacturer": "HUAWEI",
"model": "Mate 40",
"ipv4": "",
"ipv6": "1.1.1",
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36",
"att_status": "unknown",
"lat_status": "disable",
"idfa": "3DEA635F-B24F-434B-833F-4ED028FEAEEF",
"idfa_md5": "c3381276ae145b3663c8e0f6dd9f628a",
"idfv": "3DEA635F-B24F-434B-833F-4ED028FEAEEF",
"idfv_md5": "c3381276ae145b3663c8e0f6dd9f628a",
},
"event_info": {
"event_name": "install",
"event_type": "preset",
"event_data": {
"user_id": "guest123",
"register_type": "WeChat",
"login_type": "Wechat",
"order_id": "2341242342676398724",
"order_amount": "343432",
"currency_type": "CNY",
"purchase_type": "Alipay",
"ad_platform": "csj",
"placement_type": "interstitial",
"placement_id": "23425334",
"ad_price": "4.34",
"ad_price_currency_type": "CNY",
"is_rendered": "1"
},
"custom_params": {
# "add_cart": "234234",
# "sku": "234234",
# "level_up": "234234",
# "refund": "234234",
# "refund_amount": "234234"
}
}
}
]
data_temp = json.dumps(data)
def send_request():
global data
url = "http://tkiomicro-receive-788931749.cn-north-1.elb.amazonaws.com.cn/receive/tkiov2/sdk"
# print(data)
response = requests.request("POST", url, headers=headers, data=json.dumps(data))
print(response.text)
# 全局data
data = json.loads(data_temp)
response = json.loads(response.text)
s = str(response["status"])
response["status"] = s
return response
# os为ios,channel_name不等于default
def test_os_ios():
data[0]["device_info"]["os"] = 'ios'
data[0]['application_info']['channel_name'] = 'xiaomi'
response = send_request()
assert response["status"] == "104"
# os为大写iOS
def test_os_ios():
data[0]["device_info"]["os"] = 'iOS'
response = send_request()
assert response["status"] == "115"
# ATT框架启用状态,为固定值
def test_att_status1():
lis = ['denied', 'restricted', 'authorized', 'unknown']
for astatus in lis:
data[0]['device_info']['att_status'] = astatus
response = send_request()
assert response["status"] == "0"
# ATT框架启用状态,为其他值
def test_att_status2():
data[0]['device_info']['att_status'] = "aaa"
response = send_request()
assert response["status"] == "122"
# ATT框架启用状态,为空
def test_att_status3():
data[0]['device_info']['att_status'] = ""
response = send_request()
assert response["status"] == "0"
# LAT启用状态,固定值
def test_lat_status1():
lis = ['enable', 'disable', 'unknown']
for astatus in lis:
data[0]['device_info']['lat_status'] = astatus
response = send_request()
assert response["status"] == "0"
# LAT启用状态,其他值
def test_lat_status2():
data[0]['device_info']['lat_status'] = "aaa"
response = send_request()
assert response["status"] == "123"
# LAT启用状态,空
def test_lat_status3():
data[0]['device_info']['lat_status'] = ""
response = send_request()
assert response["status"] == "0"
# idfa为空,idfa_md5不为空
def test_idfa1():
data[0]['device_info']['idfa'] = ''
response = send_request()
assert response["status"] == "0"
# idfa超长
def test_idfa2():
data[0]['device_info']['idfa'] = chaochang
response = send_request()
assert response["status"] == "124"
# idfa为空,idfa_md5也为空
def test_idfa3():
data[0]['device_info']['idfa'] = ''
data[0]['device_info']['idfa_md5'] = ''
response = send_request()
assert response["status"] == "124"
# idfa不为空,idfa_md5为空
def test_idfa_md51():
data[0]['device_info']['idfa_md5'] = ''
response = send_request()
assert response["status"] == "0"
# idfa_md5超长
def test_idfa_md52():
data[0]['device_info']['idfa_md5'] = chaochang
response = send_request()
assert response["status"] == "124"
# device_id与device_id_type不一致
def test_device_id():
data[0]['device_info']['device_id_type'] = "idfa"
data[0]['device_info']['device_id'] = "c3381276ae145b3663c8e0f6dd9f628a"
data[0]['device_info']['idfa_md5'] = "c3381276ae145b3663c8e0f6dd9f628a"
response = send_request()
assert response["status"] == "0"
# idfv为空,idfv_md5不为空
def test_idfv1():
data[0]['device_info']['idfv'] = ''
response = send_request()
assert response["status"] == "0"
# idfv超长
def test_idfv2():
data[0]['device_info']['idfv'] = chaochang
response = send_request()
assert response["status"] == "125"
# idfv为空,idfv_md5也为空
def test_idfv3():
data[0]['device_info']['idfv'] = ''
data[0]['device_info']['idfv_md5'] = ''
response = send_request()
assert response["status"] == "125"
# idfv不为空,idfv_md5为空
def test_idfv_md51():
data[0]['device_info']['idfv_md5'] = ''
response = send_request()
assert response["status"] == "0"
# idfv_md5超长
def test_idfv_md52():
data[0]['device_info']['idfv_md5'] = chaochang
response = send_request()
assert response["status"] == "125"
def test_for():
sz = ["1"]
for _ in range(5):
sz.append("2")
if __name__ == '__main__':
pytest.main()
import requests
import json
url1 = 'http://tmtest.trackingio.com/receive/turl/3r5K1h9'
parms = {
# 触点传参时间。is_s2s=1时必传,0时选传。不同渠道有可能传多种格式,详见需求。限制32位字符内。短链传参。
'ts': '2122132121',
# 集成方式。is_s2s=1为服务器上报触点,0为客户端上报触点。0或1时有不同的参数非空校验,详见需求。固定为0或1。都必传
'is_s2s': '1',
# 操作系统。限制16字符内。都选传。短链传参。暂不与app_platform互相做校验。
'os': 'ios',
# 设备型号。限制64字符内。都选传。短链传参。
'model': '小米',
# 用户公网IP v4版本。限制15字符内。is_s2s=1时都必传,0时都选传,0时优先取传参IP,未传参或传参报错时,取http header中的ip作为ipv4的值
'ipv4': '1.1.1.1',
# 用户公网IP v6版本。限制128字符内。都选传
'ipv6': '1.1.1.1',
# 用户代理信息。限制512字符内。is_s2s=1时都必传,0时都选传,0时优先取传参UA,未传参或报错时,取http header中的user agent作为ua的值
'ua': 'Mozilla/5.0 (Linux; U; Android 7.0; zh-cn; Nexus 5X Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 Chrome/37.0.0.0 MQQBrowser/7.3 Mobile Safari/537.36',
# Android OAID原值。限制512字符内。Android选传,app_platform=ios时报错
'oaid': '3DEA635F-B24F-434B-833F-4ED028FEAEEF',
# Android OAID原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错
'oaid_md5': '8e488a40a17aed2f6752f51382a4eafc',
# Android主卡IMEI原值。限制32字符内。Android选传,app_platform=ios时报错
'imei1': '8342732742383',
# Android主卡IMEI原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错
'imei1_md5': '8e488a40a17aed2f6752f51382a4eafc',
# Android副卡IMEI原值。限制32字符内。Android选传,app_platform=ios时报错
'imei2': '8342732742383',
# Android副卡IMEI原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错
'imei2_md5': '8e488a40a17aed2f6752f51382a4eafc',
# Google Advertising ID原值。固定36字符。Android选传,app_platform=ios时报错
'gaid': 'B21C5EC5-9921-42FD-AAC5-07A0EB6CF1A0',
# Google Advertising ID原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错
'gaid_md5': '8e488a40a17aed2f6752f51382a4eafc',
# //MAC原值。固定17字符。Android选传,app_platform=ios时报错
'mac': '',
# MAC原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错
'mac_md5': '',
# Android ID原值。固定16字符。Android选传,app_platform=ios时报错
'android_id': '',
# Android ID原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错
'android_id_md5': '',
# 监测短链id。固定7位。
# 'turl_id': '3r5K1h9',
# 全部url参数。
# 'tkul_string': 'xxx',
# 触点类型。固定为click。都必传
'touchpoint_type': 'click',
# 归因类型。固定为ua(user acquirement新客获取)
'attribution_type': 'ua',
# 广告账户id。限制64字符内。都选传
# 'account_id': '',
# # 广告组id。限制64字符内。都选传
# 'adgroup_id': '',
# # 广告组名称。限制256字符内。都选传
# 'adgroup_name': '',
# # 广告计划id。限制64字符内。都选传
# 'adplan_id': '',
# # 广告计划名称。限制256字符内。都选传
# 'adplan_name': '',
# # 广告创意id。限制128字符内。都选传
# 'adcreative_id': '',
# # 广告创意名称。限制256字符内。都选传
# 'adcreative_name': '',
# # 创意类型(例如大图、小图、视频等)。限制16字符内。都选传
# 'adcreative_type': '',
# # 流量媒体id(例如巨量的今日头条、穿山甲、抖音等)。限制32字符内。都选传
# 'site_id': '',
# # 流量媒体名称(例如巨量的今日头条、穿山甲、抖音等)。限制128字符内。都选传
# 'site_name': '',
# # 广告类型(例如开屏、信息流、搜索等)。限制32字符内。都选传。
# 'ad_type': '',
# # 广告位id。限制64字符内。都选传
# 'placement_id': '',
# # 转化id。限制64字符内。都选传
# 'conversion_id': '',
# # 广告点击id。限制64字符内。都选传
# 'click_id': '',
# # 广告展示id。限制64字符内。都选传
# 'impression_id': '',
# # 广告请求id。限制64字符内。都选传
# 'request_id': '',
# # 渠道回调id。限制256字符。都选传
# 'callback_id': 'EJiw267wvfQCGKf2g74ZIPD89-vIATAMOAFCIjIwMTkxMTI3MTQxMTEzMDEwMDI2MDc3MjE1MTUwNTczNTBIAQ==',
# # 渠道回调地址。限制256字符。都选传
# 'callback_url': 'http%3A%2F%2Ftracking.e.qq.com%2Fconv%3Fcb%3DMTIzYWJjNDU2ZGVm%26conv_id%3D12345678',
# 自定触点参数集合。都选传。
# 'custom_params_1': ''
}
# p = requests.get(url=url1, params=parms, timeout=10, verify=False)
# print(p.url)
# print(p.status_code)
# print(p.content)
def send_request(dl, cs):
url1 = 'http://tmtest.trackingio.com/receive/turl/'+dl + cs
response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.url)
response = json.loads(response.text)
return response
def test_aaa():
# parms['is_s2s'] = '0'
re = send_request('3r5K1h9', '')
assert re["status"] == 0
from online_android_event.android_script import allEvent
import random
import requests
import socket
import struct
import time
#向短链发送点击数据
#线上环境
# URL = 'http://uri6.com/tkio/eI7fyya?kwid=关键词&creative=创意2'
# URL = 'http://uri6.com/tkio/yIJVjia?kwid=关键词3&creative=创意'
URL = 'http://uri6.com/tkio/qmAN7ja'
# ?impression=true
# &noredirect=true
appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
event = 'event_2'
# 广告创意ID
ry_adcreative_id = '1655250814523437'
# 广告组ID
ry_adgroup_id = '1653408012613659'
# 广告计划ID
ry_adplan_id = '1655246785946685'
# 广告组名称
ry_adgroup_name = '头条广告组1'
# 广告计划名称
ry_adplan_name = '头条广告计划1'
# 广告创意名称
ry_adcreative_name = '头条广告名称1'
s=0
w=0
for _ in range(1):
#随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = '085071184873'
# ip6 = socket.i net_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# a = ''.join(str(random.choice(range(10))) for _ in range(12))
# o = ''.join(str(random.choice(range(10))) for _ in range(12))
# mac = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = '321232113212'
#随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '172.31.21.207'
# mac = 'e3f5536a141811db40efd6400f1d0a4e'
try:
parms = {
'imei': i,
# "idfa": '3F88CD9A-D90B-4448-BFF8-18B9A223B204',
'ip': ip,
# 'aid': '54676',
# 'siteid': '68793',
# 'csite': '4355743'
# 'deviceid': '0000000000'
# 'muid': '5F126EA0AD05CFE52675C3518B240540D5C10733'
# 'ipv6':ip6
# 'androidid':"fverr43tfv34erdcd23e",
# 'oaid': "754b3e3e-a274-ed22-cebf-2b6dddfc28b9",
# 'mac': mac
# 'subchannel': "111",
# "ry_adcreative_id": ry_adcreative_id,
# "ry_adgroup_id": ry_adgroup_id,
# "ry_adplan_id": ry_adplan_id,
# 'ry_adgroup_name': ry_adgroup_name,
# 'ry_adplan_name': ry_adplan_name,
# 'ry_adcreative_name':ry_adcreative_name,
# 'adId':'',
# "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3",
}
#timeout可以超时四秒
p = requests.get(url=URL, params=parms, timeout=4, verify=False)
print('success:', s)
print('imei:', i)
print('ip:', ip)
# print(p.text)
# print("androidid",a)
# print("oaid",o)
# print("mac",mac)
# print("ip6:"+ip6)
s=s+1
except requests.exceptions.RequestException:
print('wrong:',w)
print('imei:', i)
print('ip', ip)
w = w+1
# continue
time.sleep(10)
try:
allEvent().installUpload(i, ip, appkey)
# allEvent().formevent(i, ip, appkey)
#
except Exception:
print('install_wrong:', w)
w = w + 1
time.sleep(1)
try:
allEvent().registerEvent(i, ip, appkey)
except Exception as e:
print('注册_wrong:', w)
print(e)
time.sleep(4)
try:
allEvent().loginEvent(i, ip, appkey)
except Exception:
print('登录_wrong:', w)
time.sleep(3)
try:
allEvent().ziding_event(i, ip, appkey, event)
except Exception as err:
print(err)
print('自定义_wrong:', w)
time.sleep(3)
try:
allEvent().payEvent(i, ip, appkey)
except Exception as err:
print(err)
print('付费_wrong:', w)
time.sleep(3)
try:
allEvent().orderEvent(i, ip, appkey)
except Exception:
print('订单_wrong:', w)
from online_android_event.android_script import allEvent
import struct
import socket
import random
#安卓常规渠道激活
appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
event = 'event_12'
for _ in range(1):
# 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '367203484211'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '111.162.131.171'
allEvent().installUpload(i,ip,appkey)
# allEvent().loginEvent(i, ip, appkey)
# allEvent().registerEvent(i,ip,appkey)
# allEvent().payEvent(i,ip,appkey)
# allEvent().ziding_event(i,ip,appkey,event)
# # allEvent().batchUpload(i,appkey)
# allEvent().adclick(i,ip,appkey)
# allEvent().adshow(i,ip,appkey)
# allEvent().formevent(i,ip,appkey)
print(i)
\ No newline at end of file
from online_android_event.android_script import allEvent
import socket
import struct
import random
#安卓常规渠道登陆
appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
event = 'event_12'
for _ in range(1):
# 随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i= '534630756168'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().loginEvent(i,ip,appkey)
# allEvent().registerEvent(i,ip,appkey)
# allEvent().payEvent(i,ip,appkey)
# allEvent().ziding_event(i,ip,appkey,event)
# allEvent().batchUpload(i,appkey)
print(i)
\ No newline at end of file
from online_android_event.android_script import allEvent
import struct
import socket
import random
#安卓常规渠道付费
appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
for _ in range(1):
# 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '429607629374'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().payEvent(i,ip,appkey)
# print(i)
# allEvent().order Event(i,ip,appkey)
\ No newline at end of file
from online_android_event.android_script import allEvent
import struct
import socket
import random
import time
#安卓常规渠道注册
appkey = '58d8874f80d656000bae5cb53e8e19e8'
for _ in range(4):
# 随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = '8797767656757'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '212.75.166.186'
allEvent().registerEvent(i,ip,appkey)
print(i)
from online_android_event.android_script import allEvent
import struct
import socket
import random
#启动
appkey = '947d4cd56ce0b61c7c49a2dcbaa2234a'
for _ in range(1):
# 随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = '940080231104'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().startupEvent(i,ip,appkey)
\ No newline at end of file
from online_android_event.android_script import allEvent
import socket
import struct
import random
#自定义事件
event = 'invoke'
appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
for _ in range(1):
# 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
# print(i)
i = '775388367502'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '138.183.9.198'
allEvent().ziding_event(i,ip,appkey,event)
\ No newline at end of file
from online_fenbao_android_event.android_script import allEvent
import random
import requests
import socket
import struct
import time
#向短链发送点击数据
URL = 'http://uri6.com/tkio/2iYvUna?ry_dp=true&rydp_path=null&rydp_url=http%3A%2F%2F43232'
appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
cmpaignid = '11111'
event = 'invoke'
s = 0
w = 0
# 广告创意ID
ry_adcreative_id = 'kuaishou'
# 广告组ID
ry_adgroup_id = 'kuaishou'
# 广告计划ID
ry_adplan_id = 'kuaishou'
# 广告组名称
ry_adgroup_name = '广告组'
# 广告计划名称
ry_adplan_name = '广告计划'
# 广告创意名称
ry_adcreative_name = '广告创意'
for _ in range(1):
#随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
#随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
try:
parms = {
'imei':i,
'ip':ip,
# 'ry_adgroup_name': ry_adgroup_name,
# 'ry_adplan_name': ry_adplan_name,
# 'ry_adcreative_name':ry_adcreative_name,
# "ry_adgroup_id": ry_adgroup_id,
# "ry_adplan_id": ry_adplan_id,
# "ry_adcreative_id": ry_adcreative_id,
# 'oaid':i
}
#timeout可以超时四秒
p = requests.get(url=URL,params=parms,timeout=4)
# time.sleep(10)
# allEvent().installUpload(i, ip, appkey,cmpaignid)
# time.sleep(3)
# allEvent().registerEvent(i, ip, appkey)
# time.sleep(3)
# allEvent().loginEvent(i,ip,appkey)
# time.sleep(3)
# allEvent().ziding_event(i,ip,appkey,event)
# time.sleep(3)
# allEvent().payEvent(i,ip,appkey)
print('success:',s)
print('imei:',i)
#print('ip:',ip)
s=s+1
except requests.exceptions.RequestException:
print('wrong:',w)
print('imei:', i)
print('ip', ip)
w=w+1
continue
import requests
import json
import time
import random
headers = {'Content-Type': 'application/json'}
URL = 'http://log.trackingio.com/receive/tkio/'
#时间戳
current_time_13 = int(round(time.time() * 1000))
#时间和日期
when = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
#日期
ds = time.strftime('%Y-%m-%d', time.localtime(time.time()))
#设备品牌
manufacturer = 'vivo'
#设备系统
ryos = 'android'
#设备类型
rydevicetype = 'vivox9'
#网络类型
network='wifi'
#分辨率
resolution='1344*750'
#运行商
op='中国移动'
# 支付类型 支付宝(alipay),银联(unionpay),微信支付(weixinpay),易宝支付(yeepay)
paymenttype = 'alipay'
#货币类型
currencytype = 'CNY'
#支付的货币金额
currencyamount = '45'
class allEvent:
# 激活
def installUpload(self,i,IP,appkey,cmpaignid):
s = json.dumps({
"what":'install',
"appid":appkey,
"context":{
'_category': 'APPMARKET',
'_campaignid':cmpaignid,
#"_cmpaignid":cmpaignid,
"_deviceid":i,
"_imei":i,
"_androidid":i,
"_ip":IP,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op':op,
'_timestamp':current_time_13
},
# time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
'when':time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
'ds':ds,
'who':'lxx_test'
})
p = requests.post(url=URL+"install",data=s,headers=headers,timeout=5)
print(p.text)
#注册
def registerEvent(self,i,IP,appkey):
s = json.dumps({
'what':'register',
'appid':appkey,
'context':{
'_deviceid':i,
'_imei':i,
'_androidid':i,
'_ip':IP,
'_timestamp': current_time_13
},
'when':when,
'ds':ds,
'who':'lxx_test'
})
p = requests.post(url=URL+'register',data=s,headers=headers,timeout=5)
print(p.text)
#登陆
def loginEvent(self,i,IP,appkey):
s = json.dumps({
'what': 'loggedin',
'appid': appkey,
'context': {
'_deviceid': i,
'_imei': i,
'_androidid': i,
'_ip': IP,
'_timestamp': current_time_13
},
'when': when,
'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL+'loggedin', data=s, headers=headers, timeout=5)
print(p.text)
#付费
def payEvent(self,i,IP,appkey):
#订单号
transactionid = ''.join(str(random.choice(range(10))) for _ in range(19))
s = json.dumps({
'what': 'payment',
'appid': appkey,
'context': {
'_deviceid': i,
'_imei': i,
'_androidid': i,
'_ip': IP,
'_timestamp': current_time_13,
'_transactionid':transactionid,
'_paymenttype': paymenttype,
'_currencytype': currencytype,
'_currencyamount': currencyamount,
},
'when': when,
'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL+'payment', data=s, headers=headers, timeout=5)
print(p.text)
# 订单
def payEvent(self, i, IP, appkey):
# 订单号
transactionid = ''.join(str(random.choice(range(10))) for _ in range(19))
s = json.dumps({
'what': 'order',
'appid': appkey,
'context': {
'_deviceid': i,
'_imei': i,
'_androidid': i,
'_ip': IP,
'_timestamp': current_time_13,
'_transactionid': transactionid,
'_paymenttype': paymenttype,
'_currencytype': currencytype,
'_currencyamount': currencyamount,
},
'when': when,
'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL, data=s, headers=headers, timeout=5)
print(p.text)
#自定义事件
def ziding_event(self,i,IP,appkey,event):
s = json.dumps({
'what': event,
'appid': appkey,
'context': {
'_deviceid': i,
'_imei': i,
'_androidid': i,
'_ip': IP,
#识别是否为自定义事件,默认传1
'_isreyundefaultevent':'1'
},
'when': when,
'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL+'event', data=s, headers=headers, timeout=5)
print("自定义"+p.text)
from online_fenbao_android_event.android_script import allEvent
import struct
import socket
import random
#安卓分包激活
appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
campaignid = '54324563'
for _ in range(1):
# 随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = '367203484211'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '9.217.252.248'
allEvent().installUpload(i,ip,appkey,campaignid)
print(i)
\ No newline at end of file
from online_fenbao_android_event.android_script import allEvent
import socket
import struct
import random
#安卓分包登陆
appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
for _ in range(1):
# 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '441497737454'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().loginEvent(i,ip,appkey)
\ No newline at end of file
from online_fenbao_android_event.android_script import allEvent
import struct
import socket
import random
#安卓分包付费
appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
for _ in range(1):
# 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
i= '937790340879'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().payEvent(i,ip,appkey)
\ No newline at end of file
from online_fenbao_android_event.android_script import allEvent
import struct
import socket
import random
#安卓分包注册
appkey = '131e83c713592bc47184c18afc1c5061'
for _ in range(1):
# 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
i= '7654324565432'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().registerEvent(i,ip,appkey)
\ No newline at end of file
from online_fenbao_android_event.android_script import allEvent
import socket
import struct
import random
#自定义事件
event = 'event_12'
appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
for _ in range(5):
# 随机生成12为数组
#i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '101809952589'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().ziding_event(i,ip,appkey,event)
\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment