Skip to content

Commit

Permalink
Add initial rootless support
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-botticelli committed Jul 27, 2023
1 parent 9b45c9a commit 15df9ba
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 15 deletions.
5 changes: 5 additions & 0 deletions Headers.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#import <CoreFoundation/CoreFoundation.h>
#import <CoreGraphics/CoreGraphics.h>
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface _UIBackdropViewSettings : NSObject {}
@property int style;
+ (id)settingsForStyle:(int)arg1;
Expand Down
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
ARCHS = arm64 arm64e
export DEBUG = 0
export FINALPACKAGE = 1
export THEOS_PACKAGE_SCHEME = rootless
export TARGET = iphone:clang:latest:15.0

include $(THEOS)/makefiles/common.mk

TWEAK_NAME = Accent
Expand All @@ -6,8 +12,8 @@ Accent_FILES = Tweak.x
Accent_CFLAGS = -fobjc-arc
Accent_EXTRA_FRAMEWORKS += Cephei
Accent_LIBRARIES = colorpicker
SDKVERSION = 13.3
SYSROOT = $(THEOS)/sdks/iPhoneOS13.3.sdk
SDKVERSION = 14.5
SYSROOT = $(THEOS)/sdks/iPhoneOS14.5.sdk

include $(THEOS_MAKE_PATH)/tweak.mk
SUBPROJECTS += accentpreferences
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Accent (rootless fork)
A fork of Accent to support rootless jailbreaks (i.e., Dopamine).

I do not have much experience with Theos, as such, I could only get this to compile
on my macOS environment by using the latest Theos (as of this commit) and running the
following command:

`cd $THEOS/sdks/iPhoneOS14.5.sdk/System && grep -rl "(null)" . | xargs sed -i "" -e "s/(null)/ios/g"`

* Note: You must setup Theos [as described here](https://theos.dev/docs/installation-macos).
* Note: Exlcuded app support is currently missing due to removed `AppList` dependency.
6 changes: 3 additions & 3 deletions Tweak.x
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ void setColor() {
}
}

[[%c(UIApplication) sharedApplication] keyWindow];

// Deprecated: [[%c(UIApplication) sharedApplication] keyWindow];
//[[UIApplication sharedApplication] delegate].window;
}

static void PreferencesChangedCallback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) {
Expand Down Expand Up @@ -473,4 +473,4 @@ static void PreferencesChangedCallback(CFNotificationCenterRef center, void *obs
if (! [excludedAppsArray containsObject:[[NSBundle mainBundle] bundleIdentifier]] && enabled) {
%init;
}
}
}
4 changes: 2 additions & 2 deletions accentpreferences/APBRootListController.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#import <Cephei/HBRespringController.h>
#import <CepheiPrefs/HBRootListController.h>
#import <Preferences/PSListController.h>
//#import <Preferences/PSListController.h>

@interface APBRootListController : HBRootListController

@end
@end
2 changes: 1 addition & 1 deletion accentpreferences/APBRootListController.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "APBRootListController.h"
#import <CepheiPrefs/HBAppearanceSettings.h>
//#import <CepheiPrefs/HBAppearanceSettings.h>
#import "libcolorpicker.h"

#define PreferencesFilePath [NSString stringWithFormat:@"/var/mobile/Library/Preferences/com.ivanc.accentpreferences.plist"]
Expand Down
7 changes: 4 additions & 3 deletions accentpreferences/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
ARCHS = arm64 arm64e
THEOS_PACKAGE_SCHEME = rootless
#SDKVERSION = 14.5
SYSROOT = $(THEOS)/sdks/iPhoneOS14.5.sdk

include $(THEOS)/makefiles/common.mk

Expand All @@ -8,11 +11,9 @@ AccentPreferences_FILES = APBRootListController.m
AccentPreferences_INSTALL_PATH = /Library/PreferenceBundles
AccentPreferences_FRAMEWORKS = UIKit
AccentPreferences_PRIVATE_FRAMEWORKS = Preferences
AccentPreferences_CFLAGS = -fobjc-arc
AccentPreferences_CFLAGS = -fobjc-arc -DTHEOS_LEAN_AND_MEAN
AccentPreferences_EXTRA_FRAMEWORKS += Cephei CepheiPrefs
AccentPreferences_LIBRARIES = colorpicker
SDKVERSION = 13.3
SYSROOT = $(THEOS)/sdks/iPhoneOS13.3.sdk

include $(THEOS_MAKE_PATH)/bundle.mk

Expand Down
4 changes: 2 additions & 2 deletions accentpreferences/Resources/Root.plist
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<key>label</key>
<string>Current Hex</string>
</dict>
<dict>
<!--<dict>
<key>bundle</key>
<string>AppList</string>
<key>cell</key>
Expand Down Expand Up @@ -146,7 +146,7 @@
<string>1</string>
</dict>
</array>
</dict>
</dict>-->
<dict>
<key>cell</key>
<string>PSButtonCell</string>
Expand Down
Binary file modified accentpreferences/Resources/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified accentpreferences/Resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified accentpreferences/Resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions control
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Package: com.ivanc.accent
Name: Accent
Depends: mobilesubstrate, ws.hbang.common (>= 1.14), ws.hbang.alderis, applist
Depends: mobilesubstrate, ws.hbang.common (>= 1.14), ws.hbang.alderis, com.opa334.altlist (>=1.0.4)
Version: 1.5.0
Architecture: iphoneos-arm
Description: iOS accent colors in macOS style!
Maintainer: Ivan Cristina <ivancristina5@gmail.com>
Maintainer: Nick Botticelli <nick.s.botticelli@gmail.com>
Author: Ivan Cristina <[email protected]>
Section: Tweaks
Binary file modified sketch/Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 15df9ba

Please sign in to comment.