Skip to content

Commit

Permalink
feat: block firebase logging, app-measurement, sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
asdfzxcvbn committed Sep 30, 2023
1 parent 1e2fb32 commit 6f94918
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ blocks network requests to the following endpoints:
- discord.com/api/v9/science
- discord.com/api/v9/metrics
- \*.sentry.io/\*
- \*.app-measurement.com/\*
- \*firebaselogging\*

you can get the deb/dylib on [the latest release's page](https://github.com/asdfzxcvbn/DiscordNoTrack/releases/tag/v1.0.0).
22 changes: 19 additions & 3 deletions Tweak.xm
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
#import <Foundation/Foundation.h>
NSURLRequest *blocked = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://0.0.0.0/"]];

// main discord endpoints
%hook RCTHTTPRequestHandler
- (id)sendRequest:(NSURLRequest *)request withDelegate:(id)delegate {
if ([request.URL.absoluteString containsString:@"/api/v9/science"] || [request.URL.absoluteString containsString:@"/api/v9/metrics"]) { return %orig(blocked, delegate); }
return %orig(request, delegate);
}
%end

// firebase logging
%hook NSURLSession
- (id)dataTaskWithRequest:(NSURLRequest *)request completionHandler:(id)handler {
if ([request.URL.absoluteString containsString:@"sentry.io"]) { return %orig(blocked, handler); }
return %orig(request, handler);
- (id)uploadTaskWithRequest:(NSURLRequest *)request fromData:(id)data completionHandler:(id)handler {
if ([request.URL.absoluteString containsString:@"firebaselogging"]) { return %orig(blocked, data, handler); }
return %orig(request, data, handler);
}
%end

// sentry
%hook SentrySDK
+ (BOOL)isEnabled { return NO; }
%end

%hook SentryOptions
- (BOOL)enabled { return NO; }
%end

// app-measurement
%hook APMMeasurement
- (BOOL)isEnabled { return NO; }
%end
4 changes: 2 additions & 2 deletions control
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: fyi.zxcvbn.discordnotrack
Name: DiscordNoTrack
Version: 1.0.0
Version: 2.0.0
Architecture: iphoneos-arm
Description: blocks discord's requests to most telemetry endpoints
Description: blocks discord's requests to most (if not all) telemetry endpoints
Author: zxcvbn
Maintainer: zxcvbn
Section: Tweaks
Expand Down

0 comments on commit 6f94918

Please sign in to comment.