feat: PLANNING体系首版(00路线图/02任务总表/03执行协议/I-03/I-04/registry42口径)+M1止血交付

This commit is contained in:
2026-09-12 14:25:25 +08:00
commit 39af400fc8
472 changed files with 36277 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
FROM redroid/redroid:14.0.0-latest
# Install required packages
RUN apt-get update && apt-get install -y \
curl \
wget \
unzip \
openjdk-17-jdk \
android-tools-adb \
&& rm -rf /var/lib/apt/lists/*
# Set up Android SDK environment
ENV ANDROID_HOME=/opt/android-sdk
ENV PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools
# Create working directory
WORKDIR /app
# Copy entrypoint script
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
# Create APK directory
RUN mkdir -p /app/apks
# Expose ADB ports
EXPOSE 5555 5556
# Health check - check if redroid is running
HEALTHCHECK --interval=30s --timeout=10s --retries=5 \
CMD curl -f http://localhost:5555/ || exit 1
ENTRYPOINT ["/app/entrypoint.sh"]
+49
View File
@@ -0,0 +1,49 @@
FROM ubuntu:22.04
# Prevent interactive prompts
ENV DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN apt-get update && apt-get install -y \
curl \
wget \
unzip \
git \
openjdk-17-jdk \
&& rm -rf /var/lib/apt/lists/*
# Set up Android SDK
ENV ANDROID_HOME=/opt/android-sdk
ENV ANDROID_SDK_ROOT=/opt/android-sdk
ENV PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools
# Download and install Android SDK command line tools
RUN mkdir -p $ANDROID_HOME/cmdline-tools && \
cd $ANDROID_HOME/cmdline-tools && \
wget -q https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -O cmdline-tools.zip && \
unzip cmdline-tools.zip && \
mv cmdline-tools latest && \
rm cmdline-tools.zip
# Accept licenses and install required SDK components
RUN yes | sdkmanager --licenses && \
sdkmanager "platform-tools" "platforms;android-34" "build-tools;34.0.0"
# Copy the Android project
WORKDIR /app
COPY android-chunyu/ .
# Make gradlew executable
RUN chmod +x gradlew
# Build the debug APK
RUN ./gradlew assembleDebug --no-daemon
# Copy APK to expected location
RUN mkdir -p /output && \
cp app/build/outputs/apk/debug/app-debug.apk /output/ && \
echo "APK built successfully!" && \
ls -la /output/
# Output APK location
VOLUME ["/output"]
+26
View File
@@ -0,0 +1,26 @@
FROM ubuntu:22.04
# Prevent interactive prompts
ENV DEBIAN_FRONTEND=noninteractive
# Install ADB and tools
RUN apt-get update && apt-get install -y \
curl \
wget \
unzip \
openjdk-17-jdk \
android-tools-adb \
android-tools-fastboot \
&& rm -rf /var/lib/apt/lists/*
# Create working directory
WORKDIR /app
# Copy scripts
COPY scripts /app/scripts
RUN chmod +x /app/scripts/*.sh
# Create APK directory
RUN mkdir -p /app/apks
ENTRYPOINT ["/app/scripts/entrypoint.sh"]
+4
View File
@@ -0,0 +1,4 @@
# Android APK output directory
# Place your app-debug.apk here or use --build-apk flag
*.apk
!README.md
+81
View File
@@ -0,0 +1,81 @@
#!/bin/bash
set -e
echo "=========================================="
echo " ChunYu Android Emulator Container"
echo "=========================================="
# Configuration
BACKEND_HOST="${BACKEND_HOST:-backend}"
BACKEND_PORT="${BACKEND_PORT:-8000}"
APK_PATH="${APK_PATH:-/app/apks/app-debug.apk}"
LAUNCH_ACTIVITY="${LAUNCH_ACTIVITY:-com.chunyu.app/.MainActivity}"
echo "[1/5] Starting Redroid Android container..."
# Start redroid in background
redroid --host=0.0.0.0 --port=5555 &
REDROID_PID=$!
echo "[2/5] Waiting for Android emulator to be ready..."
# Wait for boot completion
timeout=120
counter=0
while [ $counter -lt $timeout ]; do
if adb devices | grep -q "emulator.*device"; then
echo " ✓ Android emulator is ready!"
break
fi
sleep 2
counter=$((counter + 2))
echo " ...waiting for emulator (${counter}s/${timeout}s)"
done
if [ $counter -ge $timeout ]; then
echo " ✗ Timeout waiting for emulator to boot"
exit 1
fi
# Wait for boot completion
adb wait-for-device
echo " Waiting for boot to complete..."
adb shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done; echo "Boot completed"'
echo " ✓ Android boot completed!"
echo "[3/5] Configuring network..."
# Get the IP that the Android emulator can use to reach the backend
# In Docker bridge network, we can use the service name
echo " Backend host: ${BACKEND_HOST}:${BACKEND_PORT}"
# Push configuration to Android
# Create a config file that the app can read
adb shell "mkdir -p /data/local/tmp/chunyu"
adb shell "echo '${BACKEND_HOST}' > /data/local/tmp/chunyu/backend_host"
adb shell "echo '${BACKEND_PORT}' > /data/local/tmp/chunyu/backend_port"
echo "[4/5] Installing APK..."
if [ -f "$APK_PATH" ]; then
echo " Installing: $APK_PATH"
adb install -r -t "$APK_PATH"
echo " ✓ APK installed successfully!"
else
echo " ⚠ APK not found at $APK_PATH"
echo " Please mount the APK to /app/apks/app-debug.apk"
fi
echo "[5/5] Launching application..."
adb shell am start -n "$LAUNCH_ACTIVITY"
echo " ✓ Application launched!"
echo ""
echo "=========================================="
echo " Android Emulator Ready!"
echo "=========================================="
echo " ADB Port: 5555"
echo " Backend: ${BACKEND_HOST}:${BACKEND_PORT}"
echo ""
echo " To connect from host:"
echo " adb connect localhost:5555"
echo "=========================================="
# Keep container running
wait $REDROID_PID
+81
View File
@@ -0,0 +1,81 @@
#!/bin/bash
set -e
echo "=========================================="
echo " ChunYu Android Tools Container"
echo "=========================================="
# Configuration
ANDROID_HOST="${ANDROID_HOST:-android}"
ANDROID_PORT="${ANDROID_PORT:-5555}"
APK_PATH="${APK_PATH:-/app/apks/app-debug.apk}"
LAUNCH_ACTIVITY="${LAUNCH_ACTIVITY:-com.chunyu.app/.MainActivity}"
WAIT_TIMEOUT="${WAIT_TIMEOUT:-120}"
echo "[1/4] Waiting for Android emulator (${ANDROID_HOST}:${ANDROID_PORT})..."
# Wait for the emulator to be reachable via ADB
counter=0
while [ $counter -lt $WAIT_TIMEOUT ]; do
if adb connect "${ANDROID_HOST}:${ANDROID_PORT}" 2>/dev/null | grep -q "connected"; then
echo " ✓ Connected to Android emulator!"
break
fi
sleep 2
counter=$((counter + 2))
echo " ...waiting for emulator (${counter}s/${WAIT_TIMEOUT}s)"
done
if [ $counter -ge $WAIT_TIMEOUT ]; then
echo " ✗ Timeout waiting for emulator"
exit 1
fi
# Wait for ADB device to be ready
adb wait-for-device
echo " ✓ ADB device ready!"
# Wait for boot to complete
echo "[2/4] Waiting for Android boot..."
counter=0
while [ $counter -lt $WAIT_TIMEOUT ]; do
boot_status=$(adb shell getprop sys.boot_completed 2>/dev/null || echo "")
if [ "$boot_status" = "1" ]; then
echo " ✓ Android boot completed!"
break
fi
sleep 2
counter=$((counter + 2))
echo " ...waiting for boot (${counter}s/${WAIT_TIMEOUT}s)"
done
if [ $counter -ge $WAIT_TIMEOUT ]; then
echo " ✗ Timeout waiting for boot"
exit 1
fi
echo "[3/4] Installing APK..."
if [ -f "$APK_PATH" ]; then
echo " Installing: $APK_PATH"
adb install -r -t "$APK_PATH" 2>&1 || echo " ⚠ APK install failed"
echo " ✓ APK installation attempted!"
else
echo " ⚠ APK not found at $APK_PATH"
echo " Mount the APK to /app/apks/app-debug.apk"
fi
echo "[4/4] Launching application..."
adb shell am start -n "$LAUNCH_ACTIVITY" 2>&1 || echo " ⚠ Launch failed"
echo " ✓ Launch attempted!"
echo ""
echo "=========================================="
echo " Android Tools Complete!"
echo "=========================================="
echo ""
echo " To connect from host:"
echo " adb connect localhost:5555"
echo ""
echo " To view logcat:"
echo " adb logcat"
echo "=========================================="