安卓APK扩展文件给出了CRC错误下载文件后: [英] Android APK Expansion Files Gives CRC ERROR after Downloading file:

查看:319
本文介绍了安卓APK扩展文件给出了CRC错误下载文件后:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我与Android的APK文件的扩展工作。通过使用rel="nofollow">谷歌提供

currently i am working with the Android's APK expansion files. By using the sample code provided by Google, It downloads the file and save on the device but gives CRC error. Any help will be appreciated.

推荐答案

在谷歌的样品code执行上的每个文件的zip文件原始数据的CRC32算法,并与存储在压缩文件中的值进行比较这验证。可悲的是,ZIP格式指定存储的CRC是一次uncom pressed的文件。如果你的压缩文件COM pressed,因此,社区康复中心将无法匹配,如果不uncom pressed它们匹配的罚款。这已被提交给谷歌作为一个bug。

The Google sample code performs the CRC32 algorithm on each file's raw data in the zip file, and compares this with the value stored in the zip file for verification purposes. Sadly, the zip format specifies that the stored CRCs are for the files once uncompressed. If your zip file is compressed, therefore, the CRCs will fail to match, if left uncompressed they match fine. This has been submitted to Google as a bug.

您可以解决此问题通过不COM pressing您的zip文件,但是,似乎是什么已经是一个相当大的下载是一个坏主意。就个人而言,我已经在我的项目完全取代这种算法。相反,我为zip文件作为一个整体产生一个CRC,并缓存在我安装APK为构建步骤该值,然后在同一时间进行比较作为样本code。

You could work around the problem by not compressing your zip file, but that seems like a bad idea for what is already a fairly large download. Personally, I have replaced this algorithm completely in my project. Instead, I generate a CRC for the zip file as a whole, and cache this value inside my installer apk as a build step, then compare it at the same time as in the sample code.

这篇关于安卓APK扩展文件给出了CRC错误下载文件后:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆