From 72981317809f576c2bff3fbb07a04e0aeef9f070 Mon Sep 17 00:00:00 2001 From: tihmstar Date: Sun, 3 Nov 2019 14:41:22 +0100 Subject: [PATCH] using libgeneral as library instad of submodule --- .gitmodules | 3 --- configure.ac | 25 ++++++++++++++++++------- external/libgeneral | 1 - futurerestore.xcodeproj/project.pbxproj | 6 ++++++ futurerestore/Makefile.am | 4 ++-- futurerestore/futurerestore.cpp | 2 +- futurerestore/main.cpp | 15 +++++++-------- 7 files changed, 34 insertions(+), 22 deletions(-) delete mode 160000 external/libgeneral diff --git a/.gitmodules b/.gitmodules index 34ddccd5..43ff96da 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,6 +4,3 @@ [submodule "external/idevicerestore"] path = external/idevicerestore url = https://github.com/tihmstar/idevicerestore.git -[submodule "external/libgeneral"] - path = external/libgeneral - url = https://github.com/tihmstar/libgeneral diff --git a/configure.ac b/configure.ac index 2e487c61..e8832459 100644 --- a/configure.ac +++ b/configure.ac @@ -43,12 +43,23 @@ AC_CONFIG_SUBDIRS(external/idevicerestore external/tsschecker) AC_CONFIG_SRCDIR([futurerestore]) -PKG_CHECK_MODULES(libplist, libplist >= 1.12) -PKG_CHECK_MODULES(libzip, libzip >= 0.10) -PKG_CHECK_MODULES(libimobiledevice, libimobiledevice-1.0 >= 1.2.1) -PKG_CHECK_MODULES(libfragmentzip, libfragmentzip >= 1.0) -PKG_CHECK_MODULES(libirecovery, libirecovery >= 0.2.0) -PKG_CHECK_MODULES(libimg4tool, libimg4tool >= 158) + +LIBIPATCHER_REQUIRES_STR="libipatcher >= 57" +LIBPLIST_REQUIRES_STR="libplist >= 2.0.0" +LIBZIP_REQUIRES_STR="libzip >= 0.10" +LIBIMOBILEDEVICE_REQUIRES_STR="libimobiledevice-1.0 >= 1.2.1" +LIBFRAGMENTZIP_REQUIRES_STR="libfragmentzip >= 47" +LIBIRECOVERY_REQUIRES_STR="libirecovery >= 0.2.0" +IMG4TOOL_REQUIRES_STR="libimg4tool >= 159" +LIBGENERAL_REQUIRES_STR="libgeneral >= 26" + +PKG_CHECK_MODULES(libplist, libplist >= 2.0.0) +PKG_CHECK_MODULES(libzip, $LIBZIP_REQUIRES_STR) +PKG_CHECK_MODULES(libimobiledevice, $LIBIMOBILEDEVICE_REQUIRES_STR) +PKG_CHECK_MODULES(libfragmentzip, $LIBFRAGMENTZIP_REQUIRES_STR) +PKG_CHECK_MODULES(libirecovery, $LIBIRECOVERY_REQUIRES_STR) +PKG_CHECK_MODULES(libimg4tool, $IMG4TOOL_REQUIRES_STR) +PKG_CHECK_MODULES(libgeneral, $LIBGENERAL_REQUIRES_STR) # Optional module libipatcher @@ -65,7 +76,7 @@ if [test -z "$LIBIPATCHER_FLAGS"]; then else AC_MSG_CHECKING([for futurerestore libipatcher]) if test "$build_libipatcher" = "true"; then - PKG_CHECK_MODULES(libipatcher, libipatcher >= 47) + PKG_CHECK_MODULES(libipatcher, $LIBIPATCHER_REQUIRES_STR) AC_DEFINE(HAVE_LIBIPATCHER, 1, [Define if you have libipatcher]) do_libipatcher=yes else diff --git a/external/libgeneral b/external/libgeneral deleted file mode 160000 index e423f64d..00000000 --- a/external/libgeneral +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e423f64d9b535c9a963f2ed3ed0fbf300c1ec24c diff --git a/futurerestore.xcodeproj/project.pbxproj b/futurerestore.xcodeproj/project.pbxproj index 6be96f92..65f44224 100644 --- a/futurerestore.xcodeproj/project.pbxproj +++ b/futurerestore.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + 8754A6AE236F104300C0D285 /* libgeneral.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8754A6AD236F104200C0D285 /* libgeneral.0.dylib */; }; + 8754A6AF236F104300C0D285 /* libgeneral.0.dylib in Embed Libraries */ = {isa = PBXBuildFile; fileRef = 8754A6AD236F104200C0D285 /* libgeneral.0.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 8762F344236DF4D900F42FDB /* libimg4tool.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8762F343236DF4D900F42FDB /* libimg4tool.0.dylib */; }; 8762F345236DF4D900F42FDB /* libimg4tool.0.dylib in Embed Libraries */ = {isa = PBXBuildFile; fileRef = 8762F343236DF4D900F42FDB /* libimg4tool.0.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 878587471D89CFDC008689F0 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 878587461D89CFDC008689F0 /* main.cpp */; }; @@ -54,6 +56,7 @@ dstSubfolderSpec = 10; files = ( 8762F345236DF4D900F42FDB /* libimg4tool.0.dylib in Embed Libraries */, + 8754A6AF236F104300C0D285 /* libgeneral.0.dylib in Embed Libraries */, ); name = "Embed Libraries"; runOnlyForDeploymentPostprocessing = 0; @@ -70,6 +73,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 8754A6AD236F104200C0D285 /* libgeneral.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libgeneral.0.dylib; path = ../../../../usr/local/lib/libgeneral.0.dylib; sourceTree = ""; }; 8762F343236DF4D900F42FDB /* libimg4tool.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libimg4tool.0.dylib; path = ../../../../usr/local/lib/libimg4tool.0.dylib; sourceTree = ""; }; 878587431D89CFDC008689F0 /* futurerestore */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = futurerestore; sourceTree = BUILT_PRODUCTS_DIR; }; 878587461D89CFDC008689F0 /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; @@ -156,6 +160,7 @@ 8762F344236DF4D900F42FDB /* libimg4tool.0.dylib in Frameworks */, 87F574D01E151F44008D5C4D /* libcrypto.dylib in Frameworks */, 87F574CB1E151E97008D5C4D /* libfragmentzip.0.dylib in Frameworks */, + 8754A6AE236F104300C0D285 /* libgeneral.0.dylib in Frameworks */, 878587B71D89D637008689F0 /* libirecovery.2.dylib in Frameworks */, 878587AF1D89D5A5008689F0 /* libcurl.tbd in Frameworks */, 878587AB1D89D590008689F0 /* libimobiledevice.6.dylib in Frameworks */, @@ -283,6 +288,7 @@ 87F574C21E151CDE008D5C4D /* Frameworks */ = { isa = PBXGroup; children = ( + 8754A6AD236F104200C0D285 /* libgeneral.0.dylib */, 8762F343236DF4D900F42FDB /* libimg4tool.0.dylib */, 878E1AC41F73EB3F00B1565B /* libzip.5.dylib */, 8788A6801EE8426A00138E07 /* libipatcher.0.dylib */, diff --git a/futurerestore/Makefile.am b/futurerestore/Makefile.am index 2ef11d83..531282d9 100644 --- a/futurerestore/Makefile.am +++ b/futurerestore/Makefile.am @@ -1,5 +1,5 @@ -AM_CFLAGS = -I$(top_srcdir)/external/libgeneral/include -I$(top_srcdir)/external/tsschecker/external/jssy/jssy -I$(top_srcdir)/external/tsschecker/tsschecker -I$(top_srcdir)/external/idevicerestore/src $(libplist_CFLAGS) $(libzip_CFLAGS) $(libimobiledevice_CFLAGS) $(libfragmentzip_CFLAGS) $(libirecovery_CFLAGS) $(libimg4tool_CFLAGS) -AM_LDFLAGS = $(libplist_LIBS) $(libzip_LIBS) $(libimobiledevice_LIBS) $(libfragmentzip_LIBS) $(libirecovery_LIBS) $(libimg4tool_LIBS) +AM_CFLAGS = -I$(top_srcdir)/external/libgeneral/include -I$(top_srcdir)/external/tsschecker/external/jssy/jssy -I$(top_srcdir)/external/tsschecker/tsschecker -I$(top_srcdir)/external/idevicerestore/src $(libplist_CFLAGS) $(libzip_CFLAGS) $(libimobiledevice_CFLAGS) $(libfragmentzip_CFLAGS) $(libirecovery_CFLAGS) $(libimg4tool_CFLAGS) $(libgeneral_CFLAGS) +AM_LDFLAGS = $(libplist_LIBS) $(libzip_LIBS) $(libimobiledevice_LIBS) $(libfragmentzip_LIBS) $(libirecovery_LIBS) $(libimg4tool_LIBS) $(libgeneral_LIBS) if HAVE_LIBIPATCHER AM_LDFLAGS += $(libipatcher_LIBS) diff --git a/futurerestore/futurerestore.cpp b/futurerestore/futurerestore.cpp index 46ba5327..17955060 100644 --- a/futurerestore/futurerestore.cpp +++ b/futurerestore/futurerestore.cpp @@ -463,7 +463,7 @@ void futurerestore::enterPwnRecovery(plist_t build_identity, string bootargs){ try { iBSSKeys = libipatcher::getFirmwareKey(_client->device->product_type, _client->build, "iBSS"); iBECKeys = libipatcher::getFirmwareKey(_client->device->product_type, _client->build, "iBEC"); - } catch (tihmstar::exception e) { + } catch (tihmstar::exception &e) { reterror("getting keys failed with error: %d (%s). Are keys publicly available?",e.code(),e.what()); } diff --git a/futurerestore/main.cpp b/futurerestore/main.cpp index 0c37ef71..0c1499b4 100644 --- a/futurerestore/main.cpp +++ b/futurerestore/main.cpp @@ -280,15 +280,14 @@ error: } int main(int argc, const char * argv[]) { -#ifdef DEBUG - return main_r(argc, argv); -#else +//#ifdef DEBUG +// return main_r(argc, argv); +//#else try { return main_r(argc, argv); - } catch (tihmstar::exception &e) { - printf("%s: failed with exception:\n",PACKAGE_NAME); - e.dump(); - return e.code(); + } catch (std::exception &e) { + printf("%s: failed with exception (%s)\n",PACKAGE_NAME,e.what()); + return -1; } -#endif +//#endif }