diff --git a/README.md b/README.md index 258a502..dae2d65 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This tool focuses on editing Android boot.img(also recovery.img, and vbmeta.img) ## 1. Prerequisite #### 1.1 Host OS requirement: -Linux or Mac development env. To get the most of the toolkit, following packages are also needed: python, jdk 8+, zlib1g-dev, cpio, device-tree-compiler. +![Linux](doc/linux24.png) or ![Mac](doc/apple24.png) development env. To get the most of the toolkit, following packages are also needed: python, jdk 8+, zlib1g-dev, cpio, device-tree-compiler. #### 1.2 Target Android requirement: @@ -34,6 +34,10 @@ Clone this repo with minimal depth: git clone https://github.com/cfig/Android_boot_image_editor.git --depth=1 +or clone it from mirror: + + git clone https://gitee.com/cfig/Android_boot_image_editor.git --depth=1 + Put your boot.img to current directory, then start gradle 'unpack' task: cp boot.img diff --git a/aosp/libavb1.2/src/avb/c/avb_sysdeps_posix.c b/aosp/libavb1.2/src/avb/c/avb_sysdeps_posix.c index e26c3ef..f1572a5 100644 --- a/aosp/libavb1.2/src/avb/c/avb_sysdeps_posix.c +++ b/aosp/libavb1.2/src/avb/c/avb_sysdeps_posix.c @@ -22,7 +22,11 @@ * SOFTWARE. */ +#if defined(__APPLE__) && defined(__MACH__) +#include +#else #include +#endif #include #include #include diff --git a/aosp/libsparse/append2simg/build.gradle.kts b/aosp/libsparse/append2simg/build.gradle.kts index 8249e94..5484028 100644 --- a/aosp/libsparse/append2simg/build.gradle.kts +++ b/aosp/libsparse/append2simg/build.gradle.kts @@ -12,3 +12,7 @@ application { tasks.withType(LinkExecutable::class.java).configureEach { linkerArgs.add("-lz") } + +tasks.withType(CppCompile::class.java).configureEach { + compilerArgs.add("-std=c++17") +} diff --git a/aosp/libsparse/base/build.gradle.kts b/aosp/libsparse/base/build.gradle.kts index f3e15d6..92a1fe4 100644 --- a/aosp/libsparse/base/build.gradle.kts +++ b/aosp/libsparse/base/build.gradle.kts @@ -12,3 +12,7 @@ extensions.configure { privateHeaders.from(file("src/main/headers")) publicHeaders.from(file("src/main/public")) } + +tasks.withType(CppCompile::class.java).configureEach { + compilerArgs.add("-std=c++17") +} diff --git a/aosp/libsparse/img2simg/build.gradle.kts b/aosp/libsparse/img2simg/build.gradle.kts index 8249e94..5484028 100644 --- a/aosp/libsparse/img2simg/build.gradle.kts +++ b/aosp/libsparse/img2simg/build.gradle.kts @@ -12,3 +12,7 @@ application { tasks.withType(LinkExecutable::class.java).configureEach { linkerArgs.add("-lz") } + +tasks.withType(CppCompile::class.java).configureEach { + compilerArgs.add("-std=c++17") +} diff --git a/aosp/libsparse/simg2img/build.gradle.kts b/aosp/libsparse/simg2img/build.gradle.kts index d8e587c..3cf339c 100644 --- a/aosp/libsparse/simg2img/build.gradle.kts +++ b/aosp/libsparse/simg2img/build.gradle.kts @@ -15,3 +15,7 @@ tasks.withType(LinkExecutable::class.java).configureEach { tasks.register("hello") { } + +tasks.withType(CppCompile::class.java).configureEach { + compilerArgs.add("-std=c++17") +} diff --git a/aosp/libsparse/simg2simg/build.gradle.kts b/aosp/libsparse/simg2simg/build.gradle.kts index 8249e94..5484028 100644 --- a/aosp/libsparse/simg2simg/build.gradle.kts +++ b/aosp/libsparse/simg2simg/build.gradle.kts @@ -12,3 +12,7 @@ application { tasks.withType(LinkExecutable::class.java).configureEach { linkerArgs.add("-lz") } + +tasks.withType(CppCompile::class.java).configureEach { + compilerArgs.add("-std=c++17") +} diff --git a/aosp/mkbootfs.10/build.gradle b/aosp/mkbootfs.10/build.gradle index 0c8f4a7..f792d7c 100644 --- a/aosp/mkbootfs.10/build.gradle +++ b/aosp/mkbootfs.10/build.gradle @@ -1,10 +1,10 @@ -apply plugin: 'cpp' -apply plugin: 'c' +apply plugin: 'cpp' +apply plugin: 'c' model { buildTypes { release - } + } components { mkbootfs(NativeExecutableSpec) { @@ -12,7 +12,7 @@ model { cppCompiler.define "__ANDROID_VNDK__" //cppCompiler.define 'CFIG_NO_FIX_STAT' cppCompiler.args << "-Wno-write-strings" - } - } - } + } + } + } } diff --git a/aosp/mkbootfs.11/build.gradle b/aosp/mkbootfs.11/build.gradle index 636dd65..c7b8efc 100644 --- a/aosp/mkbootfs.11/build.gradle +++ b/aosp/mkbootfs.11/build.gradle @@ -1,10 +1,10 @@ -apply plugin: 'cpp' -apply plugin: 'c' +apply plugin: 'cpp' +apply plugin: 'c' model { buildTypes { release - } + } components { mkbootfs(NativeExecutableSpec) { @@ -12,8 +12,8 @@ model { //cppCompiler.define "ANDROID" //cppCompiler.define "ANDROID", "__ANDROID_VNDK__" //cppCompiler.define 'CFIG_NO_FIX_STAT' - cppCompiler.args << '-std=c++17' << "-Wno-write-strings" - } - } - } + cppCompiler.args << "-std=c++17" << "-Wno-write-strings" + } + } + } } diff --git a/aosp/mkbootfs.11/src/mkbootfs/headers/utils/Compat.h b/aosp/mkbootfs.11/src/mkbootfs/headers/utils/Compat.h index 6002567..e49120f 100644 --- a/aosp/mkbootfs.11/src/mkbootfs/headers/utils/Compat.h +++ b/aosp/mkbootfs.11/src/mkbootfs/headers/utils/Compat.h @@ -79,7 +79,7 @@ static inline int ftruncate64(int fd, off64_t length) { #ifndef TEMP_FAILURE_RETRY /* Used to retry syscalls that can return EINTR. */ #define TEMP_FAILURE_RETRY(exp) ({ \ - typeof (exp) _rc; \ + decltype (exp) _rc; \ do { \ _rc = (exp); \ } while (_rc == -1 && errno == EINTR); \ diff --git a/doc/apple24.png b/doc/apple24.png new file mode 100644 index 0000000..3b8b16c Binary files /dev/null and b/doc/apple24.png differ diff --git a/doc/linux24.png b/doc/linux24.png new file mode 100644 index 0000000..f3bf519 Binary files /dev/null and b/doc/linux24.png differ diff --git a/tools/gfw.sh b/tools/gfw.sh new file mode 100755 index 0000000..dfc5b35 --- /dev/null +++ b/tools/gfw.sh @@ -0,0 +1,50 @@ +#! /bin/sh +# speed up with mirrors within the biggest LAN + +git apply - <