-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathawz.lua
More file actions
445 lines (394 loc) · 9.88 KB
/
awz.lua
File metadata and controls
445 lines (394 loc) · 9.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
-- 适用屏幕参数appKill("com.tencent.xin");
--[[
SCREEN_RESOLUTION="640x1136";
SCREEN_COLOR_BITS=32;
weixiinfo={};
-- 主入口
function main()
-- loginawxwx();
-- login62zh();
xiazai();
end
--]]
function loginawxwx()
--得到62数据
local url='http://g.7gu.cn/index.php?g=Api&m=Wxh&a=wx62data';
local redata = httpGet(url);
if redata==nil then
notifyMessage("登陆没有62数据号,请联系管理员");
os.exit();
end
local wxid=0;
local wxpwd=0;
local wx62=0;
if redata~=nil and redata~='null' then
wxid = getparame(redata,"wxid");
weixiinfo['wxid']=wxid;
wxpwd = getparame(redata,"wxpwd");
weixiinfo['wxpwd']=wxpwd;
wx62 = getparame(redata,"wx62");
weixiinfo['wx62']=wx62;
end
if wx62==0 or wx62=='' then
notifyMessage('数据已登完');
return;
end
appRun("AWZ");--打开awz
mSleep(1000);
newh(); --一键新机
getdata();--得到数据
writeFile("/var/mobile/iggparams.txt",wx62);--写入
set62dta();--设置62数据
setwxname(wxid..'--'..wxpwd);
notifyMessage("已经加62数据");
mSleep(1000);
login62zh()--登入62数据
end
--awz恢复下一条数据
function awxnexwx()
appRun("AWZ");--打开awz
mSleep(1000);
nextawzwx();
notifyMessage("成功加载数据");
end
--一件新机
function newh()
mSleep(200);
return htwx("http://127.0.0.1:1688/cmd?fun=newrecord","一键新机失败");
end
--生成62数据参数
function getdata()
mSleep(200);
return htwx("http://127.0.0.1:1688/cmd?fun=getcurrentrecordparam","获取数据失败");
end
--设置62数据参数
function set62dta()
mSleep(200);
return htwx("http://127.0.0.1:1688/cmd?fun=setcurrentrecordparam","设置62数据失败");
end
--设计当前数据名称
function setwxname(name)
mSleep(200);
local t="http://127.0.0.1:1688/cmd?fun=renamecurrentrecord&name="..name;
return htwx(t,"设置名称失败");
end
--下一条数据
function nextawzwx()
mSleep(200);
return htwx("http://127.0.0.1:1688/cmd?fun=nextrecord","下一条数据错误");
end
--发送http请求
function htwx(http,msg)
mSleep(200);
code = httpGet(http);
if code == "" then
notifyMessage(msg);
return false;
end
mSleep(3000);
return true;
end
--写入文件62long
function writeFile(path,longid)
file=io.open(path,'a+')
file:write("62long:"..longid)
file:close()
end
-- function getparame(sul,str)
-- v=string.sub(sul,string.find(sul,'<'..str..'>')+string.len('<'..str..'>'),string.find(sul,'</'..str..'>')-1);
-- return v;
-- end
--登录62数据并设置资料
function login62zh()
mSleep(1000);
openweixi();
while true do
mSleep(500);
click(158,1047);--点击登录
mSleep(500);
if seachcolorreturn(0xffffff,340,931,345,935)==1 then
break;
end
end
mSleep(800);
click(455,1055);--其他方式登录
mSleep(2000);
click(272,325);--点击输入帐号
click(272,332);--点击输入帐号
mSleep(500);
inputText(weixiinfo['wxid']);
mSleep(1200);
click(347,403);
click(592,1088);--点击下一项
inputText(weixiinfo['wxpwd']);
mSleep(1000);
seachcolor('0x1aad19',11,458,622,839);--点登录
while true do
mSleep(500);
click(560,1085);--点我
mSleep(500);
if seachcolorreturn(0x1aad19,548,1062,578,1097)==1 then
break;
end
click(190,700);--否
end
msleeprand(1000);
local msgcoty=textlocal(61,440,580,608);
if(string.match(msgcoty,'号')=='号') or (string.match(msgcoty,'立')=='立') then
click(320,665);--不再提示
end
awzsetpwd();
end
--修改密码
function awzsetpwd()
mSleep(1200);--点我
click(560,1082);
mSleep(2200);
click(220,761);--设置
mSleep(1200);
click(233,205);--帐号与安全
mSleep(1200);
while true do
click(248,418);--微信密码
mSleep(1200);
if seachcolorreturn(0x007aff,153,475,215,503)==1 then
break;
end
click(63,83);--返回
mSleep(1000);
click(245,722);--微信密码
mSleep(2000);
if seachcolorreturn(0x007aff,153,475,215,503)==1 then
break;
end
click(63,83);--返回
mSleep(1000);
click(230,809);--微信密码
mSleep(2000);
break;
end
-- click(302,395);--输入框
mSleep(1500);
inputText(weixiinfo['wxpwd']);
-- inputText('zzxxcc11');
mSleep(1500);
click(458,491);--确定
mSleep(2500);
click(337,439);--密码框
mSleep(1200);
inputText("asd168168");
mSleep(2000);
click(322,535);--确认密码框
mSleep(1200);
inputText("asd168168");
mSleep(1200);
click(587,83);--完成
mSleep(1200);
click(47,83);--返回
mSleep(800);
click(47,83);--返回
mSleep(800);
click(47,83);--返回
mSleep(800);
click(47,83);--返回
end
--下载
function xiazai()
xiazaiqqtp('pyq.txt');
--读取指定文件所有内容,返回一个数组
local list = readFile("/var/touchelf/scripts/scriptfile/images/pyq.txt");
if list==nil then
notifyMessage("文档下载失败");
return false;
end
local str = list[1];
if str==nil then
notifyMessage("文档下载失败");
return false;
end
local result = Split(str,',') --分隔字符串
notifyMessage("下载图片中");
for k, v in pairs( result) do
notifyMessage(v,2000);
xiazaiqqtp(v)
end
--]]
end
--字符串分隔方法
function Split(szFullString, szSeparator)
local nFindStartIndex = 1
local nSplitIndex = 1
local nSplitArray = {}
while true do
local nFindLastIndex = string.find(szFullString, szSeparator, nFindStartIndex)
if not nFindLastIndex then
nSplitArray[nSplitIndex] = string.sub(szFullString, nFindStartIndex, string.len(szFullString))
break
end
nSplitArray[nSplitIndex] = string.sub(szFullString, nFindStartIndex, nFindLastIndex - 1)
nFindStartIndex = nFindLastIndex + string.len(szSeparator)
nSplitIndex = nSplitIndex + 1
end
return nSplitArray
end
--读取文档
function readFile(path)
local file = io.open(path,"r");--用读模式打开一个文件
if file then
local _list = {};
for l in file:lines() do
table.insert(_list,l)
end
file:close();--关闭默认的输出文件
return _list
end
end
--下载图片请求
function xiazaiqqtp(imgname)
mSleep(1000);
local path="ftp://121.40.140.16:/script/luaimg/"..imgname;
local savepath="/var/touchelf/scripts/scriptfile/images/"..imgname;
local getdata=ftpGet(path, savepath, "productconsole", "T4t8u0p1");
if getdata then
return true;
end
return false;
end
--新号设置资料
function shezhizl()
msleeprand(1000);
delphoto();
mSleep(1000);
openweixi();
mSleep(800);
saveImageToAlbum("/var/touchelf/scripts/scriptfile/images/tx1.png");
mSleep(800);
click(560,1082);--点我设置资料
mSleep(800);
click(167,241);
mSleep(800);
click(300,250);--头像设置
mSleep(800);
click(592,85);--三点
mSleep(800);
click(322,882);--从相册选择
mSleep(800);
click(283,182);--第一个相册
mSleep(1500);--点击第一张
click(71,205);
click(572,1065);--完成
mSleep(3000);
click(83,83);--返回
mSleep(1000);
click(320,368);--设置名字
mSleep(800);
inputText("小雪");
click(590,86);--保存
mSleep(1200);
click(254,765);--设置性别女
mSleep(800);
click(307,292);--女
mSleep(800);
click(299,939);--设置个性签名
inputText("昨天依然过去,以笑脸去迎接新的一天");
click(592,86);--完成
end
--打开微信
function openweixi()
appRun("com.tencent.xin");--打开微信
end
function closeweixi()
kill_app("com.tencent.xin");
end
--点击按钮
function click(x, y)
touchDown(0, x, y);
mSleep(math.random(20,80));
touchUp(0);
end
--点击区域
function clickarea(x,y,x1,y1)
touchDown(0,math.random(x, x1),math.random(y, y1));
mSleep(math.random(100, 200));
touchUp(0);
end
--根据区域查找字符串
function textlocal(x,y,x1,y1)
code = localOcrText("/var/touchelf/scripts/tessdata", -- 语言包tessdata目录在设备中的路径
"chi_sim", -- 语言类型为中文
x, -- 图片左上角X坐标为100
y, -- 图片左上角Y坐标为100
x1, -- 图片右下角X坐标为200
y1); -- 图片右下角Y坐标为200
if code == "" then
code=0;
end
return code;
end
--查找当前屏幕颜色值并返回int 1 0
function seachcolorreturn(color,x,y,x1,y1)
local t = 1;
x,y=findColorInRegionFuzzy(color,80,x,y,x1,y1); -- 在全屏范围找到第一个颜色为0x0000ff的点, 精确度为90%, 将其坐标保存到变量x和y中
if x ~= -1 and y ~= -1 then -- 如果找到了
t = 1;
else
t=0;
end
return t;
end
--删除相片
function delphoto()
mSleep(1000);
--openURL("prefs:root=Photos"); .sharing-nowakeMar
--appRun("com.apple.mediastream");
mSleep(1000);
appKill("com.apple.mobileslideshow");
mSleep(1000);
appRun("com.apple.mobileslideshow");
--appRun("com.apple.mediastream.sharing-nowake");
mSleep(1000);
--是否打相册
local numloop = 1;
while true do
local wloop = false;
for sim = 100, 90, -1 do
x, y = findColorInRegionFuzzy(0x007aff, sim, 93, 1068, 131, 1095);
if x ~= -1 and y ~= -1 then --如果在指定区域找到某点符合条件
wloop=true;
break; --并跳出循环
end
end
local wloop1 = false;
for sim = 100, 90, -1 do
x, y = findColorInRegionFuzzy(0x007aff, sim, 15, 58, 126, 123);
if x ~= -1 and y ~= -1 then --如果在指定区域找到某点符合条件
wloop1=true;
break; --并跳出循环
end
end
if wloop1==false then
return;
end
if wloop==true then
break;
end
numloop=numloop+1;
if numloop>50 then
break;
end
mSleep(1000);
click(101,1087);
mSleep(1000);
appKill("com.apple.mobileslideshow");
mSleep(2000);
end
mSleep(800);
click(591,81);
mSleep(1000);
click(583,177);
mSleep(1000);
click(591,1083);
mSleep(1000);
click(317,975);
--是否打相册
end