From d04817440218aac00625accc2358b434dc098a9b Mon Sep 17 00:00:00 2001 From: Enginex0 Date: Tue, 19 May 2026 05:10:34 +0100 Subject: [PATCH] fix(spoof): guard atomicWrite errors in updateTo writeText and Files.move can throw IOException, SecurityException, or AtomicMoveNotSupportedException. The exception previously propagated through updateTo into BulletinPoller.fetchAndParse's broad catch, which mislabelled it as "network_error" in the history. Wrap atomicWrite, log the real failure, and return before resetprop so the on-disk file and live props stay consistent on failure. --- .../org/matrix/TEESimulator/config/PatchLevelManager.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/matrix/TEESimulator/config/PatchLevelManager.kt b/app/src/main/java/org/matrix/TEESimulator/config/PatchLevelManager.kt index 85e9f0c..2d8a1e6 100644 --- a/app/src/main/java/org/matrix/TEESimulator/config/PatchLevelManager.kt +++ b/app/src/main/java/org/matrix/TEESimulator/config/PatchLevelManager.kt @@ -82,7 +82,12 @@ object PatchLevelManager { ) return } - atomicWrite(date) + try { + atomicWrite(date) + } catch (e: Exception) { + SystemLogger.error("PatchLevelManager: atomicWrite failed for $date", e) + return + } applyToProps(date) SystemLogger.info("PatchLevelManager: applied patch date $date") }