Android automation APP - Macrodroid

foreword

  • We are often salivated by the shortcut commands on Apple mobile phones. Having this small object on the mobile phone can make learning and office work more effective. Android Jun also has benefits this time, this APP is called Macrodroid!
    如果想要实现更加高级的功能,推荐Tasker这款软件。可以尝试参考我的另一篇文章:Android automation APP - Tasker

1. Software introduction

  • Macrodroid is a software for automatic control of mobile phones in a customized way on Android phones. The logic of the software is controlled by 触发>>> 动作+ .约束条件
Figure 1 software screenshot

This software basically includes all the sensors in Android phones as triggers, such as light sensors, acceleration sensors, GPS, NFC, etc., and through various open APIs, it realizes quick modification of system settings, voice broadcast, custom notifications, Send and receive emails, take pictures, gesture operations, logging and other functions, the most important thing is to support shell commands, and tasker plug-in calls and backups. If root permission is obtained, there will be more flexible functions. Possess many advantages such as powerful functions, fresh interface, and simple operation.

2. Functional analysis

Triggers (only analyze those that are not easy to operate, the same below)

  1. 连接>>> Webhook(Url)——This is to convert the custom identification code and the relevant parameters of your mobile phone into a short link, and when anyone visits this short link, an action is triggered. Due to the location of the software's servers, network latency can be very high, and this trigger is often difficult to work.
  2. 位置>>> 位置触发器, 地理位置触发器and 天气, 日出日落- because the default API uses Google Maps and for well-known reasons, the trigger may be inaccurate.
  3. 应用程序>>> 程序打开/关闭, when the app is alive in the background, it will not trigger when the app is opened again. In the same way, the application will not trigger (close) when returning to the desktop or switching to other applications, it will only be triggered when the background is killed.
  4. 用户输入>>> 音量键长按Long press for 1s and then release it will trigger, instead of long press to trigger.

action

  1. 发送intent—— Use the intent in the four major components of Android to jump to the application interface or data within the application and between applications. For example, to open the chat interface of a QQ designated contact, send an external intent to QQ, fill in the android.intent.action.VIEWdata in the action mqqwpa://im/chat?chat_type=wpa&uin=[lv=QQ号], and the square brackets are the QQ number variables, as shown in the following figure:
Figure 2 intent configuration

  1. 麦克风录音——It can be set 直到录音取消, and then use 取消录音the end recording to realize custom control recording and ending.
  2. 亮度——Because the brightness value range of the brand mobile phone and the native Android system is different (the native Android system is 0-100), when the brightness cannot be changed in proportion, you can check the Android9+ mode, or use a custom slider value in a range greater than 100 Try adjusting the brightness.
  3. 系统报时——This requires the installation of TTS (speech-to-text engine) before it can be used.
  4. 声音搜索——This is implemented based on the native Android voice assistant. Domestic brand mobile phones may not be available. To use it, you can install the Google Voice Assistant after installing the Google framework.
  5. 系统设置——This is achieved by configuring the mobile phone /data/system/users/0/directory
    settings_global.xmland these three files to realize the mobile phone settings. The specific corresponding settings can be found in settings_secure.xmlthe Android API . The principle of this function is the same as the settings command below .settings_system.xml9. shell脚本
  6. 分享位置信息——Same 触发as here, using the Google Maps API, the positioning may be inaccurate or fail.
  7. 写入文件—— UTF-8 encoding is used to write files, and the suffix name can be customized.
  8. shell脚本——It is equivalent to using adb shell the command in the ADB tool on the computer, but it needs Root permission to run on the phone. Commonly used shell commands can refer to this link (not my article), or you can directly search for related posts. If the link contains the adb shell command, you only need to fill in the content behind the shell in this APP, and finally check Root.
  9. 文本操作——This function can intercept, replace, and format local variables and global variables in the APP, as well as system-related variables and information in Android, and supports regular expressions.
  10. 等待下一步操作——Delay function, at least 10ms. Generally, it is best to add this action before and after actions with long-term response, otherwise the application will be stuck.
  11. 发送电子邮件- Gmail accounts may not work. The SMTP mailbox needs to be configured. For details, please refer to QQ mailbox configuration . The specific method is shown in the figure below:
Figure 3 SMTP service configuration

  1. SMTP server address: smtp.qq.com
  2. SMTP server port: 465
  3. Tick ​​Use Authentication
  4. Username: your QQ mailbox account
  5. Password: Click in the warm reminder under the QQ邮箱设置>>> 账户>>> item to get the password (do not fill in the QQ mailbox login password)POP3/IMAP/SMTP/Exchange/CardDAV/CalDAV服务生成授权码

constraint

The characteristics of constraints are the same as triggers, and conditions can be nested with each other. The first-level logical relationship is a union, that is, it is executed when all the following conditions are met at the same time.

variable

Variables are used to store and transmit data in this APP, and can be used as trigger conditions and constraints. Variables can be nested, but pay attention to the relationship between inside and outside. Local variables can only be used within the same instance. Global variables can be used in all instances. The maximum value of an integer variable is 2^32, which is 4294967296

3. Matters needing attention

  • Trigger, action, limit, press and hold each function button or click the question mark icon in the upper right corner to display help, and long press when editing the status will also pop up help.
  • The one marked with Root in the function button needs to obtain the Root permission, and the one marked with ADB needs to open the ADB permission of Macrodroid through the ADB tool, and at the same time, any condition marked can be used
  • To keep the background of the application valid for a long time, please lock the background , ignore battery optimization , enable auto-start , enable necessary permissions , and turn on the accessibility switch and other related settings in each brand of mobile phone .

write at the end

在使用软件的过程中,如遇到问题的或是有不明白的地方又或在本文中没能阐述清楚的、不恰当的,欢迎留言评论,我会尽力一一回复,并在后续中加以修正!

Guess you like

Origin blog.csdn.net/qq_32917155/article/details/119888421