Comments (3)
Hi,
the quick answer is to listen password callback and forget about sure that the file has a password
.
Because, the internal logic will ask user/user code for the password when it's needed and if it's needed.
Otherwise, the whole concept of password protected archive is gone when it's written/stored somehow inside the file :)
Also, keep in mind that archived may have encrypted header, i.e. the list of file, so you can't even see the list of files before first access.
For the reference, how the encrypted archives works, you can check the behavior the console 7za utility to check when the logic prompts the password, i.e. never, before opening and listing the file content or before extracting the first file.
So, if behavior of the archiver is not fits for your needs, just do not use such logic to avoid wrong app architecture.
Or, open archive and extract items in a separate thread and when the original SDK will ask the password, suspend an execution thread, display password prompt in a UI thread and then resume execution thread with user provided password.
from lzmasdkobjc.
@OlehKulykov
Hi,
Thank you for your detailed explanation.I understand what you mean, thank you very much.
I have another question I would like to ask you.If you like, I am very happy to know your thoughts.
My need is to compress large files. Use 7z volume archive.
For example, I have a 100 MB file and want to break it down into two 7z files.
My idea is to convert the file to NSData. Then use 7z compression.
- (BOOL) addData:(nonnull NSData *) data forPath:(nonnull NSString *) path;
I look forward to your answer.
from lzmasdkobjc.
Hi,
unfortunately split handler is not ported and was not even planned for a mobile platform, due to multiple write output and reader input. But thanks for the good idea, I'll keep in mind...
So, in this case I would like to recommend to:
- Archive single big file and then split output 7z file into few small parts.
- Read single big file into few small NSData's and archive each part individually into few 7z's archives.
P.S.: for a big input files, it's better to use - (BOOL) addPath:(nonnull NSString *) aPath forPath:(nonnull NSString *) path;
method instead of keeping all in memory.
from lzmasdkobjc.
Related Issues (20)
- Being unable to install in a objc project, no swift inside. HOT 2
- Feature request: function to uncompress only one file HOT 2
- No compressed file size metadata available?
- Encounter error SZ_ERROR_INPUT_EOF
- Extraction of one item in continuous archive leads to extraction of all items HOT 5
- Extracting item from archive to NSData object (without saving it to disk) HOT 1
- LZMA SDK has new version 18.05
- Not 2.0.19 in cocoapods HOT 1
- Extract zip data from nsdata HOT 6
- Swift compiler warnings (Xcode 10.1, Swift 4.2) HOT 1
- Unarchive .7z file works randomly - LZMA DEBUG 72: ERROR: code = 1, HOT 2
- How to add files to an already existed .7z file?
- use_frameworks! HOT 1
- How to interrupt the compression process? HOT 2
- 。。。 HOT 1
- Can the file size be over 4g?
- About 7z-MultiVolume
- How to know a 7z file is password protected HOT 1
- Hello, how do I use the sdk to do split volume compression 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 lzmasdkobjc.