#development
1 messages · Page 231 of 1
iproxy 2222 22, then ssh -p2222 root@0
Or just do
ssh -o 'ProxyCommand=inetcat 22' -o 'UserKnownHostsFile /dev/null' -o 'StrictHostKeyChecking no' root@frcoal
yeah i cant be assed to do allat
frcoal?

okay mineek
Also a Fedora issue
make sure to have libimobiledevice installed for inetcat
In a new Terminal window,```
sudo systemctl stop usbmuxd
sudo usbmuxd -f -p
its already installed but it still didnt run
-f is foreground
it says inetcat not found but that package is installed
-p is uhh
I may be stupid 
I think the package is called libimobiledevice-utils or something
Try dnf search libimobiledevice
there is a utils pkg
sure ill try it
new error
Error connecting to device: Inappropriate ioctl for device
@crisp frost i love fedora
okay
now i combined 2 hooks
time to test
hmm thats not what i wanted
i shouldve run the green hook first
Someone should make an ios daemon that automatically installs any package that is sent to a discord channel and resprings

@interface SBHomeScreenViewController : UIViewController
@end
@interface _UIStatusBarForegroundView : UIView
@end
%hook _UIStatusBarForegroundView
-(void)didMoveToWindow{
%orig;
self.alpha = 0.3;
}
%end
%hook SBHomeScreenViewController
-(void)viewDidLoad {
%orig;
UIView *ourView = [[UIView alloc] init];
ourView.frame = CGRectMake(0, 0, 200, 50);
ourView.backgroundColor = [UIColor greenColor];
[self.view addSubview:ourView];
}
%end```
my L code
how does one instead make a cicle
circle
instead of a rectangle
that's when you start using stackoverflow
oh boy oh boy oh boy
already arrived at stackoverflow
yuck all that code is beyond my current paygrade of debt
^ specifically only works if you're making a circle, not ovals
oooh the swift code isn't
eh but i wont go into that yet
i dont understand any of this
maybe i should take like
an obj c course
no that's the fun part
https://www.youtube.com/watch?v=o3t52-ZxFtU&list=PLyjWuFyddLWNsPRqqF3cwGpQ02DhEAb0o
actually taught me a decent bit
it's old but still
Objective-C really hasnt drastically changed in a long time
UIKit hasn't either?
the last "addition" was in 2019 with objc_direct which was a tiny change in retrospect
UIKit has evolved drastically, but the core concepts in the lecture are mostly still the same
they're not directly applicable to tweaks since they're working on apps, so I'd say maybe lecture 8 or 9
interesting requirements
I just sat and watched them FYI, didnt follow along
so maybe get some popcorn and watch idk
just trial and error
lmao
not even joking
is the cocoa touch shit relevant at all
that just refers to UIKit now pretty much
where does wsl store files
under there
under where ?

ERROR: control directory has bad permissions 777 (must be >=0755 and <=0775)
make: *** [/home/jwalr/theos/makefiles/package/deb.mk:70: internal-package] Error 255
weird error on wsl
Yeah I tried fixing the perms
It didn’t work
I might just switch to Linux
For iOS dev at least
does that mean i have to hook posix_spawn again in the child process, because apparently the launchd spawn mechanism goes something like this
Launchd calls fork/posix_spawn -> the child becomes the generic process called xpcproxy (via xpc messages) -> idk how but that turns into the real process later, the last part is probably where the envs are lost.
tldr: can you clarify what that means
launchd -> posix_spawn() -> xpcproxy -> posix_spawn() -> your bin
whereas the latter posix_spawn is called with the setexec flag
(if you hook posix_spawn using instruction replacements you do not need to worry about posix_spawnp, if you don't then you need to reimplement it and interpose it with your reimplementation)
Funni
red box
indeed
alr ima try using some new headers now
nooo it didnt work
-(void)viewWillAppear {
%orig;
UIView *ourView = [[UIView alloc] init];
ourView.frame = CGRectMake(0, 0, 200, 50);
ourView.backgroundColor = [UIColor greenColor];
[self.view addSubview:ourView];
}
%end```
what did i do wrong
look closely at the declaration
wym
void viewWillAppear();
void viewWillAppear(bool animated);
in C++ these would these represent the same or different functions?
do i need viewWillAppear(true)
diffferent
obviously
Right
the 2nd wants you to pass in 2 values
-(void)viewWillAppear:(true)
No, that's just the syntax of the method
- (void) viewWillAppear:(BOOL) animated
(BOOL) is the argument type
animated is the argument name
okay so its just viewWillAppear(true)
?
oh no
right
but i dont want it to be animated
%hook SBHomeScreenSpotlightViewController
-(void)viewWillAppear:(BOOL)animated {
%orig;
UIView *ourView = [[UIView alloc] init];
ourView.frame = CGRectMake(0, 0, 200, 50);
ourView.backgroundColor = [UIColor greenColor];
[self.view addSubview:ourView];
}
%end
it doesnt matter, you're just overriding the original method
the original method is - (void)viewWillAppear:(BOOL)animated
so you need to match the signature
but why didnt i have to do that with the other methods that had that same sorta thing
lemme find
oh
i see
so the bool can be empty
and itll work
dingus
indeed
that would be me

IT WORKED
LETS GOOOO
W
so many of these custom headers seem a bit iffy tho
i dont know what 99% of them do
like wtf is SBHomeScreenSwitcherModifier.h
or SBIconDragPreviewContaining.h
idek
also what are the "delegate" ones
Contains, in alphabetical order, descriptions of design patterns, architectures, and other concepts important in Cocoa development.
so can i use NCNotificationViewControllerDelegate.h to inject into the noiftication centre
maybe try hooking NCNotificationViewController instead
i didnt see a header file for that
cripes its long
lemme see if i can find a suitable place to inject
oh i can just use viewDidLoad again
oh boy
that is not what i wanted

its doing it on every notification
not on the actual view itself
although i could do some cool shit with that
does quartzcore still exist
apparently so
rounded corners!
youre probably making use of the wrong view
youre doing it to the view responsible for being the individual notification cells 
do you have FLEX
no
i probably should install it
ill do that after my lesson
Funni rounded corners
idk why the advice i see is "make a custom swift extention"
when you can literally just use quartzcore
and write a singular line
ourView.layer.cornerRadius = 5;
quartzcore is basically just coreanimation now
but dont bother with the naming
is there any advantage to writing it like this
@IBInspectable public var cornerRadius: CGFloat {
set {
layer.cornerRadius = newValue
}
get {
return layer.cornerRadius
}
}
public func roundCorners(corners: UIRectCorner, radius: CGFloat) {
let path = UIBezierPath(roundedRect: bounds, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius))
let mask = CAShapeLayer()
mask.path = path.cgPath
layer.mask = mask
}
}
ive seen this online quite a few times
not at all
LMAO ofc there isn't

i'm starting to like this
it's so fun being able to inject shit into whatever i want
feels like the OS is actually mine
i have an idea
for a tweak
but i need a little more knowledge to do it
whats ur idea
well it's basically knock off bloom but a singular colour
i wanna try it
but i need to know how to sort the layer so it goes behind the notification, and i need to know how to grab the length and height of each notification
idk how i should do that
-(void)viewDidLoad {
%orig;
UIView *ourView = [[UIView alloc] init];
ourView.frame = CGRectMake(0, 0, 200, 50);
ourView.backgroundColor = [UIColor greenColor];
ourView.layer.cornerRadius = 5;
[self.view insertSubview(ourView :belowSubview: )];
}
%end```
cooked
im so bad at this
lmao
thats definitely wrong
try this
%hook NCNotificationViewController
-(void)viewDidLoad {
%orig;
UIView *ourView = [[UIView alloc] init];
ourView.frame = CGRectMake(0, 0, 200, 50);
ourView.backgroundColor = [UIColor greenColor];
ourView.layer.cornerRadius = 5;
[self.view insertSubview:ourView atIndex:0];
}
%end
L
it worked!
well now i need to be able to do everything else
i need to blur, adapt rect to the size of the notif
just gonna do an approximation
until i can figure out
how to actually do it
lmao i way overshot
i think i got the corner radius close tho
grr this is hard without knowing how long it actually should be
huh
finally
thats the one
itll only work on my phone tho
since it doesn't properly scale to shit
i have this example code, is it correct?
-(void)viewDidLoad {
%orig;
// Create the blur effect
UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
UIVisualEffectView *blurView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
blurView.frame = CGRectMake(0, 0, 300, 60);
blurView.layer.cornerRadius = 20;
blurView.clipsToBounds = YES; // Ensure rounded corners are respected
// Add the blurred view to the main view
[self.view insertSubview:blurView atIndex:0];
}
%end
mmmm no thats not what i wanted
oh well
i got it
lets go
it still not exactly what i want but the effect is correct
does anyone know how to get the dimensions of a notification at runtime?
@acoustic imp
im estimating
its a fixed rectangle
i need the actual dimensions
? i can find the exact dimensions w flex, but i want it to adapt
depending on the size
GL
no it should be, jus find a ref to the MTMaterial view and gets its dimentions & radius or wtv
yes
would this work
%orig;
CGRect notificationFrame = self.view.frame;
CGFloat width = notificationFrame.size.width;
CGFloat height = notificationFrame.size.height;
}```
looks like it would
idk how to send those values off to the next function tho
setFrame?
i need it here:
%orig;
UIView *ourView = [[UIView alloc] init];
ourView.frame = CGRectMake(0, 0, width, height);
ourView.backgroundColor = [[UIColor greenColor] colorWithAlphaComponent:0.7];
ourView.layer.cornerRadius = 20;
ourView.layer.shadowColor = [UIColor greenColor].CGColor;
ourView.layer.shadowOpacity = 0.7;
ourView.layer.shadowRadius = 15;
ourView.layer.shadowOffset = CGSizeZero;
[self.view insertSubview:ourView atIndex:1];
}```
so just get it there?
i can't because it doesn't grab the right dimensions
thats why im getting it here
so do all this ^ here -> #development message ?
i tried that and it didnt work
how so
alr
(idk if u can do th3 = 0 actully)
@import QuartzCore;
@interface NCNotificationViewController : UIViewController
@end
CGFloat notificationWidth;
CGFloat notificationHeight;
%hook NCNotificationViewController
-(void)viewDidLayoutSubviews {
%orig;
notificationWidth = self.view.frame.size.width;
notificationHeight = self.view.frame.size.height;
[self viewDidLoad];
}
-(void)viewDidLoad {
%orig;
UIView *ourView = [[UIView alloc] init];
ourView.frame = CGRectMake(0, 0, notificationWidth, notificationHeight);
ourView.backgroundColor = [[UIColor greenColor] colorWithAlphaComponent:0.7];
ourView.layer.cornerRadius = 20;
ourView.layer.shadowColor = [UIColor greenColor].CGColor;
ourView.layer.shadowOpacity = 0.7;
ourView.layer.shadowRadius = 15;
ourView.layer.shadowOffset = CGSizeZero;
[self.view insertSubview:ourView atIndex:1];
}
%end```
unsure
use flex rq
i dont have flex installed
@import UIKit;
@import QuartzCore;
@interface NCNotificationViewController : UIViewController
@property (nonatomic, strong) UIView *someTweakPrefix_borderView;
@end
%hook NCNotificationViewController
%property (nonatomic, strong) UIView *someTweakPrefix_borderView;
-(void)viewDidLayoutSubviews {
%orig;
//notificationWidth = self.view.frame.size.width;
//notificationHeight = self.view.frame.size.height;
self.someTweakPrefix_borderView.frame = self.view.bounds;
[self viewDidLoad];
}
-(void)viewDidLoad {
%orig;
self.someTweakPrefix_borderView = [[UIView alloc] init];
self.someTweakPrefix_borderView.frame = self.view.bounds;
self.someTweakPrefix_borderView.backgroundColor = [[UIColor greenColor] colorWithAlphaComponent:0.7];
self.someTweakPrefix_borderView.layer.cornerRadius = 20;
self.someTweakPrefix_borderView.layer.shadowColor = [UIColor greenColor].CGColor;
self.someTweakPrefix_borderView.layer.shadowOpacity = 0.7;
self.someTweakPrefix_borderView.layer.shadowRadius = 15;
self.someTweakPrefix_borderView.layer.shadowOffset = CGSizeZero;
[self.view insertSubview:self.someTweakPrefix_borderView atIndex:1];
}
%end```
maybe try that idk
i jus wrote it in dc
@magic hazel
😭
rip
probably yeah
make sure to let the device boot up fully, ie: connect to wifi and open up an app
kfd try to be reliable challenge
landa is stable on my phone
alfie made it possible
he still has me blocked :/
he has half of the server blocked
ikr, i made a joke ab him after sm he said and he blocked me...
🤦♂️
it freezes sits there
then resprings
ill unistall the tweak
but idk why it's freezing
remove/diable all other tweaks to
ima just comment out smthing and see if it fixes it, i cannot be assed to install a logger and attempt to extract it that way for such a basic tweak
i mean if u gonna tweak dev might as well
did u try this? ^
no i havent yet but i also dont really know what you changed
TLDR: added a prpoperty/referance to ur view on the viewcontroller and instead of storring the width/height just applied/set it
okay
i dont entirely understand what that does but alr
im sus it could be this [self viewDidLoad];
where do you grab the notif width and height
~~jus install krashkop 😭 🙏 ~~
same spot u do
its commented out
yeah but then you make another rectangle
self.someTweakPrefix_borderView.frame = CGRectMake(0, 0, notificationWidth, notificationHeight);
bounds are just the h/w with the x/y both 0, its the correct way to get the H/W of a view
using those variables
no im setting the frame of the one your alr created
self.someTweakPrefix_borderView is the referance to that view
yeah it throws an error
about those exact variables
send it
self.someTweakPrefix_borderView.frame = CGRectMake(0, 0, notificationWidth, notificationHeight);
^
Tweak.x:25:81: error: use of undeclared identifier 'notificationHeight'
self.someTweakPrefix_borderView.frame = CGRectMake(0, 0, notificationWidth, notificationHeight);
^
2 errors generated.
make[3]: *** [/home/jwalr/theos/makefiles/instance/rules.mk:404: /home/jwalr/tutorial/.theos/obj/debug/arm64/Tweak.x.d67574f8.o] Error 1
make[2]: *** [/home/jwalr/theos/makefiles/instance/library.mk:52: /home/jwalr/tutorial/.theos/obj/debug/arm64/tutorial.dylib] Error 2
make[1]: *** [/home/jwalr/theos/makefiles/instance/library.mk:37: internal-library-all_] Error 2
make: *** [/home/jwalr/theos/makefiles/master/rules.mk:146: tutorial.all.tweak.variables] Error ```
lmao
(re copy paste)
CGRectMake(0, 0, notificationWidth, notificationHeight); != CGRectMake(self.view.bounds.size.width, self.view.bounds.size.height, 0, 0);
(ignore the placement)
same error
send
literally word for word the same
did u re copy paste?
yes
multiple times
@import QuartzCore;
@interface NCNotificationViewController : UIViewController
@property (nonatomic, strong) UIView *someTweakPrefix_borderView;
@end
%hook NCNotificationViewController
%property (nonatomic, strong) UIView *someTweakPrefix_borderView;
-(void)viewDidLayoutSubviews {
%orig;
//notificationWidth = self.view.frame.size.width;
//notificationHeight = self.view.frame.size.height;
self.someTweakPrefix_borderView.frame = CGRectMake(self.view.bounds.size.width, self.view.bounds.size.height, 0, 0);
[self viewDidLoad];
}
-(void)viewDidLoad {
%orig;
self.someTweakPrefix_borderView = [[UIView alloc] init];
self.someTweakPrefix_borderView.frame = CGRectMake(0, 0, notificationWidth, notificationHeight);
self.someTweakPrefix_borderView.backgroundColor = [[UIColor greenColor] colorWithAlphaComponent:0.7];
self.someTweakPrefix_borderView.layer.cornerRadius = 20;
self.someTweakPrefix_borderView.layer.shadowColor = [UIColor greenColor].CGColor;
self.someTweakPrefix_borderView.layer.shadowOpacity = 0.7;
self.someTweakPrefix_borderView.layer.shadowRadius = 15;
self.someTweakPrefix_borderView.layer.shadowOffset = CGSizeZero;
[self.view insertSubview:self.someTweakPrefix_borderView atIndex:1];
}
%end```
oh shit
set self.someTweakPrefix_borderView.frame = CGRectMake(0, 0, notificationWidth, notificationHeight); to self.someTweakPrefix_borderView.frame = CGRectMake(self.view.bounds.size.width, self.view.bounds.size.height, 0, 0);
i hate doing this thru discord
😭
i still dont really understand the code
is the variable you made of type uiview
and then you set its dimensions to that of the notif
and then pass that
yes its defined here
into the next function
yes
it froze

see why please
of wait
@import UIKit;
@import QuartzCore;
@interface NCNotificationViewController : UIViewController
@property (nonatomic, strong) UIView *someTweakPrefix_borderView;
@end
%hook NCNotificationViewController
%property (nonatomic, strong) UIView *someTweakPrefix_borderView;
-(void)viewDidLayoutSubviews {
%orig;
//notificationWidth = self.view.frame.size.width;
//notificationHeight = self.view.frame.size.height;
if(self.someTweakPrefix_borderView){
self.someTweakPrefix_borderView.frame = self.view.bounds;
}
}
-(void)viewDidLoad {
%orig;
self.someTweakPrefix_borderView = [[UIView alloc] init];
self.someTweakPrefix_borderView.frame = self.view.bounds;
self.someTweakPrefix_borderView.backgroundColor = [[UIColor greenColor] colorWithAlphaComponent:0.7];
self.someTweakPrefix_borderView.layer.cornerRadius = 20;
self.someTweakPrefix_borderView.layer.shadowColor = [UIColor greenColor].CGColor;
self.someTweakPrefix_borderView.layer.shadowOpacity = 0.7;
self.someTweakPrefix_borderView.layer.shadowRadius = 15;
self.someTweakPrefix_borderView.layer.shadowOffset = CGSizeZero;
[self.view insertSubview:self.someTweakPrefix_borderView atIndex:1];
}
%end```
what did you change
I go away and you’re already teaching him %property
lmaoo
yep
i have absolutely no idea whats going on
with that part
my code is making my ipad freeze
Just add a borderWidth and borderColor on the original view and be done with it

huh
i tried to grab the width and length of the og view
he wants some like under notif border not a full border
My head hurts too much for this rn
go take a nap
^
I just woke up from a nap
no
it bloody well froze again
its because we're calling viewdid load
you're not supposed to call that function aagin
it's not our function
omg dont do that
lmao you had it in your code
so did i
i didnt read it all
lmao
i claled it because
at least in c++
you need to call the function to do jack
it wont keep going
itll just end operation
dw ab that in logos
so itll just continue the program?
alr
i wish it didnt freeze and i could just uninstall without rebooting twice
it no longer freezes
but it also does not grab the correct values
at least my code doesn't
ill try yours

your code works
i just don't understand it
what is self.view.bounds
lmao
the bounds of the view
idk what this nonatomic strong bs is nor do i know why you seem to call it twice?
also why do you run self.someTweakPrefix_borderView.frame = self.view.bounds;
twice
A variable with the 'nonatomic' property means that the variable is not thread safe. This might sound scary, but it just means that the variable can be accessed from multiple threads at the same time.
also why do you use "self" in front of everything
It’s like “this” in c++
do i need it
why am i declaring the property twice, once in the hook, and once in the obj c code
For properties yes
it looks like exactly the same property
%property (nonatomic, strong) UIView *ourView;
@property (nonatomic, strong) UIView *ourView;
the only thing that changed was the @ and %
The %property is needed if you’re creating a new property
That one didn’t exist originally
so this line: @property (nonatomic, strong) UIView *ourView;
is irrelevant
@import QuartzCore;
@interface NCNotificationViewController : UIViewController
@property (nonatomic, strong) UIView *ourView;
@end
%hook NCNotificationViewController
%property (nonatomic, strong) UIView *ourView;
-(void)viewDidLayoutSubviews {
%orig;
self.ourView.frame = self.view.bounds;
}
-(void)viewDidLoad {
%orig;
UIView *ourView = [[UIView alloc] init];
ourView.frame = self.view.bounds;
ourView.backgroundColor = [[UIColor greenColor] colorWithAlphaComponent:0.7];
ourView.layer.cornerRadius = 20;
ourView.layer.shadowColor = [UIColor greenColor].CGColor;
ourView.layer.shadowOpacity = 0.7;
ourView.layer.shadowRadius = 15;
ourView.layer.shadowOffset = CGSizeZero;
[self.view insertSubview:ourView atIndex:1];
}
%end```
No, it’s needed to compile it
so i need to declare every property twice, once outside the hook, and once inside?
At first you’re lying to the compiler to say that that property exists, and then you’re adding it yourself to make sure it exists
i see
i just saw that as "property property" "tweak property" when i was fucking around with tweaks 
If you’re just using an existing property, you only need to declare it in the interface
If you’re making a new property (this isn’t that prevalent, teslaman just seems to have an obsession with them) you’ll need to do one in the hook and one in the interface
okay cool, and why is it a property and not just an object
this isn’t that prevalent, teslaman just seems to have an obsession with them
also, i seem to run this " self.ourView.frame = self.view.bounds;
" in both functions. if that's the code that grabs the size, then surely i tshould grab zero when i run it again in the second function
What
%orig;
self.ourView.frame = self.view.bounds;
}``` and
```-(void)viewDidLoad {
%orig;
self.ourView = [[UIView alloc] init];
self.ourView.frame = self.view.bounds;```
See this is where I’ll suggest you to start reading UIKit documentation — in the viewDidLoad the bounds will likely be 0, but in viewDidLayoutSubviews they’ll be defined
so i can just delete that line?
.
kk
so far this is just a lot to keep track of but i'm wrapping my head around it
i see next in the tutorial we go onto preferences
i think my first tweak will just be to have a glow behind notifs that can be toggled on and off
maybe with options to change the colour
it worked!
nice send a screenshot
Nice
Indeed
idk if its bad that im still refering to a lot of the documentation
idk if i should try and memorise all this
No not at all
that's encouraged
and please please please look at open source tweaks
not just you specifically, I'm talking about all new devs
i know i've trying to but a lot of them are just overwhelming
so much stuff i have absolutely 0 clue what it does
how to i grab the corner offset asw
bounds grabs the bounds thats cool
but it's not a perfect fit since my corner radius
isnt
ahhhh im lost

@implementation EXMRootListController
- (NSArray *)specifiers {
if (!_specifiers) {
_specifiers = [self loadSpecifiersFromPlistName:@"Root" target:self];
}
return _specifiers;
}
@end```
i don't understand this code
i dont undertsand how to make an on/off siwtch
i read the other gh page
i setup a gh repo
idk how to do this preference shit tho
how do i do this but also just have it respring
this notification metho dseems wack
is there a simpler way?
ive used chatgpt to hack somethign together
i dont understand it tho
not even that is working
aight ima take a break
im so lost
YOOOO
IT WORKS
i understand kinda
i dont understand the code
specifically this
NSUserDefaults *prefs = [[NSUserDefaults alloc] initWithSuiteName:@"com.dingus.TutorialPrefs"];
testSwitchKey = [prefs objectForKey:@"testSwitchKey"] ? [prefs boolForKey:@"testSwitchKey"] : YES;
}```
UGHHH
i cant get it to respring
grr so much i dont understand
i have absolutely 0 clue what the respring code does
u probly jus need to make it /var/jb/usr/bin/killall or wtv it is
add /var/jb/ to the front of the path
@import UIKit;
@import QuartzCore;
#import <spawn.h>
@interface NCNotificationViewController : UIViewController
@property (nonatomic, strong) UIView *ourView;
@end
static BOOL testSwitchKey;
//Preference code, don't understand it yet
static void preferencesChanged() {
NSUserDefaults *prefs = [[NSUserDefaults alloc] initWithSuiteName:@"com.dingus.TutorialPrefs"];
testSwitchKey = [prefs objectForKey:@"testSwitchKey"] ? [prefs boolForKey:@"testSwitchKey"] : YES;
}
//Code that searches for a change in preference
%ctor {
preferencesChanged();
}
//Respring code from Chat-GPT, no idea what it actually does but hopefully it works
extern void respring() {
NSLog(@"[TutorialPrefs] Respring button pressed");
pid_t pid;
int status;
const char *args[] = { "killall", "-9", "SpringBoard", NULL };
posix_spawn(&pid, "/usr/bin/killall", NULL, NULL, (char * const *)args, NULL);
waitpid(pid, &status, 0);
}
%hook NCNotificationViewController
%property (nonatomic, strong) UIView *ourView;
//Grab notification bounds
-(void)viewDidLayoutSubviews {
%orig;
self.ourView.frame = self.view.bounds;
}
//Create notification glow and set colour and size
-(void)viewDidLoad {
%orig;
//Doesn't run if the switch is off
if (!testSwitchKey) return;
//Initilise the property from last function
self.ourView = [[UIView alloc] init];
self.ourView.backgroundColor = [[UIColor clearColor] colorWithAlphaComponent:0.7];
self.ourView.layer.cornerRadius = 20;
//Code for glow parameters
self.ourView.layer.shadowColor = [UIColor greenColor].CGColor;
self.ourView.layer.shadowOpacity = 0.7;
self.ourView.layer.shadowRadius = 10;
self.ourView.layer.shadowOffset = CGSizeZero;
[self.view insertSubview:self.ourView atIndex:0];
}
%end```
how do i do it with obj c highlight shit
there we go
idk i might ditch the respring
i have no clue what im doing when it comes to preferences
what if i put respring in %ctor
Why
i dont know
That’ll cause the phone to respring loop
Every time the tweak loads it’ll respring the phone
well i have no idea how to get it to work then
ima comment out that respring code for now and try and understand the preference bs
i should make a tweak that randomly resprings u at random times every day
but like
u cant remove it from sileo
Bad
is that ai
teslaman 2.0:
Why do you want to respring the device
to update the change to the notification glow toggle
the notification based system is way way over my head
i cannot follow what it is doing whatsoever
So you want a button in the settings of the tweak that will cause a respring when pressed?
Right
But you’re adding the respring code in the main tweak right now
You don’t need it there
You need it in the prefs
^
Go to my github user and look up posix_spawn
so in my header file
@radiant idol random question for CC18, yay or nay for doing the like wifi/bt modules to ios 18.0.1(easy and lazy) or copy it from latest
so i put it in my header file but when am i supposed to call it
how do i make it call that function when i click the button
What
TLDR one or two
nope
ooooh
no i have an idea
what if instead of letting the user do it
i just force it to happen
once you've made a change
bcus i cannot seem to get this button working
i hate preferences
i like the first
wrong link
?
https://github.com/NightwindDev/Preference-Bundle-Example?tab=readme-ov-file#psbuttoncell @magic hazel
Some information about preference bundles and the different cells in there. - NightwindDev/Preference-Bundle-Example
just change MobilePhone to SpringBoard
make this size
does that go within the implementation
yes
posix_spawn(&pid, ROOT_PATH("/usr/bin/killall"), NULL, NULL, (char* const*)args, NULL);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jwalr/theos/sdks/iPhoneOS16.5.sdk/usr/include/spawn.h:60:64: note: passing argument to parameter here
int posix_spawn(pid_t * __restrict, const char * __restrict,
^
2 errors generated.
make[4]: *** [/home/jwalr/theos/makefiles/instance/rules.mk:305: /home/jwalr/tutorial/.theos/obj/debug/arm64e/JWIRootListController.m.a29e5e37.o] Error 1
==> Compiling JWIRootListController.m (arm64)…
/home/jwalr/theos/toolchain/linux/iphone/bin/clang: /lib64/libtinfo.so.6: no version information available (required by /home/jwalr/theos/toolchain/linux/iphone/bin/clang)
JWIRootListController.m:17:20: error: call to undeclared function 'ROOT_PATH'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
posix_spawn(&pid, ROOT_PATH("/usr/bin/killall"), NULL, NULL, (char* const*)args, NULL);
^
JWIRootListController.m:17:20: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *' [-Werror,-Wint-conversion]
posix_spawn(&pid, ROOT_PATH("/usr/bin/killall"), NULL, NULL, (char* const*)args, NULL);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jwalr/theos/sdks/iPhoneOS16.5.sdk/usr/include/spawn.h:60:64: note: passing argument to parameter here
int posix_spawn(pid_t * __restrict, const char * __restrict,
^
2 errors generated.
make[4]: *** [/home/jwalr/theos/makefiles/instance/rules.mk:305: /home/jwalr/tutorial/.theos/obj/debug/arm64/JWIRootListController.m.b3878261.o] Error 1
make[3]: *** [/home/jwalr/theos/makefiles/instance/bundle.mk:37: /home/jwalr/tutorial/.theos/obj/debug/arm64/TutorialPrefs.bundle/TutorialPrefs] Error 2
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [/home/jwalr/theos/makefiles/instance/bundle.mk:37: /home/jwalr/tutorial/.theos/obj/debug/arm64e/TutorialPrefs.bundle/TutorialPrefs] Error 2
make[2]: *** [/home/jwalr/theos/makefiles/instance/bundle.mk:26: internal-bundle-all_] Error 2
make[1]: *** [/home/jwalr/theos/makefiles/master/rules.mk:146: TutorialPrefs.all.bundle.variables] Error 2
make: *** [/home/jwalr/theos/makefiles/master/aggregate.mk:12: internal-all] Error 2
add these to the top:
#import <spawn.h>
#import <rootless.h>
oh
i use the NS one
i lied then
hence why you use ROOT_PATH instead of ROOT_PATH_NS
@magic hazel dont worry I didnt understand what posix_spawn actually did until like last year
and I started making tweaks in 2021

im less concerned about the respring stuff
idgaf what that does
im more concerned abt the preference stuff
rule one, dont
i should know
lemme push changes
its public right
not private
yes
nice
static void preferencesChanged() {
NSUserDefaults *prefs = [[NSUserDefaults alloc] initWithSuiteName:@"com.dingus.TutorialPrefs"];
testSwitchKey = [prefs objectForKey:@"testSwitchKey"] ? [prefs boolForKey:@"testSwitchKey"] : YES;
}
what is this doing
NSUserDefaults stores the settings of the tweak
do you know what ternary operators are?
no
bool A = true;
int B = A == true ? 4 : 2;
B will be 4 if A is true and 2 if not
what
okay i understand the first line now
its just like a property
or the UIView
a NSUserDefaults called "prefs" is allocated and initialised, with the suite name of com.dingus.TutorialPrefs
finished my LA hw 🙏
i might be wrong
i still dont quite get that second line
why does it ask for an objectkey
and a boolkey
my object is a bool

do you understand this
that's just the syntax
i assume the : means else
it can be written like this:
bool A = true;
int B;
if (A == true) {
B = 4;
} else {
B = 2;
}
testSwitchKey = [prefs objectForKey:@"testSwitchKey"] ? [prefs boolForKey:@"testSwitchKey"] : YES;```
is jus like (sorta)
```objc
BOOL testSwitchKey = nil;
if([prefs objectForKey:@"testSwitchKey"]){
testSwitchKey = [prefs boolForKey:@"testSwitchKey"];
}else{
testSwitchKey = YES;
}
testSwitchKey = testSwitchKey;
LMAO
okay i get that now
but why is there prefs objectForKey:@"testSwitchKey"]){
var = [prefs boolForKey:@"testSwitchKey
var is a BOOL not id
ik ik
B is 4 if A is true, otherwise it's 2
we check objectForKey because we want to make sure the user has set some value for testSwitchKey
yep
if they have set a value, we use the boolForKey
if not, we use the default
? is and?
whar
huh

testSwitchKey = [prefs objectForKey:@"testSwitchKey"] ? [prefs boolForKey:@"testSwitchKey"] : YES;
okay so if i have this crrect, this code uses that first part tere about objectforkey purely to detect if the user has or hasnt changed it, and then if that first part is true, and they have changed it, then it sets the boolforkey to be whatever it is the user changed it to
testSwitchKey = /* if user has set the setting to some value */ ? /* use the user's setting */ : /* use the default value */;
/* same thing as: */
if (/* user has set the setting to some value */) {
testSwitchKey = /* use the user's setting */;
} else {
testSwitchKey = /* use the default value */;
}
if testSwitchKey is set from prefs or wtv [prefs objectForKey:@"testSwitchKey"] will return a vlaue, the first part just sees if there is a value, and if there is set that var as the value as a boolean and if not set it as the "default'
yea
cool now i have to somehow remember all this
i wont but i can just reread this
lmao
ima put comments there
i just copy paste every time, ive learned it over time tho
you'll just put it to muscle memory
yeah
well
i think i have a functional tweak now
i can enable and disable the glow
and apply it with a respring
good thing to do is type everything out by hand when learning NO COPY PASTE
wrd
i actually didnt think id get this far
I think something cool you could then do is make the glow match the icon of the app
so is velvet2
not anymore
oh okay
starting out i could never get the one funct on stack overflow to work ~~still havnt to this day bc i gave up 😭 ~~
ok
blud deletes more messages than he sends
awesome
that'll be useful
no I sent that for you to see how I did it teslaman lol
no
i get that
but im also stealing it
i need an icon colour grabber
idk if that works for notifications tho
wait wtheck
im jk i wont actually copy paste ur code i just wanted to take a look
mmm
still way over my head
wait
no i can read most of it
nice
ima make a to-do file
and add that suggestiong
I think something cool you could then do is make the glow match the icon of the app
bro mac os just ate one of my windows i cant find it

fatty, it had alot of tabs open too 
LMAO
why did i just find 2 long lost windows 😭
okay so ima take a break
so i can let it sit
maybe tmrw or later today ill redo the tweak
from scratch
new repo
see if i remember anything
i will probably have to keep refering back to my current tweak
which isn't great (i think)
hopefully ill be able to not do that eventually
itll come w practice ig
what do i have to make to get the dev role
(purple is kinda ugly)
a decently big tweak
bootlooper

./j
-(void)viewDidLoad {
%orig;
//Doesn't run if the switch is off
if (!testSwitchKey) {
return;
}
else {
//Initilise the property from last function
self.ourView = [[UIView alloc] init];
self.ourView.backgroundColor = [[UIColor clearColor] colorWithAlphaComponent:0.7];
self.ourView.layer.cornerRadius = 20;
//Code for glow parameters
self.ourView.layer.shadowColor = [UIColor greenColor].CGColor;
self.ourView.layer.shadowOpacity = 0.7;
self.ourView.layer.shadowRadius = 10;
self.ourView.layer.shadowOffset = CGSizeZero;
[self.view insertSubview:self.ourView atIndex:0];
}
}```
is this if else statement okay
just tryna clean some stuff up
you dont need the else
you can just have the if
once you return, the rest of the code will be ignored
hot take, i dont like doing it like this
why
idk, jus feels weird
how so
not really
if else > if return
¯_(ツ)_/¯
maybe i should try remaking it rn
i kinda want to
but im a bit tired
this is the most fun ive had writing any code
probably because i can actually get help when shit goes wrong
- its small proj
easy to iterate
hey i need some help with something, i've got a jailbroken iphone 11 with dopamine, ios 16.3.1, and i was trying to get kernel read working through kfd, but whenever i run the exploit it crashes my phone, i've been debugging it a bit with lldb and i found it crashed whenever it got to this line. I've also tried using opa334's fork but got the same result. Any help would be appreciated.
That fork doesn’t work on ios 16
is there one that works on ios 16 or should i just try taking it directly from dopamine?
Wait, are you using IOSurface method or not? Otherwise it should work actually
nope
Nonetheless, stock kfd will work for you
The hardcoded addresses for your device can be obtained with https://github.com/opa334/XPF
so just updating the offsets should fix it?
No problem
does anyone here have a paid apple dev account
why
why
why
why
rewrote my code mostly from memory
i'm pretty happy with what i remembered
@import UIKit;
@import QuartzCore;
@interface NCNotificationViewController : UIViewController
@property (nonatomic, strong) UIView *notificationView;
@end
//Main Hook
%hook NCNotificationViewController
%property (nonatomic, strong) UIView *notificationView;
//Obtain notification dimensions
-(void)viewDidLayoutSubviews {
%orig
self.notificationView.frame = self.view.bounds;
}
//Inject glow behind each notification
-(void)viewDidLoad {
%orig
//Create a rectangle that matches the shape of the notification
self.notificationView = [[UIView alloc] init];
self.notificationView.backgroundColor = [UIColor clearColor]
self.notificationView.cornerRadius = 20;
//Make and outer edge glow for the final effect
self.notificationView.shadowColor = [UIColor greenColor].CGColor;
self.notificationView.shadowOpacity = 0.7;
self.notificationView.shadowRadius = 10;
self.notificationView.shadowOffset = CGSizeZero;
[self.view insertSubview:self.notificationView atIndex:0];
}
%end```
time to make it more complex
the QuartzCore import is unncessary btw
nowadays
it was integrated into UIKit iirc
oh okay
remove it and you'll see
Contribute to JWIMaster/NotificationGlow2.0 development by creating an account on GitHub.
new repo
how do i make it compile for rootless by default
instead of manually specifying via the command line each time i build
add THEOS_PACKAGE_SCHEME=rootless to the makefile
anywhere
but I would personally not do this, it goes against conventions
got it
but if it's easier then sure you can
i'm not gonna be compiling for rootful either way
not at this stage at least
i have no rootful devices to test on
i'd only compile for rootful once i have a big enough tweak that i'm happy publishing to my own repo
I see
i got it to work on wsl btw
you need to add a mount command to your wsl file
ill send it in a sec in case anyone else needs it
[automount]
options="metadata"
go to the root directory and add it via sudo nano /etc/wsl.conf
you need to use sudo or it won't save properly
you can add export THEOS_PACKAGE_SCHEME=rootless to your bashrc
what am i doing wrong then
show the error
^
Tweak.x:28:24: error: property 'shadowOpacity' not found on object of type 'UIView *'
self.notificationView.shadowOpacity = 0.7;
^
Tweak.x:29:24: error: property 'shadowRadius' not found on object of type 'UIView *'
self.notificationView.shadowRadius = 10;
^
Tweak.x:30:24: error: property 'shadowOffset' not found on object of type 'UIView *'
self.notificationView.shadowOffset = CGSizeZero;
i have nearly identical code
self.notificationView.layer.
Never said it was any good 👍
huh im missing a ";" somwhere
i cant see it though
if only VSCode could actually show me

Error logs in the terminal should tell it
so only core animation layers can have those properties applied?
also yeah i didnt need quartzcore
cripes chatgpt says grabbing the colour is very hard
- (UIColor *)mostProminentColorOfImage:(UIImage *)image {
// Resize the image to reduce processing time
CGSize newSize = CGSizeMake(40, 40); // Small size for faster processing
UIGraphicsBeginImageContextWithOptions(newSize, YES, 0);
[image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)];
UIImage *resizedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
CGImageRef cgImage = resizedImage.CGImage;
CFDataRef imageData = CGDataProviderCopyData(CGImageGetDataProvider(cgImage));
const UInt8 *pixels = CFDataGetBytePtr(imageData);
NSMutableDictionary<NSString *, NSNumber *> *colourCounts = [NSMutableDictionary dictionary];
for (int x = 0; x < newSize.width; x++) {
for (int y = 0; y < newSize.height; y++) {
int pixelIndex = ((newSize.width * y) + x) * 4;
int red = pixels[pixelIndex];
int green = pixels[pixelIndex + 1];
int blue = pixels[pixelIndex + 2];
int alpha = pixels[pixelIndex + 3];
// Ignore transparent pixels
if (alpha < 128) continue;
NSString *key = [NSString stringWithFormat:@"%d,%d,%d", red, green, blue];
NSNumber *count = [colourCounts objectForKey:key];
if (count) {
colourCounts[key] = @(count.integerValue + 1);
} else {
colourCounts[key] = @1;
}
}
}
CFRelease(imageData);
// Find the most common colour
NSString *mostCommonKey = nil;
NSInteger highestCount = 0;
for (NSString *key in colourCounts) {
NSInteger count = colourCounts[key].integerValue;
if (count > highestCount) {
highestCount = count;
mostCommonKey = key;
}
}
if (mostCommonKey) {
NSArray<NSString *> *components = [mostCommonKey componentsSeparatedByString:@","];
UIColor *prominentColor = [UIColor colorWithRed:[components[0] intValue] / 255.0
green:[components[1] intValue] / 255.0
blue:[components[2] intValue] / 255.0
alpha:1.0];
return prominentColor;
}
return nil;
}
i have no idea what most of this means
does it work for any UIImage
yes
k lemme see
hmm
seems a bit off
wallet is the worst offender
how did it grab orange 😭
well its the average color
hmmm
not the dominant color
i dont understand your code yet
but ima try and learn
i assume the app icon is grabbed from a different place for notifications

abcdefg
nothing about a uiimage
okay
moving on
chatgpt gave me this
%hook NCNotificationListCell
- (void)layoutSubviews {
%orig;
// Attempt to directly access the image view if it's a private property
UIImageView *iconImageView = [self valueForKey:@"_iconImageView"]; // May not exist, depending on iOS version
if (!iconImageView) {
// If the direct access fails, search the subviews for an UIImageView
for (UIView *subview in self.subviews) {
if ([subview isKindOfClass:[UIImageView class]]) {
iconImageView = (UIImageView *)subview;
break;
}
}
}
if (iconImageView && [iconImageView isKindOfClass:[UIImageView class]]) {
UIImage *iconImage = iconImageView.image;
if (iconImage) {
UIColor *prominentColor = [self mostProminentColorOfImage:iconImage];
NSLog(@"Most Prominent Colour: %@", prominentColor);
}
}
}
%end
Headers don’t contain objc types
They all just say id
well i have no idea what any of this codes means lmaoo
i probably have to start learning more objc
@import UIKit;
@import QuartzCore;
@interface NCNotificationViewController : UIViewController
@property (nonatomic, strong) UIView *notificationView;
@end
static BOOL enableGlow;
//Create a preference file that contains a BOOL value from the on/off switch
static void preferencesChanged() {
NSUserDefaults *prefs = [[NSUserDefaults alloc] initWithSuiteName:@"com.jwi.NotificationGlow2Prefs"];
enableGlow = [prefs objectForKey:@"enableGlow"] ? [prefs boolForKey:@"enableGlow"] : YES;
}
//Constantly check if any preference has changed
%ctor {
preferencesChanged();
}
//Main Hook
%hook NCNotificationViewController
%property (nonatomic, strong) UIView *notificationView;
//Obtain notification dimensions
-(void)viewDidLayoutSubviews {
%orig;
self.notificationView.frame = self.view.bounds;
}
//Inject glow behind each notification
-(void)viewDidLoad {
%orig;
if (!enableGlow) {
return;
}
//Create a rectangle that matches the shape of the notification
self.notificationView = [[UIView alloc] init];
self.notificationView.backgroundColor = [UIColor clearColor];
self.notificationView.layer.cornerRadius = 20;
//Make and outer edge glow for the final effect
self.notificationView.layer.shadowColor = [UIColor greenColor].CGColor;
self.notificationView.layer.shadowOpacity = 0.7;
self.notificationView.layer.shadowRadius = 10;
self.notificationView.layer.shadowOffset = CGSizeZero;
[self.view insertSubview:self.notificationView atIndex:0];
}
%end
got the pref code working again
havent done the respring stuff yet but
ima see if i can understand your notif code
i seem to be getting a better hang of this
it wont wok
bruh
lemme try without prefs
huh
nothing
nvm i fixed it
didnt read all the messages but if you need average color of app icon function this is pretty good (or so i remember)
i ended up getting the offsets from https://github.com/Lrdsnow/kfd_offsets but same thing happens
Offsets for KFD. Contribute to Lrdsnow/kfd_offsets development by creating an account on GitHub.
wher can i get a rootless version of flexing
What do the panic logs say
if you trust you can use this :p
i'm not sure how to install a dylib manually
oh sorry, i dont have a deb package (you can use the dylib via tools like trollfools or opainject, or create a deb package from it but idrk how to do it)
neteskos >
so
so how do you use it
you hold on the screen with 3 fingers
theres this thing called a README



