Unrar4iOS – A port of unrar to iOS platform

Posted by – November 15, 2010

Recently I started a project which must understand the CBR format, for those that doesn’t know, CBR is a comics file format, which consists of several image files archived in RAR archive format.

In order to be able to read CBR archive contents and uncompress them I need to port unrar library to iOS, after some quick research I found an existing work done in this way, it’s pretty old, but gave me some insight about how to start.

I decided to start a static library project on XCode, the work started by copying the entire sources of unrar library and try build the project, at first time I got several compiler errors, I could fix few of them, after some hours fixing compiler errors I started to take a look on makefile found here, this makefile helped a lot me here and the project could be successfully compiled.

My next step was create a example project, I could get some a better idea about how to work with unrar library by taking a look on the sources of this project, after some hours reading the sources I could list archive contents and few days later extract one file from archive as stream.

Now with static library and example project working as expected, it’s time to polish a little, I wrote a small Objective-C class called Unrar4iOS, this class act as wrapper class of unrar cpp code, with this class the work with unrar library became a much more easier task, after get this class working as expected I researched a little to figure out how to package the static library as framework, you can find some good info about how do it here.

The final result is a github project called Unrar4iOS, got there and clone or fork it!

Share

6 Comments on Unrar4iOS – A port of unrar to iOS platform

  1. Renepep says:

    Hi rogerio,
    Tried your port and while it works flawlessly on simulator :) , It crashes on the device with NSObject selector not found error… even the example included in the project suffers the same fate. Any help would really really be helpful.

  2. rogerio says:

    Fixed and the changes has been pushed to github.

  3. maxuan says:

    Dear, extracting function is not yet complete, and when to achieve?
    “unrarFileTo: (NSString *) path overWrite: (BOOL) overwrite”

  4. rogerio says:

    I need help from you and the others developers to implement missing features, thanks!

  5. Martin says:

    I find a leak memory with the framework, is very importan because when extract a weight cbr all of these data keep in memory

  6. Joshua says:

    Can u plz tell me how to unrar a password protected file?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>