Skip to content

Commit

Permalink
rootless
Browse files Browse the repository at this point in the history
  • Loading branch information
turannul committed Sep 27, 2023
1 parent b2bd32d commit 3cea765
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 17 deletions.
8 changes: 6 additions & 2 deletions rootless/ForgetYourUpdate.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#include <Preferences/PSSpecifier.h>
#include <Preferences/PSListController.h>
#import <Preferences/PSSpecifier.h>
#import <Preferences/PSListController.h>
#import <Foundation/Foundation.h>
#include <objc/runtime.h>
#include <dlfcn.h>
#include <sys/stat.h>

#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)

Expand Down
10 changes: 2 additions & 8 deletions rootless/ForgetYourUpdate.xm
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
#import "ForgetYourUpdate.h"

%group iOS13 // 13-16 Works confirmed. (Palera1n rootless on iOS 16.2).
%group iOS15 // 15-16 Works confirmed. (Palera1n rootless on iOS 16.2).
%hook PSGGeneralController
-(void)viewWillAppear:(BOOL)arg1 { %orig; [self removeSpecifierID:@"SOFTWARE_UPDATE_LINK" animated:NO]; }
%end
%end

%group iOS12 // I have no idea, if this works iOS 11 and older versions.
%hook PSUIGeneralController
-(void)viewDidAppear:(BOOL)arg1 { %orig; [self removeSpecifierID:@"SOFTWARE_UPDATE_LINK" animated:NO]; }
%end
%end

%ctor { if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"13.0")) { %init(iOS13); } else { %init(iOS12); } }
%ctor { %init(iOS15); }
11 changes: 7 additions & 4 deletions rootless/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
ARCHS = arm64 arm64e
THEOS_PACKAGE_SCHEME = rootless
export FINALPACKAGE=1
INSTALL_TARGET_PROCESSES = Preferences
export ARCHS = arm64 arm64e
export THEOS_PACKAGE_SCHEME = rootless

INSTALL_TARGET_PROCESSES = Preferences
TWEAK_NAME = ForgetYourUpdate
$(TWEAK_NAME)_FILES = ForgetYourUpdate.xm

$(TWEAK_NAME)_FILES = ForgetYourUpdate.xm updatek1ller.mm
$(TWEAK_NAME)_LIBRARIES = MobileGestalt
$(TWEAK_NAME)_CFLAGS = -fobjc-arc

include $(THEOS)/makefiles/common.mk
include $(THEOS_MAKE_PATH)/tweak.mk

Expand Down
6 changes: 3 additions & 3 deletions rootless/layout/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Package: xyz.turannul.forgetyourupdate
Section: Tweaks
Maintainer: Turann_
Architecture: iphoneos-arm
Version: 1.3
Depends: preferenceloader, mobilesubstrate, bash, launchctl
Architecture: iphoneos-arm64
Version: 1.5
Depends: preferenceloader, mobilesubstrate, bash, launchctl, firmware (>= 15.0)
Replaces: xyz.turannul.updateblockr, xyz.turannul.forgetyourupdates
Conflict: xyz.turannul.updateblockr, xyz.turannul.forgetyourupdates
Description:
Expand Down
9 changes: 9 additions & 0 deletions rootless/updatek1ller.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#import "ForgetYourUpdate.h"

__attribute__((constructor)) int main(int argc, char **argv, char **envp)
{
[[NSUserDefaults standardUserDefaults] setObject:@NO forKey:@"MobileAssetSUAllowOSVersionChange"];
[[NSUserDefaults standardUserDefaults] setObject:@NO forKey:@"MobileAssetSUAllowSameVersionFullReplacement"];
[[NSUserDefaults standardUserDefaults] setObject:@"NULL" forKey:@"MobileAssetServerURL-com.apple.MobileAsset.SoftwareUpdate"];
[[NSUserDefaults standardUserDefaults] setObject:@"MULL" forKey:@"MobileAssetServerURL-com.apple.MobileAsset.MobileSoftwareUpdate.UpdateBrain"];
}

0 comments on commit 3cea765

Please sign in to comment.