diff --git a/docs/assets/flatpak-files/com.ayugram.desktop.yml b/docs/assets/flatpak-files/com.ayugram.desktop.yml new file mode 100644 index 0000000000..d122a54681 --- /dev/null +++ b/docs/assets/flatpak-files/com.ayugram.desktop.yml @@ -0,0 +1,39 @@ +app-id: com.ayugram.desktop + +runtime: org.gnome.Platform +runtime-version: '48' +sdk: org.gnome.Sdk + +command: ayugram-desktop + +finish-args: + - --share=ipc + - --socket=fallback-x11 + - --socket=wayland + - --socket=pulseaudio + - --device=dri + - --share=network + - --filesystem=xdg-download + - --talk-name=org.kde.StatusNotifierWatcher + - --talk-name=org.gnome.Mutter.IdleMonitor + - --talk-name=com.canonical.AppMenu.Registrar + - --talk-name=com.canonical.indicator.application + - --talk-name=org.freedesktop.Notifications + - --talk-name=org.freedesktop.portal.Desktop + - --talk-name=org.freedesktop.portal.OpenURI + - --talk-name=org.freedesktop.portal.FileChooser + - --talk-name=org.sigxcpu.Feedback + +modules: + - name: ayugram-repack + buildsystem: simple + build-commands: + - sed -i 's|^Exec=.*|Exec=ayugram-desktop -- %%u|' usr/share/applications/com.ayugram.desktop.desktop + - sed -i 's|^Exec=.*|Exec=/app/bin/ayugram-desktop|' usr/share/dbus-1/services/com.ayugram.desktop.service + - install -d /app/share/ + - install -Dm755 AyuGram /app/bin/ayugram-desktop + - cp -a usr/share/* /app/share/ + + sources: + - type: dir + path: . \ No newline at end of file diff --git a/docs/assets/flatpak-files/usr/share/applications/com.ayugram.desktop.desktop b/docs/assets/flatpak-files/usr/share/applications/com.ayugram.desktop.desktop new file mode 100644 index 0000000000..d9a12b7532 --- /dev/null +++ b/docs/assets/flatpak-files/usr/share/applications/com.ayugram.desktop.desktop @@ -0,0 +1,22 @@ +[Desktop Entry] +Name=AyuGram Desktop +Comment=Desktop version of AyuGram - ToS breaking Telegram client +TryExec=ayugram-desktop +Exec=env DESKTOPINTEGRATION=1 ayugram-desktop -- %u +Icon=com.ayugram.desktop +Terminal=false +StartupWMClass=AyuGram +Type=Application +Categories=Chat;Network;InstantMessaging;Qt; +MimeType=x-scheme-handler/tg;x-scheme-handler/tonsite; +Keywords=tg;chat;im;messaging;messenger;sms;telegram;tdesktop; +Actions=quit; +DBusActivatable=true +SingleMainWindow=true +X-GNOME-UsesNotifications=true +X-GNOME-SingleWindow=true + +[Desktop Action quit] +Exec=ayugram-desktop -quit +Name=Quit AyuGram +Icon=application-exit diff --git a/docs/assets/flatpak-files/usr/share/dbus-1/services/com.ayugram.desktop.service b/docs/assets/flatpak-files/usr/share/dbus-1/services/com.ayugram.desktop.service new file mode 100644 index 0000000000..9f08a471f6 --- /dev/null +++ b/docs/assets/flatpak-files/usr/share/dbus-1/services/com.ayugram.desktop.service @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=com.ayugram.desktop +Exec=/usr/bin/ayugram-desktop diff --git a/docs/assets/flatpak-files/usr/share/icons/hicolor/128x128/apps/com.ayugram.desktop.png b/docs/assets/flatpak-files/usr/share/icons/hicolor/128x128/apps/com.ayugram.desktop.png new file mode 100644 index 0000000000..2da9ed972a Binary files /dev/null and b/docs/assets/flatpak-files/usr/share/icons/hicolor/128x128/apps/com.ayugram.desktop.png differ diff --git a/docs/assets/flatpak-files/usr/share/icons/hicolor/16x16/apps/com.ayugram.desktop.png b/docs/assets/flatpak-files/usr/share/icons/hicolor/16x16/apps/com.ayugram.desktop.png new file mode 100644 index 0000000000..2e99d9305d Binary files /dev/null and b/docs/assets/flatpak-files/usr/share/icons/hicolor/16x16/apps/com.ayugram.desktop.png differ diff --git a/docs/assets/flatpak-files/usr/share/icons/hicolor/256x256/apps/com.ayugram.desktop.png b/docs/assets/flatpak-files/usr/share/icons/hicolor/256x256/apps/com.ayugram.desktop.png new file mode 100644 index 0000000000..d75f58b817 Binary files /dev/null and b/docs/assets/flatpak-files/usr/share/icons/hicolor/256x256/apps/com.ayugram.desktop.png differ diff --git a/docs/assets/flatpak-files/usr/share/icons/hicolor/32x32/apps/com.ayugram.desktop.png b/docs/assets/flatpak-files/usr/share/icons/hicolor/32x32/apps/com.ayugram.desktop.png new file mode 100644 index 0000000000..e4afdca783 Binary files /dev/null and b/docs/assets/flatpak-files/usr/share/icons/hicolor/32x32/apps/com.ayugram.desktop.png differ diff --git a/docs/assets/flatpak-files/usr/share/icons/hicolor/48x48/apps/com.ayugram.desktop.png b/docs/assets/flatpak-files/usr/share/icons/hicolor/48x48/apps/com.ayugram.desktop.png new file mode 100644 index 0000000000..180ddb23bb Binary files /dev/null and b/docs/assets/flatpak-files/usr/share/icons/hicolor/48x48/apps/com.ayugram.desktop.png differ diff --git a/docs/assets/flatpak-files/usr/share/icons/hicolor/512x512/apps/com.ayugram.desktop.png b/docs/assets/flatpak-files/usr/share/icons/hicolor/512x512/apps/com.ayugram.desktop.png new file mode 100644 index 0000000000..6a3dfa6416 Binary files /dev/null and b/docs/assets/flatpak-files/usr/share/icons/hicolor/512x512/apps/com.ayugram.desktop.png differ diff --git a/docs/assets/flatpak-files/usr/share/icons/hicolor/64x64/apps/com.ayugram.desktop.png b/docs/assets/flatpak-files/usr/share/icons/hicolor/64x64/apps/com.ayugram.desktop.png new file mode 100644 index 0000000000..b57b6e3bb4 Binary files /dev/null and b/docs/assets/flatpak-files/usr/share/icons/hicolor/64x64/apps/com.ayugram.desktop.png differ diff --git a/docs/assets/flatpak-files/usr/share/icons/hicolor/symbolic/apps/com.ayugram.desktop-attention-symbolic.svg b/docs/assets/flatpak-files/usr/share/icons/hicolor/symbolic/apps/com.ayugram.desktop-attention-symbolic.svg new file mode 100644 index 0000000000..95b8c2cfaf --- /dev/null +++ b/docs/assets/flatpak-files/usr/share/icons/hicolor/symbolic/apps/com.ayugram.desktop-attention-symbolic.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/assets/flatpak-files/usr/share/icons/hicolor/symbolic/apps/com.ayugram.desktop-mute-symbolic.svg b/docs/assets/flatpak-files/usr/share/icons/hicolor/symbolic/apps/com.ayugram.desktop-mute-symbolic.svg new file mode 100644 index 0000000000..448f6990b2 --- /dev/null +++ b/docs/assets/flatpak-files/usr/share/icons/hicolor/symbolic/apps/com.ayugram.desktop-mute-symbolic.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/assets/flatpak-files/usr/share/icons/hicolor/symbolic/apps/com.ayugram.desktop-symbolic.svg b/docs/assets/flatpak-files/usr/share/icons/hicolor/symbolic/apps/com.ayugram.desktop-symbolic.svg new file mode 100644 index 0000000000..f2b95fc226 --- /dev/null +++ b/docs/assets/flatpak-files/usr/share/icons/hicolor/symbolic/apps/com.ayugram.desktop-symbolic.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/docs/assets/flatpak-files/usr/share/metainfo/com.ayugram.desktop.metainfo.xml b/docs/assets/flatpak-files/usr/share/metainfo/com.ayugram.desktop.metainfo.xml new file mode 100644 index 0000000000..f52f7b9691 --- /dev/null +++ b/docs/assets/flatpak-files/usr/share/metainfo/com.ayugram.desktop.metainfo.xml @@ -0,0 +1,80 @@ + + + com.ayugram.desktop + CC0-1.0 + GPL-3.0 + AyuGram Desktop + Desktop version of AyuGram - ToS breaking Telegram client + +

Telegram Desktop with Ghost Mode, Anti-Recall and cool design.

+
+ + Network + InstantMessaging + + helpdesk_at_radolyn.com + Radolyn Labs + https://ayugram.one/ + https://t.me/ayugramchat/1262 + https://crowdin.com/project/ayugram + https://github.com/AyuGram/AyuGramDesktop/blob/dev/.github/CONTRIBUTING.md + + + https://raw.githubusercontent.com/telegramdesktop/tdesktop/dev/docs/assets/preview.png + + + + tg + telegram + tdesktop + messaging + messenger + chat + sms + im + ayugram + + + medium + always + + + pointing + keyboard + touch + + + none + none + none + none + none + none + none + none + none + none + none + none + none + none + none + none + none + none + none + none + intense + none + intense + none + intense + intense + none + moderate + + com.ayugram.desktop.desktop + + ayugram-desktop + +
  • Fix stale birthday suggestions removing.
  • Fix notification click opening a new window.
  • Buy Rare Gifts in the Marketplace.
  • Sell Your Gifts for Stars.
  • Set Your Channel to Auto-Translate.
  • Fix launching on Windows 7.
  • Secure Group Calls Made Easy.
  • Automated Business Accounts.
  • New Gifts Settings.
  • Fix crash in group/channel stories.
  • Allow transferring my unique gifts from Send Gift section.
  • Edit type of gifts you accept in Settings > Privacy and Security.
  • Swipe navigation using swipe gesture on touchpads / touchscreens.
  • Choose chat list quick action for swipe or middle click.
  • Allow customizing chats list swipe left action.
  • Fix custom emoji in poll results view.
  • Fix crash in main menu swipe closing.
  • Support swipe navigation on touchscreens.
  • Close main menu by swipe navigation.
  • Touchpad swipe back to go back in navigation history.
  • Touchpad swipe between folders if they're horizontal.
  • Out-of-the-box monochrome tray icon on Linux.
  • Icons telegram{,{,-attention,-mute}-panel} are renamed
  • Snap package got icon theming support,
  • Fix a couple more crashes.
  • Fix gift disappearing on unpin.
  • Fix country emoji for Fragment numbers.
\ No newline at end of file diff --git a/docs/building-flatpak.md b/docs/building-flatpak.md new file mode 100644 index 0000000000..f40a248067 --- /dev/null +++ b/docs/building-flatpak.md @@ -0,0 +1,177 @@ +# Building the AyuGram Flatpak + +This guide describes the complete process for creating a Flatpak package for AyuGram. The process consists of two main stages: + +1. **Building the AyuGram binary** using the official Docker environment. +2. **Packaging the built binary** and necessary resources into a Flatpak package. + +## Prerequisites + +This guide was tested on **Fedora 42** (inside a Toolbx container) but should work on most modern Linux distributions. + +Before you begin, ensure that the following components are installed on your system: + +* `git` +* `docker` +* `flatpak` +* `flatpak-builder` + +Also, make sure your user is added to the `docker` group to run commands without `sudo`. + +```bash +# Example for Fedora/Ubuntu +sudo usermod -aG docker $USER +# You will need to log out and log back in for this change to take effect +``` + +## Step 1: Build the AyuGram Binary + +First, you need to build the application itself by following the official instructions. + +1. **Clone the AyuGram repository:** + Choose a directory for the build and run the command. Note that this will create a directory named `tdesktop`. + + ```bash + git clone --recursive https://github.com/AyuGram/AyuGramDesktop.git tdesktop + cd tdesktop + ``` + +2. **Prepare the libraries:** + Run the preparation script. You might need `poetry` for this. + + ```bash + # If poetry is not installed: pip install poetry + ./Telegram/build/prepare/linux.sh + ``` + +3. **Build the project using Docker:** + This command will run the build in an isolated CentOS environment. + + ```bash + docker run --rm -it \ + -u $(id -u) \ + -v "$PWD:/usr/src/tdesktop" \ + ghcr.io/telegramdesktop/tdesktop/centos_env:latest \ + /usr/src/tdesktop/Telegram/build/docker/centos_env/build.sh \ + -D TDESKTOP_API_ID=2040 \ + -D TDESKTOP_API_HASH=b18441a1ff607e10a989891a5462e627 + ``` + + After the build completes successfully, the resulting binary will be located at: + `tdesktop/out/Release/AyuGram`. + +## Step 2: Prepare for the Flatpak Build + +Now that we have the binary, we will prepare a dedicated directory for the Flatpak build. + +1. **Create a working directory:** + Return to your parent directory and create a folder for the Flatpak build. + + ```bash + # If you are inside the tdesktop directory, navigate out of it + cd .. + mkdir ayugram-flatpak-build + cd ayugram-flatpak-build + ``` + +2. **Copy the necessary files:** + We need to copy three items from the `tdesktop` repository into this new directory: + * The built `AyuGram` binary. + * The `com.ayugram.desktop.yml` manifest and its resources (icons, .desktop file, metadata), which are located in the same folder. + + Execute the following commands from the `ayugram-flatpak-build` directory: + + ```bash + # Copy the binary from the correct path + cp ../tdesktop/out/Release/AyuGram . + + # Copy the manifest and all resources from the flatpak-files directory + cp -r ../tdesktop/docs/assets/flatpak-files/* . + ``` + + After this, your `ayugram-flatpak-build` directory should have the following structure: + ``` + . + ├── AyuGram + ├── com.ayugram.desktop.yml + └── usr/ + └── share/ + ├── applications/ + ├── dbus-1/ + ├── icons/ + └── metainfo/ + ``` + +## Step 3: Build the Flatpak Package + +Everything is now ready for the final step. + +1. **Install the GNOME SDK:** + Our Flatpak uses the GNOME runtime. Ensure you have the corresponding SDK (Software Development Kit) installed. + + ```bash + flatpak install --user org.gnome.Sdk//48 + ``` + *Note: The manifest uses runtime version `48`. If `flatpak` cannot find this version, make sure you have the Flathub repository enabled.* + +You now have two build options. + +### Option A: Build and Install into the System (for testing) + +This method is ideal for quickly testing the application. + +1. **Run the build and installation:** + + ```bash + flatpak-builder --user --install --force-clean build-dir com.ayugram.desktop.yml + ``` + * `--user`: Install for the current user. + * `--install`: Automatically install after building. + * `--force-clean`: Start with a clean build. + * `build-dir`: A temporary directory for the build. + + *Problem and Solution:* If you see a `Permission denied` or `Failure spawning rofiles-fuse` error, add the `--disable-rofiles-fuse` flag: + ```bash + flatpak-builder --disable-rofiles-fuse --user --install --force-clean build-dir com.ayugram.desktop.yml + ``` + +2. **Run the installed application:** + + ```bash + flatpak run com.ayugram.desktop + ``` + +### Option B: Build a Portable `.flatpak` File (for distribution) + +This method creates a single file that can be distributed to other users for installation. + +1. **Clean up old artifacts (important!):** + If you have previously attempted to build a bundle, delete the old repository directory to avoid errors. + + ```bash + rm -rf repo + ``` + +2. **Build the application into a local repository:** + + ```bash + flatpak-builder --repo=repo --force-clean build-dir com.ayugram.desktop.yml + ``` + * `--repo=repo`: Tells `flatpak-builder` to export the result into a directory named `repo`, creating a repository there. + + *Problem and Solution:* As with Option A, add the `--disable-rofiles-fuse` flag if you encounter a `rofiles-fuse` error. + +3. **Create the `.flatpak` bundle:** + Now, let's package the contents of the `repo` repository into a single file. + + ```bash + flatpak build-bundle repo ayugram-desktop-5.16.3.flatpak com.ayugram.desktop + ``` + * `repo`: The source (our local repository). + * `ayugram-desktop-5.16.3.flatpak`: The name of the final file (remember to update the version if necessary). + * `com.ayugram.desktop`: The ID of the application to be packaged. + +As a result, the `ayugram-desktop-5.16.3.flatpak` file will appear in the current directory, ready for installation. It can be installed with the command: +```bash +flatpak install --user ayugram-desktop-5.16.3.flatpak +``` \ No newline at end of file