Opencord: Difference between revisions

From Discord Client Modding Wiki
Jump to navigation Jump to search
m (change category)
(add input from xinto and cleanup)
Line 1: Line 1:
[[File:Opencord.png|thumb|Opencord's original logo]]
[[File:Opencord.png|thumb|Opencord's original logo]]


[https://github.com/MateriiApps/OpenCord Opencord] was an open-source Material You implementation of the Discord Android app. Created in late August of 2021, it has reimplemented a sizable portion of the mobile Discord client, completely from scratch. It aims to replicate the functionality and behavior of the [[v126.21|Legacy Android Discord app]], the last release of which was in the summer of 2022. Despite steady development initially, it alternated between periods of rapid progress and months of inactivity. Progress completely stopped by May 2023, and it was archived on Jan 12, 2024. As of March 2024, it still has over 1.2k stars on GitHub.
[https://github.com/MateriiApps/OpenCord Opencord] was an open-source Material You implementation of the Discord Android app. Created in late August of 2021, it has reimplemented a sizable portion of the mobile Discord client, completely from scratch. Despite steady development initially, it alternated between periods of rapid progress and months of inactivity. Progress completely stopped by May 2023, and it was archived on Jan 12, 2024. As of March 2024, it still has over 1.2k stars on GitHub.


==Backstory==
==Backstory==


While the original reason for its creation is unknown<sup>[Xinto needed]</sup>, as [[Aliucord|another mobile client mod]] started to mature, it became apparent that adding dozens of fixes onto an outdated client would eventually become unsustainable. While the first 8 months of development were only propelled by [https://github.com/x1nto Xinto], in Apr 2022, [https://github.com/rushiiMachine rushii] started contributing to the project and eventually became one of the two main developers. After an amount of time, most contributions started to be done by only rushii as Xinto focused on other projects. Eventually, rushii stopped work on it as well due to roadblocks in designing a proper architecture, exacerbated by loads of technical debt, and dozens of heated debates over the most minuscule of changes.
While the original reason for its creation was that Xinto was fed up with crossplatform React Native apps everywhere<ref>{{cite web|title=Materii discord message|url=https://discord.com/channels/885879572447522817/885879572447522820/1215711663525863442}}</ref>, as [[Aliucord]], another client mod, started to mature, it became apparent that adding dozens of fixes onto an outdated client would eventually become unsustainable, and an entirely new client would be needed. While the first 8 months of development were only propelled by [https://github.com/x1nto Xinto], in Apr 2022, [https://github.com/rushiiMachine rushii] started contributing to the project and eventually became one of the two main developers. After an amount of time, most contributions started to be done by only rushii as Xinto focused on other projects. Eventually, rushii stopped work on it as well due to roadblocks in designing a proper architecture, exacerbated by loads of technical debt, and dozens of heated debates over the most minuscule of changes.


One of the main goals of the project was to avoid the instability of client mods by reimplementing everything from scratch, instead of relying on patching Discord code which can easily due to updates. In doing so, a lot of things could be omitted or simplified, like the intentional exclusion of nitro features. (i.e. super reactions, profile effects, etc.) Having a clean interface that focused on usability and simplicity while remaining functional was an important design goal.
One of the main goals of the project was to avoid the instability of client mods by reimplementing everything from scratch, instead of relying on patching Discord code which can easily break due to updates. In doing so, a lot of things could be omitted or simplified, like the intentional exclusion of nitro features. (i.e. super reactions, profile effects, etc.) Having a clean interface that focused on usability and simplicity while remaining functional was an important design goal.


While Discord doesn't "care" about client mods or 3rd party clients, the truth is that if certain API and gateway requests are incorrect, the account will be flagged in a variety of ways and could cause additional captchas, forcing phone verification, or an outright ban.<ref>{{cite web|title=Cordless shutdown notice|url=https://github.com/Bios-Marcel/cordless?tab=readme-ov-file#i-am-closing-down-the-cordless-project}}</ref> This is one of the major reasons why development took so long since the client must act exactly like a [[v126.21]] Discord client, from the identification sent to the API and gateway, to the request content on specific endpoints, to even TLS metadata.<ref>{{cite web|title=JA3 TLS fingerprinting|url=https://github.com/salesforce/ja3}}</ref>
While Discord doesn't "care" about client mods or 3rd party clients, the truth is that if certain API and gateway requests are incorrect, the account will be flagged in a variety of ways and could cause additional captchas, forcing phone verification, or an outright ban.<ref>{{cite web|title=Cordless shutdown notice|url=https://github.com/Bios-Marcel/cordless?tab=readme-ov-file#i-am-closing-down-the-cordless-project}}</ref> This is one of the major reasons why development took so long since the client must act exactly like a [[v126.21]] Discord client, from the identification sent to the API and gateway, to adhering to all ratelimits, to even spoofing the TLS metadata.<ref>{{cite web|title=JA3 TLS fingerprinting|url=https://github.com/salesforce/ja3}}</ref>


==Architecture==
==Architecture==

Revision as of 17:33, 8 March 2024

Opencord's original logo

Opencord was an open-source Material You implementation of the Discord Android app. Created in late August of 2021, it has reimplemented a sizable portion of the mobile Discord client, completely from scratch. Despite steady development initially, it alternated between periods of rapid progress and months of inactivity. Progress completely stopped by May 2023, and it was archived on Jan 12, 2024. As of March 2024, it still has over 1.2k stars on GitHub.

Backstory

While the original reason for its creation was that Xinto was fed up with crossplatform React Native apps everywhere[1], as Aliucord, another client mod, started to mature, it became apparent that adding dozens of fixes onto an outdated client would eventually become unsustainable, and an entirely new client would be needed. While the first 8 months of development were only propelled by Xinto, in Apr 2022, rushii started contributing to the project and eventually became one of the two main developers. After an amount of time, most contributions started to be done by only rushii as Xinto focused on other projects. Eventually, rushii stopped work on it as well due to roadblocks in designing a proper architecture, exacerbated by loads of technical debt, and dozens of heated debates over the most minuscule of changes.

One of the main goals of the project was to avoid the instability of client mods by reimplementing everything from scratch, instead of relying on patching Discord code which can easily break due to updates. In doing so, a lot of things could be omitted or simplified, like the intentional exclusion of nitro features. (i.e. super reactions, profile effects, etc.) Having a clean interface that focused on usability and simplicity while remaining functional was an important design goal.

While Discord doesn't "care" about client mods or 3rd party clients, the truth is that if certain API and gateway requests are incorrect, the account will be flagged in a variety of ways and could cause additional captchas, forcing phone verification, or an outright ban.[2] This is one of the major reasons why development took so long since the client must act exactly like a v126.21 Discord client, from the identification sent to the API and gateway, to adhering to all ratelimits, to even spoofing the TLS metadata.[3]

Architecture

Opencord is written in Kotlin with the use of Jetpack Compose, a modern declarative native UI framework for Android. Most of the codebase is based on dependency injection with Koin, in such a way that it would be theoretically testable in the future. While basic gateway functionality lives independently, most of the complex logic, including caching and live state, lives in Stores, a concept taken from the original Discord codebase.

While most of the UI is broken up into small @Composable components, complex UI was wrongly implemented, leading to dozens of recomposition issues that took an insane amount of effort to fix. Additionally, due to the idiomaticity of Compose, complex UI components can be split up into the layout and content, where invoking the layout forces you to provide all the content to the layout. This led to a lot of repetitiveness throughout the codebase, quickly becoming unmaintainable. While this was eventually planned to be refactored out, that never happened. This has been taken into consideration regarding future projects of the developers and it hasn't happened to this extent since.

Notes

  1. "Materii discord message".
  2. "Cordless shutdown notice".
  3. "JA3 TLS fingerprinting".