feat: Verification Deep Dive — Local Hosting Simulation + review fixes - #28
Merged
Conversation
- AdbShellExecutor: parseCommand now honors double-quoted args so intents with spaces in URIs no longer split mid-argument - Android11Strategy: drop "| grep" pipe — ProcessBuilder doesn't go through a shell, so the pipe was being passed as a literal grep argument and breaking App Links queries on Android 11. Filtering is already done in Kotlin by the caller. - FavoriteRepositoryImpl: move saveToDisk to Dispatchers.IO and serialize add/remove with a Mutex so concurrent calls can't double-write - LocalHostingRepositoryImpl: wrap runVerificationWorkflow in try/finally to guarantee server cleanup on early return, exception, or cancellation - VerificationDiagnostics: add INVALID_CONTENT_TYPE status and matching failure reason so wrong Content-Type responses are surfaced instead of being silently mapped to VALID - App.kt: stop the local Ktor server inside DisposableEffect before cancelling viewModelScope so the port isn't held until process exit - MainViewModel: route refreshDevices through a new RefreshDevicesUseCase + DeviceRepository.refreshDevices(), removing direct AdbShellExecutor and DeviceMapper usage from the UI layer
# Conflicts: # composeApp/build.gradle.kts # composeApp/src/jvmMain/kotlin/com/manjee/linkops/App.kt # composeApp/src/jvmMain/kotlin/com/manjee/linkops/data/repository/LocalHostingRepositoryImpl.kt # composeApp/src/jvmMain/kotlin/com/manjee/linkops/di/AppContainer.kt # composeApp/src/jvmMain/kotlin/com/manjee/linkops/ui/navigation/NavGraph.kt # composeApp/src/jvmMain/kotlin/com/manjee/linkops/ui/navigation/Screen.kt # gradle/libs.versions.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
assetlinks.jsonso developers can pre-flight App Links verification before publishing the real file. Includes fingerprint extraction from device, JSON preview, and a step-by-step workflow that triggerspm verify-app-links --re-verifyand polls for results.What's in the feature
infrastructure/server/AssetLinksServer.kt— Ktor server (127.0.0.1bound only)data/generator/AssetLinksGenerator.kt— builds the JSONdata/parser/FingerprintParser.kt— extracts SHA-256 from device outputdomain/usecase/localhosting/*— Start / Stop / Extract / Generate / RunVerificationWorkflowui/screen/localhosting/LocalHostingScreen.kt+LocalHostingViewModel.ktReview fixes (commit
16ad6a6)| greppipe (ProcessBuilder bypasses the shell — filtering is done in Kotlin instead)FavoriteRepositoryImpl: disk writes onDispatchers.IO, add/remove serialized withMutexrunVerificationWorkflowwrapped intry { } finally { }so the server is always stopped on early return / exception / cancellationAssetLinksStatus.INVALID_CONTENT_TYPEadded (was being silently mapped toVALID) — analyzer + UI updated to surface itApp.ktstops the local server before cancellingviewModelScopeon dispose, so the port is freed at app exitMainViewModel.refreshDevices()now goes throughRefreshDevicesUseCase→DeviceRepositoryinstead of touchingAdbShellExecutor/DeviceMapperdirectlyTest plan
./gradlew :composeApp:compileKotlinJvm→ BUILD SUCCESSFUL./gradlew :composeApp:jvmTest→ all green| greppipe)lsof -iTCP:<port>)assetlinks.jsonwith wrong Content-Type, confirm UI shows "Wrong Content-Type"Related: closes-out work tracked in #12.