search

What is auto.js

May 18, 2019 pm 01:43 PM

"auto.js" is a script framework based on JavaScript language running on the Android platform. The main working principle of "auto.js" is based on the auxiliary service "AccessibilityService".

What is auto.js

Auto.js uses the "auxiliary function" of the Android system to implement auxiliary work similar to the key wizard, which can simulate a series of interface actions through code.

Different from the "Button Wizard", its simulated actions are not simply implemented using fixed coordinate points on the interface, but similar to Win, using window handles to achieve this. This is quite grace.

Because Auto.js is based on JavaScript, it is recommended to learn the basic syntax and built-in objects of JavaScript before learning the API of Auto.js. You can use the JavaScript tutorial to learn.

If you want to use TypeScript to develop, a developer has announced a tool that can use TypeScript for Auto.js development, see Auto.js DevTools.

If you want to develop Auto.js on a computer instead of a mobile phone, you can use VS Code and the corresponding Auto.js plug-in so that the script edited on the computer can be pushed to the mobile phone to run, see Auto.js-VSCode -Extension.

The "automatic operation" part can be roughly divided into control-based and coordinate-based operations. Coordinate-based operations are the methods used by script software such as traditional button wizards and touch wizards. They use screen coordinates to click and long press. Specify the position to simulate the operation to achieve the goal. For example, click(100, 200), press(100, 200, 500), etc. This method is more feasible in game scripts, combined with the functions of finding pictures and colors, and coordinate scaling It can also achieve better compatibility. However, this method is difficult to achieve the desired effect for general software scripts, and this method requires Android version 7.0 or above or root privileges to execute. Therefore, for general software scripts (such as batch addition Contacts, automatically extract SMS verification codes, etc.), we use control-based simulation operation methods, combined with notification events, key events, etc. to achieve a better workflow.

In addition to development documents, Problems encountered by individuals are recorded here

The loop statement in the UI thread loops multiple times and an error is reported

Auto.js (hereinafter referred to as AJ) To modify the properties of the interface, you need to Using

ui.run(function(){
        //TODO
});

It is not recommended to use a large amount of logic code within a function. You should try to only include a small amount of code that modifies the UI. Otherwise, an error will be reported

Only the original thread that created a view hierarchy can touch its views.

For example, code like this is very likely to cause problems.

ui.run(function(){
    for(var i=0;i<len><p> should be changed to: </p>
<pre class="brush:php;toolbar:false"> for(var i=0;i<len ui.run></len>

The above is the detailed content of What is auto.js. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software