我使用 Objective-zip 压缩一些带有密码的文件并成功生成 zip 文件。但是,当我手动upzip文件时,它说我的密码错误,有什么办法可以处理吗?它是由 crc32 还是其他原因引起的?
-(void) zipCandidcate:(NSString *)filePath Candidcate:(Candicate *)c{
ZipFile *zFile=[[ZipFile alloc] initWithFileName:filePath mode:ZipFileModeCreate ];
//write folder
NSString *cFolderPath=[c filePath];
//write photo
NSString *cPhotoPath=[[[c photos] objectAtIndex:0] path];
ws=[zFile writeFileInZipWithName:@"file/image-1.png" fileDate:[[NSDate alloc] init] compressionLevel:ZipCompressionLevelNone password:@"123" crc32:0];
[ws writeData:[[NSFileManager defaultManager] contentsAtPath:cPhotoPath]];
[ws finishedWriting];
ws=[zFile writeFileInZipWithName:@"file/" compressionLevel:ZipCompressionLevelNone];
[ws writeData:[[NSFileManager defaultManager] contentsAtPath:filePath]];
[ws finishedWriting];
[zFile close];
}