{"id":28721764,"url":"https://github.com/ostrya/presencepublisher","last_synced_at":"2025-06-15T07:30:18.441Z","repository":{"id":36254731,"uuid":"164247362","full_name":"ostrya/PresencePublisher","owner":"ostrya","description":"An Android MQTT client that regularly publishes messages to notify about the device's presence","archived":false,"fork":false,"pushed_at":"2025-05-27T18:16:36.000Z","size":3128,"stargazers_count":94,"open_issues_count":9,"forks_count":14,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-27T19:19:27.582Z","etag":null,"topics":["android","mqtt-client","presence"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ostrya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null}},"created_at":"2019-01-05T20:07:28.000Z","updated_at":"2025-05-27T18:16:39.000Z","dependencies_parsed_at":"2024-09-07T22:26:40.710Z","dependency_job_id":"21727ad7-f0f9-4c08-b5fa-986180abdd0d","html_url":"https://github.com/ostrya/PresencePublisher","commit_stats":null,"previous_names":[],"tags_count":58,"template":false,"template_full_name":null,"purl":"pkg:github/ostrya/PresencePublisher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ostrya%2FPresencePublisher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ostrya%2FPresencePublisher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ostrya%2FPresencePublisher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ostrya%2FPresencePublisher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ostrya","download_url":"https://codeload.github.com/ostrya/PresencePublisher/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ostrya%2FPresencePublisher/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259940332,"owners_count":22935257,"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","mqtt-client","presence"],"created_at":"2025-06-15T07:30:17.863Z","updated_at":"2025-06-15T07:30:18.424Z","avatar_url":"https://github.com/ostrya.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Presence Publisher\n\n[![Android CI](https://github.com/ostrya/presencepublisher/actions/workflows/android.yml/badge.svg?branch=main)](https://github.com/ostrya/PresencePublisher/actions?query=branch%3Amain)\n[![Github release date](https://img.shields.io/github/release-date/ostrya/presencepublisher.svg?logo=github) ![Github release](https://img.shields.io/github/release/ostrya/presencepublisher.svg?logo=github)](https://github.com/ostrya/PresencePublisher/releases)\n[![F-Droid release](https://img.shields.io/f-droid/v/org.ostrya.presencepublisher.svg)](https://f-droid.org/packages/org.ostrya.presencepublisher)\n\n[\u003cimg src=\"https://f-droid.org/badge/get-it-on.png\" alt=\"Get it on F-Droid\" height=\"75\"\u003e](https://f-droid.org/packages/org.ostrya.presencepublisher)\n[\u003cimg src=\"https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png\" height=\"75\" alt=\"Get it on Google Play\"\u003e](https://play.google.com/store/apps/details?id=org.ostrya.presencepublisher\u0026pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1)\n\nPresence Publisher is a simple app that regularly publishes to a configurable MQTT topic whenever connected to a\ngiven Wi-Fi network or in proximity to a Bluetooth beacon. This can be used to integrate the presence of your phone\nin home automation.\n\nSeveral networks and beacons can be configured at once, and the message to be sent can be configured\nfor each of them.\n\nIf your MQTT server is available on the internet, you can also choose to send an 'offline' message\nwhenever you are not connected to any of the configured Wi-Fi networks and not in range of any\nconfigured beacon.\n\nAs an additional feature, you can send the battery level of your device whenever a condition is met,\nso that you can recharge it before it turns off.\n\nThe app uses Android's Work Manager library, so notifications are sent even if the phone is in\nstand-by.\n\nFor details on which data this app processes and how it does so, please have a look at the\n[privacy policy](https://ostrya.github.io/PresencePublisher/en/PRIVACY_POLICY.html).\n\n## TLS with self-signed certificates\n\nThe app uses the default Android CA trust store for checking the server certificate validity. You can simply add your\ncertificate via:\n\n* Android 5 - 7:\n  * `Security` → `Install from SD card`\n* Android 8 - 9:\n  * `Security \u0026 location` → `Encryption \u0026 credentials` → `Install from SD card`\n* Android 10:\n  * `Security` → `Encryption \u0026 credentials` → `Install from SD card`\n* Android 11 - 12:\n  * `Security` → `Encryption \u0026 credentials` → `Install a certificate` → `CA Certificate`\n* Android 13+:\n  * `Security \u0026 privacy` → `More security settings` → `Encryption and credentials` → `Install a certificate` → `CA certificate`\n\nPlease note you need to have your certificate in DER format to be able to import it correctly. You can\ncheck this using:\n\n```bash\nopenssl x509 -inform der -in server.crt -text\n```\n\nThis should show you the correct certificate information. If you instead see something like `unable to load certificate`,\nthe certificate is most likely formatted in PEM format and needs to be converted, e.g like this:\n\n```bash\nopenssl x509 -inform pem -outform der -in server.crt -out server_der.crt\n```\n\nAlternatively, you can use the [KeyStore Explorer](https://keystore-explorer.org) to do the conversion:\n\n* `Create a new KeyStore` → choose `PKCS #12`\n* `Tools` → `Import Trusted Certificates` → open your certificate file and give it some alias\n* Right-click the entry → `Export` → `Export Certificate` → select export format `X.509` and uncheck `PEM`\n* afterwards, you can close the keystore without saving it\n\n### Client certificates\n\nThe Android keychain will only allow you to import a PKCS#12 keystore. If you have created a client certificate along\nthe lines of [https://mosquitto.org/man/mosquitto-tls-7.html](https://mosquitto.org/man/mosquitto-tls-7.html),\nyou will need to combine the certificate and key file together like this:\n\n```bash\nopenssl pkcs12 -inkey client.key -in client.crt -export -out client.pfx\n```\n\nIf you do not need your client certificate to be signed by a root certificate, because you plan to add it directly to\nthe trusted certificates of your MQTT broker, you can also use the [KeyStore Explorer](https://keystore-explorer.org)\nto generate your client certificate:\n\n* `Create a new KeyStore` → choose `PKCS #12`\n* `Tools` → `Generate Key Pair` → choose one of Android's\n  [supported algorithms](https://developer.android.com/training/articles/keystore#SupportedKeyPairGenerators)\n  → configure properties of the public certificate → set a password for the private key\n* `File` → `Save` → use the same password as above for the keystore\n\nMake sure your PKCS#12 keystore file has the `.pfx` extension, otherwise Android will not recognize it.\n\nTo be able to select this client certificate in Presence Publisher, you first need to add it to\nthe Android Keystore. This works similar to the process for the server certificate:\n\n* Android 5 - 7:\n  * `Security` → `Install from SD card`\n* Android 8 - 9:\n  * `Security \u0026 location` → `Encryption \u0026 credentials` → `Install from SD card`\n* Android 10:\n  * `Security` → `Encryption \u0026 credentials` → `Install from SD card`\n* Android 11 - 12:\n  * `Security` → `Encryption \u0026 credentials` → `Install a certificate` → `VPN \u0026 app user certificate`\n* Android 13+:\n  * `Security \u0026 privacy` → `More security settings` → `Encryption and credentials` → `Install a certificate` → `VPN and app user certificate`\n\nAfter you have imported your client certificate, you will be able to choose it from the app.\n\n## Permissions\n\n* ACCESS_BACKGROUND_LOCATION: on Android 10+, necessary to retrieve name of connected Wi-Fi while running in background\n* ACCESS_FINE_LOCATION: necessary to discover beacons; on Android 9+, necessary to retrieve name of connected Wi-Fi\n* ACCESS_NETWORK_STATE: necessary to register network change listener\n* ACCESS_WIFI_STATE: necessary to retrieve SSID of connected Wi-Fi\n* BLUETOOTH: necessary up to Android 11 to communicate with beacons\n* BLUETOOTH_ADMIN: necessary up to Android 11 to discover beacons\n* BLUETOOTH_CONNECT: on Android 12+, necessary to read beacon names\n* BLUETOOTH_SCAN: on Android 12+, necessary to discover beacons\n* FOREGROUND_SERVICE: on Android 9+, necessary to run the app reliably\n* FOREGROUND_SERVICE_DATA_SYNC: on Android 14+, necessary to send MQTT messages\n* INTERNET: only necessary if your MQTT server is not running locally\n* POST_NOTIFICATIONS: on Android 13+, necessary to create notifications\n* RECEIVE_BOOT_COMPLETED: necessary to start service on start-up\n* REQUEST_IGNORE_BATTERY_OPTIMIZATIONS: on Android 6+, necessary to request disabling battery optimization\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fostrya%2Fpresencepublisher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fostrya%2Fpresencepublisher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fostrya%2Fpresencepublisher/lists"}