Git Product home page Git Product logo

Comments (46)

15738519635 avatar 15738519635 commented on May 27, 2024 17

please support it

from junrar.

beothorn avatar beothorn commented on May 27, 2024 11

There are no plans to support it right now.

from junrar.

andrebrait avatar andrebrait commented on May 27, 2024 11

@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.

Hello-xBugs avatar Hello-xBugs commented on May 27, 2024 10

RAR 5 format is not supported, Is there any plans to support it?

from junrar.

iteleshov avatar iteleshov commented on May 27, 2024 8

Dear development team,
Are there any plans to start support Rar version 5 in the near future?

from junrar.

xishian avatar xishian commented on May 27, 2024 5

http://sevenzipjbind.sourceforge.net/
This library can parse rar5 files and many others. It is a JNA wrapper for 7zip.

from junrar.

sunny-shu avatar sunny-shu commented on May 27, 2024 4

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.

andrebrait avatar andrebrait commented on May 27, 2024 4

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.

gotson avatar gotson commented on May 27, 2024 2

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.

linsui avatar linsui commented on May 27, 2024 2

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.

Neiko2002 avatar Neiko2002 commented on May 27, 2024 1

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.

siwee avatar siwee commented on May 27, 2024 1

@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.

gotson avatar gotson commented on May 27, 2024 1

@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.

tlf30 avatar tlf30 commented on May 27, 2024

@beothorn Is there a reason for this?

from junrar.

WangJi92 avatar WangJi92 commented on May 27, 2024

RAR 5 format is not supported, Is there any plans to support it?

from junrar.

gotson avatar gotson commented on May 27, 2024

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.

sunny-shu avatar sunny-shu commented on May 27, 2024

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.

sunny-shu avatar sunny-shu commented on May 27, 2024

@gotson
I've read that document,the rar v5 format is not yet implemented。

from junrar.

gotson avatar gotson commented on May 27, 2024

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.

zhaosongyi avatar zhaosongyi commented on May 27, 2024

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.

gotson avatar gotson commented on May 27, 2024

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.

zhaosongyi avatar zhaosongyi commented on May 27, 2024

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.

gotson avatar gotson commented on May 27, 2024

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.

zhaosongyi avatar zhaosongyi commented on May 27, 2024

ok, I see.

from junrar.

suntrian avatar suntrian commented on May 27, 2024

7zip completed rar5 decompress algorithm which is open source, but it's written by c++

from junrar.

syedecryptr avatar syedecryptr commented on May 27, 2024

Dear development team,
Are there any plans to start support Rar version 5 in the near future?

from junrar.

syedecryptr avatar syedecryptr commented on May 27, 2024

@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.

siwee avatar siwee commented on May 27, 2024

@syedecryptr Hi,

I think it should be possible, but I'm not familiar with C++.

from junrar.

gotson avatar gotson commented on May 27, 2024

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.

syedecryptr avatar syedecryptr commented on May 27, 2024

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.

marcin-chwedczuk avatar marcin-chwedczuk commented on May 27, 2024

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.

focuseyes360 avatar focuseyes360 commented on May 27, 2024

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.

andrebrait avatar andrebrait commented on May 27, 2024

@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.

andrebrait avatar andrebrait commented on May 27, 2024

@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.

linsui avatar linsui commented on May 27, 2024

@andrebrait Yes, so it's not open source.

from junrar.

andrebrait avatar andrebrait commented on May 27, 2024

@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.

linsui avatar linsui commented on May 27, 2024

Oh, I just found that this lib is also distributed under the unrar license. And it declares itself as a freeware.

from junrar.

andrebrait avatar andrebrait commented on May 27, 2024

Well, yes. It has to. It's part of the original license.

from junrar.

andrebrait avatar andrebrait commented on May 27, 2024

@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 avatar gotson commented on May 27, 2024

@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.

gotson avatar gotson commented on May 27, 2024

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.

andrebrait avatar andrebrait commented on May 27, 2024

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.

andrebrait avatar andrebrait commented on May 27, 2024

By Header Type in #110 I meant VM filter

from junrar.

gotson avatar gotson commented on May 27, 2024

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.

valery-lavrik avatar valery-lavrik commented on May 27, 2024

Dear Developer!
Are there any successes with unzipping rar 5?

This is very important to me...

from junrar.

andrebrait avatar andrebrait commented on May 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.