forgertele 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. forgertele-1.0.0/ACKNOWLEDGMENTS.md +108 -0
  2. forgertele-1.0.0/CHANGELOG.md +997 -0
  3. forgertele-1.0.0/LICENSE +21 -0
  4. forgertele-1.0.0/MANIFEST.in +10 -0
  5. forgertele-1.0.0/PKG-INFO +99 -0
  6. forgertele-1.0.0/README.md +81 -0
  7. forgertele-1.0.0/SECURITY.md +98 -0
  8. forgertele-1.0.0/docs/examples/README.md +12 -0
  9. forgertele-1.0.0/docs/examples/batch-convert.md +75 -0
  10. forgertele-1.0.0/docs/examples/cli-quick-start.md +60 -0
  11. forgertele-1.0.0/docs/examples/convert-tdata-to-telethon.md +101 -0
  12. forgertele-1.0.0/docs/examples/convert-telethon-to-tdata.md +90 -0
  13. forgertele-1.0.0/docs/examples/docker.md +115 -0
  14. forgertele-1.0.0/docs/examples/pyrogram.md +130 -0
  15. forgertele-1.0.0/docs/examples/qr-login.md +135 -0
  16. forgertele-1.0.0/docs/examples/using-official-apis.md +159 -0
  17. forgertele-1.0.0/forgertele.egg-info/PKG-INFO +99 -0
  18. forgertele-1.0.0/forgertele.egg-info/SOURCES.txt +48 -0
  19. forgertele-1.0.0/forgertele.egg-info/dependency_links.txt +1 -0
  20. forgertele-1.0.0/forgertele.egg-info/entry_points.txt +2 -0
  21. forgertele-1.0.0/forgertele.egg-info/requires.txt +10 -0
  22. forgertele-1.0.0/forgertele.egg-info/top_level.txt +1 -0
  23. forgertele-1.0.0/pyproject.toml +44 -0
  24. forgertele-1.0.0/requirements.txt +3 -0
  25. forgertele-1.0.0/setup.cfg +4 -0
  26. forgertele-1.0.0/src/__init__.py +15 -0
  27. forgertele-1.0.0/src/__main__.py +272 -0
  28. forgertele-1.0.0/src/antiban.py +108 -0
  29. forgertele-1.0.0/src/api.py +897 -0
  30. forgertele-1.0.0/src/debug.py +174 -0
  31. forgertele-1.0.0/src/devices.json +5811 -0
  32. forgertele-1.0.0/src/devices.py +449 -0
  33. forgertele-1.0.0/src/exception.py +362 -0
  34. forgertele-1.0.0/src/py.typed +0 -0
  35. forgertele-1.0.0/src/session.py +116 -0
  36. forgertele-1.0.0/src/td/__init__.py +3 -0
  37. forgertele-1.0.0/src/td/account.py +1493 -0
  38. forgertele-1.0.0/src/td/auth.py +109 -0
  39. forgertele-1.0.0/src/td/configs.py +446 -0
  40. forgertele-1.0.0/src/td/mtp.py +522 -0
  41. forgertele-1.0.0/src/td/qdatastream.py +802 -0
  42. forgertele-1.0.0/src/td/shared.py +13 -0
  43. forgertele-1.0.0/src/td/storage.py +590 -0
  44. forgertele-1.0.0/src/td/tdesktop.py +891 -0
  45. forgertele-1.0.0/src/tl/__init__.py +1 -0
  46. forgertele-1.0.0/src/tl/configs.py +39 -0
  47. forgertele-1.0.0/src/tl/pyrogram_bridge.py +321 -0
  48. forgertele-1.0.0/src/tl/shared.py +1 -0
  49. forgertele-1.0.0/src/tl/telethon.py +1104 -0
  50. forgertele-1.0.0/src/utils.py +243 -0
@@ -0,0 +1,108 @@
1
+ # Acknowledgments
2
+
3
+ `opentele-ng` is a fork of [thedemons/opentele](https://github.com/thedemons/opentele),
4
+ released under MIT. The 11-phase modernization (May 2026) integrated work
5
+ from many sources — credit where credit is due.
6
+
7
+ ## Upstream
8
+
9
+ - **[thedemons](https://github.com/thedemons)** — original `opentele`
10
+ library (2022). All core architecture (`TDesktop`, `Account`, `MapData`,
11
+ `Storage`, `MTProto auth`) is from upstream. Without it, this fork would
12
+ not exist.
13
+
14
+ ## Contributing forks (integrated patches)
15
+
16
+ The fork analysis surveyed 40+ active forks of upstream; the following
17
+ contributed actual patches or specific discoveries that landed in
18
+ `opentele-ng`:
19
+
20
+ ### Phase 1 — Python 3.13/3.14 + PyQt6
21
+ - **[azamtoiri/opentele](https://github.com/azamtoiri/opentele)** — Python 3.13
22
+ fix approach: `crossDelete` extension + `__func__`-based bound method
23
+ comparison.
24
+ - **[iamlostshe/opentele](https://github.com/iamlostshe/opentele)** (deep fork
25
+ via AlreadyNobody) — pointed to `tgcrypto-pyrofork` as replacement for
26
+ abandoned `tgcrypto`.
27
+ - **[hustLer2k/opentele](https://github.com/hustLer2k/opentele)** (deep fork)
28
+ — UTF-8 encoding for `setup.py` README read (Windows fix).
29
+ - **[Snowing](https://github.com/Snowing)** — `account.py:186` fix: invalid
30
+ `map.stream >> legacyBackgroundKeyDay` (Python no-op) replaced with
31
+ `readUInt64()`.
32
+
33
+ ### Phase 1.5 — Wire-format fixes (verified against TDesktop C++)
34
+ - **[RobertAzovski/opentele](https://github.com/RobertAzovski/opentele)** —
35
+ discovered 4 new `lskType` keys for Telegram Desktop 5.x-6.x tdata format:
36
+ - `lskRoundPlaceholder` (0x1A) — single uint64
37
+ - `lskInlineBotsDownloads` (0x1B) — single uint64
38
+ - `lskMediaLastPlaybackPositions` (0x1C) — single uint64
39
+ - `lskBotStorages` (0x1D) — corrected wire format to
40
+ `Dict[PeerId, FileKey]` map after 3-AI code review (initial submission
41
+ was a single uint64).
42
+ - `lskPrefs` (0x1E) — found by Codex during AI review by direct source dive
43
+ into upstream Telegram Desktop C++ — not present in any community fork.
44
+
45
+ ### Phase 2 — 2026 device fingerprints
46
+ - **[Paramon/opentele](https://github.com/Paramon/opentele)** — base for
47
+ modern macOS device list + `_generate_tdesktop_app_version(unique_id)`.
48
+ - 2026 updates (Galaxy S26 series, M5 Mac lineup, iPhone 17 / Air, Android
49
+ SDK 36/37) added during the Phase 2 work itself with verified sources.
50
+
51
+ ### Phase 3 — Multi-account + QoL
52
+ - **[snakechilds/opentele-nuitka](https://github.com/snakechilds/opentele-nuitka)**
53
+ — `kMaxAccounts` bump, `**kwargs` forwarding pattern in `FromTelethon`,
54
+ Nuitka-friendly `sharemethod` rewrite.
55
+ - **[Ehekatech/opentele-tg](https://github.com/Ehekatech/opentele-tg)** —
56
+ QR-login documentation skeleton.
57
+
58
+ ### Phase 6 — Pyrogram bridge + layer-aware fingerprints
59
+ - **[timka-123/opentele](https://github.com/timka-123/opentele)** — the idea of
60
+ a Pyrogram bridge (`FromPyrogram` / `ToPyrogram`), which upstream listed as an
61
+ incoming feature and never shipped. The implementation here is written from
62
+ scratch: theirs does not run (`account` used before assignment, `writeKeys`
63
+ stamping `MainDcId` onto every key, `session_name=` which Pyrogram 2.x does
64
+ not accept), which their README acknowledges.
65
+ - **[anmv/opentele](https://github.com/anmv/opentele)** — the insight that the
66
+ advertised Telegram Desktop version should match the MTProto layer the
67
+ client actually speaks. They hardcode the version/layer pair; `opentele-ng`
68
+ derives it from the installed Telethon at runtime
69
+ (`TELEGRAM_DESKTOP_LAYERS`).
70
+
71
+ ## Telegram Desktop source
72
+
73
+ Wire format for the new `lskType` keys, `_settingsKey` AES alignment fix
74
+ (1.0.1), and DoS guard upper bounds (1.0.3) verified against upstream
75
+ **[telegramdesktop/tdesktop](https://github.com/telegramdesktop/tdesktop)**
76
+ `Telegram/SourceFiles/storage/storage_account.cpp` and
77
+ `storage_file_utilities.cpp` (dev branch).
78
+
79
+ ## Code review
80
+
81
+ Every phase of `opentele-ng` was reviewed by **three independent AI systems**
82
+ running in parallel before push: **OpenAI Codex**, **Cursor**, and **Google
83
+ Gemini**. They caught critical issues that would otherwise have shipped:
84
+
85
+ - Phase 1.5: `lskWebviewTokens` was uint64×2 (wrong; should be QByteArray×2)
86
+ — caught by all three AI; `lskBotStorages` was a single uint64 (wrong;
87
+ should be a map) — Cursor + Codex; `lskPrefs` was completely missing —
88
+ Codex via C++ source dive.
89
+ - Phase 2.5: `AndroidDevice.__gen__` was iterating the legacy 4500-model
90
+ list against modern Android 13-17 SDKs (Galaxy S4 + Android 17 fingerprint)
91
+ — all three; `macOSDevice.__gen__` `FromIdentifier` parser was corrupting
92
+ clean model names (`"Mac16,9 (MacBook Air M4 13-inch)"` →
93
+ `"MacMacBook Air Minch"`) — all three; macOS versions lost the `"macOS "`
94
+ prefix — Codex.
95
+ - Phase 4: pure-Python `qdatastream` had no direct test coverage (tests used
96
+ PyQt6 as oracle, never exercising the new code) — Codex; QString goldens
97
+ missing — Gemini.
98
+ - Phase 1.0.2: untrusted `count` fields in `MapData.read` count loops were
99
+ a real DoS vector — Codex's prediction confirmed by hand-built malformed
100
+ payloads; this became the 1.0.3 release.
101
+ - Phase 1.0.3: a third count-loop in `tdesktop.py:__loadFromTData` was
102
+ missed by the first pass — Codex + Gemini; the in-test `pytest.xfail()`
103
+ fallback was a fail-open canary that needed to become a hard assert
104
+ after the fix — all three.
105
+
106
+ ## License
107
+
108
+ MIT (same as upstream). See [LICENSE](LICENSE).