Skip to content

Commit

Permalink
continue unpatch despite errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Vendicated committed Nov 29, 2022
1 parent 48238e6 commit 580f19f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions patcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,21 +249,24 @@ func (di *DiscordInstall) patch(canaryHack bool) error {
return nil
}

func unpatchRenames(dir string, isSystemElectron bool) error {
func unpatchRenames(dir string, isSystemElectron bool) (errOut error) {
appAsar := path.Join(dir, "app.asar")
_appAsar := path.Join(dir, "_app.asar")
fmt.Println("Deleting", appAsar)
if err := os.RemoveAll(appAsar); err != nil {
return err
fmt.Println(err)
errOut = err
}
fmt.Println("Renaming", _appAsar, "to", appAsar)
if err := os.Rename(_appAsar, appAsar); err != nil {
return err
fmt.Println(err)
errOut = err
}
if isSystemElectron {
fmt.Println("Renaming", _appAsar+".unpacked", "to", appAsar+".unpacked")
if err := os.Rename(_appAsar+".unpacked", appAsar+".unpacked"); err != nil {
return err
fmt.Println(err)
errOut = err
}
}
return nil
Expand Down

0 comments on commit 580f19f

Please sign in to comment.