main
John Lauer Publish 0.1.3 28b92ce

name: adom-bridge-android description: >- Use the user's Android phone as an Adom Bridge target: open and drive apps, take screenshots, read texts and notifications, place calls, send texts, over the Adom Mesh, with no cable. Also install and set up the phone app. Use when asked to do something on my phone, open an app on my phone, read my texts, call or text someone, or put my phone on my mesh.

Adom Bridge Android

The phone is one more --target on the user's Adom Mesh. Find its name with adom-bridge targets, then:

adom-bridge --ai-thread "<thread>" --target <phone> status
adom-bridge --ai-thread "<thread>" --target <phone> commands     # every verb and its arguments
adom-bridge --ai-thread "<thread>" --target <phone> android_open_app '{"app":"Clock","reason":"Set the 6 AM alarm you asked for"}'

Rules

  • Every gated verb needs reason: one plain sentence. The owner reads it on the phone.
  • Calls and texts reach other people. Only place or send one the user asked for, and name exactly who and what in chat first. Never turn these permissions to "Always" for convenience.
  • Never try to get past a prompt. Permission and trust need a real finger on the phone; injected touches are refused. declined means stop and ask in chat. Do not retry.
  • protected_app (banks, wallets, password managers, Settings): not available to you.
  • device_locked: only the owner can unlock it. android_wake lights the screen, no more.
  • The owner may be using the phone. Say what you are about to do before you open an app.
  • Passwords need the owner's "Type passwords". Type only a password the user gave you for that app, in one android_type call with value. Never put it in reason, in chat or in a file.
  • Android permission popups need the owner's "Answer permission popups". android_screen_read returns permissionPopup with the question. If buttonsHidden is true, take an android_screenshot and send android_tap {x, y, button}, where button is the exact words on the button. Press what the user asked for, and choose the narrower option when they did not say. Popups about Adom Bridge itself, protected apps, or anything that is not recognised as a permission question are refused: leave those to the owner.

Driving an app

  1. android_open_app {app}.
  2. android_screenshot to see it. android_screen_read lists the nodes.
  3. android_tap, android_type, android_scroll or android_swipe.
  4. Look again before saying it worked.

Texts and notifications

  • android_sms_read returns SMS and MMS. RCS chats in Google Messages are usually not there: use android_notifications.
  • android_contacts looks up a number. If several match, ask the user which. Never guess.

Set up a phone

Android 13 or later. The APK is in the Download box of adom/adom-bridge-android.

With a USB cable (USB debugging on, the "Allow USB debugging" prompt accepted): download the APK, then run APK=<apk> tools/install-on-phone.sh adb. It installs the app and turns on screen access, notification access and the battery exemption. Pass adb -s <serial> if several devices are attached. On Samsung, Auto Blocker must be off for USB debugging.

Without a cable: the owner downloads the APK on the phone and installs it, then uses the Setup list in the app. If Android greys out Screen access, the owner opens the app's App info page, the three-dot menu, "Allow restricted settings".

Then the owner, on the phone: Sign in to Adom, tap their machine under Your machines, and Trust this machine. On the PC, they accept Adom Bridge's MESH JOIN card. These steps are theirs; do not do them for them.

Update the app

From 0.1.2, over the mesh: send_files the new APK, then android_update_app {file}. The owner turns on Setup > Update over Wi-Fi once and approves each update on the phone. Then call status until version changes.

When it does not answer

  • After a trust change or a restart of the app, the first call can take about 30 s. A PC that just failed to reach the phone waits up to 2 minutes before it tries again.
  • The app must be Reachable (top switch) and exempt from battery limits ("Stay reachable").
  • status shows the battery, network, lock state, current setup and permissions.