Releases: NicholasBly/RedditFilter
Releases · NicholasBly/RedditFilter
1.2.0
Stability Enhancement: Improved Objective-C runtime safety when fetching internal asset bundles, preventing potential crashes if iOS internal structures (CUICatalog) change
Bug Fix: Refactored associated object keys in UI constraints (ToggleImageTableViewCell) to use static memory addresses instead of selectors for best practices and eliminating the risk of runtime key collisions
1.1.9
Quick Summary
Significantly faster page loading/switching: performance/CPU/battery optimizations
- Implemented exact locations to each filter type to pinpoint filtering
- Only runs JSON filtering engine on these specific locations and ignores everything else
- Replaces recursive searching for all network requests and eliminates wasted searching (original fallback recursive search still implemented if exact location changes in the future)
- Filtering loop optimizations
- Fix Reddit Filter settings menu not showing in Reddit settings
- Other fixes/improvements
Architecture & Feature Updates
- Targeted GraphQL Schema Paths: Replaced the global recursive JSON traversal with precise Key-Value Coding (
valueForKeyPath:) for known Reddit feed structures. The tweak now instantly targets the exact data arrays for:
HomeFeedSdui(Home Feed)PopularFeedSdui(Popular/Recommended Feed)FeedPostDetailsByIds(Post Details)PostInfoById&PostInfoByIdComments(Comment Trees)PdpCommentsAds(End-of-thread Ad payloads)
- Adaptive Fallback Mechanism: Implemented a failsafe that seamlessly routes any unrecognized or newly introduced GraphQL operations back to the original recursive
filterNodemethod. This ensures the filter continues to work even if Reddit updates their API schemas. - Telemetry & Config Bypass: Implemented a strict "Ignore List" that completely bypasses JSON traversal for 35+ known telemetry, analytics, and account configuration operations (e.g.,
GetAccount,GetAllExperimentVariants,BadgeCounts). This prevents the tweak from wasting CPU cycles searching for ads in background telemetry.
Performance & Memory Optimizations
- O(1) Operation Lookup: Converted the Ignore List from a dynamically allocated
NSArrayto a staticNSSet(ignoredOperationsSet). The set is initialized exactly once during the tweak's%ctorlifecycle, reducing memory allocation overhead and providing instant lookup times during network callbacks. - Preference Caching (Structs): Eliminated the severe bottleneck of querying
NSUserDefaults.standardUserDefaultsrepeatedly inside thefilterNodeloop. Preferences are now fetched exactly once per network request, stored in a lightweightRedditFilterPrefsC-struct, and passed securely down the filtering chain. - Optimized Node Traversal: Refactored the
filterNodefunction to utilize anelse ifchain for__typenameevaluation. This prevents the CPU from executing redundant string comparisons once a matching node type is identified.
Stability & Safety
- Enhanced Type Safety: Added strict
isKindOfClass:NSString.classvalidation before evaluating the__typenameof a dictionary payload, preventing potential unrecognized selector crashes when encountering unexpected backend JSON data types.
Fixes
Fixed RedditFilter settings menu (now a RedditFilter link on the top right of the settings menu)
- Replaced the hook for the old AppSettingsViewController with a UIViewController hook that detects the new SwiftUI Settings page (RedditSliceKit)
Initialization: Fixed a copy-paste error in %ctor where default settings for Recommended, NSFW, and Awards were incorrectly checking the kRedditFilterPromoted key.
Fix: Include localizable strings in deb package - #2 (Thanks dwojc6!)