Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/build-rootless-deb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build rootless DEB

on:
push:
workflow_dispatch:

jobs:
build:
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- uses: waruhachi/theos-action@v2.4.6
with:
theos-src: 'theos/theos'
theos-branch: 'master'
sdks-src: 'theos/sdks'
sdks-branch: 'master'
libgcuniversal: true
libgcuniversal-src: 'MrGcGamer/LibGcUniversalDocumentation'
libgcuniversal-branch: 'master'
altlist: true
altlist-src: 'opa334/AltList'
altlist-branch: 'main'

- name: Build rootless package
run: make clean package FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless

- name: Upload DEB artifacts
uses: actions/upload-artifact@v4
with:
name: flexing-rootless-debs
path: |
packages/*.deb
if-no-files-found: error
41 changes: 41 additions & 0 deletions Tweak.xm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
BOOL initialized = NO;
id manager = nil;
SEL show = nil;
BOOL didAutoShowExplorer = NO;

static NSHashTable *windowsWithGestures = nil;

Expand Down Expand Up @@ -51,6 +52,36 @@ inline BOOL flexAlreadyLoaded() {
return NSClassFromString(@"FLEXExplorerToolbar") != nil;
}

inline BOOL isSpringBoardProcess() {
return [NSBundle.mainBundle.bundleIdentifier isEqualToString:@"com.apple.springboard"];
}

inline void enableNetworkMonitoringIfPossible() {
if (!manager) {
return;
}

// FLEX exposes this as the setter for the `networkDebuggingEnabled` property
// (from FLEXManager+Networking), but keep a fallback for older/variant builds.
SEL selectors[] = {
@selector(setNetworkDebuggingEnabled:),
NSSelectorFromString(@"enableNetworkDebugging")
};

for (NSUInteger i = 0; i < sizeof(selectors) / sizeof(SEL); i++) {
SEL selector = selectors[i];
if ([manager respondsToSelector:selector]) {
if (selector == @selector(setNetworkDebuggingEnabled:)) {
((void (*)(id, SEL, BOOL))[manager methodForSelector:selector])(manager, selector, YES);
} else {
((void (*)(id, SEL))[manager methodForSelector:selector])(manager, selector);
}
HBLogInfo(@"FLEXing: Enabled network monitoring via %@", NSStringFromSelector(selector));
break;
}
}
}

%ctor {
#if TARGET_OS_SIMULATOR
NSString *standardPath = realPath(@"/Library/MobileSubstrate/DynamicLibraries/libFLEX.dylib");
Expand Down Expand Up @@ -111,6 +142,7 @@ inline BOOL flexAlreadyLoaded() {
if (FLXGetManager && FLXRevealSEL) {
manager = FLXGetManager();
show = FLXRevealSEL();
enableNetworkMonitoringIfPossible();

windowsWithGestures = [NSHashTable weakObjectsHashTable];
initialized = YES;
Expand All @@ -133,6 +165,15 @@ inline BOOL flexAlreadyLoaded() {
BOOL needsGesture = ![windowsWithGestures containsObject:self];
BOOL isFLEXWindow = [self isKindOfClass:FLXWindowClass()];
BOOL isStatusBar = [self isKindOfClass:[UIStatusBarWindow class]];
BOOL shouldAutoShow = !didAutoShowExplorer && !isSpringBoardProcess();

if (shouldAutoShow && !isFLEXWindow && manager && show) {
didAutoShowExplorer = YES;
dispatch_async(dispatch_get_main_queue(), ^{
[manager performSelector:show];
});
}

if (needsGesture && !isFLEXWindow && !isStatusBar) {
[windowsWithGestures addObject:self];

Expand Down
6 changes: 3 additions & 3 deletions control
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Package: com.pantsthief.flexing
Package: com.github.devnoname120.flexing
Name: FLEXing
Pre-Depends: firmware (>= 8.0)
Version: 1.5.1
Version: 1.5.2
Architecture: iphoneos-arm
Description: Open FLEX anywhere!
Maintainer: Tanner Bennett <thepantsthief@me.com>
Author: Tanner Bennett <thepantsthief@me.com>
Section: Tweaks
Conflicts: com.dgh0st.flexall, gg.gh0stbyte.flexivator, com.shmoopillic.flexible, applebetas.ios.tweak.devtools.flexgesture, com.creaturecoding.flexer, com.lacertosusrepo.flex4me, me.nepeta.flexxx, com.ipadkid.flexit, com.qiop1379.flexbar, com.leftyfl1p.reflex
Conflicts: com.dgh0st.flexall, gg.gh0stbyte.flexivator, com.shmoopillic.flexible, applebetas.ios.tweak.devtools.flexgesture, com.creaturecoding.flexer, com.lacertosusrepo.flex4me, me.nepeta.flexxx, com.ipadkid.flexit, com.qiop1379.flexbar, com.leftyfl1p.reflex, com.pantsthief.flexing
Depiction: https://nscake.github.io/package.html?package=com.pantsthief.flexing
SileoDepiction: https://nscake.github.io/depictions/com.pantsthief.flexing.sileo.json