From 24c4967d049ddcb174302896387925971a55cfde Mon Sep 17 00:00:00 2001 From: Teodor G Date: Tue, 11 Oct 2022 11:38:59 +0300 Subject: [PATCH 1/4] renamed overriding field to `value` --- .idea/deploymentTargetDropDown.xml | 17 +++++++++++++++++ build.gradle | 4 ++-- buildSrc/build/libs/buildSrc.jar | Bin 261 -> 261 bytes .../plugin-under-test-metadata.properties | 2 +- .../java/com/zeoflow/memo/ConcealEncryption.kt | 8 ++++---- 5 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 .idea/deploymentTargetDropDown.xml diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml new file mode 100644 index 0000000..da9379e --- /dev/null +++ b/.idea/deploymentTargetDropDown.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 4de5dd6..1d2ed2b 100644 --- a/build.gradle +++ b/build.gradle @@ -13,8 +13,8 @@ buildscript { } plugins { - id 'com.android.application' version '7.4.0-alpha07' apply false - id 'com.android.library' version '7.4.0-alpha07' apply false + id 'com.android.application' version '7.3.0' apply false + id 'com.android.library' version '7.3.0' apply false id 'org.jetbrains.kotlin.android' version '1.7.0' apply false id 'org.jetbrains.kotlin.jvm' version '1.7.0' apply false } \ No newline at end of file diff --git a/buildSrc/build/libs/buildSrc.jar b/buildSrc/build/libs/buildSrc.jar index 9b9e6bd2df2c9d8fdc1f6a903158b6c42b5cffc0..dd4e6040f7116092ec447c5eed15467bbaf64b6d 100644 GIT binary patch delta 46 scmZo=YGvXJ@MdP=VqoClU=ZHz6*`emmF31RAZ_l=0_L|FL->0=00N&4*Z=?k delta 46 tcmZo=YGvXJ@MdP=VqoClV9?lkFJvO0D$A#BK-%1!1 Date: Tue, 11 Oct 2022 13:21:28 +0300 Subject: [PATCH 2/4] updated default encryption --- memo/src/main/java/com/zeoflow/memo/MemoBuilder.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memo/src/main/java/com/zeoflow/memo/MemoBuilder.kt b/memo/src/main/java/com/zeoflow/memo/MemoBuilder.kt index 076eed6..a3430b3 100644 --- a/memo/src/main/java/com/zeoflow/memo/MemoBuilder.kt +++ b/memo/src/main/java/com/zeoflow/memo/MemoBuilder.kt @@ -55,7 +55,7 @@ class MemoBuilder @JvmOverloads constructor(context: Context = ApplicationInitia get() { return cryptoStorage } - var encryption: Encryption = ConcealEncryption("c34f5345") + var encryption: Encryption = ConcealEncryption("default") get() { if (field is ConcealEncryption) { if (!(field as ConcealEncryption).init()) { From afd517855b53664f62072351a2262df69e37809b Mon Sep 17 00:00:00 2001 From: Teodor G Date: Tue, 11 Oct 2022 13:21:48 +0300 Subject: [PATCH 3/4] updated secret key alghoritm --- memo/src/main/java/com/zeoflow/memo/ConcealEncryption.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memo/src/main/java/com/zeoflow/memo/ConcealEncryption.kt b/memo/src/main/java/com/zeoflow/memo/ConcealEncryption.kt index fd93aa6..8983c07 100644 --- a/memo/src/main/java/com/zeoflow/memo/ConcealEncryption.kt +++ b/memo/src/main/java/com/zeoflow/memo/ConcealEncryption.kt @@ -24,7 +24,7 @@ open class ConcealEncryption protected constructor( val passwordBytes = encryptionKey.toByteArray(StandardCharsets.UTF_8) val length = passwordBytes.size.coerceAtMost(keyBytes.size) System.arraycopy(passwordBytes, 0, keyBytes, 0, length) - secretKey = SecretKeySpec(keyBytes, "AES") + secretKey = SecretKeySpec(keyBytes, "AES/GCM/NoPadding") } override fun encryptionKey(): String { From fb69ad20b3005b71f8b0bf062e9416395266032e Mon Sep 17 00:00:00 2001 From: Teodor G Date: Tue, 11 Oct 2022 13:28:13 +0300 Subject: [PATCH 4/4] removed second constructor --- memo/src/main/java/com/zeoflow/memo/ConcealEncryption.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/memo/src/main/java/com/zeoflow/memo/ConcealEncryption.kt b/memo/src/main/java/com/zeoflow/memo/ConcealEncryption.kt index 8983c07..6ed14cb 100644 --- a/memo/src/main/java/com/zeoflow/memo/ConcealEncryption.kt +++ b/memo/src/main/java/com/zeoflow/memo/ConcealEncryption.kt @@ -9,13 +9,11 @@ import java.util.* import javax.crypto.* import javax.crypto.spec.SecretKeySpec -open class ConcealEncryption protected constructor( +open class ConcealEncryption constructor( private val encryptionKey: String, - init: Boolean ) : Encryption { - private val secretKey: SecretKey? - constructor(encryptionKey: String) : this(encryptionKey, true) + private val secretKey: SecretKey? init { val keyLength = 128