Skip to content

Commit 82b7b2f

Browse files
Merge pull request #9 from tkgstrator/arm64
Add Docker support and convert subhook to submodule
2 parents 36e7fff + 014259f commit 82b7b2f

8 files changed

Lines changed: 98 additions & 6 deletions

File tree

.dockerignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.editorconfig
2+
.env
3+
.git
4+
.gitattributes
5+
.github
6+
.gitignore
7+
.gitmodules
8+
.vscode
9+
Dockerfile
10+
README.md
11+
build

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
USERNAME=
2+
PASSWORD=

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,8 @@ rootfs/
8989
.vscode/
9090
wrapper
9191
rootfs/system/bin/linker64
92-
build/
92+
build/
93+
94+
# Enviroment Variables
95+
.env
96+
!.env.example

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "subhook"]
2+
path = subhook
3+
url = https://github.com/savushkin-r-d/subhook.git

Dockerfile

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,46 @@
1-
FROM ubuntu:latest
1+
ARG BUILD_PLATFORM=linux/amd64
2+
ARG RUNTIME_PLATFORM=linux/arm64
3+
4+
FROM --platform=${BUILD_PLATFORM} debian:13.2 AS build
5+
ARG TARGET_ARCH=aarch64
6+
ARG NDK_VERSION=23
7+
8+
SHELL ["/bin/bash", "-c"]
9+
10+
RUN \
11+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
12+
--mount=type=cache,target=/var/cache/apt,sharing=locked \
13+
apt-get update && apt-get install -y \
14+
build-essential \
15+
cmake \
16+
unzip \
17+
git \
18+
lsb-release \
19+
gnupg \
20+
aria2 \
21+
gcc-aarch64-linux-gnu
22+
23+
WORKDIR /app
24+
RUN bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
25+
RUN aria2c -o android-ndk-r${NDK_VERSION}b-linux.zip https://dl.google.com/android/repository/android-ndk-r${NDK_VERSION}b-linux.zip
26+
RUN unzip -q -d ~ android-ndk-r${NDK_VERSION}b-linux.zip
27+
RUN rm android-ndk-r${NDK_VERSION}b-linux.zip
28+
COPY ./ ./
29+
30+
WORKDIR /app
31+
RUN mkdir build
32+
WORKDIR /app/build
33+
RUN cmake -DTARGET_ARCH=${TARGET_ARCH} ..
34+
RUN make -j$(nproc)
35+
36+
FROM --platform=${RUNTIME_PLATFORM} debian:13.2
237

338
WORKDIR /app
4-
COPY . /app
5-
ENV args ""
39+
COPY --from=build /app/wrapper /app/wrapper
40+
COPY --from=build /app/rootfs /app/rootfs
41+
COPY entrypoint.sh /app/entrypoint.sh
42+
RUN chmod +x /app/entrypoint.sh
643

7-
CMD ["bash", "-c", "./wrapper ${args}"]
44+
CMD ["/app/entrypoint.sh"]
845

9-
EXPOSE 10020 20020
46+
EXPOSE 10020 20020 30020

compose.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
services:
2+
app:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
6+
args:
7+
TARGET_ARCH: aarch64
8+
NDK_VERSION: 23
9+
volumes:
10+
- ./rootfs/data:/app/rootfs/data
11+
environment:
12+
USERNAME: ${USERNAME}
13+
PASSWORD: ${PASSWORD}

entrypoint.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
set -e
3+
4+
MUSIC_TOKEN_PATH="/app/rootfs/data/data/com.apple.android.music/files/MUSIC_TOKEN"
5+
6+
if [ ! -f "$MUSIC_TOKEN_PATH" ]; then
7+
echo "Login required: MUSIC_TOKEN not found."
8+
if [ -z "${USERNAME}" ] || [ -z "${PASSWORD}" ]; then
9+
echo "Error: USERNAME and PASSWORD environment variables must be set when MUSIC_TOKEN is missing." >&2
10+
exit 1
11+
fi
12+
exec ./wrapper \
13+
-L ${USERNAME}:${PASSWORD} \
14+
-F \
15+
-H 0.0.0.0 \
16+
"$@"
17+
else
18+
exec ./wrapper \
19+
-H 0.0.0.0 \
20+
"$@"
21+
fi

subhook

Submodule subhook added at e935959

0 commit comments

Comments
 (0)