Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tkio-test-case
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liuxiaoxing
tkio-test-case
Commits
15ed9f4b
Commit
15ed9f4b
authored
Dec 07, 2022
by
liuxiaoxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据处理与归因逻辑优化
parent
6fcb6197
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
1533 additions
and
520 deletions
+1533
-520
click.py
android_click/click.py
+34
-33
android_script.py
android_event/android_script.py
+4
-4
android_fenlianjie.py
android_event_case/android_fenlianjie.py
+8
-8
click.py
fenbao_android_click/click.py
+15
-15
android_fenlianjie.py
fenbao_android_event_case/android_fenlianjie.py
+6
-6
click.py
ios_click/click.py
+8
-8
ios_script.py
ios_event/ios_script.py
+2
-2
ios_fenlianjie.py
ios_event_case/ios_fenlianjie.py
+2
-2
attributioncase.py
microservices/attributioncase.py
+613
-12
attributioncaseios.py
microservices/attributioncaseios.py
+127
-2
receiveandroid.py
microservices/receiveandroid.py
+5
-6
receiveios.py
microservices/receiveios.py
+2
-2
redirectandroid.py
microservices/redirectandroid.py
+320
-294
redirectios.py
microservices/redirectios.py
+30
-30
attributioncaseandroid.py
tkio/attributioncaseandroid.py
+225
-40
attributioncaseios.py
tkio/attributioncaseios.py
+86
-17
clickandroid.py
tkio/clickandroid.py
+3
-2
clickios.py
tkio/clickios.py
+1
-1
tkioreceive.py
tkio/tkioreceive.py
+3
-3
tkioreceiveandroid.py
tkio/tkioreceiveandroid.py
+3
-3
x_launch.py
xiaochengxu/x_launch.py
+23
-19
xiaochenxu_script.py
xiaochengxu/xiaochenxu_script.py
+13
-11
No files found.
android_click/click.py
View file @
15ed9f4b
...
...
@@ -25,14 +25,14 @@ def code_nums2(n=6):
# from jiami.md5 import get_str_sha1_secret_str
# 向短链发送点击数据
# 广告创意ID
#
ry_adcreative_id = code_nums2(6)
ry_adcreative_id
=
'453282367872
'
ry_adcreative_id
=
code_nums2
(
6
)
# ry_adcreative_id = '384609
'
# 广告组ID
#
ry_adgroup_id = code_nums2(6)
ry_adgroup_id
=
'203346609
'
ry_adgroup_id
=
code_nums2
(
6
)
# ry_adgroup_id = '019750
'
# 广告计划ID
#
ry_adplan_id = code_nums2(6)
ry_adplan_id
=
'7138970403
'
ry_adplan_id
=
code_nums2
(
6
)
# ry_adplan_id = '258640
'
# 广告组名称
ry_adgroup_name
=
'c测试1'
# 广告计划名称
...
...
@@ -41,8 +41,8 @@ ry_adplan_name = 'c测试1'
ry_adcreative_name
=
'c测试1'
# bytedance_int 今日头条,kuaishou_int 快手,tencentams_int (新)广点通,rryingxiao_int 人人营销
pid
=
'rryingxiao_int'
# URL = 'http://uri6.com/tkio/uq2uQn
a?noredirect=true'
URL
=
'http://52.80.137.106:8083/tkio/AZRvA3
a?noredirect=true'
URL
=
'http://uri6.com/tkio/NjeQJj
a?noredirect=true'
# URL = 'http://52.80.137.106:8083/tkio/aI7j6v
a?noredirect=true'
# 测试头条衍生事件回调时加上
# callback= http%3A%2F%2Fad.toutiao.com%2Ftrack%2Factivate%2F%3Fcallback%3DCKP4rs-Zn4QDEKiQ6teZn4QDGN6L8Y-h9Wcg3ovxj6H1ZyiE0PjgroSEAzAOOM_X-8IDQik0YWY1NzdlOC1lZmViLTRmZDEtYmZkZC00MzE1Zjc1MmJhMGF1NTQ5M0iA0pOtA1AAiAEAkAECmAEA%26os%3D0%26muid%3D
...
...
@@ -63,16 +63,16 @@ def computeMD5upper(message):
return
m
.
hexdigest
()
.
upper
()
appkey
=
'
88d7d29c4c7a49d2b5ec8d9723f70eb1
'
appkey
=
'
5076ba423652a3254761d7493d9c80ad
'
lst
=
[]
nowTime
=
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
s
=
0
w
=
0
for
index
in
range
(
1
0
):
for
index
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 = '
%*%5323423332233
'
# i = '
A1E36666F0EB4C25
'
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
))
...
...
@@ -80,7 +80,7 @@ for index in range(10):
# adid = '5011813780042235'
p1
=
''
.
join
(
str
(
random
.
choice
(
range
(
10
)))
for
_
in
range
(
12
))
accountid
=
''
.
join
(
str
(
random
.
choice
(
range
(
10
)))
for
_
in
range
(
12
))
# accountid = '3
7655892
'
# accountid = '3
83218638957
'
# p1 = '测试一下'
# "idfa": 'B5588C9C-4534-43FB-935D-F17C91622C83',
# "idfa": '00000000-0000-0000-0000-000000000000',
...
...
@@ -134,8 +134,8 @@ for index in range(10):
"ry_adgroup_id"
:
ry_adgroup_id
,
"ry_adplan_id"
:
ry_adplan_id
,
"ry_adcreative_id"
:
ry_adcreative_id
,
# # # 账户id
"accountid"
:
accountid
# # #
#
账户id
"accountid"
:
accountid
,
# 'imei2': 'null',
# 'meid': i
# 'bd_vid': i
...
...
@@ -188,6 +188,7 @@ for index in range(10):
print
(
'success:'
,
s
)
print
(
p
.
status_code
)
print
(
p
.
content
)
print
(
"计划id:"
+
ry_adplan_id
)
# print('androidid:',a)
# print(nowTime)
s
=
s
+
1
...
...
@@ -200,18 +201,18 @@ for index in range(10):
# print('androidid', a)
w
=
w
+
1
#
time.sleep(6)
#
try:
#
allEvent().installUpload(i, ip, appkey)
#
# allEvent().formevent(i, ip, appkey)
#
#
except Exception:
#
print('install_wrong:', w)
#
w = w + 1
time
.
sleep
(
6
)
try
:
allEvent
()
.
installUpload
(
i
,
ip
,
appkey
)
# allEvent().formevent(i, ip, appkey)
except
Exception
:
print
(
'install_wrong:'
,
w
)
w
=
w
+
1
# # # # #
# # # # #
# time.sleep(
10
)
# time.sleep(
6
)
# try:
# allEvent().invoke_test(i, ip, appkey)
# except Exception:
...
...
@@ -268,7 +269,7 @@ for index in range(10):
# try:
# allEvent().appduration(i, ip, appkey,se)
# # allEvent().formevent(i, ip, appkey)
# print("session:"+se)
#
#
print("session:"+se)
# except Exception:
# print('install_wrong:', w)
# w = w + 1
...
...
@@ -287,16 +288,16 @@ for index in range(10):
# print('install_wrong:', w)
# w = w + 1
#
#
num = index + 1
# #
event = 'event_' + str(num)
num
=
index
+
1
event
=
'event_'
+
str
(
num
)
# event = 'event_28'
# time.sleep(3
)
#
try:
#
allEvent().ziding_event(i, ip, appkey, event)
#
print(event)
#
except Exception as err:
#
print(err)
#
print('自定义_wrong:', w)
time
.
sleep
(
2
)
try
:
allEvent
()
.
ziding_event
(
i
,
ip
,
appkey
,
event
)
print
(
event
)
except
Exception
as
err
:
print
(
err
)
print
(
'自定义_wrong:'
,
w
)
# time.sleep(6)
# try:
...
...
android_event/android_script.py
View file @
15ed9f4b
...
...
@@ -10,8 +10,8 @@ headers = {'Content-Type': 'application/json', 'X-RY-Access-Token': 'test_access
# 测试环境
URL_batch
=
'http://10.3.20.42:8080/receive/batch'
# URL = 'http://52.80.137.106:8080/receive/tkio/'
#
URL = 'http://log.trackingio.com/receive/tkio/'
URL
=
'http://jisulog.sortda.com/receive/tkio/'
URL
=
'http://log.trackingio.com/receive/tkio/'
#
URL = 'http://jisulog.sortda.com/receive/tkio/'
# URL = 'http://172.31.21.207:8080/receive/tkio/'
# URL = 'http://120.53.212.71/receive/tkio/'
# 腾迅云tkio http协议的生产地址:
...
...
@@ -80,8 +80,8 @@ class allEvent:
# "_campaignid": 'default',
"_deviceid"
:
i
,
"_imei"
:
i
,
"_meid"
:
'UNKNOWN'
,
"mobdna_info"
:
"{
\"
mobdna_oid
\"
:
\"
95820f88217ec8cbdf621919bb81c0a5
\"
,
\"
mobdna_appkey
\"
:
\"
16dc0cb882d3dbec4f7f66251a84d6dd
\"
,
\"
mobdna_rdid
\"
:
\"
96AD0BC02C70D0BA5C446C12580E3800
\"
,
\"
mobdna_requestid
\"
:
\"
463cfd5564d24d30a607a18a1e8ae2d8
\"
}"
,
# "_meid":i
,
#
"mobdna_info": "{\"mobdna_oid\":\"95820f88217ec8cbdf621919bb81c0a5\",\"mobdna_appkey\":\"16dc0cb882d3dbec4f7f66251a84d6dd\",\"mobdna_rdid\":\"96AD0BC02C70D0BA5C446C12580E3800\",\"mobdna_requestid\":\"463cfd5564d24d30a607a18a1e8ae2d8\"}",
'_oaid'
:
i
,
# "_rdid": '09DA91D0664C33DA7BEE7294CCCCCA07',
# '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',
...
...
android_event_case/android_fenlianjie.py
View file @
15ed9f4b
...
...
@@ -10,7 +10,7 @@ import hashlib
#安卓常规渠道激活
appkey
=
'
83c18356b6ab202f007565b821e43e10
'
appkey
=
'
16dc0cb882d3dbec4f7f66251a84d6dd
'
# 线上预约app
# 7f64fbd64513bc74aa6b5bf753ae0953
# 16dc0cb882d3dbec4f7f66251a84d6dd
...
...
@@ -30,7 +30,7 @@ appkey = '83c18356b6ab202f007565b821e43e10'
# allEvent().payEvent(i, ip, appkey)
# print("开始时间"+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
for
index
in
range
(
1
):
for
index
in
range
(
40
):
# 随机生成12为数组
s
=
''
.
join
(
str
(
random
.
choice
(
range
(
10
)))
for
_
in
range
(
18
))
p
=
''
.
join
(
str
(
random
.
choice
(
range
(
10
)))
for
_
in
range
(
12
))
...
...
@@ -41,7 +41,7 @@ for index in range(1):
# p = '987654321234567'
# s = '2321321312h8ro321'
i
=
''
.
join
(
str
(
random
.
choice
(
range
(
10
)))
for
_
in
range
(
12
))
# i = '
778980150907
'
# i = '
315141921832
'
# i = '00000000-0000-0000-0000-000000000000'
# 随机生成ipXXXX XXCB489741-0029-4A35-8E38-D142F836B623
ip
=
socket
.
inet_ntoa
(
struct
.
pack
(
'>I'
,
random
.
randint
(
1
,
0xffffffff
)))
...
...
@@ -63,10 +63,10 @@ for index in range(1):
# time.sleep(1)
# allEvent().payorder(i, ip, appkey)
# time.sleep(1)
#
num = index + 1
#
event = 'event_' + str(num)
#
#
event = 'event_5'
#
allEvent().ziding_event(i, ip, appkey, event)
num
=
index
+
1
event
=
'event_'
+
str
(
num
)
# event = 'event_5'
allEvent
()
.
ziding_event
(
i
,
ip
,
appkey
,
event
)
# print(s)
# s = int(s) + 1
# time.sleep(3)
...
...
@@ -81,7 +81,7 @@ for index in range(1):
# allEvent().batchUpload(i,ip,appkey)
# allEvent().H5download(i,ip,appkey)
# # time.sleep(1)
allEvent
()
.
H5pv
(
i
,
ip
,
appkey
)
#
allEvent().H5pv(i,ip,appkey)
# # time.sleep(1)
# #
# allEvent().H5su(i,ip,appkey)
...
...
fenbao_android_click/click.py
View file @
15ed9f4b
...
...
@@ -9,11 +9,11 @@ import time
#!!!!分包需要删掉https的s
# URL = 'http://uri6.com/tkio/3uu6rya?noredirect=true'
URL
=
'http://52.80.137.106:8083/tkio/
RvYNJn
a?noredirect=true'
URL
=
'http://52.80.137.106:8083/tkio/
NjiYvu
a?noredirect=true'
appkey
=
'
5b0e99269160e67ef8e560716221e142
'
appkey
=
'
345b0e19ef25ab3e7cc46770c2f16a3b
'
# event = 'invoke'
cmpaignid
=
'11
1
'
cmpaignid
=
'11
2233
'
# 广告创意ID
ry_adcreative_id
=
'9876543'
# 广告组ID
...
...
@@ -29,7 +29,7 @@ ry_adcreative_name = '广告创意'
s
=
0
w
=
0
for
index
in
range
(
1
):
for
index
in
range
(
40
):
#随机生成12为数组
i
=
''
.
join
(
str
(
random
.
choice
(
range
(
10
)))
for
_
in
range
(
12
))
...
...
@@ -103,19 +103,19 @@ for index in range(1):
# allEvent().loginEvent(i, ip, appkey)
# except Exception:
# print('登录_wrong:', w)
time
.
sleep
(
5
)
try
:
allEvent
()
.
payEvent
(
i
,
ip
,
appkey
)
except
Exception
:
print
(
'付费_wrong:'
,
w
)
# num = index + 1
# event = 'event_' + str(num)
# event = 'event_28'
# time.sleep(3)
# time.sleep(5)
# try:
# allEvent().
ziding_event(i, ip, appkey,event
)
# allEvent().
payEvent(i, ip, appkey
)
# except Exception:
# print('自定义_wrong:', w)
# print('付费_wrong:', w)
num
=
index
+
1
event
=
'event_'
+
str
(
num
)
# event = 'event_28'
time
.
sleep
(
2
)
try
:
allEvent
()
.
ziding_event
(
i
,
ip
,
appkey
,
event
)
except
Exception
:
print
(
'自定义_wrong:'
,
w
)
...
...
fenbao_android_event_case/android_fenlianjie.py
View file @
15ed9f4b
...
...
@@ -5,23 +5,23 @@ import random
import
time
import
time
#安卓分包激活
appkey
=
'
f461b1ab7aca6fdf3fa719bf4b6af863
'
appkey
=
'
345b0e19ef25ab3e7cc46770c2f16a3b
'
#57ed2dd31596bb4682471e82c0c73c1a
# 4b25b8a4dc584e63e9a7b81c3adedf2f
# event = 'event_10'
cmpaignid
=
'11
11
'
cmpaignid
=
'11
22
'
for
index
in
range
(
1
):
# 随机生成12为数组
i
=
''
.
join
(
str
(
random
.
choice
(
range
(
10
)))
for
_
in
range
(
12
))
# i = 'q27dux0c9d5mv9413cp903d07a8q1ipf
'
#
i = ''.join(str(random.choice(range(10))) for _ in range(12))
i
=
'189894848469
'
# 随机生成ip
ip
=
socket
.
inet_ntoa
(
struct
.
pack
(
'>I'
,
random
.
randint
(
1
,
0xffffffff
)))
# ip = '143.205.125.236'
allEvent
()
.
installUpload
(
i
,
ip
,
appkey
,
cmpaignid
)
#
allEvent().installUpload(i, ip, appkey, cmpaignid)
# time.sleep(3)
#
allEvent().loginEvent(i, ip, appkey)
allEvent
()
.
loginEvent
(
i
,
ip
,
appkey
)
# allEvent().orderEvent(i, ip, appkey)
# time.sleep(1)
# num = index + 1
...
...
ios_click/click.py
View file @
15ed9f4b
...
...
@@ -100,14 +100,14 @@ for _ in range(1):
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
(
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)
...
...
ios_event/ios_script.py
View file @
15ed9f4b
...
...
@@ -8,8 +8,8 @@ import random
headers
=
{
'Content-Type'
:
'application/json'
}
# URL = 'http://10.2.20.42:8080/receive/tkio/'
URL
=
'http://52.80.137.106:8080/receive/tkio/'
#
URL = 'http://log.trackingio.com/receive/tkio/'
#
URL = 'http://52.80.137.106:8080/receive/tkio/'
URL
=
'http://log.trackingio.com/receive/tkio/'
# URL = 'http://jisulog.sortda.com/receive/tkio/'
#时间戳
...
...
ios_event_case/ios_fenlianjie.py
View file @
15ed9f4b
...
...
@@ -6,7 +6,7 @@ import string
import
time
#iOS常规渠道激活
appkey
=
'
0ecc232109dc25bfedff8aba06271539
'
appkey
=
'
60763edf19602c0fa27b967c282fe805
'
event
=
'event_1'
for
index
in
range
(
5
):
...
...
@@ -40,7 +40,7 @@ for index in range(5):
# # event = 'event_' + str(num)
# event = 'event_1'
# allEvent().ziding_event(i, ip, appkey, event)
print
(
event
)
#
print(event)
# allEvent().adshow(i,ip,appkey,adid)
# allEvent().adclick(i,ip,appkey,adid)
# allEvent().pageduration(i,ip,appkey,se,p)
...
...
microservices/attributioncase.py
View file @
15ed9f4b
...
...
@@ -977,6 +977,7 @@ def test_atb45():
i
=
code_nums
(
12
)
redirectandroid
.
parms
[
'callback_url'
]
=
'https://www.baidu.com/?tn=98010089_dg&ch=16/'
redirectandroid
.
parms
[
'oaid'
]
=
i
redirectandroid
.
parms
[
'oaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
send_request3
(
''
)
time
.
sleep
(
5
)
# receiveandroid.data[0]['application_info']['appkey'] = 'b8e5e389e1223ffa16a5a9420258383d'
...
...
@@ -992,20 +993,20 @@ def test_atb45():
# receiveandroid.data[0]["event_info"]['event_name'] = 'startup'
# receiveandroid.data[0]["event_info"]['event_type'] = 'preset'
# receiveandroid.send_request()
time
.
sleep
(
3
)
time
.
sleep
(
1
3
)
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id'
]
=
i
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid'
]
=
i
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'oaid'
receiveandroid
.
data
[
0
][
"event_info"
][
'event_name'
]
=
'register'
receiveandroid
.
data
[
0
][
"event_info"
][
'event_type'
]
=
'preset'
receiveandroid
.
send_request
()
time
.
sleep
(
3
)
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id'
]
=
i
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid'
]
=
i
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'oaid'
receiveandroid
.
data
[
0
][
"event_info"
][
'event_name'
]
=
'login'
receiveandroid
.
data
[
0
][
"event_info"
][
'event_type'
]
=
'preset'
receiveandroid
.
send_request
()
#
time.sleep(3)
#
receiveandroid.data[0]['device_info']['device_id'] = i
#
receiveandroid.data[0]['device_info']['oaid'] = i
#
receiveandroid.data[0]['device_info']['device_id_type'] = 'oaid'
#
receiveandroid.data[0]["event_info"]['event_name'] = 'login'
#
receiveandroid.data[0]["event_info"]['event_type'] = 'preset'
#
receiveandroid.send_request()
# time.sleep(3)
# receiveandroid.data[0]['device_info']['device_id'] = i
# receiveandroid.data[0]['device_info']['oaid'] = i
...
...
@@ -1551,20 +1552,32 @@ def test_click():
# 单独的激活
def
test_install
():
i
=
'acr4n9muc39v'
# i = '23A051-DB2A-4F4F-9154-BC15EF565752'
i
=
code_nums
(
12
)
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id'
]
=
i
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid'
]
=
i
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'oaid'
receiveandroid
.
send_request
()
print
(
i
)
# 单独的点击
def
test_click
():
i
=
code_nums
(
12
)
# redirectandroid.parms['touchpoint_type'] = 'impression'
redirectandroid
.
parms
[
'gaid'
]
=
'9C3FA000-DB2A-4F4F-9154-BC15EF565772'
# redirectandroid.parms['ts'] = '1668997850000'
redirectandroid
.
send_request3
(
''
)
print
(
i
)
def
test_atbgoogle
():
# i =
idfacode(
)
i
=
'
3C3FA051-DB2A-4F4F-9154-BC15EF565750
'
receiveandroid
.
data
[
0
][
'timestamp_info'
][
'current_event_time'
]
=
'16
59148260199
'
# i =
code_nums(12
)
i
=
'
9C3FA051-DB2A-4F4F-9154-BC15EF565783
'
receiveandroid
.
data
[
0
][
'timestamp_info'
][
'current_event_time'
]
=
'16
68847756000
'
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id'
]
=
i
receiveandroid
.
data
[
0
][
'device_info'
][
'imei1'
]
=
''
receiveandroid
.
data
[
0
][
'device_info'
][
'gaid'
]
=
i
...
...
@@ -1572,3 +1585,590 @@ def test_atbgoogle():
receiveandroid
.
data
[
0
][
'device_info'
][
'os'
]
=
'1'
receiveandroid
.
send_requestgoogle
()
print
(
i
)
# ---------------------------ts规则修改-------------------
# ts为10/13位的归因(修改send_request3中的ts事件即可)
def
test_ts10
():
ts
=
int
(
round
(
time
.
time
()))
i
=
code_nums
(
12
)
redirectandroid
.
parms
[
'oaid'
]
=
i
redirectandroid
.
parms
[
'ts'
]
=
ts
redirectandroid
.
send_request3
(
''
)
time
.
sleep
(
6
)
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id'
]
=
i
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid'
]
=
i
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'oaid'
receiveandroid
.
send_request
()
print
(
i
)
# -------------------数据处理与归因逻辑优化----------------------
# 只有ipv4满足规则,其他的字段不满足,归因到ipv4
def
test_at_newipv4
():
redirectandroid
.
parms
[
'ipv4'
]
=
ip
redirectandroid
.
parms
[
'oaid'
]
=
code_nums
(
513
)
redirectandroid
.
parms
[
'oaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'gaid'
]
=
code_nums
(
37
)
redirectandroid
.
parms
[
'gaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'mac'
]
=
code_nums
(
18
)
redirectandroid
.
parms
[
'mac_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'android_id'
]
=
code_nums
(
17
)
redirectandroid
.
parms
[
'android_id_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'is_s2s'
]
=
'1'
redirectandroid
.
parms
[
'touchpoint_type'
]
=
'click'
redirectandroid
.
parms
[
'attribution_type'
]
=
'ua'
redirectandroid
.
send_request3
(
''
)
time
.
sleep
(
6
)
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid_md5'
]
=
md
receiveandroid
.
data
[
0
][
'device_info'
][
'imei1'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'imei1'
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_md5_type'
]
=
'oaid_md5'
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_md5'
]
=
md
receiveandroid
.
data
[
0
][
'device_info'
][
'ipv4'
]
=
ip
receiveandroid
.
send_request
()
print
(
o
)
print
(
md
)
def
test_at_newoaid
():
redirectandroid
.
parms
[
'ipv4'
]
=
code_nums
(
129
)
redirectandroid
.
parms
[
'oaid'
]
=
o
redirectandroid
.
parms
[
'oaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'gaid'
]
=
code_nums
(
37
)
redirectandroid
.
parms
[
'gaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'mac'
]
=
code_nums
(
18
)
redirectandroid
.
parms
[
'mac_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'android_id'
]
=
code_nums
(
17
)
redirectandroid
.
parms
[
'android_id_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'is_s2s'
]
=
'1'
redirectandroid
.
parms
[
'touchpoint_type'
]
=
'click'
redirectandroid
.
parms
[
'attribution_type'
]
=
'ua'
redirectandroid
.
send_request3
(
''
)
time
.
sleep
(
6
)
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid_md5'
]
=
md
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'imei1'
]
=
''
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'oaid'
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_md5_type'
]
=
'oaid_md5'
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_md5'
]
=
md
receiveandroid
.
data
[
0
][
'device_info'
][
'ipv4'
]
=
ip
receiveandroid
.
send_request
()
time
.
sleep
(
6
)
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid_md5'
]
=
md
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'imei1'
]
=
''
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'oaid'
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_md5_type'
]
=
'oaid_md5'
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_md5'
]
=
md
receiveandroid
.
data
[
0
][
'device_info'
][
'ipv4'
]
=
ip
receiveandroid
.
data
[
0
][
'event_info'
][
'event_name'
]
=
'register'
receiveandroid
.
send_request
()
print
(
o
)
print
(
md
)
def
test_at_newoaid_md5
():
redirectandroid
.
parms
[
'ipv4'
]
=
code_nums
(
129
)
redirectandroid
.
parms
[
'oaid'
]
=
code_nums
(
513
)
redirectandroid
.
parms
[
'oaid_md5'
]
=
md
redirectandroid
.
parms
[
'imei1'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'gaid'
]
=
code_nums
(
37
)
redirectandroid
.
parms
[
'gaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'mac'
]
=
code_nums
(
18
)
redirectandroid
.
parms
[
'mac_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'android_id'
]
=
code_nums
(
17
)
redirectandroid
.
parms
[
'android_id_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'is_s2s'
]
=
'1'
redirectandroid
.
parms
[
'touchpoint_type'
]
=
'click'
redirectandroid
.
parms
[
'attribution_type'
]
=
'ua'
redirectandroid
.
send_request3
(
''
)
time
.
sleep
(
6
)
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid_md5'
]
=
md
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'imei1'
]
=
''
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'oaid'
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_md5_type'
]
=
'oaid_md5'
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_md5'
]
=
md
receiveandroid
.
data
[
0
][
'device_info'
][
'ipv4'
]
=
ip
receiveandroid
.
send_request
()
print
(
o
)
print
(
md
)
def
test_at_newimei1
():
redirectandroid
.
parms
[
'ipv4'
]
=
code_nums
(
129
)
redirectandroid
.
parms
[
'oaid'
]
=
code_nums
(
513
)
redirectandroid
.
parms
[
'oaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1'
]
=
o
redirectandroid
.
parms
[
'imei1_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'gaid'
]
=
code_nums
(
37
)
redirectandroid
.
parms
[
'gaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'mac'
]
=
code_nums
(
18
)
redirectandroid
.
parms
[
'mac_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'android_id'
]
=
code_nums
(
17
)
redirectandroid
.
parms
[
'android_id_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'is_s2s'
]
=
'1'
redirectandroid
.
parms
[
'touchpoint_type'
]
=
'click'
redirectandroid
.
parms
[
'attribution_type'
]
=
'ua'
redirectandroid
.
send_request3
(
''
)
time
.
sleep
(
6
)
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid_md5'
]
=
md
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid'
]
=
''
receiveandroid
.
data
[
0
][
'device_info'
][
'imei1'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'imei1'
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_md5_type'
]
=
'oaid_md5'
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_md5'
]
=
md
receiveandroid
.
data
[
0
][
'device_info'
][
'ipv4'
]
=
ip
receiveandroid
.
send_request
()
print
(
o
)
print
(
md
)
def
test_at_newimei1_md5
():
redirectandroid
.
parms
[
'ipv4'
]
=
code_nums
(
129
)
redirectandroid
.
parms
[
'oaid'
]
=
code_nums
(
513
)
redirectandroid
.
parms
[
'oaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1_md5'
]
=
md
redirectandroid
.
parms
[
'imei2'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'gaid'
]
=
code_nums
(
37
)
redirectandroid
.
parms
[
'gaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'mac'
]
=
code_nums
(
18
)
redirectandroid
.
parms
[
'mac_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'android_id'
]
=
code_nums
(
17
)
redirectandroid
.
parms
[
'android_id_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'is_s2s'
]
=
'1'
redirectandroid
.
parms
[
'touchpoint_type'
]
=
'click'
redirectandroid
.
parms
[
'attribution_type'
]
=
'ua'
redirectandroid
.
send_request3
(
''
)
time
.
sleep
(
6
)
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid_md5'
]
=
''
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid'
]
=
''
receiveandroid
.
data
[
0
][
'device_info'
][
'imei1'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'imei1_md5'
]
=
md
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'imei1'
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_md5_type'
]
=
'imei1_md5'
receiveandroid
.
data
[
0
][
'device_info'
][
'ipv4'
]
=
ip
receiveandroid
.
send_request
()
print
(
o
)
print
(
md
)
def
test_at_newimei2
():
imei2
=
code_nums
(
32
)
redirectandroid
.
parms
[
'ipv4'
]
=
code_nums
(
129
)
redirectandroid
.
parms
[
'oaid'
]
=
code_nums
(
513
)
redirectandroid
.
parms
[
'oaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2'
]
=
imei2
redirectandroid
.
parms
[
'imei2_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'gaid'
]
=
code_nums
(
37
)
redirectandroid
.
parms
[
'gaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'mac'
]
=
code_nums
(
18
)
redirectandroid
.
parms
[
'mac_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'android_id'
]
=
code_nums
(
17
)
redirectandroid
.
parms
[
'android_id_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'is_s2s'
]
=
'1'
redirectandroid
.
parms
[
'touchpoint_type'
]
=
'click'
redirectandroid
.
parms
[
'attribution_type'
]
=
'ua'
redirectandroid
.
send_request3
(
''
)
time
.
sleep
(
6
)
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid_md5'
]
=
''
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid'
]
=
''
receiveandroid
.
data
[
0
][
'device_info'
][
'imei1'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'imei2'
]
=
imei2
receiveandroid
.
data
[
0
][
'device_info'
][
'imei1_md5'
]
=
md
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'imei1'
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_md5_type'
]
=
'imei1_md5'
receiveandroid
.
data
[
0
][
'device_info'
][
'ipv4'
]
=
ip
receiveandroid
.
send_request
()
print
(
o
)
print
(
md
)
def
test_at_newimei2_md5
():
imei2_md5
=
code_nums
(
32
)
redirectandroid
.
parms
[
'ipv4'
]
=
code_nums
(
129
)
redirectandroid
.
parms
[
'oaid'
]
=
code_nums
(
513
)
redirectandroid
.
parms
[
'oaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2_md5'
]
=
imei2_md5
redirectandroid
.
parms
[
'gaid'
]
=
code_nums
(
37
)
redirectandroid
.
parms
[
'gaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'mac'
]
=
code_nums
(
18
)
redirectandroid
.
parms
[
'mac_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'android_id'
]
=
code_nums
(
17
)
redirectandroid
.
parms
[
'android_id_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'is_s2s'
]
=
'1'
redirectandroid
.
parms
[
'touchpoint_type'
]
=
'click'
redirectandroid
.
parms
[
'attribution_type'
]
=
'ua'
redirectandroid
.
send_request3
(
''
)
time
.
sleep
(
6
)
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid_md5'
]
=
''
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid'
]
=
''
receiveandroid
.
data
[
0
][
'device_info'
][
'imei1'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'imei2_md5'
]
=
imei2_md5
receiveandroid
.
data
[
0
][
'device_info'
][
'imei1_md5'
]
=
md
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'imei1'
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_md5_type'
]
=
'imei1_md5'
receiveandroid
.
data
[
0
][
'device_info'
][
'ipv4'
]
=
ip
receiveandroid
.
send_request
()
print
(
o
)
print
(
md
)
def
test_at_newigaid
():
gaid
=
code_nums
(
36
)
redirectandroid
.
parms
[
'ipv4'
]
=
code_nums
(
129
)
redirectandroid
.
parms
[
'oaid'
]
=
code_nums
(
513
)
redirectandroid
.
parms
[
'oaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'gaid'
]
=
gaid
redirectandroid
.
parms
[
'gaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'mac'
]
=
code_nums
(
18
)
redirectandroid
.
parms
[
'mac_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'android_id'
]
=
code_nums
(
17
)
redirectandroid
.
parms
[
'android_id_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'is_s2s'
]
=
'1'
redirectandroid
.
parms
[
'touchpoint_type'
]
=
'click'
redirectandroid
.
parms
[
'attribution_type'
]
=
'ua'
redirectandroid
.
send_request3
(
''
)
time
.
sleep
(
6
)
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid_md5'
]
=
''
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid'
]
=
''
receiveandroid
.
data
[
0
][
'device_info'
][
'imei1'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'gaid'
]
=
gaid
receiveandroid
.
data
[
0
][
'device_info'
][
'imei1_md5'
]
=
md
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'imei1'
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_md5_type'
]
=
'imei1_md5'
receiveandroid
.
data
[
0
][
'device_info'
][
'ipv4'
]
=
ip
receiveandroid
.
send_request
()
print
(
o
)
print
(
md
)
def
test_at_newigaid_md5
():
gaid_md5
=
code_nums
(
32
)
redirectandroid
.
parms
[
'ipv4'
]
=
code_nums
(
129
)
redirectandroid
.
parms
[
'oaid'
]
=
code_nums
(
513
)
redirectandroid
.
parms
[
'oaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'gaid'
]
=
code_nums
(
37
)
redirectandroid
.
parms
[
'gaid_md5'
]
=
gaid_md5
redirectandroid
.
parms
[
'mac'
]
=
code_nums
(
18
)
redirectandroid
.
parms
[
'mac_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'android_id'
]
=
code_nums
(
17
)
redirectandroid
.
parms
[
'android_id_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'is_s2s'
]
=
'1'
redirectandroid
.
parms
[
'touchpoint_type'
]
=
'click'
redirectandroid
.
parms
[
'attribution_type'
]
=
'ua'
redirectandroid
.
send_request3
(
''
)
time
.
sleep
(
6
)
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid_md5'
]
=
''
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid'
]
=
''
receiveandroid
.
data
[
0
][
'device_info'
][
'imei1'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'gaid_md5'
]
=
gaid_md5
receiveandroid
.
data
[
0
][
'device_info'
][
'imei1_md5'
]
=
md
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'imei1'
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_md5_type'
]
=
'imei1_md5'
receiveandroid
.
data
[
0
][
'device_info'
][
'ipv4'
]
=
ip
receiveandroid
.
send_request
()
print
(
o
)
print
(
md
)
def
test_at_newmac
():
mac
=
code_nums
(
17
)
redirectandroid
.
parms
[
'ipv4'
]
=
code_nums
(
129
)
redirectandroid
.
parms
[
'oaid'
]
=
code_nums
(
513
)
redirectandroid
.
parms
[
'oaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'gaid'
]
=
code_nums
(
37
)
redirectandroid
.
parms
[
'gaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'mac'
]
=
mac
redirectandroid
.
parms
[
'mac_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'android_id'
]
=
code_nums
(
17
)
redirectandroid
.
parms
[
'android_id_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'is_s2s'
]
=
'1'
redirectandroid
.
parms
[
'touchpoint_type'
]
=
'click'
redirectandroid
.
parms
[
'attribution_type'
]
=
'ua'
redirectandroid
.
send_request3
(
''
)
time
.
sleep
(
6
)
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid_md5'
]
=
''
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid'
]
=
''
receiveandroid
.
data
[
0
][
'device_info'
][
'imei1'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'mac'
]
=
mac
receiveandroid
.
data
[
0
][
'device_info'
][
'imei1_md5'
]
=
md
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'imei1'
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_md5_type'
]
=
'imei1_md5'
receiveandroid
.
data
[
0
][
'device_info'
][
'ipv4'
]
=
ip
receiveandroid
.
send_request
()
print
(
o
)
print
(
md
)
def
test_at_newmac_md5
():
mac_md5
=
code_nums
(
32
)
redirectandroid
.
parms
[
'ipv4'
]
=
code_nums
(
129
)
redirectandroid
.
parms
[
'oaid'
]
=
code_nums
(
513
)
redirectandroid
.
parms
[
'oaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'gaid'
]
=
code_nums
(
37
)
redirectandroid
.
parms
[
'gaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'mac'
]
=
code_nums
(
18
)
redirectandroid
.
parms
[
'mac_md5'
]
=
mac_md5
redirectandroid
.
parms
[
'android_id'
]
=
code_nums
(
17
)
redirectandroid
.
parms
[
'android_id_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'is_s2s'
]
=
'1'
redirectandroid
.
parms
[
'touchpoint_type'
]
=
'click'
redirectandroid
.
parms
[
'attribution_type'
]
=
'ua'
redirectandroid
.
send_request3
(
''
)
time
.
sleep
(
6
)
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid_md5'
]
=
''
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid'
]
=
''
receiveandroid
.
data
[
0
][
'device_info'
][
'imei1'
]
=
o
receiveandroid
.
data
[
0
][
'device_info'
][
'mac_md5'
]
=
mac_md5
receiveandroid
.
data
[
0
][
'device_info'
][
'imei1_md5'
]
=
md
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'imei1'
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_md5_type'
]
=
'imei1_md5'
receiveandroid
.
data
[
0
][
'device_info'
][
'ipv4'
]
=
ip
receiveandroid
.
send_request
()
receiveandroid
.
send_request
()
print
(
o
)
print
(
md
)
def
test_at_newandroidid
():
android_id
=
code_nums
(
16
)
redirectandroid
.
parms
[
'ipv4'
]
=
code_nums
(
129
)
redirectandroid
.
parms
[
'oaid'
]
=
code_nums
(
513
)
redirectandroid
.
parms
[
'oaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'gaid'
]
=
code_nums
(
37
)
redirectandroid
.
parms
[
'gaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'mac'
]
=
code_nums
(
18
)
redirectandroid
.
parms
[
'mac_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'android_id'
]
=
android_id
redirectandroid
.
parms
[
'android_id_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'is_s2s'
]
=
'1'
redirectandroid
.
parms
[
'touchpoint_type'
]
=
'click'
redirectandroid
.
parms
[
'attribution_type'
]
=
'ua'
redirectandroid
.
send_request3
(
''
)
# -------------------------所以设备都非法-------------------------
# ts,is_s2s,turl_id,touchpoint_type,attribution_type满足校验规则,device_info中没有满足规则的字段
def
test_at_newclick1
():
redirectandroid
.
parms
[
'ipv4'
]
=
code_nums
(
129
)
redirectandroid
.
parms
[
'oaid'
]
=
code_nums
(
513
)
redirectandroid
.
parms
[
'oaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei1_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'imei2_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'gaid'
]
=
code_nums
(
37
)
redirectandroid
.
parms
[
'gaid_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'mac'
]
=
code_nums
(
18
)
redirectandroid
.
parms
[
'mac_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'android_id'
]
=
code_nums
(
17
)
redirectandroid
.
parms
[
'android_id_md5'
]
=
code_nums
(
33
)
redirectandroid
.
parms
[
'is_s2s'
]
=
'1'
redirectandroid
.
parms
[
'touchpoint_type'
]
=
'click'
redirectandroid
.
parms
[
'attribution_type'
]
=
'ua'
redirectandroid
.
send_request3
(
''
)
# device_info,is_s2s,turl_id,touchpoint_type,attribution_type满足校验规则,ts不满足规则
def
test_at_newclick2
():
redirectandroid
.
parms
[
'ipv4'
]
=
ip
redirectandroid
.
parms
[
'oaid'
]
=
o
redirectandroid
.
parms
[
'oaid_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei1'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei1_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei2'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei2_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'gaid'
]
=
code_nums
(
36
)
redirectandroid
.
parms
[
'gaid_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'mac'
]
=
code_nums
(
17
)
redirectandroid
.
parms
[
'mac_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'android_id'
]
=
code_nums
(
16
)
redirectandroid
.
parms
[
'android_id_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'is_s2s'
]
=
'1'
redirectandroid
.
parms
[
'ts'
]
=
code_nums
(
20
)
redirectandroid
.
parms
[
'touchpoint_type'
]
=
'click'
redirectandroid
.
parms
[
'attribution_type'
]
=
'ua'
redirectandroid
.
send_request4
()
# device_info,is_s2s,turl_id,touchpoint_type,attribution_type满足校验规则,ts不满足规则
def
test_at_newclick3
():
redirectandroid
.
parms
[
'ipv4'
]
=
ip
redirectandroid
.
parms
[
'oaid'
]
=
o
redirectandroid
.
parms
[
'oaid_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei1'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei1_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei2'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei2_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'gaid'
]
=
code_nums
(
36
)
redirectandroid
.
parms
[
'gaid_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'mac'
]
=
code_nums
(
17
)
redirectandroid
.
parms
[
'mac_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'android_id'
]
=
code_nums
(
16
)
redirectandroid
.
parms
[
'android_id_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'is_s2s'
]
=
'i'
redirectandroid
.
parms
[
'touchpoint_type'
]
=
'click'
redirectandroid
.
parms
[
'attribution_type'
]
=
'ua'
redirectandroid
.
send_request3
(
''
)
# device_info,is_s2s,turl_id,touchpoint_type,attribution_type满足校验规则,ts不满足规则
def
test_at_newclick4
():
redirectandroid
.
parms
[
'ipv4'
]
=
ip
redirectandroid
.
parms
[
'oaid'
]
=
o
redirectandroid
.
parms
[
'oaid_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei1'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei1_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei2'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei2_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'gaid'
]
=
code_nums
(
36
)
redirectandroid
.
parms
[
'gaid_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'mac'
]
=
code_nums
(
17
)
redirectandroid
.
parms
[
'mac_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'android_id'
]
=
code_nums
(
16
)
redirectandroid
.
parms
[
'android_id_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'is_s2s'
]
=
'1'
redirectandroid
.
parms
[
'touchpoint_type'
]
=
'click'
redirectandroid
.
parms
[
'attribution_type'
]
=
'ua'
redirectandroid
.
send_request
(
'33322'
,
''
)
# is_s2s,ts,device_info,turl_id,attribution_type,ts,device_info满足校验规则,touchpoint_type不满足规则
def
test_at_newclick5
():
redirectandroid
.
parms
[
'ipv4'
]
=
ip
redirectandroid
.
parms
[
'oaid'
]
=
o
redirectandroid
.
parms
[
'oaid_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei1'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei1_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei2'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei2_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'gaid'
]
=
code_nums
(
36
)
redirectandroid
.
parms
[
'gaid_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'mac'
]
=
code_nums
(
17
)
redirectandroid
.
parms
[
'mac_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'android_id'
]
=
code_nums
(
16
)
redirectandroid
.
parms
[
'android_id_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'is_s2s'
]
=
'1'
redirectandroid
.
parms
[
'touchpoint_type'
]
=
'click1'
redirectandroid
.
parms
[
'attribution_type'
]
=
'ua'
redirectandroid
.
send_request3
(
''
)
# is_s2s,ts,device_info,turl_id,touchpoint_type,ts,device_info满足校验规则,attribution_type不满足规则
def
test_at_newclick6
():
redirectandroid
.
parms
[
'ipv4'
]
=
ip
redirectandroid
.
parms
[
'oaid'
]
=
o
redirectandroid
.
parms
[
'oaid_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei1'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei1_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei2'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei2_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'gaid'
]
=
code_nums
(
36
)
redirectandroid
.
parms
[
'gaid_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'mac'
]
=
code_nums
(
17
)
redirectandroid
.
parms
[
'mac_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'android_id'
]
=
code_nums
(
16
)
redirectandroid
.
parms
[
'android_id_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'is_s2s'
]
=
'1'
redirectandroid
.
parms
[
'touchpoint_type'
]
=
'click'
redirectandroid
.
parms
[
'attribution_type'
]
=
'ua1'
redirectandroid
.
send_request3
(
''
)
# 所以设备都合法
def
test_at_newclick
():
redirectandroid
.
parms
[
'ipv4'
]
=
ip
redirectandroid
.
parms
[
'oaid'
]
=
o
redirectandroid
.
parms
[
'oaid_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei1'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei1_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei2'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'imei2_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'gaid'
]
=
code_nums
(
36
)
redirectandroid
.
parms
[
'gaid_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'mac'
]
=
code_nums
(
17
)
redirectandroid
.
parms
[
'mac_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'android_id'
]
=
code_nums
(
16
)
redirectandroid
.
parms
[
'android_id_md5'
]
=
code_nums
(
32
)
redirectandroid
.
parms
[
'is_s2s'
]
=
'1'
redirectandroid
.
parms
[
'touchpoint_type'
]
=
'click'
redirectandroid
.
parms
[
'attribution_type'
]
=
'ua'
redirectandroid
.
send_request3
(
''
)
\ No newline at end of file
microservices/attributioncaseios.py
View file @
15ed9f4b
...
...
@@ -24,6 +24,20 @@ def computeMD5upper(message):
return
m
.
hexdigest
()
.
upper
()
n
=
10
def
code_nums
(
n
=
6
):
ret
=
''
for
i
in
range
(
n
):
num
=
random
.
randint
(
0
,
9
)
letter
=
chr
(
random
.
randint
(
97
,
122
))
s
=
str
(
random
.
choice
([
num
,
letter
]))
ret
+=
s
return
ret
def
idfacode
():
ret
=
''
a
=
""
.
join
(
random
.
sample
(
string
.
ascii_letters
+
string
.
digits
,
8
))
...
...
@@ -1922,6 +1936,9 @@ def test_impatb9():
# 1.传一个激活,google自归因查询为true,2.last touch来自google渠道
# 归因为google,并通知google
# google归因
...
...
@@ -1973,8 +1990,8 @@ def test_atbgoogle2():
# asa激活
def
test_atbgoogle3
():
i
=
idfacode
()
# i = '3C3FA051-DB2A-4F4F-9154-BC15EF565750
'
#
i = idfacode()
i
=
'9C3FA051-DB2A-4F4F-9154-BC15EF565773
'
v
=
idfvcode
()
receiveios
.
data
[
0
][
'device_info'
][
'idfa'
]
=
i
receiveios
.
data
[
0
][
'timestamp_info'
][
'current_event_time'
]
=
'1659148260199'
...
...
@@ -2023,6 +2040,8 @@ def test_atbgoogle4():
print
(
i
)
#激活中idfa为空
def
test_atbgoogle5
():
i2
=
idfacode
()
...
...
@@ -2049,4 +2068,110 @@ def test_atbgoogle5():
# -------------------数据处理与归因逻辑优化----------------------
def
test_at_newipv4
():
i
=
idfacode
()
v
=
idfvcode
()
redirectios
.
parms
[
'ipv4'
]
=
ip
redirectios
.
parms
[
'idfa'
]
=
code_nums
(
37
)
redirectios
.
parms
[
'idfa_md5'
]
=
code_nums
(
33
)
redirectios
.
parms
[
'idfv'
]
=
code_nums
(
37
)
redirectios
.
parms
[
'idfv_md5'
]
=
code_nums
(
33
)
redirectios
.
parms
[
'is_s2s'
]
=
'1'
redirectios
.
parms
[
'touchpoint_type'
]
=
'click'
redirectios
.
parms
[
'attribution_type'
]
=
'ua'
redirectios
.
send_request3
(
''
)
time
.
sleep
(
3
)
receiveios
.
data
[
0
][
'device_info'
][
'idfa'
]
=
i
receiveios
.
data
[
0
][
'device_info'
][
'idfa_md5'
]
=
''
receiveios
.
data
[
0
][
'device_info'
][
'idfv'
]
=
v
receiveios
.
data
[
0
][
'device_info'
][
'idfv_md5'
]
=
computeMD5
(
v
)
receiveios
.
data
[
0
][
'device_info'
][
'device_id'
]
=
i
receiveios
.
data
[
0
][
'device_info'
][
'device_id_md5'
]
=
''
receiveios
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'idfa'
receiveios
.
data
[
0
][
'device_info'
][
'device_id_md5_type'
]
=
''
receiveios
.
data
[
0
][
'device_info'
][
'ipv4'
]
=
ip
receiveios
.
send_request
()
print
(
i
)
def
test_at_newidfa
():
i
=
idfacode
()
v
=
idfvcode
()
redirectios
.
parms
[
'ipv4'
]
=
code_nums
(
129
)
redirectios
.
parms
[
'idfa'
]
=
i
redirectios
.
parms
[
'idfa_md5'
]
=
code_nums
(
33
)
redirectios
.
parms
[
'idfv'
]
=
code_nums
(
37
)
redirectios
.
parms
[
'idfv_md5'
]
=
code_nums
(
33
)
redirectios
.
parms
[
'is_s2s'
]
=
'1'
redirectios
.
parms
[
'touchpoint_type'
]
=
'click'
redirectios
.
parms
[
'attribution_type'
]
=
'ua'
redirectios
.
send_request3
(
''
)
time
.
sleep
(
3
)
receiveios
.
data
[
0
][
'device_info'
][
'idfa'
]
=
i
receiveios
.
data
[
0
][
'device_info'
][
'idfa_md5'
]
=
''
receiveios
.
data
[
0
][
'device_info'
][
'idfv'
]
=
v
receiveios
.
data
[
0
][
'device_info'
][
'idfv_md5'
]
=
computeMD5
(
v
)
receiveios
.
data
[
0
][
'device_info'
][
'device_id'
]
=
i
receiveios
.
data
[
0
][
'device_info'
][
'device_id_md5'
]
=
''
receiveios
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'idfa'
receiveios
.
data
[
0
][
'device_info'
][
'device_id_md5_type'
]
=
''
receiveios
.
data
[
0
][
'device_info'
][
'ipv4'
]
=
ip
receiveios
.
send_request
()
time
.
sleep
(
6
)
receiveios
.
data
[
0
][
'device_info'
][
'idfa'
]
=
i
receiveios
.
data
[
0
][
'device_info'
][
'idfa_md5'
]
=
''
receiveios
.
data
[
0
][
'device_info'
][
'idfv'
]
=
v
receiveios
.
data
[
0
][
'device_info'
][
'idfv_md5'
]
=
computeMD5
(
v
)
receiveios
.
data
[
0
][
'device_info'
][
'device_id'
]
=
i
receiveios
.
data
[
0
][
'device_info'
][
'device_id_md5'
]
=
''
receiveios
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'idfa'
receiveios
.
data
[
0
][
'device_info'
][
'device_id_md5_type'
]
=
''
receiveios
.
data
[
0
][
'device_info'
][
'ipv4'
]
=
ip
receiveios
.
data
[
0
][
"event_info"
][
'event_name'
]
=
'register'
receiveios
.
data
[
0
][
"event_info"
][
'event_type'
]
=
'preset'
receiveios
.
send_request
()
print
(
i
)
def
test_at_newidfa_md5
():
i
=
idfacode
()
i2
=
code_nums
(
32
)
v
=
idfvcode
()
redirectios
.
parms
[
'ipv4'
]
=
code_nums
(
129
)
redirectios
.
parms
[
'idfa'
]
=
code_nums
(
37
)
redirectios
.
parms
[
'idfa_md5'
]
=
i2
redirectios
.
parms
[
'idfv'
]
=
code_nums
(
37
)
redirectios
.
parms
[
'idfv_md5'
]
=
code_nums
(
33
)
redirectios
.
parms
[
'is_s2s'
]
=
'1'
redirectios
.
parms
[
'touchpoint_type'
]
=
'click'
redirectios
.
parms
[
'attribution_type'
]
=
'ua'
redirectios
.
send_request3
(
''
)
time
.
sleep
(
3
)
receiveios
.
data
[
0
][
'device_info'
][
'idfa'
]
=
i
receiveios
.
data
[
0
][
'device_info'
][
'idfa_md5'
]
=
i2
receiveios
.
data
[
0
][
'device_info'
][
'idfv'
]
=
v
receiveios
.
data
[
0
][
'device_info'
][
'idfv_md5'
]
=
computeMD5
(
v
)
receiveios
.
data
[
0
][
'device_info'
][
'device_id'
]
=
i
receiveios
.
data
[
0
][
'device_info'
][
'device_id_md5'
]
=
i2
receiveios
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'idfa'
receiveios
.
data
[
0
][
'device_info'
][
'device_id_md5_type'
]
=
'idfa_md5'
receiveios
.
data
[
0
][
'device_info'
][
'ipv4'
]
=
ip
receiveios
.
send_request
()
print
(
i
)
# -------------------------所以设备都非法-------------------------
def
test_at_newclick1
():
i
=
idfacode
()
v
=
idfvcode
()
redirectios
.
parms
[
'ipv4'
]
=
code_nums
(
129
)
redirectios
.
parms
[
'idfa'
]
=
code_nums
(
37
)
redirectios
.
parms
[
'idfa_md5'
]
=
code_nums
(
33
)
redirectios
.
parms
[
'idfv'
]
=
code_nums
(
37
)
redirectios
.
parms
[
'idfv_md5'
]
=
code_nums
(
33
)
redirectios
.
parms
[
'is_s2s'
]
=
'1'
redirectios
.
parms
[
'touchpoint_type'
]
=
'click'
redirectios
.
parms
[
'attribution_type'
]
=
'ua'
redirectios
.
send_request3
(
''
)
microservices/receiveandroid.py
View file @
15ed9f4b
...
...
@@ -46,7 +46,7 @@ global data
data
=
[
{
"application_info"
:
{
"appkey"
:
"
666
"
,
"appkey"
:
"
111
"
,
"bundleid"
:
"3423232"
,
"app_version"
:
"1"
,
"channel_name"
:
"HUAWEI"
...
...
@@ -137,9 +137,9 @@ def send_request():
# 对接se地址
# url = 'http://tmtest-se.trackingio.com/receive/tkiov2/sdk'
# 测试
url
=
"http://tmtest.trackingio.com/receive/tkiov2/sdk"
#
url = "http://tmtest.trackingio.com/receive/tkiov2/sdk"
# 线上
#
url = "http://tkio-receive.solar-engine.com/receive/tkiov2/sdk"
url
=
"http://tkio-receive.solar-engine.com/receive/tkiov2/sdk"
data
[
0
][
'timestamp_info'
][
'install_time'
]
=
int
(
round
(
time
.
time
()
*
1000
))
print
(
data
)
response
=
requests
.
request
(
"POST"
,
url
,
headers
=
headers
,
data
=
json
.
dumps
(
data
))
...
...
@@ -193,9 +193,9 @@ def send_requestgoogle():
# 对接se地址
# url = 'http://tmtest-se.trackingio.com/receive/tkiov2/sdk'
# 测试
url
=
"http://tmtest.trackingio.com/receive/tkiov2/sdk"
#
url = "http://tmtest.trackingio.com/receive/tkiov2/sdk"
# 线上
#
url = "http://tkio-receive.solar-engine.com/receive/tkiov2/sdk"
url
=
"http://tkio-receive.solar-engine.com/receive/tkiov2/sdk"
print
(
data
)
response
=
requests
.
request
(
"POST"
,
url
,
headers
=
headers
,
data
=
json
.
dumps
(
data
))
...
...
@@ -1259,7 +1259,6 @@ def test_event_name1():
# event_type为custom
def
test_event_name2
():
# lst = []
newList
=
[
'222'
,
'wwqeWEW'
,
'We2_32e'
]
for
event
in
newList
:
data
[
0
][
"event_info"
][
'event_name'
]
=
event
...
...
microservices/receiveios.py
View file @
15ed9f4b
...
...
@@ -193,9 +193,9 @@ def send_requestgoogle():
# 对接se地址
# url = 'http://tmtest-se.trackingio.com/receive/tkiov2/sdk'
# 测试
#
url = "http://tmtest.trackingio.com/receive/tkiov2/sdk"
url
=
"http://tmtest.trackingio.com/receive/tkiov2/sdk"
# 线上
url
=
"http://tkio-receive.solar-engine.com/receive/tkiov2/sdk"
#
url = "http://tkio-receive.solar-engine.com/receive/tkiov2/sdk"
data
[
0
][
'timestamp_info'
][
'install_time'
]
=
int
(
round
(
time
.
time
()
*
1000
))
# data[0]['timestamp_info']['current_event_time'] = int(round(time.time() * 1000))
...
...
microservices/redirectandroid.py
View file @
15ed9f4b
...
...
@@ -2,6 +2,7 @@ import requests
import
json
import
time
import
pytest
import
random
url1
=
'http://tmtest.trackingio.com/receive/turl/3r5K1h9'
current_time_13
=
int
(
round
(
time
.
time
()
*
1000
))
zf35
=
'54321422322132132131213133322323233'
...
...
@@ -12,7 +13,18 @@ zf468 = '1.2.23.3.4.4232.213123.13.23.213.123.123.213.21.321.3.213.12.321.3.21.3
zf668
=
'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.36Mozilla/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.36Mozilla/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.36Mozilla/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'
zf256
=
'测试广告组名称,广告计划名称,广告创意名称,渠道回调id,渠道回调地址等于256字符广告组名称,广告计划名称,广告创意名称,渠道回调id,渠道回调地址等于256字符广告组名称,广告计划名称,广告创意名称,渠道回调id,渠道回调地址等于256字符广告组名称,广告计划名称fff'
global
parms
# 生成小写字母加数字组合
n
=
10
def
code_nums
(
n
=
6
):
ret
=
''
for
i
in
range
(
n
):
num
=
random
.
randint
(
0
,
9
)
letter
=
chr
(
random
.
randint
(
97
,
122
))
s
=
str
(
random
.
choice
([
num
,
letter
]))
ret
+=
s
return
ret
parms
=
{
'ry_touchpoint_ts'
:
int
(
round
(
time
.
time
()
*
1000
)),
# 触点传参时间。is_s2s=1时必传,0时选传。不同渠道有可能传多种格式,详见需求。限制32位字符内。短链传参。
...
...
@@ -109,7 +121,9 @@ data_temp = json.dumps(parms)
# 有短链及参数要求的用该方法
def
send_request
(
dl
,
cs
):
global
parms
url1
=
'http://tmtest.trackingio.com/receive/turl/'
+
dl
+
cs
# url1 = 'http://tmtest.trackingio.com/receive/turl/' + dl + cs
url1
=
'http://tkio-redirect.solar-engine.com/receive/turl/'
+
dl
+
cs
response
=
requests
.
get
(
url
=
url1
,
params
=
parms
,
timeout
=
10
,
verify
=
False
)
print
(
response
.
url
)
print
(
response
.
text
)
...
...
@@ -130,14 +144,17 @@ def send_request2():
def
send_request3
(
cs
):
global
parms
# 测试
url1
=
'http://tmtest.trackingio.com/receive/turl/M7vIre
a'
+
cs
# url1 = 'http://tmtest.trackingio.com/receive/turl/qIjQBj
a' + cs
# 线上
#
url1 = 'http://tkio-redirect.solar-engine.com/receive/turl/FFNn2aa' + cs
url1
=
'http://tkio-redirect.solar-engine.com/receive/turl/FFNn2aa'
+
cs
parms
[
'ts'
]
=
int
(
round
(
time
.
time
()
*
1000
))
# parms['ts'] = int(round(time.time()))
parms
[
'ry_touchpoint_ts'
]
=
int
(
round
(
time
.
time
()
*
1000
))
response
=
requests
.
get
(
url
=
url1
,
params
=
parms
,
timeout
=
10
,
verify
=
False
)
print
(
response
.
url
)
print
(
response
.
text
)
print
(
response
.
status_code
)
parms
=
json
.
loads
(
data_temp
)
response
=
json
.
loads
(
response
.
text
)
return
response
...
...
@@ -146,8 +163,8 @@ def send_request3(cs):
def
send_request4
():
global
parms
url1
=
'http://tmtest.trackingio.com/receive/turl/QN3eQb
a'
# url1 = 'http://tkio-redirect.solar-engine.com/receive/turl/vMvqE3
a'
# url1 = 'http://tmtest.trackingio.com/receive/turl/qIjQBj
a'
url1
=
'http://tkio-redirect.solar-engine.com/receive/turl/FFNn2a
a'
response
=
requests
.
get
(
url
=
url1
,
params
=
parms
,
timeout
=
10
,
verify
=
False
)
print
(
response
.
url
)
...
...
@@ -162,8 +179,13 @@ def test_dl():
re
=
send_request
(
'33322'
,
''
)
assert
re
[
"status"
]
==
166
# 触点传参时间等于10位
def
test_ts10
():
parms
[
'ts'
]
=
'1231234567'
re
=
send_request4
()
assert
re
[
"status"
]
==
0
# 触点传参时间为正常
# 触点传参时间为正常
13位
def
test_ts9
():
parms
[
'ts'
]
=
current_time_13
re
=
send_request4
()
...
...
@@ -176,6 +198,11 @@ def test_ts8():
re
=
send_request4
()
assert
re
[
"status"
]
==
167
# 触点传参时间小于10位
def
test_ts8
():
parms
[
'ts'
]
=
'16462'
re
=
send_request4
()
assert
re
[
"status"
]
==
167
# 触点传参时间等于13字符,但是包含特殊字符
def
test_ts7
():
...
...
@@ -184,7 +211,7 @@ def test_ts7():
assert
re
[
"status"
]
==
167
# 触点传参时间等于13字符,但是包含汉
子
# 触点传参时间等于13字符,但是包含汉
字
def
test_ts0
():
parms
[
'ts'
]
=
'1测4690943661'
re
=
send_request4
()
...
...
@@ -260,7 +287,7 @@ def test_os1():
def
test_os2
():
parms
[
'os'
]
=
zf35
re
=
send_request4
()
assert
re
[
"status"
]
==
115
assert
re
[
"status"
]
==
0
...
...
@@ -295,7 +322,7 @@ def test_model1():
def
test_model2
():
parms
[
'model'
]
=
zf130
re
=
send_request4
()
assert
re
[
"status"
]
==
118
assert
re
[
"status"
]
==
0
# 设备型号=64字符
...
...
@@ -313,19 +340,19 @@ def test_ipv41():
assert
re
[
"status"
]
==
0
# 用户公网IP v4版本为空,is_s2s为1
# 用户公网IP v4版本为空,is_s2s为1
,其他设备无数据
def
test_ipv42
():
parms
[
'ipv4'
]
=
""
parms
[
'is_s2s'
]
=
'1'
re
=
send_request4
()
assert
re
[
"status"
]
==
119
assert
re
[
"status"
]
==
221
# 用户公网IP v4版本超过1
5字符
# 用户公网IP v4版本超过1
28字符,其他设备无数据
def
test_ipv43
():
parms
[
'ipv4'
]
=
zf35
parms
[
'ipv4'
]
=
code_nums
(
129
)
re
=
send_request4
()
assert
re
[
"status"
]
==
119
assert
re
[
"status"
]
==
221
# 用户公网IP v4版本为空,is_s2s为0,取http header中的ip作为ipv4/ua的值
...
...
@@ -343,11 +370,11 @@ def test_ipv45():
send_request2
()
# 用户公网ipv6版本超过128字符
#
#
用户公网ipv6版本超过128字符
def
test_ipv61
():
parms
[
'ipv6'
]
=
zf468
parms
[
'ipv6'
]
=
code_nums
(
129
)
re
=
send_request4
()
assert
re
[
"status"
]
==
12
0
assert
re
[
"status"
]
==
0
# 用户公网ipv6版本为空
...
...
@@ -369,7 +396,7 @@ def test_ua1():
parms
[
'ua'
]
=
""
parms
[
'is_s2s'
]
=
'1'
re
=
send_request4
()
assert
re
[
"status"
]
==
121
assert
re
[
"status"
]
==
0
# 用户代理信息超过512字符
...
...
@@ -377,7 +404,7 @@ def test_ua2():
parms
[
'ua'
]
=
zf668
parms
[
'is_s2s'
]
=
'1'
re
=
send_request4
()
assert
re
[
"status"
]
==
121
assert
re
[
"status"
]
==
0
# 用户代理信息为空,is_s2s=0
...
...
@@ -387,293 +414,293 @@ def test_ua3():
send_request2
()
# OAID超过512字符
def
test_oaid1
():
parms
[
'oaid'
]
=
zf668
re
=
send_request4
()
assert
re
[
"status"
]
==
126
# OAID为空
def
test_oaid2
():
parms
[
'oaid'
]
=
''
re
=
send_request4
()
assert
re
[
"status"
]
==
0
# OAID小于512
def
test_oaid3
():
parms
[
'oaid'
]
=
'3DEA635F-B24F-434B-833F-4ED028FEAEEF'
re
=
send_request4
()
assert
re
[
"status"
]
==
0
# oaid_md5超过32字符
def
test_oaid_md51
():
parms
[
'oaid_md5'
]
=
zf35
re
=
send_request4
()
assert
re
[
"status"
]
==
127
# oaid_md5为空
def
test_oaid_md52
():
parms
[
'oaid_md5'
]
=
''
re
=
send_request4
()
assert
re
[
"status"
]
==
0
# oaid_md5为32字符
def
test_oaid_md53
():
parms
[
'oaid_md5'
]
=
'8e488a40a17aed2f6752f51382a4eafc'
re
=
send_request4
()
assert
re
[
"status"
]
==
0
#
#
OAID超过512字符
#
def test_oaid1():
#
parms['oaid'] = zf668
#
re = send_request4()
#
assert re["status"] == 126
#
#
#
#
OAID为空
#
def test_oaid2():
#
parms['oaid'] = ''
#
re = send_request4()
#
assert re["status"] == 0
#
#
#
#
OAID小于512
#
def test_oaid3():
#
parms['oaid'] = '3DEA635F-B24F-434B-833F-4ED028FEAEEF'
#
re = send_request4()
#
assert re["status"] == 0
#
#
#
#
oaid_md5超过32字符
#
def test_oaid_md51():
#
parms['oaid_md5'] = zf35
#
re = send_request4()
#
assert re["status"] == 127
#
#
#
#
oaid_md5为空
#
def test_oaid_md52():
#
parms['oaid_md5'] = ''
#
re = send_request4()
#
assert re["status"] == 0
#
#
#
#
oaid_md5为32字符
#
def test_oaid_md53():
#
parms['oaid_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
#
re = send_request4()
#
assert re["status"] == 0
# 各个设备的md5为32字符,大写
def
test_oaid_md54
():
newlist
=
[
'oaid_md5'
,
'imei1_md5'
,
'imei2_md5'
,
'gaid_md5'
,
'mac_md5'
,
'android_id_md5'
]
for
shebei_md5
in
newlist
:
parms
[
shebei_md5
]
=
'8E488A40A17AED2F6752F51382A4EAFC'
re
=
send_request4
()
assert
re
[
"status"
]
==
0
#
def test_oaid_md54():
#
newlist = ['oaid_md5', 'imei1_md5', 'imei2_md5', 'gaid_md5', 'mac_md5', 'android_id_md5']
#
for shebei_md5 in newlist:
#
parms[shebei_md5] = '8E488A40A17AED2F6752F51382A4EAFC'
#
re = send_request4()
#
assert re["status"] == 0
# imei1超过32字符
def
test_imei11
():
parms
[
'imei1'
]
=
zf35
re
=
send_request4
()
assert
re
[
"status"
]
==
128
# imei1为空
def
test_imei12
():
parms
[
'imei1'
]
=
''
re
=
send_request4
()
assert
re
[
"status"
]
==
0
# imei1为正常
def
test_imei13
():
parms
[
'imei1'
]
=
'8342732742383'
re
=
send_request4
()
assert
re
[
"status"
]
==
0
# imei1_md5非32字符
def
test_imei1_md51
():
parms
[
'imei1_md5'
]
=
zf35
re
=
send_request4
()
assert
re
[
"status"
]
==
129
# imei1_md5为32字符
def
test_imei1_md53
():
parms
[
'imei1_md5'
]
=
'8e488a40a17aed2f6752f51382a4eafc'
re
=
send_request4
()
assert
re
[
"status"
]
==
0
# imei1_md5为空
def
test_imei1_md52
():
parms
[
'imei1_md5'
]
=
''
re
=
send_request4
()
assert
re
[
"status"
]
==
0
# imei2超过32字符
def
test_imei21
():
parms
[
'imei2'
]
=
zf35
re
=
send_request4
()
assert
re
[
"status"
]
==
130
# imei2为空
def
test_imei22
():
parms
[
'imei2'
]
=
''
re
=
send_request4
()
assert
re
[
"status"
]
==
0
# imei2为32字符内
def
test_imei23
():
parms
[
'imei2'
]
=
'8342732742383'
re
=
send_request4
()
assert
re
[
"status"
]
==
0
# imei2_md5非32字符
def
test_imei2_md51
():
parms
[
'imei2_md5'
]
=
zf35
re
=
send_request4
()
assert
re
[
"status"
]
==
131
# imei2_md5为空
def
test_imei2_md52
():
parms
[
'imei2_md5'
]
=
''
re
=
send_request4
()
assert
re
[
"status"
]
==
0
# imei2_md5为32字符
def
test_imei2_md53
():
parms
[
'imei2_md5'
]
=
'8e488a40a17aed2f6752f51382a4eafc'
re
=
send_request4
()
assert
re
[
"status"
]
==
0
# gaid非36字符
def
test_gaid1
():
parms
[
'gaid'
]
=
zf35
re
=
send_request4
()
assert
re
[
"status"
]
==
132
# gaid为空
def
test_gaid2
():
parms
[
'gaid'
]
=
''
re
=
send_request4
()
assert
re
[
"status"
]
==
0
# gaid为36字符
def
test_gaid3
():
parms
[
'gaid'
]
=
'B21C5EC5-9921-42FD-AAC5-07A0EB6CF1A0'
re
=
send_request4
()
assert
re
[
"status"
]
==
0
# gaid_md5非32字符
def
test_gaid_md51
():
parms
[
'gaid_md5'
]
=
zf35
re
=
send_request4
()
assert
re
[
"status"
]
==
133
# gaid_md5为空
def
test_gaid_md52
():
parms
[
'gaid_md5'
]
=
''
re
=
send_request4
()
assert
re
[
"status"
]
==
0
# gaid_md5为32 字符
def
test_gaid_md53
():
parms
[
'gaid_md5'
]
=
'8e488a40a17aed2f6752f51382a4eafc'
re
=
send_request4
()
assert
re
[
"status"
]
==
0
# mac非17个字符
def
test_mac1
():
parms
[
'mac'
]
=
"111111"
re
=
send_request4
()
assert
re
[
"status"
]
==
134
# mac为空
def
test_mac2
():
parms
[
'mac'
]
=
""
re
=
send_request4
()
assert
re
[
"status"
]
==
0
# mac为17字符
def
test_mac3
():
parms
[
'mac'
]
=
"08:00:20:0A:8C:6D"
re
=
send_request4
()
assert
re
[
"status"
]
==
0
# mac_md5非32字符
def
test_mac_md51
():
parms
[
'mac_md5'
]
=
zf35
re
=
send_request4
()
assert
re
[
"status"
]
==
135
# mac_md5为空
def
test_mac_md52
():
parms
[
'gaid_md5'
]
=
''
re
=
send_request4
()
assert
re
[
"status"
]
==
0
# mac_md5 32字符
def
test_mac_md53
():
parms
[
'gaid_md5'
]
=
'8e488a40a17aed2f6752f51382a4eafc'
re
=
send_request4
()
assert
re
[
"status"
]
==
0
# android_id非16字符
def
test_android_id1
():
parms
[
'android_id'
]
=
zf35
re
=
send_request4
()
assert
re
[
"status"
]
==
136
# android_id为空
def
test_android_id2
():
parms
[
'android_id'
]
=
''
re
=
send_request4
()
assert
re
[
"status"
]
==
0
# android_id为16字符
def
test_android_id3
():
parms
[
'android_id'
]
=
'1a34fc556a43c453'
re
=
send_request4
()
assert
re
[
"status"
]
==
0
# android_id_md5非32字符
def
test_android_id_md51
():
parms
[
'android_id_md5'
]
=
zf35
re
=
send_request4
()
assert
re
[
"status"
]
==
189
# android_id_md5为空
def
test_android_id_md52
():
parms
[
'android_id_md5'
]
=
''
re
=
send_request4
()
assert
re
[
"status"
]
==
0
# android_id_md5为32字符
def
test_android_id_md53
():
parms
[
'android_id_md5'
]
=
'8e488a40a17aed2f6752f51382a4eafc'
re
=
send_request4
()
assert
re
[
"status"
]
==
0
#
def test_imei11():
#
parms['imei1'] = zf35
#
re = send_request4()
#
assert re["status"] == 128
#
#
#
#
imei1为空
#
def test_imei12():
#
parms['imei1'] = ''
#
re = send_request4()
#
assert re["status"] == 0
#
#
#
#
imei1为正常
#
def test_imei13():
#
parms['imei1'] = '8342732742383'
#
re = send_request4()
#
assert re["status"] == 0
#
#
#
#
imei1_md5非32字符
#
def test_imei1_md51():
#
parms['imei1_md5'] = zf35
#
re = send_request4()
#
assert re["status"] == 129
#
#
#
#
imei1_md5为32字符
#
def test_imei1_md53():
#
parms['imei1_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
#
re = send_request4()
#
assert re["status"] == 0
#
#
#
#
imei1_md5为空
#
def test_imei1_md52():
#
parms['imei1_md5'] = ''
#
re = send_request4()
#
assert re["status"] == 0
#
#
#
#
imei2超过32字符
#
def test_imei21():
#
parms['imei2'] = zf35
#
re = send_request4()
#
assert re["status"] == 130
#
#
#
#
imei2为空
#
def test_imei22():
#
parms['imei2'] = ''
#
re = send_request4()
#
assert re["status"] == 0
#
#
#
#
imei2为32字符内
#
def test_imei23():
#
parms['imei2'] = '8342732742383'
#
re = send_request4()
#
assert re["status"] == 0
#
#
#
#
imei2_md5非32字符
#
def test_imei2_md51():
#
parms['imei2_md5'] = zf35
#
re = send_request4()
#
assert re["status"] == 131
#
#
#
#
imei2_md5为空
#
def test_imei2_md52():
#
parms['imei2_md5'] = ''
#
re = send_request4()
#
assert re["status"] == 0
#
#
#
#
imei2_md5为32字符
#
def test_imei2_md53():
#
parms['imei2_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
#
re = send_request4()
#
assert re["status"] == 0
#
#
#
#
gaid非36字符
#
def test_gaid1():
#
parms['gaid'] = zf35
#
re = send_request4()
#
assert re["status"] == 132
#
#
#
#
gaid为空
#
def test_gaid2():
#
parms['gaid'] = ''
#
re = send_request4()
#
assert re["status"] == 0
#
#
#
#
gaid为36字符
#
def test_gaid3():
#
parms['gaid'] = 'B21C5EC5-9921-42FD-AAC5-07A0EB6CF1A0'
#
re = send_request4()
#
assert re["status"] == 0
#
#
#
#
gaid_md5非32字符
#
def test_gaid_md51():
#
parms['gaid_md5'] = zf35
#
re = send_request4()
#
assert re["status"] == 133
#
#
#
#
gaid_md5为空
#
def test_gaid_md52():
#
parms['gaid_md5'] = ''
#
re = send_request4()
#
assert re["status"] == 0
#
#
#
#
gaid_md5为32 字符
#
def test_gaid_md53():
#
parms['gaid_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
#
re = send_request4()
#
assert re["status"] == 0
#
#
#
#
mac非17个字符
#
def test_mac1():
#
parms['mac'] = "111111"
#
re = send_request4()
#
assert re["status"] == 134
#
#
mac为空
#
def test_mac2():
#
parms['mac'] = ""
#
re = send_request4()
#
assert re["status"] == 0
#
#
#
#
mac为17字符
#
def test_mac3():
#
parms['mac'] = "08:00:20:0A:8C:6D"
#
re = send_request4()
#
assert re["status"] == 0
#
#
#
#
mac_md5非32字符
#
def test_mac_md51():
#
parms['mac_md5'] = zf35
#
re = send_request4()
#
assert re["status"] == 135
#
#
#
#
mac_md5为空
#
def test_mac_md52():
#
parms['gaid_md5'] = ''
#
re = send_request4()
#
assert re["status"] == 0
#
#
#
#
mac_md5 32字符
#
def test_mac_md53():
#
parms['gaid_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
#
re = send_request4()
#
assert re["status"] == 0
#
#
#
#
android_id非16字符
#
def test_android_id1():
#
parms['android_id'] = zf35
#
re = send_request4()
#
assert re["status"] == 136
#
#
#
#
android_id为空
#
def test_android_id2():
#
parms['android_id'] = ''
#
re = send_request4()
#
assert re["status"] == 0
#
#
#
#
android_id为16字符
#
def test_android_id3():
#
parms['android_id'] = '1a34fc556a43c453'
#
re = send_request4()
#
assert re["status"] == 0
#
#
#
#
android_id_md5非32字符
#
def test_android_id_md51():
#
parms['android_id_md5'] = zf35
#
re = send_request4()
#
assert re["status"] == 189
#
#
android_id_md5为空
#
def test_android_id_md52():
#
parms['android_id_md5'] = ''
#
re = send_request4()
#
assert re["status"] == 0
#
#
#
#
android_id_md5为32字符
#
def test_android_id_md53():
#
parms['android_id_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
#
re = send_request4()
#
assert re["status"] == 0
# 短链是安卓,传idfa
def
test_idfa1
():
parms
[
'idfa'
]
=
'3DEA635F-B24F-434B-833F-4ED028FEAEEF'
re
=
send_request4
()
assert
re
[
"status"
]
==
115
assert
re
[
"status"
]
==
220
# 短链是安卓,传idfa_md5
def
test_idfa_md51
():
parms
[
'idfa_md5'
]
=
'8e488a40a17aed2f6752f51382a4eafc'
re
=
send_request4
()
assert
re
[
"status"
]
==
115
assert
re
[
"status"
]
==
220
# 短链是安卓,传idfv
def
test_idfv1
():
parms
[
'idfv'
]
=
'3DEA635F-B24F-434B-833F-4ED028FEAEEF'
re
=
send_request4
()
assert
re
[
"status"
]
==
115
assert
re
[
"status"
]
==
220
# 短链是安卓,传idfv_md5
def
test_idfv_md51
():
parms
[
'idfv_md5'
]
=
'8e488a40a17aed2f6752f51382a4eafc'
re
=
send_request4
()
assert
re
[
"status"
]
==
115
assert
re
[
"status"
]
==
220
# oaid","oaid_md5","imei1","imei1_md5","imei2","imei2_md5","mac","mac_md5","mac1","mac1_md5","gaid","gaid_md5"全部为空
...
...
@@ -718,14 +745,14 @@ def test_ads_data2():
# 广告账户id,广告组id,广告计划id,广告位id,转化id,广告点击id,广告展示id,广告请求id超过64字符
def
test_ads_data3
():
newlist
=
[{
'name'
:
'account_id'
,
'status'
:
168
},
{
'name'
:
'adgroup_id'
,
'status'
:
169
},
{
'name'
:
'adplan_id'
,
'status'
:
171
},
{
'name'
:
'placement_id'
,
'status'
:
179
},
{
'name'
:
'conversion_id'
,
'status'
:
18
0
},
{
'name'
:
'click_id'
,
'status'
:
181
},
{
'name'
:
'impression_id'
,
'status'
:
182
},
{
'name'
:
'request_id'
,
'status'
:
183
},
newlist
=
[{
'name'
:
'account_id'
,
'status'
:
0
},
{
'name'
:
'adgroup_id'
,
'status'
:
0
},
{
'name'
:
'adplan_id'
,
'status'
:
0
},
{
'name'
:
'placement_id'
,
'status'
:
0
},
{
'name'
:
'conversion_id'
,
'status'
:
0
},
{
'name'
:
'click_id'
,
'status'
:
0
},
{
'name'
:
'impression_id'
,
'status'
:
0
},
{
'name'
:
'request_id'
,
'status'
:
0
},
]
for
ads_data
in
newlist
:
parms
[
ads_data
[
'name'
]]
=
zf130
...
...
@@ -735,11 +762,10 @@ def test_ads_data3():
# 广告组名称,广告计划名称,广告创意名称,渠道回调id,渠道回调地址超过256字符
def
test_ads_data4
():
newlist
=
[{
'name'
:
'adgroup_name'
,
'status'
:
170
},
{
'name'
:
'adplan_name'
,
'status'
:
172
},
{
'name'
:
'adcreative_name'
,
'status'
:
174
},
{
'name'
:
'callback_id'
,
'status'
:
184
},
{
'name'
:
'callback_url'
,
'status'
:
185
},
newlist
=
[{
'name'
:
'adgroup_name'
,
'status'
:
0
},
{
'name'
:
'adplan_name'
,
'status'
:
0
},
{
'name'
:
'adcreative_name'
,
'status'
:
0
},
{
'name'
:
'callback_id'
,
'status'
:
0
},
]
for
ads_data
in
newlist
:
parms
[
ads_data
[
'name'
]]
=
zf468
...
...
@@ -799,9 +825,9 @@ def test_ads_data8():
# 创意类型,广告类型,流量媒体id超过32字符
def
test_ads_data9
():
newlist
=
[{
'name'
:
'adcreative_type'
,
'status'
:
175
},
{
'name'
:
'site_id'
,
'status'
:
176
},
{
'name'
:
'ad_type'
,
'status'
:
178
},
newlist
=
[{
'name'
:
'adcreative_type'
,
'status'
:
0
},
{
'name'
:
'site_id'
,
'status'
:
0
},
{
'name'
:
'ad_type'
,
'status'
:
0
},
]
for
ads_data
in
newlist
:
parms
[
ads_data
[
'name'
]]
=
zf35
...
...
@@ -851,7 +877,7 @@ def test_custom_params1():
def
test_custom_params2
():
parms
[
'custom_params_1'
]
=
zf35
re
=
send_request4
()
assert
re
[
"status"
]
==
186
assert
re
[
"status"
]
==
0
if
__name__
==
'__main__'
:
...
...
microservices/redirectios.py
View file @
15ed9f4b
...
...
@@ -104,9 +104,9 @@ def send_request(cs):
def
send_request3
(
cs
):
global
parms
# 测试
# url1 = 'http://tmtest.trackingio.com/receive/turl/uaa6N3
a' + cs
url1
=
'http://tmtest.trackingio.com/receive/turl/vMjIBz
a'
+
cs
# 线上
url1
=
'http://tkio-redirect.solar-engine.com/receive/turl/6Z3Yrya'
+
cs
#
url1 = 'http://tkio-redirect.solar-engine.com/receive/turl/6Z3Yrya' + cs
parms
[
'ts'
]
=
int
(
round
(
time
.
time
()
*
1000
))
response
=
requests
.
get
(
url
=
url1
,
params
=
parms
,
timeout
=
10
,
verify
=
False
)
print
(
response
.
url
)
...
...
@@ -149,10 +149,10 @@ def test_idfa3():
# idfa非32字符
def
test_idfa4
():
parms
[
'idfa'
]
=
zf35
re
=
send_request
(
''
)
assert
re
[
"status"
]
==
124
#
def test_idfa4():
#
parms['idfa'] = zf35
#
re = send_request('')
#
assert re["status"] == 124
# idfa_md5为空
...
...
@@ -177,10 +177,10 @@ def test_idfa_md53():
# idfa_md5非32字符
def
test_idfa_md54
():
parms
[
'idfa_md5'
]
=
zf35
re
=
send_request
(
''
)
assert
re
[
"status"
]
==
187
#
def test_idfa_md54():
#
parms['idfa_md5'] = zf35
#
re = send_request('')
#
assert re["status"] == 187
# idfv和idfv_md5同上
...
...
@@ -206,10 +206,10 @@ def test_idfv3():
# idfv非32字符
def
test_idfv4
():
parms
[
'idfv'
]
=
zf35
re
=
send_request
(
''
)
assert
re
[
"status"
]
==
125
#
def test_idfv4():
#
parms['idfv'] = zf35
#
re = send_request('')
#
assert re["status"] == 125
...
...
@@ -235,10 +235,10 @@ def test_idfv_md53():
# idfv_md5非32字符
def
test_idfv_md54
():
parms
[
'idfv_md5'
]
=
zf35
re
=
send_request
(
''
)
assert
re
[
"status"
]
==
188
#
def test_idfv_md54():
#
parms['idfv_md5'] = zf35
#
re = send_request('')
#
assert re["status"] == 188
...
...
@@ -246,21 +246,21 @@ def test_idfv_md54():
def
test_oaid
():
parms
[
'oaid'
]
=
'3DEA635F-B24F-434B-833F-4ED028FEAEE'
re
=
send_request
(
''
)
assert
re
[
"status"
]
==
115
assert
re
[
"status"
]
==
219
# 短链是ios,传oaid_md5
def
test_oaid_md5
():
parms
[
'oaid_md5'
]
=
'8e488a40a17aed2f6752f51382a4eafc'
re
=
send_request
(
''
)
assert
re
[
"status"
]
==
115
assert
re
[
"status"
]
==
219
# 短链是ios,传imei1
def
test_imei1
():
parms
[
'imei1'
]
=
'8342732742383'
re
=
send_request
(
''
)
assert
re
[
"status"
]
==
115
assert
re
[
"status"
]
==
219
...
...
@@ -268,35 +268,35 @@ def test_imei1():
def
test_imei1_md5
():
parms
[
'imei1_md5'
]
=
'8e488a40a17aed2f6752f51382a4eafc'
re
=
send_request
(
''
)
assert
re
[
"status"
]
==
115
assert
re
[
"status"
]
==
219
# 短链是ios,传imei2
def
test_imei2
():
parms
[
'imei2'
]
=
'8342732742383'
re
=
send_request
(
''
)
assert
re
[
"status"
]
==
115
assert
re
[
"status"
]
==
219
# 短链是ios,传imei2_md5
def
test_imei2_md5
():
parms
[
'imei2_md5'
]
=
'8e488a40a17aed2f6752f51382a4eafc'
re
=
send_request
(
''
)
assert
re
[
"status"
]
==
115
assert
re
[
"status"
]
==
219
# 短链是ios,传gaid
def
test_gaid
():
parms
[
'gaid'
]
=
'B21C5EC5-9921-42FD-AAC5-07A0EB6CF1A0'
re
=
send_request
(
''
)
assert
re
[
"status"
]
==
115
assert
re
[
"status"
]
==
219
# 短链是ios,传gaid_md5
def
test_gaid_md5
():
parms
[
'gaid_md5'
]
=
'8e488a40a17aed2f6752f51382a4eafc'
re
=
send_request
(
''
)
assert
re
[
"status"
]
==
115
assert
re
[
"status"
]
==
219
...
...
@@ -304,7 +304,7 @@ def test_gaid_md5():
def
test_mac
():
parms
[
'mac'
]
=
'B21C5EC5-9921-42FD-AAC5-07A0EB6CF1A0'
re
=
send_request
(
''
)
assert
re
[
"status"
]
==
115
assert
re
[
"status"
]
==
219
...
...
@@ -312,14 +312,14 @@ def test_mac():
def
test_mac_md5
():
parms
[
'mac_md5'
]
=
'8e488a40a17aed2f6752f51382a4eafc'
re
=
send_request
(
''
)
assert
re
[
"status"
]
==
115
assert
re
[
"status"
]
==
219
# 短链是ios,传android_id
def
test_android_id
():
parms
[
'android_id'
]
=
'1a34fc556a43c453'
re
=
send_request
(
''
)
assert
re
[
"status"
]
==
115
assert
re
[
"status"
]
==
219
...
...
@@ -327,7 +327,7 @@ def test_android_id():
def
test_android_id_md5
():
parms
[
'android_id'
]
=
'8e488a40a17aed2f6752f51382a4eafc'
re
=
send_request
(
''
)
assert
re
[
"status"
]
==
115
assert
re
[
"status"
]
==
219
...
...
tkio/attributioncaseandroid.py
View file @
15ed9f4b
...
...
@@ -25,6 +25,8 @@ def computeMD5lower(message):
# 生成小写字母加数字组合
n
=
10
def
code_nums1
(
n
=
6
):
ret
=
''
for
i
in
range
(
n
):
...
...
@@ -34,6 +36,15 @@ def code_nums1(n=6):
ret
+=
s
return
ret
# SHA加密
def
computesha
(
message
):
sha
=
hashlib
.
sha1
(
message
.
encode
(
'utf-8'
))
encrypts
=
sha
.
hexdigest
()
print
(
encrypts
)
return
encrypts
# **************************************************自定义归因测试用例开始**************************************************
# -----------------------------------点击激活的imei/imei_MD5,oaid,androidid,mac,ip值相同,归因到imei---------------------
# 点击imei=111,oaid=222,androidid=333,mac=444,ip=1.1.1.1激活imei=111,oaid=222,androidid=333,mac=444,ip=1.1.1.1
...
...
@@ -386,9 +397,9 @@ def test_ip2():
clickandroid
.
parms
[
'mac'
]
=
''
clickandroid
.
parms
[
'muid'
]
=
''
clickandroid
.
parms
[
'ip'
]
=
ip2
#
clickandroid.send_requestandroid('')
clickandroid
.
send_requestandroid
(
'&preorder=true'
)
time
.
sleep
(
5
)
clickandroid
.
send_requestandroid
(
''
)
#
clickandroid.send_requestandroid('&preorder=true')
time
.
sleep
(
6
)
tkioreceiveandroid
.
data
[
'context'
][
'_deviceid'
]
=
i
tkioreceiveandroid
.
data
[
'context'
][
'_imei'
]
=
i
tkioreceiveandroid
.
data
[
'context'
][
'_oaid'
]
=
oaid
...
...
@@ -535,9 +546,6 @@ def test_at5():
print
(
i
)
def
test_hl
():
i
=
code_nums1
(
32
)
oaid
=
code_nums1
(
15
)
...
...
@@ -620,7 +628,7 @@ def test_at6():
# **************************************************自定义归因测试用例结束**************************************************
#回流
#
回流
def
test_huiliu
():
i
=
code_nums1
(
32
)
# i = 'jxmqw8bbpj706d812w6q67dfo5pf4428'
...
...
@@ -668,11 +676,6 @@ def test_huiliu():
print
(
ip
)
# 分包
def
test_fenbao
():
i
=
code_nums1
(
32
)
...
...
@@ -694,7 +697,7 @@ def test_fenbao():
print
(
ip
)
#分包分链接
#
分包分链接
def
test_fbflj
():
i
=
code_nums1
(
32
)
# i = 'jxmqw8bbpj706d812w6q67dfo5pf4428'
...
...
@@ -723,9 +726,7 @@ def test_fbflj():
print
(
ip
)
#deeplink归因
# deeplink归因
def
test_deeplink
():
i
=
code_nums1
(
32
)
# i = 'jxmqw8bbpj706d812w6q67dfo5pf4428'
...
...
@@ -753,7 +754,7 @@ def test_deeplink():
print
(
ip
)
#preorder预约归因
#
preorder预约归因
def
test_preorder
():
i
=
code_nums1
(
32
)
# i = 'jxmqw8bbpj706d812w6q67dfo5pf4428'
...
...
@@ -837,7 +838,6 @@ def test_atboaid():
print
(
i
)
# oaidmd5
def
test_atboaidmd5
():
i
=
code_nums1
(
32
)
...
...
@@ -862,8 +862,6 @@ def test_atboaidmd5():
print
(
i
)
# androidid
def
test_atbandroidid
():
i
=
code_nums1
(
32
)
...
...
@@ -882,7 +880,7 @@ def test_atbandroidid():
tkioreceiveandroid
.
data
[
'context'
][
'_imei'
]
=
i
tkioreceiveandroid
.
data
[
'context'
][
'_androidid'
]
=
androidid
tkioreceiveandroid
.
data
[
'context'
][
'_ip'
]
=
ip
tkioreceiveandroid
.
data
[
'context'
][
'_apptype'
]
=
'quickApp'
#
tkioreceiveandroid.data['context']['_apptype'] = 'quickApp'
tkioreceiveandroid
.
send_request
()
print
(
i
)
...
...
@@ -910,13 +908,12 @@ def test_atbandroididmd5():
tkioreceiveandroid
.
data
[
'context'
][
'_oaid'
]
=
oaid
tkioreceiveandroid
.
data
[
'context'
][
'_androidid'
]
=
androidid
tkioreceiveandroid
.
data
[
'context'
][
'_ip'
]
=
ip
tkioreceiveandroid
.
data
[
'context'
][
'_apptype'
]
=
'quickApp'
#
tkioreceiveandroid.data['context']['_apptype'] = 'quickApp'
tkioreceiveandroid
.
send_request
()
print
(
i
)
# mac
def
test_atbmac
():
i
=
code_nums1
(
32
)
...
...
@@ -941,7 +938,7 @@ def test_atbmac():
tkioreceiveandroid
.
data
[
'context'
][
'_androidid'
]
=
androidid
tkioreceiveandroid
.
data
[
'context'
][
'_mac'
]
=
mac
tkioreceiveandroid
.
data
[
'context'
][
'_ip'
]
=
ip
tkioreceiveandroid
.
data
[
'context'
][
'_apptype'
]
=
'quickApp'
#
tkioreceiveandroid.data['context']['_apptype'] = 'quickApp'
tkioreceiveandroid
.
send_request
()
print
(
i
)
...
...
@@ -971,16 +968,217 @@ def test_atbmacmd5():
tkioreceiveandroid
.
data
[
'context'
][
'_androidid'
]
=
androidid
tkioreceiveandroid
.
data
[
'context'
][
'_mac'
]
=
mac
tkioreceiveandroid
.
data
[
'context'
][
'_ip'
]
=
ip
tkioreceiveandroid
.
data
[
'context'
][
'_apptype'
]
=
'quickApp'
# tkioreceiveandroid.data['context']['_apptype'] = 'quickApp'
tkioreceiveandroid
.
send_request
()
print
(
i
)
# jointype-归因方式补充
# imei2 纯数字可归因,带字母的设备暂时无法归因
def
test_jointypeimei2
():
i
=
'88978987787891'
oaid
=
code_nums1
(
15
)
mac
=
code_nums1
(
32
)
androidid
=
code_nums1
(
16
)
ip
=
socket
.
inet_ntoa
(
struct
.
pack
(
'>I'
,
random
.
randint
(
1
,
0xffffffff
)))
clickandroid
.
parms
[
'imei'
]
=
i
clickandroid
.
parms
[
'ip'
]
=
ip
clickandroid
.
send_requestandroid
(
''
)
# clickandroid.send_requestandroid('&preorder=true')
time
.
sleep
(
6
)
tkioreceiveandroid
.
data
[
'context'
][
'_deviceid'
]
=
i
tkioreceiveandroid
.
data
[
'context'
][
'_imei2'
]
=
i
tkioreceiveandroid
.
data
[
'context'
][
'_ip'
]
=
ip
tkioreceiveandroid
.
send_request
()
print
(
i
)
print
(
ip
)
# sha_imei
def
test_shaimei
():
i
=
code_nums1
(
12
)
ip
=
socket
.
inet_ntoa
(
struct
.
pack
(
'>I'
,
random
.
randint
(
1
,
0xffffffff
)))
clickandroid
.
parms
[
'imei'
]
=
computesha
(
i
)
clickandroid
.
parms
[
'ip'
]
=
ip
clickandroid
.
send_requestandroid
(
''
)
time
.
sleep
(
6
)
tkioreceiveandroid
.
data
[
'context'
][
'_deviceid'
]
=
i
tkioreceiveandroid
.
data
[
'context'
][
'_imei'
]
=
i
tkioreceiveandroid
.
data
[
'context'
][
'_ip'
]
=
ip
tkioreceiveandroid
.
send_request
()
print
(
i
)
print
(
ip
)
# md5_imei2
def
test_imei2md5
():
i
=
code_nums1
(
12
)
ip
=
socket
.
inet_ntoa
(
struct
.
pack
(
'>I'
,
random
.
randint
(
1
,
0xffffffff
)))
clickandroid
.
parms
[
'imei'
]
=
computeMD5lower
(
i
)
clickandroid
.
parms
[
'ip'
]
=
ip
clickandroid
.
send_requestandroid
(
''
)
time
.
sleep
(
6
)
tkioreceiveandroid
.
data
[
'context'
][
'_deviceid'
]
=
i
tkioreceiveandroid
.
data
[
'context'
][
'_imei2'
]
=
i
tkioreceiveandroid
.
data
[
'context'
][
'_ip'
]
=
ip
tkioreceiveandroid
.
send_request
()
print
(
i
)
print
(
ip
)
# sha_imei2
def
test_shaimei2
():
i
=
code_nums1
(
12
)
ip
=
socket
.
inet_ntoa
(
struct
.
pack
(
'>I'
,
random
.
randint
(
1
,
0xffffffff
)))
clickandroid
.
parms
[
'imei'
]
=
computesha
(
i
)
clickandroid
.
parms
[
'ip'
]
=
ip
clickandroid
.
send_requestandroid
(
''
)
time
.
sleep
(
6
)
tkioreceiveandroid
.
data
[
'context'
][
'_deviceid'
]
=
i
tkioreceiveandroid
.
data
[
'context'
][
'_imei2'
]
=
i
tkioreceiveandroid
.
data
[
'context'
][
'_ip'
]
=
ip
tkioreceiveandroid
.
send_request
()
print
(
i
)
print
(
ip
)
# meid
# def test_shameid():
# i = code_nums1(12)
# ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# clickandroid.parms['imei'] = i
# clickandroid.parms['ip'] = ip
# clickandroid.send_requestandroid('')
# time.sleep(6)
# tkioreceiveandroid.data['context']['_deviceid'] = i
# tkioreceiveandroid.data['context']['_meid'] = i
# tkioreceiveandroid.data['context']['_ip'] = ip
# tkioreceiveandroid.send_request()
# print(i)
# print(ip)
# sha_oaid
def
test_shaoaid
():
i
=
code_nums1
(
32
)
oaid
=
code_nums1
(
15
)
mac
=
code_nums1
(
32
)
androidid
=
code_nums1
(
16
)
ip
=
socket
.
inet_ntoa
(
struct
.
pack
(
'>I'
,
random
.
randint
(
1
,
0xffffffff
)))
clickandroid
.
parms
[
'imei'
]
=
'111'
clickandroid
.
parms
[
'imei_MD5'
]
=
''
clickandroid
.
parms
[
'oaid'
]
=
''
clickandroid
.
parms
[
'oaid_MD5'
]
=
computesha
(
oaid
)
clickandroid
.
parms
[
'muid'
]
=
''
clickandroid
.
parms
[
'ip'
]
=
ip
clickandroid
.
send_requestandroid
(
''
)
time
.
sleep
(
6
)
tkioreceiveandroid
.
data
[
'context'
][
'_deviceid'
]
=
i
tkioreceiveandroid
.
data
[
'context'
][
'_imei'
]
=
i
tkioreceiveandroid
.
data
[
'context'
][
'_oaid'
]
=
oaid
tkioreceiveandroid
.
data
[
'context'
][
'_ip'
]
=
ip
tkioreceiveandroid
.
send_request
()
print
(
i
)
# sha_android_id
def
test_sha_android_id
():
i
=
code_nums1
(
32
)
oaid
=
code_nums1
(
15
)
mac
=
code_nums1
(
32
)
androidid
=
code_nums1
(
16
)
ip
=
socket
.
inet_ntoa
(
struct
.
pack
(
'>I'
,
random
.
randint
(
1
,
0xffffffff
)))
clickandroid
.
parms
[
'imei'
]
=
'111'
clickandroid
.
parms
[
'imei_MD5'
]
=
''
clickandroid
.
parms
[
'androidid'
]
=
computesha
(
androidid
)
clickandroid
.
parms
[
'muid'
]
=
''
clickandroid
.
parms
[
'ip'
]
=
ip
clickandroid
.
send_requestandroid
(
''
)
time
.
sleep
(
6
)
tkioreceiveandroid
.
data
[
'context'
][
'_deviceid'
]
=
i
tkioreceiveandroid
.
data
[
'context'
][
'_imei'
]
=
i
tkioreceiveandroid
.
data
[
'context'
][
'_androidid'
]
=
androidid
tkioreceiveandroid
.
data
[
'context'
][
'_ip'
]
=
ip
tkioreceiveandroid
.
send_request
()
print
(
i
)
# no_colon_mac
def
test_no_colon_mac
():
i
=
code_nums1
(
32
)
oaid
=
code_nums1
(
15
)
mac_colon
=
'00:09:5B:EC:EE:F3'
no_colon_mac
=
'00095BECEEF3'
androidid
=
code_nums1
(
16
)
ip
=
socket
.
inet_ntoa
(
struct
.
pack
(
'>I'
,
random
.
randint
(
1
,
0xffffffff
)))
clickandroid
.
parms
[
'imei'
]
=
'111'
clickandroid
.
parms
[
'imei_MD5'
]
=
'222'
clickandroid
.
parms
[
'oaid'
]
=
''
clickandroid
.
parms
[
'oaid_MD5'
]
=
''
clickandroid
.
parms
[
'androidid'
]
=
''
clickandroid
.
parms
[
'androidid_MD5'
]
=
'343'
clickandroid
.
parms
[
'mac'
]
=
no_colon_mac
clickandroid
.
parms
[
'muid'
]
=
''
clickandroid
.
parms
[
'ip'
]
=
ip
clickandroid
.
send_requestandroid
(
''
)
time
.
sleep
(
6
)
tkioreceiveandroid
.
data
[
'context'
][
'_deviceid'
]
=
i
tkioreceiveandroid
.
data
[
'context'
][
'_imei'
]
=
i
tkioreceiveandroid
.
data
[
'context'
][
'_oaid'
]
=
oaid
tkioreceiveandroid
.
data
[
'context'
][
'_androidid'
]
=
androidid
tkioreceiveandroid
.
data
[
'context'
][
'_mac'
]
=
mac_colon
tkioreceiveandroid
.
data
[
'context'
][
'_ip'
]
=
ip
# tkioreceiveandroid.data['context']['_apptype'] = 'quickApp'
tkioreceiveandroid
.
send_request
()
print
(
i
)
# md5_no_colon_mac
def
test_md5_no_colon_mac
():
i
=
code_nums1
(
32
)
oaid
=
code_nums1
(
15
)
mac_colon
=
'00:09:5B:EC:EE:F3'
no_colon_mac
=
'00095BECEEF3'
androidid
=
code_nums1
(
16
)
ip
=
socket
.
inet_ntoa
(
struct
.
pack
(
'>I'
,
random
.
randint
(
1
,
0xffffffff
)))
clickandroid
.
parms
[
'imei'
]
=
'111'
clickandroid
.
parms
[
'imei_MD5'
]
=
'222'
clickandroid
.
parms
[
'oaid'
]
=
''
clickandroid
.
parms
[
'oaid_MD5'
]
=
''
clickandroid
.
parms
[
'androidid'
]
=
''
clickandroid
.
parms
[
'androidid_MD5'
]
=
'343'
clickandroid
.
parms
[
'mac'
]
=
computeMD5lower
(
no_colon_mac
)
clickandroid
.
parms
[
'muid'
]
=
''
clickandroid
.
parms
[
'ip'
]
=
ip
clickandroid
.
send_requestandroid
(
''
)
time
.
sleep
(
6
)
tkioreceiveandroid
.
data
[
'context'
][
'_deviceid'
]
=
i
tkioreceiveandroid
.
data
[
'context'
][
'_imei'
]
=
i
tkioreceiveandroid
.
data
[
'context'
][
'_oaid'
]
=
oaid
tkioreceiveandroid
.
data
[
'context'
][
'_androidid'
]
=
androidid
tkioreceiveandroid
.
data
[
'context'
][
'_mac'
]
=
mac_colon
tkioreceiveandroid
.
data
[
'context'
][
'_ip'
]
=
ip
# tkioreceiveandroid.data['context']['_apptype'] = 'quickApp'
tkioreceiveandroid
.
send_request
()
print
(
i
)
def
test_TEST
():
i
=
code_nums1
(
32
)
oaid
=
code_nums1
(
15
)
...
...
@@ -1016,41 +1214,32 @@ def test_TEST():
print
(
ip
)
# 点击存储验证
def
test_click
():
mget
=
'b34100cdf5b586774e5d4dd4357c7b17:'
# mget = ''
# i = code_nums1(32)
i
=
'CM471A7C6B21F0369B5US8J8UV8P8SVD'
# mdi = '5DF50CF4C9E6BD1B5A42561C637DAEBE'
oaid
=
code_nums1
(
15
)
# oaid = 'S96Z9721656VRIP'
# mdo = '8127886D006BB678853E0DC918E688CA'
mac
=
code_nums1
(
32
)
# mac = 'A05Q8GGG6572D861XEIB0869S56Q1VD7'
# androidid = code_nums1(16)
androidid
=
'95J247G5ZQYM81Z8'
androidid
=
'95J247G5ZQYM81Z8'
# mda = 'EB802DB3386F1CB75975F4D58667F70F'
muid
=
code_nums1
(
16
)
# muid='LGSM6ND543Q9JSZU'
# ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
ip
=
'58.243.117.39'
clickandroid
.
parms
[
'click_time'
]
=
'1663309200'
# clickandroid.parms['imei'] = i
# clickandroid.parms['imei_MD5'] = computeMD5upper(i)
...
...
@@ -1076,8 +1265,7 @@ def test_click():
# print("androidid: "+mget+androidid.upper())
# print("androidid_MD5: "+mget+computeMD5upper(androidid))
# print("muid: "+mget+muid.upper())
print
(
"ip: "
+
mget
+
ip
)
print
(
"ip: "
+
mget
+
ip
)
def
test_install
():
...
...
@@ -1098,6 +1286,3 @@ def test_install():
tkioreceiveandroid
.
data
[
'context'
][
'_ip'
]
=
ip
tkioreceiveandroid
.
send_request
()
print
(
i
)
tkio/attributioncaseios.py
View file @
15ed9f4b
...
...
@@ -42,17 +42,31 @@ def computeMD5upper(message):
return
m
.
hexdigest
()
.
upper
()
# md5加密转
xiao
写
# md5加密转
小
写
def
computeMD5lower
(
message
):
m
=
hashlib
.
md5
()
m
.
update
(
message
.
encode
(
encoding
=
'utf-8'
))
return
m
.
hexdigest
()
# SHA加密
def
computesha
(
message
):
sha
=
hashlib
.
sha1
(
message
.
encode
(
'utf-8'
))
encrypts
=
sha
.
hexdigest
()
print
(
encrypts
)
return
encrypts
# 生成小写字母加数字组合
n
=
10
def
test_sha1
():
computesha
(
"111"
)
def
code_nums1
(
n
=
6
):
ret
=
''
for
i
in
range
(
n
):
...
...
@@ -194,9 +208,9 @@ def test_at6():
clickios
.
parms
[
'ip'
]
=
ip
clickios
.
parms
[
'caid1'
]
=
caid
clickios
.
parms
[
'caid2'
]
=
caid2
#
clickios.send_requestandroid('')
clickios
.
send_requestandroid
(
'&preorder=true'
)
time
.
sleep
(
5
)
clickios
.
send_requestandroid
(
''
)
#
clickios.send_requestandroid('&preorder=true')
time
.
sleep
(
6
)
tkioreceive
.
data
[
'context'
][
'_deviceid'
]
=
i2
tkioreceive
.
data
[
'context'
][
'_idfa'
]
=
i2
tkioreceive
.
data
[
'context'
][
'_ip'
]
=
ip
...
...
@@ -218,8 +232,8 @@ def test_at7():
clickios
.
parms
[
'ip'
]
=
ip
clickios
.
parms
[
'caid1'
]
=
caid
clickios
.
parms
[
'caid2'
]
=
caid2
#
clickios.send_requestandroid('')
clickios
.
send_requestandroid
(
'&preorder=true'
)
clickios
.
send_requestandroid
(
''
)
#
clickios.send_requestandroid('&preorder=true')
time
.
sleep
(
5
)
tkioreceive
.
data
[
'context'
][
'_deviceid'
]
=
i2
...
...
@@ -243,8 +257,8 @@ def test_at8():
clickios
.
parms
[
'ip'
]
=
ip
clickios
.
parms
[
'caid1'
]
=
caid
clickios
.
parms
[
'caid2'
]
=
caid2
#
clickios.send_requestandroid('')
clickios
.
send_requestandroid
(
'&preorder=true'
)
clickios
.
send_requestandroid
(
''
)
#
clickios.send_requestandroid('&preorder=true')
time
.
sleep
(
5
)
tkioreceive
.
data
[
'context'
][
'_deviceid'
]
=
i2
...
...
@@ -268,8 +282,8 @@ def test_at9():
clickios
.
parms
[
'ip'
]
=
ip
clickios
.
parms
[
'caid1'
]
=
caid
clickios
.
parms
[
'caid2'
]
=
caid2
#
clickios.send_requestandroid('')
clickios
.
send_requestandroid
(
'&preorder=true'
)
clickios
.
send_requestandroid
(
''
)
#
clickios.send_requestandroid('&preorder=true')
time
.
sleep
(
6
)
tkioreceive
.
data
[
'context'
][
'_deviceid'
]
=
i2
...
...
@@ -347,7 +361,7 @@ def test_at12():
clickios
.
parms
[
'caid1'
]
=
caid
clickios
.
parms
[
'caid2'
]
=
caid2
clickios
.
send_requestandroid
(
''
)
time
.
sleep
(
5
)
time
.
sleep
(
6
)
tkioreceive
.
data
[
'context'
][
'_deviceid'
]
=
i2
tkioreceive
.
data
[
'context'
][
'_idfa'
]
=
i2
tkioreceive
.
data
[
'context'
][
'_ip'
]
=
ip
...
...
@@ -370,8 +384,8 @@ def test_at13():
clickios
.
parms
[
'ip'
]
=
ip
clickios
.
parms
[
'caid1'
]
=
computeMD5upper
(
caid
)
clickios
.
parms
[
'caid2'
]
=
caid2
#
clickios.send_requestandroid('')
clickios
.
send_requestandroid
(
'&preorder=true'
)
clickios
.
send_requestandroid
(
''
)
#
clickios.send_requestandroid('&preorder=true')
time
.
sleep
(
6
)
tkioreceive
.
data
[
'context'
][
'_deviceid'
]
=
i2
...
...
@@ -448,8 +462,8 @@ def test_at16():
clickios
.
parms
[
'ip'
]
=
ip
clickios
.
parms
[
'caid1'
]
=
''
clickios
.
parms
[
'caid2'
]
=
caid
#
clickios.send_requestandroid('')
clickios
.
send_requestandroid
(
'&preorder=true'
)
clickios
.
send_requestandroid
(
''
)
#
clickios.send_requestandroid('&preorder=true')
time
.
sleep
(
6
)
tkioreceive
.
data
[
'context'
][
'_deviceid'
]
=
i2
...
...
@@ -511,7 +525,7 @@ def test_at18():
clickios
.
parms
[
'caid1'
]
=
''
clickios
.
parms
[
'caid2'
]
=
caid
clickios
.
send_requestandroid
(
''
)
time
.
sleep
(
5
)
time
.
sleep
(
6
)
tkioreceive
.
data
[
'context'
][
'_deviceid'
]
=
i2
tkioreceive
.
data
[
'context'
][
'_idfa'
]
=
i2
tkioreceive
.
data
[
'context'
][
'_ip'
]
=
ip
...
...
@@ -541,7 +555,7 @@ def test_at19():
clickios
.
parms
[
'caid1'
]
=
''
clickios
.
parms
[
'caid2'
]
=
caid
clickios
.
send_requestandroid
(
''
)
time
.
sleep
(
5
)
time
.
sleep
(
6
)
tkioreceive
.
data
[
'context'
][
'_deviceid'
]
=
i2
tkioreceive
.
data
[
'context'
][
'_idfa'
]
=
i2
tkioreceive
.
data
[
'context'
][
'_ip'
]
=
ip
...
...
@@ -930,3 +944,58 @@ def test_firstclick():
print
(
i2
)
print
(
ip1
)
print
(
ip2
)
# jointype-归因方式补充
# sha idfa 暂时无法归因
def
test_sha
():
i
=
idfacode
()
i2
=
idfacode
()
caid
=
code_nums1
(
32
)
ip
=
socket
.
inet_ntoa
(
struct
.
pack
(
'>I'
,
random
.
randint
(
1
,
0xffffffff
)))
clickios
.
parms
[
'idfa_MD5'
]
=
computesha
(
i
)
clickios
.
parms
[
'idfa'
]
=
''
clickios
.
parms
[
'ip'
]
=
ip
clickios
.
parms
[
'caid1'
]
=
caid
clickios
.
send_requestandroid
(
''
)
# clickios.send_requestandroid('&preorder=true')
time
.
sleep
(
6
)
tkioreceive
.
data
[
'context'
][
'_deviceid'
]
=
i
tkioreceive
.
data
[
'context'
][
'_idfa'
]
=
i
tkioreceive
.
data
[
'context'
][
'_ip'
]
=
ip
tkioreceive
.
data
[
'context'
][
'_caid'
]
=
caid
tkioreceive
.
send_request
()
print
(
i
)
print
(
ip
)
# no_line_idfa
def
test_no_line_idfa
():
i
=
'ZRNDIT5KU5OHWXAUVZL5AQWOTIRB2CY2'
i2
=
'ZRNDIT5K-U5OH-WXAU-VZL5-AQWOTIRB2CY2'
caid
=
code_nums1
(
36
)
ip1
=
socket
.
inet_ntoa
(
struct
.
pack
(
'>I'
,
random
.
randint
(
1
,
0xffffffff
)))
clickios
.
parms
[
'idfa'
]
=
i
clickios
.
parms
[
'ip'
]
=
ip1
clickios
.
parms
[
'caid1'
]
=
caid
clickios
.
send_requestandroid
(
''
)
# clickios.send_requestandroid('&preorder=true')
time
.
sleep
(
6
)
tkioreceive
.
data
[
'context'
][
'_deviceid'
]
=
i2
tkioreceive
.
data
[
'context'
][
'_idfa'
]
=
i2
tkioreceive
.
data
[
'context'
][
'_ip'
]
=
ip1
tkioreceive
.
data
[
'context'
][
'_caid'
]
=
caid
tkioreceive
.
send_request
()
print
(
i
)
print
(
ip1
)
tkio/clickandroid.py
View file @
15ed9f4b
...
...
@@ -34,11 +34,12 @@ parms = {
def
send_requestandroid
(
hc
):
url1
=
'http://52.80.137.106:8083/tkio/MfyEzya?noredirect=true'
+
hc
# url1 = 'http://uri6.com/tkio/26rQJz
a?noredirect=true' + hc
#
url1 = 'http://52.80.137.106:8083/tkio/MfyEzya?noredirect=true' + hc
url1
=
'http://uri6.com/tkio/bmEJre
a?noredirect=true'
+
hc
response
=
requests
.
get
(
url
=
url1
,
params
=
parms
,
timeout
=
10
,
verify
=
False
)
print
(
response
.
text
)
print
(
url1
)
print
(
parms
)
return
response
...
...
tkio/clickios.py
View file @
15ed9f4b
...
...
@@ -33,7 +33,7 @@ parms = {
def
send_requestandroid
(
hc
):
# url1 = 'http://52.80.137.106:8083/tkio/F3QVrqa?noredirect=true' + hc
url1
=
'http://uri6.com/tkio/
uUFN7
fa?noredirect=true'
+
hc
url1
=
'http://uri6.com/tkio/
ayERV
fa?noredirect=true'
+
hc
response
=
requests
.
get
(
url
=
url1
,
params
=
parms
,
timeout
=
10
,
verify
=
False
)
print
(
response
.
text
)
print
(
url1
)
...
...
tkio/tkioreceive.py
View file @
15ed9f4b
...
...
@@ -8,7 +8,7 @@ import hashlib
data
=
{
"what"
:
"install"
,
"appid"
:
"
b21d0385ad8371de9e90b3e969a5d0c6
"
,
"appid"
:
"
60763edf19602c0fa27b967c282fe805
"
,
"context"
:
{
"_deviceid"
:
""
,
"_idfa"
:
""
,
...
...
@@ -42,9 +42,9 @@ data_temp = json.dumps(data)
def
send_request
():
global
data
# 测试
url
=
"http://52.80.137.106:8080/receive/tkio/install"
#
url = "http://52.80.137.106:8080/receive/tkio/install"
# 线上
#
url = "http://log.trackingio.com/receive/tkio/install"
url
=
"http://log.trackingio.com/receive/tkio/install"
data
[
'context'
][
'install_time'
]
=
int
(
round
(
time
.
time
()
*
1000
))
print
(
data
)
response
=
requests
.
request
(
"POST"
,
url
,
headers
=
headers
,
data
=
json
.
dumps
(
data
))
...
...
tkio/tkioreceiveandroid.py
View file @
15ed9f4b
...
...
@@ -8,7 +8,7 @@ import hashlib
data
=
{
"what"
:
"install"
,
"appid"
:
"
5b0e99269160e67ef8e560716221e142
"
,
"appid"
:
"
894ef23136b0a6bb039800aa217f2729
"
,
"context"
:
{
"_deviceid"
:
""
,
"_imei"
:
""
,
...
...
@@ -42,11 +42,11 @@ data_temp = json.dumps(data)
def
send_request
():
global
data
# 测试
url
=
"http://52.80.137.106:8080/receive/tkio/install"
#
url = "http://52.80.137.106:8080/receive/tkio/install"
# url = "http://52.80.137.106:8080/receive/tkio/event"
# 线上
#
url = "http://log.trackingio.com/receive/tkio/install"
url
=
"http://log.trackingio.com/receive/tkio/install"
data
[
'context'
][
'install_time'
]
=
int
(
round
(
time
.
time
()
*
1000
))
print
(
data
)
response
=
requests
.
request
(
"POST"
,
url
,
headers
=
headers
,
data
=
json
.
dumps
(
data
))
...
...
xiaochengxu/x_launch.py
View file @
15ed9f4b
...
...
@@ -7,37 +7,39 @@ import requests
appkey
=
'74131e54a444aa5a8597e73b646cba77'
# cid
cid
=
'21
164
'
cid
=
'21
075
'
# surl
surl
=
'
mAbeqa
a'
# URL = 'http://52.80.137.106:8083/tkio/EjABBra?noredirect=true
'
# URL = 'http://uri6.com/tkio/
BVjQf2a?noredirect=true
'
surl
=
'
J32uqi
a'
URL
=
'http://52.80.137.106:8083/tkio/Ur2MFra?noredirect=true&callback=www.baidu.com&request_id=111111&promoted_object_id=111
'
# URL = 'http://uri6.com/tkio/
Ur2MFra?noredirect=true&callback=www.baidu.com&request_id=111111&promoted_object_id=111
'
impressionid
=
''
.
join
(
str
(
random
.
choice
(
range
(
10
)))
for
_
in
range
(
12
))
requestid
=
''
.
join
(
str
(
random
.
choice
(
range
(
10
)))
for
_
in
range
(
12
))
s
=
0
for
_
in
range
(
1
):
for
index
in
range
(
40
):
# 随机生成12为数组
#
i = ''.join(str(random.choice(range(10))) for _ in range(28))
i
=
'2539452844786738942022514936'
i
=
''
.
join
(
str
(
random
.
choice
(
range
(
10
)))
for
_
in
range
(
28
))
#
i = '2539452844786738942022514936'
# 随机生成ip
ip
=
socket
.
inet_ntoa
(
struct
.
pack
(
'>I'
,
random
.
randint
(
1
,
0xffffffff
)))
#
# 打开
#
allEvent().openxiaochengxu(i, ip, cid, surl, appkey, impressionid, requestid)
# 打开
allEvent
()
.
openxiaochengxu
(
i
,
ip
,
cid
,
surl
,
appkey
,
impressionid
,
requestid
)
# # # time.sleep(5)
# # # #pv
# # # allEvent().pviaochengxu(i,ip,cid,surl,appkey)
# # # # # #离开
# # # # allEvent().hidechengxu(i,ip,cid,surl,appkey)
# # # time.sleep(2)
allEvent
()
.
regedchengxu
(
i
,
ip
,
cid
,
surl
,
appkey
)
#
allEvent().regedchengxu(i, ip, cid, surl, appkey)
# # # time.sleep(2)
# allEvent().loggedinchengxu(i, ip, cid, surl, appkey)
# time.sleep(2)
# allEvent().paymentchengxu(i,ip,cid,surl,appkey)
# time.sleep(2)
# allEvent().eventchengxu(i,ip,cid,surl,appkey)
time
.
sleep
(
2
)
num
=
index
+
1
event
=
'event_'
+
str
(
num
)
allEvent
()
.
eventchengxu
(
i
,
ip
,
cid
,
surl
,
appkey
,
event
)
# for index in range(1):
...
...
@@ -48,9 +50,9 @@ for _ in range(1):
# # print("开始时间"+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
# # 随机生成12为数组
# # impressionid = ''.join(str(random.choice(range(10))) for _ in range(12))
# impressionid = '111222334455'
# impressionid = '111222334455
667788
'
# # requestid = ''.join(str(random.choice(range(10))) for _ in range(12))
# requestid = '1112223344'
# requestid = '1112223344
55
'
# accountid = ''.join(str(random.choice(range(10))) for _ in range(12))
# # 随机生成ip
# ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
...
...
@@ -58,14 +60,16 @@ for _ in range(1):
# try:
# parms = {
# 'click_time': str(round(time.time() * 1000)),
# # 'click_time': '1663309200',
# # 'click_time': '1667308011000',
# 'wechat_openid': i,
# 'click_id':'123456789',
# 'accountid': accountid,
# 'ip': ip,
# 'impression_id': impressionid,
# 'request_id': requestid,
# '_ry_adgroup_id': '
333
',
# '_ry_adplan_id': "
333
",
# '_ry_adcreative_id': '
333
'
# '_ry_adgroup_id': '
222
',
# '_ry_adplan_id': "
222
",
# '_ry_adcreative_id': '
222
'
# }
# # timeout可以超时四秒
# # verify = False
...
...
@@ -106,7 +110,7 @@ for _ in range(1):
# # #离开
# time.sleep(2)
# allEvent().hidechengxu(i,ip,cid,surl,appkey)
# time.sleep(2
00
)
# time.sleep(2)
# allEvent().regedchengxu(i, ip, cid, surl, appkey)
# time.sleep(2)
# allEvent().loggedinchengxu(i,ip,cid,surl,appkey)
...
...
xiaochengxu/xiaochenxu_script.py
View file @
15ed9f4b
...
...
@@ -44,18 +44,19 @@ class allEvent:
"_openid"
:
i
,
"_campaignid"
:
surl
,
"_sceneid"
:
"434444"
,
"gdt_vid"
:
'1112223344'
,
# "
ry_adgroup_id": "111",
# "
ry_adplan_id": "111",
# "
ry_adcreative_id": "111",
#
"accountid":"123456",
"gdt_vid"
:
'1112223344
556677
'
,
"_
ry_adgroup_id"
:
"111"
,
"_
ry_adplan_id"
:
"111"
,
"_
ry_adcreative_id"
:
"111"
,
"accountid"
:
"123456"
,
'impression_id'
:
impressionid
,
'request_id'
:
requestid
,
# 投放广告详情-头条
"advertiser_id"
:
"ccc"
,
"ad_id"
:
"ccc"
,
"creative_id"
:
"ccc"
,
"_apptype"
:
"wx"
"_apptype"
:
"wg"
},
"where"
:
"launch"
,
# "when": when,
...
...
@@ -102,7 +103,7 @@ class allEvent:
"_openid"
:
i
,
"_campaignid"
:
surl
,
"_sceneid"
:
"unknown"
,
"_apptype"
:
"w
x
"
,
"_apptype"
:
"w
g
"
,
"_num_pages"
:
"5"
,
"_duration"
:
"10"
},
...
...
@@ -126,7 +127,8 @@ class allEvent:
"_openid"
:
i
,
"_campaignid"
:
surl
,
"_sceneid"
:
"unknown"
,
"_apptype"
:
"wx"
,
# wg-小游戏
"_apptype"
:
"wg"
,
"_num_pages"
:
"5"
,
"_duration"
:
"10"
},
...
...
@@ -153,7 +155,7 @@ class allEvent:
"_openid"
:
i
,
"_campaignid"
:
surl
,
"_sceneid"
:
"unknown"
,
"_apptype"
:
"w
x
"
,
"_apptype"
:
"w
g
"
,
"_num_pages"
:
"5"
,
'_transactionid'
:
transactionid
,
'_paymenttype'
:
paymenttype
,
...
...
@@ -198,9 +200,9 @@ class allEvent:
print
(
p
.
text
)
# 自定义事件
def
eventchengxu
(
self
,
i
,
IP
,
cid
,
surl
,
appid
):
def
eventchengxu
(
self
,
i
,
IP
,
cid
,
surl
,
appid
,
event
):
s
=
json
.
dumps
({
"what"
:
"event_10"
,
"what"
:
event
,
"appid"
:
appid
,
"context"
:
{
"_cid"
:
cid
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment