Skip to content

Commit

Permalink
refactor: change naming convention from bh -> sc
Browse files Browse the repository at this point in the history
  • Loading branch information
SoCuul committed Apr 20, 2024
1 parent dc0f75b commit 9c479bd
Show file tree
Hide file tree
Showing 42 changed files with 280 additions and 280 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ ARCHS = arm64

include $(THEOS)/makefiles/common.mk

TWEAK_NAME = BHInsta
TWEAK_NAME = SCInsta

BHInsta_FILES = $(shell find src -type f \( -iname \*.x -o -iname \*.xm -o -iname \*.m \)) $(wildcard modules/JGProgressHUD/*.m)
BHInsta_FRAMEWORKS = UIKit Foundation CoreGraphics Photos CoreServices SystemConfiguration SafariServices Security QuartzCore
BHInsta_PRIVATE_FRAMEWORKS = Preferences
BHInsta_EXTRA_FRAMEWORKS = Cephei CepheiPrefs CepheiUI
BHInsta_CFLAGS = -fobjc-arc -Wno-unsupported-availability-guard -Wno-unused-value -Wno-deprecated-declarations -Wno-nullability-completeness -Wno-unused-function -Wno-incompatible-pointer-types
SCInsta_FILES = $(shell find src -type f \( -iname \*.x -o -iname \*.xm -o -iname \*.m \)) $(wildcard modules/JGProgressHUD/*.m)
SCInsta_FRAMEWORKS = UIKit Foundation CoreGraphics Photos CoreServices SystemConfiguration SafariServices Security QuartzCore
SCInsta_PRIVATE_FRAMEWORKS = Preferences
SCInsta_EXTRA_FRAMEWORKS = Cephei CepheiPrefs CepheiUI
SCInsta_CFLAGS = -fobjc-arc -Wno-unsupported-availability-guard -Wno-unused-value -Wno-deprecated-declarations -Wno-nullability-completeness -Wno-unused-function -Wno-incompatible-pointer-types

include $(THEOS_MAKE_PATH)/tweak.mk

ifndef DEV
BHInsta_SUBPROJECTS += modules/libflex
SCInsta_SUBPROJECTS += modules/libflex
endif
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# BHInsta
# SCInsta (previously BHInsta)
A feature-rich tweak for Instagram on iOS!\
`Version v0.4.0-dev` | `Tested on Instagram v327.1.0`

Expand Down Expand Up @@ -43,7 +43,7 @@ A feature-rich tweak for Instagram on iOS!\
- Padlock (biometric requirement to access app)

### Built-in Tweak Settings
> Long press on the Instagram settings button to bring up the BHInsta tweak settings
> Long press on the Instagram settings button to bring up the SCInsta tweak settings
# Building
## Prerequisites
Expand All @@ -57,7 +57,7 @@ A feature-rich tweak for Instagram on iOS!\
1. Install iOS 14.5 frameworks for theos
1. [Click to download iOS SDKs](https://github.com/xybp888/iOS-SDKs/archive/refs/heads/master.zip)
2. Unzip, then copy the `iPhoneOS14.5.sdk` folder into `~/theos/sdks`
2. Clone BHInsta repo from GitHub: `git clone --recurse-submodules https://github.com/SoCuul/BHInsta --branch v0.3.0`
2. Clone SCInsta repo from GitHub: `git clone --recurse-submodules https://github.com/SoCuul/SCInsta --branch v0.3.0`
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
Expand Down
6 changes: 3 additions & 3 deletions build-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ echo
./build.sh --dev

# Install to device
cp -fr ./packages/BHInsta-sideloaded.ipa ~/Documents/Signing/BHInsta/ipas/UNSIGNED.ipa
cp -fr ./packages/SCInsta-sideloaded.ipa ~/Documents/Signing/SCInsta/ipas/UNSIGNED.ipa
cd ~/Documents/Signing
./sign.sh BHInsta
./deploy.sh BHInsta #true
./sign.sh SCInsta
./deploy.sh SCInsta #true
8 changes: 4 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ elif [ -z "$(ls -A modules/libflex/FLEX)" ]; then
exit 1
fi

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

# Clean build artifacts
make clean
Expand All @@ -32,6 +32,6 @@ fi

# IPA File
echo -e '\033[1m\033[32mBuilding the IPA.\033[0m'
rm -f packages/BHInsta-sideloaded.ipa
pyzule -i "packages/${ipaFile}" -o packages/BHInsta-sideloaded.ipa -f .theos/obj/debug/BHInsta.dylib $FLEXPATH -c 0 -m 15.0 -du
echo -e "\033[1m\033[32mDone, we hope you enjoy BHInsta!\033[0m\n\nYou can find the ipa file at: $(pwd)/packages"
rm -f packages/SCInsta-sideloaded.ipa
pyzule -i "packages/${ipaFile}" -o packages/SCInsta-sideloaded.ipa -f .theos/obj/debug/SCInsta.dylib $FLEXPATH -c 0 -m 15.0 -du
echo -e "\033[1m\033[32mDone, we hope you enjoy SCInsta!\033[0m\n\nYou can find the ipa file at: $(pwd)/packages"
6 changes: 3 additions & 3 deletions control
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Package: com.socuul.bhinsta
Name: BHInsta
Package: com.socuul.scinsta
Name: SCInsta
Version: 0.4.0
Architecture: iphoneos-arm
Description: A feature-rich tweak for Instagram on iOS!
Maintainer: SoCuul
Author: Bandar Alruwaili
Author: SoCuul
Section: Tweaks
Depends: mobilesubstrate, ws.hbang.common
2 changes: 1 addition & 1 deletion src/Controllers/SecurityViewController.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#import <UIKit/UIKit.h>
#import <LocalAuthentication/LocalAuthentication.h>

@interface BHSecurityViewController : UIViewController
@interface SCISecurityViewController : UIViewController
@end
10 changes: 5 additions & 5 deletions src/Controllers/SecurityViewController.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import "SecurityViewController.h"

@implementation BHSecurityViewController
@implementation SCISecurityViewController

- (void)viewDidLoad {
[super viewDidLoad];
Expand All @@ -27,7 +27,7 @@ - (void)authenticate {
LAContext *context = [[LAContext alloc] init];
NSError *error = nil;

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

if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthentication error:&error]) {
NSString *reason = @"Authenticate to unlock app";
Expand All @@ -37,14 +37,14 @@ - (void)authenticate {
if (success) {
[self dismissViewControllerAnimated:YES completion:nil];

NSLog(@"[BHInsta] Padlock authentication: Unlock success");
NSLog(@"[SCInsta] Padlock authentication: Unlock success");
} else {
NSLog(@"[BHInsta] Padlock authentication: Unlock failed");
NSLog(@"[SCInsta] Padlock authentication: Unlock failed");
}
});
}];
} else {
NSLog(@"[BHInsta] Padlock authentication: Device authentication not available");
NSLog(@"[SCInsta] Padlock authentication: Device authentication not available");
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/Controllers/SettingsViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ typedef NS_ENUM(NSInteger, DynamicSpecifierOperatorType) {
LessThanOperatorType,
};

@interface BHSettingsViewController : HBListController
@interface SCISettingsViewController : HBListController
- (instancetype)init;
- (PSSpecifier *)newSectionWithTitle:(NSString *)header footer:(NSString *)footer;
- (PSSpecifier *)newSwitchCellWithTitle:(NSString *)titleText detailTitle:(NSString *)detailText key:(NSString *)keyText defaultValue:(BOOL)defValue changeAction:(SEL)changeAction;
Expand All @@ -34,8 +34,8 @@ typedef NS_ENUM(NSInteger, DynamicSpecifierOperatorType) {
- (void)setPreferenceValue:(id)value specifier:(PSSpecifier *)specifier;
@end

@interface BHButtonTableViewCell : HBTintedTableCell
@interface SCIButtonTableViewCell : HBTintedTableCell
@end

@interface BHSwitchTableCell : PSSwitchTableCell
@interface SCISwitchTableCell : PSSwitchTableCell
@end
24 changes: 12 additions & 12 deletions src/Controllers/SettingsViewController.m
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#import "SettingsViewController.h"

@interface BHSettingsViewController ()
@interface SCISettingsViewController ()
@property (nonatomic, assign) BOOL hasDynamicSpecifiers;
@property (nonatomic, retain) NSMutableDictionary *dynamicSpecifiers;
@end

@implementation BHSettingsViewController
@implementation SCISettingsViewController
- (instancetype)init {
self = [super init];
if (self) {
self.title = @"BHInsta";
self.title = @"SCInsta";
[self.navigationController.navigationBar setPrefersLargeTitles:false];
}
return self;
Expand All @@ -35,7 +35,7 @@ - (PSSpecifier *)newSwitchCellWithTitle:(NSString *)titleText detailTitle:(NSStr
[switchCell setProperty:keyText forKey:@"key"];
[switchCell setProperty:keyText forKey:@"id"];
[switchCell setProperty:@YES forKey:@"big"];
[switchCell setProperty:BHSwitchTableCell.class forKey:@"cellClass"];
[switchCell setProperty:SCISwitchTableCell.class forKey:@"cellClass"];
[switchCell setProperty:NSBundle.mainBundle.bundleIdentifier forKey:@"defaults"];
[switchCell setProperty:@(defValue) forKey:@"default"];
[switchCell setProperty:NSStringFromSelector(changeAction) forKey:@"switchAction"];
Expand All @@ -51,7 +51,7 @@ - (PSSpecifier *)newButtonCellWithTitle:(NSString *)titleText detailTitle:(NSStr

[buttonCell setButtonAction:action];
[buttonCell setProperty:@YES forKey:@"big"];
[buttonCell setProperty:BHButtonTableViewCell.class forKey:@"cellClass"];
[buttonCell setProperty:SCIButtonTableViewCell.class forKey:@"cellClass"];
if (detailText != nil ){
[buttonCell setProperty:detailText forKey:@"subtitle"];
}
Expand Down Expand Up @@ -142,10 +142,10 @@ - (NSArray *)specifiers {
[self newSwitchCellWithTitle:@"Enable FLEX gesture" detailTitle:@"Allows you to hold 5 fingers on the screen to open the FLEX explorer" key:@"flex_instagram" defaultValue:false changeAction:@selector(FLEXAction:)],

// Section 8: Credits
[self newSectionWithTitle:@"Credits" footer:[NSString stringWithFormat:@"BHInsta %@", BHIVersionString]],
[self newSectionWithTitle:@"Credits" footer:[NSString stringWithFormat:@"SCInsta %@", SCIVersionString]],
[self newHBTwitterCellWithTitle:@"Maintainer" twitterUsername:@"SoVeryCuul" customAvatarURL:@"https://unavatar.io/twitter/SoVeryCuul"],
[self newHBTwitterCellWithTitle:@"Original Author" twitterUsername:@"BandarHL" customAvatarURL:@"https://unavatar.io/twitter/BandarHL"],
[self newHBLinkCellWithTitle:@"View Repo" detailTitle:@"View the tweak's source code on GitHub" url:@"https://github.com/SoCuul/BHInsta"]
[self newHBLinkCellWithTitle:@"View Repo" detailTitle:@"View the tweak's source code on GitHub" url:@"https://github.com/SoCuul/SCInsta"]
]];

[self collectDynamicSpecifiersFromArray:_specifiers];
Expand Down Expand Up @@ -267,7 +267,7 @@ - (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);
NSLog(@"[SCInsta] Set user default. Key: %@ | Value: %@", [specifier identifier], value);

if (self.hasDynamicSpecifiers) {
NSString *specifierID = [specifier propertyForKey:PSIDKey];
Expand All @@ -288,16 +288,16 @@ - (void)FLEXAction:(UISwitch *)sender {
if (sender.isOn) {
[[objc_getClass("FLEXManager") sharedManager] showExplorer];

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

NSLog(@"[BHInsta] FLEX explorer: Disabled");
NSLog(@"[SCInsta] FLEX explorer: Disabled");
}
}
@end

@implementation BHButtonTableViewCell
@implementation SCIButtonTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier specifier:(PSSpecifier *)specifier {
self = [super initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseIdentifier specifier:specifier];
if (self) {
Expand All @@ -312,7 +312,7 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSStr

@end

@implementation BHSwitchTableCell
@implementation SCISwitchTableCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier specifier:(PSSpecifier *)specifier {
if ((self = [super initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseIdentifier specifier:specifier])) {
NSString *subTitle = [specifier.properties[@"subtitle"] copy];
Expand Down
6 changes: 3 additions & 3 deletions src/Download.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

NS_ASSUME_NONNULL_BEGIN

@protocol BHIDownloadDelegate <NSObject>
@protocol SCIDownloadDelegate <NSObject>
@optional
- (void)downloadProgress:(float)progress;
- (void)downloadDidFinish:(NSURL *)filePath Filename:(NSString *)fileName;
- (void)downloadDidFailureWithError:(NSError *)error;
@end

@interface BHIDownload : NSObject
@interface SCIDownload : NSObject
{
id delegate;
}
Expand All @@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, strong) NSString *fileName;
@end

@interface BHIDownload () <NSURLSessionDelegate, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate, NSURLSessionStreamDelegate>
@interface SCIDownload () <NSURLSessionDelegate, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate, NSURLSessionStreamDelegate>
@property (nonatomic, strong) NSURLSession *Session;
@end

Expand Down
2 changes: 1 addition & 1 deletion src/Download.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import "Download.h"

@implementation BHIDownload
@implementation SCIDownload
- (instancetype)init {
self = [super init];
if (self) {
Expand Down
12 changes: 6 additions & 6 deletions src/Features/Confirm/CallConfirm.x
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
%hook IGDirectThreadCallButtonsCoordinator
// Voice Call
- (void)_didTapAudioButton:(id)arg1 {
if ([BHIManager callConfirmation]) {
NSLog(@"[BHInsta] Call confirm triggered");
if ([SCIManager callConfirmation]) {
NSLog(@"[SCInsta] Call confirm triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
[SCIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
}
}

// Video Call
- (void)_didTapVideoButton:(id)arg1 {
if ([BHIManager callConfirmation]) {
NSLog(@"[BHInsta] Call confirm triggered");
if ([SCIManager callConfirmation]) {
NSLog(@"[SCInsta] Call confirm triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
[SCIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Features/Confirm/DMAudioMsgConfirm.x
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

%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");
if ([SCIManager voiceMessageConfirmation]) {
NSLog(@"[SCInsta] DM audio message confirm triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
[SCIUtils showConfirmation:^(void) { %orig; }];
} else {
return %orig;
}
Expand Down
Loading

0 comments on commit 9c479bd

Please sign in to comment.