Skip to content

Commit b0c58c3

Browse files
committed
Update readme
Use protoc prebuilt binary
1 parent 29fee0c commit b0c58c3

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

README.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Aapt2 package build workflow
22

3-
[![build workflow](https://github.com/revanced/aapt2/actions/workflows/build.yml/badge.svg)](https://github.com/revanced/aapt2/actions/workflows/build.yml)
3+
[![build workflow](../../actions/workflows/release.yml/badge.svg)](../../actions/workflows/release.yml)
44

55
This repository contains a workflow to build the aapt2 binaries for Android.
66

@@ -11,25 +11,29 @@ This repository contains a workflow to build the aapt2 binaries for Android.
1111
git submodule update --init --recursive --depth 1
1212
```
1313

14-
## Apply patch
14+
## Protoc dependency
15+
16+
`protoc` needs to be installed, the current required version is 21.12. Install it with:
1517
```bash
16-
bash ./patch.sh
18+
wget https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-linux-x86_64.zip
19+
sudo unzip -p protoc-*.zip bin/protoc -d /usr/local/bin/
20+
```
21+
22+
The required version can be identified with :
23+
```bash
24+
grep PROTOC_VERSION src/protobuf/protobuf_version.bzl
1725
```
1826

19-
## Build protoc
27+
## Apply patch
2028
```bash
21-
mkdir -p src/protobuf/build
22-
cd src/protobuf/build
23-
cmake -GNinja -Dprotobuf_BUILD_TESTS=OFF ..
24-
ninja -j$(nproc --all)
25-
cd -
29+
bash ./patch.sh
2630
```
2731

2832
## Build the binary
2933

3034
Supported arch are 'x86_64', 'x86', 'arm64-v8a' & 'armeabi-v7a'
3135
```bash
32-
ANDROID_NDK="$HOME/Android/Sdk/ndk/" PROTOC_PATH="$PWD/src/protobuf/build/protoc" bash ./build.sh arm64-v8a # Build output in build/$arch/bin/aapt-*
36+
ANDROID_NDK="$HOME/Android/Sdk/ndk/" bash ./build.sh arm64-v8a # Build output in build/bin/aapt-*
3337
```
3438

3539
# Credits

build-tools/aapt2.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ set_source_files_properties(${AAPT2_PROTO_SRC} ${AAPT2_PROTO_HDRS}
4545
set(COMPILE_FLAGS
4646
-Wno-unused-parameter
4747
-Wno-missing-field-initializers
48-
-fno-exceptions
48+
-fno-exceptions
4949
-fno-rtti)
5050

5151
set(INCLUDES

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ cmake -GNinja \
6161
-Dprotobuf_BUILD_LIBPROTOC=ON \
6262
-DPNG_SHARED=OFF \
6363
-DZLIB_USE_STATIC_LIBS=ON
64-
64+
6565
# Build the binary
6666
ninja -C build aapt2
6767

0 commit comments

Comments
 (0)