Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SCInsta
A feature-rich tweak for Instagram on iOS!\
`Version v1.1.1` | `Tested on Instagram 418.2.0`
`Version v1.2.0-dev` | `Tested on Instagram 418.2.0`

---

Expand Down Expand Up @@ -29,6 +29,7 @@ A feature-rich tweak for Instagram on iOS!\
- Use detailed (native) color picker
- Enable liquid glass buttons
- Enable teen app icons
- Disable app haptics
- IG Notes:
- Hide notes tray
- Hide friends map
Expand All @@ -39,6 +40,7 @@ A feature-rich tweak for Instagram on iOS!\
- No suggested chats
- Hide trending searches
- Hide explore posts grid
- Hide metrics

### Feed
- Hide stories tray
Expand Down Expand Up @@ -83,6 +85,7 @@ A feature-rich tweak for Instagram on iOS!\
- Hiding tabs
- Hide feed tab
- Hide explore tab
- Hide messages tab
- Hide reels tab
- Hide create tab

Expand Down
2 changes: 1 addition & 1 deletion control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: com.socuul.scinsta
Name: SCInsta
Version: 1.1.1
Version: 1.2.0
Architecture: iphoneos-arm
Description: A feature-rich tweak for Instagram on iOS!
Homepage: https://github.com/SoCuul/SCInsta
Expand Down
33 changes: 33 additions & 0 deletions src/Features/General/DisableHaptics.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#import "../../Utils.h"

%hook UIImpactFeedbackGenerator
- (void)impactOccurred {
if (![SCIUtils getBoolPref:@"disable_haptics"]) %orig;
}
- (void)impactOccurredWithIntensity:(CGFloat)intensity {
if (![SCIUtils getBoolPref:@"disable_haptics"]) %orig(intensity);
}
%end

%hook UINotificationFeedbackGenerator
- (void)notificationOccurred:(UINotificationFeedbackType)notificationType {
if (![SCIUtils getBoolPref:@"disable_haptics"]) %orig(notificationType);
}
%end

%hook UISelectionFeedbackGenerator
- (void)selectionChanged {
if (![SCIUtils getBoolPref:@"disable_haptics"]) %orig;
}
%end

%hook CHHapticEngine
- (BOOL)startAndReturnError:(NSError **)outError {
if (![SCIUtils getBoolPref:@"disable_haptics"]) {
return %orig(outError);
}
else {
return NO;
}
}
%end
65 changes: 55 additions & 10 deletions src/Features/General/HideMetaAI.xm
Original file line number Diff line number Diff line change
Expand Up @@ -135,22 +135,35 @@
// Write with meta ai in message composer
%hook IGDirectComposer
- (id)initWithLayoutSpecProvider:(id)arg1
userLauncherSetProviding:(id)arg2
userSession:(id)arg2
userLauncherSet:(id)arg3
config:(IGDirectComposerConfig *)config
style:(id)arg4
text:(id)arg5
style:(id)arg5
text:(id)arg6
{
return %orig(arg1, arg2, [self patchConfig:config], arg4, arg5);
return %orig(arg1, arg2, arg3, [self patchConfig:config], arg5, arg6);
}

- (id)initWithLayoutSpecProvider:(id)arg1
userLauncherSetProviding:(id)arg2
userSession:(id)arg2
userLauncherSet:(id)arg3
config:(IGDirectComposerConfig *)config
style:(id)arg4
text:(id)arg5
shouldUpdateModeLater:(BOOL)arg6
style:(id)arg5
text:(id)arg6
shouldUpdateModeLater:(BOOL)arg7
{
return %orig(arg1, arg2, [self patchConfig:config], arg4, arg5, arg6);
return %orig(arg1, arg2, arg3, [self patchConfig:config], arg5, arg6, arg7);
}

- (id)_initializeWithLayoutSpecProvider:(id)arg1
userSession:(id)arg2
userLauncherSet:(id)arg3
config:(IGDirectComposerConfig *)config
style:(id)arg5
text:(id)arg6
shouldUpdateModeLater:(BOOL)arg7
{
return %orig(arg1, arg2, arg3, [self patchConfig:config], arg5, arg6, arg7);
}

- (void)setConfig:(IGDirectComposerConfig *)config {
Expand Down Expand Up @@ -178,6 +191,20 @@
}
%end

// Demangled name: IGAIRewrite.IGAIRewriteStoryRepliesPresenter
%hook _TtC11IGAIRewrite32IGAIRewriteStoryRepliesPresenter
- (BOOL)shouldShowAIRewriteButton:(id)arg1 input:(id)arg2 {
if ([SCIUtils getBoolPref:@"hide_meta_ai"]) {
NSLog(@"[SCInsta] Hiding meta ai: disable ai rewrite story reply presenter");

return NO;
}

return %orig(arg1, arg2);
}

%end

// Direct sticker tray picker view
%hook IGStickerTrayListAdapterDataSource
- (id)objectsForListAdapter:(id)arg1 {
Expand Down Expand Up @@ -346,6 +373,24 @@
// Reels/Sundial

// Suggested AI searches in comment section
%hook IGCommentConfig
- (id)initWithUserSession:(id)session
commentThreadConfiguration:(IGCommentThreadConfiguration *)threadConfig
sponsoredSupportConfiguration:(id)supportConfig
CTAPresenterContext:(id)context
replyText:(id)text
loggingDelegate:(id)loggingDelegate
presentingViewController:(id)vc
childCommentThreadDelegate:(id)threadDelegate
{
if ([SCIUtils getBoolPref:@"hide_meta_ai"]) {
[threadConfig setValue:@(YES) forKey:@"disableMetaAICarousel"];
}
return %orig(session, threadConfig, supportConfig, context, text, loggingDelegate, vc, threadDelegate);
}
%end

// Suggested AI searches in comment section (workaround if setting comment thread config fails)
%hook IGCommentThreadAICarousel
- (id)initWithLauncherSet:(id)arg1 hasSearchPrefix:(BOOL)arg2 {
if ([SCIUtils getBoolPref:@"hide_meta_ai"]) {
Expand Down Expand Up @@ -383,7 +428,7 @@
NSLog(@"[SCInsta] Hiding meta ai: ai images add to story suggestion");

if ([SCIUtils getBoolPref:@"hide_meta_ai"]) {
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"NOT (SELF IN %@)", @[ @(10), @(11) ]];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"NOT (SELF IN %@)", @[ @(9), @(10), @(11) ]];
newTools = [tools filteredArrayUsingPredicate:predicate];
}

Expand Down
25 changes: 25 additions & 0 deletions src/Features/General/HideMetrics.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#import "../../Utils.h"

%hook IGSundialViewerVerticalUFI
- (void)setNumLikes:(NSInteger)num {
return %orig([SCIUtils getBoolPref:@"hide_metrics"] ? 0 : num);
}
- (void)setNumReshares:(NSInteger)num {
return %orig([SCIUtils getBoolPref:@"hide_metrics"] ? 0 : num);
}
- (void)setNumComments:(NSInteger)num {
return %orig([SCIUtils getBoolPref:@"hide_metrics"] ? 0 : num);
}
- (void)setNumReposts:(NSInteger)num {
return %orig([SCIUtils getBoolPref:@"hide_metrics"] ? 0 : num);
}
- (void)setNumSaves:(NSInteger)num {
return %orig([SCIUtils getBoolPref:@"hide_metrics"] ? 0 : num);
}
%end

%hook IGUFIButtonWithCountsView
- (void)setCountString:(id)string showButton:(BOOL)showButton {
return %orig([SCIUtils getBoolPref:@"hide_metrics"] ? @"" : string, showButton);
}
%end
20 changes: 20 additions & 0 deletions src/Features/General/Navigation.xm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ BOOL isSurfaceShown(IGMainAppSurfaceIntent *surface) {
isShown = NO;
}

// Messages
else if ([[surface tabStringFromSurfaceIntent] isEqualToString:@"DIRECT"] && [SCIUtils getBoolPref:@"hide_messages_tab"]) {
isShown = NO;
}

// Explore
else if ([[surface tabStringFromSurfaceIntent] isEqualToString:@"SEARCH"] && [SCIUtils getBoolPref:@"hide_explore_tab"]) {
isShown = NO;
Expand Down Expand Up @@ -97,4 +102,19 @@ NSArray *filterSurfacesArray(NSArray *surfaces) {
- (void)setIsTabSwipingEnabled:(BOOL)arg1 {
return;
}
%end

%hook IGHomeFeedHeaderView
- (void)didMoveToWindow {
%orig;

if ([SCIUtils getBoolPref:@"hide_messages_tab"]) {
UIButton *rightButton = [self valueForKey:@"rightButton"];
if (rightButton) {
NSLog(@"[SCInsta] Hiding messages tab (on feed)");

[rightButton removeFromSuperview];
}
}
}
%end
4 changes: 2 additions & 2 deletions src/Features/General/NoRecentSearches.x
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@

// Recent dm message recipients search bar
%hook IGDirectRecipientRecentSearchStorage
- (id)initWithDiskManager:(id)arg1 directCache:(id)arg2 userStore:(id)arg3 currentUser:(id)arg4 featureSets:(id)arg5 {
- (id)initWithDiskManager:(id)arg1 directRepo:(id)arg2 userMap:(id)arg3 currentUser:(id)arg4 launcherSet:(id)arg5 {
if ([SCIUtils getBoolPref:@"no_recent_searches"]) {
NSLog(@"[SCInsta] Disabling recent searches");

return nil;
}

return %orig;
return %orig(arg1, arg2, arg3, arg4, arg5);
}
%end
2 changes: 1 addition & 1 deletion src/Features/General/NoSuggestedUsers.x
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
// Section header
if ([obj isKindOfClass:%c(IGLabelItemViewModel)]) {
// Suggested for you
if ([[obj labelTitle] isEqualToString:@"Suggested for you"]) {
if ([[obj valueForKey:@"tag"] intValue] == 2) { // 2 == Suggested Users
if ([SCIUtils getBoolPref:@"no_suggested_users"]) {
NSLog(@"[SCInsta] Hiding suggested users (header: activity feed)");

Expand Down
Loading