diff --git a/Makefile b/Makefile index 07e6966..7196737 100644 --- a/Makefile +++ b/Makefile @@ -5,13 +5,16 @@ INSTALL_TARGET_PROCESSES = SpringBoard include $(THEOS)/makefiles/common.mk # TARGET_CODESIGN = fastPathSign -TWEAK_NAME = TrollPad +TWEAK_NAME = TrollPadSB TrollPadUI -TrollPad_FILES = Tweak.x TrollPadPrefs/NSUserDefaults+hook.x TPPrefsObserver.m -TrollPad_CFLAGS = -fobjc-arc -TrollPad_LDFLAGS = -lMobileGestalt +TrollPadSB_FILES = TweakSB.x TrollPadPrefs/NSUserDefaults+hook.x TPPrefsObserver.m +TrollPadSB_CFLAGS = -fobjc-arc +TrollPadSB_LDFLAGS = -lMobileGestalt # TrollPad_PRIVATE_FRAMEWORKS = BoardServices SpringBoard +TrollPadUI_FILES = TweakUI.x +TrollPadUI_CFLAGS = -fobjc-arc + include $(THEOS_MAKE_PATH)/tweak.mk SUBPROJECTS += TrollPadPrefs include $(THEOS_MAKE_PATH)/aggregate.mk diff --git a/TrollPad.plist b/TrollPadSB.plist similarity index 100% rename from TrollPad.plist rename to TrollPadSB.plist diff --git a/TrollPadUI.plist b/TrollPadUI.plist new file mode 100644 index 0000000..5a63f2d --- /dev/null +++ b/TrollPadUI.plist @@ -0,0 +1,7 @@ +{ + Filter = { + Bundles = ( + "com.apple.UIKit" + ); + }; +} \ No newline at end of file diff --git a/Tweak.x b/TweakSB.x similarity index 96% rename from Tweak.x rename to TweakSB.x index 4d988ec..f1c5f9f 100644 --- a/Tweak.x +++ b/TweakSB.x @@ -23,17 +23,6 @@ static TPPrefsObserver* pref; static uint16_t forcePadIdiom = 0; -/* -%hook UIWindowScene -- (UIEdgeInsets)_safeAreaInsetsForInterfaceOrientation:(NSInteger)orientation { - forcePadIdiom++; - UIEdgeInsets result = %orig; - forcePadIdiom--; - return result; -} -%end -*/ - %hook UIDevice - (UIUserInterfaceIdiom)userInterfaceIdiom { // Ever wondered how I obtained those random functions to hook? This is my way diff --git a/TweakUI.x b/TweakUI.x new file mode 100644 index 0000000..062ca29 --- /dev/null +++ b/TweakUI.x @@ -0,0 +1,17 @@ +#import + +// Unlock iPadOS keyboard +BOOL forcePadKBIdiom = YES; +UIUserInterfaceIdiom UIKeyboardGetSafeDeviceIdiom(); +%hookf(UIUserInterfaceIdiom, UIKeyboardGetSafeDeviceIdiom) { + return forcePadKBIdiom ? UIUserInterfaceIdiomPad : %orig; +} + +%hook UIKeyboardImpl ++ (UIEdgeInsets)deviceSpecificPaddingForInterfaceOrientation:(NSUInteger)arg1 inputMode:(id)arg2 { + forcePadKBIdiom = NO; + UIEdgeInsets result = %orig; + forcePadKBIdiom = YES; + return result; +} +%end