From 9c8009b3d18e08e49adc881dc3400dc53b9517a8 Mon Sep 17 00:00:00 2001 From: Enzo DJABALI Date: Thu, 11 Dec 2025 12:24:13 +0100 Subject: [PATCH] tech(#1): implementing a dockerfile that builds the package --- .dockerignore | 36 ++++++++ .github/workflows/build.yml | 61 +++++++++++++ .gitignore | 2 + Dockerfile | 167 ++++++++++++++++++++++++++++++++++++ README.md | 152 ++++++++++++++++++++++++++++---- build-docker.sh | 63 ++++++++++++++ libwebmessage/Makefile | 3 +- 7 files changed, 468 insertions(+), 16 deletions(-) create mode 100644 .dockerignore create mode 100644 .github/workflows/build.yml create mode 100644 Dockerfile create mode 100755 build-docker.sh diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..8d8b84e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,36 @@ +# Git files +.git +.gitignore +.gitattributes + +# Build artifacts +*.deb +.theos/obj +.theos/_/ +*.o +*.dylib +*.a + +# Xcode +*.xcodeproj/xcuserdata +*.xcodeproj/project.xcworkspace/xcuserdata +*.xcworkspace/xcuserdata +*.xcodeproj/project.xcworkspace/*.xcuserstate +*.xcuserstate +DerivedData/ + +# IDE +.vscode/ +.idea/ + +# macOS +.DS_Store +._* + +# Logs +*.log + +# Temporary files +*.tmp +*.swp +*~ diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..297bbf5 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,61 @@ +name: Build WebMessage .deb + +on: + push: + branches: [ main, develop ] + tags: + - 'v*' + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build Docker image + run: | + docker build -t webmessage-builder:latest . + + - name: Build .deb package + run: | + docker run --name webmessage-build webmessage-builder:latest + mkdir -p output + docker cp webmessage-build:/build/WebMessage.deb ./output/ + docker rm webmessage-build + + - name: Get package info + run: | + echo "## Package Information" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + dpkg-deb --info output/WebMessage.deb >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "## Package Size" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + ls -lh output/WebMessage.deb >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + + - name: Upload .deb artifact + uses: actions/upload-artifact@v3 + with: + name: WebMessage-deb + path: output/WebMessage.deb + retention-days: 30 + + - name: Create Release (on tag) + if: startsWith(github.ref, 'refs/tags/v') + uses: softprops/action-gh-release@v1 + with: + files: output/WebMessage.deb + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index ab1c452..c5b7178 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ LatestBuild Packages +output/WebMessage.deb + # OS generated files # ###################### .DS_Store diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f53ea30 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,167 @@ +# Dockerfile for building WebMessage Sileo jailbreak tweak +# This builds the .deb package for iOS jailbroken devices + +FROM ubuntu:22.04 + +# Prevent interactive prompts during installation +ENV DEBIAN_FRONTEND=noninteractive + +# Set environment variables for Theos +ENV THEOS=/opt/theos +ENV PATH="${THEOS}/bin:${PATH}" + +# Install required dependencies +RUN apt-get update && apt-get install -y \ + curl \ + git \ + make \ + perl \ + zip \ + unzip \ + build-essential \ + clang \ + libssl-dev \ + fakeroot \ + dpkg-dev \ + libplist-dev \ + libplist-utils \ + python3 \ + python3-pip \ + ca-certificates \ + wget \ + libtinfo5 \ + libncurses5 \ + rsync \ + && rm -rf /var/lib/apt/lists/* + +# Install ldid (code signing tool) - build from source with all required libraries +RUN git clone https://github.com/ProcursusTeam/ldid.git /tmp/ldid && \ + cd /tmp/ldid && \ + make LDFLAGS="-lcrypto -lssl -lplist-2.0" && \ + cp -f ./ldid /usr/local/bin/ldid && \ + chmod +x /usr/local/bin/ldid && \ + cd / && \ + rm -rf /tmp/ldid + +# Install Theos +RUN git clone --recursive https://github.com/theos/theos.git /opt/theos + +# Install iOS toolchain for cross-compilation +RUN mkdir -p /opt/theos/toolchain && \ + cd /opt/theos/toolchain && \ + wget -q https://github.com/sbingner/llvm-project/releases/download/v10.0.0-1/linux-ios-arm64e-clang-toolchain.tar.lzma && \ + tar --lzma -xf linux-ios-arm64e-clang-toolchain.tar.lzma && \ + rm linux-ios-arm64e-clang-toolchain.tar.lzma && \ + mkdir -p linux/iphone && \ + mv ios-arm64e-clang-toolchain/* linux/iphone/ && \ + rmdir ios-arm64e-clang-toolchain && \ + find linux/iphone/bin -type f -exec chmod +x {} \; + +# Download and install iOS SDKs (extract all then use iOS 13.7 which works with clang 10) +RUN mkdir -p /opt/theos/sdks && \ + cd /opt/theos/sdks && \ + curl -LO https://github.com/theos/sdks/archive/master.zip && \ + unzip -q master.zip && \ + mv sdks-master/* . && \ + rm -rf sdks-master master.zip && \ + # Remove iOS 14+ SDKs that have incompatible TBD format + rm -rf iPhoneOS14.*.sdk iPhoneOS15.*.sdk iPhoneOS16.*.sdk iPhoneOS17.*.sdk + +# Clone and install MRYIPC (dependency) +RUN git clone https://github.com/Muirey03/MRYIPC.git /tmp/MRYIPC && \ + cp -R /tmp/MRYIPC/*.h /opt/theos/vendor/include/ && \ + rm -rf /tmp/MRYIPC + +# Copy the project's libmryipc library to theos +# This will be done after COPY . . to use the project's version + +# Set working directory +WORKDIR /build + +# Copy project files +COPY . . + +# Copy the libmryipc library from the project to theos lib directory +RUN if [ -f /build/WebMessage/Libraries/libmryipc.dylib ]; then \ + cp /build/WebMessage/Libraries/libmryipc.dylib /opt/theos/lib/libmryipc.dylib; \ + fi + +# Create a build script +RUN echo '#!/bin/bash\n\ +set -e\n\ +\n\ +echo "========================================"\n\ +echo "Building libwebmessage tweak..."\n\ +echo "========================================"\n\ +\n\ +# Build libwebmessage\n\ +cd /build/libwebmessage\n\ +make clean || true\n\ +make package FINALPACKAGE=1\n\ +\n\ +echo ""\n\ +echo "========================================"\n\ +echo "Building WebMessagePreferences bundle..."\n\ +echo "========================================"\n\ +\n\ +# Build WebMessagePreferences\n\ +cd /build/WebMessagePreferences\n\ +make clean || true\n\ +make FINALPACKAGE=1\n\ +\n\ +echo ""\n\ +echo "========================================"\n\ +echo "Copying built files to Package..."\n\ +echo "========================================"\n\ +\n\ +# Ensure directories exist\n\ +mkdir -p /build/WebMessage/Package/Library/MobileSubstrate/DynamicLibraries\n\ +mkdir -p /build/WebMessage/Package/Library/PreferenceBundles\n\ +\n\ +# Remove old symlinks if they exist\n\ +rm -f /build/WebMessage/Package/Library/MobileSubstrate/DynamicLibraries/libwebmessage.dylib\n\ +rm -f /build/WebMessage/Package/Library/MobileSubstrate/DynamicLibraries/libwebmessage.plist\n\ +rm -f /build/WebMessage/Package/Library/PreferenceBundles/WebMessage.bundle\n\ +\n\ +# Copy libwebmessage files\n\ +if [ -f /build/libwebmessage/.theos/obj/libwebmessage.dylib ]; then\n\ + cp /build/libwebmessage/.theos/obj/libwebmessage.dylib /build/WebMessage/Package/Library/MobileSubstrate/DynamicLibraries/\n\ +elif [ -f /build/libwebmessage/.theos/obj/debug/libwebmessage.dylib ]; then\n\ + cp /build/libwebmessage/.theos/obj/debug/libwebmessage.dylib /build/WebMessage/Package/Library/MobileSubstrate/DynamicLibraries/\n\ +fi\n\ +\n\ +cp /build/libwebmessage/libwebmessage.plist /build/WebMessage/Package/Library/MobileSubstrate/DynamicLibraries/\n\ +\n\ +# Copy WebMessage preferences bundle\n\ +if [ -d /build/WebMessagePreferences/.theos/obj/WebMessage.bundle ]; then\n\ + cp -r /build/WebMessagePreferences/.theos/obj/WebMessage.bundle /build/WebMessage/Package/Library/PreferenceBundles/\n\ +elif [ -d /build/WebMessagePreferences/.theos/obj/debug/WebMessage.bundle ]; then\n\ + cp -r /build/WebMessagePreferences/.theos/obj/debug/WebMessage.bundle /build/WebMessage/Package/Library/PreferenceBundles/\n\ +fi\n\ +\n\ +echo ""\n\ +echo "========================================"\n\ +echo "Building final .deb package..."\n\ +echo "========================================"\n\ +\n\ +# Build the final .deb package\n\ +cd /build\n\ +rm -f WebMessage.deb\n\ +dpkg-deb --root-owner-group -b WebMessage/Package WebMessage.deb\n\ +\n\ +echo ""\n\ +echo "========================================"\n\ +echo "Build complete!"\n\ +echo "========================================"\n\ +echo ""\n\ +dpkg-deb --info WebMessage.deb\n\ +echo ""\n\ +echo "Package size:"\n\ +ls -lh WebMessage.deb\n\ +echo ""\n\ +echo "Package contents:"\n\ +dpkg-deb --contents WebMessage.deb\n\ +' > /build/build.sh && chmod +x /build/build.sh + +# Set the default command +CMD ["/build/build.sh"] diff --git a/README.md b/README.md index d54a605..d87682b 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,149 @@ -# WebMessage-Tweak -iOS tweak companion for WebMessage client. Get it through my repo [https://sgtaziz.github.io/repo](https://sgtaziz.github.io/repo) +# WebMessage Server -**To open issues, visit the [client's repo](https://github.com/sgtaziz/WebMessage).** -## Warnings -* This package requires the [client](https://github.com/sgtaziz/WebMessage/releases/latest) installed on your computer to work! Without it, this package will be useless. +iOS tweak companion for iOSMB-Client. + +WebMessage allows you to access your iMessages on any device through a web interface. + +## What This Builds + +- **libwebmessage.dylib**: MobileSubstrate tweak that hooks into Messages app + +- **WebMessage binary**: Main server application * This package has not been tested against iOS 12 fully. It is still in its early stages. + +- **WebMessage.bundle**: Settings/preferences UI + +- **Package**: Complete .deb installer for jailbroken iOS devices -* This package has not been tested against iOS 12 fully. It is still in its early stages. - ## Description + WebMessage is a tweak exposing a REST API (and a WebSocket) from your phone, allowing for SMS and iMessage functionality. To work, the client used and the phone must be on the same network. Alternatively, tunneling can also be used. +## Building + The current features are as follows: -* Real-time sending and receiving of messages -* Sending attachments from your computer without needing to transfer it to your phone -* Native notifications + +### Prerequisites + +- Docker installed ([Get Docker](https://docs.docker.com/get-docker/)) Sending attachments from your computer without needing to transfer it to your phone + +- ~2GB free disk space Native notifications + * SSL encryption using your own privately generated certificate -* Password-protected -* Always-running daemon -* Ability to download all attachments through client + +### Build Command + +```bash* Always-running daemon + +./build-docker.sh* Ability to download all attachments through client + +``` More features are planned in the future, such as reactions, read receipts, and more. -If you would like to support my work, you can donate using [this link](https://paypal.me/sgtaziztweaks). +The `.deb` package will be created in `output/WebMessage.deb` (~832KB) + +## Installation + +## Build Instructions + +1. **Transfer to your iPhone:** + +```bash### Option 1: Docker Build (Recommended for Linux/Cross-platform) + +scp output/WebMessage.deb mobile@YOUR-IPHONE-IP:/tmp/ + +```The easiest way to build the .deb package on any platform: + + + +2. **SSH into your device and install:**```bash + +```bash./build-docker.sh + +ssh mobile@YOUR-IPHONE-IP``` + +sudo dpkg -i /tmp/WebMessage.deb + +sudo apt-get install -f # Fix dependencies if neededThe built package will be available in the `output/` directory. + +``` + +For detailed Docker build instructions, see [DOCKER_BUILD.md](DOCKER_BUILD.md). + +## Requirements + +### Option 2: Native Build (macOS with Theos) + +### Your iPhone Needs: + +- iOS 12.0 or later (tested on iOS 14.8.1 and 15.1)If you have Theos installed locally: + +- Jailbroken (any jailbreak: checkra1n, unc0ver, Taurine, etc.) + +- Dependencies (auto-installed):```bash + + - `com.muirey03.libmryipc` (available on default repos)./build.sh + + - `mobilesubstrate```` + + - `preferenceloader` + + - `openssl`Requirements: + +- [Theos](https://theos.dev/docs/installation) installed at `/opt/theos` or `$HOME/theos` + +### Build System Uses:- iOS SDKs from [theos/sdks](https://github.com/theos/sdks) + +- Ubuntu 22.04 in Docker- MRYIPC headers installed in Theos + +- Theos framework- dpkg-deb (install via Homebrew: `brew install dpkg`) + +- iOS 13.7 SDK- ldid (install via Homebrew: `brew install ldid`) + +- Clang 10 cross-compiler for arm64/arm64e ## Build Environment -This package uses [MonkeyDev](https://github.com/AloneMonkey/MonkeyDev/wiki/Installation) for its environment, alongside Theos for the Preferences. + +## CompatibilityThis package uses [Theos](https://theos.dev/) for building the tweak components and [MonkeyDev](https://github.com/AloneMonkey/MonkeyDev/wiki/Installation) for the main binary. + + +Works on: +- iPhone 5s through iPhone 15 Pro Max +- iOS 12.0 - iOS 17.x +- All arm64/arm64e devices + +## Troubleshooting + +**Docker not found?** +Install Docker: https://docs.docker.com/get-docker/ + +**Permission denied on build script?** +```bash +chmod +x build-docker.sh +``` + +**Build fails with errors?** +Remove old Docker images and rebuild: +```bash +docker rmi webmessage-builder:latest +./build-docker.sh +``` + +**Can't install on device?** +Make sure `libmryipc` is installed first via Cydia/Sileo + +## Features + +- Real-time sending and receiving of messages +- Send attachments from your computer +- Native notifications +- SSL encryption with private certificates +- Password-protected +- Always-running daemon +- Download all attachments through client + +## Credits + +Original project: https://github.com/sgtaziz/WebMessage + +If you would like to support the original author: https://paypal.me/sgtaziztweaks diff --git a/build-docker.sh b/build-docker.sh new file mode 100755 index 0000000..6236825 --- /dev/null +++ b/build-docker.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +# Build script for WebMessage .deb package using Docker +# This script builds the Docker image and runs it to create the .deb file + +set -e + +echo "==========================================" +echo "WebMessage Docker Build Script" +echo "==========================================" +echo "" + +# Colors for output +GREEN='\033[0;32m' +BLUE='\033[0;34m' +RED='\033[0;31m' +NC='\033[0m' # No Color + +# Configuration +IMAGE_NAME="webmessage-builder" +CONTAINER_NAME="webmessage-build-container" +OUTPUT_DIR="./output" + +# Clean up old container if it exists +if [ "$(docker ps -aq -f name=${CONTAINER_NAME})" ]; then + echo -e "${BLUE}Removing old container...${NC}" + docker rm -f ${CONTAINER_NAME} 2>/dev/null || true +fi + +# Build the Docker image +echo -e "${BLUE}Building Docker image...${NC}" +docker build -t ${IMAGE_NAME}:latest . + +# Create output directory +mkdir -p ${OUTPUT_DIR} + +# Run the container and copy the .deb file +echo "" +echo -e "${BLUE}Running build container...${NC}" +docker run --name ${CONTAINER_NAME} ${IMAGE_NAME}:latest + +# Copy the .deb file from the container +echo "" +echo -e "${BLUE}Copying .deb file from container...${NC}" +docker cp ${CONTAINER_NAME}:/build/WebMessage.deb ${OUTPUT_DIR}/ + +# Clean up container +docker rm ${CONTAINER_NAME} + +# Show the result +echo "" +echo -e "${GREEN}========================================${NC}" +echo -e "${GREEN}Build completed successfully!${NC}" +echo -e "${GREEN}========================================${NC}" +echo "" +echo -e "Package location: ${GREEN}${OUTPUT_DIR}/WebMessage.deb${NC}" +echo "" +ls -lh ${OUTPUT_DIR}/WebMessage.deb +echo "" +echo -e "${BLUE}Package info:${NC}" +dpkg-deb --info ${OUTPUT_DIR}/WebMessage.deb 2>/dev/null || echo "Install dpkg to view package info" +echo "" +echo -e "${GREEN}You can now install this .deb file on your jailbroken iOS device!${NC}" diff --git a/libwebmessage/Makefile b/libwebmessage/Makefile index 20c2f4a..013d337 100644 --- a/libwebmessage/Makefile +++ b/libwebmessage/Makefile @@ -10,7 +10,8 @@ TWEAK_NAME = libwebmessage libwebmessage_FILES = Tweak.x libwebmessage_CFLAGS = -fobjc-arc -libwebmessage_LIBRARIES = mryipc +libwebmessage_LIBRARIES = mryipc c++ +libwebmessage_LDFLAGS = -lc++ include $(THEOS_MAKE_PATH)/tweak.mk