mirror of
https://github.com/Xpl0itU/WiiUDownloader.git
synced 2025-05-16 16:14:48 -04:00
Add delete encrypted files and fix some crashes
This commit is contained in:
parent
af70c73bf5
commit
0a1db82aeb
4 changed files with 74 additions and 21 deletions
27
utils.go
Normal file
27
utils.go
Normal file
|
@ -0,0 +1,27 @@
|
|||
package wiiudownloader
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func isThisDecryptedFile(path string) bool {
|
||||
return strings.Contains(path, "code") || strings.Contains(path, "content") || strings.Contains(path, "meta")
|
||||
}
|
||||
|
||||
func doDeleteEncryptedContents(path string) error {
|
||||
err := filepath.Walk(path, func(filePath string, info os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if info.Mode().IsRegular() && !isThisDecryptedFile(filePath) {
|
||||
if err := os.Remove(filePath); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
return err
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue