From 5d6529a4d8dc6dc938cd05903bfde76412ce17cd Mon Sep 17 00:00:00 2001 From: Fabian Henneke Date: Wed, 10 Jun 2020 11:19:49 +0200 Subject: Replace FileUtils with Kotlin stdlib calls (#843) --- app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'app/src/main/java/com/zeapo/pwdstore/crypto') diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt index c62b6293..77d7e70c 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt @@ -43,7 +43,6 @@ import com.zeapo.pwdstore.autofill.oreo.AutofillPreferences import com.zeapo.pwdstore.autofill.oreo.DirectoryStructure import com.zeapo.pwdstore.ui.dialogs.PasswordGeneratorDialogFragment import com.zeapo.pwdstore.ui.dialogs.XkPasswordGeneratorDialogFragment -import com.zeapo.pwdstore.utils.FileUtils import kotlinx.android.synthetic.main.decrypt_layout.crypto_password_category_decrypt import kotlinx.android.synthetic.main.decrypt_layout.crypto_password_file import kotlinx.android.synthetic.main.decrypt_layout.crypto_password_last_changed @@ -95,7 +94,7 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound { private val repoPath: String by lazy { intent.getStringExtra("REPO_PATH") } private val fullPath: String by lazy { intent.getStringExtra("FILE_PATH") } - private val name: String by lazy { getName(fullPath) } + private val name: String by lazy { File(fullPath).nameWithoutExtension } private val lastChangedString: CharSequence by lazy { getLastChangedString( intent.getLongExtra( @@ -767,13 +766,6 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound { return "/${relativePath.substring(startIndex = 0, endIndex = index + 1)}/".replace("/+".toRegex(), "/") } - /** - * Gets the name of the password (excluding .gpg) - */ - fun getName(fullPath: String): String { - return FileUtils.getBaseName(fullPath) - } - /** * /path/to/store/social/facebook.gpg -> social/facebook */ -- cgit v1.2.3