Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9282] Android: Utils.md5HexDigest() not reading blob

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-01-31T23:06:54.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sn/a
ComponentsAndroid
Labelsparity
ReporterKetan Majmudar
AssigneeIngo Muschenetz
Created2012-05-25T13:26:13.000+0000
Updated2017-03-31T22:17:48.000+0000

Description

Problem

When reading a locally stored file (in both resources directory and a downloaded file in the app data directory), Ti.Utils.md5HexDigest() should read the blob and return a string, but instead NULL is returned on Android. Works on iOS.

Test case

Add the following snippet to the end of a new mobile project and iOS will return MD5 hex string, android won't.
downloadPath     =     Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'KS_nav_ui.png');		
var localFile     =     downloadPath.read();
Ti.API.info(typeof localFile);
localmd5checksum     =     Ti.Utils.md5HexDigest(localFile);
Ti.API.info(localmd5checksum);
alert(localmd5checksum);

Discussions

http://developer.appcelerator.com/question/122224/verify-file-checksum (11 months old)

Comments

  1. Neeraj Gupta 2012-05-28

    The bug might not be with the md5, but with the Ti.File object.
  2. Ketan Majmudar 2012-07-25

    It looks like others have had issues with the File OBject as you point out... any idea/ETA for a fix?
  3. Lee Morris 2017-03-31

    Closing ticket as fixed, if there are any problems, please file a new ticket.

JSON Source