Skip to content

Commit

Permalink
Feat: Add logging throughout tweak
Browse files Browse the repository at this point in the history
FIx: Add mising log functions
  • Loading branch information
SoCuul committed Mar 9, 2024
1 parent 526d65a commit 8bc2251
Show file tree
Hide file tree
Showing 19 changed files with 142 additions and 8 deletions.
10 changes: 7 additions & 3 deletions src/Controllers/SecurityViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,25 @@ - (void)authenticateButtonTapped:(id)sender {
- (void)authenticate {
LAContext *context = [[LAContext alloc] init];
NSError *error = nil;


NSLog(@"[BHInsta] Padlock authentication: Prompting for unlock");

if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthentication error:&error]) {
NSString *reason = @"Authenticate to unlock app";

[context evaluatePolicy:LAPolicyDeviceOwnerAuthentication localizedReason:reason reply:^(BOOL success, NSError *authenticationError) {
dispatch_async(dispatch_get_main_queue(), ^{
if (success) {
[self dismissViewControllerAnimated:YES completion:nil];

NSLog(@"[BHInsta] Padlock authentication: Unlock success");
} else {
// error
NSLog(@"[BHInsta] Padlock authentication: Unlock failed");
}
});
}];
} else {
// No biometric auth
NSLog(@"[BHInsta] Padlock authentication: Device authentication not available");
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/Controllers/SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@ - (BOOL)shouldHideSpecifier:(PSSpecifier *)specifier {
- (void)setPreferenceValue:(id)value specifier:(PSSpecifier *)specifier {
NSUserDefaults *Prefs = [NSUserDefaults standardUserDefaults];
[Prefs setValue:value forKey:[specifier identifier]];

NSLog(@"[BHInsta] Set user default. Key: %@ | Value: %@", [specifier identifier], value);

if (self.hasDynamicSpecifiers) {
NSString *specifierID = [specifier propertyForKey:PSIDKey];
Expand All @@ -280,8 +282,12 @@ - (id)readPreferenceValue:(PSSpecifier *)specifier {
- (void)FLEXAction:(UISwitch *)sender {
if (sender.isOn) {
[[objc_getClass("FLEXManager") sharedManager] showExplorer];

NSLog(@"[BHInsta] FLEX explorer: Enabled");
} else {
[[objc_getClass("FLEXManager") sharedManager] hideExplorer];

NSLog(@"[BHInsta] FLEX explorer: Disabled");
}
}
@end
Expand Down
4 changes: 4 additions & 0 deletions src/Features/Confirm/CallConfirm.x
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Voice Call
- (void)_didTapAudioButton:(id)arg1 {
if ([BHIManager callConfirmation]) {
NSLog(@"[BHInsta] Call confirm triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
Expand All @@ -14,6 +16,8 @@
// Video Call
- (void)_didTapVideoButton:(id)arg1 {
if ([BHIManager callConfirmation]) {
NSLog(@"[BHInsta] Call confirm triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
Expand Down
2 changes: 2 additions & 0 deletions src/Features/Confirm/DMAudioMsgConfirm.x
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
%hook IGDirectThreadViewController
- (void)voiceRecordViewController:(id)arg1 didRecordAudioClipWithURL:(id)arg2 waveform:(id)arg3 duration:(CGFloat)arg4 entryPoint:(NSInteger)arg5 {
if ([BHIManager voiceMessageConfirmation]) {
NSLog(@"[BHInsta] DM audio message confirm triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
Expand Down
14 changes: 14 additions & 0 deletions src/Features/Confirm/FollowConfirm.x
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
%hook IGFollowController
- (void)_didPressFollowButton {
if ([BHIManager followConfirmation]) {
NSLog(@"[BHInsta] Confirm follow triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
Expand All @@ -16,13 +18,17 @@
%hook IGDiscoverPeopleButtonGroupView
- (void)_onFollowButtonTapped:(id)arg1 {
if ([BHIManager followConfirmation]) {
NSLog(@"[BHInsta] Confirm follow triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
}
}
- (void)_onFollowingButtonTapped:(id)arg1 {
if ([BHIManager followConfirmation]) {
NSLog(@"[BHInsta] Confirm follow triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
Expand All @@ -34,6 +40,8 @@
%hook IGHScrollAYMFCell
- (void)_didTapAYMFActionButton {
if ([BHIManager followConfirmation]) {
NSLog(@"[BHInsta] Confirm follow triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
Expand All @@ -43,6 +51,8 @@
%hook IGHScrollAYMFActionButton
- (void)_didTapTextActionButton {
if ([BHIManager followConfirmation]) {
NSLog(@"[BHInsta] Confirm follow triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
Expand All @@ -54,6 +64,8 @@
%hook IGUnifiedVideoFollowButton
- (void)_hackilyHandleOurOwnButtonTaps:(id)arg1 {
if ([BHIManager followConfirmation]) {
NSLog(@"[BHInsta] Confirm follow triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
Expand All @@ -65,6 +77,8 @@
%hook IGProfileViewController
- (void)navigationItemsControllerDidTapHeaderFollowButton:(id)arg1 {
if ([BHIManager followConfirmation]) {
NSLog(@"[BHInsta] Confirm follow triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
Expand Down
30 changes: 30 additions & 0 deletions src/Features/Confirm/LikeConfirm.x
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
%hook IGUFIButtonBarView
- (void)_onLikeButtonPressed:(id)arg1 {
if ([BHIManager postLikeConfirmation]) {
NSLog(@"[BHInsta] Confirm post like triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
Expand All @@ -14,6 +16,8 @@
%hook IGFeedPhotoView
- (void)_onDoubleTap:(id)arg1 {
if ([BHIManager postLikeConfirmation]) {
NSLog(@"[BHInsta] Confirm post like triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
Expand All @@ -23,6 +27,8 @@
%hook IGVideoPlayerOverlayContainerView
- (void)_handleDoubleTapGesture:(id)arg1 {
if ([BHIManager postLikeConfirmation]) {
NSLog(@"[BHInsta] Confirm post like triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
Expand All @@ -34,27 +40,35 @@
%hook IGSundialViewerVideoCell
- (void)controlsOverlayControllerDidTapLikeButton:(id)arg1 {
if ([BHIManager reelsLikeConfirmation]) {
NSLog(@"[BHInsta] Confirm reels like triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
}
}
- (void)controlsOverlayControllerDidLongPressLikeButton:(id)arg1 gestureRecognizer:(id)arg2 {
if ([BHIManager reelsLikeConfirmation]) {
NSLog(@"[BHInsta] Confirm reels like triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
}
}
- (void)controlsOverlayControllerDidTapLikedBySocialContextButton:(id)arg1 button:(id)arg2 {
if ([BHIManager reelsLikeConfirmation]) {
NSLog(@"[BHInsta] Confirm reels like triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
}
}
- (void)gestureController:(id)arg1 didObserveDoubleTap:(id)arg2 {
if ([BHIManager reelsLikeConfirmation]) {
NSLog(@"[BHInsta] Confirm reels like triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
Expand All @@ -66,34 +80,44 @@
%hook IGCommentCellController
- (void)commentCell:(id)arg1 didTapLikeButton:(id)arg2 {
if ([BHIManager postLikeConfirmation]) {
NSLog(@"[BHInsta] Confirm post like triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
}
}
- (void)commentCell:(id)arg1 didTapLikedByButtonForUser:(id)arg2 {
if ([BHIManager postLikeConfirmation]) {
NSLog(@"[BHInsta] Confirm post like triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
}
}
- (void)commentCellDidLongPressOnLikeButton:(id)arg1 {
if ([BHIManager postLikeConfirmation]) {
NSLog(@"[BHInsta] Confirm post like triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
}
}
- (void)commentCellDidEndLongPressOnLikeButton:(id)arg1 {
if ([BHIManager postLikeConfirmation]) {
NSLog(@"[BHInsta] Confirm post like triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
}
}
- (void)commentCellDidDoubleTap:(id)arg1 {
if ([BHIManager postLikeConfirmation]) {
NSLog(@"[BHInsta] Confirm post like triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
Expand All @@ -105,13 +129,17 @@
%hook IGStoryFullscreenDefaultFooterView
- (void)_likeTapped {
if ([BHIManager postLikeConfirmation]) {
NSLog(@"[BHInsta] Confirm post like triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
}
}
- (void)inputView:(id)arg1 didTapLikeButton:(id)arg2 {
if ([BHIManager postLikeConfirmation]) {
NSLog(@"[BHInsta] Confirm post like triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
Expand All @@ -123,6 +151,8 @@
%hook IGDirectThreadViewController
- (void)_didTapLikeButton {
if ([BHIManager postLikeConfirmation]) {
NSLog(@"[BHInsta] Confirm post like triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
Expand Down
2 changes: 2 additions & 0 deletions src/Features/Confirm/PostCommentConfirm.x
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
%hook IGCommentComposingController
- (void)_onSendButtonTapped:(id)arg1 {
if ([BHIManager postCommentConfirmation]) {
NSLog(@"[BHInsta] Confirm post comment triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
Expand Down
2 changes: 2 additions & 0 deletions src/Features/Confirm/StickerInteractConfirm.x
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
%hook IGStoryViewerTapTarget
- (void)_didTap:(id)arg1 forEvent:(id)arg2 {
if ([BHIManager stickerInteractConfirmation]) {
NSLog(@"[BHInsta] Confirm sticker interact triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
Expand Down
2 changes: 2 additions & 0 deletions src/Features/Feed/HideSuggestedForYou.x
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
%hook IGHScrollAYMFSectionController
- (id)initWithUserSession:(id)arg1 sessionId:(id)arg2 analyticsModule:(id)arg3 format:(NSInteger)arg4 netEgoItemType:(NSUInteger)arg5 netegoImpressionStrategy:(id)arg6 isForcedDarkModeImmersive:(BOOL)arg7 {
if ([BHIManager removeSuggestedAccounts]) {
NSLog(@"[BHInsta] Hiding suggested for you");

return nil;
}
return %orig;
Expand Down
2 changes: 2 additions & 0 deletions src/Features/Feed/HideSuggestedReels.x
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
%hook IGMainFeedStoryTrayActionDelegate
- (id)initWithMainFeedContext:(id)arg1 {
if ([BHIManager removeSuggestedReels]) {
NSLog(@"[BHInsta] Hiding suggested reels");

return nil;
}
return %orig;
Expand Down
2 changes: 2 additions & 0 deletions src/Features/Feed/HideThreads.x
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
%hook BKBloksViewHelper
- (id)initWithObjectSet:(id)arg1 bloksData:(id)arg2 delegate:(id)arg3 {
if ([BHIManager removeSuggestedThreads]) {
NSLog(@"[BHInsta] Hiding threads posts");

return nil;
}
return %orig;
Expand Down
2 changes: 2 additions & 0 deletions src/Features/General/CopyDescription.x
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

%new - (void)handleLongPress:(UILongPressGestureRecognizer *)sender {
if (sender.state == UIGestureRecognizerStateBegan) {
NSLog(@"[BHInsta] Copying description");

// Copy text to system clipboard
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
pasteboard.string = self.text;
Expand Down
2 changes: 2 additions & 0 deletions src/Features/General/HideExploreGrid.x
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
%hook IGExploreGridViewController
- (id)view {
if ([BHIManager hideExploreGrid]) {
NSLog(@"[BHInsta] Hiding explore grid");

return nil;
}

Expand Down
2 changes: 2 additions & 0 deletions src/Features/General/HideTrendingSearches.x
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
%hook IGDSSegmentedPillControl
+ (id)newWithStyle:(id)arg1 {
if ([BHIManager hideTrendingSearches]) {
NSLog(@"[BHInsta] Hiding trending searches");

return nil;
}

Expand Down
4 changes: 4 additions & 0 deletions src/Features/General/NoRecentSearches.x
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
%hook IGRecentSearchStore
- (BOOL)addItem:(id)arg1 {
if ([BHIManager noRecentSearches]) {
NSLog(@"[BHInsta] Disabling recent searches");

return nil;
} else {
return %orig;
Expand All @@ -16,6 +18,8 @@
%hook IGDirectRecipientRecentSearchStorage
- (id)initWithDiskManager:(id)arg1 directCache:(id)arg2 userStore:(id)arg3 currentUser:(id)arg4 featureSets:(id)arg5 {
if ([BHIManager noRecentSearches]) {
NSLog(@"[BHInsta] Disabling recent searches");

return nil;
} else {
return %orig;
Expand Down
Loading

0 comments on commit 8bc2251

Please sign in to comment.