danikula / danikula/AndroidVideoCache

Media is encrypted but not working after cached.

Offen
#229 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Java
Sterne
5.5k
Forks
1.2k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hi,

Following up on this [issue](https://github.com/danikula/AndroidVideoCache/issues/71#issuecomment-301775416)
I wrote the `Cipher` using `XOR` encryption as you said above, but i ran into problem where data is ciphered successfully and cached but not when i try to decipher the cached file.

private fun encryptOrDecrypt(input: ByteArray, key: String) {
for (i in input.indices) {
val o = input[i] xor '0'.toByte()
input[i] = o

}
}

and i aslo added the `CipherAwareCacheWrapper`

private HttpProxyCache newHttpProxyCache() throws ProxyCacheException {
HttpUrlSource source = new HttpUrlSource(url, config.sourceInfoStorage, config.headerInjector);
FileCache cache = new FileCache(config.generateCacheFile(url), config.diskUsage);
CipherAwareCacheWrapper cipherAwareCacheWrapper = new CipherAwareCacheWrapper(cache, config.cipher);
HttpProxyCache httpProxyCache = new HttpProxyCache(source, cipherAwareCacheWrapper);
httpProxyCache.registerCacheListener(uiCacheListener);
return httpProxyCache;
}

Can you please guide me on what I'm missing up?
Thanks in advance.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.