This repository was archived by the owner on May 20, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
android/app/src/main/java/com/microsoft/codepush/react Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -475,11 +475,22 @@ + (void)rollbackPackage
475
475
{
476
476
NSError *error;
477
477
NSMutableDictionary *info = [self getCurrentPackageInfo: &error];
478
+ if (error) {
479
+ return ;
480
+ }
478
481
482
+ NSString *currentPackageFolderPath = [self getCurrentPackageFolderPath: &error];
479
483
if (error) {
480
484
return ;
481
485
}
482
486
487
+ NSError *deleteError;
488
+ [[NSFileManager defaultManager ] removeItemAtPath: currentPackageFolderPath
489
+ error: &deleteError];
490
+ if (deleteError) {
491
+ NSLog (@" Error deleting current package contents at %@ " , currentPackageFolderPath);
492
+ }
493
+
483
494
[info setValue: info[@" previousPackage" ] forKey: @" currentPackage" ];
484
495
[info removeObjectForKey: @" previousPackage" ];
485
496
Original file line number Diff line number Diff line change @@ -187,6 +187,8 @@ public void installPackage(ReadableMap updatePackage) throws IOException {
187
187
188
188
public void rollbackPackage () throws IOException {
189
189
WritableMap info = getCurrentPackageInfo ();
190
+ String currentPackageFolderPath = getCurrentPackageFolderPath ();
191
+ CodePushUtils .deleteDirectoryAtPath (currentPackageFolderPath );
190
192
info .putString (CURRENT_PACKAGE_KEY , CodePushUtils .tryGetString (info , PREVIOUS_PACKAGE_KEY ));
191
193
info .putNull (PREVIOUS_PACKAGE_KEY );
192
194
updateCurrentPackageInfo (info );
You can’t perform that action at this time.
0 commit comments