From 34f40f35387bb952980fc9d9a7e7cfba355830d0 Mon Sep 17 00:00:00 2001 From: Andrew Gunnerson Date: Fri, 13 Sep 2024 20:24:45 -0400 Subject: [PATCH] Notifications: Fix isDeviceProtectedStorage() check This fixes success notifications not showing when using the default output directory. relativeToOrNull() can include `../` components, so it's not suitable for the job. The boolean operator was also incorrect. Signed-off-by: Andrew Gunnerson --- app/src/main/java/com/chiller3/bcr/Notifications.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/chiller3/bcr/Notifications.kt b/app/src/main/java/com/chiller3/bcr/Notifications.kt index 8461a96ae..5f5b8ae3b 100644 --- a/app/src/main/java/com/chiller3/bcr/Notifications.kt +++ b/app/src/main/java/com/chiller3/bcr/Notifications.kt @@ -192,8 +192,8 @@ class Notifications( val file = outputFile.uri.toFile() - return file.relativeToOrNull(prefs.directBootInProgressDir) != null - && file.relativeToOrNull(prefs.directBootCompletedDir) != null + return file.startsWith(prefs.directBootInProgressDir) + || file.startsWith(prefs.directBootCompletedDir) } /**