Skip to content

Releases: NicholasBly/RedditFilter

1.2.0

17 Feb 20:00
a16409c

Choose a tag to compare

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

14 Feb 04:24
d8edee9

Choose a tag to compare

Quick Summary

Significantly faster page loading/switching: performance/CPU/battery optimizations

  1. 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)
  1. Filtering loop optimizations
  2. Fix Reddit Filter settings menu not showing in Reddit settings
  3. 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 filterNode method. 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 NSArray to a static NSSet (ignoredOperationsSet). The set is initialized exactly once during the tweak's %ctor lifecycle, reducing memory allocation overhead and providing instant lookup times during network callbacks.
  • Preference Caching (Structs): Eliminated the severe bottleneck of querying NSUserDefaults.standardUserDefaults repeatedly inside the filterNode loop. Preferences are now fetched exactly once per network request, stored in a lightweight RedditFilterPrefs C-struct, and passed securely down the filtering chain.
  • Optimized Node Traversal: Refactored the filterNode function to utilize an else if chain for __typename evaluation. 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.class validation before evaluating the __typename of 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!)