Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/210.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
android中资源的数据加密_Android_Android Assets - Fatal编程技术网

android中资源的数据加密

android中资源的数据加密,android,android-assets,Android,Android Assets,我正在使用数据库文件和一些文本文件,我已经在资产文件夹中。当任何用户下载我的APK文件并提取它时,他将很容易从资产文件夹中获取我的资源 我如何加密我的所有资源,以便任何人获得我的资源时都不能使用它?假设资产文件已经加密,Java对资产文件内容进行解密将有助于满足您的需要 // Cipher that holds algorithm (E.g. AES) Cipher cipher = getCipherProbablyAES(); // Get input stream to that fi

我正在使用数据库文件和一些文本文件,我已经在资产文件夹中。当任何用户下载我的APK文件并提取它时,他将很容易从资产文件夹中获取我的资源


我如何加密我的所有资源,以便任何人获得我的资源时都不能使用它?

假设资产文件已经加密,Java对资产文件内容进行解密将有助于满足您的需要

// 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);

您可以根据应用程序的可用性选择加密级别。但是可以使用内部Java加密类您可以使用AES encryption Java类来加密和解密您的资源考虑这将有多有效。无论应用程序能做什么,攻击者也能做什么。