Comments (46)
please support it
from junrar.
There are no plans to support it right now.
from junrar.
@gotson I started working on it.
The good news is: RAR5 is almost entirely a separate path from RAR3 (and below).
The sad news is: unrar had plenty of changes on the RAR3 front, so now I'm trying to choose to either bring those changes over or maybe do some extra work and leave it as is while bringing only RAR5.
For now, I'm gonna do the latter. I can see if I can bring over the other changes later.
from junrar.
RAR 5 format is not supported, Is there any plans to support it?
from junrar.
Dear development team,
Are there any plans to start support Rar version 5 in the near future?
from junrar.
http://sevenzipjbind.sourceforge.net/
This library can parse rar5 files and many others. It is a JNA wrapper for 7zip.
from junrar.
i will take a try.
i have taken a look at the rar5.0 format, it changes a lot.i will try my best,but i wont be finished soon。
from junrar.
Just a note to anyone interested, I've started updating the code against the latest version of UnRAR.
It'll take a while, but we'll get RAR5 support... eventually...
from junrar.
There are no plans to add this, in near or far future. The format is completely different from the rar 4 handled in this library.
The code for junrar is a java port of the freely available code of the C unrar library, it's more than 10 years old. I don't think anyone will spend the time to do this for rar 5. It would require considerable time and technical ability.
from junrar.
Though it seems this won't happen in the near future, please don't use unrar's code which is not free. See https://fedoraproject.org/wiki/Licensing:Unrar. 7zip support rar using unrar so please don't use that, either.
from junrar.
What about https://formats.kaitai.io/rar/index.html? It seems to me they can at least read rar v5. But I have not tried it yet.
from junrar.
@gotson Hi,
Is it possible to use jni to achieve? UnRAR have c++ source code.
https://www.rarlab.com/rar/unrarsrc-6.0.3.tar.gz
from junrar.
@andrebrait i added documentation on how to run regression testing locally, that will most likely help you: https://github.com/junrar/junrar/blob/master/CONTRIBUTING.md#regression-testing
from junrar.
@beothorn Is there a reason for this?
from junrar.
RAR 5 format is not supported, Is there any plans to support it?
from junrar.
i have taken a look at the rar5.0 format, it changes a lot.i will try my best,but i wont be finished soon。
The kaitai tool mentioned above already contain the definition of the rar5 archive. It might come handy to start the implementation?
from junrar.
i have taken a look at the rar5.0 format, it changes a lot.i will try my best,but i wont be finished soon。
The kaitai tool mentioned above already contain the definition of the rar5 archive. It might come handy to start the implementation?
thank you for your advice. i will take a look
from junrar.
@gotson
I've read that document,the rar v5 format is not yet implemented。
from junrar.
Yes, kaitai is just defining the arrangement of blocks in a file format. It doesn't implement uncompressing rar5, but it gives you the structure of the rar5 files. Maybe it can help, maybe not.
from junrar.
When I read a rar5 file. the exception can not be catched.
try {
a = new Archive(new FileVolumeManager(f));
} catch (RarException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
no matter which version 0.7 or 7.3.0. I use JDK8
from junrar.
When I read a rar5 file. the exception can not be catched.
There is a test that covers that.
It could come from your archive.
Can you perform a unrar l <archive.rar>
with your file?
On the rar5.rar
file in our test folder, here is what i get:
> unrar l rar5.rar
UNRAR 5.91 freeware Copyright (c) 1993-2020 Alexander Roshal
Archive: rar5.rar
Details: RAR 5
from junrar.
Thank you for the quick response. do you mean I can catch the eception with the way in your @test code? for "unrar", is it a shell command or a new method in your junrar?
from junrar.
What I am saying is that a rar5 will throw an exception, as shown in the test. So the problem is probably with your file.
Unrar is the free executable provided by rarlab, you can download it on their website.
from junrar.
ok, I see.
from junrar.
7zip completed rar5 decompress algorithm which is open source, but it's written by c++
from junrar.
Dear development team,
Are there any plans to start support Rar version 5 in the near future?
from junrar.
@aomsweet I have not checked it by running but it seems this project is trying to achieve the same thing you describing? using UnRAR with jni, also not sure does this support RAR5 or not.
https://github.com/vsoftio/unrar-android
from junrar.
@syedecryptr Hi,
I think it should be possible, but I'm not familiar with C++.
from junrar.
To use JNI one would need to write all the bindings from Java to C++.
Then you have the problem of compiling the underlying library for many OSes and cpu architectures.
Either you ship a barebone jar with only JNI bindings, and you leave the user to compile their own native library.
Or you ship native libraries for many targets inside the jar, and use a special loader to load the right one.
The second route is very complex, there are so many variants that it's impossible to build everything in a repeatable environment so you can follow upstream library releases.
Anyhow Junrar is plain Java unrar, so even if someone was willing to go the JNI route, it would need to be done in a separate project in order to keep junrar true to its mandate of being plain java.
from junrar.
Made a flutter plugin to unrar a file, up to RAR4 used junrar and for RAR5 used custom dart code if interested check :
https://github.com/syedecryptr/unrar_file
from junrar.
This .NET library has RAR5 (without decryption currently): https://github.com/adamhathcock/sharpcompress
It should be much more easier to translate C# -> Java, than C -> Java.
from junrar.
How the android app named Simple Unrar to extract rar5 file? they declare "!!! Now supporting RAR version 5 !!!".The link as follows: https://play.google.com/store/apps/details?id=com.resonancelab.unrar&hl=en_US&gl=US
from junrar.
@focuseyes360 The UnRAR tool is open source. Anyone with enough time and patience can technically port it to whatever platform they choose. I'm guessing these guys either did that or they're using some native library with a JNA/JNI wrapper.
from junrar.
@linsui you can use UnRAR's code to do anything related to opening and handling RAR files.
You cannot use it only if you're trying to compress to RAR or reverse-engineer the format.
It's the exact same license this repository uses.
Since it's permissive, you can even use it inside GPL'd code and whatnot.
It's right here in the license:
2. The UnRAR sources may be used in any software to handle RAR
archives without limitations free of charge, but cannot be used
to re-create the RAR compression algorithm, which is proprietary.
Distribution of modified UnRAR sources in separate form or as a
part of other software is permitted, provided that it is clearly
stated in the documentation and source comments that the code may
not be used to develop a RAR (WinRAR) compatible archiver.
from junrar.
@andrebrait Yes, so it's not open source.
from junrar.
@linsui every license has some restriction, like how some of them revoke the rights to use of the code if the person sues the original author, etc., and like some licenses don't give you a grant to patents while others do.
It is "open-source", though the license isn't approved by the OSS, as long as you don't use the source code to code tools that produce RAR files.
I guess it's what they called a "source available freeware", but the point is, they do make their source code available and they do state that it can be modified, redistributed and used for the purposes we want to use it. That makes it just as good for our purposes as any open-source piece of software out there.
There are basically no limitations as long as we don't cross the line of producing RAR archives.
from junrar.
Oh, I just found that this lib is also distributed under the unrar license. And it declares itself as a freeware.
from junrar.
Well, yes. It has to. It's part of the original license.
from junrar.
@gotson my plan here is to basically "rebase" Junrar on top of the latest C++ code for unrar. It will be a very, very big diff, and I'm 99% sure it will have to be one big PR, but I'll do my best to cover every piece of it with tests.
Let me know if you have any alternative ideas on how I can make it easier to you as the maintainer.
from junrar.
@gotson my plan here is to basically "rebase" Junrar on top of the latest C++ code for unrar. It will be a very, very big diff, and I'm 99% sure it will have to be one big PR, but I'll do my best to cover every piece of it with tests.
Let me know if you have any alternative ideas on how I can make it easier to you as the maintainer.
I don't think there's an easy way. Hopefully we have sufficient test coverage 😉
from junrar.
unrar had plenty of changes on the RAR3 front, so now I'm trying to choose to either bring those changes over or maybe do some extra work and leave it as is while bringing only RAR5.
That's great news. Are you able to gauge what those changes in RAR3 bring?
from junrar.
unrar had plenty of changes on the RAR3 front, so now I'm trying to choose to either bring those changes over or maybe do some extra work and leave it as is while bringing only RAR5.
That's great news. Are you able to gauge what those changes in RAR3 bring?
That's hard to say.
Some of them seem to work around some corner cases when dealing with some header types.
Also, unrar doesn't have a header type that someone else recently worked on here in Junrar (I think #110).
I'm porting over most of the changes that seem to be quite neutral.
So far, the most annoying part is just dealing with enums (because in C++ they're just named integers and in Java they're proper types) and some bits where they converged the handling of equivalent enums between RAR 3 and 5, but nothing I can't solve with an interface.
Overall, they also updated some enum values, renamed a bunch, etc. I ported over those changes too.
It'll be a breaking release, that's for sure. Ton of stuff on the public API will end up potentially changing (I don't think people should be referencing any of that in their code, but hey, public fields are public, who knows).
Also, I'm making RarException extend IOException instead of Exception. There's no reason for it to not be an IOException, I think, but please correct me if I'm wrong.
All archive and file-related exceptions are IOException in most other libraries (like Apache's common-compress or Java's own stuff for handling Zip).
from junrar.
By Header Type in #110 I meant VM filter
from junrar.
It'll be a breaking release, that's for sure. Ton of stuff on the public API will end up potentially changing (I don't think people should be referencing any of that in their code, but hey, public fields are public, who knows).
that's something we should have handled a long time ago probably, but didn't, to hide all the internals and provide a clean interface. We can factor that in for the next major release.
Also, I'm making RarException extend IOException instead of Exception. There's no reason for it to not be an IOException, I think, but please correct me if I'm wrong.
Given ZipException
extends IOException
i think that's fine.
from junrar.
Dear Developer!
Are there any successes with unzipping rar 5?
This is very important to me...
from junrar.
Dear Developer!
Are there any successes with unzipping rar 5?This is very important to me...
Not yet. I had to stop working on it.
I only finished accounting for the most of the differences in the current support for RAR 4 and below, and I started touching some of the RAR5 code, but honestly the biggest difficulty is that unrar
source code is a spaghetti that uses inheritance in (IMHO) weird ways. Almost like a textbook example of how not to do inheritance.
It is hard because a ton of stuff changed in unrar
in the meantime.
from junrar.
Related Issues (20)
- Get a specific inputstream from a rar containing multiple items. HOT 1
- Error unpacking large file(>2G) HOT 10
- Could the junrar project benefit from free security help?
- [BUG] Special characters are not recognized anymore HOT 8
- How to disable logging in System.err? HOT 2
- FileHeader times change depending on the current timezone HOT 9
- FileTime.fromMillis(getDateDos(fileTime)) is not working below android API 26 HOT 2
- [BUG]com.github.junrar.exception.UnsupportedRarV5Exception
- CrcErrorException HOT 4
- [BUG] Compress HOT 1
- [BUG]A carefully crafted RAR archive can trigger an infinite loop while parsing. HOT 10
- com.github.junrar.exception.CrcErrorException during extracting of archive HOT 2
- [BUG]A carefully crafted RAR archive can trigger an infinite loop while parsing HOT 21
- [BUG] NullPointerException when extracting solid archives HOT 6
- [BUG]com.github.junrar.exception.CorruptHeaderException: null HOT 2
- [BUG] Exception swallowed during initialization -- silently missing data we used to get in 7.4.1 HOT 11
- [BUG] "IllegalArgumentException: Pipe Size <= 0" with an empty file in the archive HOT 9
- Integration with Google oss-fuzz fuzzing service HOT 2
- Hrlp me HOT 1
- [BUG] Pom License link leads to 404 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from junrar.