Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Fix show like count, unlimit replay direct messages
Browse files Browse the repository at this point in the history
  • Loading branch information
haoict committed Mar 17, 2021
1 parent a49046d commit 6d44323
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Free & Open Source Tweak for Instagram app on iOS!
- Show like count
- Determine if user is following you
- Disable DM seen and Story seen receipt
- Unlimited Replay Direct Message
- Support iOS 12 - 14 & latest version of Instagram

## Cydia Repo
Expand Down
1 change: 1 addition & 0 deletions Tweak.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
@end

@interface IGStyledString : NSObject
@property(retain, nonatomic) NSMutableAttributedString *attributedString;
- (void)appendString:(id)arg1;
@end

Expand Down
27 changes: 24 additions & 3 deletions Tweak.xm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ BOOL canSaveHDProfilePicture;
BOOL showLikeCount;
BOOL disableDirectMessageSeenReceipt;
BOOL disableStorySeenReceipt;
BOOL unlimitedReplayDirectMessage;
BOOL determineIfUserIsFollowingYou;
BOOL likeConfirmation;
int appLockSetting;
Expand All @@ -24,6 +25,7 @@ static void reloadPrefs() {
determineIfUserIsFollowingYou = [[settings objectForKey:@"determineIfUserIsFollowingYou"] ?: @(YES) boolValue];
disableDirectMessageSeenReceipt = [[settings objectForKey:@"disableDirectMessageSeenReceipt"] ?: @(NO) boolValue];
disableStorySeenReceipt = [[settings objectForKey:@"disableStorySeenReceipt"] ?: @(NO) boolValue];
unlimitedReplayDirectMessage = [[settings objectForKey:@"unlimitedReplayDirectMessage"] ?: @(YES) boolValue];
likeConfirmation = [[settings objectForKey:@"likeConfirmation"] ?: @(NO) boolValue];
appLockSetting = [[settings objectForKey:@"appLockSetting"] intValue] ?: 0;
}
Expand Down Expand Up @@ -95,9 +97,24 @@ static void showConfirmation(void (^okHandler)(void)) {

// for instagram v178.0
%hook IGFeedItemLikeCountCell
- (void)configureWithStyledString:(IGStyledString *)arg1 media:(IGMedia *)arg2 feedItemRow:(id)arg3 feedTheme:(id)arg4 cellDelegate:(id)arg5 touchHandlerDelegate:(id)arg6 topPadding:(double)arg7 userSession:(id)arg8 analyticsModule:(id)arg9 {
[arg1 appendString:[NSString stringWithFormat:@" (%lld)", arg2.likeCount]];
return %orig;
+ (IGStyledString *)buildStyledStringWithMedia:(IGMedia *)arg1 feedItemRow:(id)arg2 pageCellState:(id)arg3 configuration:(id)arg4 feedConfiguration:(id)arg5 contentWidth:(double)arg6 textWidth:(double)arg7 combinedContextOptions:(long long)arg8 userSession:(id)arg9 {
IGStyledString *orig = %orig;
if (orig != nil
&& orig.attributedString != nil
&& orig.attributedString.string != nil
&& ![orig.attributedString.string containsString:@"("]
&& ![orig.attributedString.string containsString:@")"]) {
[orig appendString:[NSString stringWithFormat:@" (%lld)", arg1.likeCount]];
}
return orig;
}
%end
%end

%group UnlimitedReplayDirectMessage
%hook IGStoryPhotoView
- (void)progressImageView:(id)arg1 didLoadImage:(id)arg2 loadSource:(id)arg3 networkRequestSummary:(id)arg4 {

}
%end
%end
Expand Down Expand Up @@ -508,6 +525,10 @@ static id observer;
if (disableStorySeenReceipt) {
%init(DisableStorySeenReceipt)
}

if (unlimitedReplayDirectMessage) {
%init(UnlimitedReplayDirectMessage)
}
}
];
}
Expand Down
3 changes: 2 additions & 1 deletion control
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: com.haoict.instanoads
Name: Instagram No Ads
Depends: mobilesubstrate, preferenceloader, com.haoict.libhdev (>= 4.8.0), firmware (>= 12), firmware(>= 12.2) | ${LIBSWIFT}
Version: 2.7.0
Version: 2.8.0
Architecture: iphoneos-arm
Description: Free & Open Source Tweak for Instagram
Free & Open Source Tweak for Instagram
Expand All @@ -14,6 +14,7 @@ Description: Free & Open Source Tweak for Instagram
- Show like count
- Determine if user is following you
- Disable DM seen and Story seen receipt
- Unlimited Replay Direct Messages
- Like confirmation
- Add App lock (use faceid/touchid to unlock)
- Support iOS 12 - 14 & latest Instagram version (>= 178.0)
Expand Down
18 changes: 18 additions & 0 deletions pref/Resources/Root.plist
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,24 @@
<string>com.haoict.instanoadspref/PrefChanged</string>
</dict>

<dict>
<key>cell</key>
<string>PSSwitchCell</string>
<key>cellClass</key>
<string>HPSSwitchCell</string>
<key>default</key>
<true/>
<key>defaults</key>
<string>com.haoict.instanoadspref</string>
<key>key</key>
<string>unlimitedReplayDirectMessage</string>
<key>label</key>
<string>UNLIMITED_REPLAY_DIRECT_MESSAGES</string>
<key>subtitle</key>
<string>UNLIMITED_REPLAY_DIRECT_MESSAGES_DESC</string>
<key>PostNotification</key>
<string>com.haoict.instanoadspref/PrefChanged</string>
</dict>

<dict>
<key>cell</key>
Expand Down
2 changes: 2 additions & 0 deletions pref/Resources/base.lproj/Root.strings
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"READ_DIRECT_MESSAGE_WITHOUT_OTHERS_KNOWING" = "Read direct message without others knowing";
"DISABLE_STORY_SEEN_RECEIPT" = "Disable Story Seen Receipt";
"SEE_STORY_WITHOUT_OTHERS_KNOWING" = "See story without others knowing";
"UNLIMITED_REPLAY_DIRECT_MESSAGES" = "Unlimited Replay Direct Messages";
"UNLIMITED_REPLAY_DIRECT_MESSAGES_DESC" = "Photo/Video in DM can be replayed anytime and stay permanently";
"APP_LOCK_PREFERENCES" = "App Lock Preferences";
"APP_LOCK" = "App Lock";
"DISABLE" = "Disable";
Expand Down
2 changes: 2 additions & 0 deletions pref/Resources/en.lproj/Root.strings
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"READ_DIRECT_MESSAGE_WITHOUT_OTHERS_KNOWING" = "Read direct message without others knowing";
"DISABLE_STORY_SEEN_RECEIPT" = "Disable Story Seen Receipt";
"SEE_STORY_WITHOUT_OTHERS_KNOWING" = "See story without others knowing";
"UNLIMITED_REPLAY_DIRECT_MESSAGES" = "Unlimited Replay Direct Messages";
"UNLIMITED_REPLAY_DIRECT_MESSAGES_DESC" = "Photo/Video in DM can be replayed anytime and stay permanently";
"APP_LOCK_PREFERENCES" = "App Lock Preferences";
"APP_LOCK" = "App Lock";
"DISABLE" = "Disable";
Expand Down
2 changes: 2 additions & 0 deletions pref/Resources/th.lproj/Root.strings
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"READ_DIRECT_MESSAGE_WITHOUT_OTHERS_KNOWING" = "Read direct message without others knowing";
"DISABLE_STORY_SEEN_RECEIPT" = "Disable Story Seen Receipt";
"SEE_STORY_WITHOUT_OTHERS_KNOWING" = "See story without others knowing";
"UNLIMITED_REPLAY_DIRECT_MESSAGES" = "Unlimited Replay Direct Messages";
"UNLIMITED_REPLAY_DIRECT_MESSAGES_DESC" = "Photo/Video in DM can be replayed anytime and stay permanently";
"APP_LOCK_PREFERENCES" = "App Lock Preferences";
"APP_LOCK" = "App Lock";
"DISABLE" = "Disable";
Expand Down
2 changes: 2 additions & 0 deletions pref/Resources/vi.lproj/Root.strings
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"READ_DIRECT_MESSAGE_WITHOUT_OTHERS_KNOWING" = "Đọc tin nhắn ẩn danh";
"DISABLE_STORY_SEEN_RECEIPT" = "Tắt đã xem story";
"SEE_STORY_WITHOUT_OTHERS_KNOWING" = "Xem story ẩn danh";
"UNLIMITED_REPLAY_DIRECT_MESSAGES" = "Unlimited Replay Direct Messages";
"UNLIMITED_REPLAY_DIRECT_MESSAGES_DESC" = "Photo/Video in DM can be replayed anytime and stay permanently";
"APP_LOCK_PREFERENCES" = "App Lock Preferences";
"APP_LOCK" = "App Lock";
"DISABLE" = "Disable";
Expand Down
Binary file not shown.

0 comments on commit 6d44323

Please sign in to comment.