@@ -5,12 +5,11 @@ @implementation CodePushUpdateUtils
5
5
6
6
NSString * const AssetsFolderName = @" assets" ;
7
7
NSString * const BinaryHashKey = @" CodePushBinaryHash" ;
8
- NSString * const DefaultJsBundleName = @" main.jsbundle" ;
9
8
NSString * const ManifestFolderPrefix = @" CodePush" ;
10
9
11
10
// These variables are used to cache the hash of the binary contents in memory.
12
11
static NSString *binaryHash = nil ;
13
- static BOOL didLoadBinaryHash = false ;
12
+ static BOOL didLoadBinaryHash = NO ;
14
13
15
14
+ (void )addContentsOfFolderToManifest : (NSString *)folderPath
16
15
pathPrefix : (NSString *)pathPrefix
@@ -160,16 +159,11 @@ + (NSString *)getAssetsFolderName
160
159
return AssetsFolderName;
161
160
}
162
161
163
- + (NSString *)getDefaultJsBundleName
164
- {
165
- return DefaultJsBundleName;
166
- }
167
-
168
162
+ (NSString *)getHashForBinaryContents : (NSURL *)binaryBundleUrl
169
163
error : (NSError **)error
170
164
{
171
165
if (!didLoadBinaryHash) {
172
- didLoadBinaryHash = true ;
166
+ didLoadBinaryHash = YES ;
173
167
174
168
// Get the cached hash from user preferences if it exists.
175
169
NSString *binaryModifiedDate = [self modifiedDateStringOfFileAtURL: binaryBundleUrl];
@@ -199,7 +193,7 @@ + (NSString *)getHashForBinaryContents:(NSURL *)binaryBundleUrl
199
193
200
194
NSData *jsBundleContents = [NSData dataWithContentsOfURL: binaryBundleUrl];
201
195
NSString *jsBundleContentsHash = [self computeHashForData: jsBundleContents];
202
- [manifest addObject: [[NSString stringWithFormat: @" %@ /%@ " , [self getManifestFolderPrefix ], [self getDefaultJsBundleName ]] stringByAppendingString: jsBundleContentsHash]];
196
+ [manifest addObject: [[NSString stringWithFormat: @" %@ /%@ : " , [self getManifestFolderPrefix ], [binaryBundleUrl lastPathComponent ]] stringByAppendingString: jsBundleContentsHash]];
203
197
binaryHash = [self computeFinalHashFromManifest: manifest error: error];
204
198
205
199
// Cache the hash in user preferences. This assumes that the modified date for the
0 commit comments