IOSZipRarUtil
iOS zip rar 压缩、解压缩 预览 compression and decompression rar、zip文件 密码判断 中文编码乱码处理
Install / Use
/learn @ceekay1991/IOSZipRarUtilREADME
ArchiveUnArchiveIniOS_zip_rar
一、ArchiveUnArchiveIniOS_zip_rar简介
ArchiveUnArchiveIniOS_zip_rar 集成的第三方库
- UnrarKit---rar解压缩;
- SSZipArchive----zip解压缩、压缩(扩展密码判断、密码正确性判断);
- ZipZap----zip解压缩、压缩;
- unchardet---编码解析。
ArchiveUnArchiveIniOS_zip_rar 支持的功能
- 1、rar文件解压缩;
- 2、zip文件解压缩;
- 3、判断压缩文件是否有密码;
- 4、校验密码的正确性;
- 5、将压缩文件重新压缩为zip完美解决iOS7和iOS8对zip文件预览支持的差异性;
- 6、解压、压缩文件名编码解析;
- 6、解压、压缩文本文件重新编码支持ios系统的预览;
二、ArchiveUnArchiveIniOS_zip_rar 使用步骤
-
1、将Class下的文件添加到工程目录
-
2、添加系统库
MobileCoreService.framework Foundation.framework ImageIO.framework CoreGraphics.framework UIKit.framework SystemConfiguration.framework libz.dylib QuickLook.framework -
3、buildsettings 配置
Other Link Flags 增加如下2项 -lc++ -force_load UnrarKit/libUnrarKit.a -
4.代码调用
解压缩:
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[BDCompressUtil unCompressWitthSourcePath:源文件 andDestenationPath:输出 目录文件夹 andFinish:^(NSString *filePath) {
dispatch_async(dispatch_get_main_queue(), ^{
NSLog(@"unCompressFile 输出目录:%@",filePath);
});
}];
});
压缩:
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[BDCompressUtil reCompressToZIPWitthSourcePath:filePath
andDestenationPath:ArchiveUnArchiveViewControllerOutPath
andFinish:^(NSString *filePath){
dispatch_async(dispatch_get_main_queue(), ^{
NSLog(@"recompress2zip 输出目录:%@",filePath);
});
}];
});
三、备注
四 截图

Related Skills
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
