Skip to content

Your phone, on your command. Gotcha is world's first fully on-device AI copilot for Android that turns natural language into real device actions — safely.

ci: add CI pipeline with detekt, Android Lint, and expanded unit tests

Durganshu Mishra004a09952f0e
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..4d094f4
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,51 @@
+name: CI
+
+on:
+ push:
+ branches: [master, development]
+ pull_request:
+ workflow_dispatch:
+
+concurrency:
+ group: ci-${{ github.ref }}
+ cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
+
+jobs:
+ build:
+ runs-on: ubuntu-latest # TerminalToolTest shells out to POSIX `sh` — do not move to windows/macos
+ timeout-minutes: 30
+ steps:
+ - uses: actions/checkout@v4
+
+ - uses: actions/setup-java@v4
+ with:
+ distribution: temurin
+ java-version: "17"
+
+ - uses: gradle/actions/setup-gradle@v4
+
+ # Baselined against existing findings (app/detekt-baseline.xml); regenerate
+ # locally with: ./gradlew :app:detektBaseline
+ - name: Detekt
+ run: ./gradlew :app:detekt --stacktrace
+
+ - name: Unit tests
+ run: ./gradlew :app:testDebugUnitTest --stacktrace
+
+ # Baselined against existing findings (app/lint-baseline.xml); regenerate
+ # locally with: ./gradlew :app:updateLintBaseline
+ - name: Android Lint
+ run: ./gradlew :app:lintDebug --stacktrace
+
+ - name: Assemble debug APK
+ run: ./gradlew :app:assembleDebug --stacktrace
+
+ - name: Upload reports
+ if: always()
+ uses: actions/upload-artifact@v4
+ with:
+ name: reports
+ path: |
+ app/build/reports/
+ app/build/test-results/testDebugUnitTest/
+ retention-days: 14
diff --git a/RUNNING.md b/RUNNING.md
index 80c6f57..9b9db07 100644
--- a/RUNNING.md
+++ b/RUNNING.md
@@ -1,5 +1,7 @@
# Running Gotcha
+![CI](https://github.com/<org>/Gotcha/actions/workflows/ci.yml/badge.svg?branch=master)
+
A step-by-step guide to build, run, and configure the Gotcha Android app.
## 1. Prerequisites
@@ -54,8 +56,22 @@ From the project root:
./gradlew assembleDebug # builds app/build/outputs/apk/debug/app-debug.apk
./gradlew installDebug # builds + installs onto the connected device
./gradlew testDebugUnitTest # runs the JVM unit tests
+./gradlew detekt lintDebug # static analysis (detekt + Android Lint)
```
+### Continuous integration
+
+Every pull request and push to `master` or `development` runs the
+GitHub Actions workflow (`.github/workflows/ci.yml`): detekt → JVM unit tests →
+Android Lint → `assembleDebug`. Test and analysis reports are attached to each
+run as artifacts. The workflow can also be triggered manually from the Actions
+tab (**workflow_dispatch**) on any branch.
+Detekt and lint check only *new* findings — existing ones are grandfathered in
+committed baselines (`app/detekt-baseline.xml`, `app/lint-baseline.xml`);
+regenerate them with `./gradlew :app:detektBaseline :app:updateLintBaseline`.
+The unit tests shell out to a POSIX `sh` (TerminalTool), so they need Linux,
+macOS, or Git Bash — on plain Windows they fail; use CI instead.
+
## 5. Configure the LLM (required before chatting)
The app talks to **any OpenAI-compatible `/chat/completions` endpoint**. On the
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 886f786..dc1ed96 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -4,6 +4,7 @@ plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("org.jetbrains.kotlin.plugin.serialization")
+ id("io.gitlab.arturbosch.detekt")
}
// Load signing credentials from local.properties (gitignored), if present.
@@ -75,6 +76,20 @@ android {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
+
+ lint {
+ abortOnError = true
+ warningsAsErrors = false
+ htmlReport = true
+ sarifReport = true
+ baseline = file("lint-baseline.xml")
+ }
+}
+
+detekt {
+ buildUponDefaultConfig = true
+ config.setFrom(rootProject.files("config/detekt/detekt.yml"))
+ baseline = file("detekt-baseline.xml")
}
dependencies {
@@ -122,6 +137,9 @@ dependencies {
implementation("androidx.camera:camera-lifecycle:$cameraxVersion")
implementation("androidx.camera:camera-view:$cameraxVersion")
+ // Static analysis
+ detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.6")
+
// Debug
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")
diff --git a/app/detekt-baseline.xml b/app/detekt-baseline.xml
new file mode 100644
index 0000000..f167fda
--- /dev/null
+++ b/app/detekt-baseline.xml
@@ -0,0 +1,780 @@
+<?xml version="1.0" ?>
+<SmellBaseline>
+ <ManuallySuppressedIssues></ManuallySuppressedIssues>
+ <CurrentIssues>
+ <ID>AnnotationOnSeparateLine:AssistiveBallOverlay.kt$AssistiveBallOverlay$@Suppress("DEPRECATION") WindowManager.LayoutParams.TYPE_PHONE</ID>
+ <ID>ArgumentListWrapping:ActionLog.kt$ActionLog$('\n', ' ')</ID>
+ <ID>ArgumentListWrapping:ActionLog.kt$ActionLog$(500)</ID>
+ <ID>ArgumentListWrapping:ActionLog.kt$ActionLog$(Date())</ID>
+ <ID>ArgumentListWrapping:AlarmReceiver.kt$AlarmReceiver$(CHANNEL_ID_SILENT, "Alarms &amp; Timers (no vibration)", NotificationManager.IMPORTANCE_HIGH)</ID>
+ <ID>ArgumentListWrapping:AlarmTool.kt$AlarmTool$(",")</ID>
+ <ID>ArgumentListWrapping:AlarmTool.kt$AlarmTool$("Alarm $id lives in the system clock app but no clock app handled the update intent. Edit it in the clock app directly.")</ID>
+ <ID>ArgumentListWrapping:AlarmTool.kt$AlarmTool$("Removed alarm $id from this assistant's list, but no clock app handled the dismiss intent — ask the user to delete it in the clock app.")</ID>
+ <ID>ArgumentListWrapping:AlarmTool.kt$AlarmTool$("Set alarm '$label' for %02d:%02d$extra (id=$id). No clock app handled it, so it was scheduled in-app and rings as a notification.".format(hour, minute))</ID>
+ <ID>ArgumentListWrapping:AlarmTool.kt$AlarmTool$("Set alarm '$label' for %02d:%02d$extra in the system clock app (id=$id).".format(hour, minute))</ID>
+ <ID>ArgumentListWrapping:AlarmTool.kt$AlarmTool$(3)</ID>
+ <ID>ArgumentListWrapping:AlarmTool.kt$AlarmTool$(AlarmRecord(id, hour, minute, dayInts, label, vibrate ?: true, system = true, triggerAt = triggerAt))</ID>
+ <ID>ArgumentListWrapping:AlarmTool.kt$AlarmTool$(Calendar.MONDAY, Calendar.TUESDAY, Calendar.WEDNESDAY, Calendar.THURSDAY, Calendar.FRIDAY)</ID>
+ <ID>ArgumentListWrapping:AlarmTool.kt$AlarmTool$(a.id)</ID>
+ <ID>ArgumentListWrapping:AlarmTool.kt$AlarmTool$(buildSetAlarmIntent(record.hour, record.minute, record.label, record.days, record.vibrate))</ID>
+ <ID>ArgumentListWrapping:AlarmTool.kt$AlarmTool$(context, alarmRequestCode(a.id), intent, PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT)</ID>
+ <ID>ArgumentListWrapping:AlarmTool.kt$AlarmTool$(context, requestCode, intent, PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_NO_CREATE)</ID>
+ <ID>ArgumentListWrapping:AlarmTool.kt$AlarmTool$(context, timerRequestCode(t.id), intent, PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT)</ID>
+ <ID>ArgumentListWrapping:AlarmTool.kt$AlarmTool$(d)</ID>
+ <ID>ArgumentListWrapping:AlarmTool.kt$AlarmTool$(hour, minute)</ID>
+ <ID>ArgumentListWrapping:AlarmTool.kt$AlarmTool$(id, hour, minute, dayInts, label, vibrate ?: true, system = true, triggerAt = triggerAt)</ID>
+ <ID>ArgumentListWrapping:AlarmTool.kt$AlarmTool$(kotlinx.serialization.json.JsonPrimitive(d))</ID>
+ <ID>ArgumentListWrapping:AlarmTool.kt$AlarmTool$(record.hour, record.minute, record.label, record.days, record.vibrate)</ID>
+ <ID>ArgumentListWrapping:AlarmTool.kt$AlarmTool$(t.id)</ID>
+ <ID>ArgumentListWrapping:AppsTool.kt$AppsTool$( AppOpsManager.OPSTR_GET_USAGE_STATS, Process.myUid(), context.packageName )</ID>
+ <ID>ArgumentListWrapping:AppsTool.kt$AppsTool$("Found $matchCount app(s) matching '$search'$truncated ($total total, $userApps user, $systemApps system).\n$listing")</ID>
+ <ID>ArgumentListWrapping:AppsTool.kt$AppsTool$("System dialog opened to uninstall $label. After you tap OK in the dialog, ask the assistant to verify the app is gone.")</ID>
+ <ID>ArgumentListWrapping:AssistiveBallService.kt$AssistiveBallService$( this, 0, Intent(this, MainActivity::class.java).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK), PendingIntent.FLAG_IMMUTABLE )</ID>
+ <ID>ArgumentListWrapping:AudioApi.kt$AudioApi$( "application/json".toMediaType(), json.toString() )</ID>
+ <ID>ArgumentListWrapping:AudioApi.kt$AudioApi$(boundary, audioFile, "file", "audio/m4a", mapOf("model" to model) )</ID>
+ <ID>ArgumentListWrapping:CalendarTool.kt$CalendarTool$( "yyyy-MM-dd HH:mm", "yyyy-MM-dd'T'HH:mm", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd'T'HH:mm:ss" )</ID>
+ <ID>ArgumentListWrapping:CalendarTool.kt$CalendarTool$( CalendarContract.Calendars.CONTENT_URI, projection, null, null, null )</ID>
+ <ID>ArgumentListWrapping:CalendarTool.kt$CalendarTool$( CalendarContract.Calendars.CONTENT_URI, projection, selection, args, "${CalendarContract.Calendars.IS_PRIMARY} DESC" )</ID>
+ <ID>ArgumentListWrapping:CalendarTool.kt$CalendarTool$( builder.build(), projection, selection, selectionArgs, "${CalendarContract.Instances.BEGIN} ASC" )</ID>
+ <ID>ArgumentListWrapping:ChatScreen.kt$(Icons.Default.Stop, contentDescription = "Stop recording", modifier = Modifier.size(20.dp), tint = Color.White)</ID>
+ <ID>ArgumentListWrapping:ChatScreen.kt$(Icons.Default.Stop, contentDescription = "Stop", modifier = Modifier.size(20.dp))</ID>
+ <ID>ArgumentListWrapping:ChatViewModel.kt$ChatViewModel$( "Screen text:\n$screenText\n\nThe assistant also captured a screenshot. " + "Use it together with the screen text to understand the current screen.", screenshotBase64, "png" )</ID>
+ <ID>ArgumentListWrapping:ChatViewModel.kt$ChatViewModel$( "The assistant read an image file: $filename ($dimensions, $sizeDisplay).", base64, format )</ID>
+ <ID>ArgumentListWrapping:ChatViewModel.kt$ChatViewModel$( getApplication(), settings.sttApiBaseUrl, settings.apiKey )</ID>
+ <ID>ArgumentListWrapping:ChatViewModel.kt$ChatViewModel$( getApplication(), settings.ttsApiBaseUrl, settings.apiKey )</ID>
+ <ID>ArgumentListWrapping:ChatViewModel.kt$ChatViewModel$(" Android version: ${android.os.Build.VERSION.RELEASE} (API ${android.os.Build.VERSION.SDK_INT})")</ID>
+ <ID>ArgumentListWrapping:ChatViewModel.kt$ChatViewModel$("Please summarize the following conversation history according to the system prompt instructions:\n\n$historyText")</ID>
+ <ID>ArgumentListWrapping:ChatViewModel.kt$ChatViewModel$("You are an advanced context compaction agent. Your task is to compress the preceding conversation history into a highly dense, structured continuation summary. You must preserve critical context, decisions, and codebase states while eliminating conversational filler and repetitive tool logs.\n\nGenerate a structured summary containing exactly the following sections:\n1. **Goal**: What is the ultimate objective of this engineering session?\n2. **Instructions &amp; Constraints**: What specific guidelines, patterns, user preferences, or technical limitations have been established?\n3. **Discoveries &amp; Architecture**: What have we learned about the codebase? Detail any symbol mappings, logic structures, or debugging conclusions.\n4. **Accomplished**: What changes have already been completely implemented, verified, or fixed?\n5. **Relevant Files**: Which files are currently being modified or are active in the workspace?\n\nCRITICAL: Do not lose technical specifics, user-stated constraints, or deep investigation states.\n\nContinue if you have next steps, or stop and ask for clarification if you are unsure how to proceed.")</ID>
+ <ID>ArgumentListWrapping:ChatViewModel.kt$ChatViewModel$("delete_$kind")</ID>
+ <ID>ArgumentListWrapping:ChatViewModel.kt$ChatViewModel$("uninstall_app")</ID>
+ <ID>ArgumentListWrapping:ChatViewModel.kt$ChatViewModel$(ChatSession(id, title, System.currentTimeMillis(), llmHistory.toList(), activeSessionTokenCount))</ID>
+ <ID>ArgumentListWrapping:ChatViewModel.kt$ChatViewModel$(MessageKind.ERROR, "Microphone permission not granted. Enable it in Settings → Permissions.")</ID>
+ <ID>ArgumentListWrapping:ChatViewModel.kt$ChatViewModel$(activity = null, pendingConfirmation = PendingConfirmation(listOf("delete_$kind"), description))</ID>
+ <ID>ArgumentListWrapping:ChatViewModel.kt$ChatViewModel$(activity = null, pendingConfirmation = PendingConfirmation(listOf("uninstall_app"), description))</ID>
+ <ID>ArgumentListWrapping:ChatViewModel.kt$ChatViewModel$(android.content.Context.CONNECTIVITY_SERVICE)</ID>
+ <ID>ArgumentListWrapping:ChatViewModel.kt$ChatViewModel$(id, title, System.currentTimeMillis(), llmHistory.toList(), activeSessionTokenCount)</ID>
+ <ID>ArgumentListWrapping:ChatViewModel.kt$ChatViewModel$(listOf("delete_$kind"), description)</ID>
+ <ID>ArgumentListWrapping:ChatViewModel.kt$ChatViewModel$(listOf("uninstall_app"), description)</ID>
+ <ID>ArgumentListWrapping:ChatViewModel.kt$ChatViewModel$(nextId++, MessageKind.USER, msg.textContent.ifEmpty { "(image attached)" })</ID>
+ <ID>ArgumentListWrapping:ClipboardTool.kt$ClipboardTool$("Clipboard (from accessibility service): ${text.take(2000)}")</ID>
+ <ID>ArgumentListWrapping:ClipboardTool.kt$ClipboardTool$(2000)</ID>
+ <ID>ArgumentListWrapping:ContactsTool.kt$ContactsTool$( ContactsContract.CommonDataKinds.Email.CONTENT_URI, arrayOf(ContactsContract.CommonDataKinds.Email.ADDRESS), "${ContactsContract.CommonDataKinds.Email.CONTACT_ID} = ?", arrayOf(contactId), null )</ID>
+ <ID>ArgumentListWrapping:ContactsTool.kt$ContactsTool$( uri, arrayOf(ContactsContract.PhoneLookup._ID), null, null, null )</ID>
+ <ID>ArgumentListWrapping:ContactsTool.kt$ContactsTool$(ContactsContract.CommonDataKinds.Email.TYPE, ContactsContract.CommonDataKinds.Email.TYPE_WORK)</ID>
+ <ID>ArgumentListWrapping:ContactsTool.kt$ContactsTool$(ContactsContract.CommonDataKinds.Organization.TYPE, ContactsContract.CommonDataKinds.Organization.TYPE_WORK)</ID>
+ <ID>ArgumentListWrapping:ContactsTool.kt$ContactsTool$(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE)</ID>
+ <ID>ArgumentListWrapping:ContactsTool.kt$ContactsTool$(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.Organization.CONTENT_ITEM_TYPE)</ID>
+ <ID>ArgumentListWrapping:ContactsTool.kt$ContactsTool$(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)</ID>
+ <ID>ArgumentListWrapping:DeviceTool.kt$DeviceTool$("Unknown stream '$name'. Use media, ring, alarm, notification, or call.")</ID>
+ <ID>ArgumentListWrapping:EditTool.kt$EditTool$("File '$path' does not exist (resolved: ${file.canonicalPath}).")</ID>
+ <ID>ArgumentListWrapping:EditTool.kt$EditTool$("Found $count matches in '$path'. " + "Provide more surrounding context or use replaceAll=true.")</ID>
+ <ID>ArgumentListWrapping:EditTool.kt$EditTool$("No match found for the specified text in '$path'. " + "The text must match exactly, including whitespace and indentation.")</ID>
+ <ID>ArgumentListWrapping:FileResolver.kt$FileResolver$( android.Manifest.permission.READ_EXTERNAL_STORAGE, READ_STORAGE_GUIDE )</ID>
+ <ID>ArgumentListWrapping:FileResolver.kt$FileResolver$( android.Manifest.permission.WRITE_EXTERNAL_STORAGE, WRITE_STORAGE_GUIDE )</ID>
+ <ID>ArgumentListWrapping:FileTool.kt$FileTool$( resolved.file, path, sortBy, include, exclude, recursive, maxDepth )</ID>
+ <ID>ArgumentListWrapping:FileTool.kt$FileTool$("${file.name} (${resolver.formatSize(file.length())})\nResolved: ${file.canonicalPath}")</ID>
+ <ID>ArgumentListWrapping:FileTool.kt$FileTool$("${if (append) "Appended" else "Wrote"} ${resolver.formatSize(bytes.size.toLong())} to '$originalPath' (resolved: ${file.canonicalPath}).")</ID>
+ <ID>ArgumentListWrapping:FileTool.kt$FileTool$("(Showing lines $startLine-$endLine of ${lines.size}. Use offset=${endLine + 1} to continue.)")</ID>
+ <ID>ArgumentListWrapping:FileTool.kt$FileTool$("Archive: ${file.name} (${resolver.formatSize(file.length())}, ${entries.size} entries, ${resolver.formatSize(totalSize)} uncompressed)")</ID>
+ <ID>ArgumentListWrapping:FileTool.kt$FileTool$("File too large (${resolver.formatSize(file.length())}). Max: ${MAX_BINARY_BYTES / 1024 / 1024} MB.")</ID>
+ <ID>ArgumentListWrapping:FileTool.kt$FileTool$("Image too large (${resolver.formatSize(file.length())}). Max: ${MAX_IMAGE_BYTES / 1024 / 1024} MB.")</ID>
+ <ID>ArgumentListWrapping:FileTool.kt$FileTool$("Path '$originalPath' does not exist (resolved: ${file.canonicalPath}).")</ID>
+ <ID>ArgumentListWrapping:FileTool.kt$FileTool$("Wrote ${resolver.formatSize(bytes.size.toLong())} binary data to '$originalPath' (resolved: ${file.canonicalPath}).")</ID>
+ <ID>ArgumentListWrapping:FileTool.kt$FileTool$(bytes.size.toLong())</ID>
+ <ID>ArgumentListWrapping:FileTool.kt$FileTool$(file.length())</ID>
+ <ID>ArgumentListWrapping:FileTool.kt$FileTool$(totalSize)</ID>
+ <ID>ArgumentListWrapping:FileTool.kt$FileTool.Companion$( ".zip/", ".apk/", ".aar/", ".jar/", ".war/", ".docx/", ".xlsx/", ".pptx/" )</ID>
+ <ID>ArgumentListWrapping:LocationTool.kt$LocationTool$( lat, lng, accuracy, altitude, bearing, speed, where, source )</ID>
+ <ID>ArgumentListWrapping:MainActivity.kt$MainActivity$( apiKey = "unused", baseUrl = "http://localhost/", context = this@MainActivity )</ID>
+ <ID>ArgumentListWrapping:MainActivity.kt$MainActivity$(AndroidSettings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:$packageName"))</ID>
+ <ID>ArgumentListWrapping:PermissionItems.kt$( "Accessibility", "Read screen, tap, swipe, type", null, "special:accessibility_access", { c -&gt; val expected = "${c.packageName}/com.gotcha.service.GotchaAccessibilityService" val enabled = Settings.Secure.getString( c.contentResolver, Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES ) ?: "" enabled.contains(expected, ignoreCase = true) } )</ID>
+ <ID>ArgumentListWrapping:PermissionItems.kt$( "All Files Access", "Full access to all files on device", null, "special:all_files_access", { c -&gt; if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.R) Environment.isExternalStorageManager() else checkPerm(c, android.Manifest.permission.READ_EXTERNAL_STORAGE) } )</ID>
+ <ID>ArgumentListWrapping:PermissionItems.kt$( "Calendar", "Read and create calendar events", android.Manifest.permission.READ_CALENDAR, null, { c -&gt; checkPerm(c, android.Manifest.permission.READ_CALENDAR) &amp;&amp; checkPerm(c, android.Manifest.permission.WRITE_CALENDAR) }, extraPermissions = listOf(android.Manifest.permission.WRITE_CALENDAR) )</ID>
+ <ID>ArgumentListWrapping:PermissionItems.kt$( "Call Log", "Read recent call history", android.Manifest.permission.READ_CALL_LOG, null, { c -&gt; checkPerm(c, android.Manifest.permission.READ_CALL_LOG) } )</ID>
+ <ID>ArgumentListWrapping:PermissionItems.kt$( "Camera", "Take photos", android.Manifest.permission.CAMERA, null, { c -&gt; checkPerm(c, android.Manifest.permission.CAMERA) } )</ID>
+ <ID>ArgumentListWrapping:PermissionItems.kt$( "Contacts", "Read and create contacts", android.Manifest.permission.READ_CONTACTS, null, { c -&gt; checkPerm(c, android.Manifest.permission.READ_CONTACTS) &amp;&amp; checkPerm(c, android.Manifest.permission.WRITE_CONTACTS) }, extraPermissions = listOf(android.Manifest.permission.WRITE_CONTACTS) )</ID>
+ <ID>ArgumentListWrapping:PermissionItems.kt$( "Device Admin", "Lock screen, enforce password policy", null, "special:device_admin", { c -&gt; val dpm = c.getSystemService(Context.DEVICE_POLICY_SERVICE) as? DevicePolicyManager dpm?.isAdminActive(ComponentName(c, GotchaDeviceAdminReceiver::class.java)) ?: false } )</ID>
+ <ID>ArgumentListWrapping:PermissionItems.kt$( "Display Over Apps", "Show floating overlays", null, "special:overlay_access", { c -&gt; Settings.canDrawOverlays(c) } )</ID>
+ <ID>ArgumentListWrapping:PermissionItems.kt$( "Do Not Disturb", "Silence/vibrate mode and DND", null, "special:dnd_access", { c -&gt; val nm = c.getSystemService(Context.NOTIFICATION_SERVICE) as? android.app.NotificationManager nm?.isNotificationPolicyAccessGranted ?: false } )</ID>
+ <ID>ArgumentListWrapping:PermissionItems.kt$( "Location", "Get device location", android.Manifest.permission.ACCESS_FINE_LOCATION, null, { c -&gt; checkPerm(c, android.Manifest.permission.ACCESS_FINE_LOCATION) } )</ID>
+ <ID>ArgumentListWrapping:PermissionItems.kt$( "Microphone", "Record audio", android.Manifest.permission.RECORD_AUDIO, null, { c -&gt; checkPerm(c, android.Manifest.permission.RECORD_AUDIO) } )</ID>
+ <ID>ArgumentListWrapping:PermissionItems.kt$( "Notification Listener", "Read and dismiss notifications, media control", null, "special:notification_listener_access", { c -&gt; val expected = c.packageName val enabled = Settings.Secure.getString( c.contentResolver, "enabled_notification_listeners" ) ?: "" enabled.contains(expected, ignoreCase = true) } )</ID>
+ <ID>ArgumentListWrapping:PermissionItems.kt$( "Phone", "Place calls directly", android.Manifest.permission.CALL_PHONE, null, { c -&gt; checkPerm(c, android.Manifest.permission.CALL_PHONE) } )</ID>
+ <ID>ArgumentListWrapping:PermissionItems.kt$( "Read SMS", "Read inbox messages", android.Manifest.permission.READ_SMS, null, { c -&gt; checkPerm(c, android.Manifest.permission.READ_SMS) } )</ID>
+ <ID>ArgumentListWrapping:PermissionItems.kt$( "SMS", "Send text messages", android.Manifest.permission.SEND_SMS, null, { c -&gt; checkPerm(c, android.Manifest.permission.SEND_SMS) } )</ID>
+ <ID>ArgumentListWrapping:PermissionItems.kt$( "Storage Read", "Read files from shared storage", if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.TIRAMISU) android.Manifest.permission.READ_MEDIA_IMAGES else android.Manifest.permission.READ_EXTERNAL_STORAGE, null, { c -&gt; val perm = if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.TIRAMISU) android.Manifest.permission.READ_MEDIA_IMAGES else android.Manifest.permission.READ_EXTERNAL_STORAGE checkPerm(c, perm) } )</ID>
+ <ID>ArgumentListWrapping:PermissionItems.kt$( "Storage Write", "Write files to shared storage", android.Manifest.permission.WRITE_EXTERNAL_STORAGE, null, { c -&gt; if (Build.VERSION.SDK_INT &lt;= 29) checkPerm(c, android.Manifest.permission.WRITE_EXTERNAL_STORAGE) else true // API 30+ uses MANAGE_EXTERNAL_STORAGE } )</ID>
+ <ID>ArgumentListWrapping:PermissionItems.kt$( "Usage Access", "Read app usage and data stats", null, "special:usage_access", { c -&gt; if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.KITKAT) { val appOps = c.getSystemService(Context.APP_OPS_SERVICE) as? AppOpsManager appOps?.checkOpNoThrow( AppOpsManager.OPSTR_GET_USAGE_STATS, android.os.Process.myUid(), c.packageName ) == AppOpsManager.MODE_ALLOWED } else true } )</ID>
+ <ID>ArgumentListWrapping:PermissionItems.kt$( "VPN", "Block all network traffic (firewall kill-switch)", null, "special:vpn_consent", { c -&gt; try { val cm = c.getSystemService(Context.CONNECTIVITY_SERVICE) as? android.net.ConnectivityManager cm?.let { mgr -&gt; val network = mgr.activeNetwork if (network != null) { mgr.getNetworkCapabilities(network) ?.hasTransport(android.net.NetworkCapabilities.TRANSPORT_VPN) ?: false } else false } ?: false } catch (_: SecurityException) { false } } )</ID>
+ <ID>ArgumentListWrapping:PermissionItems.kt$( "Write Settings", "Modify system settings (brightness)", null, "special:write_settings", { c -&gt; Settings.System.canWrite(c) } )</ID>
+ <ID>ArgumentListWrapping:PermissionsSection.kt$("package:$packageName")</ID>
+ <ID>ArgumentListWrapping:PermissionsSection.kt$(AndroidSettings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:$packageName"))</ID>
+ <ID>ArgumentListWrapping:PhoneTool.kt$PhoneTool$( uri, arrayOf(ContactsContract.PhoneLookup.DISPLAY_NAME), null, null, null )</ID>
+ <ID>ArgumentListWrapping:PhoneTool.kt$PhoneTool$(86_400_000L - 1)</ID>
+ <ID>ArgumentListWrapping:PhoneTool.kt$PhoneTool$(toDate)</ID>
+ <ID>ArgumentListWrapping:SettingsScreen.kt$(emptyList(), emptyList())</ID>
+ <ID>ArgumentListWrapping:SettingsScreen.kt$(expanded = sttModelExpanded)</ID>
+ <ID>ArgumentListWrapping:SettingsScreen.kt$(expanded = ttsModelExpanded)</ID>
+ <ID>ArgumentListWrapping:SmsTool.kt$SmsTool$( context, System.currentTimeMillis().toInt() and 0x7FFFFFFF, intent, PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT )</ID>
+ <ID>ArgumentListWrapping:SmsTool.kt$SmsTool$( context, number.hashCode() and 0x7FFFFFFF, intent, PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT )</ID>
+ <ID>ArgumentListWrapping:SmsTool.kt$SmsTool$( context, receiver, IntentFilter("com.gotcha.SMS_SENT"), ContextCompat.RECEIVER_NOT_EXPORTED )</ID>
+ <ID>ArgumentListWrapping:SmsTool.kt$SmsTool$( uri, arrayOf(Telephony.Sms.ADDRESS, Telephony.Sms.BODY, Telephony.Sms.DATE, Telephony.Sms._ID), selection, selectionArgs, "${Telephony.Sms.DATE} DESC" )</ID>
+ <ID>ArgumentListWrapping:SmsTool.kt$SmsTool$( uri, arrayOf(android.provider.ContactsContract.PhoneLookup.DISPLAY_NAME), null, null, null )</ID>
+ <ID>ArgumentListWrapping:SmsTool.kt$SmsTool$(86_400_000L - 1)</ID>
+ <ID>ArgumentListWrapping:SmsTool.kt$SmsTool$(toDate)</ID>
+ <ID>ArgumentListWrapping:StorageTool.kt$StorageTool$("Internal storage: ${format(internal.used)} used of ${format(internal.total)} total, ${format(internal.free)} free")</ID>
+ <ID>ArgumentListWrapping:StorageTool.kt$StorageTool$("\nExternal / SD card: ${format(external.used)} used of ${format(external.total)} total, ${format(external.free)} free")</ID>
+ <ID>ArgumentListWrapping:StorageTool.kt$StorageTool$(external.free)</ID>
+ <ID>ArgumentListWrapping:StorageTool.kt$StorageTool$(external.total)</ID>
+ <ID>ArgumentListWrapping:StorageTool.kt$StorageTool$(external.used)</ID>
+ <ID>ArgumentListWrapping:StorageTool.kt$StorageTool$(internal.free)</ID>
+ <ID>ArgumentListWrapping:StorageTool.kt$StorageTool$(internal.total)</ID>
+ <ID>ArgumentListWrapping:StorageTool.kt$StorageTool$(internal.used)</ID>
+ <ID>ArgumentListWrapping:SystemTool.kt$SystemTool$(null, android.content.IntentFilter(android.content.Intent.ACTION_BATTERY_CHANGED))</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("description", "Audio source: 'mic' (default), 'voice' (optimized for speech), or 'camcorder' (wider range).")</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("description", "Calendar account name to add the event to (e.g. 'Work', 'Personal'). Defaults to the primary writable calendar.")</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("description", "Custom file path to save the recording. Defaults to Recordings/recording_{timestamp}.m4a.")</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("description", "Filter by call type: 'incoming', 'outgoing', 'missed', or 'rejected'. Omit for all.")</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("description", "Filter by sender/recipient address (partial match, e.g. a contact name or phone number).")</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("description", "How many days ahead to include (1-365). Default 7 when from_date/to_date not set.")</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("description", "If true, request a fresh GPS fix (takes a few seconds). Default false (uses last-known location).")</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("description", "New reminder before event in minutes. -1 to remove reminder. Omit to keep current.")</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("description", "One of: pending, in_progress, completed, cancelled.")</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("description", "Optional output format: 'text' (default) or 'markdown'. Currently always returns text.")</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("description", "Optional: auto-turn off after this many seconds (1-300). Only applies when turning on.")</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("description", "Optional: high, medium, low.")</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("description", "Phone number label: 'mobile' (default), 'home', 'work', 'main', 'fax', or 'pager'.")</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("description", "Predefined pattern: short (100ms), long (1s), double (two quick buzzes), sos (...---...). Overrides duration_ms.")</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("description", "Recording quality: 'low' (16kHz, 16kbps), 'medium' (44.1kHz, 64kbps), or 'high' (44.1kHz, 192kbps). Default medium.")</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("description", "Repeating days: e.g. ['mon','wed','fri'] or ['weekdays']. Omit for one-time alarm.")</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("description", "SIM slot to use: 'sim1' or 'sim2'. Only needed on dual-SIM devices. Default is the system default.")</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("description", "Schedule future delivery: ISO-8601 timestamp like '2026-01-15T14:30:00' or epoch millis. Omit for immediate send.")</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("description", "Vibration length in milliseconds (1-5000). Default 500. Ignored when pattern is set.")</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("description", "Which stream to read: media, ring, alarm, notification, call. If omitted, all streams are reported.")</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("description", "Working directory for the command (absolute path). Defaults to the app's working directory.")</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("priority")</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("status")</ID>
+ <ID>ArgumentListWrapping:ToolDefinitions.kt$ToolDefinitions$("type", "string")</ID>
+ <ID>ArgumentListWrapping:ToolExecutor.kt$ToolExecutor$( direction = args.requireString("direction"), x1 = args.requireInt("x1"), y1 = args.requireInt("y1"), x2 = args.requireInt("x2"), y2 = args.requireInt("y2") )</ID>
+ <ID>ArgumentListWrapping:ToolExecutor.kt$ToolExecutor$(TAG, "execute: $name -&gt; success=${result.success}, msgLen=${result.message.length}, perm=${result.needsPermission}")</ID>
+ <ID>ArgumentListWrapping:TtsEngine.kt$TtsEngine$(AudioAttributes.Builder() .setUsage(AudioAttributes.USAGE_MEDIA) .setContentType(AudioAttributes.CONTENT_TYPE_SPEECH) .build())</ID>
+ <ID>ArgumentListWrapping:TtsEngine.kt$TtsEngine$(AudioFormat.Builder() .setEncoding(AudioFormat.ENCODING_PCM_16BIT) .setSampleRate(24000) .setChannelMask(AudioFormat.CHANNEL_OUT_MONO) .build())</ID>
+ <ID>ArgumentListWrapping:WebFetchTool.kt$WebFetchTool$("User-Agent", "Mozilla/5.0 (Linux; Android 14; Pixel 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.6422.165 Mobile Safari/537.36")</ID>
+ <ID>ArgumentListWrapping:WebSearchTool.kt$WebSearchTool$("User-Agent", "Mozilla/5.0 (Linux; Android 14; Pixel 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.6422.165 Mobile Safari/537.36")</ID>
+ <ID>ChainWrapping:LLMClient.kt$LLMClient$&amp;&amp;</ID>
+ <ID>ChainWrapping:SystemTool.kt$SystemTool$||</ID>
+ <ID>ComplexCondition:AccessibilityTool.kt$AccessibilityTool$x1 != null &amp;&amp; y1 != null &amp;&amp; x2 != null &amp;&amp; y2 != null</ID>
+ <ID>ComplexCondition:FileResolver.kt$FileResolver$bytes.size &gt;= 3 &amp;&amp; bytes[0] == 0x47.toByte() &amp;&amp; bytes[1] == 0x49.toByte() &amp;&amp; bytes[2] == 0x46.toByte()</ID>
+ <ID>ComplexCondition:FileResolver.kt$FileResolver$bytes.size &gt;= 3 &amp;&amp; bytes[0] == 0xFF.toByte() &amp;&amp; bytes[1] == 0xD8.toByte() &amp;&amp; bytes[2] == 0xFF.toByte()</ID>
+ <ID>ComplexCondition:FileResolver.kt$FileResolver$bytes.size &gt;= 4 &amp;&amp; bytes[0] == 0x4D.toByte() &amp;&amp; bytes[1] == 0x54.toByte() &amp;&amp; bytes[2] == 0x68.toByte() &amp;&amp; bytes[3] == 0x64.toByte()</ID>
+ <ID>ComplexCondition:FileResolver.kt$FileResolver$bytes.size &gt;= 5 &amp;&amp; bytes[0] == 0x25.toByte() &amp;&amp; bytes[1] == 0x50.toByte() &amp;&amp; bytes[2] == 0x44.toByte() &amp;&amp; bytes[3] == 0x46.toByte() &amp;&amp; bytes[4] == 0x2D.toByte()</ID>
+ <ID>ComplexCondition:FileResolver.kt$FileResolver$bytes.size &gt;= 8 &amp;&amp; bytes[0] == 0x89.toByte() &amp;&amp; bytes[1] == 0x50.toByte() &amp;&amp; bytes[2] == 0x4E.toByte() &amp;&amp; bytes[3] == 0x47.toByte()</ID>
+ <ID>ComplexCondition:LocationTool.kt$LocationTool$loc != null &amp;&amp; (current == null || loc.time &gt; current.time || loc.accuracy &lt; current.accuracy)</ID>
+ <ID>ComplexCondition:TtsEngine.kt$TtsEngine$bytes.size &gt; 44 &amp;&amp; bytes[0] == 0x52.toByte() &amp;&amp; bytes[1] == 0x49.toByte() &amp;&amp; bytes[2] == 0x46.toByte() &amp;&amp; bytes[3] == 0x46.toByte()</ID>
+ <ID>CyclomaticComplexMethod:AudioModels.kt$AudioModel.Companion$fun categorize(id: String, task: String? = null): ModelCategory</ID>
+ <ID>CyclomaticComplexMethod:CalendarTool.kt$CalendarTool$fun createEvent( title: String, start: String, end: String? = null, location: String? = null, description: String? = null, allDay: Boolean? = null, reminderMinutes: Int? = null, calendarName: String? = null ): ToolResult</ID>
+ <ID>CyclomaticComplexMethod:CalendarTool.kt$CalendarTool$fun editEvent( eventId: Long, title: String? = null, start: String? = null, end: String? = null, location: String? = null, description: String? = null, allDay: Boolean? = null, reminderMinutes: Int? = null ): ToolResult</ID>
+ <ID>CyclomaticComplexMethod:CalendarTool.kt$CalendarTool$fun listEvents( daysAhead: Int? = null, fromDate: String? = null, toDate: String? = null, search: String? = null ): ToolResult</ID>
+ <ID>CyclomaticComplexMethod:ChatScreen.kt$@OptIn(ExperimentalMaterial3Api::class) @Composable fun ChatScreen( state: ChatUiState, onSend: (String, String?) -&gt; Unit, onStop: () -&gt; Unit, onConfirm: (Boolean) -&gt; Unit, onAnswer: (String?) -&gt; Unit, onBack: () -&gt; Unit, onOpenSettings: () -&gt; Unit, onPickImage: (Uri) -&gt; String?, onSwitchAgent: () -&gt; Unit, onSpeak: (String) -&gt; Unit = {}, onStartListening: () -&gt; Unit = {}, onStopRecording: () -&gt; Unit = {} )</ID>
+ <ID>CyclomaticComplexMethod:ChatViewModel.kt$ChatViewModel$private fun buildEnvironmentString(agent: AgentMode): String</ID>
+ <ID>CyclomaticComplexMethod:ChatViewModel.kt$ChatViewModel$private suspend fun runToolLoop()</ID>
+ <ID>CyclomaticComplexMethod:ContactsTool.kt$ContactsTool$fun addContact( name: String, number: String, phoneType: String? = null, email: String? = null, organization: String? = null ): ToolResult</ID>
+ <ID>CyclomaticComplexMethod:ContactsTool.kt$ContactsTool$fun findContact(name: String? = null, number: String? = null): ToolResult</ID>
+ <ID>CyclomaticComplexMethod:EditTool.kt$EditTool$fun edit(path: String, oldString: String, newString: String, replaceAll: Boolean): ToolResult</ID>
+ <ID>CyclomaticComplexMethod:FileResolver.kt$FileResolver$fun detectMime(bytes: ByteArray): String?</ID>
+ <ID>CyclomaticComplexMethod:FileTool.kt$FileTool$private fun listResolved( file: File, originalPath: String, sortBy: String?, include: String?, exclude: String?, recursive: Boolean, maxDepth: Int? ): ToolResult</ID>
+ <ID>CyclomaticComplexMethod:FileTool.kt$FileTool$private fun readTextFile(file: File, offset: Int?, limit: Int?, encoding: String?): ToolResult</ID>
+ <ID>CyclomaticComplexMethod:FileTool.kt$FileTool$private fun readUnknownFile(file: File, encoding: String?): ToolResult</ID>
+ <ID>CyclomaticComplexMethod:FileTool.kt$FileTool$private fun readZipEntry(zf: ZipFile, archiveFile: File, archivePath: String, entryPath: String): ToolResult</ID>
+ <ID>CyclomaticComplexMethod:GlobTool.kt$GlobTool$fun glob(path: String, pattern: String): ToolResult</ID>
+ <ID>CyclomaticComplexMethod:GrepTool.kt$GrepTool$fun grep(path: String, pattern: String, include: String?): ToolResult</ID>
+ <ID>CyclomaticComplexMethod:MediaCaptureTool.kt$MediaCaptureTool$fun startAudioRecording( source: String? = null, maxDurationSeconds: Int? = null, outputPath: String? = null, quality: String? = null ): ToolResult</ID>
+ <ID>CyclomaticComplexMethod:MessageBubble.kt$@OptIn(ExperimentalFoundationApi::class) @Composable fun MessageBubble( message: UiMessage, onSpeak: (String) -&gt; Unit = {} )</ID>
+ <ID>CyclomaticComplexMethod:PermissionItems.kt$fun allPermissionGroups(context: Context): List&lt;PermissionGroup&gt;</ID>
+ <ID>CyclomaticComplexMethod:PermissionsSection.kt$private fun openSpecialAccess(context: android.content.Context, marker: String, packageName: String)</ID>
+ <ID>CyclomaticComplexMethod:PhoneTool.kt$PhoneTool$fun readCallLog( limit: Int, callTypeFilter: String? = null, contact: String? = null, fromDate: String? = null, toDate: String? = null ): ToolResult</ID>
+ <ID>CyclomaticComplexMethod:SettingsScreen.kt$@OptIn(ExperimentalMaterial3Api::class) @Composable fun SettingsScreen( initial: Settings, onSave: (Settings) -&gt; Unit, onTestConnection: suspend (Settings) -&gt; Result&lt;String&gt;, onClearLlmCache: () -&gt; Unit, onBack: () -&gt; Unit, onRefreshAudioModels: suspend (Settings) -&gt; Pair&lt;List&lt;AudioModel&gt;, List&lt;AudioModel&gt;&gt; = { Pair(emptyList(), emptyList()) }, packageName: String = "" )</ID>
+ <ID>CyclomaticComplexMethod:SmsTool.kt$SmsTool$fun readRecentSms( limit: Int, fromAddress: String? = null, fromDate: String? = null, toDate: String? = null, unreadOnly: Boolean? = null, search: String? = null, includeSent: Boolean? = null ): ToolResult</ID>
+ <ID>CyclomaticComplexMethod:SmsTool.kt$SmsTool$fun sendSms( number: String, message: String, deliveryReport: Boolean? = null, sendAt: String? = null ): ToolResult</ID>
+ <ID>CyclomaticComplexMethod:SystemTool.kt$SystemTool$fun getBatteryInfo(): ToolResult</ID>
+ <ID>CyclomaticComplexMethod:ToolExecutor.kt$ToolExecutor$private suspend fun dispatch(name: String, args: JsonObject): ToolResult</ID>
+ <ID>CyclomaticComplexMethod:WebFetchTool.kt$WebFetchTool$fun fetch(url: String, format: String?): ToolResult</ID>
+ <ID>CyclomaticComplexMethod:WebFetchTool.kt$WebFetchTool$private fun htmlToMarkdown(doc: Document): String</ID>
+ <ID>CyclomaticComplexMethod:WebSearchTool.kt$WebSearchTool$fun search(query: String, numResults: Int): ToolResult</ID>
+ <ID>DestructuringDeclarationWithTooManyEntries:AccessibilityTool.kt$AccessibilityTool$val (sx, sy, ex, ey) = when (direction?.lowercase()?.trim()) { "up" -&gt; listOf(w / 2, h * 0.7f, w / 2, h * 0.3f) "down" -&gt; listOf(w / 2, h * 0.3f, w / 2, h * 0.7f) "left" -&gt; listOf(w * 0.7f, h / 2, w * 0.3f, h / 2) "right" -&gt; listOf(w * 0.3f, h / 2, w * 0.7f, h / 2) else -&gt; return ToolResult.error( "Provide a direction (up/down/left/right) or explicit x1,y1,x2,y2 coordinates." ) }</ID>
+ <ID>EmptyDefaultConstructor:StorageTool.kt$StorageTool$()</ID>
+ <ID>EmptyFunctionBlock:GotchaAccessibilityService.kt$GotchaAccessibilityService${}</ID>
+ <ID>EmptyFunctionBlock:GotchaNotificationListenerService.kt$GotchaNotificationListenerService${}</ID>
+ <ID>EmptyFunctionBlock:LocationTool.kt$LocationTool.&lt;no name provided&gt;${}</ID>
+ <ID>EmptyFunctionBlock:SttEngine.kt$SttEngine.&lt;no name provided&gt;${}</ID>
+ <ID>EmptyFunctionBlock:TtsEngine.kt$TtsEngine.&lt;no name provided&gt;${}</ID>
+ <ID>FunctionNaming:ChatScreen.kt$@OptIn(ExperimentalMaterial3Api::class) @Composable fun ChatScreen( state: ChatUiState, onSend: (String, String?) -&gt; Unit, onStop: () -&gt; Unit, onConfirm: (Boolean) -&gt; Unit, onAnswer: (String?) -&gt; Unit, onBack: () -&gt; Unit, onOpenSettings: () -&gt; Unit, onPickImage: (Uri) -&gt; String?, onSwitchAgent: () -&gt; Unit, onSpeak: (String) -&gt; Unit = {}, onStartListening: () -&gt; Unit = {}, onStopRecording: () -&gt; Unit = {} )</ID>
+ <ID>FunctionNaming:MainActivity.kt$MainActivity$@Composable private fun GotchaApp()</ID>
+ <ID>FunctionNaming:MessageBubble.kt$@OptIn(ExperimentalFoundationApi::class) @Composable fun MessageBubble( message: UiMessage, onSpeak: (String) -&gt; Unit = {} )</ID>
+ <ID>FunctionNaming:PermissionsSection.kt$@Composable fun PermissionsSection(packageName: String)</ID>
+ <ID>FunctionNaming:PermissionsSection.kt$@Composable private fun PermissionRow( item: PermissionItem, granted: Boolean, packageName: String, onRequestRuntime: (Array&lt;String&gt;) -&gt; Unit )</ID>
+ <ID>FunctionNaming:SessionsScreen.kt$@Composable fun SessionRow( session: ChatSession, onClick: () -&gt; Unit, onDelete: () -&gt; Unit )</ID>
+ <ID>FunctionNaming:SessionsScreen.kt$@OptIn(ExperimentalMaterial3Api::class) @Composable fun SessionsScreen( sessions: List&lt;ChatSession&gt;, onSessionClick: (String) -&gt; Unit, onDeleteSession: (String) -&gt; Unit, onNewChat: () -&gt; Unit, onOpenSettings: () -&gt; Unit, assistiveBallEnabled: Boolean = false, onToggleAssistiveBall: (Boolean) -&gt; Unit = {} )</ID>
+ <ID>FunctionNaming:SettingsScreen.kt$@Composable private fun SectionHeader( title: String, expanded: Boolean, onToggle: () -&gt; Unit )</ID>
+ <ID>FunctionNaming:SettingsScreen.kt$@OptIn(ExperimentalMaterial3Api::class) @Composable fun SettingsScreen( initial: Settings, onSave: (Settings) -&gt; Unit, onTestConnection: suspend (Settings) -&gt; Result&lt;String&gt;, onClearLlmCache: () -&gt; Unit, onBack: () -&gt; Unit, onRefreshAudioModels: suspend (Settings) -&gt; Pair&lt;List&lt;AudioModel&gt;, List&lt;AudioModel&gt;&gt; = { Pair(emptyList(), emptyList()) }, packageName: String = "" )</ID>
+ <ID>FunctionNaming:Theme.kt$@Composable fun GotchaTheme( darkTheme: Boolean = isSystemInDarkTheme(), dynamicColor: Boolean = true, content: @Composable () -&gt; Unit )</ID>
+ <ID>ImportOrdering:AlarmTool.kt$import android.app.AlarmManager import android.app.PendingIntent import android.content.ActivityNotFoundException import android.content.Context import android.content.Intent import android.content.SharedPreferences import android.os.Build import android.provider.AlarmClock import java.text.SimpleDateFormat import java.util.Calendar import java.util.Date import java.util.Locale import kotlinx.serialization.json.Json import kotlinx.serialization.json.JsonArray import kotlinx.serialization.json.JsonObject import kotlinx.serialization.json.booleanOrNull import kotlinx.serialization.json.buildJsonArray import kotlinx.serialization.json.buildJsonObject import kotlinx.serialization.json.intOrNull import kotlinx.serialization.json.jsonArray import kotlinx.serialization.json.jsonObject import kotlinx.serialization.json.jsonPrimitive import kotlinx.serialization.json.put</ID>
+ <ID>ImportOrdering:AppsTool.kt$import android.app.AppOpsManager import android.app.usage.NetworkStatsManager import android.app.usage.UsageStatsManager import android.content.Context import android.content.Intent import android.content.pm.ApplicationInfo import android.content.pm.PackageManager import android.util.Log import android.net.ConnectivityManager import android.net.Uri import android.os.Build import android.os.Process</ID>
+ <ID>ImportOrdering:ChatHistoryRepository.kt$import android.content.Context import com.gotcha.llm.ChatMessage import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import kotlinx.serialization.builtins.ListSerializer import kotlinx.serialization.json.Json import java.io.File import kotlinx.serialization.Serializable import java.util.UUID</ID>
+ <ID>ImportOrdering:ChatScreen.kt$import android.net.Uri import androidx.activity.compose.rememberLauncherForActivityResult import androidx.activity.result.contract.ActivityResultContracts import androidx.compose.foundation.Image as ComposeImage import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.ArrowBack import androidx.compose.material.icons.filled.Close import androidx.compose.material.icons.filled.Mic import androidx.compose.material.icons.filled.Send import androidx.compose.material.icons.filled.Stop import androidx.compose.material3.AlertDialog import androidx.compose.material3.Button import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.CircularProgressIndicator import androidx.compose.material3.FilterChip import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material3.IconButtonDefaults import androidx.compose.material3.LinearProgressIndicator import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.MaterialTheme import androidx.compose.material3.OutlinedTextField import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.material3.TextButton import androidx.compose.material3.TopAppBar import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.asImageBitmap import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.unit.dp import com.gotcha.agent.ChatUiState import com.gotcha.agent.PendingQuestion import com.gotcha.tools.AgentMode</ID>
+ <ID>ImportOrdering:ChatViewModel.kt$import android.app.Application import android.graphics.Bitmap import android.graphics.BitmapFactory import android.net.Uri import android.util.Log import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.viewModelScope import com.gotcha.audio.AudioProvider import com.gotcha.audio.AudioModel import com.gotcha.audio.SttEngine import com.gotcha.audio.TtsEngine import com.gotcha.data.ChatHistoryRepository import com.gotcha.data.Settings import com.gotcha.data.SettingsRepository import com.gotcha.llm.ChatMessage import com.gotcha.data.ChatSession import com.gotcha.llm.LLMClient import com.gotcha.llm.ToolCall import com.gotcha.llm.visionUserMessage import com.gotcha.tools.AgentMode import com.gotcha.tools.FileResolver import com.gotcha.tools.ToolExecutor import com.gotcha.tools.ToolRegistry import com.gotcha.tools.ToolResult import com.gotcha.ui.ConfirmationOverlay import kotlinx.coroutines.CompletableDeferred import kotlinx.coroutines.Job import kotlinx.coroutines.delay import kotlinx.coroutines.CancellationException import kotlinx.coroutines.withContext import kotlinx.coroutines.NonCancellable import kotlinx.coroutines.withTimeoutOrNull import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.SharedFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asSharedFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import kotlinx.serialization.json.Json import kotlinx.serialization.json.JsonObject import kotlinx.serialization.json.JsonPrimitive import kotlinx.serialization.json.buildJsonObject import kotlinx.serialization.json.put import java.io.ByteArrayOutputStream</ID>
+ <ID>ImportOrdering:LLMClient.kt$import android.content.Context import kotlinx.serialization.builtins.ListSerializer import kotlinx.serialization.json.Json import okhttp3.MediaType.Companion.toMediaType import okhttp3.OkHttpClient import okhttp3.logging.HttpLoggingInterceptor import retrofit2.Retrofit import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory import java.security.MessageDigest</ID>
+ <ID>ImportOrdering:MainActivity.kt$import android.app.admin.DevicePolicyManager import android.content.Context import android.content.Intent import android.content.SharedPreferences import android.net.Uri import android.net.VpnService import android.os.Build import android.os.Bundle import android.provider.Settings as AndroidSettings import android.widget.Toast import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.activity.compose.BackHandler import androidx.activity.result.contract.ActivityResultContracts import androidx.activity.viewModels import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Surface import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.lifecycle.lifecycleScope import com.gotcha.agent.ChatViewModel import com.gotcha.audio.AudioApi import com.gotcha.audio.AudioModel import com.gotcha.audio.ModelCategory import com.gotcha.data.Settings import com.gotcha.data.SettingsRepository import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import com.gotcha.llm.ChatMessage import com.gotcha.llm.LLMClient import kotlinx.serialization.json.JsonPrimitive import com.gotcha.service.AssistiveBallService import com.gotcha.service.GotchaDeviceAdminReceiver import com.gotcha.tools.ToolResult import com.gotcha.ui.ChatScreen import com.gotcha.ui.SessionsScreen import com.gotcha.ui.SettingsScreen import com.gotcha.ui.theme.GotchaTheme import kotlinx.coroutines.launch</ID>
+ <ID>ImportOrdering:MessageBubble.kt$import android.content.ClipData import android.content.ClipboardManager import android.content.Context import android.widget.Toast import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.Image import androidx.compose.foundation.combinedClickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.widthIn import androidx.compose.foundation.shape.RoundedCornerShape import com.halilibo.richtext.markdown.Markdown import com.halilibo.richtext.ui.material3.Material3RichText import androidx.compose.material.icons.Icons import androidx.compose.material.icons.automirrored.rounded.VolumeUp import androidx.compose.material3.DropdownMenu import androidx.compose.material3.DropdownMenuItem import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Surface import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.asImageBitmap import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import com.gotcha.agent.MessageKind import com.gotcha.agent.UiMessage</ID>
+ <ID>ImportOrdering:PermissionItems.kt$import android.content.Context import android.os.Build import android.os.Environment import android.provider.Settings import android.app.admin.DevicePolicyManager import android.app.AppOpsManager import android.content.ComponentName import android.content.ContextWrapper import androidx.core.content.ContextCompat import com.gotcha.service.GotchaDeviceAdminReceiver</ID>
+ <ID>ImportOrdering:PermissionsSection.kt$import android.content.Intent import android.net.Uri import android.net.VpnService import android.os.Build import android.provider.Settings as AndroidSettings import android.app.admin.DevicePolicyManager import android.content.ComponentName import android.widget.Toast import androidx.activity.compose.rememberLauncherForActivityResult import androidx.activity.result.contract.ActivityResultContracts import androidx.compose.animation.AnimatedVisibility import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Switch import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.DisposableEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalLifecycleOwner import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.lifecycle.Lifecycle import androidx.lifecycle.LifecycleEventObserver import com.gotcha.service.GotchaDeviceAdminReceiver import com.gotcha.tools.ToolResult</ID>
+ <ID>ImportOrdering:ToolDefinitions.kt$import com.gotcha.llm.FunctionDefinition import com.gotcha.llm.ToolDefinition import kotlinx.serialization.json.JsonObject import kotlinx.serialization.json.buildJsonObject import kotlinx.serialization.json.put import kotlinx.serialization.json.putJsonArray import kotlinx.serialization.json.putJsonObject import kotlinx.serialization.json.add</ID>
+ <ID>Indentation:CalendarTool.kt$CalendarTool$ </ID>
+ <ID>Indentation:ChatViewModel.kt$ChatViewModel$ </ID>
+ <ID>Indentation:ContactsTool.kt$ContactsTool$ </ID>
+ <ID>Indentation:FileResolver.kt$FileResolver.Companion$ </ID>
+ <ID>Indentation:FileTool.kt$FileTool$ </ID>
+ <ID>Indentation:LLMClient.kt$LLMClient$ </ID>
+ <ID>Indentation:MediaCaptureTool.kt$MediaCaptureTool$ </ID>
+ <ID>Indentation:SystemTool.kt$SystemTool$ </ID>
+ <ID>Indentation:ToolExecutor.kt$ToolExecutor$ </ID>
+ <ID>LargeClass:ChatViewModel.kt$ChatViewModel : AndroidViewModel</ID>
+ <ID>LargeClass:ToolDefinitions.kt$ToolDefinitions</ID>
+ <ID>LongMethod:CalendarTool.kt$CalendarTool$fun listEvents( daysAhead: Int? = null, fromDate: String? = null, toDate: String? = null, search: String? = null ): ToolResult</ID>
+ <ID>LongMethod:ChatScreen.kt$@OptIn(ExperimentalMaterial3Api::class) @Composable fun ChatScreen( state: ChatUiState, onSend: (String, String?) -&gt; Unit, onStop: () -&gt; Unit, onConfirm: (Boolean) -&gt; Unit, onAnswer: (String?) -&gt; Unit, onBack: () -&gt; Unit, onOpenSettings: () -&gt; Unit, onPickImage: (Uri) -&gt; String?, onSwitchAgent: () -&gt; Unit, onSpeak: (String) -&gt; Unit = {}, onStartListening: () -&gt; Unit = {}, onStopRecording: () -&gt; Unit = {} )</ID>
+ <ID>LongMethod:ContactsTool.kt$ContactsTool$fun addContact( name: String, number: String, phoneType: String? = null, email: String? = null, organization: String? = null ): ToolResult</ID>
+ <ID>LongMethod:ContactsTool.kt$ContactsTool$fun findContact(name: String? = null, number: String? = null): ToolResult</ID>
+ <ID>LongMethod:MainActivity.kt$MainActivity$@Composable private fun GotchaApp()</ID>
+ <ID>LongMethod:MessageBubble.kt$@OptIn(ExperimentalFoundationApi::class) @Composable fun MessageBubble( message: UiMessage, onSpeak: (String) -&gt; Unit = {} )</ID>
+ <ID>LongMethod:PermissionItems.kt$fun allPermissionGroups(context: Context): List&lt;PermissionGroup&gt;</ID>
+ <ID>LongMethod:PhoneTool.kt$PhoneTool$fun readCallLog( limit: Int, callTypeFilter: String? = null, contact: String? = null, fromDate: String? = null, toDate: String? = null ): ToolResult</ID>
+ <ID>LongMethod:SettingsScreen.kt$@OptIn(ExperimentalMaterial3Api::class) @Composable fun SettingsScreen( initial: Settings, onSave: (Settings) -&gt; Unit, onTestConnection: suspend (Settings) -&gt; Result&lt;String&gt;, onClearLlmCache: () -&gt; Unit, onBack: () -&gt; Unit, onRefreshAudioModels: suspend (Settings) -&gt; Pair&lt;List&lt;AudioModel&gt;, List&lt;AudioModel&gt;&gt; = { Pair(emptyList(), emptyList()) }, packageName: String = "" )</ID>
+ <ID>LongMethod:ToolExecutor.kt$ToolExecutor$private suspend fun dispatch(name: String, args: JsonObject): ToolResult</ID>
+ <ID>LongParameterList:ChatScreen.kt$( state: ChatUiState, onSend: (String, String?) -&gt; Unit, onStop: () -&gt; Unit, onConfirm: (Boolean) -&gt; Unit, onAnswer: (String?) -&gt; Unit, onBack: () -&gt; Unit, onOpenSettings: () -&gt; Unit, onPickImage: (Uri) -&gt; String?, onSwitchAgent: () -&gt; Unit, onSpeak: (String) -&gt; Unit = {}, onStartListening: () -&gt; Unit = {}, onStopRecording: () -&gt; Unit = {} )</ID>
+ <ID>LoopWithTooManyJumpStatements:FileTool.kt$FileTool$for</ID>
+ <ID>LoopWithTooManyJumpStatements:GrepTool.kt$GrepTool$for</ID>
+ <ID>LoopWithTooManyJumpStatements:WebSearchTool.kt$WebSearchTool$for</ID>
+ <ID>MagicNumber:AccessibilityTool.kt$AccessibilityTool$0.3f</ID>
+ <ID>MagicNumber:AccessibilityTool.kt$AccessibilityTool$0.7f</ID>
+ <ID>MagicNumber:ActionLog.kt$ActionLog$1024</ID>
+ <ID>MagicNumber:ActionLog.kt$ActionLog$500</ID>
+ <ID>MagicNumber:ActionLog.kt$ActionLog$512</ID>
+ <ID>MagicNumber:AlarmReceiver.kt$AlarmReceiver$1000</ID>
+ <ID>MagicNumber:AlarmReceiver.kt$AlarmReceiver$2000</ID>
+ <ID>MagicNumber:AlarmTool.kt$AlarmTool$1000</ID>
+ <ID>MagicNumber:AlarmTool.kt$AlarmTool$23</ID>
+ <ID>MagicNumber:AlarmTool.kt$AlarmTool$3</ID>
+ <ID>MagicNumber:AlarmTool.kt$AlarmTool$3600</ID>
+ <ID>MagicNumber:AlarmTool.kt$AlarmTool$59</ID>
+ <ID>MagicNumber:AlarmTool.kt$AlarmTool$6</ID>
+ <ID>MagicNumber:AlarmTool.kt$AlarmTool$60</ID>
+ <ID>MagicNumber:AlarmTool.kt$AlarmTool$7</ID>
+ <ID>MagicNumber:AlarmTool.kt$AlarmTool.TimerRecord$1000L</ID>
+ <ID>MagicNumber:AppsTool.kt$AppsTool$10</ID>
+ <ID>MagicNumber:AppsTool.kt$AppsTool$1000</ID>
+ <ID>MagicNumber:AppsTool.kt$AppsTool$200</ID>
+ <ID>MagicNumber:AppsTool.kt$AppsTool$24L</ID>
+ <ID>MagicNumber:AppsTool.kt$AppsTool$30</ID>
+ <ID>MagicNumber:AppsTool.kt$AppsTool$60</ID>
+ <ID>MagicNumber:AppsTool.kt$AppsTool$60000</ID>
+ <ID>MagicNumber:AppsTool.kt$AppsTool$90</ID>
+ <ID>MagicNumber:AssistiveBallOverlay.kt$AssistiveBallOverlay$12</ID>
+ <ID>MagicNumber:AssistiveBallOverlay.kt$AssistiveBallOverlay$13f</ID>
+ <ID>MagicNumber:AssistiveBallOverlay.kt$AssistiveBallOverlay$14f</ID>
+ <ID>MagicNumber:AssistiveBallOverlay.kt$AssistiveBallOverlay$16</ID>
+ <ID>MagicNumber:AssistiveBallOverlay.kt$AssistiveBallOverlay$160</ID>
+ <ID>MagicNumber:AssistiveBallOverlay.kt$AssistiveBallOverlay$20</ID>
+ <ID>MagicNumber:AssistiveBallOverlay.kt$AssistiveBallOverlay$240</ID>
+ <ID>MagicNumber:AssistiveBallOverlay.kt$AssistiveBallOverlay$260</ID>
+ <ID>MagicNumber:AssistiveBallOverlay.kt$AssistiveBallOverlay$320</ID>
+ <ID>MagicNumber:AssistiveBallOverlay.kt$AssistiveBallOverlay$4</ID>
+ <ID>MagicNumber:AssistiveBallOverlay.kt$AssistiveBallOverlay$56</ID>
+ <ID>MagicNumber:AssistiveBallOverlay.kt$AssistiveBallOverlay$64</ID>
+ <ID>MagicNumber:AssistiveBallOverlay.kt$AssistiveBallOverlay$8</ID>
+ <ID>MagicNumber:AssistiveBallService.kt$AssistiveBallService$350</ID>
+ <ID>MagicNumber:AssistiveBallService.kt$AssistiveBallService$401</ID>
+ <ID>MagicNumber:AudioApi.kt$AudioApi$200</ID>
+ <ID>MagicNumber:CalendarTool.kt$CalendarTool$1000</ID>
+ <ID>MagicNumber:CalendarTool.kt$CalendarTool$200</ID>
+ <ID>MagicNumber:CalendarTool.kt$CalendarTool$24L</ID>
+ <ID>MagicNumber:CalendarTool.kt$CalendarTool$365</ID>
+ <ID>MagicNumber:CalendarTool.kt$CalendarTool$50</ID>
+ <ID>MagicNumber:CalendarTool.kt$CalendarTool$60</ID>
+ <ID>MagicNumber:CalendarTool.kt$CalendarTool$7</ID>
+ <ID>MagicNumber:CalendarTool.kt$CalendarTool$86400000L</ID>
+ <ID>MagicNumber:CalendarTool.kt$CalendarTool$86_400_000L</ID>
+ <ID>MagicNumber:ChatViewModel.kt$ChatViewModel$0.8</ID>
+ <ID>MagicNumber:ChatViewModel.kt$ChatViewModel$1024</ID>
+ <ID>MagicNumber:ChatViewModel.kt$ChatViewModel$120_000L</ID>
+ <ID>MagicNumber:ChatViewModel.kt$ChatViewModel$200</ID>
+ <ID>MagicNumber:ChatViewModel.kt$ChatViewModel$3</ID>
+ <ID>MagicNumber:ChatViewModel.kt$ChatViewModel$30</ID>
+ <ID>MagicNumber:ChatViewModel.kt$ChatViewModel$4</ID>
+ <ID>MagicNumber:ChatViewModel.kt$ChatViewModel$401</ID>
+ <ID>MagicNumber:ChatViewModel.kt$ChatViewModel$5</ID>
+ <ID>MagicNumber:ChatViewModel.kt$ChatViewModel$500</ID>
+ <ID>MagicNumber:ChatViewModel.kt$ChatViewModel$6</ID>
+ <ID>MagicNumber:ChatViewModel.kt$ChatViewModel$85</ID>
+ <ID>MagicNumber:ChatViewModel.kt$ChatViewModel$90</ID>
+ <ID>MagicNumber:ClipboardTool.kt$ClipboardTool$2000</ID>
+ <ID>MagicNumber:ClipboardTool.kt$ClipboardTool$34</ID>
+ <ID>MagicNumber:Color.kt$0xFF002117</ID>
+ <ID>MagicNumber:Color.kt$0xFF00363D</ID>
+ <ID>MagicNumber:Color.kt$0xFF004F58</ID>
+ <ID>MagicNumber:Color.kt$0xFF006C53</ID>
+ <ID>MagicNumber:Color.kt$0xFF00E5FF</ID>
+ <ID>MagicNumber:Color.kt$0xFF08201A</ID>
+ <ID>MagicNumber:Color.kt$0xFF0F172A</ID>
+ <ID>MagicNumber:Color.kt$0xFF1E293B</ID>
+ <ID>MagicNumber:Color.kt$0xFF334155</ID>
+ <ID>MagicNumber:Color.kt$0xFF3F4945</ID>
+ <ID>MagicNumber:Color.kt$0xFF4C635B</ID>
+ <ID>MagicNumber:Color.kt$0xFF7A003C</ID>
+ <ID>MagicNumber:Color.kt$0xFFA6FAFF</ID>
+ <ID>MagicNumber:Color.kt$0xFFCBD5E1</ID>
+ <ID>MagicNumber:Color.kt$0xFFCEE9DD</ID>
+ <ID>MagicNumber:Color.kt$0xFFDBE5E0</ID>
+ <ID>MagicNumber:Color.kt$0xFFE8F6F2</ID>
+ <ID>MagicNumber:Color.kt$0xFFFBFDF9</ID>
+ <ID>MagicNumber:Color.kt$0xFFFF007F</ID>
+ <ID>MagicNumber:Color.kt$0xFFFFD9E2</ID>
+ <ID>MagicNumber:Color.kt$0xFFFFFFFF</ID>
+ <ID>MagicNumber:ConfirmationOverlay.kt$ConfirmationOverlay$13f</ID>
+ <ID>MagicNumber:ConfirmationOverlay.kt$ConfirmationOverlay$16</ID>
+ <ID>MagicNumber:ConfirmationOverlay.kt$ConfirmationOverlay$16f</ID>
+ <ID>MagicNumber:ConfirmationOverlay.kt$ConfirmationOverlay$20</ID>
+ <ID>MagicNumber:ConfirmationOverlay.kt$ConfirmationOverlay$320</ID>
+ <ID>MagicNumber:ConfirmationOverlay.kt$ConfirmationOverlay$8</ID>
+ <ID>MagicNumber:ContactsTool.kt$ContactsTool$10</ID>
+ <ID>MagicNumber:DeviceAdminTool.kt$DeviceAdminTool$16</ID>
+ <ID>MagicNumber:DeviceTool.kt$DeviceTool$100</ID>
+ <ID>MagicNumber:DeviceTool.kt$DeviceTool$1000</ID>
+ <ID>MagicNumber:DeviceTool.kt$DeviceTool$1000L</ID>
+ <ID>MagicNumber:DeviceTool.kt$DeviceTool$200</ID>
+ <ID>MagicNumber:DeviceTool.kt$DeviceTool$255</ID>
+ <ID>MagicNumber:DeviceTool.kt$DeviceTool$300</ID>
+ <ID>MagicNumber:DeviceTool.kt$DeviceTool$500</ID>
+ <ID>MagicNumber:DeviceTool.kt$DeviceTool$5000</ID>
+ <ID>MagicNumber:DeviceTool.kt$DeviceTool$600</ID>
+ <ID>MagicNumber:DeviceTool.kt$DeviceTool$800</ID>
+ <ID>MagicNumber:EditTool.kt$EditTool$5</ID>
+ <ID>MagicNumber:EditTool.kt$EditTool$80</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$0x03</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$0x04</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$0x1A</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$0x21</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$0x2E</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$0x42</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$0x45</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$0x46</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$0x49</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$0x4B</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$0x50</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$0x52</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$0x57</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$0x61</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$0x64</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$0x66</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$0x6E</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$0x70</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$0x72</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$0x73</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$0x74</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$0x79</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$12</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$23</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$28</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$29</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$3</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$4</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$5</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver$8</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver.Companion$1024</ID>
+ <ID>MagicNumber:FileResolver.kt$FileResolver.Companion$1024L</ID>
+ <ID>MagicNumber:FileTool.kt$FileTool$0.05f</ID>
+ <ID>MagicNumber:FileTool.kt$FileTool$0.3f</ID>
+ <ID>MagicNumber:FileTool.kt$FileTool$0xFF</ID>
+ <ID>MagicNumber:FileTool.kt$FileTool$10</ID>
+ <ID>MagicNumber:FileTool.kt$FileTool$100</ID>
+ <ID>MagicNumber:FileTool.kt$FileTool$1024</ID>
+ <ID>MagicNumber:FileTool.kt$FileTool$13</ID>
+ <ID>MagicNumber:FileTool.kt$FileTool$200</ID>
+ <ID>MagicNumber:FileTool.kt$FileTool$32</ID>
+ <ID>MagicNumber:FileTool.kt$FileTool$5</ID>
+ <ID>MagicNumber:FileTool.kt$FileTool$512</ID>
+ <ID>MagicNumber:FileTool.kt$FileTool$9</ID>
+ <ID>MagicNumber:GrepTool.kt$GrepTool$200</ID>
+ <ID>MagicNumber:GotchaAccessibilityService.kt$GotchaAccessibilityService$50</ID>
+ <ID>MagicNumber:GotchaAccessibilityService.kt$GotchaAccessibilityService$60_000</ID>
+ <ID>MagicNumber:GotchaVpnService.kt$GotchaVpnService$128</ID>
+ <ID>MagicNumber:GotchaVpnService.kt$GotchaVpnService$32</ID>
+ <ID>MagicNumber:LLMCache.kt$LLMCache$1000</ID>
+ <ID>MagicNumber:LLMCache.kt$LLMCache$5</ID>
+ <ID>MagicNumber:LLMCache.kt$LLMCache$60</ID>
+ <ID>MagicNumber:LLMCache.kt$LLMCache.&lt;no name provided&gt;$0.75f</ID>
+ <ID>MagicNumber:LLMCache.kt$LLMCache.&lt;no name provided&gt;$16</ID>
+ <ID>MagicNumber:LocationTool.kt$LocationTool$3.6</ID>
+ <ID>MagicNumber:LocationTool.kt$LocationTool$8</ID>
+ <ID>MagicNumber:MainActivity.kt$MainActivity$29</ID>
+ <ID>MagicNumber:MainActivity.kt$MainActivity$60</ID>
+ <ID>MagicNumber:MediaCaptureTool.kt$MediaCaptureTool$1000</ID>
+ <ID>MagicNumber:MediaCaptureTool.kt$MediaCaptureTool$16000</ID>
+ <ID>MagicNumber:MediaCaptureTool.kt$MediaCaptureTool$192000</ID>
+ <ID>MagicNumber:MediaCaptureTool.kt$MediaCaptureTool$44100</ID>
+ <ID>MagicNumber:MediaCaptureTool.kt$MediaCaptureTool$5</ID>
+ <ID>MagicNumber:MediaCaptureTool.kt$MediaCaptureTool$60</ID>
+ <ID>MagicNumber:MediaCaptureTool.kt$MediaCaptureTool$64000</ID>
+ <ID>MagicNumber:NotificationTool.kt$NotificationTool$50</ID>
+ <ID>MagicNumber:OverlayTool.kt$OverlayTool$1000</ID>
+ <ID>MagicNumber:OverlayTool.kt$OverlayTool$120</ID>
+ <ID>MagicNumber:OverlayTool.kt$OverlayTool$16f</ID>
+ <ID>MagicNumber:OverlayTool.kt$OverlayTool$220</ID>
+ <ID>MagicNumber:OverlayTool.kt$OverlayTool$24</ID>
+ <ID>MagicNumber:OverlayTool.kt$OverlayTool$300_000</ID>
+ <ID>MagicNumber:OverlayTool.kt$OverlayTool$32</ID>
+ <ID>MagicNumber:PermissionItems.kt$29</ID>
+ <ID>MagicNumber:PhoneTool.kt$PhoneTool$50</ID>
+ <ID>MagicNumber:PhoneTool.kt$PhoneTool$60</ID>
+ <ID>MagicNumber:PhoneTool.kt$PhoneTool$86_400_000L</ID>
+ <ID>MagicNumber:QuestionTool.kt$QuestionTool$10</ID>
+ <ID>MagicNumber:QuickAskEngine.kt$QuickAskEngine$1024</ID>
+ <ID>MagicNumber:QuickAskEngine.kt$QuickAskEngine$1100</ID>
+ <ID>MagicNumber:QuickAskEngine.kt$QuickAskEngine$85</ID>
+ <ID>MagicNumber:RootTool.kt$RootTool$1024</ID>
+ <ID>MagicNumber:RootTool.kt$RootTool$120</ID>
+ <ID>MagicNumber:RootTool.kt$RootTool$2000</ID>
+ <ID>MagicNumber:RootTool.kt$RootTool$32</ID>
+ <ID>MagicNumber:RootTool.kt$RootTool$4096</ID>
+ <ID>MagicNumber:SettingsRepository.kt$SettingsRepository$30</ID>
+ <ID>MagicNumber:SettingsRepository.kt$SettingsRepository$40000</ID>
+ <ID>MagicNumber:SmsTool.kt$SmsTool$0x7FFFFFFF</ID>
+ <ID>MagicNumber:SmsTool.kt$SmsTool$10</ID>
+ <ID>MagicNumber:SmsTool.kt$SmsTool$160</ID>
+ <ID>MagicNumber:SmsTool.kt$SmsTool$3</ID>
+ <ID>MagicNumber:SmsTool.kt$SmsTool$300</ID>
+ <ID>MagicNumber:SmsTool.kt$SmsTool$50</ID>
+ <ID>MagicNumber:SmsTool.kt$SmsTool$60000</ID>
+ <ID>MagicNumber:SmsTool.kt$SmsTool$86_400_000L</ID>
+ <ID>MagicNumber:StorageTool.kt$StorageTool$10</ID>
+ <ID>MagicNumber:StorageTool.kt$StorageTool$100</ID>
+ <ID>MagicNumber:StorageTool.kt$StorageTool$100L</ID>
+ <ID>MagicNumber:StorageTool.kt$StorageTool$20</ID>
+ <ID>MagicNumber:StorageTool.kt$StorageTool.Companion$1024</ID>
+ <ID>MagicNumber:SttEngine.kt$SttEngine$16000</ID>
+ <ID>MagicNumber:SystemTool.kt$SystemTool$100</ID>
+ <ID>MagicNumber:SystemTool.kt$SystemTool$1000</ID>
+ <ID>MagicNumber:SystemTool.kt$SystemTool$10f</ID>
+ <ID>MagicNumber:SystemTool.kt$SystemTool$255</ID>
+ <ID>MagicNumber:TerminalTool.kt$TerminalTool$1024</ID>
+ <ID>MagicNumber:TerminalTool.kt$TerminalTool$120</ID>
+ <ID>MagicNumber:TerminalTool.kt$TerminalTool$2000</ID>
+ <ID>MagicNumber:TerminalTool.kt$TerminalTool$32</ID>
+ <ID>MagicNumber:TerminalTool.kt$TerminalTool$4096</ID>
+ <ID>MagicNumber:ToolExecutor.kt$ToolExecutor$1000L</ID>
+ <ID>MagicNumber:ToolExecutor.kt$ToolExecutor$15</ID>
+ <ID>MagicNumber:ToolExecutor.kt$ToolExecutor$30</ID>
+ <ID>MagicNumber:ToolExecutor.kt$ToolExecutor$7</ID>
+ <ID>MagicNumber:ToolExecutor.kt$ToolExecutor$86400</ID>
+ <ID>MagicNumber:TtsEngine.kt$TtsEngine$24000</ID>
+ <ID>MagicNumber:TtsEngine.kt$TtsEngine$3</ID>
+ <ID>MagicNumber:TtsEngine.kt$TtsEngine$44</ID>
+ <ID>MagicNumber:WallpaperTool.kt$WallpaperTool$15</ID>
+ <ID>MagicNumber:WallpaperTool.kt$WallpaperTool$30</ID>
+ <ID>MagicNumber:WebFetchTool.kt$WebFetchTool$1024</ID>
+ <ID>MagicNumber:WebSearchTool.kt$WebSearchTool$10</ID>
+ <ID>MaxLineLength:AlarmTool.kt$AlarmTool$ToolResult.ok("Removed alarm $id from this assistant's list, but no clock app handled the dismiss intent — ask the user to delete it in the clock app.")</ID>
+ <ID>MaxLineLength:AlarmTool.kt$AlarmTool$fun</ID>
+ <ID>MaxLineLength:AlarmTool.kt$AlarmTool$return PendingIntent.getBroadcast(context, requestCode, intent, PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_NO_CREATE) != null</ID>
+ <ID>MaxLineLength:AlarmTool.kt$AlarmTool$return ToolResult.error("Alarm $id lives in the system clock app but no clock app handled the update intent. Edit it in the clock app directly.")</ID>
+ <ID>MaxLineLength:AlarmTool.kt$AlarmTool$return ToolResult.ok("Set alarm '$label' for %02d:%02d$extra (id=$id). No clock app handled it, so it was scheduled in-app and rings as a notification.".format(hour, minute))</ID>
+ <ID>MaxLineLength:AlarmTool.kt$AlarmTool$val pi = PendingIntent.getBroadcast(context, alarmRequestCode(a.id), intent, PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT)</ID>
+ <ID>MaxLineLength:AlarmTool.kt$AlarmTool$val pi = PendingIntent.getBroadcast(context, timerRequestCode(t.id), intent, PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT)</ID>
+ <ID>MaxLineLength:AppsTool.kt$AppsTool$ToolResult.ok("Found $matchCount app(s) matching '$search'$truncated ($total total, $userApps user, $systemApps system).\n$listing")</ID>
+ <ID>MaxLineLength:AppsTool.kt$AppsTool$ToolResult.ok("System dialog opened to uninstall $label. After you tap OK in the dialog, ask the assistant to verify the app is gone.")</ID>
+ <ID>MaxLineLength:AudioModels.kt$AudioModel.Companion$t == "automatic-speech-recognition" || t == "stt" || t == "speech-to-text" || t == "transcription" -&gt; return ModelCategory.STT</ID>
+ <ID>MaxLineLength:ChatViewModel.kt$ChatViewModel$AgentMode.MONITOR -&gt; "[System: Switched to Monitor (read-only). You may now ONLY inspect and observe. No changes to the device are permitted.]"</ID>
+ <ID>MaxLineLength:ChatViewModel.kt$ChatViewModel$content = JsonPrimitive("Please summarize the following conversation history according to the system prompt instructions:\n\n$historyText")</ID>
+ <ID>MaxLineLength:ChatViewModel.kt$ChatViewModel$content = JsonPrimitive("You are an advanced context compaction agent. Your task is to compress the preceding conversation history into a highly dense, structured continuation summary. You must preserve critical context, decisions, and codebase states while eliminating conversational filler and repetitive tool logs.\n\nGenerate a structured summary containing exactly the following sections:\n1. **Goal**: What is the ultimate objective of this engineering session?\n2. **Instructions &amp; Constraints**: What specific guidelines, patterns, user preferences, or technical limitations have been established?\n3. **Discoveries &amp; Architecture**: What have we learned about the codebase? Detail any symbol mappings, logic structures, or debugging conclusions.\n4. **Accomplished**: What changes have already been completely implemented, verified, or fixed?\n5. **Relevant Files**: Which files are currently being modified or are active in the workspace?\n\nCRITICAL: Do not lose technical specifics, user-stated constraints, or deep investigation states.\n\nContinue if you have next steps, or stop and ask for clarification if you are unsure how to proceed.")</ID>
+ <ID>MaxLineLength:ChatViewModel.kt$ChatViewModel$return listOf(ChatMessage(role = "user", content = JsonPrimitive("[System Note: Conversation context restored from previous turn]"))) + trimmed</ID>
+ <ID>MaxLineLength:ChatViewModel.kt$ChatViewModel$val description = "Request to uninstall \"$label\". After you approve, a system dialog will open — you must tap \"OK\" in that dialog to complete the removal. This action is irreversible."</ID>
+ <ID>MaxLineLength:ContactsTool.kt$ContactsTool$.</ID>
+ <ID>MaxLineLength:DeviceTool.kt$DeviceTool$"Do Not Disturb control needs notification-policy access. I have opened that settings page — please enable it and ask again."</ID>
+ <ID>MaxLineLength:FileResolver.kt$FileResolver$fun isArchiveMime(mime: String): Boolean</ID>
+ <ID>MaxLineLength:FileResolver.kt$FileResolver$if (bytes.size &gt;= 28 &amp;&amp; startsWith(bytes.copyOfRange(0,5), byteArrayOf(0x52,0x61,0x72,0x21,0x1A))) return "application/x-rar-compressed"</ID>
+ <ID>MaxLineLength:FileResolver.kt$FileResolver$if (bytes.size &gt;= 3 &amp;&amp; startsWith(bytes.copyOfRange(0,3), byteArrayOf(0x1F.toByte(), 0x8B.toByte(), 0x08.toByte()))) return "application/gzip"</ID>
+ <ID>MaxLineLength:FileResolver.kt$FileResolver$if (bytes.size &gt;= 4 &amp;&amp; bytes[0] == 0x4D.toByte() &amp;&amp; bytes[1] == 0x54.toByte() &amp;&amp; bytes[2] == 0x68.toByte() &amp;&amp; bytes[3] == 0x64.toByte()) return "audio/midi"</ID>
+ <ID>MaxLineLength:FileResolver.kt$FileResolver$if (bytes.size &gt;= 5 &amp;&amp; bytes[0] == 0x25.toByte() &amp;&amp; bytes[1] == 0x50.toByte() &amp;&amp; bytes[2] == 0x44.toByte() &amp;&amp; bytes[3] == 0x46.toByte() &amp;&amp; bytes[4] == 0x2D.toByte()) return "application/pdf"</ID>
+ <ID>MaxLineLength:FileResolver.kt$FileResolver$if (bytes.size &gt;= 8 &amp;&amp; bytes[0] == 0x89.toByte() &amp;&amp; bytes[1] == 0x50.toByte() &amp;&amp; bytes[2] == 0x4E.toByte() &amp;&amp; bytes[3] == 0x47.toByte()) return "image/png"</ID>
+ <ID>MaxLineLength:FileTool.kt$FileTool$ToolResult.ok("${if (append) "Appended" else "Wrote"} ${resolver.formatSize(bytes.size.toLong())} to '$originalPath' (resolved: ${file.canonicalPath}).")</ID>
+ <ID>MaxLineLength:FileTool.kt$FileTool$ToolResult.ok("Wrote ${resolver.formatSize(bytes.size.toLong())} binary data to '$originalPath' (resolved: ${file.canonicalPath}).")</ID>
+ <ID>MaxLineLength:FileTool.kt$FileTool$sb.appendLine("Archive: ${file.name} (${resolver.formatSize(file.length())}, ${entries.size} entries, ${resolver.formatSize(totalSize)} uncompressed)")</ID>
+ <ID>MaxLineLength:StorageTool.kt$StorageTool$append("\nExternal / SD card: ${format(external.used)} used of ${format(external.total)} total, ${format(external.free)} free")</ID>
+ <ID>MaxLineLength:ToolDefinitions.kt$ToolDefinitions$put("description", "Calendar account name to add the event to (e.g. 'Work', 'Personal'). Defaults to the primary writable calendar.")</ID>
+ <ID>MaxLineLength:ToolDefinitions.kt$ToolDefinitions$put("description", "Predefined pattern: short (100ms), long (1s), double (two quick buzzes), sos (...---...). Overrides duration_ms.")</ID>
+ <ID>MaxLineLength:ToolDefinitions.kt$ToolDefinitions$put("description", "Recording quality: 'low' (16kHz, 16kbps), 'medium' (44.1kHz, 64kbps), or 'high' (44.1kHz, 192kbps). Default medium.")</ID>
+ <ID>MaxLineLength:ToolDefinitions.kt$ToolDefinitions$put("description", "Schedule future delivery: ISO-8601 timestamp like '2026-01-15T14:30:00' or epoch millis. Omit for immediate send.")</ID>
+ <ID>MaxLineLength:ToolDefinitions.kt$ToolDefinitions$put("description", "Which stream to read: media, ring, alarm, notification, call. If omitted, all streams are reported.")</ID>
+ <ID>MaxLineLength:ToolDefinitions.kt$ToolDefinitions$putJsonObject("status") { put("type", "string"); put("description", "One of: pending, in_progress, completed, cancelled.") }</ID>
+ <ID>MaxLineLength:WebFetchTool.kt$WebFetchTool$"Fetched ${trimmed} (${rawSizeKb} KB raw → ${finalOutput.length / 1024} KB ${outputFormat}, HTTP ${response.code}):\n\n$finalOutput"</ID>
+ <ID>MaxLineLength:WebFetchTool.kt$WebFetchTool$.</ID>
+ <ID>MaxLineLength:WebSearchTool.kt$WebSearchTool$.</ID>
+ <ID>MaximumLineLength:AlarmTool.kt$AlarmTool$ </ID>
+ <ID>MaximumLineLength:AppsTool.kt$AppsTool$ </ID>
+ <ID>MaximumLineLength:AudioModels.kt$AudioModel.Companion$ </ID>
+ <ID>MaximumLineLength:ChatViewModel.kt$ChatViewModel$ </ID>
+ <ID>MaximumLineLength:ContactsTool.kt$ContactsTool$ </ID>
+ <ID>MaximumLineLength:DeviceTool.kt$DeviceTool$ </ID>
+ <ID>MaximumLineLength:FileResolver.kt$FileResolver$ </ID>
+ <ID>MaximumLineLength:FileTool.kt$FileTool$ </ID>
+ <ID>MaximumLineLength:StorageTool.kt$StorageTool$ </ID>
+ <ID>MaximumLineLength:ToolDefinitions.kt$ToolDefinitions$ </ID>
+ <ID>MaximumLineLength:WebFetchTool.kt$WebFetchTool$ </ID>
+ <ID>MaximumLineLength:WebSearchTool.kt$WebSearchTool$ </ID>
+ <ID>MultiLineIfElse:AccessibilityTool.kt$AccessibilityTool$ToolResult.error( "Unknown or unsupported global action '$action'. " + "Use back, home, recents, notifications, quick_settings, or lock_screen." )</ID>
+ <ID>MultiLineIfElse:AccessibilityTool.kt$AccessibilityTool$ToolResult.error("Could not dispatch the swipe gesture.")</ID>
+ <ID>MultiLineIfElse:AccessibilityTool.kt$AccessibilityTool$ToolResult.error("Could not dispatch the tap gesture.")</ID>
+ <ID>MultiLineIfElse:AccessibilityTool.kt$AccessibilityTool$ToolResult.error("Found no clickable element matching \"$text\" on screen.")</ID>
+ <ID>MultiLineIfElse:AccessibilityTool.kt$AccessibilityTool$ToolResult.error("No editable field is focused. Tap a text field first, then input text.")</ID>
+ <ID>MultiLineIfElse:AccessibilityTool.kt$AccessibilityTool$ToolResult.ok("Performed global action: $action.")</ID>
+ <ID>MultiLineIfElse:AccessibilityTool.kt$AccessibilityTool$ToolResult.ok("Swiped $direction.")</ID>
+ <ID>MultiLineIfElse:AccessibilityTool.kt$AccessibilityTool$ToolResult.ok("Swiped from ($x1, $y1) to ($x2, $y2).")</ID>
+ <ID>MultiLineIfElse:AccessibilityTool.kt$AccessibilityTool$ToolResult.ok("Tapped an element matching \"$text\".")</ID>
+ <ID>MultiLineIfElse:AccessibilityTool.kt$AccessibilityTool$ToolResult.ok("Tapped at ($x, $y).")</ID>
+ <ID>MultiLineIfElse:AccessibilityTool.kt$AccessibilityTool$ToolResult.ok("Typed \"$text\" into the focused field.")</ID>
+ <ID>MultiLineIfElse:AlarmTool.kt$AlarmTool$"once"</ID>
+ <ID>MultiLineIfElse:AssistiveBallOverlay.kt$AssistiveBallOverlay$@Suppress("DEPRECATION") WindowManager.LayoutParams.TYPE_PHONE</ID>
+ <ID>MultiLineIfElse:AssistiveBallOverlay.kt$AssistiveBallOverlay$WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY</ID>
+ <ID>MultiLineIfElse:AssistiveBallService.kt$AssistiveBallService$null</ID>
+ <ID>MultiLineIfElse:AudioApi.kt$AudioApi$emptyList()</ID>
+ <ID>MultiLineIfElse:CalendarTool.kt$CalendarTool$ToolResult.ok("Events $rangeDesc ($count):\n$out")</ID>
+ <ID>MultiLineIfElse:CalendarTool.kt$CalendarTool$now</ID>
+ <ID>MultiLineIfElse:CalendarTool.kt$CalendarTool$null ?: defaultWritableCalendarId() ?: return ToolResult.error("No writable calendar was found on this device.")</ID>
+ <ID>MultiLineIfElse:CalendarTool.kt$CalendarTool$parseWhen(end) ?: return ToolResult.error("Could not understand the end time '$end'.")</ID>
+ <ID>MultiLineIfElse:CalendarTool.kt$CalendarTool$rangeStart + 86400000L</ID>
+ <ID>MultiLineIfElse:CalendarTool.kt$CalendarTool$startMs + 60 * 60 * 1000</ID>
+ <ID>MultiLineIfElse:ChatViewModel.kt$ChatViewModel$""</ID>
+ <ID>MultiLineIfElse:ChatViewModel.kt$ChatViewModel$bitmap.width to bitmap.height</ID>
+ <ID>MultiLineIfElse:ChatViewModel.kt$ChatViewModel$null</ID>
+ <ID>MultiLineIfElse:ContactsTool.kt$ContactsTool$null</ID>
+ <ID>MultiLineIfElse:DeviceAdminTool.kt$DeviceAdminTool$"The current password does NOT meet the policy — the user will be prompted to update it."</ID>
+ <ID>MultiLineIfElse:DeviceAdminTool.kt$DeviceAdminTool$"The current password meets the policy."</ID>
+ <ID>MultiLineIfElse:DeviceTool.kt$DeviceTool$NotificationManager.INTERRUPTION_FILTER_ALL</ID>
+ <ID>MultiLineIfElse:DeviceTool.kt$DeviceTool$NotificationManager.INTERRUPTION_FILTER_PRIORITY</ID>
+ <ID>MultiLineIfElse:DeviceTool.kt$DeviceTool$VibrationEffect.createOneShot(ms, VibrationEffect.DEFAULT_AMPLITUDE)</ID>
+ <ID>MultiLineIfElse:DeviceTool.kt$DeviceTool$VibrationEffect.createOneShot(ms, amplitude)</ID>
+ <ID>MultiLineIfElse:DeviceTool.kt$DeviceTool$listOf("media", "ring", "alarm", "notification", "call")</ID>
+ <ID>MultiLineIfElse:DeviceTool.kt$DeviceTool$listOf(stream.lowercase().trim())</ID>
+ <ID>MultiLineIfElse:EditTool.kt$EditTool$content.replace(oldString, newString)</ID>
+ <ID>MultiLineIfElse:EditTool.kt$EditTool$content.replaceFirst(oldString, newString)</ID>
+ <ID>MultiLineIfElse:EditTool.kt$EditTool$content.split(oldString).size - 1</ID>
+ <ID>MultiLineIfElse:FileResolver.kt$FileResolver$ResolveResult.Ok(File(canonical))</ID>
+ <ID>MultiLineIfElse:FileResolver.kt$FileResolver$ResolveResult.PermissionNeeded( ToolResult.permissionNeeded( android.Manifest.permission.READ_EXTERNAL_STORAGE, READ_STORAGE_GUIDE ) )</ID>
+ <ID>MultiLineIfElse:FileResolver.kt$FileResolver$ResolveResult.PermissionNeeded( ToolResult.permissionNeeded( android.Manifest.permission.WRITE_EXTERNAL_STORAGE, WRITE_STORAGE_GUIDE ) )</ID>
+ <ID>MultiLineIfElse:FileResolver.kt$FileResolver$ResolveResult.PermissionNeeded( ToolResult.permissionNeeded(ToolResult.ALL_FILES_ACCESS, ALL_FILES_ACCESS_GUIDE) )</ID>
+ <ID>MultiLineIfElse:FileResolver.kt$FileResolver$return "image/webp"</ID>
+ <ID>MultiLineIfElse:FileResolver.kt$FileResolver$return ToolResult.permissionNeeded(ToolResult.ALL_FILES_ACCESS, ALL_FILES_ACCESS_GUIDE)</ID>
+ <ID>MultiLineIfElse:FileTool.kt$FileTool$" Did you mean one of: ${matching.joinToString(", ")}?"</ID>
+ <ID>MultiLineIfElse:FileTool.kt$FileTool$""</ID>
+ <ID>MultiLineIfElse:FileTool.kt$FileTool$ToolResult.ok( "Office document detected (${file.name}). It is a ZIP archive containing:\n" + list.message + "\nUse read_file on a specific entry, e.g. '${originalPath}/word/document.xml' for .docx." )</ID>
+ <ID>MultiLineIfElse:FileTool.kt$FileTool$line</ID>
+ <ID>MultiLineIfElse:FileTool.kt$FileTool$line.take(MAX_LINE_LENGTH) + "…(line truncated)"</ID>
+ <ID>MultiLineIfElse:FileTool.kt$FileTool$list</ID>
+ <ID>MultiLineIfElse:FileTool.kt$FileTool$return ToolResult.error("File '${file.name}' could not be decoded as an image.")</ID>
+ <ID>MultiLineIfElse:FileTool.kt$FileTool$return ToolResult.error("File '${file.name}' is not a recognized image format.")</ID>
+ <ID>MultiLineIfElse:GlobTool.kt$GlobTool$walk(root, 0)</ID>
+ <ID>MultiLineIfElse:GrepTool.kt$GrepTool$""</ID>
+ <ID>MultiLineIfElse:GrepTool.kt$GrepTool$walk(root, 0)</ID>
+ <ID>MultiLineIfElse:GotchaAccessibilityService.kt$GotchaAccessibilityService$out.add(text)</ID>
+ <ID>MultiLineIfElse:MainActivity.kt$MainActivity$"Permission denied."</ID>
+ <ID>MultiLineIfElse:MainActivity.kt$MainActivity$"Permission granted."</ID>
+ <ID>MultiLineIfElse:MainActivity.kt$MainActivity$Intent( AndroidSettings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION, Uri.parse("package:$packageName") )</ID>
+ <ID>MultiLineIfElse:MainActivity.kt$MainActivity$Intent(AndroidSettings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:$packageName"))</ID>
+ <ID>MultiLineIfElse:MediaCaptureTool.kt$MediaCaptureTool$File(FileResolver.WORKING_DIR_BASE, outputPath).absolutePath</ID>
+ <ID>MultiLineIfElse:MediaCaptureTool.kt$MediaCaptureTool$outputPath</ID>
+ <ID>MultiLineIfElse:MessageBubble.kt$Modifier.combinedClickable( onClick = { expanded.value = !expanded.value }, onLongClick = { showMenu = true } )</ID>
+ <ID>MultiLineIfElse:MessageBubble.kt$Modifier.combinedClickable( onClick = { }, onLongClick = { showMenu = true } )</ID>
+ <ID>MultiLineIfElse:OverlayTool.kt$OverlayTool$"Showing a persistent overlay: \"$text\". Call hide_overlay to remove it."</ID>
+ <ID>MultiLineIfElse:OverlayTool.kt$OverlayTool$"Showing an overlay for ${duration / 1000}s: \"$text\"."</ID>
+ <ID>MultiLineIfElse:PermissionItems.kt$Environment.isExternalStorageManager()</ID>
+ <ID>MultiLineIfElse:PermissionItems.kt$android.Manifest.permission.READ_EXTERNAL_STORAGE</ID>
+ <ID>MultiLineIfElse:PermissionItems.kt$android.Manifest.permission.READ_MEDIA_IMAGES</ID>
+ <ID>MultiLineIfElse:PermissionItems.kt$checkPerm(c, android.Manifest.permission.READ_EXTERNAL_STORAGE)</ID>
+ <ID>MultiLineIfElse:PermissionItems.kt$checkPerm(c, android.Manifest.permission.WRITE_EXTERNAL_STORAGE)</ID>
+ <ID>MultiLineIfElse:PermissionItems.kt$false</ID>
+ <ID>MultiLineIfElse:PermissionItems.kt$true</ID>
+ <ID>MultiLineIfElse:PermissionsSection.kt$Intent(AndroidSettings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:$packageName"))</ID>
+ <ID>MultiLineIfElse:PermissionsSection.kt$Intent(AndroidSettings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION, Uri.parse("package:$packageName"))</ID>
+ <ID>MultiLineIfElse:PhoneTool.kt$PhoneTool$ToolResult.ok("Last $count call(s):\n$entries")</ID>
+ <ID>MultiLineIfElse:PhoneTool.kt$PhoneTool$ToolResult.ok("The call log is empty.")</ID>
+ <ID>MultiLineIfElse:PhoneTool.kt$PhoneTool$null</ID>
+ <ID>MultiLineIfElse:QuickAskEngine.kt$QuickAskEngine$""</ID>
+ <ID>MultiLineIfElse:QuickAskEngine.kt$QuickAskEngine$SYSTEM_PROMPT</ID>
+ <ID>MultiLineIfElse:QuickAskEngine.kt$QuickAskEngine$bitmap.width to bitmap.height</ID>
+ <ID>MultiLineIfElse:SessionsScreen.kt$"Turn off assistive ball"</ID>
+ <ID>MultiLineIfElse:SessionsScreen.kt$"Turn on assistive ball"</ID>
+ <ID>MultiLineIfElse:SessionsScreen.kt$MaterialTheme.colorScheme.onSurfaceVariant</ID>
+ <ID>MultiLineIfElse:SessionsScreen.kt$MaterialTheme.colorScheme.primary</ID>
+ <ID>MultiLineIfElse:SettingsScreen.kt$PasswordVisualTransformation()</ID>
+ <ID>MultiLineIfElse:SettingsScreen.kt$VisualTransformation.None</ID>
+ <ID>MultiLineIfElse:SmsTool.kt$SmsTool$null</ID>
+ <ID>MultiLineIfElse:SmsTool.kt$SmsTool$return null</ID>
+ <ID>MultiLineIfElse:TtsEngine.kt$TtsEngine$bytes</ID>
+ <ID>MultiLineIfElse:VpnTool.kt$VpnTool$"The network firewall is OFF — traffic flows normally."</ID>
+ <ID>MultiLineIfElse:VpnTool.kt$VpnTool$"The network firewall is ON — all traffic is blocked."</ID>
+ <ID>MultiLineIfElse:WebFetchTool.kt$WebFetchTool$"text/html"</ID>
+ <ID>MultiLineIfElse:WebFetchTool.kt$WebFetchTool$output</ID>
+ <ID>NestedBlockDepth:AlarmTool.kt$AlarmTool$fun listAlarms(): ToolResult</ID>
+ <ID>NestedBlockDepth:CalendarTool.kt$CalendarTool$fun editEvent( eventId: Long, title: String? = null, start: String? = null, end: String? = null, location: String? = null, description: String? = null, allDay: Boolean? = null, reminderMinutes: Int? = null ): ToolResult</ID>
+ <ID>NestedBlockDepth:CalendarTool.kt$CalendarTool$fun listEvents( daysAhead: Int? = null, fromDate: String? = null, toDate: String? = null, search: String? = null ): ToolResult</ID>
+ <ID>NestedBlockDepth:ContactsTool.kt$ContactsTool$fun findContact(name: String? = null, number: String? = null): ToolResult</ID>
+ <ID>NestedBlockDepth:ContactsTool.kt$ContactsTool$private fun resolveEmail(number: String): List&lt;String&gt;</ID>
+ <ID>NestedBlockDepth:ContactsTool.kt$ContactsTool$private fun resolveOrganization(number: String): String?</ID>
+ <ID>NestedBlockDepth:FileTool.kt$FileTool$private fun listArchiveContents(file: File): ToolResult</ID>
+ <ID>NestedBlockDepth:GlobTool.kt$GlobTool$private fun globToRegex(glob: String): Regex</ID>
+ <ID>NestedBlockDepth:GrepTool.kt$GrepTool$fun grep(path: String, pattern: String, include: String?): ToolResult</ID>
+ <ID>NestedBlockDepth:MediaCaptureTool.kt$MediaCaptureTool$fun stopAudioRecording(): ToolResult</ID>
+ <ID>NestedBlockDepth:PhoneTool.kt$PhoneTool$fun callNumber(number: String, speakerphone: Boolean? = null, simSlot: String? = null): ToolResult</ID>
+ <ID>NestedBlockDepth:PhoneTool.kt$PhoneTool$fun readCallLog( limit: Int, callTypeFilter: String? = null, contact: String? = null, fromDate: String? = null, toDate: String? = null ): ToolResult</ID>
+ <ID>NestedBlockDepth:SmsTool.kt$SmsTool$fun readRecentSms( limit: Int, fromAddress: String? = null, fromDate: String? = null, toDate: String? = null, unreadOnly: Boolean? = null, search: String? = null, includeSent: Boolean? = null ): ToolResult</ID>
+ <ID>NestedBlockDepth:SmsTool.kt$SmsTool$fun sendSms( number: String, message: String, deliveryReport: Boolean? = null, sendAt: String? = null ): ToolResult</ID>
+ <ID>NestedBlockDepth:SmsTool.kt$SmsTool$private fun parseSendAt(sendAt: String): Long?</ID>
+ <ID>NestedBlockDepth:TerminalTool.kt$TerminalTool$private fun drain( read: (CharArray, Int, Int) -&gt; Int, into: StringBuilder )</ID>
+ <ID>NestedBlockDepth:WebSearchTool.kt$WebSearchTool$fun search(query: String, numResults: Int): ToolResult</ID>
+ <ID>NoMultipleSpaces:RootTool.kt$RootTool$ </ID>
+ <ID>NoTrailingSpaces:AssistiveBallService.kt$AssistiveBallService$ </ID>
+ <ID>NoTrailingSpaces:ChatHistoryRepository.kt$ChatHistoryRepository$ </ID>
+ <ID>NoTrailingSpaces:ChatViewModel.kt$ChatViewModel$ </ID>
+ <ID>NoTrailingSpaces:MainActivity.kt$MainActivity$ </ID>
+ <ID>NoUnusedImports:AlarmTool.kt$com.gotcha.tools.AlarmTool.kt</ID>
+ <ID>NoUnusedImports:AppsTool.kt$com.gotcha.tools.AppsTool.kt</ID>
+ <ID>NoUnusedImports:ChatHistoryRepository.kt$com.gotcha.data.ChatHistoryRepository.kt</ID>
+ <ID>NoUnusedImports:ChatScreen.kt$com.gotcha.ui.ChatScreen.kt</ID>
+ <ID>NoUnusedImports:ChatViewModel.kt$com.gotcha.agent.ChatViewModel.kt</ID>
+ <ID>NoUnusedImports:EditTool.kt$com.gotcha.tools.EditTool.kt</ID>
+ <ID>NoUnusedImports:FileTool.kt$com.gotcha.tools.FileTool.kt</ID>
+ <ID>NoUnusedImports:MainActivity.kt$com.gotcha.MainActivity.kt</ID>
+ <ID>NoUnusedImports:MessageBubble.kt$com.gotcha.ui.MessageBubble.kt</ID>
+ <ID>NoUnusedImports:Models.kt$com.gotcha.llm.Models.kt</ID>
+ <ID>NoUnusedImports:PermissionItems.kt$com.gotcha.ui.PermissionItems.kt</ID>
+ <ID>NoUnusedImports:SmsTool.kt$com.gotcha.tools.SmsTool.kt</ID>
+ <ID>NoUnusedImports:TtsEngine.kt$com.gotcha.audio.TtsEngine.kt</ID>
+ <ID>NoWildcardImports:SessionsScreen.kt$import androidx.compose.foundation.layout.*</ID>
+ <ID>NoWildcardImports:SessionsScreen.kt$import androidx.compose.material3.*</ID>
+ <ID>NoWildcardImports:SessionsScreen.kt$import androidx.compose.runtime.*</ID>
+ <ID>ParameterListWrapping:AlarmTool.kt$AlarmTool.AlarmRecord$( val id: Long, val hour: Int, val minute: Int, val days: List&lt;Int&gt;, val label: String?, val vibrate: Boolean, val system: Boolean = false, val triggerAt: Long? = null )</ID>
+ <ID>ParameterListWrapping:AlarmTool.kt$AlarmTool.TimerRecord$( val id: Long, val seconds: Int, val label: String?, val triggerAt: Long = System.currentTimeMillis() + seconds * 1000L )</ID>
+ <ID>ParameterListWrapping:AudioApi.kt$AudioApi$( boundary: String, file: File, fieldName: String, contentType: String, extraFields: Map&lt;String, String&gt; )</ID>
+ <ID>ParameterListWrapping:CalendarTool.kt$CalendarTool$(_: Exception)</ID>
+ <ID>ParameterListWrapping:FileResolver.kt$FileResolver$(mime: String)</ID>
+ <ID>ParameterListWrapping:PhoneTool.kt$PhoneTool$(_: Exception)</ID>
+ <ID>ParameterListWrapping:SettingsScreen.kt$(Settings)</ID>
+ <ID>ParameterListWrapping:SmsTool.kt$SmsTool$(_: Exception)</ID>
+ <ID>PropertyWrapping:AlarmTool.kt$AlarmTool$val daysArr = buildJsonArray { a.days.forEach { d -&gt; add(kotlinx.serialization.json.JsonPrimitive(d)) } }</ID>
+ <ID>ReturnCount:AlarmTool.kt$AlarmTool$fun editAlarm(id: Long, hour: Int? = null, minute: Int? = null, message: String? = null, days: List&lt;String&gt;? = null, vibrate: Boolean? = null): ToolResult</ID>
+ <ID>ReturnCount:AlarmTool.kt$AlarmTool$fun setAlarm(hour: Int, minute: Int, message: String? = null, days: List&lt;String&gt;? = null, vibrate: Boolean? = null): ToolResult</ID>
+ <ID>ReturnCount:CalendarTool.kt$CalendarTool$fun createEvent( title: String, start: String, end: String? = null, location: String? = null, description: String? = null, allDay: Boolean? = null, reminderMinutes: Int? = null, calendarName: String? = null ): ToolResult</ID>
+ <ID>ReturnCount:CalendarTool.kt$CalendarTool$fun editEvent( eventId: Long, title: String? = null, start: String? = null, end: String? = null, location: String? = null, description: String? = null, allDay: Boolean? = null, reminderMinutes: Int? = null ): ToolResult</ID>
+ <ID>ReturnCount:ContactsTool.kt$ContactsTool$fun addContact( name: String, number: String, phoneType: String? = null, email: String? = null, organization: String? = null ): ToolResult</ID>
+ <ID>ReturnCount:ContactsTool.kt$ContactsTool$fun findContact(name: String? = null, number: String? = null): ToolResult</ID>
+ <ID>ReturnCount:EditTool.kt$EditTool$fun edit(path: String, oldString: String, newString: String, replaceAll: Boolean): ToolResult</ID>
+ <ID>ReturnCount:FileResolver.kt$FileResolver$fun detectMime(bytes: ByteArray): String?</ID>
+ <ID>ReturnCount:FileTool.kt$FileTool$private fun listResolved( file: File, originalPath: String, sortBy: String?, include: String?, exclude: String?, recursive: Boolean, maxDepth: Int? ): ToolResult</ID>
+ <ID>ReturnCount:FileTool.kt$FileTool$private fun readResolved( file: File, originalPath: String, offset: Int?, limit: Int?, encoding: String? ): ToolResult</ID>
+ <ID>ReturnCount:FileTool.kt$FileTool$private fun readUnknownFile(file: File, encoding: String?): ToolResult</ID>
+ <ID>ReturnCount:FileTool.kt$FileTool$private fun readZipEntry(zf: ZipFile, archiveFile: File, archivePath: String, entryPath: String): ToolResult</ID>
+ <ID>ReturnCount:GlobTool.kt$GlobTool$fun glob(path: String, pattern: String): ToolResult</ID>
+ <ID>ReturnCount:GrepTool.kt$GrepTool$fun grep(path: String, pattern: String, include: String?): ToolResult</ID>
+ <ID>ReturnCount:GrepTool.kt$GrepTool$fun walk(dir: File, depth: Int)</ID>
+ <ID>ReturnCount:LLMCache.kt$LLMCache$@Synchronized fun get(key: String): ChatResponse?</ID>
+ <ID>ReturnCount:RootTool.kt$RootTool$fun writeSecureSetting(namespace: String, key: String, value: String): ToolResult</ID>
+ <ID>ReturnCount:SmsTool.kt$SmsTool$fun sendSms( number: String, message: String, deliveryReport: Boolean? = null, sendAt: String? = null ): ToolResult</ID>
+ <ID>ReturnCount:ToolExecutor.kt$ToolExecutor$private suspend fun dispatch(name: String, args: JsonObject): ToolResult</ID>
+ <ID>ReturnCount:WebFetchTool.kt$WebFetchTool$fun fetch(url: String, format: String?): ToolResult</ID>
+ <ID>ReturnCount:WebSearchTool.kt$WebSearchTool$fun search(query: String, numResults: Int): ToolResult</ID>
+ <ID>SpacingAroundComma:FileResolver.kt$FileResolver$,</ID>
+ <ID>SpacingBetweenDeclarationsWithAnnotations:AppsTool.kt$AppsTool$@Suppress("DEPRECATION") val mobile = nsm.querySummaryForDevice(ConnectivityManager.TYPE_MOBILE, null, start, end)</ID>
+ <ID>SpacingBetweenDeclarationsWithAnnotations:AppsTool.kt$AppsTool$@Suppress("DEPRECATION") val wifi = nsm.querySummaryForDevice(ConnectivityManager.TYPE_WIFI, null, start, end)</ID>
+ <ID>SpacingBetweenDeclarationsWithAnnotations:AssistiveBallService.kt$AssistiveBallService$@Volatile private var listening = false</ID>
+ <ID>SpacingBetweenDeclarationsWithAnnotations:ChatViewModel.kt$ChatViewModel$/** True when the most recent user message was sent via voice (STT). */ @Volatile private var lastInputWasVoice = false</ID>
+ <ID>SpacingBetweenDeclarationsWithComments:AssistiveBallService.kt$AssistiveBallService.Companion$/** Live running state of the ball, so UI toggles can track "Hide ball" too. */</ID>
+ <ID>SpacingBetweenDeclarationsWithComments:ChatViewModel.kt$ChatViewModel$/** True when the most recent user message was sent via voice (STT). */</ID>
+ <ID>SpacingBetweenDeclarationsWithComments:SttEngine.kt$SttEngine$// Android STT state</ID>
+ <ID>SpacingBetweenDeclarationsWithComments:ToolExecutor.kt$ToolExecutor$// Tier 3 tools</ID>
+ <ID>SpacingBetweenDeclarationsWithComments:ToolExecutor.kt$ToolExecutor$// Tier 4 tools</ID>
+ <ID>StringTemplate:DeviceTool.kt$DeviceTool$${pct}</ID>
+ <ID>StringTemplate:DeviceTool.kt$DeviceTool$${percent}</ID>
+ <ID>StringTemplate:DeviceTool.kt$DeviceTool$${previousPct}</ID>
+ <ID>StringTemplate:FileTool.kt$FileTool$${originalPath}</ID>
+ <ID>StringTemplate:StorageTool.kt$StorageTool$${pct}</ID>
+ <ID>StringTemplate:WebFetchTool.kt$WebFetchTool$${outputFormat}</ID>
+ <ID>StringTemplate:WebFetchTool.kt$WebFetchTool$${rawSizeKb}</ID>
+ <ID>StringTemplate:WebFetchTool.kt$WebFetchTool$${trimmed}</ID>
+ <ID>SwallowedException:ChatHistoryRepository.kt$ChatHistoryRepository$e: Exception</ID>
+ <ID>SwallowedException:ChatViewModel.kt$ChatViewModel$e: CancellationException</ID>
+ <ID>SwallowedException:ChatViewModel.kt$ChatViewModel$e: Exception</ID>
+ <ID>SwallowedException:DeviceTool.kt$DeviceTool$e: SecurityException</ID>
+ <ID>SwallowedException:FileTool.kt$FileTool$e: java.nio.charset.UnsupportedCharsetException</ID>
+ <ID>SwallowedException:LLMCache.kt$LLMCache$e: Exception</ID>
+ <ID>SwallowedException:NotificationTool.kt$NotificationTool$e: SecurityException</ID>
+ <ID>SwallowedException:PhoneTool.kt$PhoneTool$e: SecurityException</ID>
+ <ID>SwallowedException:SmsTool.kt$SmsTool$e: SecurityException</ID>
+ <ID>SwallowedException:SystemTool.kt$SystemTool$e: SecurityException</ID>
+ <ID>SwallowedException:WebFetchTool.kt$WebFetchTool$e: java.net.SocketTimeoutException</ID>
+ <ID>SwallowedException:WebSearchTool.kt$WebSearchTool$e: java.net.SocketTimeoutException</ID>
+ <ID>TooManyFunctions:AlarmTool.kt$AlarmTool</ID>
+ <ID>TooManyFunctions:AssistiveBallOverlay.kt$AssistiveBallOverlay</ID>
+ <ID>TooManyFunctions:ChatViewModel.kt$ChatViewModel : AndroidViewModel</ID>
+ <ID>UnusedParameter:PermissionItems.kt$context: Context</ID>
+ <ID>UnusedParameter:WebSearchTool.kt$WebSearchTool$row: org.jsoup.nodes.Element</ID>
+ <ID>UnusedPrivateProperty:LLMClient.kt$LLMClient.Companion$private const val DEFAULT_MODEL = "gpt-4o"</ID>
+ <ID>UnusedPrivateProperty:MainActivity.kt$MainActivity$/** Used by the Settings screen to grant individual runtime permissions. */ private val permissionLauncher = registerForActivityResult(ActivityResultContracts.RequestPermission()) { granted -&gt; Toast.makeText( this, if (granted) "Permission granted." else "Permission denied.", Toast.LENGTH_SHORT ).show() }</ID>
+ <ID>UnusedPrivateProperty:WebSearchTool.kt$WebSearchTool$val urlEl = row.selectFirst(".result__url")</ID>
+ <ID>UseCheckOrError:QuickAskEngine.kt$QuickAskEngine$throw IllegalStateException("Not configured")</ID>
+ <ID>VariableNaming:AppsTool.kt$AppsTool$private val TAG = "Gotcha"</ID>
+ <ID>VariableNaming:ChatViewModel.kt$ChatViewModel$private val TAG = "Gotcha"</ID>
+ <ID>VariableNaming:FileResolver.kt$FileResolver$val IMAGE_DATA_PREFIX = "IMAGE_DATA:"</ID>
+ <ID>VariableNaming:MediaCaptureTool.kt$MediaCaptureTool$private val TAG = "Gotcha"</ID>
+ <ID>VariableNaming:ToolExecutor.kt$ToolExecutor$private val TAG = "Gotcha"</ID>
+ <ID>WildcardImport:SessionsScreen.kt$import androidx.compose.foundation.layout.*</ID>
+ <ID>WildcardImport:SessionsScreen.kt$import androidx.compose.material3.*</ID>
+ <ID>WildcardImport:SessionsScreen.kt$import androidx.compose.runtime.*</ID>
+ <ID>Wrapping:AlarmTool.kt$AlarmTool$(</ID>
+ <ID>Wrapping:AppsTool.kt$AppsTool$;</ID>
+ <ID>Wrapping:AssistiveBallOverlay.kt$AssistiveBallOverlay$(</ID>
+ <ID>Wrapping:AudioApi.kt$AudioApi$(</ID>
+ <ID>Wrapping:ChatScreen.kt$(</ID>
+ <ID>Wrapping:ChatViewModel.kt$ChatViewModel$it.copy(activity = null, pendingConfirmation = PendingConfirmation(listOf("delete_$kind"), description))</ID>
+ <ID>Wrapping:ChatViewModel.kt$ChatViewModel$it.copy(activity = null, pendingConfirmation = PendingConfirmation(listOf("uninstall_app"), description))</ID>
+ <ID>Wrapping:ContactsTool.kt$ContactsTool$(</ID>
+ <ID>Wrapping:EditTool.kt$EditTool$(</ID>
+ <ID>Wrapping:FileResolver.kt$FileResolver$(</ID>
+ <ID>Wrapping:FileTool.kt$FileTool$(</ID>
+ <ID>Wrapping:FileTool.kt$FileTool$;</ID>
+ <ID>Wrapping:GlobTool.kt$GlobTool$(</ID>
+ <ID>Wrapping:GlobTool.kt$GlobTool$;</ID>
+ <ID>Wrapping:GrepTool.kt$GrepTool$(</ID>
+ <ID>Wrapping:GrepTool.kt$GrepTool$;</ID>
+ <ID>Wrapping:GotchaVpnService.kt$GotchaVpnService$;</ID>
+ <ID>Wrapping:MainActivity.kt$MainActivity$(</ID>
+ <ID>Wrapping:MediaCaptureTool.kt$MediaCaptureTool$;</ID>
+ <ID>Wrapping:Models.kt$(</ID>
+ <ID>Wrapping:PermissionItems.kt$(</ID>
+ <ID>Wrapping:PermissionItems.kt$( "Storage Read", "Read files from shared storage", if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.TIRAMISU) android.Manifest.permission.READ_MEDIA_IMAGES else android.Manifest.permission.READ_EXTERNAL_STORAGE, null, { c -&gt; val perm = if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.TIRAMISU) android.Manifest.permission.READ_MEDIA_IMAGES else android.Manifest.permission.READ_EXTERNAL_STORAGE checkPerm(c, perm) } )</ID>
+ <ID>Wrapping:PermissionItems.kt$("Calendar", listOf( PermissionItem( "Calendar", "Read and create calendar events", android.Manifest.permission.READ_CALENDAR, null, { c -&gt; checkPerm(c, android.Manifest.permission.READ_CALENDAR) &amp;&amp; checkPerm(c, android.Manifest.permission.WRITE_CALENDAR) }, extraPermissions = listOf(android.Manifest.permission.WRITE_CALENDAR) ) ))</ID>
+ <ID>Wrapping:PermissionItems.kt$("Communications", listOf( PermissionItem( "Phone", "Place calls directly", android.Manifest.permission.CALL_PHONE, null, { c -&gt; checkPerm(c, android.Manifest.permission.CALL_PHONE) } ), PermissionItem( "SMS", "Send text messages", android.Manifest.permission.SEND_SMS, null, { c -&gt; checkPerm(c, android.Manifest.permission.SEND_SMS) } ), PermissionItem( "Read SMS", "Read inbox messages", android.Manifest.permission.READ_SMS, null, { c -&gt; checkPerm(c, android.Manifest.permission.READ_SMS) } ), PermissionItem( "Call Log", "Read recent call history", android.Manifest.permission.READ_CALL_LOG, null, { c -&gt; checkPerm(c, android.Manifest.permission.READ_CALL_LOG) } ) ))</ID>
+ <ID>Wrapping:PermissionItems.kt$("Contacts", listOf( PermissionItem( "Contacts", "Read and create contacts", android.Manifest.permission.READ_CONTACTS, null, { c -&gt; checkPerm(c, android.Manifest.permission.READ_CONTACTS) &amp;&amp; checkPerm(c, android.Manifest.permission.WRITE_CONTACTS) }, extraPermissions = listOf(android.Manifest.permission.WRITE_CONTACTS) ) ))</ID>
+ <ID>Wrapping:PermissionItems.kt$("Device Control", listOf( PermissionItem( "Write Settings", "Modify system settings (brightness)", null, "special:write_settings", { c -&gt; Settings.System.canWrite(c) } ), PermissionItem( "Do Not Disturb", "Silence/vibrate mode and DND", null, "special:dnd_access", { c -&gt; val nm = c.getSystemService(Context.NOTIFICATION_SERVICE) as? android.app.NotificationManager nm?.isNotificationPolicyAccessGranted ?: false } ), PermissionItem( "Usage Access", "Read app usage and data stats", null, "special:usage_access", { c -&gt; if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.KITKAT) { val appOps = c.getSystemService(Context.APP_OPS_SERVICE) as? AppOpsManager appOps?.checkOpNoThrow( AppOpsManager.OPSTR_GET_USAGE_STATS, android.os.Process.myUid(), c.packageName ) == AppOpsManager.MODE_ALLOWED } else true } ), PermissionItem( "Device Admin", "Lock screen, enforce password policy", null, "special:device_admin", { c -&gt; val dpm = c.getSystemService(Context.DEVICE_POLICY_SERVICE) as? DevicePolicyManager dpm?.isAdminActive(ComponentName(c, GotchaDeviceAdminReceiver::class.java)) ?: false } ) ))</ID>
+ <ID>Wrapping:PermissionItems.kt$("Location", listOf( PermissionItem( "Location", "Get device location", android.Manifest.permission.ACCESS_FINE_LOCATION, null, { c -&gt; checkPerm(c, android.Manifest.permission.ACCESS_FINE_LOCATION) } ) ))</ID>
+ <ID>Wrapping:PermissionItems.kt$("Media &amp; Storage", listOf( PermissionItem( "Camera", "Take photos", android.Manifest.permission.CAMERA, null, { c -&gt; checkPerm(c, android.Manifest.permission.CAMERA) } ), PermissionItem( "Microphone", "Record audio", android.Manifest.permission.RECORD_AUDIO, null, { c -&gt; checkPerm(c, android.Manifest.permission.RECORD_AUDIO) } ), PermissionItem( "Storage Read", "Read files from shared storage", if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.TIRAMISU) android.Manifest.permission.READ_MEDIA_IMAGES else android.Manifest.permission.READ_EXTERNAL_STORAGE, null, { c -&gt; val perm = if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.TIRAMISU) android.Manifest.permission.READ_MEDIA_IMAGES else android.Manifest.permission.READ_EXTERNAL_STORAGE checkPerm(c, perm) } ), PermissionItem( "Storage Write", "Write files to shared storage", android.Manifest.permission.WRITE_EXTERNAL_STORAGE, null, { c -&gt; if (Build.VERSION.SDK_INT &lt;= 29) checkPerm(c, android.Manifest.permission.WRITE_EXTERNAL_STORAGE) else true // API 30+ uses MANAGE_EXTERNAL_STORAGE } ), PermissionItem( "All Files Access", "Full access to all files on device", null, "special:all_files_access", { c -&gt; if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.R) Environment.isExternalStorageManager() else checkPerm(c, android.Manifest.permission.READ_EXTERNAL_STORAGE) } ) ))</ID>
+ <ID>Wrapping:PermissionItems.kt$("System Access", listOf( PermissionItem( "Accessibility", "Read screen, tap, swipe, type", null, "special:accessibility_access", { c -&gt; val expected = "${c.packageName}/com.gotcha.service.GotchaAccessibilityService" val enabled = Settings.Secure.getString( c.contentResolver, Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES ) ?: "" enabled.contains(expected, ignoreCase = true) } ), PermissionItem( "Notification Listener", "Read and dismiss notifications, media control", null, "special:notification_listener_access", { c -&gt; val expected = c.packageName val enabled = Settings.Secure.getString( c.contentResolver, "enabled_notification_listeners" ) ?: "" enabled.contains(expected, ignoreCase = true) } ), PermissionItem( "Display Over Apps", "Show floating overlays", null, "special:overlay_access", { c -&gt; Settings.canDrawOverlays(c) } ), PermissionItem( "VPN", "Block all network traffic (firewall kill-switch)", null, "special:vpn_consent", { c -&gt; try { val cm = c.getSystemService(Context.CONNECTIVITY_SERVICE) as? android.net.ConnectivityManager cm?.let { mgr -&gt; val network = mgr.activeNetwork if (network != null) { mgr.getNetworkCapabilities(network) ?.hasTransport(android.net.NetworkCapabilities.TRANSPORT_VPN) ?: false } else false } ?: false } catch (_: SecurityException) { false } } ) ))</ID>
+ <ID>Wrapping:SettingsScreen.kt$Pair(emptyList(), emptyList())</ID>
+ <ID>Wrapping:SmsTool.kt$SmsTool$(</ID>
+ <ID>Wrapping:SttEngine.kt$SttEngine$;</ID>
+ <ID>Wrapping:SystemTool.kt$SystemTool$(</ID>
+ <ID>Wrapping:TerminalTool.kt$TerminalTool$;</ID>
+ <ID>Wrapping:ToolDefinitions.kt$ToolDefinitions$;</ID>
+ <ID>Wrapping:ToolDefinitions.kt$ToolDefinitions$put("type", "string"); put("description", "One of: pending, in_progress, completed, cancelled.")</ID>
+ <ID>Wrapping:TtsEngine.kt$TtsEngine$(</ID>
+ <ID>Wrapping:WebFetchTool.kt$WebFetchTool$;</ID>
+ </CurrentIssues>
+</SmellBaseline>
diff --git a/app/lint-baseline.xml b/app/lint-baseline.xml
new file mode 100644
index 0000000..28496c3
--- /dev/null
+++ b/app/lint-baseline.xml
@@ -0,0 +1,1061 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<issues format="6" by="lint 8.13.2" type="baseline" client="gradle" dependencies="false" name="AGP (8.13.2)" variant="all" version="8.13.2">
+
+ <issue
+ id="MissingPermission"
+ message="Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with `checkPermission`) or explicitly handle a potential `SecurityException`"
+ errorLine1=" lm.requestSingleUpdate(provider, listener, Looper.getMainLooper())"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/tools/LocationTool.kt"
+ line="110"
+ column="9"/>
+ </issue>
+
+ <issue
+ id="MissingPermission"
+ message="Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with `checkPermission`) or explicitly handle a potential `SecurityException`"
+ errorLine1=" context.getSystemService(SubscriptionManager::class.java)?.activeSubscriptionInfoList"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/tools/PhoneTool.kt"
+ line="95"
+ column="17"/>
+ </issue>
+
+ <issue
+ id="MissingPermission"
+ message="Missing permissions required by SubscriptionManager.getActiveSubscriptionInfoList: android.permission.READ_PHONE_STATE"
+ errorLine1=" context.getSystemService(SubscriptionManager::class.java)?.activeSubscriptionInfoList"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/tools/PhoneTool.kt"
+ line="95"
+ column="17"/>
+ </issue>
+
+ <issue
+ id="MissingPermission"
+ message="Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with `checkPermission`) or explicitly handle a potential `SecurityException`"
+ errorLine1=" SubscriptionManager.from(context).activeSubscriptionInfoList"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/tools/PhoneTool.kt"
+ line="98"
+ column="17"/>
+ </issue>
+
+ <issue
+ id="MissingPermission"
+ message="Missing permissions required by SubscriptionManager.getActiveSubscriptionInfoList: android.permission.READ_PHONE_STATE"
+ errorLine1=" SubscriptionManager.from(context).activeSubscriptionInfoList"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/tools/PhoneTool.kt"
+ line="98"
+ column="17"/>
+ </issue>
+
+ <issue
+ id="InlinedApi"
+ message="Field requires API level 30 (current min is 29): `android.content.pm.ServiceInfo#FOREGROUND_SERVICE_TYPE_MICROPHONE`"
+ errorLine1=" ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/service/AssistiveBallService.kt"
+ line="271"
+ column="17"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="This Kotlin extension function will be hidden by `java.util.SequencedCollection` starting in API 35: `removeLast`. When this source code is recompiled against API level 35, it will crash on older levels. You can avoid this by using `removeAt(llmHistory.lastIndex)` instead."
+ errorLine1=" llmHistory.removeLast()"
+ errorLine2=" ~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/agent/ChatViewModel.kt"
+ line="437"
+ column="24"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level 33 (current min is 26): `java.io.InputStream#readNBytes`"
+ errorLine1=" val sample = try { file.inputStream().use { it.readNBytes(512) } } catch (_: Exception) { ByteArray(0) }"
+ errorLine2=" ~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/tools/FileTool.kt"
+ line="189"
+ column="56"/>
+ </issue>
+
+ <issue
+ id="OldTargetApi"
+ message="Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the `android.os.Build.VERSION_CODES` javadoc for details."
+ errorLine1=" targetSdk = 34"
+ errorLine2=" ~~~~~~~~~~~~~~">
+ <location
+ file="build.gradle.kts"
+ line="23"
+ column="9"/>
+ </issue>
+
+ <issue
+ id="UnusedAttribute"
+ message="Attribute `canTakeScreenshot` is only used in API level 30 and higher (current min is 26)"
+ errorLine1=" android:canTakeScreenshot=&quot;true&quot;"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/res/xml/accessibility_service_config.xml"
+ line="8"
+ column="5"/>
+ </issue>
+
+ <issue
+ id="QueryPermissionsNeeded"
+ message="As of Android 11, this method no longer returns information about all apps; see https://g.co/dev/packagevisibility for details"
+ errorLine1=" pm.getInstalledApplications(0).firstOrNull { app ->"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/tools/AppsTool.kt"
+ line="95"
+ column="16"/>
+ </issue>
+
+ <issue
+ id="QueryPermissionsNeeded"
+ message="As of Android 11, this method no longer returns information about all apps; see https://g.co/dev/packagevisibility for details"
+ errorLine1=" val match = pm.getInstalledApplications(0).firstOrNull {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/tools/SystemTool.kt"
+ line="137"
+ column="28"/>
+ </issue>
+
+ <issue
+ id="SelectedPhotoAccess"
+ message="Your app is currently not handling Selected Photos Access introduced in Android 14+"
+ errorLine1=" &lt;uses-permission android:name=&quot;android.permission.READ_MEDIA_IMAGES&quot; />"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/AndroidManifest.xml"
+ line="9"
+ column="36"/>
+ </issue>
+
+ <issue
+ id="GradleDependency"
+ message="A newer version of `compileSdkVersion` than 34 is available: 36"
+ errorLine1=" compileSdk = 34"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="build.gradle.kts"
+ line="18"
+ column="5"/>
+ </issue>
+
+ <issue
+ id="GradleDependency"
+ message="A newer version of androidx.core:core-ktx than 1.12.0 is available: 1.19.0"
+ errorLine1=" implementation(&quot;androidx.core:core-ktx:1.12.0&quot;)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="build.gradle.kts"
+ line="101"
+ column="20"/>
+ </issue>
+
+ <issue
+ id="GradleDependency"
+ message="A newer version of androidx.lifecycle:lifecycle-runtime-ktx than 2.7.0 is available: 2.11.0"
+ errorLine1=" implementation(&quot;androidx.lifecycle:lifecycle-runtime-ktx:2.7.0&quot;)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="build.gradle.kts"
+ line="102"
+ column="20"/>
+ </issue>
+
+ <issue
+ id="GradleDependency"
+ message="A newer version of androidx.activity:activity-compose than 1.8.2 is available: 1.13.0"
+ errorLine1=" implementation(&quot;androidx.activity:activity-compose:1.8.2&quot;)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="build.gradle.kts"
+ line="103"
+ column="20"/>
+ </issue>
+
+ <issue
+ id="GradleDependency"
+ message="A newer version of androidx.lifecycle:lifecycle-viewmodel-compose than 2.7.0 is available: 2.11.0"
+ errorLine1=" implementation(&quot;androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0&quot;)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="build.gradle.kts"
+ line="113"
+ column="20"/>
+ </issue>
+
+ <issue
+ id="GradleDependency"
+ message="A newer version of androidx.security:security-crypto than 1.1.0-alpha06 is available: 1.1.0"
+ errorLine1=" implementation(&quot;androidx.security:security-crypto:1.1.0-alpha06&quot;)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="build.gradle.kts"
+ line="124"
+ column="20"/>
+ </issue>
+
+ <issue
+ id="GradleDependency"
+ message="A newer version of androidx.camera:camera-core than 1.4.0 is available: 1.6.1"
+ errorLine1=" implementation(&quot;androidx.camera:camera-core:$cameraxVersion&quot;)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="build.gradle.kts"
+ line="135"
+ column="20"/>
+ </issue>
+
+ <issue
+ id="GradleDependency"
+ message="A newer version of androidx.camera:camera-camera2 than 1.4.0 is available: 1.6.1"
+ errorLine1=" implementation(&quot;androidx.camera:camera-camera2:$cameraxVersion&quot;)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="build.gradle.kts"
+ line="136"
+ column="20"/>
+ </issue>
+
+ <issue
+ id="GradleDependency"
+ message="A newer version of androidx.camera:camera-lifecycle than 1.4.0 is available: 1.6.1"
+ errorLine1=" implementation(&quot;androidx.camera:camera-lifecycle:$cameraxVersion&quot;)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="build.gradle.kts"
+ line="137"
+ column="20"/>
+ </issue>
+
+ <issue
+ id="GradleDependency"
+ message="A newer version of androidx.camera:camera-view than 1.4.0 is available: 1.6.1"
+ errorLine1=" implementation(&quot;androidx.camera:camera-view:$cameraxVersion&quot;)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="build.gradle.kts"
+ line="138"
+ column="20"/>
+ </issue>
+
+ <issue
+ id="NewerVersionAvailable"
+ message="A newer version of com.squareup.retrofit2:retrofit than 2.9.0 is available: 3.0.0"
+ errorLine1=" implementation(&quot;com.squareup.retrofit2:retrofit:2.9.0&quot;)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="build.gradle.kts"
+ line="116"
+ column="20"/>
+ </issue>
+
+ <issue
+ id="NewerVersionAvailable"
+ message="A newer version of com.squareup.okhttp3:logging-interceptor than 4.12.0 is available: 5.4.0"
+ errorLine1=" implementation(&quot;com.squareup.okhttp3:logging-interceptor:4.12.0&quot;)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="build.gradle.kts"
+ line="117"
+ column="20"/>
+ </issue>
+
+ <issue
+ id="NewerVersionAvailable"
+ message="A newer version of org.jetbrains.kotlinx:kotlinx-serialization-json than 1.6.2 is available: 1.11.0"
+ errorLine1=" implementation(&quot;org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.2&quot;)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="build.gradle.kts"
+ line="120"
+ column="20"/>
+ </issue>
+
+ <issue
+ id="NewerVersionAvailable"
+ message="A newer version of org.jsoup:jsoup than 1.17.2 is available: 1.22.2"
+ errorLine1=" implementation(&quot;org.jsoup:jsoup:1.17.2&quot;)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="build.gradle.kts"
+ line="127"
+ column="20"/>
+ </issue>
+
+ <issue
+ id="NewerVersionAvailable"
+ message="A newer version of com.halilibo.compose-richtext:richtext-ui-material3 than 0.17.0 is available: 0.20.0"
+ errorLine1=" implementation(&quot;com.halilibo.compose-richtext:richtext-ui-material3:0.17.0&quot;)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="build.gradle.kts"
+ line="130"
+ column="20"/>
+ </issue>
+
+ <issue
+ id="NewerVersionAvailable"
+ message="A newer version of com.halilibo.compose-richtext:richtext-commonmark than 0.17.0 is available: 0.20.0"
+ errorLine1=" implementation(&quot;com.halilibo.compose-richtext:richtext-commonmark:0.17.0&quot;)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="build.gradle.kts"
+ line="131"
+ column="20"/>
+ </issue>
+
+ <issue
+ id="NewerVersionAvailable"
+ message="A newer version of io.gitlab.arturbosch.detekt:detekt-formatting than 1.23.6 is available: 1.23.8"
+ errorLine1=" detektPlugins(&quot;io.gitlab.arturbosch.detekt:detekt-formatting:1.23.6&quot;)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="build.gradle.kts"
+ line="141"
+ column="19"/>
+ </issue>
+
+ <issue
+ id="NewerVersionAvailable"
+ message="A newer version of com.squareup.okhttp3:mockwebserver than 4.12.0 is available: 5.4.0"
+ errorLine1=" testImplementation(&quot;com.squareup.okhttp3:mockwebserver:4.12.0&quot;)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="build.gradle.kts"
+ line="149"
+ column="24"/>
+ </issue>
+
+ <issue
+ id="NewerVersionAvailable"
+ message="A newer version of org.jetbrains.kotlinx:kotlinx-coroutines-test than 1.7.3 is available: 1.11.0"
+ errorLine1=" testImplementation(&quot;org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3&quot;)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="build.gradle.kts"
+ line="150"
+ column="24"/>
+ </issue>
+
+ <issue
+ id="PermissionImpliesUnsupportedChromeOsHardware"
+ message="Permission exists without corresponding hardware `&lt;uses-feature android:name=&quot;android.hardware.telephony&quot; required=&quot;false&quot;>` tag"
+ errorLine1=" &lt;uses-permission android:name=&quot;android.permission.CALL_PHONE&quot; />"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/AndroidManifest.xml"
+ line="10"
+ column="6"/>
+ </issue>
+
+ <issue
+ id="PermissionImpliesUnsupportedChromeOsHardware"
+ message="Permission exists without corresponding hardware `&lt;uses-feature android:name=&quot;android.hardware.telephony&quot; required=&quot;false&quot;>` tag"
+ errorLine1=" &lt;uses-permission android:name=&quot;android.permission.SEND_SMS&quot; />"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/AndroidManifest.xml"
+ line="19"
+ column="6"/>
+ </issue>
+
+ <issue
+ id="PermissionImpliesUnsupportedChromeOsHardware"
+ message="Permission exists without corresponding hardware `&lt;uses-feature android:name=&quot;android.hardware.telephony&quot; required=&quot;false&quot;>` tag"
+ errorLine1=" &lt;uses-permission android:name=&quot;android.permission.READ_SMS&quot; />"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/AndroidManifest.xml"
+ line="20"
+ column="6"/>
+ </issue>
+
+ <issue
+ id="PermissionImpliesUnsupportedChromeOsHardware"
+ message="Permission exists without corresponding hardware `&lt;uses-feature android:name=&quot;android.hardware.camera&quot; required=&quot;false&quot;>` tag"
+ errorLine1=" &lt;uses-permission android:name=&quot;android.permission.CAMERA&quot; />"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/AndroidManifest.xml"
+ line="28"
+ column="6"/>
+ </issue>
+
+ <issue
+ id="SetWorldReadable"
+ message="Setting file permissions to world-readable can be risky, review carefully"
+ errorLine1=" file?.setReadable(true, false)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/tools/MediaCaptureTool.kt"
+ line="178"
+ column="13"/>
+ </issue>
+
+ <issue
+ id="ObsoleteSdkInt"
+ message="Unnecessary; `SDK_INT` is always >= 26"
+ errorLine1=" if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/tools/AlarmReceiver.kt"
+ line="55"
+ column="13"/>
+ </issue>
+
+ <issue
+ id="ObsoleteSdkInt"
+ message="Unnecessary; `SDK_INT` is never &lt; 26"
+ errorLine1=" Build.VERSION.SDK_INT &lt; Build.VERSION_CODES.M || Settings.canDrawOverlays(appContext)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/AssistiveBallOverlay.kt"
+ line="64"
+ column="9"/>
+ </issue>
+
+ <issue
+ id="ObsoleteSdkInt"
+ message="Unnecessary; `SDK_INT` is always >= 26"
+ errorLine1=" if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/AssistiveBallOverlay.kt"
+ line="343"
+ column="13"/>
+ </issue>
+
+ <issue
+ id="ObsoleteSdkInt"
+ message="Unnecessary; `SDK_INT` is always >= 26"
+ errorLine1=" if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/service/AssistiveBallService.kt"
+ line="279"
+ column="13"/>
+ </issue>
+
+ <issue
+ id="ObsoleteSdkInt"
+ message="Unnecessary; `SDK_INT` is never &lt; 26"
+ errorLine1=" Build.VERSION.SDK_INT &lt; Build.VERSION_CODES.M || Settings.canDrawOverlays(appContext)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/ConfirmationOverlay.kt"
+ line="39"
+ column="9"/>
+ </issue>
+
+ <issue
+ id="ObsoleteSdkInt"
+ message="Unnecessary; `SDK_INT` is always >= 26"
+ errorLine1=" val type = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/ConfirmationOverlay.kt"
+ line="116"
+ column="24"/>
+ </issue>
+
+ <issue
+ id="ObsoleteSdkInt"
+ message="Unnecessary; `SDK_INT` is never &lt; 26"
+ errorLine1=" if (Build.VERSION.SDK_INT &lt; Build.VERSION_CODES.N) return false"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/service/GotchaAccessibilityService.kt"
+ line="153"
+ column="13"/>
+ </issue>
+
+ <issue
+ id="ObsoleteSdkInt"
+ message="Unnecessary; `SDK_INT` is never &lt; 26"
+ errorLine1=" if (Build.VERSION.SDK_INT &lt; Build.VERSION_CODES.N) {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/tools/MediaCaptureTool.kt"
+ line="212"
+ column="13"/>
+ </issue>
+
+ <issue
+ id="ObsoleteSdkInt"
+ message="Unnecessary; `SDK_INT` is never &lt; 26"
+ errorLine1=" if (Build.VERSION.SDK_INT &lt; Build.VERSION_CODES.N) {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/tools/MediaCaptureTool.kt"
+ line="227"
+ column="13"/>
+ </issue>
+
+ <issue
+ id="ObsoleteSdkInt"
+ message="Unnecessary; `SDK_INT` is always >= 26"
+ errorLine1=" val type = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/tools/OverlayTool.kt"
+ line="76"
+ column="24"/>
+ </issue>
+
+ <issue
+ id="ObsoleteSdkInt"
+ message="Unnecessary; `SDK_INT` is never &lt; 26"
+ errorLine1=" Build.VERSION.SDK_INT &lt; Build.VERSION_CODES.M || Settings.canDrawOverlays(context)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/tools/OverlayTool.kt"
+ line="96"
+ column="9"/>
+ </issue>
+
+ <issue
+ id="ObsoleteSdkInt"
+ message="Unnecessary; `SDK_INT` is always >= 26"
+ errorLine1=" if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/PermissionItems.kt"
+ line="140"
+ column="21"/>
+ </issue>
+
+ <issue
+ id="AutoboxingStateCreation"
+ message="Prefer `mutableIntStateOf` instead of `mutableStateOf`"
+ errorLine1=" var resumeSignal by remember { mutableStateOf(0) }"
+ errorLine2=" ~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/PermissionsSection.kt"
+ line="48"
+ column="36"/>
+ </issue>
+
+ <issue
+ id="UnusedResources"
+ message="The resource `R.drawable.ic_launcher_background` appears to be unused"
+ errorLine1="&lt;vector xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;"
+ errorLine2="^">
+ <location
+ file="src/main/res/drawable/ic_launcher_background.xml"
+ line="2"
+ column="1"/>
+ </issue>
+
+ <issue
+ id="UnusedResources"
+ message="The resource `R.drawable.ic_launcher_foreground` appears to be unused"
+ errorLine1="&lt;vector xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;"
+ errorLine2="^">
+ <location
+ file="src/main/res/drawable/ic_launcher_foreground.xml"
+ line="2"
+ column="1"/>
+ </issue>
+
+ <issue
+ id="IconLauncherShape"
+ message="Launcher icons should not fill every pixel of their square region; see the design guide for details">
+ <location
+ file="src/main/res/mipmap-xxxhdpi/ic_launcher.png"/>
+ </issue>
+
+ <issue
+ id="IconLauncherShape"
+ message="Launcher icon used as round icon did not have a circular shape">
+ <location
+ file="src/main/res/mipmap-xxxhdpi/ic_launcher_round.png"/>
+ </issue>
+
+ <issue
+ id="IconDuplicates"
+ message="The following unrelated icon files have identical contents: ic_launcher.png, ic_launcher_round.png">
+ <location
+ file="src/main/res/mipmap-xxxhdpi/ic_launcher_round.png"/>
+ <location
+ file="src/main/res/mipmap-xxxhdpi/ic_launcher.png"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `SharedPreferences.edit` instead?"
+ errorLine1=" set(v) = prefs.edit().putLong(&quot;next_id&quot;, v).apply()"
+ errorLine2=" ~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/tools/AlarmTool.kt"
+ line="51"
+ column="18"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `SharedPreferences.edit` instead?"
+ errorLine1=" prefs.edit().putString(&quot;alarms&quot;, json.toString()).apply()"
+ errorLine2=" ~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/tools/AlarmTool.kt"
+ line="421"
+ column="9"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `SharedPreferences.edit` instead?"
+ errorLine1=" prefs.edit().putString(&quot;timers&quot;, json.toString()).apply()"
+ errorLine2=" ~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/tools/AlarmTool.kt"
+ line="463"
+ column="9"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toUri` instead?"
+ errorLine1=" val intent = Intent(Intent.ACTION_DELETE, Uri.parse(&quot;package:$packageName&quot;))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/tools/AppsTool.kt"
+ line="134"
+ column="55"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toColorInt` instead?"
+ errorLine1=" setStroke(dp(1), Color.parseColor(&quot;#66FFFFFF&quot;))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/AssistiveBallOverlay.kt"
+ line="134"
+ column="34"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toColorInt` instead?"
+ errorLine1=" setStroke(dp(1), Color.parseColor(&quot;#66FFFFFF&quot;))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/AssistiveBallOverlay.kt"
+ line="134"
+ column="34"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toColorInt` instead?"
+ errorLine1=" setColor(Color.parseColor(&quot;#1E1E1E&quot;))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/AssistiveBallOverlay.kt"
+ line="210"
+ column="26"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toColorInt` instead?"
+ errorLine1=" setColor(Color.parseColor(&quot;#1E1E1E&quot;))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/AssistiveBallOverlay.kt"
+ line="210"
+ column="26"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toColorInt` instead?"
+ errorLine1=" setStroke(dp(1), Color.parseColor(&quot;#3A3A3A&quot;))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/AssistiveBallOverlay.kt"
+ line="211"
+ column="34"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toColorInt` instead?"
+ errorLine1=" setStroke(dp(1), Color.parseColor(&quot;#3A3A3A&quot;))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/AssistiveBallOverlay.kt"
+ line="211"
+ column="34"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toColorInt` instead?"
+ errorLine1=" setTextColor(Color.parseColor(&quot;#EADDFF&quot;))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/AssistiveBallOverlay.kt"
+ line="237"
+ column="22"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toColorInt` instead?"
+ errorLine1=" setColor(Color.parseColor(&quot;#1E1E1E&quot;))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/AssistiveBallOverlay.kt"
+ line="291"
+ column="30"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toColorInt` instead?"
+ errorLine1=" setColor(Color.parseColor(&quot;#1E1E1E&quot;))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/AssistiveBallOverlay.kt"
+ line="291"
+ column="30"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toColorInt` instead?"
+ errorLine1=" setStroke(dp(1), Color.parseColor(&quot;#3A3A3A&quot;))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/AssistiveBallOverlay.kt"
+ line="292"
+ column="38"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toColorInt` instead?"
+ errorLine1=" setStroke(dp(1), Color.parseColor(&quot;#3A3A3A&quot;))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/AssistiveBallOverlay.kt"
+ line="292"
+ column="38"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toColorInt` instead?"
+ errorLine1=" setTextColor(Color.parseColor(&quot;#EEEEEE&quot;))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/AssistiveBallOverlay.kt"
+ line="298"
+ column="34"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `Bitmap.scale` instead?"
+ errorLine1=" val scaled = Bitmap.createScaledBitmap(bitmap, w, h, true)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/agent/ChatViewModel.kt"
+ line="225"
+ column="26"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `Bitmap.scale` instead?"
+ errorLine1=" val scaled = android.graphics.Bitmap.createScaledBitmap(bitmap, w, h, true)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/agent/ChatViewModel.kt"
+ line="1079"
+ column="26"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toColorInt` instead?"
+ errorLine1=" setColor(Color.parseColor(&quot;#1E1E1E&quot;))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/ConfirmationOverlay.kt"
+ line="75"
+ column="26"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toColorInt` instead?"
+ errorLine1=" setColor(Color.parseColor(&quot;#1E1E1E&quot;))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/ConfirmationOverlay.kt"
+ line="75"
+ column="26"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toColorInt` instead?"
+ errorLine1=" setStroke(dp(1), Color.parseColor(&quot;#3A3A3A&quot;))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/ConfirmationOverlay.kt"
+ line="76"
+ column="34"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toColorInt` instead?"
+ errorLine1=" setStroke(dp(1), Color.parseColor(&quot;#3A3A3A&quot;))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/ConfirmationOverlay.kt"
+ line="76"
+ column="34"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toColorInt` instead?"
+ errorLine1=" setTextColor(Color.parseColor(&quot;#CCCCCC&quot;))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/ConfirmationOverlay.kt"
+ line="89"
+ column="26"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toUri` instead?"
+ errorLine1=" Uri.parse(&quot;package:$packageName&quot;)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/MainActivity.kt"
+ line="92"
+ column="29"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toUri` instead?"
+ errorLine1=" Uri.parse(&quot;package:$packageName&quot;)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/MainActivity.kt"
+ line="110"
+ column="29"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toUri` instead?"
+ errorLine1=" Uri.parse(&quot;package:$packageName&quot;))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/MainActivity.kt"
+ line="112"
+ column="29"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toUri` instead?"
+ errorLine1=" Uri.parse(&quot;package:$packageName&quot;)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/MainActivity.kt"
+ line="117"
+ column="29"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `SharedPreferences.edit` instead?"
+ errorLine1=" prefs.edit().putBoolean(KEY_FIRST_LAUNCH_DONE, true).apply()"
+ errorLine2=" ~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/MainActivity.kt"
+ line="147"
+ column="17"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toUri` instead?"
+ errorLine1=" Uri.parse(&quot;package:$packageName&quot;)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/MainActivity.kt"
+ line="187"
+ column="25"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toUri` instead?"
+ errorLine1=" Uri.parse(&quot;package:$packageName&quot;)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/PermissionsSection.kt"
+ line="156"
+ column="13"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toUri` instead?"
+ errorLine1=" Intent(AndroidSettings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION, Uri.parse(&quot;package:$packageName&quot;))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/PermissionsSection.kt"
+ line="163"
+ column="83"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toUri` instead?"
+ errorLine1=" else Intent(AndroidSettings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse(&quot;package:$packageName&quot;))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/PermissionsSection.kt"
+ line="164"
+ column="74"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toUri` instead?"
+ errorLine1=" ToolResult.OVERLAY_ACCESS -> Intent(AndroidSettings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse(&quot;package:$packageName&quot;))"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/PermissionsSection.kt"
+ line="165"
+ column="95"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toUri` instead?"
+ errorLine1=" val intent = Intent(Intent.ACTION_DIAL, Uri.parse(&quot;tel:$trimmed&quot;)).apply {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/tools/PhoneTool.kt"
+ line="32"
+ column="53"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `String.toUri` instead?"
+ errorLine1=" val intent = Intent(Intent.ACTION_CALL, Uri.parse(&quot;tel:$trimmed&quot;)).apply {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/tools/PhoneTool.kt"
+ line="59"
+ column="53"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `Bitmap.scale` instead?"
+ errorLine1=" val scaled = Bitmap.createScaledBitmap(bitmap, w, h, true)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/agent/QuickAskEngine.kt"
+ line="99"
+ column="30"/>
+ </issue>
+
+ <issue
+ id="UseKtx"
+ message="Use the KTX extension function `SharedPreferences.edit` instead?"
+ errorLine1=" prefs.edit()"
+ errorLine2=" ~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/data/SettingsRepository.kt"
+ line="69"
+ column="9"/>
+ </issue>
+
+ <issue
+ id="ClickableViewAccessibility"
+ message="`onTouch` lambda should call `View#performClick` when a click is detected"
+ errorLine1=" return View.OnTouchListener { _, event ->"
+ errorLine2=" ^">
+ <location
+ file="src/main/java/com/gotcha/ui/AssistiveBallOverlay.kt"
+ line="146"
+ column="37"/>
+ </issue>
+
+ <issue
+ id="SetTextI18n"
+ message="String literal in `setText` can not be translated. Use Android resources instead."
+ errorLine1=" text = &quot;Close&quot;"
+ errorLine2=" ~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/AssistiveBallOverlay.kt"
+ line="309"
+ column="29"/>
+ </issue>
+
+ <issue
+ id="SetTextI18n"
+ message="String literal in `setText` can not be translated. Use Android resources instead."
+ errorLine1=" text = &quot;Gotcha — confirm action&quot;"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/ConfirmationOverlay.kt"
+ line="81"
+ column="21"/>
+ </issue>
+
+ <issue
+ id="SetTextI18n"
+ message="String literal in `setText` can not be translated. Use Android resources instead."
+ errorLine1=" text = &quot;Deny&quot;"
+ errorLine2=" ~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/ConfirmationOverlay.kt"
+ line="99"
+ column="21"/>
+ </issue>
+
+ <issue
+ id="SetTextI18n"
+ message="String literal in `setText` can not be translated. Use Android resources instead."
+ errorLine1=" text = &quot;Allow&quot;"
+ errorLine2=" ~~~~~">
+ <location
+ file="src/main/java/com/gotcha/ui/ConfirmationOverlay.kt"
+ line="103"
+ column="21"/>
+ </issue>
+
+</issues>
diff --git a/app/src/test/java/com/gotcha/audio/AudioModelTest.kt b/app/src/test/java/com/gotcha/audio/AudioModelTest.kt
new file mode 100644
index 0000000..5d3a029
--- /dev/null
+++ b/app/src/test/java/com/gotcha/audio/AudioModelTest.kt
@@ -0,0 +1,66 @@
+package com.gotcha.audio
+
+import org.junit.Assert.assertEquals
+import org.junit.Test
+
+class AudioModelTest {
+
+ @Test
+ fun `task field takes precedence over name heuristics`() {
+ // Name says TTS (kokoro) but the API's task field says STT — task wins.
+ assertEquals(ModelCategory.STT, AudioModel.categorize("kokoro-82m", "automatic-speech-recognition"))
+ // Name says STT (whisper) but task says TTS — task wins.
+ assertEquals(ModelCategory.TTS, AudioModel.categorize("whisper-clone", "text-to-speech"))
+ }
+
+ @Test
+ fun `known task field values are mapped`() {
+ assertEquals(ModelCategory.TTS, AudioModel.categorize("m", "text-to-speech"))
+ assertEquals(ModelCategory.TTS, AudioModel.categorize("m", "TTS"))
+ assertEquals(ModelCategory.STT, AudioModel.categorize("m", "automatic-speech-recognition"))
+ assertEquals(ModelCategory.STT, AudioModel.categorize("m", "speech-to-text"))
+ assertEquals(ModelCategory.STT, AudioModel.categorize("m", "transcription"))
+ }
+
+ @Test
+ fun `unknown task falls back to name heuristics`() {
+ assertEquals(ModelCategory.STT, AudioModel.categorize("whisper-large-v3", "something-else"))
+ }
+
+ @Test
+ fun `name heuristics categorize STT models`() {
+ assertEquals(ModelCategory.STT, AudioModel.categorize("whisper-large-v3"))
+ assertEquals(ModelCategory.STT, AudioModel.categorize("faster-STT-en"))
+ assertEquals(ModelCategory.STT, AudioModel.categorize("nova-transcription"))
+ }
+
+ @Test
+ fun `name heuristics categorize TTS models`() {
+ assertEquals(ModelCategory.TTS, AudioModel.categorize("kokoro-82m"))
+ assertEquals(ModelCategory.TTS, AudioModel.categorize("tts-1-hd"))
+ assertEquals(ModelCategory.TTS, AudioModel.categorize("neural-speech-2"))
+ assertEquals(ModelCategory.TTS, AudioModel.categorize("my-voice-model"))
+ }
+
+ @Test
+ fun `unrecognized models are UNKNOWN`() {
+ assertEquals(ModelCategory.UNKNOWN, AudioModel.categorize("gpt-4o"))
+ assertEquals(ModelCategory.UNKNOWN, AudioModel.categorize("llama-3-8b"))
+ }
+
+ @Test
+ fun `default voice falls back to af_heart when no voices are listed`() {
+ val model = AudioModel(id = "kokoro-82m", category = ModelCategory.TTS)
+ assertEquals("af_heart", model.defaultVoice)
+ }
+
+ @Test
+ fun `default voice is the first listed voice`() {
+ val model = AudioModel(
+ id = "kokoro-82m",
+ category = ModelCategory.TTS,
+ voices = listOf("bm_lewis", "af_heart")
+ )
+ assertEquals("bm_lewis", model.defaultVoice)
+ }
+}
diff --git a/app/src/test/java/com/gotcha/llm/LLMCacheTest.kt b/app/src/test/java/com/gotcha/llm/LLMCacheTest.kt
new file mode 100644
index 0000000..48bcdff
--- /dev/null
+++ b/app/src/test/java/com/gotcha/llm/LLMCacheTest.kt
@@ -0,0 +1,66 @@
+package com.gotcha.llm
+
+import kotlinx.serialization.json.JsonPrimitive
+import org.junit.Assert.assertEquals
+import org.junit.Assert.assertNotNull
+import org.junit.Assert.assertNull
+import org.junit.Test
+
+/**
+ * Tests the in-memory cache path (context = null → no disk cache).
+ * Deterministic expiry is exercised with a negative TTL so no clock control is needed.
+ */
+class LLMCacheTest {
+
+ private fun response(text: String) = ChatResponse(
+ choices = listOf(Choice(message = ChatMessage(role = "assistant", content = JsonPrimitive(text))))
+ )
+
+ @Test
+ fun `put then get returns the cached response`() {
+ val cache = LLMCache()
+ cache.put("k1", response("answer"))
+ assertEquals("answer", cache.get("k1")!!.choices.single().message.textContent)
+ }
+
+ @Test
+ fun `get returns null for unknown keys`() {
+ assertNull(LLMCache().get("missing"))
+ }
+
+ @Test
+ fun `expired entries are evicted on get`() {
+ val cache = LLMCache()
+ cache.put("k1", response("stale"), ttlMs = -1)
+ assertNull(cache.get("k1"))
+ }
+
+ @Test
+ fun `least recently used entry is evicted at maxSize`() {
+ val cache = LLMCache(maxSize = 2)
+ cache.put("a", response("A"))
+ cache.put("b", response("B"))
+ // Touch "a" so "b" becomes the least recently used entry.
+ assertNotNull(cache.get("a"))
+ cache.put("c", response("C"))
+
+ assertNull(cache.get("b"))
+ assertNotNull(cache.get("a"))
+ assertNotNull(cache.get("c"))
+ }
+
+ @Test
+ fun `clear empties the cache`() {
+ val cache = LLMCache()
+ cache.put("k1", response("gone"))
+ cache.clear()
+ assertNull(cache.get("k1"))
+ }
+
+ @Test
+ fun `entries within their TTL remain retrievable`() {
+ val cache = LLMCache()
+ cache.put("k1", response("fresh"), ttlMs = 60_000)
+ assertNotNull(cache.get("k1"))
+ }
+}
diff --git a/app/src/test/java/com/gotcha/llm/ModelsTest.kt b/app/src/test/java/com/gotcha/llm/ModelsTest.kt
new file mode 100644
index 0000000..2b6a2d6
--- /dev/null
+++ b/app/src/test/java/com/gotcha/llm/ModelsTest.kt
@@ -0,0 +1,173 @@
+package com.gotcha.llm
+
+import kotlinx.serialization.json.Json
+import kotlinx.serialization.json.JsonArray
+import kotlinx.serialization.json.JsonPrimitive
+import kotlinx.serialization.json.jsonArray
+import kotlinx.serialization.json.jsonObject
+import kotlinx.serialization.json.jsonPrimitive
+import org.junit.Assert.assertEquals
+import org.junit.Assert.assertFalse
+import org.junit.Assert.assertNull
+import org.junit.Assert.assertTrue
+import org.junit.Test
+
+/**
+ * Wire-contract tests for the OpenAI-compatible API models. These pin the JSON
+ * shapes the LLM endpoint expects; a regression here breaks tool calling silently.
+ */
+class ModelsTest {
+
+ // Mirror of LLMClient's Json configuration.
+ @OptIn(kotlinx.serialization.ExperimentalSerializationApi::class)
+ private val json = Json {
+ ignoreUnknownKeys = true
+ explicitNulls = false
+ encodeDefaults = false
+ }
+
+ @Test
+ fun `textContent returns string content for plain messages`() {
+ val msg = ChatMessage(role = "user", content = JsonPrimitive("hello"))
+ assertEquals("hello", msg.textContent)
+ assertTrue(msg.hasText)
+ }
+
+ @Test
+ fun `textContent extracts text part from vision content array`() {
+ val msg = visionUserMessage("describe this", "QUJD")
+ assertEquals("describe this", msg.textContent)
+ assertTrue(msg.hasText)
+ }
+
+ @Test
+ fun `textContent is empty for null content`() {
+ val msg = ChatMessage(role = "assistant", content = null)
+ assertEquals("", msg.textContent)
+ assertFalse(msg.hasText)
+ }
+
+ @Test
+ fun `hasText is false for blank content`() {
+ assertFalse(ChatMessage(role = "user", content = JsonPrimitive(" ")).hasText)
+ }
+
+ @Test
+ fun `visionUserMessage builds the OpenAI two-part content structure`() {
+ val msg = visionUserMessage("what is this", "QUJD", imageFormat = "jpeg")
+
+ assertEquals("user", msg.role)
+ val parts = (msg.content as JsonArray)
+ assertEquals(2, parts.size)
+
+ val textPart = parts[0].jsonObject
+ assertEquals("text", textPart["type"]!!.jsonPrimitive.content)
+ assertEquals("what is this", textPart["text"]!!.jsonPrimitive.content)
+
+ val imagePart = parts[1].jsonObject
+ assertEquals("image_url", imagePart["type"]!!.jsonPrimitive.content)
+ assertEquals(
+ "data:image/jpeg;base64,QUJD",
+ imagePart["image_url"]!!.jsonObject["url"]!!.jsonPrimitive.content
+ )
+ }
+
+ @Test
+ fun `visionUserMessage falls back to a default prompt for blank text`() {
+ val msg = visionUserMessage(" ", "QUJD")
+ assertEquals("What is in this image?", msg.textContent)
+ }
+
+ @Test
+ fun `tool call type is always encoded even with encodeDefaults off`() {
+ val call = ToolCall(id = "call_1", function = FunctionCall(name = "dial_number", arguments = "{}"))
+ val encoded = json.encodeToString(ToolCall.serializer(), call)
+ val obj = json.parseToJsonElement(encoded).jsonObject
+ assertEquals("function", obj["type"]!!.jsonPrimitive.content)
+ }
+
+ @Test
+ fun `tool definition type is always encoded even with encodeDefaults off`() {
+ val def = ToolDefinition(
+ function = FunctionDefinition(
+ name = "x",
+ description = "y",
+ parameters = json.parseToJsonElement("""{"type":"object"}""").jsonObject
+ )
+ )
+ val encoded = json.encodeToString(ToolDefinition.serializer(), def)
+ val obj = json.parseToJsonElement(encoded).jsonObject
+ assertEquals("function", obj["type"]!!.jsonPrimitive.content)
+ }
+
+ @Test
+ fun `chat request omits null tools and temperature`() {
+ val request = ChatRequest(
+ model = "gpt-4o",
+ messages = listOf(ChatMessage(role = "user", content = JsonPrimitive("hi")))
+ )
+ val obj = json.parseToJsonElement(json.encodeToString(ChatRequest.serializer(), request)).jsonObject
+ assertNull(obj["tools"])
+ assertNull(obj["temperature"])
+ }
+
+ @Test
+ fun `chat response decoding ignores unknown keys`() {
+ val response = json.decodeFromString(
+ ChatResponse.serializer(),
+ """
+ {
+ "id": "chatcmpl-123",
+ "object": "chat.completion",
+ "created": 1700000000,
+ "choices": [
+ {
+ "index": 0,
+ "message": {"role": "assistant", "content": "hi", "refusal": null},
+ "finish_reason": "stop",
+ "logprobs": null
+ }
+ ],
+ "usage": {"prompt_tokens": 5, "completion_tokens": 2, "total_tokens": 7}
+ }
+ """.trimIndent()
+ )
+ assertEquals("hi", response.choices.single().message.textContent)
+ assertEquals("stop", response.choices.single().finishReason)
+ assertEquals(7, response.usage!!.totalTokens)
+ }
+
+ @Test
+ fun `chat message with tool calls round-trips through serialization`() {
+ val original = ChatMessage(
+ role = "assistant",
+ toolCalls = listOf(
+ ToolCall(id = "call_1", function = FunctionCall("read_file", """{"path":"files/a.txt"}"""))
+ )
+ )
+ val decoded = json.decodeFromString(
+ ChatMessage.serializer(),
+ json.encodeToString(ChatMessage.serializer(), original)
+ )
+ assertEquals(original, decoded)
+ }
+
+ @Test
+ fun `tool result message uses tool_call_id serial name`() {
+ val msg = ChatMessage(role = "tool", content = JsonPrimitive("ok"), toolCallId = "call_9")
+ val obj = json.parseToJsonElement(json.encodeToString(ChatMessage.serializer(), msg)).jsonObject
+ assertEquals("call_9", obj["tool_call_id"]!!.jsonPrimitive.content)
+ assertNull(obj["toolCallId"])
+ }
+
+ @Test
+ fun `vision message content survives a serialization round-trip`() {
+ val original = visionUserMessage("look", "QUJD")
+ val decoded = json.decodeFromString(
+ ChatMessage.serializer(),
+ json.encodeToString(ChatMessage.serializer(), original)
+ )
+ assertEquals(original, decoded)
+ assertEquals(2, decoded.content!!.jsonArray.size)
+ }
+}
diff --git a/app/src/test/java/com/gotcha/tools/ToolDefinitionsSchemaTest.kt b/app/src/test/java/com/gotcha/tools/ToolDefinitionsSchemaTest.kt
new file mode 100644
index 0000000..7537f2c
--- /dev/null
+++ b/app/src/test/java/com/gotcha/tools/ToolDefinitionsSchemaTest.kt
@@ -0,0 +1,77 @@
+package com.gotcha.tools
+
+import kotlinx.serialization.json.jsonArray
+import kotlinx.serialization.json.jsonObject
+import kotlinx.serialization.json.jsonPrimitive
+import org.junit.Assert.assertEquals
+import org.junit.Assert.assertTrue
+import org.junit.Test
+
+/**
+ * Structural invariants over the entire tool catalog. A malformed schema here
+ * doesn't crash the app — it silently degrades the LLM's tool calling.
+ */
+class ToolDefinitionsSchemaTest {
+
+ @Test
+ fun `catalog is not empty`() {
+ assertTrue(ToolDefinitions.all.isNotEmpty())
+ }
+
+ @Test
+ fun `tool names are unique`() {
+ val names = ToolDefinitions.all.map { it.function.name }
+ val duplicates = names.groupingBy { it }.eachCount().filterValues { it > 1 }.keys
+ assertTrue("duplicate tool names: $duplicates", duplicates.isEmpty())
+ }
+
+ @Test
+ fun `every tool has a non-blank name and description`() {
+ ToolDefinitions.all.forEach { def ->
+ assertTrue("blank name in catalog", def.function.name.isNotBlank())
+ assertTrue("'${def.function.name}' has a blank description", def.function.description.isNotBlank())
+ }
+ }
+
+ @Test
+ fun `every schema is a JSON object with a properties map`() {
+ ToolDefinitions.all.forEach { def ->
+ val params = def.function.parameters
+ assertEquals(
+ "'${def.function.name}' parameters must have type=object",
+ "object",
+ params["type"]!!.jsonPrimitive.content
+ )
+ assertTrue(
+ "'${def.function.name}' is missing a properties object",
+ params["properties"] is kotlinx.serialization.json.JsonObject
+ )
+ }
+ }
+
+ @Test
+ fun `every required parameter is declared in properties`() {
+ ToolDefinitions.all.forEach { def ->
+ val params = def.function.parameters
+ val properties = params["properties"]!!.jsonObject.keys
+ val required = params["required"]?.jsonArray?.map { it.jsonPrimitive.content } ?: emptyList()
+ required.forEach { name ->
+ assertTrue(
+ "'${def.function.name}' requires '$name' but does not declare it in properties",
+ name in properties
+ )
+ }
+ }
+ }
+
+ @Test
+ fun `tool names follow the snake_case convention`() {
+ val pattern = Regex("^[a-z][a-z0-9_]*$")
+ ToolDefinitions.all.forEach { def ->
+ assertTrue(
+ "'${def.function.name}' is not snake_case",
+ pattern.matches(def.function.name)
+ )
+ }
+ }
+}
diff --git a/app/src/test/java/com/gotcha/tools/WebFetchToolTest.kt b/app/src/test/java/com/gotcha/tools/WebFetchToolTest.kt
new file mode 100644
index 0000000..8a67597
--- /dev/null
+++ b/app/src/test/java/com/gotcha/tools/WebFetchToolTest.kt
@@ -0,0 +1,164 @@
+package com.gotcha.tools
+
+import okhttp3.mockwebserver.MockResponse
+import okhttp3.mockwebserver.MockWebServer
+import org.junit.After
+import org.junit.Assert.assertFalse
+import org.junit.Assert.assertTrue
+import org.junit.Before
+import org.junit.Test
+
+class WebFetchToolTest {
+
+ private lateinit var server: MockWebServer
+ private val tool = WebFetchTool()
+
+ private val sampleHtml = """
+ <html>
+ <head><title>Page</title><script>var secret = 1;</script><style>.x{color:red}</style></head>
+ <body>
+ <nav>NavBarText</nav>
+ <h1>Main Title</h1>
+ <h2>Sub Title</h2>
+ <p>Hello <strong>world</strong> and <code>inline</code>.</p>
+ <a href="https://example.com/page">A Link</a>
+ <ul><li>first item</li><li>second item</li></ul>
+ <blockquote>quoted text</blockquote>
+ <pre>preformatted block</pre>
+ <footer>FooterText</footer>
+ </body>
+ </html>
+ """.trimIndent()
+
+ @Before
+ fun setUp() {
+ server = MockWebServer()
+ server.start()
+ }
+
+ @After
+ fun tearDown() {
+ server.shutdown()
+ }
+
+ private fun enqueueHtml(body: String = sampleHtml) {
+ server.enqueue(
+ MockResponse().setBody(body).setHeader("Content-Type", "text/html; charset=utf-8")
+ )
+ }
+
+ @Test
+ fun `text format strips script style nav and footer`() {
+ enqueueHtml()
+ val result = tool.fetch(server.url("/").toString(), "text")
+
+ assertTrue(result.success)
+ assertTrue(result.message.contains("Main Title"))
+ assertTrue(result.message.contains("Hello world"))
+ assertFalse(result.message.contains("NavBarText"))
+ assertFalse(result.message.contains("FooterText"))
+ assertFalse(result.message.contains("var secret"))
+ assertFalse(result.message.contains("color:red"))
+ }
+
+ @Test
+ fun `markdown format converts headings links emphasis lists and quotes`() {
+ enqueueHtml()
+ val result = tool.fetch(server.url("/").toString(), "markdown")
+
+ assertTrue(result.success)
+ assertTrue(result.message.contains("# Main Title"))
+ assertTrue(result.message.contains("## Sub Title"))
+ assertTrue(result.message.contains("**world**"))
+ assertTrue(result.message.contains("`inline`"))
+ assertTrue(result.message.contains("[A Link](https://example.com/page)"))
+ assertTrue(result.message.contains("- first item"))
+ assertTrue(result.message.contains("- second item"))
+ assertTrue(result.message.contains("> quoted text"))
+ assertTrue(result.message.contains("```"))
+ assertTrue(result.message.contains("preformatted block"))
+ assertFalse(result.message.contains("NavBarText"))
+ }
+
+ @Test
+ fun `relative links are resolved against the page URL`() {
+ enqueueHtml("""<html><body><a href="/sub/page">Rel</a></body></html>""")
+ val base = server.url("/").toString()
+ val result = tool.fetch(base, "markdown")
+
+ assertTrue(result.success)
+ assertTrue(result.message.contains("[Rel](${base}sub/page)"))
+ }
+
+ @Test
+ fun `unknown format falls back to text`() {
+ enqueueHtml()
+ val result = tool.fetch(server.url("/").toString(), "yaml")
+
+ assertTrue(result.success)
+ assertTrue(result.message.contains("KB text"))
+ assertFalse(result.message.contains("# Main Title"))
+ }
+
+ @Test
+ fun `null format defaults to text`() {
+ enqueueHtml()
+ val result = tool.fetch(server.url("/").toString(), null)
+
+ assertTrue(result.success)
+ assertTrue(result.message.contains("Main Title"))
+ }
+
+ @Test
+ fun `non-http URLs are rejected without a network call`() {
+ listOf("ftp://example.com/x", "file:///etc/passwd", "example.com").forEach { url ->
+ val result = tool.fetch(url, "text")
+ assertFalse("expected '$url' to be rejected", result.success)
+ assertTrue(result.message.contains("http"))
+ }
+ assertTrue(server.requestCount == 0)
+ }
+
+ @Test
+ fun `http error status is reported`() {
+ server.enqueue(MockResponse().setResponseCode(404).setBody("gone"))
+ val result = tool.fetch(server.url("/missing").toString(), "text")
+
+ assertFalse(result.success)
+ assertTrue(result.message.contains("HTTP 404"))
+ }
+
+ @Test
+ fun `unsupported content type is rejected`() {
+ server.enqueue(
+ MockResponse().setBody("binarydata").setHeader("Content-Type", "image/png")
+ )
+ val result = tool.fetch(server.url("/img.png").toString(), "text")
+
+ assertFalse(result.success)
+ assertTrue(result.message.contains("Unsupported content type"))
+ assertTrue(result.message.contains("image/png"))
+ }
+
+ @Test
+ fun `plain text response is returned as-is`() {
+ server.enqueue(
+ MockResponse().setBody("just plain text").setHeader("Content-Type", "text/plain")
+ )
+ val result = tool.fetch(server.url("/plain").toString(), "text")
+
+ assertTrue(result.success)
+ assertTrue(result.message.contains("just plain text"))
+ }
+
+ @Test
+ fun `json response is accepted`() {
+ server.enqueue(
+ MockResponse().setBody("""{"key":"value"}""").setHeader("Content-Type", "application/json")
+ )
+ val result = tool.fetch(server.url("/api").toString(), "text")
+
+ assertTrue(result.success)
+ assertTrue(result.message.contains(""""key":"value""""))
+ }
+}
diff --git a/app/test_dep.gradle b/app/test_dep.gradle
deleted file mode 100644
index 38db41e..0000000
--- a/app/test_dep.gradle
+++ /dev/null
@@ -1,3 +0,0 @@
-apply plugin: 'com.android.application'
-repositories { mavenCentral(); google() }
-dependencies { implementation "com.halilibo.compose-richtext:richtext-commonmark:0.17.0" }
diff --git a/build.gradle.kts b/build.gradle.kts
index 2292a28..8d85bdd 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -2,4 +2,6 @@ plugins {
id("com.android.application") version "8.13.2" apply false
id("org.jetbrains.kotlin.android") version "1.9.22" apply false
id("org.jetbrains.kotlin.plugin.serialization") version "1.9.22" apply false
+ // Pinned to 1.23.6: last detekt release built against Kotlin 1.9.x. Bump only with Kotlin.
+ id("io.gitlab.arturbosch.detekt") version "1.23.6" apply false
}
diff --git a/config/detekt/detekt.yml b/config/detekt/detekt.yml
new file mode 100644
index 0000000..259b1df
--- /dev/null
+++ b/config/detekt/detekt.yml
@@ -0,0 +1,34 @@
+# Overrides on top of detekt's default config (buildUponDefaultConfig = true in app/build.gradle.kts).
+# Keep this file small: only deviations from defaults belong here.
+
+build:
+ maxIssues: 0
+
+style:
+ MaxLineLength:
+ maxLineLength: 140
+ MagicNumber:
+ excludes: ["**/test/**"]
+ ReturnCount:
+ max: 4
+
+complexity:
+ LongMethod:
+ threshold: 80
+ LongParameterList:
+ functionThreshold: 8
+ constructorThreshold: 8
+ ignoreDefaultParameters: true
+ TooManyFunctions:
+ thresholdInFiles: 20
+ thresholdInClasses: 20
+ thresholdInObjects: 20
+
+exceptions:
+ # Tool implementations intentionally catch broad exceptions and convert them to ToolResult errors
+ TooGenericExceptionCaught:
+ active: false
+
+formatting:
+ MaximumLineLength:
+ maxLineLength: 140