norman784 / libimobiledevice-node

A cross-platform software protocol library and tools to communicate with iOS® devices natively.
MIT License
25 stars 8 forks source link

Repeated progress message with the same value when calling backup2 #4

Closed didix21 closed 5 years ago

didix21 commented 5 years ago

I have been testing backup2 with different devices. Right now all the devices that I test the backup has been done successfully. However, there is one that backup is not finishing correctly. After digging into the code, I could see that progress message is repeated several times when is reaching 93%, 94% and 95% of the backup. (Almost 500 times each value).

After debugging the code I could see that backup is stuck in lockdown_client_with_handshake () which is executed inside of do_post_notification ():

  if (lockfile) {
            afc_file_lock(afc, lockfile, AFC_LOCK_UN);
            afc_file_close(afc, lockfile);
            lockfile = 0;

            if (cmd == CMD_BACKUP)
                do_post_notification(device, NP_SYNC_DID_FINISH);
        }
norman784 commented 5 years ago

Did you try the libimobiledevice bin itself? If not try that and check it out if it works for you, this binding was an attempt to use this library inside an electron app and bypass the signing issue that we run with apple apps because the inclusion of other binary files, I encourage to use the original library if possible or submit a pull request to this or the original one (where the issue is) to fix the issue, because I'm not actively using this library so it may be out of date.

didix21 commented 5 years ago

Yes, I tried with the binary and it worked. Actually I'm using your library inside an electron app. I could solve the problem rejecting the repeated messages.