zlib directly for uncompressing a zip folder for iphone - iphone

Is it possible to use the bare minimum zlib available on iPhone to uncompress a zip of a folder. I don't want to go for a open source library, please enlighten me the difficulty or possibility of implementing one piece of code which can uncompress a zip file.

As JosephH said, you cannot use ZLib to deal with .zip files.
But you can use the MiniZip library for that: http://www.winimage.com/zLibDll/minizip.html
There's already an Objective-C wrapper, if you don't want to write yours: http://code.google.com/p/ziparchive/
FYI - ZLib on iPhone:
Adds libz to the linked frameworks of your main target, just as another framework.
Then, you can check the ZLIB tutorials, to learn how to compress/decompress a file: http://www.zlib.net/zlib_how.html

zlib does not directly support the .zip file format, sorry.
It can be done though, contrib/minizip in the zlib distribution provides an example. (link to code: http://cvsweb.xfree86.org/cvsweb/utils/zlib/contrib/minizip/miniunz.c?rev=1.1&content-type=text/vnd.viewcvs-markup )
I'm unsure why you're against open source libraries, but
http://bitbucket.org/kolpanic/zipkit/wiki/Home is a great solution.

Related

iOS/Objective-C read 4GB or greater of Zipped archive library?

I have tried using:
Objective-Zip
ZipKit
Both say they have the capability of reading 4GB or larger zipped archives. Has anyone successfully been able to read very larged zipped content using one of the libraries mentioned above?
If you know a better zipped archive library, please let me know.
I ran into the same problem and trying to solve it over couple of days.
Finally, i solved it.
With my instruction you can unzip big files (even 8GB) in iOS without any problems.
This is an step-by-step instruction how to solve it:
1) Download Objective-Zip from https://github.com/flyingdolphinstudio/Objective-Zip
2) Download MiniZip from https://github.com/nmoinvaz/minizip
3) Take 4 files - ioapi.c, ioapi.h, unzip.c, unzip.h - from minizip folder (which you downloaded in step 2) and paste it to the Objective-Zip/MiniZip folder (override files).
4) Go to Objective-Zip/Objective-Zip/ZipFile.m and replace this string
int err= unzLocateFile(_unzFile, [fileNameInZip cStringUsingEncoding:NSUTF8StringEncoding], 1);
to this
int err= unzLocateFile(_unzFile, [fileNameInZip cStringUsingEncoding:NSUTF8StringEncoding], (unzFileNameComparer)1);
5) Finally, add Objective-Zip to your project and happy unzipping! :)
Now you can unzip big files in iOS. I checked on 8GB-zip, everything works like a charm!
P.S.: developer of Objective-Zip will update it with my fix as soon as possible, so this instruction is actual for Objective-Zip 0.8.1 only.
As long the zip library supports PKWare's ZIP64 extension then it should be able to work with large files over 4GB.
Objective-Zip uses minizip 1.1 which supports ZIP64.
ZipKit website states it supports ZIP64 extension.
Both these libraries should work. I have experience with minizip 1.1 and I know for certain that it supports large files.

How can we get source from filename.a file and appname.ipa file in iphone.? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Is it possible to reverse-engineer my iPhone application?
How can I get the source code from the .ipa file?
Is there any way to fetch out the source code from compiled (.a) file and .ipa file in iphone. In android we can get source code from .apk file then why could we not able to get the source code from .ipa file. There should be any way to fetch out the source code from a compiled file in iphone.
I have also get trapped in the situation when any of the api for iphone has got then it contains .a file that is compiled and I would not be able to modify its code. So if any founds the way to find out the source code from compiled file in iphone then please answer this question....!
I will very thankful to you.
No You can't fetch code from ipa ...
.a file is a static library. A static library is a set of routines, external functions and variables which are resolved in a caller at compile-time and copied into a target application by a compiler, linker, or binder, producing an object file and a stand-alone executable. More on Wiki
Isn't the basic objective of creating a .a file is to hide the source code?
However I have "heard" people disassembling signed binaries, using some specialized tools. IDA is one of them.
I can't help you more on operating the tool, as I myself haven't used it ;)

How to cross compile tesseract ocr engine for iphone?

I am struggling from past 1 week that how to compile the tesseract ocr enging for iphone. I have gon through through some link, But i couldn't find the proper way. Can anyone help me through step by step procedure. Thanks in advance.
I will have to agree with you on this that it is not an easy task, but the below links finally helped me achieve this... hoping this helps..
http://tinsuke.wordpress.com/2011/11/01/how-to-compile-and-use-tesseract-3-01-on-ios-sdk-5/
http://tinsuke.wordpress.com/2011/02/17/how-to-cross-compiling-libraries-for-ios-armv6armv7i386/
That probably won't be enough. I know nothing about Tesseract OCR library but you will require the include directives, plus specify the directory to where the Tesseract header files are installed via a compiler switch (usually -I) and (possibly) link with the Tesseract library file(s).
That would be enough to compile the sources if the header files are installed into common include directories. However, if the header files do not contain the definitions (not just declarations) for all functions/variables then there will be a library file(s) (like libtesseract.a or/and libtesseract.so) that must be linked in order to compile your binary.

Python module for binary plist

Is there any Python project/module working on a binary plist writer? I need one for a REST implementation I'm doing. I would like the server to send a HTTP REsponse containing a binary plist instead of json, for example. The server is Apache with mod_python and django installed. Considering adding bplist format alongside json as output formats, just inorder to simplify parsing on the iPhone, plus cutting the data transfers down.
I'm thinking of writing my own, but contributing to an existing project would be prefereable.
Thanks in advance.
I was afraid I might have to learn SWIG, implement this myself, or switch to another language for this hobby project that involves parsing binary plists -- but after a quick pip search plist, I found biplist.
What about plistlib in the default Python distribution? It is available for all platforms since Python 2.6; before Python 2.6, it was included in the Mac version, but I guess you can simply grab the source from Python 2.6 and backport it if you really need to support older Python versions.
Update: Sorry, I've just realised that you need to support the binary plist format. In that case, use libplist, which supports both the binary and the XML format. It is written in C++, but they provide a SWIG interface definition file with which SWIG can easily generate a Python module for it. Ubuntu/Debian also includes a package called python-plist which contains precompiled binaries.

FFMpeg for iPhone

I am trying to create an app that will allow me to stream video FROM the iPhone TO a server. my current theory as to how to do this is to create a series of FFMpeg files and send them to the server. as far as i can tell i have compiled the FFMpeg library correctly for the iPhone.
i followed these instructions here. a series of executable files appeared in the folder so i'm assuming it worked.
my question is now what? how do i get these into an app? how do i make calls to these executable files? and most importantly will this even work the way i want it to?
You have built the ffmpeg binary which can run on an iPhone. You cannot run executables from an app on a (non-jailbroken) phone. So you would have to compile the library, and link against that. Then, from your app, call the relevant functions directly, mimicing what the ffmpeg program does.
Althought this issue is quite old this could help to other users in the future:
Just take a look at the source code here http://dev.wunderground.com/support/wunderradio/wunderradio.1.9lgpl.zip
Good luck
Ok you said that you succesfully compiled FFMpeg for iPhone, right? As mvds said, you can't use them as executable files. So in order to use this libraries after compilation finishes you need to copy all the .a libs generated to your project (as when you add libraries or other frameworks). These libraries are:
libavcodec.a
libavfilter.a
libavutil.a
libswscale.a
libavdevice.a
libavformat.a
libswresample.a
Then you have to configure your project
Clic on your project -> build settings
Search "Header Search Paths" and add the folder location of your libraries (location can be absolute or relative)
Clic on build phases -> Link Binary With Libraries -> Add other, and add all .a files
Voila! Now you can import and use the libraries of FFmpeg for your project
#include <avcodec.h>
#include ...
// More C and/or Objective-C Code
To access individual uncompressed frames you can use captureOutput:didOutputSampleBuffer:fromConnection: delegate method from AVCaptureVideoDataOutput (there are plenty of examples), and somehow encoding them to h264 maybe using AVFrame? As far as I know FFmpeg also can stream using RTSP for live streaming, but it seems that documentation is close to zero :(
To answer your final question
and most importantly will this even work the way i want it to?
The answer is yes, it can work, I found 2 libraries that do just what you want to achieve
http://www.foxitsolutions.com/iphone_h264_sdk.html
http://ios-rtmp-library.com
Both uses FFmpeg the same way you are suggesting, this question is a little old but I have found many users trying to achieve this so so I have a question Do you had success on doing this? Can you share your experience or recomendations?