diff --git a/.serena/memories/code_style_conventions.md b/.serena/memories/code_style_conventions.md new file mode 100644 index 0000000..15829e6 --- /dev/null +++ b/.serena/memories/code_style_conventions.md @@ -0,0 +1,33 @@ +# Code Style and Conventions + +## Naming Conventions +- **Classes**: PascalCase (e.g., `MainActivity`, `EnableProxyUseCase`) +- **Functions**: camelCase (e.g., `enableProxy()`, `onProxySwitchClicked()`) +- **Composables**: PascalCase with `@Composable` annotation +- **Variables**: camelCase (e.g., `isProxyEnabled`, `proxyHost`) +- **Constants**: UPPER_SNAKE_CASE + +## Architecture Patterns +- **Clean Architecture**: Data/Domain/UI layer separation +- **MVVM**: Model-View-ViewModel with Compose +- **Repository Pattern**: Data access abstraction +- **Use Case/Interactor Pattern**: Business logic encapsulation + +## Compose UI Patterns +- Use `@Composable` functions for UI components +- State management with `remember` and state hoisting +- Material Design components +- Modifier chaining for styling + +## Dependency Injection with Koin +```kotlin +val domainModule = module { + single { EnableProxyInteractor(get()) } + single { GlobalSettingRepositoryImpl(get()) } +} +``` + +## Error Handling +- Handle SecurityException when accessing system settings +- Provide graceful degradation when permissions not granted +- Use try-catch blocks for system-level operations \ No newline at end of file diff --git a/.serena/memories/project_overview.md b/.serena/memories/project_overview.md new file mode 100644 index 0000000..4093b0f --- /dev/null +++ b/.serena/memories/project_overview.md @@ -0,0 +1,31 @@ +# DebugAssistant Project Overview + +## Purpose +Debug Assistant is an Android application that helps Android developers by providing quick access to development tools through system tiles. The app enables toggling proxy settings and ADB (Android Debug Bridge) directly from the Quick Settings panel. + +## Tech Stack +- **Language**: Kotlin +- **Min SDK**: 28 (Android 9.0) +- **Current SDK**: compileSdk 35, targetSdk 35 +- **Architecture**: Clean Architecture with MVVM +- **UI Framework**: Jetpack Compose 1.8.0 +- **Dependency Injection**: Koin 3.5.6 +- **Build System**: Gradle with Android Gradle Plugin 8.8.0/8.9.2 +- **Testing**: JUnit, MockK, Compose Testing + +## Project Structure +Multi-module Android project: +- `app/` - Main application module (UI, ViewModels, Activities, Tile Services) +- `data/repository/` - Data layer with repository implementations +- `domain/usecase/` - Business logic and use cases +- `domain/model/` - Domain models and entities + +## Key Features +1. Proxy Toggle: Enable/disable system HTTP proxy via Quick Settings +2. ADB Toggle: Enable/disable Android Debug Bridge via Quick Settings +3. Permission Management: Handles WRITE_SECURE_SETTINGS permission + +## Package Structure +Base package: `com.nagopy.android.debugassistant` +- Clear separation between UI, domain, and data layers +- Feature-based packaging within modules \ No newline at end of file diff --git a/.serena/memories/suggested_commands.md b/.serena/memories/suggested_commands.md new file mode 100644 index 0000000..7d6740f --- /dev/null +++ b/.serena/memories/suggested_commands.md @@ -0,0 +1,26 @@ +# Essential Development Commands + +## Build Commands +- `./gradlew build` - Full project build +- `./gradlew assembleDebug` - Build debug APK +- `./gradlew assembleRelease` - Build release APK + +## Testing Commands +- `./gradlew testDebugUnitTest` - Run unit tests +- `./gradlew connectedAndroidTest` - Run instrumentation tests + +## Code Quality +- `./gradlew detekt` - Run static code analysis +- `./gradlew ktlintCheck` - Check code formatting +- `./gradlew ktlintFormat` - Auto-format code + +## Gradle Management +- `./gradlew clean` - Clean build artifacts +- `./gradlew --refresh-dependencies` - Refresh dependencies + +## System Utilities (Linux) +- `git` - Version control +- `find . -name "*.kt"` - Find Kotlin files +- `grep -r "pattern" --include="*.kt"` - Search in Kotlin files +- `ls -la` - List files with details +- `cd path/to/directory` - Change directory \ No newline at end of file diff --git a/.serena/memories/task_completion_checklist.md b/.serena/memories/task_completion_checklist.md new file mode 100644 index 0000000..b0ead03 --- /dev/null +++ b/.serena/memories/task_completion_checklist.md @@ -0,0 +1,30 @@ +# Task Completion Checklist + +When completing a development task, follow these steps: + +## Code Changes +1. **Make minimal changes**: Only modify what's necessary for the task +2. **Follow architecture patterns**: Maintain Clean Architecture structure +3. **Add tests**: Include unit tests for business logic, UI tests for interactions +4. **Handle errors**: Implement proper error handling for system operations + +## Build and Quality Checks +1. **Build the project**: `./gradlew build` +2. **Run tests**: `./gradlew testDebugUnitTest` +3. **Check code quality**: `./gradlew detekt` +4. **Format code**: `./gradlew ktlintCheck` or `./gradlew ktlintFormat` + +## System Integration +- Verify WRITE_SECURE_SETTINGS permission handling +- Test with system settings modifications +- Ensure Quick Settings tiles work properly + +## Documentation +- Update documentation if changes affect API or architecture +- Add comments for complex logic (matching existing style) +- Update README if new features are added + +## Final Verification +- Test on device/emulator with required permissions +- Verify no regression in existing functionality +- Check that all modules compile and tests pass \ No newline at end of file diff --git a/.serena/project.yml b/.serena/project.yml new file mode 100644 index 0000000..f937704 --- /dev/null +++ b/.serena/project.yml @@ -0,0 +1,68 @@ +# language of the project (csharp, python, rust, java, typescript, go, cpp, or ruby) +# * For C, use cpp +# * For JavaScript, use typescript +# Special requirements: +# * csharp: Requires the presence of a .sln file in the project folder. +language: kotlin + +# whether to use the project's gitignore file to ignore files +# Added on 2025-04-07 +ignore_all_files_in_gitignore: true +# list of additional paths to ignore +# same syntax as gitignore, so you can use * and ** +# Was previously called `ignored_dirs`, please update your config if you are using that. +# Added (renamed) on 2025-04-07 +ignored_paths: [] + +# whether the project is in read-only mode +# If set to true, all editing tools will be disabled and attempts to use them will result in an error +# Added on 2025-04-18 +read_only: false + + +# list of tool names to exclude. We recommend not excluding any tools, see the readme for more details. +# Below is the complete list of tools for convenience. +# To make sure you have the latest list of tools, and to view their descriptions, +# execute `uv run scripts/print_tool_overview.py`. +# +# * `activate_project`: Activates a project by name. +# * `check_onboarding_performed`: Checks whether project onboarding was already performed. +# * `create_text_file`: Creates/overwrites a file in the project directory. +# * `delete_lines`: Deletes a range of lines within a file. +# * `delete_memory`: Deletes a memory from Serena's project-specific memory store. +# * `execute_shell_command`: Executes a shell command. +# * `find_referencing_code_snippets`: Finds code snippets in which the symbol at the given location is referenced. +# * `find_referencing_symbols`: Finds symbols that reference the symbol at the given location (optionally filtered by type). +# * `find_symbol`: Performs a global (or local) search for symbols with/containing a given name/substring (optionally filtered by type). +# * `get_current_config`: Prints the current configuration of the agent, including the active and available projects, tools, contexts, and modes. +# * `get_symbols_overview`: Gets an overview of the top-level symbols defined in a given file. +# * `initial_instructions`: Gets the initial instructions for the current project. +# Should only be used in settings where the system prompt cannot be set, +# e.g. in clients you have no control over, like Claude Desktop. +# * `insert_after_symbol`: Inserts content after the end of the definition of a given symbol. +# * `insert_at_line`: Inserts content at a given line in a file. +# * `insert_before_symbol`: Inserts content before the beginning of the definition of a given symbol. +# * `list_dir`: Lists files and directories in the given directory (optionally with recursion). +# * `list_memories`: Lists memories in Serena's project-specific memory store. +# * `onboarding`: Performs onboarding (identifying the project structure and essential tasks, e.g. for testing or building). +# * `prepare_for_new_conversation`: Provides instructions for preparing for a new conversation (in order to continue with the necessary context). +# * `read_file`: Reads a file within the project directory. +# * `read_memory`: Reads the memory with the given name from Serena's project-specific memory store. +# * `remove_project`: Removes a project from the Serena configuration. +# * `replace_lines`: Replaces a range of lines within a file with new content. +# * `replace_symbol_body`: Replaces the full definition of a symbol. +# * `restart_language_server`: Restarts the language server, may be necessary when edits not through Serena happen. +# * `search_for_pattern`: Performs a search for a pattern in the project. +# * `summarize_changes`: Provides instructions for summarizing the changes made to the codebase. +# * `switch_modes`: Activates modes by providing a list of their names +# * `think_about_collected_information`: Thinking tool for pondering the completeness of collected information. +# * `think_about_task_adherence`: Thinking tool for determining whether the agent is still on track with the current task. +# * `think_about_whether_you_are_done`: Thinking tool for determining whether the task is truly completed. +# * `write_memory`: Writes a named memory (for future reference) to Serena's project-specific memory store. +excluded_tools: [] + +# initial prompt for the project. It will always be given to the LLM upon activating the project +# (contrary to the memories, which are loaded on demand). +initial_prompt: "" + +project_name: "DebugAssistant" diff --git a/app/build.gradle b/app/build.gradle index 67cf560..4981cac 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.android.application' id 'org.jetbrains.kotlin.android' + id 'org.jetbrains.kotlin.plugin.compose' id 'org.jlleitschuh.gradle.ktlint' id 'com.google.android.gms.oss-licenses-plugin' id 'io.gitlab.arturbosch.detekt' @@ -13,12 +14,12 @@ detekt { android { - compileSdk 34 + compileSdk 36 defaultConfig { applicationId "com.nagopy.android.debugassistant" minSdk 28 - targetSdk 34 + targetSdk 36 versionCode 9 versionName "1.1.3" @@ -62,30 +63,30 @@ dependencies { implementation project(":domain:usecase") implementation project(":data:repository") - implementation 'androidx.core:core-ktx:1.10.1' + implementation 'androidx.core:core-ktx:1.16.0' implementation "androidx.compose.ui:ui:$compose_version" implementation "androidx.compose.material:material:$compose_version" implementation "androidx.compose.ui:ui-tooling-preview:$compose_version" - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1' - implementation 'androidx.activity:activity-compose:1.7.2' + implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.9.2' + implementation 'androidx.activity:activity-compose:1.10.1' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version" debugImplementation "androidx.compose.ui:ui-tooling:$compose_version" - testImplementation "io.mockk:mockk:1.12.3" + testImplementation "io.mockk:mockk:1.14.0" testImplementation 'org.jetbrains.kotlin:kotlin-test' androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version" debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version" androidTestImplementation 'org.jetbrains.kotlin:kotlin-test' - androidTestImplementation "io.mockk:mockk-android:1.12.3" + androidTestImplementation "io.mockk:mockk-android:1.14.0" - implementation "io.insert-koin:koin-android:3.4.3" + implementation "io.insert-koin:koin-android:3.5.6" - implementation 'com.google.android.gms:play-services-oss-licenses:17.0.1' - implementation "androidx.appcompat:appcompat:1.6.1" + implementation 'com.google.android.gms:play-services-oss-licenses:17.1.0' + implementation "androidx.appcompat:appcompat:1.7.0" } diff --git a/build.gradle b/build.gradle index f98a048..1f9befb 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ buildscript { ext { - compose_version = '1.5.0' + compose_version = '1.8.0' } repositories { google() @@ -10,12 +10,13 @@ buildscript { } }// Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id 'com.android.application' version '8.1.2' apply false - id 'com.android.library' version '8.1.2' apply false - id 'org.jetbrains.kotlin.android' version '1.8.22' apply false - id("org.jlleitschuh.gradle.ktlint") version "11.5.1" - id("io.gitlab.arturbosch.detekt") version "1.23.1" - id 'org.jetbrains.kotlin.jvm' version '1.9.0' apply false + id 'com.android.application' version '8.8.0' apply false + id 'com.android.library' version '8.9.2' apply false + id 'org.jetbrains.kotlin.android' version '2.2.10' apply false + id 'org.jetbrains.kotlin.plugin.compose' version '2.2.10' apply false + id("org.jlleitschuh.gradle.ktlint") version "12.1.2" + id("io.gitlab.arturbosch.detekt") version "1.23.8" + id 'org.jetbrains.kotlin.jvm' version '2.2.10' apply false } task clean(type: Delete) { diff --git a/data/repository/build.gradle b/data/repository/build.gradle index 90e0827..27adaa2 100644 --- a/data/repository/build.gradle +++ b/data/repository/build.gradle @@ -4,11 +4,11 @@ plugins { } android { - compileSdk 34 + compileSdk 36 defaultConfig { minSdk 28 - targetSdk 34 + targetSdk 36 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" @@ -31,6 +31,6 @@ android { } dependencies { - implementation "io.insert-koin:koin-android:3.4.3" + implementation "io.insert-koin:koin-android:3.5.6" implementation "androidx.security:security-crypto:1.0.0" } \ No newline at end of file diff --git a/domain/usecase/build.gradle b/domain/usecase/build.gradle index 6e0a4e9..484e7bf 100644 --- a/domain/usecase/build.gradle +++ b/domain/usecase/build.gradle @@ -4,11 +4,11 @@ plugins { } android { - compileSdk 34 + compileSdk 36 defaultConfig { minSdk 28 - targetSdk 34 + targetSdk 36 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" @@ -33,8 +33,8 @@ android { dependencies { implementation project(":domain:model") implementation project(":data:repository") - implementation "io.insert-koin:koin-android:3.4.3" + implementation "io.insert-koin:koin-android:3.5.6" testImplementation 'junit:junit:4.13.2' - testImplementation "io.mockk:mockk:1.13.7" + testImplementation "io.mockk:mockk:1.14.0" testImplementation 'org.jetbrains.kotlin:kotlin-test' } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5116946..1407ffd 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Sat Feb 12 22:29:37 JST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME