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,5 @@
#include "Font.hpp"
namespace lottie {
}
@@ -0,0 +1,103 @@
#ifndef Font_hpp
#define Font_hpp
#include "Lottie/Private/Parsing/JsonParsing.hpp"
#include <string>
#include <vector>
namespace lottie {
class Font {
public:
Font(
std::string const &name_,
std::string const &familyName_,
std::string const &style_,
float ascent_
) :
name(name_),
familyName(familyName_),
style(style_),
ascent(ascent_) {
}
explicit Font(lottiejson11::Json::object const &json) noexcept(false) {
name = getString(json, "fName");
familyName = getString(json, "fFamily");
path = getOptionalString(json, "fPath");
weight = getOptionalString(json, "fWeight");
fontClass = getOptionalString(json, "fClass");
style = getString(json, "fStyle");
ascent = (float)getDouble(json, "ascent");
origin = getOptionalInt(json, "origin");
}
lottiejson11::Json::object toJson() const {
lottiejson11::Json::object result;
result.insert(std::make_pair("fName", name));
result.insert(std::make_pair("fFamily", familyName));
if (path.has_value()) {
result.insert(std::make_pair("fPath", path.value()));
}
if (weight.has_value()) {
result.insert(std::make_pair("fWeight", weight.value()));
}
if (fontClass.has_value()) {
result.insert(std::make_pair("fClass", fontClass.value()));
}
result.insert(std::make_pair("fStyle", style));
result.insert(std::make_pair("ascent", ascent));
if (origin.has_value()) {
result.insert(std::make_pair("origin", origin.value()));
}
return result;
}
public:
std::string name;
std::string familyName;
std::optional<std::string> path;
std::optional<std::string> weight;
std::optional<std::string> fontClass;
std::string style;
float ascent;
std::optional<int> origin;
};
/// A list of fonts
class FontList {
public:
FontList(std::vector<Font> const &fonts_) :
fonts(fonts_) {
}
explicit FontList(lottiejson11::Json::object const &json) noexcept(false) {
if (const auto fontsData = getOptionalObjectArray(json, "list")) {
for (const auto &fontData : fontsData.value()) {
fonts.emplace_back(fontData);
}
}
}
lottiejson11::Json::object toJson() const {
lottiejson11::Json::array fontArray;
for (const auto &font : fonts) {
fontArray.push_back(font.toJson());
}
lottiejson11::Json::object result;
result.insert(std::make_pair("list", fontArray));
return result;
}
public:
std::vector<Font> fonts;
};
}
#endif /* Font_hpp */
@@ -0,0 +1,5 @@
#include "Glyph.hpp"
namespace lottie {
}
@@ -0,0 +1,108 @@
#ifndef Glyph_hpp
#define Glyph_hpp
#include "Lottie/Private/Model/ShapeItems/ShapeItem.hpp"
#include "Lottie/Private/Parsing/JsonParsing.hpp"
#include <string>
#include <vector>
namespace lottie {
class Glyph {
public:
Glyph(
std::string const &character_,
float fontSize_,
std::string const &fontFamily_,
std::string const &fontStyle_,
float width_,
std::optional<std::vector<std::shared_ptr<ShapeItem>>> shapes_
) :
character(character_),
fontSize(fontSize_),
fontFamily(fontFamily_),
fontStyle(fontStyle_),
width(width_),
shapes(shapes_) {
}
explicit Glyph(lottiejson11::Json::object const &json) noexcept(false) :
character(""),
fontSize(0.0),
fontFamily(""),
fontStyle(""),
width(0.0) {
character = getString(json, "ch");
fontSize = (float)getDouble(json, "size");
fontFamily = getString(json, "fFamily");
fontStyle = getString(json, "style");
width = (float)getDouble(json, "w");
if (const auto shapeContainer = getOptionalObject(json, "data")) {
internalHasData = true;
if (const auto shapesData = getOptionalObjectArray(shapeContainer.value(), "shapes")) {
shapes = std::vector<std::shared_ptr<ShapeItem>>();
for (const auto &shapeData : shapesData.value()) {
shapes->push_back(parseShapeItem(shapeData));
}
}
}
}
lottiejson11::Json::object toJson() const {
lottiejson11::Json::object result;
result.insert(std::make_pair("ch", character));
result.insert(std::make_pair("size", fontSize));
result.insert(std::make_pair("fFamily", fontFamily));
result.insert(std::make_pair("style", fontStyle));
result.insert(std::make_pair("w", width));
if (internalHasData || shapes.has_value()) {
lottiejson11::Json::object shapeContainer;
if (shapes.has_value()) {
lottiejson11::Json::array shapeArray;
for (const auto &shape : shapes.value()) {
lottiejson11::Json::object shapeJson;
shape->toJson(shapeJson);
shapeArray.push_back(shapeJson);
}
shapeContainer.insert(std::make_pair("shapes", shapeArray));
}
result.insert(std::make_pair("data", shapeContainer));
}
return result;
}
public:
/// The character
std::string character;
/// The font size of the character
float fontSize;
/// The font family of the character
std::string fontFamily;
/// The Style of the character
std::string fontStyle;
/// The Width of the character
float width;
/// The Shape Data of the Character
std::optional<std::vector<std::shared_ptr<ShapeItem>>> shapes;
bool internalHasData = false;
};
}
#endif /* Glyph_hpp */
@@ -0,0 +1,5 @@
#include "TextAnimator.hpp"
namespace lottie {
}
@@ -0,0 +1,183 @@
#ifndef TextAnimator_hpp
#define TextAnimator_hpp
#include <LottieCpp/Vectors.h>
#import <LottieCpp/Color.h>
#include "Lottie/Private/Model/Keyframes/KeyframeGroup.hpp"
#include "Lottie/Private/Parsing/JsonParsing.hpp"
#include <string>
#include <optional>
namespace lottie {
class TextAnimator {
public:
TextAnimator(
std::optional<std::string> &name_,
std::optional<KeyframeGroup<Vector3D>> anchor_,
std::optional<KeyframeGroup<Vector3D>> position_,
std::optional<KeyframeGroup<Vector3D>> scale_,
std::optional<KeyframeGroup<Vector1D>> skew_,
std::optional<KeyframeGroup<Vector1D>> skewAxis_,
std::optional<KeyframeGroup<Vector1D>> rotation_,
std::optional<KeyframeGroup<Vector1D>> opacity_,
std::optional<KeyframeGroup<Color>> strokeColor_,
std::optional<KeyframeGroup<Color>> fillColor_,
std::optional<KeyframeGroup<Vector1D>> strokeWidth_,
std::optional<KeyframeGroup<Vector1D>> tracking_
) :
name(name_),
anchor(anchor_),
position(position_),
scale(scale_),
skew(skew_),
skewAxis(skewAxis_),
rotation(rotation_),
opacity(opacity_),
strokeColor(strokeColor_),
fillColor(fillColor_),
strokeWidth(strokeWidth_),
tracking(tracking_) {
}
explicit TextAnimator(lottiejson11::Json const &jsonAny) {
if (!jsonAny.is_object()) {
throw LottieParsingException();
}
lottiejson11::Json::object const &json = jsonAny.object_items();
if (const auto nameData = getOptionalString(json, "nm")) {
name = nameData.value();
}
_extraS = getOptionalAny(json, "s");
lottiejson11::Json::object const &animatorContainer = getObject(json, "a");
if (const auto fillColorData = getOptionalObject(animatorContainer, "fc")) {
fillColor = KeyframeGroup<Color>(fillColorData.value());
}
if (const auto strokeColorData = getOptionalObject(animatorContainer, "sc")) {
strokeColor = KeyframeGroup<Color>(strokeColorData.value());
}
if (const auto strokeWidthData = getOptionalObject(animatorContainer, "sw")) {
strokeWidth = KeyframeGroup<Vector1D>(strokeWidthData.value());
}
if (const auto trackingData = getOptionalObject(animatorContainer, "t")) {
tracking = KeyframeGroup<Vector1D>(trackingData.value());
}
if (const auto anchorData = getOptionalObject(animatorContainer, "a")) {
anchor = KeyframeGroup<Vector3D>(anchorData.value());
}
if (const auto positionData = getOptionalObject(animatorContainer, "p")) {
position = KeyframeGroup<Vector3D>(positionData.value());
}
if (const auto scaleData = getOptionalObject(animatorContainer, "s")) {
scale = KeyframeGroup<Vector3D>(scaleData.value());
}
if (const auto skewData = getOptionalObject(animatorContainer, "sk")) {
skew = KeyframeGroup<Vector1D>(skewData.value());
}
if (const auto skewAxisData = getOptionalObject(animatorContainer, "sa")) {
skewAxis = KeyframeGroup<Vector1D>(skewAxisData.value());
}
if (const auto rotationData = getOptionalObject(animatorContainer, "r")) {
rotation = KeyframeGroup<Vector1D>(rotationData.value());
}
if (const auto opacityData = getOptionalObject(animatorContainer, "o")) {
opacity = KeyframeGroup<Vector1D>(opacityData.value());
}
}
lottiejson11::Json::object toJson() const {
lottiejson11::Json::object animatorContainer;
if (fillColor.has_value()) {
animatorContainer.insert(std::make_pair("fc", fillColor->toJson()));
}
if (strokeColor.has_value()) {
animatorContainer.insert(std::make_pair("sc", strokeColor->toJson()));
}
if (strokeWidth.has_value()) {
animatorContainer.insert(std::make_pair("sw", strokeWidth->toJson()));
}
if (tracking.has_value()) {
animatorContainer.insert(std::make_pair("t", tracking->toJson()));
}
if (anchor.has_value()) {
animatorContainer.insert(std::make_pair("a", anchor->toJson()));
}
if (position.has_value()) {
animatorContainer.insert(std::make_pair("p", position->toJson()));
}
if (scale.has_value()) {
animatorContainer.insert(std::make_pair("s", scale->toJson()));
}
if (skew.has_value()) {
animatorContainer.insert(std::make_pair("sk", skew->toJson()));
}
if (skewAxis.has_value()) {
animatorContainer.insert(std::make_pair("sa", skewAxis->toJson()));
}
if (rotation.has_value()) {
animatorContainer.insert(std::make_pair("r", rotation->toJson()));
}
if (opacity.has_value()) {
animatorContainer.insert(std::make_pair("o", opacity->toJson()));
}
lottiejson11::Json::object result;
result.insert(std::make_pair("a", animatorContainer));
if (name.has_value()) {
result.insert(std::make_pair("nm", name.value()));
}
if (_extraS.has_value()) {
result.insert(std::make_pair("s", _extraS.value()));
}
return result;
}
public:
std::optional<std::string> name;
/// Anchor
std::optional<KeyframeGroup<Vector3D>> anchor;
/// Position
std::optional<KeyframeGroup<Vector3D>> position;
/// Scale
std::optional<KeyframeGroup<Vector3D>> scale;
/// Skew
std::optional<KeyframeGroup<Vector1D>> skew;
/// Skew Axis
std::optional<KeyframeGroup<Vector1D>> skewAxis;
/// Rotation
std::optional<KeyframeGroup<Vector1D>> rotation;
/// Opacity
std::optional<KeyframeGroup<Vector1D>> opacity;
/// Stroke Color
std::optional<KeyframeGroup<Color>> strokeColor;
/// Fill Color
std::optional<KeyframeGroup<Color>> fillColor;
/// Stroke Width
std::optional<KeyframeGroup<Vector1D>> strokeWidth;
/// Tracking
std::optional<KeyframeGroup<Vector1D>> tracking;
std::optional<lottiejson11::Json> _extraS;
};
}
#endif /* TextAnimator_hpp */
@@ -0,0 +1,5 @@
#include "TextDocument.hpp"
namespace lottie {
}
@@ -0,0 +1,190 @@
#ifndef TextDocument_hpp
#define TextDocument_hpp
#include <LottieCpp/Vectors.h>
#import <LottieCpp/Color.h>
#include "Lottie/Private/Parsing/JsonParsing.hpp"
#include <string>
#include <optional>
namespace lottie {
enum class TextJustification: int {
Left = 0,
Right = 1,
Center = 2
};
class TextDocument {
public:
TextDocument(
std::string const &text_,
float fontSize_,
std::string const &fontFamily_,
TextJustification justification_,
int tracking_,
float lineHeight_,
std::optional<float> baseline_,
std::optional<Color> fillColorData_,
std::optional<Color> strokeColorData_,
std::optional<float> strokeWidth_,
std::optional<bool> strokeOverFill_,
std::optional<Vector3D> textFramePosition_,
std::optional<Vector3D> textFrameSize_
) :
text(text_),
fontSize(fontSize_),
fontFamily(fontFamily_),
justification(justification_),
tracking(tracking_),
lineHeight(lineHeight_),
baseline(baseline_),
fillColorData(fillColorData_),
strokeColorData(strokeColorData_),
strokeWidth(strokeWidth_),
strokeOverFill(strokeOverFill_),
textFramePosition(textFramePosition_),
textFrameSize(textFrameSize_) {
}
explicit TextDocument(lottiejson11::Json const &jsonAny) noexcept(false) :
text(""),
fontSize(0.0),
fontFamily(""),
justification(TextJustification::Left),
tracking(0),
lineHeight(0.0) {
if (!jsonAny.is_object()) {
throw LottieParsingException();
}
lottiejson11::Json::object const &json = jsonAny.object_items();
text = getString(json, "t");
fontSize = (float)getDouble(json, "s");
fontFamily = getString(json, "f");
auto justificationRawValue = getInt(json, "j");
switch (justificationRawValue) {
case 0:
justification = TextJustification::Left;
break;
case 1:
justification = TextJustification::Right;
break;
case 2:
justification = TextJustification::Center;
break;
default:
throw LottieParsingException();
}
tracking = getInt(json, "tr");
lineHeight = (float)getDouble(json, "lh");
if (const auto baselineValue = getOptionalDouble(json, "ls")) {
baseline = (float)baselineValue.value();
}
if (const auto fillColorDataValue = getOptionalAny(json, "fc")) {
fillColorData = Color(fillColorDataValue.value());
}
if (const auto strokeColorDataValue = getOptionalAny(json, "sc")) {
strokeColorData = Color(strokeColorDataValue.value());
}
if (const auto strokeWidthValue = getOptionalDouble(json, "sw")) {
strokeWidth = (float)strokeWidthValue.value();
}
if (const auto strokeOverFillValue = getOptionalBool(json, "of")) {
strokeOverFill = (float)strokeOverFillValue.value();
}
if (const auto textFramePositionData = getOptionalAny(json, "ps")) {
textFramePosition = Vector3D(textFramePositionData.value());
}
if (const auto textFrameSizeData = getOptionalAny(json, "sz")) {
textFrameSize = Vector3D(textFrameSizeData.value());
}
}
lottiejson11::Json::object toJson() const {
lottiejson11::Json::object result;
result.insert(std::make_pair("t", text));
result.insert(std::make_pair("s", fontSize));
result.insert(std::make_pair("f", fontFamily));
result.insert(std::make_pair("j", (int)justification));
result.insert(std::make_pair("tr", tracking));
result.insert(std::make_pair("lh", lineHeight));
if (baseline.has_value()) {
result.insert(std::make_pair("ls", baseline.value()));
}
if (fillColorData.has_value()) {
result.insert(std::make_pair("fc", fillColorData->toJson()));
}
if (strokeColorData.has_value()) {
result.insert(std::make_pair("sc", strokeColorData->toJson()));
}
if (strokeWidth.has_value()) {
result.insert(std::make_pair("sw", strokeWidth.value()));
}
if (strokeOverFill.has_value()) {
result.insert(std::make_pair("of", strokeOverFill.value()));
}
if (textFramePosition.has_value()) {
result.insert(std::make_pair("ps", textFramePosition->toJson()));
}
if (textFrameSize.has_value()) {
result.insert(std::make_pair("sz", textFrameSize->toJson()));
}
return result;
}
public:
/// The Text
std::string text;
/// The Font size
float fontSize;
/// The Font Family
std::string fontFamily;
/// Justification
TextJustification justification;
/// Tracking
int tracking;
/// Line Height
float lineHeight;
/// Baseline
std::optional<float> baseline;
/// Fill Color data
std::optional<Color> fillColorData;
/// Scroke Color data
std::optional<Color> strokeColorData;
/// Stroke Width
std::optional<float> strokeWidth;
/// Stroke Over Fill
std::optional<bool> strokeOverFill;
std::optional<Vector3D> textFramePosition;
std::optional<Vector3D> textFrameSize;
};
}
#endif /* TextDocument_hpp */