Last active
June 26, 2019 08:59
-
-
Save BDOMDev/936f9bd4fd39f950d7fd7de119a648e0 to your computer and use it in GitHub Desktop.
Revisions
-
BDOMDev revised this gist
Jun 26, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ fun encryptDownloadedFile() { try { val filePath = filesDir.absolutePath + "/filename" val fileData = readFile(filePath) //get secret key -
BDOMDev created this gist
Jun 26, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ fun encryptDownloadedFile() { try { val filePath = filesDir.absolutePath + "/file.pdf" 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) } }