Skip to content

Add minimal CoT interoperability with UDP beaconing#4

Merged
nbschultz97 merged 1 commit intomainfrom
codex/implement-cursor-on-target-wrapper-in-interop
Sep 12, 2025
Merged

Add minimal CoT interoperability with UDP beaconing#4
nbschultz97 merged 1 commit intomainfrom
codex/implement-cursor-on-target-wrapper-in-interop

Conversation

@nbschultz97
Copy link
Owner

Summary

  • Introduce core module with CoT event model, XML helpers, UDP sender and Interop API
  • Add settings screen to toggle CoT, configure host/port and start self-position beaconing
  • Expose broadcast receiver and buttons to send or receive markers as CoT packets

Testing

  • gradle test (fails: SDK location not found)

https://chatgpt.com/codex/tasks/task_e_68c4044aaa1c832881b32e5cab07178f

@nbschultz97 nbschultz97 merged commit 2394022 into main Sep 12, 2025
0 of 2 checks passed
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

fun startSelfBeacon(context: Context) {
val request = PeriodicWorkRequestBuilder<SelfBeaconWorker>(5, TimeUnit.SECONDS).build()
WorkManager.getInstance(context)

[P1] Schedule periodic work below WorkManager minimum interval

The self-beacon is created with PeriodicWorkRequestBuilder<SelfBeaconWorker>(5, TimeUnit.SECONDS), but WorkManager enforces a minimum repeat interval of 15 minutes. Calling this method will throw IllegalArgumentException: intervalMillis < MIN_PERIODIC_INTERVAL_MILLIS when the user enables CoT in the settings screen, so the beacon can never start. Use at least 15 minutes (or PeriodicWorkRequest.MIN_PERIODIC_INTERVAL_MILLIS) and consider constraints instead of short polling.


override suspend fun doWork(): Result {
if (!Interop.enabled) return Result.success()
val lm = applicationContext.getSystemService(Context.LOCATION_SERVICE) as LocationManager
val loc: Location? = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER)

[P1] Self beacon worker ignores runtime location permission

The worker fetches the last known GPS location without checking whether ACCESS_FINE_LOCATION has been granted at runtime. On devices where the user has not granted location, getLastKnownLocation will raise SecurityException, causing the periodic work to fail continuously and preventing any beacons from being transmitted. Request or verify the permission before scheduling the work and handle failures gracefully inside the worker.


override fun onReceive(context: Context, intent: Intent) {
val json = intent.getStringExtra("marker") ?: return
Interop.publishMarkerJson(json)

[P1] Exported CoT receiver crashes on malformed broadcasts

The exported CotMarkerReceiver blindly decodes the marker extra with Json.decodeFromString and lacks error handling. Any other app can send com.tacticalapp.SEND_MARKER with invalid JSON, causing a SerializationException that terminates the process while the receiver runs in the background. Validate or catch parsing errors and consider requiring a permission for the broadcast to avoid a trivial DoS.


Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant