Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Password followed by Starting a Backup fails #41

Closed
iwhiffin opened this issue May 19, 2024 · 3 comments
Closed

Change Password followed by Starting a Backup fails #41

iwhiffin opened this issue May 19, 2024 · 3 comments

Comments

@iwhiffin
Copy link

When a user starts a backup process, I would like to check if the backup will be encrypted and if not, prompt them to add a password.

I have the check and setting password working fine.
I have the backup working fine.

But I cannot do both together without restarting the application in between.

Step 1: User selects to create a backup.
Step 2: Device is checked to see if encryption is in use.
a) If it is, proceed with backup. (This works)
b) if it isn't, prompt the user to add a password.
i)They can choose to proceed without a password and backup anyway (this works)
ii) They can choose to add a password (this works) and start the backup (this is where is fails)

I've tried numerous things, but it seems that the changing/setting of a password ties up the tool as the Backup process just sits there not doing anything.

Restarting the app and starting the backup works fine but is not really feasible.

Any tips?

Thank you.

@artehe
Copy link
Owner

artehe commented May 31, 2024

That sounds odd I'm fairly sure it should just work.

However one thign you can do is just recreate the Servivce so something like

 using (LockdownClient lockdown = MobileDevice.CreateUsingUsbmux(logger: logger)) {
            using (DeviceBackup backupJob = new DeviceBackup(lockdown, path)) {
                 // Check backup encryption / set password etc
            }

           using (DeviceBackup backupJob = new DeviceBackup(lockdown, path)) {
                 // Do backup
            }
        }

@iwhiffin
Copy link
Author

iwhiffin commented Jun 8, 2024

Thanks for the suggestion.

I'd tried a bunch of stuff to no avail including recreating the service, but your magic must have been all that was required as it is working now... No idea what is different but clearly my mistake.

Thanks again!

@Elanchezhiyan-P
Copy link
Contributor

@iwhiffin, Could you please send me the PR (if raised) or code snippet for the below process?

a) If it is, proceed with backup. (This works)
b) if it isn't, prompt the user to add a password.
i)They can choose to proceed without a password and backup anyway (this works)
ii) They can choose to add a password (this works) and start the backup (this is where is fails)

@artehe artehe closed this as completed Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants