Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.
This repository was archived by the owner on May 20, 2025. It is now read-only.

The update contents failed the data integrity check (UTF8 characters in filename) #1793

Description

@hemith

Steps to Reproduce

  1. Add an image file with the file name in Korean. ex) 준비중.png
  2. coding: require('../asset/img/준비중.png') in react-native js code
  3. setup: https://docs.microsoft.com/ko-kr/appcenter/distribution/codepush/react-native#ios-setup
  4. deploying: appcenter codepush release-react -d $deployment -m --description "${desc}"
  5. 1st test: run CodePush.sync() in app. (app is updated)
  6. update some js code
  7. deploying again: appcenter codepush release-react -d $deployment -m --description "${desc}"
  8. 2nd test: run CodePush.sync() in app.
  9. final codePushStatusDidChange status is codePush.SyncStatus.UNKNOWN_ERROR

Expected Behavior

The update contents download and install

Actual Behavior

Update(a zipped file contained main.jsbundle) is downloaded but is not installed.
print this log message.

CPLog(@"The update contents failed the data integrity check.");

expectedHash and updateContentsManifestHash is different.

CPLog(@"Expected hash: %@, actual hash: %@", expectedHash, updateContentsManifestHash);

Environment

  • react-native-code-push version: 6.1.0
  • react-native version: 0.61.5
  • iOS/Android/Windows version: iOS 13.3
  • Does this reproduce on a debug build or release build? release
  • Does this reproduce on a simulator, or only on a physical device? both

Additional Information

How I solved..

After I rename file from Korean(UTF8) to English(ASCII).
Then Expected hash and actual hash is matched.
and codepush is working properly

NSString *manifestString = [[NSString alloc] initWithData:manifestData

Question

computeFinalHashFromManifest function return value is incorrect when an image filename(in manifast variable) have UTF8 characters in iOS environment ?
Is this a bug?

+ (NSString *)computeFinalHashFromManifest:(NSMutableArray *)manifest

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions