Files
echolot/echolot-app/adb-beacon/build.gradle.kts
T
mrambossekandClaude Opus 5 38d4440412 tools: beacon fixes — cleartext, multi-device, validated-net POST, status URL
Debugging against a real restricted LAN surfaced three fixes:
- Android blocks app cleartext HTTP by default (targetSdk 36) — the port
  discovery + reachability were fine (phone curl reached fmr), only the
  app POST was denied. Added usesCleartextTraffic for this dev tool.
- Multi-device: report + receiver are keyed by device (Build.MODEL) so a
  phone and tablet don't clobber each other; connector connects each.
- POST over a VALIDATED internet network (prefer cellular) since the
  wireless-debug wifi is often a restricted LAN.
- Status/notification now show the target beacon URL + which network, per
  the request to surface what it's connecting to.
Verified live: beacon tracks the (frequently rotating) port via mDNS and
self-reports the current endpoint within seconds.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 22:07:35 +02:00

40 lines
1.4 KiB
Kotlin

// SPDX-FileCopyrightText: 2026 Echolot contributors
// SPDX-License-Identifier: GPL-3.0-or-later
plugins {
// AGP 9 built-in Kotlin (no kotlin.android — see core-probe note).
alias(libs.plugins.android.application)
}
// Dev tool (NOT the product app): reports this phone's rotating wireless-debug
// endpoint to the fmr beacon so the PC can keep `adb connect` current. Reads
// the connect port from adbd's own mDNS advertisement (_adb-tls-connect._tcp)
// via NsdManager — no root, no Shizuku.
android {
namespace = "app.echo_lot.adbbeacon"
compileSdk = 36
defaultConfig {
applicationId = "app.echo_lot.adbbeacon"
minSdk = 26
targetSdk = 36
versionCode = 1
versionName = "0.1.0"
// Prefilled beacon config (dev tool — secret in the APK is fine).
buildConfigField("String", "BEACON_URL", "\"http://89.185.109.150:443/beacon\"")
buildConfigField("String", "BEACON_SECRET", "\"D4OmG5gGJsElqVVbtYIZbR\"")
}
buildTypes { release { isMinifyEnabled = false } }
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
buildFeatures { buildConfig = true }
}
dependencies {
implementation(libs.kotlinx.coroutines.android)
implementation(libs.androidx.core.ktx)
implementation("androidx.activity:activity:1.9.3")
}