fix(deps): update dependency com.facebook:ktfmt to v0.44 (#2490)
* fix(deps): update dependency com.facebook:ktfmt to v0.44 * chore: reformat with ktfmt 0.44 --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
251d94c9f3
commit
d04e1fa368
40 changed files with 134 additions and 29 deletions
|
@ -29,6 +29,7 @@ object PasswordRepository {
|
||||||
private val settings by unsafeLazy { Application.instance.sharedPrefs }
|
private val settings by unsafeLazy { Application.instance.sharedPrefs }
|
||||||
private val filesDir
|
private val filesDir
|
||||||
get() = Application.instance.filesDir
|
get() = Application.instance.filesDir
|
||||||
|
|
||||||
val isInitialized: Boolean
|
val isInitialized: Boolean
|
||||||
get() = repository != null
|
get() = repository != null
|
||||||
|
|
||||||
|
|
|
@ -78,6 +78,7 @@ open class PasswordItemRecyclerAdapter(coroutineScope: CoroutineScope) :
|
||||||
itemDetails =
|
itemDetails =
|
||||||
object : ItemDetailsLookup.ItemDetails<String>() {
|
object : ItemDetailsLookup.ItemDetails<String>() {
|
||||||
override fun getPosition() = absoluteAdapterPosition
|
override fun getPosition() = absoluteAdapterPosition
|
||||||
|
|
||||||
override fun getSelectionKey() = item.stableId
|
override fun getSelectionKey() = item.stableId
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,10 +163,8 @@ open class BasePgpActivity : AppCompatActivity() {
|
||||||
fun getParentPath(fullPath: String, repositoryPath: String): String {
|
fun getParentPath(fullPath: String, repositoryPath: String): String {
|
||||||
val relativePath = getRelativePath(fullPath, repositoryPath)
|
val relativePath = getRelativePath(fullPath, repositoryPath)
|
||||||
val index = relativePath.lastIndexOf("/")
|
val index = relativePath.lastIndexOf("/")
|
||||||
return "/${relativePath.substring(startIndex = 0, endIndex = index + 1)}/".replace(
|
return "/${relativePath.substring(startIndex = 0, endIndex = index + 1)}/"
|
||||||
"/+".toRegex(),
|
.replace("/+".toRegex(), "/")
|
||||||
"/"
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** /path/to/store/social/facebook.gpg -> social/facebook */
|
/** /path/to/store/social/facebook.gpg -> social/facebook */
|
||||||
|
|
|
@ -20,6 +20,7 @@ import java.io.File
|
||||||
class FolderCreationDialogFragment : DialogFragment() {
|
class FolderCreationDialogFragment : DialogFragment() {
|
||||||
|
|
||||||
private lateinit var newFolder: File
|
private lateinit var newFolder: File
|
||||||
|
|
||||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||||
val alertDialogBuilder = MaterialAlertDialogBuilder(requireContext())
|
val alertDialogBuilder = MaterialAlertDialogBuilder(requireContext())
|
||||||
alertDialogBuilder.setTitle(R.string.title_create_folder)
|
alertDialogBuilder.setTitle(R.string.title_create_folder)
|
||||||
|
@ -65,6 +66,7 @@ class FolderCreationDialogFragment : DialogFragment() {
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
private const val CURRENT_DIR_EXTRA = "CURRENT_DIRECTORY"
|
private const val CURRENT_DIR_EXTRA = "CURRENT_DIRECTORY"
|
||||||
|
|
||||||
fun newInstance(startingDirectory: String): FolderCreationDialogFragment {
|
fun newInstance(startingDirectory: String): FolderCreationDialogFragment {
|
||||||
val extras = bundleOf(CURRENT_DIR_EXTRA to startingDirectory)
|
val extras = bundleOf(CURRENT_DIR_EXTRA to startingDirectory)
|
||||||
val fragment = FolderCreationDialogFragment()
|
val fragment = FolderCreationDialogFragment()
|
||||||
|
|
|
@ -49,6 +49,7 @@ class TextInputDialog : DialogFragment() {
|
||||||
super.onCancel(dialog)
|
super.onCancel(dialog)
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val REQUEST_KEY = "text_input_dialog"
|
const val REQUEST_KEY = "text_input_dialog"
|
||||||
const val BUNDLE_KEY_TEXT = "text"
|
const val BUNDLE_KEY_TEXT = "text"
|
||||||
|
|
|
@ -600,6 +600,7 @@ class PasswordStore : BaseGitActivity() {
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
const val REQUEST_ARG_PATH = "PATH"
|
const val REQUEST_ARG_PATH = "PATH"
|
||||||
|
|
||||||
private fun isPrintable(c: Char): Boolean {
|
private fun isPrintable(c: Char): Boolean {
|
||||||
val block = UnicodeBlock.of(c)
|
val block = UnicodeBlock.of(c)
|
||||||
return (!Character.isISOControl(c) && block != null && block !== UnicodeBlock.SPECIALS)
|
return (!Character.isISOControl(c) && block != null && block !== UnicodeBlock.SPECIALS)
|
||||||
|
|
|
@ -195,6 +195,7 @@ class RepositorySettings(
|
||||||
@InstallIn(SingletonComponent::class)
|
@InstallIn(SingletonComponent::class)
|
||||||
interface RepositorySettingsEntryPoint {
|
interface RepositorySettingsEntryPoint {
|
||||||
fun gitSettings(): GitSettings
|
fun gitSettings(): GitSettings
|
||||||
|
|
||||||
@GitPreferences fun encryptedPreferences(): SharedPreferences
|
@GitPreferences fun encryptedPreferences(): SharedPreferences
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,10 +52,12 @@ class AutofillMatcher {
|
||||||
private const val MAX_NUM_MATCHES = 10
|
private const val MAX_NUM_MATCHES = 10
|
||||||
|
|
||||||
private const val PREFERENCE_PREFIX_TOKEN = "token;"
|
private const val PREFERENCE_PREFIX_TOKEN = "token;"
|
||||||
|
|
||||||
private fun tokenKey(formOrigin: FormOrigin.App) =
|
private fun tokenKey(formOrigin: FormOrigin.App) =
|
||||||
"$PREFERENCE_PREFIX_TOKEN${formOrigin.identifier}"
|
"$PREFERENCE_PREFIX_TOKEN${formOrigin.identifier}"
|
||||||
|
|
||||||
private const val PREFERENCE_PREFIX_MATCHES = "matches;"
|
private const val PREFERENCE_PREFIX_MATCHES = "matches;"
|
||||||
|
|
||||||
private fun matchesKey(formOrigin: FormOrigin) =
|
private fun matchesKey(formOrigin: FormOrigin) =
|
||||||
"$PREFERENCE_PREFIX_MATCHES${formOrigin.identifier}"
|
"$PREFERENCE_PREFIX_MATCHES${formOrigin.identifier}"
|
||||||
|
|
||||||
|
|
|
@ -121,6 +121,7 @@ enum class DirectoryStructure(val value: String) {
|
||||||
val DEFAULT = FileBased
|
val DEFAULT = FileBased
|
||||||
|
|
||||||
private val reverseMap = values().associateBy { it.value }
|
private val reverseMap = values().associateBy { it.value }
|
||||||
|
|
||||||
fun fromValue(value: String?) = if (value != null) reverseMap[value] ?: DEFAULT else DEFAULT
|
fun fromValue(value: String?) = if (value != null) reverseMap[value] ?: DEFAULT else DEFAULT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ sealed class GitException(@StringRes res: Int, vararg fmt: String) :
|
||||||
sealed class PullException(@StringRes res: Int, vararg fmt: String) : GitException(res, *fmt) {
|
sealed class PullException(@StringRes res: Int, vararg fmt: String) : GitException(res, *fmt) {
|
||||||
|
|
||||||
object PullRebaseFailed : PullException(R.string.git_pull_rebase_fail_error)
|
object PullRebaseFailed : PullException(R.string.git_pull_rebase_fail_error)
|
||||||
|
|
||||||
object PullMergeFailed : PullException(R.string.git_pull_merge_fail_error)
|
object PullMergeFailed : PullException(R.string.git_pull_merge_fail_error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +37,9 @@ sealed class GitException(@StringRes res: Int, vararg fmt: String) :
|
||||||
sealed class PushException(@StringRes res: Int, vararg fmt: String) : GitException(res, *fmt) {
|
sealed class PushException(@StringRes res: Int, vararg fmt: String) : GitException(res, *fmt) {
|
||||||
|
|
||||||
object NonFastForward : PushException(R.string.git_push_nff_error)
|
object NonFastForward : PushException(R.string.git_push_nff_error)
|
||||||
|
|
||||||
object RemoteRejected : PushException(R.string.git_push_other_error)
|
object RemoteRejected : PushException(R.string.git_push_other_error)
|
||||||
|
|
||||||
class Generic(message: String) : PushException(R.string.git_push_generic_error, message)
|
class Generic(message: String) : PushException(R.string.git_push_generic_error, message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,7 @@ class GitCommandExecutor(
|
||||||
GitCommandExecutorEntryPoint::class.java
|
GitCommandExecutorEntryPoint::class.java
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun execute(): Result<Unit, Throwable> {
|
suspend fun execute(): Result<Unit, Throwable> {
|
||||||
val gitSettings = hiltEntryPoint.gitSettings()
|
val gitSettings = hiltEntryPoint.gitSettings()
|
||||||
val snackbar =
|
val snackbar =
|
||||||
|
|
|
@ -77,10 +77,13 @@ object SshKey {
|
||||||
|
|
||||||
val sshPublicKey
|
val sshPublicKey
|
||||||
get() = if (publicKeyFile.exists()) publicKeyFile.readText() else null
|
get() = if (publicKeyFile.exists()) publicKeyFile.readText() else null
|
||||||
|
|
||||||
val canShowSshPublicKey
|
val canShowSshPublicKey
|
||||||
get() = type in listOf(Type.LegacyGenerated, Type.KeystoreNative, Type.KeystoreWrappedEd25519)
|
get() = type in listOf(Type.LegacyGenerated, Type.KeystoreNative, Type.KeystoreWrappedEd25519)
|
||||||
|
|
||||||
val exists
|
val exists
|
||||||
get() = type != null
|
get() = type != null
|
||||||
|
|
||||||
val mustAuthenticate: Boolean
|
val mustAuthenticate: Boolean
|
||||||
get() {
|
get() {
|
||||||
return runCatching {
|
return runCatching {
|
||||||
|
@ -111,6 +114,7 @@ object SshKey {
|
||||||
|
|
||||||
private val privateKeyFile
|
private val privateKeyFile
|
||||||
get() = File(context.filesDir, ".ssh_key")
|
get() = File(context.filesDir, ".ssh_key")
|
||||||
|
|
||||||
private val publicKeyFile
|
private val publicKeyFile
|
||||||
get() = File(context.filesDir, ".ssh_key.pub")
|
get() = File(context.filesDir, ".ssh_key.pub")
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,7 @@ import org.eclipse.jgit.util.FS
|
||||||
|
|
||||||
sealed class SshAuthMethod(val activity: AppCompatActivity) {
|
sealed class SshAuthMethod(val activity: AppCompatActivity) {
|
||||||
class Password(activity: AppCompatActivity) : SshAuthMethod(activity)
|
class Password(activity: AppCompatActivity) : SshAuthMethod(activity)
|
||||||
|
|
||||||
class SshKey(activity: AppCompatActivity) : SshAuthMethod(activity)
|
class SshKey(activity: AppCompatActivity) : SshAuthMethod(activity)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,26 +10,41 @@ import org.slf4j.Marker
|
||||||
abstract class AbstractLogger(private val name: String) : Logger {
|
abstract class AbstractLogger(private val name: String) : Logger {
|
||||||
|
|
||||||
abstract fun t(message: String, t: Throwable? = null, vararg args: Any?)
|
abstract fun t(message: String, t: Throwable? = null, vararg args: Any?)
|
||||||
|
|
||||||
abstract fun d(message: String, t: Throwable? = null, vararg args: Any?)
|
abstract fun d(message: String, t: Throwable? = null, vararg args: Any?)
|
||||||
|
|
||||||
abstract fun i(message: String, t: Throwable? = null, vararg args: Any?)
|
abstract fun i(message: String, t: Throwable? = null, vararg args: Any?)
|
||||||
|
|
||||||
abstract fun w(message: String, t: Throwable? = null, vararg args: Any?)
|
abstract fun w(message: String, t: Throwable? = null, vararg args: Any?)
|
||||||
|
|
||||||
abstract fun e(message: String, t: Throwable? = null, vararg args: Any?)
|
abstract fun e(message: String, t: Throwable? = null, vararg args: Any?)
|
||||||
|
|
||||||
override fun getName() = name
|
override fun getName() = name
|
||||||
|
|
||||||
override fun isTraceEnabled(marker: Marker?): Boolean = isTraceEnabled
|
override fun isTraceEnabled(marker: Marker?): Boolean = isTraceEnabled
|
||||||
|
|
||||||
override fun isDebugEnabled(marker: Marker?): Boolean = isDebugEnabled
|
override fun isDebugEnabled(marker: Marker?): Boolean = isDebugEnabled
|
||||||
|
|
||||||
override fun isInfoEnabled(marker: Marker?): Boolean = isInfoEnabled
|
override fun isInfoEnabled(marker: Marker?): Boolean = isInfoEnabled
|
||||||
|
|
||||||
override fun isWarnEnabled(marker: Marker?): Boolean = isWarnEnabled
|
override fun isWarnEnabled(marker: Marker?): Boolean = isWarnEnabled
|
||||||
|
|
||||||
override fun isErrorEnabled(marker: Marker?): Boolean = isErrorEnabled
|
override fun isErrorEnabled(marker: Marker?): Boolean = isErrorEnabled
|
||||||
|
|
||||||
override fun trace(msg: String) = t(msg)
|
override fun trace(msg: String) = t(msg)
|
||||||
|
|
||||||
override fun trace(format: String, arg: Any?) = t(format, null, arg)
|
override fun trace(format: String, arg: Any?) = t(format, null, arg)
|
||||||
|
|
||||||
override fun trace(format: String, arg1: Any?, arg2: Any?) = t(format, null, arg1, arg2)
|
override fun trace(format: String, arg1: Any?, arg2: Any?) = t(format, null, arg1, arg2)
|
||||||
|
|
||||||
override fun trace(format: String, vararg arguments: Any?) = t(format, null, *arguments)
|
override fun trace(format: String, vararg arguments: Any?) = t(format, null, *arguments)
|
||||||
|
|
||||||
override fun trace(msg: String, t: Throwable?) = t(msg, t)
|
override fun trace(msg: String, t: Throwable?) = t(msg, t)
|
||||||
|
|
||||||
override fun trace(marker: Marker, msg: String) = trace(msg)
|
override fun trace(marker: Marker, msg: String) = trace(msg)
|
||||||
|
|
||||||
override fun trace(marker: Marker?, format: String, arg: Any?) = trace(format, arg)
|
override fun trace(marker: Marker?, format: String, arg: Any?) = trace(format, arg)
|
||||||
|
|
||||||
override fun trace(marker: Marker?, format: String, arg1: Any?, arg2: Any?) =
|
override fun trace(marker: Marker?, format: String, arg1: Any?, arg2: Any?) =
|
||||||
trace(format, arg1, arg2)
|
trace(format, arg1, arg2)
|
||||||
|
|
||||||
|
@ -39,12 +54,19 @@ abstract class AbstractLogger(private val name: String) : Logger {
|
||||||
override fun trace(marker: Marker?, msg: String, t: Throwable?) = trace(msg, t)
|
override fun trace(marker: Marker?, msg: String, t: Throwable?) = trace(msg, t)
|
||||||
|
|
||||||
override fun debug(msg: String) = d(msg)
|
override fun debug(msg: String) = d(msg)
|
||||||
|
|
||||||
override fun debug(format: String, arg: Any?) = d(format, null, arg)
|
override fun debug(format: String, arg: Any?) = d(format, null, arg)
|
||||||
|
|
||||||
override fun debug(format: String, arg1: Any?, arg2: Any?) = d(format, null, arg1, arg2)
|
override fun debug(format: String, arg1: Any?, arg2: Any?) = d(format, null, arg1, arg2)
|
||||||
|
|
||||||
override fun debug(format: String, vararg arguments: Any?) = d(format, null, *arguments)
|
override fun debug(format: String, vararg arguments: Any?) = d(format, null, *arguments)
|
||||||
|
|
||||||
override fun debug(msg: String, t: Throwable?) = d(msg, t)
|
override fun debug(msg: String, t: Throwable?) = d(msg, t)
|
||||||
|
|
||||||
override fun debug(marker: Marker, msg: String) = debug(msg)
|
override fun debug(marker: Marker, msg: String) = debug(msg)
|
||||||
|
|
||||||
override fun debug(marker: Marker?, format: String, arg: Any?) = debug(format, arg)
|
override fun debug(marker: Marker?, format: String, arg: Any?) = debug(format, arg)
|
||||||
|
|
||||||
override fun debug(marker: Marker?, format: String, arg1: Any?, arg2: Any?) =
|
override fun debug(marker: Marker?, format: String, arg1: Any?, arg2: Any?) =
|
||||||
debug(format, arg1, arg2)
|
debug(format, arg1, arg2)
|
||||||
|
|
||||||
|
@ -54,12 +76,19 @@ abstract class AbstractLogger(private val name: String) : Logger {
|
||||||
override fun debug(marker: Marker?, msg: String, t: Throwable?) = debug(msg, t)
|
override fun debug(marker: Marker?, msg: String, t: Throwable?) = debug(msg, t)
|
||||||
|
|
||||||
override fun info(msg: String) = i(msg)
|
override fun info(msg: String) = i(msg)
|
||||||
|
|
||||||
override fun info(format: String, arg: Any?) = i(format, null, arg)
|
override fun info(format: String, arg: Any?) = i(format, null, arg)
|
||||||
|
|
||||||
override fun info(format: String, arg1: Any?, arg2: Any?) = i(format, null, arg1, arg2)
|
override fun info(format: String, arg1: Any?, arg2: Any?) = i(format, null, arg1, arg2)
|
||||||
|
|
||||||
override fun info(format: String, vararg arguments: Any?) = i(format, null, *arguments)
|
override fun info(format: String, vararg arguments: Any?) = i(format, null, *arguments)
|
||||||
|
|
||||||
override fun info(msg: String, t: Throwable?) = i(msg, t)
|
override fun info(msg: String, t: Throwable?) = i(msg, t)
|
||||||
|
|
||||||
override fun info(marker: Marker, msg: String) = info(msg)
|
override fun info(marker: Marker, msg: String) = info(msg)
|
||||||
|
|
||||||
override fun info(marker: Marker?, format: String, arg: Any?) = info(format, arg)
|
override fun info(marker: Marker?, format: String, arg: Any?) = info(format, arg)
|
||||||
|
|
||||||
override fun info(marker: Marker?, format: String, arg1: Any?, arg2: Any?) =
|
override fun info(marker: Marker?, format: String, arg1: Any?, arg2: Any?) =
|
||||||
info(format, arg1, arg2)
|
info(format, arg1, arg2)
|
||||||
|
|
||||||
|
@ -69,12 +98,19 @@ abstract class AbstractLogger(private val name: String) : Logger {
|
||||||
override fun info(marker: Marker?, msg: String, t: Throwable?) = info(msg, t)
|
override fun info(marker: Marker?, msg: String, t: Throwable?) = info(msg, t)
|
||||||
|
|
||||||
override fun warn(msg: String) = w(msg)
|
override fun warn(msg: String) = w(msg)
|
||||||
|
|
||||||
override fun warn(format: String, arg: Any?) = w(format, null, arg)
|
override fun warn(format: String, arg: Any?) = w(format, null, arg)
|
||||||
|
|
||||||
override fun warn(format: String, arg1: Any?, arg2: Any?) = w(format, null, arg1, arg2)
|
override fun warn(format: String, arg1: Any?, arg2: Any?) = w(format, null, arg1, arg2)
|
||||||
|
|
||||||
override fun warn(format: String, vararg arguments: Any?) = w(format, null, *arguments)
|
override fun warn(format: String, vararg arguments: Any?) = w(format, null, *arguments)
|
||||||
|
|
||||||
override fun warn(msg: String, t: Throwable?) = w(msg, t)
|
override fun warn(msg: String, t: Throwable?) = w(msg, t)
|
||||||
|
|
||||||
override fun warn(marker: Marker, msg: String) = warn(msg)
|
override fun warn(marker: Marker, msg: String) = warn(msg)
|
||||||
|
|
||||||
override fun warn(marker: Marker?, format: String, arg: Any?) = warn(format, arg)
|
override fun warn(marker: Marker?, format: String, arg: Any?) = warn(format, arg)
|
||||||
|
|
||||||
override fun warn(marker: Marker?, format: String, arg1: Any?, arg2: Any?) =
|
override fun warn(marker: Marker?, format: String, arg1: Any?, arg2: Any?) =
|
||||||
warn(format, arg1, arg2)
|
warn(format, arg1, arg2)
|
||||||
|
|
||||||
|
@ -84,12 +120,19 @@ abstract class AbstractLogger(private val name: String) : Logger {
|
||||||
override fun warn(marker: Marker?, msg: String, t: Throwable?) = warn(msg, t)
|
override fun warn(marker: Marker?, msg: String, t: Throwable?) = warn(msg, t)
|
||||||
|
|
||||||
override fun error(msg: String) = e(msg)
|
override fun error(msg: String) = e(msg)
|
||||||
|
|
||||||
override fun error(format: String, arg: Any?) = e(format, null, arg)
|
override fun error(format: String, arg: Any?) = e(format, null, arg)
|
||||||
|
|
||||||
override fun error(format: String, arg1: Any?, arg2: Any?) = e(format, null, arg1, arg2)
|
override fun error(format: String, arg1: Any?, arg2: Any?) = e(format, null, arg1, arg2)
|
||||||
|
|
||||||
override fun error(format: String, vararg arguments: Any?) = e(format, null, *arguments)
|
override fun error(format: String, vararg arguments: Any?) = e(format, null, *arguments)
|
||||||
|
|
||||||
override fun error(msg: String, t: Throwable?) = e(msg, t)
|
override fun error(msg: String, t: Throwable?) = e(msg, t)
|
||||||
|
|
||||||
override fun error(marker: Marker, msg: String) = error(msg)
|
override fun error(marker: Marker, msg: String) = error(msg)
|
||||||
|
|
||||||
override fun error(marker: Marker?, format: String, arg: Any?) = error(format, arg)
|
override fun error(marker: Marker?, format: String, arg: Any?) = error(format, arg)
|
||||||
|
|
||||||
override fun error(marker: Marker?, format: String, arg1: Any?, arg2: Any?) =
|
override fun error(marker: Marker?, format: String, arg1: Any?, arg2: Any?) =
|
||||||
error(format, arg1, arg2)
|
error(format, arg1, arg2)
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,13 @@ import logcat.logcat
|
||||||
class LogcatLogger(name: String) : AbstractLogger(name) {
|
class LogcatLogger(name: String) : AbstractLogger(name) {
|
||||||
|
|
||||||
override fun isTraceEnabled() = true
|
override fun isTraceEnabled() = true
|
||||||
|
|
||||||
override fun isDebugEnabled() = true
|
override fun isDebugEnabled() = true
|
||||||
|
|
||||||
override fun isInfoEnabled() = true
|
override fun isInfoEnabled() = true
|
||||||
|
|
||||||
override fun isWarnEnabled() = true
|
override fun isWarnEnabled() = true
|
||||||
|
|
||||||
override fun isErrorEnabled() = true
|
override fun isErrorEnabled() = true
|
||||||
|
|
||||||
// Replace slf4j's "{}" format string style with standard Java's "%s".
|
// Replace slf4j's "{}" format string style with standard Java's "%s".
|
||||||
|
|
|
@ -11,6 +11,7 @@ import org.slf4j.Logger
|
||||||
class LogcatLoggerFactory : ILoggerFactory {
|
class LogcatLoggerFactory : ILoggerFactory {
|
||||||
|
|
||||||
private val loggers = ConcurrentHashMap<String, Logger>()
|
private val loggers = ConcurrentHashMap<String, Logger>()
|
||||||
|
|
||||||
override fun getLogger(name: String): Logger {
|
override fun getLogger(name: String): Logger {
|
||||||
return loggers.getOrPut(name) { LogcatLogger(name) }
|
return loggers.getOrPut(name) { LogcatLogger(name) }
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ enum class Protocol(val pref: String) {
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
private val map = values().associateBy(Protocol::pref)
|
private val map = values().associateBy(Protocol::pref)
|
||||||
|
|
||||||
fun fromString(type: String?): Protocol {
|
fun fromString(type: String?): Protocol {
|
||||||
return map[type ?: return Ssh]
|
return map[type ?: return Ssh]
|
||||||
?: throw IllegalArgumentException("$type is not a valid Protocol")
|
?: throw IllegalArgumentException("$type is not a valid Protocol")
|
||||||
|
@ -43,6 +44,7 @@ enum class AuthMode(val pref: String) {
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
private val map = values().associateBy(AuthMode::pref)
|
private val map = values().associateBy(AuthMode::pref)
|
||||||
|
|
||||||
fun fromString(type: String?): AuthMode {
|
fun fromString(type: String?): AuthMode {
|
||||||
return map[type ?: return SshKey]
|
return map[type ?: return SshKey]
|
||||||
?: throw IllegalArgumentException("$type is not a valid AuthMode")
|
?: throw IllegalArgumentException("$type is not a valid AuthMode")
|
||||||
|
@ -66,6 +68,7 @@ constructor(
|
||||||
private set(value) {
|
private set(value) {
|
||||||
settings.edit { putString(PreferenceKeys.GIT_REMOTE_AUTH, value.pref) }
|
settings.edit { putString(PreferenceKeys.GIT_REMOTE_AUTH, value.pref) }
|
||||||
}
|
}
|
||||||
|
|
||||||
var url
|
var url
|
||||||
get() = settings.getString(PreferenceKeys.GIT_REMOTE_URL)
|
get() = settings.getString(PreferenceKeys.GIT_REMOTE_URL)
|
||||||
private set(value) {
|
private set(value) {
|
||||||
|
@ -79,41 +82,49 @@ constructor(
|
||||||
encryptedSettings.edit { remove(PreferenceKeys.HTTPS_PASSWORD) }
|
encryptedSettings.edit { remove(PreferenceKeys.HTTPS_PASSWORD) }
|
||||||
clearSavedHostKey()
|
clearSavedHostKey()
|
||||||
}
|
}
|
||||||
|
|
||||||
var authorName
|
var authorName
|
||||||
get() = settings.getString(PreferenceKeys.GIT_CONFIG_AUTHOR_NAME) ?: ""
|
get() = settings.getString(PreferenceKeys.GIT_CONFIG_AUTHOR_NAME) ?: ""
|
||||||
set(value) {
|
set(value) {
|
||||||
settings.edit { putString(PreferenceKeys.GIT_CONFIG_AUTHOR_NAME, value) }
|
settings.edit { putString(PreferenceKeys.GIT_CONFIG_AUTHOR_NAME, value) }
|
||||||
}
|
}
|
||||||
|
|
||||||
var authorEmail
|
var authorEmail
|
||||||
get() = settings.getString(PreferenceKeys.GIT_CONFIG_AUTHOR_EMAIL) ?: ""
|
get() = settings.getString(PreferenceKeys.GIT_CONFIG_AUTHOR_EMAIL) ?: ""
|
||||||
set(value) {
|
set(value) {
|
||||||
settings.edit { putString(PreferenceKeys.GIT_CONFIG_AUTHOR_EMAIL, value) }
|
settings.edit { putString(PreferenceKeys.GIT_CONFIG_AUTHOR_EMAIL, value) }
|
||||||
}
|
}
|
||||||
|
|
||||||
var useMultiplexing
|
var useMultiplexing
|
||||||
get() = settings.getBoolean(PreferenceKeys.GIT_REMOTE_USE_MULTIPLEXING, true)
|
get() = settings.getBoolean(PreferenceKeys.GIT_REMOTE_USE_MULTIPLEXING, true)
|
||||||
set(value) {
|
set(value) {
|
||||||
settings.edit { putBoolean(PreferenceKeys.GIT_REMOTE_USE_MULTIPLEXING, value) }
|
settings.edit { putBoolean(PreferenceKeys.GIT_REMOTE_USE_MULTIPLEXING, value) }
|
||||||
}
|
}
|
||||||
|
|
||||||
var proxyHost
|
var proxyHost
|
||||||
get() = proxySettings.getString(PreferenceKeys.PROXY_HOST)
|
get() = proxySettings.getString(PreferenceKeys.PROXY_HOST)
|
||||||
set(value) {
|
set(value) {
|
||||||
proxySettings.edit { putString(PreferenceKeys.PROXY_HOST, value) }
|
proxySettings.edit { putString(PreferenceKeys.PROXY_HOST, value) }
|
||||||
}
|
}
|
||||||
|
|
||||||
var proxyPort
|
var proxyPort
|
||||||
get() = proxySettings.getInt(PreferenceKeys.PROXY_PORT, -1)
|
get() = proxySettings.getInt(PreferenceKeys.PROXY_PORT, -1)
|
||||||
set(value) {
|
set(value) {
|
||||||
proxySettings.edit { putInt(PreferenceKeys.PROXY_PORT, value) }
|
proxySettings.edit { putInt(PreferenceKeys.PROXY_PORT, value) }
|
||||||
}
|
}
|
||||||
|
|
||||||
var proxyUsername
|
var proxyUsername
|
||||||
get() = settings.getString(PreferenceKeys.PROXY_USERNAME)
|
get() = settings.getString(PreferenceKeys.PROXY_USERNAME)
|
||||||
set(value) {
|
set(value) {
|
||||||
proxySettings.edit { putString(PreferenceKeys.PROXY_USERNAME, value) }
|
proxySettings.edit { putString(PreferenceKeys.PROXY_USERNAME, value) }
|
||||||
}
|
}
|
||||||
|
|
||||||
var proxyPassword
|
var proxyPassword
|
||||||
get() = proxySettings.getString(PreferenceKeys.PROXY_PASSWORD)
|
get() = proxySettings.getString(PreferenceKeys.PROXY_PASSWORD)
|
||||||
set(value) {
|
set(value) {
|
||||||
proxySettings.edit { putString(PreferenceKeys.PROXY_PASSWORD, value) }
|
proxySettings.edit { putString(PreferenceKeys.PROXY_PASSWORD, value) }
|
||||||
}
|
}
|
||||||
|
|
||||||
var rebaseOnPull
|
var rebaseOnPull
|
||||||
get() = settings.getBoolean(PreferenceKeys.REBASE_ON_PULL, true)
|
get() = settings.getBoolean(PreferenceKeys.REBASE_ON_PULL, true)
|
||||||
set(value) {
|
set(value) {
|
||||||
|
@ -122,9 +133,12 @@ constructor(
|
||||||
|
|
||||||
sealed class UpdateConnectionSettingsResult {
|
sealed class UpdateConnectionSettingsResult {
|
||||||
class MissingUsername(val newProtocol: Protocol) : UpdateConnectionSettingsResult()
|
class MissingUsername(val newProtocol: Protocol) : UpdateConnectionSettingsResult()
|
||||||
|
|
||||||
class AuthModeMismatch(val newProtocol: Protocol, val validModes: List<AuthMode>) :
|
class AuthModeMismatch(val newProtocol: Protocol, val validModes: List<AuthMode>) :
|
||||||
UpdateConnectionSettingsResult()
|
UpdateConnectionSettingsResult()
|
||||||
|
|
||||||
object Valid : UpdateConnectionSettingsResult()
|
object Valid : UpdateConnectionSettingsResult()
|
||||||
|
|
||||||
object FailedToParseUrl : UpdateConnectionSettingsResult()
|
object FailedToParseUrl : UpdateConnectionSettingsResult()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,7 @@ constructor(
|
||||||
SshKey.mustAuthenticate
|
SshKey.mustAuthenticate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun keyProvider(client: SSHClient, credentialFinder: CredentialFinder): KeyProvider? {
|
fun keyProvider(client: SSHClient, credentialFinder: CredentialFinder): KeyProvider? {
|
||||||
return if (useNewSSH) {
|
return if (useNewSSH) {
|
||||||
sshKeyManager.keyProvider(client, credentialFinder)
|
sshKeyManager.keyProvider(client, credentialFinder)
|
||||||
|
|
|
@ -130,8 +130,10 @@ constructor(
|
||||||
|
|
||||||
private val root
|
private val root
|
||||||
get() = PasswordRepository.getRepositoryDirectory()
|
get() = PasswordRepository.getRepositoryDirectory()
|
||||||
|
|
||||||
private val showHiddenContents
|
private val showHiddenContents
|
||||||
get() = settings.getBoolean(PreferenceKeys.SHOW_HIDDEN_CONTENTS, false)
|
get() = settings.getBoolean(PreferenceKeys.SHOW_HIDDEN_CONTENTS, false)
|
||||||
|
|
||||||
private val defaultSearchMode
|
private val defaultSearchMode
|
||||||
get() =
|
get() =
|
||||||
if (settings.getBoolean(PreferenceKeys.FILTER_RECURSIVELY, true)) {
|
if (settings.getBoolean(PreferenceKeys.FILTER_RECURSIVELY, true)) {
|
||||||
|
@ -142,8 +144,10 @@ constructor(
|
||||||
|
|
||||||
private val typeSortOrder
|
private val typeSortOrder
|
||||||
get() = PasswordSortOrder.getSortOrder(settings)
|
get() = PasswordSortOrder.getSortOrder(settings)
|
||||||
|
|
||||||
private val directoryStructure
|
private val directoryStructure
|
||||||
get() = AutofillPreferences.directoryStructure(getApplication())
|
get() = AutofillPreferences.directoryStructure(getApplication())
|
||||||
|
|
||||||
private val itemComparator
|
private val itemComparator
|
||||||
get() = PasswordItem.makeComparator(typeSortOrder, directoryStructure)
|
get() = PasswordItem.makeComparator(typeSortOrder, directoryStructure)
|
||||||
|
|
||||||
|
@ -428,6 +432,7 @@ open class SearchableRepositoryAdapter<T : RecyclerView.ViewHolder>(
|
||||||
}
|
}
|
||||||
|
|
||||||
private var onItemClickedListener: ((holder: T, item: PasswordItem) -> Unit)? = null
|
private var onItemClickedListener: ((holder: T, item: PasswordItem) -> Unit)? = null
|
||||||
|
|
||||||
open fun onItemClicked(
|
open fun onItemClicked(
|
||||||
listener: (holder: T, item: PasswordItem) -> Unit
|
listener: (holder: T, item: PasswordItem) -> Unit
|
||||||
): SearchableRepositoryAdapter<T> {
|
): SearchableRepositoryAdapter<T> {
|
||||||
|
@ -439,6 +444,7 @@ open class SearchableRepositoryAdapter<T : RecyclerView.ViewHolder>(
|
||||||
}
|
}
|
||||||
|
|
||||||
private var onSelectionChangedListener: ((selection: Selection<String>) -> Unit)? = null
|
private var onSelectionChangedListener: ((selection: Selection<String>) -> Unit)? = null
|
||||||
|
|
||||||
open fun onSelectionChanged(
|
open fun onSelectionChanged(
|
||||||
listener: (selection: Selection<String>) -> Unit
|
listener: (selection: Selection<String>) -> Unit
|
||||||
): SearchableRepositoryAdapter<T> {
|
): SearchableRepositoryAdapter<T> {
|
||||||
|
@ -458,6 +464,7 @@ open class SearchableRepositoryAdapter<T : RecyclerView.ViewHolder>(
|
||||||
}
|
}
|
||||||
|
|
||||||
private var selectionTracker: SelectionTracker<String>? = null
|
private var selectionTracker: SelectionTracker<String>? = null
|
||||||
|
|
||||||
fun requireSelectionTracker() = selectionTracker!!
|
fun requireSelectionTracker() = selectionTracker!!
|
||||||
|
|
||||||
private val selectedFiles
|
private val selectedFiles
|
||||||
|
@ -483,6 +490,7 @@ open class SearchableRepositoryAdapter<T : RecyclerView.ViewHolder>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final override fun getPopupText(position: Int): String {
|
final override fun getPopupText(position: Int): String {
|
||||||
return getItem(position).name[0].toString().uppercase(Locale.getDefault())
|
return getItem(position).name[0].toString().uppercase(Locale.getDefault())
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ class StaticLoggerBinder : LoggerFactoryBinder {
|
||||||
override fun getLoggerFactory(): ILoggerFactory {
|
override fun getLoggerFactory(): ILoggerFactory {
|
||||||
return loggerFactory
|
return loggerFactory
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getLoggerFactoryClassStr(): String {
|
override fun getLoggerFactoryClassStr(): String {
|
||||||
return loggerFactoryClassStr
|
return loggerFactoryClassStr
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ import logcat.logcat
|
||||||
public sealed class FormOrigin(public open val identifier: String) {
|
public sealed class FormOrigin(public open val identifier: String) {
|
||||||
|
|
||||||
public data class Web(override val identifier: String) : FormOrigin(identifier)
|
public data class Web(override val identifier: String) : FormOrigin(identifier)
|
||||||
|
|
||||||
public data class App(override val identifier: String) : FormOrigin(identifier)
|
public data class App(override val identifier: String) : FormOrigin(identifier)
|
||||||
|
|
||||||
public companion object {
|
public companion object {
|
||||||
|
|
|
@ -199,12 +199,16 @@ internal data class ClassifiedAutofillScenario<T : Any>(
|
||||||
|
|
||||||
override val allPasswordFields
|
override val allPasswordFields
|
||||||
get() = currentPassword + newPassword
|
get() = currentPassword + newPassword
|
||||||
|
|
||||||
override val passwordFieldsToFillOnMatch
|
override val passwordFieldsToFillOnMatch
|
||||||
get() = currentPassword
|
get() = currentPassword
|
||||||
|
|
||||||
override val passwordFieldsToFillOnSearch
|
override val passwordFieldsToFillOnSearch
|
||||||
get() = currentPassword
|
get() = currentPassword
|
||||||
|
|
||||||
override val passwordFieldsToFillOnGenerate
|
override val passwordFieldsToFillOnGenerate
|
||||||
get() = newPassword
|
get() = newPassword
|
||||||
|
|
||||||
override val passwordFieldsToSave
|
override val passwordFieldsToSave
|
||||||
get() = newPassword.ifEmpty { currentPassword }
|
get() = newPassword.ifEmpty { currentPassword }
|
||||||
}
|
}
|
||||||
|
@ -219,12 +223,16 @@ internal data class GenericAutofillScenario<T : Any>(
|
||||||
|
|
||||||
override val allPasswordFields
|
override val allPasswordFields
|
||||||
get() = genericPassword
|
get() = genericPassword
|
||||||
|
|
||||||
override val passwordFieldsToFillOnMatch
|
override val passwordFieldsToFillOnMatch
|
||||||
get() = if (genericPassword.size == 1) genericPassword else emptyList()
|
get() = if (genericPassword.size == 1) genericPassword else emptyList()
|
||||||
|
|
||||||
override val passwordFieldsToFillOnSearch
|
override val passwordFieldsToFillOnSearch
|
||||||
get() = if (genericPassword.size == 1) genericPassword else emptyList()
|
get() = if (genericPassword.size == 1) genericPassword else emptyList()
|
||||||
|
|
||||||
override val passwordFieldsToFillOnGenerate
|
override val passwordFieldsToFillOnGenerate
|
||||||
get() = genericPassword
|
get() = genericPassword
|
||||||
|
|
||||||
override val passwordFieldsToSave
|
override val passwordFieldsToSave
|
||||||
get() = genericPassword
|
get() = genericPassword
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,6 +76,7 @@ internal class FormField(
|
||||||
"com.google.android.material.textfield.TextInputEditText",
|
"com.google.android.material.textfield.TextInputEditText",
|
||||||
)
|
)
|
||||||
private const val ANDROID_WEB_VIEW_CLASS_NAME = "android.webkit.WebView"
|
private const val ANDROID_WEB_VIEW_CLASS_NAME = "android.webkit.WebView"
|
||||||
|
|
||||||
private fun isPasswordInputType(inputType: Int): Boolean {
|
private fun isPasswordInputType(inputType: Int): Boolean {
|
||||||
val typeClass = inputType and InputType.TYPE_MASK_CLASS
|
val typeClass = inputType and InputType.TYPE_MASK_CLASS
|
||||||
val typeVariation = inputType and InputType.TYPE_MASK_VARIATION
|
val typeVariation = inputType and InputType.TYPE_MASK_VARIATION
|
||||||
|
@ -116,6 +117,7 @@ internal class FormField(
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
private fun isSupportedHint(hint: String?) = hint in HINTS_FILLABLE
|
private fun isSupportedHint(hint: String?) = hint in HINTS_FILLABLE
|
||||||
|
|
||||||
private val EXCLUDED_TERMS =
|
private val EXCLUDED_TERMS =
|
||||||
listOf(
|
listOf(
|
||||||
"url_bar", // Chrome/Edge/Firefox address bar
|
"url_bar", // Chrome/Edge/Firefox address bar
|
||||||
|
@ -157,6 +159,7 @@ internal class FormField(
|
||||||
|
|
||||||
private val List<String>.anyMatchesFieldInfo
|
private val List<String>.anyMatchesFieldInfo
|
||||||
get() = any { fieldId.contains(it) || hint.contains(it) || htmlName.contains(it) }
|
get() = any { fieldId.contains(it) || hint.contains(it) || htmlName.contains(it) }
|
||||||
|
|
||||||
val autofillId: AutofillId = node.autofillId!!
|
val autofillId: AutofillId = node.autofillId!!
|
||||||
|
|
||||||
// Information for heuristics and exclusion rules based only on the current field
|
// Information for heuristics and exclusion rules based only on the current field
|
||||||
|
|
|
@ -156,6 +156,8 @@ internal class PublicSuffixListData(
|
||||||
|
|
||||||
internal sealed class PublicSuffixOffset {
|
internal sealed class PublicSuffixOffset {
|
||||||
data class Offset(val value: Int) : PublicSuffixOffset()
|
data class Offset(val value: Int) : PublicSuffixOffset()
|
||||||
|
|
||||||
object PublicSuffix : PublicSuffixOffset()
|
object PublicSuffix : PublicSuffixOffset()
|
||||||
|
|
||||||
object PrevailingRule : PublicSuffixOffset()
|
object PrevailingRule : PublicSuffixOffset()
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,9 +17,11 @@ tasks.withType<JavaCompile>().configureEach {
|
||||||
tasks.withType<KotlinCompile>().configureEach {
|
tasks.withType<KotlinCompile>().configureEach {
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = JavaVersion.VERSION_11.toString()
|
jvmTarget = JavaVersion.VERSION_11.toString()
|
||||||
freeCompilerArgs = freeCompilerArgs + listOf(
|
freeCompilerArgs =
|
||||||
"-opt-in=kotlin.RequiresOptIn",
|
freeCompilerArgs +
|
||||||
)
|
listOf(
|
||||||
|
"-opt-in=kotlin.RequiresOptIn",
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
* Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
|
* Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
|
||||||
* SPDX-License-Identifier: GPL-3.0-only
|
* SPDX-License-Identifier: GPL-3.0-only
|
||||||
*/
|
*/
|
||||||
plugins {
|
plugins { id("com.github.android-password-store.kotlin-jvm-library") }
|
||||||
id("com.github.android-password-store.kotlin-jvm-library")
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(projects.coroutineUtils)
|
implementation(projects.coroutineUtils)
|
||||||
|
|
|
@ -28,8 +28,11 @@ public class CoroutineTestRule(
|
||||||
public val testDispatcherProvider: DispatcherProvider =
|
public val testDispatcherProvider: DispatcherProvider =
|
||||||
object : DispatcherProvider {
|
object : DispatcherProvider {
|
||||||
override fun default(): CoroutineDispatcher = testDispatcher
|
override fun default(): CoroutineDispatcher = testDispatcher
|
||||||
|
|
||||||
override fun io(): CoroutineDispatcher = testDispatcher
|
override fun io(): CoroutineDispatcher = testDispatcher
|
||||||
|
|
||||||
override fun main(): CoroutineDispatcher = testDispatcher
|
override fun main(): CoroutineDispatcher = testDispatcher
|
||||||
|
|
||||||
override fun unconfined(): CoroutineDispatcher = testDispatcher
|
override fun unconfined(): CoroutineDispatcher = testDispatcher
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
* Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
|
* Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
|
||||||
* SPDX-License-Identifier: GPL-3.0-only
|
* SPDX-License-Identifier: GPL-3.0-only
|
||||||
*/
|
*/
|
||||||
plugins {
|
plugins { id("com.github.android-password-store.kotlin-jvm-library") }
|
||||||
id("com.github.android-password-store.kotlin-jvm-library")
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(libs.kotlin.coroutines.core)
|
implementation(libs.kotlin.coroutines.core)
|
||||||
|
|
|
@ -13,8 +13,11 @@ import kotlinx.coroutines.Dispatchers
|
||||||
public interface DispatcherProvider {
|
public interface DispatcherProvider {
|
||||||
|
|
||||||
public fun main(): CoroutineDispatcher = Dispatchers.Main
|
public fun main(): CoroutineDispatcher = Dispatchers.Main
|
||||||
|
|
||||||
public fun default(): CoroutineDispatcher = Dispatchers.Default
|
public fun default(): CoroutineDispatcher = Dispatchers.Default
|
||||||
|
|
||||||
public fun io(): CoroutineDispatcher = Dispatchers.IO
|
public fun io(): CoroutineDispatcher = Dispatchers.IO
|
||||||
|
|
||||||
public fun unconfined(): CoroutineDispatcher = Dispatchers.Unconfined
|
public fun unconfined(): CoroutineDispatcher = Dispatchers.Unconfined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
* Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
|
* Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
|
||||||
* SPDX-License-Identifier: GPL-3.0-only
|
* SPDX-License-Identifier: GPL-3.0-only
|
||||||
*/
|
*/
|
||||||
plugins {
|
plugins { id("com.github.android-password-store.kotlin-jvm-library") }
|
||||||
id("com.github.android-password-store.kotlin-jvm-library")
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies { implementation(libs.thirdparty.kotlinResult) }
|
dependencies { implementation(libs.thirdparty.kotlinResult) }
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
* Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
|
* Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
|
||||||
* SPDX-License-Identifier: GPL-3.0-only
|
* SPDX-License-Identifier: GPL-3.0-only
|
||||||
*/
|
*/
|
||||||
plugins {
|
plugins { id("com.github.android-password-store.kotlin-jvm-library") }
|
||||||
id("com.github.android-password-store.kotlin-jvm-library")
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api(projects.cryptoCommon)
|
api(projects.cryptoCommon)
|
||||||
|
|
|
@ -31,6 +31,7 @@ public sealed class GpgIdentifier {
|
||||||
return hexString
|
return hexString
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public data class UserId(val email: String) : GpgIdentifier() {
|
public data class UserId(val email: String) : GpgIdentifier() {
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return email
|
return email
|
||||||
|
|
|
@ -8,9 +8,12 @@ package app.passwordstore.crypto
|
||||||
|
|
||||||
object TestUtils {
|
object TestUtils {
|
||||||
fun getArmoredSecretKey() = this::class.java.classLoader.getResource("secret_key").readBytes()
|
fun getArmoredSecretKey() = this::class.java.classLoader.getResource("secret_key").readBytes()
|
||||||
|
|
||||||
fun getArmoredPublicKey() = this::class.java.classLoader.getResource("public_key").readBytes()
|
fun getArmoredPublicKey() = this::class.java.classLoader.getResource("public_key").readBytes()
|
||||||
|
|
||||||
fun getArmoredSecretKeyWithMultipleIdentities() =
|
fun getArmoredSecretKeyWithMultipleIdentities() =
|
||||||
this::class.java.classLoader.getResource("secret_key_multiple_identities").readBytes()
|
this::class.java.classLoader.getResource("secret_key_multiple_identities").readBytes()
|
||||||
|
|
||||||
fun getArmoredPublicKeyWithMultipleIdentities() =
|
fun getArmoredPublicKeyWithMultipleIdentities() =
|
||||||
this::class.java.classLoader.getResource("public_key_multiple_identities").readBytes()
|
this::class.java.classLoader.getResource("public_key_multiple_identities").readBytes()
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
* Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
|
* Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
|
||||||
* SPDX-License-Identifier: GPL-3.0-only
|
* SPDX-License-Identifier: GPL-3.0-only
|
||||||
*/
|
*/
|
||||||
plugins {
|
plugins { id("com.github.android-password-store.kotlin-jvm-library") }
|
||||||
id("com.github.android-password-store.kotlin-jvm-library")
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api(libs.kotlin.coroutines.core)
|
api(libs.kotlin.coroutines.core)
|
||||||
|
|
|
@ -39,7 +39,7 @@ build-agp = { module = "com.android.tools.build:gradle", version.ref = "agp" }
|
||||||
build-diffutils = "io.github.java-diff-utils:java-diff-utils:4.12"
|
build-diffutils = "io.github.java-diff-utils:java-diff-utils:4.12"
|
||||||
build-download = "de.undercouch:gradle-download-task:5.4.0"
|
build-download = "de.undercouch:gradle-download-task:5.4.0"
|
||||||
build-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
|
build-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
|
||||||
build-ktfmt = "com.facebook:ktfmt:0.43"
|
build-ktfmt = "com.facebook:ktfmt:0.44"
|
||||||
build-mavenpublish = "com.vanniktech:gradle-maven-publish-plugin:0.25.2"
|
build-mavenpublish = "com.vanniktech:gradle-maven-publish-plugin:0.25.2"
|
||||||
build-metalava = "me.tylerbwong.gradle.metalava:plugin:0.3.3"
|
build-metalava = "me.tylerbwong.gradle.metalava:plugin:0.3.3"
|
||||||
build-moshi = "com.squareup.moshi:moshi:1.14.0"
|
build-moshi = "com.squareup.moshi:moshi:1.14.0"
|
||||||
|
|
|
@ -17,12 +17,14 @@ public class OpenPgpServiceConnection(context: Context, providerPackageName: Str
|
||||||
public interface OnBound {
|
public interface OnBound {
|
||||||
|
|
||||||
public fun onBound(service: IOpenPgpService2)
|
public fun onBound(service: IOpenPgpService2)
|
||||||
|
|
||||||
public fun onError(e: Exception)
|
public fun onError(e: Exception)
|
||||||
}
|
}
|
||||||
|
|
||||||
private val mApplicationContext: Context = context.applicationContext
|
private val mApplicationContext: Context = context.applicationContext
|
||||||
public var service: IOpenPgpService2? = null
|
public var service: IOpenPgpService2? = null
|
||||||
private set
|
private set
|
||||||
|
|
||||||
private val mProviderPackageName: String? = providerPackageName
|
private val mProviderPackageName: String? = providerPackageName
|
||||||
private var mOnBoundListener: OnBound? = null
|
private var mOnBoundListener: OnBound? = null
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ class DicewarePassphraseGeneratorTest {
|
||||||
private val random = Random(1_00_000)
|
private val random = Random(1_00_000)
|
||||||
|
|
||||||
private val intGenerator = RandomIntGenerator { it.random(random) }
|
private val intGenerator = RandomIntGenerator { it.random(random) }
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun generatePassphrase() {
|
fun generatePassphrase() {
|
||||||
val die = Die(6, intGenerator)
|
val die = Die(6, intGenerator)
|
||||||
|
|
|
@ -2,6 +2,4 @@
|
||||||
* Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
|
* Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
|
||||||
* SPDX-License-Identifier: GPL-3.0-only
|
* SPDX-License-Identifier: GPL-3.0-only
|
||||||
*/
|
*/
|
||||||
plugins {
|
plugins { id("com.github.android-password-store.kotlin-jvm-library") }
|
||||||
id("com.github.android-password-store.kotlin-jvm-library")
|
|
||||||
}
|
|
||||||
|
|
|
@ -2,6 +2,4 @@
|
||||||
* Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
|
* Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
|
||||||
* SPDX-License-Identifier: GPL-3.0-only
|
* SPDX-License-Identifier: GPL-3.0-only
|
||||||
*/
|
*/
|
||||||
plugins {
|
plugins { id("com.github.android-password-store.kotlin-jvm-library") }
|
||||||
id("com.github.android-password-store.kotlin-jvm-library")
|
|
||||||
}
|
|
||||||
|
|
|
@ -6,5 +6,6 @@ import io.sentry.protocol.User
|
||||||
|
|
||||||
public class Scope {
|
public class Scope {
|
||||||
public var user: User? = null
|
public var user: User? = null
|
||||||
|
|
||||||
public fun setTag(tag: String, value: String) {}
|
public fun setTag(tag: String, value: String) {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue