mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 05:16:01 +00:00
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:
1 parent
4b6cba0a6d
commit
2fb066507a
7 files changed
+128
-6
No files matched your search
@@ -26,6 +26,21 @@ class SessionLogShareZipTest {
|
||||
|
||||
@After fun resetSourceOpener() = resetSecureSourceOpener()
|
||||
|
||||
@Test fun anArchiveCanBeWrittenOutsideTheShareFolder() {
|
||||
val session = File(LinuxRuntime.logDir(app), "2026-11-03-01-steam").apply { mkdirs() }
|
||||
val out = File(app.getExternalFilesDir(null), "agent-logs")
|
||||
try {
|
||||
File(session, "session.log").writeText("booted\n")
|
||||
val zip = SessionLogShare.zipFolder(app, session, out)!!
|
||||
assertEquals(out, zip.parentFile)
|
||||
assertFalse(File(app.cacheDir, "share").exists())
|
||||
ZipFile(zip).use { assertTrue(it.getEntry("${session.name}/session.log") != null) }
|
||||
} finally {
|
||||
out.deleteRecursively()
|
||||
session.deleteRecursively()
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun aLargeSteamLogIsRedactedInTheSharedArchive() {
|
||||
val session = File(LinuxRuntime.logDir(app), "2026-10-08-02-steam").apply { mkdirs() }
|
||||
val raw = File(session, "steam-42.log")
|
||||
|
||||
Reference in new issue
Block a user