fix(droiddeckctl): logs latest works without root

`logs latest` pulled the session folder under getFilesDir(), which adb
cannot read on an unrooted device, so it always failed with "Permission
denied" and droiddeck-scenario kept no logs for failed runs.

The agent bridge gets a `logs` method that writes the Share logs archive
to the app's external files folder (agent-logs/), and droiddeckctl pulls
that zip and unpacks it into the destination with the session's files at
the top, as before. Builds without the method still get the old pull.
This commit is contained in:
angelrenefm authored and Kurt Himebauch committed 2026-11-05 13:52:43 -05:00
1 parent 4b6cba0a6d
commit 2fb066507a
7 files changed
+128 -6

No files matched your search

@@ -158,13 +158,14 @@ internal object EnhancedSessionLogShare {
context: Context,
folder: File,
onProgress: ((Float) -> Unit)? = null,
outputDirectory: File = SessionLogShare.shareDir(context),
limits: EnhancedShareLimits = EnhancedShareLimits(maxFilesPerArchive = 512),
): File? {
if (!folder.isDirectory || Files.isSymbolicLink(folder.toPath()) ||
limits.maxFilesPerArchive < 1 || limits.maxBytesPerFile < 1 || limits.maxBytesTotal < 1) {
return null
}
val out = SessionLogShare.shareDir(context).apply { deleteRecursively(); mkdirs() }
val out = outputDirectory.apply { deleteRecursively(); mkdirs() }
val redactionLearningComplete = LogRedactor.learnFromRuntime(LinuxRuntime.rootDir(context))
val discovery = collect(context, folder, limits.maxDiscoveredFiles, legacy = true)
val candidates = discovery.candidates.filter { it.linePrefix == null }
@@ -75,8 +75,8 @@ object SessionLogShare {
}
fun zipFolder(context: Context, folder: File, onProgress: ((Float) -> Unit)? = null): File? {
return EnhancedSessionLogShare.createLegacy(context, folder, onProgress)
fun zipFolder(context: Context, folder: File, out: File = shareDir(context), onProgress: ((Float) -> Unit)? = null): File? {
return EnhancedSessionLogShare.createLegacy(context, folder, onProgress, out)
}
const val STORES_DIR = "stores"