Skip to content

v1.1.2 Add Ota & Make Some Changes

Choose a tag to compare

@B3rr7 B3rr7 released this 16 Aug 10:24
· 198 commits to main since this release

WuWaConfig v1.1.2

Changelog for everything landed after v1.1.1 (commits b836cbf, 3348469, 6d98cd4, 4b61c81).

Backend hardening

  • AdbClient keepalive/command race — serialized keepalive pings and command dispatch behind txMutex so heartbeats no longer corrupt in-flight commands.
  • ShizukuBackend.pushFile — each chunk is now pushed with execOrThrow, surfacing failures instead of silently swallowing them.
  • LogRepository — disk writes moved to Dispatchers.IO (no longer block the main/UI thread).
  • ADB Client.log copy fix (3348469) — the ADB shell runs as a different UID and cp into the app's private directory failed silently, because AdbClient.executeShellCommand ignored the shell exit code (a failed copy looked like success and skipped the fallback). AdbBackend.copyFile now verifies with test -f; if the file didn't land, it stages via the world-writable /data/local/tmp, chmod 644 (so the app UID can read it), then copies in-process into the private target. Fixes "Failed to copy log file" on the ADB backend.

Config & optimization

  • AccessBackend.deleteFile added to the interface + all four backends (ADB/Shizuku/Root/SAF); ConfigManager.deleteConfigFiles now uses it.
  • CvarDatabase.optimizeIniText / optimizeIniTextImpl — comments out redundant/unknown CVars; covered by new CvarDatabaseOptimizeTest.
  • UpdateManager.verifySignatureMatchesInstalled — SHA-256 certificate comparison against the installed package (signingCerts helper) for OTA/signature integrity checks.
  • CvarDatabase.ensureLoaded — made non-blocking so the DB no longer stalls startup.
  • ConfigManager.deleteConfigFiles / cleanConfigFiles — return Result.success (no-op) instead of erroring on non-existent files.
  • GachaViewModel.onReceive — wrapped in viewModelScope.launch(Dispatchers.IO) so the gacha broadcast receiver no longer does work on the main thread.
  • ShizukuBackend — now takes a Context (passed from WuWaConfigApp) for correct lifecycle/scoping.

pushFile refactor

  • Extracted buildPushFilePlan / PushFilePlan into ShellUtils.kt; AdbBackend.pushFile and ShizukuBackend.pushFile now share the same planning logic.
  • Fixed an off-by-one in maxPushChunkSize — the overhead now correctly counts the two quote characters around each chunk (PRINTF_PREFIX(12) + CHUNK_QUOTE(2) + REDIRECT(4) + quoted-path length), preventing overly-large chunks that exceeded MAX_ARG_STRLEN.

Unit tests added

  • ShellUtilsTest, HashMonitorTest, ConfigManagerTest (uses mockStatic(Environment)), UpdateManagerTest (Mockito — mocks Signature.toByteArray(), which the Android stub throws on), PushFilePlanTest, CvarDatabaseOptimizeTest.
  • Mockito added to gradle/libs.versions.toml (mockito = "5.11.0") and app/build.gradle.kts testImplementation(libs.mockito.core).
  • Full suite (~90 tests) green through testDebugUnitTest.

Pity Tracker changes

  • Version bump → versionName 1.1.2 (versionCode 13).
  • Removed the background Pity Tracker service (GachaPollService):
    • Deleted app/src/main/java/com/wuwaconfig/app/service/GachaPollService.kt.
    • Removed its <service> declaration from AndroidManifest.xml.
    • Removed the supporting GachaViewModel plumbing: isPolling state, pollStoppedReceiver, startBackgroundPoll(), stopGachaPoll(), and the GachaPollService import.
    • The Pity Tracker screen no longer runs a foreground service that polls Client.log in the background.
  • Added a Stop Reading button to the Pity Tracker screen:
    • Fetch Gacha History now runs a cancellable coroutine (readJob in GachaViewModel).
    • New GachaViewModel.stopReading() cancels the in-progress read and clears loading flags.
    • A red Stop Reading button appears while reading Client.log / fetching from Kuro's API, and stops it on tap.