如何创建普通的受密码保护的 ZIP 存档?
我的应用程序压缩多个文件,将 zip 文件保存到 SD 卡,然后通过电子邮件将 zip 文件发送到某个地址。
压缩是通过以下代码完成的:使用 Android 压缩文件(以编程方式)。
现在的问题是,如何在 zip 文件上设置密码,以便授权人员在计算机(Windows、Mac 或 Ubuntu)上打开该文件时能够使用提供的密码提取文件?
我读了这篇文章:Android zip 文件身份验证,但在我看来,读取 zip用另一部手机完成了...还是我错了? 如果有人知道请告诉我!谢谢!
My app zips several files, saves the zip file to the SD card, and it emails the zip file to an address.
The zipping is done with this code: Zipping Files with Android (Programmatically).
Now the question is, how do I put a password on the zip file so that authorized individuals who opens it on a computer (Windows, Mac, or Ubuntu) would be able to extract the files with a supplied password?
I read this post: Android zip file authentication, but it sounds to me that reading of the zip is done with another phone... or am I wrong?
If anybody knows please let me know! Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我搜索了很多,终于找到了一个好的库,可以使用密码压缩文件easy:
Zip:
Unzip:
Rar:
这个库的文档已经足够好了,我只是从那里添加了一些示例。
它是完全免费的,并且是专门为 Android 编写的。
Mvn 链接
I've searched a lot and finally found a good library that can zip files with password easily:
Zip:
Unzip:
Rar:
The documentation of this library is good enough, I just added a few examples from there.
It's totally free and wrote specially for android.
Mvn Link
由于Android有一个JVM,您可以尝试使用您在java中看到的所有库(有些可以运行,有些不能,并且某些库的一些更改也可以)。
这样我就会复制这个回答问题(用 Java 编写受密码保护的 Zip 文件):
您还必须知道,也许将它们适应 Android 并不容易,但也许您很幸运,其中一些将立即为您运行。
祝你好运!
since Android has a JVM , you can try to use all lib that you see for java (some will run , some not , and some changes of some library will be ok too) .
This way i'll copy past this answer fo the question (Write a password protected Zip file in Java):
You must also know that maybe it won't be easy to adapt them to Android , but maybe you are lucky and some of this will run for you immediately .
Good luck!