当前位置:   article > 正文

Autojs自动化 实现自动删除公众号文章(通过订阅号助手删除)_hjaa93.top

hjaa93.top

设备

小米9

效果

autojs1

 

autojs2

代码

UI

  1. "ui";
  2. const storage = storages.create("dinyue");
  3. auto()
  4. var search_value = ''
  5. if(storage.contains('search_value')){
  6. search_value = storage.get('search_value')
  7. }
  8. ui.layout(
  9. <vertical padding="30">
  10. <text textSize="16sp">输入要匹配的关键字</text>
  11. <input id="search" text="{{search_value}}"/>
  12. </vertical>
  13. );
  14. //创建新的线程
  15. threads.start(function () {
  16. createFloaty();
  17. });
  18. /**
  19. * 设置悬浮窗
  20. */
  21. function createFloaty() {
  22. // const Utils = require('lib')
  23. window = floaty.window(
  24. <vertical>
  25. <vertical id="start" bg="#000000" alpha="0.5" w="50" h="52" gravity="center">
  26. <img w="30" h="30" layout_gravity="center" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAcMUlEQVR4Xu1dCbAtVXVdK6U4V0SloqaMsRzQqEFxAAURAuIchQQcIgqCkSg4IApKFDGg8B0QBxwCCKJG4wAGRURQBEFwQgwIOIEaZ1SMiQMaV2o9T3/uf//d97rv3ef0cHtXdT3xn95n73163TPtgRgpmwUk3QbA5um5E4Bb1Hgszy9rPFcBuNIPyWuyKbHgjLng+oeoL6kCwd0nAOH/zwApQQbIEljSc0UCjv97pDksMAKkofEk3QrA/QE8BMB26WnIpWjzcwH4OQ/AF0j+rGjvPe9sBMgaAyjpzgAekJ5tAGzV8zG/CMD5AD7vh+Q3e65PVvFHgKxgXkk7AngsAP+9V9YRaJ/5pQDOBnAaSf8dacICI0CSMSRtDeAx6dliQb+SSwB8xA/JCxfUBhuovdAAkeTZoQKFl08jXW8BL8MqsHiWWUhaOIBI2gTAXgB2BbDzQo56c6XPBPAhAO8geV3z1/v7xsIARNKmAJ6ewHHP/g5Zq5JfZpAAOIHkz1uVpFDngweIpDskUHjW+MtCdh16N1cnoHhG+e6QlR0sQCT50q6aMUpd2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ebd79l4AbtJVww9MLuclsw/dcSQvHpJugwPIBFB8R+BUQwZK6SCfIX0jq+lyTQKGU/BcMUSlBwuQCaA4DY1B4se3ziPNbwEXVvWM8Q6S352fXXc5DB4gE0DZdGJGyZ0Os7sjPp9kPo0yMDxjLERW/YUByARQNkmziUt07Tzf97Iwb5+ZCiN5xrhuYbQe4ia9yeCl0FInjfCzTZN3F6Cts+U7qtJJEy5dAH1XVHHhZpBpAy1p6wQUg2WLBf0g7IlcgcIu/AtPI0BW+AQk7QjAqWYcUzH0/Yr3FWcBOG3MFbbxxzACZI3fSEl2Lffs4seReCVzC+f4Bfc9hXOBeYa4kKQT+I00xQIjQBp+GpJ8p2JPYu9Zqqchl6LNvZeongtI+u5ipJoWGAFS01CrNUuzTBXE5L/VU+qC0h+9Z4Lq8aXdlePsMP/gjgCZ34ZTOaTZpgLLnQDcosZjfr+s8VxVAWKcFfIN4v8DjrHRMqG8jI0AAAAASUVORK5CYII=" />
  27. <text text="开始" textColor="white" textSize="10" gravity="center" />
  28. </vertical>
  29. <vertical id="stop" bg="#000000" alpha="0.5" w="50" h="52" gravity="center" marginTop="20">
  30. <img w="30" h="30" layout_gravity="center" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAaGElEQVR4Xu2dCdBsRXXH//+UgppYAZWKmDKGUgEjBEUUlEUIi4IShQRcEg1PTDSuAVFAVMBAhKeCuCAqi0hiUIygKCKCssjmwhOECLiAcY9PwVARwVRO6j/pecz3fbPcnnv6TvdMn6pbI76+p7tP39/X+zlElWQWMLOHAdgsPJsAeHCDR+W5q8FzG4Bb9JBcm6wSC66YC15/l+qbWR+CzQeA0P8nQLoQAdKDJTw3B3D031VaWKACEmk8M3sIgG0A7Ahgp/BEauk0+eUA9FwB4Gskf9lp7oVnVgGZ0IBm9mgATw7P9gC2LbzNrwVwJYCv6iH53cLrk7T4FZAh5jWzXQHsDUC/WyRtgdkrvxHAJQDOJ6nfKgMWqIAEY5jZ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HPPytAAiS6laj7yimv7sbaf65gyRAKtYeW4V9P8tzYxkmZPjtAAiSCQ5CkdAIxrV0Fi+6hXA3gCpK3Tquoq/fMbKOwZ/HU4MMsh55isPqCQnC43CP3tGuWgPQr2MEVTQ9byrndNQC0r3IxyZ97KG2jw8zuB2C38Mipn8DIVdyvyXpWNGtAMh5yjWuD68Mlrm8B6D0kv+3ZaIO6zEzhuRVsRo820/Tb6Q73lHXLcki1vC7ZA1LAkKvJ9/E/fVjC728AjHseAGDc0wdBMChdaZLtkKpIQAobcpX2sXZd3qyHVEUDEnoTXcaRd4xUDrO7/mAWJT85kl7d1ldu18YqYoi13ChmpnIfGp4U8Um6bod5zk/xOXQ3XZGMZ3GKu5VtiwRkYMglhwACJVWkq1bGrS/jrADGVMFrcrBf0YAMgKKoRBp2pQgsmkM7lVYGBczUcCo6JmBuFZ0LQMLcRNF3+8OuFHHcc2u7HMujOOT94VRUNNkcK6MyzQ0gA72J7rzrePYqAA/M1fBzVi75JdMZulNJrpmnus0dIAOgaI9AroYESteXfObpGxlXl7UBDLnguXkeKz23gAyAIjc0gkSPdp2rtLeAAquqxziD5A/aq8tXw9wDMgDKhgM9Smp3mPm2eLuSaTVKYKjHWAiv+gsDyAAo64XeRCG69mj3vSzM2xeFwEjqMe5dmFrP4yQ9pvHC1VI5jdCzfcy7C5BW3vJ1q1JOE25cgPoOreLC9SCjGtrMtgugCJatFvSD0EnkPhQ6wr/wUgEZ8gmY2a4A5GpGdyrmfb6iecXFAM6vvsJWfgwVkAl/I81MR8vVu+jRTbwufQun+AuufQr5AlMPcQ1JOfCrMsICFZDIT8PMtKeik8Sas/SfSC2dJtdcov9cRVJ7F1UaWqAC0tBQ45KFXqZ/iUm//aerDUp99OoJ+o827W6pvUP7xq2AtLfhSA2ht+nDsgmABzd4pO+uBs9tfSBqr5CuEf8PZudRMiaoc30AAAAASUVORK5CYII=" />
  31. <text text="结束" textColor="white" textSize="10" gravity="center" />
  32. </vertical>
  33. {/* <vertical id="return" bg="#000000" alpha="0.5" w="50" h="52" gravity="center" marginTop="20">
  34. <img w="30" h="30" layout_gravity="center" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAR4UlEQVR4Xu2dC/BuUxnGnzfpooQo3dBlJCoViiI5lUuEpIgkhRJdJCqiCylCpqtuUomjEkelk0tGtymXzOh+mYnSRWrMFCNdzNO8Z9Z35u/z/75v7/3ttfZaez/vzDfnmLP2Wu963vWz9mWtdxlkUkAKTFTApI0UkAKTFRAgGh1SYIoCAkTDQwoIEI0BKdBMAc0gzXTTVQNRQIAMJNDqZjMFBEgz3XTVQBQQIAMJtLrZTAEB0kw3XTUQBQTIQAKtbjZTQIA0001XDUQBAdIg0CT3MLMLG1yqSwpTQIDUDBjJnQC8zcyW1LxUxQtUQIDUCBrJ5wC4BMAPBUgN4QouKkAqBo/klgC+BWBNAFcKkIrCFV5MgFQIIMlNw8zxsFBcgFTQrQ9FBMiMKJLcMMDxmAVFBUgfRn+FPgiQKSKRfFSAY5OxYgKkwuDqQxEBMiGKJNcOcGy+SBEB0ofRX6EPAmQRkUiuFuDYZoKGAqTC4OpDEQEyFkWSrom/yt1+SoAFSB9Gf4U+CJB7AnIRgN1maCdAKgyuPhQRIAuiSPI8AHtXCKwAqSBSH4oIkBBFkmcBOKBiUAVIRaFKLyZAAJD8OIDX1QimAKkhVslFBw8IydMAHFEziAKkpmClFh80ICRPBHBMg+AJkAailXjJYAEheSyAExoGTYA0FK60ywYJCMm3ADh1jmAJkDnEK+nSwQFC8lAAH5szSAJkTgFLuXxQgJB8FYDPthAcAdKCiCVUMRhASL4MwNKWgiJAWhIy92oGAQjJ3QEsazEYAqRFMXOuqveAkNwBwDcArNpiIARIi2LmXFWvASH57ADHg1oOggBpWdBcq+stICS3AHAxgIdGEF+ARBA1xyp7CQjJJwY4NogkugCJJGxu1fYOEJKPC3BsFFFsARJR3Jyq7hUgJB8R4HhqZJEFSGSBc6m+N4CQXAvANwFslUBcA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ik/Q0Qg7JejNiIkBqDNrURUn669+pS0gW8ekcM9tPgMyIFklPSOeQ+P6ESSZAUo/6mu2RfACA22tcdjOADczsPwuv0S3WIgqS9EwpywGsPkFgAVJj5HVVlKSf0fiPGu2/wMz8f44rTYBMUI+kHyLjkCx2frkAqTHquixK0rfx/qKiD/fYaShApj+T7BIyyo+XEiAVR1wOxUh6RsVLK/jyIzPz1KmaQSqItaIIycUypQiQqgJmUq7Gd5L1zeymkduaQSoEkKS/3Vj4ClCAVNAttyIkPQ/XCTP8OsjMzhQgNaNH0tf7+LofNwFSU79cipP8BABPWjfJzjOzlWdiagapETmSo0wpAqSGbrkVJelHZ0zaKHWzmfnKihUmQGpGLyyM29nMltS8VMUzUYDkrEOYnm5m1wqQhgEjeZyZzbqXbVi7LkuhQFiS4jOJn7c4bu8wM0/0oRkkRTDURp4KkPQNc75xbtxW3kLrFivP2MmrRAqQPBTAx8aau83M/Cu8ZpBEcVAzGStA0vNuvWPMxSeY2a81g2QcOLmWToFFst3sa2ZLBUi6GKiljBUguQaAKxYcL36amR0pQDIOmlxLqwBJ/zbib7bcVjyoC5C0MVBrmStA8iQAbwOw4kFdgGQeMLmXXgGSPwDwLL/dEiDp9VeLmStA8mkArgNwoADJPFhyrxsFSL5pRaaTbppXq1IgfwVIni9A8o+TPOxIAT9YVIB0JL6aLUMBAVJGnORlRwoIkI6EV7NlKCBAyoiTvOxIAQHSkfBqtgwFBEgZcZKXHSkgQDoSXs2WoYAAKSNO8rIjBQRIR8Kr2TIUECBlxEledqSAAOlIeDVbhgICpIw4ycuOFPg/sYqk3qIb/x8AAAAASUVORK5CYII=" />
  35. <text text="返回" textColor="white" textSize="10" gravity="center" />
  36. </vertical> */}
  37. </vertical>
  38. );
  39. window1 = floaty.rawWindow(
  40. <vertical gravity="bottom">
  41. <text id="status" text="运行状态" textColor="white" bg="#00CD66" alpha="0.5"
  42. w="*" h="*" gravity="center" />
  43. </vertical>
  44. );
  45. window.exitOnClose();
  46. window.setSize(200, 400);
  47. window.setPosition(device.width - 1080, device.height/10);
  48. window1.exitOnClose();
  49. window1.setTouchable(false);
  50. window1.setSize(device.width, device.height / 4);
  51. window1.setPosition(0, device.height - device.height / 4);
  52. //点击返回
  53. // window.return.click(() => {
  54. // app.launch("com.xm.duihua");
  55. // engines.myEngine().forceStop();
  56. // });
  57. //点击停止
  58. window.stop.click(() => {
  59. // if (thread) {
  60. // thread.interrupt();
  61. // }
  62. // window1.status.setText("已停止");
  63. engines.stopAll()
  64. });
  65. //点击开始
  66. window.start.click(() => {
  67. window1.status.setText("正在运行");
  68. thread = threads.start(function () {
  69. let search_val = ui.search.text()
  70. if(search_val.trim().length==0){
  71. toast('请填写要匹配的关键字')
  72. }else{
  73. storage.put('search_value',search_val)
  74. engines.execScriptFile("./sub.js",{delay:2000});
  75. }
  76. });
  77. });
  78. }

sub.js

  1. const Utils = require('lib');
  2. const storage = storages.create("dinyue");
  3. // 编写主函数:程序启动后执行的逻辑代码。
  4. function main() {
  5. sleep(2000)
  6. let search =storage.get('search_value')
  7. while(!Utils.wait_for_num('互动',1)){
  8. back()
  9. }
  10. sleep(2000)
  11. click(535, 2120)
  12. sleep(2000)
  13. click(945, 1065)
  14. sleep(2000)
  15. Utils.click_item('已发表内容',[700,0])
  16. setText(search)
  17. click(995, 1510)
  18. sleep(2000)
  19. // sleep(3000)
  20. // Utils.click_item('【宁大晚安】')
  21. while(true){
  22. let items = textContains(search).find()
  23. if(items.empty()){
  24. Utils.swipe_up()
  25. }else{
  26. for(let index=1;index<items.length;index++){
  27. if(items[index].parent().child(0).text().includes('已删除')){
  28. continue
  29. }
  30. items[index].parent().child(1).click()
  31. sleep(1000)
  32. Utils.click_item('删除',[0,-100])
  33. sleep(1000)
  34. Utils.click_item('删除',[0,100])
  35. }
  36. Utils.swipe_up()
  37. sleep(1000)
  38. }
  39. }
  40. }
  41. // 启动应用:传入参数依次为:主函数,要启动的 App 名称,当前应用描述,是否语音播报执行状态。
  42. Utils.start_app(main, '订阅号助手', '订阅号助手', false,false)

 lib.js

  1. /**
  2. * 仓库:https://github.com/kangour/autojs_sdk
  3. */
  4. operation_app = ''
  5. window = {
  6. width: device.width,
  7. height: device.height,
  8. }
  9. /**
  10. * 权限管理
  11. */
  12. auto.waitFor();
  13. setScreenMetrics(window.width, window.height);
  14. if (!requestScreenCapture()) {
  15. log('Screen capture fail');
  16. exit();
  17. }
  18. /**
  19. * 通知栏提示
  20. */
  21. let runing_tip = floaty.rawWindow(
  22. <frame gravity="center" bg="#CC999999">
  23. <text padding="5 0 5 0" w="auto" h="auto" id="text" textColor='#FFFFFF'></text>
  24. </frame>
  25. )
  26. runing_tip.setPosition(220, 5);
  27. runing_tip.setTouchable(false);
  28. /**
  29. * 通知栏提示内容设置
  30. * @param {*} _text 提示文本
  31. */
  32. function set_runing_tip(_text) {
  33. ui.run(function () {
  34. runing_tip.text.setText(operation_app + _text);
  35. });
  36. }
  37. /**
  38. * 修改通知栏提示的坐标
  39. * @param {*} _text 提示文本
  40. */
  41. function set_runing_tip_position(x, y) {
  42. runing_tip.setPosition(x, y);
  43. }
  44. /**
  45. * 开始结束提示
  46. */
  47. function start_tip(this_app) {
  48. warn('开始执行', this_app)
  49. vibrate(100)
  50. }
  51. function end_tip(operation_app) {
  52. warn(operation_app, '执行完成')
  53. vibrate(300)
  54. }
  55. // 普通上滑解锁
  56. // /**
  57. // * 解锁
  58. // */
  59. // function unlock() {
  60. // while (true) {
  61. // // 唤醒屏幕
  62. // if (!device.isScreenOn()) {
  63. // log('Wake up')
  64. // device.wakeUp();
  65. // // 避开锁屏界面的弹窗
  66. // back()
  67. // }
  68. // if (has_text('画报')) {
  69. // warn('尝试解锁')
  70. // swipe(500, 1600, 100, 500, 200);
  71. // sleep(500)
  72. // } else {
  73. // warn('解锁成功')
  74. // break
  75. // }
  76. // }
  77. // log('Unlocked')
  78. // sleep(800);
  79. // back() // 避开解锁后界面的弹窗
  80. // sleep(800)
  81. // }
  82. // MUI10 解锁
  83. function unlock() {
  84. // 唤醒屏幕
  85. if (!device.isScreenOn()) {
  86. log('Wake up')
  87. device.wakeUp();
  88. // 避开锁屏界面的弹窗
  89. back()
  90. }
  91. sleep(800)
  92. if (has_text('画报')) {
  93. warn('尝试解锁')
  94. //下拉状态栏
  95. swipe(500, 30, 500, 1000, 300);
  96. sleep(400);
  97. //点击时间
  98. click(100, 120);
  99. sleep(400);
  100. //解锁 密码
  101. desc(2).findOne().click();
  102. desc(3).findOne().click();
  103. desc(6).findOne().click();
  104. desc(9).findOne().click();
  105. //等待解锁完成
  106. text('闹钟').waitFor();
  107. warn('Unlocked')
  108. //返回主页
  109. home();
  110. }
  111. }
  112. /**
  113. * 获取文本类型,分别有 text、desc
  114. * @param {string} _text 需要查询的文本
  115. */
  116. function get_text_type(_text) {
  117. for (i = 5; i > 0; i--) {
  118. if (textContains(_text).exists()) {
  119. return 'text'
  120. } else if (descContains(_text).exists()) {
  121. return 'desc'
  122. } else {
  123. // verbose(_text, '不存在 ' + i)
  124. sleep(200)
  125. }
  126. }
  127. return null
  128. }
  129. /**
  130. * 当前屏幕是否存在文本
  131. * @param {*} _text 需要查询的文本
  132. */
  133. function has_text(_text) {
  134. set_runing_tip('find ' + _text)
  135. point = get_coord_by_text(_text, 'no_tip')
  136. if (point != null && point.x > 0 && point.x < window.width && point.y > 0 && point.y < window.height) return true
  137. return false
  138. }
  139. /**
  140. * 设备音量
  141. * @param {*} number
  142. */
  143. function set_volume(number) {
  144. device.setMusicVolume(device.getMusicMaxVolume() / 100 * number)
  145. }
  146. /**
  147. * 震动控制
  148. * @param {*} duration 震动时长
  149. * @param {*} times 震动次数
  150. * @param {*} delay 两次间的延迟
  151. */
  152. function vibrate(duration, times, delay) {
  153. if (delay == null) delay = 0
  154. if (times == null) times = 1
  155. for (i = 0; i < times; i++) {
  156. device.vibrate(duration);
  157. sleep(delay)
  158. }
  159. }
  160. /**
  161. * 操作失败后的提示弹窗,引导下一步操作
  162. * @param {*} callback 弹窗确认后执行的函数,一般出入执行失败的函数
  163. * @param {*} _text
  164. */
  165. function confirm_continue(callback, _text) {
  166. tts_report(_text + '失败')
  167. if (get_hours() < 9) {
  168. sleep(2000)
  169. callback(_text)
  170. return
  171. }
  172. vibrate(1000, 3, 0)
  173. if (confirm(_text + "不存在,2s 后重试?")) {
  174. toast('2s 后重试')
  175. sleep(2000)
  176. callback(_text)
  177. } else {
  178. if (confirm("继续下一步?")) {
  179. toast('2s 后继续')
  180. sleep(2000)
  181. } else {
  182. toastLog('手动结束运行')
  183. exit()
  184. }
  185. }
  186. }
  187. /**
  188. * 文本点击
  189. * @param {*} _text 待查询的文本
  190. * @param {*} fix_coord 修复坐标位置,传入一个数组,第一位是 x 坐标,第二位是 y 坐标。
  191. * 应用中的页面结构决定了获取的坐标准确性,调试时,可以用开发者工具打开指针位置,查看点击位置是否正确,错误的点击位置则需要传入修复的坐标。
  192. * 例如:[10, -10] 表示在点击时,x 右移 10 个点,y 上移 10 个点
  193. * @param {*} tip_type 未找到时,是否需要提示,传入 no_tip 则不提示
  194. */
  195. function click_item(_text, fix_coord, tip_type) {
  196. if (fix_coord == undefined) fix_coord = [0, 0]
  197. wait_for(_text)
  198. log('(click) ' + _text)
  199. if (has_text(_text) == false && tip_type != 'no_tip') {
  200. confirm_continue(click_item, _text)
  201. return
  202. }
  203. text_type = get_text_type(_text)
  204. if (text_type == 'text') {
  205. click_text(_text, fix_coord)
  206. } else if (text_type == 'desc') {
  207. click_desc(_text, fix_coord)
  208. } else if (tip_type != 'no_tip') {
  209. error('Unknown type', text_type)
  210. }
  211. }
  212. /**
  213. * 任意类型的文本循环点击
  214. * @param {*} _text 待查询的文本
  215. * @param {*} tip_type 未找到时,是否需要提示,传入 no_tip 则不提示
  216. */
  217. function click_item_each(_text, tip_type) {
  218. wait_for(_text)
  219. log('(click-each) ' + _text)
  220. if (has_text(_text) == false && tip_type != 'no_tip') {
  221. confirm_continue(click_item, _text)
  222. return
  223. }
  224. text_type = get_text_type(_text)
  225. if (text_type == 'text') {
  226. click_text_each(_text)
  227. } else if (text_type == 'desc') {
  228. click_desc_each(_text)
  229. } else if (tip_type != 'no_tip') {
  230. error('Unknown type', text_type)
  231. }
  232. }
  233. /**
  234. * 获取文本坐标,文本点击时自动调用
  235. * @param {*} _text 待查询的文本
  236. * @param {*} tip_type 未找到时,是否需要提示,传入 no_tip 则不提示
  237. */
  238. function get_coord_by_text(_text, tip_type) {
  239. text_type = get_text_type(_text)
  240. btn = null
  241. if (text_type == null) {
  242. if (tip_type != 'no_tip') confirm_continue(get_coord_by_text, _text)
  243. return null
  244. } else if (text_type == 'text') {
  245. btn = textContains(_text).findOne()
  246. if (btn.bounds().centerX() == undefined) btn = textStartsWith(_text).findOne()
  247. if (btn.bounds().centerX() == undefined) btn = textEndsWith(_text).findOne()
  248. } else if (text_type == 'desc') {
  249. btn = descContains(_text).findOne()
  250. if (btn.bounds().centerX() == undefined) btn = descStartsWith(_text).findOne()
  251. if (btn.bounds().centerX() == undefined) btn = descEndsWith(_text).findOne()
  252. } else {
  253. if (tip_type != 'no_tip') error('Unknown type', text_type)
  254. return null
  255. }
  256. point = btn.bounds()
  257. if (point.centerX()) {
  258. return {
  259. x: point.centerX(),
  260. y: point.centerY()
  261. }
  262. } else {
  263. sleep(800)
  264. return get_coord_by_text(_text, tip_type)
  265. }
  266. }
  267. function click_desc(_text, fix_coord) {
  268. point = get_coord_by_text(_text)
  269. click(point.x + fix_coord[0], point.y + 10 + fix_coord[1]);
  270. sleep(800)
  271. }
  272. function long_click_desc(_text) {
  273. point = get_coord_by_text(_text)
  274. log('(long-click)' + _text)
  275. press(point.x, point.y + 10, 800)
  276. sleep(500)
  277. }
  278. function click_desc_each(_text) {
  279. let btns = descContains(_text).untilFind();
  280. btns.each(function (btn) {
  281. let point = btn.bounds();
  282. click(point.centerX(), point.centerY() + 10);
  283. })
  284. sleep(800)
  285. }
  286. function click_text(_text, fix_coord) {
  287. btn = textContains(_text).findOne()
  288. let point = btn.bounds();
  289. click(point.centerX() + fix_coord[0], point.centerY() + 10 + fix_coord[1]);
  290. sleep(800)
  291. }
  292. function click_text_each(_text) {
  293. let btns = textContains(_text).untilFind();
  294. btns.each(function (btn) {
  295. let point = btn.bounds();
  296. click(point.centerX(), point.centerY() + 10);
  297. })
  298. sleep(800)
  299. }
  300. function has_color(_color, x, y, w, h) {
  301. return find_color(_color, x, y, w, h)
  302. }
  303. function find_color(_color, x, y, w, h) {
  304. if (x == undefined) {
  305. x = 0
  306. y = 0
  307. w = device.width
  308. h = device.height
  309. }
  310. image = captureScreen();
  311. let point = findColorInRegion(image, _color, x, y, w, h);
  312. if (point) return point
  313. else {
  314. sleep(200)
  315. return null
  316. }
  317. }
  318. /**
  319. * 根据id判断 是否有这个组件
  320. * @param {} id
  321. * @returns
  322. */
  323. function has_id(id_){
  324. return id(id_).exists()
  325. }
  326. /**
  327. * 等待某区域颜色出现,持续 10s
  328. * @param {*} _color
  329. * @param {*} x
  330. * @param {*} y
  331. * @param {*} w
  332. * @param {*} h
  333. */
  334. function wait_for_color(_color, x, y, w, h) {
  335. let n = 0
  336. while (true) {
  337. log('wait_for_color', _color)
  338. verbose('(find-color)' + _color)
  339. point = find_color(_color, x, y, w, h)
  340. if (point) return point
  341. else {
  342. sleep(1000)
  343. n++
  344. }
  345. if (n > 10) {
  346. warn('not found', _color)
  347. return null
  348. }
  349. }
  350. }
  351. /**
  352. * 通过颜色获取坐标
  353. * @param {*} _color
  354. * @param {*} x
  355. * @param {*} y
  356. * @param {*} w
  357. * @param {*} h
  358. */
  359. function get_coord_by_color(_color, x, y, w, h) {
  360. verbose('(find-color)' + _color)
  361. return wait_for_color(_color, x, y, w, h)
  362. }
  363. /**
  364. * 0 到 200 s 随机睡眠
  365. * @param {*} tip_message 睡眠时的提示消息
  366. */
  367. function random_sleep(tip_message) {
  368. if (tip_message == undefined) tip_message = 'random-sleep'
  369. random_number = random(0, 200)
  370. log(tip_message + ' sleep ' + random_number + ' s')
  371. for (i = random_number; i >= 0; i--) {
  372. if (i % 3 == 0) toast(tip_message + ' ' + i + ' s')
  373. sleep(1000)
  374. }
  375. }
  376. /**
  377. * 按键监听,自动执行,按下音量加结束进程
  378. */
  379. function key_event() {
  380. threads.start(function () {
  381. events.observeKey();
  382. events.on("key_down", function (keyCode, events) {
  383. if (keyCode == keys.volume_up) {
  384. toastLog('运行结束')
  385. exit();
  386. }
  387. });
  388. });
  389. }
  390. // /**
  391. // * 普通左右布局任务
  392. // * 将即将启动的 App 从最近任务中移除
  393. // * @param {*} operation_app App 名称
  394. // */
  395. // function clear_recent(operation_app) {
  396. // log('移除最近任务')
  397. // home()
  398. // sleep(800)
  399. // recents()
  400. // sleep(800)
  401. // let times_swips = 0
  402. // while (true) {
  403. // if (has_text(operation_app)) {
  404. // point = get_coord_by_text(operation_app)
  405. // if (point.x < 530) {
  406. // swipe(100, 1000, 500, 1000, 500);
  407. // } else if (point.x > 800) {
  408. // swipe(500, 1000, 100, 1000, 500);
  409. // } else {
  410. // swipe(point.x - 330, 1400, point.x - 330, 100, 1000);
  411. // sleep(500)
  412. // }
  413. // times_swips++
  414. // if (times_swips > 10) {
  415. // warn('重试')
  416. // times_swips = 0
  417. // clear_recent()
  418. // break
  419. // }
  420. // } else {
  421. // break
  422. // }
  423. // }
  424. // home()
  425. // }
  426. /**
  427. * Mui10 任务
  428. * 将即将启动的 App 从最近任务中移除
  429. * @param {*} operation_app App 名称
  430. */
  431. function clear_recent(operation_app) {
  432. log('移除最近任务')
  433. home()
  434. sleep(800)
  435. recents()
  436. sleep(800)
  437. let times_swips = 0
  438. while (true) {
  439. if (has_text(operation_app)) {
  440. point = get_coord_by_text(operation_app)
  441. swipe(point.x, point.y, point.x + 500, point.y, 600);
  442. sleep(800)
  443. times_swips++
  444. if (times_swips > 10) {
  445. warn('重试')
  446. times_swips = 0
  447. clear_recent()
  448. break
  449. }
  450. } else {
  451. break
  452. }
  453. }
  454. home()
  455. }
  456. /**
  457. * 脚本运行的前置+后置自动化操作,包括屏幕解锁,自动按键监听,移出最近任务,启动 App,执行脚本,结束进程等。
  458. * @param {*} callback 启动 App 后需要执行的内容
  459. * @param {*} op_app 需要启动的 App,如:网易云音乐
  460. * @param {*} this_app 当前脚本描述,如:播放日推
  461. * @param {*} use_tts 是否使用结束语音,传入 true 时,会在运行结束前给出语音提示
  462. */
  463. function start_app(callback, op_app, this_app, use_tts, close_app) {
  464. if (close_app == undefined) close_app = false
  465. this_app = this_app != undefined ? this_app : op_app
  466. operation_app = op_app + '\n'
  467. while (!device.isScreenOn()) {
  468. unlock();
  469. }
  470. key_event()
  471. sleep(800)
  472. if (close_app == true) clear_recent(op_app)
  473. log('Launch', op_app)
  474. launchApp(op_app);
  475. start_tip(this_app);
  476. sleep(1000)
  477. if (op_app) {
  478. callback();
  479. end_tip(this_app);
  480. if (use_tts) tts_report(this_app + '成功')
  481. exit()
  482. }
  483. }
  484. /**
  485. * 给出语音提示
  486. * @param {*} _text
  487. */
  488. function tts_report(_text) {
  489. warn(_text)
  490. importClass(java.io.File);
  491. importClass(android.speech.tts.TextToSpeech);
  492. let ttsStatus = false;
  493. let ttsListener = new TextToSpeech.OnInitListener({
  494. onInit: function (status) {
  495. if (status == TextToSpeech.SUCCESS) {
  496. let ttsSetLanguageResult = TTS.setLanguage(TTS.getDefaultVoice().getLocale()/*ttsLanguage*/);
  497. if (ttsSetLanguageResult != TextToSpeech.LANG_MISSING_DATA && ttsSetLanguageResult != TextToSpeech.LANG_NOT_SUPPORTED) {
  498. ttsStatus = true;
  499. TTS.stop();
  500. speech(_text);
  501. // let file = "/sdcard/xxx.mp3";
  502. // speech(_text, file);
  503. } else {
  504. toast("TTS不支持当前语言");
  505. }
  506. } else {
  507. toast("初始化TTS失败");
  508. }
  509. }
  510. })
  511. let TTS = new TextToSpeech(context, ttsListener);
  512. function speech(ttsText, fileName) {
  513. if (TTS && ttsStatus) {
  514. if (ttsText.length <= TextToSpeech.getMaxSpeechInputLength()) {
  515. if (fileName) {
  516. let file = new File(fileName);
  517. if (!file.exists()) {
  518. file.createNewFile();
  519. }
  520. TTS.synthesizeToFile(ttsText, null, file, Math.random());
  521. } else {
  522. TTS.speak(ttsText, TextToSpeech.QUEUE_FLUSH/*QUEUE_FLUSH插队,QUEUE_ADD排队*/, null);
  523. }
  524. return true;
  525. } else {
  526. toast("朗读文本过长");
  527. return false;
  528. }
  529. } else {
  530. toast("TTS未准备好");
  531. return false;
  532. }
  533. }
  534. }
  535. /**
  536. * 颜色点击
  537. * @param {*} _color 需要点击的颜色
  538. * @param {*} x 颜色区域的左上角 x 坐标
  539. * @param {*} y 颜色区域的左上角 y 坐标
  540. * @param {*} w 颜色区域的宽度
  541. * @param {*} h 颜色区域的高度
  542. */
  543. function click_color(_color, x, y, w, h) {
  544. let point = get_coord_by_color(_color, x, y, w, h)
  545. if (point) {
  546. click(point.x, point.y + 20);
  547. return true
  548. }
  549. return false
  550. }
  551. /**
  552. * 颜色循环点击
  553. * @param {*} _color 需要点击的颜色
  554. * @param {*} x 颜色区域的左上角 x 坐标
  555. * @param {*} y 颜色区域的左上角 y 坐标
  556. * @param {*} w 颜色区域的宽度
  557. * @param {*} h 颜色区域的高度
  558. */
  559. function click_color_each(_color, x, y, w, h) {
  560. let attempts = 0
  561. let finded = 0
  562. while (true) {
  563. if (click_color(_color, x, y, w, h)) {
  564. finded++
  565. if (finded > 10) return
  566. } else {
  567. attempts++
  568. if (attempts > 2) return
  569. }
  570. sleep(300)
  571. }
  572. }
  573. /**
  574. * 等待文本出现
  575. * @param {*} _text 等待出现的文本
  576. */
  577. function wait_for(_text) {
  578. log('(wait)' + _text)
  579. let n = 0
  580. while (true) {
  581. n++
  582. if (has_text(_text)) {
  583. set_runing_tip('')
  584. return true
  585. } else {
  586. set_runing_tip('查找(' + _text + ')第' + n + '次')
  587. }
  588. sleep(1500)
  589. }
  590. }
  591. /**
  592. * 等待文本出现 到达某次 跳出循环 默认 20次
  593. * @param {*} _text
  594. * @param {*} num
  595. * @returns
  596. */
  597. function wait_for_num(_text,num) {
  598. log('(wait)' + _text)
  599. if (num == undefined) num = 20
  600. let n = 0
  601. while (true) {
  602. n++
  603. if (has_text(_text)) {
  604. set_runing_tip('')
  605. return true
  606. } else {
  607. set_runing_tip('查找(' + _text + ')第' + n + '次')
  608. if(n>num){
  609. return false
  610. }
  611. }
  612. sleep(1500)
  613. }
  614. }
  615. /**
  616. * 接口描述:等待某文本出现之前的点击。
  617. * 场景举例:启动网易云音乐时,等待首页出现之前,点击跳过按钮 wait_befor_click('我的', '跳过')
  618. * @param {*} wait_text 等待出现的文本
  619. * @param {*} click_text 需要点击的文本
  620. * @param {*} timer 等待计时器,计时器越长,click_text 被点击的几率越高
  621. */
  622. function wait_befor_click(wait_text, click_text, timer) {
  623. log('(wait-click)' + click_text)
  624. if (timer == undefined) timer = 10
  625. for (let n = timer; n > 0; n--) {
  626. if (has_text(wait_text)) {
  627. break
  628. } else if (has_text(click_text)) {
  629. click_item(click_text)
  630. } else sleep(600)
  631. }
  632. // wait_for(wait_text)
  633. return
  634. }
  635. /**
  636. * 获取当前年月日时分秒和星期
  637. */
  638. function get_year() {
  639. let now = new Date();
  640. return now.getFullYear();
  641. }
  642. function get_month() {
  643. let now = new Date();
  644. return now.getMonth() + 1;
  645. }
  646. /**
  647. * 获取上个月月份
  648. */
  649. function get_last_month() {
  650. _month = get_month()
  651. if (_month > 1 && _month <= 12) return _month - 1
  652. else if (_month == 1) return 12
  653. else {
  654. error('月份超出范围')
  655. return false
  656. }
  657. }
  658. /**
  659. * 计算单休的每月工作时长
  660. * @param {*} start_date 开始时间,格式:yyyy/mm/dd
  661. * @param {*} end_date
  662. * @param {*} rest_days 每周休息天数
  663. */
  664. function count_work_day(start_date, end_date, rest_days) {
  665. if (rest_days == undefined) rest_days = 1
  666. start_date = string2date(start_date);
  667. end_date = string2date(end_date);
  668. let delta = (end_date - start_date) / (1000 * 60 * 60 * 24);
  669. let weeks = 0;
  670. for (i = 0; i < delta; i++) {
  671. if (start_date.getDay() < rest_days) weeks++;
  672. start_date = start_date.valueOf();
  673. start_date += 1000 * 60 * 60 * 24;
  674. start_date = new Date(start_date);
  675. }
  676. return delta - weeks;
  677. }
  678. /**
  679. * 计算上个月的年份
  680. * @param {*} start_date
  681. * @param {*} end_date
  682. */
  683. function get_last_month_year() {
  684. let now = new Date();
  685. now = now.valueOf();
  686. now -= 20 * 1000 * 60 * 60 * 24;
  687. let last_month_date = new Date(now);
  688. return last_month_date.getFullYear();
  689. }
  690. /**
  691. * 返回日期
  692. */
  693. function get_date() {
  694. let now = new Date();
  695. return now.getDate();
  696. }
  697. /**
  698. * 返回星期
  699. */
  700. function get_day() {
  701. let now = new Date();
  702. return now.getDay();
  703. }
  704. function get_hours() {
  705. let now = new Date();
  706. return now.getHours();
  707. }
  708. function get_minutes() {
  709. let now = new Date();
  710. return now.getMinutes();
  711. }
  712. function get_seconds() {
  713. let now = new Date();
  714. return now.getSeconds();
  715. }
  716. /**
  717. * 拆分用户设定的时间,20:59:35 分别拆为时分秒
  718. * @param {string} _time 时间字符串
  719. */
  720. function get_my_hours(_time) {
  721. return Number(_time.split(":")[0])
  722. }
  723. function get_my_minutes(_time) {
  724. return Number(_time.split(":")[1])
  725. }
  726. function get_my_seconds(_time) {
  727. return Number(_time.split(":")[2])
  728. }
  729. /**
  730. * 获取倒计时
  731. * @param {string} _time 时间字符串
  732. */
  733. function total_seconds_delta(_time) {
  734. return ~~(time2date(_time) - new Date()) / 1000
  735. }
  736. function seconds_delta(_time) {
  737. let delta_seconds = total_seconds_delta(_time)
  738. return parseInt(delta_seconds % 60)
  739. }
  740. function minutes_delta(_time) {
  741. let delta_seconds = total_seconds_delta(_time)
  742. return parseInt(delta_seconds / 60 % 60)
  743. }
  744. function hours_delta(_time) {
  745. let delta_seconds = total_seconds_delta(_time)
  746. return parseInt(delta_seconds / 60 / 60 % 60)
  747. }
  748. function time2date(_time) {
  749. let str_time = get_year() + '/' + get_month() + '/' + get_date() + ' ' + _time
  750. return new Date(str_time)
  751. }
  752. function string2date(_time) {
  753. return new Date(_time)
  754. }
  755. function time2str(_time) {
  756. let total_seconds = total_seconds_delta(_time)
  757. let seconds = seconds_delta(_time)
  758. let minutes = minutes_delta(_time)
  759. let hours = hours_delta(_time)
  760. if (total_seconds < 0) {
  761. seconds += 59
  762. hours += 23
  763. minutes += 59
  764. }
  765. result = ''
  766. if (hours != 0) result += hours + 'h '
  767. if (minutes != 0) result += minutes + 'm '
  768. result += seconds + 's'
  769. return result
  770. }
  771. /**
  772. * 简写的日志输出
  773. */
  774. function error() {
  775. res = Array.prototype.slice.call(arguments).join(' ')
  776. // toast(res)
  777. console.error(res)
  778. // if (operation_app != '') res = operation_app + res
  779. set_runing_tip(res)
  780. }
  781. function warn() {
  782. res = Array.prototype.slice.call(arguments).join(' ')
  783. toast(res)
  784. console.warn(res)
  785. // if (operation_app != '') res = operation_app + res
  786. set_runing_tip(res)
  787. }
  788. function log() {
  789. res = Array.prototype.slice.call(arguments).join(' ')
  790. console.log(res)
  791. // toast(res)
  792. // if (operation_app != '') res = operation_app + res
  793. set_runing_tip(res)
  794. }
  795. function verbose() {
  796. res = Array.prototype.slice.call(arguments).join(' ')
  797. console.verbose(res)
  798. // if (operation_app != '') res = operation_app + res
  799. set_runing_tip(res)
  800. }
  801. /**
  802. * 获取问候语
  803. */
  804. function say_hi() {
  805. let hour = get_hours()
  806. let greet = "Hi"
  807. if (hour <= 3) {
  808. greet = "晚安"
  809. } else if (hour < 9) {
  810. greet = "早上好"
  811. } else if (hour < 12) {
  812. greet = "上午好"
  813. } else if (hour < 14) {
  814. greet = "中午好"
  815. } else if (hour < 18) {
  816. greet = "下午好"
  817. } else if (hour < 24) {
  818. greet = "晚上好"
  819. }
  820. return greet
  821. }
  822. function click_id(id_name) {
  823. id(id_name).findOne().click()
  824. }
  825. function swipe_down() {
  826. swipe(500, 500, 500, 1500, 500)
  827. sleep(800)
  828. }
  829. function swipe_up() {
  830. swipe(500, 1500, 500, 100, 500)
  831. sleep(800)
  832. }
  833. /**
  834. * 提醒用户,接下来的操作需要注意(用户确认后,方可继续)
  835. * @param {*} _text
  836. */
  837. function be_careful(_text) {
  838. log('请注意,', _text)
  839. while (true) {
  840. if (confirm(_text)) break;
  841. else sleep(1000);
  842. }
  843. sleep(1000);
  844. }
  845. /**
  846. * 提醒用户,接下来的操作需要人工处理(用户确认后,方可继续)
  847. * @param {*} _text
  848. */
  849. function handwork(_text, timer) {
  850. timer = timer === undefined ? 2 : timer
  851. let timer_backup = timer
  852. log('人工', _text)
  853. while (true) {
  854. for (timer; timer > 0; timer--) {
  855. sleep(1000);
  856. toast('倒计时 ' + timer + ' s');
  857. }
  858. if (confirm(_text + '?')) break;
  859. else timer = timer_backup + 1
  860. }
  861. }
  862. /**
  863. * 倒计时 秒后执行
  864. * @param {}} timer
  865. */
  866. function countDown(timer){
  867. timer = timer === undefined ? 2 : timer
  868. for (timer; timer > 0; timer--) {
  869. toast('倒计时 ' + timer + ' s 后执行');
  870. sleep(1000);
  871. }
  872. }
  873. module.exports = {
  874. swipe_up: swipe_up,
  875. handwork: handwork,
  876. be_careful: be_careful,
  877. swipe_down: swipe_down,
  878. unlock: unlock, // 解锁
  879. clear_recent: clear_recent, // 结束最近任务
  880. start_app: start_app, // 脚本运行的前置+后置自动化操作,包括屏幕解锁,自动按键监听,移出最近任务,启动 App,执行脚本,结束进程等。
  881. wait_for: wait_for, // 等待文本出现
  882. wait_for_num:wait_for_num,//等待文本出现 n次
  883. has_text: has_text, // 当前屏幕是否存在文本
  884. vibrate: vibrate, // 设备震动
  885. say_hi: say_hi, // 获取问候语
  886. log: log, // 普通日志
  887. warn: warn, // 警告日志
  888. error: error, // 错误日志
  889. verbose: verbose, // 调试日志
  890. time2str: time2str, // 时间转字符串
  891. time2date: time2date, // 时间转日期
  892. random_sleep: random_sleep, // 0 到 200 s 随机睡眠
  893. total_seconds_delta: total_seconds_delta, // 获取倒计时
  894. click_item: click_item, // 任意类型的文本点击
  895. click_color: click_color, // 颜色点击
  896. click_id: click_id,
  897. find_color: find_color,
  898. has_color: has_color,
  899. wait_for_color: wait_for_color,
  900. click_item_each: click_item_each, // 任意类型的文本循环点击
  901. click_color_each: click_color_each, // 颜色循环点击
  902. wait_befor_click: wait_befor_click, // 接口描述:等待某文本出现之前的点击。 场景举例:启动网易云音乐时,等待首页出现之前,点击跳过按钮 wait_befor_click('我的', '跳过')
  903. get_coord_by_color: get_coord_by_color, // 通过颜色获取坐标
  904. get_coord_by_text: get_coord_by_text, // 获取文本坐标,文本点击时自动调用
  905. get_last_month: get_last_month, // 获取上个月月份
  906. get_year: get_year, // 获取年份
  907. get_month: get_month, // 获取月份
  908. get_date: get_date, // 返回日期
  909. get_day: get_day, // 返回星期
  910. get_hours: get_hours, // 返回小时
  911. get_minutes: get_minutes, // 返回分钟
  912. get_seconds: get_seconds, // 返回秒
  913. set_volume: set_volume, // 设置设备音量
  914. set_runing_tip: set_runing_tip, // 通知栏提示内容设置
  915. key_event: key_event, // 音量加结束脚本
  916. string2date: string2date, // 字符串转日期
  917. get_last_month_year: get_last_month_year, // 获取上个月的年份
  918. count_work_day: count_work_day, // 获取工作天数
  919. set_runing_tip_position: set_runing_tip_position, // 设置状态栏位置
  920. has_id:has_id,//根据id 判断是否有这个组件
  921. countDown:countDown,//倒计时
  922. }

网站

Auto.js Pro Docs

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/393757
推荐阅读
相关标签
  

闽ICP备14008679号