[release] RyukGram v1.2.0

### Features
- **Open Instagram links in app (Safari extension)** — bundled Safari web extension (sideload IPA only). Enable in Safari → Extensions; instagram.com links open in the app.
- **Localization** — every user-facing string flows through a central translation layer. Globe button in Settings; missing keys fall back to English. Ships English only — see the "Translating RyukGram" section in the README to add more.
- **Action buttons** — context-aware menus on feed, reels, and stories (expand, repost, download, copy caption, etc.) with per-context default tap action and carousel/multi-story bulk download
- **Enhanced HD downloads** — up to 1080p via DASH + FFmpegKit with quality picker, preview playback, encoding-speed options, and 720p fallback
- **Repost**, **media viewer**, **media zoom** (long-press), **download pill** (frosted glass, stacks concurrent downloads)
- **Fake location** — overrides CoreLocation app-wide, map picker + saved presets, optional quick-toggle button on the Friends Map
- **Messages-only mode** — strips every tab except DM inbox + profile
- **Launch tab** — pick which tab the app opens to
- Full last active date in DMs — show full date instead of "Active 2h ago"
- Custom date format — 12 formats with per-surface toggles (feed, notes/comments/stories, DMs)
- Send files in DMs (experimental)
- View story mentions
- Hide suggested stories
- Story tray long-press actions — view HD profile picture from the tray menu
- Advance on story reply — auto-skip to next story after sending a reply or reaction
- Mark story as seen on reply or emoji reaction
- Hide metrics (likes, comments, shares counts)
- Hide messages tab
- Hide voice/video call buttons in DM thread header (independent toggles)
- Disable app haptics
- Disable reels tab refresh
- Disable disappearing messages mode in DMs
- Follow indicator — shows whether the profile user follows you
- Copy note text on long press
- Zoom profile photo — long press opens full-screen viewer
- Notes actions — copy text, download GIF/audio from notes long-press menu
- Confirm unfollow
- Feed refresh controls — disable background refresh, home button refresh, and home button scroll

### Improvements
- Default tap action: added copy URL, repost, and view mentions options; dynamic menu generation per context
- Settings pages reordered: General → Feed → Stories → Reels → Messages → Profile → Navigation → Saving → Confirmations
- Fake location picker: native Apple Maps-style UI (search, long-press to drop pin, current location)
- Liquid glass floating tab bar + dynamic sizing
- Upload audio: FFmpegKit re-encode + trim for any audio/video input
- Settings reorganized with per-context action button config; new Profile page
- Highlight cover: full-screen viewer replaces direct download
- Switched HD encoder to `h264_videotoolbox` (hardware) — no GPL FFmpegKit required
- Legacy long-press download deprecated (off by default), replaced by action buttons

### Fixes
- Hide suggested stories no longer removes followed users' stories on scroll
- Settings search bar transparency with liquid glass off; auto-deactivates on push
- HD download cancel: tapping pill aborts in-flight downloads + FFmpeg sessions cleanly
- Download pill stuck state on background/foreground, progress reset per download
- Disappearing messages mode confirmation not firing on swipe
- Detailed color picker not working on story draw `†`
- DM seen toggle menu not updating after tap
- Reel refresh confirmation appearing on first app launch `†`
- Reels action button displacing profile pictures on photo reels
- Disappearing DM media download (expand, share, save to Photos with progress pill)
- Carousel "Download all" not showing item count in feed
- Encoding speed setting being ignored for HD downloads
- Various upstream SCInsta merges (Meta AI hiding, suggested chats hiding, notes tray) — marked `†`

> `†` Merged from upstream [SCInsta](https://github.com/SoCuul/SCInsta) by SoCuul

### Credits
- Thanks to [@erupts0](https://github.com/erupts0) (John) for testing and feature suggestions
- Thanks to [@euoradan](https://t.me/euoradan) (Radan) for experimental Instagram feature flag research
- Safari extension forked/cleaned from [BillyCurtis/OpenInstagramSafariExtension](https://github.com/BillyCurtis/OpenInstagramSafariExtension)

### Known Issues
- Preserved unsent messages can't be removed via "Delete for you"; pull-to-refresh clears them (warning available in settings)
- "Delete for you" detection uses a ~2s window after the local action — a real unsend landing in that window may be missed (rare)
This commit is contained in:
faroukbmiled
2026-04-16 03:03:30 +01:00
parent 9b2c7dc202
commit 86eaa95019
124 changed files with 11523 additions and 1393 deletions
+165
View File
@@ -0,0 +1,165 @@
#import "SCIActionButton.h"
#import "SCIActionMenu.h"
#import "../Utils.h"
#import <objc/runtime.h>
// Associated-object keys for per-button config.
static const void *kSCICtxKey = &kSCICtxKey;
static const void *kSCIProviderKey = &kSCIProviderKey;
static const void *kSCIPrefKey = &kSCIPrefKey;
const void *kSCIDismissKey = &kSCIDismissKey;
@interface SCIActionButton () <UIContextMenuInteractionDelegate>
@end
@implementation SCIActionButton
// Singleton delegate for UIContextMenuInteraction.
+ (instancetype)shared {
static SCIActionButton *s;
static dispatch_once_t once;
dispatch_once(&once, ^{ s = [SCIActionButton new]; });
return s;
}
+ (UIMenu *)deferredMenuForContext:(SCIActionContext)ctx
fromView:(UIView *)sourceView
mediaProvider:(SCIActionMediaProvider)provider {
__weak UIView *weakSource = sourceView;
SCIActionMediaProvider capturedProvider = [provider copy];
UIDeferredMenuElement *deferred = [UIDeferredMenuElement
elementWithUncachedProvider:^(void (^completion)(NSArray<UIMenuElement *> * _Nonnull)) {
UIView *view = weakSource;
id media = (view && capturedProvider) ? capturedProvider(view) : nil;
NSArray *actions = [SCIMediaActions actionsForContext:ctx
media:media
fromView:view];
UIMenu *built = [SCIActionMenu buildMenuWithActions:actions];
completion(built.children);
}];
return [UIMenu menuWithTitle:@""
image:nil
identifier:nil
options:0
children:@[deferred]];
}
+ (void)configureButton:(UIButton *)button
context:(SCIActionContext)ctx
prefKey:(NSString *)prefKey
mediaProvider:(SCIActionMediaProvider)provider {
if (!button) return;
// Stash config on the button.
objc_setAssociatedObject(button, kSCICtxKey, @(ctx), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
objc_setAssociatedObject(button, kSCIProviderKey, [provider copy], OBJC_ASSOCIATION_COPY_NONATOMIC);
objc_setAssociatedObject(button, kSCIPrefKey, [prefKey copy], OBJC_ASSOCIATION_COPY_NONATOMIC);
// Read default tap mode fresh.
NSString *defaultTap = [SCIUtils getStringPref:prefKey];
if (!defaultTap.length) defaultTap = @"menu";
// Remove previous wiring to stay idempotent.
[button removeTarget:nil action:NULL forControlEvents:UIControlEventTouchUpInside];
for (id<UIInteraction> it in [button.interactions copy]) {
if ([(id)it isKindOfClass:[UIContextMenuInteraction class]]) {
[button removeInteraction:it];
}
}
if ([defaultTap isEqualToString:@"menu"]) {
// Tap opens menu natively.
button.menu = [self deferredMenuForContext:ctx fromView:button mediaProvider:provider];
button.showsMenuAsPrimaryAction = YES;
return;
}
// Tap fires dedicated action; long-press opens menu.
button.showsMenuAsPrimaryAction = NO;
button.menu = nil;
[button addTarget:[self shared]
action:@selector(sciTapHandler:)
forControlEvents:UIControlEventTouchUpInside];
UIContextMenuInteraction *interaction =
[[UIContextMenuInteraction alloc] initWithDelegate:[self shared]];
[button addInteraction:interaction];
}
// Haptic + scale-bounce feedback.
+ (void)bounceButton:(UIView *)view {
UIImpactFeedbackGenerator *haptic =
[[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleMedium];
[haptic impactOccurred];
[UIView animateWithDuration:0.1
animations:^{ view.transform = CGAffineTransformMakeScale(0.82, 0.82); }
completion:^(BOOL _) {
[UIView animateWithDuration:0.1 animations:^{
view.transform = CGAffineTransformIdentity;
}];
}];
}
// Default-tap handler.
- (void)sciTapHandler:(UIButton *)sender {
[SCIActionButton bounceButton:sender];
NSNumber *ctxNum = objc_getAssociatedObject(sender, kSCICtxKey);
SCIActionMediaProvider provider = objc_getAssociatedObject(sender, kSCIProviderKey);
NSString *prefKey = objc_getAssociatedObject(sender, kSCIPrefKey);
if (!ctxNum || !provider) return;
NSString *tap = [SCIUtils getStringPref:prefKey];
if (!tap.length) tap = @"menu";
id media = provider(sender);
if (media == (id)kCFNull) return;
if ([tap isEqualToString:@"expand"]) {
[SCIMediaActions expandMedia:media fromView:sender caption:nil];
} else if ([tap isEqualToString:@"download_share"]) {
[SCIMediaActions downloadAndShareMedia:media];
} else if ([tap isEqualToString:@"download_photos"]) {
[SCIMediaActions downloadAndSaveMedia:media];
} else {
// Fallback: user can long-press for menu.
}
}
// MARK: - UIContextMenuInteractionDelegate
- (UIContextMenuConfiguration *)contextMenuInteraction:(UIContextMenuInteraction *)interaction
configurationForMenuAtLocation:(CGPoint)location {
UIView *view = interaction.view;
NSNumber *ctxNum = objc_getAssociatedObject(view, kSCICtxKey);
SCIActionMediaProvider provider = objc_getAssociatedObject(view, kSCIProviderKey);
if (!ctxNum || !provider) return nil;
SCIActionContext ctx = (SCIActionContext)ctxNum.integerValue;
return [UIContextMenuConfiguration
configurationWithIdentifier:nil
previewProvider:nil
actionProvider:^UIMenu * _Nullable(NSArray<UIMenuElement *> * _Nonnull suggested) {
return [SCIActionButton deferredMenuForContext:ctx
fromView:view
mediaProvider:provider];
}];
}
- (void)contextMenuInteraction:(UIContextMenuInteraction *)interaction
willEndForConfiguration:(UIContextMenuConfiguration *)configuration
animator:(id<UIContextMenuInteractionAnimating>)animator {
UIView *view = interaction.view;
void (^dismiss)(void) = objc_getAssociatedObject(view, kSCIDismissKey);
if (dismiss) {
if (animator) {
[animator addCompletion:^{ dismiss(); }];
} else {
dismiss();
}
}
}
@end