私のプロジェクトにはビデオがあります。セキュリティのために、私は非常にうまく動作しているビデオファイルを暗号化します。 が、問題のバイトを渡すことが可能ということであるである((復号化される)私は、ファイルを渡す必要があります。この方法ではどのように私はアンドロイドのバイトからビデオを再生することができます
**videoView.setVideoPath("/mnt/sdcard/intro_video.3gp");**
ので、私は、ファイルのパスのためのSDカード上の復号化されたファイルを作成していますということです復号化された)をビデオビューで直接表示します。暗号化にCipherを使用しています。
は、ここで私はあなたがそれを行うことができます疑う
private void decryption()throws Exception {
// TODO Auto-generated method stub
String filePath2 = path + "en/encVideo";
String filePath3 = path + "de/decVideo";
File decfile = new File(filePath3);
if(!decfile.exists())
decfile.createNewFile();
File outfile = new File(filePath2);
int read;
FileInputStream encfis = new FileInputStream(outfile);
Cipher decipher = Cipher.getInstance("AES");
decipher.init(Cipher.DECRYPT_MODE, skey);
FileOutputStream decfos = new FileOutputStream(decfile);
CipherOutputStream cos = new CipherOutputStream(decfos,decipher);
while((read=encfis.read()) != -1)
{
cos.write(read);
cos.flush();
}
cos.close();
}
こんにちは@Youddh、私は似たような解決策を探しています。作業コードを共有できますか? – user1444172
@ user1444172申し訳ありませんが私の知識それは不可能なので、私はそれを再生する元のバイトに充電する(いくつかのバイトの変更と)sdcardでファイルを作成する(聞いて、答えはhttp://stackoverflow.com/questions/です4576388/changing-a-specific-byte-in-a-file) – Youddh