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

idevicebackup2: Include network/wifi devices #920

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ nobase_include_HEADERS = libimobiledevice/libimobiledevice.h \
libimobiledevice/mobileactivation.h\
libimobiledevice/preboard.h\
libimobiledevice/property_list_service.h\
libimobiledevice/service.h
libimobiledevice/service.h\
libimobiledevice/devicebackup2.h
66 changes: 66 additions & 0 deletions include/libimobiledevice/devicebackup2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* devicebackup2.h
* Wraps idevicebackup2 CLI into a library
*
* Copyright (c) 2020 Cody Hatfield <cody.hatfield@me.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef DEVICEBACKUP2_H
#define DEVICEBACKUP2_H

#ifdef __cplusplus
extern "C" {
#endif

#include <libimobiledevice/devicebackup2.h>

enum cmd_mode {
CMD_BACKUP,
CMD_RESTORE,
CMD_INFO,
CMD_LIST,
CMD_UNBACK,
CMD_CHANGEPW,
CMD_LEAVE,
CMD_CLOUD
};

enum cmd_flags {
CMD_FLAG_RESTORE_SYSTEM_FILES = (1 << 1),
CMD_FLAG_RESTORE_NO_REBOOT = (1 << 2),
CMD_FLAG_RESTORE_COPY_BACKUP = (1 << 3),
CMD_FLAG_RESTORE_SETTINGS = (1 << 4),
CMD_FLAG_RESTORE_REMOVE_ITEMS = (1 << 5),
CMD_FLAG_ENCRYPTION_ENABLE = (1 << 6),
CMD_FLAG_ENCRYPTION_DISABLE = (1 << 7),
CMD_FLAG_ENCRYPTION_CHANGEPW = (1 << 8),
CMD_FLAG_FORCE_FULL_BACKUP = (1 << 9),
CMD_FLAG_CLOUD_ENABLE = (1 << 10),
CMD_FLAG_CLOUD_DISABLE = (1 << 11),
CMD_FLAG_RESTORE_SKIP_APPS = (1 << 12)
};

/**
* Wraps idevicebackup2 CLI to be used as a library
**/
int run_cmd(int cmd, int cmd_flags, char* udid, char* source_udid, char* backup_directory, int interactive_mode, char* backup_password, char* newpw);

#ifdef __cplusplus
}
#endif

#endif
3 changes: 2 additions & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ libimobiledevice_la_SOURCES = idevice.c idevice.h \
webinspector.c webinspector.h\
mobileactivation.c mobileactivation.h\
preboard.c preboard.h \
syslog_relay.c syslog_relay.h
syslog_relay.c syslog_relay.h \
devicebackup2.c devicebackup2.h

if WIN32
libimobiledevice_la_LDFLAGS += -avoid-version -static-libgcc
Expand Down
Loading