-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/sdk 4214/Encryption v2 #719
Conversation
- adds remaining code from encryption task
- removes internal class - removes init block which is not needed - handles passing encryption level in a better way
- adds more performance to the code
- based on approach 2 in TAN - omits partial failure cases - moves logic to migratedb/prefs for finding data type - saves new info in boolean flag - more info in TAN
…roach from the TAN
clevertap-core/src/main/java/com/clevertap/android/sdk/StorageHelper.java
Show resolved
Hide resolved
clevertap-core/src/main/java/com/clevertap/android/sdk/cryption/CryptHandler.kt
Outdated
Show resolved
Hide resolved
clevertap-core/src/main/java/com/clevertap/android/sdk/cryption/AESGCMCrypt.kt
Outdated
Show resolved
Hide resolved
clevertap-core/src/main/java/com/clevertap/android/sdk/cryption/CryptMigrator.kt
Outdated
Show resolved
Hide resolved
clevertap-core/src/main/java/com/clevertap/android/sdk/cryption/CryptMigrator.kt
Outdated
Show resolved
Hide resolved
clevertap-core/src/main/java/com/clevertap/android/sdk/cryption/CryptMigrator.kt
Outdated
Show resolved
Hide resolved
clevertap-core/src/main/java/com/clevertap/android/sdk/cryption/CryptMigrator.kt
Outdated
Show resolved
Hide resolved
clevertap-core/src/main/java/com/clevertap/android/sdk/cryption/CryptMigrator.kt
Outdated
Show resolved
Hide resolved
clevertap-core/src/main/java/com/clevertap/android/sdk/cryption/AESGCMCrypt.kt
Outdated
Show resolved
Hide resolved
…s but plaintext to AES_GCM fails
- adds remaining code from encryption task
- removes internal class - removes init block which is not needed - handles passing encryption level in a better way
- adds more performance to the code
- the factory is created at a core instance level itself. - this allows us to have less dependencies while writing tests. - creates chance for easier mocks
- makes sure all classes are internal - avoids access for clients.
val iv: ByteArray, | ||
val encryptedBytes: ByteArray | ||
) { | ||
override fun equals(other: Any?): Boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these ever used?
val iv: ByteArray, | ||
val encryptedBytes: ByteArray | ||
) { | ||
override fun equals(other: Any?): Boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already auto generated by data class. Is there any difference?
- removes compilation errors in tests - there is still need to check correctness.
clevertap-core/src/main/java/com/clevertap/android/sdk/cryption/EncryptionLevel.kt
Show resolved
Hide resolved
…cause of && operations
- adds verify methods - adds assertions
…ld-encrypted data was still persisted
val dataMigrationRepository = DataMigrationRepository( | ||
context = context, | ||
config = config, | ||
dbAdapter = baseDatabaseManager.loadDBAdapter(context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loadDBAdapter()
heavy operation on main thread
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed this.
- moves the shared prefs migration code to the repository layer
- moved repo and database adapter load out of main thread - removes method args which are not needed
- returns a failure object instead of throwing exception
- adds nullability due to test cases problem
https://wizrocket.atlassian.net/browse/SDK-4206
[TAN][SDK] Encryption Algorithm Upgrade in SDK [W.I.P]
Support for API 21 and 22 uses a key saved in the prefs. Higher form of security for these API levels is difficult to achieve because of limitations