From 7ec1e2f73ecf8e560763988d8734aeb511bc1f8b Mon Sep 17 00:00:00 2001 From: lillian rose winter Date: Tue, 26 Nov 2019 08:42:55 -0600 Subject: [PATCH] :sparkles: custom call to action --- Tweak.x | 20 +++++++++++++++++++ hanahakiprefs/Resources/Root.plist | 32 ++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/Tweak.x b/Tweak.x index a247592..22a3c50 100644 --- a/Tweak.x +++ b/Tweak.x @@ -11,6 +11,8 @@ #import "Headers.h" +NSString *ctaText = @"hanahaki"; //this is for the custom CTA + %hook NSObject @interface NSObject (customObject) - (BOOL)isSettingOn:(NSString *)keyStr; @@ -132,3 +134,21 @@ %orig(arg1); } %end + +// CUSTOM CALL TO ACTION (press home to unlock) + +%hook SBUICallToActionLabel +- (void)setText:(id)arg1 forLanguage:(id)arg2 animated:(bool)arg3 { + NSObject *object = [[NSObject alloc] init]; + BOOL isSettingOn = [object isSettingOn:@"customctaction"]; + + if (isSettingOn) { + NSDictionary *pref = [NSDictionary dictionaryWithContentsOfFile:[NSString stringWithFormat:@"/var/mobile/Library/Preferences/toys.lily.hanahakiprefs.plist"]]; + ctaText = [[pref objectForKey:@"customctatext"] stringValue]; + return %orig(ctaText, arg2, arg3); + } + else { + return %orig(arg1, arg2, arg3); + } +} +%end diff --git a/hanahakiprefs/Resources/Root.plist b/hanahakiprefs/Resources/Root.plist index 875c854..ae0c2db 100644 --- a/hanahakiprefs/Resources/Root.plist +++ b/hanahakiprefs/Resources/Root.plist @@ -50,6 +50,38 @@ label rounded screen corners + + cell + PSGroupCell + label + lock screen + + + cell + PSSwitchCell + default + + defaults + toys.lily.hanahakiprefs + key + customctaction + label + custom "press home to unlock" text + + + cell + PSEditTextCell + default + Press Home to Unlock + bestGuess + Press Home to Unlock + defaults + toys.lily.hanahakiprefs + key + customctatext + label + custom text + cell PSGroupCell