Skip to content

Add Desktop.Android: Android remote desktop agent for Remotely - #12

Draft
Undermozes with Copilot wants to merge 4 commits into
masterfrom
copilot/create-remote-desktop-agent
Draft

Undermozes with Copilot wants to merge 4 commits into
masterfrom
copilot/create-remote-desktop-agent

Conversation

Copilot AI commented Mar 11, 2026 •

Copy link
Copy Markdown

Implements a complete Android remote control agent (Desktop.Android) that brings Remotely's remote desktop capabilities to Android devices (API 26+ / Android 8.0 Oreo).

New Project: Desktop.Android/

Screen capture — AndroidScreenCapturer uses the MediaProjection API + ImageReader to capture frames and converts RGBA→BGRA for SkiaSharp:

const int PixelFormatRgba8888 = 1;  // PixelFormat.RGBA_8888 — not exposed by name in ImageFormatType
_imageReader = ImageReader.NewInstance(width, height, (ImageFormatType)PixelFormatRgba8888, 2);
_virtualDisplay = _mediaProjection?.CreateVirtualDisplay("RemotelyCapture", width, height, dpi,
    DisplayFlags.None, _imageReader.Surface, null, null);

Input injection — RemotelyAccessibilityService dispatches gestures via AccessibilityService.DispatchGesture (API 26+) and injects text via AccessibilityNodeInfo.Action.SetText. Mouse hover is a documented no-op (no hardware cursor on touch devices).

Foreground service — AgentForegroundService keeps the SignalR connection alive with foregroundServiceType = mediaProjection | remoteMessaging (Android 14 compliance).

Remaining services implement the full Desktop.Shared interface surface:

Service Mechanism
Clipboard ClipboardManager.PrimaryClip polling + write
File transfer App external storage (Android/data/<pkg>/files/Remotely/)
Session indicator Ongoing NotificationChannel notification
Remote access consent AlertDialog allow/deny before session starts
Audio capturer Safe no-op (requires privileged CAPTURE_AUDIO_OUTPUT)
Chat AlertDialog for inbound messages

Supporting Changes

  • Shared/Enums/Platform.cs — added Android value
  • Desktop.Shared/Properties/AssemblyInfo.cs — InternalsVisibleTo("Remotely_Desktop_Android") so the Android project can call AddRemoteControlXplat()
  • Remotely.sln — project added
  • .github/workflows/build-android.yml — CI workflow; produces unsigned APK by default, signed APK only when all three keystore secrets (ANDROID_KEY_ALIAS, ANDROID_KEY_PASS, ANDROID_STORE_PASS) are present — no silent unsigned fallback

Android Manifest Permissions

INTERNET, FOREGROUND_SERVICE, FOREGROUND_SERVICE_MEDIA_PROJECTION, POST_NOTIFICATIONS, RECORD_AUDIO, READ_MEDIA_*, WAKE_LOCK — plus accessibility service declaration with canPerformGestures="true".


Please read the following. Do not delete below this line.

Thank you for your contribution to the Remotely project. It is required that contributors assign copyright to Immense Networks so we retain full ownership of the project.

This makes it easier for other entities to use the software because they only have to deal with one copyright holder. It also gives me assurance that we'll be able to make decisions in the future without gathering and consulting all contributors.

While this may seem odd, many open source maintainers practice this. Here are a couple well-known examples:

A nice article on the topic can be found here: https://haacked.com/archive/2006/01/26/WhoOwnstheCopyrightforAnOpenSourceProject.aspx/

By submitting this PR, you agree to the following:

You hereby assign copyright in this PR's code to the Remotely project and its copyright holder, Immense Networks, to be licensed under the same terms as the rest of the code. You agree to relinquish any and all copyright interest in the software, to the detriment of your heirs and successors.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.myget.org
    • Triggering command: /opt/hostedtoolcache/CodeQL/2.24.2/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp /opt/hostedtoolcache/CodeQL/2.24.2/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp (dns block)
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/Remotely/Remotely/Remotely.sln --packages /tmp/codeql-scratch-308cdbf2ab4d8643/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-308cdbf2ab4d8643/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-308cdbf2ab4d8643/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true -w s/AndroidCursorIconWatcher.cs security /net10.0/android_api_check OUTPUT -d 168.63.129.16 /net10.0/android_api_check (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: Undermozes <58026189+Undermozes@users.noreply.github.com>
Copilot AI changed the title [WIP] Add plan for remote desktop agent on Android Add Android remote desktop agent plan Mar 11, 2026
Copilot AI and others added 2 commits March 11, 2026 22:36
Co-authored-by: Undermozes <58026189+Undermozes@users.noreply.github.com>
Co-authored-by: Undermozes <58026189+Undermozes@users.noreply.github.com>
Copilot AI changed the title Add Android remote desktop agent plan Add Desktop.Android: Android remote desktop agent for Remotely Mar 11, 2026
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