When AI Learns to "See the Screen": Dissecting Runtime-Powered Android Malware
This article examines a new class of Android malware that sends the live screen structure to a cloud-based large language model during execution and then acts on the model's instructions. It explains how runtime AI reasoning works, how screen node data is collected and turned into action commands, why this approach solves the persistence problem across device brands, and the full attack chain from phishing to uninstall resistance. It also covers recovery through Android Safe Mode and practical detection and hardening advice for developers.
1. Overview: Malware That “Thinks While It Runs”
Traditional Android malware usually has its behavior hard-coded at packaging time. Developers write the controls to click, the screens to read, and the paths to navigate directly into the code. Such samples may work on a single device model or OS version, but they break as soon as the target device’s view hierarchy, control naming, or “recent tasks” locking logic changes.
A class of Android malware that security researchers describe as “runtime-integrated generative AI” changes this premise. Instead of relying on a pre-written sequence of actions, it sends the current screen’s structural data to a cloud-based large model while running on the infected device. The model analyzes the data and returns structured action instructions, which the malware then executes. Public research records show that early versions of these samples appeared in January 2026, with more advanced versions submitted to a public sample analysis platform in February of the same year. The associated cloud and model service providers subsequently shut down the related assets.
This is fundamentally different from “using AI to write scam scripts” or “using AI to generate malicious code.” The latter happens during the attack preparation stage; the former happens during the attack execution stage. It marks a shift in mobile malware from “script automation” to a closed loop of “perception–decision–execution.”
2. Technical Breakdown: How Visual Analysis and Instruction Feedback Work
2.1 What “Runtime” Means
Runtime refers to the period when a program is actually running. In this context, it emphasizes that the malware can connect to AI in real time for inference and decision-making while running on the phone, rather than hard-coding every branch before release. This design shifts the “adaptation cost” from the developer to the model side.
2.2 Collecting Structured Screen Data
Android provides an accessibility node tree interface for accessibility capabilities. By abusing the accessibility service, malware can obtain the XML-like structure of the current screen, including control types, text, clickable attributes, and screen coordinates. Compared with screenshots, structured data is smaller in size, more stable to parse, and easier for a model to convert into precise coordinates.
An illustrative data structure is shown below (for form only, not a real interface):
{"screen": "recent_tasks","nodes": [{"type": "ImageView", "text": "", "clickable": false, "bounds": [120, 800, 300, 980]},{"type": "TextView", "text": "Task card", "clickable": false, "bounds": [40, 700, 360, 760]},{"type": "Button", "text": "Lock", "clickable": true, "bounds": [40, 980, 200, 1040]}]}
2.3 Action Instructions Returned by the Model
The malware requires the model to output action instructions in JSON format. Typical actions include click, long press, swipe, text input, and go back. Examples:
{"action": "long_press", "x": 210, "y": 890, "duration_ms": 800}{"action": "click", "x": 120, "y": 1010}
This “structured input–structured output” protocol design means the execution end does not need to understand semantics; it only needs to execute by coordinates, greatly reducing engineering complexity.
2.4 Why AI Is Necessary: The Persistence Problem
The malware needs to lock itself in the “recent tasks” list to prevent users from clearing it with one tap. The problem is that different vendors’ customized systems have completely different interaction paths for locking an app: some show a menu on long-pressing the card, some expand more buttons by swiping up, and some require entering the app info page first. Traditional scripts must maintain a separate branch for each brand, which is costly and prone to failure.
With a model in place, the malware only needs to send the current screen structure; the model can “understand” what screen it is and where to click next, adapting to multiple device brands with a single logic. This is the core reason generative AI is embedded in the attack chain: replacing fragmented adaptation with general-purpose semantic understanding.
3. Full Attack Chain: From Phishing to Loss of Control
- Initial delivery: Disguised as the login or verification page of a major bank, tricking the user into downloading and installing an app package from an unknown source, and inducing the user to enable accessibility permissions during installation.
- Permission abuse and persistence: Using the accessibility service to achieve persistent residence, monitoring foreground app changes, and automatically taking over operations when the target screen appears.
- Real-time decision-making: Collecting screen structure, calling the cloud model for action instructions, and completing steps such as locking, navigation, and input.
- Information theft: Capturing PINs, passwords, and verification information in a fake input screen and sending it back to a channel controlled by the attacker.
- Anti-uninstall: Overlaying a transparent layer when the user attempts to uninstall, intercepting clicks and confirmations so the uninstall process cannot complete.
4. Cleanup and Recovery: Safe Mode Is the Reliable Path
Because overlay layers and accessibility abuse interfere with normal uninstallation, the most reliable way to remove the malware is to enter Android Safe Mode. This mode disables third-party apps and some auto-start capabilities, causing the malware to lose its foreground interference ability. Then, uninstall suspicious apps in system settings and revoke their accessibility and device admin permissions. After cleanup, it is recommended to change passwords for related accounts, check SMS and verification messages, and perform a factory reset if necessary.
5. Detection and Hardening Advice for Developers
- Permission side: Establish whitelists and audits for accessibility service usage, with secondary confirmation before sensitive operations.
- Behavior side: Monitor features such as high-frequency view tree reads, abnormal long-press durations, and non-standard coordinate clicks.
- Network side: Set alerts for high-frequency runtime outbound connections and structured JSON round trips, forming a closed loop with logging and monitoring services.
- Supply chain side: Distribute apps only through trusted channels, and verify signatures and package integrity.
- Architecture side: Combine risk control, identity verification, and device fingerprinting to avoid single-point reliance on screen input.
6. Trend Outlook
When models gain real-time visual understanding, attackers obtain a “universal adapter.” Defense should therefore shift from “matching known samples” to “constraining capability boundaries”: minimizing permissions, strengthening runtime behavior audits, and establishing observability for AI outbound connections. For developers and enterprises, understanding this chain is the starting point for building the next generation of mobile security defenses.
