GLEGram 12.5 — Initial public release

Based on Swiftgram 12.5 (Telegram iOS 12.5).
All GLEGram features ported and organized in GLEGram/ folder.

Features: Ghost Mode, Saved Deleted Messages, Content Protection Bypass,
Font Replacement, Fake Profile, Chat Export, Plugin System, and more.

See CHANGELOG_12.5.md for full details.
This commit is contained in:
Leeksov
2026-04-06 09:48:12 +03:00
commit 4647310322
39685 changed files with 11052678 additions and 0 deletions
@@ -0,0 +1,21 @@
import SGSimpleSettings
import Foundation
import SwiftSignalKit
public func sgSimpleSettingsBoolSignal(_ key: SGSimpleSettings.Keys, defaultValue: Bool) -> Signal<Bool, NoError> {
let initial = Signal<Bool, NoError>.single(UserDefaults.standard.object(forKey: key.rawValue) as? Bool ?? defaultValue)
let changes = Signal<Bool, NoError> { subscriber in
let observer = NotificationCenter.default.addObserver(
forName: UserDefaults.didChangeNotification,
object: UserDefaults.standard,
queue: nil
) { _ in
let value = UserDefaults.standard.object(forKey: key.rawValue) as? Bool ?? defaultValue
subscriber.putNext(value)
}
return ActionDisposable {
NotificationCenter.default.removeObserver(observer)
}
}
return (initial |> then(changes)) |> distinctUntilChanged
}
@@ -0,0 +1,60 @@
import SGSimpleSettings
import CoreGraphics
import Display
enum SGCompactMessagePreviewLayout {
static func isEnabled() -> Bool {
(SGSimpleSettings.ChatListLines(rawValue: SGSimpleSettings.shared.chatListLines) ?? .three) != .three
}
static func avatarScaleDivisor(compactChatList: Bool, compactMessagePreview: Bool) -> CGFloat {
compactChatList ? 1.5 : (compactMessagePreview ? 1.1 : 1.0)
}
static func forumTopicIconYOffset(compactMessagePreview: Bool) -> CGFloat {
compactMessagePreview ? 8.0 : 0.0
}
static func badgeOffset(sizeFactor: CGFloat, compactMessagePreview: Bool, compactChatList: Bool) -> CGFloat {
guard compactMessagePreview && !compactChatList else {
return 0.0
}
let sizeRange: CGFloat = 0.5
let maxLift: CGFloat = 16.0
let maxDownshift: CGFloat = 24.0
let sizeDelta = sizeFactor - 1.0
let lift: CGFloat
if sizeDelta >= 0.0 {
let sizeGrow = min(sizeRange, sizeDelta)
let sizeGrowFactor = sizeGrow / sizeRange
lift = maxLift * sizeGrowFactor * sizeGrowFactor * (3.0 - 2.0 * sizeGrowFactor)
} else {
let sizeShrink = min(sizeRange, -sizeDelta)
let sizeShrinkFactor = sizeShrink / sizeRange
let downshift = maxDownshift * sizeShrinkFactor * sizeShrinkFactor * (3.0 - 2.0 * sizeShrinkFactor)
lift = -downshift
}
return floorToScreenPixels(lift)
}
static func textVerticalOffset(sizeFactor: CGFloat, compactMessagePreview: Bool, compactChatList: Bool, hasAuthorLine: Bool) -> CGFloat {
guard compactMessagePreview && !compactChatList && !hasAuthorLine else {
return 0.0
}
return floorToScreenPixels(6.0 * sizeFactor)
}
static func titleTextSpacing(sizeFactor: CGFloat, compactMessagePreview: Bool, compactChatList: Bool, hasAuthorLine: Bool) -> CGFloat {
guard compactMessagePreview && !compactChatList && !hasAuthorLine else {
return 0.0
}
return floorToScreenPixels(6.0 * sizeFactor)
}
static func textBlockOffset(sizeFactor: CGFloat, compactMessagePreview: Bool, compactChatList: Bool, hasAuthorLine: Bool) -> CGFloat {
textVerticalOffset(sizeFactor: sizeFactor, compactMessagePreview: compactMessagePreview, compactChatList: compactChatList, hasAuthorLine: hasAuthorLine)
+ titleTextSpacing(sizeFactor: sizeFactor, compactMessagePreview: compactMessagePreview, compactChatList: compactChatList, hasAuthorLine: hasAuthorLine)
}
}