How to get the top visible window? [newbie question]

Hello everybody! I’m very new in dev for jailbreak, but exeprienced in iOS dev.
I’m trying to make a command line tool for iOS 16+, to find a frame of view by label on the screen or by Accessibility label, ok it’s easiest part of my idea:) My problem is to get the top visible window at the time.

I was trying the method _accessibilityFrontMostApplication,
but I can’t get the singleton of SpringBoard.
Does it even work on iOS16? or it doesn’t work on rootless jailbreak?

Could somebody explain the way how to get the top visible window? I’ll be appresiate for any help.

咋看出来的 (楼主可以去看看flex框架

一般只有外挂才会研究SpringBoard 绘制什么的 而且他估计想在巨魔环境下实现夸进程绘制把

巨魔官方有个网速显示的插件 现在很多外挂都是二改这个的

i have used that (not sure if it works on rootless):

NSString* getFrontMostWindow() {
return [[(SpringBoard *)[objc_getClass(“SpringBoard”) sharedApplication] _accessibilityFrontMostApplication] bundleIdentifier];
}