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,44 @@
//
// DashPattern.swift
// lottie-swift
//
// Created by Brandon Withrow on 1/22/19.
//
import Foundation
// MARK: - DashElementType
enum DashElementType: String, Codable {
case offset = "o"
case dash = "d"
case gap = "g"
}
// MARK: - DashElement
final class DashElement: Codable, DictionaryInitializable {
// MARK: Lifecycle
init(dictionary: [String: Any]) throws {
let typeRawValue: String = try dictionary.value(for: CodingKeys.type)
guard let type = DashElementType(rawValue: typeRawValue) else {
throw InitializableError.invalidInput
}
self.type = type
let valueDictionary: [String: Any] = try dictionary.value(for: CodingKeys.value)
value = try KeyframeGroup<Vector1D>(dictionary: valueDictionary)
}
// MARK: Internal
enum CodingKeys: String, CodingKey {
case type = "n"
case value = "v"
}
let type: DashElementType
let value: KeyframeGroup<Vector1D>
}
@@ -0,0 +1,33 @@
//
// Marker.swift
// lottie-swift
//
// Created by Brandon Withrow on 1/9/19.
//
import Foundation
/// A time marker
final class Marker: Codable, DictionaryInitializable {
// MARK: Lifecycle
init(dictionary: [String: Any]) throws {
name = try dictionary.value(for: CodingKeys.name)
frameTime = try dictionary.value(for: CodingKeys.frameTime)
}
// MARK: Internal
enum CodingKeys: String, CodingKey {
case name = "cm"
case frameTime = "tm"
}
/// The Marker Name
let name: String
/// The Frame time of the marker
let frameTime: AnimationFrameTime
}
@@ -0,0 +1,80 @@
//
// Mask.swift
// lottie-swift
//
// Created by Brandon Withrow on 1/8/19.
//
import Foundation
// MARK: - MaskMode
enum MaskMode: String, Codable {
case add = "a"
case subtract = "s"
case intersect = "i"
case lighten = "l"
case darken = "d"
case difference = "f"
case none = "n"
}
// MARK: - Mask
final class Mask: Codable, DictionaryInitializable {
// MARK: Lifecycle
required init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: Mask.CodingKeys.self)
mode = try container.decodeIfPresent(MaskMode.self, forKey: .mode) ?? .add
opacity = try container.decodeIfPresent(KeyframeGroup<Vector1D>.self, forKey: .opacity) ?? KeyframeGroup(Vector1D(100))
shape = try container.decode(KeyframeGroup<BezierPath>.self, forKey: .shape)
inverted = try container.decodeIfPresent(Bool.self, forKey: .inverted) ?? false
expansion = try container.decodeIfPresent(KeyframeGroup<Vector1D>.self, forKey: .expansion) ?? KeyframeGroup(Vector1D(0))
}
init(dictionary: [String: Any]) throws {
if
let modeRawType = dictionary[CodingKeys.mode.rawValue] as? String,
let mode = MaskMode(rawValue: modeRawType)
{
self.mode = mode
} else {
mode = .add
}
if let opacityDictionary = dictionary[CodingKeys.opacity.rawValue] as? [String: Any] {
opacity = try KeyframeGroup<Vector1D>(dictionary: opacityDictionary)
} else {
opacity = KeyframeGroup(Vector1D(100))
}
let shapeDictionary: [String: Any] = try dictionary.value(for: CodingKeys.shape)
shape = try KeyframeGroup<BezierPath>(dictionary: shapeDictionary)
inverted = (try? dictionary.value(for: CodingKeys.inverted)) ?? false
if let expansionDictionary = dictionary[CodingKeys.expansion.rawValue] as? [String: Any] {
expansion = try KeyframeGroup<Vector1D>(dictionary: expansionDictionary)
} else {
expansion = KeyframeGroup(Vector1D(0))
}
}
// MARK: Internal
enum CodingKeys: String, CodingKey {
case mode
case opacity = "o"
case inverted = "inv"
case shape = "pt"
case expansion = "x"
}
let mode: MaskMode
let opacity: KeyframeGroup<Vector1D>
let shape: KeyframeGroup<BezierPath>
let inverted: Bool
let expansion: KeyframeGroup<Vector1D>
}
@@ -0,0 +1,179 @@
//
// Transform.swift
// lottie-swift
//
// Created by Brandon Withrow on 1/7/19.
//
import Foundation
/// The animatable transform for a layer. Controls position, rotation, scale, and opacity.
final class Transform: Codable, DictionaryInitializable {
// MARK: Lifecycle
required init(from decoder: Decoder) throws {
/// This manual override of decode is required because we want to throw an error
/// in the case that there is not position data.
let container = try decoder.container(keyedBy: Transform.CodingKeys.self)
// AnchorPoint
anchorPoint = try container
.decodeIfPresent(KeyframeGroup<Vector3D>.self, forKey: .anchorPoint) ?? KeyframeGroup(Vector3D(x: Double(0), y: 0, z: 0))
// Position
if container.contains(.positionX), container.contains(.positionY) {
// Position dimensions are split into two keyframe groups
positionX = try container.decode(KeyframeGroup<Vector1D>.self, forKey: .positionX)
positionY = try container.decode(KeyframeGroup<Vector1D>.self, forKey: .positionY)
position = nil
} else if let positionKeyframes = try? container.decode(KeyframeGroup<Vector3D>.self, forKey: .position) {
// Position dimensions are a single keyframe group.
position = positionKeyframes
positionX = nil
positionY = nil
} else if
let positionContainer = try? container.nestedContainer(keyedBy: PositionCodingKeys.self, forKey: .position),
let positionX = try? positionContainer.decode(KeyframeGroup<Vector1D>.self, forKey: .positionX),
let positionY = try? positionContainer.decode(KeyframeGroup<Vector1D>.self, forKey: .positionY)
{
/// Position keyframes are split and nested.
self.positionX = positionX
self.positionY = positionY
position = nil
} else {
/// Default value.
position = KeyframeGroup(Vector3D(x: Double(0), y: 0, z: 0))
positionX = nil
positionY = nil
}
// Scale
scale = try container
.decodeIfPresent(KeyframeGroup<Vector3D>.self, forKey: .scale) ?? KeyframeGroup(Vector3D(x: Double(100), y: 100, z: 100))
// Rotation
if let rotationZ = try container.decodeIfPresent(KeyframeGroup<Vector1D>.self, forKey: .rotationZ) {
rotation = rotationZ
} else {
rotation = try container.decodeIfPresent(KeyframeGroup<Vector1D>.self, forKey: .rotation) ?? KeyframeGroup(Vector1D(0))
}
rotationZ = nil
// Opacity
opacity = try container.decodeIfPresent(KeyframeGroup<Vector1D>.self, forKey: .opacity) ?? KeyframeGroup(Vector1D(100))
}
init(dictionary: [String: Any]) throws {
if
let anchorPointDictionary = dictionary[CodingKeys.anchorPoint.rawValue] as? [String: Any],
let anchorPoint = try? KeyframeGroup<Vector3D>(dictionary: anchorPointDictionary)
{
self.anchorPoint = anchorPoint
} else {
anchorPoint = KeyframeGroup(Vector3D(x: Double(0), y: 0, z: 0))
}
if
let xDictionary = dictionary[CodingKeys.positionX.rawValue] as? [String: Any],
let yDictionary = dictionary[CodingKeys.positionY.rawValue] as? [String: Any]
{
positionX = try KeyframeGroup<Vector1D>(dictionary: xDictionary)
positionY = try KeyframeGroup<Vector1D>(dictionary: yDictionary)
position = nil
} else if
let positionDictionary = dictionary[CodingKeys.position.rawValue] as? [String: Any],
positionDictionary[KeyframeGroup<Vector3D>.KeyframeWrapperKey.keyframeData.rawValue] != nil
{
position = try KeyframeGroup<Vector3D>(dictionary: positionDictionary)
positionX = nil
positionY = nil
} else if
let positionDictionary = dictionary[CodingKeys.position.rawValue] as? [String: Any],
let xDictionary = positionDictionary[PositionCodingKeys.positionX.rawValue] as? [String: Any],
let yDictionary = positionDictionary[PositionCodingKeys.positionY.rawValue] as? [String: Any]
{
positionX = try KeyframeGroup<Vector1D>(dictionary: xDictionary)
positionY = try KeyframeGroup<Vector1D>(dictionary: yDictionary)
position = nil
} else {
position = KeyframeGroup(Vector3D(x: Double(0), y: 0, z: 0))
positionX = nil
positionY = nil
}
if
let scaleDictionary = dictionary[CodingKeys.scale.rawValue] as? [String: Any],
let scale = try? KeyframeGroup<Vector3D>(dictionary: scaleDictionary)
{
self.scale = scale
} else {
scale = KeyframeGroup(Vector3D(x: Double(100), y: 100, z: 100))
}
if
let rotationDictionary = dictionary[CodingKeys.rotationZ.rawValue] as? [String: Any],
let rotation = try? KeyframeGroup<Vector1D>(dictionary: rotationDictionary)
{
self.rotation = rotation
} else if
let rotationDictionary = dictionary[CodingKeys.rotation.rawValue] as? [String: Any],
let rotation = try? KeyframeGroup<Vector1D>(dictionary: rotationDictionary)
{
self.rotation = rotation
} else {
rotation = KeyframeGroup(Vector1D(0))
}
rotationZ = nil
if
let opacityDictionary = dictionary[CodingKeys.opacity.rawValue] as? [String: Any],
let opacity = try? KeyframeGroup<Vector1D>(dictionary: opacityDictionary)
{
self.opacity = opacity
} else {
opacity = KeyframeGroup(Vector1D(100))
}
}
// MARK: Internal
enum CodingKeys: String, CodingKey {
case anchorPoint = "a"
case position = "p"
case positionX = "px"
case positionY = "py"
case scale = "s"
case rotation = "r"
case rotationZ = "rz"
case opacity = "o"
}
enum PositionCodingKeys: String, CodingKey {
case split = "s"
case positionX = "x"
case positionY = "y"
}
/// The anchor point of the transform.
let anchorPoint: KeyframeGroup<Vector3D>
/// The position of the transform. This is nil if the position data was split.
let position: KeyframeGroup<Vector3D>?
/// The positionX of the transform. This is nil if the position property is set.
let positionX: KeyframeGroup<Vector1D>?
/// The positionY of the transform. This is nil if the position property is set.
let positionY: KeyframeGroup<Vector1D>?
/// The scale of the transform
let scale: KeyframeGroup<Vector3D>
/// The rotation of the transform. Note: This is single dimensional rotation.
let rotation: KeyframeGroup<Vector1D>
/// The opacity of the transform.
let opacity: KeyframeGroup<Vector1D>
/// Should always be nil.
let rotationZ: KeyframeGroup<Vector1D>?
}