function FreeRestriction() {
importClass(com.stardust.autojs.core.accessibility.AccessibilityBridge.WindowFilter);
let bridge = runtime.accessibilityBridge;
let bridgeField = runtime.getClass().getDeclaredField("accessibilityBridge");
let configField = bridgeField.getType().getDeclaredField("mConfig");
configField.setAccessible(true);
configField.set(bridge, configField.getType().newInstance());
bridge.setWindowFilter(new JavaAdapter(AccessibilityBridge$WindowFilter, {
filter: function (info) {
return true;
}
}));
}
FreeRestriction()
function ttt() {
var temp = className("ImageView").depth(12).find()
// console.show();
log("123")
var number
temp.forEach(function (w) {
var w = w.parent().parent()
w.click()
sleep(500)
// id("c20").findOne().parent().click()
// sleep(500)
swipe(500, 1300, 500, 700, 500)
sleep(500)
// log("商品评价")
try {
numbertext = className("TextView").textContains("商品评价").findOne(5000).text();
// number = "商品(123)"
number = numbertext.match(/[0-9]+/)
log(number)
if ((number > 1000 || numbertext.match(/万/)) && (text("收藏").exists())) {
log("dian")
text("收藏").findOne().parent().parent().click()
sleep(1500)
}
} catch(error){
}
back()
sleep(500)
// log(w.className())
// log(w.bounds().centerX(), w.bounds().centerY())
// log(w.clickable())
});
// // longClick(810,1250)
}
ttt()
swipe(535, 1390, 535, 609, 500)
swipe(535, 1390, 535, 609, 500)
swipe(535, 1390, 535, 609, 500)
while (true) {
ttt()
swipe(535, 1390, 535, 609, 500)
swipe(535, 1390, 535, 609, 500)
swipe(535, 1390, 535, 609, 500)
}