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)
import requests
import json
import time
import random
import threading
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/'
URLbatch = 'http://119.3.252.134/receive/'
#时间戳
current_time_13 = int(round(time.time() * 1000))
#时间和日期
when = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
# when = '2019-11-10 10:45:33'
#日期
ds = time.strftime('%Y-%m-%d', time.localtime(time.time()))
# ds = '2019-11-10'
#设备品牌
manufacturer = '苹果'
#设备系统
ryos = 'ios'
#设备类型
rydevicetype = 'iphone'
#网络类型
network = 'wifi'
#分辨率
resolution = '111*670'
#运行商
op = '中国移动'
channelid = '111'
#版本
app_version = '11.05.01'
model = 'iPhone 4'
event = 'event_1212'
page = 'page_1212'
session = '312211'
class allEvent:
# 激活
def installUpload(self, i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"ds": ds,
"what": "install",
# "when": when,
"where": "install",
"who": i,
"context": {
"_frequency": "0.000",
"_manufacturer": manufacturer,
# "_city": "北京",
"_lats": "1",
"_network_type": network,
# "_country": "中国",
"_timestamp": current_time_13,
"_device_gps": "unknown",
"_modify": "0",
"_ipv6": "fe80::810:c0fd:6a98:e3e2",
"_tz": "+8",
"_ry_ts": "1572406560870",
"_pkgname": "com.reyun.sdktrackingtest",
"_audio_volume": "0.562",
"_app_version": app_version,
"_jbk": "0",
# "_ry_origin_when": "2019-10-30 11:36:00",
"_model": model,
"_idfv": "0B7B677B-47C6-4615-B938-983EB8C09B28",
"_ip": IP,
"_lib": "iOS",
"_mac": "02:00:00:00:00:00",
"_ryos": ryos,
"_create_timestamp": current_time_13,
"_idfa": i,
"_ryosversion": "13.2",
"_resolution": resolution,
# "_region": "北京",
"_lib_version": "a1.0.0",
"_deviceid": i,
"_rydevicetype": "iPhone",
"_carrier": op,
"_screen_brightness": "0.698",
"_channelid": channelid
},
})
s = encryptorForAES(s,JDClass)
# print(s)
# print(URL+'install')
p = requests.post(url=URL+'install', data=s, headers=headers, timeout=10)
print("激活:"+p.text)
# print(ds)
# 启动
def startupUpload(self, i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"context": {
"_frequency": "0.000",
"_manufacturer": manufacturer,
# "_city": "北京",
"_lats": "1",
"_network_type": network,
# "_country": "中国",
"_timestamp": "1572406560809.306",
"_device_gps": "unknown",
"_modify": "0",
"_ipv6": "fe80::810:c0fd:6a98:e3e2",
"_tz": "+8",
"_ry_ts": "1572406560870",
"_pkgname": "com.reyun.sdktrackingtest",
"_audio_volume": "0.562",
"_app_version": app_version,
"_jbk": "0",
# "_ry_origin_when": "2019-10-30 11:36:00",
"_model": model,
"_idfv": "0B7B677B-47C6-4615-B938-983EB8C09B28",
"_ip": IP,
"_lib": "iOS",
"_mac": "02:00:00:00:00:00",
"_ryos": ryos,
# "_create_timestamp": "1572406560809.306",
"_idfa": i,
"_ryosversion": "13.2",
"_resolution": resolution,
# "_region": "北京",
"_lib_version": "a1.0.0",
"_deviceid": i,
"_rydevicetype": "iPhone",
"_carrier": op,
"_screen_brightness": "0.698",
"_channelid": channelid
},
"ds": ds,
"what": "startup",
"when": when,
"where": "startup",
"who": i
})
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,
"ds": ds,
"what": event,
"when": when,
"where": "event",
"who": i,
"context": {
"_ry_origin_when": when,
"_idfv": "0B7B677B-47C6-4615-B938-983EB8C09B28",
# "_city": "unknown",
"_ip": IP,
"_lib": "iOS",
"_session": "6",
"_interface_type": interface_type,
"_country": "unknown",
"_timestamp": current_time_13,
"_create_timestamp": time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
"_idfa": i,
# "_region": "unknown",
"_lib_version": "a1.0.0",
"_deviceid": i,
"_model": model,
"_tz": "+8",
"_channelid": channelid,
"_ry_ts": "1572335394441",
"_app_version": app_version,
"_batch_type": "eventbatch"
},
})
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,
"when": when,
"where": "page",
"who": i,
"context": {
"_idfv": i,
# "_city": "unknown",
"_ip":IP,
"_lib": "iOS",
# "_batch_type": "pagebatch",
"_session": session,
"_interface_type": interface_type,
"_country": "unknown",
"_timestamp": current_time_13,
"_create_timestamp": time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
"_idfa": i,
# "_region": "unknown",
"_lib_version": "a1.0.0",
"_deviceid": i,
"_model": model,
"_tz": "+8",
"_channelid": channelid,
"_ry_ts": "1572342341972",
"_app_version": app_version
},
})
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",
"when": when,
"who": i,
"context": {
"_ry_origin_when": when,
"_triger": "terminate",
"_idfv": i,
# "_city": "unknown",
"_ip": IP,
"_exit_page": page,
"_lib": "iOS",
"_model": model,
"_session": session,
"_country": "unknown",
"_timestamp": current_time_13,
"_create_timestamp": time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
"_idfa": i,
# "_region": "unknown",
"_lib_version": "a1.0.0",
"_deviceid": i,
"_tz": "+8",
"_channelid": channelid,
"_ry_ts": "1572343547238",
"_app_version": app_version
},
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL + 'exit', data=s, headers=headers, timeout=10)
print("退出:" + p.text)
# print(p.url)
# 批量上传数据接口
def batchUpload(self, i, IP, appkey,JDClass):
s = json.dumps(
{
"from": "analysis",
"data": [
{
"appid": appkey,
"when": when,
"what": "page1",
"who": "unknown",
"context": {
"_manufacturer": "苹果",
"_carrier": op,
"_lats": "1",
"_jbk": "1",
"_app_version": app_version,
"_timestamp": current_time_13,
"_create_timestamp": current_time_13,
"_rydevicetype": "iPhone",
"_deviceid": i,
"_tz": "+8",
"_resolution": resolution,
"_pkgname": "com.reyun.testapp",
"_mac": "80:E6:50:12:4C:DE",
"_network_type": network,
"_istf": "8",
"_idfv": "27CCEE6E-5ED1-47EC-B486-81F9129C05D3",
"_ryosversion": "11.2",
"_model": model,
"_lib_version": "2.0.0",
"_ryos": ryos,
"_idfa": i,
"_batch_type":"pagebatch"
},
},
{
"appid": appkey,
"when": when,
"what": "dsadxas",
"who": "unknown",
"context": {
"_manufacturer": "苹果",
"_carrier": op,
"_lats": "1",
"_jbk": "1",
"_app_version": app_version,
"_timestamp": current_time_13,
"_create_timestamp": current_time_13,
"_rydevicetype": "iPhone",
"_deviceid": i,
"_tz": "+8",
"_resolution": resolution,
"_pkgname": "com.reyun.testapp",
"_mac": "80:E6:50:12:4C:DE",
"_network_type": network,
"_istf": "8",
"_idfv": "27CCEE6E-5ED1-47EC-B486-81F9129C05D3",
"_ryosversion": "11.2",
"_model": model,
"_lib_version": "2.0.0",
"_ryos": ryos,
"_idfa": i,
"_batch_type": "pagebatch"
},
}
]
}
)
s = encryptorForAES(s, JDClass)
p = requests.post(url=URLbatch + 'batch', 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'))
import requests
import json
import time
import random
headers = {'Content-Type': 'application/json'}
# X-RY-Access-Token': 'b8f6d4c7b8a848e697291dccf9027120
#测试环境
# URL_batch = 'http://10.3.20.42:8080/receive/batch'
# URL = 'http://10.2.20.42:8080/receive/tkio/'
URL = 'http://log.trackingio.com/receive/tkio/'
# URL = 'http://172.31.21.207:8080/receive/tkio/'
# URL = 'http://120.53.212.71/receive/tkio/'
# 腾迅云tkio http协议的生产地址:
# URL = 'http://tlog.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 = 'ios'
#设备类型
rydevicetype = 'vivox9'
#网络类型
network ='wifi'
#分辨率
resolution ='1344*750'
#运行商
op='中国移动'
# 支付类型 支付宝(alipay),银联(unionpay),微信支付(weixinpay),易宝支付(yeepay)
paymenttype = 'alipay'
#货币类型
currencytype = 'CNY'
#支付的货币金额
currencyamount = '90'
# # 填充广告在变现平台的广告位ID
# adid = '839296815'
# 填充广告的变现平台,例如穿山甲(csj)、优量汇(ylh)、百青藤(bqt)、Sigmob(sigmob)、快手(ks)、Mintegral(mintegral)、OneWay(oneway)、Vungle(vungle)等
adPlatform = 'ylh'
# 页面展示时调用 pageID代表页面唯一标识
# 会话时长,单位秒
appduration = '600'
# 时长,单位:秒
pageduration = '200'
istablet = 'phone'
lib = 'ios'
when1 = '2020-06-06 16:44:31'
# 设备型号
model = '测试1'
# 操作系统版本
ryosversion = '13.6.1'
# 网络环境
network_type = '5g'
# 运营商
carrier = '中国联通'
lv = '1.8.5'
class allEvent:
# 激活
def installUpload(self, i, IP, appkey):
s = json.dumps({
# "what":'install',
"appid": appkey,
"context": {
"_carrier": carrier,
"_networkwhat_type": network_type,
"_ryosversion": ryosversion,
"_model": model,
"_pkgname": "com.yanjing.yami",
"_campaignid": 'default',
"_deviceid": i,
"_imei": i,
'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',
# "idfa": i,
# "_current_caid": "00_A0FF634AEDF1403205A4A6A1118CDA61_A66338F33BEBB40F5CD65F198AF2F40C",
# "gxid": "876543567543565",
# "_idfv": i,
"_androidid": '1987654567898765',
# "_imei2":"324323AAAA",
# "_meid": "CCC324323",
"_ip": IP,
# "_ipv6": i,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op': op,
'_timestamp': current_time_13,
# '_oaid': '9f80c84a559f573636a47ff8daed0d32',
'_mac': "5432453241421",
"_istablet": istablet,
"_lib" : lib,
"_lib_version": lv,
# 'sysfsize': '111',
# '_model': '1',
# 'sysram': '1',
# '_ryosversion': '1',
# 'sysutime': '1',
# 'sysuname': '1',
# '_carrier': '1',
# 'syscountryc': '1',
# 'sysrtime': '1',
# 转化类型,新增或重装,Download 或 Redownload
# "iad-conversion-type": "Redownload",
# # 关键词 id
# "iad-keyword-id": "12323222",
# # 点击ASA广告时间
# "iad-click-date": when,
# # 素材ID
# "iad-creativeset-id": "1234567890",
# # 广告组名称
# "iad-adgroup-name": "AdGroupName",
# # 广告活动ID
# "iad-campaign-id": "1234567890",
# # 本次下载完成的时间(仅ASA转化时,该值传且必传)
# "iad-conversion-date": "2021-06-24T11:22:23Z",
# # 关键词匹配类型
# "iad-keyword-matchtype": "Broad",
# #首次下载完成的时间(有可能包括非ASA转化,当为redownload且conversion date有值时,purchase date是第一次下载App的时间)
# "iad-purchase-date": "2021-06-24T11:22:23Z",
# # 归因结果
# "iad-attribution": "true",
# # 广告活动组ID(campaign group id)
# "iad-org-id": "1234567890",
# # 关键词
# "iad-keyword": "Keyword",
# # 素材名称
# "iad-creativeset-name": "CreativeSetName",
# # 国家
# "iad-country-or-region": "US",
# # 广告活动名称
# "iad-campaign-name": "CampaignName",
# # 广告组ID
# "iad-adgroup-id": "1234567890",
# # 广告活动组名称(campaign group name)
# "iad-org-name": "OrgName",
# "iad-lineitem-id": "1234567890",
# "iad-lineitem-name": "LineName",
# "asatoken": "PLEU97c4CmufaE1LSl1WtLiJYp/uAzaw2/u1ClT+/3oOXTZioJj7HQIYfPwXFWajiQSKEQKrVPsMnWQehYxKvM738taR5TvFewAAAVADAAAAywAAAIB8/odC2bsr2fCP0zyFh2a48uyqcqFV3Wn0H+OnHN503dkHiCpsUaiHAptHQ/rAZgwXbtOXr4614Qabc0C6/55eP4mcFycPe24Q6rnkFl5ShwZmeEvu7I/oDWoDFkVKu0zD1g5dI6+yBI6Eb/Jj64OUAv6vpadD2SjJmqyBKHzhoAAAAB+I7jKYVGw7cbkI3+pjVhmfRPcq/WqGUP/FQhenKvuzAAAAnwGApEjvnfSmSwNz08eBOarI6h0R/AAAAIYEBDPzgQTIVpZBqceNqDtPiNNg0gYO9zXPdYKgB+aWtBsu5f6dUTZ/cA0Q2igUO7WpNTVOLT8HiA9GwulZtKM87LwOoD/p4Km9wFfsbZgxSnt6sgYGCfFY4GehIKqsNeuCUS+9M4/Z2LRIcWEXkbhm/AE1XsmemM5JjB8P8+wGe0Mb5Xb1XQABBEUNAAA=",
# "_oaid_limited": "false",
# "_app_version": "1.2.0_1565149_1627898",
# "_timestamp": "1611131462864",
# "_province": "湖北",
# "_city": "武汉",
# "_carrier": "unknown",
# "_ryos": "Android",
# "_ry_ts": "1611131463068",
# "_oaid": "5c70287b-27f5-4ac3-9e9c-2d67b8cf1065",
# "_pkgname": "com.miHoYo.Yuanshen",
# "_lib_version": "1.6.2",
# "_ucid": "unknown",
# "_ryandroid8version": "29",
# "_model": "ASK-AL20",
# "_istablet": "phone",
# "_mac": "DE:12:94:7D:78:E4",
# "_ryosversion": "10",
# "_rydevicetype": "ASK-AL20",
# "_ry_origin_when": "2021-01-20 16:31:03",
# "_imei": "5c70287b-27f5-4ac3-9e9c-2d67b8cf1065",
# "_meid": "unknown",
# "_lib": "Android",
# "_tz": "+8",
# "_audio_volume": "0",
# "_manufacturer": "HUAWEI",
# "_create_timestamp": "1611131463351",
# "_ip": IP,
# "_imei2": "unknown",
# "_resolution": "1412*720",
# "_campaignid": "1",
# "_bd_vid": "unknown",
# "_ipv6": "240e:45f:7200:21fb:a81c:2870:e657:4ab6",
# "_androidid": "ccb8533a2c18827b",
# "_screen_brightness": "60",
# "_ukid": "unknown",
# "_network_type": "UNKOWN",
# "_deviceid": "5C70287B-27F5-4AC3-9E9C-2D67B8CF1065"
},
# 'when': '2021-01-17 23:59:36',
#time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
# 'ds': ds,
'who': 'lxx_test'
})
try:
p = requests.post(url=URL+'install', data=s, headers=headers, timeout=5)
# , headers = headers
print("激活:" + p.text)
print("设备id:"+i)
print(p.url)
except Exception as err:
print(err)
#今日头条归因
def formevent(self, i, IP, appkey):
s = json.dumps({
"appid": appkey,
"context": {
"_campaignid": 'default',
"_deviceid": i,
"_imei": i,
# "_imei2":i,
# "_oaid":i,
# "_meid":i,
"_androidid": "2342312",
"_ip": IP,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op': op,
"_lib_version": lv,
'_timestamp': "aaa"
},
# '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+'form', 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,
"_lib_version": lv,
# "current_caid":'2121',
# "_campaignid": 'default',
# "_deviceid": i,
# "_imei": i,
# # "_idfa": '75463565745634546',
# "_androidid": "424653325643",
# # "_imei2":"324323AAAA",
# # "_meid": "CCC324323",
# "_ip": IP,
# # "_ipv6": i,
# '_manufacturer': manufacturer,
'_ryos': ryos,
# '_rydevicetype': rydevicetype,
# '_network': network,
# '_resolution': resolution,
# '_op': op,
# '_timestamp': current_time_13,
# '_oaid': '999b6e3e-a274-ed22-cebf-2b6dddfc29b7'
# # '_mac':"565354131606"
'sysfsize': '111',
'_model': '1',
'sysram': '1',
'_ryosversion': '1',
'sysutime': '1',
'sysuname': '1',
'_carrier': '1',
'syscountryc': '1',
'sysrtime': '1',
},
# 'when': when,
# 'ds': ds,
'who': 'lxx_test'
}
)
p = requests.post(url=URL+'startup', data=s, headers=headers, timeout=10)
print("启动"+p.text)
print(when)
#注册
def registerEvent(self,i,IP,appkey):
s = json.dumps({
# 'what':'register',
'appid':appkey,
'context':{
'_deviceid':i,
'_imei':i,
# "_idfv": i,
# '_androidid':i,
'_ip':IP,
'_timestamp': current_time_13,
'_oaid': i,
"_lib_version": lv,
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL+'register',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,
"_idfv": i,
'_androidid': i,
'_ip': IP,
'_ryos': ryos,
"_lib_version": lv,
"serverid": "111111",
# '_rydevicetype': rydevicetype,
'_timestamp': current_time_13
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
})
try:
p = requests.post(url=URL+'loggedin', data=s, headers=headers, timeout=10)
print("登录"+p.text)
except Exception as err:
print(err)
#付费
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,
"_lib_version": lv,
'_oaid':"unknow"
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL+'payment', data=s, headers=headers, timeout=5)
print("付费"+p.text)
# print(str(s))
# 订单
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,
"_lib_version": lv,
'_currencytype': currencytype,
'_ryos': ryos,
'_currencyamount': currencyamount,
},
# '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 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,
"_lib_version": lv,
'_key_action_category': '1', '_key_action_threshold': '15',
#识别是否为自定义事件,默认传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):
s = json.dumps({
"what": "invoke",
"appType": "",
"appid": appkey,
"context": {
"_campaignid": "_default_",
"_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": "DBC43622-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",
# "_androidid": "5432453421342654",
"_lats": "1"
},
"where": "event",
# "when": time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# "ds": ds,
"who": "unknown"
})
p = requests.post(url=URL+'event', data=s, headers=headers, timeout=5)
print("自定义" + p.text)
# 广告展示
def adshow(self, i, IP, appkey,adid):
s = json.dumps({
"appid": appkey,
"context": {
'_adPlatform': adPlatform,
'_adId': adid,
"_campaignid": 'default',
"_deviceid": i,
"_imei": i,
# "_idfa": '75463565745634546',
"_androidid": "424653325643",
# "_imei2":"324323AAAA",
# "_meid": "CCC324323",
"_ip": IP,
# "_ipv6": i,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op': op,
'_timestamp': current_time_13,
'_oaid': '999b6e3e-a274-ed22-cebf-2b6dddfc29b7',
"_fill": "0",
# '_mac':"565354131606"
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
})
try:
p = requests.post(url=URL + 'adshow', data=s, headers=headers, timeout=5)
print("广告展示:" + p.text)
print("设备id:" + i)
except Exception as err:
print(err)
# 广告点击
def adclick(self, i, IP, appkey,adid):
s = json.dumps({
"appid": appkey,
"context": {
'_adPlatform': adPlatform,
'_adId': adid,
"_campaignid": 'default',
"_deviceid": i,
"_imei": i,
# "_idfa": '75463565745634546',
"_androidid": "424653325643",
# "_imei2":"324323AAAA",
# "_meid": "CCC324323",
"_ip": IP,
# "_ipv6": i,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op': op,
'_timestamp': current_time_13,
'_oaid': '999b6e3e-a274-ed22-cebf-2b6dddfc29b7'
# '_mac':"565354131606"
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
})
try:
p = requests.post(url=URL + 'adclick', data=s, headers=headers, timeout=5)
print("广告点击:" + p.text)
print("设备id:" + i)
except Exception as err:
print(err)
def retentionEvent(self, i, IP, appkey):
s = json.dumps(
{
"what": "retention",
"appType": "",
"appid": appkey,
"context": {
"_campaignid": "_default_",
"_rydevicetype": "iPhone",
"cfnetworkversion": "1197",
"sysuname": "E3DB67CAC7AA864C3CBDE118997ADD44",
"kernelinfo": "Darwin Kernel Version 20.0.0: Fri Aug 28 23:07:15 PDT 2020; root:xnu-7195.0.46~9/RELEASE_ARM64_T8030",
"language": "disable",
"_ryosversion": "14.0",
"ua": "unknown",
"_manufacturer": "苹果",
"frequency": "43.667",
"_screen_brightness": "0.442",
"_isreyundefaultevent": "1",
"_timestamp": "1627372876508",
"_idfa": "00000000-0000-0000-0000-000000000000",
"sysrtime": "disable",
"mn": "e2dbe3e4e5eeabe7f3f3",
"_carrier": "disable",
"_tz": "+8",
"_pkgname": "com.reyun.sdktrackingtest",
"_ryos": "ios",
"_mac": "02:00:00:00:00:00",
"hwm": "D421AP", "pbv": "18A373",
"_ip": IP,
"sysutime": "disable",
"_app_version": "2.0",
"_deviceid": i,
"less_than_fourteen_dev": "00000000-0000-0000-0000-000000000000",
"_jbk": "0",
"kernosrelease": "20.0.0",
"syscountryc": "disable",
"ry_appname": "测试iOS",
"_idfv": "31199199-4B90-4E10-9D28-3CA815E2B740",
"_lib_version": "1.8.6_jsfc",
"_ry_ts": "1627372876761",
"_create_timestamp": "1627372876508",
"_network_type": "WIFI", "_lats": "0"},
"where": "event",
"when": when,
"deviceid": i,
"ds": when,
"who": "TA 5-"
})
p = requests.post(url=URL + 'event', data=s, headers=headers, timeout=10)
print("retention" + p.text)
print(when)
# App页面浏览时长分布
def pageduration(self, i, IP, appkey,sessionID,pageId):
s = json.dumps({
"appid": appkey,
"context": {
'_pageid': pageId,
"_sessionid": sessionID,
'_pageduration': pageduration,
"_campaignid": 'default',
"_deviceid": i,
"_imei": i,
# "_idfa": '75463565745634546',
# "_androidid": "424653325643",
# "_imei2":"324323AAAA",
# "_meid": "CCC324323",
"_ip": IP,
# "_ipv6": i,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op': op,
'_timestamp': current_time_13,
'_oaid': '999b6e3e-a274-ed22-cebf-2b6dddfc29b7'
# '_mac':"565354131606"
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
})
try:
p = requests.post(url=URL + 'pageduration', data=s, headers=headers, timeout=5)
print("App页面浏览时长分布:" + p.text)
except Exception as err:
print(err)
# App使用时长
def appduration(self, i, IP, appkey,sessionID):
s = json.dumps({
"appid": appkey,
"context": {
"_appduration": appduration,
"_sessionid": sessionID,
"_campaignid": 'default',
"_deviceid": i,
"_imei": i,
# "_idfa": '75463565745634546',
# "_androidid": "424653325643",
# "_imei2":"324323AAAA",
# "_meid": "CCC324323",
"_ip": IP,
# "_ipv6": i,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op': op,
'_timestamp': current_time_13,
# '_oaid': '999b6e3e-a274-ed22-cebf-2b6dddfc29b7'
# '_mac':"565354131606"
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
})
try:
p = requests.post(url=URL + 'appduration', data=s, headers=headers, timeout=5)
print("App使用时长:" + p.text)
except Exception as err:
print(err)
# 批量上传数据接口
def batchUpload(self, i, IP, appkey):
s = json.dumps(
{"from": "tkio", "data": [
{"appid": appkey, "when": "2018-01-08 11:22:42", "what": "startup",
"context": {"_manufacturer": "苹果", "_carrier": "unknown", "_lats": "1", "_jbk": "1",
"_app_version": "1.0", "_timestamp": "1515381771925", "_create_timestamp": "1515381762624",
"_rydevicetype": "iPhone", "_deviceid": "FD8A5386-C25B-49D8-A0F3-2E61B179DA0E",
"_tz": "+8", "_resolution": "667*375", "_pkgname": "com.reyun.testapp",
"_mac": "80:E6:50:12:4C:DE", "_network_type": "NO CONNECT", "_istf": "8",
"_idfv": "27CCEE6E-5ED1-47EC-B486-81F9129C05D3", "_ryosversion": "11.2",
"_model": "iPhone Simulator", "_lib_version": "2.0.0", "_ryos": "ios",
"_campaignid": "channelid", "_idfa": "FD8A5386-C25B-49D8-A0F3-2E61B179DA0E"},
"who": "unknown"},
{"appid": appkey, "when": "2018-01-08 11:22:42", "what": "register",
"context": {"_manufacturer": "苹果", "_carrier": "unknown", "_lats": "1", "_jbk": "1",
"_app_version": "1.0", "_timestamp": "1515381771925", "_create_timestamp": "1515381762657",
"_rydevicetype": "iPhone", "_deviceid": "FD8A5386-C25B-49D8-A0F3-2E61B179DA0E",
"_tz": "+8", "_resolution": "667*375", "_pkgname": "com.reyun.testapp",
"_mac": "80:E6:50:12:4C:DE", "_network_type": "NO CONNECT", "_istf": "8",
"_idfv": "27CCEE6E-5ED1-47EC-B486-81F9129C05D3", "_ryosversion": "11.2",
"_model": "iPhone Simulator", "_lib_version": "2.0.0", "_ryos": "ios",
"_campaignid": "channelid", "_idfa": "FD8A5386-C25B-49D8-A0F3-2E61B179DA0E"},
"who": "acc1"},
]}
)
p = requests.post(url=URL_batch, data=s, headers=headers, timeout=5)
print("自定义" + p.text)
# h5
def H5(self, i, IP, appkey):
s = json.dumps({
"what": "download",
"appType": "wap",
"appid": appkey,
"context": {
"_campaignid": "_default_",
"_deviceid": i,
"_cid": "-1",
"_ry_ts": "1588130655311",
"_tz": "+8",
"_ip":IP,
"_apptype": "wap",
"_campaignid_bak": "_default_",
"_ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36",
"_cid_bak": "-1"
},
"where": "event",
"deviceid": i,
"when": when,
"ds": ds,
"who": "552317006484"
})
try:
p = requests.post(url=URL + 'event', data=s, headers=headers, timeout=5)
print("App使用时长:" + p.text)
except Exception as err:
print(err)
\ No newline at end of file
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'))
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://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 = 'ios'
#设备类型
rydevicetype = 'vivox9'
#网络类型
network ='wifi'
#分辨率
resolution ='1344*750'
#运行商
op='中国移动'
# 支付类型 支付宝(alipay),银联(unionpay),微信支付(weixinpay),易宝支付(yeepay)
paymenttype = 'alipay'
#货币类型
currencytype = 'CNY'
#支付的货币金额
currencyamount = '98.8'
# # 填充广告在变现平台的广告位ID
# adid = '839296815'
# 填充广告的变现平台,例如穿山甲(csj)、优量汇(ylh)、百青藤(bqt)、Sigmob(sigmob)、快手(ks)、Mintegral(mintegral)、OneWay(oneway)、Vungle(vungle)等
adPlatform = 'ylh'
# 页面展示时调用 pageID代表页面唯一标识
# 会话时长,单位秒
appduration = '600'
# 时长,单位:秒
pageduration = '200'
istablet = 'phone'
lib = 'ios'
when1 = '2020-06-06 16:44:31'
# 设备型号
model = '测试1'
# 操作系统版本
ryosversion = '13.6.1'
# 网络环境
network_type = '5g'
# 运营商
carrier = '中国联通'
lv = '1.8.5'
class allEvent:
# 激活
def installUpload(self,i,IP,appkey):
s = json.dumps({
"what":'install',
"appid":appkey,
"context":{
# "_cmpaignid":'default',
"_deviceid":i,
# 00000000 - 0000 - 0000 - 0000 - 000000000000
"_idfa":i,
"_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)',
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_networktype': network_type,
'_resolution': resolution,
'_carrier': carrier,
'_timestamp': current_time_13,
'_model': 'jixing',
'_ryosversion': ryosversion,
'__model': 'jixing',
# 1.redownload + deviceId有归因结果 asa_install_type = old_redownload对应3
# 2.redownload + deviceId无归因结果 asa_install_type = new_redownload对应4
# 3.download + deviceId有归因结果asa_install_type = old_download对应1
# 4.download + deviceId无归因结果asa_install_type = new_download对应2
#
#
# # 转化类型,新增或重装,Download 或 Redownload
"iad-conversion-type": "Redownload",
# 广告活动组ID(campaign group id)
"iad-org-id": "12123",
# 广告活动组名称(campaign group name)
"iad-org-name": "12345678",
# 广告活动ID
"iad-campaign-id": "99999999999",
# 广告活动名称
"iad-campaign-name": "CampaignName",
# 广告组ID
"iad-adgroup-id": "99999999999",
# 广告组名称
"iad-adgroup-name": "AdGroupName",
# 关键词 id
"iad-keyword-id": "99999999999",
# 关键词
"iad-keyword": "Keyword",
# 素材ID
"iad-creativeset-id": "99999999999",
# 素材名称
"iad-creativeset-name": "CreativeSetName",
# 点击ASA广告时间
"iad-click-date": '2021-06-24T11:32:33Z',
# 本次下载完成的时间(仅ASA转化时,该值传且必传)
"iad-conversion-date": when,
# Broad 广泛匹配 ; Exact 完全匹配;SearchMatch 搜索匹配
# 关键词匹配类型
"iad-keyword-matchtype": "SearchMatch",
#首次下载完成的时间(有可能包括非ASA转化,当为redownload且conversion date有值时,purchase date是第一次下载App的时间)
"iad-purchase-date": '2021-06-24T11:32:33Z',
# 归因结果
"iad-attribution": "true",
# 国家
"iad-country-or-region": "US",
'asa_install_time':'2021-06-24T11:32:33Z',
# 'asatoken': 'OfmS+MFycll/025oJEjtpZ+rs4AUkDEJh52fT8RrjwIR/ h+2JOpXz4MRdmtcemL8WTTHfNN52tjqjbWupke40AAAAVADAAAAvQAAAIAg QF1+XF4Tl2IZ7Bw/M6ufUHt+UcIhuBeJT8YenB2v36bnZKEjvq/ IH8rqXkRELTHdyiqOYtpy837+UjF/NjE6t1/ l7sIn71b0t3FEXJd8QOtl3Bi6iQyJgGeN8w8X0MK1PDqz9nLJtRD/ wl+p112qR2YrMDyyKnwNrbfRhnGB9AAAAB7wAXlwNHelWf5RT2bzSJcGflq ELMCGoDEHIl7jF6kAAACfAb9ylY8ffdbTlyJODQYQ/ 6V9qbaBAAAAhgUBW39MQI1A0SZgNmZFz4KPaF94BxBzd4rDkjr/ eSeuaXWCmEW3ZhBzE/MOM17hAPBVlDhTPcZ/2ybr3WYIkfb+AAg/ 7jxGpDXgTtco3fzTytnZpEaI5SenXHALIexQAUTBsfBW2HCMQuTRo+7anoW kf69656ZAWcSc3DEQ1CAkUSKO9X7iAAABBEQQBQA='
},
'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 startupEvent(self, i, IP, appkey):
s = json.dumps(
{
# 'what': 'startup',
'appid': appkey,
'context': {
# "_cmpaignid":'default',
"_deviceid": i,
# 00000000 - 0000 - 0000 - 0000 - 000000000000
"_idfa": i,
"_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)',
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_networktype': network_type,
'_resolution': resolution,
'_carrier': carrier,
'_timestamp': current_time_13,
'_model': 'jixing',
'_ryosversion': ryosversion,
'__model': 'jixing',
# "current_caid":'2121',
# "_campaignid": 'default',
# "_deviceid": i,
# "_imei": i,
# # "_idfa": '75463565745634546',
# "_androidid": "424653325643",
# # "_imei2":"324323AAAA",
# # "_meid": "CCC324323",
# "_ip": IP,
# # "_ipv6": i,
# '_manufacturer': manufacturer,
'_ryos': ryos,
# '_rydevicetype': rydevicetype,
# '_network': network,
# '_resolution': resolution,
# '_op': op,
# '_timestamp': current_time_13,
# '_oaid': '999b6e3e-a274-ed22-cebf-2b6dddfc29b7'
# # '_mac':"565354131606"
'sysfsize': '111',
'_model': '1',
'sysram': '1',
'_ryosversion': '1',
'sysutime': '1',
'sysuname': '1',
'_carrier': '1',
'syscountryc': '1',
'sysrtime': '1',
},
# 'when': when,
# 'ds': ds,
'who': 'lxx_test'
}
)
p = requests.post(url=URL + 'startup', data=s, headers=headers, timeout=10)
print("启动" + p.text)
print(when)
# 注册
def registerEvent(self, i, IP, appkey):
s = json.dumps({
# 'what':'register',
'appid': appkey,
'context': {
# "_cmpaignid":'default',
"_deviceid":i,
# 00000000 - 0000 - 0000 - 0000 - 000000000000
"_idfa":i,
"_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)',
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_networktype': network_type,
'_resolution': resolution,
'_carrier': carrier,
'_timestamp': current_time_13,
'_model': 'jixing',
'_ryosversion': ryosversion,
'__model': 'jixing',
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL + 'register', 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,
# 00000000 - 0000 - 0000 - 0000 - 000000000000
"_idfa": i,
"_ip": IP,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_networktype': network_type,
'_resolution': resolution,
'_carrier': carrier,
'_timestamp': current_time_13,
'_model': 'jixing',
'_ryosversion': ryosversion,
'__model': 'jixing',
"serverid": "111111",
'accountid': '99999',
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
})
try:
p = requests.post(url=URL + 'loggedin', data=s, headers=headers, timeout=10)
print("登录" + p.text)
except Exception as err:
print(err)
# 付费
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,
# 00000000 - 0000 - 0000 - 0000 - 000000000000
"_idfa":i,
"_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)',
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_networktype': network_type,
'_resolution': resolution,
'_carrier': carrier,
'_timestamp': current_time_13,
'_model': 'jixing',
'_ryosversion': ryosversion,
'__model': 'jixing',
'_transactionid': transactionid,
'_paymenttype': paymenttype,
'_currencytype': currencytype,
'_currencyamount': currencyamount,
"_lib_version": lv,
'_oaid': "unknow"
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL + 'payment', data=s, headers=headers, timeout=5)
print("付费" + p.text)
# print(str(s))
# 订单
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,
# 00000000 - 0000 - 0000 - 0000 - 000000000000
"_idfa":i,
"_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)',
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_networktype': network_type,
'_resolution': resolution,
'_carrier': carrier,
'_timestamp': current_time_13,
'_model': 'jixing',
'_ryosversion': ryosversion,
'__model': 'jixing',
'accountid': '99999',
'_transactionid': transactionid,
'_paymenttype': paymenttype,
"_lib_version": lv,
'_currencytype': currencytype,
'_currencyamount': currencyamount,
},
# '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 ziding_event(self, i, IP, appkey, event):
s = json.dumps({
'what': event,
'appid': appkey,
'context': {
"_deviceid":i,
# 00000000 - 0000 - 0000 - 0000 - 000000000000
"_idfa":i,
"_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)',
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_networktype': network_type,
'_resolution': resolution,
'_carrier': carrier,
'_timestamp': current_time_13,
'_model': 'jixing',
'_ryosversion': ryosversion,
'__model': 'jixing',
"_lib_version": lv,
'_key_action_category': '1', '_key_action_threshold': '15',
# 识别是否为自定义事件,默认传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):
s = json.dumps({
"what": "invoke",
"appType": "",
"appid": appkey,
"context": {
"_campaignid": "_default_",
"_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": "DBC43622-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",
# "_androidid": "5432453421342654",
"_lats": "1"
},
"where": "event",
# "when": time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# "ds": ds,
"who": "unknown"
})
p = requests.post(url=URL + 'event', data=s, headers=headers, timeout=5)
print("自定义" + p.text)
# 广告展示
def adshow(self, i, IP, appkey, adid):
s = json.dumps({
"appid": appkey,
"context": {
'_adPlatform': adPlatform,
'_adId': adid,
"_campaignid": 'default',
"_deviceid": i,
"_imei": i,
# "_idfa": '75463565745634546',
"_androidid": "424653325643",
# "_imei2":"324323AAAA",
# "_meid": "CCC324323",
"_ip": IP,
# "_ipv6": i,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op': op,
'_timestamp': current_time_13,
'_oaid': '999b6e3e-a274-ed22-cebf-2b6dddfc29b7',
"_fill": "1",
# '_mac':"565354131606"
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
})
try:
p = requests.post(url=URL + 'adshow', data=s, headers=headers, timeout=5)
print("广告展示:" + p.text)
print("设备id:" + i)
except Exception as err:
print(err)
# 广告点击
def adclick(self, i, IP, appkey, adid):
s = json.dumps({
"appid": appkey,
"context": {
'_adPlatform': adPlatform,
'_adId': adid,
"_campaignid": 'default',
"_deviceid": i,
"_imei": i,
# "_idfa": '75463565745634546',
"_androidid": "424653325643",
# "_imei2":"324323AAAA",
# "_meid": "CCC324323",
"_ip": IP,
# "_ipv6": i,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op': op,
'_timestamp': current_time_13,
'_oaid': '999b6e3e-a274-ed22-cebf-2b6dddfc29b7'
# '_mac':"565354131606"
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
})
try:
p = requests.post(url=URL + 'adclick', data=s, headers=headers, timeout=5)
print("广告点击:" + p.text)
print("设备id:" + i)
except Exception as err:
print(err)
# App页面浏览时长分布
def pageduration(self, i, IP, appkey, sessionID, pageId):
s = json.dumps({
"appid": appkey,
"context": {
'_pageid': pageId,
"_sessionid": sessionID,
'_pageduration': pageduration,
"_campaignid": 'default',
"_deviceid": i,
"_imei": i,
# "_idfa": '75463565745634546',
# "_androidid": "424653325643",
# "_imei2":"324323AAAA",
# "_meid": "CCC324323",
"_ip": IP,
# "_ipv6": i,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op': op,
'_timestamp': current_time_13,
'_oaid': '999b6e3e-a274-ed22-cebf-2b6dddfc29b7'
# '_mac':"565354131606"
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
})
try:
p = requests.post(url=URL + 'pageduration', data=s, headers=headers, timeout=5)
print("App页面浏览时长分布:" + p.text)
except Exception as err:
print(err)
# App使用时长
def appduration(self, i, IP, appkey, sessionID):
s = json.dumps({
"appid": appkey,
"context": {
"_appduration": appduration,
"_sessionid": sessionID,
"_campaignid": 'default',
"_deviceid": i,
"_imei": i,
# "_idfa": '75463565745634546',
# "_androidid": "424653325643",
# "_imei2":"324323AAAA",
# "_meid": "CCC324323",
"_ip": IP,
# "_ipv6": i,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op': op,
'_timestamp': current_time_13,
# '_oaid': '999b6e3e-a274-ed22-cebf-2b6dddfc29b7'
# '_mac':"565354131606"
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
})
try:
p = requests.post(url=URL + 'appduration', data=s, headers=headers, timeout=5)
print("App使用时长:" + p.text)
except Exception as err:
print(err)
def retentionEvent(self, i, IP, appkey):
s = json.dumps(
{
"what": "retention",
"appType": "",
"appid": appkey,
"context": {
"_campaignid": "_default_",
"_rydevicetype": "iPhone",
"cfnetworkversion": "1197",
"sysuname": "E3DB67CAC7AA864C3CBDE118997ADD44",
"kernelinfo": "Darwin Kernel Version 20.0.0: Fri Aug 28 23:07:15 PDT 2020; root:xnu-7195.0.46~9/RELEASE_ARM64_T8030",
"language": "disable",
"_ryosversion": "14.0",
"ua": "unknown",
"_manufacturer": "苹果",
"frequency": "43.667",
"_screen_brightness": "0.442",
"_isreyundefaultevent": "1",
"_timestamp": "1627372876508",
"_idfa": "00000000-0000-0000-0000-000000000000",
"sysrtime": "disable",
"mn": "e2dbe3e4e5eeabe7f3f3",
"_carrier": "disable",
"_tz": "+8",
"_pkgname": "com.reyun.sdktrackingtest",
"_ryos": "ios",
"_mac": "02:00:00:00:00:00",
"hwm": "D421AP", "pbv": "18A373",
"_ip": IP,
"sysutime": "disable",
"_app_version": "2.0",
"_deviceid": i,
"less_than_fourteen_dev": "00000000-0000-0000-0000-000000000000",
"_jbk": "0",
"kernosrelease": "20.0.0",
"syscountryc": "disable",
"ry_appname": "测试iOS",
"_idfv": "31199199-4B90-4E10-9D28-3CA815E2B740",
"_lib_version": "1.8.6_jsfc",
"_ry_ts": "1627372876761",
"_create_timestamp": "1627372876508",
"_network_type": "WIFI", "_lats": "0"},
"where": "event",
"when": when,
"deviceid": i,
"ds": when,
"who": "TA 5-"
})
p = requests.post(url=URL + 'event', data=s, headers=headers, timeout=10)
print("retention" + p.text)
print(when)
# 批量上传数据接口
def batchUpload(self, i, IP, appkey):
s = json.dumps(
{"from": "tkio", "data": [
{"appid": appkey, "when": "2018-01-08 11:22:42", "what": "startup",
"context": {"_manufacturer": "苹果", "_carrier": "unknown", "_lats": "1", "_jbk": "1",
"_app_version": "1.0", "_timestamp": "1515381771925", "_create_timestamp": "1515381762624",
"_rydevicetype": "iPhone", "_deviceid": "FD8A5386-C25B-49D8-A0F3-2E61B179DA0E",
"_tz": "+8", "_resolution": "667*375", "_pkgname": "com.reyun.testapp",
"_mac": "80:E6:50:12:4C:DE", "_network_type": "NO CONNECT", "_istf": "8",
"_idfv": "27CCEE6E-5ED1-47EC-B486-81F9129C05D3", "_ryosversion": "11.2",
"_model": "iPhone Simulator", "_lib_version": "2.0.0", "_ryos": "ios",
"_campaignid": "channelid", "_idfa": "FD8A5386-C25B-49D8-A0F3-2E61B179DA0E"},
"who": "unknown"},
{"appid": appkey, "when": "2018-01-08 11:22:42", "what": "register",
"context": {"_manufacturer": "苹果", "_carrier": "unknown", "_lats": "1", "_jbk": "1",
"_app_version": "1.0", "_timestamp": "1515381771925", "_create_timestamp": "1515381762657",
"_rydevicetype": "iPhone", "_deviceid": "FD8A5386-C25B-49D8-A0F3-2E61B179DA0E",
"_tz": "+8", "_resolution": "667*375", "_pkgname": "com.reyun.testapp",
"_mac": "80:E6:50:12:4C:DE", "_network_type": "NO CONNECT", "_istf": "8",
"_idfv": "27CCEE6E-5ED1-47EC-B486-81F9129C05D3", "_ryosversion": "11.2",
"_model": "iPhone Simulator", "_lib_version": "2.0.0", "_ryos": "ios",
"_campaignid": "channelid", "_idfa": "FD8A5386-C25B-49D8-A0F3-2E61B179DA0E"},
"who": "acc1"},
]}
)
p = requests.post(url=URL_batch, data=s, headers=headers, timeout=5)
print("自定义" + p.text)
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
# 153字符
chaochang = '543214223221321321312131313133132131232131232132132543214223221321321312131313133132131232131232132132543214223221321321312131313133132131232131232132132'
cc612 = '543214223221321321312131313133132131232131232132132543214223221321321312131313133132131232131232132132543214223221321321312131313133132131232131232132132543214223221321321312131313133132131232131235432142232213213213121313131331321312321312321321325432142232213213213121313131331321312321312321321325432142232213213213121313131331321312321312321321325432142232213213213121313131331321312321312321321325432142232213213213121313131331321312321312321321325432142232213213213121313131331321312321312321321322132132543214223221321321312131313133132131232131232132132543214223221321321312131313133132131232131232132132'
headers = {
'Content-Type': 'application/json'
}
global data
data = [
{
"application_info": {
"appkey": "74b81be2432c029040e0b2bc375ce7fb",
"bundleid": "3423232",
"app_version": "1.9.0",
"channel_name": "HUAWEI"
},
"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": "3DEA635F-B24F-434B-833F-4ED028FEAEEF",
"device_id_type": "oaid",
"device_id_md5": "8e488a40a17aed2f6752f51382a4eafc",
"device_id_md5_type": "oaid_md5",
"os": "android",
"os_version": "19",
"manufacturer": "HUAWEI",
"model": "Mate 40",
"ipv4": "1.1.1.1",
"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",
"oaid": "3DEA635F-B24F-434B-833F-4ED028FEAEEF",
"oaid_md5": "8e488a40a17aed2f6752f51382a4eafc",
"imei1": "8342732742383",
"imei1_md5": "8e488a40a17aed2f6752f51382a4eafc",
"imei2": "8342732742383",
"imei2_md5": "8e488a40a17aed2f6752f51382a4eafc",
"gaid": "B21C5EC5-9921-42FD-AAC5-07A0EB6CF1A0",
"gaid_md5": "8e488a40a17aed2f6752f51382a4eafc",
"mac": "23456787898767898",
"mac_md5": "24953067e92f5bdebc9fd56411fd38f3",
"android_id": "1a34fc556a43c453",
"android_id_md5": "8e488a40a17aed2f6752f51382a4eafc"
},
"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是全局的,前一个测试用例对data的操作会影响第二个测试用例获取的data
# 涉及到对象引用赋值问题(修改一个对象,另一个对象也会改变,所以需要把data转成json赋值给data_temp)
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
def send_requests2s():
global data
url = "http://tkiomicro-receive-788931749.cn-north-1.elb.amazonaws.com.cn/receive/tkiov2/s2s"
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
# 批量上报的数据中存在异常数据
def test_piliang():
# data.append(data[0])
# data[1]['event_info'] = '1'
# data.append(data[0])
# data[2]['event_info'] = '2'
# data.append(data[0])
# data[3]['event_info'] = '3'
# 取data的第一个元素
first = data[0]
for num in range(3):
# 修改data的第一个元素的event_info
first['event_info'] = str(num)
# 将元素添加到数组
data.append(first)
response = send_request()
assert response["status"] == "406"
#
#
# 批量上报的数据超过100条
def test_piliang2():
for _ in range(100):
data.append(data[0])
response = send_request()
assert response["status"] == "406"
# -------------------------应用信息-------------------------
# application_info为空
def test_appinfo_empty():
data[0]["application_info"] = ""
response = send_request()
# 这里可以针对返回结果做断言,需要根据实际情况修改
assert response["status"] == "100"
# appkey为空
def test_app_empty():
data[0]["application_info"]["appkey"] = ""
response = send_request()
# 这里可以针对返回结果做断言,需要根据实际情况修改
assert response["status"] == "101"
# appkey长度非法
def test_app_illegal_length():
data[0]["application_info"]["appkey"] = "74b81be2432c029040e0b2bc375ce7fb3"
response = send_request()
assert response["status"] == "101"
# bundleid为空
def test_bundleid_empty():
data[0]["application_info"]["bundleid"] = ""
response = send_request()
assert response["status"] == "102"
# bundleid超过128字符
def test_bundleid_illegal_length():
data[0]["application_info"]["bundleid"] = chaochang
response = send_request()
assert response["status"] == "102"
# bundleid包含特殊字符
def test_bundleid1():
data[0]["application_info"]["bundleid"] = "23232sfds$%%-"
response = send_request()
assert response["status"] == "0"
# app_version 为空
def test_app_version_empty():
data[0]["application_info"]["app_version"] = ""
response = send_request()
assert response["status"] == "0"
# app_version 超长
def test_app_version_illegal_length():
data[0]["application_info"]["app_version"] = chaochang
response = send_request()
assert response["status"] == "103"
# app_version 特殊字符
def test_app_version3():
data[0]["application_info"]["app_version"] = "#¥%"
response = send_request()
assert response["status"] == "0"
# channel_name传HUAWEI,os为iOS
def test_channel_name_error():
data[0]["application_info"]["channel_name"] = "HUAWEI"
data[0]["device_info"]["os"] = "ios"
response = send_request()
assert response["status"] == "104"
def test_channel_name():
data[0]["application_info"]["channel_name"] = "HUAWEI"
data[0]["device_info"]["os"] = "android"
response = send_request()
assert response["status"] == "0"
# channel_name为空
def test_channel_name_empty():
data[0]["application_info"]["channel_name"] = ""
response = send_request()
assert response["status"] == "104"
# channel_name超长
def test_channel_name3():
data[0]["application_info"]["channel_name"] = chaochang
response = send_request()
assert response["status"] == "104"
# -------------------------时间戳信息-------------------------
# timestamp_info为空
def test_timestamp_info_empty():
data[0]["timestamp_info"] = ""
response = send_request()
assert response["status"] == "105"
# time_zone为空
def test_time_zone_empty():
data[0]["timestamp_info"]["time_zone"] = ""
response = send_request()
assert response["status"] == "106"
# time_zone不等于6个字符
def test_time_zone__illegal_length():
data[0]["timestamp_info"]["time_zone"] = chaochang
response = send_request()
assert response["status"] == "106"
# time_zone等于6个字符
def test_time_zone1():
data[0]["timestamp_info"]["time_zone"] = "qwertr"
response = send_request()
assert response["status"] == "0"
# time_zone为正常时区
def test_time_zone2():
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
response = send_request()
assert response["status"] == "0"
# time_zone包含特殊字符
def test_time_zone3():
data[0]["timestamp_info"]["time_zone"] = "G*%+08"
response = send_request()
assert response["status"] == "0"
# time_zone为特殊字符
def test_time_zone4():
data[0]["timestamp_info"]["time_zone"] = "%¥"
response = send_request()
assert response["status"] == "106"
# install_time为空
def test_install_time_empty():
data[0]["timestamp_info"]["install_time"] = ""
response = send_request()
assert response["status"] == "107"
# install_time不等于13个字符
def test_install_time_illegal_length():
data[0]["timestamp_info"]["install_time"] = chaochang
response = send_request()
assert response["status"] == "107"
# install_time不等于13个字符
def test_install_time13():
data[0]["timestamp_info"]["install_time"] = "2334567877765"
response = send_request()
assert response["status"] == "0"
# install_time为特殊字符
def test_install_time4():
data[0]["timestamp_info"]["install_time"] = "@#¥##¥%#@@#"
response = send_request()
assert response["status"] == "107"
# install_time包含特殊字符
def test_install_time4():
data[0]["timestamp_info"]["install_time"] = "143343#242334"
response = send_request()
assert response["status"] == "0"
# current_event_time为空
def test_current_event_time_empty():
data[0]["timestamp_info"]["current_event_time"] = ""
response = send_request()
assert response["status"] == "108"
# current_event_time不等于13个字符
def test_current_event_time_illegal_length():
data[0]["timestamp_info"]["current_event_time"] = chaochang
response = send_request()
assert response["status"] == "108"
# current_event_time为特殊字符
def test_current_event_time3():
data[0]["timestamp_info"]["current_event_time"] = "@#¥##¥%#@@#"
response = send_request()
assert response["status"] == "108"
# current_event_time包含特殊字符
def test_current_event_time4():
data[0]["timestamp_info"]["current_event_time"] = "143343#242334"
response = send_request()
assert response["status"] == "0"
# report_time为空
def test_report_time_empty():
data[0]["timestamp_info"]["report_time"] = ""
response = send_request()
assert response["status"] == "109"
# report_time不等于13个字符
def test_report_time_illegal_length():
data[0]["timestamp_info"]["report_time"] = chaochang
response = send_request()
assert response["status"] == "109"
# sdk上报,report_time为空
def test_report_time_sdk1():
data[0]["timestamp_info"]["report_time"] = ""
data[0]["collector_info"]["integration_type"] = "sdk"
response = send_request()
assert response["status"] == "109"
# sdk上报,report_time不为空
def test_report_time_sdk2():
data[0]["timestamp_info"]["report_time"] = "1637823377000"
data[0]["collector_info"]["integration_type"] = "sdk"
response = send_request()
assert response["status"] == "0"
# s2s上报,report_time不为空
def test_report_time_s2s1():
data[0]["timestamp_info"]["report_time"] = "1637823377000"
data[0]["collector_info"]["integration_type"] = "s2s"
response = send_requests2s()
assert response["status"] == "0"
# s2s上报,report_time为空
def test_report_time_s2s2():
data[0]["timestamp_info"]["report_time"] = ""
data[0]["collector_info"]["integration_type"] = "s2s"
response = send_requests2s()
assert response["status"] == "0"
# sdk上报,report_time为特殊字符
def test_report_time_sdk3():
data[0]["timestamp_info"]["report_time"] = "@#¥##¥%#@@#"
data[0]["collector_info"]["integration_type"] = "sdk"
response = send_request()
assert response["status"] == "109"
# sdk上报,report_time包含特殊字符
def test_report_time_sdk3():
data[0]["timestamp_info"]["report_time"] = "22657¥%6756"
data[0]["collector_info"]["integration_type"] = "sdk"
response = send_request()
assert response["status"] == "109"
# -------------------------收集器信息-------------------------
def test_collector_info_empty():
data[0]["collector_info"] = ''
response = send_request()
assert response["status"] == "110"
# integration_type为空
def test_integration_type_empty():
data[0]["collector_info"]["integration_type"] = ''
response = send_request()
assert response["status"] == "111"
# integration_type为s2s,接口为sdk
def test_integration_types2s_empty():
data[0]["collector_info"]["integration_type"] = 's2s'
response = send_request()
assert response["status"] == "111"
# integration_type为sdk,接口为s2s
def test_integration_types2s3():
data[0]["collector_info"]["integration_type"] = 'sdk'
response = send_requests2s()
assert response["status"] == "111"
# integration_type为大写SDK
def test_integration_type4():
data[0]["collector_info"]["integration_type"] = 'SDK'
response = send_request()
assert response["status"] == "111"
# integration_type为大写s2s
def test_integration_type5():
data[0]["collector_info"]["integration_type"] = 'S2S'
response = send_requests2s()
assert response["status"] == "111"
# integration_type为其他字符
def test_integration_type6():
data[0]["collector_info"]["integration_type"] = 'qqq'
response = send_requests2s()
assert response["status"] == "111"
# collector_version为空
def test_collector_version_empty():
data[0]["collector_info"]["collector_version"] = ''
response = send_request()
assert response["status"] == "112"
# collector_version不等于5个字符
def test_collector_version_illegal_length():
data[0]["collector_info"]["collector_version"] = chaochang
response = send_request()
assert response["status"] == "112"
# collector_version等于5个字符,但不是规范版本
def test_collector_version2():
data[0]["collector_info"]["collector_version"] = '11111'
response = send_request()
assert response["status"] == "0"
# collector_version等于5个字符,规范版本
def test_collector_version3():
data[0]["collector_info"]["collector_version"] = '1.8.0'
response = send_request()
assert response["status"] == "0"
# retried_times为空
def test_retried_times_empty():
data[0]["collector_info"]["retried_times"] = ""
response = send_request()
assert response["status"] == "0"
# retried_times超过2个字符
def test_retried_times_illegal_length():
data[0]["collector_info"]["retried_times"] = "123"
response = send_request()
assert response["status"] == "113"
# -------------------------终端设备信息-------------------------
# device_info为空
def test_device_info_empty():
data[0]["device_info"] = ''
response = send_request()
assert response["status"] == "114"
# os为android
def test_os_android():
data[0]["device_info"]["os"] = 'android'
response = send_request()
assert response["status"] == "0"
# os为大写ANDROID
def test_os_android():
data[0]["device_info"]["os"] = 'ANDROID'
response = send_request()
assert response["status"] == "115"
# os为ios,channel_name等于default,没有传idfa等iOS相关参数
def test_os_ios2():
data[0]["device_info"]["os"] = 'ios'
data[0]['application_info']['channel_name'] = 'default'
response = send_request()
assert response["status"] == "124"
# os为空
def test_os_empty():
data[0]["device_info"]["os"] = ''
response = send_request()
assert response["status"] == "115"
# os为web
def test_os_web():
data[0]["device_info"]["os"] = 'web'
response = send_request()
assert response["status"] == "0"
# os_version为空
def test_os_versionempty():
data[0]["device_info"]["os_version"] = ''
response = send_request()
assert response["status"] == "116"
# os_version超长
def test_os_version_illegal_length():
data[0]["device_info"]["os_version"] = chaochang
response = send_request()
assert response["status"] == "116"
# os_version为特殊字符
def test_os_version3():
data[0]["device_info"]["os_version"] = "#¥@@@"
response = send_request()
assert response["status"] == "0"
# os_version包含特殊字符
def test_os_version4():
data[0]["device_info"]["os_version"] = "12&*"
response = send_request()
assert response["status"] == "0"
# manufacturer为空
def test_manufacturerempty():
data[0]["device_info"]["manufacturer"] = ""
response = send_request()
assert response["status"] == "0"
# manufacturer为空
def test_manufacturer_illegal_length():
data[0]["device_info"]["manufacturer"] = chaochang
response = send_request()
assert response["status"] == "117"
# manufacturer为特殊字符
def test_manufacturer3():
data[0]["device_info"]["manufacturer"] = "@#@#@#!@#@#"
response = send_request()
assert response["status"] == "0"
# model为空
def test_model_empty():
data[0]["device_info"]["model"] = ""
response = send_request()
assert response["status"] == "0"
# model超长
def test_model_illegal_length():
data[0]["device_info"]["model"] = chaochang
response = send_request()
assert response["status"] == "118"
# model为特殊字符
def test_model_illegal_length():
data[0]["device_info"]["model"] = "#¥"
response = send_request()
assert response["status"] == "0"
# ipv4 格式非*.*.*.*
def test_ipv4():
data[0]["device_info"]["ipv4"] = "12.2"
response = send_request()
assert response["status"] == "119"
# ipv4 超长
def test_ipv4_illegal_length():
data[0]["device_info"]["ipv4"] = "12.2323423.32432421321421.32423424"
response = send_request()
assert response["status"] == "119"
# 集成方式为s2s,ipv4不传
def test_ipv4_s2s():
data[0]["device_info"]["ipv4"] = ""
data[0]["collector_info"]["integration_type"] = 's2s'
response = send_requests2s()
assert response["status"] == "119"
# 集成方式为s2s,传ipv4
def test_ipv4_s2s2():
data[0]["device_info"]["ipv4"] = "1.1.1.1"
data[0]["collector_info"]["integration_type"] = 's2s'
response = send_requests2s()
assert response["status"] == "0"
# 集成方式为s2s,ipv6不传
def test_ipv6_s2s():
data[0]["device_info"]["ipv6"] = ""
data[0]["collector_info"]["integration_type"] = 's2s'
response = send_requests2s()
assert response["status"] == "0"
# 集成方式为sdk,ipv6不传
def test_ipv6_sdk():
data[0]["device_info"]["ipv6"] = ""
data[0]["collector_info"]["integration_type"] = 'sdk'
response = send_request()
assert response["status"] == "0"
# ipv6超长
def test_ipv6_illegal_length():
data[0]["device_info"]["ipv6"] = chaochang
data[0]["collector_info"]["integration_type"] = 'sdk'
response = send_request()
assert response["status"] == "120"
# ua为空,os为android
def test_ua_androidempty():
data[0]["device_info"]["ua"] = ""
data[0]["device_info"]["os"] = 'android'
response = send_request()
assert response["status"] == "0"
# ua为空,os为web
def test_ua_androidempty():
data[0]["device_info"]["ua"] = ""
data[0]["device_info"]["os"] = 'web'
response = send_request()
assert response["status"] == "121"
# ua为空,os为iOS
def test_ua_iosempty():
data[0]["device_info"]["ua"] = ""
data[0]["device_info"]["os"] = 'ios'
data[0]["application_info"]["channel_name"] = 'default'
response = send_request()
assert response["status"] == "121"
# ua不为空,但是是无法解析的ua
def test_ua_androidempty():
data[0]["device_info"]["ua"] = "11111"
data[0]["device_info"]["os"] = 'web'
response = send_request()
assert response["status"] == "0"
# os为android,att_status为空
def test_uatt_statusempty():
data[0]["device_info"]["att_status"] = ""
response = send_request()
assert response["status"] == "0"
# os为android,lat_status为空
def test_lat_statusempt():
data[0]["device_info"]["att_status"] = ""
response = send_request()
assert response["status"] == "0"
# oaid为空
def test_oaidempty():
data[0]["device_info"]["oaid"] = ""
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "0"
# oaid长度超长
def test_oaid_illegal_length():
data[0]["device_info"]["oaid"] = cc612
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "126"
# oaid_md5为空
def test_oaid_md5_empty():
data[0]["device_info"]["oaid_md5"] = ''
# data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
# data[0]["device_info"]["device_id_type"] = "android_id"
# data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
# data[0]["device_info"]["device_id_md5"] = "30f54d5d0e9f70ef59a212bad02cee8c"
# data[0]["device_info"]["device_id_md5_type"] = "android_id_md5"
response = send_request()
assert response["status"] == "0"
# ios系统,上报oaid,oaid_md5,imei1,imei1_md5,imei2,imei2_md5,gaid,gaid_md5,mac,mac_md5,android_id,android_id_md5,在"3237receiveios"脚本里
# oaid_md5长度超长
def test_oaid_md5_illegal_length():
data[0]["device_info"]["oaid_md5"] = cc612
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "127"
# 安卓系统,上报idfa
def test_idfa():
data[0]["device_info"]["idfa"] = "3DEA635F-B24F-434B-833F-4ED028FEAEEF"
response = send_request()
assert response["status"] == "115"
# 安卓系统,上报idfa_md5
def test_idfa_md5():
data[0]["device_info"]["idfa_md5"] = "8e488a40a17aed2f6752f51382a4eafc"
response = send_request()
assert response["status"] == "115"
# 安卓系统,上报idfv
def test_idfv():
data[0]["device_info"]["idfv"] = "3DEA635F-B24F-434B-833F-4ED028FEAEEF"
response = send_request()
assert response["status"] == "115"
# 安卓系统,上报idfv_md5
def test_idfv_md5():
data[0]["device_info"]["idfv_md5"] = "8e488a40a17aed2f6752f51382a4eafc"
response = send_request()
assert response["status"] == "115"
# imei1为空
def test_imei1_empty():
data[0]["device_info"]["imei1"] = ""
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "0"
# imei1长度超长
def test_imei1__illegal_length():
data[0]["device_info"]["imei1"] = chaochang
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "128"
# imei1_md5为空
def test_imei1_md5_empty():
data[0]["device_info"]["imei1_md5"] = ""
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "0"
# imei1_md5长度超长
def test_imei1_md5_illegal_length():
data[0]["device_info"]["imei1_md5"] = cc612
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "129"
# imei2为空
def test_imei2_empty():
data[0]["device_info"]["imei2"] = ""
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "0"
# imei2长度超长
def test_imei2_illegal_length():
data[0]["device_info"]["imei2"] = chaochang
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "130"
# imei2_md5为空
def test_imei2_md5_empty():
data[0]["device_info"]["imei2_md5"] = ""
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "0"
# imei2_md5长度超长
def test_imei2_md5_illegal_length():
data[0]["device_info"]["imei2_md5"] = cc612
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "131"
# gaid为空
def test_gaid_empty():
data[0]["device_info"]["gaid"] = ""
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "0"
# gaid长度超长
def test_imei2__illegal_length():
data[0]["device_info"]["gaid"] = chaochang
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "132"
# gaid_md5为空
def test_gaid_md5_empty():
data[0]["device_info"]["gaid_md5"] = ""
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "0"
# gaid_md5长度超长
def test_imei2_md5_illegal_length():
data[0]["device_info"]["gaid_md5"] = cc612
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "133"
# mac为空
def test_mac_empty():
data[0]["device_info"]["mac"] = ""
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "0"
# mac长度超长
def test_mac__illegal_length():
data[0]["device_info"]["mac"] = chaochang
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "134"
# mac_md5为空
def test_mac_md5_empty():
data[0]["device_info"]["mac_md5"] = ""
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "0"
# mac_md5长度超长
def test_mac_md5_illegal_length():
data[0]["device_info"]["mac_md5"] = cc612
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "135"
# android_id为空,android_id_md5不为空
def test_android_id_empty():
data[0]["device_info"]["android_id"] = ""
data[0]["device_info"]["android_id_md5"] = "9120163167c05aed85f30bf88495bd89"
data[0]["device_info"]["device_id"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
data[0]["device_info"]["device_id_type"] = "oaid"
data[0]["device_info"]["oaid"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
response = send_request()
assert response["status"] == "0"
# android_id长度超长
def test_android_id__illegal_length():
data[0]["device_info"]["android_id"] = chaochang
data[0]["device_info"]["android_id_md5"] = "9120163167c05aed85f30bf88495bd89"
data[0]["device_info"]["device_id"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
data[0]["device_info"]["device_id_type"] = "oaid"
data[0]["device_info"]["oaid"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
response = send_request()
assert response["status"] == "136"
# android_id为空,android_id_md5为空
def test_android_id_md5__empty():
data[0]["device_info"]["android_id"] = ''
data[0]["device_info"]["android_id_md5"] = ""
data[0]["device_info"]["device_id"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
data[0]["device_info"]["device_id_type"] = "oaid"
data[0]["device_info"]["oaid"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
response = send_request()
assert response["status"] == "136"
# android_id_md5长度超长
def test_android_id_illegal_length():
data[0]["device_info"]["android_id"] = "7564324234234322"
data[0]["device_info"]["android_id_md5"] = chaochang
data[0]["device_info"]["device_id"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
data[0]["device_info"]["device_id_type"] = "oaid"
data[0]["device_info"]["oaid"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
response = send_request()
assert response["status"] == "136"
# *******************************修改了需求,修改为:移除device_id与设备id的一致性校验。例如device_id_type=oaid时,不校验device_id与oaid是否一致***************************
# device_id与device_id_type不一致
def test_device_id1():
data[0]["device_info"]["android_id"] = "7564324234234322"
data[0]["device_info"]["android_id_md5"] = "66bfc3658fc8766d826114bf4c2320b7"
data[0]["device_info"]["device_id"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["oaid"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
response = send_request()
assert response["status"] == "0"
# device_id超长
def test_device_id_illegal_length():
data[0]["device_info"]["android_id"] = "7564324234234322"
data[0]["device_info"]["android_id_md5"] = "66bfc3658fc8766d826114bf4c2320b7"
data[0]["device_info"]["device_id"] = cc612
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["oaid"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
response = send_request()
assert response["status"] == "137"
# device_id为空,device_id_md5也为空
def test_device_id_empty1():
data[0]["device_info"]["device_id"] = ''
data[0]["device_info"]["device_id_md5"] = ''
response = send_request()
assert response["status"] == "137"
# device_id_type为空
def test_device_id_type_empty2():
data[0]["device_info"]["device_id_type"] = ''
response = send_request()
assert response["status"] == "138"
# device_id为空,device_id_md5不为空
def test_device_idmd5_empty():
data[0]["device_info"]["device_id"] = ''
data[0]["device_info"]["device_id_md5"] = '4f71f3a43123b1538e93e8c0b9773d06'
data[0]["device_info"]["device_id_md5_type"] = 'oaid_md5'
data[0]["device_info"]['oaid_md5'] = '4f71f3a43123b1538e93e8c0b9773d06'
response = send_request()
assert response["status"] == "0"
# device_id_type是文档中不存在的值
def test_device_id3():
data[0]["device_info"]["android_id"] = "7564324234234322"
data[0]["device_info"]["android_id_md5"] = "66bfc3658fc8766d826114bf4c2320b7"
data[0]["device_info"]["device_id"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
data[0]["device_info"]["device_id_type"] = "qqq"
data[0]["device_info"]["oaid"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
response = send_request()
assert response["status"] == "0"
# device_id_type长度超长
def test_device_id_type_illegal_length():
data[0]["device_info"]["device_id_type"] = chaochang
response = send_request()
assert response["status"] == "138"
# device_id_md5_type为空,device_id_md5有值
def test_device_id_md5_type_empty():
data[0]["device_info"]["device_id"] = ''
data[0]["device_info"]["device_id_md5"] = '4f71f3a43123b1538e93e8c0b9773d06'
data[0]["device_info"]["device_id_md5_type"] = ''
data[0]["device_info"]['oaid_md5'] = '4f71f3a43123b1538e93e8c0b9773d06'
response = send_request()
assert response["status"] == "139"
# device_id_md5_type为任意字符,device_id_md5有值
def test_device_id_md5_type2():
data[0]["device_info"]["device_id"] = ''
data[0]["device_info"]["device_id_md5"] = '4f71f3a43123b1538e93e8c0b9773d06'
data[0]["device_info"]["device_id_md5_type"] = 'aaa'
data[0]["device_info"]['oaid_md5'] = '4f71f3a43123b1538e93e8c0b9773d06'
response = send_request()
assert response["status"] == "0"
# device_id_md5与device_id_md5_type不一致
def test_device_id_md5_type3():
data[0]["device_info"]["device_id"] = ''
data[0]["device_info"]["device_id_md5"] = '4f71f3a43123b1538e93e8c0b9773d06'
data[0]["device_info"]["device_id_md5_type"] = 'android_id'
data[0]["device_info"]['oaid_md5'] = '4f71f3a43123b1538e93e8c0b9773d06'
response = send_request()
assert response["status"] == "0"
# ------------------------------事件信息----------------------
# event_info为空
def test_event_info():
data[0]["event_info"] = ''
response = send_request()
assert response["status"] == "142"
# eevent_name为空
def test_event_info():
data[0]["event_info"]['event_name'] = ''
response = send_request()
assert response["status"] == "143"
# event_type为preset
def test_event_name1():
newList = ['install', 'startup', 'register', 'login', 'order', 'purchase',
'adimpression', 'adclick', '222', 'wwqeWEW', 'We2_32e']
for event in newList:
data[0]["event_info"]['event_name'] = event
data[0]["event_info"]['event_type'] = 'preset'
response = send_request()
assert response["status"] == "143"
# event_type为custom
def test_event_name2():
# lst = []
newList = ['222', 'wwqeWEW', 'We2_32e']
for event in newList:
data[0]["event_info"]['event_name'] = event
data[0]["event_info"]['event_type'] = "custom"
response = send_request()
assert response["status"] == "0"
# event_type为preset,event为自定义事件
def test_event_name3():
# lst = []
newList = ['222', 'wwqeWEW', 'We2_32e']
for event in newList:
data[0]["event_info"]['event_name'] = event
data[0]["event_info"]['event_type'] = "preset"
response = send_request()
assert response["status"] == "143"
# 自定义事件,包含特殊字符(非名称限制数字、大小写字符、下划线)
def test_event_name4():
# lst = []
newList = ['@¥@@#¥#@¥', '2321==--=', 'We*&*(&']
for event in newList:
data[0]["event_info"]['event_name'] = event
data[0]["event_info"]['event_type'] = "custom"
response = send_request()
assert response["status"] == "143"
# event_name超长
def test_event_name5():
data[0]["event_info"]['event_name'] = chaochang
response = send_request()
assert response["status"] == "143"
# event_type为custom,event_name为大写install
def test_event_name7():
data[0]["event_info"]['event_name'] = "INSTALL"
data[0]["event_info"]['event_type'] = "custom"
response = send_request()
assert response["status"] == "0"
# event_type为custom,event_name为preset中的固定参数
def test_event_name7():
newList = ['install', 'startup', 'register', 'login', 'order', 'purchase',
'adimpression', 'adclick']
for event in newList:
data[0]["event_info"]['event_name'] = event
data[0]["event_info"]['event_type'] = "custom"
response = send_request()
assert response["status"] == "143"
# event_type为非固定的值
def test_event_type():
data[0]["event_info"]['event_type'] = '123'
response = send_request()
assert response["status"] == "144"
# event_type为空
def test_event_type():
data[0]["event_info"]['event_type'] = ''
response = send_request()
assert response["status"] == "144"
# event_data为空
def test_event_data():
data[0]["event_info"]["event_data"] = ""
response = send_request()
assert response["status"] == "145"
# user_id为空
def test_user_id1():
data[0]["event_info"]["event_data"]['user_id'] = ""
response = send_request()
assert response["status"] == "146"
# user_id超长
def test_user_id2():
data[0]["event_info"]["event_data"]['user_id'] = chaochang
response = send_request()
assert response["status"] == "146"
# 事件为install时,user_id为-1
def test_user_id3():
data[0]["event_info"]["event_data"]['user_id'] = "-1"
data[0]['event_info']['event_name'] = 'install'
response = send_request()
assert response["status"] == "0"
# 事件为startup时,user_id为-1
def test_user_id4():
data[0]["event_info"]["event_data"]['user_id'] = "-1"
data[0]['event_info']['event_name'] = 'startup'
response = send_request()
assert response["status"] == "0"
# register_type超长
def test_register_type1():
data[0]["event_info"]["event_data"]['register_type'] = chaochang
response = send_request()
assert response["status"] == "147"
# event_name为register,register_type为空
def test_register_type2():
data[0]["event_info"]["event_data"]['register_type'] = ""
data[0]['event_info']['event_name'] = 'register'
response = send_request()
assert response["status"] == "147"
# event_name为register,register_type不为空
def test_register_type3():
data[0]["event_info"]["event_data"]['register_type'] = "WeChat"
data[0]['event_info']['event_name'] = 'register'
response = send_request()
assert response["status"] == "0"
# event_name为非register,register_type为空
def test_register_type4():
newList = ['install', 'startup', 'login', 'order', 'purchase',
'adimpression', 'adclick']
for event in newList:
data[0]["event_info"]["event_data"]['register_type'] = ""
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "0"
# event_name为非register,register_type不为空
def test_register_type5():
newList = ['install', 'startup', 'login', 'order', 'purchase',
'adimpression', 'adclick']
for event in newList:
data[0]["event_info"]["event_data"]['register_type'] = "WeChat"
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "0"
# login_type超长
def test_login_type1():
data[0]["event_info"]["event_data"]['login_type'] = chaochang
response = send_request()
assert response["status"] == "148"
# event_name为login,login_type为空
def test_login_type2():
data[0]["event_info"]["event_data"]['login_type'] = ""
data[0]['event_info']['event_name'] = 'login'
response = send_request()
assert response["status"] == "148"
# event_name为login,login_type不为空
def test_login_type3():
data[0]["event_info"]["event_data"]['login_type'] = "WeChat"
data[0]['event_info']['event_name'] = 'login'
response = send_request()
assert response["status"] == "0"
# event_name为非login,login_type为空
def test_login_type4():
newList = ['install', 'startup' 'order', 'purchase',
'adimpression', 'adclick']
for event in newList:
data[0]["event_info"]["event_data"]['login_type'] = ""
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "0"
# event_name为非login,login_type不为空
def test_login_type5():
newList = ['install', 'startup', 'order', 'purchase',
'adimpression', 'adclick']
for event in newList:
data[0]["event_info"]["event_data"]['login_type'] = "WeChat"
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "0"
# order_id超长
def test_order_id1():
data[0]["event_info"]["event_data"]['order_id'] = chaochang
response = send_request()
assert response["status"] == "149"
# event_name为order,order_id为空
def test_order_id2():
data[0]["event_info"]["event_data"]['order_id'] = ""
data[0]['event_info']['event_name'] = 'order'
response = send_request()
assert response["status"] == "149"
# event_name为order,order_id不为空
def test_order_id3():
data[0]["event_info"]["event_data"]['order_id'] = "2341242342676398724"
data[0]['event_info']['event_name'] = 'order'
response = send_request()
assert response["status"] == "0"
# event_name为非order和purchase,order_id为空
def test_order_id4():
newList = ['install', 'startup', 'register', 'login', 'adimpression', 'adclick']
for event in newList:
data[0]["event_info"]["event_data"]['order_id'] = ""
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "0"
# event_name为非order和purchase,order_id不为空
def test_order_id5():
newList = ['install', 'startup', 'register', 'login', 'adimpression', 'adclick']
for event in newList:
data[0]["event_info"]["event_data"]['order_id'] = "2341242342676398724"
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "0"
# event_name为purchase,order_id为空
def test_order_id6():
data[0]["event_info"]["event_data"]['order_id'] = ""
data[0]['event_info']['event_name'] = 'purchase'
response = send_request()
assert response["status"] == "149"
# order_amount非0以及正整数
def test_order_amount1():
data[0]["event_info"]["event_data"]['order_amount'] = "23.232131"
response = send_request()
assert response["status"] == "150"
# event_name为order,order_amount为空
def test_order_amount2():
data[0]["event_info"]["event_data"]['order_amount'] = ""
data[0]['event_info']['event_name'] = 'order'
response = send_request()
assert response["status"] == "150"
# event_name为order,order_amount不为空
def test_order_amount3():
data[0]["event_info"]["event_data"]['order_amount'] = "0"
data[0]['event_info']['event_name'] = 'order'
response = send_request()
assert response["status"] == "0"
# event_name为非order和purchase,order_amount为空
def test_order_amount4():
newList = ['install', 'startup', 'register', 'login', 'adimpression', 'adclick']
for event in newList:
data[0]["event_info"]["event_data"]['order_amount'] = ""
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "0"
# event_name为非order和purchase,order_amount不为空
def test_order_amount5():
newList = ['install', 'startup', 'register', 'login', 'adimpression', 'adclick']
for event in newList:
data[0]["event_info"]["event_data"]['order_amount'] = "2341242342676398724"
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "0"
# event_name为purchase,order_amount为空
def test_order_amount6():
data[0]["event_info"]["event_data"]['order_amount'] = ""
data[0]['event_info']['event_name'] = 'purchase'
response = send_request()
assert response["status"] == "150"
# event_name为purchase,order_amount不为空
def test_order_amount7():
data[0]["event_info"]["event_data"]['order_amount'] = "0"
data[0]['event_info']['event_name'] = 'purchase'
response = send_request()
assert response["status"] == "0"
# event_name为purchase,currency_type为空
def test_currency_type1():
data[0]['event_info']['event_data']['currency_type'] = ''
data[0]['event_info']['event_name'] = 'purchase'
response = send_request()
assert response["status"] == "151"
# event_name为purchase,currency_type不为空
def test_currency_type2():
data[0]['event_info']['event_data']['currency_type'] = 'CNY'
data[0]['event_info']['event_name'] = 'purchase'
response = send_request()
assert response["status"] == "0"
# event_name为purchase,currency_type为2个字符
def test_currency_type3():
data[0]['event_info']['event_data']['currency_type'] = 'aa'
data[0]['event_info']['event_name'] = 'purchase'
response = send_request()
assert response["status"] == "151"
# event_name为非purchase,currency_type为空
def test__currency_type4():
newList = ['install', 'startup', 'register', 'login', 'adimpression', 'adclick']
for event in newList:
data[0]["event_info"]["event_data"]['currency_type'] = ""
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "0"
# event_name为purchase,purchase_type为空
def test_purchase_type1():
data[0]['event_info']['event_data']['purchase_type'] = ''
data[0]['event_info']['event_name'] = 'purchase'
response = send_request()
assert response["status"] == "152"
# event_name为purchase,purchase_type不为空
def test_purchase_type2():
data[0]['event_info']['event_data']['purchase_type'] = 'Alipay'
data[0]['event_info']['event_name'] = 'purchase'
response = send_request()
assert response["status"] == "0"
# event_name为非purchase,purchase_type为空
def test_purchase_type3():
newList = ['install', 'startup', 'register', 'login', 'adimpression', 'adclick']
for event in newList:
data[0]["event_info"]["event_data"]['purchase_type'] = ""
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "0"
# purchase_type超长
def test_purchase_type4():
data[0]['event_info']['event_data']['purchase_type'] = chaochang
data[0]['event_info']['event_name'] = 'purchase'
response = send_request()
assert response["status"] == "152"
# event_name为adimpression和adclick,ad_platform为空
def test_ad_platform1():
newlist = ["adimpression", "adclick"]
for event in newlist:
data[0]["event_info"]['event_data']['ad_platform'] = ''
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "153"
# event_name为adimpression和adclick,ad_platform不为空
def test_ad_platform2():
newlist = ["adimpression", "adclick"]
for event in newlist:
data[0]["event_info"]['event_data']['ad_platform'] = 'csj'
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "0"
# # event_name非adimpression和adclick,ad_platform为空
def test_ad_platform3():
newlist = ['install', 'startup', 'register', 'login', 'order', 'purchase']
for event in newlist:
data[0]["event_info"]['event_data']['ad_platform'] = ''
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "0"
# # event_name非adimpression和adclick,ad_platform不为空
def test_ad_platform4():
newlist = ['install', 'startup', 'register', 'login', 'order', 'purchase']
for event in newlist:
data[0]["event_info"]['event_data']['ad_platform'] = 'ylh'
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "0"
# ad_platform超长
def test_ad_platform5():
data[0]["event_info"]['event_data']['ad_platform'] = chaochang
data[0]['event_info']['event_name'] = "adclick"
response = send_request()
assert response["status"] == "153"
# # event_name为adimpression和adclick,placement_type为空
def test_placement_type1():
newlist = ["adimpression", "adclick"]
for event in newlist:
data[0]["event_info"]['event_data']['placement_type'] = ''
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "154"
# # event_name为adimpression和adclick,placement_type不为空
def test_placement_type2():
newlist = ["adimpression", "adclick"]
for event in newlist:
data[0]["event_info"]['event_data']['placement_type'] = 'interstitial'
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "0"
# # event_name非adimpression和adclick,placement_type为空
def test_placement_type3():
newlist = ['install', 'startup', 'register', 'login', 'order', 'purchase']
for event in newlist:
data[0]["event_info"]['event_data']['placement_type'] = ''
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "0"
# # event_name非adimpression和adclick,placement_type不为空
def test_placement_type4():
newlist = ['install', 'startup', 'register', 'login', 'order', 'purchase']
for event in newlist:
data[0]["event_info"]['event_data']['placement_type'] = 'interstitial'
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "0"
# # placement_type超长
def test_placement_type5():
data[0]["event_info"]['event_data']['placement_type'] = chaochang
data[0]['event_info']['event_name'] = "adclick"
response = send_request()
assert response["status"] == "154"
# # event_name为adimpression和adclick,placement_id为空
def test_placement_id1():
newlist = ["adimpression", "adclick"]
for event in newlist:
data[0]["event_info"]['event_data']['placement_id'] = ''
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "155"
# # event_name为adimpression和adclick,placement_id不为空
def test_placement_id2():
newlist = ["adimpression", "adclick"]
for event in newlist:
data[0]["event_info"]['event_data']['placement_id'] = '765453434'
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "0"
# # event_name非adimpression和adclick,placement_id为空
def test_placement_id3():
newlist = ['install', 'startup', 'register', 'login', 'order', 'purchase']
for event in newlist:
data[0]["event_info"]['event_data']['placement_id'] = ''
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "0"
# # event_name非adimpression和adclick,placement_id不为空
def test_placement_id4():
newlist = ['install', 'startup', 'register', 'login', 'order', 'purchase']
for event in newlist:
data[0]["event_info"]['event_data']['placement_id'] = '98765434567654'
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "0"
# # placement_id超长
def test_placement_type5():
data[0]["event_info"]['event_data']['placement_id'] = chaochang
data[0]['event_info']['event_name'] = "adclick"
response = send_request()
assert response["status"] == "155"
# event_name为adimpression,ad_price为空
def test_ad_price1():
data[0]["event_info"]['event_data']['ad_price'] = ''
data[0]['event_info']['event_name'] = 'adimpression'
response = send_request()
assert response["status"] == "156"
# event_name为adimpression,ad_price不为空
def test_ad_price2():
data[0]["event_info"]['event_data']['ad_price'] = '765453434'
data[0]['event_info']['event_name'] = 'adimpression'
response = send_request()
assert response["status"] == "0"
# event_name非adimpression,ad_price为空
def test_ad_price3():
newlist = ['install', 'startup', 'register', 'login', 'order', 'purchase', 'adclick']
for event in newlist:
data[0]["event_info"]['event_data']['ad_price'] = ''
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "0"
# event_name非adimpression,ad_price不为空
def test_ad_price4():
newlist = ['install', 'startup', 'register', 'login', 'order', 'purchase', 'adclick']
for event in newlist:
data[0]["event_info"]['event_data']['ad_price'] = '98765434567654'
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "0"
# ad_price超长
def test_ad_price5():
data[0]["event_info"]['event_data']['ad_price'] = chaochang
data[0]['event_info']['event_name'] = "adimpression"
response = send_request()
assert response["status"] == "156"
# event_name为adimpression,ad_price_currency_type为空
def test_ad_price_currency_type1():
data[0]["event_info"]['event_data']['ad_price_currency_type'] = ''
data[0]['event_info']['event_name'] = 'adimpression'
response = send_request()
assert response["status"] == "157"
# event_name为adimpression,ad_price_currency_type不为空
def test_ad_price_currency_type2():
data[0]["event_info"]['event_data']['ad_price_currency_type'] = 'CNY'
data[0]['event_info']['event_name'] = 'adimpression'
response = send_request()
assert response["status"] == "0"
# event_name非adimpression,ad_price_currency_type为空
def test_ad_price_currency_type3():
newlist = ['install', 'startup', 'register', 'login', 'order', 'purchase', 'adclick']
for event in newlist:
data[0]["event_info"]['event_data']['ad_price_currency_type'] = ''
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "0"
# event_name非adimpression,ad_price_currency_type不为空
def test_ad_price_currency_type4():
newlist = ['install', 'startup', 'register', 'login', 'order', 'purchase', 'adclick']
for event in newlist:
data[0]["event_info"]['event_data']['ad_price_currency_type'] = 'CNY'
data[0]['event_info']['event_name'] = event
response = send_request()
assert response["status"] == "0"
# ad_price_currency_type非三个字符
def test_ad_price_currency_type5():
data[0]["event_info"]['event_data']['ad_price_currency_type'] = "0"
data[0]['event_info']['event_name'] = "adimpression"
response = send_request()
assert response["status"] == "157"
# is_rendered为空
def test_is_rendered1():
data[0]['event_info']['event_data']['is_rendered'] = ''
response = send_request()
assert response["status"] == "0"
# is_rendered为1
def test_is_rendered2():
data[0]['event_info']['event_data']['is_rendered'] = '1'
response = send_request()
assert response["status"] == "0"
# is_rendered为0
def test_is_rendered3():
data[0]['event_info']['event_data']['is_rendered'] = '0'
response = send_request()
assert response["status"] == "0"
# is_rendered为其他字符
def test_is_rendered3():
data[0]['event_info']['event_data']['is_rendered'] = 'qqq'
response = send_request()
assert response["status"] == "158"
# custom_params为空
def test_custom_params():
data[0]['event_info']['custom_params'] = ''
response = send_request()
assert response["status"] == "0"
# custom_params下有特殊字符(key限制数字、大小写字符、下划线)
def test_custom_params2():
data[0]['event_info']['custom_params']["@#¥@#¥#@"] = '@#2321321@#¥#@'
response = send_request()
assert response["status"] == "160"
# key超过32位
def test_custom_params3():
data[0]['event_info']['custom_params'][
"3287327823728372837821378123dwdgyugggyygdwyuyuygdgyudddddydgdde"] = 'key超过32位'
response = send_request()
assert response["status"] == "160"
# value超过64位
def test_custom_params3():
data[0]['event_info']['custom_params']["key"] = chaochang
response = send_request()
assert response["status"] == "161"
# 事件自定义参数嵌套,内含参数超过10项
def test_custom_params3():
data[0]['event_info']['custom_params']["key1"] = "111"
data[0]['event_info']['custom_params']["key2"] = "222"
data[0]['event_info']['custom_params']["key3"] = "333"
data[0]['event_info']['custom_params']["key4"] = "444"
data[0]['event_info']['custom_params']["key5"] = "555"
data[0]['event_info']['custom_params']["key6"] = "222"
data[0]['event_info']['custom_params']["key7"] = "222"
data[0]['event_info']['custom_params']["key8"] = "222"
data[0]['event_info']['custom_params']["key9"] = "222"
data[0]['event_info']['custom_params']["key10"] = "222"
data[0]['event_info']['custom_params']["key11"] = "222"
response = send_request()
assert response["status"] == "162"
# 事件自定义参数嵌套,内含参数等于10项
def test_custom_params3():
data[0]['event_info']['custom_params']["key1"] = "111"
data[0]['event_info']['custom_params']["key2"] = "222"
data[0]['event_info']['custom_params']["key3"] = "333"
data[0]['event_info']['custom_params']["key4"] = "444"
data[0]['event_info']['custom_params']["key5"] = "555"
data[0]['event_info']['custom_params']["key6"] = "222"
data[0]['event_info']['custom_params']["key7"] = "222"
data[0]['event_info']['custom_params']["key8"] = "222"
data[0]['event_info']['custom_params']["key9"] = "222"
data[0]['event_info']['custom_params']["key10"] = "222"
response = send_request()
assert response["status"] == "0"
if __name__ == '__main__':
pytest.main()
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)
import requests
import json
import time
import random
headers = {'Content-Type': 'application/json'}
#线上环境
URL = 'http://log.trackingio.com/receive/tkio/'
# URL = 'http://172.31.21.207:8080/receive/tkio/'
URL_batch = 'http://172.31.21.207:8080/receive/batch'
#时间戳
current_time_13 = int(round(time.time() * 1000))
when = '2019-12-23 15:10:20'
#日期
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 = '86.67'
# 填充广告在变现平台的广告位ID
adid = '532424234324343423432'
# 填充广告的变现平台,例如穿山甲(csj)、优量汇(ylh)、百青藤(bqt)等
adPlatform = '232321321321321'
class allEvent:
# 激活
def installUpload(self, i,IP,appkey):
s = json.dumps({
"appid":appkey,
"context":{
"_campaignid":'default',
# "_deviceid":i,
"_imei": i,
# "_androidid":"fverr43tfv34erdcd23e",
# "_imei2":"QQQ345654345",
# "_meid": "A00000A3585436",
"_ip": IP,
# "_ipv6": i,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op': op,
'_timestamp':current_time_13,
'_oaid': '754b3e3e-a274-ed22-cebf-2b6dddfc28b9'
# '_mac':"565354131606"
},
'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
#
'ds': ds,
'who': 'lxx_test'
})
try:
p = requests.post(url=URL+'install',data=s,headers=headers,timeout=5)
print("激活:"+p.text)
except Exception as err:
print(err)
#今日头条归因
def formevent(self, i, IP, appkey):
s = json.dumps({
"appid": appkey,
"context": {
"_campaignid": 'default',
"_deviceid": i,
"_imei": i,
# "_imei2":i,
# "_oaid":i,
# "_meid":i,
"_androidid": "2342312",
"_ip": IP,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op': op,
'_timestamp': "3212123333"
},
# 'when': when,
# time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL+'form', 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
},
'when':time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
'ds':ds,
'who':'lxx_test'
})
p = requests.post(url=URL+'register',data=s,headers=headers,timeout=5)
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,
"_lib_version": "1.4.9",
},
'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL+'startup', data=s, headers=headers, timeout=10)
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': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
'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':"14931763749448302438",
'_paymenttype': paymenttype,
'_currencytype': currencytype,
'_currencyamount': currencyamount,
},
'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
'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':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 ziding_event(self,i,IP,appkey,event):
s = json.dumps({
"what": event,
"appType": "",
"appid": appkey,
"context": {
"_campaignid": "_default_",
"_rydevicetype": "iPhone",
"_ip": IP,
"_ryosversion": "13.0",
"_manufacturer": "苹果",
"frequency": "0.000",
"_app_version": "2.0",
"_isreyundefaultevent": "1",
"_deviceid": i,
"_device_gps": "unknown",
"_jbk": "0",
"_timestamp": "1565941809351",
"_idfa": i,
"_idfv": "6501CAF7-B6FF-469B-AA42-852B89879E74",
"_lib_version": "1.4.2",
"_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": "iPhone 7 Plus",
"_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": ds,
"who": "unknown"
})
p = requests.post(url=URL+'event', data=s, headers=headers, timeout=5)
print("自定义:"+p.text)
# 广告展示
def adshow(self, i, IP, appkey):
s = json.dumps({
"appid": appkey,
"context": {
'_adPlatform': adPlatform,
'_adId': adid,
"_campaignid": 'default',
"_deviceid": i,
"_imei": i,
# "_idfa": '75463565745634546',
"_androidid": "424653325643",
# "_imei2":"324323AAAA",
# "_meid": "CCC324323",
"_ip": IP,
# "_ipv6": i,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op': op,
'_timestamp': current_time_13,
'_oaid': '999b6e3e-a274-ed22-cebf-2b6dddfc29b7'
# '_mac':"565354131606"
},
'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
#
'ds': ds,
'who': 'lxx_test'
})
try:
p = requests.post(url=URL + 'adshow', data=s, headers=headers, timeout=5)
print("广告展示:" + p.text)
except Exception as err:
print(err)
# 广告点击
def adclick(self, i, IP, appkey):
s = json.dumps({
"appid": appkey,
"context": {
'_adPlatform': adPlatform,
'_adId': adid,
"_campaignid": 'default',
"_deviceid": i,
"_imei": i,
# "_idfa": '75463565745634546',
"_androidid": "424653325643",
# "_imei2":"324323AAAA",
# "_meid": "CCC324323",
"_ip": IP,
# "_ipv6": i,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op': op,
'_timestamp': current_time_13,
'_oaid': '999b6e3e-a274-ed22-cebf-2b6dddfc29b7'
# '_mac':"565354131606"
},
'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
'ds': ds,
'who': 'lxx_test'
})
try:
p = requests.post(url=URL + 'adclick', data=s, headers=headers, timeout=5)
print("广告点击:" + p.text)
except Exception as err:
print(err)
# 批量上传数据接口
def batchUpload(self, i, appkey):
s = json.dumps(
{"from": "tkio", "data": [
{"appid": appkey, "when": when, "what": "startup",
"context": {"_manufacturer": "苹果", "_carrier": "unknown", "_lats": "1", "_jbk": "1",
"_app_version": "1.0", "_timestamp": current_time_13, "_create_timestamp":current_time_13,
"_rydevicetype": "iPhone", "_deviceid": i,
"_tz": "+8", "_resolution": "667*375", "_pkgname": "com.reyun.testapp",
"_mac": "80:E6:50:12:4C:DE", "_network_type": "NO CONNECT", "_istf": "8",
"_idfv": "27CCEE6E-5ED1-47EC-B486-81F9129C05D3", "_ryosversion": "11.2",
"_model": "iPhone Simulator", "_lib_version": "2.0.0", "_ryos": "ios",
"_campaignid": "channelid", "_idfa": i},
"who": "unknown"},
{"appid": appkey, "when": "2018-01-08 11:22:42", "what": "register",
"context": {"_manufacturer": "苹果", "_carrier": "unknown", "_lats": "1", "_jbk": "1",
"_app_version": "1.0", "_timestamp": current_time_13, "_create_timestamp":current_time_13,
"_rydevicetype": "iPhone", "_deviceid": i,
"_tz": "+8", "_resolution": "667*375", "_pkgname": "com.reyun.testapp",
"_mac": "80:E6:50:12:4C:DE", "_network_type": "NO CONNECT", "_istf": "8",
"_idfv": "27CCEE6E-5ED1-47EC-B486-81F9129C05D3", "_ryosversion": "11.2",
"_model": "iPhone Simulator", "_lib_version": "2.0.0", "_ryos": "ios",
"_campaignid": "channelid", "_idfa": i},
"who": "acc1"},
]}
)
p = requests.post(url=URL_batch, data=s, headers=headers, timeout=5)
print("批量" + p.text)
\ No newline at end of file
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
from online_ios_event.ios_script import allEvent
import random
import requests
import socket
import struct
import time
#向短链发送点击数据
#常规渠道
URL = 'http://uri6.com/tkio/IFFvqya'
s = 0
w = 0
appkey = '0d401839250deff23daf62fd49a444cb'
for _ in range(1):
#随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '3F88CD9A-D90B-4448-BFF8-18B9A223B204'
#随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
try:
parms = {
'idfa': i,
# 'muid': '55d08b4cb7103ad93f0f432da10881de52d9e087',
'ip': ip,
# 'cid': '2093'
}
#timeout可以超时四秒
p = requests.get(url=URL,params=parms,timeout=4)
time.sleep(7)
allEvent().installUpload(i,ip,appkey)
print('success:',s)
print('idfa:',i)
print('ip:',ip)
s=s+1
except requests.exceptions.RequestException:
print('wrong:',w)
print('idfa:', i)
print('ip', ip)
w=w+1
continue
import requests
import json
import time
import random
headers = {'Content-Type': 'application/json'}
URL = 'http://log.reyun.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,
"_idfa":i,
"_ip":IP,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op':op,
#'_gaid': i,
'_timestamp':current_time_13
},
'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 registerEvent(self,i,IP,appkey):
s = json.dumps({
'what':'register',
'appid':appkey,
'context':{
'_deviceid':i,
"_idfa":i,
'_ip':IP,
'_timestamp': current_time_13
},
'when':when,
'ds':ds,
'who':'lxx_test'
})
p = requests.post(url=URL,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,
"_idfa":i,
'_ip': IP,
'_timestamp': current_time_13
},
'when': when,
'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL, 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,
"_idfa":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 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,
"_idfa":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,
"_idfa":i,
'_ip': IP,
#识别是否为自定义事件,默认传1
'_isreyundefaultevent':'1'
},
'when': when,
'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL, data=s, headers=headers, timeout=5)
print(p.text)
# 启动
def startupEvent(self, i, IP, appkey):
s = json.dumps({
'what': 'startup',
'appid': appkey,
'context': {
'_deviceid': i,
'_idfa': i,
'_ip': IP,
'_timestamp': current_time_13
},
'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)
from online_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 = '53424564324564342'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
#ip = '70.186.192.130'
allEvent().installUpload(i,ip,appkey)
\ No newline at end of file
from online_ios_event.ios_script import allEvent
import socket
import struct
import random
#ios常规渠道登陆
appkey = '120d66f57a94b73b735626c5a1e6e25a'
for _ in range(10):
# 随机生成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().loginEvent(i,ip,appkey)
\ No newline at end of file
from online_ios_event.ios_script import allEvent
import struct
import socket
import random
#ios常规渠道付费
appkey = 'daa79fc0f7624c306f48dee6fece83ca'
for _ in range(1):
# 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '191349301062'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
allEvent().orderEvent(i,ip,appkey)
\ No newline at end of file
from online_ios_event.ios_script import allEvent
import struct
import socket
import random
#ios常规渠道注册
appkey = '66bf9f5679679c01001e357ec33afef3'
for _ in range(10):
# 随机生成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 online_android_event.android_script import allEvent
import struct
import socket
import random
#启动
appkey = '8a2e5a4f171c261ea8f1601c31eed83e'
for _ in range(1):
# 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '757969873251'
# 随机生成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_ios_event.ios_script import allEvent
import socket
import struct
import random
#ios自定义事件
event = 'event_10'
appkey = '66bf9f5679679c01001e357ec33afef3'
for _ in range(10):
# 随机生成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().ziding_event(i,ip,appkey,event)
\ No newline at end of file
import random
import requests
import socket
import struct
import json
url = 'http://www.trackingio.com/api/ClickMonitor/click'
headers = {
"Content-Type":"application/json",
"Cookie": "lang=zh; sys_domain=www.trackingio.com; NG_TRANSLATE_LANG_KEY=zh_CN; cip=119.57.108.226; clickToken=d2f95f96b4134028a03b3d2e62269307; tkRmdId=1564474426213; Hm_lvt_7899fb5e9a59c7f4cdcbb69d51396b0b=1562751857,1563418405,1564474427; ryioStatus=1; ryioIcon=0; ryioAllowBehavior=true; regFlag=1; ryioRole=0; ryioRedCircle=false; regId=38; regEmail=trackingio%40reyun.com; dataFlag=today; Hm_lpvt_7899fb5e9a59c7f4cdcbb69d51396b0b=1564626658; TOKEN=ff99341d-1c84-4ad3-a907-f485c34aa24f; specialUname=true; ryioActiveStatus=false; ryioIsSuper=true; cookieStartDate=2019-08-01; cookieEndDate=2019-08-01; cookieDateFlag=today; Hm_lvt_3c5292cf6a78c16bc4f8127ca28f6ad5=1562899099,1563244549,1564646979; ryioUid=982; ryioUname=demo%40reyun.com; clickUname=demo%40reyun.com; ryioPastDate=2021-06-07; ryioLastApp=1519; Hm_lpvt_3c5292cf6a78c16bc4f8127ca28f6ad5=1564650143; ryioToken=394c8530-e02b-4258-a8f4-07ad8c0733d8; TOKEN=394c8530-e02b-4258-a8f4-07ad8c0733d8; ryioDemoapk=; selectMenu=dashboard; JSESSIONID=4581C74C49DDC6DA430DAAE49DE7BD4B"
}
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
da = json.dumps({
"menu": "register",
"type": "uv",
"cip": ip,
"email": "",
"totalCount": "200"})
# date = {
# "menu": "register",
# "type": "uv",
# "cip": ip,
# "email": "",
# "totalCount": "200"}
r = requests.post(url,da)
print(r)
import requests
import json
import time
import datetime
import random
from jiami.pdj import encryptorForAES
headers = {'Content-Type': 'application/json',
}
# 'encrypt': '111'
# URL = 'https://log.analysis.com/receive/analysis/'
URL = 'http://log.tkioglobal.com/receive/tkioglobal/'
when = datetime.datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S')
# when = '2020-02-21 15:50:47'
#时间戳
current_time_13 = int(round(time.time() * 1000))
#时间和日期
#日期
ds = time.strftime('%Y-%m-%d', time.localtime(time.time()))
#设备品牌
manufacturer = 'HUAWEI'
#设备系统
ryos = 'Android'
#设备类型
rydevicetype = 'vivox9'
#网络类型
network='wifi'
#分辨率
resolution='1344*750'
#运行商
op ='中国移动'
event = 'event1126'
# 用户名称标识
user_name = 'lxx'
# 用户唯一id(账号id)
user_id = '1232432432'
# 事件引荐来源
referral_from = 'ceshi'
# 付费名称
fufei_name = '付费'
# 任何有关游客下单的数据
checkout_as_guest = '13131232121'
# 付费商品id
content_id = '43123123'
# 流水单id,确保唯一
transactionid = '7843584342332'
# 货币类型,按照国际标准组织ISO4217中规范的3位大写字母,如USD
currencytype = 'CNY'
# 付费金额
currencyamount = '66'
# 搜索结果
results = '搜索结果 dde wae qweqw edwq eqwe qeqw '
# 搜索内容
uri = "ewr csdfsd we ds dd dasd dsa"
# 浏览内容
liulan_name = 'adsdsaadsdasdas'
# 完成教程所花费的时间,单位:秒
duration = '31221'
class allEvent:
# 激活
def installUpload(self, i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"what": "install",
"who": i,
"when":when,
"context": {
"_deviceid": i,
"_androidid": i,
# Google play advertising id
"_gaid":i,
"_mac": "0C:8F:FF:A6:E5:20",
"_ip": IP,
"_ipv6": "unknown",
"_istablet": "phone",
"_tz": "+8",
"_manufacturer": manufacturer,
"_ryos": ryos,
"_ryosversion": "6.0",
"_rydevicetype": "iPhone",
"_model": "DIG-AL00",
"_network_type": network,
"_resolution": resolution,
"_carrier": op,
"_device_gps": '43.4209116508',
"_audio_volume": '9',
"_app_version": "2.0",
"_pkgname": "com.example.reyunsdkdemo",
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": "Android",
"_screen_brightness": "102",
"_lib_version":'1.0'
},
})
s = encryptorForAES(s,JDClass)
p = requests.post(url=URL+'install', data=s, headers=headers, timeout=10)
print("激活:"+p.text)
# print(ds)
# print(s)
# 启动
def startupUpload(self, i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"what": "startup",
"who": i,
"when": when,
"context": {
"_deviceid": i,
"_androidid": i,
# Google play advertising id
"_gaid": i,
"_mac": "0C:8F:FF:A6:E5:20",
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": "6.0",
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": "Android",
"_lib_version": '1.0',
"_tz": '+8'
},
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'startup', data=s, headers=headers, timeout=10)
print("启动:"+p.text)
# print(p.url)
# 注册
def reged(self,i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "reged",
"when":when,
"context":{
"_deviceid": i,
"_androidid": i,
# Google play advertising id
"_gaid": i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": "6.0",
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": "Android",
"_lib_version": '1.0',
"_tz": '+8',
"user_name": user_name,
# 用户唯一id(账号id)
"user_id": user_id,
# 事件引荐来源
"referral_from": referral_from
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'reged', data=s, headers=headers, timeout=10)
print("注册:"+p.text)
#登陆
def login(self,i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "loggedin",
"when":when,
"context":{
"_deviceid": i,
"_androidid": i,
# Google play advertising id
"_gaid": i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": "6.0",
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": "Android",
"_lib_version": '1.0',
"_tz": '+8',
"user_name": user_name,
# 用户唯一id(账号id)
"user_id": user_id,
# 事件引荐来源
"referral_from": referral_from
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'loggedin', data=s, headers=headers, timeout=10)
print("登陆:"+p.text)
# 付费
def payment(self,i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "payment",
"when":when,
"context":{
"_deviceid": i,
"_androidid": i,
# Google play advertising id
"_gaid": i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": "6.0",
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": "Android",
"_lib_version": '1.0',
"_tz": '+8',
# 用户唯一id(账号id)
"user_id": user_id,
"name": fufei_name,
"user_id":user_id,
"checkout_as_guest":checkout_as_guest,
"content_id":content_id,
"_transactionid":transactionid,
"_currencytype":currencytype,
"_currencyamount":currencyamount
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'payment', data=s, headers=headers, timeout=10)
print("付费:"+p.text)
# 订单
def order(self,i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "order",
"context":{
"_deviceid": i,
"_androidid": i,
# Google play advertising id
"_gaid": i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": "6.0",
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": "Android",
"_lib_version": '1.0',
"_tz": '+8',
# 用户唯一id(账号id)
"user_id": user_id,
"name": fufei_name,
"checkout_as_guest":checkout_as_guest,
"content_id":content_id,
"_transactionid":transactionid,
"_currencytype":currencytype,
"_currencyamount":currencyamount
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'order', data=s, headers=headers, timeout=10)
print("订单:"+p.text)
# 订阅
def subscribe(self,i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "subscribe",
"context": {
"_deviceid": i,
"_androidid": i,
# Google play advertising id
"_gaid": i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": "6.0",
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": "Android",
"_lib_version": '1.0',
"_tz": '+8',
# 用户唯一id(账号id)
"user_id": user_id,
"name": fufei_name,
"checkout_as_guest":checkout_as_guest,
"content_id":content_id,
"_transactionid":transactionid,
"_currencytype":currencytype,
"_currencyamount":currencyamount
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'subscribe', data=s, headers=headers, timeout=10)
print("订阅:"+p.text)
# 搜索
def search(self,i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "search",
"when": when,
"context": {
"_deviceid": i,
"_androidid": i,
# Google play advertising id
"_gaid": i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": "6.0",
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": "Android",
"_lib_version": '1.0',
"_tz": '+8',
"uri": uri,
"results": results
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'search', data=s, headers=headers, timeout=10)
print("搜索:"+p.text)
# 统计浏览
def view(self,i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "view",
"when": when,
"context": {
"_deviceid": i,
"_androidid": i,
# Google play advertising id
"_gaid": i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": "6.0",
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": "Android",
"_lib_version": '1.0',
"_tz": '+8',
"user_id": user_id,
"name": liulan_name,
"referral_from": referral_from,
"content_id":content_id
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'view', data=s, headers=headers, timeout=10)
print("浏览:"+p.text)
# 统计统计加入购物车
def addtocart(self,i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "addtocart",
"when": when,
"context": {
"_deviceid": i,
"_androidid": i,
# Google play advertising id
"_gaid": i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": "6.0",
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": "Android",
"_lib_version": '1.0',
"_tz": '+8',
"user_id": user_id,
"name": liulan_name,
"referral_from": referral_from,
"content_id":content_id
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'addtocart', data=s, headers=headers, timeout=10)
print("加入购物车:"+p.text)
# 统计加入愿望清单(收藏)
def addtowishlist(self,i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "addtowishlist",
"when": when,
"context": {
"_deviceid": i,
"_androidid": i,
# Google play advertising id
"_gaid": i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": "6.0",
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": "Android",
"_lib_version": '1.0',
"_tz": '+8',
"user_id": user_id,
"name": liulan_name,
"referral_from": referral_from,
"content_id":content_id
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'addtowishlist', data=s, headers=headers, timeout=10)
print("加入愿望清单:"+p.text)
# 统计完成教程
def tutorialcomplete(self,i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "tutorialcomplete",
"when": when,
"context": {
"_deviceid": i,
"_androidid": i,
# Google play advertising id
"_gaid": i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": "6.0",
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": "Android",
"_lib_version": '1.0',
"_tz": '+8',
"user_id": user_id,
"name": liulan_name,
"duration": duration
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'tutorialcomplete', data=s, headers=headers, timeout=10)
print("完成教程:"+p.text)
# 统计等级达成
def levelcomplete(self, i, IP, appkey, JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "levelcomplete",
"when": when,
"context": {
"_deviceid": i,
"_androidid": i,
# Google play advertising id
"_gaid": i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": "6.0",
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": "Android",
"_lib_version": '1.0',
"_tz": '+8',
"user_id": user_id,
"name": liulan_name,
"duration": duration
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL + 'levelcomplete', data=s, headers=headers, timeout=10)
print("等级达成:"+p.text)
# 统计成就达成
def achievement(self, i, IP, appkey, JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "achievement",
"when": when,
"context": {
"_deviceid": i,
"_androidid": i,
# Google play advertising id
"_gaid": i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": "6.0",
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": "Android",
"_lib_version": '1.0',
"_tz": '+8',
"user_id": user_id,
"name": liulan_name,
"duration": duration
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL + 'achievement', data=s, headers=headers, timeout=10)
print("成就达成:"+p.text)
# 统计广告点击
def adclick(self, i, IP, appkey, JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "adclick",
"when": when,
"context": {
"_deviceid": i,
"_androidid": i,
# Google play advertising id
"_gaid": i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": "6.0",
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": "Android",
"_lib_version": '1.0',
"_tz": '+8',
"ad_type": "激励视频",
"ad_network_name": "广告平台名称",
"placement": "广告位"
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL + 'adclick', data=s, headers=headers, timeout=10)
print("点击广告:"+p.text)
# 统计广告观看
def adview(self, i, IP, appkey, JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "adview",
"when": when,
"context": {
"_deviceid": i,
"_androidid": i,
# Google play advertising id
"_gaid": i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": "6.0",
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": "Android",
"_lib_version": '1.0',
"_tz": '+8',
"ad_type": "激励视频",
"ad_network_name": "广告平台名称",
"placement": "广告位"
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL + 'adview', data=s, headers=headers, timeout=10)
print("广告观看:"+p.text)
# 统计评分
def rating(self, i, IP, appkey, JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "rating",
"when": when,
"context": {
"_deviceid": i,
"_androidid": i,
# Google play advertising id
"_gaid": i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": "6.0",
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": "Android",
"_lib_version": '1.0',
"_tz": '+8',
"rating_value": "30",
"max_rating_value": "89",
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL + 'rating', data=s, headers=headers, timeout=10)
print("评分:"+p.text)
def rating(self, i, IP, appkey, JDClass):
s = json.dumps({
"appid": "xxxxxxxxxxxxxxxx",
"who": "88DF8986-6E80-4B6D-8CD0-DBB402A80D18",
"what": "custom_eventname1",
"when": "2019-09-16 21:28:58",
"context": {
"_timestamp": "1570636195286",
"_app_version": "1.2.0",
"_idfv": "11288275-88C7-4880-8F86-485BE1AE88BB",
"_create_timestamp": "1570636195286",
"_idfa": "88DF8986-6E80-4B6D-8CD0-DBB402A80D18",
"_lib": "iOS",
"_lib_version": "a1.0.0",
"_deviceid": "88DF8986-6E80-4B6D-8CD0-DBB402A80D18",
"_ip": "1.1.1.1",
"_ryosversion": "13.0.1",
"_tz": "+8",
"custom_param1": "custom_value1",
"custom_param3": "custom_value3"
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL + 'rating', data=s, headers=headers, timeout=10)
print("评分:" + p.text)
# 统计事件
# def rating(self, i, IP, appkey,event, JDClass):
# s = json.dumps({
# "appid": appkey,
# "who": i,
# "what": event,
# "when": when,
# "context": {
# "_deviceid": i,
# "_androidid": i,
# # Google play advertising id
# "_gaid": i,
# "_ip": IP,
# "_app_version": "2.0",
# "_ryosversion": "6.0",
# "_create_timestamp": current_time_13,
# "_timestamp": current_time_13,
# "_lib": "Android",
# "_lib_version": '1.0',
# "_tz": '+8',
# "name": fufei_name,
# "user_id": user_id,
# "checkout_as_guest": checkout_as_guest,
# "content_id": content_id,
# "_currencytype": currencytype,
# "_currencyamount": currencyamount
# }
# })
# s = encryptorForAES(s, JDClass)
# p = requests.post(url=URL + 'rating', data=s, headers=headers, timeout=10)
\ No newline at end of file
import requests
import json
import time
import datetime
import random
from jiami.pdj import encryptorForAES
headers = {'Content-Type': 'application/json',
'User-Agent': 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8) Gecko Fedora/1.9.0.8-1.fc10 Kazehakase/0.5.6"'}
# headers = {}
URL = 'http://log.tkioglobal.com/receive/tkioglobal/'
# 线上
# http://log.tkioglobal.com/receive/tkioglobal/
# 测试环境
# http://10.3.20.42:8680/receive/tkioglobal/
#时间戳
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 = 'iOS'
#设备类型
rydevicetype = 'iPhone7'
#网络类型
network ='wifi'
#分辨率
resolution ='1344*750'
#运行商
op ='中国移动'
# 用户名称标识
user_name = 'lxx'
# 用户唯一id(账号id)
user_id = '1232432432'
# 事件引荐来源
referral_from = 'ceshi'
# 付费名称
fufei_name = '付费'
# 任何有关游客下单的数据
checkout_as_guest = '13131232121'
# 付费商品id
content_id = '43123123'
# 流水单id,确保唯一
transactionid = '7843584342332'
# 货币类型,按照国际标准组织ISO4217中规范的3位大写字母,如USD
currencytype = 'CNY'
# 付费金额
currencyamount = '66'
# 搜索结果
results = '搜索结果 dde wae qweqw edwq eqwe qeqw '
# 搜索内容
uri = "ewr csdfsd we ds dd dasd dsa"
# 浏览内容
liulan_name = 'adsdsaadsdasdas'
# 完成教程所花费的时间,单位:秒
duration = '31221'
ryosversion = '6.0'
lib = 'iOS'
zidian1 = {
"iad-attribution": "true",
"iad-org-name": "Tinder-201711",
"iad-campaign-id": "3138493",
"iad-campaign-name": "Tinder",
"iad-purchase-date": "2020-01-10 06:27:02",
"iad-conversion-date": "2020-01-10 06:27:02",
"iad-conversion-type": "Download",
"iad-click-date": "2020-01-10 06:27:02",
"iad-adgroup-id": "3138519",
"iad-adgroup-name": "Tinder",
"iad-keyword": "dating app",
"iad-creative-id": "1234567890",
"iad-creative-name": "CreativeName",
"iad-lineitem-id": "3138519",
"iad-lineitem-name": "Tinder"
# 来自非搜索广告(自然量或推广量)
# "iad-attribution": "false"
}
# zidian2 =
class allEvent:
# 激活
def installUpload(self, i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"what": "install",
"who": i,
"when": "2020-01-10 06:27:02",
"context": {
"Version3.1": {
"iad-attribution": "true",
"iad-org-name": "Tinder-201711",
"iad-campaign-id": "3138493",
"iad-campaign-name": "Tinder",
"iad-purchase-date": "2020-01-10 06:27:02",
"iad-conversion-date": "2020-01-10 06:27:02",
"iad-conversion-type": "Download",
"iad-click-date": "2020-01-10 06:27:02",
"iad-adgroup-id": "3138519",
"iad-adgroup-name": "Tinder",
"iad-keyword": "dating app",
"iad-creative-id": "1234567890",
"iad-creative-name": "CreativeName",
"iad-lineitem-id": "3138519",
"iad-lineitem-name": "Tinder"
# 来自非搜索广告(自然量或推广量)
# "iad-attribution": "false"
},
"_deviceid": i,
"_idfa": i,
"_idfv":i,
"_mac": "0C:8F:FF:A6:E5:20",
"_ip": IP,
"_ipv6": "unknown",
"_tz": "+8",
"_manufacturer": manufacturer,
"_ryos": ryos,
"_ryosversion": ryosversion,
"_rydevicetype": rydevicetype,
"_model": "DIG-AL00",
"_network_type": network,
"_resolution": resolution,
"_carrier": op,
# "_devi;ce_gps": '43.4209116508',
"_audio_volume": '9',
"_app_version": "2.0",
"_pkgname": "com.example.reyunsdkdemo",
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": lib,
"_screen_brightness": "102",
"_lib_version":'1.0',
"_jbk": '0',
"_modify": '0',
"_frequency":'0',
},
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'install', data=s, headers=headers, timeout=10)
print("激活:"+p.text)
# print(ds)
# print(p.url)
print(when)
# 启动
def startupUpload(self, i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"what": "startup",
"who": i,
"when": "2020-01-10 06:27:02",
"context": {
"Version3.1": {
"iad-attribution": "true",
"iad-org-name": "Tinder-201711",
"iad-campaign-id": "3138493",
"iad-campaign-name": "Tinder",
"iad-purchase-date": "2020-01-10 06:27:02",
"iad-conversion-date": "2020-01-10 06:27:02",
"iad-conversion-type": "Download",
"iad-click-date": "2020-01-10 06:27:02",
"iad-adgroup-id": "3138519",
"iad-adgroup-name": "Tinder",
"iad-keyword": "dating app",
"iad-creative-id": "1234567890",
"iad-creative-name": "CreativeName",
"iad-lineitem-id": "3138519",
"iad-lineitem-name": "Tinder"
# 来自非搜索广告(自然量或推广量)
# "iad-attribution": "false"
},
"_deviceid": i,
"_idfa": i,
"_idfv":i,
"_mac": "0C:8F:FF:A6:E5:20",
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": ryosversion,
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": lib,
"_lib_version": '1.0',
"_tz": '+8'
},
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'startup', data=s, headers=headers, timeout=10)
print("启动:"+p.text)
# print(p.url)
# 注册
def reged(self,i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "reged",
"when":"2020-01-10 06:27:02",
"context": {
"Version3.1": {
"iad-attribution": "true",
"iad-org-name": "Tinder-201711",
"iad-campaign-id": "3138493",
"iad-campaign-name": "Tinder",
"iad-purchase-date": "2020-01-10 06:27:02",
"iad-conversion-date": "2020-01-10 06:27:02",
"iad-conversion-type": "Download",
"iad-click-date": "2020-01-10 06:27:02",
"iad-adgroup-id": "3138519",
"iad-adgroup-name": "Tinder",
"iad-keyword": "dating app",
"iad-creative-id": "1234567890",
"iad-creative-name": "CreativeName",
"iad-lineitem-id": "3138519",
"iad-lineitem-name": "Tinder"
# 来自非搜索广告(自然量或推广量)
# "iad-attribution": "false"
},
"_deviceid": i,
"_idfa": i,
"_idfv":i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": ryosversion,
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": lib,
"_lib_version": '1.0',
"_tz": '+8',
"user_name": user_name,
# 用户唯一id(账号id)
"user_id": user_id,
# 事件引荐来源
"referral_from": referral_from
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'reged', data=s, headers=headers, timeout=10)
print("注册:"+p.text)
#登陆
def login(self,i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "loggedin",
"when":"2020-01-10 06:27:02",
"context":{
"Version3.1": {
"iad-attribution": "true",
"iad-org-name": "Tinder-201711",
"iad-campaign-id": "3138493",
"iad-campaign-name": "Tinder",
"iad-purchase-date": "2020-01-10 06:27:02",
"iad-conversion-date": "2020-01-10 06:27:02",
"iad-conversion-type": "Download",
"iad-click-date": "2020-01-10 06:27:02",
"iad-adgroup-id": "3138519",
"iad-adgroup-name": "Tinder",
"iad-keyword": "dating app",
"iad-creative-id": "1234567890",
"iad-creative-name": "CreativeName",
"iad-lineitem-id": "3138519",
"iad-lineitem-name": "Tinder"
# 来自非搜索广告(自然量或推广量)
# "iad-attribution": "false"
},
"_deviceid": i,
"_idfa": i,
"_idfv":i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": ryosversion,
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": lib,
"_lib_version": '1.0',
"_tz": '+8',
"user_name": user_name,
# 用户唯一id(账号id)
"user_id": user_id,
# 事件引荐来源
"referral_from": referral_from
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'loggedin', data=s, headers=headers, timeout=10)
print("登陆:"+p.text)
# 付费
def payment(self,i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "payment",
"when":"2020-01-10 06:27:02",
"context":{
"Version3.1": {
"iad-attribution": "true",
"iad-org-name": "Tinder-201711",
"iad-campaign-id": "3138493",
"iad-campaign-name": "Tinder",
"iad-purchase-date": "2020-01-10 06:27:02",
"iad-conversion-date": "2020-01-10 06:27:02",
"iad-conversion-type": "Download",
"iad-click-date": "2020-01-10 06:27:02",
"iad-adgroup-id": "3138519",
"iad-adgroup-name": "Tinder",
"iad-keyword": "dating app",
"iad-creative-id": "1234567890",
"iad-creative-name": "CreativeName",
"iad-lineitem-id": "3138519",
"iad-lineitem-name": "Tinder"
# 来自非搜索广告(自然量或推广量)
# "iad-attribution": "false"
},
"_deviceid": i,
"_idfa": i,
"_idfv":i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": ryosversion,
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": lib,
"_lib_version": '1.0',
"_tz": '+8',
# 用户唯一id(账号id)
"user_id": user_id,
"name": fufei_name,
"user_id":user_id,
"checkout_as_guest":checkout_as_guest,
"content_id":content_id,
"_transactionid":transactionid,
"_currencytype":currencytype,
"_currencyamount":currencyamount
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'payment', data=s, headers=headers, timeout=10)
print("付费:"+p.text)
# 订单
def order(self,i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "order",
"context":{
"Version3.1": {
"iad-attribution": "true",
"iad-org-name": "Tinder-201711",
"iad-campaign-id": "3138493",
"iad-campaign-name": "Tinder",
"iad-purchase-date": "2020-01-10 06:27:02",
"iad-conversion-date": "2020-01-10 06:27:02",
"iad-conversion-type": "Download",
"iad-click-date": "2020-01-10 06:27:02",
"iad-adgroup-id": "3138519",
"iad-adgroup-name": "Tinder",
"iad-keyword": "dating app",
"iad-creative-id": "1234567890",
"iad-creative-name": "CreativeName",
"iad-lineitem-id": "3138519",
"iad-lineitem-name": "Tinder"
# 来自非搜索广告(自然量或推广量)
# "iad-attribution": "false"
},
"_deviceid": i,
"_idfa": i,
"_idfv":i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": ryosversion,
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": lib,
"_lib_version": '1.0',
"_tz": '+8',
# 用户唯一id(账号id)
"user_id": user_id,
"name": fufei_name,
"checkout_as_guest":checkout_as_guest,
"content_id":content_id,
"_transactionid":transactionid,
"_currencytype":currencytype,
"_currencyamount":currencyamount
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'order', data=s, headers=headers, timeout=10)
print("订单:"+p.text)
# 订阅
def subscribe(self,i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "subscribe",
"context": {
"Version3.1": {
"iad-attribution": "true",
"iad-org-name": "Tinder-201711",
"iad-campaign-id": "3138493",
"iad-campaign-name": "Tinder",
"iad-purchase-date": "2020-01-10 06:27:02",
"iad-conversion-date": "2020-01-10 06:27:02",
"iad-conversion-type": "Download",
"iad-click-date": "2020-01-10 06:27:02",
"iad-adgroup-id": "3138519",
"iad-adgroup-name": "Tinder",
"iad-keyword": "dating app",
"iad-creative-id": "1234567890",
"iad-creative-name": "CreativeName",
"iad-lineitem-id": "3138519",
"iad-lineitem-name": "Tinder"
# 来自非搜索广告(自然量或推广量)
# "iad-attribution": "false"
},
"_deviceid": i,
"_idfa": i,
"_idfv":i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": ryosversion,
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": lib,
"_lib_version": '1.0',
"_tz": '+8',
# 用户唯一id(账号id)
"user_id": user_id,
"name": fufei_name,
"checkout_as_guest":checkout_as_guest,
"content_id":content_id,
"_transactionid":transactionid,
"_currencytype":currencytype,
"_currencyamount":currencyamount
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'subscribe', data=s, headers=headers, timeout=10)
print("订阅:"+p.text)
# 搜索
def search(self,i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "search",
"when": "2020-01-10 06:27:02",
"context": {
"Version3.1": {
"iad-attribution": "true",
"iad-org-name": "Tinder-201711",
"iad-campaign-id": "3138493",
"iad-campaign-name": "Tinder",
"iad-purchase-date": "2020-01-10 06:27:02",
"iad-conversion-date": "2020-01-10 06:27:02",
"iad-conversion-type": "Download",
"iad-click-date": "2020-01-10 06:27:02",
"iad-adgroup-id": "3138519",
"iad-adgroup-name": "Tinder",
"iad-keyword": "dating app",
"iad-creative-id": "1234567890",
"iad-creative-name": "CreativeName",
"iad-lineitem-id": "3138519",
"iad-lineitem-name": "Tinder"
# 来自非搜索广告(自然量或推广量)
# "iad-attribution": "false"
},
"_deviceid": i,
"_idfa": i,
"_idfv":i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": ryosversion,
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": lib,
"_lib_version": '1.0',
"_tz": '+8',
"uri": uri,
"results": results
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'search', data=s, headers=headers, timeout=10)
print("搜索:"+p.text)
# 统计浏览
def view(self,i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "view",
"when": "2020-01-10 06:27:02",
"context": {
"Version3.1": {
"iad-attribution": "true",
"iad-org-name": "Tinder-201711",
"iad-campaign-id": "3138493",
"iad-campaign-name": "Tinder",
"iad-purchase-date": "2020-01-10 06:27:02",
"iad-conversion-date": "2020-01-10 06:27:02",
"iad-conversion-type": "Download",
"iad-click-date": "2020-01-10 06:27:02",
"iad-adgroup-id": "3138519",
"iad-adgroup-name": "Tinder",
"iad-keyword": "dating app",
"iad-creative-id": "1234567890",
"iad-creative-name": "CreativeName",
"iad-lineitem-id": "3138519",
"iad-lineitem-name": "Tinder"
# 来自非搜索广告(自然量或推广量)
# "iad-attribution": "false"
},
"_deviceid": i,
"_idfa": i,
"_idfv":i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": ryosversion,
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": lib,
"_lib_version": '1.0',
"_tz": '+8',
"user_id": user_id,
"name": liulan_name,
"referral_from": referral_from,
"content_id":content_id
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'view', data=s, headers=headers, timeout=10)
print("浏览:"+p.text)
# 统计统计加入购物车
def addtocart(self,i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "addtocart",
"when": "2020-01-10 06:27:02",
"context": {
"Version3.1": {
"iad-attribution": "true",
"iad-org-name": "Tinder-201711",
"iad-campaign-id": "3138493",
"iad-campaign-name": "Tinder",
"iad-purchase-date": "2020-01-10 06:27:02",
"iad-conversion-date": "2020-01-10 06:27:02",
"iad-conversion-type": "Download",
"iad-click-date": "2020-01-10 06:27:02",
"iad-adgroup-id": "3138519",
"iad-adgroup-name": "Tinder",
"iad-keyword": "dating app",
"iad-creative-id": "1234567890",
"iad-creative-name": "CreativeName",
"iad-lineitem-id": "3138519",
"iad-lineitem-name": "Tinder"
# 来自非搜索广告(自然量或推广量)
# "iad-attribution": "false"
},
"_deviceid": i,
"_idfa": i,
"_idfv":i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": ryosversion,
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": lib,
"_lib_version": '1.0',
"_tz": '+8',
"user_id": user_id,
"name": liulan_name,
"referral_from": referral_from,
"content_id":content_id
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'addtocart', data=s, headers=headers, timeout=10)
print("加入购物车:"+p.text)
# 统计加入愿望清单(收藏)
def addtowishlist(self,i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "addtowishlist",
"when": "2020-01-10 06:27:02",
"context": {
"Version3.1": {
"iad-attribution": "true",
"iad-org-name": "Tinder-201711",
"iad-campaign-id": "3138493",
"iad-campaign-name": "Tinder",
"iad-purchase-date": "2020-01-10 06:27:02",
"iad-conversion-date": "2020-01-10 06:27:02",
"iad-conversion-type": "Download",
"iad-click-date": "2020-01-10 06:27:02",
"iad-adgroup-id": "3138519",
"iad-adgroup-name": "Tinder",
"iad-keyword": "dating app",
"iad-creative-id": "1234567890",
"iad-creative-name": "CreativeName",
"iad-lineitem-id": "3138519",
"iad-lineitem-name": "Tinder"
# 来自非搜索广告(自然量或推广量)
# "iad-attribution": "false"
},
"_deviceid": i,
"_idfa": i,
"_idfv":i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": ryosversion,
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": lib,
"_lib_version": '1.0',
"_tz": '+8',
"user_id": user_id,
"name": liulan_name,
"referral_from": referral_from,
"content_id":content_id
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'addtowishlist', data=s, headers=headers, timeout=10)
print("加入愿望清单:"+p.text)
# 统计完成教程
def tutorialcomplete(self,i,IP,appkey,JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "tutorialcomplete",
"when": "2020-01-10 06:27:02",
"context": {
"Version3.1": {
"iad-attribution": "true",
"iad-org-name": "Tinder-201711",
"iad-campaign-id": "3138493",
"iad-campaign-name": "Tinder",
"iad-purchase-date": "2020-01-10 06:27:02",
"iad-conversion-date": "2020-01-10 06:27:02",
"iad-conversion-type": "Download",
"iad-click-date": "2020-01-10 06:27:02",
"iad-adgroup-id": "3138519",
"iad-adgroup-name": "Tinder",
"iad-keyword": "dating app",
"iad-creative-id": "1234567890",
"iad-creative-name": "CreativeName",
"iad-lineitem-id": "3138519",
"iad-lineitem-name": "Tinder"
# 来自非搜索广告(自然量或推广量)
# "iad-attribution": "false"
},
"_deviceid": i,
"_idfa": i,
"_idfv":i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": ryosversion,
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": lib,
"_lib_version": '1.0',
"_tz": '+8',
"user_id": user_id,
"name": liulan_name,
"duration": duration
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL+'tutorialcomplete', data=s, headers=headers, timeout=10)
print("完成教程:"+p.text)
# 统计等级达成
def levelcomplete(self, i, IP, appkey, JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "levelcomplete",
"when": "2020-01-10 06:27:02",
"context": {
"Version3.1": {
"iad-attribution": "true",
"iad-org-name": "Tinder-201711",
"iad-campaign-id": "3138493",
"iad-campaign-name": "Tinder",
"iad-purchase-date": "2020-01-10 06:27:02",
"iad-conversion-date": "2020-01-10 06:27:02",
"iad-conversion-type": "Download",
"iad-click-date": "2020-01-10 06:27:02",
"iad-adgroup-id": "3138519",
"iad-adgroup-name": "Tinder",
"iad-keyword": "dating app",
"iad-creative-id": "1234567890",
"iad-creative-name": "CreativeName",
"iad-lineitem-id": "3138519",
"iad-lineitem-name": "Tinder"
# 来自非搜索广告(自然量或推广量)
# "iad-attribution": "false"
},
"_deviceid": i,
"_idfa": i,
"_idfv":i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": ryosversion,
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": lib,
"_lib_version": '1.0',
"_tz": '+8',
"user_id": user_id,
"name": liulan_name,
"duration": duration
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL + 'levelcomplete', data=s, headers=headers, timeout=10)
print("等级达成:"+p.text)
# 统计成就达成
def achievement(self, i, IP, appkey, JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "achievement",
"when": "2020-01-10 06:27:02",
"context": {
"Version3.1": {
"iad-attribution": "true",
"iad-org-name": "Tinder-201711",
"iad-campaign-id": "3138493",
"iad-campaign-name": "Tinder",
"iad-purchase-date": "2020-01-10 06:27:02",
"iad-conversion-date": "2020-01-10 06:27:02",
"iad-conversion-type": "Download",
"iad-click-date": "2020-01-10 06:27:02",
"iad-adgroup-id": "3138519",
"iad-adgroup-name": "Tinder",
"iad-keyword": "dating app",
"iad-creative-id": "1234567890",
"iad-creative-name": "CreativeName",
"iad-lineitem-id": "3138519",
"iad-lineitem-name": "Tinder"
# 来自非搜索广告(自然量或推广量)
# "iad-attribution": "false"
},
"_deviceid": i,
"_idfa": i,
"_idfv":i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": ryosversion,
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": lib,
"_lib_version": '1.0',
"_tz": '+8',
"user_id": user_id,
"name": liulan_name,
"duration": duration
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL + 'achievement', data=s, headers=headers, timeout=10)
print("成就达成:"+p.text)
# 统计广告点击
def adclick(self, i, IP, appkey, JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "adclick",
"when": "2020-01-10 06:27:02",
"context": {
"Version3.1": {
"iad-attribution": "true",
"iad-org-name": "Tinder-201711",
"iad-campaign-id": "3138493",
"iad-campaign-name": "Tinder",
"iad-purchase-date": "2020-01-10 06:27:02",
"iad-conversion-date": "2020-01-10 06:27:02",
"iad-conversion-type": "Download",
"iad-click-date": "2020-01-10 06:27:02",
"iad-adgroup-id": "3138519",
"iad-adgroup-name": "Tinder",
"iad-keyword": "dating app",
"iad-creative-id": "1234567890",
"iad-creative-name": "CreativeName",
"iad-lineitem-id": "3138519",
"iad-lineitem-name": "Tinder"
# 来自非搜索广告(自然量或推广量)
# "iad-attribution": "false"
},
"_deviceid": i,
"_idfa": i,
"_idfv":i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": ryosversion,
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": lib,
"_lib_version": '1.0',
"_tz": '+8',
"ad_type": "ad type ",
"ad_network_name": "ad_network_name",
"placement": "ad_network_name"
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL + 'adclick', data=s, headers=headers, timeout=10)
print("点击广告:"+p.text)
# 统计广告观看
def adview(self, i, IP, appkey, JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "adview",
"when": "2020-01-10 06:27:02",
"context": {
"Version3.1": {
"iad-attribution": "true",
"iad-org-name": "Tinder-201711",
"iad-campaign-id": "3138493",
"iad-campaign-name": "Tinder",
"iad-purchase-date": "2020-01-10 06:27:02",
"iad-conversion-date": "2020-01-10 06:27:02",
"iad-conversion-type": "Download",
"iad-click-date": "2020-01-10 06:27:02",
"iad-adgroup-id": "3138519",
"iad-adgroup-name": "Tinder",
"iad-keyword": "dating app",
"iad-creative-id": "1234567890",
"iad-creative-name": "CreativeName",
"iad-lineitem-id": "3138519",
"iad-lineitem-name": "Tinder"
# 来自非搜索广告(自然量或推广量)
# "iad-attribution": "false"
},
"_deviceid": i,
"_idfa": i,
"_idfv":i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": ryosversion,
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": lib,
"_lib_version": '1.0',
"_tz": '+8',
"ad_type": "激励视频",
"ad_network_name": "广告平台名称",
"placement": "广告位"
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL + 'adview', data=s, headers=headers, timeout=10)
print("广告观看:"+p.text)
# 统计评分
def rating(self, i, IP, appkey, JDClass):
s = json.dumps({
"appid": appkey,
"who": i,
"what": "rating",
"when": "2020-01-10 06:27:02",
"context": {
"Version3.1": {
"iad-attribution": "true",
"iad-org-name": "Tinder-201711",
"iad-campaign-id": "3138493",
"iad-campaign-name": "Tinder",
"iad-purchase-date": "2020-01-10 06:27:02",
"iad-conversion-date": "2020-01-10 06:27:02",
"iad-conversion-type": "Download",
"iad-click-date": "2020-01-10 06:27:02",
"iad-adgroup-id": "3138519",
"iad-adgroup-name": "Tinder",
"iad-keyword": "dating app",
"iad-creative-id": "1234567890",
"iad-creative-name": "CreativeName",
"iad-lineitem-id": "3138519",
"iad-lineitem-name": "Tinder"
# 来自非搜索广告(自然量或推广量)
# "iad-attribution": "false"
},
"_deviceid": i,
"_idfa": i,
"_idfv":i,
"_ip": IP,
"_app_version": "2.0",
"_ryosversion": ryosversion,
"_create_timestamp": current_time_13,
"_timestamp": current_time_13,
"_lib": lib,
"_lib_version": '1.0',
"_tz": '+8',
"rating_value": "30",
"max_rating_value": "89",
}
})
s = encryptorForAES(s, JDClass)
p = requests.post(url=URL + 'rating', data=s, headers=headers, timeout=10)
print("评分:"+p.text)
{
"appid": "koxiaoxing-test-jxg",
"when": "2020-02-18 07:22:45",
"what": "eve",
"context": {
"_lib": "iOS",
"_lib_version": "1.0.2",
"_deviceid": "DBC93722-E34B-440C-B7A7-FB6641D0D9AB",
"_create_timestamp": "1582010565679",
"_idfa": "DBC93722-E34B-440C-B7A7-FB6641D0D9AB",
"_tz": "+8",
"_app_version": "2.0",
"_ryosversion": "13.3.1",
"custom_param": {
"key1": "value1",
"key3": 11.220000000000001,
"key2": 10
},
"_idfv": "F3E81978-222A-4B43-B809-C48D4456B3CB",
"_timestamp": "1582010565679"
},
"who": "DBC93722-E34B-440C-B7A7-FB6641D0D9AB"
}
# 统计事件
# def rating(self, i, IP, appkey,event, JDClass):
# s = json.dumps({
# "appid": appkey,
# "who": i,
# "what": event,
# "when": when,
# "context": {
# "_deviceid": i,
# "_androidid": i,
# # Google play advertising id
# "_gaid": i,
# "_ip": IP,
# "_app_version": "2.0",
# "_ryosversion": "6.0",
# "_create_timestamp": current_time_13,
# "_timestamp": current_time_13,
# "_lib": "Android",
# "_lib_version": '1.0',
# "_tz": '+8',
# "name": fufei_name,
# "user_id": user_id,
# "checkout_as_guest": checkout_as_guest,
# "content_id": content_id,
# "_currencytype": currencytype,
# "_currencyamount": currencyamount
# }
# })
# s = encryptorForAES(s, JDClass)
# p = requests.post(url=URL + 'rating', data=s, headers=headers, timeout=10)
\ No newline at end of file
from ry_kochava.android_script import allEvent
import struct
import socket
import random
import time
import os
from jpype import *
appkey = 'ko1206-zxh'
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))
# i = '557761077746'
# 随机生成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().reged(i, ip, appkey, JDClass)
allEvent().login(i, ip, appkey, JDClass)
allEvent().payment(i, ip, appkey, JDClass)
allEvent().order(i, ip, appkey, JDClass)
allEvent().subscribe(i, ip, appkey, JDClass)
allEvent().search(i, ip, appkey, JDClass)
allEvent().view(i, ip, appkey, JDClass)
allEvent().addtocart(i, ip, appkey, JDClass)
allEvent().addtowishlist(i, ip, appkey, JDClass)
allEvent().tutorialcomplete(i, ip, appkey, JDClass)
allEvent().levelcomplete(i, ip, appkey, JDClass)
allEvent().achievement(i, ip, appkey, JDClass)
allEvent().adclick(i, ip, appkey, JDClass)
allEvent().adview(i, ip, appkey, JDClass)
allEvent().rating(i, ip, appkey, JDClass)
#
lst.append(i)
print(lst)
\ No newline at end of file
from ry_kochava.ios_script import allEvent
import struct
import socket
import random
import string
import time
import os
from jpype import *
appkey = 'koluka-android-1223-wb980ot'
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为数组
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, 11))
i = a+"-"+b+"-"+c+"-"+d+"-"+e
# i = '401092010659'
# 随机生成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().reged(i, ip, appkey, JDClass)
# allEvent().login(i, ip, appkey, JDClass)
# allEvent().payment(i, ip, appkey, JDClass)
# allEvent().order(i, ip, appkey, JDClass)
# allEvent().subscribe(i, ip, appkey, JDClass)
# allEvent().search(i, ip, appkey, JDClass)
# allEvent().view(i, ip, appkey, JDClass)
# allEvent().addtocart(i, ip, appkey, JDClass)
# allEvent().addtowishlist(i, ip, appkey, JDClass)
# allEvent().tutorialcomplete(i, ip, appkey, JDClass)
# allEvent().levelcomplete(i, ip, appkey, JDClass)
# allEvent().achievement(i, ip, appkey, JDClass)
# allEvent().adclick(i, ip, appkey, JDClass)
# allEvent().adview(i, ip, appkey, JDClass)
# allEvent().rating(i, ip, appkey, JDClass)
lst.append(i)
print(lst)
\ No newline at end of file
# 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
# 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'
parms = {
# 'androidid': i,
# 'imei': i,
# "idfa": '8C297900-EE26-4501-94B5-DDE6F83E1496',
# 'gxid': '78B5382F687FAD16E75F5DDDC7745013',
# 'caid': '00_A0FF634AEDF1403205A4A6A1118CDA61_A66338F33BEBB40F5CD65F198AF2F40C',
# 'oaid': '00000000000000000000000000000000',
'ip': ip,
}
def send_request(url):
response = requests.get(url=url, params=parms, timeout=5, verify=False)
print(response.text)
def send_request():
response = requests.get(url=URL, params=parms, timeout=5, verify=False)
print(response.text)
def test_ua():
# url = "http://10.2.20.42:8083/tkio/vEBV7ra?preorder=true&noredirect=true"
send_request()
def hcc():
print("hcc is shadan")
def hcc(c):
print(c)
# p = "hh"
hcc("mmmmhh")
print("1")
def zcc(p1,p2):
print("5")
return p1+p2
print("2")
def fanren():
print("4")
ww = zcc(1, 2)
print("6")
# print(ww)
print("3")
fanren()
print("7")
import requests
import json
import pytest
url = "http://tkiomicro-receive-788931749.cn-north-1.elb.amazonaws.com.cn/receive/tkiov2/sdk"
headers = {
'Content-Type': 'application/json'
}
data = [
{
"application_info": {
"appkey": "74b81be2432c029040e0b2bc375ce7fb",
"bundleid": "3423232",
"app_version": "1.9.0",
"channel_name": "HUAWEI"
},
"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": "3DEA635F-B24F-434B-833F-4ED028FEAEEF",
"device_id_type": "oaid",
"device_id_md5": "8e488a40a17aed2f6752f51382a4eafc",
"device_id_md5_type": "oaid_md5",
"os": "ANDROID",
"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",
"oaid": "3DEA635F-B24F-434B-833F-4ED028FEAEEF",
"oaid_md5": "8e488a40a17aed2f6752f51382a4eafc",
"imei1": "8342732742383",
"imei1_md5": "8e488a40a17aed2f6752f51382a4eafc",
"imei2": "8342732742383",
"imei2_md5": "8e488a40a17aed2f6752f51382a4eafc",
"gaid": "B21C5EC5-9921-42FD-AAC5-07A0EB6CF1A0",
"gaid_md5": "8e488a40a17aed2f6752f51382a4eafc",
"mac": "23456787898767898",
"mac_md5": "24953067e92f5bdebc9fd56411fd38f3",
"android_id": "1a34fc556a43c453",
"android_id_md5": "8e488a40a17aed2f6752f51382a4eafc"
},
"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"
}
}
}
]
print("ee")
# 函数只有调用的时候才会执行
def send_request():
response = requests.request("POST", url, headers=headers, data=json.dumps(data))
print(response.text)
response = json.loads(response.text)
# 断言 如果返回结果状态 等于0 正常执行,否则抛出异常
# assert response["status"] == 0
a = response["status"]
s = str(a)
response["status"] = s
return response
# 测试用例的名字一定要明显知道是干啥的,或者就加上备注,不要test_case1 ,以后多了就不知道这函数是干啥的了
def test_case1():
data[0]["application_info"]["appkey"] = "ffff"
response = send_request()
a = 5
b = 6
c = a
a = b
b = c
print(a)
print(b)
# 这里可以针对返回结果做断言,需要根据实际情况修改
assert response["status"] == "101"
def test_case2():
data[0]["application_info"]["bundleid"] = "ffff"
# 如果不需要对返回结果做处理 不用 获取返回值
response = send_request()
assert response["status"] == "0"
from xiaochengxu.xiaochenxu_script import allEvent
import socket
import struct
import random
appkey = '9a6442bafe808b253cfb9b381e1d74fb'
#cid
cid = '17774'
#surl
surl = 'fQbAVja'
for _ in range(1):
# 随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = '324014210339'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
#打开
# allEvent().openxiaochengxu(i,ip,cid,surl,appkey)
#pv
allEvent().pviaochengxu(i,ip,cid,surl,appkey)
#离开
# allEvent().hidechengxu(i,ip,cid,surl,appkey)
import requests
import json
import time
import random
headers = {'Content-Type': 'application/json'}
#测试环境
# URL = 'http://10.3.20.42:8080/receive/tkio/event'
#线上环境
URL = 'http://log.reyun.com/receive/tkio/event'
# URL = 'http://tlog.trackingio.com/receive/tkio/event'
#时间和日期
when = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
#日期
ds = time.strftime('%Y-%m-%d', time.localtime(time.time()))
#访问时常,以s计时
duration = '5'
#订单id
transactionid = '34232323'
# 支付类型 支付宝(alipay),银联(unionpay),微信支付(weixinpay),易宝支付(yeepay)
paymenttype = 'alipay'
#货币类型
currencytype = 'CNY'
#支付金额
currencyamount = '45'
#是否热云默认,标记为自定义事件
isreyundefaultevent = ''
class allEvent:
#打开小程序
def openxiaochengxu(self,i,IP,cid,surl,appid):
s = json.dumps({
"what":"launch",
"appid":appid,
"context":{
"_cid":cid,
"_ip":IP,
"_deviceid":'null',
# "_openid":i,
"_campaignid":surl,
"_sceneid":"unknown",
"_apptype":"wx"
},
"where":"launch",
"when":when,
"ds":ds,
"who":"lxx-test"
})
p = requests.post(url=URL, data=s, headers=headers, timeout=5)
print(p.text)
print(p.url)
# pv
def pviaochengxu(self, i, IP, cid, surl, appid):
s = json.dumps({
"what": "pageview",
"appid": appid,
"context": {
"_cid": cid,
"_ip": IP,
"_deviceid": i,
"_openid": "xxxx",
"_campaignid": surl,
"_sceneid": "unknown",
"_apptype": "wx"
},
"where": "pageview",
"when": when,
"ds": ds,
"who": "lxx-test"
})
p = requests.post(url=URL, data=s, headers=headers, timeout=5)
print(p.text)
# hide
def hidechengxu(self, i, IP, cid, surl, appid):
s = json.dumps({
"what": "hide",
"appid": appid,
"context": {
"_cid": cid,
"_ip": IP,
"_deviceid": i,
"_openid": "xxxx",
"_campaignid": surl,
"_sceneid": "unknown",
"_apptype": "wx",
"_num_pages":"5",
"_duration":"10"
},
"where": "startup",
"when": when,
"ds": ds,
"who": "lxx-test"
})
p = requests.post(url=URL, data=s, headers=headers, timeout=5)
print(p.text)
\ No newline at end of file
import requests
import json
import time
import random
headers = {'Content-Type': 'application/json'}
current_time_13 = int(round(time.time() * 1000))
#测试环境
# URL_install = 'http://10.3.20.39:10202/dpquery'
URL_install = 'http://link.trackingio.com/dpquery'
class allEvent:
# 激活
def dp_imei(self, i, appkey):
s = json.dumps({
"create_timestamp": current_time_13,
"imei": i,
"appid": appkey,
"device_id": i
})
try:
p = requests.post(url=URL_install, data=s, headers=headers, timeout=5)
print("dp返回:" + p.text)
# print("状态码:"+p.status_code)
print("设备id:" + i)
# print(p.url)
except Exception as err:
print(err)
# 激活
def dp_ios(self, i, appkey):
s = json.dumps({
"create_timestamp": current_time_13,
"idfa": i,
"appid": appkey,
"device_id": i
})
try:
p = requests.post(url=URL_install, data=s, headers=headers, timeout=5)
print("dp返回:" + p.text)
# print("状态码:"+p.status_code)
print("设备id:" + i)
# print(p.url)
except Exception as err:
print(err)
\ No newline at end of file
from yanchidp.dp 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 = '352745509625'
# 随机生成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().dp_imei(i, appkey)
# allEvent().dp_ios(i, appkey)
\ No newline at end of file
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