Skip to content

Add unattended remote access support - #45

Open
Rambomst wants to merge 4 commits into
Ylianst:mainfrom
Rambomst:feature/unattended-remote-access
Open

Add unattended remote access support#45
Rambomst wants to merge 4 commits into
Ylianst:mainfrom
Rambomst:feature/unattended-remote-access

Conversation

@Rambomst

@Rambomst Rambomst commented May 30, 2026

Copy link
Copy Markdown
  • Add foreground service, boot receiver, and accessibility remote control
  • Route agent lifecycle through shared runtime controller
  • Add unattended setup prompts and settings status entries
  • Improve remote desktop refresh and session notifications
  • Update Gradle and scanner dependency versions

Potential Concerns:
These changes cause Google Play Protect to flag this .apk when being sideloaded due to what I can tell is the accessibility feature used for unattended access. I was reading up on it, I don't think this should stop the app from getting on the play store. It just means outside of the play store there is adb install and enterprise based deployments, or being rooted.

Disclaimer: An AI coding assistant was using when developing these changes

Rambomst added 3 commits May 30, 2026 21:57
- Add foreground service, boot receiver, and accessibility remote control
- Route agent lifecycle through shared runtime controller
- Add unattended setup prompts and settings status entries
- Improve remote desktop refresh and session notifications
- Update Gradle and scanner dependency versions
…tter battery usage

- Add retry backoff logic with delay for agent reconnection attempts
- Introduce `shouldKeepForegroundServiceRunning` for better service control
- Optimise frame encoding with idle frame delay adjustments
- Enhance user disconnect handling via shared preferences
- Adjust remote desktop frame capturing to dynamically handle delays
- MeshAgent: stop starting projection immediately after the agent control
  connection authenticates.
- AgentRuntime: require an active desktop tunnel before starting screen
  projection.
@Rambomst

Copy link
Copy Markdown
Author

Ive had this running on two devices without any issues for the past week or so. My initial commit introduce some battery issues but that was resolved and now its back to basically using nothing.

…s disabled

- Implement user consent prompt via dialogs and notifications for remote desktop access.
- Add new notification channel for "Approve/Deny" screen sharing actions.
- Ensure thread-safe handling and lifecycle management for capture processes.
- Remove redundant battery optimization request logic.
- Optimize screenshot capture flow with throttling and backoff mechanisms.
@Rambomst

Rambomst commented Jun 14, 2026

Copy link
Copy Markdown
Author

A few fixes to the unattended consent flow, with Play Store approval in mind.

  • Consent is properly enforced now. With Automatic Consent off, every session has to be approved (in-app dialog, or Approve/Deny on the notification), so there's no silent screen capture, which is the main thing Google flags for apps like this.
  • Removed the battery optimization popup that auto-fired on launch, since auto-firing that intent is a known rejection trigger. It's only reachable from Settings now.
  • Capture only runs during an active session and shows a persistent notification plus a per-session one, so it stays transparent rather than looking like spyware.

To hopefully get this through review we need to do this in Play Console:

  • Complete the Accessibility API declaration and add a prominent in-app disclosure, framed as person-driven remote support as Google restricts accessibility use for automation as of the Jan 2026 policy change.
  • Fill in the foreground service types declaration for the specialUse service which needs a short justification and a demo video. Something like this:

MeshCentral Agent is a remote management/support tool. The foreground service keeps a persistent connection to the management server open so an administrator can reach the device on demand for remote desktop, file transfer, and commands. It has to run continuously and indefinitely; it isn't a finite data sync, media playback, location job, or any other predefined types, so specialUse applies.

  • There might also be a need to justify the battery optimization exemption, but that should be fine since this agent wouldn't work properly without it. If they did have an issue with it we can change it pretty easily but no harm in trying if this was already going through review.

How to sideload this with the accessibility changes:

Play Store > profile icon > Play Protect > gear/settings icon > toggle off "Scan apps with Play Protect" > install the APK > turn it back on after.

Then it blocks the accessibility access until we do this:
Settings > Apps > Mesh Central > App info⋮(top-right) > Allow restricted settings (authenticate), then the toggle works.

@GlitchedCod

Copy link
Copy Markdown

I hope that this get official one day, it's really a useful feature. The app itself without that is basically useless, it's not ok to ask a user how to go to the home menu, find all the apps, start the agent and then allow the screen sharing. Plus you can't see when a device is online on the MeshCentral dashboard since the app is not running in the background if it wasn't started at the launch of the device.

It would also be cool to add the "device administrator" rights to the app so that it can be set as the device owner, disable FRP on the device and so that the user can't uninstall it unless the device is wiped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants