diff options
Diffstat (limited to 'app/src/main/java/org/pacien/tincapp/utils/TincKeyring.kt')
-rw-r--r-- | app/src/main/java/org/pacien/tincapp/utils/TincKeyring.kt | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/app/src/main/java/org/pacien/tincapp/utils/TincKeyring.kt b/app/src/main/java/org/pacien/tincapp/utils/TincKeyring.kt index 89bb246..e8d9ad6 100644 --- a/app/src/main/java/org/pacien/tincapp/utils/TincKeyring.kt +++ b/app/src/main/java/org/pacien/tincapp/utils/TincKeyring.kt | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon | 2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon |
3 | * Copyright (C) 2017-2020 Pacien TRAN-GIRARD | 3 | * Copyright (C) 2017-2024 Pacien TRAN-GIRARD |
4 | * | 4 | * |
5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
@@ -43,16 +43,10 @@ object TincKeyring { | |||
43 | } | 43 | } |
44 | 44 | ||
45 | private fun tempKey(name: String): File { | 45 | private fun tempKey(name: String): File { |
46 | val file = File(AppPaths.internalCacheDir(), name) | 46 | val file = File(AppPaths.runtimeDir(), name) |
47 | file.createNewFile() | 47 | file.createNewFile() |
48 | file.deleteOnExit() | 48 | file.deleteOnExit() |
49 | file.makePrivate() | 49 | file.makePrivate() |
50 | return file | 50 | return file |
51 | } | 51 | } |
52 | |||
53 | private fun File.makePrivate() { | ||
54 | this.setExecutable(false, false) | ||
55 | this.setReadable(true, true) | ||
56 | this.setWritable(true, true) | ||
57 | } | ||
58 | } | 52 | } |