Skip to content

Commit

Permalink
Add Copy Bio Feature By Long press
Browse files Browse the repository at this point in the history
Copy Bio Profile By Long Press on bio Text
  • Loading branch information
0wb3 committed Feb 2, 2024
1 parent 2477ee0 commit 700db88
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 1 deletion.
1 change: 1 addition & 0 deletions BHIManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
+ (BOOL)likeConfirmation;
+ (BOOL)followConfirmation;
+ (BOOL)copyDecription;
+ (BOOL)copyBio;
+ (BOOL)Padlock;
+ (BOOL)keepDeletedMessage;
+ (BOOL)hideLastSeen;
Expand Down
3 changes: 3 additions & 0 deletions BHIManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ + (BOOL)followConfirmation; {
+ (BOOL)copyDecription {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"copy_description"];
}
+ (BOOL)copyBio {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"copy_bio"];
}
+ (BOOL)Padlock {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"padlock"];
}
Expand Down
1 change: 1 addition & 0 deletions InstagramHeaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@
@property NSInteger followStatus;
@property(copy) NSString *username;
@property BOOL followsCurrentUser;
@property NSString *biography;
- (NSURL *)HDProfilePicURL;
- (BOOL)isUser;

Expand Down
3 changes: 2 additions & 1 deletion SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ - (NSArray *)specifiers {
PSSpecifier *likeConfirmation = [self newSwitchCellWithTitle:@"Confirm like" detailTitle:@"Show alert when you click the like button to confirm the like" key:@"like_confirm" defaultValue:false changeAction:nil];
PSSpecifier *followConfirmation = [self newSwitchCellWithTitle:@"Confirm Follow" detailTitle:@"Show alert when you click the Follow button to confirm the Follow" key:@"follow_confirm" defaultValue:false changeAction:nil];
PSSpecifier *copyDecription = [self newSwitchCellWithTitle:@"Copy description" detailTitle:@"Copy the post description by long press" key:@"copy_description" defaultValue:true changeAction:nil];

PSSpecifier *copyBio = [self newSwitchCellWithTitle:@"Copy Profile Bio" detailTitle:@"Copy the Profile Bio by long press on Bio" key:@"copy_bio" defaultValue:true changeAction:nil];
PSSpecifier *downloadVid = [self newSwitchCellWithTitle:@"Download Videos" detailTitle:@"Download Videos by log press in any video you want." key:@"dw_videos" defaultValue:true changeAction:nil];
PSSpecifier *profileSave = [self newSwitchCellWithTitle:@"Save profile image" detailTitle:@"Save profile image by long press." key:@"save_profile" defaultValue:true changeAction:nil];

Expand All @@ -125,6 +125,7 @@ - (NSArray *)specifiers {
likeConfirmation,
followConfirmation,
copyDecription,
copyBio,

mediaSection, // 2
downloadVid,
Expand Down
24 changes: 24 additions & 0 deletions Tweak.x
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,29 @@ static BOOL isAuthenticationShowed = FALSE;
}
}
%end
// Copy Bio

%hook IGProfileViewController

-(void)bioSectionControllerDidLongPress:(id)arg1 {
if ([BHIManager copyBio]) {
IGProfileBioModel* bioModel = [self valueForKey:@"_bioModel"];
NSString* biography = [[bioModel user] biography];
UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:@"HI" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* copyButton = [UIAlertAction actionWithTitle:@"Copy Bio" style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {

UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
pasteboard.string = biography;
}];
[alert addAction:copyButton];
[self presentViewController:alert animated:YES completion:nil];
}
return %orig;


}
%end

// Follow Confirm

Expand Down Expand Up @@ -312,6 +334,8 @@ static BOOL isAuthenticationShowed = FALSE;
}
%end



// Hide Ads
%hook IGMainFeedListAdapterDataSource
- (NSArray *)objectsForListAdapter:(id)arg1 {
Expand Down

0 comments on commit 700db88

Please sign in to comment.