Skip to content

Commit

Permalink
Added support for password-protected and encrypted rar archives, as w…
Browse files Browse the repository at this point in the history
…ell as tests for each; initial support ported from java-unrar, then extended and fixed
  • Loading branch information
koroshiya committed Nov 8, 2013
1 parent d1079df commit 06bdd47
Show file tree
Hide file tree
Showing 394 changed files with 27,322 additions and 0 deletions.
Binary file added bin/Main.class
Binary file not shown.
Binary file added bin/de/innosystec/unrar/Archive.class
Binary file not shown.
Binary file added bin/de/innosystec/unrar/UnrarCallback.class
Binary file not shown.
Binary file added bin/de/innosystec/unrar/Volume.class
Binary file not shown.
Binary file added bin/de/innosystec/unrar/crc/RarCRC.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added bin/de/innosystec/unrar/io/IReadOnlyAccess.class
Binary file not shown.
Binary file added bin/de/innosystec/unrar/io/Raw.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added bin/de/innosystec/unrar/rarfile/AVHeader.class
Binary file not shown.
Binary file added bin/de/innosystec/unrar/rarfile/BaseBlock.class
Binary file not shown.
Binary file added bin/de/innosystec/unrar/rarfile/BlockHeader.class
Binary file not shown.
Binary file not shown.
Binary file added bin/de/innosystec/unrar/rarfile/EAHeader.class
Binary file not shown.
Binary file not shown.
Binary file added bin/de/innosystec/unrar/rarfile/FileHeader.class
Binary file not shown.
Binary file not shown.
Binary file added bin/de/innosystec/unrar/rarfile/HostSystem.class
Binary file not shown.
Binary file not shown.
Binary file added bin/de/innosystec/unrar/rarfile/MainHeader.class
Binary file not shown.
Binary file added bin/de/innosystec/unrar/rarfile/MarkHeader.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added bin/de/innosystec/unrar/rarfile/SignHeader.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added bin/de/innosystec/unrar/tika/RARParser.class
Binary file not shown.
Binary file added bin/de/innosystec/unrar/unpack/ComprDataIO.class
Binary file not shown.
Binary file added bin/de/innosystec/unrar/unpack/Unpack.class
Binary file not shown.
Binary file added bin/de/innosystec/unrar/unpack/Unpack15.class
Binary file not shown.
Binary file added bin/de/innosystec/unrar/unpack/Unpack20.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added bin/de/innosystec/unrar/unpack/decode/Compress.class
Binary file not shown.
Binary file added bin/de/innosystec/unrar/unpack/decode/Decode.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added bin/de/innosystec/unrar/unpack/ppm/FreqData.class
Binary file not shown.
Binary file added bin/de/innosystec/unrar/unpack/ppm/ModelPPM.class
Binary file not shown.
Binary file not shown.
Binary file added bin/de/innosystec/unrar/unpack/ppm/Pointer.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added bin/de/innosystec/unrar/unpack/ppm/RarNode.class
Binary file not shown.
Binary file not shown.
Binary file added bin/de/innosystec/unrar/unpack/ppm/State.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added bin/de/innosystec/unrar/unpack/vm/BitInput.class
Binary file not shown.
Binary file added bin/de/innosystec/unrar/unpack/vm/RarVM.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added bin/de/innosystec/unrar/unpack/vm/VMFlags.class
Binary file not shown.
Binary file added bin/de/innosystec/unrar/unpack/vm/VMOpType.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added bin/de/innosystec/unrar/unsigned/UnsignedLong.class
Binary file not shown.
Binary file added bin/de/innosystec/unrar/unsigned/UnsignedShort.class
Binary file not shown.
Binary file added bin/org/apache/tika/Tika.class
Binary file not shown.
Binary file added bin/org/apache/tika/config/TikaConfig.class
Binary file not shown.
Binary file not shown.
Binary file added bin/org/apache/tika/detect/Detector.class
Binary file not shown.
Binary file added bin/org/apache/tika/detect/MagicDetector.class
Binary file not shown.
Binary file added bin/org/apache/tika/detect/NameDetector.class
Binary file not shown.
Binary file added bin/org/apache/tika/detect/TextDetector.class
Binary file not shown.
Binary file added bin/org/apache/tika/detect/TypeDetector.class
Binary file not shown.
Binary file not shown.
Binary file added bin/org/apache/tika/detect/XmlRootExtractor.class
Binary file not shown.
Binary file added bin/org/apache/tika/exception/TikaException.class
Binary file not shown.
Binary file not shown.
Binary file added bin/org/apache/tika/extractor/DocumentSelector.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added bin/org/apache/tika/fork/ForkClient.class
Binary file not shown.
Binary file added bin/org/apache/tika/fork/ForkParser.class
Binary file not shown.
Binary file added bin/org/apache/tika/fork/ForkSerializer.class
Binary file not shown.
Binary file added bin/org/apache/tika/fork/ForkServer.class
Binary file not shown.
Binary file not shown.
Binary file added bin/org/apache/tika/io/CloseShieldInputStream.class
Binary file not shown.
Binary file added bin/org/apache/tika/io/ClosedInputStream.class
Binary file not shown.
Binary file added bin/org/apache/tika/io/CountingInputStream.class
Binary file not shown.
Binary file added bin/org/apache/tika/io/IOExceptionWithCause.class
Binary file not shown.
Binary file added bin/org/apache/tika/io/IOUtils.class
Binary file not shown.
Binary file added bin/org/apache/tika/io/NullInputStream.class
Binary file not shown.
Binary file added bin/org/apache/tika/io/NullOutputStream.class
Binary file not shown.
Binary file added bin/org/apache/tika/io/ProxyInputStream.class
Binary file not shown.
Binary file added bin/org/apache/tika/io/TaggedIOException.class
Binary file not shown.
Binary file added bin/org/apache/tika/io/TaggedInputStream.class
Binary file not shown.
Binary file added bin/org/apache/tika/io/TikaInputStream.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added bin/org/apache/tika/metadata/ClimateForcast.class
Binary file not shown.
Binary file added bin/org/apache/tika/metadata/CreativeCommons.class
Binary file not shown.
Binary file added bin/org/apache/tika/metadata/DublinCore.class
Binary file not shown.
Binary file added bin/org/apache/tika/metadata/Geographic.class
Binary file not shown.
Binary file added bin/org/apache/tika/metadata/HttpHeaders.class
Binary file not shown.
Binary file added bin/org/apache/tika/metadata/MSOffice.class
Binary file not shown.
Binary file added bin/org/apache/tika/metadata/Message.class
Binary file not shown.
Binary file added bin/org/apache/tika/metadata/Metadata.class
Binary file not shown.
Binary file added bin/org/apache/tika/metadata/MetadataHelper.class
Binary file not shown.
Binary file added bin/org/apache/tika/metadata/PagedText.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added bin/org/apache/tika/metadata/Property.class
Binary file not shown.
Binary file not shown.
Binary file added bin/org/apache/tika/metadata/TIFF.class
Binary file not shown.
Binary file added bin/org/apache/tika/metadata/TikaMetadataKeys.class
Binary file not shown.
Binary file added bin/org/apache/tika/metadata/TikaMimeKeys.class
Binary file not shown.
Binary file added bin/org/apache/tika/metadata/XMPDM.class
Binary file not shown.
Binary file added bin/org/apache/tika/metadata/package-info.class
Binary file not shown.
Binary file added bin/org/apache/tika/mime/AndClause.class
Binary file not shown.
Binary file added bin/org/apache/tika/mime/Clause.class
Binary file not shown.
Binary file added bin/org/apache/tika/mime/HexCoDec.class
Binary file not shown.
Binary file added bin/org/apache/tika/mime/Magic.class
Binary file not shown.
Binary file added bin/org/apache/tika/mime/MagicMatch.class
Binary file not shown.
Binary file added bin/org/apache/tika/mime/MediaType.class
Binary file not shown.
Binary file added bin/org/apache/tika/mime/MediaTypeRegistry.class
Binary file not shown.
Binary file added bin/org/apache/tika/mime/MimeType$RootXML.class
Binary file not shown.
Binary file added bin/org/apache/tika/mime/MimeType.class
Binary file not shown.
Binary file added bin/org/apache/tika/mime/MimeTypeException.class
Binary file not shown.
Binary file added bin/org/apache/tika/mime/MimeTypes.class
Binary file not shown.
Binary file added bin/org/apache/tika/mime/MimeTypesFactory.class
Binary file not shown.
Binary file added bin/org/apache/tika/mime/MimeTypesReader.class
Binary file not shown.
Binary file not shown.
Binary file added bin/org/apache/tika/mime/OrClause.class
Binary file not shown.
Binary file not shown.
Binary file added bin/org/apache/tika/mime/Patterns.class
Binary file not shown.
Binary file added bin/org/apache/tika/parser/AutoDetectParser.class
Binary file not shown.
Binary file added bin/org/apache/tika/parser/CompositeParser.class
Binary file not shown.
Binary file added bin/org/apache/tika/parser/DefaultParser.class
Binary file not shown.
Binary file added bin/org/apache/tika/parser/DelegatingParser.class
Binary file not shown.
Binary file added bin/org/apache/tika/parser/EmptyParser.class
Binary file not shown.
Binary file added bin/org/apache/tika/parser/ErrorParser.class
Binary file not shown.
Binary file added bin/org/apache/tika/parser/ExternalParser$1.class
Binary file not shown.
Binary file added bin/org/apache/tika/parser/ExternalParser$2.class
Binary file not shown.
Binary file added bin/org/apache/tika/parser/ExternalParser.class
Binary file not shown.
Binary file added bin/org/apache/tika/parser/ParseContext.class
Binary file not shown.
Binary file added bin/org/apache/tika/parser/Parser.class
Binary file not shown.
Binary file not shown.
Binary file added bin/org/apache/tika/parser/ParserDecorator.class
Binary file not shown.
Binary file not shown.
Binary file added bin/org/apache/tika/parser/ParsingReader$1.class
Binary file not shown.
Binary file not shown.
Binary file added bin/org/apache/tika/parser/ParsingReader.class
Binary file not shown.
Binary file added bin/org/apache/tika/sax/BodyContentHandler.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added bin/org/apache/tika/sax/EmbeddedContentHandler.class
Binary file not shown.
Binary file added bin/org/apache/tika/sax/Link.class
Binary file not shown.
Binary file added bin/org/apache/tika/sax/LinkBuilder.class
Binary file not shown.
Binary file added bin/org/apache/tika/sax/LinkContentHandler.class
Binary file not shown.
Binary file added bin/org/apache/tika/sax/OfflineContentHandler.class
Binary file not shown.
Binary file added bin/org/apache/tika/sax/SafeContentHandler$1.class
Binary file not shown.
Binary file added bin/org/apache/tika/sax/SafeContentHandler$2.class
Binary file not shown.
Binary file not shown.
Binary file added bin/org/apache/tika/sax/SafeContentHandler.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added bin/org/apache/tika/sax/TeeContentHandler.class
Binary file not shown.
Binary file added bin/org/apache/tika/sax/TextContentHandler.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added bin/org/apache/tika/sax/xpath/AttributeMatcher.class
Binary file not shown.
Binary file added bin/org/apache/tika/sax/xpath/ChildMatcher.class
Binary file not shown.
Binary file not shown.
Binary file added bin/org/apache/tika/sax/xpath/ElementMatcher.class
Binary file not shown.
Binary file added bin/org/apache/tika/sax/xpath/Matcher.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added bin/org/apache/tika/sax/xpath/NodeMatcher.class
Binary file not shown.
Binary file not shown.
Binary file added bin/org/apache/tika/sax/xpath/TextMatcher.class
Binary file not shown.
Binary file added bin/org/apache/tika/sax/xpath/XPathParser.class
Binary file not shown.
Binary file added bin/org/apache/tika/utils/CharsetUtils$1.class
Binary file not shown.
Binary file added bin/org/apache/tika/utils/CharsetUtils.class
Binary file not shown.
Binary file added bin/org/apache/tika/utils/ParseUtils.class
Binary file not shown.
Binary file added bin/org/apache/tika/utils/RegexUtils.class
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions bin/services/org.apache.tika.parser.Parser
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
de.innosystec.unrar.tika.RARParser
Binary file added lib/gnu-crypto.jar
Binary file not shown.
29 changes: 29 additions & 0 deletions src/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import java.io.File;
import java.io.IOException;

import de.innosystec.unrar.Archive;
import de.innosystec.unrar.exception.RarException;


public class Main {

public static void main(String[] args){
testArchive("test1.rar");
}

private static void testArchive(String location){
Archive archive;
try {
archive = new Archive(new File(location), "test");
System.out.println(location);
System.out.println(archive.isEncrypted() ? "encrypted" : "not encrypted");
System.out.println(archive.isPasswordProtected() ? "password protected" : "unprotected");

System.out.println("");
archive.close();
} catch (RarException | IOException e) {
e.printStackTrace();
}
}

}
Loading

0 comments on commit 06bdd47

Please sign in to comment.