mirror of
https://github.com/Xpl0itU/WiiUDownloader.git
synced 2025-05-16 08:04:59 -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
|
@ -22,13 +22,13 @@ var (
|
|||
decryptionError = false
|
||||
)
|
||||
|
||||
func decryptContents(path string, progress *ProgressWindow) error {
|
||||
func decryptContents(path string, progress *ProgressWindow, deleteEncryptedContents bool) error {
|
||||
wg.Add(1)
|
||||
progressInt := 0
|
||||
go runDecryption(path, &progressInt)
|
||||
progressInt := 1
|
||||
go runDecryption(path, &progressInt, deleteEncryptedContents)
|
||||
progress.percentLabel.SetText("Decrypting...")
|
||||
for !decryptionDone {
|
||||
progress.bar.SetFraction(float64(progressInt) / 100)
|
||||
progress.percentLabel.SetText(fmt.Sprintf("Decrypting... (%d%%)", progressInt))
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ func decryptContents(path string, progress *ProgressWindow) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func runDecryption(path string, progress *int) {
|
||||
func runDecryption(path string, progress *int, deleteEncryptedContents bool) {
|
||||
defer wg.Done()
|
||||
argv := make([]*C.char, 2)
|
||||
argv[0] = C.CString("WiiUDownloader")
|
||||
|
@ -50,5 +50,8 @@ func runDecryption(path string, progress *int) {
|
|||
if int(C.cdecrypt_main(2, (**C.char)(unsafe.Pointer(&argv[0])), (*C.int)(unsafe.Pointer(progress)))) != 0 {
|
||||
decryptionError = true
|
||||
}
|
||||
if deleteEncryptedContents {
|
||||
doDeleteEncryptedContents(path)
|
||||
}
|
||||
decryptionDone = true
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue