chore(deps): upgrade ktfmt to 0.42

This commit is contained in:
Harsh Shandilya 2022-12-09 18:20:02 +05:30
parent 9f89e1dbf5
commit 2d3d6707e8
No known key found for this signature in database
9 changed files with 29 additions and 40 deletions

View file

@ -16,7 +16,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
* General purpose [DialogFragment] that can be used to accept a single text input. It provides a * General purpose [DialogFragment] that can be used to accept a single text input. It provides a
* configurable title and text input hint through the instantiation helper at * configurable title and text input hint through the instantiation helper at
* [TextInputDialog.newInstance]. Typical usage would look something like this: * [TextInputDialog.newInstance]. Typical usage would look something like this:
*
* ```kotlin * ```kotlin
* val dialog = TextInputDialog.newInstance(getString(R.string.dialog_title), getString(R.string.dialog_hint)) * val dialog = TextInputDialog.newInstance(getString(R.string.dialog_title), getString(R.string.dialog_hint))
* dialog.show(supportFragmentManager, "text_input_dialog") * dialog.show(supportFragmentManager, "text_input_dialog")

View file

@ -65,6 +65,7 @@ abstract class BaseGitActivity : AppCompatActivity() {
/** /**
* Attempt to launch the requested Git operation. * Attempt to launch the requested Git operation.
*
* @param operation The type of git operation to launch * @param operation The type of git operation to launch
*/ */
suspend fun launchGitOperation(operation: GitOp): Result<Unit, Throwable> { suspend fun launchGitOperation(operation: GitOp): Result<Unit, Throwable> {

View file

@ -463,9 +463,8 @@ class PasswordStore : BaseGitActivity() {
* *
* @param oldCategory The category to change its name * @param oldCategory The category to change its name
* @param error Determines whether to show an error to the user in the alert dialog, this error * @param error Determines whether to show an error to the user in the alert dialog, this error
* may be due to the new category the user entered already exists or the field was empty or the * may be due to the new category the user entered already exists or the field was empty or the
* destination path is outside the repository * destination path is outside the repository
*
* @see [CategoryRenameError] * @see [CategoryRenameError]
* @see [isInsideRepository] * @see [isInsideRepository]
*/ */

View file

@ -16,17 +16,14 @@ import androidx.annotation.RequiresApi
/** /**
* In order to add a new browser, do the following: * In order to add a new browser, do the following:
*
* 1. Obtain the .apk from a trusted source. For example, download it from the Play Store on your * 1. Obtain the .apk from a trusted source. For example, download it from the Play Store on your
* phone and use adb pull to get it onto your computer. We will assume that it is called * phone and use adb pull to get it onto your computer. We will assume that it is called
* browser.apk. * browser.apk.
*
* 2. Run * 2. Run
* *
* aapt dump badging browser.apk | grep package: | grep -Eo " name='[a-zA-Z0-9_\.]*" | cut -c8- * aapt dump badging browser.apk | grep package: | grep -Eo " name='[a-zA-Z0-9_\.]*" | cut -c8-
* *
* to obtain the package name (actually, the application ID) of the app in the .apk. * to obtain the package name (actually, the application ID) of the app in the .apk.
*
* 3. Run * 3. Run
* *
* apksigner verify --print-certs browser.apk | grep "#1 certificate SHA-256" | grep -Eo * apksigner verify --print-certs browser.apk | grep "#1 certificate SHA-256" | grep -Eo
@ -36,19 +33,15 @@ import androidx.annotation.RequiresApi
* the apk has a single signing certificate. Apps with multiple signers are very rare, so there is * the apk has a single signing certificate. Apps with multiple signers are very rare, so there is
* probably no need to add them. Refer to computeCertificatesHash to learn how the hash would be * probably no need to add them. Refer to computeCertificatesHash to learn how the hash would be
* computed in this case. * computed in this case.
*
* 4. Verify the package name and the hash, for example by asking other people to repeat the steps * 4. Verify the package name and the hash, for example by asking other people to repeat the steps
* above. * above.
*
* 5. Add an entry with the browser apps's package name and the hash to * 5. Add an entry with the browser apps's package name and the hash to
* TRUSTED_BROWSER_CERTIFICATE_HASH. * TRUSTED_BROWSER_CERTIFICATE_HASH.
*
* 6. Optionally, try adding the browser's package name to BROWSERS_WITH_SAVE_SUPPORT and check * 6. Optionally, try adding the browser's package name to BROWSERS_WITH_SAVE_SUPPORT and check
* whether a save request to Password Store is triggered when you submit a registration form. * whether a save request to Password Store is triggered when you submit a registration form.
*
* 7. Optionally, try adding the browser's package name to BROWSERS_WITH_MULTI_ORIGIN_SUPPORT and * 7. Optionally, try adding the browser's package name to BROWSERS_WITH_MULTI_ORIGIN_SUPPORT and
* check whether it correctly distinguishes web origins even if iframes are present on the page. You * check whether it correctly distinguishes web origins even if iframes are present on the page.
* can use https://fabianhenneke.github.io/Android-Password-Store/ as a test form. * You can use https://fabianhenneke.github.io/Android-Password-Store/ as a test form.
* *
* **Security assumption**: Browsers on this list correctly report the web origin of the top-level * **Security assumption**: Browsers on this list correctly report the web origin of the top-level
* window as part of their AssistStructure. * window as part of their AssistStructure.
@ -112,9 +105,9 @@ internal enum class BrowserMultiOriginMethod {
* *
* There are two methods used by browsers: * There are two methods used by browsers:
* - Browsers based on Android's WebView report web domains on each WebView view node, which then * - Browsers based on Android's WebView report web domains on each WebView view node, which then
* needs to be propagated to the child nodes ( [BrowserMultiOriginMethod.WebView]). * needs to be propagated to the child nodes ( [BrowserMultiOriginMethod.WebView]).
* - Browsers with custom Autofill implementations report web domains on each input field ( * - Browsers with custom Autofill implementations report web domains on each input field (
* [BrowserMultiOriginMethod.Field]). * [BrowserMultiOriginMethod.Field]).
*/ */
private val BROWSER_MULTI_ORIGIN_METHOD = private val BROWSER_MULTI_ORIGIN_METHOD =
mapOf( mapOf(

View file

@ -17,10 +17,9 @@ import kotlinx.coroutines.async
/** /**
* API for reading and accessing the public suffix list. * API for reading and accessing the public suffix list.
*
* > A "public suffix" is one under which Internet users can (or historically could) directly * > A "public suffix" is one under which Internet users can (or historically could) directly
* register names. Some > examples of public suffixes are .com, .co.uk and pvt.k12.ma.us. The Public * > register names. Some > examples of public suffixes are .com, .co.uk and pvt.k12.ma.us. The
* Suffix List is a list of all known > public suffixes. * > Public Suffix List is a list of all known > public suffixes.
* *
* Note that this implementation applies the rules of the public suffix list only and does not * Note that this implementation applies the rules of the public suffix list only and does not
* validate domains. * validate domains.
@ -51,8 +50,8 @@ internal class PublicSuffixList(
* ``` * ```
* *
* @param [domain] _must_ be a valid domain. [PublicSuffixList] performs no validation, and if any * @param [domain] _must_ be a valid domain. [PublicSuffixList] performs no validation, and if any
* unexpected values are passed (e.g., a full URL, a domain with a trailing '/', etc) this may * unexpected values are passed (e.g., a full URL, a domain with a trailing '/', etc) this may
* return an incorrect result. * return an incorrect result.
*/ */
fun getPublicSuffixPlusOneAsync(domain: String): Deferred<String?> = fun getPublicSuffixPlusOneAsync(domain: String): Deferred<String?> =
scope.async { scope.async {

View file

@ -41,7 +41,7 @@ build-detekt = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.22.0"
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.3.0" build-download = "de.undercouch:gradle-download-task:5.3.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.41" build-ktfmt = "com.facebook:ktfmt:0.42"
build-mavenpublish = "com.vanniktech:gradle-maven-publish-plugin:0.22.0" build-mavenpublish = "com.vanniktech:gradle-maven-publish-plugin:0.22.0"
build-metalava = "me.tylerbwong.gradle.metalava:plugin:0.3.2" build-metalava = "me.tylerbwong.gradle.metalava:plugin:0.3.2"
build-okhttp = "com.squareup.okhttp3:okhttp:4.10.0" build-okhttp = "com.squareup.okhttp3:okhttp:4.10.0"

View file

@ -31,7 +31,7 @@ public class OpenPgpServiceConnection(context: Context, providerPackageName: Str
* *
* @param context * @param context
* @param providerPackageName specify package name of OpenPGP provider, e.g., * @param providerPackageName specify package name of OpenPGP provider, e.g.,
* "org.sufficientlysecure.keychain" * "org.sufficientlysecure.keychain"
* @param onBoundListener callback, executed when connection to service has been established * @param onBoundListener callback, executed when connection to service has been established
*/ */
public constructor( public constructor(

View file

@ -11,17 +11,16 @@ internal object RandomPasswordGenerator {
/** /**
* Generates a random password of length [targetLength], taking the following flags in [pwFlags] * Generates a random password of length [targetLength], taking the following flags in [pwFlags]
* into account, or fails to do so and returns null: * into account, or fails to do so and returns null:
*
* - [PasswordGenerator.DIGITS]: If set, the password will contain at least one digit; if not set, * - [PasswordGenerator.DIGITS]: If set, the password will contain at least one digit; if not set,
* the password will not contain any digits. * the password will not contain any digits.
* - [PasswordGenerator.UPPERS]: If set, the password will contain at least one uppercase letter; * - [PasswordGenerator.UPPERS]: If set, the password will contain at least one uppercase letter;
* if not set, the password will not contain any uppercase letters. * if not set, the password will not contain any uppercase letters.
* - [PasswordGenerator.LOWERS]: If set, the password will contain at least one lowercase letter; * - [PasswordGenerator.LOWERS]: If set, the password will contain at least one lowercase letter;
* if not set, the password will not contain any lowercase letters. * if not set, the password will not contain any lowercase letters.
* - [PasswordGenerator.SYMBOLS]: If set, the password will contain at least one symbol; if not * - [PasswordGenerator.SYMBOLS]: If set, the password will contain at least one symbol; if not
* set, the password will not contain any symbols. * set, the password will not contain any symbols.
* - [PasswordGenerator.NO_AMBIGUOUS]: If set, the password will not contain any ambiguous * - [PasswordGenerator.NO_AMBIGUOUS]: If set, the password will not contain any ambiguous
* characters. * characters.
*/ */
fun generate(targetLength: Int, pwFlags: Int): String? { fun generate(targetLength: Int, pwFlags: Int): String? {
val bank = val bank =

View file

@ -69,18 +69,17 @@ internal object RandomPhonemesGenerator {
/** /**
* Generates a random human-readable password of length [targetLength], taking the following flags * Generates a random human-readable password of length [targetLength], taking the following flags
* in [pwFlags] into account, or fails to do so and returns null: * in [pwFlags] into account, or fails to do so and returns null:
*
* - [PasswordGenerator.DIGITS]: If set, the password will contain at least one digit; if not set, * - [PasswordGenerator.DIGITS]: If set, the password will contain at least one digit; if not set,
* the password will not contain any digits. * the password will not contain any digits.
* - [PasswordGenerator.UPPERS]: If set, the password will contain at least one uppercase letter; * - [PasswordGenerator.UPPERS]: If set, the password will contain at least one uppercase letter;
* if not set, the password will not contain any uppercase letters. * if not set, the password will not contain any uppercase letters.
* - [PasswordGenerator.LOWERS]: If set, the password will contain at least one lowercase letter; * - [PasswordGenerator.LOWERS]: If set, the password will contain at least one lowercase letter;
* if not set and [PasswordGenerator.UPPERS] is set, the password will not contain any lowercase * if not set and [PasswordGenerator.UPPERS] is set, the password will not contain any lowercase
* characters; if both are not set, an exception is thrown. * characters; if both are not set, an exception is thrown.
* - [PasswordGenerator.SYMBOLS]: If set, the password will contain at least one symbol; if not * - [PasswordGenerator.SYMBOLS]: If set, the password will contain at least one symbol; if not
* set, the password will not contain any symbols. * set, the password will not contain any symbols.
* - [PasswordGenerator.NO_AMBIGUOUS]: If set, the password will not contain any ambiguous * - [PasswordGenerator.NO_AMBIGUOUS]: If set, the password will not contain any ambiguous
* characters. * characters.
*/ */
fun generate(targetLength: Int, pwFlags: Int): String? { fun generate(targetLength: Int, pwFlags: Int): String? {
require(pwFlags hasFlag PasswordGenerator.UPPERS || pwFlags hasFlag PasswordGenerator.LOWERS) require(pwFlags hasFlag PasswordGenerator.UPPERS || pwFlags hasFlag PasswordGenerator.LOWERS)