diff --git a/agree.html b/agree.html new file mode 100644 index 0000000..837832a --- /dev/null +++ b/agree.html @@ -0,0 +1,27 @@ +欢迎使用DeekeScript App模拟点击软件(以下简称“本软件”)。在使用本软件前,请您仔细阅读以下用户使用协议条款。使用本软件即表示您同意遵守本协议的所有条款。如果您不同意这些条款,请勿使用本软件。 + +

一、使用许可

+您有权在遵守本协议条款的前提下下载、安装和使用本软件。 +本软件仅供个人和非商业用途使用。未经授权,您不得将本软件用于任何商业目的。 +

二、用户责任

+合法使用:您承诺不会利用本软件从事任何违法、违规或侵犯他人合法权益的活动。这些活动包括但不限于: +传播任何违法、骚扰、中伤、诽谤、辱骂、威胁、伤害他人或侵犯他人隐私的信息。 +利用本软件进行任何形式的网络攻击、入侵或破坏行为。 +任何违反国家、地区、法律法规的行为。 +后果自负:您理解并同意,因您使用本软件而引发的任何争议、纠纷、损失、责任等后果均由您本人承担。开发者及其关联方不对因您使用本软件而产生的任何损失或损害负责。 +数据安全:您在使用本软件时,应自行备份和保护您的数据。对于因使用本软件造成的数据丢失或损坏,开发者不承担任何责任。 +

三、软件更新

+为了提升用户体验和服务质量,开发者可能会对本软件进行更新和升级。您同意开发者有权在无需通知您的情况下进行软件更新。 +您在使用新版软件时,应遵守新版软件的使用协议。 +

四、知识产权

+本软件及相关文档的所有权利、所有权和知识产权归开发者所有。未经开发者书面许可,您不得以任何形式复制、修改、出售、出租或再分发本软件或其部分内容。 +

五、协议变更

+开发者有权随时修改本协议条款。修改后的协议将通过适当的方式进行公布,例如软件内通知或网站公告。修改后的协议自公布之日起生效。 +您继续使用本软件即表示您接受修改后的协议。如果您不接受修改后的协议,您应停止使用本软件。 +

六、终止

+如果您违反本协议的任何条款,开发者有权在不通知您的情况下终止您使用本软件的权利。 +您可以随时卸载并停止使用本软件,但这并不免除您在使用期间产生的责任和义务。 +

七、其他

+本协议适用中华人民共和国法律。 +因本协议引起的或与本协议有关的任何争议,双方应友好协商解决;协商不成的,任何一方均可向开发者所在地有管辖权的人民法院提起诉讼。 +感谢您阅读本协议,祝您使用愉快! \ No newline at end of file diff --git a/app/dy/Code.js b/app/dy/Code.js index b7d0245..46fd459 100644 --- a/app/dy/Code.js +++ b/app/dy/Code.js @@ -9,4 +9,4 @@ const Code = { 107: '任务因为某种原因中断了',//此时可以休息10分钟 直接关掉抖音即可 } -module.exports = { Code }; +module.exports = Code; diff --git a/app/dy/Comment.js b/app/dy/Comment.js index b0a8a1d..677469b 100644 --- a/app/dy/Comment.js +++ b/app/dy/Comment.js @@ -1,7 +1,7 @@ -import { Common } from 'app/dy/Common.js'; -import { storage } from 'common/storage.js'; -import { statistics } from 'common/statistics.js'; -import { V } from 'version/V.js'; +let Common = require('app/dy/Common.js'); +let storage = require('common/storage.js'); +let statistics = require('common/statistics.js'); +let V = require('version/V.js'); const Comment = { tag: undefined,//当前的tag标签 @@ -30,8 +30,9 @@ const Comment = { }, getBackTag(tag) { - this.tag = tag; - return this.getTimeTag(); + return Common.id(V.Comment.getBackMsg[0]).filter(v => { + return v.bounds().left >= tag.bounds().left && v.bounds().top >= tag.bounds().top && v.bounds().top + v.bounds().height() <= tag.bounds().top + tag.bounds().height(); + }).findOne(); }, getZanTag(tag) { @@ -93,7 +94,7 @@ const Comment = { //data 是getList返回的参数 clickZan(data) { let zanTag = this.getZanTag(data.tag); - zanTag?.parent()?.click(); + zanTag && zanTag.parent() && zanTag.parent().click(); statistics.zanComment(); //Common.click(zanTag); return true; @@ -151,7 +152,9 @@ const Comment = { }, getList() { - let contains = Common.id(V.Comment.getList[0]).isVisibleToUser(true).find(); + let contains = Common.id(V.Comment.getList[0]).isVisibleToUser(true).filter(v => { + return v && v.bounds() && v.bounds().left <= 10;//过滤评论回复内容 + }).find(); Log.log("数量:", contains.length); let contents = []; let data = {}; @@ -221,10 +224,8 @@ const Comment = { //data 是getList返回的参数 评论 backMsg(data, msg) { let backTag = this.getBackTag(data.tag); - //Log.log(data); - //Common.click(backTag); - backTag.setClickable(true); - backTag.click(); + Log.log(backTag.bounds()); + Common.click(backTag); Common.sleep(1000 + 2000 * Math.random()); iptTag = Common.id(V.Comment.backMsg[0]).find(); @@ -239,7 +240,7 @@ const Comment = { for (let i in msg) { input += msg[i]; iptTag.setText(input); - Common.sleep(1000 + Math.random() * 1000);//每个字1-2秒 + Common.sleep(200 + Math.random() * 300);//每个字1-2秒 } Common.sleep(Math.random() * 1000); @@ -283,7 +284,7 @@ const Comment = { for (let i = 0; i < msg.length; i++) { iText = msg.substring(0, i + 1); iptTag.setText(iText); - Common.sleep(500 + 1000 * Math.random()); + Common.sleep(100 + 300 * Math.random()); } Common.sleep(500 + Math.random() * 1000); @@ -388,7 +389,7 @@ const Comment = { while (true) { let tvTag = Common.id(V.Comment.commentAtUser[2]).find(); - arr.push(tvTag ? (tvTag[0]?._addr) : null); + arr.push(tvTag ? (tvTag[0] && tvTag[0]._addr) : null); if (arr.length > 2) { arr.shift(); } @@ -661,4 +662,4 @@ const Comment = { } } -module.exports = { Comment }; +module.exports = Comment; diff --git a/app/dy/Common.js b/app/dy/Common.js index 868796e..c011d3b 100644 --- a/app/dy/Common.js +++ b/app/dy/Common.js @@ -1,6 +1,6 @@ -import { storage as cStorage } from 'common/storage.js'; -import { V } from 'version/V.js'; +let cStorage = require('common/storage.js'); +let V = require('version/V.js'); const Common = { //封装的方法 @@ -23,6 +23,35 @@ const Common = { return 'com.ss.android.ugc.aweme'; }, + clickRange(tag, top, bottom) { + if (tag.bounds().top + tag.bounds().height() <= top) { + return false; + } + + if (tag.bounds().top >= bottom) { + return false; + } + + if (tag.bounds().top > top && tag.bounds().top + tag.bounds().height() < bottom) { + this.click(tag); + return true; + } + + //卡在top的上下 + if (tag.bounds().top <= top && tag.bounds().top + tag.bounds().height() > top) { + let topY = tag.bounds().top + tag.bounds().height() - top; + Gesture.click(tag.bounds().left + tag.bounds().width() * Math.random(), (tag.bounds().top + 1) + (topY - 1) * Math.random()); + return true; + } + + if (tag.bounds().top < bottom && tag.bounds().top + tag.bounds().height() >= bottom) { + let topY = bottom - tag.bounds().top; + Gesture.click(tag.bounds().left + tag.bounds().width() * Math.random(), tag.bounds().top + (topY - 1) * Math.random()); + return true; + } + return false; + }, + backHome() { this.openApp(); let i = 0; @@ -40,6 +69,22 @@ const Common = { return true; }, + backHomeOnly() { + let i = 0; + while (i++ < 5) { + let homeTag = this.id(V.Common.backHome[0]).isVisibleToUser(true).findOnce(); + if (!homeTag) { + Log.log(this.id(V.Common.backHome[0]).isVisibleToUser(true).findOnce()); + this.back(); + this.sleep(1000); + continue; + } + Log.log("找到了homeTag"); + break; + } + return true; + }, + click(tag, rate) { if (!rate) { rate = 0.05; @@ -188,6 +233,20 @@ const Common = { } }, + //粉丝群列表滑动 + swipeFansGroupListOp() { + let tag = this.id(V.Message.fansSwipe[0]).scrollable(true).filter((v) => { + return v && v.bounds() && v.bounds().top > 0 && v.bounds().left >= 0 && v.bounds().width() == Device.width() && v.bounds().top >= 0; + }).findOnce(); + console.log(tag); + if (tag) { + tag.scrollForward(); + } else { + Log.log('滑动失败'); + } + //Log.log(this.swipeCommentListOpTarget); + }, + //关闭弹窗 closeAlert(type) { this.log('开启线程监听弹窗'); @@ -255,11 +314,6 @@ const Common = { System.cleanUp();//清理线程垃圾 } } catch (e) { - console.log("线程中断状态:", Engines.isInterrupted()); - if (Engines.isInterrupted()) { - Log.log("线程被外部中断"); - break; - } this.log("close dialog 异常了"); this.log(e); } @@ -359,6 +413,10 @@ const Common = { playAudio(file) { media.playMusic(file); }, + + getRemark(remark) { + return remark.indexOf('#') == 0 || remark.indexOf('#') == 0; + } } -module.exports = { Common }; +module.exports = Common; diff --git a/app/dy/Index.js b/app/dy/Index.js index f4ee110..8358737 100644 --- a/app/dy/Index.js +++ b/app/dy/Index.js @@ -1,5 +1,5 @@ -import { V } from 'version/V.js'; -import { Common } from 'app/dy/Common.js'; +let V = require('version/V.js'); +let Common = require('app/dy/Common.js'); let citys = ["同城", "北京市", "东城区", "西城区", "朝阳区", "丰台区", "石景山区", "海淀区", "门头沟区", "房山区", "通州区", "顺义区", "昌平区", "大兴区", "怀柔区", "平谷区", "密云县", "延庆县", "天津市", "和平区", "河东区", "河西区", "南开区", "河北区", "红桥区", "滨海新区", "东丽区", "西青区", "津南区", "北辰区", "武清区", "宝坻区", "宁河县", "静海县", "蓟县", "河北省", "石家庄市", "市辖区", "长安区", "桥东区", "桥西区", "新华区", "井陉矿区", "裕华区", "井陉县", "正定县", "栾城县", "行唐县", "灵寿县", "高邑县", "深泽县", "赞皇县", "无极县", "平山县", "元氏县", "赵县", "辛集市", "藁城市", "晋州市", "新乐市", "鹿泉市", "唐山市", "市辖区", "路南区", "路北区", "古冶区", "开平区", "丰南区", "丰润区", "滦县", "滦南县", "乐亭县", "迁西县", "玉田县", "唐海县", "遵化市", "迁安市", "秦皇岛市", "海港区", "山海关区", "北戴河区", "青龙满族自治县", "昌黎县", "抚宁县", "卢龙县", "邯郸市", "市辖区", "邯山区", "丛台区", "复兴区", "峰峰矿区", "邯郸县", "临漳县", "成安县", "大名县", "涉县", "磁县", "肥乡县", "永年县", "邱县", "鸡泽县", "广平县", "馆陶县", "魏县", "曲周县", "武安市", "邢台市", "市辖区", "桥东区", "桥西区", "邢台县", "临城县", "内丘县", "柏乡县", "隆尧县", "任县", "南和县", "宁晋县", "巨鹿县", "新河县", "广宗县", "平乡县", "威县", "清河县", "临西县", "南宫市", "沙河市", "保定市", "新市区", "北市区", "南市区", "满城县", "清苑县", "涞水县", "阜平县", "徐水县", "定兴县", "唐县", "高阳县", "容城县", "涞源县", "望都县", "安新县", "易县", "曲阳县", "蠡县", "顺平县", "博野县", "雄县", "涿州市", "定州市", "安国市", "高碑店市", "白沟新城县", "张家口市", "市辖区", "桥东区", "桥西区", "宣化区", "下花园区", "宣化县", "张北县", "康保县", "沽源县", "尚义县", "蔚县", "阳原县", "怀安县", "万全县", "怀来县", "涿鹿县", "赤城县", "崇礼县", "承德市", "市辖区", "双桥区", "双滦区", "鹰手营子矿区", "承德县", "兴隆县", "平泉县", "滦平县", "隆化县", "丰宁满族自治县", "宽城满族自治县", "围场满族蒙古族自治县", "沧州市", "市辖区", "新华区", "运河区", "沧县", "青县", "东光县", "海兴县", "盐山县", "肃宁县", "南皮县", "吴桥县", "献县", "孟村回族自治县", "泊头市", "任丘市", "黄骅市", "河间市", "廊坊市", "市辖区", "安次区", "广阳区", "固安县", "永清县", "香河县", "大城县", "文安县", "大厂回族自治县", "霸州市", "三河市", "衡水市", "市辖区", "桃城区", "枣强县", "武邑县", "武强县", "饶阳县", "安平县", "故城县", "景县", "阜城县", "冀州市", "深州市", "山西省", "太原市", "市辖区", "小店区", "迎泽区", "杏花岭区", "尖草坪区", "万柏林区", "晋源区", "清徐县", "阳曲县", "娄烦县", "古交市", "大同市", "市辖区", "城区", "矿区", "南郊区", "新荣区", "阳高县", "天镇县", "广灵县", "灵丘县", "浑源县", "左云县", "大同县", "阳泉市", "市辖区", "城区", "矿区", "郊区", "平定县", "盂县", "长治市", "市辖区", "城区", "郊区", "长治县", "襄垣县", "屯留县", "平顺县", "黎城县", "壶关县", "长子县", "武乡县", "沁县", "沁源县", "潞城市", "晋城市", "市辖区", "城区", "沁水县", "阳城县", "陵川县", "泽州县", "高平市", "朔州市", "市辖区", "朔城区", "平鲁区", "山阴县", "应县", "右玉县", "怀仁县", "晋中市", "市辖区", "榆次区", "榆社县", "左权县", "和顺县", "昔阳县", "寿阳县", "太谷县", "祁县", "平遥县", "灵石县", "介休市", "运城市", "市辖区", "盐湖区", "临猗县", "万荣县", "闻喜县", "稷山县", "新绛县", "绛县", "垣曲县", "夏县", "平陆县", "芮城县", "永济市", "河津市", "忻州市", "忻府区", "定襄县", "五台县", "代县", "繁峙县", "宁武县", "静乐县", "神池县", "五寨县", "岢岚县", "河曲县", "保德县", "偏关县", "原平市", "临汾市", "市辖区", "尧都区", "曲沃县", "翼城县", "襄汾县", "洪洞县", "古县", "安泽县", "浮山县", "吉县", "乡宁县", "大宁县", "隰县", "永和县", "蒲县", "汾西县", "侯马市", "霍州市", "吕梁市", "市辖区", "离石区", "文水县", "交城县", "兴县", "临县", "柳林县", "石楼县", "岚县", "方山县", "中阳县", "交口县", "孝义市", "汾阳市", "内蒙古自治区", "呼和浩特市", "市辖区", "新城区", "回民区", "玉泉区", "赛罕区", "土默特左旗", "托克托县", "和林格尔县", "清水河县", "武川县", "包头市", "市辖区", "东河区", "昆都仑区", "青山区", "石拐区", "白云矿区", "九原区", "土默特右旗", "固阳县", "达尔罕茂明安联合旗", "乌海市", "市辖区", "海勃湾区", "海南区", "乌达区", "赤峰市", "市辖区", "红山区", "元宝山区", "松山区", "阿鲁科尔沁旗", "巴林左旗", "巴林右旗", "林西县", "克什克腾旗", "翁牛特旗", "喀喇沁旗", "宁城县", "敖汉旗", "通辽市", "市辖区", "科尔沁区", "科尔沁左翼中旗", "科尔沁左翼后旗", "开鲁县", "库伦旗", "奈曼旗", "扎鲁特旗", "霍林郭勒市", "鄂尔多斯市", "东胜区", "达拉特旗", "准格尔旗", "鄂托克前旗", "鄂托克旗", "杭锦旗", "乌审旗", "伊金霍洛旗", "呼伦贝尔市", "市辖区", "海拉尔区", "阿荣旗", "莫力达瓦达斡尔族自治旗", "鄂伦春自治旗", "鄂温克族自治旗", "陈巴尔虎旗", "新巴尔虎左旗", "新巴尔虎右旗", "满洲里市", "牙克石市", "扎兰屯市", "额尔古纳市", "根河市", "巴彦淖尔市", "市辖区", "临河区", "五原县", "磴口县", "乌拉特前旗", "乌拉特中旗", "乌拉特后旗", "杭锦后旗", "乌兰察布市", "市辖区", "集宁区", "卓资县", "化德县", "商都县", "兴和县", "凉城县", "察哈尔右翼前旗", "察哈尔右翼中旗", "察哈尔右翼后旗", "四子王旗", "丰镇市", "兴安盟", "乌兰浩特市", "阿尔山市", "科尔沁右翼前旗", "科尔沁右翼中旗", "扎赉特旗", "突泉县", "锡林郭勒盟", "二连浩特市", "锡林浩特市", "阿巴嘎旗", "苏尼特左旗", "苏尼特右旗", "东乌珠穆沁旗", "西乌珠穆沁旗", "太仆寺旗", "镶黄旗", "正镶白旗", "正蓝旗", "多伦县", "阿拉善盟", "阿拉善左旗", "阿拉善右旗", "额济纳旗", "辽宁省", "沈阳市", "市辖区", "和平区", "沈河区", "大东区", "皇姑区", "铁西区", "苏家屯区", "东陵区", "新城子区", "于洪区", "辽中县", "康平县", "法库县", "新民市", "沈北新区", "大连市", "市辖区", "中山区", "西岗区", "沙河口区", "甘井子区", "旅顺口区", "金州区", "长海县", "瓦房店市", "普兰店市", "庄河市", "鞍山市", "市辖区", "铁东区", "铁西区", "立山区", "千山区", "台安县", "岫岩满族自治县", "海城市", "抚顺市", "市辖区", "新抚区", "东洲区", "望花区", "顺城区", "抚顺县", "新宾满族自治县", "清原满族自治县", "本溪市", "市辖区", "平山区", "溪湖??", "明山区", "南芬区", "本溪满族自治县", "桓仁满族自治县", "丹东市", "市辖区", "元宝区", "振兴区", "振安区", "宽甸满族自治县", "东港市", "凤城市", "锦州市", "市辖区", "古塔区", "凌河区", "太和区", "黑山县", "义县", "凌海市", "北宁市", "营口市", "市辖区", "站前区", "西市区", "鲅鱼圈区", "老边区", "盖州市", "大石桥市", "阜新市", "市辖区", "海州区", "新邱区", "太平区", "清河门区", "细河区", "阜新蒙古族自治县", "彰武县", "辽阳市", "市辖区", "白塔区", "文圣区", "宏伟区", "弓长岭区", "太子河区", "辽阳县", "灯塔市", "盘锦市", "市辖区", "双台子区", "兴隆台区", "大洼县", "盘山县", "铁岭市", "市辖区", "银州区", "清河区", "铁岭县", "西丰县", "昌图县", "调兵山市", "开原市", "朝阳市", "市辖区", "双塔区", "龙城区", "朝阳县", "建平县", "喀喇沁左翼蒙古族自治县", "北票市", "凌源市", "葫芦岛市", "市辖区", "连山区", "龙港区", "南票区", "绥中县", "建昌县", "兴城市", "吉林省", "长春市", "市辖区", "南关区", "宽城区", "朝阳区", "二道区", "绿园区", "双阳区", "农安县", "九台市", "榆树市", "德惠市", "吉林市", "市辖区", "昌邑区", "龙潭区", "船营区", "丰满区", "永吉县", "蛟河市", "桦甸市", "舒兰市", "磐石市", "四平市", "市辖区", "铁西区", "铁东区", "梨树县", "伊通满族自治县", "公主岭市", "双辽市", "辽源市", "市辖区", "龙山区", "西安区", "东丰县", "东辽县", "通化市", "市辖区", "东昌区", "二道江区", "通化县", "辉南县", "柳河县", "梅河口市", "集安市", "白山市", "市辖区", "八道江区", "抚松县", "靖宇县", "长白朝鲜族自治县", "江源区", "临江市", "松原市", "市辖区", "宁江区", "前郭尔罗斯蒙古族自治县", "长岭县", "乾安县", "扶余市", "白城市", "市辖区", "洮北区", "镇赉县", "通榆县", "洮南市", "大安市", "延边朝鲜族自治州", "延吉市", "图们市", "敦化市", "珲春市", "龙井市", "和龙市", "汪清县", "安图县", "黑龙江省", "哈尔滨市", "市辖区", "道里区", "南岗区", "道外区", "香坊区", "动力区", "平房区", "松北区", "呼兰区", "依兰县", "方正县", "宾县", "巴彦县", "木兰县", "通河县", "延寿县", "阿城市", "双城市", "尚志市", "五常市", "齐齐哈尔市", "市辖区", "龙沙区", "建华区", "铁锋区", "昂昂溪区", "富拉尔基区", "碾子山区", "梅里斯达斡尔族区", "龙江县", "依安县", "泰来县", "甘南县", "富裕县", "克山县", "克东县", "拜泉县", "讷河市", "鸡西市", "市辖区", "鸡冠区", "恒山区", "滴道区", "梨树区", "城子河区", "麻山区", "鸡东县", "虎林市", "密山市", "鹤岗市", "市辖区", "向阳区", "工农区", "南山区", "兴安区", "东山区", "兴山区", "萝北县", "绥滨县", "双鸭山市", "市辖区", "尖山区", "岭东区", "四方台区", "宝山区", "集贤县", "友谊县", "宝清县", "饶河县", "大庆市", "市辖区", "萨尔图区", "龙凤区", "让胡路区", "红岗区", "大同区", "肇州县", "肇源县", "林甸县", "杜尔伯特蒙古族自治县", "伊春市", "市辖区", "伊春区", "南岔区", "友好区", "西林区", "翠峦区", "新青区", "美溪区", "金山屯区", "五营区", "乌马河区", "汤旺河区", "带岭区", "乌伊岭区", "红星区", "上甘岭区", "嘉荫县", "铁力市", "佳木斯市", "市辖区", "向阳区", "前进区", "东风区", "郊区", "桦南县", "桦川县", "汤原县", "抚远县", "同江市", "富锦市", "七台河市", "市辖区", "新兴区", "桃山区", "茄子河区", "勃利县", "牡丹江市", "市辖区", "东安区", "阳明区", "爱民区", "西安区", "东宁县", "林口县", "绥芬河市", "海林市", "宁安市", "穆棱市", "黑河市", "市辖区", "爱辉区", "嫩江县", "逊克县", "孙吴县", "北安市", "五大连池市", "绥化市", "北林区", "望奎县", "兰西县", "青冈县", "庆安县", "明水县", "绥棱县", "安达市", "肇东市", "海伦市", "大兴安岭地区", "加格达奇区", "松岭区", "新林区", "呼中区", "呼玛县", "塔河县", "漠河县", "上海市", "黄浦区", "卢湾区", "徐汇区", "长宁区", "静安区", "普陀区", "闸北区", "虹口区", "杨浦区", "闵行区", "宝山区", "嘉定区", "浦东新区", "金山区", "松江区", "青浦区", "南汇区", "奉贤区", "崇明县", "江苏省", "南京市", "市辖区", "玄武区", "白下区", "秦淮区", "建邺区", "鼓楼区", "下关区", "浦口区", "栖霞区", "雨花台区", "江宁区", "六合区", "溧水区", "高淳区", "无锡市", "市辖区", "崇安区", "南长区", "北塘区", "锡山区", "惠山区", "滨湖区", "江阴市", "宜兴市", "徐州市", "泉山区", "鼓楼区", "云龙区", "九里区", "贾汪区", "丰县", "沛县", "铜山县", "睢宁县", "新沂市", "邳州市", "常州市", "市辖区", "天宁区", "钟楼区", "戚墅堰区", "新北区", "武进区", "溧阳市", "金坛市", "苏州市", "市辖区", "沧浪区", "平江区", "金阊区", "虎丘区", "吴中区", "相城区", "常熟市", "张家港市", "昆山市", "吴江市", "太仓市", "南通市", "市辖区", "崇川区", "港闸区", "海安县", "如东县", "启东市", "如皋市", "通州市", "海门市", "连云港市", "市辖区", "连云区", "新浦区", "海州区", "赣榆县", "东海县", "灌云县", "灌南县", "淮安市", "市辖区", "清河区", "楚州区", "淮阴区", "清浦区", "涟水县", "洪泽县", "盱眙县", "金湖县", "盐城市", "市辖区", "亭湖区", "盐都区", "响水县", "滨海县", "阜宁县", "射阳县", "建湖县", "东台市", "大丰市", "扬州市", "市辖区", "广陵区", "邗江区", "维扬区", "宝应县", "仪征市", "高邮市", "江都市", "镇江市", "市辖区", "京口区", "润州区", "丹徒区", "丹阳市", "扬中市", "句容市", "泰州市", "市辖区", "海陵区", "高港区", "兴化市", "靖江市", "泰兴市", "姜堰市", "宿迁市", "市辖区", "宿城区", "宿豫区", "沭阳县", "泗阳县", "泗洪县", "浙江省", "杭州市", "市辖区", "上城区", "下城区", "江干区", "拱墅区", "西湖区", "滨江区", "萧山区", "余杭区", "桐庐县", "淳安县", "建德市", "富阳市", "临安市", "宁波市", "市辖区", "海曙区", "江东区", "江北区", "北仑区", "镇海区", "鄞州区", "象山县", "宁海县", "余姚市", "慈溪市", "奉化市", "温州市", "市辖区", "鹿城区", "龙湾区", "瓯海区", "洞头县", "永嘉县", "平阳县", "苍南县", "文成县", "泰顺县", "瑞安市", "乐清市", "嘉兴市", "市辖区", "南湖区", "秀洲区", "嘉善县", "海盐县", "海宁市", "平湖市", "桐乡市", "湖州市", "市辖区", "吴兴区", "南浔区", "德清县", "长兴县", "安吉县", "绍兴市", "市辖区", "越城区", "绍兴县", "新昌县", "诸暨市", "上虞市", "嵊州市", "金华市", "市辖区", "婺城区", "金东区", "武义县", "浦江县", "磐安县", "兰溪市", "义乌市", "东阳市", "永康市", "衢州市", "市辖区", "柯城区", "衢江区", "常山县", "开化县", "龙游县", "江山市", "舟山市", "市辖区", "定海区", "普陀区", "岱山县", "嵊泗县", "台州市", "市辖区", "椒江区", "黄岩区", "路桥区", "玉环县", "三门县", "天台县", "仙居县", "温岭市", "临海市", "丽水市", "市辖区", "莲都区", "青田县", "缙云县", "遂昌县", "松阳县", "云和县", "庆元县", "景宁畲族自治县", "龙泉市", "安徽省", "合肥市", "市辖区", "瑶海区", "庐阳区", "蜀山区", "包河区", "长丰县", "肥东县", "肥西县", "庐江县", "巢湖市", "芜湖市", "市辖区", "镜湖区", "马塘区", "鸠江区", "芜湖县", "繁昌县", "南陵县", "无为县", "蚌埠市", "市辖区", "龙子湖区", "蚌山区", "禹会区", "淮上区", "怀远县", "五河县", "固镇县", "淮南市", "市辖区", "大通区", "田家庵区", "谢家集区", "八公山区", "潘集区", "凤台县", "马鞍山市", "市辖区", "金家庄区", "花山区", "雨山区", "当涂县", "含山县", "和县", "淮北市", "市辖区", "杜集区", "相山区", "烈山区", "濉溪县", "铜陵市", "市辖区", "铜官山区", "狮子山区", "郊区", "铜陵县", "安庆市", "市辖区", "迎江区", "大观区", "宜秀区", "怀宁县", "枞阳县", "潜山县", "太湖县", "宿松县", "望江县", "岳西县", "桐城市", "黄山市", "黄山区", "屯溪区", "徽州区", "歙县", "休宁县", "黟县", "祁门县", "汤口镇", "滁州市", "市辖区", "琅琊区", "南谯区", "来安县", "全椒县", "定远县", "凤阳县", "天长市", "明光市", "阜阳市", "颍泉区", "颍州区", "颍东区", "临泉县", "太和县", "阜南县", "颍上县", "界首市", "宿州市", "市辖区", "埇桥区", "砀山县", "萧县", "灵璧县", "泗县", "居巢区", "六安市", "市辖区", "金安区", "裕安区", "寿县", "霍邱县", "舒城县", "金寨县", "霍山县", "亳州市", "谯城区", "涡阳县", "蒙城县", "利辛县", "池州市", "市辖区", "贵池区", "东至县", "石台县", "青阳县", "宣城市", "市辖区", "宣州区", "郎溪县", "广德县", "泾县", "绩溪县", "旌德县", "宁国市", "福建省", "福州市", "市辖区", "鼓楼区", "台江区", "仓山区", "马尾区", "晋安区", "闽侯县", "连江县", "罗源县", "闽清县", "永泰县", "平潭县", "福清市", "长乐市", "厦门市", "市辖区", "思明区", "海沧区", "湖里区", "集美区", "同安区", "翔安区", "莆田市", "市辖区", "城厢区", "涵江区", "荔城区", "秀屿区", "仙游县", "三明市", "市辖区", "梅列区", "三元区", "明溪县", "清流县", "宁化县", "大田县", "尤溪县", "沙县", "将乐县", "泰宁县", "建宁县", "永安市", "泉州市", "市辖区", "鲤城区", "丰泽区", "洛江区", "泉港区", "惠安县", "安溪县", "永春县", "德化县", "金门县", "石狮市", "晋江市", "南安市", "漳州市", "市辖区", "芗城区", "龙文区", "云霄县", "漳浦县", "诏安县", "长泰县", "东山县", "南靖县", "平和县", "华安县", "龙海市", "南平市", "市辖区", "延平区", "顺昌县", "浦城县", "光泽县", "松溪县", "政和县", "邵武市", "武夷山市", "建瓯市", "建阳市", "龙岩市", "市辖区", "新罗区", "长汀县", "永定县", "上杭县", "武平县", "连城县", "漳平市", "宁德市", "市辖区", "蕉城区", "霞浦县", "古田县", "屏南县", "寿宁县", "周宁县", "柘荣县", "福安市", "福鼎市", "江西省", "南昌市", "市辖区", "东湖区", "西湖区", "青云谱区", "湾里区", "青山湖区", "南昌县", "新建县", "安义县", "进贤县", "景德镇市", "市辖区", "昌江区", "珠山区", "浮梁县", "乐平市", "萍乡市", "市辖区", "安源区", "湘东区", "莲花县", "上栗县", "芦溪县", "九江市", "市辖区", "庐山区", "浔阳区", "九江县", "武宁县", "修水县", "永修县", "德安县", "星子县", "都昌县", "湖口县", "彭泽县", "瑞昌市", "共青城市", "新余市", "市辖区", "渝水区", "分宜县", "鹰潭市", "市辖区", "月湖区", "余江县", "贵溪市", "赣州市", "市辖区", "章贡区", "赣县", "信丰县", "大余县", "上犹县", "崇义县", "安远县", "龙南县", "定南县", "全南县", "宁都县", "于都县", "兴国县", "会昌县", "寻乌县", "石城县", "瑞金市", "南康市", "吉安市", "市辖区", "吉州区", "青原区", "吉安县", "吉水县", "峡江县", "新干县", "永丰县", "泰和县", "遂川县", "万安县", "安福县", "永新县", "井冈山市", "宜春市", "市辖区", "袁州区", "奉新县", "万载县", "上高县", "宜丰县", "靖安县", "铜鼓县", "丰城市", "樟树市", "高安市", "抚州市", "市辖区", "临川区", "南城县", "黎川县", "南丰县", "崇仁县", "乐安县", "宜黄县", "金溪县", "资溪县", "东乡县", "广昌县", "上饶市", "市辖区", "信州区", "上饶县", "广丰县", "玉山县", "铅山县", "横峰县", "弋阳县", "余干县", "鄱阳县", "万年县", "婺源县", "德兴市", "山东省", "济南市", "市辖区", "历下区", "市中区", "槐荫区", "天桥区", "历城区", "长清区", "平阴县", "济阳县", "商河县", "章丘市", "青岛市", "市辖区", "市南区", "市北区", "四方区", "黄岛区", "崂山区", "李沧区", "城阳区", "胶州市", "即墨市", "平度市", "胶南市", "莱西市", "淄博市", "市辖区", "淄川区", "张店区", "博山区", "临淄区", "周村区", "桓台县", "高青县", "沂源县", "枣庄市", "市辖区", "市中区", "薛城区", "峄城区", "台儿庄区", "山亭区", "滕州市", "东营市", "市辖区", "东营区", "河口区", "垦利县", "利津县", "广饶县", "烟台市", "市辖区", "芝罘区", "福山区", "牟平区", "莱山区", "长岛县", "龙口市", "莱阳市", "莱州市", "蓬莱市", "招远市", "栖霞市", "海阳市", "潍坊市", "市辖区", "潍城区", "寒亭区", "坊子区", "奎文区", "临朐县", "昌乐县", "青州市", "诸城市", "寿光市", "安丘市", "高密市", "昌邑市", "济宁市", "市辖区", "市中区", "任城区", "微山县", "鱼台县", "金乡县", "嘉祥县", "汶上县", "泗水县", "梁山县", "曲阜市", "兖州市", "邹城市", "泰安市", "岱岳区", "泰山区", "宁阳县", "东平县", "新泰市", "肥城市", "威海市", "市辖区", "环翠区", "文登市", "荣成市", "乳山市", "日照市", "市辖区", "东港区", "岚山区", "五莲县", "莒县", "莱芜市", "市辖区", "莱城区", "钢城区", "临沂市", "市辖区", "兰山区", "罗庄区", "河东区", "沂南县", "郯城县", "沂水县", "苍山县", "费县", "平邑县", "莒南县", "蒙阴县", "临沭县", "德州市", "市辖区", "德城区", "陵县", "宁津县", "庆云县", "临邑县", "齐河县", "平原县", "夏津县", "武城县", "乐陵市", "禹城市", "聊城市", "市辖区", "东昌府区", "阳谷县", "莘县", "茌平县", "东阿县", "冠县", "高唐县", "临清市", "滨州市", "市辖区", "滨城区", "惠民县", "阳信县", "无棣县", "沾化县", "博兴县", "邹平县", "菏泽市", "市辖区", "牡丹区", "曹县", "单县", "成武县", "巨野县", "郓城县", "鄄城县", "定陶县", "东明县", "河南省", "郑州市", "金水区", "中原区", "二七区", "管城回族区", "上街区", "惠济区", "中牟县", "巩义市", "荥阳市", "新密市", "新郑市", "登封市", "开封市", "市辖区", "龙亭区", "顺河回族区", "鼓楼区", "禹王台区", "金明区", "杞县", "通许县", "尉氏县", "开封县", "兰考县", "洛阳市", "市辖区", "老城区", "西工区", "廛河回族区", "涧西区", "吉利区", "洛龙区", "孟津县", "新安县", "栾川县", "嵩县", "汝阳县", "宜阳县", "洛宁县", "伊川县", "偃师市", "平顶山市", "市辖区", "新华区", "卫东区", "石龙区", "湛河区", "宝丰县", "叶县", "鲁山县", "郏县", "舞钢市", "汝州市", "安阳市", "市辖区", "文峰区", "北关区", "殷都区", "龙安区", "安阳县", "汤阴县", "滑县", "内黄县", "林州市", "鹤壁市", "市辖区", "鹤山区", "山城区", "淇滨区", "浚县", "淇县", "新乡市", "市辖区", "红旗区", "卫滨区", "凤泉区", "牧野区", "新乡县", "获嘉县", "原阳县", "延津县", "封丘县", "长垣县", "卫辉市", "辉县市", "焦作市", "市辖区", "解放区", "中站区", "马村区", "山阳区", "修武县", "博爱县", "武陟县", "温县", "沁阳市", "孟州市", "濮阳市", "市辖区", "华龙区", "清丰县", "南乐县", "范县", "台前县", "濮阳县", "许昌市", "市辖区", "魏都区", "许昌县", "鄢陵县", "襄城县", "禹州市", "长葛市", "漯河市", "召陵区", "源汇区", "郾城区", "舞阳县", "临颍县", "三门峡市", "市辖区", "湖滨区", "渑池县", "陕县", "卢氏县", "义马市", "灵宝市", "南阳市", "市辖区", "宛城区", "卧龙区", "南召县", "方城县", "西峡县", "镇平县", "内乡县", "淅川县", "社旗县", "唐河县", "新野县", "桐柏县", "邓州市", "商丘市", "市辖区", "梁园区", "睢阳区", "民权县", "睢县", "宁陵县", "柘城县", "虞城县", "夏邑县", "永城市", "新区", "信阳市", "市辖区", "浉河区", "平桥区", "罗山县", "光山县", "新县", "固始县", "潢川县", "淮滨县", "息县", "周口市", "市辖区", "川汇区", "扶沟县", "西华县", "商水县", "沈丘县", "郸城县", "淮阳县", "太康县", "鹿邑县", "项城市", "驻马店市", "市辖区", "驿城区", "西平县", "上蔡县", "平舆县", "正阳县", "确山县", "泌阳县", "汝南县", "遂平县", "新蔡县", "济源市", "市辖区", "湖北省", "武汉市", "市辖区", "江岸区", "江汉区", "硚口区", "汉阳区", "武昌区", "青山区", "洪山区", "东西湖区", "汉南区", "蔡甸区", "江夏区", "黄陂区", "新洲区", "黄石市", "市辖区", "黄石港区", "西塞山区", "下陆区", "铁山区", "阳新县", "大冶市", "十堰市", "市辖区", "茅箭区", "张湾区", "郧县", "郧西县", "竹山县", "竹溪县", "房县", "丹江口市", "宜昌市", "市辖区", "西陵区", "伍家岗区", "点军区", "猇亭区", "夷陵区", "远安县", "兴山县", "秭归县", "长阳土家族自治县", "五峰土家族自治县", "宜都市", "当阳市", "枝江市", "襄阳市", "市辖区", "襄城区", "樊城区", "襄州区", "南漳县", "谷城县", "保康县", "老河口市", "枣阳市", "宜城市", "鄂州市", "市辖区", "梁子湖区", "华容区", "鄂城区", "荆门市", "市辖区", "东宝区", "掇刀区", "京山县", "沙洋县", "钟祥市", "孝感市", "市辖区", "孝南区", "孝昌县", "大悟县", "云梦县", "应城市", "安陆市", "汉川市", "荆州市", "市辖区", "沙市区", "荆州区", "公安县", "监利县", "江陵县", "石首市", "洪湖市", "松滋市", "黄冈市", "市辖区", "黄州区", "团风县", "红安县", "罗田县", "英山县", "浠水县", "蕲春县", "黄梅县", "麻城市", "武穴市", "咸宁市", "市辖区", "咸安区", "嘉鱼县", "通城县", "崇阳县", "通山县", "赤壁市", "随州市", "市辖区", "曾都区", "广水市", "恩施土家族苗族自治州", "恩施市", "利川市", "建始县", "巴东县", "宣恩县", "咸丰县", "来凤县", "鹤峰县", "省直辖行政单位", "仙桃市", "潜江市", "天门市", "神农架林区", "湖南省", "长沙市", "市辖区", "芙蓉区", "天心区", "岳麓区", "开福区", "雨花区", "长沙县", "望城县", "宁乡县", "浏阳市", "株洲市", "市辖区", "荷塘区", "芦淞区", "石峰区", "天元区", "株洲县", "攸县", "茶陵县", "炎陵县", "醴陵市", "湘潭市", "市辖区", "雨湖区", "岳塘区", "湘潭县", "湘乡市", "韶山市", "衡阳市", "市辖区", "珠晖区", "雁峰区", "石鼓区", "蒸湘区", "南岳区", "衡阳县", "衡南县", "衡山县", "衡东县", "祁东县", "耒阳市", "常宁市", "邵阳市", "市辖区", "双清区", "大祥区", "北塔区", "邵东县", "新邵县", "邵阳县", "隆回县", "洞口县", "绥宁县", "新宁县", "城步苗族自治县", "武冈市", "岳阳市", "市辖区", "岳阳楼区", "云溪区", "君山区", "岳阳县", "华容县", "湘阴县", "平江县", "汨罗市", "临湘市", "常德市", "市辖区", "武陵区", "鼎城区", "安乡县", "汉寿县", "澧县", "临澧县", "桃源县", "石门县", "津市市", "张家界市", "市辖区", "永定区", "武陵源区", "慈利县", "桑植县", "益阳市", "市辖区", "资阳区", "赫山区", "南县", "桃江县", "安化县", "沅江市", "郴州市", "市辖区", "北湖区", "苏仙区", "桂阳县", "宜章县", "永兴县", "嘉禾县", "临武县", "汝城县", "桂东县", "安仁县", "资兴市", "永州市", "市辖区", "零陵区", "冷水滩区", "祁阳县", "东安县", "双牌县", "道县", "江永县", "宁远县", "蓝山县", "新田县", "江华瑶族自治县", "怀化市", "市辖区", "鹤城区", "中方县", "沅陵县", "辰溪县", "溆浦县", "会同县", "麻阳苗族自治县", "新晃侗族自治县", "芷江侗族自治县", "靖州苗族侗族自治县", "通道侗族自治县", "洪江市", "娄底市", "市辖区", "娄星区", "双峰县", "新化县", "冷水江市", "涟源市", "湘西土家族苗族自治州", "吉首市", "泸溪县", "凤凰县", "花垣县", "保靖县", "古丈县", "永顺县", "龙山县", "广东省", "广州市", "市辖区", "荔湾区", "越秀区", "海珠区", "天河区", "白云区", "黄埔区", "番禺区", "花都区", "南沙区", "萝岗区", "增城市", "从化市", "韶关市", "市辖区", "武江区", "浈江区", "曲江区", "始兴县", "仁化县", "翁源县", "乳源瑶族自治县", "新丰县", "乐昌市", "南雄市", "深圳市", "市辖区", "罗湖区", "福田区", "南山区", "宝安区", "龙岗区", "盐田区", "珠海市", "市辖区", "香洲区", "斗门区", "金湾区", "汕头市", "市辖区", "龙湖区", "金平区", "濠江区", "潮阳区", "潮南区", "澄海区", "南澳县", "佛山市", "市辖区", "禅城区", "南海区", "顺德区", "三水区", "高明区", "江门市", "市辖区", "蓬江区", "江海区", "新会区", "台山市", "开平市", "鹤山市", "恩平市", "湛江市", "市辖区", "赤坎区", "霞山区", "坡头区", "麻章区", "遂溪县", "徐闻县", "廉江市", "雷州市", "吴川市", "茂名市", "市辖区", "茂南区", "茂港区", "电白县", "高州市", "化州市", "信宜市", "肇庆市", "市辖区", "端州区", "鼎湖区", "广宁县", "怀集县", "封开县", "德庆县", "高要市", "四会市", "惠州市", "市辖区", "惠城区", "惠阳区", "博罗县", "惠东县", "龙门县", "梅州市", "市辖区", "梅江区", "梅县", "大埔县", "丰顺县", "五华县", "平远县", "蕉岭县", "兴宁市", "汕尾市", "市辖区", "城区", "海丰县", "陆河县", "陆丰市", "河源市", "市辖区", "源城区", "紫金县", "龙川县", "连平县", "和平县", "东源县", "阳江市", "市辖区", "江城区", "阳西县", "阳东县", "阳春市", "清远市", "市辖区", "清城区", "佛冈县", "阳山县", "连山壮族瑶族自治县", "连南瑶族自治县", "清新县", "英德市", "连州市", "东莞市", "中山市", "潮州市", "市辖区", "湘桥区", "潮安区", "饶平县", "揭阳市", "市辖区", "榕城区", "揭东县", "揭西县", "惠来县", "普宁市", "云浮市", "市辖区", "云城区", "新兴县", "郁南县", "云安县", "罗定市", "广西壮族自治区", "南宁市", "市辖区", "兴宁区", "青秀区", "江南区", "西乡塘区", "良庆区", "邕宁区", "武鸣县", "隆安县", "马山县", "上林县", "宾阳县", "横县", "柳州市", "市辖区", "城中区", "鱼峰区", "柳南区", "柳北区", "柳江县", "柳城县", "鹿寨县", "融安县", "融水苗族自治县", "三江侗族自治县", "桂林市", "市辖区", "秀峰区", "叠彩区", "象山区", "七星区", "雁山区", "阳朔县", "临桂区", "灵川县", "全州县", "兴安县", "永福县", "灌阳县", "龙胜各族自治县", "资源县", "平乐县", "荔浦县", "恭城瑶族自治县", "梧州市", "市辖区", "万秀区", "蝶山区", "长洲区", "苍梧县", "藤县", "蒙山县", "岑溪市", "北海市", "市辖区", "海城区", "银海区", "铁山港区", "合浦县", "防城港市", "市辖区", "港口区", "防城区", "上思县", "东兴市", "钦州市", "市辖区", "钦南区", "钦北区", "灵山县", "浦北县", "贵港市", "市辖区", "港北区", "港南区", "覃塘区", "平南县", "桂平市", "玉林市", "市辖区", "玉州区", "容县", "陆川县", "博白县", "兴业县", "北流市", "百色市", "市辖区", "右江区", "田阳县", "田东县", "平果县", "德保县", "靖西县", "那坡县", "凌云县", "乐业县", "田林县", "西林县", "隆林各族自治县", "贺州市", "市辖区", "八步区", "昭平县", "钟山县", "富川瑶族自治县", "河池市", "市辖区", "金城江区", "南丹县", "天峨县", "凤山县", "东兰县", "罗城仫佬族自治县", "环江毛南族自治县", "巴马瑶族自治县", "都安瑶族自治县", "大化瑶族自治县", "宜州市", "来宾市", "市辖区", "兴宾区", "忻城县", "象州县", "武宣县", "金秀瑶族自治县", "合山市", "崇左市", "市辖区", "江洲区", "扶绥县", "宁明县", "龙州县", "大新县", "天等县", "凭祥市", "海南省", "海口市", "市辖区", "秀英区", "龙华区", "琼山区", "美兰区", "三亚市", "市辖区", "省直辖县级行政单位", "五指山市", "琼海市", "儋州市", "文昌市", "万宁市", "东方市", "定安县", "屯昌县", "澄迈县", "临高县", "白沙黎族自治县", "昌江黎族自治县", "乐东黎族自治县", "陵水黎族自治县", "保亭黎族苗族自治县", "琼中黎族苗族自治县", "西沙群岛", "南沙群岛", "中沙群岛的岛礁及其海域", "重庆市", "万州区", "万州区", "涪陵区", "涪陵区", "渝中区", "渝中区", "大渡口区", "大渡口区", "江北区", "江北区", "沙坪坝区", "沙坪坝区", "九龙坡区", "九龙坡区", "南岸区", "南岸区", "北碚区", "北碚区", "万盛区", "万盛区", "双桥区", "双桥区", "渝北区", "渝北区", "巴南区", "巴南区", "黔江区", "黔江区", "长寿区", "长寿区", "綦江区", "綦江区", "潼南县", "潼南县", "铜梁县", "铜梁县", "大足区", "大足区", "荣昌县", "荣昌县", "璧山县", "璧山县", "梁平县", "梁平县", "城口县", "城口县", "丰都县", "丰都县", "垫江县", "垫江县", "武隆县", "武隆县", "忠县", "忠县", "开县", "开县", "云阳县", "云阳县", "奉节县", "奉节县", "巫山县", "巫山县", "巫溪县", "巫溪县", "石柱县", "石柱县", "秀山县", "秀山县", "酉阳县", "酉阳县", "彭水县", "彭水县", "江津区", "江津区", "合川区", "合川区", "永川区", "永川区", "南川区", "南川区", "四川省", "成都市", "市辖区", "锦江区", "青羊区", "金牛区", "武侯区", "成华区", "龙泉驿区", "青白江区", "新都区", "温江区", "金堂县", "双流县", "郫县", "大邑县", "蒲江县", "新津县", "都江堰市", "彭州市", "邛崃市", "崇州市", "自贡市", "市辖区", "自流井区", "贡井区", "大安区", "沿滩区", "荣县", "富顺县", "攀枝花市", "市辖区", "东区", "西区", "仁和区", "米易县", "盐边县", "泸州市", "市辖区", "江阳区", "纳溪区", "龙马潭区", "泸县", "合江县", "叙永县", "古蔺县", "德阳市", "市辖区", "旌阳区", "中江县", "罗江县", "广汉市", "什邡市", "绵竹市", "绵阳市", "市辖区", "涪城区", "游仙区", "三台县", "盐亭县", "安县", "梓潼县", "北川羌族自治县", "平武县", "江油市", "广元市", "市辖区", "市中区", "元坝区", "朝天区", "旺苍县", "青川县", "剑阁县", "苍溪县", "遂宁市", "市辖区", "船山区", "安居区", "蓬溪县", "射洪县", "大英县", "内江市", "市辖区", "市中区", "东兴区", "威远县", "资中县", "隆昌县", "乐山市", "市辖区", "市中区", "沙湾区", "五通桥区", "金口河区", "犍为县", "井研县", "夹江县", "沐川县", "峨边彝族自治县", "马边彝族自治县", "峨眉山市", "南充市", "市辖区", "顺庆区", "高坪区", "嘉陵区", "南部县", "营山县", "蓬安县", "仪陇县", "西充县", "阆中市", "眉山市", "市辖区", "东坡区", "仁寿县", "彭山县", "洪雅县", "丹棱县", "青神县", "宜宾市", "市辖区", "翠屏区", "宜宾县", "南溪县", "江安县", "长宁县", "高县", "珙县", "筠连县", "兴文县", "屏山县", "广安市", "市辖区", "广安区", "岳池县", "武胜县", "邻水县", "华蓥市", "广安区", "达州市", "市辖区", "通川区", "达川区", "宣汉县", "开江县", "大竹县", "渠县", "万源市", "雅安市", "雨城区", "雨城区", "名山区", "荥经县", "汉源县", "石棉县", "天全县", "芦山县", "宝兴县", "巴中市", "市辖区", "巴州区", "通江县", "南江县", "平昌县", "资阳市", "市辖区", "雁江区", "安岳县", "乐至县", "简阳市", "阿坝藏族羌族自治州", "汶川县", "理县", "茂县", "松潘县", "九寨沟县", "金川县", "小金县", "黑水县", "马尔康县", "壤塘县", "阿坝县", "若尔盖县", "红原县", "甘孜藏族自治州", "康定县", "泸定县", "丹巴县", "九龙县", "雅江县", "道孚县", "炉霍县", "甘孜县", "新龙县", "德格县", "白玉县", "石渠县", "色达县", "理塘县", "巴塘县", "乡城县", "稻城县", "得荣县", "凉山彝族自治州", "西昌市", "木里藏族自治县", "盐源县", "德昌县", "会理县", "会东县", "宁南县", "普格县", "布拖县", "金阳县", "昭觉县", "喜德县", "冕宁县", "越西县", "甘洛县", "美姑县", "雷波县", "贵州省", "贵阳市", "市辖区", "南明区", "云岩区", "花溪区", "乌当区", "白云区", "小河区", "开阳县", "息烽县", "修文县", "清镇市", "六盘水市", "钟山区", "六枝特区", "水城县", "盘县", "遵义市", "市辖区", "红花岗区", "汇川区", "遵义县", "桐梓县", "绥阳县", "正安县", "道真仡佬族苗族自治县", "务川仡佬族苗族自治县", "凤冈县", "湄潭县", "余庆县", "习水县", "赤水市", "仁怀市", "安顺市", "市辖区", "西秀区", "平坝县", "普定县", "镇宁布依族苗族自治县", "关岭布依族苗族自治县", "紫云苗族布依族自治县", "铜仁市", "碧江区", "江口县", "玉屏侗族自治县", "石阡县", "思南县", "印江土家族苗族自治县", "德江县", "沿河土家族自治县", "松桃苗族自治县", "万山区", "黔西南布依族苗族自治州", "兴义市", "兴仁县", "普安县", "晴隆县", "贞丰县", "望谟县", "册亨县", "安龙县", "毕节市", "七星关区", "大方县", "黔西县", "金沙县", "织金县", "纳雍县", "威宁彝族回族苗族自治县", "赫章县", "黔东南苗族侗族自治州", "凯里市", "黄平县", "施秉县", "三穗县", "镇远县", "岑巩县", "天柱县", "锦屏县", "剑河县", "台江县", "黎平县", "榕江县", "从江县", "雷山县", "麻江县", "丹寨县", "黔南布依族苗族自治州", "都匀市", "福泉市", "荔波县", "贵定县", "瓮安县", "独山县", "平塘县", "罗甸县", "长顺县", "龙里县", "惠水县", "三都水族自治县", "云南省", "昆明市", "市辖区", "五华区", "盘龙区", "官渡区", "西山区", "东川区", "呈贡县", "晋宁县", "富民县", "宜良县", "石林彝族自治县", "嵩明县", "禄劝彝族苗族自治县", "寻甸回族彝族自治县", "安宁市", "曲靖市", "市辖区", "麒麟区", "马龙县", "陆良县", "师宗县", "罗平县", "富源县", "会泽县", "沾益县", "宣威市", "玉溪市", "市辖区", "红塔区", "江川县", "澄江县", "通海县", "华宁县", "易门县", "峨山彝族自治县", "新平彝族傣族自治县", "元江哈尼族彝族傣族自治县", "保山市", "市辖区", "隆阳区", "施甸县", "腾冲县", "龙陵县", "昌宁县", "昭通市", "市辖区", "昭阳区", "鲁甸县", "巧家县", "盐津县", "大关县", "永善县", "绥江县", "镇雄县", "彝良县", "威信县", "水富县", "丽江市", "市辖区", "古城区", "玉龙纳西族自治县", "永胜县", "华坪县", "宁蒗彝族自治县", "普洱市", "市辖区", "翠云区", "宁洱哈尼族彝族自治县", "墨江哈尼族自治县", "景东彝族自治县", "景谷傣族彝族自治县", "镇沅彝族哈尼族拉祜族自治县", "江城哈尼族彝族自治县", "孟连傣族拉祜族佤族自治县", "澜沧拉祜族自治县", "西盟佤族自治县", "临沧市", "市辖区", "临翔区", "凤庆县", "云县", "永德县", "镇康县", "双江拉祜族佤族布朗族傣族自治县", "耿马傣族佤族自治县", "沧源佤族自治县", "楚雄彝族自治州", "楚雄市", "双柏县", "牟定县", "南华县", "姚安县", "大姚县", "永仁县", "元谋县", "武定县", "禄丰县", "红河哈尼族彝族自治州", "个旧市", "开远市", "蒙自市", "屏边苗族自治县", "建水县", "石屏县", "弥勒市", "泸西县", "元阳县", "红河县", "金平苗族瑶族傣族自治县", "绿春县", "河口瑶族自治县", "文山壮族苗族自治州", "文山市", "砚山县", "西畴县", "麻栗坡县", "马关县", "丘北县", "广南县", "富宁县", "西双版纳傣族自治州", "景洪市", "勐海县", "勐腊县", "大理白族自治州", "大理市", "漾濞彝族自治县", "祥云县", "宾川县", "弥渡县", "南涧彝族自治县", "巍山彝族回族自治县", "永平县", "云龙县", "洱源县", "剑川县", "鹤庆县", "德宏傣族景颇族自治州", "瑞丽市", "潞西市", "梁河县", "盈江县", "陇川县", "怒江傈僳族自治州", "泸水县", "福贡县", "贡山独龙族怒族自治县", "兰坪白族普米族自治县", "迪庆藏族自治州", "香格里拉县", "德钦县", "维西傈僳族自治县", "西藏自治区", "拉萨市", "市辖区", "城关区", "林周县", "当雄县", "尼木县", "曲水县", "堆龙德庆县", "达孜县", "墨竹工卡县", "昌都地区", "昌都县", "江达县", "贡觉县", "类乌齐县", "丁青县", "察雅县", "八宿县", "左贡县", "芒康县", "洛隆县", "边坝县", "山南地区", "乃东县", "扎囊县", "贡嘎县", "桑日县", "琼结县", "曲松县", "措美县", "洛扎县", "加查县", "隆子县", "错那县", "浪卡子县", "日喀则地区", "日喀则市", "南木林县", "江孜县", "定日县", "萨迦县", "拉孜县", "昂仁县", "谢通门县", "白朗县", "仁布县", "康马县", "定结县", "仲巴县", "亚东县", "吉隆县", "聂拉木县", "萨嘎县", "岗巴县", "那曲地区", "那曲县", "嘉黎县", "比如县", "聂荣县", "安多县", "申扎县", "索县", "班戈县", "巴青县", "尼玛县", "阿里地区", "普兰县", "札达县", "噶尔县", "日土县", "革吉县", "改则县", "措勤县", "林芝地区", "林芝县", "工布江达县", "米林县", "墨脱县", "波密县", "察隅县", "朗县", "陕西省", "西安市", "长安区", "新城区", "碑林区", "莲湖区", "灞桥区", "未央区", "雁塔区", "阎良区", "临潼区", "蓝田县", "周至县", "户县", "高陵县", "铜川市", "市辖区", "王益区", "印台区", "耀州区", "宜君县", "宝鸡市", "市辖区", "渭滨区", "金台区", "陈仓区", "凤翔县", "岐山县", "扶风县", "眉县", "陇县", "千阳县", "麟游县", "凤县", "太白县", "咸阳市", "市辖区", "秦都区", "渭城区", "三原县", "泾阳县", "乾县", "礼泉县", "永寿县", "彬县", "长武县", "旬邑县", "淳化县", "武功县", "兴平市", "渭南市", "市辖区", "临渭区", "华县", "潼关县", "大荔县", "合阳县", "澄城县", "蒲城县", "白水县", "富平县", "韩城市", "华阴市", "延安市", "市辖区", "宝塔区", "延长县", "延川县", "子长县", "安塞县", "志丹县", "吴起县", "甘泉县", "富县", "洛川县", "宜川县", "黄龙县", "黄陵县", "汉中市", "市辖区", "汉台区", "南郑县", "城固县", "洋县", "西乡县", "勉县", "宁强县", "略阳县", "镇巴县", "留坝县", "佛坪县", "榆林市", "市辖区", "榆阳区", "神木县", "府谷县", "横山县", "靖边县", "定边县", "绥德县", "米脂县", "佳县", "吴堡县", "清涧县", "子洲县", "安康市", "市辖区", "汉滨区", "汉阴县", "石泉县", "宁陕县", "紫阳县", "岚皋县", "平利县", "镇坪县", "旬阳县", "白河县", "商洛市", "市辖区", "商州区", "洛南县", "丹凤县", "商南县", "山阳县", "镇安县", "柞水县", "杨凌示范区", "杨凌区", "甘肃省", "兰州市", "市辖区", "城关区", "七里河区", "西固区", "安宁区", "红古区", "永登县", "皋兰县", "榆中县", "嘉峪关市", "市辖区", "金昌市", "金川区", "永昌县", "白银市", "市辖区", "白银区", "平川区", "靖远县", "会宁县", "景泰县", "天水市", "麦积区", "秦州区", "清水县", "秦安县", "甘谷县", "武山县", "张家川回族自治县", "武威市", "市辖区", "凉州区", "民勤县", "古浪县", "天祝藏族自治县", "张掖市", "市辖区", "甘州区", "肃南裕固族自治县", "民乐县", "临泽县", "高台县", "山丹县", "平凉市", "市辖区", "崆峒区", "泾川县", "灵台县", "崇信县", "华亭县", "庄浪县", "静宁县", "酒泉市", "市辖区", "肃州区", "金塔县", "瓜洲县", "肃北蒙古族自治县", "阿克塞哈萨克族自治县", "玉门市", "敦煌市", "庆阳市", "市辖区", "西峰区", "庆城县", "环县", "华池县", "合水县", "正宁县", "宁县", "镇原县", "定西市", "市辖区", "安定区", "通渭县", "陇西县", "渭源县", "临洮县", "漳县", "岷县", "陇南市", "武都区", "成县", "文县", "宕昌县", "康县", "西和县", "礼县", "徽县", "两当县", "临夏回族自治州", "临夏市", "临夏县", "康乐县", "永靖县", "广河县", "和政县", "东乡族自治县", "积石山保安族东乡族撒拉族自治县", "甘南藏族自治州", "合作市", "临潭县", "卓尼县", "舟曲县", "迭部县", "玛曲县", "碌曲县", "夏河县", "青海省", "西宁市", "市辖区", "城东区", "城中区", "城西区", "城北区", "大通回族土族自治县", "湟中县", "湟源县", "海东市", "平安县", "民和回族土族自治县", "乐都区", "互助土族自治县", "化隆回族自治县", "循化撒拉族自治县", "海北藏族自治州", "门源回族自治县", "祁连县", "海晏县", "刚察县", "黄南藏族自治州", "同仁县", "尖扎县", "泽库县", "河南蒙古族自治县", "海南藏族自治州", "共和县", "同德县", "贵德县", "兴海县", "贵南县", "果洛藏族自治州", "玛沁县", "班玛县", "甘德县", "达日县", "久治县", "玛多县", "玉树藏族自治州", "玉树县", "杂多县", "称多县", "治多县", "囊谦县", "曲麻莱县", "海西蒙古族藏族自治州", "格尔木市", "德令哈市", "乌兰县", "都兰县", "天峻县", "宁夏回族自治区", "银川市", "兴庆区", "西夏区", "金凤区", "永宁县", "贺兰县", "灵武市", "石嘴山市", "大武口区", "惠农县", "平罗县", "吴忠市", "红寺堡区", "利通区", "盐池县", "同心县", "青铜峡市", "固原市", "市辖区", "原州区", "西吉县", "隆德县", "泾源县", "彭阳县", "中卫市", "市辖区", "沙坡头区", "中宁县", "海原县", "新疆维吾尔自治区", "乌鲁木齐市", "市辖区", "天山区", "沙依巴克区", "新市区", "水磨沟区", "头屯河区", "达坂城区", "东山区", "乌鲁木齐县", "克拉玛依市", "市辖区", "独山子区", "克拉玛依区", "白碱滩区", "乌尔禾区", "吐鲁番地区", "吐鲁番市", "鄯善县", "托克逊县", "哈密地区", "哈密市", "巴里坤哈萨克自治县", "伊吾县", "昌吉回族自治州", "昌吉市", "阜康市", "米泉市", "呼图壁县", "玛纳斯县", "奇台县", "吉木萨尔县", "木垒哈萨克自治县", "博尔塔拉蒙古自治州", "博乐市", "精河县", "温泉县", "巴音郭楞蒙古自治州", "库尔勒市", "轮台县", "尉犁县", "若羌县", "且末县", "焉耆回族自治县", "和静县", "和硕县", "博湖县", "阿克苏地区", "阿克苏市", "温宿县", "库车县", "沙雅县", "新和县", "拜城县", "乌什县", "阿瓦提县", "柯坪县", "克孜勒苏柯尔克孜自治州", "阿图什市", "阿克陶县", "阿合奇县", "乌恰县", "喀什地区", "喀什市", "疏附县", "疏勒县", "英吉沙县", "泽普县", "莎车县", "叶城县", "麦盖提县", "岳普湖县", "伽师县", "巴楚县", "塔什库尔干塔吉克自治县", "和田地区", "和田市", "和田县", "墨玉县", "皮山县", "洛浦县", "策勒县", "于田县", "民丰县", "伊犁哈萨克自治州", "伊宁市", "奎屯市", "伊宁县", "察布查尔锡伯自治县", "霍城县", "巩留县", "新源县", "昭苏县", "特克斯县", "尼勒克县", "塔城地区", "塔城市", "乌苏市", "额敏县", "沙湾县", "托里县", "裕民县", "和布克赛尔蒙古自治县", "阿勒泰地区", "阿勒泰市", "布尔津县", "富蕴县", "福海县", "哈巴河县", "青河县", "吉木乃县", "省直辖行政单位", "石河子市", "阿拉尔市", "图木舒克市", "五家渠市"]; const Index = { intoHome() { @@ -210,4 +210,4 @@ const Index = { } } -module.exports = { Index }; +module.exports = Index; diff --git a/app/dy/Live.js b/app/dy/Live.js index 2ade541..a493ef0 100644 --- a/app/dy/Live.js +++ b/app/dy/Live.js @@ -1,6 +1,6 @@ -import { Common } from 'app/dy/Common.js'; -import { statistics } from 'common/statistics'; -import { V } from 'version/V.js'; +let Common = require('app/dy/Common.js'); +let statistics = require('common/statistics'); +let V = require('version/V.js'); let Live = { getUserCountTag() { @@ -14,9 +14,9 @@ let Live = { Common.sleep(3000); }, - getUserTags() { + _getUserTags() { //小米手机的left是1,华为是0,这里10控制 - console.log("length", Common.id(V.Live.getUserTags[0]).findOnce().children().length); + console.log("length", Common.id(V.Live.getUserTags[0]).findOnce().children().length()); let tags = Common.id(V.Live.getUserTags[0]).findOnce().children().find(UiSelector().textMatches(V.Live.getUserTags[1]).isVisibleToUser(true).filter((v) => { //console.log("vvv", v); return v && !v.text().includes('我的信息') && v.bounds().left < 10 && v.bounds().width() >= Device.width() - 10; @@ -24,27 +24,36 @@ let Live = { return tags; }, + getUserTags() { + let tags = Common.id(V.Live.getUserTags[0]).findOnce().children().find(UiSelector().className(V.Live.getUserTags[2]).isVisibleToUser(true).filter((v) => { + //console.log("vvv", v); + return v && v.bounds().left < 10 && v.bounds().width() >= Device.width() - 10; + })); + return tags; + }, + + //userCount: 0, getUsers() { let tags = this.getUserTags(); let users = []; for (let i in tags) { - let tp = /第(\d+)名/.exec(tags[i].text()); users.push({ - title: tags[i].text(), + //title: tags[i].text(),//_addr tag: tags[i], - index: (tp && tp[1]) || 1000, + //index: ++this.userCount, }); + Log.log(tags[i]); } Log.log("粉丝列表:" + tags.length); - Log.log(tags); return users; }, - intoFansPage(data) { - Log.log(data.tag); - Common.click(data.tag); - Log.log('点击list'); - Common.sleep(2000); + getNickname() { + let userTag = Common.id(V.Live.intoFansPage[0]).isVisibleToUser(true).findOne(); + return userTag ? userTag.text() : ''; + }, + + intoFansPage() { let nickTag = Common.id(V.Live.intoFansPage[0]).findOnce(); Common.click(nickTag); statistics.viewUser(); @@ -52,14 +61,14 @@ let Live = { Common.sleep(3500); }, - swipeFansList(rate) { - if (rate === undefined) { - rate = 1; + swipeFansList() { + let a = UiSelector().scrollable(true).isVisibleToUser(true).findOne(); + if (a) { + a.scrollForward(); + Log.log('滑动成功'); + } else { + Log.log('滑动失败'); } - let left = Math.random() * Device.width() * 0.8 + Device.width() * 0.2; - let bottom = Device.height() * 2 / 3; - let top = Device.height() / 2; - Gesture.swipe(left, bottom * rate, left, top * rate, 150 + 100 * Math.random());//从下往上推,清除 }, getNewRecord: function (baseRecord, grabRecord) { @@ -240,4 +249,4 @@ let Live = { } } -module.exports = { Live }; +module.exports = Live; diff --git a/app/dy/Message.js b/app/dy/Message.js index d37b8bb..e86771f 100644 --- a/app/dy/Message.js +++ b/app/dy/Message.js @@ -1,9 +1,9 @@ -import { Common } from 'app/dy/Common.js'; -import { Comment } from 'app/dy/Comment.js'; -import { User } from 'app/dy/User.js'; -import { Video } from 'app/dy/Video.js'; -import { statistics } from 'common/statistics'; -import { V } from 'version/V.js'; +let Common = require('app/dy/Common.js'); +let Comment = require('app/dy/Comment.js'); +let User = require('app/dy/User.js'); +let Video = require('app/dy/Video.js'); +let statistics = require('common/statistics'); +let V = require('version/V.js'); let Message = { showAll() { @@ -228,7 +228,11 @@ let Message = { let groupTag = UiSelector().descContains(V.Message.intoGroupUserList[2]).isVisibleToUser(true).findOnce(); if (!groupTag) { - throw new Error('找不到“groupTag“'); + groupTag = UiSelector().descContains(V.Message.intoGroupUserList[2]).findOnce(); + + if (!groupTag) { + throw new Error('找不到“groupTag“'); + } } groupTag.click(); @@ -243,34 +247,49 @@ let Message = { } let rpCount = 0; + let rpContains = []; while (true) { - let rp = 0; - let count = 0 - let contains = Common.id(V.Message.intoGroupUserList[4]).find(); + let contains = Common.id(V.Message.intoGroupUserList[4]).isVisibleToUser(true).find(); + + if (0 == contains.length) { + return true; + } + + let isAddFirst = false; for (let i in contains) { if (isNaN(i)) { continue; } - count++; if (contains[i].bounds().top < groupTag.bounds().top) { - rp++; continue; } if (contains[i].bounds().top > Device.height()) { - rp++; continue; } let titleTag = contains[i].children().findOne(Common.id(V.Message.intoGroupUserList[5])) || contains[i].children().findOne(Common.id(V.Message.intoGroupUserList[6])); if (!titleTag || !titleTag.text()) { - rp++; continue; } + if (!isAddFirst) { + rpContains.push(titleTag.text()); + if (rpContains[0] == rpContains[1]) { + rpCount++; + } else { + rpCount = 0; + } + + if (rpContains.length >= 2) { + rpContains.shift(); + } + Log.log('rpContains', rpContains, rpCount); + isAddFirst = true; + } + if (contents.includes(titleTag.text()) || machineInclude(titleTag.text())) { - rp++; continue; } @@ -314,20 +333,14 @@ let Message = { Common.back(); } - if (rp === count) { - rpCount++; - } else { - rpCount = 0; - } - if (rpCount >= 3) { return true; } - Common.swipe(0, 0.6); + Common.swipeFansGroupListOp(); Log.log('滑动'); Common.sleep(1000 + 1000 * Math.random()); } } } -module.exports = { Message }; +module.exports = Message; diff --git a/app/dy/Search.js b/app/dy/Search.js index 20a7059..25ce719 100644 --- a/app/dy/Search.js +++ b/app/dy/Search.js @@ -1,8 +1,8 @@ -import { Common } from 'app/dy/Common.js'; -import { User } from 'app/dy/User.js'; -import { statistics } from 'common/statistics'; -import { V } from 'version/V.js'; -import { Video } from 'app/dy/Video.js'; +let Common = require('app/dy/Common.js'); +let User = require('app/dy/User.js'); +let statistics = require('common/statistics'); +let V = require('version/V.js'); +let Video = require('app/dy/Video.js'); const Search = { //type = 0 视频 type = 1 用户 需要先进入搜索页 @@ -54,7 +54,7 @@ const Search = { } console.log('进入用户或者视频:', videoTag); - Common.click(videoTag); + Common.click(videoTag, 0.2); Common.sleep(3000 + 2000 * Math.random()); }, @@ -219,7 +219,7 @@ const Search = { Log.log('containers为0'); } - arr.push(tags ? (tags[0]?._addr) : null); + arr.push(tags ? (tags[0] && tags[0]._addr) : null); if (arr.length >= 3) { arr.shift(); } @@ -376,4 +376,4 @@ const Search = { } } -module.exports = { Search }; +module.exports = Search; diff --git a/app/dy/User.js b/app/dy/User.js index c75bb74..26303e6 100644 --- a/app/dy/User.js +++ b/app/dy/User.js @@ -1,6 +1,6 @@ -import { Common } from 'app/dy/Common.js'; -import { statistics } from 'common/statistics.js'; -import { V } from 'version/V.js'; +let Common = require('app/dy/Common.js'); +let statistics = require('common/statistics.js'); +let V = require('version/V.js'); const User = { //保证执行的时候在哪个页面,执行完成也是哪个界面 @@ -37,13 +37,14 @@ const User = { return false; } Common.click(textTag); + Common.sleep(500); textTag = Common.id(V.User.privateMsg[6]).findOnce(); let iText = ''; for (let i = 0; i < msg.length; i++) { iText = msg.substring(0, i + 1); textTag.setText(iText); - Common.sleep(500 + 1000 * Math.random()); + Common.sleep(200 + 300 * Math.random()); } Common.sleep(500); @@ -402,7 +403,7 @@ const User = { Log.log('containers为0'); } - arr.push(containers ? (containers[0]?._addr) : null); + arr.push(containers ? (containers[0] && containers[0]._addr) : null); if (arr.length > 2) { arr.shift(); } @@ -551,7 +552,7 @@ const User = { Log.log('containers为0'); } - arr.push(containers ? (containers[0]?._addr) : null); + arr.push(containers ? (containers[0] && containers[0]._addr) : null); if (arr.length >= 3) { arr.shift(); } @@ -779,7 +780,7 @@ const User = { Log.log('containers为0'); } - arr.push(containers ? (containers[0]?._addr) : null); + arr.push(containers ? (containers[0] && containers[0]._addr) : null); if (arr.length >= 3) { arr.shift(); } @@ -1079,8 +1080,106 @@ const User = { return false; } - return Common.id(V.User.hasAlertInput[0]).findOne() + return Common.id(V.User.hasAlertInput[0]).findOne(); }, + + zanHead() { + Log.log("准备点击头像"); + let header = Common.id(V.User.head[0]).isVisibleToUser(true).findOne(); + Log.log(header); + if (header) { + Common.click(header); + Common.sleep(1000 + 1000 * Math.random()); + let zanTag = Common.id(V.User.head[1]).textContains(V.User.head[2]).isVisibleToUser(true).findOne(); + Common.click(zanTag); + Common.sleep(1000); + Common.back(1); + Common.sleep(1000); + } else { + Common.back(); + Common.sleep(1000); + } + }, + + intoLive() { + let header = Common.id(V.User.head[0]).isVisibleToUser(true).findOne(); + Log.log(header); + if (header) { + Common.click(header); + return true; + } + return false; + }, + + privateMsgCard(index) { + if (Common.id(V.User.privateMsg[0]).text(V.User.privateMsg[1]).findOnce()) { + Log.log('私密账号'); + return false; + } + + let settingTag = Common.id(V.User.privateMsg[2]).desc(V.User.privateMsg[3]).isVisibleToUser(true).findOnce(); + if (!settingTag) { + Log.log('找不到setting按钮'); + return false; + } + + Common.click(settingTag); + Log.log("私信"); + Common.sleep(1000); + + let sendTag = Common.id(V.User.privateMsg[4]).text(V.User.privateMsg[5]).findOnce(); + if (!sendTag) { + Log.log('找不到发私信按钮'); + return false; + } + + Common.click(sendTag.parent()); + Common.sleep(4000 + 2000 * Math.random()); + + let tag = Common.id(V.User.more[0]).descContains(V.User.more[1]).findOnce(); + if (!tag) { + Log.log('找不到“更多”');//点击更多,弹出“经营工具” + Common.back(); + return false; + } + + Common.click(tag); + Common.sleep(500); + + let jingyingTag = Common.id(V.User.more[2]).textContains(V.User.more[3]).findOne(); + Common.click(jingyingTag); + Common.sleep(4000 + 1200 * Math.random()); + + let highTag = UiSelector().textContains(V.User.more[4]).descContains(V.User.more[4]).isVisibleToUser(true).findOne(); + Log.log(highTag); + if (!highTag) { + Log.log('没有找到高级在线预约'); + return false; + } + + Log.log('点击高级在线预约'); + Common.click(highTag); + Common.sleep(3000 + 1200 * Math.random()); + + let cardsTag = UiSelector().textContains(V.User.more[5]).descContains(V.User.more[5]).isVisibleToUser(true).findOne(); + if (!cardsTag) { + Log.log('没有卡片'); + return false; + } + + Gesture.click(cardsTag.bounds().left + Device.width() / 2 * Math.random(), cardsTag.bounds().top - 160 * Math.random()); + Common.sleep(500 + 500 * Math.random()); + + let sendTags = UiSelector().textContains(V.User.more[6]).descContains(V.User.more[6]).clickable(true).isVisibleToUser(true).findOne(); + if (!sendTags) { + Log.log('没有发送按钮'); + return false; + } + + Log.log(sendTags.bounds()); + Common.click(sendTags); + Common.sleep(1000 + 1000 * Math.random()); + } } -module.exports = { User }; +module.exports = User; diff --git a/app/dy/Video.js b/app/dy/Video.js index ec090ac..70e2509 100644 --- a/app/dy/Video.js +++ b/app/dy/Video.js @@ -1,6 +1,6 @@ -import { Common } from 'app/dy/Common.js'; -import { statistics } from 'common/statistics.js'; -import { V } from 'version/V.js'; +let Common = require('app/dy/Common.js'); +let statistics = require('common/statistics.js'); +let V = require('version/V.js'); const Video = { next() { @@ -468,4 +468,4 @@ const Video = { } -module.exports = { Video }; +module.exports = Video; diff --git a/app/iDy.js b/app/iDy.js index 7e461ca..9c15926 100644 --- a/app/iDy.js +++ b/app/iDy.js @@ -1,12 +1,12 @@ -import { Common as DyCommon } from 'app/dy/Common.js'; -import { Video as DyVideo } from 'app/dy/Video.js'; -import { User as DyUser } from 'app/dy/User.js'; -import { Index as DyIndex } from 'app/dy/Index.js'; -import { Comment as DyComment } from 'app/dy/Comment.js'; -import { storage } from 'common/storage.js'; -import { machine } from 'common/machine.js'; -import { baiduWenxin } from 'service/baiduWenxin.js'; -import { statistics } from 'common/statistics.js'; +let DyCommon = require('app/dy/Common.js'); +let DyVideo = require('app/dy/Video.js'); +let DyUser = require('app/dy/User.js'); +let DyIndex = require('app/dy/Index.js'); +let DyComment = require('app/dy/Comment.js'); +let storage = require('common/storage.js'); +let machine = require('common/machine.js'); +let baiduWenxin = require('service/baiduWenxin.js'); +let statistics = require('common/statistics.js'); let iDy = { me: {},//当前账号的信息 @@ -54,8 +54,7 @@ let iDy = { taskCheck() { //查看是否到了时间,没有的话,直接返回flase let hour = this.configData.toker_run_hour; - - if (!hour.includes((new Date()).getHours().toString())) { + if (!hour.includes("" + (new Date()).getHours())) { return 101;//不在任务时间 } @@ -407,7 +406,7 @@ let iDy = { } } - + if (userData) { Log.log('看到了用户数据了哦'); } else { @@ -454,4 +453,4 @@ let iDy = { }, } -module.exports = { iDy }; +module.exports = iDy; diff --git a/app/xhs/Common.js b/app/xhs/Common.js index f063ecd..14213ad 100644 --- a/app/xhs/Common.js +++ b/app/xhs/Common.js @@ -1,7 +1,7 @@ -import { storage as cStorage } from 'common/storage.js'; -import { XhsV as V } from 'version/XhsV.js'; +let cStorage = require('common/storage.js'); +let V = require('version/XhsV.js'); -const Common = { +let Common = { //封装的方法 logs: [], id(name) { @@ -63,6 +63,35 @@ const Common = { return true; }, + clickRange(tag, top, bottom) { + if (tag.bounds().top + tag.bounds().height() <= top) { + return false; + } + + if (tag.bounds().top >= bottom) { + return false; + } + + if (tag.bounds().top > top && tag.bounds().top + tag.bounds().height() < bottom) { + this.click(tag); + return true; + } + + //卡在top的上下 + if (tag.bounds().top <= top && tag.bounds().top + tag.bounds().height() > top) { + let topY = tag.bounds().top + tag.bounds().height() - top; + Gesture.click(tag.bounds().left + tag.bounds().width() * Math.random(), (tag.bounds().top + 1) + (topY - 1) * Math.random()); + return true; + } + + if (tag.bounds().top < bottom && tag.bounds().top + tag.bounds().height() >= bottom) { + let topY = bottom - tag.bounds().top; + Gesture.click(tag.bounds().left + tag.bounds().width() * Math.random(), tag.bounds().top + (topY - 1) * Math.random()); + return true; + } + return false; + }, + openApp() { this.log('openApp', System.currentPackage(), cStorage.getPackage()); if (cStorage.getPackage() && System.currentPackage() !== cStorage.getPackage() && cStorage.getPackage() !== 'top.deeke.script') { @@ -189,6 +218,19 @@ const Common = { //Log.log(this.swipeCommentListOpTarget); }, + swipeWorkOp() { + let tag = this.id(V.Search.container).scrollable(true).filter((v) => { + return v && v.bounds() && v.bounds().top > 0 && v.bounds().left >= 0 && v.bounds().width() == Device.width() && v.bounds().top >= 0; + }).findOnce(); + if (tag) { + tag.scrollForward(); + } else { + Log.log('滑动失败'); + } + //Log.log(this.swipeCommentListOpTarget); + }, + + //关闭弹窗 closeAlert() { this.log('开启线程监听弹窗'); @@ -197,7 +239,7 @@ const Common = { while (true) { //检测是否只有当前的线程,是的话则关闭 try { - let a = this.id('close').findOne(); + let a = this.id('aj3').textContains('稍后再说').isVisibleToUser(true).findOne();//免流量升级 if (a) { a.click(); Log.log(a); @@ -212,11 +254,6 @@ const Common = { } k++; } catch (e) { - console.log("线程中断状态:", Engines.isInterrupted()); - if (Engines.isInterrupted()) { - Log.log("线程被外部中断"); - break; - } this.log("close dialog 异常了"); this.log(e); } @@ -288,4 +325,4 @@ const Common = { }, } -module.exports = { Common }; +module.exports = Common; diff --git a/app/xhs/Index.js b/app/xhs/Index.js index d20e8ce..1cb6eab 100644 --- a/app/xhs/Index.js +++ b/app/xhs/Index.js @@ -1,5 +1,5 @@ -import { XhsV as V } from "version/XhsV.js"; -import { Common } from "app/xhs/Common.js"; +let V = require("version/XhsV.js"); +let Common = require("app/xhs/Common.js"); let Index = { intoCity() { @@ -103,7 +103,21 @@ let Index = { return Common.id(V.Work.head[0]).isVisibleToUser(true).findOne(); } return Common.id(V.Work.videoNickname[0]).isVisibleToUser(true).findOne(); - } + }, + + //从主页进入搜索页 + intoSearchPage() { + Common.sleep(3000); + let searchTag = Common.id(V.Index.intoSearchPage[0]).descContains(V.Index.intoSearchPage[1]).isVisibleToUser(true).findOneBy(5000); + Log.log(searchTag); + if (!searchTag) { + throw new Error('找不到搜索框,无法进入搜索页'); + } + //searchTag.click(); + Common.click(searchTag); + Common.sleep(2000); + return true; + }, } -module.exports = { Index }; +module.exports = Index; diff --git a/app/xhs/Search.js b/app/xhs/Search.js new file mode 100644 index 0000000..12fec91 --- /dev/null +++ b/app/xhs/Search.js @@ -0,0 +1,58 @@ +let Common = require("app/xhs/Common.js"); +let V = require("version/XhsV.js"); + +let Search = { + intoSearchList(keyword) { + //开始搜索 + let iptTag = Common.id(V.Search.intoSearchList[0]).isVisibleToUser(true).findOneBy(5000); + if (!iptTag) { + throw new Error('没有找到输入框'); + } + iptTag.setText(keyword); + + Common.sleep(1500); + //找到搜索按钮 + let searchBtnTag = Common.id(V.Search.intoSearchList[1]).desc(V.Search.intoSearchList[2]).isVisibleToUser(true).findOnce(); + if (!searchBtnTag) { + Log.log('新按钮'); + searchBtnTag = UiSelector().className('android.widget.Button').text(V.Search.intoSearchList[2]).isVisibleToUser(true).findOne() || UiSelector().className('android.widget.Button').text(V.Search.intoSearchList[2]).findOne(); + if (!searchBtnTag) { + throw new Error('没有找到搜索点击按钮'); + } + } + + Log.log('searchBtnTag', searchBtnTag); + //Common.click(searchBtnTag); + searchBtnTag.click(); + Common.sleep(3000 + 2000 * Math.random()); + }, + + //从列表进入详情 + intoSearchVideo() { + let descTag = Common.id(V.Search.intoSearchVideo[0]).isVisibleToUser(true).findOnce(); + if (descTag) { + Common.click(descTag); + return true; + } + + let container = Common.id(V.Search.intoSearchVideo[1]).isVisibleToUser(true).findOnce(); + if (container) { + Common.click(container); + return true; + } + + let titleTag = Common.id(V.Search.intoSearchVideo[2]).isVisibleToUser(true).findOnce(); + if (titleTag) { + Common.click(titleTag); + return true; + } + throw new Error('找不到视频输入'); + }, + + getList(){ + let tags = Common.id(V.Search.intoSearchVideo[0]).isVisibleToUser(true).find(); + return tags; + } +} + +module.exports = Search; diff --git a/app/xhs/User.js b/app/xhs/User.js index 0cb1463..5f576da 100644 --- a/app/xhs/User.js +++ b/app/xhs/User.js @@ -1,5 +1,5 @@ -import { Common } from "app/xhs/Common.js"; -import { XhsV as V } from "version/XhsV.js"; +let Common = require("app/xhs/Common.js"); +let V = require("version/XhsV.js"); let User = { swipeFans(selectText) { @@ -32,6 +32,7 @@ let User = { } else { let sendMsgTag = Common.id(V.User.sendMsg[0]).findOne(); sendMsgTag.click(); + Common.sleep(2000 + 1000 * Math.random()); } let sendIptTag = Common.id(V.User.msgBtn[0]).findOne(); @@ -103,4 +104,4 @@ let User = { } } -module.exports = { User }; +module.exports = User; diff --git a/app/xhs/Work.js b/app/xhs/Work.js index e75f93b..6c5b693 100644 --- a/app/xhs/Work.js +++ b/app/xhs/Work.js @@ -1,5 +1,5 @@ -import { Common } from "app/xhs/Common.js"; -import { XhsV as V } from "version/XhsV.js" +let Common = require("app/xhs/Common.js"); +let V = require("version/XhsV.js"); let Work = { getZanTag() { @@ -28,6 +28,32 @@ let Work = { return false; }, + getCollectTag() { + return Common.id(V.Work.collect[0]).isVisibleToUser(true).findOne() || Common.id(V.Work.collect[1]).isVisibleToUser(true).findOne(); + }, + + collect() { + if (this.isCollect()) { + Log.log('已经点过赞了'); + return; + } + + let collectTag = this.getCollectTag(); + if (collectTag) { + Common.click(collectTag); + Log.log('点赞成功'); + } + }, + + isCollect() { + let collectTag = this.getCollectTag(); + if (collectTag) { + return collectTag.isSelected(); + } + + return false; + }, + zanUserListSwipe() { let tag = Common.id(V.Work.zanUserList[0]).isVisibleToUser(true).findOne(); if (tag) { @@ -176,7 +202,29 @@ let Work = { tag.click(); return true; + }, + + getNickname() { + let tag = Common.id(V.Work.nickname).isVisibleToUser(true).findOne(); + return tag ? tag.text() : ''; + }, + + getContent() { + let tag = Common.id(V.Work.title).isVisibleToUser(true).findOne(); + return tag ? tag.text() : ''; + }, + + getType() { + if (Common.id(V.Work.nickname).isVisibleToUser(true).findOne()) { + return 0;//笔记 + } + + if (Common.id(V.Work.VideoNickname).isVisibleToUser(true).findOne()) { + return 1;//视频 + } + + return -1; } } -module.exports = { Work }; +module.exports = Work; diff --git a/app/xhs/xhs.js b/app/xhs/xhs.js index 6ebd707..9e00865 100644 --- a/app/xhs/xhs.js +++ b/app/xhs/xhs.js @@ -1,9 +1,9 @@ -import { storage } from "common/storage.js"; -import { XhsV as V } from "version/XhsV.js"; -import { Common } from "app/xhs/Common.js"; -import { Index } from "app/xhs/Index.js"; -import { User } from "app/xhs/User.js"; -import { Work } from "app/xhs/Work.js"; +let storage = require("common/storage.js"); +let V = require("version/XhsV.js"); +let Common = require("app/xhs/Common.js"); +let Index = require("app/xhs/Index.js"); +let User = require("app/xhs/User.js"); +let Work = require("app/xhs/Work.js"); let xhs = { config: { @@ -117,7 +117,8 @@ let xhs = { } if (currentCommentRate < this.config.commentRate) { - let msg = getMsg(0, title)?.msg || ''; + let ttt = getMsg(0, title); + let msg = ttt ? ttt.msg : ''; Log.log('评论内容:', msg); if (msg) { Work.msg(type, msg); @@ -154,4 +155,4 @@ let xhs = { } } -module.exports = { xhs }; +module.exports = xhs; diff --git a/common/db.js b/common/db.js index 434240e..5b29952 100644 --- a/common/db.js +++ b/common/db.js @@ -1,4 +1,4 @@ -export let db = { +let db = { _table: undefined, _limit: limit, _offset: offset, @@ -28,3 +28,5 @@ export let db = { } } + +module.exports = db; diff --git a/common/machine.js b/common/machine.js index 5453b1b..0c3c057 100644 --- a/common/machine.js +++ b/common/machine.js @@ -1,5 +1,5 @@ -import { storage } from 'common/storage.js'; -export let machine = { +let storage = require('common/storage.js'); +let machine = { db() { return Storage; }, @@ -153,14 +153,6 @@ export let machine = { return { privateClose: true }; }, - addDouyinConfig(account) { - let db = this.db(); - let key = 'privateClose_' + account; - db.put(key, { - timestamp: Date.parse(new Date()) / 1000, - }); - }, - getMsg(type) { let speechs = storage.getSpeech(); if (speechs.length === 0) { @@ -185,11 +177,11 @@ export let machine = { }, douyinExist(account) { - let res = this.db().get('douyinExist_' + account, 'bool'); + let res = this.db().getBoolean('douyinExist_' + account); if (res) { return true; } - this.db().put('douyinExist_' + account, true); + this.db().putBool('douyinExist_' + account, true); return false; }, @@ -198,7 +190,7 @@ export let machine = { if (res) { return true; } - this.db().put('videoExist_' + nickname, true); + this.db().putBool('videoExist_' + nickname, true); return false; }, @@ -241,48 +233,6 @@ export let machine = { return { code: 1 }; }, - //let types = { 'zanVideo': 0, 'zanComment': 1, 'comment': 2, 'focus': 3, 'privateMsg': 4, 'viewUserPage': 5, 'refreshVideo': 6 }; - op(index, type) { - let db = this.db(); - let current = Date.parse(new Date()) / 1000; - if (type === 6) { - let res = db.get('config_' + index + '_videoTimestamp_' + this.getDate()) || '[]'; - res = JSON.parse(res); - res.push(current); - db.put('config_' + index + '_videoTimestamp_' + this.getDate(), JSON.stringify(res)); - } else if (type === 0) { - let res = db.get('config_' + index + '_zanVideoTimestamp_' + this.getDate()) || '[]'; - res = JSON.parse(res); - res.push(current); - db.put('config_' + index + '_zanVideoTimestamp_' + this.getDate(), JSON.stringify(res)); - } else if (type === 1) { - let res = db.get('config_' + index + '_zanCommentTimestamp_' + this.getDate()) || '[]'; - res = JSON.parse(res); - res.push(current); - db.put('config_' + index + '_zanCommentTimestamp_' + this.getDate(), JSON.stringify(res)); - } else if (type === 2) { - let res = db.get('config_' + index + '_commentTimestamp_' + this.getDate()) || '[]'; - res = JSON.parse(res); - res.push(current); - db.put('config_' + index + '_commentTimestamp_' + this.getDate(), JSON.stringify(res)); - } else if (type === 3) { - let res = db.get('config_' + index + '_focusTimestamp_' + this.getDate()) || '[]'; - res = JSON.parse(res); - res.push(current); - db.put('config_' + index + '_focusTimestamp_' + this.getDate(), JSON.stringify(res)); - } else if (type === 4) { - let res = db.get('config_' + index + '_privateMsgTimestamp_' + this.getDate()) || '[]'; - res = JSON.parse(res); - res.push(current); - db.put('config_' + index + '_privateMsgTimestamp_' + this.getDate(), JSON.stringify(res)); - } else if (type === 5) { - let res = db.get('config_' + index + '_viewUserPageTimestamp_' + this.getDate()) || '[]'; - res = JSON.parse(res); - res.push(current); - db.put('config_' + index + '_viewUserPageTimestamp_' + this.getDate(), JSON.stringify(res)); - } - }, - getProvinces() { return [ { id: 1, name: '北京市' }, @@ -354,7 +304,7 @@ export let machine = { getFansIncSettingRate() { return { - task_dy_fans_inc_account: this.get("task_dy_fans_inc_account") || "95448698248,58750165149,38881966964,94758877668,92447212883,68126855345,61699752775,71395667132,75142410816,889256509,395884542288,66578272648,169732746,87455571449,47194470908,32644724711,23187788634,62510783289,69223680672,96559110830,79005535521,88799238805,895625215,77363968851,55217137528,54622933772,37437482688,48352073886,76908371782,38640136098,40456270246,98424754311,35818992365,96759008218,65221746903,76624998351,98305400525,24960970462,69244897030,75685568264,85532304608,81363075786,96075763758,2246367608,23067498754,45111336856,42885218405,76689548008,67205394933,88962987158,69719995846,42818130984,46282922894,75298522313,72604960726,69871128004,63592002784,54846140779,32388171981,55723218866,35749719069,36537826537,79463954521,84474997814,50431204320,42061882164,37166306794,68599155804,39263028799,31886238669,23157543024,44012618457,29563170032,28299323774,56416830940,64506637557,78870241551,48526777093,24876415948,89408353473,96539996331,936476675,89957893782,34572776530,92395004509,97344880844,37922724907,45531367850,45744197922,95791428263,91213830582,64584170675,87848495482,70863532958,75402323381,33777722078,21870652822,55476237990,70351088381,65026526521,42698001513,23802956189,39588454228,82301202960,31378632368,52111285916,97147471316,89423632858,88591002525,90059730444,94597858923,85726685665,92118626390,32388028850,90166424348,95083742969,81513762732,84903176304,83632618320,67912093054,158429800,97041911019,44470985369,52384977465,27359079074,37647703624,68483129852,26973719491,26095825044,36514652748,67896511190,87927348300,78768278304,90280584550,33055446816,60868933832,21855860437,56241533261,68668816385,62213741333,2175832856,59060487184,37503636816,89858990850,85321761615,38322383217,30591990979,64680579392,75946503526,66414381472,69376551175,52673069280,42484456260,77079260519,54381291881,62145675388,39065033624,20127226665,79430769320,86211094786,34015597930,68450894086,85946916017,62174862151,33008215614,44836317668,53050413966,59820605725,2194007165,22134321918,37723146157,65108802891,85523640615,43317117423,59139428846,91827246644,38914989360,64746155764,66627939316,80804316279,72907749899,66565888957,87772529698,55454795916,47145585472,24800193566,36913812765,73137166987,48643824711,31909045905,55196300609,68199805575,20283350687,81562472957,46136323673,87136403907,28514222882,73199869765,404562702465,227632044135,54228512456,52936694827,68678273893,231275712045,68469408408,72671115108,86027468523,77298829198,562339186595,44311099572,90936310434,70494211453,929634987315,43141608431,27240998586,84275354579,57275028977,52593974019,32642537469,70335428329,97112022294,27896818599,84436815315,51610018133,91276940375,50468599848,91515681050,73598809368,206019269,35710454738,53157771146,89216074723,27914282999,34854026483,428181309845,22638146246,72391363090,94306065597,95978575346,98029311634,53672229175,55346084685,93679528985,98658571072,81571383599,87650762334,42624561769,26704301808,95551165144,69687938635,91776336482,54471764323,23127571204,68558522036,37828435111,44030025432,68639048072,32362386757,29510188307,81375201152,34727642669,56233918659,52717110047,20858754929,90326988020,28667805730,25670861510,483520738868,937531915628,55755189275,67848133766,39227926439,88781869853,61459254906,64599313314,1124607785,70906367584,40476441875,32744216673,836326183208,590604871848,230165851448,73973310514,28765571071,42331821886,26131405437,53024297183,56124976548", + task_dy_fans_inc_accounts: this.get("task_dy_fans_inc_accounts") || '', task_dy_fans_inc_head_zan_rate: this.get("task_dy_fans_inc_head_zan_rate", "int") || 0, task_dy_fans_inc_video_zan_rate: this.get("task_dy_fans_inc_video_zan_rate", "int") || 0, task_dy_fans_inc_comment_rate: this.get("task_dy_fans_inc_comment_rate", "int") || 0, @@ -395,6 +345,29 @@ export let machine = { //这里返回的字段要一直,只是值不一致 getTokerData(type) { + //type 2 轻松拓客, 默认设置参数 + if (type == 2) { + return { + toker_view_video_second: this.get('task_dy_qingsong_tuoke_interval', 'int'), + toker_view_video_keywords: "", + toker_zan_rate: 70, + toker_comment_rate: 60, + toker_focus_rate: 5, + toker_comment_area_zan_rate: 80, + toker_run_hour: [ + '0', '1', '2', '3', '4', + '5', '6', '7', '8', '9', + '10', '11', '12', '13', '14', + '15', '16', '17', '18', '19', + '20', '21', '22', '23' + ], + toker_run_sex: ["0", "1", "2"],//0,1,2分别表示 女,男,未知 + toker_run_min_age: 0, + toker_run_max_age: 120, + runTimes: this.get('task_dy_qingsong_tuoke_run_times', 'int'), + } + } + if (!type) { return { toker_view_video_second: this.get('toker_view_video_second', 'int'), @@ -405,6 +378,9 @@ export let machine = { toker_private_msg_rate: this.get('toker_private_msg_rate', 'int'), toker_comment_area_zan_rate: this.get('toker_comment_area_zan_rate', 'int'), toker_run_hour: this.getArray('toker_run_hour'), + toker_run_sex: this.getArray('toker_run_sex'),//0,1,2分别表示 女,男,未知 + toker_run_min_age: this.get('toker_run_min_age', 'int'), + toker_run_max_age: this.get('toker_run_max_age', 'int'), } } @@ -417,6 +393,10 @@ export let machine = { toker_private_msg_rate: this.get('toker_city_private_msg_rate', 'int'), toker_comment_area_zan_rate: this.get('toker_city_comment_area_zan_rate', 'int'), toker_run_hour: this.getArray('toker_city_run_hour'), + toker_distance: this.get('toker_city_distance', 'int'), + toker_run_sex: this.getArray('toker_city_run_sex'),//0,1,2分别表示 女,男,未知 + toker_run_min_age: this.get('toker_city_run_min_age', 'int'), + toker_run_max_age: this.get('toker_city_run_max_age', 'int'), } }, @@ -441,7 +421,10 @@ export let machine = { }, //尽量 文件名 + key的模式 - get(key, type = "string") { + get(key, type) { + if (type == undefined) { + type = "string"; + } let db = this.db(); Log.log("key:" + key + ":type:" + type); if (type == "string") { @@ -467,8 +450,24 @@ export let machine = { //尽量 文件名 + key的模式 set(key, value) { let db = this.db(); - db.put(key, value); + if (typeof value == 'string') { + db.put(key, value); + } else if (typeof value == 'boolean') { + db.putBool(key, value); + } else if (typeof value == 'object') { + db.putDouble(key, value); + } else if (typeof value == 'undefined' || typeof value == 'null') { + db.putObj(key, value); + } else if (Number.isInteger(value)) { + db.putInteger(key, value); + } else if (Number.isFloat(value)) { + db.putDouble(key, value); + } else { + db.putObj(key, value); + } + return true; } }; +module.exports = machine; diff --git a/common/statistics.js b/common/statistics.js index ddc57de..7b942aa 100644 --- a/common/statistics.js +++ b/common/statistics.js @@ -1,6 +1,6 @@ -import { storage } from 'common/storage.js'; +let storage = require('common/storage.js'); -export let statistics = { +let statistics = { getDate() { let d = new Date(); let m = d.getMonth() + 1; @@ -10,49 +10,49 @@ export let statistics = { viewVideo() { let time = this.getDate(); - let count = storage.get('s_viewVideo' + time) || 0; + let count = storage.get('s_viewVideo' + time, 'int') || 0; storage.set('s_viewVideo' + time, count + 1); }, viewTargetVideo() { let time = this.getDate(); - let count = storage.get('s_viewTargetVideo' + time) || 0; + let count = storage.get('s_viewTargetVideo' + time, 'int') || 0; storage.set('s_viewTargetVideo' + time, count + 1); }, zan() { let time = this.getDate(); - let count = storage.get('s_zan' + time) || 0; + let count = storage.get('s_zan' + time, 'int') || 0; storage.set('s_zan' + time, count + 1); }, comment() { let time = this.getDate(); - let count = storage.get('s_comment' + time) || 0; + let count = storage.get('s_comment' + time, 'int') || 0; storage.set('s_comment' + time, count + 1); }, zanComment() { let time = this.getDate(); - let count = storage.get('s_zanComment' + time) || 0; + let count = storage.get('s_zanComment' + time, 'int') || 0; storage.set('s_zanComment' + time, count + 1); }, privateMsg() { let time = this.getDate(); - let count = storage.get('s_privateMsg' + time) || 0; + let count = storage.get('s_privateMsg' + time, 'int') || 0; storage.set('s_privateMsg' + time, count + 1); }, focus() { let time = this.getDate(); - let count = storage.get('s_focus' + time) || 0; + let count = storage.get('s_focus' + time, 'int') || 0; storage.set('s_focus' + time, count + 1); }, viewUser() { let time = this.getDate(); - let count = storage.get('s_viewUser' + time) || 0; + let count = storage.get('s_viewUser' + time, 'int') || 0; storage.set('s_viewUser' + time, count + 1); }, @@ -94,14 +94,14 @@ export let statistics = { } return { - s_viewVideo: storage.get('s_viewVideo' + time) || 0, - s_viewTargetVideo: storage.get('s_viewTargetVideo' + time) || 0, - s_zan: storage.get('s_zan' + time) || 0, - s_comment: storage.get('s_comment' + time) || 0, - s_zanComment: storage.get('s_zanComment' + time) || 0, - s_privateMsg: storage.get('s_privateMsg' + time) || 0, - s_focus: storage.get('s_focus' + time) || 0, - s_viewUser: storage.get('s_viewUser' + time) || 0, + s_viewVideo: storage.get('s_viewVideo' + time, 'int') || 0, + s_viewTargetVideo: storage.get('s_viewTargetVideo' + time, 'int') || 0, + s_zan: storage.get('s_zan' + time, 'int') || 0, + s_comment: storage.get('s_comment' + time, 'int') || 0, + s_zanComment: storage.get('s_zanComment' + time, 'int') || 0, + s_privateMsg: storage.get('s_privateMsg' + time, 'int') || 0, + s_focus: storage.get('s_focus' + time, 'int') || 0, + s_viewUser: storage.get('s_viewUser' + time, 'int') || 0, } }, @@ -124,3 +124,6 @@ export let statistics = { return res; } } + + +module.exports = statistics; diff --git a/common/storage.js b/common/storage.js index 5c5e88c..9401792 100644 --- a/common/storage.js +++ b/common/storage.js @@ -1,100 +1,16 @@ -export let storage = { +let storage = { getToken() { return Storage.get("token"); }, - setToken(token) { - return Storage.put("token", token); - }, - - getMobile() { - return Storage.get("mobile"); - }, - - setMobile(mobile) { - return Storage.put("mobile", mobile); - }, - - getMachineId() { - return Storage.get("machine_id"); - }, - - setMachineId(machineId) { - return Storage.put("machine_id", machineId); - }, - - getInit() { - return Storage.get("init"); - }, - - setInit(type) { - return Storage.put("init", type); - }, - - removeToken() { - - Storage.remove('token'); - return true; - }, - - setPackage(name) { - return Storage.put("package", name); - }, - getPackage() { return Storage.get("package"); }, - setTag(name) { - return Storage.put("tag", name); - }, - - getTag() { - return Storage.get("tag"); - }, - - //1无后台,2有后台 - setMachineType(type) { - return Storage.put("machineType", type); - }, - getMachineType() { return 1; }, - setOpenWx(type) { - return Storage.put("openWx", type); - }, - - getOpenWx() { - return Storage.get("openWx"); - }, - - setIsAgent(type) { - return Storage.put("isAgent", type); - }, - - getIsAgent() { - return Storage.get("isAgent"); - }, - - getMakeMoney() { - - return Storage.get("makeMoney"); - }, - - setMakeMoney(type) { - return Storage.put("makeMoney", type); - }, - - setCity(city) { - return Storage.put("city", city); - }, - - getCity() { - return Storage.get("city"); - }, - setExcNicknames(nicknames) { return Storage.put("excNicknames", nicknames); }, @@ -103,46 +19,6 @@ export let storage = { return Storage.get("excNicknames"); }, - setEndTime(time) { - return Storage.put("endTime", time); - }, - - getEndTime() { - return Storage.get("endTime"); - }, - - removeSpeech(index) { - let data = this.getSpeech(); - if (data.length === 0) { - return true; - } - - for (let i in data) { - if (data[i].index === index) { - data.splice(i, 1); - } - } - Storage.put('deekeScript:speech:default', JSON.stringify(data)); - }, - - addSpeech(item) { - let data = this.getSpeech(); - data.push(item); - Storage.put('deekeScript:speech:default', JSON.stringify(data)); - return data; - }, - - addSpeechAll(items) { - let data = this.getSpeech(); - - for (let item of items) { - data.push(item); - } - Storage.put('deekeScript:speech:default', JSON.stringify(data)); - - return data; - }, - getSpeech() { let data = Storage.get('deekeScript:speech:default'); console.log("speech内容"); @@ -152,35 +28,7 @@ export let storage = { } data = JSON.parse(data); - return data?.speechLists; - }, - - clearSpeech() { - let data = []; - Storage.put('deekeScript:speech:default', JSON.stringify(data)); - return data; - }, - - removeTask(index) { - let data = this.getTask(); - if (data.length === 0) { - return true; - } - - for (let i in data) { - if (data[i].index === index) { - data.splice(i, 1); - } - } - - Storage.put('task', JSON.stringify(data)); - }, - - addTask(item) { - let data = this.getTask(); - data.push(item); - Storage.put('task', JSON.stringify(data)); - return data; + return data && data.speechLists; }, getTask() { @@ -193,37 +41,6 @@ export let storage = { return data; }, - updateTask(index, title) { - let data = this.getTask(); - if (data.length === 0) { - return []; - } - - for (let i in data) { - if (data[i].index === index) { - data[i].title = title; - } - } - - Storage.put('task', JSON.stringify(data)); - return data; - }, - - updateTaskState(index, state) { - let data = this.getTask(); - if (data.length === 0) { - return false; - } - - for (let i in data) { - if (data[i].index === index) { - data[i].state = state; - } - } - - Storage.put('task', JSON.stringify(data)); - return true; - }, removeTaskDetail(i) { let data = this.getTaskDetail(); @@ -262,42 +79,15 @@ export let storage = { return data; }, - updateTaskDetail(data, taskTrue) { - let items = this.getTaskDetail(); - let update = false; - if (items && items.length) { - for (let i in items) { - if (items[i].taskIndex === data.taskIndex) { - items[i] = data; - update = true; - break; - } - } - } - - if (!update) { - items.push(data); - } - Storage.put('taskDetail', JSON.stringify(items)); - - Log.log('taskTrue', taskTrue, data.taskIndex); - if (taskTrue) { - this.updateTaskState(data.taskIndex, true); - } - return data; - }, - - setMobileStopType(type) { - Storage.put('mobileStopType', type); - return true; - }, - getMobileStopType() { return Storage.get('mobileStopType'); }, //尽量 文件名 + key的模式 - get(key, type = "string") { + get(key, type) { + if (type == undefined) { + type = "string" + } Log.log("key:" + key + ":type:" + type); if (type == "string") { return Storage.get(key); @@ -314,13 +104,29 @@ export let storage = { return undefined; }, - getArray(key){ + getArray(key) { return Storage.getArray(key); }, //尽量 文件名 + key的模式 set(key, value) { - Storage.put(key, value); + if (typeof value == 'string') { + Storage.put(key, value); + } else if (typeof value == 'boolean') { + Storage.putBool(key, value); + } else if (typeof value == 'object') { + Storage.putDouble(key, value); + } else if (typeof value == 'undefined' || typeof value == 'null') { + Storage.putObj(key, value); + } else if (Number.isInteger(value)) { + Storage.putInteger(key, value); + } else if (Number.isFloat(value)) { + Storage.putDouble(key, value); + } else { + Storage.putObj(key, value); + } return true; }, } + +module.exports = storage; diff --git a/config/config.js b/config/config.js index de85923..e83d1e0 100644 --- a/config/config.js +++ b/config/config.js @@ -1,4 +1,4 @@ -export let config = { +let config = { name: '嘀客', logo: 'dke', domain: 'https://dke.dkeapp.cn/', @@ -6,15 +6,6 @@ export let config = { weixin: ['dke_2019', 'dke2023'], dyVersion: 270301,//要求的抖音版本 dyVersions: "27.3.1",//要求的抖音版本 - getDyVersion() { - let manager = context.getPackageManager(); - let code = 0; - try { - let info = manager.getPackageInfo('com.ss.android.ugc.aweme', 0); - code = info.versionCode; - } catch (e) { - return false; - } - return code; - } }; + +module.exports = config; diff --git a/img/.DS_Store b/img/.DS_Store new file mode 100644 index 0000000..8782c5f Binary files /dev/null and b/img/.DS_Store differ diff --git a/img/ai.png b/img/ai.png new file mode 100644 index 0000000..ec198e7 Binary files /dev/null and b/img/ai.png differ diff --git a/img/auto-2.png b/img/auto-2.png new file mode 100644 index 0000000..3383b8a Binary files /dev/null and b/img/auto-2.png differ diff --git a/img/comment-2.png b/img/comment-2.png new file mode 100644 index 0000000..11c3590 Binary files /dev/null and b/img/comment-2.png differ diff --git a/img/friend.png b/img/friend.png new file mode 100644 index 0000000..3e69e08 Binary files /dev/null and b/img/friend.png differ diff --git a/img/invite.png b/img/invite.png new file mode 100644 index 0000000..cea7e0a Binary files /dev/null and b/img/invite.png differ diff --git a/img/jubao.png b/img/jubao.png new file mode 100644 index 0000000..011746c Binary files /dev/null and b/img/jubao.png differ diff --git a/img/manual.png b/img/manual.png new file mode 100644 index 0000000..d588628 Binary files /dev/null and b/img/manual.png differ diff --git a/img/openai-icon.png b/img/openai-icon.png new file mode 100644 index 0000000..2d774a6 Binary files /dev/null and b/img/openai-icon.png differ diff --git a/img/private-2.png b/img/private-2.png new file mode 100644 index 0000000..aa6db17 Binary files /dev/null and b/img/private-2.png differ diff --git a/img/qingsong.png b/img/qingsong.png new file mode 100644 index 0000000..0c717ce Binary files /dev/null and b/img/qingsong.png differ diff --git a/img/statistics.png b/img/statistics.png new file mode 100644 index 0000000..38121db Binary files /dev/null and b/img/statistics.png differ diff --git a/img/team-buy.png b/img/team-buy.png new file mode 100644 index 0000000..c8ef69f Binary files /dev/null and b/img/team-buy.png differ diff --git a/img/xhs-fans.png b/img/xhs-fans.png new file mode 100644 index 0000000..238ace3 Binary files /dev/null and b/img/xhs-fans.png differ diff --git a/img/xhs-wanneng.png b/img/xhs-wanneng.png new file mode 100644 index 0000000..9198043 Binary files /dev/null and b/img/xhs-wanneng.png differ diff --git a/img/xhs-zan.png b/img/xhs-zan.png new file mode 100644 index 0000000..98f7a3a Binary files /dev/null and b/img/xhs-zan.png differ diff --git a/img/zan.png b/img/zan.png new file mode 100644 index 0000000..ad6dfc7 Binary files /dev/null and b/img/zan.png differ diff --git a/photo/2-1.jpg b/photo/2-1.jpg index dfd9d02..ce67ad3 100644 Binary files a/photo/2-1.jpg and b/photo/2-1.jpg differ diff --git a/photo/2-2-1.jpg b/photo/2-2-1.jpg new file mode 100644 index 0000000..162421d Binary files /dev/null and b/photo/2-2-1.jpg differ diff --git a/photo/2-2.jpg b/photo/2-2.jpg index d31f132..9b4f161 100644 Binary files a/photo/2-2.jpg and b/photo/2-2.jpg differ diff --git a/photo/2-3-1.jpg b/photo/2-3-1.jpg new file mode 100644 index 0000000..ab7454b Binary files /dev/null and b/photo/2-3-1.jpg differ diff --git a/photo/2-3-2.jpg b/photo/2-3-2.jpg new file mode 100644 index 0000000..a9143d0 Binary files /dev/null and b/photo/2-3-2.jpg differ diff --git a/photo/2-3.jpg b/photo/2-3.jpg index 486c81a..a5d6194 100644 Binary files a/photo/2-3.jpg and b/photo/2-3.jpg differ diff --git a/photo/4.jpg b/photo/4.jpg index 1990eea..1e33074 100644 Binary files a/photo/4.jpg and b/photo/4.jpg differ diff --git a/photo/5.jpg b/photo/5.jpg index cdcc819..294b042 100644 Binary files a/photo/5.jpg and b/photo/5.jpg differ diff --git a/photo/6.jpg b/photo/6.jpg index 79495d4..3dd60b8 100644 Binary files a/photo/6.jpg and b/photo/6.jpg differ diff --git a/photo/7.jpg b/photo/7.jpg index 25c786d..dacf605 100644 Binary files a/photo/7.jpg and b/photo/7.jpg differ diff --git a/readme.md b/readme.md index 9aff1b5..34f9265 100644 --- a/readme.md +++ b/readme.md @@ -27,7 +27,11 @@ Deeke支持后台一键贴牌,你不需要懂技术,只需要提供logo,
Deeke图标展示 Deeke主界面 +Deeke主界面 + Deeke主界面 +Deeke主界面 +Deeke主界面 Deeke主界面隐藏菜单 Deeke话术界面 diff --git a/service/baiduImageRead.js b/service/baiduImageRead.js index 586c323..2417882 100644 --- a/service/baiduImageRead.js +++ b/service/baiduImageRead.js @@ -1,4 +1,4 @@ -export let baiduImageRead = { +let baiduImageRead = { apiKey: '', secretKey: '', url: 'https://aip.baidubce.com/rest/2.0/ocr/v1/numbers', @@ -38,3 +38,5 @@ export let baiduImageRead = { return re['access_token']; } } + +module.exports = baiduImageRead; diff --git a/service/baiduImageSimilar.js b/service/baiduImageSimilar.js index faa79e3..1f846bc 100644 --- a/service/baiduImageSimilar.js +++ b/service/baiduImageSimilar.js @@ -1,4 +1,4 @@ -export let baiduImageSimilar = { +let baiduImageSimilar = { apiKey: '', secretKey: '', addImageUrl: 'https://aip.baidubce.com/rest/2.0/image-classify/v1/realtime_search/similar/add', @@ -53,9 +53,11 @@ export let baiduImageSimilar = { }, getAccessToken: function () { - let res = http.get(this.getAccessTokenUrl + '?grant_type=client_credentials&client_id=' + this.apiKey + '&client_secret=' + this.secretKey); + let res = http.httpGet(this.getAccessTokenUrl + '?grant_type=client_credentials&client_id=' + this.apiKey + '&client_secret=' + this.secretKey); let re = res.body.json(); // Log.log(re); return re['access_token']; } } + +module.exports = baiduImageSimilar; diff --git a/service/baiduWenxin.js b/service/baiduWenxin.js index a2ec68c..c11483a 100644 --- a/service/baiduWenxin.js +++ b/service/baiduWenxin.js @@ -1,61 +1,113 @@ -import { storage } from 'common/storage.js'; +let storage = require('common/storage.js'); -export let baiduWenxin = { +let baiduWenxin = { + key: 'setting_baidu_wenxin_role', + dataFrom: 'role', getToken(key, secret) { key = key || storage.get('setting_baidu_wenxin_key'); secret = secret || storage.get('setting_baidu_wenxin_secret'); - let url = 'https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=' + key + '&client_secret=' + secret; - let res = Http.get(url); - if(res==null){ + + //查看是否激活了 + let body = System.AiSpeechToken(key, secret); + Log.log('body', body); + let aiRes = JSON.parse(body); + Log.log('aiRes[\'data\']', aiRes['data']); + if (aiRes['code'] === 0) { + //开始激活 + return aiRes['data']; + } else if (aiRes['code'] === 1) { + FloatDialogs.show('提示', aiRes.msg); + System.sleep(360000 * 1000); + return; + } else { + Log.log('网络异常了'); return false; } - console.log("获取token内容:"); - console.log(res); - let result = JSON.parse(res); - return result; }, - getComment(title) { - if (title.length > 50) { - title = title.substring(0, 50) + '..'; - } + testChat(title) { + let res = this.getToken(); + let access_token = res['access_token']; - let res = storage.get('baidu_access_token'); - if (res) { - res = JSON.parse(res); + let params = { + "messages": [ + { + "role": "user", + "content": title + } + ], + "max_output_tokens": 60,//最大输出长度60 + "system": System.getDataFrom(this.key, this.dataFrom, 'content'), + //"system_memory_id": access_token, + //"enable_system_memory": true, } - let access_token; - if (res && res['expire_in'] < Date.parse(new Date()) / 1000) { - access_token = res['access_token']; - } else { - res = this.getToken(); - res['expires_in'] = Date.parse(new Date()) / 1000 + res['expires_in'] - 60; - access_token = res['access_token']; - storage.set('baidu_access_token', JSON.stringify(res)); + Log.log(params); + res = Http.post('https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions?access_token=' + access_token, params); + if (res == null) { + return false; } + let result = JSON.parse(res); + Log.log(title, result['result']); + if (result && result['result']) { + if (result['result'].substring(0, 1) === '"' && result['result'].substring(result['result'].length - 1) === '"') { + result['result'] = result['result'].substring(1, result['result'].length - 1); + } + } + return result['result'] || false; + }, + + getComment(title) { + let res = this.getToken(); + let access_token = res['access_token']; - let len = 15 + Math.round(15 * Math.random()); + let len = 20 + Math.round(30 * Math.random()); let tmp = ''; - if(title){ - tmp = '请根据短视频标题生成一段小于30字的吸引人的评论,请直接给出一条评论内容!不要输出与评论无关的内容!短视频的标题是“' + title + '”'; + if (title) { + tmp = '请你根据短视频标题生成一个有趣的评论内容,标题是:' + title; } + let params = { "messages": [ { "role": "user", - "content": title ? tmp : '请你写一条长度小于' + len + '字的吸引人的视频评论,请直接给出一条评论内容!不要输出与评论无关的内容!' + "content": "接下来,请你随机帮我生成一条评论,可以是夸别人的视频拍的好、也开始是写一条祝福语、也可以你最想告诉大众的想法" } - ] + ], + "max_output_tokens": 60,//最大输出长度60 + "system": System.getDataFrom(this.key, this.dataFrom, 'content'), } - res = Http.post('https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/eb-instant?access_token=' + access_token, params); - if(res==null){ + if (title) { + params = { + "messages": [ + { + "role": "user", + "content": "接下来,我会给你一条视频标题,请你帮我生成一条评论,评论内容一定要精简,尽可能能让人看了想和我互动,并且尽可能不要激怒别人;内容字数不要超过" + len + "字,这个很重要" + }, + { + "role": "assistant", + "content": '好的,我会尽我所能,请给我一条视频标题吧!' + }, + { + "role": "user", + "content": title + }, + ], + "max_output_tokens": 60,//最大输出长度60 + "system": System.getDataFrom(this.key, this.dataFrom, 'content'), + } + } + + //console.log(System.getDataFrom(this.key, this.dataFrom, 'content')); + + res = Http.post('https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions?access_token=' + access_token, params); + if (res == null) { return false; } let result = JSON.parse(res); - Log.log('百度文心返回话术-1', title ? '别人抖音视频的标题是“' + title + '”,请你给这个视频写一条长度小于' + len + '字的吸引人的评论内容' : '请你写一条长度小于' + len + '字的吸引人的评论视频内容去评论别人的视频', result); + Log.log('百度文心返回话术-1', title ? '视频的标题是“' + title + '”,请结合你的角色,写一条少于' + len + '字的吸引人的评论内容' : '请你写一条字数小于' + len + '字的吸引人的评论视频内容', result); if (result && result['result']) { if (result['result'].substring(0, 1) === '"' && result['result'].substring(result['result'].length - 1) === '"') { result['result'] = result['result'].substring(1, result['result'].length - 1); @@ -65,22 +117,10 @@ export let baiduWenxin = { }, getChat(nickname, age, gender) { - let res = storage.get('baidu_access_token'); - if (res) { - res = JSON.parse(res); - } + let res = this.getToken(); + let access_token = res['access_token']; - let access_token; - if (res && res['expire_in'] < Date.parse(new Date()) / 1000) { - access_token = res['access_token']; - } else { - res = this.getToken(); - res['expires_in'] = Date.parse(new Date()) / 1000 + res['expires_in'] - 60; - access_token = res['access_token']; - storage.set('baidu_access_token', JSON.stringify(res)); - } - - let len = 15 + Math.round(10 * Math.random()); + let len = 20 + Math.round(20 * Math.random()); let content = '对方的昵称是:' + nickname; if (age) { content += ',年龄是:' + age + '岁'; @@ -94,16 +134,28 @@ export let baiduWenxin = { "messages": [ { "role": "user", - "content": content + ',请帮我生成一条长度小于' + len + '字的吸引人的打招呼话术' - } - ] + "content": "请你根据对方的账号昵称、年龄、性别等信息,随机帮我生成一条打招呼内容,注意:年龄和性别不一定有,但是昵称是一定有的;你可以是夸别人的视频拍的好、也开始是写一条祝福语、又可以是常用的打招呼,尽量能吸引到别人回复;内容字数限制在" + len + "字", + }, + { + "role": "assistant", + "content": '好的,我会尽我所能,请给出对方的昵称、年龄、性别吧!' + }, + { + "role": "user", + "content": content + }, + ], + "max_output_tokens": 60,//最大输出长度60 + "system": System.getDataFrom(this.key, this.dataFrom, 'content'), } - res = Http.post('https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/eb-instant?access_token=' + access_token, params); - if(res==null){ + + res = Http.post('https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions?access_token=' + access_token, params); + //res = Http.post('https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/eb-instant?access_token=' + access_token, params); + if (res == null) { return false; } let result = JSON.parse(res); - Log.log('百度文心返回话术', content + ',请帮我生成一条长度小于' + len + '字的吸引人的打招呼话术和他打招呼', result); + Log.log('百度文心返回话术', content + '请结合你的角色,写一条字数小于' + len + '字的吸引人的打招呼话术', result); if (result && result['result']) { if (result['result'].substring(0, 1) === '"' && result['result'].substring(result['result'].length - 1) === '"') { result['result'] = result['result'].substring(1, result['result'].length - 1); @@ -112,3 +164,5 @@ export let baiduWenxin = { return result['result'] || false; } } + +module.exports = baiduWenxin; diff --git a/statistics/statistics.js b/statistics/statistics.js new file mode 100644 index 0000000..2688673 --- /dev/null +++ b/statistics/statistics.js @@ -0,0 +1,65 @@ +let statistics = require('common/statistics.js'); + +var deekeStatistics = { + dataList() { + let data = statistics.getData(); + console.log(data); + let weekData = statistics.getWeekData(); + console.log(weekData); + + //weight最大24 + return [ + { + 'title': '今日累计视频', + 'weight': 12, + 'checked': true, + 'value': data['s_viewVideo'], + 'data': weekData['s_viewVideo'], + }, + { + 'title': '今日目标视频', + 'weight': 12, + 'value': data['s_viewTargetVideo'], + 'data': weekData['s_viewTargetVideo'], + }, + { + 'title': '今日点赞', + 'weight': 8, + 'value': data['s_zan'], + 'data': weekData['s_viewTargetVideo'], + }, + { + 'title': '今日评论', + 'count': 1, + 'weight': 8, + 'value': data['s_comment'], + 'data': weekData['s_viewTargetVideo'], + }, + { + 'title': '今日赞评论', + 'weight': 8, + 'value': data['s_zanComment'], + 'data': weekData['s_zanComment'], + }, + { + 'title': '今日私信', + 'weight': 8, + 'value': data['s_privateMsg'], + 'data': weekData['s_viewTargetVideo'], + }, + { + 'title': '今日关注', + 'count': 1, + 'weight': 8, + 'value': data['s_focus'], + 'data': weekData['s_focus'], + }, + { + 'title': '今日访问', + 'weight': 8, + 'value': data['s_viewUser'], + 'data': weekData['s_viewUser'], + }, + ]; + } +} diff --git a/task.html b/task.html new file mode 100644 index 0000000..522f0c4 --- /dev/null +++ b/task.html @@ -0,0 +1,149 @@ +

软件功能说明文档

+

本软件旨在减少人工操作成本,提升企业运营效率;围绕第三方软件的“点赞”、“评论”、“私信”、“关注”、“赞评论”、“赞头像”、“收藏”、“无限卡片”等功能进行设计, + 绝大多数功能进入设置界面就能很好地了解对应工作的目的和操作

+ +

下面主要就软件的功能特点和操作进行简单的参数

+ +

注意事项

+

由于软件主要模拟人工操作,在绝大多数场景下,相关设置应该满足人类操作规律和速度!长时间运行,就不用高频率“点赞”、“评论”等操作;短时间运行,可以适当提升操作频率; + 无论是“评论”还是“私信”,尽量不要发送硬广(硬广就是直截了当地告诉别人,我有XXX产品和服务,快来找我买!!!或者直接了当地询问别人要不要XXX产品和服务); + 操作频率可以由小到大,比如刚刚开始从点赞率10%到后面调整到35%甚至更高;新号不要一上来就操作“点赞”、“评论”等,注意养号,前期用软件多刷视频,但是不要操作! +

+ +

一、软件启动

+
    +
  1. 点击功能图标,进入设置页
  2. +
  3. 如果没有开启无障碍和悬浮窗,按照提示打开即可
  4. +
  5. 将相关设置参数填写正确
  6. +
  7. 点击设置页的“保存并运行”
  8. +
+ +

* 注意,如果功能需要输入UID或者USER_ID,部分机型需要打开“后台弹窗”权限;点击软件主页的左上角“三条杠”图标,开启即可

+ +

二、软件关闭

+
    +
  1. 点击右侧悬浮窗,等待1-3秒
  2. +
  3. 再次点击悬浮窗,系统弹出“任务关闭”表示关闭成功
  4. +
+

* 注意,任务未关闭之前,不要人工介入手机操作,否则可能会产生不良后果

+ +

三、异常情况

+

虽然我们的软件已经历经了多年沉淀、功能优化和底层重构,并且我们让软件能在95%以上的主流Android手机上正常运行,但是仍有一些操作问题导致的系统异常、或者部分机型无障碍存在bug,导致软件异常

+

如果你发现了异常,请第一时间给我们反馈,我们将会在24小时内修复

+
    +
  1. 功能未正常运行就提示完成:可能是无障碍异常了,需要重启软件或者重启手机,重新运行功能即可
  2. +
  3. 功能无法正常运行:到软件的“设置”,点击“上传日志”,技术人员会尽快处理
  4. +
+ +

功能说明

+ +

关于操作频率

+

操作频率是软件操作的很重要的一个概念,比如点赞频率为50%,则大概每100个视频会操作50次点赞;当然,因为概率具备随机性,操作的次数越多概率越接近;次数少的时候可能不准确!

+ +

DY功能说明

+
1.推荐营销
+ + +
2.同城营销
+

类似“推荐营销”,区别是在“同城”区域运行;适合同城相关业务

+ +
3.工具箱
+ +
  • 功能说明:包含“功能说明”、“一键取赞”、“一键取关”
  • +
    + +
    4.粉丝截流/关注截流
    + +
  • 功能说明:通过“粉丝数”、“作品数”等条件,筛选某个账号下面的粉丝,针对某个类目的用户的“粉丝列表”/“关注列表”进行操作
  • +
  • 操作说明:需要确保账号的“粉丝列表”或者“关注列表”未设置隐私
  • +
    + +
    5.评论区截流
    + +
  • 功能说明:通过“评论关键词”等条件,筛选某个账号下面的用户,对“前3个视频的评论用户的视频”进行“点赞”、“评论”等操作
  • +
  • 操作说明:需要确保账号存在,并且账号下存在视频
  • +
    + +
    6.直播间截流
    + +
  • 功能说明:进入某个用户的直播间的列表,然后进入列表用户的视频下“点赞”、“评论”、“关注”、“私信”等
  • +
  • 操作说明:需要确保当前账号正在直播,并且“直播间列表”未设置隐私
  • +
    + +
    7.粉丝群截流
    + +
  • 功能说明:进入某个粉丝群用户列表,对用户的视频下“点赞”、“评论”等
  • +
  • 操作说明:确保已经加入了粉丝群
  • +
    + +
    8.智能询盘
    + +
  • 功能说明:通过“关键词”搜索视频,然后根据“关键词”匹配视频下面的评论,对匹配的用户的视频进行“点赞”、“评论”等操作
  • +
  • 操作说明:关键词尽量多变着法子更换,比如搜索的时候加入地区、产品特点等特性,如:武汉互联网工作室
  • +
    + +
    9.垂直养号
    + +
  • 功能说明:通过“关键词”搜索视频,然后根据“关键词”匹配视频,对匹配的视频进行“点赞”、“评论”,以及对用户进行“关注”等操作
  • +
  • 操作说明:新账号前3天可以使用此功能;注意评率要设置5%-10%,每次运行100个视频即可;
  • +
    + +
    9.快速涨粉
    + +
  • 功能说明:需要输入多个涨粉迅速的账号,对这些账号的粉丝列表进行“点赞”、“赞评论”、“评论”、“头像赞”、“收藏”等操作
  • +
  • 操作说明:需要关注一些涨粉快的账号,这样效果会更好
  • +
    + +
    10.喜欢截流
    + +
  • 功能说明:随机对某个账号下面的“喜欢列表”进行“点赞”、“评论”等操作
  • +
  • 操作说明:需要找一些涨粉快的账号,这样效果会更好
  • +
    + +
    11.轻松拓客/赞回访/好友转化
    + +
  • 功能说明:主要用于快速涨粉、设置参数后,需要手动进入指定界面后,才能运行程序;会执行“点赞”、“评论”等操作
  • +
  • 操作说明:“轻松拓客”和“好友转化”主要是操作用户的“粉丝列表”、“赞回访”主要是对自己账号的作品的点赞的用户进行操作
  • +
    + +
    12.UID私信/UID邀约
    + +
  • 功能说明:主要用于对大量用户进行快速“私信”和“发送蓝V卡片”
  • +
  • 操作说明:需要借助第三方工具获取到UID
  • +
    + +
    13.精准行业
    + +
  • 功能说明:通过关键词,搜索某类用户,并且通过“粉丝数”等条件对用户进行筛选;对符合条件的用户进行“点赞”、“评论”、“关注”、“私信”等操作
  • +
  • 操作说明:使用你的潜在客户可能观看的视频关键词即可
  • +
    + +
    14.粉丝回访
    + +
  • 功能说明:对当前账号的粉丝列表用户进行“回访”操作
  • +
  • 操作说明:一键启动即可
  • +
    + +
    15.团购营销
    + +
  • 功能说明:对指定团购门店的评论区列表的用户的视频进行“点赞”、“评论”等操作
  • +
  • 操作说明:需要手动找到团购门店,然后复制团购名称;然后输入名称
  • +
    + +
    16.直播间弹幕
    + +
  • 功能说明:对某个直播间进行循环的“评论”和“疯狂点赞”操作
  • +
  • 操作说明:确保账号在直播,一键启动即可
  • +
    + +
    17.评论区截流II
    + +
  • 功能说明:对某些视频的评论区的用户进行“点赞”、“评论”、“关注”、“回复作品首评”等操作
  • +
  • 操作说明:手动进入视频搜索页,可以按照时间筛选出内容,然后点击“悬浮窗”运行
  • +
    + +

    小红薯功能说明

    +

    功能完全参考DY功能即可

    diff --git a/tasks/task_dy_cancel_fans.js b/tasks/task_dy_cancel_fans.js index c54fd4a..a339d38 100644 --- a/tasks/task_dy_cancel_fans.js +++ b/tasks/task_dy_cancel_fans.js @@ -1,9 +1,10 @@ -import {Common as tCommon} from "app/dy/Common"; -import { Index as DyIndex } from 'app/dy/Index.js'; -// import { Search as DySearch } from 'app/dy/Search.js'; +let tCommon = require("app/dy/Common"); +let DyIndex = require('app/dy/Index.js'); +// let DySearch = require('app/dy/Search.js'); const DyUser = require('app/dy/User.js'); -import { Video as DyVideo } from 'app/dy/Video.js'; -// import { Comment as DyComment } from 'app/dy/Comment.js'; +let DyVideo = require('app/dy/Video.js'); +let machine = require('common/machine.js'); +// let DyComment = require('app/dy/Comment.js'); // let dy = require('app/iDy'); // let config = require('config/config'); @@ -23,7 +24,7 @@ let task = { testTask() { //首先进入点赞页面 DyIndex.intoMyPage(); - DyUser.cancelFocusList(); + DyUser.cancelFocusList(machine); }, } diff --git a/tasks/task_dy_cancel_focus.js b/tasks/task_dy_cancel_focus.js index 29318b2..e9e8f16 100644 --- a/tasks/task_dy_cancel_focus.js +++ b/tasks/task_dy_cancel_focus.js @@ -1,6 +1,7 @@ -import { Common as tCommon } from "app/dy/Common"; -import { Index as DyIndex } from 'app/dy/Index.js'; -import { User as DyUser } from 'app/dy/User.js'; +let tCommon = require("app/dy/Common"); +let DyIndex = require('app/dy/Index.js'); +let DyUser = require('app/dy/User.js'); +let machine = require('common/machine.js'); let task = { run() { @@ -17,18 +18,17 @@ let task = { testTask() { //首先进入点赞页面 DyIndex.intoMyPage(); - return DyUser.cancelFocusList(); + return DyUser.cancelFocusList(machine); }, } - tCommon.openApp(); +//开启线程 自动关闭弹窗 +Engines.executeScript("unit/dialogClose.js"); while (true) { task.log(); try { - //开启线程 自动关闭弹窗 - Engines.executeScript("unit/dialogClose.js"); if (task.run()) { tCommon.sleep(1000); FloatDialogs.show('提示', '取消关注已完成'); @@ -36,7 +36,8 @@ while (true) { } tCommon.sleep(3000); } catch (e) { - Log.log(e.stack); + Log.log(e); + tCommon.closeAlert(1); tCommon.backHome(); } } \ No newline at end of file diff --git a/tasks/task_dy_cancel_zan.js b/tasks/task_dy_cancel_zan.js index 907fa31..525ea95 100644 --- a/tasks/task_dy_cancel_zan.js +++ b/tasks/task_dy_cancel_zan.js @@ -1,9 +1,9 @@ -import {Common as tCommon} from "app/dy/Common"; -import { Index as DyIndex } from 'app/dy/Index.js'; -// import { Search as DySearch } from 'app/dy/Search.js'; +let tCommon = require("app/dy/Common"); +let DyIndex = require('app/dy/Index.js'); +// let DySearch = require('app/dy/Search.js'); // const DyUser = require('app/dy/User.js'); -import { Video as DyVideo } from 'app/dy/Video.js'; -// import { Comment as DyComment } from 'app/dy/Comment.js'; +let DyVideo = require('app/dy/Video.js'); +// let DyComment = require('app/dy/Comment.js'); // let dy = require('app/iDy'); // let config = require('config/config'); @@ -72,61 +72,28 @@ let task = { if (isZan) { DyVideo.clickZan(); } - tCommon.sleep(500); + tCommon.sleep(1500); DyVideo.next(); } }, } -let i = false; -Dialogs.confirm('提示', '确定开始执行嘛?', (_true) => { - i = _true; -}); - -if (!i) { - tCommon.showToast('你取消了执行'); - //console.hide();(); - System.exit(); -} - tCommon.openApp(); +Engines.executeScript("unit/dialogClose.js"); -let thr = undefined; while (true) { task.log(); try { //开启线程 自动关闭弹窗 - thr = tCommon.closeAlert(); if (task.run()) { - if (thr) { - thr.interrupt(); - Threads.shutDownAll(); - tCommon.sleep(1000); - } + tCommon.sleep(1000); FloatDialogs.show('提示', '一键取赞完成'); break; } tCommon.sleep(3000); } catch (e) { Log.log(e); - try { - if (thr) { - thr.interrupt(); - Threads.shutDownAll(); - } - tCommon.showToast("遇到错误,即将自动重启"); - tCommon.closeApp(); - tCommon.sleep(3000); - tCommon.showToast('开启抖音'); - tCommon.openApp(); - } catch (e) { - Log.log('启停bug', e); - } + tCommon.closeAlert(1); + tCommon.backHome(); } } - -try { - Engines.closeAll(true); -} catch (e) { - Log.log('停止脚本'); -} diff --git a/tasks/task_dy_comment_back.js b/tasks/task_dy_comment_back.js index 4ac8b4f..a52d9b8 100644 --- a/tasks/task_dy_comment_back.js +++ b/tasks/task_dy_comment_back.js @@ -1,10 +1,10 @@ -import {Common as tCommon} from "app/dy/Common"; -import { Index as DyIndex } from 'app/dy/Index.js'; -// import { Search as DySearch } from 'app/dy/Search.js'; +let tCommon = require("app/dy/Common"); +let DyIndex = require('app/dy/Index.js'); +// let DySearch = require('app/dy/Search.js'); const DyUser = require('app/dy/User.js'); -import { Video as DyVideo } from 'app/dy/Video.js'; +let DyVideo = require('app/dy/Video.js'); const DyMessage = require('app/dy/Message.js'); -// import { Comment as DyComment } from 'app/dy/Comment.js'; +// let DyComment = require('app/dy/Comment.js'); // let dy = require('app/iDy'); // let config = require('config/config'); diff --git a/tasks/task_dy_consum_user.js b/tasks/task_dy_consum_user.js index bd0a0a9..1f4bcc1 100644 --- a/tasks/task_dy_consum_user.js +++ b/tasks/task_dy_consum_user.js @@ -1,12 +1,14 @@ -import { Common as tCommon } from 'app/dy/Common.js'; -import { Index as DyIndex } from 'app/dy/Index.js'; -import { Search as DySearch } from 'app/dy/Search.js'; -import { User as DyUser } from 'app/dy/User.js'; -import { Video as DyVideo } from 'app/dy/Video.js'; -import { storage } from 'common/storage.js'; -import { machine } from 'common/machine.js'; -import { Comment as DyComment } from 'app/dy/Comment.js'; -import { baiduWenxin } from 'service/baiduWenxin.js'; +let tCommon = require('app/dy/Common.js'); +let DyIndex = require('app/dy/Index.js'); +let DySearch = require('app/dy/Search.js'); +let DyUser = require('app/dy/User.js'); +let DyVideo = require('app/dy/Video.js'); +let storage = require('common/storage.js'); +let machine = require('common/machine.js'); +let DyComment = require('app/dy/Comment.js'); +let baiduWenxin = require('service/baiduWenxin.js'); +let statistics = require('common/statistics'); +let V = require("version/V.js"); // let dy = require('app/iDy'); // let config = require('config/config'); @@ -34,7 +36,7 @@ let task = { //type 0 评论,1私信 getMsg(type, title, age, gender) { - if (storage.get('setting_baidu_wenxin_switch', 'bool')) { + if (storage.get('setting_baidu_wenxin_switch', 'bool')) { return { msg: type === 1 ? baiduWenxin.getChat(title, age, gender) : baiduWenxin.getComment(title) }; } return machine.getMsg(type) || false;//永远不会结束 @@ -72,7 +74,7 @@ let task = { DySearch.homeIntoSearchUser(account); tCommon.sleep(2000 + 2000 * Math.random()); //进入喜欢视频列表 - let likeTag = tCommon.aId('text1').textContains('喜欢').filter((v) => { + let likeTag = tCommon.aId(V.C.text1a).textContains(V.Index.intoMyLikeVideo[1]).filter((v) => { return v && v.bounds() && v.bounds().top > 0 && v.bounds().left > 0 && v.bounds().height() > 0 && v.bounds().width() > 0; }).findOnce(); @@ -86,7 +88,7 @@ let task = { tCommon.click(likeTag); tCommon.sleep(3000 + Math.random() * 3000); - let contain = tCommon.id('m_a').filter((v) => { + let contain = tCommon.id(V.Index.intoMyLikeVideo[2]).filter((v) => { return v && v.bounds() && v.bounds().top > 0 && v.bounds().left >= 0 && v.bounds().height() > 0 && v.bounds().width() > 0; }).findOnce(); @@ -158,6 +160,8 @@ let task = { tCommon.sleep(1000 * (Math.random() * 10 + 5)); System.toast('开始操作视频'); DyVideo.clickZan(); + statistics.viewVideo(); + statistics.viewTargetVideo(); videoCount--; if (videoCount <= 0) { return true; @@ -177,7 +181,7 @@ let task = { } catch (e) { Log.log(e) } - tCommon.back();///返回到视频 + //tCommon.back();///返回到视频 这个页面的视频评论之后,自动关闭了,不用返回 tCommon.sleep(1500); } @@ -186,6 +190,7 @@ let task = { DyVideo.intoUserPage(); tCommon.sleep(1000 * (Math.random() * 2)); tCommon.back();//防止头像找不到异常 + Log.log("用户页面返回"); } catch (e) { Log.log('进入用户主页出错'); } @@ -203,7 +208,7 @@ let task = { tCommon.sleep(1000); } } catch (e) { - print(e, errorCount); + //print(e, errorCount); errorCount++; if (errorCount > 3) { return true; @@ -232,12 +237,12 @@ if (isNaN(videoCount) || videoCount <= 0) { } tCommon.openApp(); +//开启线程 自动关闭弹窗 +Engines.executeScript("unit/dialogClose.js"); while (true) { task.log(); try { - //开启线程 自动关闭弹窗 - Engines.executeScript("unit/dialogClose.js"); let res = task.run(account); if (res) { tCommon.sleep(3000); @@ -256,7 +261,8 @@ while (true) { tCommon.sleep(3000); } catch (e) { - Log.log(e.stack); + Log.log(e); + tCommon.closeAlert(1); tCommon.backHome(); } } diff --git a/tasks/task_dy_fans_back_view.js b/tasks/task_dy_fans_back_view.js index 9467e53..1a82d73 100644 --- a/tasks/task_dy_fans_back_view.js +++ b/tasks/task_dy_fans_back_view.js @@ -1,9 +1,9 @@ -import { Common as tCommon } from "app/dy/Common"; -import { Index as DyIndex } from 'app/dy/Index.js'; -// import { Search as DySearch } from 'app/dy/Search.js'; -import { User as DyUser } from 'app/dy/User.js'; -//import { Video as DyVideo } from 'app/dy/Video.js'; -// import { Comment as DyComment } from 'app/dy/Comment.js'; +let tCommon = require("app/dy/Common"); +let DyIndex = require('app/dy/Index.js'); +// let DySearch = require('app/dy/Search.js'); +let DyUser = require('app/dy/User.js'); +//let DyVideo = require('app/dy/Video.js'); +// let DyComment = require('app/dy/Comment.js'); // let dy = require('app/iDy'); // let config = require('config/config'); @@ -41,7 +41,7 @@ while (true) { } tCommon.sleep(3000); } catch (e) { - Log.log(e.stack); + Log.log(e); tCommon.backHome(); } } diff --git a/tasks/task_dy_fans_group.js b/tasks/task_dy_fans_group.js index adae00b..4fa10cd 100644 --- a/tasks/task_dy_fans_group.js +++ b/tasks/task_dy_fans_group.js @@ -1,12 +1,12 @@ -import { Common as tCommon } from "app/dy/Common"; -import { Index as DyIndex } from 'app/dy/Index.js'; -//import { Search as DySearch } from 'app/dy/Search.js'; +let tCommon = require("app/dy/Common"); +let DyIndex = require('app/dy/Index.js'); +//let DySearch = require('app/dy/Search.js'); // const DyUser = require('app/dy/User.js'); -//import { Video as DyVideo } from 'app/dy/Video.js'; -import { storage } from "common/storage"; -import { machine } from "common/machine"; -import { Message as DyMessage } from 'app/dy/Message.js'; - +//let DyVideo = require('app/dy/Video.js'); +let storage = require("common/storage"); +let machine = require("common/machine"); +let DyMessage = require('app/dy/Message.js'); +let baiduWenxin = require('service/baiduWenxin.js'); // let dy = require('app/iDy'); // let config = require('config/config'); @@ -27,7 +27,7 @@ let task = { //type 0 评论,1私信 getMsg(type, lib_id, title, age, gender) { if (storage.getMachineType() === 1) { - if (storage.get('setting_baidu_wenxin_switch', 'bool')) { + if (storage.get('setting_baidu_wenxin_switch', 'bool')) { return { msg: type === 1 ? baiduWenxin.getChat(title, age, gender) : baiduWenxin.getComment(title) }; } return machine.getMsg(type) || false;//永远不会结束 @@ -63,12 +63,13 @@ if (!index) { } tCommon.openApp(); +//开启线程 自动关闭弹窗 +Engines.executeScript("unit/dialogClose.js"); while (true) { task.log(); try { - //开启线程 自动关闭弹窗 - Engines.executeScript("unit/dialogClose.js"); + let res = task.run(keyword, index); if (res || res === false) { tCommon.sleep(1000); @@ -76,13 +77,10 @@ while (true) { break; } - if (res === false) { - break; - } - tCommon.sleep(3000); } catch (e) { - Log.log(e.stack); + Log.log(e); + tCommon.closeAlert(1); tCommon.backHome(); } } \ No newline at end of file diff --git a/tasks/task_dy_fans_inc.js b/tasks/task_dy_fans_inc.js index fe330db..6860678 100644 --- a/tasks/task_dy_fans_inc.js +++ b/tasks/task_dy_fans_inc.js @@ -1,11 +1,11 @@ -import {Common as tCommon} from "app/dy/Common"; -import { Index as DyIndex } from 'app/dy/Index.js'; +let tCommon = require("app/dy/Common"); +let DyIndex = require('app/dy/Index.js'); const DyUser = require('app/dy/User.js'); -import { Video as DyVideo } from 'app/dy/Video.js'; -import { Comment as DyComment } from 'app/dy/Comment.js'; -import {storage} from "common/storage"; -import {baiduWenxin} from "service/baiduWenxin"; -import {machine} from "common/machine"; +let DyVideo = require('app/dy/Video.js'); +let DyComment = require('app/dy/Comment.js'); +let storage = require("common/storage"); +let baiduWenxin = require("service/baiduWenxin"); +let machine = require("common/machine"); let task = { msg: [], diff --git a/tasks/task_dy_fans_inc_main.js b/tasks/task_dy_fans_inc_main.js index d807d5d..a5af64f 100644 --- a/tasks/task_dy_fans_inc_main.js +++ b/tasks/task_dy_fans_inc_main.js @@ -1,16 +1,17 @@ -import { Common as tCommon } from 'app/dy/Common.js'; -import { Index as DyIndex } from 'app/dy/Index.js'; -import { Search as DySearch } from 'app/dy/Search.js'; -import { User as DyUser } from 'app/dy/User.js'; -import { Video as DyVideo } from 'app/dy/Video.js'; -import { storage } from 'common/storage.js'; -import { machine } from 'common/machine.js'; -import { Comment as DyComment } from 'app/dy/Comment.js'; -import { baiduWenxin } from 'service/baiduWenxin.js'; +let tCommon = require('app/dy/Common.js'); +let DyIndex = require('app/dy/Index.js'); +let DySearch = require('app/dy/Search.js'); +let DyUser = require('app/dy/User.js'); +let DyVideo = require('app/dy/Video.js'); +let storage = require('common/storage.js'); +let machine = require('common/machine.js'); +let DyComment = require('app/dy/Comment.js'); +let baiduWenxin = require('service/baiduWenxin.js'); let task = { contents: [], me: {}, + remark: false,//是否是#开头 run(settingData) { return this.testTask(settingData); }, @@ -24,7 +25,7 @@ let task = { //type 0 评论,1私信 getMsg(type, title, age, gender) { - if (storage.get('setting_baidu_wenxin_switch', 'bool')) { + if (storage.get('setting_baidu_wenxin_switch', 'bool')) { return { msg: type === 1 ? baiduWenxin.getChat(title, age, gender) : baiduWenxin.getComment(title) }; } @@ -47,15 +48,20 @@ let task = { })); DyIndex.intoHome(); - if (settingData.account.indexOf('+') === 0) { - DyIndex.intoMyPage(); + if (this.remark) { + App.gotoIntent('snssdk1128://user/profile/' + settingData.account); + tCommon.sleep(5000 + 2000 * Math.random()); } else { - DyIndex.intoSearchPage(); - } - - let res = DySearch.homeIntoSearchUser(settingData.account); - if (res) { - return res; + if (settingData.account.indexOf('+') === 0) { + DyIndex.intoMyPage(); + } else { + DyIndex.intoSearchPage(); + } + + let res = DySearch.homeIntoSearchUser(settingData.account); + if (res) { + return res; + } } return DyUser.fansIncList(this.getMsg, DyVideo, DyComment, machine, settingData, this.contents, this.me.nickname); @@ -69,7 +75,7 @@ Log.log('settingData', settingData); let count = settingData.task_dy_fans_inc_head_zan_rate + settingData.task_dy_fans_inc_video_zan_rate + settingData.task_dy_fans_inc_comment_rate + settingData.task_dy_fans_inc_collection_rate; if (count == 0) { - count = 1; + count = 100; } settingData.task_dy_fans_inc_head_zan_rate = (settingData.task_dy_fans_inc_head_zan_rate / count) * 100; @@ -80,11 +86,15 @@ settingData.task_dy_fans_inc_collection_rate = (settingData.task_dy_fans_inc_col console.log(machine.getMsg(0)); Log.log('settingData', settingData); -let tmp = settingData.task_dy_fans_inc_account.split(','); +task.remark = tCommon.getRemark(settingData.task_dy_fans_inc_accounts); +if (task.remark) { + settingData.task_dy_fans_inc_accounts = settingData.task_dy_fans_inc_accounts.substring(1); +} +let tmp = settingData.task_dy_fans_inc_accounts.split("\n"); tCommon.openApp(); Engines.executeScript("unit/dialogClose.js"); //开启线程 自动关闭弹窗 -Log.log('日志开始'); +Log.log('日志开始', tmp); task.log(); while (true) { @@ -100,7 +110,8 @@ while (true) { tCommon.sleep(3000); } } catch (e) { - Log.log(e.stack); + Log.log(e); + tCommon.closeAlert(1); tCommon.backHome(); } } diff --git a/tasks/task_dy_friend_change.js b/tasks/task_dy_friend_change.js new file mode 100644 index 0000000..32a8e4d --- /dev/null +++ b/tasks/task_dy_friend_change.js @@ -0,0 +1,251 @@ +let tCommon = require('app/dy/Common.js'); +let DyUser = require('app/dy/User.js'); +let DyVideo = require('app/dy/Video.js'); +let storage = require('common/storage.js'); +let machine = require('common/machine.js'); +let baiduWenxin = require('service/baiduWenxin.js'); +let statistics = require('common/statistics'); +let V = require("version/V.js"); + +// let dy = require('app/iDy'); +// let config = require('config/config'); + +/** + * 赞回访 + */ + +let videoCount = 500; + +let task = { + contents: [], + run() { + return this.testTask(); + }, + + log() { + let d = new Date(); + let file = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(); + let allFile = "log/log-dy-friend-change-" + file + ".txt"; + Log.setFile(allFile); + }, + + //type 0 评论,1私信 + getMsg(type, title, age, gender) { + if (storage.get('setting_baidu_wenxin_switch', 'bool')) { + return { msg: type === 1 ? baiduWenxin.getChat(title, age, gender) : baiduWenxin.getComment(title) }; + } + return machine.getMsg(type) || false;//永远不会结束 + }, + + getConfig() { + return { + runTimes: machine.get('task_dy_friend_change_run_count', 'int'),//运行次数 + intevalSecond: machine.get('task_dy_friend_change_interval', 'int'),//操作间隔 + homeWait: machine.get('task_dy_friend_change_home_wait', 'int'),//主页停留时间 + workWait: machine.get('task_dy_friend_change_work_wait', 'int'),//作品停留时间 + fansMin: machine.get('task_dy_friend_change_min_fans', 'int'), //最小粉丝数 + fansMax: machine.get('task_dy_friend_change_max_fans', 'int'),//最大粉丝数 + workMin: machine.get('task_dy_friend_change_min_work', 'int'),//最小作品数 + op: machine.getArray('task_dy_friend_change_op'), // "0","1","2" 分别是 关注、私信、点赞 + privateType: machine.getArray('task_dy_friend_change_private_type'), + } + }, + + testTask() { + //查看是不是进入了指定页面,是的话才开始运行 + let config = this.getConfig(); + Log.log("配置信息:", config); + tCommon.aId(V.C.text1a).textContains(V.Search.userList[2]).isVisibleToUser(true).waitFindOne();//粉丝或者关注界面 + Log.log("bug来了"); + let arr = [];//存储最新的20个 + let count = 0; + let repeatCount = 0; + let errorCount = 0; + let errorContainsCount = 0; + while (true) { + try { + tCommon.sleep(3000); + System.toast('开始执行,剩余数量:' + (config.runTimes - count)); + let contains = tCommon.id(V.C.rootLayout).isVisibleToUser(true).find(); + Log.log("找到的内容数量:", contains.length); + if (contains.length == 0) { + if (errorContainsCount++ >= 3) { + errorCount = 0; + throw new Error("3次找不到container内容"); + } + continue; + } + errorContainsCount = 0; + + for (let i in contains) { + tCommon.sleep(config.intevalSecond * 1000); + let nicknameTag = contains[i].children().findOne(tCommon.id(V.C.fansNickTag).isVisibleToUser(true)); + Log.log(nicknameTag); + if (!nicknameTag) { + System.generateWindowElements(); + Log.log('找不到昵称标签', contains[i]); + if (errorCount++ > 3) { + throw new Error("3次找不到昵称"); + } + continue; + } + errorCount = 0; + + tCommon.click(nicknameTag); + tCommon.sleep(2000); + statistics.viewUser(); + let nickname = nicknameTag.text(); + + if (count >= config.runTimes) { + System.toast('运行次数达到了'); + return true; + } + + if (DyUser.isPrivate()) { + tCommon.back(); + System.toast('私密账号'); + continue; + } + + let account = DyUser.getDouyin(); + if (machine.get("task_dy_friend_change_" + account, 'bool')) { + tCommon.back(); + System.toast('已经操作过了'); + continue; + } + + Log.log("抖音号:", account); + machine.set("task_dy_friend_change_" + account, true); + if (arr.indexOf(account) != -1) { + repeatCount++; + if (repeatCount >= 2) { + System.toast('运行结束'); + return true; + } + tCommon.back(); + continue; + } else { + repeatCount = 0; + } + + arr.push(account); + + let fansCount = DyUser.getFansCount(); + Log.log("粉丝数量:", fansCount); + if (fansCount < config.fansMin || fansCount > config.fansMax) { + tCommon.back(); + System.toast('粉丝数不符合要求'); + continue; + } + + let workCount = DyUser.getWorksCount(); + Log.log("作品数量:", workCount); + if (workCount < config.workMin) { + tCommon.back(); + System.toast('作品数不符合要求'); + continue; + } + + let isOp = false; + if (config.op.includes("2") && DyVideo.intoUserVideo()) { + Log.log("执行进入视频"); + tCommon.sleep(config.workWait * 1000); + if (DyVideo.isZan()) { + System.toast('已经点赞了'); + } else { + DyVideo.clickZan(); + isOp = true; + tCommon.sleep(2000 + 1000 * Math.random()); + } + tCommon.back(); + } + + //查看是否关注 + if (config.op.includes("0")) { + Log.log("执行关注"); + if (DyUser.isFocus()) { + System.toast('已关注,不操作'); + } else { + DyUser.focus(); + isOp = true; + tCommon.sleep(1000 + Math.random() * 1000); + } + } + + if (config.op.includes("1")) { + Log.log("执行私信"); + //如果 + if (config.privateType.includes("0") && config.privateType.includes("1")) { + DyUser.privateMsg(this.getMsg(1, nickname).msg); + isOp = true; + } else if (config.privateType.includes("0") && !DyUser.isCompany()) { + DyUser.privateMsg(this.getMsg(1, nickname).msg); + isOp = true; + } else if (config.privateType.includes("1") && DyUser.isCompany()) { + DyUser.privateMsg(this.getMsg(1, nickname).msg); + isOp = true; + } + } + + if (isOp) { + count++; + Log.log('操作次数:' + count + "/" + config.runTimes); + } + + tCommon.sleep(config.homeWait * 1000);//主页停留 + tCommon.swipe(0, 0.5); + tCommon.sleep(500); + if (tCommon.id(V.C.userListHead).isVisibleToUser(true).findOne()) { + Log.log("在列表页面了"); + } else { + tCommon.back(); + } + } + + tCommon.sleep(1000); + Log.log("执行滑动"); + //判断是粉丝还是关注 + task.swipe(); + System.cleanUp(); + } catch (e) { + if (!tCommon.id(V.C.userListHead).isVisibleToUser(true).findOne()) { + Log.log("找不到标签,返回了"); + tCommon.back(); + tCommon.sleep(2000); + } else { + Log.log('滑动一下,解决问题'); + task.swipe(); + } + Log.log(e); + } + } + }, + + swipe() { + let fansTag = tCommon.aId(V.C.text1a).textContains(V.Search.userList[2]).findOne(); + if (fansTag && fansTag.parent().isSelected()) { + tCommon.swipeFansListOp(); + } else { + tCommon.swipeFocusListOp(); + } + } +} + +//开启线程 自动关闭弹窗 +Engines.executeScript("unit/dialogClose.js"); + +while (true) { + task.log(); + try { + let res = task.run(); + if (res) { + tCommon.sleep(3000); + FloatDialogs.show('提示', '已完成'); + break; + } + + tCommon.sleep(3000); + } catch (e) { + Log.log(e); + } +} diff --git a/tasks/task_dy_grab.js b/tasks/task_dy_grab.js index 8a7145f..6a3822e 100644 --- a/tasks/task_dy_grab.js +++ b/tasks/task_dy_grab.js @@ -1,11 +1,11 @@ -import {Common as tCommon} from "app/dy/Common"; -import { Index as DyIndex } from 'app/dy/Index.js'; -import { Search as DySearch } from 'app/dy/Search.js'; +let tCommon = require("app/dy/Common"); +let DyIndex = require('app/dy/Index.js'); +let DySearch = require('app/dy/Search.js'); const DyUser = require('app/dy/User.js'); -import {machine} from "common/machine"; +let machine = require("common/machine"); let mHttp = require('unit/mHttp'); let Wx = require('app/wx/Wx.js'); -import {storage} from "common/storage"; +let storage = require("common/storage"); let task = { setting: {}, @@ -239,11 +239,11 @@ let task = { let rp = 0; while (true) { - let tags = new UiSelector().className('com.lynx.tasm.behavior.ui.LynxFlattenUI').textContains('粉丝').filter((v) => { + let tags = UiSelector().className('com.lynx.tasm.behavior.ui.LynxFlattenUI').textContains('粉丝').filter((v) => { return v && !!v.bounds() && v.bounds().left > 0 && v.bounds().width() > 0 && v.bounds().top > 0 && v.bounds().top + v.bounds().height() < Device.height(); }).find(); - arr.push(contains ? (contains[0]?._addr) : null); + arr.push(contains ? (contains[0] && contains[0]._addr) : null); if (contains.length > 2) { contains.shift(); } @@ -274,7 +274,7 @@ let task = { tCommon.click(tags[i]); tCommon.sleep(3000); - let contentTag = new UiSelector().className('android.widget.TextView').clickable(true).filter((v) => { + let contentTag = UiSelector().className('android.widget.TextView').clickable(true).filter((v) => { return v && v.bounds() && v.bounds().top > 0 && v.bounds().left > 0 && v.bounds().width() > 0; }).textContains('更多').findOnce(); @@ -293,7 +293,7 @@ let task = { System.sleep(30); } tCommon.sleep(2000); - contentTag = new UiSelector().className('android.widget.TextView').filter((v) => { + contentTag = UiSelector().className('android.widget.TextView').filter((v) => { return v && v.bounds() && v.bounds().left == contentTag.bounds().left && v.bounds().top == contentTag.bounds().top && v.bounds().width() == contentTag.bounds().width(); }).clickable(true).findOnce(); } else { @@ -301,7 +301,7 @@ let task = { return v && v.bounds() && v.bounds().top > 0 && v.bounds().left >= 0 && v.bounds().width() > 0; }).findOnce(); - contentTag = new UiSelector().className('android.widget.TextView').filter((v) => { + contentTag = UiSelector().className('android.widget.TextView').filter((v) => { return v && v.bounds() && v.bounds().left >= 0 && v.bounds().top == tag.bounds().top + tag.bounds().height() && v.bounds().width() > 0; }).clickable(true).findOnce(); } diff --git a/tasks/task_dy_grab_phone.js b/tasks/task_dy_grab_phone.js index 203d013..23a9c8d 100644 --- a/tasks/task_dy_grab_phone.js +++ b/tasks/task_dy_grab_phone.js @@ -1,10 +1,10 @@ -import { Common as tCommon } from "app/dy/Common"; -import { Index as DyIndex } from 'app/dy/Index.js'; -import { Search as DySearch } from 'app/dy/Search.js'; +let tCommon = require("app/dy/Common"); +let DyIndex = require('app/dy/Index.js'); +let DySearch = require('app/dy/Search.js'); const DyUser = require('app/dy/User.js'); -import { machine } from "common/machine"; -// import { Video as DyVideo } from 'app/dy/Video.js'; -// import { Comment as DyComment } from 'app/dy/Comment.js'; +let machine = require("common/machine"); +// let DyVideo = require('app/dy/Video.js'); +// let DyComment = require('app/dy/Comment.js'); // let dy = require('app/iDy'); // let config = require('config/config'); @@ -37,11 +37,11 @@ let task = { let grabLvError = 0; while (true) { - let tags = new UiSelector().className('com.lynx.tasm.behavior.ui.LynxFlattenUI').textContains('粉丝').filter((v) => { + let tags = UiSelector().className('com.lynx.tasm.behavior.ui.LynxFlattenUI').textContains('粉丝').filter((v) => { return v && !!v.bounds() && v.bounds().left > 0 && v.bounds().width() > 0 && v.bounds().top > 0 && v.bounds().top + v.bounds().height() < Device.height(); }).find(); - arr.push(contains ? (contains[0]?._addr) : null); + arr.push(contains ? (contains[0] && contains[0]._addr) : null); if (contains.length > 2) { contains.shift(); } @@ -72,7 +72,7 @@ let task = { tCommon.click(tags[i]); tCommon.sleep(3000); - let contentTag = new UiSelector().className('android.widget.TextView').filter((v) => { + let contentTag = UiSelector().className('android.widget.TextView').filter((v) => { return v && v.bounds() && v.bounds().top > 0 && v.bounds().left > 0 && v.bounds().width() > 0; }).textContains('更多').findOnce(); @@ -91,7 +91,7 @@ let task = { System.sleep(30); } tCommon.sleep(2000); - contentTag = new UiSelector().className('android.widget.TextView').filter((v) => { + contentTag = UiSelector().className('android.widget.TextView').filter((v) => { return v && v.bounds() && v.bounds().left == contentTag.bounds().left && v.bounds().top == contentTag.bounds().top && v.bounds().width() == contentTag.bounds().width(); }).clickable(true).findOnce(); } diff --git a/tasks/task_dy_live_barrage.js b/tasks/task_dy_live_barrage.js index 20481fc..fe8c559 100644 --- a/tasks/task_dy_live_barrage.js +++ b/tasks/task_dy_live_barrage.js @@ -1,28 +1,37 @@ -import {Common as tCommon} from "app/dy/Common"; -import { Index as DyIndex } from 'app/dy/Index.js'; -import { Search as DySearch } from 'app/dy/Search.js'; -// const DyUser = require('app/dy/User.js'); -const DyLive = require('app/dy/Live.js'); -// import { Comment as DyComment } from 'app/dy/Comment.js'; +let tCommon = require("app/dy/Common"); +let DyIndex = require('app/dy/Index.js'); +let DySearch = require('app/dy/Search.js'); +let DyUser = require('app/dy/User.js'); +let DyLive = require('app/dy/Live.js'); +// let DyComment = require('app/dy/Comment.js'); // let dy = require('app/iDy'); // let config = require('config/config'); -import {storage} from "common/storage"; +let storage = require("common/storage"); +let machine = require("common/machine"); let task = { rp: 0, msg: [], - run(account, second, msg) { - this.msg = tCommon.splitKeyword(msg); - Log.log('msg', this.msg); + run(account, second) { return this.testTask(account, second); }, - getMsg() { - return this.msg[Math.round(Math.random() * (this.msg.length - 1))]; + getMsg(type, title, age, gender) { + let comments = storage.get('task_dy_live_barrage_comments'); + if (comments) { + let tmp = comments.split("\n"); + let rd = Math.floor(Math.random() * tmp.length); + return { msg: tmp[rd] }; + } + + if (storage.get('setting_baidu_wenxin_switch', 'bool')) { + return { msg: type === 1 ? baiduWenxin.getChat(title, age, gender) : baiduWenxin.getComment(title) }; + } + return machine.getMsg(type) || false;//永远不会结束 }, - log(){ + log() { let d = new Date(); let file = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(); let allFile = "log/log-live-barrage-" + file + ".txt"; @@ -31,18 +40,35 @@ let task = { testTask(account, second) { //首先进入点赞页面 - DyIndex.intoSearchPage(); - this.rp++; - if (this.rp >= 3) { - return true; + if (!tCommon.getRemark(account)) { + DyIndex.intoSearchPage(); + this.rp++; + if (this.rp >= 3) { + return true; + } + + DySearch.intoSearchList(account, 1); + DySearch.intoLiveRoom(account); + } else { + account = account.substring(1); + App.gotoIntent('snssdk1128://user/profile/' + account); + tCommon.sleep(5000 + 2000 * Math.random()); + if (!DyUser.intoLive()) { + return true; + } + tCommon.sleep(5000 + 2000 * Math.random()); } - DySearch.intoSearchList(account, 1); - DySearch.intoLiveRoom(account); this.rp = 0; while (true) { - Log.log('开始评论了'); - if (false === DyLive.loopComment(this.getMsg())) { + Log.log('开始点赞了'); + if (storage.get('task_dy_live_barrage_zan_rate', 'int') > Math.random() * 100 && false === DyLive.loopClick(20 + Math.round(20 * Math.random()))) { + throw new Error('可能异常'); + } + + let msg = this.getMsg(0); + Log.log('开始评论了', msg); + if (msg && msg.msg && storage.get('task_dy_live_barrage_comment_rate', 'int') > Math.random() * 100 && false === DyLive.loopComment(msg.msg, storage.get('task_dy_live_barrage_comment_emoji_switch', 'bool'))) { throw new Error('可能异常'); } @@ -53,79 +79,29 @@ let task = { }, } -let i = false; -Dialogs.confirm('提示', '确定开始执行嘛?', (_true) => { - i = _true; -}); - -if (!i) { - tCommon.showToast('你取消了执行'); - //console.hide();(); - System.exit(); -} - -let account = Dialogs.input('请输入直播账号:', storage.get('task_dy_live_barrage_account') || ''); +let account = storage.get('task_dy_live_barrage_account', 'string'); if (!account) { - tCommon.showToast('你取消了执行'); - //console.hide();(); - System.exit(); -} -storage.set('task_dy_live_barrage_account', account); - -let second = Dialogs.input('请输入弹幕最大间隔(秒):', storage.get('task_dy_live_barrage_second') || ''); -if (!second || isNaN(second)) { - tCommon.showToast('你取消了执行'); - //console.hide();(); - System.exit(); -} -storage.set('task_dy_live_barrage_second', second); - -let msg = Dialogs.input('请输入评论内容(多个使用逗号隔开):', storage.get('task_dy_live_barrage_msg') || ''); -if (!msg) { - tCommon.showToast('你取消了执行'); - //console.hide();(); + tCommon.showToast('直播账号不能为空'); + //console.hide();(); System.exit(); } -storage.set('task_dy_live_barrage_msg', msg); tCommon.openApp(); +//开启线程 自动关闭弹窗 +Engines.executeScript("unit/dialogClose.js"); -let thr = undefined; while (true) { task.log(); try { //开启线程 自动关闭弹窗 - thr = tCommon.closeAlert(); - if (task.run(account, second, msg)) { - if (thr) { - thr.interrupt(); - Threads.shutDownAll(); - tCommon.sleep(1000); - } + if (task.run(account, storage.get('task_dy_live_barrage_second', 'int'))) { FloatDialogs.show('提示', '直播结束了'); break; } tCommon.sleep(3000); } catch (e) { Log.log(e); - try { - if (thr) { - thr.interrupt(); - Threads.shutDownAll(); - } - tCommon.showToast("遇到错误,即将自动重启"); - tCommon.closeApp(); - tCommon.sleep(3000); - tCommon.showToast('开启抖音'); - tCommon.openApp(); - } catch (e) { - Log.log('启停bug', e); - } + tCommon.closeAlert(1); + tCommon.backHome(); } } - -try { - Engines.closeAll(true); -} catch (e) { - Log.log('停止脚本'); -} diff --git a/tasks/task_dy_live_zan.js b/tasks/task_dy_live_zan.js index fb3a2b2..38e37c4 100644 --- a/tasks/task_dy_live_zan.js +++ b/tasks/task_dy_live_zan.js @@ -1,13 +1,13 @@ -import {Common as tCommon} from "app/dy/Common"; -import { Index as DyIndex } from 'app/dy/Index.js'; -import { Search as DySearch } from 'app/dy/Search.js'; +let tCommon = require("app/dy/Common"); +let DyIndex = require('app/dy/Index.js'); +let DySearch = require('app/dy/Search.js'); // const DyUser = require('app/dy/User.js'); const DyLive = require('app/dy/Live.js'); -// import { Comment as DyComment } from 'app/dy/Comment.js'; +// let DyComment = require('app/dy/Comment.js'); // let dy = require('app/iDy'); // let config = require('config/config'); -import {storage} from "common/storage"; +let storage = require("common/storage"); let task = { rp: 0, diff --git a/tasks/task_dy_qingsong_tuoke.js b/tasks/task_dy_qingsong_tuoke.js new file mode 100644 index 0000000..9df3f7e --- /dev/null +++ b/tasks/task_dy_qingsong_tuoke.js @@ -0,0 +1,244 @@ +let tCommon = require('app/dy/Common.js'); +let DyUser = require('app/dy/User.js'); +let DyVideo = require('app/dy/Video.js'); +let storage = require('common/storage.js'); +let machine = require('common/machine.js'); +let baiduWenxin = require('service/baiduWenxin.js'); +let statistics = require('common/statistics'); +let V = require("version/V.js"); + +// let dy = require('app/iDy'); +// let config = require('config/config'); + +/** + * 赞回访 + */ + +let videoCount = 500; + +let task = { + contents: [], + run() { + return this.testTask(); + }, + + log() { + let d = new Date(); + let file = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(); + let allFile = "log/log-dy-qingsong-tuoke-" + file + ".txt"; + Log.setFile(allFile); + }, + + //type 0 评论,1私信 + getMsg(type, title, age, gender) { + if (storage.get('setting_baidu_wenxin_switch', 'bool')) { + return { msg: type === 1 ? baiduWenxin.getChat(title, age, gender) : baiduWenxin.getComment(title) }; + } + return machine.getMsg(type) || false;//永远不会结束 + }, + + getConfig() { + return { + runTimes: machine.get('task_dy_qingsong_tuoke_run_count', 'int'),//运行次数 + intevalSecond: machine.get('task_dy_qingsong_tuoke_interval', 'int'),//操作间隔 + homeWait: machine.get('task_dy_qingsong_tuoke_home_wait', 'int') || 5,//主页停留时间 + workWait: machine.get('task_dy_qingsong_tuoke_work_wait', 'int') || 5,//作品停留时间 + fansMin: machine.get('task_dy_qingsong_tuoke_min_fans', 'int') || 0, //最小粉丝数 + fansMax: machine.get('task_dy_qingsong_tuoke_max_fans', 'int') || 1000000000,//最大粉丝数 + workMin: machine.get('task_dy_qingsong_tuoke_min_work', 'int') || 1,//最小作品数 + op: ["2"],//machine.getArray('task_dy_qingsong_tuoke_op'), // "0","1","2" 分别是 关注、私信、点赞 + privateType: machine.getArray('task_dy_qingsong_tuoke_private_type') || [], + } + }, + + testTask() { + //查看是不是进入了指定页面,是的话才开始运行 + let config = this.getConfig(); + Log.log("配置信息:", config); + tCommon.aId(V.C.text1a).textContains(V.Search.userList[2]).isVisibleToUser(true).waitFindOne();//粉丝或者关注界面 + Log.log("bug来了"); + let arr = [];//存储最新的20个 + let count = 0; + let repeatCount = 0; + let errorCount = 0; + let errorContainsCount = 0; + + while (true) { + try { + tCommon.sleep(3000); + System.toast('开始执行,剩余数量:' + (config.runTimes - count)); + let contains = tCommon.id(V.C.rootLayout).isVisibleToUser(true).find(); + Log.log("找到的内容数量:", contains.length); + if (contains.length == 0) { + if (errorContainsCount++ >= 3) { + throw new Error("3次找不到container内容"); + } + continue; + } + errorContainsCount = 0; + + for (let i in contains) { + tCommon.sleep(config.intevalSecond * 1000); + let nicknameTag = contains[i].children().findOne(tCommon.id(V.C.fansNickTag).isVisibleToUser(true)); + Log.log(nicknameTag); + if (!nicknameTag) { + System.generateWindowElements(); + Log.log('找不到昵称标签', contains[i]); + if (errorCount++ > 3) { + errorCount = 0; + throw new Error("3次找不到昵称"); + } + continue; + } + errorCount = 0; + + tCommon.click(nicknameTag); + tCommon.sleep(2000); + statistics.viewUser(); + let nickname = nicknameTag.text(); + count++; + Log.log('操作次数:' + count + "/" + config.runTimes); + if (count >= config.runTimes) { + System.toast('运行次数达到了'); + return true; + } + + if (DyUser.isPrivate()) { + tCommon.back(); + System.toast('私密账号'); + continue; + } + + let account = DyUser.getDouyin(); + if (machine.get("task_dy_qingsong_tuoke_" + account, 'bool')) { + tCommon.back(); + System.toast('已经操作过了'); + continue; + } + + Log.log("抖音号:", account); + machine.set("task_dy_qingsong_tuoke_" + account, true); + if (arr.indexOf(account) != -1) { + repeatCount++; + if (repeatCount >= 2) { + System.toast('运行结束'); + return true; + } + tCommon.back(); + continue; + } else { + repeatCount = 0; + } + + arr.push(account); + + let fansCount = DyUser.getFansCount(); + Log.log("粉丝数量:", fansCount); + if (fansCount < config.fansMin || fansCount > config.fansMax) { + tCommon.back(); + System.toast('粉丝数不符合要求'); + continue; + } + + let workCount = DyUser.getWorksCount(); + Log.log("作品数量:", workCount); + if (workCount < config.workMin) { + tCommon.back(); + System.toast('作品数不符合要求'); + continue; + } + + if (config.op.includes("2") && DyVideo.intoUserVideo()) { + Log.log("执行进入视频"); + tCommon.sleep(config.workWait * 1000); + if (DyVideo.isZan()) { + System.toast('已经点赞了'); + } else { + DyVideo.clickZan(); + tCommon.sleep(2000 + 1000 * Math.random()); + } + tCommon.back(); + } + + //查看是否关注 + if (config.op.includes("0")) { + Log.log("执行关注"); + if (DyUser.isFocus()) { + System.toast('已关注,不操作'); + } else { + DyUser.focus(); + tCommon.sleep(1000 + Math.random() * 1000); + } + } + + if (config.op.includes("1")) { + Log.log("执行私信"); + //如果 + if (config.privateType.includes("0") && config.privateType.includes("1")) { + DyUser.privateMsg(this.getMsg(1, nickname).msg); + } else if (config.privateType.includes("0") && !DyUser.isCompany()) { + DyUser.privateMsg(this.getMsg(1, nickname).msg); + } else if (config.privateType.includes("1") && DyUser.isCompany()) { + DyUser.privateMsg(this.getMsg(1, nickname).msg); + } + } + + tCommon.sleep(config.homeWait * 1000);//主页停留 + tCommon.swipe(0, 0.5); + tCommon.sleep(500); + + if (tCommon.id(V.C.userListHead).isVisibleToUser(true).findOne()) { + //不做任何处理,已经在列表页面了 + Log.log("在列表页面了"); + } else { + tCommon.back();//这里的back最好是判断一下,如果不在用户页,则不用返回了;或者判断是不是在列表页,是的话,也不用返回 + } + } + + tCommon.sleep(1000); + Log.log("执行滑动"); + //判断是粉丝还是关注 + task.swipe(); + System.cleanUp(); + } catch (e) { + if (!tCommon.id(V.C.userListHead).isVisibleToUser(true).findOne()) { + Log.log("找不到标签,返回了"); + tCommon.back(); + tCommon.sleep(2000); + } else { + Log.log('滑动一下,解决问题'); + task.swipe(); + } + Log.log(e); + } + } + }, + + swipe() { + let fansTag = tCommon.aId(V.C.text1a).textContains(V.Search.userList[2]).findOne(); + if (fansTag && fansTag.parent().isSelected()) { + tCommon.swipeFansListOp(); + } else { + tCommon.swipeFocusListOp(); + } + } +} + +//开启线程 自动关闭弹窗 +Engines.executeScript("unit/dialogClose.js"); + +while (true) { + task.log(); + try { + let res = task.run(); + if (res) { + tCommon.sleep(3000); + FloatDialogs.show('提示', '已完成'); + break; + } + + tCommon.sleep(3000); + } catch (e) { + Log.log(e); + } +} diff --git a/tasks/task_dy_search_inquiry.js b/tasks/task_dy_search_inquiry.js index c40716a..0d50c5f 100644 --- a/tasks/task_dy_search_inquiry.js +++ b/tasks/task_dy_search_inquiry.js @@ -1,12 +1,12 @@ -import { Common as tCommon } from 'app/dy/Common.js'; -import { Index as DyIndex } from 'app/dy/Index.js'; -import { Search as DySearch } from 'app/dy/Search.js'; -import { User as DyUser } from 'app/dy/User.js'; -import { Video as DyVideo } from 'app/dy/Video.js'; -import { storage } from 'common/storage.js'; -import { machine } from 'common/machine.js'; -import { Comment as DyComment } from 'app/dy/Comment.js'; -import { baiduWenxin } from 'service/baiduWenxin.js'; +let tCommon = require('app/dy/Common.js'); +let DyIndex = require('app/dy/Index.js'); +let DySearch = require('app/dy/Search.js'); +let DyUser = require('app/dy/User.js'); +let DyVideo = require('app/dy/Video.js'); +let storage = require('common/storage.js'); +let machine = require('common/machine.js'); +let DyComment = require('app/dy/Comment.js'); +let baiduWenxin = require('service/baiduWenxin.js'); // let dy = require('app/iDy'); // let config = require('config/config'); @@ -265,12 +265,12 @@ if (!task.count) { } tCommon.openApp(); +//开启线程 自动关闭弹窗 +Engines.executeScript("unit/dialogClose.js"); while (true) { task.log(); try { - //开启线程 自动关闭弹窗 - Engines.executeScript("unit/dialogClose.js"); let res = task.run(keyword, kws); if (res) { tCommon.sleep(3000); @@ -284,7 +284,8 @@ while (true) { tCommon.sleep(3000); } catch (e) { - Log.log(e.stack); + Log.log(e); + tCommon.closeAlert(1); tCommon.backHome(); } } diff --git a/tasks/task_dy_search_user.js b/tasks/task_dy_search_user.js index 56cc244..9036f7a 100644 --- a/tasks/task_dy_search_user.js +++ b/tasks/task_dy_search_user.js @@ -1,12 +1,12 @@ -import { Common as tCommon } from 'app/dy/Common.js'; -import { Index as DyIndex } from 'app/dy/Index.js'; -import { Search as DySearch } from 'app/dy/Search.js'; -import { User as DyUser } from 'app/dy/User.js'; -import { Video as DyVideo } from 'app/dy/Video.js'; -import { storage } from 'common/storage.js'; -import { machine } from 'common/machine.js'; -import { Comment as DyComment } from 'app/dy/Comment.js'; -import { baiduWenxin } from 'service/baiduWenxin.js'; +let tCommon = require('app/dy/Common.js'); +let DyIndex = require('app/dy/Index.js'); +let DySearch = require('app/dy/Search.js'); +let DyUser = require('app/dy/User.js'); +let DyVideo = require('app/dy/Video.js'); +let storage = require('common/storage.js'); +let machine = require('common/machine.js'); +let DyComment = require('app/dy/Comment.js'); +let baiduWenxin = require('service/baiduWenxin.js'); // let dy = require('app/iDy'); // let config = require('config/config'); @@ -64,8 +64,8 @@ let task = { } -let settingData = machine.getSearchUserSettingRate(); -settingData.isFirst = true; +let settingData = machine.getSearchUserSettingRate();//commentRate +settingData.isFirst = false;//首个视频必操作,关闭 Log.log('settingData', settingData); if (!settingData.keyword) { @@ -82,12 +82,12 @@ if (!task.count) { } tCommon.openApp(); +//开启线程 自动关闭弹窗 +Engines.executeScript("unit/dialogClose.js"); while (true) { task.log(); try { - //开启线程 自动关闭弹窗 - Engines.executeScript("unit/dialogClose.js"); let res = task.run(settingData); if (res) { tCommon.sleep(3000); @@ -102,7 +102,8 @@ while (true) { tCommon.sleep(3000); } catch (e) { - Log.log(e.stack); + Log.log(e); + tCommon.closeAlert(1); tCommon.backHome(); } } \ No newline at end of file diff --git a/tasks/task_dy_search_vertical.js b/tasks/task_dy_search_vertical.js index f6fa009..cda609b 100644 --- a/tasks/task_dy_search_vertical.js +++ b/tasks/task_dy_search_vertical.js @@ -1,11 +1,12 @@ -import { Common as tCommon } from "app/dy/Common"; -import { Index as DyIndex } from 'app/dy/Index.js'; -import { Search as DySearch } from 'app/dy/Search.js'; -import { Video as DyVideo } from 'app/dy/Video.js'; -import { storage } from "common/storage"; -import { machine } from "common/machine"; -import { Comment as DyComment } from 'app/dy/Comment.js'; -import { baiduWenxin } from "service/baiduWenxin"; +let tCommon = require("app/dy/Common"); +let DyIndex = require('app/dy/Index.js'); +let DySearch = require('app/dy/Search.js'); +let DyVideo = require('app/dy/Video.js'); +let storage = require("common/storage"); +let machine = require("common/machine"); +let DyComment = require('app/dy/Comment.js'); +let baiduWenxin = require("service/baiduWenxin"); +let statistics = require("common/statistics"); // let dy = require('app/iDy'); // let config = require('config/config'); @@ -14,6 +15,9 @@ let task = { contents: [], lib_id: undefined, count: 100, + zanRate: storage.get('task_dy_search_zan_rate', 'int'), + commentRate: storage.get('task_dy_search_comment_rate', 'int'), + focusRate: storage.get('task_dy_search_focus_rate', 'int'), run(keyword) { return this.testTask(keyword); }, @@ -28,7 +32,7 @@ let task = { //type 0 评论,1私信 getMsg(type, title, age, gender) { if (storage.getMachineType() === 1) { - if (storage.get('setting_baidu_wenxin_switch', 'bool')) { + if (storage.get('setting_baidu_wenxin_switch', 'bool')) { return { msg: type === 1 ? baiduWenxin.getChat(title, age, gender) : baiduWenxin.getComment(title) }; } return machine.getMsg(type) || false;//永远不会结束 @@ -43,97 +47,115 @@ let task = { tCommon.sleep(5000); let rpCount = 0; + let noNicknameCount = 0; while (true) { - if (DyVideo.isLiving()) { - Log.log('直播'); - tCommon.sleep(2000 + Math.random() * 2000); - DyVideo.next(); - tCommon.sleep(2000); - continue; - } + try { + if (DyVideo.isLiving()) { + Log.log('直播'); + tCommon.sleep(2000 + Math.random() * 2000); + DyVideo.next(); + tCommon.sleep(2000); + continue; + } - let title = DyVideo.getContent(); - let nickname = DyVideo.getNickname(); - if (machine.get('task_dy_search_vertical_' + nickname + "_" + title, 'bool')) { - Log.log('重复视频'); - tCommon.sleep(2000 + Math.random() * 2000); - DyVideo.next(); - tCommon.sleep(2000); - continue; - } + let title = DyVideo.getContent(); + let nickname = DyVideo.getNickname(); - if (this.contents.includes(nickname + '_' + title)) { - rpCount++; - if (rpCount > 3) { - return true; + if (machine.get('task_dy_search_vertical_' + nickname + "_" + title, 'bool')) { + Log.log('重复视频'); + tCommon.sleep(2000 + Math.random() * 2000); + DyVideo.next(); + tCommon.sleep(2000); + continue; } - } - rpCount = 0; + statistics.viewVideo(); + statistics.viewTargetVideo(); - if (this.count-- <= 0) { - return true; - } + if (this.contents.includes(nickname + '_' + title)) { + rpCount++; + if (rpCount > 3) { + return true; + } + } - //刷视频 - let processBar = DyVideo.getProcessBar(); - //Log.log('processBar', processBar, processBar && processBar.bounds().height(), processBar && processBar.bounds().top); - if (storage.getPackage() !== 'org.autojs.autoxjs.v6') { - if (processBar) { - let sleepSec = 20 + 20 * Math.random() - 5; - Log.log('休眠' + sleepSec + 's'); - tCommon.sleep(sleepSec * 1000);//最后减去视频加载时间 和查询元素的时间 - } else { - let sleepSec = (15 + 10 * Math.random() - 5); - Log.log('休眠' + sleepSec + 's'); - tCommon.sleep(sleepSec * 1000);//最后减去视频加载时间 和查询元素的时间 + rpCount = 0; + + if (this.count-- <= 0) { + return true; } - } else { - let sleepSec = (5 + 10 * Math.random() - 5); + + //刷视频 + let sleepSec = (10 + 10 * Math.random()); Log.log('休眠' + sleepSec + 's'); tCommon.sleep(sleepSec * 1000);//最后减去视频加载时间 和查询元素的时间 - } - Log.log('看看是不是广告'); - //看看是不是广告,是的话,不操作作者 - if (DyVideo.viewDetail()) { - let clickRePlayTag = tCommon.id('fw2').filter((v) => { - return v && v.bounds() && v.bounds().top > 0 && v.bounds().top + v.bounds().height() < Device.height() && v.bounds().width() > 0 && v.bounds().left > 0; - }).findOnce(); - if (clickRePlayTag) { - Log.log('点击重播'); - clickRePlayTag.click(); - tCommon.sleep(1000); + Log.log('看看是不是广告'); + //看看是不是广告,是的话,不操作作者 + if (DyVideo.viewDetail()) { + let clickRePlayTag = UiSelector().textContains('点击重播').filter((v) => { + return v && v.bounds() && v.bounds().top > 0 && v.bounds().top + v.bounds().height() < Device.height() && v.bounds().width() > 0 && v.bounds().left > 0; + }).findOnce(); + if (clickRePlayTag) { + Log.log('点击重播'); + clickRePlayTag.click(); + tCommon.sleep(1000); + } + Gesture.click(500 + Math.random() * 200, 500 + Math.random() * 300); + tCommon.sleep(1500); + } else { + //Log.log('不是广告,准备进入主页'); } - Gesture.click(500 + Math.random() * 200, 500 + Math.random() * 300); - tCommon.sleep(1500); - } else { - Log.log('不是广告,准备进入主页'); - } - let commentCount = DyVideo.getCommentCount(); - - if (Math.random() <= 0.333) { - Log.log('评论') - let videoTitle = DyVideo.getContent(); - DyVideo.openComment(!!commentCount); - tCommon.sleep(500 + 500 * Math.random()); - let msg = this.getMsg(0, videoTitle); - DyComment.commentMsg(msg.msg); - tCommon.sleep(2000 + 2000 * Math.random()); - tCommon.back(); - tCommon.sleep(500); - } + let commentCount = DyVideo.getCommentCount(); + + if (Math.random() * 100 <= task.commentRate) { + Log.log('评论') + let videoTitle = DyVideo.getContent(); + DyVideo.openComment(!!commentCount); + tCommon.sleep(500 + 500 * Math.random()); + let msg = this.getMsg(0, videoTitle); + DyComment.commentMsg(msg.msg); + tCommon.sleep(2000 + 2000 * Math.random()); + tCommon.back(); + tCommon.sleep(500); + } - if (Math.random() <= 0.333) { - Log.log('点赞'); - DyVideo.clickZan(); - } + if (Math.random() * 100 <= task.zanRate) { + Log.log('点赞'); + DyVideo.clickZan(); + tCommon.sleep(1000 + 1000 * Math.random()); + } - machine.set('task_dy_search_vertical_' + nickname + "_" + title, true); - this.contents.push(nickname + "_" + title); - DyVideo.next(); - tCommon.sleep(2000); + if (Math.random() * 100 <= task.focusRate) { + DyVideo.intoUserPage(); + tCommon.sleep(3000 + 1000 * Math.random()); + Log.log('关注开始'); + DyUser.focus(); + tCommon.sleep(1000 + 1000 * Math.random()); + tCommon.back(); + Log.log('关注完成'); + } + + machine.set('task_dy_search_vertical_' + nickname + "_" + title, true); + this.contents.push(nickname + "_" + title); + DyVideo.next(); + tCommon.sleep(2000); + noNicknameCount = 0; + } catch (e) { + Log.log(e); + if (noNicknameCount++ >= 3) { + if (noNicknameCount > 6) { + Log.log('多次退出未解决问题'); + break; + } + tCommon.back(); + tCommon.sleep(500); + DyVideo.next(); + tCommon.sleep(2000); + } + continue; + } } }, } @@ -153,12 +175,12 @@ if (!task.count) { } tCommon.openApp(); +//开启线程 自动关闭弹窗 +Engines.executeScript("unit/dialogClose.js"); while (true) { task.log(); try { - //开启线程 自动关闭弹窗 - Engines.executeScript("unit/dialogClose.js"); let res = task.run(keyword); if (res) { tCommon.sleep(3000); @@ -174,7 +196,8 @@ while (true) { tCommon.sleep(3000); } catch (e) { - Log.log(e.stack); + Log.log(e); + tCommon.closeAlert(1); tCommon.backHome(); } } diff --git a/tasks/task_dy_team_buy.js b/tasks/task_dy_team_buy.js new file mode 100644 index 0000000..6d42c7d --- /dev/null +++ b/tasks/task_dy_team_buy.js @@ -0,0 +1,372 @@ +let tCommon = require("app/dy/Common"); +let DyIndex = require("app/dy/Index"); +let DyUser = require("app/dy/User"); +let DyVideo = require("app/dy/Video"); +let DyComment = require("app/dy/Comment"); +let storage = require("common/storage"); +let machine = require("common/machine"); +let baiduWenxin = require("service/baiduWenxin"); +let V = require('version/V.js'); + +let task = { + index: -1, + nicknames: [], + contents: [], + run() { + return this.testTask(); + }, + + getMsg(type, title, age, gender) { + if (storage.get('setting_baidu_wenxin_switch', 'bool')) { + return { msg: type === 1 ? baiduWenxin.getChat(title, age, gender) : baiduWenxin.getComment(title) }; + } + return machine.getMsg(type) || false;//永远不会结束 + }, + + log() { + let d = new Date(); + let file = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(); + let allFile = "log/log-comment-" + file + ".txt"; + Log.setFile(allFile); + }, + + includesKw(str, kw) { + for (let i in kw) { + if (str.includes(kw[i])) { + return true; + } + } + return false; + }, + + search(keyword) { + let inputTag = tCommon.id(V.Search.intoSearchList[0]).isVisibleToUser(true).findOne(); + if (!inputTag) { + Log.log('没有input'); + return false; + } + + tCommon.click(inputTag); + tCommon.sleep(2000); + + inputTag = tCommon.id(V.Search.intoSearchList[0]).findOne(); + if (!inputTag) { + tCommon.sleep(2000); + inputTag = tCommon.id(V.Search.intoSearchList[0]).findOne(); + } + + inputTag.setText(keyword); + tCommon.sleep(2000); + + let submitTag = tCommon.id(V.Search.intoSearchList[1]).textContains(V.Search.intoSearchList[2]).isVisibleToUser(true).findOne(); + if (!submitTag) { + Log.log('没有搜索button'); + return false; + } + tCommon.click(submitTag); + tCommon.sleep(5000); + + let containerTag = UiSelector().textContains(keyword).className('com.lynx.tasm.behavior.ui.text.FlattenUIText').isVisibleToUser(true).findOne(); + + Log.log('神器:', containerTag); + + if (!containerTag) { + containerTag = UiSelector().textContains(keyword.substring(0, 6)).className('com.lynx.tasm.behavior.ui.text.FlattenUIText').isVisibleToUser(true).findOne(); + if (!containerTag) { + Log.log('没有找到店铺'); + FloatDialogs.show('提示', '没有找到门店,请确保名称完全一致~'); + return -1; + } + } + + Log.log(containerTag); + + Gesture.click(containerTag.bounds().left + 5 + Math.random() * 20, containerTag.bounds().top + 5 + Math.random() * 20); + tCommon.sleep(3000 + 3000 * Math.random()); + + let i = 12; + let commentTag; + while (i-- > 0) { + commentTag = UiSelector().textContains(V.GroupBuy.shopContainer[1]).textContains(V.GroupBuy.shopContainer[2]).isVisibleToUser(true).findOne(); + if (commentTag) { + break; + } + + let shopContainer = tCommon.id(V.GroupBuy.shopContainer[0]).isVisibleToUser(true).filter(v => { + return v && v.bounds() && v.bounds().top > Device.height() - v.bounds().height(); + }).findOne(); + if (!shopContainer) { + tCommon.swipe(0, 0.5);//慢慢滑动 + tCommon.sleep(1000 + 500 * Math.random()); + } else { + Log.log('没有找到shopContainer'); + } + } + + if (!commentTag) { + FloatDialogs.show('提示', '没有找到评论列表~'); + return -1; + } + + Gesture.click(commentTag.bounds().left + 200 + 400 * Math.random(), commentTag.bounds().top + 20 * Math.random()); + tCommon.sleep(3000 + 2000 * Math.random()); + + //最新点击 + let newTag = new UiSelector().textContains('最新').className('com.lynx.tasm.behavior.ui.text.UIText').findOne() || new UiSelector().textContains('最新').className('com.lynx.tasm.behavior.ui.text.FlattenUIText').findOne();; + if (newTag) { + tCommon.click(newTag); + tCommon.sleep(3000 + 2000 * Math.random()); + } + + return true; + }, + + testTask() { + let keyword = machine.get('task_dy_team_buy_text'); + let zanRate = machine.get('task_dy_team_buy_zan_rate', 'int'); + let privateRate = machine.get('task_dy_team_buy_private_rate', 'int'); + let commentRate = machine.get('task_dy_team_buy_comment_rate', 'int'); + let opCount = machine.get('task_dy_team_buy_op_count') * 1; + let waitSecond = machine.get('task_dy_team_buy_wait', 'int'); + + Log.log([ + keyword, zanRate, privateRate, commentRate, opCount, waitSecond + ]); + + //首先进入页面 + let res = DyIndex.intoGroupBuy(keyword); + if (!res) { + return res; + } + + tCommon.sleep(3000); + res = this.search(keyword); + if (true !== res) { + return res; + } + + let containers = []; + let rpContainers = []; + + while (true) { + try { + // ntoUser = UiSelector().textContains('帮助更多用户决策').isVisibleToUser(true).findOne() ? false : true; + let tags = UiSelector().textMatches("[\\s\\S]+").isVisibleToUser(true).clickable(true).filter(v => { + return v && v.bounds() && v.bounds().width() == Device.width() && v.bounds().height() > 0 && v.bounds().left == 0 && v.bounds().top + v.bounds().height() < Device.height(); + }).find(); + + if (tags.length == 0) { + Log.log('无内容'); + return true; + } + + if (containers.length >= 3) { + if (tags[0].text() == containers[0]) { + Log.log('完成'); + return true; + } + + containers.shift(); + } + + containers.push(tags[0].text()); + + for (let i in tags) { + if (rpContainers.indexOf(tags[i].text()) != -1) { + Log.log('重复'); + continue; + } + + rpContainers.push(tags[i].text()); + if (rpContainers.length > 20) { + rpContainers.shift(); + } + + if (tags[i].text() && (tags[i].text().indexOf('**') !== -1 || tags[i].text().indexOf('帮助更多用户决策') !== -1) || !tags[i].desc()) { + Log.log('隐私或者底部'); + continue; + } + + if(tags[i].text().indexOf('写评价,吃喝玩乐免费体验') !== -1){ + Log.log('评价'); + continue; + } + + Log.log('进入用户中心', tags[i], tags[i].bounds().top, tags[i].bounds().height()); + //tags[i].click(); + let top = tags[i].bounds().top; + if (top < 0) { + top = tags[i].bounds().top + tags[i].bounds().height() - 10 * Math.random(); + } else { + top += 20 * Math.random(); + } + + Gesture.click(tags[i].bounds().left + 20 * Math.random(), top); + tCommon.sleep(3000 + 1000 * Math.random()); + + let commentDetailHead = UiSelector().className('com.lynx.tasm.ui.image.FlattenUIImage').clickable(false).filter(v => { + return v && v.bounds() && v.bounds().left < Device.width() * 0.3 && v.bounds().height() == v.bounds().width(); + }).findOne(); + + if (!commentDetailHead) { + Log.log('没有头像,返回'); + tCommon.back(); + continue; + } + + tCommon.click(commentDetailHead); + tCommon.sleep(3000 + 1000 * Math.random()); + if (UiSelector().textContains('用户评价').descContains('用户评价').isVisibleToUser(true).findOne()) { + Log.log('点击失效'); + continue; + } + + intoUser = UiSelector().textContains('评价数').descContains('评价数').isVisibleToUser(true).findOne() ? true : false; + if (!intoUser) { + tCommon.back(); + Log.log('没有进入到主页,可能是设置隐私了-1'); + continue; + } + + let currentCommentRate = Math.random() * 100; + let currentPrivateRate = Math.random() * 100; + let currentZanRate = Math.random() * 100; + + if (zanRate >= currentZanRate || commentRate >= currentCommentRate || privateRate >= currentPrivateRate) { + Log.log('进入主页留痕了'); + let header = UiSelector().className('com.lynx.tasm.ui.image.FlattenUIImage').clickable(false).filter(v => { + return v && v.bounds() && v.bounds().left > Device.width() * 0.6 && v.bounds().height() == v.bounds().width(); + }).findOne(); + + Log.log('头像', header); + if (!header) { + tCommon.back(); + Log.log('没有看见头,返回'); + continue; + } + + tCommon.click(header); + tCommon.sleep(3000 + 1000 * Math.random()); + + let douyin = DyUser.getDouyin(); + if (rpContainers.indexOf(douyin) != -1) { + tCommon.back(2); + tCommon.sleep(1000); + Log.log('重复'); + continue; + } + + rpContainers.push(douyin); + + if (!DyVideo.intoUserVideo()) { + tCommon.back(2); + tCommon.sleep(1000); + Log.log('没有进入视频,返回3次') + continue; + } + + let opC = 0; + tCommon.sleep(5000 + 5000 * Math.random()); + if (zanRate >= currentZanRate) { + DyVideo.clickZan(); + tCommon.sleep(1000 + Math.random() * 3000); + opC = 1; + } + + if (commentRate >= currentCommentRate) { + DyComment.commentMsg(this.getMsg(0, DyVideo.getContent()).msg); + tCommon.sleep(1000 + Math.random() * 3000); + opC = 1; + } + + tCommon.back();//返回到用户界面 + + if (privateRate >= currentPrivateRate) { + tCommon.sleep(500); + Log.log('滑动'); + tCommon.swipe(1, 0.8); + //Gesture.swipe(200, Device.height() * 0.3, 200, Device.height() * 0.7, 100); + tCommon.sleep(500); + DyUser.privateMsg(this.getMsg(1, DyUser.getNickname()).msg); + opC = 1; + } + + opCount -= opC; + if (opCount <= 0) { + Log.log('opCount', opCount); + return true; + } + + tCommon.sleep(waitSecond * 1000); + Log.log('操作完了,返回') + tCommon.back(3);//用户评论主页,再返回一次,才是列表页 + } + + //用户评论页,回到列表页 + if (intoUser) { + Log.log('进入了用户-'); + let isTrueIntoUserTag = UiSelector().textContains('评价数').descContains('评价数').isVisibleToUser(true).findOne(); + if (isTrueIntoUserTag) { + tCommon.back(2); + tCommon.sleep(1000); + } + } + } + + Log.log('下一页评论'); + let l = 300 * Math.random(); + let rd = Device.height() * 0.1; + Gesture.swipe(l + 200, Device.height() * 0.6 + rd, l + 200, Device.height() * (0.2 + 0.1 * Math.random()), 200); + tCommon.sleep(1500 + 500 * Math.random()); + } catch (e) { + Log.log('报错了', e); + let runTimes = 5; + let resolve = false; + do { + let bottomTag = UiSelector().textContains('用户评价').descContains('用户评价').isVisibleToUser(true).findOne();//底部栏 + if (bottomTag) { + resolve = true; + break; + } + + if (runTimes-- > 0) { + tCommon.back(); + tCommon.sleep(500); + Log.log('尝试返回'); + continue; + } + break; + } while (true); + + if (!resolve) { + throw new Error('5次没有解决异常'); + } + } + } + }, +} + +tCommon.openApp(); +//开启线程 自动关闭弹窗 +Engines.executeScript("unit/dialogClose.js"); + +while (true) { + task.log(); + try { + let r = task.run(); + if (r == -1 || r == false) { + break;//异常的情况 + } + + if (r) { + FloatDialogs.show('提示', '完成'); + break; + } + + tCommon.sleep(3000); + } catch (e) { + Log.log(e); + tCommon.closeAlert(1); + tCommon.backHome(10); + } +} diff --git a/tasks/task_dy_toker.js b/tasks/task_dy_toker.js index 54d2398..80dfc0e 100644 --- a/tasks/task_dy_toker.js +++ b/tasks/task_dy_toker.js @@ -1,7 +1,8 @@ -import { Common as tCommon } from "app/dy/Common"; -import { iDy as dy } from 'app/iDy'; -import { config } from 'config/config'; -import { machine } from "common/machine"; +let tCommon = require("app/dy/Common"); +let dy = require('app/iDy'); +let config = require('config/config'); +let machine = require("common/machine"); +// let baiduWenxin = require("service/baiduWenxin"); let task = { me: {},//我的抖音号和昵称 @@ -25,30 +26,41 @@ let task = { }, } -tCommon.openApp(); +// let a = System.getDataFrom('setting_baidu_wenxin_role', 'role', 'content'); +// Log.log(a); +// Log.log(baiduWenxin.testChat('你好啊')); + //开启线程 自动关闭弹窗 Engines.executeScript("unit/dialogClose.js"); while (true) { task.log(); try { + tCommon.openApp();//兜底,防止跑到外面去了 let code = task.run(); if (code === 101) { // tCommon.closeApp(); tCommon.showToast('不在任务时间,休息一会儿'); + Log.log('不在任务时间,休眠一会儿'); + tCommon.backApp(); + //App.notifySuccess('通知', '即将返回到App'); let hours = machine.getTokerData(0).toker_run_hour; - console.log(hours, (new Date()).getHours(), hours.includes("0")); + console.log(Array.isArray(hours), hours, (new Date()).getHours(), hours.includes("0")); while (true) { - tCommon.sleep(1 * 60 * 1000); + tCommon.sleep(1 * 60 * 1000 / 6); if (hours.includes((new Date()).getHours().toString())) { break; } } + Log.log("内存清理"); + System.cleanUp(); + throw new Error('重新进入'); } - tCommon.sleep(3000); } catch (e) { - Log.log(e.stack); + Log.log(e); + System.cleanUp(); + tCommon.closeAlert(1); tCommon.backHome(); } } diff --git a/tasks/task_dy_toker_accurate_placement.js b/tasks/task_dy_toker_accurate_placement.js index c7fec93..1de108f 100644 --- a/tasks/task_dy_toker_accurate_placement.js +++ b/tasks/task_dy_toker_accurate_placement.js @@ -1,12 +1,12 @@ -import {Common as tCommon} from "app/dy/Common"; -import {Index as DyIndex} from "app/dy/Index"; -import {Search as DySearch} from "app/dy/Search"; -import {User as DyUser} from "app/dy/User"; -import {Video as DyVideo} from "app/dy/Video"; -import {Comment as DyComment} from "app/dy/Comment"; +let tCommon = require("app/dy/Common"); +let DyIndex = require("app/dy/Index"); +let DySearch = require("app/dy/Search"); +let DyUser = require("app/dy/User"); +let DyVideo = require("app/dy/Video"); +let DyComment = require("app/dy/Comment"); let Http = require('unit/mHttp'); -import {storage} from "common/storage"; -import {machine} from "common/machine"; +let storage = require("common/storage"); +let machine = require("common/machine"); // let dy = require('app/iDy'); // let config = require('config/config'); diff --git a/tasks/task_dy_toker_city.js b/tasks/task_dy_toker_city.js index 58aad8e..5731cdc 100644 --- a/tasks/task_dy_toker_city.js +++ b/tasks/task_dy_toker_city.js @@ -1,7 +1,7 @@ -import { Common as tCommon } from "app/dy/Common"; -import { iDy as dy } from 'app/iDy'; -import { config } from 'config/config'; -import { machine } from "common/machine"; +let tCommon = require("app/dy/Common"); +let dy = require('app/iDy'); +let config = require('config/config'); +let machine = require("common/machine"); let task = { me: {},//我的抖音号和昵称 @@ -32,23 +32,31 @@ Engines.executeScript("unit/dialogClose.js"); while (true) { task.log(); try { + tCommon.openApp(); let code = task.run(); if (code === 101) { // tCommon.closeApp(); tCommon.showToast('不在任务时间,休息一会儿'); + Log.log('不在任务时间,休眠一会儿'); let hours = machine.getTokerData(1).toker_run_hour; console.log(hours, (new Date()).getHours(), hours.includes("0")); + tCommon.backApp(); while (true) { tCommon.sleep(1 * 60 * 1000); if (hours.includes((new Date()).getHours().toString())) { break; } } + Log.log("内存清理"); + System.cleanUp(); + throw new Error('重新进入'); } tCommon.sleep(3000); } catch (e) { - Log.log(e.stack); + Log.log(e); + System.cleanUp(); + tCommon.closeAlert(1); tCommon.backHome(); } } diff --git a/tasks/task_dy_toker_comment.js b/tasks/task_dy_toker_comment.js index af33e97..9a99df6 100644 --- a/tasks/task_dy_toker_comment.js +++ b/tasks/task_dy_toker_comment.js @@ -1,12 +1,13 @@ -import { Common as tCommon } from "app/dy/Common"; -import { Index as DyIndex } from "app/dy/Index"; -import { Search as DySearch } from "app/dy/Search"; -import { User as DyUser } from "app/dy/User"; -import { Video as DyVideo } from "app/dy/Video"; -import { Comment as DyComment } from "app/dy/Comment"; -import { storage } from "common/storage"; -import { machine } from "common/machine"; -import { baiduWenxin } from "service/baiduWenxin"; +let tCommon = require("app/dy/Common"); +let DyIndex = require("app/dy/Index"); +let DySearch = require("app/dy/Search"); +let DyUser = require("app/dy/User"); +let DyVideo = require("app/dy/Video"); +let DyComment = require("app/dy/Comment"); +let storage = require("common/storage"); +let machine = require("common/machine"); +let baiduWenxin = require("service/baiduWenxin"); +let statistics = require("common/statistics"); let task = { index: -1, @@ -17,7 +18,7 @@ let task = { }, getMsg(type, title, age, gender) { - if (storage.get('setting_baidu_wenxin_switch', 'bool')) { + if (storage.get('setting_baidu_wenxin_switch', 'bool')) { return { msg: type === 1 ? baiduWenxin.getChat(title, age, gender) : baiduWenxin.getComment(title) }; } return machine.getMsg(type) || false;//永远不会结束 @@ -42,39 +43,53 @@ let task = { testTask(input, kw, sleepSecond) { //首先进入页面 let intoUserFansList = input.indexOf('+') === 0; - if (intoUserFansList) { - input = input.substring(1); - DyIndex.intoMyPage(); - DyUser.intoFocusList(); - tCommon.sleep(3000); + let hasRemark = tCommon.getRemark(input); + this.index++; + let douyin; + if (!hasRemark) { + if (intoUserFansList) { + input = input.substring(1); + DyIndex.intoMyPage(); + DyUser.intoFocusList(); + tCommon.sleep(3000); + } else { + DyIndex.intoSearchPage(); + } + input = tCommon.splitKeyword(input); + douyin = input[this.index]; } else { - DyIndex.intoSearchPage(); + input = input.substring(1); + input = tCommon.splitKeyword(input); + douyin = input[this.index]; + App.gotoIntent('snssdk1128://user/profile/' + douyin); + tCommon.sleep(5000 + 2000 * Math.random()); + DyVideo.intoUserVideo(); } - input = tCommon.splitKeyword(input); kw = tCommon.splitKeyword(kw); Log.log('账号:', input); Log.log('关键词:', kw); - this.index++; + if (this.index >= input.length) { this.index = 0; } - let douyin = input[this.index]; let res; - if (intoUserFansList) { - res = DyUser.focusListSearch(douyin); - } else { - res = DySearch.intoUserVideoPage(input[this.index], 1); - } + if (!hasRemark) { + if (intoUserFansList) { + res = DyUser.focusListSearch(douyin); + } else { + res = DySearch.intoUserVideoPage(input[this.index], 1); + } - if (!res) { - System.toast('找不到用户账号:' + input); - return 'exit'; - } + if (!res) { + System.toast('找不到用户账号:' + input); + return 'exit'; + } - if (intoUserFansList) { - DyVideo.intoUserVideo(); + if (intoUserFansList) { + DyVideo.intoUserVideo(); + } } //获取最新的前三视频 @@ -89,6 +104,9 @@ let task = { continue; } + statistics.viewVideo(); + statistics.viewTargetVideo(); + DyVideo.openComment(commentCount); tCommon.sleep(2000 + 1000 * Math.random()); let rp = 0; @@ -188,9 +206,9 @@ let task = { } if (intoUserFansList) { - tCommon.back(4, 1500); + tCommon.back(5, 1500); } else { - tCommon.back(4, 1500); + tCommon.back(5, 1500); } tCommon.backApp(); @@ -229,18 +247,13 @@ if (sleepSecond <= 0) { System.exit(); } -if (!sleepSecond) { - System.toast('你取消了任务'); - System.exit(); -} - tCommon.openApp(); +//开启线程 自动关闭弹窗 +Engines.executeScript("unit/dialogClose.js"); while (true) { task.log(); try { - //开启线程 自动关闭弹窗 - Engines.executeScript("unit/dialogClose.js"); let r = task.run(input, kw, sleepSecond); if (r === 'exit') { if (thr) { @@ -256,7 +269,8 @@ while (true) { tCommon.sleep(3000); } catch (e) { - Log.log(e.stack); + Log.log(e); + tCommon.closeAlert(1); tCommon.backHome(); } } \ No newline at end of file diff --git a/tasks/task_dy_toker_dominating_screen.js b/tasks/task_dy_toker_dominating_screen.js index 3ee68d5..29e1425 100644 --- a/tasks/task_dy_toker_dominating_screen.js +++ b/tasks/task_dy_toker_dominating_screen.js @@ -1,9 +1,9 @@ -import {Common as tCommon} from "app/dy/Common"; -// import { Index as DyIndex } from 'app/dy/Index.js'; -// import { Search as DySearch } from 'app/dy/Search.js'; +let tCommon = require("app/dy/Common"); +// let DyIndex = require('app/dy/Index.js'); +// let DySearch = require('app/dy/Search.js'); // const DyUser = require('app/dy/User.js'); -// import { Video as DyVideo } from 'app/dy/Video.js'; -// import { Comment as DyComment } from 'app/dy/Comment.js'; +// let DyVideo = require('app/dy/Video.js'); +// let DyComment = require('app/dy/Comment.js'); let dy = require('app/iDy'); let config = require('config/config'); diff --git a/tasks/task_dy_toker_fans.js b/tasks/task_dy_toker_fans.js index a80adbe..4b79ef9 100644 --- a/tasks/task_dy_toker_fans.js +++ b/tasks/task_dy_toker_fans.js @@ -1,13 +1,12 @@ -import { Common as tCommon } from 'app/dy/Common.js'; -import { Index as DyIndex } from 'app/dy/Index.js'; -import { Search as DySearch } from 'app/dy/Search.js'; -import { User as DyUser } from 'app/dy/User.js'; -import { Video as DyVideo } from 'app/dy/Video.js'; -import { storage } from 'common/storage.js'; -import { machine } from 'common/machine.js'; -import { Comment as DyComment } from 'app/dy/Comment.js'; -import { mHttp as Http } from 'unit/mHttp.js'; -import { baiduWenxin } from 'service/baiduWenxin.js'; +let tCommon = require('app/dy/Common.js'); +let DyIndex = require('app/dy/Index.js'); +let DySearch = require('app/dy/Search.js'); +let DyUser = require('app/dy/User.js'); +let DyVideo = require('app/dy/Video.js'); +let storage = require('common/storage.js'); +let machine = require('common/machine.js'); +let DyComment = require('app/dy/Comment.js'); +let baiduWenxin = require('service/baiduWenxin.js'); let task = { contents: [], @@ -25,7 +24,7 @@ let task = { //type 0 评论,1私信 getMsg(type, title, age, gender) { - if (storage.get('setting_baidu_wenxin_switch', 'bool')) { + if (storage.get('setting_baidu_wenxin_switch', 'bool')) { return { msg: type === 1 ? baiduWenxin.getChat(title, age, gender) : baiduWenxin.getComment(title) }; } @@ -48,15 +47,21 @@ let task = { })); DyIndex.intoHome(); - if (settingData.account.indexOf('+') === 0) { - DyIndex.intoMyPage(); + if (tCommon.getRemark(settingData.account)) { + settingData.account = settingData.account.substring(1); + App.gotoIntent('snssdk1128://user/profile/' + settingData.account); + tCommon.sleep(5000 + 2000 * Math.random()); } else { - DyIndex.intoSearchPage(); - } - - let res = DySearch.homeIntoSearchUser(settingData.account); - if (res) { - return res; + if (settingData.account.indexOf('+') === 0) { + DyIndex.intoMyPage(); + } else { + DyIndex.intoSearchPage(); + } + + let res = DySearch.homeIntoSearchUser(settingData.account); + if (res) { + return res; + } } return DyUser.focusUserList(1, this.getMsg, DyVideo, DyComment, machine, settingData, this.contents, this.me.nickname); @@ -77,14 +82,14 @@ if (!settingData.account) { } tCommon.openApp(); +//开启线程 自动关闭弹窗 +Engines.executeScript("unit/dialogClose.js"); let thr = undefined; while (true) { Log.log('日志开始'); task.log(); try { - //开启线程 自动关闭弹窗 - Engines.executeScript("unit/dialogClose.js"); let res = task.run(settingData); if (res) { tCommon.sleep(3000); @@ -99,7 +104,8 @@ while (true) { tCommon.sleep(3000); } catch (e) { - Log.log(e.stack); + Log.log(e); + tCommon.closeAlert(1); tCommon.backHome(); } } diff --git a/tasks/task_dy_toker_focus.js b/tasks/task_dy_toker_focus.js index e9faf4b..f7d1912 100644 --- a/tasks/task_dy_toker_focus.js +++ b/tasks/task_dy_toker_focus.js @@ -1,12 +1,12 @@ -import { Common as tCommon } from 'app/dy/Common.js'; -import { Index as DyIndex } from 'app/dy/Index.js'; -import { Search as DySearch } from 'app/dy/Search.js'; -import { User as DyUser } from 'app/dy/User.js'; -import { Video as DyVideo } from 'app/dy/Video.js'; -import { storage } from 'common/storage.js'; -import { machine } from 'common/machine.js'; -import { Comment as DyComment } from 'app/dy/Comment.js'; -import { baiduWenxin } from 'service/baiduWenxin.js'; +let tCommon = require('app/dy/Common.js'); +let DyIndex = require('app/dy/Index.js'); +let DySearch = require('app/dy/Search.js'); +let DyUser = require('app/dy/User.js'); +let DyVideo = require('app/dy/Video.js'); +let storage = require('common/storage.js'); +let machine = require('common/machine.js'); +let DyComment = require('app/dy/Comment.js'); +let baiduWenxin = require('service/baiduWenxin.js'); let task = { contents: [], @@ -23,7 +23,7 @@ let task = { //type 0 评论,1私信 getMsg(type, title, age, gender) { - if (storage.get('setting_baidu_wenxin_switch', 'bool')) { + if (storage.get('setting_baidu_wenxin_switch', 'bool')) { return { msg: type === 1 ? baiduWenxin.getChat(title, age, gender) : baiduWenxin.getComment(title) }; } return machine.getMsg(type) || false;//永远不会结束 @@ -32,14 +32,21 @@ let task = { testTask(settingData) { //首先进入点赞页面 DyIndex.intoHome(); - if (settingData.account.indexOf('+') === 0) { - DyIndex.intoMyPage(); + + if (tCommon.getRemark(settingData.account)) { + settingData.account = settingData.account.substring(1); + App.gotoIntent('snssdk1128://user/profile/' + settingData.account); + tCommon.sleep(5000 + 2000 * Math.random()); } else { - DyIndex.intoSearchPage(); - } - let res = DySearch.homeIntoSearchUser(settingData.account); - if (res) { - return res; + if (settingData.account.indexOf('+') === 0) { + DyIndex.intoMyPage(); + } else { + DyIndex.intoSearchPage(); + } + let res = DySearch.homeIntoSearchUser(settingData.account); + if (res) { + return res; + } } return DyUser.focusUserList(0, this.getMsg, DyVideo, DyComment, machine, settingData, this.contents); @@ -59,12 +66,12 @@ if (!settingData.account) { } tCommon.openApp(); +//开启线程 自动关闭弹窗 +Engines.executeScript("unit/dialogClose.js"); while (true) { task.log(); try { - //开启线程 自动关闭弹窗 - Engines.executeScript("unit/dialogClose.js"); let res = task.run(settingData); if (res) { tCommon.sleep(3000); @@ -78,7 +85,8 @@ while (true) { tCommon.sleep(3000); } catch (e) { - Log.log(e.stack); + Log.log(e); + tCommon.closeAlert(1); tCommon.backHome(); } } diff --git a/tasks/task_dy_toker_invite.js b/tasks/task_dy_toker_invite.js new file mode 100644 index 0000000..2b37e81 --- /dev/null +++ b/tasks/task_dy_toker_invite.js @@ -0,0 +1,90 @@ +let tCommon = require("app/dy/Common"); +const DyUser = require('app/dy/User.js'); +let storage = require("common/storage"); +let machine = require("common/machine"); + +let task = { + index: 0, + run(accounts, second) { + return this.testTask(accounts, second); + }, + + log() { + let d = new Date(); + let file = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(); + let allFile = "log/log-dy-toker-uid-" + file + ".txt"; + Log.setFile(allFile); + }, + + //type 0 评论,1私信 + getMsg(type, title, age, gender) { + if (storage.get('setting_baidu_wenxin_switch', 'bool')) { + return { msg: type === 1 ? baiduWenxin.getChat(title, age, gender) : baiduWenxin.getComment(title) }; + } + + //return { msg: ['厉害', '六六六', '666', '拍得很好', '不错哦', '关注你很久了', '学习了', '景色不错', '真的很不错', '太厉害了', '深表认同', '来过了', '茫茫人海遇见你', '太不容易了', '很好', '懂了', '我看到了', '可以的', '一起加油', '真好', '我的个乖乖'][Math.round(Math.random() * 20)] }; + return machine.getMsg(type) || false;//永远不会结束 + }, + + testTask(accounts, second) { + //首先进入点赞页面 + Log.log('账号:', accounts, second); + for (let i in accounts) { + if (i < this.index) { + continue; + } + + try { + //进入用户主页,私信,关注 + Log.log('开始进入主页', 'snssdk1128://user/profile/' + accounts[i]); + App.gotoIntent('snssdk1128://user/profile/' + accounts[i]); + tCommon.sleep(5000 + 3000 * Math.random()); + Log.log('发送卡片'); + DyUser.privateMsgCard(1); + tCommon.sleep(500 + 1000 * Math.random()); + } catch (e) { + Log.log("报错捕获:", e); + tCommon.sleep(500 + 1000 * Math.random()); + } + + this.index++; + let s = (second / 2 + second / 2 * Math.random()); + Log.log('休眠' + s + '秒') + tCommon.sleep(s * 1000); + } + + if (this.index >= accounts.length) { + return true; + } + }, +} + +let accounts = storage.get('task_dy_toker_invite_account'); +Log.log('accounts', accounts); +if (!accounts) { + tCommon.showToast('你取消了执行'); + //console.hide();(); + System.exit(); +} +accounts = accounts.split("\n"); + +//开启线程 自动关闭弹窗 +Engines.executeScript("unit/dialogClose.js"); +tCommon.openApp();//兜底,防止跑到外面去了 + +task.log(); +try { + //开启线程 自动关闭弹窗 + if (task.run(accounts, storage.get('task_dy_toker_invite_interval', 'int'))) { + FloatDialogs.show('提示', '执行完成'); + } + tCommon.sleep(3000); +} catch (e) { + Log.log(e); + try { + tCommon.showToast("遇到错误,即将自动重启"); + tCommon.sleep(3000); + } catch (e) { + Log.log('启停bug', e); + } +} diff --git a/tasks/task_dy_toker_live.js b/tasks/task_dy_toker_live.js index 9cbbed2..e88de0e 100644 --- a/tasks/task_dy_toker_live.js +++ b/tasks/task_dy_toker_live.js @@ -1,13 +1,13 @@ -import { Common as tCommon } from "app/dy/Common"; -import { Index as DyIndex } from "app/dy/Index"; -import { Search as DySearch } from "app/dy/Search"; -import { Comment as DyComment } from "app/dy/Comment"; -import { User as DyUser } from "app/dy/User"; -import { Video as DyVideo } from "app/dy/Video"; -import { storage } from "common/storage"; -import { machine } from "common/machine"; -import { Live as DyLive } from "app/dy/Live"; -import { baiduWenxin } from "service/baiduWenxin"; +let tCommon = require("app/dy/Common"); +let DyIndex = require("app/dy/Index"); +let DySearch = require("app/dy/Search"); +let DyComment = require("app/dy/Comment"); +let DyUser = require("app/dy/User"); +let DyVideo = require("app/dy/Video"); +let storage = require("common/storage"); +let machine = require("common/machine"); +let DyLive = require("app/dy/Live"); +let baiduWenxin = require("service/baiduWenxin"); let task = { index: -1, @@ -18,7 +18,7 @@ let task = { }, getMsg(type, title, age, gender) { - if (storage.get('setting_baidu_wenxin_switch', 'bool')) { + if (storage.get('setting_baidu_wenxin_switch', 'bool')) { return { msg: type === 1 ? baiduWenxin.getChat(title, age, gender) : baiduWenxin.getComment(title) }; } return machine.getMsg(type) || false;//永远不会结束 @@ -41,20 +41,30 @@ let task = { }, testTask(douyin, preIndex) { - //首先进入页面 - DyIndex.intoSearchPage(); Log.log('账号:', douyin); Log.log('preIndex:', preIndex); - let res = DySearch.intoUserLiveRoom(douyin, 1); - if (!res) { - System.toast('找不到用户账号:' + douyin); - this.intoErrorCount++; - Threads.shutDownAll(); - tCommon.sleep(500); - if (this.intoErrorCount >= 3) { - return true;//完成了 + if (!tCommon.getRemark(douyin)) { + //首先进入页面 + DyIndex.intoSearchPage(); + let res = DySearch.intoUserLiveRoom(douyin, 1); + if (!res) { + System.toast('找不到用户账号:' + douyin); + this.intoErrorCount++; + Threads.shutDownAll(); + tCommon.sleep(500); + if (this.intoErrorCount >= 3) { + return true;//完成了 + } + throw new Error('找不到用户账号:' + douyin); + } + } else { + douyin = douyin.substring(1); + App.gotoIntent('snssdk1128://user/profile/' + douyin); + tCommon.sleep(5000 + 2000 * Math.random()); + if (!DyUser.intoLive()) { + return true; } - throw new Error('找不到用户账号:' + douyin); + tCommon.sleep(5000 + 2000 * Math.random()); } this.intoErrorCount = 0; @@ -62,21 +72,24 @@ let task = { let rp = 0; while (true) { DyLive.openUserList(); - let onlineTag = new UiSelector().descContains('在线观众').textContains('在线观众').filter((v) => { + let onlineTag = UiSelector().descContains('在线观众').textContains('在线观众').filter((v) => { return v && v.bounds() && v.bounds().top && v.bounds().width() && v.bounds().height() && v.bounds().top + v.bounds().height() < Device.height(); - }).findOne(2000); + }).findOneBy(2000); if (!onlineTag) { throw new Error('找不到“在线观众”tag'); } - let lastUser = undefined; + let addr = undefined; + let hiddenI = 0; + let ignoreIndex = 0; while (true) { let users = DyLive.getUsers(); - if (JSON.stringify(users) === lastUser) { - rp++; - } else { - rp = 0; + if (users.length == 0) { + tCommon.back(); + tCommon.sleep(1000); + Log.log('无数据'); + break; } if (rp >= 3) { @@ -86,51 +99,80 @@ let task = { break; } - lastUser = JSON.stringify(users); for (let k in users) { - if (this.nicknames.includes(users[k].title)) { + Log.log('index', ignoreIndex); + if (ignoreIndex++ <= preIndex) { continue; } - Log.log('index', users[k].index * 1); - if (users[k].index * 1 <= preIndex) { + if (!tCommon.clickRange(users[k].tag, onlineTag.bounds().top, Device.height() - users[k].tag.bounds().height())) { + Log.log('边界超出'); continue; } - let tmp = /第\d+名/.exec(users[k].title); - let title = users[k].title; - if (tmp && tmp[0]) { - title = title.replace(tmp[0], ''); + tCommon.sleep(1000 + 2000 * Math.random()); + let nickname = DyLive.getNickname(); + if (nickname == '') { + Log.log('没有点击成功'); + if (hiddenI++ >= 3) { + break; + } + continue; } + hiddenI = 0; - if (title.indexOf('***') !== -1) { - return -1; + if (k == 0) { + if (nickname === addr) { + rp++; + } else { + rp = 0; + } + addr = nickname; } - if (machine.get('task_dy_toker_live_' + douyin + '_' + title, 'bool')) { - Log.log('重复'); + if (this.nicknames.includes(nickname)) { + tCommon.back(); + Log.log('重复-'); continue; } - if (users[k].tag.bounds().top <= onlineTag.bounds().top + onlineTag.bounds().height()) { - Log.log('边界超出'); + if (machine.get('task_dy_toker_live_' + douyin + '_' + nickname, 'bool')) { + Log.log('重复'); + tCommon.back(); continue; } - Log.log('开始操作用户:', title, machine.get('task_dy_toker_live_' + douyin + '_' + title, 'bool')); - this.nicknames.push(users[k].title); - machine.set('task_dy_toker_live_' + douyin + '_' + title, true); - Log.log('设置后:' + machine.get('task_dy_toker_live_' + douyin + '_' + title, 'bool')); + Log.log('开始操作用户:', nickname, machine.get('task_dy_toker_live_' + douyin + '_' + nickname, 'bool')); + this.nicknames.push(nickname); + machine.set('task_dy_toker_live_' + douyin + '_' + nickname, true); + Log.log('设置后:' + machine.get('task_dy_toker_live_' + douyin + '_' + nickname, 'bool')); Log.log('进入粉丝列表'); - DyLive.intoFansPage(users[k]); + DyLive.intoFansPage(); if (DyUser.isPrivate()) { Log.log('私密账号'); tCommon.back(1, 1000); continue; } + try { + if (machine.get('task_dy_toker_live_focus_switch', 'bool')) { + DyUser.focus(); + } + + if (machine.get('task_dy_toker_live_private_switch', 'bool')) { + let msg = this.getMsg(1, DyUser.getNickname(), DyUser.getAge(), DyUser.getGender()); + if (msg) { + DyUser.privateMsg(msg.msg); + } + } + + } catch (e) { + Log.log(e); + } + //开始操作评论 - if (DyVideo.intoUserVideo()) { + let comment_user_video_rate = machine.get('task_dy_toker_live_comment_user_video_rate', 'int'); + if (comment_user_video_rate > Math.random() * 100 && DyVideo.intoUserVideo()) { Log.log('有视频,直接操作视频引流'); DyVideo.clickZan(); tCommon.sleep(1000); @@ -144,22 +186,17 @@ let task = { } else { tCommon.back();//从视频页面到用户页面 } - } else { - Log.log('无视频,直接操作关注和私信引流'); - try { - DyUser.focus(); - let msg = this.getMsg(1, DyUser.getNickname(), DyUser.getAge(), DyUser.getGender()); - if (msg) { - DyUser.privateMsg(msg.msg); - } - } catch (e) { - Log.log(e); - } } + tCommon.sleep(1000); Log.log('back 1'); tCommon.back(); - tCommon.sleep(2000); + System.toast('操作间隔:' + machine.get('task_dy_toker_live_focus_rate', 'int')); + tCommon.sleep(machine.get('task_dy_toker_live_focus_rate', 'int') * 1000); + } + + if (hiddenI++ >= 3) { + break; } Log.log('下一页'); DyLive.swipeFansList(); @@ -185,13 +222,14 @@ if (!preIndex) { } tCommon.openApp(); +//开启线程 自动关闭弹窗 +Engines.executeScript("unit/dialogClose.js"); + while (true) { task.log(); try { - //开启线程 自动关闭弹窗 - Engines.executeScript("unit/dialogClose.js"); let res = task.run(input, preIndex); - if (res) { + if (res == true) { tCommon.sleep(5000); FloatDialogs.show('提示', '任务完成了'); break; @@ -205,13 +243,8 @@ while (true) { } tCommon.sleep(3000); } catch (e) { - Log.log(e.stack); + Log.log(e); + tCommon.closeAlert(1); tCommon.backHome(); } } - -try { - Engines.closeAll(true); -} catch (e) { - Log.log('停止脚本'); -} diff --git a/tasks/task_dy_toker_test.js b/tasks/task_dy_toker_test.js index 024b69a..9f03b7e 100644 --- a/tasks/task_dy_toker_test.js +++ b/tasks/task_dy_toker_test.js @@ -1,10 +1,10 @@ const tDyCommon = require('app/dy/Common.js'); -import { Index as DyIndex } from 'app/dy/Index.js'; +let DyIndex = require('app/dy/Index.js'); const DyUser = require('app/dy/User.js'); -import { Video as DyVideo } from 'app/dy/Video.js'; -import { Comment as DyComment } from 'app/dy/Comment.js'; -import {storage} from "common/storage"; -import {baiduWenxin} from "service/baiduWenxin"; +let DyVideo = require('app/dy/Video.js'); +let DyComment = require('app/dy/Comment.js'); +let storage = require("common/storage"); +let baiduWenxin = require("service/baiduWenxin"); let task = { me: {},//我的抖音号和昵称 diff --git a/tasks/task_dy_toker_uid.js b/tasks/task_dy_toker_uid.js new file mode 100644 index 0000000..73de3f2 --- /dev/null +++ b/tasks/task_dy_toker_uid.js @@ -0,0 +1,106 @@ +let tCommon = require("app/dy/Common"); +const DyUser = require('app/dy/User.js'); +let storage = require("common/storage"); +let machine = require("common/machine"); + +let task = { + index: 0, + run(accounts, second, ops) { + return this.testTask(accounts, second, ops); + }, + + log() { + let d = new Date(); + let file = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(); + let allFile = "log/log-dy-toker-uid-" + file + ".txt"; + Log.setFile(allFile); + }, + + //type 0 评论,1私信 + getMsg(type, title, age, gender) { + if (storage.get('setting_baidu_wenxin_switch', 'bool')) { + return { msg: type === 1 ? baiduWenxin.getChat(title, age, gender) : baiduWenxin.getComment(title) }; + } + + //return { msg: ['厉害', '六六六', '666', '拍得很好', '不错哦', '关注你很久了', '学习了', '景色不错', '真的很不错', '太厉害了', '深表认同', '来过了', '茫茫人海遇见你', '太不容易了', '很好', '懂了', '我看到了', '可以的', '一起加油', '真好', '我的个乖乖'][Math.round(Math.random() * 20)] }; + return machine.getMsg(type) || false;//永远不会结束 + }, + + testTask(accounts, second, ops) { + //首先进入点赞页面 + Log.log('账号:', accounts, ops); + for (let i in accounts) { + if (i < this.index) { + continue; + } + + try { + //进入用户主页,私信,关注 + App.gotoIntent('snssdk1128://user/profile/' + accounts[i]); + tCommon.sleep(5000 + 3000 * Math.random()); + if (ops.includes("1")) { + Log.log('私信'); + DyUser.privateMsg(this.getMsg(1).msg); + tCommon.sleep(500 + 1000 * Math.random()); + } + + if (ops.includes("0")) { + Log.log('关注'); + DyUser.focus(); + } + } catch (e) { + Log.log(e); + } + + this.index++; + let s = (second / 2 + second / 2 * Math.random()); + Log.log('休眠' + s + '秒') + tCommon.sleep(s * 1000); + tCommon.backHomeOnly(); + tCommon.sleep(2000 * Math.random() + 500); + } + + if (this.index >= accounts.length) { + return true; + } + }, +} + +let accounts = storage.get('task_dy_toker_uid_account'); +Log.log('accounts', accounts); +if (!accounts) { + tCommon.showToast('你取消了执行'); + //console.hide();(); + System.exit(); +} +accounts = accounts.split("\n"); + +//开启线程 自动关闭弹窗 +Engines.executeScript("unit/dialogClose.js"); +tCommon.openApp();//兜底,防止跑到外面去了 + +while (true) { + task.log(); + try { + //开启线程 自动关闭弹窗 + if (task.run(accounts, storage.get('task_dy_toker_uid_interval', 'int'), storage.getArray('task_dy_toker_uid_op'))) { + FloatDialogs.show('提示', '执行完成'); + break; + } + tCommon.sleep(3000); + } catch (e) { + Log.log(e); + try { + tCommon.showToast("遇到错误,即将自动重启"); + tCommon.sleep(3000); + } catch (e) { + Log.log('启停bug', e); + } + } +} + +try { + Engines.closeAll(); +} catch (e) { + Log.log('停止脚本'); +} diff --git a/tasks/task_dy_toker_video.js b/tasks/task_dy_toker_video.js new file mode 100644 index 0000000..325cde1 --- /dev/null +++ b/tasks/task_dy_toker_video.js @@ -0,0 +1,209 @@ +let tCommon = require("app/dy/Common"); +let DyUser = require("app/dy/User"); +let DySearch = require("app/dy/Search"); +let DyVideo = require("app/dy/Video"); +let DyComment = require("app/dy/Comment"); +let storage = require("common/storage"); +let machine = require("common/machine"); +let baiduWenxin = require("service/baiduWenxin"); +let statistics = require("common/statistics"); + +let task = { + nicknames: [], + contents: [], + run(input, sleepSecond) { + return this.testTask(input, sleepSecond); + }, + + getMsg(type, title, age, gender) { + if (storage.get('setting_baidu_wenxin_switch', 'bool')) { + return { msg: type === 1 ? baiduWenxin.getChat(title, age, gender) : baiduWenxin.getComment(title) }; + } + return machine.getMsg(type) || false;//永远不会结束 + }, + + log() { + let d = new Date(); + let file = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(); + let allFile = "log/log-comment-" + file + ".txt"; + Log.setFile(allFile); + }, + + includesKw(str, kw) { + for (let i in kw) { + if (str.includes(kw[i])) { + return true; + } + } + return false; + }, + + testTask(input, sleepSecond) { + //首先进入页面 + let commentKw = tCommon.splitKeyword(input); + Log.log('评论关键词:', commentKw); + DySearch.intoSearchVideo(); + + let rateCount = storage.get('task_dy_toker_live_video_zan_head_rate', 'int') + storage.get('task_dy_toker_live_video_focus_rate', 'int') + storage.get('task_dy_toker_live_video_zan_comment_rate', 'int'); + let zanHeadRate = 0; + let zanCommentRate = 0; + let focuRate = 0; + if (rateCount > 0) { + zanHeadRate = storage.get('task_dy_toker_live_video_zan_head_rate', 'int') / rateCount; + zanCommentRate = storage.get('task_dy_toker_live_video_zan_comment_rate', 'int') / rateCount; + focuRate = storage.get('task_dy_toker_live_video_focus_rate', 'int') / rateCount; + } + Log.log('总的点赞:', rateCount, zanCommentRate, zanHeadRate, focuRate); + + while (true) { + tCommon.sleep(4000 + Math.random() * 2000); + let title = DyVideo.getContent(); + let commentCount = DyVideo.getCommentCount(); + statistics.viewVideo(); + if (commentCount === 0 || this.contents.includes(title)) { + Log.log('下一个视频'); + DyVideo.next(); + continue; + } + + statistics.viewTargetVideo(); + DyVideo.openComment(commentCount); + tCommon.sleep(2000 + 1000 * Math.random()); + + let rp = 0; + let lastComment = []; + let firstComment = true; + while (true) { + let comments = DyComment.getList(); + if (comments.length == 0) { + tCommon.back(); + tCommon.sleep(1000); + Log.log('没有评论内容'); + break; + } + + if (lastComment.length == 2 && lastComment[0] == lastComment[1]) { + rp++; + } else { + rp = 0; + } + + lastComment.push(comments[0].nickname + ':' + comments[0].content); + if (lastComment.length > 2) { + lastComment.shift(); + } + + if (rp >= 3) { + tCommon.back(); + tCommon.sleep(1000); + Log.log('评论扫描完了'); + break; + } + + for (let k in comments) { + if (firstComment && Math.random() * 100 <= storage.get('task_dy_toker_live_video_comment_first_comment_rate', 'int')) { + DyComment.backMsg(comments[k], this.getMsg(0, comments[k].content).msg); + Log.log('首评'); + tCommon.sleep(1000); + comments = DyComment.getList(); + firstComment = false; + continue; + } + firstComment = false; + Log.log('comments[k]', comments[k]); + if (!comments[k]) { + continue; + } + + if (comments[k]['content'] == "" || !this.includesKw(comments[k]['content'], commentKw) || this.nicknames.includes(comments[k].nickname)) { + Log.log('数据:', comments[k]['content'], !this.includesKw(comments[k]['content'], commentKw), this.nicknames.includes(comments[k].nickname)); + continue; + } + + if (machine.get('task_dy_toker_video_' + comments[k].nickname, 'bool')) { + Log.log('重复'); + continue; + } + + Log.log('找到了关键词', comments[k]['content']); + let opRate = Math.random(); + if (opRate <= zanHeadRate) { + DyComment.intoUserPage(comments[k]); + if (DyUser.isPrivate()) { + tCommon.back(); + } else { + DyUser.zanHead(); + tCommon.sleep(1000 + 1000 * Math.random()); + tCommon.back(); + } + } else if (opRate <= zanHeadRate + zanCommentRate) { + try { + Log.log('点赞'); + if (!DyComment.isZan()) { + DyComment.clickZan(comments[k]); + tCommon.sleep(1000 + 1000 * Math.random()); + } + } catch (e) { + Log.log('异常处理:', e); + continue; + } + } else { + DyComment.intoUserPage(comments[k]); + if (DyUser.isPrivate()) { + tCommon.back(); + } else { + DyUser.focus(); + Log.log('关注'); + tCommon.sleep(1000 + 1000 * Math.random()); + tCommon.back(); + } + } + + this.nicknames.push(comments[k].nickname); + machine.set('task_dy_toker_video_' + comments[k].nickname, true); + tCommon.sleep(sleepSecond * 1000); + } + + Log.log('下一页评论'); + tCommon.swipeCommentListOp(); + tCommon.sleep(1500 + 500 * Math.random()); + } + Log.log('下一个视频'); + this.contents.push(title); + DyVideo.next(); + } + }, +} + +let input = machine.get('task_dy_toker_live_video_comment_keyword'); +Log.log("input内容:" + machine.get('task_dy_toker_live_video_comment_keyword', 'string')); +if (!input) { + System.toast('请输入评论关键词'); + System.exit(); +} + +//开启线程 自动关闭弹窗 +Engines.executeScript("unit/dialogClose.js"); + +while (true) { + task.log(); + try { + let r = task.run(input, storage.get('task_dy_toker_live_video_second', 'int')); + if (r === 'exit') { + if (thr) { + tCommon.sleep(3000); + FloatDialogs.show('找不到用户,停止执行'); + } + break; + } + + if (r) { + throw new Error('一个任务完成,重启,进入新的账号'); + } + + tCommon.sleep(3000); + } catch (e) { + Log.log(e); + tCommon.closeAlert(1); + } +} \ No newline at end of file diff --git a/tasks/task_dy_zan_back.js b/tasks/task_dy_zan_back.js new file mode 100644 index 0000000..2e7136c --- /dev/null +++ b/tasks/task_dy_zan_back.js @@ -0,0 +1,231 @@ +let tCommon = require('app/dy/Common.js'); +let DyUser = require('app/dy/User.js'); +let DyVideo = require('app/dy/Video.js'); +let storage = require('common/storage.js'); +let machine = require('common/machine.js'); +let baiduWenxin = require('service/baiduWenxin.js'); +let statistics = require('common/statistics'); +let V = require("version/V.js"); + +// let dy = require('app/iDy'); +// let config = require('config/config'); + +/** + * 赞回访 + */ + +let videoCount = 500; + +let task = { + contents: [], + run() { + return this.testTask(); + }, + + log() { + let d = new Date(); + let file = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(); + let allFile = "log/log-dy-zan-back-" + file + ".txt"; + Log.setFile(allFile); + }, + + //type 0 评论,1私信 + getMsg(type, title, age, gender) { + if (storage.get('setting_baidu_wenxin_switch', 'bool')) { + return { msg: type === 1 ? baiduWenxin.getChat(title, age, gender) : baiduWenxin.getComment(title) }; + } + return machine.getMsg(type) || false;//永远不会结束 + }, + + getConfig() { + return { + runTimes: machine.get('task_dy_zan_back_run_count', 'int'),//运行次数 + intevalSecond: machine.get('task_dy_zan_back_interval', 'int'),//操作间隔 + homeWait: machine.get('task_dy_zan_back_home_wait', 'int') || 5,//主页停留时间 + workWait: machine.get('task_dy_zan_back_work_wait', 'int') || 5,//作品停留时间 + fansMin: machine.get('task_dy_zan_back_min_fans', 'int') || 0, //最小粉丝数 + fansMax: machine.get('task_dy_zan_back_max_fans', 'int') || 1000000000,//最大粉丝数 + workMin: machine.get('task_dy_zan_back_min_work', 'int') || 1,//最小作品数 + op: machine.getArray('task_dy_zan_back_op'), // "0","1","2" 分别是 关注、私信、点赞 + } + }, + + testTask() { + //查看是不是进入了指定页面,是的话才开始运行 + let config = this.getConfig(); + Log.log("配置信息:", config); + tCommon.id(V.C.userListTop).isVisibleToUser(true).waitFindOne(); + + let arr = [];//存储最新的20个 + let count = 0; + let repeatCount = 0; + let errorCount = 0; + let errorContainsCount = 0; + + while (true) { + try { + tCommon.sleep(3000); + System.toast('开始执行,剩余数量:' + (config.runTimes - count)); + let contains = tCommon.id(V.Comment.getList[0]).isVisibleToUser(true).find(); + Log.log("找到的内容数量:", contains.length); + if (contains.length == 0) { + if (errorContainsCount++ >= 3) { + throw new Error("3次找不到container内容"); + } + continue; + } + errorContainsCount = 0; + + for (let i in contains) { + tCommon.sleep(config.intevalSecond * 1000); + let nicknameTag = contains[i].children().findOne(tCommon.id(V.Video.zanList[0]).isVisibleToUser(true)); + Log.log(nicknameTag); + if (!nicknameTag) { + System.generateWindowElements(); + Log.log('找不到昵称标签', contains[i]); + if (errorCount++ > 3) { + errorCount = 0; + throw new Error("3次找不到昵称"); + } + continue; + } + errorCount = 0; + + tCommon.click(nicknameTag); + tCommon.sleep(2000); + statistics.viewUser(); + let nickname = nicknameTag.text(); + count++; + Log.log('操作次数:' + count + "/" + config.runTimes); + if (count >= config.runTimes) { + System.toast('运行次数达到了'); + return true; + } + + if (DyUser.isPrivate()) { + tCommon.back(); + System.toast('私密账号'); + continue; + } + + let account = DyUser.getDouyin(); + if (machine.get("task_dy_zan_back_" + account, 'bool')) { + tCommon.back(); + System.toast('已经操作过了'); + continue; + } + + Log.log("抖音号:", account); + machine.set("task_dy_zan_back_" + account, true); + if (arr.indexOf(account) != -1) { + repeatCount++; + if (repeatCount >= 2) { + System.toast('运行结束'); + return true; + } + tCommon.back(); + continue; + } else { + repeatCount = 0; + } + + arr.push(account); + + let fansCount = DyUser.getFansCount(); + Log.log("粉丝数量:", fansCount); + if (fansCount < config.fansMin || fansCount > config.fansMax) { + tCommon.back(); + System.toast('粉丝数不符合要求'); + continue; + } + + let workCount = DyUser.getWorksCount(); + Log.log("作品数量:", workCount); + if (workCount < config.workMin) { + tCommon.back(); + System.toast('作品数不符合要求'); + continue; + } + + if (config.op.includes("2") && DyVideo.intoUserVideo()) { + Log.log("执行进入视频"); + tCommon.sleep(config.workWait * 1000); + if (DyVideo.isZan()) { + System.toast('已经点赞了'); + } else { + DyVideo.clickZan(); + tCommon.sleep(1000 + 1000 * Math.random()); + } + tCommon.back(); + } + + //查看是否关注 + if (config.op.includes("0")) { + Log.log("执行关注"); + if (DyUser.isFocus()) { + System.toast('已关注,不操作'); + } else { + DyUser.focus(); + tCommon.sleep(1000 + Math.random() * 1000); + } + } + + if (config.op.includes("1")) { + Log.log("执行私信"); + DyUser.privateMsg(this.getMsg(1, nickname).msg); + } + + tCommon.sleep(config.homeWait * 1000);//主页停留 + tCommon.swipe(0, 0.5); + tCommon.sleep(500); + if (tCommon.id(V.Comment.getList[0]).isVisibleToUser(true).findOne()) { + Log.log('在列表页面了'); + } else { + tCommon.back();//返回 + } + } + + tCommon.sleep(1000); + Log.log("执行滑动"); + task.swipe(); + System.cleanUp(); + } catch (e) { + Log.log(e); + if (!tCommon.id(V.Comment.getList[0]).isVisibleToUser(true).findOne()) { + Log.log("找不到标签,返回了"); + tCommon.back(); + tCommon.sleep(2000); + } else { + Log.log('滑动一下,解决问题'); + task.swipe(); + } + } + } + }, + + swipe() { + let scrolls = tCommon.id(V.Common.swipeCommentListOp[0]).scrollable(true).find(); + for (let i in scrolls) { + scrolls[i].scrollForward(); + } + } +} + +//开启线程 自动关闭弹窗 +Engines.executeScript("unit/dialogClose.js"); + +while (true) { + task.log(); + try { + let res = task.run(); + if (res) { + tCommon.sleep(3000); + FloatDialogs.show('提示', '已完成'); + break; + } + + tCommon.sleep(3000); + } catch (e) { + Log.log(e); + } +} diff --git a/tasks/task_xhs_fans.js b/tasks/task_xhs_fans.js new file mode 100644 index 0000000..0d509f8 --- /dev/null +++ b/tasks/task_xhs_fans.js @@ -0,0 +1,215 @@ +let storage = require("common/storage.js"); +let machine = require("common/machine.js"); +let Common = require("app/xhs/Common.js"); +let V = require("version/XhsV.js"); +let User = require("app/xhs/User.js"); +let Work = require("app/xhs/Work.js"); +let baiduWenxin = require('service/baiduWenxin.js'); + +let task = { + log() { + let d = new Date(); + let file = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(); + let allFile = "log/log-xhs-fans-" + file + ".txt"; + Log.setFile(allFile); + }, + + //type 0 评论,1私信 + getMsg(type, title, age, gender) { + if (storage.get('setting_baidu_wenxin_switch', 'bool')) { + return { msg: type === 1 ? baiduWenxin.getChat(title, age, gender) : baiduWenxin.getComment(title) }; + } + + //return { msg: ['厉害', '六六六', '666', '拍得很好', '不错哦', '关注你很久了', '学习了', '景色不错', '真的很不错', '太厉害了', '深表认同', '来过了', '茫茫人海遇见你', '太不容易了', '很好', '懂了', '我看到了', '可以的', '一起加油', '真好', '我的个乖乖'][Math.round(Math.random() * 20)] }; + return machine.getMsg(type) || false;//永远不会结束 + }, + + run() { + let config = { + runCount: storage.get('task_xhs_fans_run_count', 'int'), + interval: storage.get('task_xhs_fans_interval', 'int') * 1000, + homeWait: storage.get('task_xhs_fans_home_wait', 'int') * 1000, + workWait: storage.get('task_xhs_fans_work_wait', 'int') * 1000, + minFans: storage.get('task_xhs_fans_min_fans', 'int'), + maxFans: storage.get('task_xhs_fans_max_fans', 'int'), + minWork: storage.get('task_xhs_fans_min_work', 'int'), + op: storage.getArray('task_xhs_fans_op'),//0关注,1私信,2首作品点赞 + } + + Log.log('config', config); + this.log(); + this.tokerFans(config); + }, + + tokerFans(config) { + Common.id(V.User.fans[0]).descContains(V.User.fans[1]).isVisibleToUser(true).waitFindOne();//粉丝或者关注界面 + let nicknameErrorCount = 0; + + let selectedTag = Common.id(V.User.fans[0]).isVisibleToUser(true).descContains(V.User.fans[4]).findOne(); + Log.log("选择的内容", selectedTag); + + let selectText = selectedTag.desc().replace(V.User.fans[4], '');//根据内容 【关注、粉丝、推荐】选择对应的滑动 + let arr = []; + let stopMarkCount = 0; + Log.log('总数量:' + config.runCount); + let showAll = false;//还没有点击 “查看全部” + let minTop = selectedTag.bounds().top + selectedTag.bounds().height(); + Log.log('最低top是:', minTop); + let containsCountError = 0; + + while (true) { + try { + let contains = Common.id(V.User.fans[5]).isVisibleToUser(true).find(); + Log.log('容器数量:' + contains.length); + if (contains.length === 0) { + if (containsCountError++ >= 3) { + throw new Error('3次容器数量为0'); + } + } + + containsCountError = 0; + for (let i in contains) { + let nicknameTag = contains[i].children().findOne(Common.id(V.User.fans[6]).filter(v => { + return v && v.bounds() && v.bounds().height() > 0 && v.bounds().top >= minTop; + })); + if (!nicknameTag) { + Log.log("找不到昵称", contains[i]); + if (nicknameErrorCount++ >= 3) { + return true;//完成 + } + continue; + } + + nicknameErrorCount = 0; + let nickname = nicknameTag.text(); + Log.log('开始操作昵称', nickname, nicknameTag); + if (arr.indexOf(nickname) != -1) { + Log.log('重复昵称', nickname); + if (stopMarkCount++ >= 3) { + return true; + } + continue; + } + + arr.push(nickname); + if (arr.length >= 20) { + arr.shift(); + } + + //作品数和粉丝数,仅仅针对“粉丝列表” + if (selectText == V.User.fans[2]) { + let countTag = contains[i].children().findOne(Common.id(V.User.fans[8])); + let workCount = User.getListWorkCount(countTag); + if (workCount < config.minWork) { + Log.log('作品数量不合格:', workCount, config.minWork); + continue; + } + + let fansCount = User.getListFansCount(countTag); + if (fansCount < config.minFans || fansCount > config.maxFans) { + Log.log('粉丝数量不合格:', fansCount, config.minFans, config.maxFans); + continue; + } + } + + Common.click(nicknameTag); + Common.sleep(2000 + 1000 * Math.random());//进入了主页 + let fansCount = User.getFansCount(); + if (fansCount < config.minFans || fansCount > config.maxFans) { + Log.log('作品:数量不合格:', fansCount, config.minFans, config.maxFans); + Common.back(); + continue; + } + + //首先进入视频,不管是关注,私信,还是首作品点赞; 进入视频主要是为了防止风控 + + if (User.intoVideo()) { + //有视频 进入了视频 假装休眠 + Common.sleep(config.workWait * 0.7); + Common.swipe(0, 0.5); + + //是否点赞 + if (config.op.indexOf('2') != -1) { + Log.log('点赞了'); + Work.zan(); + } + + Common.sleep(config.workWait * 0.3); + Common.back();//有时候会出现不能返回的情况,小红薯的设计bug 比如点击关注之后,出现了 “关注他的人也关注了”的列表,返回之后,只是关闭了这个,而没有真正返回 + Common.sleep(1000 + 1000 * Math.random()); + Log.log('从视频页面返回到主页'); + } + + //这里防止视频页面没有进去,但是已经返回到了列表页 + if (!Common.id(V.User.nickname[0]).findOne()) { + continue; + } + + //正常情况下,在用户页,进行返回操作 + Common.sleep(config.homeWait * 0.8); + + if (config.op.indexOf('0') != -1) { + Log.log('准备关注'); + User.focus(); + Common.sleep(1500 + 1000 * Math.random()); + } + + if (config.op.indexOf('1') != -1) { + let ttt = this.getMsg(1, nickname); + let msg = ttt ? ttt.msg : ''; + Log.log('准备私信', msg); + User.privateMsg(msg); + Common.sleep(1500 + 1000 * Math.random()); + } + + Log.log('剩余数量:' + config.runCount); + + if (config.runCount-- <= 0) { + return true; + } + + Common.sleep((config.interval || 1000) * 0.8); + Common.swipe(0, 0.2); + Common.sleep((config.interval || 1000) * 0.2);//假装滑动 + Common.back(); + Common.sleep(500); + + if (Common.id(V.User.nickname[0]).findOne()) { + Common.back();//有时候会出现不能返回的情况,小红薯的设计bug + } + Log.log('返回到了主界面'); + } + + if (!showAll) { + let showAllTag = Common.id(V.User.showAllFans[0]).textContains(V.User.showAllFans[1]).isVisibleToUser(true).findOne(); + if (showAllTag) { + Log.log('点击“查看全部”'); + Common.click(showAllTag); + Common.sleep(2000 + 1000 * Math.random()); + showAll = true; + } + } + + let likeTag = Common.id(V.Work.like[0]).textContains(V.Work.like[1]).isVisibleToUser(true).findOne(); + if (likeTag) { + return true;//操作完成了,下面都是“你可能感兴趣的人” + } + + User.swipeFans(selectText); + Common.sleep(1000 + 1000 * Math.random()); + } catch (e) { + Log.log('异常了~', e); + if (Common.id(V.User.fans[0]).descContains(V.User.fans[1]).isVisibleToUser(true).findOne()) { + User.swipeFans(selectText); + } else { + Common.back(); + } + Common.sleep(1000 + 1000 * Math.random()); + } + } + } +} + +if (task.run()) { + FloatDialogs.show('提示', '已完成'); +} diff --git a/tasks/task_xhs_toker.js b/tasks/task_xhs_toker.js new file mode 100644 index 0000000..b7d4695 --- /dev/null +++ b/tasks/task_xhs_toker.js @@ -0,0 +1,34 @@ +let storage = require("common/storage.js"); +let machine = require("common/machine.js"); +let Common = require("app/xhs/Common.js"); +let xhs = require("app/xhs/xhs.js"); +let baiduWenxin = require('service/baiduWenxin.js'); + +let task = { + log() { + let d = new Date(); + let file = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(); + let allFile = "log/log-xhs-toker-" + file + ".txt"; + Log.setFile(allFile); + }, + + //type 0 评论,1私信 + getMsg(type, title, age, gender) { + if (storage.get('setting_baidu_wenxin_switch', 'bool')) { + return { msg: type === 1 ? baiduWenxin.getChat(title, age, gender) : baiduWenxin.getComment(title) }; + } + + //return { msg: ['厉害', '六六六', '666', '拍得很好', '不错哦', '关注你很久了', '学习了', '景色不错', '真的很不错', '太厉害了', '深表认同', '来过了', '茫茫人海遇见你', '太不容易了', '很好', '懂了', '我看到了', '可以的', '一起加油', '真好', '我的个乖乖'][Math.round(Math.random() * 20)] }; + return machine.getMsg(type) || false;//永远不会结束 + }, + + run() { + this.log(); + Common.openApp(); + xhs.run(this.getMsg); + } +} + +if (task.run()) { + FloatDialogs.show('提示', '已完成'); +} diff --git a/tasks/task_xhs_toker_uid.js b/tasks/task_xhs_toker_uid.js new file mode 100644 index 0000000..76abcb4 --- /dev/null +++ b/tasks/task_xhs_toker_uid.js @@ -0,0 +1,106 @@ +let tCommon = require("app/xhs/Common"); +const DyUser = require('app/xhs/User.js'); +let storage = require("common/storage"); +let machine = require("common/machine"); + +let task = { + index: 0, + run(accounts, second, ops) { + return this.testTask(accounts, second, ops); + }, + + log() { + let d = new Date(); + let file = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(); + let allFile = "log/log-xhs-toker-uid-" + file + ".txt"; + Log.setFile(allFile); + }, + + //type 0 评论,1私信 + getMsg(type, title, age, gender) { + if (storage.get('setting_baidu_wenxin_switch', 'bool')) { + return { msg: type === 1 ? baiduWenxin.getChat(title, age, gender) : baiduWenxin.getComment(title) }; + } + + //return { msg: ['厉害', '六六六', '666', '拍得很好', '不错哦', '关注你很久了', '学习了', '景色不错', '真的很不错', '太厉害了', '深表认同', '来过了', '茫茫人海遇见你', '太不容易了', '很好', '懂了', '我看到了', '可以的', '一起加油', '真好', '我的个乖乖'][Math.round(Math.random() * 20)] }; + return machine.getMsg(type) || false;//永远不会结束 + }, + + testTask(accounts, second, ops) { + //首先进入点赞页面 + Log.log('账号:', accounts, ops); + for (let i in accounts) { + if (i < this.index) { + continue; + } + + try { + //进入用户主页,私信,关注 + App.gotoIntent('xhsdiscover://user/' + accounts[i]);//5f12d8cf0000000001004c15 + tCommon.sleep(5000 + 3000 * Math.random()); + if (ops.includes("1")) { + Log.log('私信'); + DyUser.privateMsg(this.getMsg(1).msg); + tCommon.sleep(500 + 1000 * Math.random()); + } + + if (ops.includes("0")) { + Log.log('关注'); + DyUser.focus(); + } + } catch (e) { + Log.log(e); + } + + this.index++; + let s = (second / 2 + second / 2 * Math.random()); + Log.log('休眠' + s + '秒') + tCommon.sleep(s * 1000); + tCommon.backHomeOnly(); + tCommon.sleep(2000 * Math.random() + 500); + } + + if (this.index >= accounts.length) { + return true; + } + }, +} + +let accounts = storage.get('task_xhs_toker_uid_account'); +Log.log('accounts', accounts); +if (!accounts) { + tCommon.showToast('你取消了执行'); + //console.hide();(); + System.exit(); +} +accounts = accounts.split("\n"); + +//开启线程 自动关闭弹窗 +Engines.executeScript("unit/dialogClose.js"); +tCommon.openApp();//兜底,防止跑到外面去了 + +while (true) { + task.log(); + try { + //开启线程 自动关闭弹窗 + if (task.run(accounts, storage.get('task_xhs_toker_uid_interval', 'int'), storage.getArray('task_xhs_toker_uid_op'))) { + FloatDialogs.show('提示', '执行完成'); + break; + } + tCommon.sleep(3000); + } catch (e) { + Log.log(e); + try { + tCommon.showToast("遇到错误,即将自动重启"); + tCommon.sleep(3000); + } catch (e) { + Log.log('启停bug', e); + } + } +} + +try { + Engines.closeAll(); +} catch (e) { + Log.log('停止脚本'); +} diff --git a/tasks/task_xhs_yanghao.js b/tasks/task_xhs_yanghao.js new file mode 100644 index 0000000..d3cd1d6 --- /dev/null +++ b/tasks/task_xhs_yanghao.js @@ -0,0 +1,160 @@ +let tCommon = require("app/xhs/Common"); +let DyIndex = require('app/xhs/Index.js'); +let DySearch = require('app/xhs/Search.js'); +let Work = require('app/xhs/Work.js'); +let storage = require("common/storage"); +let machine = require("common/machine"); +let baiduWenxin = require("service/baiduWenxin"); +let statistics = require("common/statistics"); +let V = require("version/XhsV.js"); + +let task = { + contents: [], + count: storage.get('task_xhs_yanghao_count', 'int'), + zanRate: storage.get('task_xhs_yanghao_zan_rate', 'int'), + commentRate: storage.get('task_xhs_yanghao_comment_rate', 'int'), + collectRate: storage.get('task_xhs_yanghao_collect_rate', 'int'), + run(keyword) { + return this.testTask(keyword); + }, + + log() { + let d = new Date(); + let file = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(); + let allFile = "log/log-search-vertical-" + file + ".txt"; + Log.setFile(allFile); + }, + + //type 0 评论,1私信 + getMsg(type, title, age, gender) { + if (storage.getMachineType() === 1) { + if (storage.get('setting_baidu_wenxin_switch', 'bool')) { + return { msg: type === 1 ? baiduWenxin.getChat(title, age, gender) : baiduWenxin.getComment(title) }; + } + return machine.getMsg(type) || false;//永远不会结束 + } + }, + + testTask(keyword) { + //首先进入点赞页面 + DyIndex.intoIndex(); + DyIndex.intoSearchPage(); + DySearch.intoSearchList(keyword); + tCommon.sleep(4000 + 2000 * Math.random()); + + let topTag = tCommon.id(V.Search.searchTop).isVisibleToUser(true).findOne(); + let top = topTag ? topTag.bounds().top + topTag.bounds().height() : 210; + let interval = storage.get('task_xhs_yanghao_interval', 'int'); + while (true) { + let tags = DySearch.getList(); + for (let i in tags) { + try { + let text = tags[i].text(); + if (this.contents.includes(text)) { + continue; + } + + if (machine.get('task_xhs_yanghao_' + text, 'bool')) { + Log.log('重复视频'); + continue; + } + + tCommon.clickRange(tags[i], top, Device.height()); + tCommon.sleep(3000 + 2000 * Math.random()); + + let title = Work.getContent(); + Log.log('title:' + title); + //let nickname = Work.getNickname(); + statistics.viewVideo(); + statistics.viewTargetVideo(); + + let sleepSec = (interval / 2 + interval / 2 * Math.random()) * 1000; + Log.log('休眠' + sleepSec + 'ms'); + tCommon.sleep(sleepSec);//最后减去视频加载时间 和查询元素的时间 + + if (this.count-- <= 0) { + return true; + } + Log.log('剩余多少个:' + this.count); + + if (Math.random() * 100 <= task.commentRate) { + Work.msg(Work.getType(), this.getMsg(0, title).msg); + tCommon.sleep(2000 + 1000 * Math.random()); + } + + if (Math.random() * 100 <= task.zanRate) { + Log.log('点赞'); + Work.zan(); + tCommon.sleep(2000 + 1000 * Math.random()); + } + + if (Math.random() * 100 <= task.collectRate) { + Log.log('收藏'); + Work.collect(); + tCommon.sleep(2000 + 1000 * Math.random()); + } + + machine.set('task_xhs_yanghao_' + text, true); + this.contents.push(text); + if (!tCommon.id(V.Search.searchTop).isVisibleToUser(true).findOne()) { + tCommon.back(); + } + tCommon.sleep(1000 + 500 * Math.random()); + } catch (e) { + //判断是否在日记页面 + if (Work.getType() != -1) { + tCommon.back(); + tCommon.sleep(1000); + } + Log.log('错误:' + e); + } + } + + Log.log('开始滑动'); + tCommon.swipeWorkOp(); + tCommon.sleep(3000 + 2000 * Math.random()); + } + }, +} + +let keyword = storage.get('task_xhs_yanghao_keyword'); +if (!keyword) { + tCommon.showToast('请设置关键词'); + //console.hide();(); + System.exit(); +} + +task.count = storage.get('task_xhs_yanghao_count', 'int'); +if (!task.count) { + tCommon.showToast('请设置刷视频数量'); + //console.hide();(); + System.exit(); +} + +tCommon.openApp(); +//开启线程 自动关闭弹窗 +Engines.executeScript("unit/dialogClose.js"); + +while (true) { + task.log(); + try { + let res = task.run(keyword); + if (res) { + tCommon.sleep(3000); + FloatDialogs.show('提示', '已完成'); + break; + } + + if (res === false) { + tCommon.sleep(3000); + FloatDialogs.show('提示', '已完成'); + break; + } + + tCommon.sleep(3000); + } catch (e) { + Log.log(e); + tCommon.closeAlert(1); + tCommon.backHome(); + } +} diff --git a/tasks/task_xhs_zan_back.js b/tasks/task_xhs_zan_back.js new file mode 100644 index 0000000..0061c35 --- /dev/null +++ b/tasks/task_xhs_zan_back.js @@ -0,0 +1,141 @@ +let storage = require("common/storage.js"); +let Common = require("app/xhs/Common.js"); +let User = require("app/xhs/User.js"); +let V = require("version/XhsV.js"); + +let Work = require("app/xhs/Work.js"); + +let task = { + log() { + let d = new Date(); + let file = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(); + let allFile = "log/log-xhs-zan-back-" + file + ".txt"; + Log.setFile(allFile); + }, + + //type 0 评论,1私信 + getMsg(type, title, age, gender) { + if (storage.get('setting_baidu_wenxin_switch', 'bool')) { + return { msg: type === 1 ? baiduWenxin.getChat(title, age, gender) : baiduWenxin.getComment(title) }; + } + + //return { msg: ['厉害', '六六六', '666', '拍得很好', '不错哦', '关注你很久了', '学习了', '景色不错', '真的很不错', '太厉害了', '深表认同', '来过了', '茫茫人海遇见你', '太不容易了', '很好', '懂了', '我看到了', '可以的', '一起加油', '真好', '我的个乖乖'][Math.round(Math.random() * 20)] }; + return machine.getMsg(type) || false;//永远不会结束 + }, + + run() { + let config = { + runCount: storage.get('task_xhs_zan_back_run_count', 'int'), + interval: 5 * 1000, + homeWait: 5 * 1000, + workWait: 5 * 1000 + } + + return this.zanBack(config); + }, + + zanBack(config) { + Log.log('开始'); + Log.log(Common.id(V.Work.zanCollectionHead[0]).descContains(V.Work.zanCollectionHead[1]).findOne()); + Common.id(V.Work.zanCollectionHead[0]).descContains(V.Work.zanCollectionHead[1]).isVisibleToUser(true).waitFindOne(); + Log.log('进入'); + + let noNicknameTagCount = 0; + let arr = []; + let repeatNicknameCount = 0; + Log.log('操作总次数:' + config.runCount); + + while (true) { + try { + let containers = Common.id(V.Work.zanUserList[0]).findOne().children().find(Common.id(V.Work.zanUserList[2]).isVisibleToUser(true));//获取列表外层 + for (let i in containers) { + let nicknameTag = containers[i]; + if (!nicknameTag) { + if (noNicknameTagCount++ >= 3) { + throw new Error('3次找不到昵称'); + } + } + + let nickname = nicknameTag.text(); + Log.log('准备操作昵称:' + nickname); + + if (arr.indexOf(nickname) != -1) { + if (repeatNicknameCount++ >= 3) { + Log.log('重复3次,都是同一个昵称'); + return true;//完成了 + } + continue; + } + + repeatNicknameCount = 0; + arr.push(nickname); + if (arr.length >= 20) { + arr.shift(); + } + + try { + if (containers[i].parent().children().findOne(Common.id(V.Work.zanUserList[3])).text() == V.Work.zanUserList[4]) { + continue; + } + } catch (e) { + Log.log('作者判断'); + } + + Common.click(nicknameTag); + Common.sleep(2000 + 2000 * Math.random()); + + Log.log('即将进入视频'); + let intoVideo = false; + if (User.intoVideo()) { + Log.log('进入视频'); + Common.sleep(config.workWait * 0.9); + Work.zan(); + if (config.runCount-- <= 0) { + Log.log('剩余数量:' + config.runCount); + return true; + } + + intoVideo = true; + Common.sleep(config.workWait * 0.1); + Common.back(); + } + + //判断是否在用户页面 有作品的才操作,没有作品 + if (intoVideo) { + if (Common.id(V.User.account[0]).findOne()) { + Common.sleep(config.homeWait * 0.8); + Common.swipe(0, 0.5); + Common.sleep(config.homeWait * 0.2); + Common.back(); + Log.log('返回列表'); + } else { + Log.log('问题'); + //可能是列表页面 不做任何返回操作 + } + } else { + Common.sleep(config.homeWait * 0.2); + Common.back(); + } + + Common.sleep(config.interval); + } + + Work.zanUserListSwipe(); + } catch (e) { + let a = Common.id(V.Work.zanCollectionHead[0]).descContains(V.Work.zanCollectionHead[1]).findOne(); + if (a) { + Log.log(a); + Work.zanUserListSwipe(); + } else { + Log.log('其他页面,返回'); + Common.back();//其他页面,则返回 + } + Log.log('异常了~', e); + } + } + } +} + +if (task.run()) { + FloatDialogs.show('提示', '已完成'); +} diff --git a/tasks/tool.js b/tasks/tool.js index 4c98433..c65c1ca 100644 --- a/tasks/tool.js +++ b/tasks/tool.js @@ -1 +1,5 @@ -FloatDialogs.show('功能开发中···'); \ No newline at end of file +//import { Common } from "app/dy/Common.js" + + +console.log('哈哈哈'); +console.log(UiSelector()); diff --git a/test.js b/test.js new file mode 100644 index 0000000..5a112ff --- /dev/null +++ b/test.js @@ -0,0 +1,288 @@ +const Common = { + //封装的方法 + logs: [], + id(name) { + return id('com.ss.android.ugc.aweme:id/' + name); + }, + aId(name) { + //android:id/text1 + return id('android:id/' + name); + }, +} + +// let tjTag = DyCommon.id('yic').text('推荐').findOne().parent(); +// if (tjTag && tjTag.desc().indexOf("已选中") != -1) { +// console.log('32423423432'); +// } + + +// let tag = descMatches(/自定义表情[\\s\\S]+/).findOne().parent(); +// console.log(tag); + +// let tagParent = desc('表情').clickable(true).findOne(); + +// if (tagParent) { +// let imgTag = tagParent.parent(); +// console.log(imgTag); +// } + +// let tag = Common.id('o-8').findOne(); +// console.log(tag); +// let img = tag.children().findOne(desc('表情')); + +// img.click(); + +// let submitTag = Common.id('dj2').findOne(); + +// console.log(submitTag); +// console.log(submitTag.click()); + + + +// let header = Common.id('pgn').findOne(); + +// console.log(header.parent()); + +// console.log(desc('取消').find()); +// console.log(desc('关闭').find()); + +//console.log(Common.id('pgx').findOne().children()); +// console.log(Common.id('title_bar').findOne()); + +// console.log(Common.id('vq7').findOne()); + +// console.log(Common.id('u+m').findOne()); + + +// let a = scrollable(true).find(); +// console.log(a); +// console.log(a.scrollForward()); + + +// console.log(Common.id('wl0').find()); + + + +// console.log(textContains('59').findOne()); +// console.log(descContains('59').findOne()); + + +// console.log(Common.id('content').find()); +// console.log(Common.id('tv_name').find()); + +// console.log(textContains("作品").findOne()); + +// console.log(Common.id('wk5').findOne()); + +// console.log(descContains('表情').findOne().parent()); + +// let a = Common.id('i7r').findOne().children().findOne(descContains('表情')); +// console.log(a); + + +// console.log(descContains('自定义表情').find()); + +// let tag = textContains("中国").filter((v) => { +// return v && v._id == null; +// }).findOnce().parent().children().findOne(textContains("直播")); + +// console.log(tag); + +// let tags = Common.id("_a").findOnce().children().find(textMatches(/[\s\S]+/)).filter((v) => { +// return v && !v.text().includes('我的信息') && v.bounds().top > 0 && v.bounds().top + v.bounds().height() < device.height - 300 && v.bounds().left < 10 && v.bounds().width() >= device.width - 10; +// }); + +// console.log(tags); + + +// let swipeSearchUserOpTarge = Common.id("syq").scrollable(true).filter((v) => { +// return v && v.bounds() && v.bounds().top > 0 && v.bounds().left >= 0 && v.bounds().width() == device.width && v.bounds().top >= 0; +// }).findOnce(); + +// if (swipeSearchUserOpTarge) { +// swipeSearchUserOpTarge.scrollForward(); +// } else { +// console.log('滑动失败'); +// } + +// console.log(Common.id('syq').scrollable(true).find()); + +// console.log(Common.id('desc').find()); + +// console.log(textContains('大品牌').find()); + +// console.log(Common.id('ero').findOne()); + +// let a = scrollable(true).find(); + +// console.log(a); + +// Common.id('rw3').findOne().scrollForward(); + +// console.log(descContains('点击进入直播间').find()); + +// let container = descContains('美女').findOne(); +// console.log(container); + +// console.log(text("取消关注").findOne()); + +// let tags = Common.id('p=u').findOnce().children().find(textMatches("[\\s\\S]+")); + +// log(tags); + + +// console.log(textContains('直播按钮').findOne().parent().children()); + + +// let tag = textContains('zhang').textContains('抖音号').filter((v) => { +// return v && v._id == null && v.bounds().left > 0;; +// }).findOnce().parent().children().findOne(textContains('直播').filter((v) => { +// return v && v.bounds() && v.bounds().width() < device.width();//过滤其他,应该能获取当前的头像 +// })); + +// log(tag); + +// let tags = Common.aId("text1").textContains("作品").findOne();//rj5 或者 ptm +// console.log(tags); + + +// let containers = className('android.widget.FrameLayout').focusable(true).filter((v) => { +// return v && v.bounds() && v.bounds().left === 0 && v.bounds().top > 400 && v.bounds().top + v.bounds().height() < device.height && !!v.children() && !!v.children().findOne(textContains('粉丝')); +// }).find(); + +// for (let i in containers) { +// if (isNaN(i)) { +// continue; +// } +// let titleTag = containers[i].children().findOne(textContains('粉丝')); +// console.log(titleTag); +// } + +// sleep(5000); +// let douyin = textContains("抖音").findOnce(); +// if (douyin && douyin.text()) { +// console.log(douyin.text()); +// } + + + +// console.log(Common.id('rw3').scrollable(true).find()); + +// console.log(Common.id('rw3').scrollable(true).find()[0].scrollForward()); +// console.log(Common.id('rw3').scrollable(true).find()[1].scrollForward()); + +// console.log(textContains('有限公司').findOne().parent()); + +// console.log(clickable(false).find()); + +// console.log(Common.id('v9f').findOne(1000));//Rect(0, 0 - 1080, 120); boundsInScreen: Rect(0, 1401 - 1080, 1521) + +// console.log(Common.id('dsc').findOne(1000)); + + +// console.log(Common.id('d6s').filter(v=>{ +// return v && v.bounds() && v.bounds() && v.bounds().width()>0; +// }).findOne(1000)); + +// console.log(Common.id('bj').findOne(1000)); + +// let contains = Common.id('root_layout').find(); +// for (let i in contains) { +// if (isNaN(i)) { +// continue; +// } + +// let nicknameTag = contains[i].children().findOne(Common.id('0bq')); +// console.log(contains[i]); +// console.log(nicknameTag); +// } + + +// let scrolls = Common.id("1").scrollable(true).find(); +// console.log(scrolls); + + +// for (let i in scrolls) { +// if(isNaN(i)){ +// continue; +// } + + +// scrolls[i].scrollForward(); +// } + +//console.log(textContains('置顶').find()); + +// let contains = Common.id('container').find(); +// for(let i in contains){ +// if(isNaN(i)){ +// continue; +// } + +// log(contains[i].children().find(Common.id('z5t'))); +// } + +// let containers = scrollable(true).find(); +// log(textContains('取消关注').findOne().parent().click()); + +// Common.id('explorer_item_list').findOne().scrollForward(); + +// console.log(id('u-o').findOne().scrollForward()); + + +// console.log(id('wk5').findOne().scrollForward()); + + +// console.log(textMatches(/[\s\S]+/).clickable(true).filter(v => { +// return v && v.bounds() && v.bounds().width() == device.width; +// }).find()); + + +// log(scrollable(true).find()[0].scrollForward()); + + +// swipe(200, device.height * 0.3, 200, device.height * 0.7, 100); + +let ass = '漾YOUNG男士发型22'; +// let a = textContains('漾YOUNG男士发型2').findOne(); + +// log(ass.substring(0, ass.length/2)); +// a = textContains(ass.substring(0, ass.length/2)).findOne(); +// log(a); + + +// log(textContains('查看详情').findOne()); + +// log(textContains('点击重播').findOne()); + + +// log(id('container').filter(v=>{ +// log(v.bounds().width(), device.width); +// return v && v.bounds() && v.bounds().width() <= device.width/3; +// }).find()); + +// console.log(scrollable(true).findOne().scrollForward()); + +// // id('oc8').findOne().scrollForward(); +// id('nrj').findOne().scrollForward(); + +// let a = textMatches(/.+/).find(); + +// console.log(a); + +// let a = className('android.widget.FrameLayout').filter((v) => { +// return v && v.bounds() && v.bounds().width() >= device.width - 10 && v.bounds().left >= 0 && v.bounds().top + v.bounds().height() < device.height; +// }).find(); +// log(a); + +// log(descContains('蒙').find()); + +// log(descMatches(/[\s\S]*/).find()); + + +// console.log(scrollable(true).find()); + +// id('fhj').findOne().scrollForward(); + +log(id('s4y').findOne().parent()); + diff --git a/test.md b/test.md new file mode 100644 index 0000000..9ff387c --- /dev/null +++ b/test.md @@ -0,0 +1,15 @@ + +
    + 本项目由DeekeScript赞助 +
    + Deeke是一款基于抖音的引流获客工具,可实现快速起号、快速获客~ +
    +
    + 稳定 + 高效 + 自主研发 +
    +
    + 立即咨询 +
    +
    diff --git a/test2.js b/test2.js new file mode 100644 index 0000000..16baef0 --- /dev/null +++ b/test2.js @@ -0,0 +1,8 @@ +let user = textContains('用户').id('android:id/text1').findOne(); + +log(user); + +click(user.bounds().centerX(), user.bounds().centerY()); + + +log(Math.random(22.33)); diff --git a/unit/dialogClose.js b/unit/dialogClose.js index 8027909..8857cab 100644 --- a/unit/dialogClose.js +++ b/unit/dialogClose.js @@ -1,3 +1,3 @@ -import { Common as tCommon } from "app/dy/Common"; +let tCommon = require("app/dy/Common"); tCommon.closeAlert(); diff --git a/unit/engineCondition.js b/unit/engineCondition.js index 263dd90..1378ab8 100644 --- a/unit/engineCondition.js +++ b/unit/engineCondition.js @@ -1,4 +1,4 @@ -export let condition = { +let condition = { dailyLastHour: function(){ let dt = new Date(); if(dt.getHours() >= 22){ @@ -14,3 +14,5 @@ export let condition = { return false; } }; + +module.exports = condition; diff --git a/unit/mHttp.js b/unit/mHttp.js index baf68b7..77e0515 100644 --- a/unit/mHttp.js +++ b/unit/mHttp.js @@ -1,13 +1,10 @@ -import { storage } from 'common/storage.js'; -import { config as mConfig } from 'config/config.js'; +let storage = require('common/storage.js'); +let mConfig = require('config/config.js'); -export let mHttp = { +let mHttp = { getConfig() { let config = { url: mConfig.domain, - token: storage.getToken(), - mobile: storage.getMobile(), - machine_id: storage.getMachineId(), }; //dev环境判断 @@ -24,8 +21,6 @@ export let mHttp = { post(controller, action, data, type) { let result = this.postBase(controller, action, data, type); if (result.code === 401) { - //生成新的token并且继续上传内容 - storage.removeToken(); return result; } return result; @@ -200,3 +195,5 @@ export let mHttp = { }); }, } + +module.exports = mHttp; diff --git a/version/27.3.0.js b/version/27.3.0.js new file mode 100644 index 0000000..2d0826b --- /dev/null +++ b/version/27.3.0.js @@ -0,0 +1,154 @@ +const C = {//G表示全局的,比如弹窗 + iptTag: 'dg0', //A0000 + submitTag: 'dj2', //A0010 + swipeWindow: '1',//A0020 + indexBottomMenu: 'u+h',//A0030 + text1: 'android:id/text1',//A0040 + text1a: 'text1',//A0040A + container: 'container',//A0050 + indexTopMenu: 'yic',//A0060 + searchTag: 'et_search_kw',//A0070 + focusTag: ['q1y', 'q1z'],//A0080 A0081 + userTag: 'pgx',//A0090 + focusText: ['已关注', '互相关注', '取消关注', '关注'],//A0100 A0101 A0102 A0103 + userMainTag: ['y=3', 'y=7'],//关注数量,粉丝数量 tag // A0110 A0111 + fansNickTag: 'yq3',//很多地方使用 // A0120 + rootLayout: 'root_layout', //A0130 + privateAccount: '私密账号',// A0140 + userListTop: 'u-o', //粉丝、关注、用户列表头部,防止列表滑动超出 + userListHead: 'bj', +} + +const C270301 = { + C: C, + Index: { + //首页 + intoHome: [C.indexBottomMenu, '首页'], //B0000 B0001 + intoMyMessage: [C.indexBottomMenu, '消息'],//B0010 B0011 + intoMyPage: [C.indexBottomMenu, '我'],//B0020 B0021 + intoMyLikeVideo: [C.text1, '喜欢', C.container],//B0030 B0031 B0032 + intoLocal: [C.indexTopMenu, 'close', C.indexBottomMenu],//B0040 B0041 B0042 + intoRecommend: [C.indexTopMenu, '推荐'],//B0050 B0051 + getMsgCount: ['u_z', '[\\d]+'],//B0060 B0061 + intoSearchPage: ['hfr'],//B0070 + inRecommend: ['yic', '推荐', '已选中,推荐,按钮']//B0080 B0081 B0082 + }, + + Message: { + //消息页面 + showAll: ['text', '查看全部'], //C0000 C0001 + ////C0010 C0011 C0012 C0013 C0014 C0015 C0016 // C0017 C0018 C0019 C0010A C0010B + backMsg: ['red_tips_count_view', '未读消息', 'tv_title', '互动消息', 'jf', 'android.view.ViewGroup', 'c2s', '赞', 'c5f', '回复评论', C.iptTag, 'ti6'], + search: ['k0t', '搜索', C.searchTag],//C0020 C0021 + intoFansGroup: ['c6k', '群聊', 'content_container', 'ojv'],//C0030 C0031 C0032 C0033 + intoGroupUserList: ['r=7', '更多', '群成员按钮', '查看群成员', 'content', 'tv_name', 'ojv'],//C0040 C0041 C0042 C0043 // C0044 C0045 C0046 + fansSwipe: ['nrj'], + }, + + User: { + //用户页面 + //D0000 D0001 D0002 D0003 D0004 // D0005 D0006 D0007 D0008 + privateMsg: ['title', C.privateAccount, 'v0f', '更多', 'desc', '发私信', 'n-v', 'j2', '私信功能已被封禁'], + getNickname: ['oth', ',复制名字'],// D0010 D0011 + getDouyin: ['y1j', '抖音号:', 'y_7'],//D0020 D0021 D0022 + getZanCount: ['y=0'],//D0030 + getFocusCount: [C.userMainTag[0]],//D0040 + getFansCount: [C.userMainTag[1]],//D0050 + getIntroduce: [C.userTag],//D0060 + getIp: [C.userTag],//D0070 + getAge: [C.userTag],//D0080 + getWorksTag: ['作品', C.text1a],//D0090 + isPrivate: [C.privateAccount, '封禁', '账号已经注销'],//D0100 D0101 D0102 + isFocus: [C.focusTag[1], C.focusText[0], C.focusText[1]],//D0110 D0111 D0112 + focus: [C.focusTag[0], C.focusTag[1], C.focusText[0], C.focusText[1]],//D0120 D0121 D0122 D0123 + cancelFocus: [C.focusTag[1], 'l2+', C.focusText[2], C.focusTag[0]],//D0130 D0131 D0132 D0133 + ////D0140 D0141 D0142 D0143 //D0144 D0145 D0146 D0147 //D0148 D0149 D0140A D0140B + cancelFocusList: [C.userMainTag[1], 'yp-', C.rootLayout, C.fansNickTag, 'title_bar', 'br+', 'n=y', 'title', C.focusText[2], C.focusText[1], C.focusText[3], C.focusText[0]], + ////D0150 D0151 D0152 D0153 //D0154 D0155 D0156 D0157 + fansIncList: [C.userMainTag[1], 'u-o', C.rootLayout, C.fansNickTag, 'r94', 'pgn', 'l_f', '点赞'], + ////D0160 D0161 D0162 D0163 //D0164 D0165 D0166 + focusUserList: [C.userMainTag[0], C.userMainTag[1], 'u-o', C.rootLayout, C.fansNickTag, 'r94', 'v0f'], + intoFocusList: [C.userMainTag[1], 'yp-'],//D0170 D0171 + focusListSearch: ['gly', C.fansNickTag, 'txt_desc'],//搜索框,昵称 ,账号 //D0180 D0181 D0182 + viewFansList: ['y=w', 'xcr', C.rootLayout, C.fansNickTag, 'title_bar'], //D0190 D0191 D0192 D0193 D0194 + hasAlertInput: ['n-v'], //D0200 + }, + + Comment: { + //评论页面 + getAvatarTag: ['avatar'],//E0000 + getNicknameTag: ['title'],//E0010 + getTimeTag: ['dls'],//E0030 + getIpTag: ['did'],//E0040 + getZanTag: ['e3b', 'lo+'],//E0050 E0051 + isAuthor: ['d6s', '作者'],//E0060 E0061 + getContent: [',,,,'],//E0070 + isZan: ['已选中'],//E0080 + swipeTop: [C.swipeWindow],//E0090 + getList: ['d6s'],//E0100 + closeCommentWindow: ['back_btn', '关闭'],//E0110 E0111 + backMsg: [C.iptTag, C.submitTag],//E0120 E0121 + commentMsg: [C.iptTag, C.submitTag],//E0130 E0131 + iptEmoj: ['gbx', 'gbi'],//E0140 E0141 + commentAtUser: [C.iptTag, 'at', 'tv_name', '最近@', C.submitTag],//E0150 E0151 E0152 E0153 E0154 + commentImage: ['o-8', '表情', 'u-n', '自定义表情', C.swipeWindow],//E0160 E0161 E0162 E0163 E0164 + zanComment: ['title', '评论'],//E0170 E0171 + }, + + Search: { + //搜索页面 + intoSearchList: [C.searchTag, 'x=2', '搜索', '视频', '用户', C.text1a],//F0000 F0001 F0002 F0003 F0004 F0005 + intoSearchLinkVideo: [C.searchTag, 'x=2', '搜索'],//F0010 F0011 F0012 + intoSearchVideo: ['desc', 'sg6', 'j='],//F0020 F0021 F0022 + intoSeachUser: ['抖音号:', '抖音号'],//F0030 F0031 + intoLiveRoom: ['抖音号:', '抖音号'],//F0040 F0041 + intoUserLiveRoom: ['直播', '抖音号'],//F0050 + userList: ['u-o', 'android.widget.FrameLayout', '粉丝', '抖音号:', 'v0f'] //F0060 F0061 F0062 F0063 + }, + + Live: { + //直播页面 + getUserCountTag: ['o4u'], // G0000 + getUserTags: ['ah0', '[\\s\\S]+'], // G0010 G0011 + intoFansPage: ['opq'],// G0020 + listenBarrage: ['text', 'android.widget.TextView'], // G0030 G0031 + loopClick: ['关闭'], // G0040 + // G0050 G0051 G0052 G0053 // G0054 G0055 G0056 + comment: ['f9h', 'android.widget.EditText', 'x_9', '发送', 'd+g', 'list', 'android.widget.FrameLayout'], + }, + + Common: { + backHome: [C.indexBottomMenu],//H0000 + swipeSearchUserOp: ['l_a'],//H0010 + swipeFansListOp: ['l5'],//H0020 + swipeFocusListOp: ['l5'],//H0030 + swipeCommentListOp: [C.swipeWindow],//H0040 + }, + + Video: { + //视频页面 主页视频、用户视频、搜索视频。 用户视频和搜索视频一致 + getZanTag: ['e3z'],//I0000 + isZan: ['已点赞'],//I0010 + getCommentTag: ['dms'],//I0020 + getCollectTag: ['dcx'],//I0030 + isCollect: ['未选中'],//I0040 + getShareTag: ['tu3'],//I0050 + getContentTag: ['desc'],//I0060 + getTitleTag: ['title'],//I0070 + getAtNickname: ['@'],//I0080 + getTimeTag: ['a=6'],//I0090 + isLiving: ['mdo', '点击进入直播间', 'yz4', '直播中'],//I0110 I0111 I0112 I0113 + getAvatar: ['user_avatar'],// I0120 + getLivingAvatarTag: ['yz4', '直播中'],//I0130 I0131 + getLivingNickname: ['直播中'],//I0140 + viewDetail: ['查看详情'],//I0150 + getDistanceTag: ['p_j', 'qj3'],//I0160 I0161 + getInTimeTag: ['x19'],//I0170 + intoUserVideo: ['android:id/text1', '作品', 'container', 'yh1'],//I0180 I0181 I0182 + isFocus: ['hrg'],//I0190 + zanList: ['yj6'], + }, +} + + +module.exports = C270301; diff --git a/version/29.7.0.js b/version/29.7.0.js new file mode 100644 index 0000000..ecd57c1 --- /dev/null +++ b/version/29.7.0.js @@ -0,0 +1,162 @@ +const C = {//G表示全局的,比如弹窗 + iptTag: 'c4g', //A0000 + submitTag: 'c7u', //A0010 + swipeWindow: '1',//A0020 + indexBottomMenu: 'wl0',//A0030 + text1: 'android:id/text1',//A0040 + text1a: 'text1',//A0040A + container: 'container',//A0050 + indexTopMenu: 'z5+',//A0060 + searchTag: 'et_search_kw',//A0070 + focusTag: ['ryd', 'rye'],//A0080 A0081 + userTag: 'p=u',//A0090 用户承载年龄、IP等标签的容器 + focusText: ['已关注', '互相关注', '取消关注', '关注'],//A0100 A0101 A0102 A0103 + userMainTag: ['0xh', '0xl'],//关注数量,粉丝数量 tag // A0110 A0111 + fansNickTag: '0bq',//很多地方使用 // A0120 + rootLayout: 'root_layout', //A0130 + privateAccount: '私密账号',// A0140 + userListTop: 'wk5', //粉丝、关注、用户列表头部,防止列表滑动超出 + userListHead: 'v9f', +} + +const C290701 = { + C: C, + Index: { + //首页 + intoHome: [C.indexBottomMenu, '首页'], //B0000 B0001 + intoMyMessage: [C.indexBottomMenu, '消息'],//B0010 B0011 + intoMyPage: [C.indexBottomMenu, '我'],//B0020 B0021 + intoMyLikeVideo: [C.text1, '喜欢', C.container],//B0030 B0031 B0032 + intoLocal: [C.indexTopMenu, 'close', C.indexBottomMenu],//B0040 B0041 B0042 + intoRecommend: [C.indexTopMenu, '推荐', '团购'],//B0050 B0051 + getMsgCount: ['wj+', '[\\d]+'],//B0060 B0061 + intoSearchPage: ['hcm'],//B0070 + inRecommend: [C.indexTopMenu, '推荐', '已选中,推荐,按钮']//B0080 B0081 B0082 + }, + + Message: { + //消息页面 + showAll: ['text', '查看全部'], //C0000 C0001 + ////C0010 C0011 C0012 C0013 C0014 C0015 C0016 // C0017 C0018 C0019 C0010A C0010B 目前无相关功能模块,暂时不用处理 + backMsg: ['red_tips_count_view', '未读消息', 'tv_title', '互动消息', 'jf', 'android.view.ViewGroup', 'c2s', '赞', 'c5f', '回复评论', C.iptTag, 'ti6'], + search: ['lb8', '搜索', C.searchTag],//C0020 C0021 + intoFansGroup: ['cok', '群聊', 'content_container', 'o-l'],//C0030 C0031 C0032 C0033 + //tv_name未发现在哪,貌似不存在了 + intoGroupUserList: ['s-s', '更多', '群成员按钮', '查看群成员', 'content', 'tv_name', 'o-l'],//C0040 C0041 C0042 C0043 // C0044 C0045 C0046 + fansSwipe: ['oc8'], + }, + + User: { + //用户页面 + //D0000 D0001 D0002 D0003 D0004 // D0005 D0006 D0007 D0008 + privateMsg: ['title', C.privateAccount, 'xct', '更多', 'desc', '发私信', 'o0x', 'ji-', '私信功能已被封禁'],//1094474339私密账号 + getNickname: ['pi9'],// D0010 + getDouyin: ['0m7', '抖音号:', '0yf'],//D0020 D0021 D0022 + getZanCount: ['0xe'],//D0030 + getFocusCount: [C.userMainTag[0]],//D0040 + getFansCount: [C.userMainTag[1]],//D0050 + getIntroduce: [C.userTag],//D0060 + getIp: [C.userTag],//D0070 + getAge: [C.userTag],//D0080 + getWorksTag: ['作品', C.text1a],//D0090 D0091 + isPrivate: [C.privateAccount, '封禁', '账号已经注销'],//D0100 D0101 D0102 + isFocus: [C.focusTag[1], C.focusText[0], C.focusText[1]],//D0110 D0111 D0112 + focus: [C.focusTag[0], C.focusTag[1], C.focusText[0], C.focusText[1]],//D0120 D0121 D0122 D0123 + cancelFocus: [C.focusTag[1], 'lx4', C.focusText[2], C.focusTag[0]],//D0130 D0131 D0132 D0133 + ////D0140 D0141 D0142 D0143 //D0144 D0145 D0146 D0147 //D0148 D0149 D0140A D0140B + cancelFocusList: [C.userMainTag[1], '0a0', C.rootLayout, C.fansNickTag, 'title_bar', '0az', 'n-2', 'title', C.focusText[2], C.focusText[1], C.focusText[3], C.focusText[0]], + ////D0150 D0151 D0152 D0153 //D0154 D0155 D0156 D0157 + fansIncList: [C.userMainTag[1], 'wk5', C.rootLayout, C.fansNickTag, 'XXX', 'p=k', 'mnj', '点赞'],//XXX表示不再使用,只是占位 + ////D0160 D0161 D0162 D0163 //D0164 D0165 D0166 + focusUserList: [C.userMainTag[0], C.userMainTag[1], 'wk5', C.rootLayout, C.fansNickTag, 'XXX', 'xct'], + intoFocusList: [C.userMainTag[1], '0a0'],//D0170 D0171 + focusListSearch: ['fwe', C.fansNickTag, 'txt_desc'],//搜索框,昵称 ,账号 //D0180 D0181 D0182 + viewFansList: ['0w+', 'yxj', C.rootLayout, C.fansNickTag, 'title_bar'], //D0190 D0191 D0192 D0193 D0194 + hasAlertInput: ['YYY'], //D0200 //YYY 表示暂未发现对应内容 + head: ['p=k', 'mnj', '点赞'],// + more: ['jzz', '更多面板', 'y7y', '经营工具', '高级在线预约', '预览', '发送'], + }, + + Comment: { + //评论页面 + getAvatarTag: ['avatar'],//E0000 + getNicknameTag: ['title'],//E0010 + getTimeTag: ['c9s'],//E0030 + getIpTag: ['dsc'],//E0040 + getZanTag: ['ero'],//E0050 E0051(第二个已被移除,后续发现再补充) + isAuthor: ['dsc', ',作者,'],//E0060 E0061 + getContent: [','],//E0070 + isZan: ['已选中'],//E0080 + //swipeTop: [C.swipeWindow],//E0090 + getList: ['dsc'],//E0100 + closeCommentWindow: ['back_btn', '关闭'],//E0110 E0111 + backMsg: [C.iptTag, C.submitTag],//E0120 E0121 + commentMsg: [C.iptTag, C.submitTag],//E0130 E0131 + iptEmoj: ['gbx', 'gbi'],//E0140 E0141 暂未使用,忽略掉了 + commentAtUser: [C.iptTag, 'at', 'tv_name', '最近@', C.submitTag],//E0150 E0151 E0152 E0153 E0154 + commentImage: ['i7r', '表情', 'wk3', '自定义表情', 'rw3'],//E0160 E0161 E0162 E0163 E0164 + zanComment: ['title', '评论'],//E0170 E0171 + getBackMsg: ['s4y'] + }, + + Search: { + //搜索页面 + intoSearchList: [C.searchTag, 'zt0', '搜索', '视频', '用户', C.text1a],//F0000 F0001 F0002 F0003 F0004 F0005 + intoSearchLinkVideo: [C.searchTag, 'zt0', '搜索'],//F0010 F0011 F0012 + intoSearchVideo: ['desc', 'ti=', 'aj6'],//F0020 F0021 F0022 + intoSeachUser: ['抖音号:', '抖音号'],//F0030 F0031 + intoLiveRoom: ['抖音号:', '抖音号'],//F0040 F0041 + intoUserLiveRoom: ['直播', '抖音号'],//F0050 + userList: ['wk5', 'android.widget.FrameLayout', '粉丝', '抖音号:', 'xct'], //F0060 F0061 F0062 F0063 + searchFilter: ['g5z', '筛选',] + }, + + Live: { + //直播页面 + getUserCountTag: ['puh'], // G0000 + getUserTags: ['_a', '[\\s\\S]+', 'android.widget.FrameLayout'], // G0010 G0011 列表元素,列表元素点击后的昵称控件 + intoFansPage: ['pes'],// G0020 + listenBarrage: ['text', 'android.widget.TextView'], // G0030 G0031 + loopClick: ['关闭'], // G0040 + // G0050 G0051 G0052 G0053 // G0054 G0055 G0056 + comment: ['fz0', 'android.widget.EditText', 'zu6', '发送', 'f50', 'list', 'android.widget.FrameLayout'], + }, + + Common: { + backHome: [C.indexBottomMenu],//H0000 + swipeSearchUserOp: ['mne'],//H0010 + swipeFansListOp: ['syq'],//H0020 + swipeFocusListOp: ['syq'],//H0030 + swipeCommentListOp: ['rw3'],//H0040 + }, + + Video: { + //视频页面 主页视频、用户视频、搜索视频。 用户视频和搜索视频一致 + getZanTag: ['er-'],//I0000 + isZan: ['已点赞'],//I0010 + getCommentTag: ['c=t'],//I0020 + getCollectTag: ['c0e'],//I0030 + isCollect: ['未选中'],//I0040 + getShareTag: ['u25'],//I0050 + getContentTag: ['desc'],//I0060 + getTitleTag: ['title'],//I0070 + getAtNickname: ['@'],//I0080 + getTimeTag: ['a4y'],//I0090 当前版本不准确,包含了IP信息:“2024-04-09 01:33 IP属地:湖北” + isLiving: ['nqn', '点击进入直播间', '0lo', '直播中'],//I0110 I0111 I0112 I0113 + getAvatar: ['user_avatar'],// I0120 + getLivingAvatarTag: ['0lo', '直播中'],//I0130 I0131 + getLivingNickname: ['直播中'],//I0140 + viewDetail: ['查看详情'],//I0150 + getDistanceTag: ['reh', 'q43'],//I0160 I0161 + getInTimeTag: ['zkh'],//I0170 + intoUserVideo: ['android:id/text1', '作品', 'container', 'z5t'],//I0180 I0181 I0182 + isFocus: ['hpt'],//I0190 + zanList: ['z7+'] //点赞列表昵称 + }, + + GroupBuy: { + shopContainer: ['eu=', '用户评价', '查看全部'], + } +} + +module.exports = C290701; diff --git a/version/V.js b/version/V.js new file mode 100644 index 0000000..792fb9f --- /dev/null +++ b/version/V.js @@ -0,0 +1,26 @@ +let C270301 = require("version/27.3.0.js"); +let C290701 = require("version/29.7.0.js"); + +let VERSION = { + "270301": C270301, + "290701": C290701 +} + +let version = App.getAppVersionCode('com.ss.android.ugc.aweme'); +let value = undefined; +for (let key in VERSION) { + if (version === parseInt(key)) { + value = VERSION[key]; + break; + } +} + +if (!value) { + //版本号不对,直接停止 + FloatDialogs.show('提示', '当前抖音版本号不支持!') + System.exit(); +} + +let V = value; + +module.exports = V; diff --git a/version/XhsV.js b/version/XhsV.js new file mode 100644 index 0000000..6889bfc --- /dev/null +++ b/version/XhsV.js @@ -0,0 +1,25 @@ +let C8380 = require("version/xhs.8.38.0.js"); + +let VERSION = { + "8380830": C8380, +} + +let version = App.getAppVersionCode('com.xingin.xhs'); +let value = undefined; +for (let key in VERSION) { + console.log('版本号比较:', version, key);//版本号比较: 8380830 8.38.0 + if (version === parseInt(key)) { + value = VERSION[key]; + break; + } +} + +if (!value) { + //版本号不对,直接停止 + FloatDialogs.show('提示', '当前小红薯版本号不支持!') + System.exit(); +} + +let XhsV = value; + +module.exports = XhsV; diff --git a/version/help.md b/version/help.md new file mode 100644 index 0000000..7cff9d5 --- /dev/null +++ b/version/help.md @@ -0,0 +1,321 @@ +## 抖音标注说明 + +#### A0000 +> 首页输入框的控件,可以点击 + +#### A0010 +> 首页输入框的输入内容后,出现的“发送”按钮,可以点击 + +#### A0020 +> 滑动窗口 + +#### A0030 +> 主界面底部菜单,父级可以被点击 + +#### A0040 和 A0040A +> 一般的textView文本,如果使用Common.aId()方法,则使用A0040A + +#### A0050 +> 用户主页的视频容器 + +#### A0060 +> 主界面顶部的导航元素,比如“同城”,“推荐”等;父级可以被点击 + +#### A0070 +> 搜索输入框元素,可以被点击和输入 + +#### A0070 +> 搜索输入框元素,可以被点击和输入 + +#### A0080 和 A0081 +> 用户主页关注按钮,分别表示“关注”按钮,和“已关注”按钮;都可以被点击 + +#### A0090 +> 用户界面的详情介绍,这个控件的子控件包含了:用户介绍,IP,年龄,性别等控件 + +#### A0100 A0101 A0102 A0103 +> 这几个描述为关注相关的控件内容,各个版本应该是一致的 + +#### A0110 A0111 +> 用户主页的,关注数量和粉丝数量控件;注意,如果是读取当前账号内容,则不一样。 + +#### A0120 +> 粉丝昵称控件,比如当前账号的粉丝列表的控件,关注列表控件等;也包括别人的粉丝和关注列表 + +#### A0130 +> 粉丝列表,关注列表的container;应该各个版本不会有变化 + +#### A0140 +> 私密账号控件描述,基本各个版本不会有变化 + + + +#### B0001 +> 主界面“首页”的底部导航 + +#### B0011 +> 主界面“消息”的底部导航 + +#### B0021 +> 主界面“我”的底部导航 + +#### B0031 +> 当前账号主页,“喜欢”Tab(和“作品”并列的位置) + +#### B0041 +> 打开同城,选择城市的左上角“关闭”控件 + +#### B0051 +> 主界面,上方的“推荐”Tab控件 + +#### B0060 B0061 +> 两个联合,表示主界面“消息”Tab的消息数量控件 + +#### B0070 +> 主界面的搜索图标控件,注意是外部的可以点击的,不是不能点击的那个ID + +#### B0080 B0081 B0082 +> 组合使用,表示主界面上方的“推荐”Tab控件被选中 + + + +#### C0000 C0001 +> 消息界面,查看所有消息的;各个版本应该有所变化;但是目前这个没有使用,可以不写 + +#### C0010 C0011 +> 消息页,未读消息控件,两个联合使用;目前未使用 + +#### C0012 C0013 +> 消息页,互动消息控件,两者联合使用;目前未使用 + +#### C0014 C0015 +> 表示多少分钟,小时前的消息控件 + +#### C0016 C0017 +> 互动消息详情,“赞”他人给当前账号的评论的“回赞”控件,两者联合使用 + +#### C0018 C0019 +> 互动消息详情,“评论“他人给当前账号的评论的“回复评论”控件,两者联合使用 + +#### C0020 C0021 +> 消息Tab页的,搜索图标控件;两个组合使用查找一个控件 + +#### C0030 C0031 +> 群聊搜索结果标题控件,介于“输入框”和“搜索结果”之间的文本标题控件 + +#### C0032 C0033 +> 群聊搜索结果记录控件,和记录对应的群名称控件;搜索结果会对应N个这样的控件 + +#### C0040 C0041 +> 粉丝群右上角的更多按钮控件 + +#### C0042 C0043 +> 查看群成员的连续的两个控件 + +#### C0044 C0045 C0046 +> 群成员列表控件; +> 群成员昵称控件; + + +#### D0000 D0001 +> 用户主页“私密账号”控件查找,两者同时使用 + +#### D0002 D0003 +> 用户页面“更多”按钮 + +##### D0004 D0005 +> 发私信控件 + +#### D0006 +> 私信输入框控件 + +#### D0007 +> 私信发送按钮控件 + +#### D0008 +> 私信功能已被封禁控件,版本迭代不会变动 + +#### D0010 D0011(29.7.0已经移除) +> 用户中心,获取用户昵称,D0011是昵称中携带的“额外”文字,需要移除 + +#### D0020 D0021 D0022 +> 一版账号的抖音号控件,D0021是“额外”的文字,D0022是特殊的抖音账号 + +#### D0030 +> 用户中心,点赞数控件 + +#### D0090 D0091(29.7.0添加,联合使用) +> 作品数控件 + +#### D0101 D0102 +> 封禁、账号已注销控件,基本不会变化 + +#### D0131 +> 取消关注控件(用户中心取消) + +#### D0141 +> 关注数量控件(标题上的) + +#### D0144 D0145 D0146 D0147 +> 顶部tab容器控件,防止用户列表划到最上方的判断; +> 是否已关注(含“已关注”、“互相关注”)控件; +> “已关注”后面的“三个点”控件; +> “取消关注”控件的ID + +#### D0154 D0155 D0156 D0157 +> 第一个用户很可能是自己判断控件; +> 头像控件 +> 头像点赞控件(D0156和D0157) + +#### D0165 D0166 +> 第一个用户很可能是自己判断控件; +> 用户界面更多按钮,同D0002 + +#### D0171 +> 关注列表,关注数控件:“我的关注(22人)” + +#### D0180 D0182 +> 关注列表,搜索框控件; +> 关注列表搜索结果,账号控件; + +#### D0190 D0191 +> 我的粉丝控件(最外层,可以点击的); +> 我的粉丝列表,粉丝总数控件 + +#### D0194 +> 粉丝列表顶部tab容器控件,用于判断粉丝用户滑动的top距离 + +#### D0200 +> 用户中心弹窗控件(部分企业账号,进入用户中心,直接弹出对话窗口) + +#### E0000 E0010 +> 评论列表头像控件;评论列表昵称控件; + +#### E0030 E0040 +> 评论列表时间控件;评论列表IP控件; + +#### E0050 E0051 +> 点赞控件;不同机型略有差异;需要适配两种机型 + +#### E0060 E0061 +> 是否是作者 + +#### E0070 +> 评论内容切割字符串 + +#### E0080 +> 是否已点赞 + +#### E0100 +> 获取评论列表控件;多个评论container; + +#### E0110 E0111 +> 关闭评论窗口控件 + +#### E0140 E0141 +> 在大的容器控件中找到emoji控件; + +#### E0151 E0152 E0153 +> 联合使用,@对应的账号控件;暂未使用,可以忽略; + +#### E0160 E0161 E0162 E0163 +> 输入框右侧的表情控件 +> 输入框展开后,下面的收藏表情(心形图标)控件; +> 自定义表情控件; + +#### E0170 E0171 +> 评论窗口标题控件,组合使用; + + + +#### F0001 F0002 F0003 F0004 +> 前两个控件是组合使用,搜索框控件; +> 搜索结果的“视频”、“用户”列表控件; + +#### F0011 F0012 +> 同F0001、F0002 + +#### F0020 F0021 F0022 +> 进入搜索视频的三种方式:descTag,container,titleTag + +#### F0030 F0031 +> 查找抖音号 + +#### F0040 F0041 +> 查找抖音号 + +#### F0050 +> 直播视频搜索 + +#### F0060 F0061 F0062 F0063 +> 搜索框头部tab控件,用于判断用户列表滑动,是否超出顶部 +> 用户列表容器控件; +> 内容控件,过滤粉丝数量;”粉丝数:2323“; +> 内容控件,过滤抖音账号;”抖音号:23423“; + + + +#### G0000 +> 粉丝在线数量控件 + +#### G0010 G0011 +> 获取粉丝列表,两个字段组合使用 + +#### G0020 +> 粉丝头像,点击进入粉丝主页控件; + +#### G0030 G0031 +> 粉丝弹幕控件,组合使用; + +#### G0040 +> 弹窗和输入框等控件,遇到直接关闭; + +#### G0050 G0051 G0052 G0053 +> 直播间输入框控件,点击弹出输入框控件 +> 输入框控件,可以设置内容; +> G0052和G0053,发送控件,组合使用; + +#### G0054 G0055 G0056 +> 点击表情控件;表情容器控件;表情控件className + + + +#### H0010 H0020 H0030 +> 滑动搜索用户列表控件;滑动粉丝类别控件;滑动关注列表控件; + + + +#### I0001 I0010 I0020 I0030 I0040 +> 点赞控件;是否已点赞判断文字,一般不会变化;评论控件;收藏控件;是否收藏判断; + +#### I0050 I0060 I0070 +> 分享控件;内容控件;标题控件; + +#### I0080 I0090 +> 通过@获取用户昵称控件;视频发布时间控件; + +#### I0110 I0111 I0112 I0113 +> I0110 I0111:头像直播控件; +> I0112 I0113:屏幕中心直播提示控件; + +#### I0120 +> 用户头像控件; + +#### I0130 I0131 +> 正在直播中用户头像,第一个ID查找昵称,第二个判断直播中控件;组合使用; + +#### I0140 +> 获取直播昵称控件; + +#### I0150 +> 广告控件,”查看详情“,一般不会变化; + +#### I0160 I0161 +> 同城距离获取,两种方式 + +#### I0170 +> 同城时间获取控件 + +#### I0180 I0181 I0182 +> 点击用户主页”作品“控件,组合使用; +> 进入用户作品控件 \ No newline at end of file diff --git a/version/xhs.8.38.0.js b/version/xhs.8.38.0.js new file mode 100644 index 0000000..4e76833 --- /dev/null +++ b/version/xhs.8.38.0.js @@ -0,0 +1,64 @@ +const C8380 = { + Common: { + backHome: ['iqq', '首页'], + swipeSearchUserOp: ['暂时无相关逻辑'], + swipeFansListOp: ['k11'], + swipeCommentListOp: ['gdo'], + swipeFocusListOp: ['g5d'], + swipeRecommendListOp: ['hf5'], + }, + + User: { + fans: ['iqg', '关注', '粉丝', '推荐', '已选定', 'cms', 'jqy', 'as2', 'jnz'],//粉丝列表 + account: ['h5g'], + nickname: ['h5e'], + focus: ['jz0', '关注', '发消息'], //关注按钮 和 发消息按钮,两者ID是一样的,关注之后,关注按钮变为发消息 + sendMsg: ['jz1', '发消息'],//没有关注的时候,关注按钮右侧的“发消息”按钮 + msgBtn: ['awc'], + sendBtn: ['f7c'],//消息发送按钮 + fansText: ['ccd'], + showAllFans: ['ixu', '查看全部'], //粉丝页面 ,需要点击才能查看全部 + back: ['h45', '返回'], + }, + + Work: { + zan: ['gef', 'fpp'],//图文赞,视频赞 + collect: ['gcm', 'fpk'], + zanCollectionHead: ['iqg', '赞和收藏'], //赞和收藏12 + zanUserList: ['jq', 'android.view.ViewGroup', 'nickNameTV', 'jm8', '作者'],//我的作品下面的赞用户列表 + head: ['ejz'],//ejz是nickNameTV外层的标签,用于判断是否进入了笔记页面 + zanCount: ['gcr'], + commentCount: ['gcx'], + zanCommentList: ['gdo', 'ezl'],//评论赞列表,第一个是滑动容器,第二是赞控件 + intoBottom: ['f0_', '到底了'], + comment: ['e1d', 'f9d'],//初始的输入框,最下面的,不是笔记内的;第二个是点击输入框之后的输入框元素 + sendBtn: ['fif', '发送'], + videoComment: ['commentLayout', 'b98'],//评论按钮;评论区滑动 + videoCommentOpen: ['e1c'], + like: ['g1_', '你可能感兴趣的人'], + videoNickname: ['matrixNickNameView'], + videoFocus: ['matrixFollowView'], + focus: ['followTV'], + nickname: 'nickNameTV', + VideoNickname: 'jzg',//desc:作者 XXX + title: 'gfd', + }, + + Index: { + intoIndex: ['发现'], + container: ['fcc', '视频 ', '笔记 ', '赞'], // 【视频 南阳知府衙门:一镜到底沉浸式体验明清地牢 来自安西承宣布政使 7663赞】 + containerCity: ['f09'], + zan: ['ecs'],//主页笔记视频点赞 + swipe: ['fcc', 'f09'], //分别是“发现”、“武汉” 两个类目中的滑动 + intoSearchPage: ['hw4', '搜索'], + }, + + Search: { + container: 'fhj',//可滑动 + intoSearchList: ['fhw', 'fi1', '搜索'], + intoSearchVideo: ['gfb', 'ge2', 'a8t'],//标题,封面,昵称和头像整体 + searchTop: 'e30', + } +} + +module.exports = C8380; diff --git a/xhs.js b/xhs.js new file mode 100644 index 0000000..a41e20e --- /dev/null +++ b/xhs.js @@ -0,0 +1,133 @@ + +//console.log(textContains('小红薯').findOne().parent().parent()); + + +//console.log(scrollable(true).find()); + +//id('com.xingin.xhs:id/k9v').findOne().scrollForward(); + +//id('com.xingin.xhs:id/g5d').findOne().scrollForward();//关注滑动 +//id('com.xingin.xhs:id/k11').findOne().scrollForward();//粉丝滑动 +//id('com.xingin.xhs:id/hf5').findOne().scrollForward();//推荐滑动 + +// let contains = id('com.xingin.xhs:id/cms').find(); + +// console.log(contains[0].children().findOne(id('com.xingin.xhs:id/jqy'))); + +// console.log(contains[0].children().findOne(id('com.xingin.xhs:id/jnz'))); + +// let a = textContains('小达人').findOne(); + +// console.log(a); +// log(a.parent()); +// log(a.parent().parent()); + +// let containers = id('com.xingin.xhs:id/ks').findOne().children().find(className('android.view.ViewGroup')); + +// for (let i in containers) { +// log(containers[i].children()); +// console.log(containers[i].children().findOne(id('com.xingin.xhs:id/nickNameTV'))); +// break; +// } + + +// let a = scrollable(true).find(); +// console.log(a); + +// id('com.xingin.xhs:id/jq').findOne().scrollForward(); + +// let tag = descContains('发现').findOne(); +// console.log(tag.parent().children()); + +// console.log(textContains('39').findOne()); +// console.log(textContains('39').findOne().parent().parent()); +// console.log(textContains('39').findOne().parent().parent().children()); + +// let tag = id('com.xingin.xhs:id/f05').filter(v => { +// return v && v.bounds() && v.bounds().left > 0 && v.bounds().top > 0; +// }).findOne(); + +// log(tag.children()); +// log(tag.parent().parent().parent().parent()); + +// let tag = id('fcc').findOne(); +// log(tag); +// log(tag.children()); + + +// let a = scrollable(true).find(); +// console.log(a); + +// id('com.xingin.xhs:id/gdo').findOne().scrollForward(); + +// id('com.xingin.xhs:id/b98').findOne().scrollForward(); + +// console.log(textContains('小红书').find()); + +// log(scrollable(true).find()); +// let tag = id('com.xingin.xhs:id/jq').findOne(); +// tag.scrollForward(); + + + +// log(id('com.xingin.xhs:id/jq').findOne().children().find(id('com.xingin.xhs:id/nickNameTV'))); + + +// console.log(scrollable(true).find()); +// id('com.xingin.xhs:id/gdo').findOne().scrollForward(); + +let Common = { + id(idName) { + return id('com.xingin.xhs:id/' + idName); + }, + + click(tag) { + click(tag.bounds().centerX(), tag.bounds().centerY()); + }, + + sleep(second) { + sleep(second); + } +} + +// function privateMsg() { +// let msg = '你好啊'; +// let sendIptTag = Common.id('awc').findOne(); +// console.log('开始设置私信', msg); +// sendIptTag.setText(msg); +// Common.sleep(500 + 500 * Math.random()); + +// //发送 +// let sendBtnTag = Common.id('f7c').findOne(); +// Common.click(sendBtnTag); +// console.log('点击发送'); +// } + +// privateMsg(); + +// function swipeFocusListOp() { +// let swipeFocusListOpTarge = this.id('g5d').scrollable(true).filter((v) => { +// return v && v.bounds() && v.bounds().top > 0 && v.bounds().left >= 0 && v.bounds().top >= 0; +// }).findOnce(); +// swipeFocusListOpTarge.scrollForward(); +// } + +// swipeFocusListOp(); + + +// console.log(scrollable(true).find()); +// id('com.xingin.xhs:id/fcc').findOne().scrollForward(); +// id('com.xingin.xhs:id/f09').findOne().scrollForward(); + +// let sendTag = Common.id('fif').textContains('发送').find(); +// log(sendTag.click()); + +// log(textContains('游泳').find()); + +// log(textContains('感觉').findOne().parent().parent()); + +let tag = Common.id('f09').findOne(); +log(tag); +if (tag) { + tag.scrollForward(); +}