diff --git a/Bootstrap.xcodeproj/project.pbxproj b/Bootstrap.xcodeproj/project.pbxproj index 2549c14f..7e73213f 100644 --- a/Bootstrap.xcodeproj/project.pbxproj +++ b/Bootstrap.xcodeproj/project.pbxproj @@ -10,6 +10,7 @@ 84364F3D2B323FB600E90B58 /* MBProgressHUD.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84364F3B2B323CE300E90B58 /* MBProgressHUD.framework */; }; 84364F3E2B323FB600E90B58 /* MBProgressHUD.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 84364F3B2B323CE300E90B58 /* MBProgressHUD.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 84364F472B3C5D4600E90B58 /* libkrw0-dummy.deb in Resources */ = {isa = PBXBuildFile; fileRef = 84364F462B3C5D4600E90B58 /* libkrw0-dummy.deb */; }; + 843E87572B56E45300CB45C4 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 843E87592B56E45300CB45C4 /* Localizable.strings */; }; 84438D472B26090D00A1E407 /* sileo.deb in Resources */ = {isa = PBXBuildFile; fileRef = 84438D432B26090D00A1E407 /* sileo.deb */; }; 84438D482B26090D00A1E407 /* tar in Resources */ = {isa = PBXBuildFile; fileRef = 84438D442B26090D00A1E407 /* tar */; }; 84438D4A2B26090D00A1E407 /* zebra.deb in Resources */ = {isa = PBXBuildFile; fileRef = 84438D462B26090D00A1E407 /* zebra.deb */; }; @@ -33,6 +34,14 @@ 847099982B1D855E003FA4ED /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 847099972B1D855E003FA4ED /* main.m */; }; 847099A32B1D868F003FA4ED /* Makefile in Sources */ = {isa = PBXBuildFile; fileRef = 847099A02B1D868F003FA4ED /* Makefile */; }; 847099A52B1D9686003FA4ED /* Bootstrap.m in Sources */ = {isa = PBXBuildFile; fileRef = 847099A42B1D9686003FA4ED /* Bootstrap.m */; }; + FE0633AC2B41BC3D00B94787 /* CreditsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE0633AB2B41BC3D00B94787 /* CreditsView.swift */; }; + FE0633AE2B41BCD900B94787 /* OptionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE0633AD2B41BCD900B94787 /* OptionsView.swift */; }; + FE84597B2B44508300DCB44E /* AppViewControllerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE84597A2B44508300DCB44E /* AppViewControllerWrapper.swift */; }; + FE84597D2B44711F00DCB44E /* ButtonStyles.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE84597C2B44711F00DCB44E /* ButtonStyles.swift */; }; + FE895FE82B418FB900A16882 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE895FE72B418FB800A16882 /* ContentView.swift */; }; + FE895FEC2B418FC800A16882 /* VisualEffectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE895FE92B418FC800A16882 /* VisualEffectView.swift */; }; + FE895FED2B418FC800A16882 /* Log.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE895FEA2B418FC800A16882 /* Log.swift */; }; + FE895FF12B418FDC00A16882 /* FluidGradient in Frameworks */ = {isa = PBXBuildFile; productRef = FE895FF02B418FDC00A16882 /* FluidGradient */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -56,6 +65,8 @@ 84364F402B32627200E90B58 /* credits.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = credits.h; sourceTree = ""; }; 84364F412B337BC000E90B58 /* bootstrap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = bootstrap.h; sourceTree = ""; }; 84364F462B3C5D4600E90B58 /* libkrw0-dummy.deb */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libkrw0-dummy.deb"; sourceTree = ""; }; + 843E87582B56E45300CB45C4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; + 843E875A2B56E48D00CB45C4 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; }; 84438D432B26090D00A1E407 /* sileo.deb */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = sileo.deb; sourceTree = ""; }; 84438D442B26090D00A1E407 /* tar */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = tar; sourceTree = ""; }; 84438D462B26090D00A1E407 /* zebra.deb */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = zebra.deb; sourceTree = ""; }; @@ -92,6 +103,14 @@ 8470999F2B1D868F003FA4ED /* entitlements.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = entitlements.plist; sourceTree = ""; }; 847099A02B1D868F003FA4ED /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; 847099A42B1D9686003FA4ED /* Bootstrap.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Bootstrap.m; sourceTree = ""; }; + FE0633AB2B41BC3D00B94787 /* CreditsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreditsView.swift; sourceTree = ""; }; + FE0633AD2B41BCD900B94787 /* OptionsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OptionsView.swift; sourceTree = ""; }; + FE84597A2B44508300DCB44E /* AppViewControllerWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppViewControllerWrapper.swift; sourceTree = ""; }; + FE84597C2B44711F00DCB44E /* ButtonStyles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonStyles.swift; sourceTree = ""; }; + FE895FE62B418FB800A16882 /* Bootstrap-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Bootstrap-Bridging-Header.h"; sourceTree = ""; }; + FE895FE72B418FB800A16882 /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + FE895FE92B418FC800A16882 /* VisualEffectView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VisualEffectView.swift; sourceTree = ""; }; + FE895FEA2B418FC800A16882 /* Log.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Log.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -100,6 +119,7 @@ buildActionMask = 2147483647; files = ( 84364F3D2B323FB600E90B58 /* MBProgressHUD.framework in Frameworks */, + FE895FF12B418FDC00A16882 /* FluidGradient in Frameworks */, 84438D622B2654EB00A1E407 /* MobileContainerManager.framework in Frameworks */, 84438D602B26546E00A1E407 /* MobileCoreServices.framework in Frameworks */, 84438D502B260F8200A1E407 /* libzstd in Frameworks */, @@ -147,6 +167,9 @@ 847099842B1D855D003FA4ED /* Bootstrap */ = { isa = PBXGroup; children = ( + FE0633B52B41CF6600B94787 /* Views */, + FE0633B42B41CF5800B94787 /* Extensions */, + FE0633B32B41CF4D00B94787 /* Classes */, 84438D692B2CDE0100A1E407 /* AppList.h */, 84438D682B2CDE0100A1E407 /* AppList.m */, 847099852B1D855D003FA4ED /* AppDelegate.h */, @@ -160,6 +183,7 @@ 84438D6A2B2CDE0100A1E407 /* AppViewController.h */, 84438D6B2B2CDE0100A1E407 /* AppViewController.m */, 84438D512B260FEB00A1E407 /* zstd_wrapper.m */, + FE895FE62B418FB800A16882 /* Bootstrap-Bridging-Header.h */, 8470998E2B1D855D003FA4ED /* Main.storyboard */, 847099912B1D855E003FA4ED /* Assets.xcassets */, 847099932B1D855E003FA4ED /* LaunchScreen.storyboard */, @@ -177,10 +201,39 @@ 84364F382B2E53BA00E90B58 /* seh.h */, 84438D702B2E439300A1E407 /* syslog.h */, 84438D712B2E4E5D00A1E407 /* common.h */, + 843E87592B56E45300CB45C4 /* Localizable.strings */, ); path = Bootstrap; sourceTree = ""; }; + FE0633B32B41CF4D00B94787 /* Classes */ = { + isa = PBXGroup; + children = ( + FE895FEA2B418FC800A16882 /* Log.swift */, + ); + path = Classes; + sourceTree = ""; + }; + FE0633B42B41CF5800B94787 /* Extensions */ = { + isa = PBXGroup; + children = ( + FE895FE92B418FC800A16882 /* VisualEffectView.swift */, + FE84597C2B44711F00DCB44E /* ButtonStyles.swift */, + ); + path = Extensions; + sourceTree = ""; + }; + FE0633B52B41CF6600B94787 /* Views */ = { + isa = PBXGroup; + children = ( + FE84597A2B44508300DCB44E /* AppViewControllerWrapper.swift */, + FE0633AD2B41BCD900B94787 /* OptionsView.swift */, + FE0633AB2B41BC3D00B94787 /* CreditsView.swift */, + FE895FE72B418FB800A16882 /* ContentView.swift */, + ); + path = Views; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -200,6 +253,7 @@ name = Bootstrap; packageProductDependencies = ( 84438D4F2B260F8200A1E407 /* libzstd */, + FE895FF02B418FDC00A16882 /* FluidGradient */, ); productName = Bootstrap; productReference = 847099822B1D855D003FA4ED /* Bootstrap.app */; @@ -216,6 +270,7 @@ TargetAttributes = { 847099812B1D855D003FA4ED = { CreatedOnToolsVersion = 14.1; + LastSwiftMigration = 1510; }; }; }; @@ -226,10 +281,12 @@ knownRegions = ( en, Base, + de, ); mainGroup = 847099792B1D855D003FA4ED; packageReferences = ( 84438D4E2B260F8200A1E407 /* XCRemoteSwiftPackageReference "zstd" */, + FE895FEF2B418FDC00A16882 /* XCRemoteSwiftPackageReference "FluidGradient" */, ); productRefGroup = 847099832B1D855D003FA4ED /* Products */; projectDirPath = ""; @@ -249,6 +306,7 @@ 84438D472B26090D00A1E407 /* sileo.deb in Resources */, 84438D4A2B26090D00A1E407 /* zebra.deb in Resources */, 84364F472B3C5D4600E90B58 /* libkrw0-dummy.deb in Resources */, + 843E87572B56E45300CB45C4 /* Localizable.strings in Resources */, 84438D482B26090D00A1E407 /* tar in Resources */, 847099952B1D855E003FA4ED /* LaunchScreen.storyboard in Resources */, 847099922B1D855E003FA4ED /* Assets.xcassets in Resources */, @@ -265,9 +323,16 @@ files = ( 847099A32B1D868F003FA4ED /* Makefile in Sources */, 8470998D2B1D855D003FA4ED /* ViewController.m in Sources */, + FE895FE82B418FB900A16882 /* ContentView.swift in Sources */, + FE0633AE2B41BCD900B94787 /* OptionsView.swift in Sources */, + FE84597B2B44508300DCB44E /* AppViewControllerWrapper.swift in Sources */, 847099A52B1D9686003FA4ED /* Bootstrap.m in Sources */, 84438D652B27522400A1E407 /* envbuf.c in Sources */, + FE895FEC2B418FC800A16882 /* VisualEffectView.swift in Sources */, + FE895FED2B418FC800A16882 /* Log.swift in Sources */, 84438D4C2B2609B200A1E407 /* utils.m in Sources */, + FE0633AC2B41BC3D00B94787 /* CreditsView.swift in Sources */, + FE84597D2B44711F00DCB44E /* ButtonStyles.swift in Sources */, 84438D6F2B2CE5A300A1E407 /* AppEnabler.m in Sources */, 847099872B1D855D003FA4ED /* AppDelegate.m in Sources */, 847099982B1D855E003FA4ED /* main.m in Sources */, @@ -282,6 +347,15 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ + 843E87592B56E45300CB45C4 /* Localizable.strings */ = { + isa = PBXVariantGroup; + children = ( + 843E87582B56E45300CB45C4 /* en */, + 843E875A2B56E48D00CB45C4 /* de */, + ); + name = Localizable.strings; + sourceTree = ""; + }; 8470998E2B1D855D003FA4ED /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( @@ -305,6 +379,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; @@ -363,6 +438,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; @@ -416,6 +492,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 49LJ27SG38; @@ -431,7 +508,7 @@ INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -441,6 +518,9 @@ PRODUCT_BUNDLE_IDENTIFIER = com.roothide.Bootstrap; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OBJC_BRIDGING_HEADER = "Bootstrap/Bootstrap-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -450,6 +530,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 49LJ27SG38; @@ -465,7 +546,7 @@ INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -475,6 +556,8 @@ PRODUCT_BUNDLE_IDENTIFIER = com.roothide.Bootstrap; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OBJC_BRIDGING_HEADER = "Bootstrap/Bootstrap-Bridging-Header.h"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -511,6 +594,14 @@ kind = branch; }; }; + FE895FEF2B418FDC00A16882 /* XCRemoteSwiftPackageReference "FluidGradient" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/Cindori/FluidGradient.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 1.0.0; + }; + }; /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ @@ -519,6 +610,11 @@ package = 84438D4E2B260F8200A1E407 /* XCRemoteSwiftPackageReference "zstd" */; productName = libzstd; }; + FE895FF02B418FDC00A16882 /* FluidGradient */ = { + isa = XCSwiftPackageProductDependency; + package = FE895FEF2B418FDC00A16882 /* XCRemoteSwiftPackageReference "FluidGradient" */; + productName = FluidGradient; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 8470997A2B1D855D003FA4ED /* Project object */; diff --git a/Bootstrap.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Bootstrap.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 38b69119..4ee7715a 100644 --- a/Bootstrap.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Bootstrap.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,14 @@ { "pins" : [ + { + "identity" : "fluidgradient", + "kind" : "remoteSourceControl", + "location" : "https://github.com/Cindori/FluidGradient.git", + "state" : { + "revision" : "9ddda4cf23671ef0228e88681ec6210cb3e0d7f7", + "version" : "1.0.0" + } + }, { "identity" : "zstd", "kind" : "remoteSourceControl", diff --git a/Bootstrap.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate b/Bootstrap.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate index 55ae4116..0f331839 100644 Binary files a/Bootstrap.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate and b/Bootstrap.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Bootstrap.xcodeproj/xcuserdata/haxi0.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Bootstrap.xcodeproj/xcuserdata/haxi0.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 00000000..29da629b --- /dev/null +++ b/Bootstrap.xcodeproj/xcuserdata/haxi0.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,6 @@ + + + diff --git a/Bootstrap.xcodeproj/xcuserdata/haxi0.xcuserdatad/xcschemes/xcschememanagement.plist b/Bootstrap.xcodeproj/xcuserdata/haxi0.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 00000000..630bbe2b --- /dev/null +++ b/Bootstrap.xcodeproj/xcuserdata/haxi0.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + Bootstrap.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/Bootstrap/AppDelegate.h b/Bootstrap/AppDelegate.h index 4c50fad2..8c9d1089 100644 --- a/Bootstrap/AppDelegate.h +++ b/Bootstrap/AppDelegate.h @@ -13,7 +13,6 @@ + (void)showMesage:(NSString*)msg title:(NSString*)title; + (void)addLogText:(NSString*)text; -+ (void)registerLogView:(UITextView*)view; @end diff --git a/Bootstrap/AppDelegate.m b/Bootstrap/AppDelegate.m index fc791355..77853dfa 100644 --- a/Bootstrap/AppDelegate.m +++ b/Bootstrap/AppDelegate.m @@ -8,23 +8,9 @@ @interface AppDelegate () @implementation AppDelegate -UITextView* logView=nil; - -+ (void)registerLogView:(UITextView*)view -{ - dispatch_async(dispatch_get_main_queue(), ^{ - logView = view; - logView.layoutManager.allowsNonContiguousLayout = NO; - }); -} - + (void)addLogText:(NSString*)text { - dispatch_async(dispatch_get_main_queue(), ^{ - [logView setText:[logView.text stringByAppendingString:[NSString stringWithFormat:@"%@\n",text]]]; - if(logView.contentSize.height >= logView.bounds.size.height) - [logView setContentOffset:CGPointMake(0, logView.contentSize.height - logView.bounds.size.height) animated:YES]; - }); + [NSNotificationCenter.defaultCenter postNotificationName:@"LogMsgNotification" object:text]; } MBProgressHUD *switchHud=nil; diff --git a/Bootstrap/AppViewController.m b/Bootstrap/AppViewController.m index 580deffd..ed52f26b 100644 --- a/Bootstrap/AppViewController.m +++ b/Bootstrap/AppViewController.m @@ -76,7 +76,7 @@ - (void)viewDidLoad { self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleInsetGrouped]; self.tableView.tableFooterView = [[UIView alloc] init]; - [self setTitle:Localized(@"Tweak Enabler")]; + [self setTitle:Localized(@"Eanble Tweak for App")]; isFiltered = false; diff --git a/Bootstrap/Assets.xcassets/Bootstrap.imageset/Bootstrap.png b/Bootstrap/Assets.xcassets/Bootstrap.imageset/Bootstrap.png new file mode 100644 index 00000000..da281067 Binary files /dev/null and b/Bootstrap/Assets.xcassets/Bootstrap.imageset/Bootstrap.png differ diff --git a/Bootstrap/Assets.xcassets/Bootstrap.imageset/Contents.json b/Bootstrap/Assets.xcassets/Bootstrap.imageset/Contents.json new file mode 100644 index 00000000..e1aff71d --- /dev/null +++ b/Bootstrap/Assets.xcassets/Bootstrap.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "Bootstrap.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Bootstrap/Base.lproj/Main.storyboard b/Bootstrap/Base.lproj/Main.storyboard index 2f16a0da..3824c6dd 100644 --- a/Bootstrap/Base.lproj/Main.storyboard +++ b/Bootstrap/Base.lproj/Main.storyboard @@ -1,10 +1,9 @@ - + - - + @@ -17,137 +16,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -155,24 +26,8 @@ - - - - - - - - - - - - - - - - diff --git a/Bootstrap/Bootstrap-Bridging-Header.h b/Bootstrap/Bootstrap-Bridging-Header.h new file mode 100644 index 00000000..97e41f5a --- /dev/null +++ b/Bootstrap/Bootstrap-Bridging-Header.h @@ -0,0 +1,9 @@ +// +// Use this file to import your target's public headers that you would like to expose to Swift. +// +#include +#include "credits.h" +#include "utils.h" +#include "bootstrap.h" +#include "ViewController.h" +#include "AppViewController.h" diff --git a/Bootstrap/Classes/Log.swift b/Bootstrap/Classes/Log.swift new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/Bootstrap/Classes/Log.swift @@ -0,0 +1 @@ + diff --git a/Bootstrap/Extensions/ButtonStyles.swift b/Bootstrap/Extensions/ButtonStyles.swift new file mode 100644 index 00000000..cf3c5246 --- /dev/null +++ b/Bootstrap/Extensions/ButtonStyles.swift @@ -0,0 +1,31 @@ +// +// ButtonStyles.swift +// Bootstrap +// +// Created by haxi0 on 02.01.2024. +// + +import SwiftUI + + +struct DopamineButtonStyle: ButtonStyle { // ty to dopamine for button style inspiration :troll: + @Environment(\.isEnabled) var isEnabled + func makeBody(configuration: Configuration) -> some View { + configuration.label + .padding(.vertical, 10) + .frame(width: 250) + .background(Color.clear) + .cornerRadius(10) + // change the text color based on if it's disabled + .foregroundColor(isEnabled ? .black : .gray) + // make the button a bit more translucent when pressed + .opacity(configuration.isPressed ? 0.3 : 1.0) + // make the button a bit smaller when pressed + .scaleEffect(configuration.isPressed ? 0.98 : 1.0) + .overlay( + RoundedRectangle(cornerRadius: 10) + .stroke(.gray, lineWidth: 1) + .opacity(isEnabled ? 0.3 : 0.1) + ) + } +} diff --git a/Bootstrap/Extensions/VisualEffectView.swift b/Bootstrap/Extensions/VisualEffectView.swift new file mode 100644 index 00000000..ac482598 --- /dev/null +++ b/Bootstrap/Extensions/VisualEffectView.swift @@ -0,0 +1,14 @@ +// +// VisualEffectView.swift +// BootstrapUI +// +// Created by haxi0 on 29.12.2023. +// + +import SwiftUI + +struct VisualEffectView: UIViewRepresentable { + var effect: UIVisualEffect? + func makeUIView(context: UIViewRepresentableContext) -> UIVisualEffectView { UIVisualEffectView() } + func updateUIView(_ uiView: UIVisualEffectView, context: UIViewRepresentableContext) { uiView.effect = effect } +} diff --git a/Bootstrap/ViewController.h b/Bootstrap/ViewController.h index a79652b5..6d8886b8 100644 --- a/Bootstrap/ViewController.h +++ b/Bootstrap/ViewController.h @@ -1,7 +1,15 @@ #import @interface ViewController : UIViewController - - @end +void initFromSwiftUI(); +void respringAction(); +void rebuildappsAction(); +void reinstallPackageManager(); +void rebuildIconCacheAction(); +void tweaEnableAction(BOOL enable); +BOOL opensshAction(BOOL enable); +void bootstrapAction(); +void unbootstrapAction(); +BOOL updateOpensshStatus(BOOL notify); diff --git a/Bootstrap/ViewController.m b/Bootstrap/ViewController.m index 29bfa85a..f1f85d2c 100644 --- a/Bootstrap/ViewController.m +++ b/Bootstrap/ViewController.m @@ -1,11 +1,12 @@ -#import "ViewController.h" -#include "NSUserDefaults+appDefaults.h" #include "common.h" -#include "AppDelegate.h" -#include "AppViewController.h" -#include "bootstrap.h" #include "credits.h" +#include "bootstrap.h" #include "AppList.h" +#include "AppDelegate.h" +#import "ViewController.h" +#include "AppViewController.h" +#include "NSUserDefaults+appDefaults.h" +#import "Bootstrap-Swift.h" #import #include @@ -18,168 +19,127 @@ @interface ViewController () -@property (weak, nonatomic) IBOutlet UITextView *logView; -@property (weak, nonatomic) IBOutlet UIButton *bootstraBtn; -@property (weak, nonatomic) IBOutlet UIButton *unbootstrapBtn; -@property (weak, nonatomic) IBOutlet UISwitch *opensshState; -@property (weak, nonatomic) IBOutlet UIButton *appEnablerBtn; -@property (weak, nonatomic) IBOutlet UIButton *respringBtn; -@property (weak, nonatomic) IBOutlet UIButton *uninstallBtn; -@property (weak, nonatomic) IBOutlet UIButton *rebuildappsBtn; -@property (weak, nonatomic) IBOutlet UIButton *rebuildIconCacheBtn; -@property (weak, nonatomic) IBOutlet UIButton *reinstallPackageManagerBtn; -@property (weak, nonatomic) IBOutlet UILabel *opensshLabel; -@property (weak, nonatomic) IBOutlet UISwitch *tweakenableState; - @end +BOOL gTweakEnabled=YES; + @implementation ViewController -- (BOOL)checkTSVersion { +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. - CFURLRef binaryURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, (__bridge CFStringRef)NSBundle.mainBundle.executablePath, kCFURLPOSIXPathStyle, false); - if(binaryURL == NULL) return NO; + UIViewController *vc = [SwiftUIViewWrapper createSwiftUIView]; - SecStaticCodeRef codeRef = NULL; - OSStatus result = SecStaticCodeCreateWithPathAndAttributes(binaryURL, kSecCSDefaultFlags, NULL, &codeRef); - if(result != errSecSuccess) return NO; - - CFDictionaryRef signingInfo = NULL; - result = SecCodeCopySigningInformation(codeRef, kSecCSSigningInformation, &signingInfo); - if(result != errSecSuccess) return NO; - - NSString* teamID = (NSString*)CFDictionaryGetValue(signingInfo, CFSTR("teamid")); - SYSLOG("teamID in trollstore: %@", teamID); + UIView *swiftuiView = vc.view; + swiftuiView.translatesAutoresizingMaskIntoConstraints = NO; - return [teamID isEqualToString:@"T8ALTGMVXN"]; + [self addChildViewController:vc]; + [self.view addSubview:swiftuiView]; + + [NSLayoutConstraint activateConstraints:@[ + [swiftuiView.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor], + [swiftuiView.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor], + [swiftuiView.topAnchor constraintEqualToAnchor:self.view.topAnchor], + [swiftuiView.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor], + ]]; + + [vc didMoveToParentViewController:self]; } -- (void)viewDidLoad { - [super viewDidLoad]; - // Do any additional setup after loading the view. +BOOL updateOpensshStatus(BOOL notify) +{ + BOOL status; - self.logView.text = nil; - self.logView.layer.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.01].CGColor; - self.logView.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.01].CGColor; - self.logView.layer.borderWidth = 1.0; - self.logView.layer.cornerRadius = 5.0; + if(isSystemBootstrapped()) { + status = spawnRoot(jbroot(@"/basebin/bootstrapd"), @[@"openssh",@"check"], nil, nil)==0; + } else { + status = [NSUserDefaults.appDefaults boolForKey:@"openssh"]; + } - [AppDelegate registerLogView:self.logView]; + if(notify) [NSNotificationCenter.defaultCenter postNotificationName:@"opensshStatusNotification" object:@(status)]; - BOOL IconCacheRebuilding=NO; + return status; +} + +BOOL checkServer() +{ + static bool alerted = false; + if(alerted) return NO; + + BOOL ret=NO; + + if(spawnRoot(jbroot(@"/basebin/bootstrapd"), @[@"check"], nil, nil) != 0) + { + ret = NO; + alerted = true; + + UIAlertController *alert = [UIAlertController alertControllerWithTitle:Localized(@"Server Not Running") message:Localized(@"for unknown reasons the bootstrap server is not running, the only thing we can do is to restart it now.") preferredStyle:UIAlertControllerStyleAlert]; + [alert addAction:[UIAlertAction actionWithTitle:Localized(@"Restart Server") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){ + + alerted = false; + + NSString* log=nil; + NSString* err=nil; + if(spawnRoot(jbroot(@"/basebin/bootstrapd"), @[@"daemon",@"-f"], &log, &err)==0) { + [AppDelegate addLogText:Localized(@"bootstrap server restart successful")]; + } else { + [AppDelegate showMesage:[NSString stringWithFormat:@"%@\nERR:%@"] title:Localized(@"Error")]; + } + }]]; + + [AppDelegate showAlert:alert]; + } else { + ret = YES; + } + updateOpensshStatus(YES); + return ret; +} + +void initFromSwiftUI() +{ + BOOL IconCacheRebuilding=NO; + if(isSystemBootstrapped()) { - if(checkBootstrapVersion()) { - self.bootstraBtn.enabled = NO; - [self.bootstraBtn setTitle:Localized(@"Bootstrapped") forState:UIControlStateDisabled]; - } else { - self.bootstraBtn.enabled = YES; - [self.bootstraBtn setTitle:Localized(@"Update") forState:UIControlStateNormal]; - } - - self.respringBtn.enabled = YES; - self.appEnablerBtn.enabled = YES; - self.rebuildappsBtn.enabled = YES; - self.rebuildIconCacheBtn.enabled = YES; - self.reinstallPackageManagerBtn.enabled = YES; - self.uninstallBtn.enabled = NO; - self.uninstallBtn.hidden = NO; - self.tweakenableState.on = [NSFileManager.defaultManager fileExistsAtPath:jbroot(@"/var/mobile/.tweakenabled")]; - if([NSFileManager.defaultManager fileExistsAtPath:jbroot(@"/basebin/.rebuildiconcache")]) { [NSFileManager.defaultManager removeItemAtPath:jbroot(@"/basebin/.rebuildiconcache") error:nil]; - [AppDelegate showHudMsg:Localized(@"Rebuilding") detail:Localized(@"Don't exit Bootstrap app until show the lock screen.")]; + [AppDelegate showHudMsg:Localized(@"Rebuilding") detail:Localized(@"Don't exit Bootstrap app until show the lock screen")]; IconCacheRebuilding = YES; } - - if([NSFileManager.defaultManager fileExistsAtPath:jbroot(@"/basebin/.launchctl_support")]) { - self.opensshState.hidden = YES; - self.opensshLabel.hidden = YES; - } - } - else if(isBootstrapInstalled()) - { - - self.bootstraBtn.enabled = YES; - [self.bootstraBtn setTitle:Localized(@"Bootstrap") forState:UIControlStateNormal]; - - self.respringBtn.enabled = NO; - self.appEnablerBtn.enabled = NO; - self.rebuildappsBtn.enabled = NO; - self.rebuildIconCacheBtn.enabled = NO; - self.reinstallPackageManagerBtn.enabled = NO; - self.uninstallBtn.hidden = NO; -//enable by default self.tweakenableState.on = [NSFileManager.defaultManager fileExistsAtPath:jbroot(@"/var/mobile/.tweakenabled")]; - } - else if(NSProcessInfo.processInfo.operatingSystemVersion.majorVersion>=15) - { - self.bootstraBtn.enabled = YES; - [self.bootstraBtn setTitle:Localized(@"Install") forState:UIControlStateNormal]; - - self.respringBtn.enabled = NO; - self.appEnablerBtn.enabled = NO; - self.rebuildappsBtn.enabled = NO; - self.rebuildIconCacheBtn.enabled = NO; - self.reinstallPackageManagerBtn.enabled = NO; - self.uninstallBtn.hidden = YES; - } else { - self.bootstraBtn.enabled = NO; - [self.bootstraBtn setTitle:Localized(@"Unsupported") forState:UIControlStateDisabled]; - - self.respringBtn.enabled = NO; - self.appEnablerBtn.enabled = NO; - self.rebuildappsBtn.enabled = NO; - self.rebuildIconCacheBtn.enabled = NO; - self.reinstallPackageManagerBtn.enabled = NO; - self.uninstallBtn.hidden = YES; - - [AppDelegate showMesage:Localized(@"the current ios version is not supported yet, we may add support in a future version.") title:Localized(@"Unsupported")]; } - [AppDelegate addLogText:[NSString stringWithFormat:@"ios-version: %@",UIDevice.currentDevice.systemVersion]]; - + struct utsname systemInfo; uname(&systemInfo); [AppDelegate addLogText:[NSString stringWithFormat:@"device-model: %s",systemInfo.machine]]; - + [AppDelegate addLogText:[NSString stringWithFormat:@"app-version: %@",NSBundle.mainBundle.infoDictionary[@"CFBundleShortVersionString"]]]; - + [AppDelegate addLogText:[NSString stringWithFormat:@"boot-session: %@",getBootSession()]]; - - [AppDelegate addLogText: isBootstrapInstalled()? @"bootstrap installed":@"bootstrap not installed"]; - [AppDelegate addLogText: isSystemBootstrapped()? @"system bootstrapped":@"system not bootstrapped"]; - - if(!isBootstrapInstalled()) dispatch_async(dispatch_get_global_queue(0, 0), ^{ - usleep(1000*500); - [AppDelegate addLogText:@"\n:::Credits:::\n"]; - usleep(1000*500); - for(NSString* name in CREDITS) { - usleep(1000*50); - [AppDelegate addLogText:[NSString stringWithFormat:@"%@ - %@\n",name,CREDITS[name]]]; - } - sleep(1); - [AppDelegate addLogText:Localized(@"\nthanks to these guys, we couldn't have completed this project without their help!")]; - - }); - + + [AppDelegate addLogText: isBootstrapInstalled()? Localized(@"bootstrap installed"):Localized(@"bootstrap not installed")]; + [AppDelegate addLogText: isSystemBootstrapped()? Localized(@"system bootstrapped"):Localized(@"system not bootstrapped")]; + SYSLOG("locale=%@", NSLocale.currentLocale.countryCode); SYSLOG("locale=%@", [NSUserDefaults.appDefaults valueForKey:@"locale"]); [NSUserDefaults.appDefaults setValue:NSLocale.currentLocale.countryCode forKey:@"locale"]; [NSUserDefaults.appDefaults synchronize]; SYSLOG("locale=%@", [NSUserDefaults.appDefaults valueForKey:@"locale"]); - + if(isSystemBootstrapped()) { - if([self checkServer]) { + if(checkServer()) { [AppDelegate addLogText:Localized(@"bootstrap server check successful")]; } - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(checkServer) - name:UIApplicationWillEnterForegroundNotification object:nil]; + + [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationWillEnterForegroundNotification object:nil queue:nil usingBlock:^(NSNotification * _Nonnull note) { + checkServer(); + }]; } - + if(!IconCacheRebuilding && isBootstrapInstalled() && !isSystemBootstrapped()) { if([UIApplication.sharedApplication canOpenURL:[NSURL URLWithString:@"filza://"]] || [LSPlugInKitProxy pluginKitProxyForIdentifier:@"com.tigisoftware.Filza.Sharing"]) @@ -189,67 +149,42 @@ - (void)viewDidLoad { } } --(BOOL)checkServer -{ - static bool alerted = false; - if(alerted) return NO; - - BOOL ret=NO; +@end + +BOOL checkTSVersion() +{ + CFURLRef binaryURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, (__bridge CFStringRef)NSBundle.mainBundle.executablePath, kCFURLPOSIXPathStyle, false); + if(binaryURL == NULL) return NO; - if(spawnRoot(jbroot(@"/basebin/bootstrapd"), @[@"check"], nil, nil) != 0) - { - ret = NO; - alerted = true; + SecStaticCodeRef codeRef = NULL; + OSStatus result = SecStaticCodeCreateWithPathAndAttributes(binaryURL, kSecCSDefaultFlags, NULL, &codeRef); + if(result != errSecSuccess) return NO; - UIAlertController *alert = [UIAlertController alertControllerWithTitle:Localized(@"Server Not Running") message:Localized(@"for unknown reasons the bootstrap server is not running, the only thing we can do is to restart it now.") preferredStyle:UIAlertControllerStyleAlert]; - [alert addAction:[UIAlertAction actionWithTitle:Localized(@"Restart Server") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){ - - alerted = false; - - NSString* log=nil; - NSString* err=nil; - if(spawnRoot(jbroot(@"/basebin/bootstrapd"), @[@"daemon",@"-f"], &log, &err)==0) { - [AppDelegate addLogText:Localized(@"bootstrap server restart successful")]; - [self updateOpensshStatus]; - } else { - [AppDelegate showMesage:[NSString stringWithFormat:@"%@\nERR:%@"] title:Localized(@"Error")]; - } - - }]]; + CFDictionaryRef signingInfo = NULL; + result = SecCodeCopySigningInformation(codeRef, kSecCSSigningInformation, &signingInfo); + if(result != errSecSuccess) return NO; - [AppDelegate showAlert:alert]; - } else { - [self updateOpensshStatus]; - ret = YES; - } + NSString* teamID = (NSString*)CFDictionaryGetValue(signingInfo, CFSTR("teamid")); + SYSLOG("teamID in trollstore: %@", teamID); - return ret; -} - --(void)updateOpensshStatus { - dispatch_async(dispatch_get_main_queue(), ^{ - if(isSystemBootstrapped()) { - self.opensshState.on = spawnRoot(jbroot(@"/basebin/bootstrapd"), @[@"openssh",@"check"], nil, nil)==0; - } else { - self.opensshState.on = [NSUserDefaults.appDefaults boolForKey:@"openssh"]; - } - }); + return [teamID isEqualToString:@"T8ALTGMVXN"]; } -- (IBAction)respring:(id)sender { - +void respringAction() +{ NSString* log=nil; NSString* err=nil; int status = spawnBootstrap((char*[]){"/usr/bin/sbreload", NULL}, &log, &err); if(status!=0) [AppDelegate showMesage:[NSString stringWithFormat:@"%@\n\nstderr:\n%@",log,err] title:[NSString stringWithFormat:@"code(%d)",status]]; } -- (IBAction)rebuildapps:(id)sender { - [AppDelegate addLogText:@"Status: Rebuilding Apps"]; - +void rebuildappsAction() +{ + [AppDelegate addLogText:Localized(@"Status: Rebuilding Apps")]; + dispatch_async(dispatch_get_global_queue(0, 0), ^{ [AppDelegate showHudMsg:Localized(@"Applying")]; - + NSString* log=nil; NSString* err=nil; int status = spawnBootstrap((char*[]){"/bin/sh", "/basebin/rebuildapps.sh", NULL}, nil, nil); @@ -262,42 +197,42 @@ - (IBAction)rebuildapps:(id)sender { }); } -- (IBAction)reinstallPackageManager:(id)sender { - +void reinstallPackageManager() +{ dispatch_async(dispatch_get_global_queue(0, 0), ^{ [AppDelegate showHudMsg:Localized(@"Applying")]; - + NSString* log=nil; NSString* err=nil; - + BOOL success=YES; - - [AppDelegate addLogText:@"Status: Reinstalling Sileo"]; + + [AppDelegate addLogText:Localized(@"Status: Reinstalling Sileo")]; NSString* sileoDeb = [NSBundle.mainBundle.bundlePath stringByAppendingPathComponent:@"sileo.deb"]; if(spawnBootstrap((char*[]){"/usr/bin/dpkg", "-i", rootfsPrefix(sileoDeb).fileSystemRepresentation, NULL}, &log, &err) != 0) { [AppDelegate addLogText:[NSString stringWithFormat:@"failed:%@\nERR:%@", log, err]]; success = NO; } - + if(spawnBootstrap((char*[]){"/usr/bin/uicache", "-p", "/Applications/Sileo.app", NULL}, &log, &err) != 0) { [AppDelegate addLogText:[NSString stringWithFormat:@"failed:%@\nERR:%@", log, err]]; success = NO; } - - [AppDelegate addLogText:@"Status: Reinstalling Zebra"]; + + [AppDelegate addLogText:Localized(@"Status: Reinstalling Zebra")]; NSString* zebraDeb = [NSBundle.mainBundle.bundlePath stringByAppendingPathComponent:@"zebra.deb"]; if(spawnBootstrap((char*[]){"/usr/bin/dpkg", "-i", rootfsPrefix(zebraDeb).fileSystemRepresentation, NULL}, nil, nil) != 0) { [AppDelegate addLogText:[NSString stringWithFormat:@"failed:%@\nERR:%@", log, err]]; success = NO; } - + if(spawnBootstrap((char*[]){"/usr/bin/uicache", "-p", "/Applications/Zebra.app", NULL}, &log, &err) != 0) { [AppDelegate addLogText:[NSString stringWithFormat:@"failed:%@\nERR:%@", log, err]]; success = NO; } - + if(success) { - [AppDelegate showMesage:@"Sileo and Zebra reinstalled!" title:@""]; + [AppDelegate showMesage:Localized(@"Sileo and Zebra reinstalled!") title:@""]; } [AppDelegate dismissHud]; }); @@ -310,132 +245,132 @@ int rebuildIconCache() STRAPLOG("trollstore not found!"); return -1; } - + STRAPLOG("rebuild icon cache..."); ASSERT([LSApplicationWorkspace.defaultWorkspace _LSPrivateRebuildApplicationDatabasesForSystemApps:YES internal:YES user:YES]); - + NSString* log=nil; NSString* err=nil; - + if(spawnRoot([tsapp.bundleURL.path stringByAppendingPathComponent:@"trollstorehelper"], @[@"refresh"], &log, &err) != 0) { STRAPLOG("refresh tsapps failed:%@\nERR:%@", log, err); return -1; } - + [[NSString new] writeToFile:jbroot(@"/basebin/.rebuildiconcache") atomically:YES encoding:NSUTF8StringEncoding error:nil]; [LSApplicationWorkspace.defaultWorkspace openApplicationWithBundleID:NSBundle.mainBundle.bundleIdentifier]; - + int status = spawnBootstrap((char*[]){"/bin/sh", "/basebin/rebuildapps.sh", NULL}, &log, &err); if(status==0) { killAllForApp("/usr/libexec/backboardd"); } else { STRAPLOG("rebuildapps failed:%@\nERR:\n%@",log,err); } - + if([NSFileManager.defaultManager fileExistsAtPath:jbroot(@"/basebin/.rebuildiconcache")]) { [NSFileManager.defaultManager removeItemAtPath:jbroot(@"/basebin/.rebuildiconcache") error:nil]; } - + return status; } -- (IBAction)rebuildIconCache:(id)sender { - [AppDelegate addLogText:@"Status: Rebuilding Icon Cache"]; - +void rebuildIconCacheAction() +{ + [AppDelegate addLogText:Localized(@"Status: Rebuilding Icon Cache")]; + dispatch_async(dispatch_get_global_queue(0, 0), ^{ - [AppDelegate showHudMsg:Localized(@"Rebuilding") detail:Localized(@"Don't exit Bootstrap app until show the lock screen.")]; - + [AppDelegate showHudMsg:Localized(@"Rebuilding") detail:Localized(@"Don't exit Bootstrap app until show the lock screen")]; + NSString* log=nil; NSString* err=nil; int status = spawnRoot(NSBundle.mainBundle.executablePath, @[@"rebuildiconcache"], &log, &err); if(status != 0) { [AppDelegate showMesage:[NSString stringWithFormat:@"%@\n\nstderr:\n%@",log,err] title:[NSString stringWithFormat:@"code(%d)",status]]; } - + [AppDelegate dismissHud]; }); } -- (IBAction)appenabler:(id)sender { - - AppViewController *vc = [[AppViewController alloc] init]; - UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:vc]; - [self presentViewController:navigationController animated:YES completion:^{}]; -} - -- (IBAction)tweakenable:(id)sender { - UISwitch* enabled = (UISwitch*)sender; +void tweaEnableAction(BOOL enable) +{ + gTweakEnabled = enable; if(!isBootstrapInstalled()) return; - - if(enabled.on) { + + if(enable) { ASSERT([[NSString new] writeToFile:jbroot(@"/var/mobile/.tweakenabled") atomically:YES encoding:NSUTF8StringEncoding error:nil]); } else if([NSFileManager.defaultManager fileExistsAtPath:jbroot(@"/var/mobile/.tweakenabled")]) { ASSERT([NSFileManager.defaultManager removeItemAtPath:jbroot(@"/var/mobile/.tweakenabled") error:nil]); } } -- (IBAction)openssh:(id)sender { - UISwitch* enabled = (UISwitch*)sender; - +BOOL opensshAction(BOOL enable) +{ if(!isSystemBootstrapped()) { - [NSUserDefaults.appDefaults setValue:@(enabled.on) forKey:@"openssh"]; + [NSUserDefaults.appDefaults setValue:@(enable) forKey:@"openssh"]; [NSUserDefaults.appDefaults synchronize]; - return; + return enable; } + if([NSFileManager.defaultManager fileExistsAtPath:jbroot(@"/basebin/.launchctl_support")]) { + return NO; + } + if(![NSFileManager.defaultManager fileExistsAtPath:jbroot(@"/usr/libexec/sshd-keygen-wrapper")]) { [AppDelegate showMesage:Localized(@"openssh package is not installed") title:Localized(@"Developer")]; - enabled.on = NO; - return; + return NO; } - + NSString* log=nil; NSString* err=nil; - int status = spawnRoot(jbroot(@"/basebin/bootstrapd"), @[@"openssh",enabled.on?@"start":@"stop"], &log, &err); - + int status = spawnRoot(jbroot(@"/basebin/bootstrapd"), @[@"openssh",enable?@"start":@"stop"], &log, &err); + //try - if(!enabled.on) spawnBootstrap((char*[]){"/usr/bin/killall","-9","sshd",NULL}, nil, nil); - + if(!enable) spawnBootstrap((char*[]){"/usr/bin/killall","-9","sshd",NULL}, nil, nil); + if(status==0) { - [NSUserDefaults.appDefaults setValue:@(enabled.on) forKey:@"openssh"]; + [NSUserDefaults.appDefaults setValue:@(enable) forKey:@"openssh"]; [NSUserDefaults.appDefaults synchronize]; } else { [AppDelegate showMesage:[NSString stringWithFormat:@"%@\n\nstderr:\n%@",log,err] title:[NSString stringWithFormat:@"code(%d)",status]]; - if(enabled.on) [enabled setOn:NO]; + return NO; } + + return enable; } -- (IBAction)bootstrap:(id)sender { - + +void bootstrapAction() +{ if(isSystemBootstrapped()) { ASSERT(checkBootstrapVersion()==false); - + UIAlertController *alert = [UIAlertController alertControllerWithTitle:Localized(@"Update") message:Localized(@"The current bootstrapped version is inconsistent with the Bootstrap app version, and you need to reboot the device to update it.") preferredStyle:UIAlertControllerStyleAlert]; - + [alert addAction:[UIAlertAction actionWithTitle:Localized(@"Cancel") style:UIAlertActionStyleDefault handler:nil]]; [alert addAction:[UIAlertAction actionWithTitle:Localized(@"Reboot Device") style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) { ASSERT(spawnRoot(NSBundle.mainBundle.executablePath, @[@"reboot"], nil, nil)==0); }]]; - + [AppDelegate showAlert:alert]; return; } - - if(![self checkTSVersion]) { + + if(!checkTSVersion()) { [AppDelegate showMesage:Localized(@"Your trollstore version is too old, Bootstrap only supports trollstore>=2.0, you have to update your trollstore then reinstall Bootstrap app.") title:Localized(@"Error")]; return; } - + if(spawnRoot([NSBundle.mainBundle.bundlePath stringByAppendingPathComponent:@"basebin/devtest"], nil, nil, nil) != 0) { - [AppDelegate showMesage:Localized(@"Your device does not seem to have developer mode enabled.\n\nPlease enable developer mode in Settings->[Privacy&Security] and reboot your device.") title:Localized(@"Error")]; + [AppDelegate showMesage:Localized(@"Your device does not seem to have developer mode enabled.\n\nPlease enable developer mode and reboot your device.") title:Localized(@"Error")]; return; } - + UIImpactFeedbackGenerator* generator = [[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleSoft]; [generator impactOccurred]; @@ -445,7 +380,8 @@ - (IBAction)bootstrap:(id)sender { [AppDelegate showMesage:Localized(@"roothide dopamine has been installed on this device, now install this bootstrap may break it!") title:Localized(@"Error")]; return; } - + + //check beta version if([NSFileManager.defaultManager fileExistsAtPath:jbroot(@"/.bootstrapped")]) { NSString* strappedVersion = [NSString stringWithContentsOfFile:jbroot(@"/.bootstrapped") encoding:NSUTF8StringEncoding error:nil]; if(strappedVersion.intValue != BOOTSTRAP_VERSION) { @@ -454,13 +390,11 @@ - (IBAction)bootstrap:(id)sender { } } } - - [(UIButton*)sender setEnabled:NO]; - + [AppDelegate showHudMsg:Localized(@"Bootstrapping")]; - + dispatch_async(dispatch_get_global_queue(0, 0), ^{ - + const char* argv[] = {NSBundle.mainBundle.executablePath.fileSystemRepresentation, "bootstrap", NULL}; int status = spawn(argv[0], argv, environ, ^(char* outstr, int length){ NSString *str = [[NSString alloc] initWithBytes:outstr length:length encoding:NSASCIIStringEncoding]; @@ -469,72 +403,69 @@ - (IBAction)bootstrap:(id)sender { NSString *str = [[NSString alloc] initWithBytes:errstr length:length encoding:NSASCIIStringEncoding]; [AppDelegate addLogText:[NSString stringWithFormat:@"ERR: %@\n",str]]; }); - + [AppDelegate dismissHud]; - + if(status != 0) { [AppDelegate showMesage:@"" title:[NSString stringWithFormat:@"code(%d)",status]]; return; } - + NSString* log=nil; NSString* err=nil; - + if([NSUserDefaults.appDefaults boolForKey:@"openssh"] && [NSFileManager.defaultManager fileExistsAtPath:jbroot(@"/usr/libexec/sshd-keygen-wrapper")]) { NSString* log=nil; NSString* err=nil; status = spawnRoot(jbroot(@"/basebin/bootstrapd"), @[@"openssh",@"start"], &log, &err); if(status==0) - [AppDelegate addLogText:@"openssh launch successful"]; + [AppDelegate addLogText:Localized(@"openssh launch successful")]; else [AppDelegate addLogText:[NSString stringWithFormat:@"openssh launch faild(%d):\n%@\n%@", status, log, err]]; } - - if(self.tweakenableState.on && ![NSFileManager.defaultManager fileExistsAtPath:jbroot(@"/var/mobile/.tweakenabled")]) { + + if(gTweakEnabled && ![NSFileManager.defaultManager fileExistsAtPath:jbroot(@"/var/mobile/.tweakenabled")]) { ASSERT([[NSString new] writeToFile:jbroot(@"/var/mobile/.tweakenabled") atomically:YES encoding:NSUTF8StringEncoding error:nil]); } - + [generator impactOccurred]; - [AppDelegate addLogText:@"respring now..."]; sleep(1); - + [AppDelegate addLogText:Localized(@"respring now...")]; sleep(1); + status = spawnBootstrap((char*[]){"/usr/bin/sbreload", NULL}, &log, &err); if(status!=0) [AppDelegate showMesage:[NSString stringWithFormat:@"%@\n\nstderr:\n%@",log,err] title:[NSString stringWithFormat:@"code(%d)",status]]; - + }); } -- (IBAction)unbootstrap:(id)sender { +void unbootstrapAction() +{ UIAlertController *alert = [UIAlertController alertControllerWithTitle:Localized(@"Warnning") message:Localized(@"Are you sure to uninstall bootstrap?\n\nPlease make sure you have disabled tweak for all apps before uninstalling.") preferredStyle:UIAlertControllerStyleAlert]; [alert addAction:[UIAlertAction actionWithTitle:Localized(@"Cancel") style:UIAlertActionStyleDefault handler:nil]]; [alert addAction:[UIAlertAction actionWithTitle:Localized(@"Uninstall") style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action){ - + dispatch_async(dispatch_get_global_queue(0, 0), ^{ [AppDelegate showHudMsg:Localized(@"Uninstalling")]; - + NSString* log=nil; NSString* err=nil; int status = spawnRoot(NSBundle.mainBundle.executablePath, @[@"unbootstrap"], &log, &err); - + [AppDelegate dismissHud]; - - NSString* msg = (status==0) ? @"bootstrap uninstalled" : [NSString stringWithFormat:@"code(%d)\n%@\n\nstderr:\n%@",status,log,err]; - + + NSString* msg = (status==0) ? Localized(@"bootstrap uninstalled") : [NSString stringWithFormat:@"code(%d)\n%@\n\nstderr:\n%@",status,log,err]; + UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"" message:msg preferredStyle:UIAlertControllerStyleAlert]; [alert addAction:[UIAlertAction actionWithTitle:Localized(@"OK") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){ exit(0); }]]; - + [AppDelegate showAlert:alert]; - + }); - + }]]; [AppDelegate showAlert:alert]; - } - - -@end diff --git a/Bootstrap/Views/AppViewControllerWrapper.swift b/Bootstrap/Views/AppViewControllerWrapper.swift new file mode 100644 index 00000000..698f7de7 --- /dev/null +++ b/Bootstrap/Views/AppViewControllerWrapper.swift @@ -0,0 +1,24 @@ +// +// AppViewControllerWrapper.swift +// Bootstrap +// +// Created by haxi0 on 02.01.2024. +// + +import SwiftUI +import UIKit + +struct AppViewControllerWrapper: UIViewControllerRepresentable { + class Coordinator: NSObject {} + + func makeCoordinator() -> Coordinator { + return Coordinator() + } + + func makeUIViewController(context: Context) -> UIViewController { + let navigationController = UINavigationController(rootViewController: AppViewController.sharedInstance()) + return navigationController + } + + func updateUIViewController(_ uiViewController: UIViewController, context: Context) {} +} diff --git a/Bootstrap/Views/ContentView.swift b/Bootstrap/Views/ContentView.swift new file mode 100644 index 00000000..b5ed06cd --- /dev/null +++ b/Bootstrap/Views/ContentView.swift @@ -0,0 +1,259 @@ +// +// ContentView.swift +// BootstrapUI +// +// Created by haxi0 on 21.12.2023. +// + +import SwiftUI +import FluidGradient + +@objc class SwiftUIViewWrapper: NSObject { + @objc static func createSwiftUIView() -> UIViewController { + let viewController = UIHostingController(rootView: ContentView()) + return viewController + } +} + +struct ContentView: View { + @State var LogItems: [String.SubSequence] = { + return [""] + }() + + @State private var showOptions = false + @State private var showCredits = false + @State private var showAppView = false + @State private var strapButtonDisabled = false + @State private var newVersionAvailable = false + @State private var newVersionReleaseURL:String = "" + + let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String + + var body: some View { + ZStack { + FluidGradient(blobs: [.red, .orange], + highlights: [.red, .yellow], + speed: 0.5, + blur: 0.95) + .background(.quaternary) + .ignoresSafeArea() + + VStack { + HStack(spacing: 15) { + Image("Bootstrap") + .resizable() + .frame(width: 80, height: 80) + .cornerRadius(18) + + VStack(alignment: .leading, content: { + Text("Bootstrap") + .bold() + .font(Font.system(size: 35)) + Text("Version \(appVersion!)") + .font(Font.system(size: 20)) + .opacity(0.5) + }) + } + .padding(20) + + if newVersionAvailable { + Button { + UIApplication.shared.open(URL(string: newVersionReleaseURL)!) + } label: { + Label( + title: { Text("New Version Available") }, + icon: { Image(systemName: "arrow.down.app.fill") } + ) + } + .frame(height:20) + .padding(.top, -20) + .padding(10) + } + + VStack { + Button { + UIImpactFeedbackGenerator(style: .light).impactOccurred() + bootstrapAction() + } label: { + if isSystemBootstrapped() { + if checkBootstrapVersion() { + Label( + title: { Text("Bootstrapped").bold() }, + icon: { Image(systemName: "chair.fill") } + ) + .padding(25) + .onAppear() { + strapButtonDisabled = true + } + } else { + Label( + title: { Text("Update").bold() }, + icon: { Image(systemName: "chair") } + ) + .padding(25) + } + } else if isBootstrapInstalled() { + Label( + title: { Text("Bootstrap").bold() }, + icon: { Image(systemName: "chair") } + ) + .padding(25) + } else if ProcessInfo.processInfo.operatingSystemVersion.majorVersion>=15 { + Label( + title: { Text("Install").bold() }, + icon: { Image(systemName: "chair") } + ) + .padding(25) + } else { + Label( + title: { Text("Unsupported").bold() }, + icon: { Image(systemName: "chair") } + ) + .padding(25) + .onAppear() { + strapButtonDisabled = true + } + } + } + .frame(width: 295) + .background { + Color(UIColor.systemBackground) + .cornerRadius(20) + .opacity(0.5) + } + .disabled(strapButtonDisabled) + + HStack { + + Button { + showAppView.toggle() + UIImpactFeedbackGenerator(style: .light).impactOccurred() + } label: { + Label( + title: { Text("App List") }, + icon: { Image(systemName: "checklist") } + ) + .frame(width: 145, height: 65) + } + .background { + Color(UIColor.systemBackground) + .cornerRadius(20) + .opacity(0.5) + } + .disabled(!isSystemBootstrapped()) + + Button { + withAnimation { + UIImpactFeedbackGenerator(style: .light).impactOccurred() + showOptions.toggle() + } + } label: { + Label( + title: { Text("Settings") }, + icon: { Image(systemName: "gear") } + ) + .frame(width: 145, height: 65) + } + .background { + Color(UIColor.systemBackground) + .cornerRadius(20) + .opacity(0.5) + } + + } + + VStack { + ScrollView { + ScrollViewReader { scroll in + VStack(alignment: .leading) { + ForEach(0.. some View { + HStack { + Text(name) + .bold() + Spacer() + Button { + if let url = URL(string: link) { + UIApplication.shared.open(url) + } + } label: { + Image(systemName: "link") + } + } + .padding(5) + } +} diff --git a/Bootstrap/Views/OptionsView.swift b/Bootstrap/Views/OptionsView.swift new file mode 100644 index 00000000..b2679dad --- /dev/null +++ b/Bootstrap/Views/OptionsView.swift @@ -0,0 +1,159 @@ +// +// OptionsView.swift +// Bootstrap +// +// Created by haxi0 on 31.12.2023. +// + +import SwiftUI + +class toggleState: ObservableObject { + @Published var state:Bool + init(state: Bool) { + self.state = state + } +} + +struct OptionsView: View { + @Binding var showOptions: Bool + @State var tweakEnable: Bool = !isSystemBootstrapped() || FileManager.default.fileExists(atPath: jbroot("/var/mobile/.tweakenabled")) + @StateObject var opensshStatus = toggleState(state: updateOpensshStatus(false)) + + var body: some View { + ZStack { + VisualEffectView(effect: UIBlurEffect(style: .regular)) + .ignoresSafeArea() + + VStack { + HStack { + Text("Settings") + .bold() + .frame(maxWidth: 250, alignment: .leading) + .font(Font.system(size: 35)) + + Button { + withAnimation { + showOptions.toggle() + } + } label: { + Image(systemName: "xmark.circle") + .resizable() + .foregroundColor(.red) + .frame(width: 30, height: 30) + } + } + + //ScrollView { + VStack { + VStack { + + Toggle(isOn: $tweakEnable, label: { + Label( + title: { Text("Tweak Enable") }, + icon: { Image(systemName: "wrench.and.screwdriver") } + ) + }).padding(5) + .onChange(of: tweakEnable) { newValue in + tweaEnableAction(newValue) + } + + Toggle(isOn: Binding(get: {opensshStatus.state}, set: { + opensshStatus.state = opensshAction($0) + }), label: { + Label( + title: { Text("OpenSSH") }, + icon: { Image(systemName: "terminal") } + ) + }) + .onReceive(NotificationCenter.default.publisher(for: Notification.Name("opensshStatusNotification"))) { obj in + DispatchQueue.global(qos: .utility).async { + let newStatus = (obj.object as! NSNumber).boolValue + opensshStatus.state = newStatus + } + } + .padding(5) + + + Divider().padding(10) + + VStack(alignment: .leading, spacing: 12, content: { + + Button { + UIImpactFeedbackGenerator(style: .light).impactOccurred() + respringAction() + } label: { + Label( + title: { Text("Respring") }, + icon: { Image(systemName: "arrow.clockwise") } + ) + } + .buttonStyle(DopamineButtonStyle()) + .disabled(!isSystemBootstrapped()) + + Button { + UIImpactFeedbackGenerator(style: .light).impactOccurred() + rebuildappsAction() + } label: { + Label( + title: { Text("Rebuild Apps") }, + icon: { Image(systemName: "arrow.clockwise") } + ) + } + .buttonStyle(DopamineButtonStyle()) + .disabled(!isSystemBootstrapped()) + + Button { + UIImpactFeedbackGenerator(style: .light).impactOccurred() + rebuildIconCacheAction() + } label: { + Label( + title: { Text("Rebuild Icon Cache") }, + icon: { Image(systemName: "arrow.clockwise") } + ) + } + .buttonStyle(DopamineButtonStyle()) + .disabled(!isSystemBootstrapped()) + + Button { + UIImpactFeedbackGenerator(style: .light).impactOccurred() + reinstallPackageManager() + } label: { + Label( + title: { Text("Reinstall Sileo & Zebra") }, + icon: { Image(systemName: "shippingbox") } + ) + } + .buttonStyle(DopamineButtonStyle()) + .disabled(!isSystemBootstrapped()) + + if isBootstrapInstalled() { + Button { + UIImpactFeedbackGenerator(style: .light).impactOccurred() + unbootstrapAction() + } label: { + Label( + title: { Text("Uninstall") }, + icon: { Image(systemName: "trash") } + ) + } + .buttonStyle(DopamineButtonStyle()) + .disabled(isSystemBootstrapped()) + } + }) + } + .frame(width: 253) + .padding(20) + .background { + Color(UIColor.systemBackground) + .cornerRadius(20) + .opacity(0.5) + } + } + //} + } + .frame(maxHeight: 550) + } + } +} + + diff --git a/Bootstrap/ar.lproj/Localizable.strings b/Bootstrap/ar.lproj/Localizable.strings new file mode 100644 index 00000000..01463565 --- /dev/null +++ b/Bootstrap/ar.lproj/Localizable.strings @@ -0,0 +1,73 @@ +"Settings" = "الاعدادات"; +"Tweak Enable" = "تفعيل الادوات"; +"OpenSSH" = "تفعيل ssh"; +"Respring" = "اعادة تشغيل سريعه"; +"Rebuild Apps" = "اعادة بناء التطبيقات"; +"Rebuild Icon Cache" = "اعادة بناء الايقونات"; +"Reinstall Sileo & Zebra" = "اعادة تثبيت سيليو و زيبرا"; +"Uninstall" = "الغاء التثبيت"; +"Credits" = "الحقوق"; +"New Version Available" = "نسخة جديدة متوفرة !"; +"Bootstrapped" = "Bootstrapped"; +"Update" = "تحديث"; +"Install" = "تثبيت"; +"Unsupported" = "غير مدعوم"; +"App List" = "التطبيقات"; + + +"OK" = "حسنا"; +"Error" = "خطأ"; +"Warnning" = "تحذير"; +"Applying" = "تطبيق"; +"Cannel" = "الغاء"; +"Update" = "تحديث"; +"Bootstrapping" = "Bootstrapping"; +"Uninstall" = "الغاء التثبيت"; +"Uninstalling" = "الغاء التثبيت جاري"; +"bootstrap uninstalled" = "ازالة bootstrap"; + +"Eanble Tweak for App" = "تفعيل الادوات للتطبيقات"; +"name or identifier" = "اسم او معرف التطبيق"; + +"Server Not Running" = "السيرفر لا يعمل"; + +"for unknown reasons the bootstrap server is not running, the only thing we can do is to restart it now." = "ل اسباب لا نعلمها ، الذي نستطيع فعله هو اعادة تشغيل السيرفر"; + +"Restart Server" = "اعادة تشغيل السيرفر"; +"bootstrap server restart successful" = "تم اعادة تشغيل السيرفر بنجاح "; + +"Rebuilding" = "اعادة البناء."; +"Don't exit Bootstrap app until show the lock screen" = "لا تخرج من التطبيق الا عندما ترى شاشة القفل "; + +"bootstrap installed" = "بوت ستراب مثبت"; +"bootstrap not installed" = "بوت ستراب ليس مثبت"; +"system bootstrapped" = "النظام مفعل bootstrap"; +"system not bootstrapped" = "النظام ليس مفعل bootstrap"; +"bootstrap server check successful" = "تم التحقق من سيرفر بوت ستراب"; + +"It seems that you have the Filza app installed, which may be detected as jailbroken. You can enable Tweak for it to hide it." = "على ما يبدو لديك فيلزا مثبته على جهازك ، يمكنك تفعيل اداة ل اخفائه عن التطبيقات لكي لا يتعرف النظام ان جهازك مفعل جلبريك"; + +"Status: Rebuilding Apps" = "الحالة : اعادة بناء التطبيقات"; +"Status: Reinstalling Sileo" = "الحالة : اعادة تثبيت سيليو"; +"Status: Reinstalling Zebra" = "الحالة : اعادة تثبيت زيبرا"; +"Sileo and Zebra reinstalled!" = "تم اعادة تثبيت سيليو و زيبرا"; +"Status: Rebuilding Icon Cache" = "الحالة : اعادة بناء ملفات الكاش ل الايقونات"; + +"openssh package is not installed" = "حزمة openssh ليست مثبته"; + +"Reboot Device" = "اعادة تشغيل الجهاز"; +"The current bootstrapped version is inconsistent with the Bootstrap app version, and you need to reboot the device to update it." = "الإصدار الحالي الذي تم تشغيله غير متوافق مع إصدار تطبيق Bootstrap، وتحتاج إلى إعادة تشغيل الجهاز لتحديثه."; + +"Your trollstore version is too old, Bootstrap only supports trollstore>=2.0, you have to update your trollstore then reinstall Bootstrap app." = "إصدار trollstore الخاص بك قديم جدًا، ولا يدعم Bootstrap سوى trollstore>=2.0، ويجب عليك تحديث trollstore ثم إعادة تثبيت تطبيق Bootstrap."; + +"Your device does not seem to have developer mode enabled.\n\nPlease enable developer mode and reboot your device." = "يبدو أن وضع المطور غير ممكّن على جهازك.\n\nالرجاء تمكين وضع المطور وإعادة تشغيل جهازك."; + +"roothide dopamine has been installed on this device, now install this bootstrap may break it!" = "لقد تم تثبيت الدوبامين الجذري على هذا الجهاز، والآن قد يؤدي تثبيت هذا التمهيد إلى كسره!"; + +"You have installed an old beta version, please disable all app tweaks and reboot the device to uninstall it so that you can install the new version bootstrap." = "لقد قمت بتثبيت إصدار تجريبي قديم، يرجى تعطيل جميع تعديلات التطبيق وإعادة تشغيل الجهاز لإلغاء تثبيته حتى تتمكن من تثبيت الإصدار الجديد bootstrap."; + +"openssh launch successful" = "تم تشغيل ssh"; +"respring now..." = "ريسبرينج الان"; + +"Are you sure to uninstall bootstrap?\n\nPlease make sure you have disabled tweak for all apps before uninstalling." = "هل أنت متأكد من إلغاء تثبيت bootstrap؟\n\nيُرجى التأكد من تعطيل التعديل لجميع التطبيقات قبل إلغاء التثبيت."; + diff --git a/Bootstrap/basebin/bootstrap.dylib b/Bootstrap/basebin/bootstrap.dylib index ed1b96cc..6ea9e234 100755 Binary files a/Bootstrap/basebin/bootstrap.dylib and b/Bootstrap/basebin/bootstrap.dylib differ diff --git a/Bootstrap/basebin/bootstrapd b/Bootstrap/basebin/bootstrapd index 3cbb11b7..a1960094 100755 Binary files a/Bootstrap/basebin/bootstrapd and b/Bootstrap/basebin/bootstrapd differ diff --git a/Bootstrap/basebin/devtest b/Bootstrap/basebin/devtest index ca283e6e..232cbea9 100755 Binary files a/Bootstrap/basebin/devtest and b/Bootstrap/basebin/devtest differ diff --git a/Bootstrap/basebin/preload b/Bootstrap/basebin/preload index 16d6908f..31334d08 100755 Binary files a/Bootstrap/basebin/preload and b/Bootstrap/basebin/preload differ diff --git a/Bootstrap/basebin/preload.dylib b/Bootstrap/basebin/preload.dylib index 530c8090..c592c008 100755 Binary files a/Bootstrap/basebin/preload.dylib and b/Bootstrap/basebin/preload.dylib differ diff --git a/Bootstrap/basebin/rebuildapp b/Bootstrap/basebin/rebuildapp index d3822610..7451af8b 100755 Binary files a/Bootstrap/basebin/rebuildapp and b/Bootstrap/basebin/rebuildapp differ diff --git a/Bootstrap/basebin/uicache b/Bootstrap/basebin/uicache index fb9e175a..4cf3a0dc 100755 Binary files a/Bootstrap/basebin/uicache and b/Bootstrap/basebin/uicache differ diff --git a/Bootstrap/bootstrap.h b/Bootstrap/bootstrap.h index de788f8f..4b6b676b 100644 --- a/Bootstrap/bootstrap.h +++ b/Bootstrap/bootstrap.h @@ -3,6 +3,8 @@ #define BOOTSTRAP_VERSION (5) +#import + void rebuildSignature(NSString *directoryPath); int bootstrap(); diff --git a/Bootstrap/bootstrap.m b/Bootstrap/bootstrap.m index dcc7cf0c..91849029 100644 --- a/Bootstrap/bootstrap.m +++ b/Bootstrap/bootstrap.m @@ -241,8 +241,8 @@ int InstallBootstrap(NSString* jbroot_path) ASSERT(spawnBootstrap((char*[]){"/usr/bin/dpkg", "-i", rootfsPrefix(zebraDeb).fileSystemRepresentation, NULL}, nil, nil) == 0); ASSERT(spawnBootstrap((char*[]){"/usr/bin/uicache", "-p", "/Applications/Zebra.app", NULL}, nil, nil) == 0); - ASSERT([[NSString stringWithFormat:@"%d",BOOTSTRAP_VERSION] writeToFile:jbroot(@"/.bootstrapped") atomically:YES encoding:NSUTF8StringEncoding error:nil]); - ASSERT([fm copyItemAtPath:jbroot(@"/.bootstrapped") toPath:[jbroot_secondary stringByAppendingPathComponent:@".bootstrapped"] error:nil]); + ASSERT([[NSString stringWithFormat:@"%d",BOOTSTRAP_VERSION] writeToFile:jbroot(@"/.thebootstrapped") atomically:YES encoding:NSUTF8StringEncoding error:nil]); + ASSERT([fm copyItemAtPath:jbroot(@"/.thebootstrapped") toPath:[jbroot_secondary stringByAppendingPathComponent:@".thebootstrapped"] error:nil]); STRAPLOG("Status: Bootstrap Installed"); @@ -331,7 +331,7 @@ int bootstrap() ASSERT(InstallBootstrap(jbroot_path) == 0); - } else if(![fm fileExistsAtPath:jbroot(@"/.bootstrapped")]) { + } else if(![fm fileExistsAtPath:jbroot(@"/.bootstrapped")] && ![fm fileExistsAtPath:jbroot(@"/.thebootstrapped")]) { STRAPLOG("remove unfinished bootstrap %@", jbroot_path); uint64_t prev_jbrand = jbrand(); @@ -351,6 +351,9 @@ int bootstrap() } else { STRAPLOG("device is strapped: %@", jbroot_path); + if([fm fileExistsAtPath:jbroot(@"/.bootstrapped")]) //beta version to public version + ASSERT([fm moveItemAtPath:jbroot(@"/.bootstrapped") toPath:jbroot(@"/.thebootstrapped") error:nil]); + STRAPLOG("Status: Rerandomize jbroot"); ASSERT(ReRandomizeBootstrap() == 0); @@ -439,7 +442,8 @@ bool isBootstrapInstalled() if(!find_jbroot()) return NO; - if(![NSFileManager.defaultManager fileExistsAtPath:jbroot(@"/.bootstrapped")]) + if(![NSFileManager.defaultManager fileExistsAtPath:jbroot(@"/.bootstrapped")] + && ![NSFileManager.defaultManager fileExistsAtPath:jbroot(@"/.thebootstrapped")]) return NO; return YES; diff --git a/Bootstrap/common.h b/Bootstrap/common.h index 7515f9e6..3dc5a0a0 100644 --- a/Bootstrap/common.h +++ b/Bootstrap/common.h @@ -5,6 +5,6 @@ #include "utils.h" #include "seh.h" -#define Localized(x) x +#define Localized(x) NSLocalizedString(x,nil) #endif /* common_h */ diff --git a/Bootstrap/credits.h b/Bootstrap/credits.h index bd3d472b..635b10b4 100644 --- a/Bootstrap/credits.h +++ b/Bootstrap/credits.h @@ -1,7 +1,7 @@ #ifndef credits_h #define credits_h // dictionary will be sorted alphabetically -NSDictionary* CREDITS = @{ +static NSDictionary* CREDITS = @{ @"Nick Chan" : @"https://github.com/asdfugil", @"opa334" : @"http://github.com/opa334", @"hayden" : @"https://procursus.social/@hayden", @@ -71,6 +71,8 @@ NSDictionary* CREDITS = @{ @"Ellie" : @"https://twitter.com/elliessurviving", @"tigisoftware" : @"https://twitter.com/tigisoftware", @"Kevin" : @"https://github.com/iodes", +@"i_82" : @"https://github.com/Lessica", +@"Lakr" : @"https://github.com/Lakr233", }; #endif /* credits_h */ diff --git a/Bootstrap/de.lproj/Localizable.strings b/Bootstrap/de.lproj/Localizable.strings new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/Bootstrap/de.lproj/Localizable.strings @@ -0,0 +1 @@ + diff --git a/Bootstrap/en.lproj/Localizable.strings b/Bootstrap/en.lproj/Localizable.strings new file mode 100644 index 00000000..1d5e9111 --- /dev/null +++ b/Bootstrap/en.lproj/Localizable.strings @@ -0,0 +1,73 @@ +"Settings" = "Settings"; +"Tweak Enable" = "Tweak Enable"; +"OpenSSH" = "OpenSSH"; +"Respring" = "Respring"; +"Rebuild Apps" = "Rebuild Apps"; +"Rebuild Icon Cache" = "Rebuild Icon Cache"; +"Reinstall Sileo & Zebra" = "Reinstall Sileo & Zebra"; +"Uninstall" = "Uninstall"; +"Credits" = "Credits"; +"New Version Available" = "New Version Available"; +"Bootstrapped" = "Bootstrapped"; +"Update" = "Update"; +"Install" = "Install"; +"Unsupported" = "Unsupported"; +"App List" = "App List"; + + +"OK" = "OK"; +"Error" = "Error"; +"Warnning" = "Warnning"; +"Applying" = "Applying"; +"Cannel" = "Cannel"; +"Update" = "Update"; +"Bootstrapping" = "Bootstrapping"; +"Uninstall" = "Uninstall"; +"Uninstalling" = "Uninstalling"; +"bootstrap uninstalled" = "bootstrap uninstalled"; + +"Eanble Tweak for App" = "Eanble Tweak for App"; +"name or identifier" = "name or identifier"; + +"Server Not Running" = "Server Not Running"; + +"for unknown reasons the bootstrap server is not running, the only thing we can do is to restart it now." = "for unknown reasons the bootstrap server is not running, the only thing we can do is to restart it now."; + +"Restart Server" = "Restart Server"; +"bootstrap server restart successful" = "bootstrap server restart successful"; + +"Rebuilding" = "Rebuilding"; +"Don't exit Bootstrap app until show the lock screen" = "Don't exit Bootstrap app until show the lock screen"; + +"bootstrap installed" = "bootstrap installed"; +"bootstrap not installed" = "bootstrap not installed"; +"system bootstrapped" = "system bootstrapped"; +"system not bootstrapped" = "system not bootstrapped"; +"bootstrap server check successful" = "bootstrap server check successful"; + +"It seems that you have the Filza app installed, which may be detected as jailbroken. You can enable Tweak for it to hide it." = "It seems that you have the Filza app installed, which may be detected as jailbroken. You can enable Tweak for it to hide it."; + +"Status: Rebuilding Apps" = "Status: Rebuilding Apps"; +"Status: Reinstalling Sileo" = "Status: Reinstalling Sileo"; +"Status: Reinstalling Zebra" = "Status: Reinstalling Zebra"; +"Sileo and Zebra reinstalled!" = "Sileo and Zebra reinstalled!"; +"Status: Rebuilding Icon Cache" = "Status: Rebuilding Icon Cache"; + +"openssh package is not installed" = "openssh package is not installed"; + +"Reboot Device" = "Reboot Device"; +"The current bootstrapped version is inconsistent with the Bootstrap app version, and you need to reboot the device to update it." = "The current bootstrapped version is inconsistent with the Bootstrap app version, and you need to reboot the device to update it."; + +"Your trollstore version is too old, Bootstrap only supports trollstore>=2.0, you have to update your trollstore then reinstall Bootstrap app." = "Your trollstore version is too old, Bootstrap only supports trollstore>=2.0, you have to update your trollstore then reinstall Bootstrap app."; + +"Your device does not seem to have developer mode enabled.\n\nPlease enable developer mode and reboot your device." = "Your device does not seem to have developer mode enabled.\n\nPlease enable developer mode and reboot your device."; + +"roothide dopamine has been installed on this device, now install this bootstrap may break it!" = "roothide dopamine has been installed on this device, now install this bootstrap may break it!"; + +"You have installed an old beta version, please disable all app tweaks and reboot the device to uninstall it so that you can install the new version bootstrap." = "You have installed an old beta version, please disable all app tweaks and reboot the device to uninstall it so that you can install the new version bootstrap."; + +"openssh launch successful" = "openssh launch successful"; +"respring now..." = "respring now..."; + +"Are you sure to uninstall bootstrap?\n\nPlease make sure you have disabled tweak for all apps before uninstalling." = "Are you sure to uninstall bootstrap?\n\nPlease make sure you have disabled tweak for all apps before uninstalling."; + diff --git a/Bootstrap/fr.lproj/Localizable.strings b/Bootstrap/fr.lproj/Localizable.strings new file mode 100644 index 00000000..1bc53be2 --- /dev/null +++ b/Bootstrap/fr.lproj/Localizable.strings @@ -0,0 +1,72 @@ +"Settings" = "Parametres"; +"Tweak Enable" = "Tweak Activé"; +"OpenSSH" = "OpenSSH"; +"Respring" = "Respring"; +"Rebuild Apps" = "Recréer les Applications"; +"Rebuild Icon Cache" = "Recréer le cache des icônes"; +"Reinstall Sileo & Zebra" = "Réinstaller Sileo & Zebra"; +"Uninstall" = "Désintaller"; +"Credits" = "Crédits"; +"New Version Available" = "Nouvelle Version Disponible"; +"Bootstrapped" = "Bootstrapped"; +"Update" = "Mise à jour"; +"Install" = "Installer"; +"Unsupported" = "Non supporté"; +"App List" = "Liste des applications"; + + +"OK" = "OK"; +"Error" = "Erreur"; +"Warnning" = "Attention"; +"Applying" = "Appliqué"; +"Cannel" = "Canal"; +"Update" = "Update"; +"Bootstrapping" = "Bootstrapping"; +"Uninstall" = "Désintaller"; +"Uninstalling" = "Désinstallation"; +"bootstrap uninstalled" = "bootstrap désinstallé"; + +"Eanble Tweak for App" = "Activer un Tweak pour une App"; +"name or identifier" = "nom ou identifieur"; + +"Server Not Running" = "Serveur pas démarré"; + +"for unknown reasons the bootstrap server is not running, the only thing we can do is to restart it now." = "pour des raisons inconnu, le serveur du boostrap n'a pas démarré, la seule chose que vous pouvez faire est de le redémarrer maintenant."; + +"Restart Server" = "Redémarrer le serveur"; +"bootstrap server restart successful" = "Le serveur du boostrap à bien redémarré"; + +"Rebuilding" = "Recréer"; +"Don't exit Bootstrap app until show the lock screen" = "Don't exit Bootstrap app until show the lock screen"; + +"bootstrap installed" = "bootstrap installé"; +"bootstrap not installed" = "bootstrap pas installé"; +"system bootstrapped" = "système bootstrappé"; +"system not bootstrapped" = "système non bootstrappé"; +"bootstrap server check successful" = "vérification du serveur bootstrap réussi"; + +"It seems that you have the Filza app installed, which may be detected as jailbroken. You can enable Tweak for it to hide it." = "It seems that you have the Filza app installed, which may be detected as jailbroken. You can enable Tweak for it to hide it."; + +"Status: Rebuilding Apps" = "Status: Reconstruction des Apps"; +"Status: Reinstalling Sileo" = "Status: Réinstallation de Sileo"; +"Status: Reinstalling Zebra" = "Status: Réinstallation de Zebra"; +"Sileo and Zebra reinstalled!" = "Sileo and Zebra réinstallé!"; +"Status: Rebuilding Icon Cache" = "Status: Reconstruction du cache des icônes"; + +"openssh package is not installed" = "openssh package is not installed"; + +"Reboot Device" = "Reboot Device"; +"The current bootstrapped version is inconsistent with the Bootstrap app version, and you need to reboot the device to update it." = "The current bootstrapped version is inconsistent with the Bootstrap app version, and you need to reboot the device to update it."; + +"Your trollstore version is too old, Bootstrap only supports trollstore>=2.0, you have to update your trollstore then reinstall Bootstrap app." = "Your trollstore version is too old, Bootstrap only supports trollstore>=2.0, you have to update your trollstore then reinstall Bootstrap app."; + +"Your device does not seem to have developer mode enabled.\n\nPlease enable developer mode and reboot your device." = "Your device does not seem to have developer mode enabled.\n\nPlease enable developer mode and reboot your device."; + +"roothide dopamine has been installed on this device, now install this bootstrap may break it!" = "roothide dopamine has been installed on this device, now install this bootstrap may break it!"; + +"You have installed an old beta version, please disable all app tweaks and reboot the device to uninstall it so that you can install the new version bootstrap." = "You have installed an old beta version, please disable all app tweaks and reboot the device to uninstall it so that you can install the new version bootstrap."; + +"openssh launch successful" = "openssh launch successful"; +"respring now..." = "respring now..."; + +"Are you sure to uninstall bootstrap?\n\nPlease make sure you have disabled tweak for all apps before uninstalling." = "Are you sure to uninstall bootstrap?\n\nPlease make sure you have disabled tweak for all apps before uninstalling."; diff --git a/Bootstrap/ja.lproj/Localizable.strings b/Bootstrap/ja.lproj/Localizable.strings new file mode 100644 index 00000000..50060c3d --- /dev/null +++ b/Bootstrap/ja.lproj/Localizable.strings @@ -0,0 +1,73 @@ +"Settings" = "設定"; +"Tweak Enable" = "Tweakを有効にする"; +"OpenSSH" = "OpenSSH"; +"Respring" = "Respring"; +"Rebuild Apps" = "アプリの再構築"; +"Rebuild Icon Cache" = "アイコンキャッシュの再構築"; +"Reinstall Sileo & Zebra" = "Sileo と Zebra を再インストールする"; +"Uninstall" = "アンインストール"; +"Credits" = "クレジット"; +"New Version Available" = "新しいバージョンが利用可能です"; +"Bootstrapped" = "Bootstrapped"; +"Update" = "アップデート"; +"Install" = "インストール"; +"Unsupported" = "サポートされていません"; +"App List" = "アプリ一覧"; + + +"OK" = "はい"; +"Error" = "エラー"; +"Warnning" = "警告"; +"Applying" = "適用中"; +"Cannel" = "キャンセル"; +"Update" = "アップデート"; +"Bootstrapping" = "Bootstrapping"; +"Uninstall" = "アンインストール"; +"Uninstalling" = "アンインストール中"; +"bootstrap uninstalled" = "bootstrapはアンインストールされました"; + +"Eanble Tweak for App" = "アプリのtweakを有効にする"; +"name or identifier" = "名前またはidentifier"; + +"Server Not Running" = "サーバーが動作していません"; + +"for unknown reasons the bootstrap server is not running, the only thing we can do is to restart it now." = "bootstrapサーバーの実行に失敗しました。再起動後にもう一度お試しください。"; + +"Restart Server" = "サーバーを再起動"; +"bootstrap server restart successful" = "bootstrapサーバーの再起動に成功しました"; + +"Rebuilding" = "再構築中"; +"Don't exit Bootstrap app until show the lock screen" = "ロック画面が表示されるまで、Bootstrapアプリを終了しないでください。"; + +"bootstrap installed" = "bootstrapがインストールされました"; +"bootstrap not installed" = "bootstrapはインストールされていません"; +"system bootstrapped" = "システムはbootstrapされました"; +"system not bootstrapped" = "システムはbootstrapされていません"; +"bootstrap server check successful" = "bootstrapサーバーにチェックに成功しました"; + +"It seems that you have the Filza app installed, which may be detected as jailbroken. You can enable Tweak for it to hide it." = "Filzaがインストールされているため、脱獄として検知される可能性があります。Tweakを有効にすると、隠すことができます。"; + +"Status: Rebuilding Apps" = "ステータス: アプリを再構築中"; +"Status: Reinstalling Sileo" = "ステータス: Sileoを再インストール中"; +"Status: Reinstalling Zebra" = "ステータス: Zebraを再インストール中"; +"Sileo and Zebra reinstalled!" = "SileoとZebraが再インストールされました!"; +"Status: Rebuilding Icon Cache" = "ステータス: アイコンキャッシュを再構築中"; + +"openssh package is not installed" = "opensshパッケージがインストールされていません"; + +"Reboot Device" = "デバイスを再起動"; +"The current bootstrapped version is inconsistent with the Bootstrap app version, and you need to reboot the device to update it." = "現在インストール済みのbootstrapのバージョンは、このアプリのbootstrapのバージョンと一致しないため、更新するにはデバイスを再起動する必要があります。"; + +"Your trollstore version is too old, Bootstrap only supports trollstore>=2.0, you have to update your trollstore then reinstall Bootstrap app." = "trollstoreのバージョンが古すぎます。Bootstrapはtrollstore>=2.0のみをサポートしています。trollstoreを更新してから、Bootstrapアプリを再インストールする必要があります。"; + +"Your device does not seem to have developer mode enabled.\n\nPlease enable developer mode and reboot your device." = "お使いのデバイスでは開発者モードが有効になっていないようです。\n\n開発者モードを有効にしてデバイスを再起動してください。"; + +"roothide dopamine has been installed on this device, now install this bootstrap may break it!" = "競合する可能性のあるdopamineのroothideがこのデバイスに既にインストールされています。このbootstrapをインストールするとデバイスが壊れる可能性があります。"; + +"You have installed an old beta version, please disable all app tweaks and reboot the device to uninstall it so that you can install the new version bootstrap." = "古いベータバージョンがインストールされています。新しいバージョンのブートストラップをインストールできるように、すべてのアプリのtweakを無効にし、デバイスを再起動してアンインストールしてください。"; + +"openssh launch successful" = "opensshの起動に成功しました"; +"respring now..." = "デバイスはまもなくRespringされます..."; + +"Are you sure to uninstall bootstrap?\n\nPlease make sure you have disabled tweak for all apps before uninstalling." = "bootstrapをアンインストールしてもよろしいですか?\n\nアンインストールする前に、すべてのアプリのtweakが無効になっていることを確認してください。"; +