I am using database files and some text files which I have put in the Assets folder. When any user downloads my APK file and extracts it, he will get my resources from the assets folder easily.
How can I encrypt all my resources so that if anyone gets my resources, he can't use it?
Assuming the asset file is already encrypted, Java's CipherInputStream to decrypt content of the asset file would help your need
// Cipher that holds algorithm (E.g. AES)
Cipher cipher = getCipherProbablyAES();
// Get input stream to that file. Handle IOException on your own
InputStream assetFile = getAssets().open("myEncrypted.txt");
CipherInputStream cipherIS = CipherInputStream(assetFile, cipher);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With