Skip to content

Commit

Permalink
Improve most features, added some more and created documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
SoCuul committed Feb 25, 2024
1 parent 283df02 commit bcee437
Show file tree
Hide file tree
Showing 29 changed files with 369 additions and 184 deletions.
10 changes: 5 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"editor.trimAutoWhitespace": true,
"editor.formatOnSave": false,
"files.associations": {
"*.x": "objective-c",
"*.xi": "objective-c",
"*.x": "logos",
"*.xi": "logos",
"*.xm": "logos",
"*.xmi": "logos",
"*.m": "objective-c",
"*.h": "objective-c",
"*.xm": "objective-c",
"*.xmi": "objective-c"
"*.h": "objective-c"
}
}
80 changes: 67 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,74 @@
# BHInstagram
An awesome tweak for Instagram!
# BHInsta
A feature-rich tweak for Instagram on iOS!
`Version v0.2.0`

---

# Features
- Hide Ads
- No suggested post
- Show Like count
- Confirm like
### General
- Show like count
- Copy description
- Download Videos
- Do not save recent searches

### Feed
- Hide ads
- No suggested posts
- No suggested for you (accounts)

### Confirm actions
- Confirm like: Posts
- Confirm like: Reels
- Confirm follow
- Confirm call
- Confirm voice messages
- Confirm sticker interaction
- Confirm posting comment

### Save media
- Download videos
- Save profile image

### Story and messages
- Keep deleted message
- Remove last seen
- Unlimited replay of direct stories
- Disabling sending read receipts
- Remove screenshot alert
- Unlimited replay of once story
- Disable Story Seen Receipt
- Padlock
- Disable story seen receipt

### Security
- Padlock (biometric requirement to access app)

# Building
## Prerequisites
- XCode + Command-Line Developer Tools
- [Homebrew](https://brew.sh/)
- CMake (install with brew)
- [Theos](https://theos.dev/docs/installation)
- [Azule](https://github.com/Al4ise/Azule/wiki)

## Setup
1. Install iOS 14.5 frameworks for theos
1. [Download from GitHub repo](https://github.com/xybp888/iOS-SDKs)
2. Copy `iPhoneOS14.5.sdk` folder into `~/theos/sdks`
2. Clone BHInsta repo from GitHub: `git clone --recurse-submodules https://github.com/SoCuul/BHInsta`
3. [Download decrypted Instagram IPA](https://armconverter.com/decryptedappstore/us/instagram), and place it inside the `packages` folder with the name `com.burbn.instagram.ipa`

## Build IPA
```sh
$ chmod +x build.sh
$ ./build.sh
```

## Install IPA
You can install the tweaked IPA file like any other sideloaded iOS app. If you have not done this before, here are some suggestions to get started.

- [AltStore](https://altstore.io/#Downloads) (Free, No notifications*) *Notifications require $99/year Apple Developer Program
- [Sideloadly](https://sideloadly.io/#download) (Free, No notifications*) *Notifications require $99/year Apple Developer Program
- [Signulous](https://www.signulous.com/register) ($19.99/year, Works with notifications)
- [UDID Registrations](https://www.udidregistrations.com/buy) ($9.99/year, Works with notifications)

# In-App Screenshots
![BHInsta Settings](https://i.imgur.com/55ervgv.jpg)

# TODO
- [ ] Add Localization for the tweak.
# Contributing
Contributions to this tweak are greatly appreciated. Feel free to create a pull request if you would like to contribute.
9 changes: 9 additions & 0 deletions build-dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

./build.sh

# Install to device
cp -fr ./packages/BHInsta-sideloaded.ipa ~/Documents/Signing/BHInsta/ipas/UNSIGNED.ipa
cd ~/Documents/Signing
./sign.sh BHInsta
./deploy.sh BHInsta #true
11 changes: 3 additions & 8 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

PROJECT_PATH=$(pwd)
CMAKE_OSX_ARCHITECTURES="arm64e;arm64"

echo -e '\033[1m\033[32mBuilding BHInsta tweak for sideloading (as IPA)\033[0m'

Expand All @@ -13,13 +14,7 @@ if [ -e ./packages/com.burbn.instagram.ipa ]; then
echo -e '\033[1m\033[32mBuilding the IPA.\033[0m'
azule -i "$PROJECT_PATH/packages/com.burbn.instagram.ipa" -o "$PROJECT_PATH/packages" -n BHInsta-sideloaded -r -f "$PROJECT_PATH/.theos/obj/debug/BHInsta.dylib" "$PROJECT_PATH/packages/Cephei.framework" "$PROJECT_PATH/packages/CepheiUI.framework" "$PROJECT_PATH/packages/CepheiPrefs.framework" "$PROJECT_PATH/modules/libflex/.theos/obj/debug/libbhFLEX.dylib"

echo -e '\033[1m\033[32mDone, we hope you enjoy BHInsta!\033[0m'
echo -e "\033[1m\033[32mDone, we hope you enjoy BHInsta!\033[0m\n\nYou can find the ipa file at: $PROJECT_PATH/packages"
else
echo -e '\033[1m\033[0;31mpackages/com.burbn.instagram.ipa not found.\nPlease put a decrypted Instagram IPA in its path.\033[0m'
fi

# Install to device
cp -fr ./packages/BHInsta-sideloaded.ipa ~/Documents/Signing/BHInsta/ipas/UNSIGNED.ipa
cd ~/Documents/Signing
./sign.sh BHInsta
./deploy.sh BHInsta #true
fi
1 change: 0 additions & 1 deletion compile_commands.json

This file was deleted.

2 changes: 1 addition & 1 deletion control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: com.socuul.bhinsta
Name: BHInsta
Version: 0.1.0
Version: 0.2.0
Architecture: iphoneos-arm
Description: A feature-rich tweak for Instagram on iOS!
Maintainer: SoCuul
Expand Down
1 change: 0 additions & 1 deletion src/Controllers/SettingsViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ typedef NS_ENUM(NSInteger, DynamicSpecifierOperatorType) {
- (PSSpecifier *)newHBLinkCellWithTitle:(NSString *)titleText detailTitle:(NSString *)detailText url:(NSString *)url;
- (PSSpecifier *)newHBButtonCellWithTitle:(NSString *)titleText action:(SEL)action;
- (PSSpecifier *)newHBTwitterCellWithTitle:(NSString *)titleText twitterUsername:(NSString *)user customAvatarURL:(NSString *)avatarURL;
- (void)_clearCache;
- (void)reloadSpecifiers;
- (void)collectDynamicSpecifiersFromArray:(NSArray *)array;
- (BOOL)shouldHideSpecifier:(PSSpecifier *)specifier;
Expand Down
52 changes: 8 additions & 44 deletions src/Controllers/SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,31 +85,36 @@ - (PSSpecifier *)newHBTwitterCellWithTitle:(NSString *)titleText twitterUsername
[TwitterCell setProperty:avatarURL forKey:@"iconURL"];
return TwitterCell;
}

- (NSArray *)specifiers {
if (!_specifiers) {
_specifiers = [NSMutableArray arrayWithArray:@[
// Section 1: General
[self newSectionWithTitle:@"General" footer:nil],
[self newSwitchCellWithTitle:@"Show Like count" detailTitle:@"Show like count in the post" key:@"show_like_count" defaultValue:true changeAction:nil],
[self newSwitchCellWithTitle:@"Show like count" detailTitle:@"Show like count in the post" key:@"show_like_count" defaultValue:true changeAction:nil],
[self newSwitchCellWithTitle:@"Copy description" detailTitle:@"Copy the post description with a long press" key:@"copy_description" defaultValue:true changeAction:nil],
[self newSwitchCellWithTitle:@"Do not save recent searches" detailTitle:@"Search bars will no longer save your recent searches." key:@"no_recent_searches" defaultValue:true changeAction:nil],

// Section 2: Feed
[self newSectionWithTitle:@"Feed" footer:nil],
[self newSwitchCellWithTitle:@"Hide Ads" detailTitle:@"Remove all ads from the Instagram app" key:@"hide_ads" defaultValue:true changeAction:nil],
[self newSwitchCellWithTitle:@"No suggested posts" detailTitle:@"Remove suggested posts from your feed" key:@"no_suggested_post" defaultValue:false changeAction:nil],
[self newSwitchCellWithTitle:@"No suggested for you" detailTitle:@"Hide suggested accounts for you to follow" key:@"no_suggested_account" defaultValue:false changeAction:nil],
//[self newSwitchCellWithTitle:@"No suggested reels" detailTitle:@"Hide suggested reels to watch" key:@"no_suggested_reels" defaultValue:false changeAction:nil],

// Section 3: Confirm actions
[self newSectionWithTitle:@"Confirm actions" footer:nil],
[self newSwitchCellWithTitle:@"Confirm like: Posts" detailTitle:@"Shows an alert when you click the like button on posts to confirm the like" key:@"like_confirm" defaultValue:false changeAction:nil],
[self newSwitchCellWithTitle:@"Confirm like: Reels" detailTitle:@"Shows an alert when you click the like button on reels to confirm the like" key:@"like_confirm_reels" defaultValue:false changeAction:nil],
[self newSwitchCellWithTitle:@"Confirm follow" detailTitle:@"Shows an alert when you click the follow button to confirm the follow" key:@"follow_confirm" defaultValue:false changeAction:nil],
[self newSwitchCellWithTitle:@"Confirm call" detailTitle:@"Shows an alert when you click the audio/video call button to confirm before calling" key:@"call_confirm" defaultValue:false changeAction:nil],
[self newSwitchCellWithTitle:@"Confirm call" detailTitle:@"Shows an alert when you click the audio/video call button to confirm before calling" key:@"call_confirm" defaultValue:true changeAction:nil],
[self newSwitchCellWithTitle:@"Confirm voice messages" detailTitle:@"Shows an alert to confirm before sending a voice message" key:@"voice_message_confirm" defaultValue:true changeAction:nil],
[self newSwitchCellWithTitle:@"Confirm sticker interaction" detailTitle:@"Shows an alert when you click a sticker on someone's story to confirm the action" key:@"sticker_interact_confirm" defaultValue:false changeAction:nil],
[self newSwitchCellWithTitle:@"Confirm posting comment" detailTitle:@"Shows an alert when you click the post comment button to confirm" key:@"post_comment_confirm" defaultValue:false changeAction:nil],

// Section 4: Save media
[self newSectionWithTitle:@"Save media" footer:nil],
[self newSwitchCellWithTitle:@"Download Videos" detailTitle:@"Download videos by long press" key:@"dw_videos" defaultValue:true changeAction:nil],
[self newSwitchCellWithTitle:@"Download videos" detailTitle:@"Download videos by long press" key:@"dw_videos" defaultValue:true changeAction:nil],
[self newSwitchCellWithTitle:@"Save profile image" detailTitle:@"Save profile image by long press" key:@"save_profile" defaultValue:true changeAction:nil],

// Section 5: Stories and Messages
Expand All @@ -127,7 +132,6 @@ - (NSArray *)specifiers {
// Section 7: Debugging
[self newSectionWithTitle:@"Debugging" footer:nil],
[self newSwitchCellWithTitle:@"Enable FLEX" detailTitle:@"Show FLEX on instagram app." key:@"flex_instagram" defaultValue:false changeAction:@selector(FLEXAction:)],
/* [self newHBButtonCellWithTitle:@"Clear cache" action:@selector(_clearCache:)], */

// Section 8: Credits
[self newSectionWithTitle:@"Credits" footer:nil],
Expand All @@ -142,46 +146,6 @@ - (NSArray *)specifiers {
return _specifiers;
}

- (void)_clearCache {
JGProgressHUD *HUD = [[JGProgressHUD alloc] init];
HUD.textLabel.text = @"Wowza.";
HUD.indicatorView = [[JGProgressHUDErrorIndicatorView alloc] init];
[HUD showInView:topMostController().view];
[HUD dismissAfterDelay:2.0];

NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *directoryPath = [NSHomeDirectory() stringByAppendingString:@"/Documents/Library/Caches/"];

if ([fileManager fileExistsAtPath:directoryPath]) {
NSDirectoryEnumerator *dirEnum = [fileManager enumeratorAtPath:directoryPath];
NSString *documentsName;
while (documentsName = [dirEnum nextObject]) {
NSString *filePath = [directoryPath stringByAppendingString:documentsName];
BOOL isFileDeleted = [fileManager removeItemAtPath:filePath error:nil];
if (isFileDeleted == NO) {

// Not all files were removed (error)
JGProgressHUD *HUD = [[JGProgressHUD alloc] init];
HUD.textLabel.text = @"Could not clear cache.";
HUD.indicatorView = [[JGProgressHUDErrorIndicatorView alloc] init];
[HUD showInView:topMostController().view];
[HUD dismissAfterDelay:2.0];

NSLog(@"Error clearing cache!");
break;

}
}

// Success
JGProgressHUD *HUD = [[JGProgressHUD alloc] init];
HUD.textLabel.text = @"Cache has been cleared!";
HUD.indicatorView = [[JGProgressHUDSuccessIndicatorView alloc] init];
[HUD showInView:topMostController().view];
[HUD dismissAfterDelay:2.0];
}
}

- (void)reloadSpecifiers {
[super reloadSpecifiers];

Expand Down
4 changes: 2 additions & 2 deletions src/Features/Confirm/CallConfirm.x
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Voice Call
- (void)_didTapAudioButton:(id)arg1 {
if ([BHIManager callConfirmation]) {
showConfirmation(^(void) { %orig; });
[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
}
Expand All @@ -14,7 +14,7 @@
// Video Call
- (void)_didTapVideoButton:(id)arg1 {
if ([BHIManager callConfirmation]) {
showConfirmation(^(void) { %orig; });
[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
}
Expand Down
21 changes: 0 additions & 21 deletions src/Features/Confirm/DMAudioMsgConfirm

This file was deleted.

12 changes: 12 additions & 0 deletions src/Features/Confirm/DMAudioMsgConfirm.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#import "../../Manager.h"
#import "../../Utils.h"

%hook IGDirectThreadViewController
- (void)voiceRecordViewController:(id)arg1 didRecordAudioClipWithURL:(id)arg2 waveform:(id)arg3 duration:(CGFloat)arg4 entryPoint:(NSInteger)arg5 {
if ([BHIManager voiceMessageConfirmation]) {
[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
}
}
%end
14 changes: 7 additions & 7 deletions src/Features/Confirm/FollowConfirm.x
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
%hook IGFollowController
- (void)_didPressFollowButton {
if ([BHIManager followConfirmation]) {
showConfirmation(^(void) { %orig; });
[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
}
Expand All @@ -16,14 +16,14 @@
%hook IGDiscoverPeopleButtonGroupView
- (void)_onFollowButtonTapped:(id)arg1 {
if ([BHIManager followConfirmation]) {
showConfirmation(^(void) { %orig; });
[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
}
}
- (void)_onFollowingButtonTapped:(id)arg1 {
if ([BHIManager followConfirmation]) {
showConfirmation(^(void) { %orig; });
[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
}
Expand All @@ -34,7 +34,7 @@
%hook IGHScrollAYMFCell
- (void)_didTapAYMFActionButton {
if ([BHIManager followConfirmation]) {
showConfirmation(^(void) { %orig; });
[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
}
Expand All @@ -43,7 +43,7 @@
%hook IGHScrollAYMFActionButton
- (void)_didTapTextActionButton {
if ([BHIManager followConfirmation]) {
showConfirmation(^(void) { %orig; });
[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
}
Expand All @@ -54,7 +54,7 @@
%hook IGUnifiedVideoFollowButton
- (void)_hackilyHandleOurOwnButtonTaps:(id)arg1 {
if ([BHIManager followConfirmation]) {
showConfirmation(^(void) { %orig; });
[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
}
Expand All @@ -65,7 +65,7 @@
%hook IGProfileViewController
- (void)navigationItemsControllerDidTapHeaderFollowButton:(id)arg1 {
if ([BHIManager followConfirmation]) {
showConfirmation(^(void) { %orig; });
[BHIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
}
Expand Down
Loading

0 comments on commit bcee437

Please sign in to comment.