From 7e2eb2425e7b9b6ccb37b7b89f19de3fa7a20c44 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sat, 15 May 2021 12:56:49 +0530 Subject: all: reformat with Spotless again Signed-off-by: Harsh Shandilya --- .../me/msfjarvis/openpgpktx/AutocryptPeerUpdate.kt | 6 ++++- .../me/msfjarvis/openpgpktx/util/OpenPgpApi.kt | 27 +++++++++++++++------- .../openpgpktx/util/OpenPgpServiceConnection.kt | 7 +++++- .../me/msfjarvis/openpgpktx/util/OpenPgpUtils.kt | 11 +++++++-- 4 files changed, 39 insertions(+), 12 deletions(-) (limited to 'openpgp-ktx/src/main/java/me') diff --git a/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/AutocryptPeerUpdate.kt b/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/AutocryptPeerUpdate.kt index f81b72a4..45ee5755 100644 --- a/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/AutocryptPeerUpdate.kt +++ b/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/AutocryptPeerUpdate.kt @@ -15,7 +15,11 @@ public class AutocryptPeerUpdate() : Parcelable { private var effectiveDate: Date? = null private lateinit var preferEncrypt: PreferEncrypt - internal constructor(keyData: ByteArray?, effectiveDate: Date?, preferEncrypt: PreferEncrypt) : this() { + internal constructor( + keyData: ByteArray?, + effectiveDate: Date?, + preferEncrypt: PreferEncrypt + ) : this() { this.keyData = keyData this.effectiveDate = effectiveDate this.preferEncrypt = preferEncrypt diff --git a/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/util/OpenPgpApi.kt b/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/util/OpenPgpApi.kt index c855f619..91523a54 100644 --- a/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/util/OpenPgpApi.kt +++ b/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/util/OpenPgpApi.kt @@ -21,7 +21,11 @@ public class OpenPgpApi(private val context: Context, private val service: IOpen private val pipeIdGen: AtomicInteger = AtomicInteger() - public suspend fun executeApi(data: Intent, inputStream: InputStream?, outputStream: OutputStream?): Intent { + public suspend fun executeApi( + data: Intent, + inputStream: InputStream?, + outputStream: OutputStream? + ): Intent { var input: ParcelFileDescriptor? = null return try { if (inputStream != null) { @@ -124,7 +128,8 @@ public class OpenPgpApi(private val context: Context, private val service: IOpen * * This action uses no extras. */ - public const val ACTION_CHECK_PERMISSION: String = "org.openintents.openpgp.action.CHECK_PERMISSION" + public const val ACTION_CHECK_PERMISSION: String = + "org.openintents.openpgp.action.CHECK_PERMISSION" /** * Sign text resulting in a cleartext signature Some magic pre-processing of the text is done to @@ -178,9 +183,11 @@ public class OpenPgpApi(private val context: Context, private val service: IOpen * passphrase) String EXTRA_ORIGINAL_FILENAME (original filename to be encrypted as metadata) * boolean EXTRA_ENABLE_COMPRESSION (enable ZLIB compression, default ist true) */ - public const val ACTION_SIGN_AND_ENCRYPT: String = "org.openintents.openpgp.action.SIGN_AND_ENCRYPT" + public const val ACTION_SIGN_AND_ENCRYPT: String = + "org.openintents.openpgp.action.SIGN_AND_ENCRYPT" - public const val ACTION_QUERY_AUTOCRYPT_STATUS: String = "org.openintents.openpgp.action.QUERY_AUTOCRYPT_STATUS" + public const val ACTION_QUERY_AUTOCRYPT_STATUS: String = + "org.openintents.openpgp.action.QUERY_AUTOCRYPT_STATUS" /** * Decrypts and verifies given input stream. This methods handles encrypted-only, @@ -208,7 +215,8 @@ public class OpenPgpApi(private val context: Context, private val service: IOpen * returned extras: OpenPgpDecryptMetadata RESULT_METADATA String RESULT_CHARSET (charset which * was specified in the headers of ascii armored input, if any) */ - public const val ACTION_DECRYPT_METADATA: String = "org.openintents.openpgp.action.DECRYPT_METADATA" + public const val ACTION_DECRYPT_METADATA: String = + "org.openintents.openpgp.action.DECRYPT_METADATA" /** * Select key id for signing @@ -217,7 +225,8 @@ public class OpenPgpApi(private val context: Context, private val service: IOpen * * returned extras: long EXTRA_SIGN_KEY_ID */ - public const val ACTION_GET_SIGN_KEY_ID: String = "org.openintents.openpgp.action.GET_SIGN_KEY_ID" + public const val ACTION_GET_SIGN_KEY_ID: String = + "org.openintents.openpgp.action.GET_SIGN_KEY_ID" /** * Get key ids based on given user ids (=emails) @@ -254,7 +263,8 @@ public class OpenPgpApi(private val context: Context, private val service: IOpen */ public const val ACTION_BACKUP: String = "org.openintents.openpgp.action.BACKUP" - public const val ACTION_UPDATE_AUTOCRYPT_PEER: String = "org.openintents.openpgp.action.UPDATE_AUTOCRYPT_PEER" + public const val ACTION_UPDATE_AUTOCRYPT_PEER: String = + "org.openintents.openpgp.action.UPDATE_AUTOCRYPT_PEER" /* Intent extras */ public const val EXTRA_API_VERSION: String = "api_version" @@ -323,7 +333,8 @@ public class OpenPgpApi(private val context: Context, private val service: IOpen public const val EXTRA_DATA_LENGTH: String = "data_length" public const val EXTRA_DECRYPTION_RESULT: String = "decryption_result" public const val EXTRA_SENDER_ADDRESS: String = "sender_address" - public const val EXTRA_SUPPORT_OVERRIDE_CRYPTO_WARNING: String = "support_override_crpto_warning" + public const val EXTRA_SUPPORT_OVERRIDE_CRYPTO_WARNING: String = + "support_override_crpto_warning" public const val EXTRA_AUTOCRYPT_PEER_ID: String = "autocrypt_peer_id" public const val EXTRA_AUTOCRYPT_PEER_UPDATE: String = "autocrypt_peer_update" public const val EXTRA_AUTOCRYPT_PEER_GOSSIP_UPDATES: String = "autocrypt_peer_gossip_updates" diff --git a/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/util/OpenPgpServiceConnection.kt b/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/util/OpenPgpServiceConnection.kt index 528c0127..67796c26 100644 --- a/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/util/OpenPgpServiceConnection.kt +++ b/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/util/OpenPgpServiceConnection.kt @@ -65,7 +65,12 @@ public class OpenPgpServiceConnection(context: Context, providerPackageName: Str val serviceIntent = Intent(OpenPgpApi.SERVICE_INTENT_2) // NOTE: setPackage is very important to restrict the intent to this provider only! serviceIntent.setPackage(mProviderPackageName) - val connect = mApplicationContext.bindService(serviceIntent, mServiceConnection, Context.BIND_AUTO_CREATE) + val connect = + mApplicationContext.bindService( + serviceIntent, + mServiceConnection, + Context.BIND_AUTO_CREATE + ) if (!connect) { throw Exception("bindService() returned false!") } diff --git a/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/util/OpenPgpUtils.kt b/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/util/OpenPgpUtils.kt index ca7e3d3d..c70d9c3c 100644 --- a/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/util/OpenPgpUtils.kt +++ b/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/util/OpenPgpUtils.kt @@ -13,7 +13,10 @@ import java.util.regex.Pattern public object OpenPgpUtils { private val PGP_MESSAGE: Pattern = - Pattern.compile(".*?(-----BEGIN PGP MESSAGE-----.*?-----END PGP MESSAGE-----).*", Pattern.DOTALL) + Pattern.compile( + ".*?(-----BEGIN PGP MESSAGE-----.*?-----END PGP MESSAGE-----).*", + Pattern.DOTALL + ) private val PGP_SIGNED_MESSAGE: Pattern = Pattern.compile( ".*?(-----BEGIN PGP SIGNED MESSAGE-----.*?-----BEGIN PGP SIGNATURE-----.*?-----END PGP SIGNATURE-----).*", @@ -103,5 +106,9 @@ public object OpenPgpUtils { return if (userIdBuilder.isEmpty()) null else userIdBuilder.toString() } - public class UserId(public val name: String?, public val email: String?, public val comment: String?) : Serializable + public class UserId( + public val name: String?, + public val email: String?, + public val comment: String? + ) : Serializable } -- cgit v1.2.3