├── .gitignore ├── FosscordTweak.plist ├── fosscordtweakprefs ├── Resources │ ├── icon.png │ ├── icon@2x.png │ ├── icon@3x.png │ ├── Info.plist │ └── Root.plist ├── GSPRootListController.h ├── Makefile ├── layout │ └── Library │ │ └── PreferenceLoader │ │ └── Preferences │ │ └── fosscordtweakprefs.plist └── GSPRootListController.m ├── headers.h ├── control ├── README.md ├── Makefile └── Tweak.xm /.gitignore: -------------------------------------------------------------------------------- 1 | .theos/ 2 | packages/ 3 | -------------------------------------------------------------------------------- /FosscordTweak.plist: -------------------------------------------------------------------------------- 1 | { Filter = { Bundles = ( "com.hammerandchisel.discord" ); }; } 2 | -------------------------------------------------------------------------------- /fosscordtweakprefs/Resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakecrowley/FosscordTweak/HEAD/fosscordtweakprefs/Resources/icon.png -------------------------------------------------------------------------------- /fosscordtweakprefs/Resources/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakecrowley/FosscordTweak/HEAD/fosscordtweakprefs/Resources/icon@2x.png -------------------------------------------------------------------------------- /fosscordtweakprefs/Resources/icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakecrowley/FosscordTweak/HEAD/fosscordtweakprefs/Resources/icon@3x.png -------------------------------------------------------------------------------- /headers.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | //@interface NSURLRequest : NSObject 4 | //-(NSURLRequest *) requestWithURL: (NSURL)url; 5 | //@end 6 | -------------------------------------------------------------------------------- /control: -------------------------------------------------------------------------------- 1 | Package: com.jakecrowley.fosscordtweak 2 | Name: FosscordTweak 3 | Version: 0.3 4 | Architecture: iphoneos-arm 5 | Description: Redirects Discord API requests to Fosscord. 6 | Maintainer: Jake Crowley 7 | Author: Jake Crowley 8 | Section: Tweaks 9 | Depends: mobilesubstrate, ws.hbang.common (>= 1.11), firmware (>= 13.0) 10 | Replaces: com.jakecrowley.fosscordtweak 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FosscordTweak 2 | iOS Tweak to redirect Discord API calls to a Fosscord server. 3 | 4 | # Installation 5 | ## Manual 6 | Download .deb file from release and install on jailbroken iPhone using Filza or Terminal Emulator. 7 | \ 8 | Must install Cephei Tweak Support which can be found on the Cydia repo https://chariz.com/ and preferenceloader. 9 | 10 | ## Cydia 11 | Cydia repo coming soon. 12 | 13 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | TARGET = iphone:latest:13.0 2 | INSTALL_TARGET_PROCESSES = SpringBoard 3 | 4 | ARCHS = arm64 arm64e 5 | 6 | include $(THEOS)/makefiles/common.mk 7 | 8 | TWEAK_NAME = FosscordTweak 9 | 10 | FosscordTweak_FILES = Tweak.xm 11 | FosscordTweak_CFLAGS = -fobjc-arc 12 | FosscordTweak_EXTRA_FRAMEWORKS += Cephei 13 | 14 | DEBUG=0 15 | 16 | include $(THEOS_MAKE_PATH)/tweak.mk 17 | SUBPROJECTS += fosscordtweakprefs 18 | include $(THEOS_MAKE_PATH)/aggregate.mk 19 | -------------------------------------------------------------------------------- /fosscordtweakprefs/GSPRootListController.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "spawn.h" 6 | 7 | @interface GSPRootListController : PSListController 8 | @property (nonatomic, retain) UIBarButtonItem *applyButton; 9 | @end 10 | 11 | @interface WinSpooferController : PSListController 12 | @property(nonatomic, retain) UIBarButtonItem *doneButton; 13 | @end -------------------------------------------------------------------------------- /fosscordtweakprefs/Makefile: -------------------------------------------------------------------------------- 1 | TARGET = iphone:latest:13.0 2 | ARCHS = arm64 arm64e 3 | 4 | include $(THEOS)/makefiles/common.mk 5 | 6 | BUNDLE_NAME = fosscordtweakprefs 7 | 8 | fosscordtweakprefs_EXTRA_FRAMEWORKS = Cephei CepheiPrefs 9 | fosscordtweakprefs_FILES = GSPRootListController.m 10 | fosscordtweakprefs_FRAMEWORKS = UIKit 11 | fosscordtweakprefs_PRIVATE_FRAMEWORKS = Preferences 12 | fosscordtweakprefs_INSTALL_PATH = /Library/PreferenceBundles 13 | fosscordtweakprefs_CFLAGS = -fobjc-arc -Wdeprecated-declarations -Wno-deprecated-declarations 14 | 15 | include $(THEOS_MAKE_PATH)/bundle.mk 16 | -------------------------------------------------------------------------------- /fosscordtweakprefs/layout/Library/PreferenceLoader/Preferences/fosscordtweakprefs.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | entry 6 | 7 | bundle 8 | fosscordtweakprefs 9 | cell 10 | PSLinkCell 11 | detail 12 | GSPRootListController 13 | icon 14 | icon.png 15 | isController 16 | 17 | label 18 | FosscordTweak 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /fosscordtweakprefs/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | fosscordtweakprefs 9 | CFBundleIdentifier 10 | com.jakecrowley.fosscordtweakprefs 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1.0 21 | NSPrincipalClass 22 | GSPRootListController 23 | 24 | 25 | -------------------------------------------------------------------------------- /Tweak.xm: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "headers.h" 4 | 5 | HBPreferences *preferences; 6 | BOOL tweakEnabled; 7 | NSString *fosscordURL; 8 | 9 | %hook NSURLRequest 10 | +(NSURLRequest *) requestWithURL: (NSURL *)url { 11 | if(tweakEnabled){ 12 | NSString *newURL = url.absoluteString; 13 | newURL = [newURL stringByReplacingOccurrencesOfString:@"discord.com" withString:fosscordURL]; 14 | newURL = [newURL stringByReplacingOccurrencesOfString:@"gateway.discord.gg" withString:fosscordURL]; 15 | newURL = [newURL stringByReplacingOccurrencesOfString:@"cdn.discordapp.com" withString:fosscordURL]; 16 | newURL = [newURL stringByReplacingOccurrencesOfString:@"media.discordapp.com" withString:fosscordURL]; 17 | 18 | url = [NSURL URLWithString:newURL]; 19 | } 20 | return %orig; 21 | } 22 | %end 23 | 24 | %ctor { 25 | preferences = [[HBPreferences alloc] initWithIdentifier:@"com.jakecrowley.fosscordtweakprefs"]; 26 | [preferences registerBool:&tweakEnabled default:NO forKey:@"tweakEnabled"]; 27 | [preferences registerObject:&fosscordURL default:@"" forKey:@"fosscordURL"]; 28 | } 29 | -------------------------------------------------------------------------------- /fosscordtweakprefs/GSPRootListController.m: -------------------------------------------------------------------------------- 1 | #include "GSPRootListController.h" 2 | 3 | @implementation GSPRootListController 4 | 5 | - (NSArray *)specifiers { 6 | if (!_specifiers) { 7 | _specifiers = [self loadSpecifiersFromPlistName:@"Root" target:self]; 8 | } 9 | 10 | return _specifiers; 11 | } 12 | 13 | - (instancetype)init { 14 | self = [super init]; 15 | 16 | if (self) { 17 | HBAppearanceSettings *appearanceSettings = [[HBAppearanceSettings alloc] init]; 18 | appearanceSettings.tintColor = [UIColor colorWithRed:1.0f green:0.81f blue:0.86f alpha:1]; 19 | appearanceSettings.tableViewCellSeparatorColor = [UIColor colorWithWhite:0 alpha:0]; 20 | self.hb_appearanceSettings = appearanceSettings; 21 | 22 | self.applyButton = [[UIBarButtonItem alloc] initWithTitle:@"Apply" 23 | style:UIBarButtonItemStylePlain 24 | target:self 25 | action:@selector(apply:)]; 26 | self.applyButton.tintColor = [UIColor colorWithRed:1.0f green:0.81f blue:0.86f alpha:1]; 27 | self.navigationItem.rightBarButtonItem = self.applyButton; 28 | } 29 | return self; 30 | } 31 | 32 | -(void)github { 33 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/jakecrowley/FosscordTweak"]]; 34 | } 35 | 36 | - (void)apply:(id)sender { 37 | pid_t pid; 38 | const char *args[] = {"sh", "-c", "killall Discord", NULL}; 39 | posix_spawn(&pid, "/bin/sh", NULL, NULL, (char *const *)args, NULL); 40 | } 41 | @end 42 | -------------------------------------------------------------------------------- /fosscordtweakprefs/Resources/Root.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | headerCellClass 11 | HBPackageNameHeaderCell 12 | packageIdentifier 13 | com.jakecrowley.fosscordtweak 14 | packageNameOverride 15 | FosscordTweak 16 | titleColor 17 | #ffcdd9 18 | subtitleColor 19 | #aaaaaa 20 | 21 | 22 | 23 | cell 24 | PSSwitchCell 25 | default 26 | 27 | defaults 28 | com.jakecrowley.fosscordtweakprefs 29 | key 30 | tweakEnabled 31 | label 32 | Enable Tweak 33 | 34 | 35 | 36 | cell 37 | PSEditTextCell 38 | placeholder 39 | fosscord.example.com 40 | isURL 41 | 42 | defaults 43 | com.jakecrowley.fosscordtweakprefs 44 | key 45 | fosscordURL 46 | label 47 | Fosscord URL 48 | 49 | 50 | 51 | cell 52 | PSGroupCell 53 | label 54 | Other 55 | 56 | 57 | 58 | 59 | cellClass 60 | HBLinkTableCell 61 | cell 62 | PSButtonCell 63 | action 64 | github 65 | label 66 | GitHub 67 | subtitle 68 | Source Code 69 | 70 | 71 | 72 | title 73 | FosscordTweak 74 | 75 | 76 | --------------------------------------------------------------------------------