Last active
June 26, 2019 08:59
-
-
Save BDOMDev/936f9bd4fd39f950d7fd7de119a648e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun encryptDownloadedFile() { | |
try { | |
val filePath = filesDir.absolutePath + "/filename" | |
val fileData = readFile(filePath) | |
//get secret key | |
val secretKey = getSecretKey(sharedPref) | |
//encrypt file | |
val encodedData = encrypt(secretKey, fileData) | |
saveFile(encodedData, filePath) | |
} catch (e: Exception) { | |
Log.d(mTag, e.message) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment