diff --git a/Dockerfile b/Dockerfile index 6b2354c..823f012 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:22.04 ARG HASH_PATCH ARG COMMIT @@ -18,10 +18,10 @@ ENV HASH_PATCH=$HASH_PATCH ENV COMMIT=$COMMIT RUN apt-get update && \ - DEBIAN_FRONTEND="noninteractive" apt-get install -y git git-svn git-man wget curl software-properties-common unzip python3-pip python3 lsb-release sudo apt-transport-https tzdata && \ + DEBIAN_FRONTEND="noninteractive" apt-get install -y git git-svn git-man wget curl software-properties-common unzip python3-pip python3 lsb-release sudo apt-transport-https tzdata python3-pkgconfig && \ mkdir t -ENTRYPOINT ["/bin/sh", "-c", "cd /t && pip3 install wheel && pip3 install . && rm -rf ${DEPOT_TOOLS_PATH} 2> /dev/null && git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git $DEPOT_TOOLS_PATH && rm -rf ${TEMP_ENGINE} 2> /dev/null && git clone https://github.com/flutter/engine.git $TEMP_ENGINE && rm -rf ${ENGINE_PATH} 2> /dev/null && mkdir --parents $ENGINE_PATH && cd $TEMP_ENGINE && git config --global user.email \"reflutter@example.com\" && git config --global user.name \"reflutter\" && git fetch origin $COMMIT && git reset --hard FETCH_HEAD && reflutter $HASH_PATCH -l && echo 'reflutter' > REFLUTTER && git add . && git commit -am \"reflutter\" && cd $ENGINE_PATH && echo 'solutions = [{\"managed\": False,\"name\": \"src/flutter\",\"url\": \"'$TEMP_ENGINE'\",\"custom_deps\": {},\"deps_file\": \"DEPS\",\"safesync_url\": \"\",},]' > .gclient && gclient sync && reflutter $HASH_PATCH -l && echo \"Wait... Change the source code...\" && sleep $WAIT && src/build/install-build-deps-android.sh --no-prompt && if [ \"$arm64\" != \"0\" ]; then src/flutter/tools/gn --no-goma --android --android-cpu=arm64 --runtime-mode=release && ninja -C src/out/android_release_arm64 && cp src/out/android_release_arm64/lib.stripped/libflutter.so /libflutter_arm64.so ;fi && if [ \"$arm\" != \"0\" ]; then src/flutter/tools/gn --no-goma --android --android-cpu=arm --runtime-mode=release && ninja -C src/out/android_release && cp src/out/android_release/lib.stripped/libflutter.so /libflutter_arm.so ;fi && if [ \"$x64\" != \"0\" ]; then src/flutter/tools/gn --no-goma --android --android-cpu=x64 --runtime-mode=release && ninja -C src/out/android_release_x64 && cp src/out/android_release_x64/lib.stripped/libflutter.so /libflutter_x64.so; fi && cd .. && cp -va *.so /t/"] +ENTRYPOINT ["/bin/sh", "-c", "cd /t && pip3 install wheel && pip3 install . && rm -rf ${DEPOT_TOOLS_PATH} 2> /dev/null && git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git ${DEPOT_TOOLS_PATH} && rm -rf ${TEMP_ENGINE} 2> /dev/null && git clone https://github.com/flutter/engine.git ${TEMP_ENGINE} && rm -rf ${ENGINE_PATH} 2> /dev/null && mkdir -p ${ENGINE_PATH} && cd ${TEMP_ENGINE} && git config --global user.email \"reflutter@example.com\" && git config --global user.name \"reflutter\" && git fetch origin ${COMMIT} && git reset --hard FETCH_HEAD && reflutter ${HASH_PATCH} -l && echo 'reflutter' > REFLUTTER && git add . && git commit -am \"reflutter\" && cd ${ENGINE_PATH} && echo 'solutions = [{\"managed\": False,\"name\": \"src/flutter\",\"url\": \"'${TEMP_ENGINE}'\",\"custom_deps\": {},\"deps_file\": \"DEPS\",\"safesync_url\": \"\",},]' > .gclient && gclient sync && reflutter ${HASH_PATCH} -l && echo \"Wait... Change the source code...\" && sleep $WAIT && if [ \"$arm64\" != \"0\" ]; then src/flutter/tools/gn --no-goma --android --android-cpu=arm64 --runtime-mode=release && ninja -C src/out/android_release_arm64 && cp src/out/android_release_arm64/lib.stripped/libflutter.so /libflutter_arm64.so ;fi && if [ \"$arm\" != \"0\" ]; then src/flutter/tools/gn --no-goma --android --android-cpu=arm --runtime-mode=release && ninja -C src/out/android_release && cp src/out/android_release/lib.stripped/libflutter.so /libflutter_arm.so ;fi && if [ \"$x64\" != \"0\" ]; then src/flutter/tools/gn --no-goma --android --android-cpu=x64 --runtime-mode=release && ninja -C src/out/android_release_x64 && cp src/out/android_release_x64/lib.stripped/libflutter.so /libflutter_x64.so; fi && cd .. && cp -va *.so /t/"] CMD ["bash"] diff --git a/scripts/build-engine b/scripts/build-engine index fa2fdeb..04b6593 100755 --- a/scripts/build-engine +++ b/scripts/build-engine @@ -46,7 +46,6 @@ mkdir customEngine cd customEngine echo 'solutions = [{"managed": False,"name": "src/flutter","url": "'"$ROOT_DIR"/engine'","custom_deps": {},"deps_file": "DEPS","safesync_url": "",},]' > .gclient gclient sync -exit reflutter "$SNAPSHOT_HASH" -l cd "$ROOT_DIR" export PATH=$PATH:$(pwd)/depot_tools && sudo xcode-select -s /Applications/Xcode.app && customEngine/src/flutter/tools/gn --ios --runtime-mode=release && ninja -C customEngine/src/out/ios_release diff --git a/src/__init__.py b/src/__init__.py index e86b36e..9d7fd73 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -332,6 +332,17 @@ def patchSource(hashS, ver): 'static bool ssl_crypto_x509_session_verify_cert_chain(SSL_SESSION *session,\n SSL_HANDSHAKE *hs,\n uint8_t *out_alert) {', 'static bool ssl_crypto_x509_session_verify_cert_chain(SSL_SESSION *session,\n SSL_HANDSHAKE *hs,\n uint8_t *out_alert) {\n return true;') + # src/flutter/third_party/boringssl/src/ssl/ssl_x509.cc + replaceFileText('src/flutter/third_party/boringssl/src/ssl/ssl_x509.cc', + 'static bool ssl_crypto_x509_session_verify_cert_chain(SSL_SESSION *session,\n SSL_HANDSHAKE *hs,\n uint8_t *out_alert) {', + 'static bool ssl_crypto_x509_session_verify_cert_chain(SSL_SESSION *session,\n SSL_HANDSHAKE *hs,\n uint8_t *out_alert) {return true;') + replaceFileText('src/flutter/third_party/boringssl/src/ssl/ssl_x509.cc', + 'static int ssl_crypto_x509_session_verify_cert_chain(SSL_SESSION *session,\n SSL_HANDSHAKE *hs,\n uint8_t *out_alert) {', + 'static int ssl_crypto_x509_session_verify_cert_chain(SSL_SESSION *session,\n SSL_HANDSHAKE *hs,\n uint8_t *out_alert) {return 1;') + replaceFileText('src/flutter/third_party/boringssl/src/ssl/ssl_x509.cc', + 'static bool ssl_crypto_x509_session_verify_cert_chain(SSL_SESSION *session,\n SSL_HANDSHAKE *hs,\n uint8_t *out_alert) {', + 'static bool ssl_crypto_x509_session_verify_cert_chain(SSL_SESSION *session,\n SSL_HANDSHAKE *hs,\n uint8_t *out_alert) {\n return true;') + if ver == 26 or ver == 27: replaceFileText('tools/generate_package_config/pubspec.yaml', 'package_config: any', 'package_config: 1.9.3') if ver == 24: