kkk*_*kkk 5 android android-assets
我正在使用数据库文件和一些放置在Assets文件夹中的文本文件。当任何用户下载并提取我的APK文件时,他将从资产文件夹中轻松获取我的资源。
我该如何加密我的所有资源,以便如果有人获得了我的资源,他将无法使用它?
假设资产文件已经加密,Java 的CipherInputStream解密资产文件的内容将有助于您的需求
// 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);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
853 次 |
| 最近记录: |