Aqara egress: what on the S1 sends data to Aqara, and how the frame agent stops all of it
Status (2026-11-28): working, verified on a panel (run 24). The firmware inventory is read from 4.5.80. The panel probe of what runs and what it queues (run 23) and the block itself (run 24) are verified.
Device: Aqara Panel Hub S1 Plus, firmware 4.5.80 (peony_evb2-user 10 QP1A.191105.004). Tools: sdat2img.py,
debugfs (e2fsprogs), aapt2, strings, grep.
Question
The maintainer's goal is that no data reaches Aqara. Turning off Aqara's apps
(debloat.md) and stopping ha_master were meant to get there. Then, during run 20c of the adb key
work (#981, adb-keys.md there), METIS saw an app logging under AqaraSensorsData queue an analytics event for an adbd
restart, carrying the panel's model and an id derived from its MAC. So two things were needed: which software on the
panel can still send data to Aqara, and a way to stop all of it that holds as Aqara's software changes.
How we got here
-
The first idea, disabling one more app, doesn't hold. The logger is
com.lumi.settings(LumiSettings), which the de-bloat keeps on purpose. It exports content providers and boot receivers that other parts of the firmware may read, so turning it off isn't proven safe. And it's one sender among several. -
Blocking apps by uid alone doesn't work either. Seven of Aqara's apps share Android's
systemuid (1000), the same uid assystem_server. So a per-app firewall can't tell LumiSettings from Android itself. -
Blocking by address alone doesn't hold. Most of Aqara's hosts resolve to shared hosting: Cloudflare (
www.aqara.com), AWS load balancers (datasink.aqara.cn, the US and Korea endpoints) and Tencent's CDN (cdn.aqara.com). A list of addresses would break unrelated sites and go stale as they move. -
So the block works by role, in three layers, at the network's edge.
- Names, for every process. A DNS query for any name under Aqara's domains is refused, which covers subdomains nobody has listed yet.
- Addresses, for every process. The addresses Aqara's software uses without a DNS lookup are refused.
- Aqara's processes. Every process that runs as root or as
system, and every Aqara app's own uid, reaches only the local network, DNS and NTP.
Nothing in Glassworks' root side needs the internet: the app downloads updates and the agent only checks them. Android's network check is the one thing in
system_serverthat does, and Android can skip it (below).
What we tried
-
The vendor and product partitions from the 4.5.80 OTA (2026-11-28, read). The images were rebuilt from
vendor.new.dat.brandproduct.new.dat.brwithsdat2img.py, then dumped withdebugfs. They're kept outside the repo, under/tmp.$ grep -rl -a AqaraSensorsData vendor/ -> app/LumiSettings/LumiSettings.apk $ aapt2 dump xmltree --file AndroidManifest.xml <apk> | grep sharedUserIdThese apps share
android.uid.system:com.lumi.settingscom.lumi.systemmanagercom.lumi.otacom.lumi.siricom.lumi.dreamcom.lumi.agingcom.goodix.rawdata
The Aqara apps with their own uid:
com.aqara.inhome.managercom.aqara.inhome.launchercom.aqara.inhome.embedded_chatcom.aqara.inhome.vassistantcom.aqara.musiccom.android.gallery3d(Aqara's gallery)
-
The hosts Aqara's software knows (2026-11-28, read). The apps' DEX and the native daemons were searched for host names.
Where Hosts LumiSettings datasink.aqara.cn(SensorsData)Manager, Launcher, Chat, Music aiot-rpc.aqara.cn,aiot-test.aqara.com,aiot-debug1.aqara.com,inhome.aqara.com,mpush-api.aliyun.com,adash.m.taobao.com(Alibaba's analytics)Launcher also ys7.comandezvizlife.com(EZVIZ cameras),ip.taobao.comVoiceAssistant ai-echo.aqara.cn,rpc-debug.aqara.com,*.duiopen.com,log.aispeech.com,119.29.29.29(DNSPod)ha_master(root)aiot-rpc.aqara.cn,bridged.aqara.com,aiot-coap-test.aqara.cn,aiot-central-coap-test.aqara.cn(clouds/aiot/coap_task.cpp)ha_lanbox(root)aiot-coap-test.aqara.cnAll of Aqara's own hosts sit under
aqara.comoraqara.cn. The region endpoints are built at run time (rpc-ger.aqara.com, seen in debloat.md). The CoAP serverha_masterwas seen using (43.131.7.8:15050, 2026-11-09) is in no binary: it comes from the cloud's own configuration. So no DNS lookup covers it.vendor/etc/init/gateway.rcstarts Aqara's gateway daemons as root (u:r:su:s0):ha_master,ha_agent,ha_basis,ha_lanbox,ha_driven,ha_matter,mosquitto,siri_metricsand the Zigbee host. -
What a Glassworks panel runs and queues (run 23, 2026-11-28, verified, read-only, from METIS).
- LumiSettings runs as uid 1000, enabled, with its
ThemeServerservice. - The SensorsData queue is
/data/data/com.lumi.settings/databases/sensorsdata, 248 KB. Itseventstable held 433 rows from 2026-11-09 to 2026-11-28, about 12 a minute at idle. Most ares_crashrecords read from/data/log/restart.txt, with the device id and model. - No upload has worked yet. The log has 186 lines of
SSLPeerUnverifiedException: Hostname datasink.aqara.cn not verified: the server presents a certificate for*.aqara.com/aqara.com, which doesn't cover.cn. But each try still resolves the name and opens a TLS connection to Aqara, which hands them the panel's address and the moment it tried. Once Aqara fixes the certificate, the queue goes out. - The radio firewall (
GWRADIO) is inbound only, so nothing blocked any of this.
- LumiSettings runs as uid 1000, enabled, with its
-
The block, built (2026-11-28, tested off-device in
shell-tests.sh, "nothing reaches Aqara"). The frame agent'saq_apply, run every loop, puts an OUTPUT chainGWAQARAin both families. It's replaced atomically withiptables-restore --noflush, as the radio firewall is.- Names, for every process. DNS over udp and tcp 53 goes through
GWAQARA_NAMES. There, a query for any name underaqara.com,aqara.cnorlumiunited.comis refused. The match is-m string --hex-string "|05|aqara|03|com|00|" --icase, the name as a query carries it. - DNS over TLS (tcp 853) is refused. Android 10's automatic private DNS then falls back to plain DNS, which the name rules can read. On a panel set to a private DNS hostname, 853 stays open (strict mode has no fallback), and the status says names aren't checked.
- Addresses, for every process:
43.131.7.8. - Aqara's processes. Root (uid 0),
system(uid 1000) and every Aqara app's own uid (from/data/system/packages.list) jump toGWAQARA_DST. That chain lets them reach DNS, NTP (udp 123), private and link-local ranges, multicast and the panel's own subnets, and rejects everything else. - Replies to connections opened to the panel pass first (
-m conntrack --ctdir REPLY). So Home Assistant still reaches the radio's ports and the ESPHome API. - Android's network check. It runs in
system_serverhere (/system/priv-app/InProcessNetworkStack, uid 1000), so the block would fail it, and the app's update check waits for a validated network (UpdateManager). With the block on, the agent setscaptive_portal_modeto0. Android 10's NetworkMonitor then skips its probes and treats the network as working:isCaptivePortal()returns success when the mode isIGNORE. It keeps the old value in$DIR/aqara-captive-portal-modeand puts it back when the block goes off. - Kernels without a match fall back. If iptables refuses the rules, the agent tries without conntrack's
direction (
-m state RELATED,ESTABLISHED), then without the string match. The status says which form held. - The switch is the app's existing Block Aqara cloud (on by default). The wall base pane writes
persist.glassworks.aqara_block(on/off); the agent treats anything butoffas on. The status is insys.glassworks.aqara.block, Diagnostics, and the Device page's "Aqara's internet access" row.
- Names, for every process. DNS over udp and tcp 53 goes through
-
Run 24: the block on the panel (2026-11-28, verified; driven from METIS, the agent pinned at
79328cc5through the loader's dev override, no reboot, app 0.9.0 as found).-
As found:
ntp_serverwasnull(Android's own default, not an Aqara host),private_dns_modewasnull, and Wi-Fi was validated.ha_agent,ha_basis,ha_lanbox,ha_driven,mosquittoandsiri_metricswere running, andha_masterwas stopped by the app. The log held 190datasink.aqara.cn not verifiedlines, and 437 SensorsData events were queued. -
The kernel took the strongest form,
ctdir string:sys.glassworks.aqara.block=on: 9 uids local only, names blocked. The uids were 0, 1000 and seven Aqara apps. iptables printed the name rules as-m string --hex-string "|05617161726103636f6d00|" --algo bm --to 65535 --icase -j REJECT, and-j GWAQARAwas the first OUTPUT rule in both families. -
Behaviour:
Test Result shell: ping datasink.aqara.cn(alsoaqara.com)"unknown host", rc 2 shell: ping www.google.comrc 0 root: ping 1.1.1.1refused, rc 1 root: ping the LAN gateway rc 0 datasink.aqara.cn not verifiedin the log192, then 192 three minutes later: the TLS tries stopped Wi-Fi still VALIDATEDClock right to the second Radio, Home Assistant ok thread_router, the ESPHome API connectedThe SDK now fails before any connection:
SA.AnalyticsMessages: Connection error: java.net.UnknownHostException: Unable to resolve host "datasink.aqara.cn". Its events stay queued on the panel (439, then 441). None leave. -
Off and on again: the rules were gone in both families, and
captive_portal_modewent back tonull. Then on again: 36 IPv4 and 33 IPv6 rules, and one jump per family. -
An agent restart kept exactly one jump per family. With the block off,
datasink.aqara.cnresolved again. The panel was restored as found. -
One harmless oddity. The panel has two addresses in one
fd…::/64(the Thread network's ULA), so that prefix appeared twice inGWAQARA_DST.fc00::/7covers it anyway.
-
Result
| Who | Could reach Aqara before | With the block |
|---|---|---|
| LumiSettings (SensorsData, uid 1000) | DNS and TLS to datasink.aqara.cn, every few seconds; the data once Aqara fixes its certificate |
The name is refused, and uid 1000 reaches only the LAN, DNS and NTP |
ha_master and the other gateway daemons (root) |
The CoAP and RPC cloud, from boot until the app stopped ha_master |
Root reaches only the LAN, DNS and NTP, from when the agent starts; 43.131.7.8 is refused for everyone |
| Aqara's apps (manager, launcher, voice, music…) | Disabled by the de-bloat; their hosts are known | Their own uids reach only the LAN, DNS and NTP; their names are refused |
| Any other app on the panel, Glassworks included | Could look up and reach any Aqara host | Can't resolve any name under aqara.com, aqara.cn or lumiunited.com, or reach 43.131.7.8 |
Third-party hosts that only Aqara's software uses (Alibaba's analytics and push, AISpeech, EZVIZ, Tencent) aren't refused by name for every app: Aqara's processes can't reach them anyway, and other apps may legitimately use those companies.
How to reproduce
On a panel with a frame bundle that has this agent. It changes iptables (RAM only) and one global setting; the undo is below.
- Check that
getprop sys.glassworks.aqara.blockstarts withon:.iptables -S GWAQARAandip6tables -S GWAQARAlist the rules, andsettings get global captive_portal_modeshows0. - Check that root can't reach the internet:
su -c 'ping -c1 -W3 1.1.1.1'fails. Lookups for Aqara's names fail:ping -c1 datasink.aqara.cngives "unknown host". Home Assistant still reaches the panel. - Check that LumiSettings stops trying:
logcat -d | grep -c 'datasink.aqara.cn not verified'stays flat.
Undo: turn off Block Aqara cloud, or run setprop persist.glassworks.aqara_block off. The agent removes the
chains and puts captive_portal_mode back. A reboot without the agent leaves no rules.
Open questions
- Other panels: run 24 covered the dev panel, whose
ntp_serveris unset. A panel where Aqara set it to a host under its own domains would lose time sync under the name block. None has been seen. - Over days: nothing of Android's own broke in run 24, but that was about ten minutes with uid 1000 off the internet.
- The SensorsData queue keeps growing (433 rows in 19 days) with nowhere to go. The SDK has opt-out prefs that could stop it from queuing at all, and they haven't been tried. Clearing the queue is a separate decision.
- The window at boot: Aqara's daemons start before the agent applies the rules. That's a few seconds, as with
ha_mastertoday.