{"id":13582713,"url":"https://github.com/bk138/droidVNC-NG","last_synced_at":"2025-04-06T14:31:14.017Z","repository":{"id":39366217,"uuid":"316240505","full_name":"bk138/droidVNC-NG","owner":"bk138","description":"VNC server app for Android that does not require root privileges.","archived":false,"fork":false,"pushed_at":"2024-10-28T10:06:58.000Z","size":1571,"stargazers_count":1359,"open_issues_count":29,"forks_count":200,"subscribers_count":43,"default_branch":"master","last_synced_at":"2024-10-29T15:27:34.645Z","etag":null,"topics":["android","mediaprojection","remote-desktop","rfb","server","vnc","vnc-server"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bk138.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"bk138","patreon":"bk138","liberapay":"bk138","issuehunt":"bk138"}},"created_at":"2020-11-26T13:33:06.000Z","updated_at":"2024-10-28T23:07:40.000Z","dependencies_parsed_at":"2023-12-22T11:55:03.243Z","dependency_job_id":"27830221-574b-4e56-b913-2641e1a931d5","html_url":"https://github.com/bk138/droidVNC-NG","commit_stats":null,"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bk138%2FdroidVNC-NG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bk138%2FdroidVNC-NG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bk138%2FdroidVNC-NG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bk138%2FdroidVNC-NG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bk138","download_url":"https://codeload.github.com/bk138/droidVNC-NG/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318744,"owners_count":20919484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","mediaprojection","remote-desktop","rfb","server","vnc","vnc-server"],"created_at":"2024-08-01T15:02:57.655Z","updated_at":"2025-04-06T14:31:14.012Z","avatar_url":"https://github.com/bk138.png","language":"Java","funding_links":["https://github.com/sponsors/bk138","https://patreon.com/bk138","https://liberapay.com/bk138","https://issuehunt.io/r/bk138"],"categories":["Java"],"sub_categories":[],"readme":"# droidVNC-NG\n\n[![Join the chat at https://gitter.im/droidVNC-NG/community](https://badges.gitter.im/droidVNC-NG/community.svg)](https://gitter.im/droidVNC-NG/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nThis is an Android VNC server using contemporary Android 7+ APIs. It therefore does not require\nroot access. In reverence to the venerable [droid-VNC-server](https://github.com/oNaiPs/droidVncServer)\nis is called droidVNC-NG.\n\nIf you have a general question, it's best to [ask in the community chat](https://gitter.im/droidVNC-NG/community). If your concern is about a bug or feature request instead, please use [the issue tracker](https://github.com/bk138/droidVNC-NG/issues).\n\n[\u003cimg src=\"https://fdroid.gitlab.io/artwork/badge/get-it-on.png\"\n     alt=\"Get it on F-Droid\"\n     height=\"80\"\u003e](https://f-droid.org/packages/net.christianbeier.droidvnc_ng/)\n[\u003cimg src=\"https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png\"\n     alt=\"Get it on Google Play\"\n     height=\"80\"\u003e](https://play.google.com/store/apps/details?id=net.christianbeier.droidvnc_ng)\n\n## Features\n\n* Network export of device frame buffer with optional server-side scaling.\n* Injection of remote pointer and basic keyboard events (Latin-1 charset plus some special keys,\n  supporting any kind of UI widget on Android 14 and newer, on older devices into EditText widgets only).\n* Handling of client-to-server text copy \u0026 paste. Note that server-to-client copy \u0026 paste only works\n  automatically for text selected in editable text fields or manually by sharing text to droidVNC-NG\n  via Android's Share-To functionality.\n* Handling of special keys to trigger 'Recent Apps' overview, Home button, Back button and Power button.\n* Android permission handling.\n* Screen rotation handling.\n* File transfer via the local network, assuming TightVNC viewer for Windows version 1.3.x is used.\n* Password protection for secure-in-terms-of-VNC connection. Note that setting a password is mandatory\n  in case you want to access the server using MacOS's built-in Screen Sharing app.\n* Ability to specify the port used.\n* Start of background service on device boot.\n* [Reverse VNC](#reverse-vnc).\n* Ability to [connect to a UltraVNC-style Mode-2 repeater](#reverse-vnc).\n* Functionality to provide default configuration via a JSON file.\n* Zeroconf/Bonjour publishing for VNC server auto-discovery.\n* Per-client mouse pointers on the controlled device.\n* Ability to control a device’s shared screen directly from a web browser by shipping the fabulous\n  [noVNC](https://github.com/novnc/noVNC) client with the server app. This alleviates the need for a\n  native VNC client.\n\n## How to use\n\n1. Install the app from either marketplace.\n2. Get it all the permissions required.\n3. Set a good password and consider turning the `Start on Boot` off.\n4. Connect to your local Wi-Fi. For accepting a connection your device should be connected to some Local Area Network that you can control, normally it is a router. Connections via data networks (i.e. your mobile provider) are not supported.\n5. Click `Start` and connect to your device.\n\n### Keyboard Shortcuts From a VNC Viewer\n\n* **Ctrl-Shift-Esc** triggers 'Recent Apps' overview\n* **Home/Pos1** acts as Home button\n* **End** acts as Power button\n* **Escape** acts as Back button\n\n### How to connect?\n#### Reverse VNC\nHere's how to connect to a listening VNC viewer without opening a server port:\n1. Leave the VNC port **blank**, which will get the Admin Panel to state the server **isn't** listening for incoming connections.\n2. Make outbound connections by choosing either \"Connect to a **listening viewer**\" or \"Connect to a **repeater**\".\n\n#### Direct VNC\nIf you want to accept incoming connections from VNC viewers:\n1. You should allow [Port Forwarding](https://en.wikipedia.org/wiki/Port_forwarding) in your router's Firewall settings. Either find a [UPnP](https://en.wikipedia.org/wiki/Universal_Plug_and_Play) supported app to open ports dynamically or log in to your router's settings (usually open 192.168.1.1 in your browser, some routers have password written on them).\n2. Find Port Forwarding, usually it's somewhere in **Network - Firewall - Port Forwards**.\n3. Create a new rule, this is an example from OpenWRT firmware.\n   \n   Name: **VNC forwarding**\n   \n   Protocol: **TCP**\n   \n   Source zone: **wan** may be \"internet\", \"modem\", something that suggests the external source.\n   \n   External port: **5900** by default or whatever you specified in the app.\n   \n   Destination zone: **lan** something that suggests local network.\n   \n   Internal IP address: your device's local IP address, leaving **any** is less secure. The device's address may change over time! You can look it up in your routers' connected clients info.\n   \n   Internal port: same as external port.\n\n4. Apply the settings, sometimes it requires rebooting a router.\n5. Figure out your public address i.e. \u003chttps://www.hashemian.com/whoami/\u003e.\n6. Use this address and port from above to connect to your device.\n\n### How to Pre-seed Preferences\n\nDroidVNC-NG can read a JSON file with default settings that apply if settings were not changed\nby the user. A file named `defaults.json` needs to created under\n`\u003cexternal files directory\u003e/Android/data/net.christianbeier.droidvnc_ng/files/` where\ndepending on your device, `\u003cexternal files directory\u003e` is something like `/storage/emulated/0` if\nthe device shows two external storages or simply `/sdcard` if the device has one external storage.\n\nAn example `defaults.json` with completely new defaults (not all entries need to be provided) is:\n\n```json\n{\n    \"port\": 5901,\n    \"portReverse\": 5555,\n    \"portRepeater\": 5556,\n    \"scaling\": 0.7,\n    \"viewOnly\": false,\n    \"showPointers\": true,\n    \"fileTransfer\": true,\n    \"password\": \"supersecure\",\n    \"accessKey\": \"evenmoresecure\",\n    \"startOnBoot\": true,\n    \"startOnBootDelay\": 0\n}\n```\n\n### Remote Control via the Intent Interface\n\ndroidVNC-NG features a remote control interface by means of Intents. This allows starting the VNC\nserver from other apps or on certain events. It is designed to be working with automation apps\nlike [MacroDroid](https://www.macrodroid.com/), [Automate](https://llamalab.com/automate/) or\n[Tasker](https://tasker.joaoapps.com/) as well as to be called from code.\n\nYou basically send an explicit Intent to `net.christianbeier.droidvnc_ng.MainService` with one of\nthe following Actions and associated Extras set:\n\n* `net.christianbeier.droidvnc_ng.ACTION_START`: Starts the server.\n  * `net.christianbeier.droidvnc_ng.EXTRA_ACCESS_KEY`: Required String Extra containing the remote control interface's access key. You can get/set this from the Admin Panel. \n  * `net.christianbeier.droidvnc_ng.EXTRA_REQUEST_ID`: Optional String Extra containing a unique id for this request. Used to identify the answer from the service.\n  * `net.christianbeier.droidvnc_ng.EXTRA_PORT`: Optional Integer Extra setting the listening port. Set to `-1` to disable listening.\n  * `net.christianbeier.droidvnc_ng.EXTRA_PASSWORD`: Optional String Extra containing VNC password.\n  * `net.christianbeier.droidvnc_ng.EXTRA_SCALING`: Optional Float Extra between 0.0 and 1.0 describing the server-side framebuffer scaling.\n  * `net.christianbeier.droidvnc_ng.EXTRA_VIEW_ONLY`:  Optional Boolean Extra toggling view-only mode.\n  * `net.christianbeier.droidvnc_ng.EXTRA_SHOW_POINTERS`:  Optional Boolean Extra toggling per-client mouse pointers.\n  * `net.christianbeier.droidvnc_ng.EXTRA_FILE_TRANSFER`: Optional Boolean Extra toggling the file transfer feature.\n  * `net.christianbeier.droidvnc_ng.EXTRA_FALLBACK_SCREEN_CAPTURE`: Optional Boolean Extra indicating whether to start with fallback screen capture that does not need a\n     user interaction to start but is slow and needs view-only to be off. Only applicable to Android 10 and newer.\n\n* `net.christianbeier.droidvnc_ng.ACTION_CONNECT_REVERSE`: Make an outbound connection to a listening viewer.\n  * `net.christianbeier.droidvnc_ng.EXTRA_ACCESS_KEY`: Required String Extra containing the remote control interface's access key. You can get/set this from the Admin Panel.\n  * `net.christianbeier.droidvnc_ng.EXTRA_REQUEST_ID`: Optional String Extra containing a unique id for this request. Used to identify the answer from the service.\n  * `net.christianbeier.droidvnc_ng.EXTRA_HOST`: Required String Extra setting the host to connect to.\n  * `net.christianbeier.droidvnc_ng.EXTRA_PORT`: Optional Integer Extra setting the remote port.\n  * `net.christianbeier.droidvnc_ng.EXTRA_RECONNECT_TRIES`: Optional Integer Extra setting the number of tries reconnecting a once established connection. Needs request id to be set.\n\n* `net.christianbeier.droidvnc_ng.ACTION_CONNECT_REPEATER` Make an outbound connection to a repeater.\n  * `net.christianbeier.droidvnc_ng.EXTRA_ACCESS_KEY`: Required String Extra containing the remote control interface's access key. You can get/set this from the Admin Panel.\n  * `net.christianbeier.droidvnc_ng.EXTRA_REQUEST_ID`: Optional String Extra containing a unique id for this request. Used to identify the answer from the service.\n  * `net.christianbeier.droidvnc_ng.EXTRA_HOST`: Required String Extra setting the host to connect to.\n  * `net.christianbeier.droidvnc_ng.EXTRA_PORT`: Optional Integer Extra setting the remote port.\n  * `net.christianbeier.droidvnc_ng.EXTRA_REPEATER_ID`: Required String Extra setting the ID on the repeater.\n  * `net.christianbeier.droidvnc_ng.EXTRA_RECONNECT_TRIES`: Optional Integer Extra setting the number of tries reconnecting a once established connection. Needs request id to be set.\n\n* `net.christianbeier.droidvnc_ng.ACTION_STOP`: Stops the server.\n  * `net.christianbeier.droidvnc_ng.EXTRA_ACCESS_KEY`: Required String Extra containing the remote control interface's access key. You can get/set this from the Admin Panel.\n  * `net.christianbeier.droidvnc_ng.EXTRA_REQUEST_ID`: Optional String Extra containing a unique id for this request. Used to identify the answer from the service.\n\nThe service answers with a Broadcast Intent with its Action mirroring your request:\n\n* Action: one of the above Actions you requested\n  * `net.christianbeier.droidvnc_ng.EXTRA_REQUEST_ID`: The request id this answer is for.\n  * `net.christianbeier.droidvnc_ng.EXTRA_REQUEST_SUCCESS`: Boolean Extra describing the outcome of the request.\n\nThere is one special case where the service sends a Broadcast Intent with action\n`net.christianbeier.droidvnc_ng.ACTION_STOP` without any extras: that is when it is stopped by the\nsystem.\n\n#### Examples\n\n##### Start a password-protected view-only server on port 5901\n\nUsing `adb shell am` syntax:\n\n```shell\nadb shell am start-foreground-service \\\n -n net.christianbeier.droidvnc_ng/.MainService \\\n -a net.christianbeier.droidvnc_ng.ACTION_START \\\n --es net.christianbeier.droidvnc_ng.EXTRA_ACCESS_KEY de32550a6efb43f8a5d145e6c07b2cde \\\n --es net.christianbeier.droidvnc_ng.EXTRA_REQUEST_ID abc123 \\\n --ei net.christianbeier.droidvnc_ng.EXTRA_PORT 5901 \\\n --es net.christianbeier.droidvnc_ng.EXTRA_PASSWORD supersecure \\\n --ez net.christianbeier.droidvnc_ng.EXTRA_VIEW_ONLY true\n```\n\n##### Start a server with defaults from Tasker\n\n- Tasker action-category in menu is System -\u003e Send Intent\n- In there:\n  - Action `net.christianbeier.droidvnc_ng.ACTION_START`\n  - Extra `net.christianbeier.droidvnc_ng.EXTRA_ACCESS_KEY:\u003cyour api key from DroidVNC-NG start screen\u003e`\n  - Package `net.christianbeier.droidvnc_ng`\n  - Class `net.christianbeier.droidvnc_ng.MainService`\n  - Target: Service\n\n##### Start a server with defaults from a Kotlin app\n\n- For apps targeting API level 30+, you'll need to specify that your app is able to see/use\n  droidVNC-NG. You do this by adding the following snippet to your AndroidManifest.xml, right under \n  the `\u003cmanifest\u003e` namepace:\n```xml\n\u003cqueries\u003e\n    \u003cpackage android:name=\"net.christianbeier.droidvnc_ng\" /\u003e\n\u003c/queries\u003e\n```\n\n- In your Kotlin code, it's then:\n```kotlin\nval intent = Intent()\nintent.setComponent(ComponentName(\"net.christianbeier.droidvnc_ng\", \"net.christianbeier.droidvnc_ng.MainService\"))\nintent.setAction(\"net.christianbeier.droidvnc_ng.ACTION_START\")\nintent.putExtra(\"net.christianbeier.droidvnc_ng.EXTRA_ACCESS_KEY\", \"\u003cyour api key from DroidVNC-NG start screen\u003e\")\nstartForegroundService(intent)\n```\n\n##### Make an outbound connection to a listening viewer from the running server\n\nFor example from Java code:\n\nSee [MainActivity.java](app/src/main/java/net/christianbeier/droidvnc_ng/MainActivity.java).\n\n##### Stop the server again\n\nUsing `adb shell am` syntax again:\n\n```shell\nadb shell am start-foreground-service \\\n -n net.christianbeier.droidvnc_ng/.MainService \\\n -a net.christianbeier.droidvnc_ng.ACTION_STOP \\\n --es net.christianbeier.droidvnc_ng.EXTRA_ACCESS_KEY de32550a6efb43f8a5d145e6c07b2cde \\\n --es net.christianbeier.droidvnc_ng.EXTRA_REQUEST_ID def456\n```\n\n## Building\n\n* After cloning the repo, make sure you have the required git submodules set up via `git submodule update --init`.\n* Then simply build via Android Studio or `gradlew`.\n \n\n## Contributing\n\nContributions to the project are very welcome and encouraged! They can come in many forms.\nYou can:\n\n  * Submit a feature request or bug report as an [issue](https://github.com/bk138/droidVNC-NG/issues).\n  * Provide info for [issues that require feedback](https://github.com/bk138/droidVNC-NG/labels/answer-needed).\n  * Add features or fix bugs via [pull requests](https://github.com/bk138/droidVNC-NG/pulls).\n    Please note [there's a list of issues](https://github.com/bk138/droidVNC-NG/labels/help%20wanted)\n\twhere contributions are especially welcome. Also, please adhere to the [contribution guidelines](CONTRIBUTING.md).\n\n\n## Notes\n\n* Requires at least Android 7.\n\n* [Since Android 10](https://developer.android.com/about/versions/10/privacy/changes#screen-contents),\nthe permission to access the screen contents has to be given on each start and is not saved. You can,\nhowever, work around this by installing [adb](https://developer.android.com/studio/command-line/adb)\n(or simply Android Studio) on a PC, connecting the device running droidVNC-NG to that PC and running\n`adb shell cmd appops set net.christianbeier.droidvnc_ng PROJECT_MEDIA allow` once. Alternatively, if\nusing the intent interface, you can also start with `net.christianbeier.droidvnc_ng.EXTRA_FALLBACK_SCREEN_CAPTURE`\nset to true.\n\n* You can also use adb to manually give input permission prior to app start via `adb shell settings put secure enabled_accessibility_services net.christianbeier.droidvnc_ng/.InputService:$(adb shell settings get secure enabled_accessibility_services)`.\n\n* If you are getting a black screen in a connected VNC viewer despite having given all permissions, it\nmight be that your device does not support Android's MediaProjection API correctly. To find out, you can\ntry screen recording with another app, [ScreenRecorder](https://gitlab.com/vijai/screenrecorder). If it\nfails as well, your device most likely does not support screen recording via MediaProjection. This is\nknown to be the case for [Android-x86](https://www.android-x86.org).\n\n* In case you happen to have a board with an Ethernet interface and experience strange hangs during a\nVNC session, setting the interface to a slower speed might help. This workaround can be applied with\n[mii-tool](https://github.com/bk138/droidVNC-NG/issues/121#issuecomment-2150790814), for instance.\n\n* If you see a a floating button similar to [this](https://user-images.githubusercontent.com/6049993/194750108-a808b9c3-2bc6-4cdd-ba40-b9c59476a456.jpg)\non your screen after enabling accessibility, make sure you have the \"shortcut\" option in accessibility settings\nturned to off.\n\n* Due to [limitations in Android API](https://android.googlesource.com/platform/frameworks/base/+/refs/heads/android15-release/media/java/android/media/projection/MediaProjectionConfig.java#72), secondary displays are not supported.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbk138%2FdroidVNC-NG","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbk138%2FdroidVNC-NG","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbk138%2FdroidVNC-NG/lists"}