diff options
author | axtloss <axtlos@tar.black> | 2022-10-15 15:24:47 +0200 |
---|---|---|
committer | axtloss <axtlos@tar.black> | 2022-10-15 15:24:47 +0200 |
commit | d507cad4751b625ab9089919271377315998d72b (patch) | |
tree | 764e15aa08af5d7a5d37219f39aa8248350bb98d | |
parent | 15db8f29b673a7f1c3dd2592474421b29dd8795c (diff) | |
download | flatpaks-d507cad4751b625ab9089919271377315998d72b.tar.gz flatpaks-d507cad4751b625ab9089919271377315998d72b.tar.bz2 |
add com.github.remoteandroid.redroid
9 files changed, 205 insertions, 0 deletions
diff --git a/com.github.remote-android.reandroid/com.github.remote-android.reandroid.yml b/com.github.remote-android.reandroid/com.github.remote-android.reandroid.yml new file mode 100644 index 0000000..2568823 --- /dev/null +++ b/com.github.remote-android.reandroid/com.github.remote-android.reandroid.yml @@ -0,0 +1,80 @@ +app-id: com.github.remoteandroid.reandroid +runtime: org.freedesktop.Platform +runtime-version: '22.08' +sdk: org.freedesktop.Sdk +command: run + +finish-args: + - --talk-name=org.freedesktop.Flatpak + - --socket=wayland + - --socket=x11 + - --share=network + - --device=all + - --env=SCRCPY_SERVER_PATH=/app/share/scrcpy/scrcpy-server + +add-extensions: + org.freedesktop.Platform.ffmpeg-full: + directory: lib/ffmpeg + version: "22.08" + add-ld-path: . + + +cleanup-commands: + - mkdir -p ${FLATPAK_DEST}/lib/ffmpeg + +modules: + - name: redroid + buildsystem: simple + sources: + - type: file + path: ./run.sh + - type: file + path: ./sudo.sh + - type: file + path: setup-binder.sh + build-commands: + - install -Dm755 run.sh /app/bin/run + - install -Dm755 sudo.sh /app/bin/sudo + - install -Dm755 setup-binder.sh /app/bin/setup-binder + + # Taken from https://github.com/flathub/shared-modules/blob/master/libusb/libusb.json + - name: libusb + config-opts: + - "--disable-static" + cleanup: + - "/lib/*.la" + - "/lib/pkgconfig" + - "/include" + sources: + - type: archive + url: https://github.com/libusb/libusb/archive/v1.0.24.tar.gz + sha256: b7724c272dfc5713dce88ff717efd60f021ca5b7c8e30f08ebb2c42d2eea08ae + post-install: + - install -Dm644 COPYING /app/share/licenses/libusb/COPYING + + + # Taken from https://github.com/nexustar/scrcpy-flatpak + - name: scrcpy + buildsystem: meson + config-opts: + - --buildtype=release + - --strip + - -Db_lto=true + - -Dprebuilt_server=scrcpy-server-v1.24 + sources: + - type: archive + url: https://github.com/Genymobile/scrcpy/archive/refs/tags/v1.24.tar.gz + sha256: e3054ad453ac577b941f8df0eabc94e842affc6e1d10ba8d21cededfa2eacc73 + - type: file + url: https://github.com/Genymobile/scrcpy/releases/download/v1.24/scrcpy-server-v1.24 + sha256: ae74a81ea79c0dc7250e586627c278c0a9a8c5de46c9fb5c38c167fb1a36f056 + + - name: adb + buildsystem: simple + build-commands: + - install -D adb /app/bin/adb + sources: + - type: archive + url: https://dl.google.com/android/repository/platform-tools_r32.0.0-linux.zip + sha256: b10f0e159f11aa08437f2e612c91e52616b8429e9d3b8c2d230456f0edd394e6 + diff --git a/com.github.remote-android.reandroid/run.sh b/com.github.remote-android.reandroid/run.sh new file mode 100644 index 0000000..86310ba --- /dev/null +++ b/com.github.remote-android.reandroid/run.sh @@ -0,0 +1,8 @@ +#!/usr/bin/bash +if [[ ! -d /dev/binderfs ]]; then + /app/bin/setup-binder +fi +sudo podman run -itd --rm --privileged -v ~/data:/data -p 5555:5555 docker.io/redroid/redroid:13.0.0-amd64 androidboot.use_memfd=true +adb connect localhost:5555 2>&1 && adb connect localhost:5555 +scrcpy -s localhost:5555 2>&1 && scrcpy -s localhost:5555 + diff --git a/com.github.remote-android.reandroid/setup-binder.sh b/com.github.remote-android.reandroid/setup-binder.sh new file mode 100644 index 0000000..0caf7b3 --- /dev/null +++ b/com.github.remote-android.reandroid/setup-binder.sh @@ -0,0 +1,8 @@ +#!/usr/bin/bash +sudo modprobe binder_linux devices="binder,hwbinder,vndbinder" +sudo mkdir -p /dev/binderfs +sudo mount -t binder binder /dev/binderfs +sudo ln -s /dev/binderfs/binder /dev/binder +sudo ln -s /dev/binderfs/hwbinder /dev/hwbinder +sudo ln -s /dev/binderfs/vndbinder /dev/vndbinder +sudo ln -s /dev/binderfs/binder-control /dev/binder-control diff --git a/com.github.remote-android.reandroid/sudo.sh b/com.github.remote-android.reandroid/sudo.sh new file mode 100644 index 0000000..5f0df92 --- /dev/null +++ b/com.github.remote-android.reandroid/sudo.sh @@ -0,0 +1,2 @@ +#!/usr/bin/bash +flatpak-spawn --host pkexec $@ diff --git a/com.github.remoteandroid.redroid/README.md b/com.github.remoteandroid.redroid/README.md new file mode 100644 index 0000000..5bcf789 --- /dev/null +++ b/com.github.remoteandroid.redroid/README.md @@ -0,0 +1,8 @@ +# [redroid/remote-android](https://github.com/remote-android) +Works fine, but requires [podman](https://podman.io/) installed on the host. + +If the `binder` module doesn't seem to be loaded it will be automatically loaded, requires the `binder` modules, expect a lot of password prompts. + +GPU acceleration *should* work, but I can't test it properly (nvidia moment). + +Ashmem is **not** needed. diff --git a/com.github.remoteandroid.redroid/com.github.remoteandroid.redroid.yml b/com.github.remoteandroid.redroid/com.github.remoteandroid.redroid.yml new file mode 100644 index 0000000..c44f56f --- /dev/null +++ b/com.github.remoteandroid.redroid/com.github.remoteandroid.redroid.yml @@ -0,0 +1,81 @@ +app-id: com.github.remoteandroid.redroid +runtime: org.freedesktop.Platform +runtime-version: '22.08' +sdk: org.freedesktop.Sdk +command: run + +finish-args: + - --talk-name=org.freedesktop.Flatpak + - --socket=wayland + - --socket=x11 + - --share=ipc + - --share=network + - --device=all + - --env=SCRCPY_SERVER_PATH=/app/share/scrcpy/scrcpy-server + +add-extensions: + org.freedesktop.Platform.ffmpeg-full: + directory: lib/ffmpeg + version: "22.08" + add-ld-path: . + + +cleanup-commands: + - mkdir -p ${FLATPAK_DEST}/lib/ffmpeg + +modules: + - name: redroid + buildsystem: simple + sources: + - type: file + path: ./run.sh + - type: file + path: ./sudo.sh + - type: file + path: setup-binder.sh + build-commands: + - install -Dm755 run.sh /app/bin/run + - install -Dm755 sudo.sh /app/bin/sudo + - install -Dm755 setup-binder.sh /app/bin/setup-binder + + # Taken from https://github.com/flathub/shared-modules/blob/master/libusb/libusb.json + - name: libusb + config-opts: + - "--disable-static" + cleanup: + - "/lib/*.la" + - "/lib/pkgconfig" + - "/include" + sources: + - type: archive + url: https://github.com/libusb/libusb/archive/v1.0.24.tar.gz + sha256: b7724c272dfc5713dce88ff717efd60f021ca5b7c8e30f08ebb2c42d2eea08ae + post-install: + - install -Dm644 COPYING /app/share/licenses/libusb/COPYING + + + # Taken from https://github.com/nexustar/scrcpy-flatpak + - name: scrcpy + buildsystem: meson + config-opts: + - --buildtype=release + - --strip + - -Db_lto=true + - -Dprebuilt_server=scrcpy-server-v1.24 + sources: + - type: archive + url: https://github.com/Genymobile/scrcpy/archive/refs/tags/v1.24.tar.gz + sha256: e3054ad453ac577b941f8df0eabc94e842affc6e1d10ba8d21cededfa2eacc73 + - type: file + url: https://github.com/Genymobile/scrcpy/releases/download/v1.24/scrcpy-server-v1.24 + sha256: ae74a81ea79c0dc7250e586627c278c0a9a8c5de46c9fb5c38c167fb1a36f056 + + - name: adb + buildsystem: simple + build-commands: + - install -D adb /app/bin/adb + sources: + - type: archive + url: https://dl.google.com/android/repository/platform-tools_r32.0.0-linux.zip + sha256: b10f0e159f11aa08437f2e612c91e52616b8429e9d3b8c2d230456f0edd394e6 + diff --git a/com.github.remoteandroid.redroid/run.sh b/com.github.remoteandroid.redroid/run.sh new file mode 100644 index 0000000..86310ba --- /dev/null +++ b/com.github.remoteandroid.redroid/run.sh @@ -0,0 +1,8 @@ +#!/usr/bin/bash +if [[ ! -d /dev/binderfs ]]; then + /app/bin/setup-binder +fi +sudo podman run -itd --rm --privileged -v ~/data:/data -p 5555:5555 docker.io/redroid/redroid:13.0.0-amd64 androidboot.use_memfd=true +adb connect localhost:5555 2>&1 && adb connect localhost:5555 +scrcpy -s localhost:5555 2>&1 && scrcpy -s localhost:5555 + diff --git a/com.github.remoteandroid.redroid/setup-binder.sh b/com.github.remoteandroid.redroid/setup-binder.sh new file mode 100644 index 0000000..0caf7b3 --- /dev/null +++ b/com.github.remoteandroid.redroid/setup-binder.sh @@ -0,0 +1,8 @@ +#!/usr/bin/bash +sudo modprobe binder_linux devices="binder,hwbinder,vndbinder" +sudo mkdir -p /dev/binderfs +sudo mount -t binder binder /dev/binderfs +sudo ln -s /dev/binderfs/binder /dev/binder +sudo ln -s /dev/binderfs/hwbinder /dev/hwbinder +sudo ln -s /dev/binderfs/vndbinder /dev/vndbinder +sudo ln -s /dev/binderfs/binder-control /dev/binder-control diff --git a/com.github.remoteandroid.redroid/sudo.sh b/com.github.remoteandroid.redroid/sudo.sh new file mode 100644 index 0000000..5f0df92 --- /dev/null +++ b/com.github.remoteandroid.redroid/sudo.sh @@ -0,0 +1,2 @@ +#!/usr/bin/bash +flatpak-spawn --host pkexec $@ |