Skip to content

gthvmt/7TV-for-WhatsApp

Repository files navigation

7TV for WhatsApp

Bring your favorite third-party twitch emotes directly to WhatsApp!

📖 About

Screenshot This app aims to make any 7TV emote usable in WhatsApp by turning it into a WhatsApp sticker. This is done by scaling the emote to 512 x 512 pixels while keeping its filesize below 500KB using compression and grouping it with a minimum of two other emotes into Sticker packs.
The upscaling and compression should happen relatively fast, since it uses rust under the hood 🦀
Also this is my first flutter/dart (and rust) project (and app in general) so please have some mercy with my spaghetti code 🙏

👨‍💻 Development

Using a Dev-Container

The simplest and recommended approach is to use the provided dev-container:

  1. Install docker on your host system
  2. Clone this repository including the submodule:
    git clone https://github.com/gthvmt/7TV-for-WhatsApp.git --recurse-submodules
  3. Install the visual studio code "Dev Containers"-extension
  4. (Re)open the cloned repository inside the devcontainer

Debugging

  1. Download the Android studio sdkmanager CLI on your host and add the bin directory to your PATH to get access to the android debug bridge (adb.exe)*
  2. Enable USB-Debugging on your Android device
  3. Make sure your Android device is connected to the same network as your PC
  4. Get the IP-adress of your Android device
  5. Connect your Android device to your PC using USB
  6. Run
    adb tcpip 5555
    adb connect <IP of your Android Device>:5555
    
  7. Run adb connect <IP of your Android Device>:5555 inside of the Dev-Container
  8. Run flutter run inside of the src directory (in the Dev-Container). If you get any errors try running just build first.

*I had some problems on windows where adb would not recognise my device a bunch of times, using https://github.com/koush/UniversalAdbDriver instead seemed to resolve this issue

If you do not have access to an android device, the dev-container comes with emulators pre-installed; so in theory it should be possible to debug the app using an emulator. I have never tested this though.

Working directly on the host system

If you are not able to install docker on your host or your host does not have the sufficient hardware you can follow this approach instead:
(this assumes that you are using visual studio code. Developing inside android studio should also work and be easier to set up but I have never done that)

  1. Install flutter
  2. Install rust
  3. Download/Install OpenJDK 11 and add the bin directory to your PATH
  4. Download the Android studio sdkmanager CLI and add the bin directory to your PATH
  5. Add the ANDROID_HOME environment variable
  6. Install the "platform-tools" using the sdkmanager
  7. Optionally install android emulator(s) using the sdkmanager
  8. Install the Android NDK and add the environment variables ANDROID_NDK and ANDROID_NDK_HOME
  9. Install just (optional), cargo-ndk and flutter_rust_bridge_codegen using cargo:
    cargo install just cargo-ndk flutter_rust_bridge_codegen
  10. Configure rust:
    rustup component add rustfmt
    rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android i686-linux-android
    

I may have missed a step here but it should be an OK guideline if you want/need to contribute to this project while working directly on your host. Feel free to check out the devcontainer file or submit a PR to fix or expand this list.

Debugging

  1. Enable USB-Debugging on your Android device
  2. Connect your Android device to your PC using USB
  3. Run flutter run inside of the src directory

🍺 Buy me a beer!

Actually, I dont even like beer...
I initially had the thought of monitizing this app by (for example) putting the ability to set a custom sticker pack provider name behind a paywall. Ultimately I decided against it because I am too lazy to implement it (and paywalls kinda suck). If you would still like to throw some money at me, you can do so here:
https://ko-fi.com/gthvmt