This repository was archived by the owner on May 20, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727
2828+ (NSString *)getApplicationSupportDirectory ;
2929
30+ + (NSString *)bundleAssetsPath ;
31+
3032/*
3133 * This methods allows dynamically setting the app's
3234 * deployment key, in addition to setting it via
@@ -89,7 +91,6 @@ failCallback:(void (^)(NSError *err))failCallback;
8991 doneCallback : (void (^)())doneCallback
9092 failCallback : (void (^)(NSError *err))failCallback ;
9193
92- + (NSString *)getBinaryAssetsPath ;
9394+ (NSDictionary *)getCurrentPackage : (NSError **)error ;
9495+ (NSDictionary *)getPreviousPackage : (NSError **)error ;
9596+ (NSString *)getCurrentPackageFolderPath : (NSError **)error ;
Original file line number Diff line number Diff line change @@ -67,6 +67,16 @@ + (NSURL *)binaryBundleURL
6767 subdirectory: bundleResourceSubdirectory];
6868}
6969
70+ + (NSString *)bundleAssetsPath
71+ {
72+ NSString *resourcePath = [[NSBundle mainBundle ] resourcePath ];
73+ if (bundleResourceSubdirectory) {
74+ resourcePath = [resourcePath stringByAppendingPathComponent: bundleResourceSubdirectory];
75+ }
76+
77+ return [resourcePath stringByAppendingPathComponent: [CodePushUpdateUtils assetsFolderName ]];
78+ }
79+
7080+ (NSURL *)bundleURL
7181{
7282 return [self bundleURLForResource: bundleResourceName];
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ + (void)downloadPackage:(NSDictionary *)updatePackage
128128 return ;
129129 }
130130
131- [[NSFileManager defaultManager ] copyItemAtPath: [self getBinaryAssetsPath ]
131+ [[NSFileManager defaultManager ] copyItemAtPath: [CodePush bundleAssetsPath ]
132132 toPath: [newUpdateCodePushPath stringByAppendingPathComponent: [CodePushUpdateUtils assetsFolderName ]]
133133 error: &error];
134134 if (error) {
@@ -280,11 +280,6 @@ + (void)downloadPackage:(NSDictionary *)updatePackage
280280 [downloadHandler download: updatePackage[@" downloadUrl" ]];
281281}
282282
283- + (NSString *)getBinaryAssetsPath
284- {
285- return [[[NSBundle mainBundle ] resourcePath ] stringByAppendingPathComponent: [CodePushUpdateUtils assetsFolderName ]];
286- }
287-
288283+ (NSString *)getCodePushPath
289284{
290285 NSString * codePushPath = [[CodePush getApplicationSupportDirectory ] stringByAppendingPathComponent: @" CodePush" ];
Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ + (NSString *)getHashForBinaryContents:(NSURL *)binaryBundleUrl
189189
190190 // If the app is using assets, then add
191191 // them to the generated content manifest.
192- NSString *assetsPath = [CodePushPackage getBinaryAssetsPath ];
192+ NSString *assetsPath = [CodePush bundleAssetsPath ];
193193 if ([[NSFileManager defaultManager ] fileExistsAtPath: assetsPath]) {
194194 [self addContentsOfFolderToManifest: assetsPath
195195 pathPrefix: [NSString stringWithFormat: @" %@ /%@ " , [self manifestFolderPrefix ], @" assets" ]
You can’t perform that action at this time.
0 commit comments