2026-10-30 14:31:15 +08:00

22 lines
1.5 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var other=engines.all().filter(function(e){return e.id!==engines.myEngine().id;});
if(other.length)throw new Error('其他脚本仍在运行,取消独立排查');
eval(files.read('/sdcard/脚本/抖音极速/douyin-lite.js').split('// MAIN:')[0]);
CONFIG.logPath='/sdcard/Download/douyin-task-probe.log';
CONFIG.pageTextPath='/sdcard/Download/douyin-task-probe-page.json';
var output='/sdcard/Download/douyin-task-probe.json',frames=[];
function plainPage(p){return p.map(function(i){return {text:i.text,rect:i.rect,id:i.id,enabled:i.enabled};});}
try {
auto.waitFor();keepScreenAwake();initLocalOcr();
app.launchPackage(CONFIG.packageName);waitStartupPackage(CONFIG.packageName,10000);sleep(1200);sessionStartedAt=Date.now();
var originalSnapshot=snapshot;
snapshot=function(){var p=originalSnapshot();frames.push({page:plainPage(p),signature:pageSignature(p),
rows:rowsOnPage(p,TASK_TITLE).map(function(r){return {title:r.title,detail:r.detail,action:r.action&&r.action.text};})});return p;};
var found=locateTask(/^看广告赚金币$/);
files.write(output,JSON.stringify({found:found&&{title:found.title,detail:found.detail,action:found.action&&found.action.text},frames:frames}));
}catch(e){files.write(output,JSON.stringify({error:String(e),stack:String(e.stack),frames:frames}));}
finally{
try{images.stopScreenCapture();}catch(ignore){}
if(captureWorker&&captureWorker.isAlive()){captureWorker.interrupt();captureWorker.join(1500);}
releaseScreenAwake();
}