mirror of
https://github.com/faroukbmiled/RyukGram.git
synced 2026-06-09 08:53:52 +02:00
[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:
@@ -0,0 +1,260 @@
|
||||
// Quick fake-location toggle injected into IG's Friends Map (DMs > Maps).
|
||||
|
||||
#import "../../Utils.h"
|
||||
#import "../../Settings/SCIFakeLocationSettingsVC.h"
|
||||
#import "../../Settings/SCIFakeLocationPickerVC.h"
|
||||
#import <objc/runtime.h>
|
||||
#import <objc/message.h>
|
||||
#import <substrate.h>
|
||||
|
||||
static const NSInteger kSciMapBtnTag = 0x5C1F4B;
|
||||
|
||||
static UIViewController *sciTopMost(void) {
|
||||
UIWindow *win = nil;
|
||||
for (UIScene *sc in [UIApplication sharedApplication].connectedScenes) {
|
||||
if (![sc isKindOfClass:[UIWindowScene class]]) continue;
|
||||
for (UIWindow *w in ((UIWindowScene *)sc).windows) if (w.isKeyWindow) { win = w; break; }
|
||||
if (win) break;
|
||||
}
|
||||
UIViewController *v = win.rootViewController;
|
||||
while (v.presentedViewController) v = v.presentedViewController;
|
||||
return v;
|
||||
}
|
||||
|
||||
static void sciRefreshMapButton(UIView *mapView);
|
||||
static void sciAddMapButton(UIView *mapView);
|
||||
static void sciRemoveMapButton(UIView *mapView);
|
||||
static UIMenu *sciBuildMapMenu(void);
|
||||
|
||||
static void sciWalkMapViews(UIView *root, Class mapCls, void (^block)(UIView *)) {
|
||||
if (!root) return;
|
||||
if (mapCls && [root isKindOfClass:mapCls]) block(root);
|
||||
for (UIView *s in root.subviews) sciWalkMapViews(s, mapCls, block);
|
||||
}
|
||||
|
||||
static void sciRefreshActiveMapButton(void) {
|
||||
Class mapCls = NSClassFromString(@"IGFriendsMapCoreUI.IGFriendsMapView");
|
||||
for (UIScene *sc in [UIApplication sharedApplication].connectedScenes) {
|
||||
if (![sc isKindOfClass:[UIWindowScene class]]) continue;
|
||||
for (UIWindow *w in ((UIWindowScene *)sc).windows) {
|
||||
sciWalkMapViews(w, mapCls, ^(UIView *mv) {
|
||||
if (![SCIUtils getBoolPref:@"show_fake_location_map_button"]) {
|
||||
sciRemoveMapButton(mv);
|
||||
} else {
|
||||
sciAddMapButton(mv);
|
||||
sciRefreshMapButton(mv);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sciOpenPickerForCurrent(void) {
|
||||
UIViewController *top = sciTopMost();
|
||||
if (!top) return;
|
||||
SCIFakeLocationPickerVC *vc = [SCIFakeLocationPickerVC new];
|
||||
NSUserDefaults *d = [NSUserDefaults standardUserDefaults];
|
||||
vc.initialCoord = CLLocationCoordinate2DMake([[d objectForKey:@"fake_location_lat"] doubleValue],
|
||||
[[d objectForKey:@"fake_location_lon"] doubleValue]);
|
||||
vc.titleText = SCILocalized(@"Set location");
|
||||
vc.onPick = ^(double lat, double lon, NSString *name) {
|
||||
NSUserDefaults *u = [NSUserDefaults standardUserDefaults];
|
||||
[u setObject:@(lat) forKey:@"fake_location_lat"];
|
||||
[u setObject:@(lon) forKey:@"fake_location_lon"];
|
||||
[u setObject:(name ?: @"") forKey:@"fake_location_name"];
|
||||
if (![u boolForKey:@"fake_location_enabled"]) [u setBool:YES forKey:@"fake_location_enabled"];
|
||||
sciRefreshActiveMapButton();
|
||||
};
|
||||
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
|
||||
nav.modalPresentationStyle = UIModalPresentationPageSheet;
|
||||
[top presentViewController:nav animated:YES completion:nil];
|
||||
}
|
||||
|
||||
static void sciOpenPickerForNewPreset(void) {
|
||||
UIViewController *top = sciTopMost();
|
||||
if (!top) return;
|
||||
SCIFakeLocationPickerVC *vc = [SCIFakeLocationPickerVC new];
|
||||
NSUserDefaults *d = [NSUserDefaults standardUserDefaults];
|
||||
vc.initialCoord = CLLocationCoordinate2DMake([[d objectForKey:@"fake_location_lat"] doubleValue],
|
||||
[[d objectForKey:@"fake_location_lon"] doubleValue]);
|
||||
vc.titleText = SCILocalized(@"Add preset");
|
||||
vc.onPick = ^(double lat, double lon, NSString *name) {
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:SCILocalized(@"Save preset")
|
||||
message:nil
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
[alert addTextFieldWithConfigurationHandler:^(UITextField *tf) { tf.placeholder = SCILocalized(@"Name"); tf.text = name; }];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:SCILocalized(@"Cancel") style:UIAlertActionStyleCancel handler:nil]];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:SCILocalized(@"Save") style:UIAlertActionStyleDefault handler:^(__unused UIAlertAction *a) {
|
||||
NSString *n = alert.textFields.firstObject.text.length ? alert.textFields.firstObject.text : name;
|
||||
NSUserDefaults *u = [NSUserDefaults standardUserDefaults];
|
||||
NSArray *raw = [u objectForKey:@"fake_location_presets"];
|
||||
NSMutableArray *presets = [raw isKindOfClass:[NSArray class]] ? [raw mutableCopy] : [NSMutableArray array];
|
||||
[presets addObject:@{@"name": n ?: @"", @"lat": @(lat), @"lon": @(lon)}];
|
||||
[u setObject:presets forKey:@"fake_location_presets"];
|
||||
sciRefreshActiveMapButton();
|
||||
}]];
|
||||
[sciTopMost() presentViewController:alert animated:YES completion:nil];
|
||||
};
|
||||
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
|
||||
nav.modalPresentationStyle = UIModalPresentationPageSheet;
|
||||
[top presentViewController:nav animated:YES completion:nil];
|
||||
}
|
||||
|
||||
static UIMenu *sciBuildMapMenu(void) {
|
||||
NSUserDefaults *d = [NSUserDefaults standardUserDefaults];
|
||||
BOOL enabled = [d boolForKey:@"fake_location_enabled"];
|
||||
NSString *name = [d objectForKey:@"fake_location_name"] ?: @"(unset)";
|
||||
|
||||
// Header section: current location (disabled), enable/disable, change location
|
||||
UIAction *header = [UIAction actionWithTitle:[NSString stringWithFormat:SCILocalized(@"Current: %@"), name]
|
||||
image:[UIImage systemImageNamed:@"mappin.and.ellipse"]
|
||||
identifier:nil handler:^(__unused UIAction *a) {}];
|
||||
header.attributes = UIMenuElementAttributesDisabled;
|
||||
|
||||
UIAction *toggle = [UIAction actionWithTitle:enabled ? SCILocalized(@"Disable") : SCILocalized(@"Enable")
|
||||
image:[UIImage systemImageNamed:enabled ? @"location.slash.fill" : @"location.fill"]
|
||||
identifier:nil
|
||||
handler:^(__unused UIAction *a) {
|
||||
[d setBool:!enabled forKey:@"fake_location_enabled"];
|
||||
sciRefreshActiveMapButton();
|
||||
}];
|
||||
if (enabled) toggle.attributes = UIMenuElementAttributesDestructive;
|
||||
|
||||
UIAction *change = [UIAction actionWithTitle:SCILocalized(@"Change location")
|
||||
image:[UIImage systemImageNamed:@"map"]
|
||||
identifier:nil
|
||||
handler:^(__unused UIAction *a) { sciOpenPickerForCurrent(); }];
|
||||
|
||||
UIMenu *headerSection = [UIMenu menuWithTitle:@"" image:nil identifier:nil
|
||||
options:UIMenuOptionsDisplayInline children:@[header, toggle, change]];
|
||||
|
||||
// Presets + Add
|
||||
NSMutableArray<UIMenuElement *> *presetItems = [NSMutableArray array];
|
||||
NSArray *presets = [d objectForKey:@"fake_location_presets"];
|
||||
if ([presets isKindOfClass:[NSArray class]]) {
|
||||
for (NSDictionary *p in presets) {
|
||||
if (![p isKindOfClass:[NSDictionary class]]) continue;
|
||||
NSString *pname = p[@"name"] ?: @"Preset";
|
||||
BOOL active = [p[@"name"] isEqualToString:name];
|
||||
UIAction *act = [UIAction actionWithTitle:pname
|
||||
image:[UIImage systemImageNamed:@"mappin.circle.fill"]
|
||||
identifier:nil
|
||||
handler:^(__unused UIAction *x) {
|
||||
[d setObject:p[@"lat"] forKey:@"fake_location_lat"];
|
||||
[d setObject:p[@"lon"] forKey:@"fake_location_lon"];
|
||||
[d setObject:p[@"name"] ?: @"" forKey:@"fake_location_name"];
|
||||
if (![d boolForKey:@"fake_location_enabled"]) [d setBool:YES forKey:@"fake_location_enabled"];
|
||||
sciRefreshActiveMapButton();
|
||||
}];
|
||||
if (active) act.state = UIMenuElementStateOn;
|
||||
[presetItems addObject:act];
|
||||
}
|
||||
}
|
||||
[presetItems addObject:[UIAction actionWithTitle:SCILocalized(@"Add location")
|
||||
image:[UIImage systemImageNamed:@"plus.circle.fill"]
|
||||
identifier:nil
|
||||
handler:^(__unused UIAction *x) { sciOpenPickerForNewPreset(); }]];
|
||||
UIMenu *presetSection = [UIMenu menuWithTitle:SCILocalized(@"Saved locations") image:nil identifier:nil
|
||||
options:UIMenuOptionsDisplayInline children:presetItems];
|
||||
|
||||
// Settings
|
||||
UIAction *openSettings = [UIAction actionWithTitle:SCILocalized(@"Settings…")
|
||||
image:[UIImage systemImageNamed:@"gearshape.fill"]
|
||||
identifier:nil
|
||||
handler:^(__unused UIAction *x) {
|
||||
UIViewController *top = sciTopMost();
|
||||
if (!top) return;
|
||||
SCIFakeLocationSettingsVC *vc = [SCIFakeLocationSettingsVC new];
|
||||
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
|
||||
nav.modalPresentationStyle = UIModalPresentationFormSheet;
|
||||
[top presentViewController:nav animated:YES completion:nil];
|
||||
}];
|
||||
UIMenu *settingsSection = [UIMenu menuWithTitle:@"" image:nil identifier:nil
|
||||
options:UIMenuOptionsDisplayInline children:@[openSettings]];
|
||||
|
||||
return [UIMenu menuWithTitle:SCILocalized(@"Fake location") image:nil identifier:nil options:0
|
||||
children:@[headerSection, presetSection, settingsSection]];
|
||||
}
|
||||
|
||||
static void sciRemoveMapButton(UIView *mapView) {
|
||||
UIView *btn = [mapView viewWithTag:kSciMapBtnTag];
|
||||
if (btn) [btn removeFromSuperview];
|
||||
}
|
||||
|
||||
static void sciAddMapButton(UIView *mapView) {
|
||||
if (!mapView) return;
|
||||
if (![SCIUtils getBoolPref:@"show_fake_location_map_button"]) { sciRemoveMapButton(mapView); return; }
|
||||
if ([mapView viewWithTag:kSciMapBtnTag]) return;
|
||||
|
||||
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
btn.tag = kSciMapBtnTag;
|
||||
btn.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
btn.backgroundColor = [UIColor secondarySystemBackgroundColor];
|
||||
btn.layer.cornerRadius = 24;
|
||||
btn.layer.shadowColor = [UIColor blackColor].CGColor;
|
||||
btn.layer.shadowOpacity = 0.18;
|
||||
btn.layer.shadowRadius = 5;
|
||||
btn.layer.shadowOffset = CGSizeMake(0, 2);
|
||||
btn.showsMenuAsPrimaryAction = YES;
|
||||
btn.menu = sciBuildMapMenu();
|
||||
|
||||
// Refresh menu on each press so toggle/preset state is current.
|
||||
[btn addAction:[UIAction actionWithHandler:^(__unused UIAction *a) {
|
||||
btn.menu = sciBuildMapMenu();
|
||||
}] forControlEvents:UIControlEventMenuActionTriggered];
|
||||
|
||||
[mapView addSubview:btn];
|
||||
[NSLayoutConstraint activateConstraints:@[
|
||||
[btn.leadingAnchor constraintEqualToAnchor:mapView.leadingAnchor constant:16],
|
||||
[btn.topAnchor constraintEqualToAnchor:mapView.safeAreaLayoutGuide.topAnchor constant:78],
|
||||
[btn.widthAnchor constraintEqualToConstant:48],
|
||||
[btn.heightAnchor constraintEqualToConstant:48],
|
||||
]];
|
||||
}
|
||||
|
||||
static void sciRefreshMapButton(UIView *mapView) {
|
||||
UIButton *btn = (UIButton *)[mapView viewWithTag:kSciMapBtnTag];
|
||||
if (!btn) return;
|
||||
BOOL on = [SCIUtils getBoolPref:@"fake_location_enabled"];
|
||||
UIImageSymbolConfiguration *cfg = [UIImageSymbolConfiguration configurationWithPointSize:18 weight:UIImageSymbolWeightSemibold];
|
||||
[btn setImage:[UIImage systemImageNamed:on ? @"location.fill" : @"location.slash" withConfiguration:cfg] forState:UIControlStateNormal];
|
||||
btn.tintColor = on ? [UIColor systemGreenColor] : [UIColor labelColor];
|
||||
btn.menu = sciBuildMapMenu();
|
||||
}
|
||||
|
||||
static void (*orig_mapLayout)(UIView *, SEL);
|
||||
static void new_mapLayout(UIView *self, SEL _cmd) {
|
||||
orig_mapLayout(self, _cmd);
|
||||
if (![SCIUtils getBoolPref:@"show_fake_location_map_button"]) {
|
||||
sciRemoveMapButton(self);
|
||||
return;
|
||||
}
|
||||
sciAddMapButton(self);
|
||||
sciRefreshMapButton(self);
|
||||
UIView *btn = [self viewWithTag:kSciMapBtnTag];
|
||||
if (btn) [self bringSubviewToFront:btn];
|
||||
}
|
||||
|
||||
static void sciInstallMapHooks(void) {
|
||||
static BOOL installed = NO;
|
||||
if (installed) return;
|
||||
Class c = NSClassFromString(@"IGFriendsMapCoreUI.IGFriendsMapView");
|
||||
if (!c) return;
|
||||
installed = YES;
|
||||
SEL sel = @selector(layoutSubviews);
|
||||
if (class_getInstanceMethod(c, sel))
|
||||
MSHookMessageEx(c, sel, (IMP)new_mapLayout, (IMP *)&orig_mapLayout);
|
||||
}
|
||||
|
||||
%ctor {
|
||||
sciInstallMapHooks();
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
sciInstallMapHooks();
|
||||
});
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:@"SCIFakeLocationMapBtnPrefChanged"
|
||||
object:nil
|
||||
queue:[NSOperationQueue mainQueue]
|
||||
usingBlock:^(__unused NSNotification *n) {
|
||||
sciRefreshActiveMapButton();
|
||||
}];
|
||||
}
|
||||
Reference in New Issue
Block a user