sterepando commited on
Commit
a4ae104
·
verified ·
1 Parent(s): 807cb4b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -17
Dockerfile CHANGED
@@ -77,28 +77,21 @@ RUN cd /build && \
77
  --disable-tftp --without-libpsl --without-libidn2 --without-brotli --without-zstd --without-nghttp2 && \
78
  make -j$(nproc) && make install
79
 
80
- # 4. Компиляция GIT (С ПАТЧЕМ)
81
  RUN cd /build && \
82
  wget -q https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.43.0.tar.gz && \
83
  tar xzf git-2.43.0.tar.gz && \
84
  cd git-2.43.0 && \
85
- # --- MANDRE PATCH: Linker Bypass ---
86
- # Мы внедряем код прямо в prepare_cmd функцию в run-command.c
87
- # Ищем строку "if (cmd->no_stdin)" (она есть в начале prepare_cmd) и вставляем перед ней патч
88
  sed -i '/if (cmd->no_stdin)/i \
89
  /* MANDRE PATCH START */ \
90
- if (cmd->file && strncmp(cmd->file, "/data/", 6) == 0) { \
91
- const char **new_argv = malloc(sizeof(char *) * (256)); \
92
- new_argv[0] = "/system/bin/linker64"; \
93
- new_argv[1] = cmd->file; \
94
- int i = 0; \
95
- while (cmd->argv[i] && i < 250) { \
96
- new_argv[i + 2] = cmd->argv[i]; \
97
- i++; \
98
- } \
99
- new_argv[i + 2] = NULL; \
100
- cmd->argv = new_argv; \
101
- cmd->file = new_argv[0]; \
102
  } \
103
  /* MANDRE PATCH END */' run-command.c && \
104
  # --- КОМПИЛЯЦИЯ ---
@@ -126,7 +119,7 @@ RUN cd /build && \
126
 
127
  # 5. Финал
128
  WORKDIR /output
129
- RUN echo '<html><body><h1>Mandre GIT Bundle (Fix 8: Linker Patch)</h1><ul><li><a href="android-git-bundle.zip" download>Download ZIP</a></li></ul></body></html>' > index.html
130
  RUN chmod -R 777 /output
131
  EXPOSE 7860
132
  CMD ["python3", "-m", "http.server", "7860"]
 
77
  --disable-tftp --without-libpsl --without-libidn2 --without-brotli --without-zstd --without-nghttp2 && \
78
  make -j$(nproc) && make install
79
 
80
+ # 4. Компиляция GIT (С ПРАВИЛЬНЫМ ПАТЧЕМ)
81
  RUN cd /build && \
82
  wget -q https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.43.0.tar.gz && \
83
  tar xzf git-2.43.0.tar.gz && \
84
  cd git-2.43.0 && \
85
+ # --- MANDRE PATCH: Linker Bypass (Corrected for Git 2.43) ---
86
+ # Мы используем API strvec, который уже есть в git
 
87
  sed -i '/if (cmd->no_stdin)/i \
88
  /* MANDRE PATCH START */ \
89
+ if (cmd->args.v[0] && strncmp(cmd->args.v[0], "/data/", 6) == 0) { \
90
+ struct strvec new_args = STRVEC_INIT; \
91
+ strvec_push(&new_args, "/system/bin/linker64"); \
92
+ strvec_pushv(&new_args, cmd->args.v); \
93
+ strvec_clear(&cmd->args); \
94
+ cmd->args = new_args; \
 
 
 
 
 
 
95
  } \
96
  /* MANDRE PATCH END */' run-command.c && \
97
  # --- КОМПИЛЯЦИЯ ---
 
119
 
120
  # 5. Финал
121
  WORKDIR /output
122
+ RUN echo '<html><body><h1>Mandre GIT Bundle (Fix 9: Corrected Patch)</h1><ul><li><a href="android-git-bundle.zip" download>Download ZIP</a></li></ul></body></html>' > index.html
123
  RUN chmod -R 777 /output
124
  EXPOSE 7860
125
  CMD ["python3", "-m", "http.server", "7860"]