MCPcopy Create free account
hub / github.com/Maschell/JNUSTool / decryptStream

Method decryptStream

src/de/mas/jnustool/util/Decryption.java:416–440  ·  view source on GitHub ↗
(InputStream input,OutputStream outputStream,FEntry fileEntry)

Source from the content-addressed store, hash-verified

414 }
415
416 public void decryptStream(InputStream input,OutputStream outputStream,FEntry fileEntry) throws IOException {
417 //String [] path = fileEntry.getFullPath().split("/");
418 boolean decryptWithHash = false;
419 if(/*!path[1].equals("code") && */fileEntry.isExtractWithHash()){
420 decryptWithHash = true;
421 }
422 long fileOffset = fileEntry.getFileOffset();
423 if(decryptWithHash){
424 int BLOCKSIZE = 0x10000;
425 int HASHBLOCKSIZE = 0xFC00;
426 fileOffset = ((fileEntry.getFileOffset() / HASHBLOCKSIZE) * BLOCKSIZE);
427 }
428 input.skip(fileOffset);
429
430 boolean result = false;
431 if(!decryptWithHash){
432 result = decryptFile(input, outputStream, fileEntry);
433 }else{
434 byte[] h3 = fileEntry.getH3();
435 result = decryptFileHash(input, outputStream, fileEntry,h3);
436 }
437 if(!result){
438
439 }
440 }
441
442 private Progress progressListener = null;
443

Callers 3

decryptAsByteMethod · 0.95
decryptContentMethod · 0.95
decryptMethod · 0.95

Calls 5

decryptFileMethod · 0.95
decryptFileHashMethod · 0.95
isExtractWithHashMethod · 0.80
getFileOffsetMethod · 0.80
getH3Method · 0.80

Tested by

no test coverage detected