Skip to content

Commit

Permalink
updata
Browse files Browse the repository at this point in the history
  • Loading branch information
cwj851 committed Jul 7, 2022
1 parent 4b65859 commit c24bf24
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 208 deletions.
16 changes: 12 additions & 4 deletions lib/ProjectBridgeHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,21 @@ module.exports = function (BaseHandler) {
}

BaseHandler.addGroupToDdWateringGroups = (data, callbackId) => {
config.DdWateringGroups.push(data)
toast(data.GroupName + "加入小号浇水列表成功!")
if(config.DdWateringGroups.map(v => v.GroupName).indexOf(data.GroupName) < 0){
config.DdWateringGroups.push(data)
toast(data.GroupName + "加入小号浇水列表成功!")
}else{
toast(data.GroupName + "已经在小号浇水列表!")
}
}

BaseHandler.addGroupToDdWateringGroupsEx = (data, callbackId) => {
config.DdWateringGroupsEx.push(data)
toast(data.GroupName + "加入大号浇水列表成功!")
if(config.DdWateringGroupsEx.map(v => v.GroupName).indexOf(data.GroupName) < 0){
config.DdWateringGroupsEx.push(data)
toast(data.GroupName + "加入大号浇水列表成功!")
}else{
toast(data.GroupName + "已经在大号浇水列表!")
}
}
function mine_group() {
app.startActivity({
Expand Down
8 changes: 8 additions & 0 deletions lib/Unlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ let NORMAL_DEVICE = function (obj) {
this.__proto__ = obj
// 图形密码解锁
this.unlock_pattern = function (password) {
debugInfo('使用图形密码解锁')
if (typeof password !== 'string') throw new Error('密码应为字符串!')
let lockBounds = id('com.android.systemui:id/lockPatternView')
.findOne(_config.timeout_findOne)
Expand All @@ -49,6 +50,10 @@ let NORMAL_DEVICE = function (obj) {

// 密码解锁(仅ROOT可用)
this.unlock_password = function (password) {
debugInfo('使用字符串密码解锁 必须有root权限')
if (!automator.hasRootPermission()) {
errorInfo('无ROOT权限,无法使用字符串密码解锁')
}
if (typeof password !== 'string') throw new Error('密码应为字符串!')
// 直接在控件中输入密码
setText(0, password)
Expand All @@ -59,6 +64,7 @@ let NORMAL_DEVICE = function (obj) {

// PIN解锁
this.unlock_pin = function (password) {
debugInfo('使用PIN密码解锁')
if (typeof password !== 'string') throw new Error('密码应为字符串!')
// 模拟按键
let button = null
Expand All @@ -78,6 +84,7 @@ let NORMAL_DEVICE = function (obj) {
* @returns
*/
this.unlock_coloros_sample = function (password) {
debugInfo('使用coloros的PIN密码解锁')
if (typeof password !== 'string') throw new Error('密码应为字符串!')
// 模拟按键
let button = null
Expand All @@ -100,6 +107,7 @@ let NORMAL_DEVICE = function (obj) {
}

this.unlock_vivo_pin = function (password) {
debugInfo('使用vivo的PIN密码解锁')
if (typeof password !== 'string') throw new Error('密码应为字符串!')
// 模拟按键
let button = null
Expand Down
2 changes: 1 addition & 1 deletion project.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
"packageName": "com.AntforestDreamPro.assistant",
"scripts": {},
"versionCode": 1,
"versionName": "1.7.1.1"
"versionName": "1.7.7.1"
}
203 changes: 0 additions & 203 deletions unit/修改步数.js

This file was deleted.

0 comments on commit c24bf24

Please sign in to comment.