Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
0559dd2
Add logging for interesting paths in JSON response
NicholasBly Feb 14, 2026
f3cb39c
Add schema paths for filtering + fallback
NicholasBly Feb 14, 2026
90b1285
Add logging for fast path in Reddit filters
NicholasBly Feb 14, 2026
04e2605
Add validation logging for fast path operations
NicholasBly Feb 14, 2026
2572bc4
Remove logging function and optimize ignored operations
NicholasBly Feb 14, 2026
6dfbcdd
Refactor filterNode and other optimizations
NicholasBly Feb 14, 2026
57cb819
Update filterNode calls to include prefs parameter
NicholasBly Feb 14, 2026
724d742
Refactor image and string caching logic
NicholasBly Feb 16, 2026
15915ba
Update PACKAGE_VERSION to 1.2.0
NicholasBly Feb 16, 2026
ab0c9ca
Revert change causing crash
NicholasBly Feb 16, 2026
e6c9018
Modify Makefile for dynamic target selection
NicholasBly Feb 16, 2026
7feea05
Enhance build workflow for modern arm64e support
NicholasBly Feb 16, 2026
21f4128
Hide cells instead of stripping them out
NicholasBly Feb 16, 2026
58fb2c3
Update Tweak.xm
NicholasBly Feb 16, 2026
836459f
Revert makefile
NicholasBly Feb 16, 2026
d32b64e
Revert build
NicholasBly Feb 16, 2026
f17032f
Hide logic v3
NicholasBly Feb 16, 2026
f580823
Revert backwards iteration filtering
NicholasBly Feb 17, 2026
1956412
Refactor FeedFilterSettingsViewController for safety
NicholasBly Feb 20, 2026
17a9291
Enhance error handling in Tweak.xm
NicholasBly Feb 20, 2026
ade442d
Update target version and package version in Makefile
NicholasBly Feb 20, 2026
815a9cc
Update build.yml
NicholasBly Apr 20, 2026
62e4126
Fix body field in build.yml for release action
NicholasBly Apr 27, 2026
8900a07
Refactor author info and ad filtering logic
NicholasBly Jun 9, 2026
165a4c2
Bump package version to 1.2.2
NicholasBly Jun 9, 2026
6c893f1
Add files via upload
NicholasBly Jun 18, 2026
56b9be5
Add files via upload
NicholasBly Jun 18, 2026
f6c02c2
Add files via upload
NicholasBly Jun 18, 2026
77c6794
Update Makefile
NicholasBly Jun 18, 2026
206012f
Add files via upload
NicholasBly Jun 19, 2026
ac4d061
Update Resources
NicholasBly Jun 19, 2026
b97a197
Update DebugMenu.x
NicholasBly Jun 19, 2026
93cd2f5
Add files via upload
NicholasBly Jun 19, 2026
403c816
Add files via upload
NicholasBly Jun 19, 2026
5823710
Refactor PostInfoById handling for comment trees
NicholasBly Jun 19, 2026
a0465d5
Configure debug flags for main and other branches
NicholasBly Jun 19, 2026
7c90289
Merge branch 'master' into test
NicholasBly Jun 19, 2026
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
24 changes: 24 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,17 @@ jobs:
cache-dir-theos: ${{ github.workspace }}/theos
cache-dir-sdks: ${{ github.workspace }}/theos/sdks

- name: Set Debug Variables
id: debug_vars
run: |
if [ "${{ github.ref_name }}" == "main" ]; then
echo "Building on main: Debug Menu OFF"
echo "cflags=-DREDDITFILTER_DEBUG=0" >> $GITHUB_OUTPUT
else
echo "Building on ${{ github.ref_name }}: Debug Menu ON"
echo "cflags=-DREDDITFILTER_DEBUG=1" >> $GITHUB_OUTPUT
fi

- name: Checkout theos-jailed
if: ${{ inputs.create_release }}
uses: actions/checkout@v4
Expand All @@ -96,11 +107,13 @@ jobs:
env:
FINALPACKAGE: ${{ inputs.create_release }}
THEOS_PACKAGE_SCHEME: rootless
ADDITIONAL_CFLAGS: ${{ steps.debug_vars.outputs.cflags }}

- name: Build rootful deb
run: make clean package
env:
FINALPACKAGE: ${{ inputs.create_release }}
ADDITIONAL_CFLAGS: ${{ steps.debug_vars.outputs.cflags }}

- name: Build IPA
if: ${{ inputs.create_release }}
Expand All @@ -110,6 +123,17 @@ jobs:
SIDELOADED: 1
IPA: ${{ github.workspace }}/App.ipa
APP_VERSION: ${{ steps.ipa_info.outputs.version }}
ADDITIONAL_CFLAGS: ${{ steps.debug_vars.outputs.cflags }}

- name: Append Debug Suffix to IPA
if: ${{ inputs.create_release && github.ref_name != 'main' }}
run: |
for file in packages/*.ipa; do
if [ -f "$file" ]; then
mv "$file" "${file%.ipa}_debug.ipa"
echo "Renamed to ${file%.ipa}_debug.ipa"
fi
done

- name: Hash release files
id: hash_files
Expand Down
89 changes: 89 additions & 0 deletions DebugMenu.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
// DebugMenu.h
//
// Lightweight, self-contained instrumentation for the GraphQL "schema paths"
// used by RedditFilter's NSURLSession hook.
//
// Reddit periodically renames pieces of its GraphQL schema (e.g. `homeV3` ->
// `homeV4`). When that happens the hardcoded key paths in Tweak.xm silently
// stop resolving and filtering breaks with no visible signal. This tracker:
//
// * records, per operation, whether the hardcoded fast-path resolved (hit)
// or returned nil (miss),
// * on the first miss, walks the live response to auto-discover where the
// data moved to, and
// * surfaces all of that in a debug section of the RedditFilter menu so the
// corrected path can be copied straight out of the app.
//
// EVERYTHING here is gated behind REDDITFILTER_DEBUG. Set it to 0 (or define it
// to 0 via the build) for a release build and the tracker, the recording call
// sites, and the debug menu all compile away to nothing.

#import <Foundation/Foundation.h> // Move this to the top!

#ifndef REDDITFILTER_DEBUG
// 1 on the test branch. Flip to 0 (or pass -DREDDITFILTER_DEBUG=0) for release.
#define REDDITFILTER_DEBUG 1
#endif

// Identifies the *shape* of the data that is expected at a given schema path so
// that, on a miss, discovery knows what it is looking for. These constants are
// always defined (they are cheap and only ever appear as dropped macro
// arguments in a release build), which keeps the call sites in Tweak.xm
// identical regardless of the flag.
typedef NS_ENUM(NSInteger, RFSchemaSig) {
RFSchemaSigEdges = 0, // an array of `{ node: {...} }` (home / popular feeds)
RFSchemaSigTrees, // an array of comment-forest trees: `{ node: {...} }`
RFSchemaSigNodeArray, // an array of post nodes, each with a `__typename`
RFSchemaSigCommentsAds, // an array of comment ads (often empty)
};

#if REDDITFILTER_DEBUG

// Keys used in the dictionaries returned by -snapshot.
extern NSString *const kRFDebugOp; // NSString operation name
extern NSString *const kRFDebugExpected; // NSString hardcoded schema path
extern NSString *const kRFDebugHits; // NSNumber times the path resolved
extern NSString *const kRFDebugMisses; // NSNumber times the path was nil
extern NSString *const kRFDebugDiscovered; // NSString auto-found path (or absent)
extern NSString *const kRFDebugLastResolved; // NSNumber BOOL, last probe outcome
extern NSString *const kRFDebugSeen; // NSNumber BOOL, any traffic observed
extern NSString *const kRFDebugFailedJSON; // NSString captured JSON on failure

@interface RFSchemaDebug : NSObject

+ (instancetype)shared;

// Called from the network hook for every probed operation. Thread-safe.
// `resolved` is the result of testing the hardcoded path against `json`.
// On the first miss for an operation, `json` and `signature` are used to try
// to locate where the data moved to.
- (void)recordOperation:(NSString *)operation
expectedPath:(NSString *)expectedPath
resolved:(BOOL)resolved
json:(id)json
signature:(RFSchemaSig)signature;

// Ordered, immutable view of the current stats for the menu (seed order first,
// then any operations discovered at runtime). Thread-safe.
- (NSArray<NSDictionary *> *)snapshot;

// Zero all counters and clear discovered paths (re-arm the probes).
- (void)reset;

@end

// Recording macro used at the call sites. In a release build it expands to a
// no-op and, because none of its parameters appear in the replacement text,
// the arguments (including any block/enum tokens) are discarded entirely.
#define RF_RECORD_SCHEMA(op, expected, resolved, json, sig) \
[[RFSchemaDebug shared] recordOperation:(op) \
expectedPath:(expected) \
resolved:(resolved) \
json:(json) \
signature:(sig)]

#else // !REDDITFILTER_DEBUG

#define RF_RECORD_SCHEMA(op, expected, resolved, json, sig) ((void)0)

#endif // REDDITFILTER_DEBUG
Loading
Loading