Skip to content

Release v0.0.3

Choose a tag to compare

@github-actions github-actions released this 05 Jul 16:36
· 3 commits to main since this release
Refactor: Enhance ADB command execution and integrate Moko Resources

This commit significantly refactors the ADB command execution logic for better reliability and introduces Moko Resources for multiplatform resource management.

**ADB Execution Enhancements:**
- The `AdbInput.kt` has been updated to use a more robust `exec` function. This function:
    - Dynamically locates the ADB executable in common SDK paths.
    - Uses the system shell (`cmd.exe /c` on Windows, `sh -c` on others) to correctly handle commands with pipes.
    - Sets the `HOME` and `ANDROID_SDK_HOME` environment variables for the process.
    - Includes improved error handling and debugging output for command execution.
    - Waits for the process to finish with a timeout.
- The `deviceList` function in `AdbInput.kt` now returns a String containing both STDOUT and STDERR of the `adb devices` command.
- The `isAwake` and `unlock` functions in `AdbInput.kt` have been updated with improved error handling around stream reading.

**Moko Resources Integration:**
- Added the Moko Resources plugin (`dev.icerock.mobile.multiplatform-resources`) and its dependencies (`moko-resources`, `moko-resources-compose`) to `composeApp/build.gradle.kts` and `gradle/libs.versions.toml`.
- Configured Moko Resources in `composeApp/build.gradle.kts` with `resourcesPackage.set("id.neotica.modernADB.res")`.
- Removed direct resource imports from `modernadb.composeapp.generated.resources` in `App.kt` in preparation for using Moko Resources.

**Other Changes:**
- `composeApp/build.gradle.kts`: Added logic to include platform-specific ADB tools from `src/desktopMain/composeResources/platform-tools` into the native package.
- `ADBTerminalInputs.kt`: Adjusted the `devices` case to reflect the change in `AdbInput.deviceList()` return type.