aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/org/pacien/tincapp/commands/PermissionFixer.kt
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/org/pacien/tincapp/commands/PermissionFixer.kt')
-rw-r--r--app/src/main/java/org/pacien/tincapp/commands/PermissionFixer.kt20
1 files changed, 0 insertions, 20 deletions
diff --git a/app/src/main/java/org/pacien/tincapp/commands/PermissionFixer.kt b/app/src/main/java/org/pacien/tincapp/commands/PermissionFixer.kt
deleted file mode 100644
index 493927c..0000000
--- a/app/src/main/java/org/pacien/tincapp/commands/PermissionFixer.kt
+++ /dev/null
@@ -1,20 +0,0 @@
1package org.pacien.tincapp.commands
2
3import android.annotation.SuppressLint
4import android.content.Context
5import org.pacien.tincapp.context.AppPaths
6import java.io.File
7
8/**
9 * @author pacien
10 */
11object PermissionFixer {
12
13 @SuppressLint("SetWorldReadable", "SetWorldWritable")
14 private fun setAllRWXPermissions(f: File): Boolean =
15 f.setReadable(true, false) && f.setWritable(true, false) && f.setExecutable(true, false)
16
17 fun makePrivateDirsPublic(ctx: Context): Boolean = listOf(AppPaths.confDir(ctx), AppPaths.logDir(ctx), AppPaths.pidDir(ctx))
18 .map { setAllRWXPermissions(it) }.all { it }
19
20}