├── .gitignore
├── 01_getndk.sh
├── 02_getsource.sh
├── 03_build_libcrypto.sh
├── 04_build_protoc.sh
├── 05_build_partition_tools.sh
├── Android_partition_tools.mk
├── Application_partition_tools.mk
├── README.md
└── build.sh
/.gitignore:
--------------------------------------------------------------------------------
1 | /android*/
2 | /dist/
3 | /obj/
4 | /src/
5 | /wget*
6 |
--------------------------------------------------------------------------------
/01_getndk.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | NDK=android-ndk-r24-linux
4 | wget -c https://dl.google.com/android/repository/$NDK.zip
5 | unzip -o $NDK.zip
6 | rm -f $NDK.zip
7 |
--------------------------------------------------------------------------------
/02_getsource.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | clone() {
4 | repo=$1
5 | git clone -b platform-tools-33.0.1 https://android.googlesource.com/platform/$repo src/$repo
6 | }
7 |
8 | mkdir src
9 |
10 | mkdir src/system
11 | clone system/core
12 | clone system/vold
13 | clone system/gsid
14 | clone system/extras
15 | clone system/libbase
16 | clone system/logging
17 |
18 | mkdir src/external
19 | clone external/avb
20 | clone external/e2fsprogs
21 | clone external/fec
22 | clone external/fmtlib
23 | clone external/selinux
24 | clone external/squashfs-tools
25 | clone external/pcre
26 | clone external/protobuf
27 | clone external/zlib
28 |
29 | git clone https://boringssl.googlesource.com/boringssl src/boringssl
30 |
--------------------------------------------------------------------------------
/03_build_libcrypto.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | ROOT_DIR=`pwd`/src/boringssl
4 | DIST_DIR=$ROOT_DIR/dist
5 | BUILD_DIR=$ROOT_DIR/build
6 |
7 | ABIS="armeabi-v7a arm64-v8a"
8 |
9 | export ANDROID_NDK=$(pwd)/android-ndk-r24
10 |
11 | build_shared() {
12 | arch=$1
13 | rm -rf $BUILD_DIR
14 | mkdir $BUILD_DIR
15 | cd $BUILD_DIR
16 | cmake -DANDROID_ABI=$arch \
17 | -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
18 | -DANDROID_NATIVE_API_LEVEL=30 \
19 | -DBUILD_SHARED_LIBS=1 \
20 | -GNinja ..
21 | ninja
22 | if [ ! -d $DIST_DIR/$arch ]; then
23 | mkdir -p $DIST_DIR/$arch
24 | fi
25 | cp $BUILD_DIR/crypto/libcrypto.so $DIST_DIR/$arch
26 | cp $BUILD_DIR/decrepit/libdecrepit.so $DIST_DIR/$arch
27 | cp $BUILD_DIR/ssl/libssl.so $DIST_DIR/$arch
28 | }
29 |
30 | build_static() {
31 | arch=$1
32 | rm -rf $BUILD_DIR
33 | mkdir $BUILD_DIR
34 | cd $BUILD_DIR
35 | cmake -DANDROID_ABI=$arch \
36 | -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
37 | -DANDROID_NATIVE_API_LEVEL=30 \
38 | -GNinja ..
39 | ninja
40 | if [ ! -d $DIST_DIR/$arch ]; then
41 | mkdir -p $DIST_DIR/$arch
42 | fi
43 | cp $BUILD_DIR/crypto/libcrypto.a $DIST_DIR/$arch
44 | cp $BUILD_DIR/decrepit/libdecrepit.a $DIST_DIR/$arch
45 | cp $BUILD_DIR/ssl/libssl.a $DIST_DIR/$arch
46 | }
47 |
48 | cd $ROOT_DIR
49 | for arch in $ABIS
50 | do
51 | build_shared $arch
52 | build_static $arch
53 | done
54 |
55 | cd ../../..
56 |
--------------------------------------------------------------------------------
/04_build_protoc.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | cd src/external/protobuf
4 | ./autogen.sh
5 | ./configure --with-protoc=protoc
6 | make
7 | cd ../../..
8 | ./src/external/protobuf/src/protoc src/system/extras/partition_tools/dynamic_partitions_device_info.proto --cpp_out=.
9 |
--------------------------------------------------------------------------------
/05_build_partition_tools.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | export PATH=$PATH:$(pwd)/android-ndk-r24
4 | ndk-build NDK_PROJECT_PATH=. NDK_APP_LIBS_OUT=dist/partition_tools NDK_APPLICATION_MK=Application_partition_tools.mk $@
5 |
--------------------------------------------------------------------------------
/Android_partition_tools.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | ##############################################################################
4 | # libz
5 | ##############################################################################
6 | include $(CLEAR_VARS)
7 |
8 | LOCAL_MODULE := libz
9 |
10 | LOCAL_C_INCLUDES := \
11 | src/external/zlib
12 |
13 | LOCAL_CFLAGS := \
14 | -DHAVE_HIDDEN \
15 | -DZLIB_CONST \
16 | -O3 \
17 | -Wall \
18 | -Werror \
19 | -Wno-unused \
20 | -Wno-unused-parameter \
21 | -DARMV8_OS_LINUX \
22 | -DADLER32_SIMD_NEON
23 |
24 | LOCAL_SRC_FILES += \
25 | src/external/zlib/adler32.c \
26 | src/external/zlib/compress.c \
27 | src/external/zlib/cpu_features.c \
28 | src/external/zlib/crc32.c \
29 | src/external/zlib/deflate.c \
30 | src/external/zlib/gzclose.c \
31 | src/external/zlib/gzlib.c \
32 | src/external/zlib/gzread.c \
33 | src/external/zlib/gzwrite.c \
34 | src/external/zlib/infback.c \
35 | src/external/zlib/inffast.c \
36 | src/external/zlib/inflate.c \
37 | src/external/zlib/inftrees.c \
38 | src/external/zlib/trees.c \
39 | src/external/zlib/uncompr.c \
40 | src/external/zlib/zutil.c \
41 | \
42 | src/external/zlib/adler32_simd.c \
43 | src/external/zlib/crc32_simd.c
44 |
45 | include $(BUILD_STATIC_LIBRARY)
46 |
47 | ##############################################################################
48 | # libfmtlib
49 | ##############################################################################
50 | include $(CLEAR_VARS)
51 |
52 | LOCAL_MODULE := libfmtlib
53 |
54 | LOCAL_C_INCLUDES := \
55 | src/external/fmtlib/include
56 |
57 | LOCAL_CFLAGS := \
58 | -fno-exceptions \
59 | -UNDEBUG
60 |
61 | LOCAL_SRC_FILES += \
62 | src/external/fmtlib/src/format.cc
63 |
64 | LOCAL_EXPORT_C_INCLUDE_DIRS := \
65 | src/external/fmtlib/include
66 |
67 | include $(BUILD_STATIC_LIBRARY)
68 |
69 | ##############################################################################
70 | # liblog
71 | ##############################################################################
72 | include $(CLEAR_VARS)
73 |
74 | LOCAL_MODULE := liblog
75 |
76 | LOCAL_C_INCLUDES := \
77 | src/system/logging/liblog \
78 | src/system/logging/liblog/include \
79 | src/system/core/libcutils/include \
80 | src/system/libbase/include \
81 | src/system/core/include
82 |
83 | LOCAL_CFLAGS := \
84 | -Wall \
85 | -Werror \
86 | -Wextra \
87 | -Wexit-time-destructors \
88 | -DSNET_EVENT_LOG_TAG=1397638484 \
89 | -DLIBLOG_LOG_TAG=1006 \
90 | -Wno-c99-designator \
91 | -U__ANDROID__
92 |
93 | LOCAL_CXXFLAGS := \
94 | -std=c++17
95 |
96 | LOCAL_SRC_FILES += \
97 | src/system/logging/liblog/log_event_list.cpp \
98 | src/system/logging/liblog/log_event_write.cpp \
99 | src/system/logging/liblog/logger_name.cpp \
100 | src/system/logging/liblog/logger_read.cpp \
101 | src/system/logging/liblog/logger_write.cpp \
102 | src/system/logging/liblog/logprint.cpp \
103 | src/system/logging/liblog/properties.cpp
104 |
105 | include $(BUILD_STATIC_LIBRARY)
106 |
107 | ##############################################################################
108 | # libbase
109 | ##############################################################################
110 | include $(CLEAR_VARS)
111 |
112 | LOCAL_MODULE := libbase
113 |
114 | LOCAL_C_INCLUDES := \
115 | src/system/libbase/include
116 |
117 | LOCAL_CFLAGS := \
118 | -Wall \
119 | -Wextra \
120 | -Werror \
121 | -D_FILE_OFFSET_BITS=64 \
122 | -Wno-c99-designator
123 |
124 | LOCAL_CPPFLAGS := \
125 | -Wexit-time-destructors
126 |
127 | LOCAL_CXXFLAGS := \
128 | -std=c++17
129 |
130 | LOCAL_SRC_FILES += \
131 | src/system/libbase/abi_compatibility.cpp \
132 | src/system/libbase/chrono_utils.cpp \
133 | src/system/libbase/cmsg.cpp \
134 | src/system/libbase/file.cpp \
135 | src/system/libbase/hex.cpp \
136 | src/system/libbase/logging.cpp \
137 | src/system/libbase/mapped_file.cpp \
138 | src/system/libbase/parsebool.cpp \
139 | src/system/libbase/parsenetaddress.cpp \
140 | src/system/libbase/posix_strerror_r.cpp \
141 | src/system/libbase/process.cpp \
142 | src/system/libbase/properties.cpp \
143 | src/system/libbase/stringprintf.cpp \
144 | src/system/libbase/strings.cpp \
145 | src/system/libbase/threads.cpp \
146 | src/system/libbase/test_utils.cpp
147 |
148 | LOCAL_SHARED_LIBRARIES := log
149 |
150 | LOCAL_EXPORT_C_INCLUDE_DIRS := \
151 | src/system/libbase/include
152 |
153 | LOCAL_EXPORT_HEADER_LIBRARY_HEADERS := fmtlib
154 |
155 | LOCAL_WHOLE_STATIC_LIBRARIES := fmtlib
156 |
157 | include $(BUILD_STATIC_LIBRARY)
158 |
159 | ##############################################################################
160 | # liblp
161 | ##############################################################################
162 | include $(CLEAR_VARS)
163 |
164 | LOCAL_MODULE := liblp
165 |
166 | LOCAL_C_INCLUDES := \
167 | src/system/core/fs_mgr/include \
168 | src/system/core/fs_mgr/liblp \
169 | src/system/core/fs_mgr/liblp/include \
170 | src/system/libbase/include \
171 | src/system/core/libsparse/include \
172 | src/system/extras/ext4_utils/include \
173 | src/boringssl/include \
174 | src/system/core/libcutils/include
175 |
176 | LOCAL_CFLAGS := \
177 | -Wall \
178 | -Werror
179 |
180 | LOCAL_CPPFLAGS := \
181 | -D_FILE_OFFSET_BITS=64
182 |
183 | LOCAL_CXXFLAGS := \
184 | -std=c++17
185 |
186 | LOCAL_SRC_FILES := \
187 | src/system/core/fs_mgr/liblp/builder.cpp \
188 | src/system/core/fs_mgr/liblp/images.cpp \
189 | src/system/core/fs_mgr/liblp/partition_opener.cpp \
190 | src/system/core/fs_mgr/liblp/property_fetcher.cpp \
191 | src/system/core/fs_mgr/liblp/reader.cpp \
192 | src/system/core/fs_mgr/liblp/utility.cpp \
193 | src/system/core/fs_mgr/liblp/writer.cpp
194 |
195 | LOCAL_STATIC_LIBRARIES := crypto base log crypto_utils sparse ext4_utils cutils
196 |
197 | LOCAL_EXPORT_C_INCLUDE_DIRS := \
198 | src/system/core/fs_mgr/liblp/include
199 |
200 | include $(BUILD_STATIC_LIBRARY)
201 |
202 | ##############################################################################
203 | # libcrypto
204 | ##############################################################################
205 | include $(CLEAR_VARS)
206 |
207 | LOCAL_MODULE := libcrypto
208 |
209 | LOCAL_C_INCLUDES := src/boringssl/include
210 |
211 | LOCAL_SRC_FILES := src/boringssl/dist/$(TARGET_ARCH_ABI)/libcrypto.a
212 |
213 | include $(PREBUILT_STATIC_LIBRARY)
214 |
215 | ##############################################################################
216 | # libcrypto_utils
217 | ##############################################################################
218 | include $(CLEAR_VARS)
219 |
220 | LOCAL_MODULE := libcrypto_utils
221 |
222 | LOCAL_C_INCLUDES := \
223 | src/system/core/libcrypto_utils/include \
224 | src/boringssl/include
225 |
226 | LOCAL_CFLAGS := \
227 | -Wall \
228 | -Wextra \
229 | -Werror
230 |
231 | LOCAL_SRC_FILES := \
232 | src/system/core/libcrypto_utils/android_pubkey.cpp
233 |
234 | LOCAL_STATIC_LIBRARIES := crypto
235 |
236 | LOCAL_EXPORT_C_INCLUDE_DIRS := \
237 | src/system/core/libcrypto_utils/include
238 |
239 | include $(BUILD_STATIC_LIBRARY)
240 |
241 | ##############################################################################
242 | # libsparse
243 | ##############################################################################
244 | include $(CLEAR_VARS)
245 |
246 | LOCAL_MODULE := libsparse
247 |
248 | LOCAL_C_INCLUDES := \
249 | src/system/core/libsparse/include \
250 | src/system/libbase/include
251 |
252 | LOCAL_CFLAGS := \
253 | -Werror
254 |
255 | LOCAL_SRC_FILES += \
256 | src/system/core/libsparse/backed_block.cpp \
257 | src/system/core/libsparse/output_file.cpp \
258 | src/system/core/libsparse/sparse.cpp \
259 | src/system/core/libsparse/sparse_crc32.cpp \
260 | src/system/core/libsparse/sparse_err.cpp \
261 | src/system/core/libsparse/sparse_read.cpp
262 |
263 | LOCAL_STATIC_LIBRARIES := z base
264 |
265 | LOCAL_EXPORT_C_INCLUDE_DIRS := \
266 | src/system/core/libsparse/include
267 |
268 | include $(BUILD_STATIC_LIBRARY)
269 |
270 | ##############################################################################
271 | #libext4_utils
272 | ##############################################################################
273 | include $(CLEAR_VARS)
274 |
275 | LOCAL_MODULE := libext4_utils
276 |
277 | LOCAL_C_INCLUDES := \
278 | src/system/extras/ext4_utils/include \
279 | src/system/libbase/include
280 |
281 | LOCAL_CFLAGS := \
282 | -fno-strict-aliasing\
283 | -Werror \
284 | -DREAL_UUID
285 |
286 | LOCAL_SRC_FILES += \
287 | src/system/extras/ext4_utils/ext4_utils.cpp \
288 | src/system/extras/ext4_utils/wipe.cpp \
289 | src/system/extras/ext4_utils/ext4_sb.cpp
290 |
291 | LOCAL_STATIC_LIBRARIES := z base cutils libext2_uuid
292 |
293 | include $(BUILD_STATIC_LIBRARY)
294 |
295 | #############################################################################
296 | # libext2_uuid
297 | #############################################################################
298 | include $(CLEAR_VARS)
299 |
300 | LOCAL_MODULE := libext2_uuid
301 |
302 | LOCAL_C_INCLUDES := \
303 | src/external/e2fsprogs/lib \
304 | src/external/e2fsprogs/lib/uuid
305 |
306 | LOCAL_CFLAGS := \
307 | -Wall \
308 | -Werror \
309 | -Wno-pointer-arith \
310 | -Wno-unused-function \
311 | -Wno-unused-parameter
312 |
313 | LOCAL_SRC_FILES := \
314 | src/external/e2fsprogs/lib/uuid/clear.c \
315 | src/external/e2fsprogs/lib/uuid/compare.c \
316 | src/external/e2fsprogs/lib/uuid/copy.c \
317 | src/external/e2fsprogs/lib/uuid/gen_uuid.c \
318 | src/external/e2fsprogs/lib/uuid/isnull.c \
319 | src/external/e2fsprogs/lib/uuid/pack.c \
320 | src/external/e2fsprogs/lib/uuid/parse.c \
321 | src/external/e2fsprogs/lib/uuid/unpack.c \
322 | src/external/e2fsprogs/lib/uuid/unparse.c \
323 | src/external/e2fsprogs/lib/uuid/uuid_time.c
324 |
325 | LOCAL_EXPORT_C_INCLUDE_DIRS := \
326 | src/external/e2fsprogs/lib \
327 | src/external/e2fsprogs/lib/uuid
328 |
329 | include $(BUILD_STATIC_LIBRARY)
330 |
331 | ##############################################################################
332 | # libcutils
333 | ##############################################################################
334 | include $(CLEAR_VARS)
335 |
336 | LOCAL_MODULE := libcutils
337 |
338 | LOCAL_C_INCLUDES := \
339 | src/system/core/libcutils/include \
340 | src/system/libbase/include \
341 | src/system/core/libprocessgroup/include \
342 | src/system/logging/liblog/include
343 |
344 | LOCAL_CFLAGS := \
345 | -Wno-exit-time-destructors \
346 | -Werror \
347 | -Wall \
348 | -Wextra \
349 | -D_GNU_SOURCE
350 |
351 | LOCAL_SRC_FILES += \
352 | src/system/core/libcutils/config_utils.cpp \
353 | src/system/core/libcutils/iosched_policy.cpp \
354 | src/system/core/libcutils/load_file.cpp \
355 | src/system/core/libcutils/native_handle.cpp \
356 | src/system/core/libcutils/properties.cpp \
357 | src/system/core/libcutils/record_stream.cpp \
358 | src/system/core/libcutils/strlcpy.c \
359 | src/system/core/libcutils/threads.cpp \
360 | \
361 | src/system/core/libcutils/android_reboot.cpp \
362 | src/system/core/libcutils/ashmem-dev.cpp \
363 | src/system/core/libcutils/canned_fs_config.cpp \
364 | src/system/core/libcutils/fs_config.cpp \
365 | src/system/core/libcutils/klog.cpp \
366 | src/system/core/libcutils/partition_utils.cpp \
367 | src/system/core/libcutils/qtaguid.cpp \
368 | src/system/core/libcutils/trace-dev.cpp \
369 | src/system/core/libcutils/uevent.cpp \
370 | \
371 | src/system/core/libcutils/sockets.cpp \
372 | src/system/core/libcutils/android_get_control_file.cpp \
373 | src/system/core/libcutils/socket_inaddr_any_server_unix.cpp \
374 | src/system/core/libcutils/socket_local_client_unix.cpp \
375 | src/system/core/libcutils/socket_local_server_unix.cpp \
376 | src/system/core/libcutils/socket_network_client_unix.cpp \
377 | src/system/core/libcutils/sockets_unix.cpp
378 |
379 | LOCAL_STATIC_LIBRARIES := log base
380 |
381 | LOCAL_EXPORT_C_INCLUDE_DIRS := \
382 | src/system/core/libcutils/include
383 |
384 | include $(BUILD_STATIC_LIBRARY)
385 |
386 | ##############################################################################
387 | # libpcre
388 | ##############################################################################
389 | include $(CLEAR_VARS)
390 |
391 | LOCAL_MODULE := libpcre
392 |
393 | LOCAL_C_INCLUDES := \
394 | src/external/pcre/include
395 |
396 | LOCAL_CFLAGS := \
397 | -DHAVE_CONFIG_H \
398 | -Wall \
399 | -Werror \
400 | -DPCRE2_CODE_UNIT_WIDTH=8
401 |
402 | LOCAL_SRC_FILES := \
403 | src/external/pcre/src/pcre2_auto_possess.c \
404 | src/external/pcre/src/pcre2_compile.c \
405 | src/external/pcre/src/pcre2_config.c \
406 | src/external/pcre/src/pcre2_context.c \
407 | src/external/pcre/src/pcre2_convert.c \
408 | src/external/pcre/src/pcre2_dfa_match.c \
409 | src/external/pcre/src/pcre2_error.c \
410 | src/external/pcre/src/pcre2_extuni.c \
411 | src/external/pcre/src/pcre2_find_bracket.c \
412 | src/external/pcre/src/pcre2_maketables.c \
413 | src/external/pcre/src/pcre2_match.c \
414 | src/external/pcre/src/pcre2_match_data.c \
415 | src/external/pcre/src/pcre2_jit_compile.c \
416 | src/external/pcre/src/pcre2_newline.c \
417 | src/external/pcre/src/pcre2_ord2utf.c \
418 | src/external/pcre/src/pcre2_pattern_info.c \
419 | src/external/pcre/src/pcre2_script_run.c \
420 | src/external/pcre/src/pcre2_serialize.c \
421 | src/external/pcre/src/pcre2_string_utils.c \
422 | src/external/pcre/src/pcre2_study.c \
423 | src/external/pcre/src/pcre2_substitute.c \
424 | src/external/pcre/src/pcre2_substring.c \
425 | src/external/pcre/src/pcre2_tables.c \
426 | src/external/pcre/src/pcre2_ucd.c \
427 | src/external/pcre/src/pcre2_valid_utf.c \
428 | src/external/pcre/src/pcre2_xclass.c \
429 | src/external/pcre/src/pcre2_chartables.c
430 |
431 | LOCAL_EXPORT_C_INCLUDE_DIRS := \
432 | src/external/pcre/include
433 |
434 | include $(BUILD_STATIC_LIBRARY)
435 |
436 | ##############################################################################
437 | # libpackagelistparser
438 | ##############################################################################
439 | include $(CLEAR_VARS)
440 |
441 | LOCAL_MODULE := libpackagelistparser
442 |
443 | LOCAL_C_INCLUDES := \
444 | src/system/core/libpackagelistparser/include \
445 | src/system/logging/liblog/include
446 |
447 | LOCAL_SRC_FILES := \
448 | src/system/core/libpackagelistparser/packagelistparser.cpp
449 |
450 | LOCAL_STATIC_LIBRARIES := log
451 |
452 | LOCAL_EXPORT_C_INCLUDE_DIRS := \
453 | src/system/core/libpackagelistparser/include
454 |
455 | include $(BUILD_STATIC_LIBRARY)
456 |
457 | ##############################################################################
458 | # libselinux
459 | ##############################################################################
460 | include $(CLEAR_VARS)
461 |
462 | LOCAL_MODULE := libselinux
463 |
464 | LOCAL_C_INCLUDES := \
465 | src/external/selinux/libselinux/include \
466 | src/external/selinux/libselinux/src \
467 | src/system/core/libcutils/include \
468 | src/system/logging/liblog/include \
469 | src/system/core/libpackagelistparser/include \
470 | src/external/pcre/include
471 |
472 | LOCAL_CFLAGS := \
473 | -DNO_PERSISTENTLY_STORED_PATTERNS \
474 | -DDISABLE_SETRANS \
475 | -DDISABLE_BOOL \
476 | -D_GNU_SOURCE \
477 | -DNO_MEDIA_BACKEND \
478 | -DNO_X_BACKEND \
479 | -DNO_DB_BACKEND \
480 | -Wall \
481 | -Werror \
482 | -Wno-error=missing-noreturn \
483 | -Wno-error=unused-function \
484 | -Wno-error=unused-variable \
485 | -DBUILD_HOST \
486 | -DUSE_PCRE2 \
487 | -DAUDITD_LOG_TAG=1003 \
488 | -Wno-unused-but-set-variable
489 |
490 | LOCAL_SRC_FILES := \
491 | src/external/selinux/libselinux/src/booleans.c \
492 | src/external/selinux/libselinux/src/callbacks.c \
493 | src/external/selinux/libselinux/src/freecon.c \
494 | src/external/selinux/libselinux/src/label_backends_android.c \
495 | src/external/selinux/libselinux/src/label.c \
496 | src/external/selinux/libselinux/src/label_support.c \
497 | src/external/selinux/libselinux/src/matchpathcon.c \
498 | src/external/selinux/libselinux/src/setrans_client.c \
499 | src/external/selinux/libselinux/src/sha1.c \
500 | src/external/selinux/libselinux/src/android/android.c \
501 | src/external/selinux/libselinux/src/canonicalize_context.c \
502 | src/external/selinux/libselinux/src/checkAccess.c \
503 | src/external/selinux/libselinux/src/check_context.c \
504 | src/external/selinux/libselinux/src/disable.c \
505 | src/external/selinux/libselinux/src/fgetfilecon.c \
506 | src/external/selinux/libselinux/src/fsetfilecon.c \
507 | src/external/selinux/libselinux/src/getpeercon.c \
508 | src/external/selinux/libselinux/src/lgetfilecon.c \
509 | src/external/selinux/libselinux/src/lsetfilecon.c \
510 | src/external/selinux/libselinux/src/policyvers.c \
511 | src/external/selinux/libselinux/src/setenforce.c \
512 | src/external/selinux/libselinux/src/setfilecon.c \
513 | src/external/selinux/libselinux/src/android/android_host.c \
514 | src/external/selinux/libselinux/src/avc.c \
515 | src/external/selinux/libselinux/src/avc_internal.c \
516 | src/external/selinux/libselinux/src/avc_sidtab.c \
517 | src/external/selinux/libselinux/src/compute_av.c \
518 | src/external/selinux/libselinux/src/compute_create.c \
519 | src/external/selinux/libselinux/src/compute_member.c \
520 | src/external/selinux/libselinux/src/context.c \
521 | src/external/selinux/libselinux/src/deny_unknown.c \
522 | src/external/selinux/libselinux/src/enabled.c \
523 | src/external/selinux/libselinux/src/getenforce.c \
524 | src/external/selinux/libselinux/src/getfilecon.c \
525 | src/external/selinux/libselinux/src/get_initial_context.c \
526 | src/external/selinux/libselinux/src/init.c \
527 | src/external/selinux/libselinux/src/load_policy.c \
528 | src/external/selinux/libselinux/src/mapping.c \
529 | src/external/selinux/libselinux/src/procattr.c \
530 | src/external/selinux/libselinux/src/reject_unknown.c \
531 | src/external/selinux/libselinux/src/sestatus.c \
532 | src/external/selinux/libselinux/src/setexecfilecon.c \
533 | src/external/selinux/libselinux/src/stringrep.c \
534 | src/external/selinux/libselinux/src/android/android_platform.c \
535 | src/external/selinux/libselinux/src/label_file.c \
536 | src/external/selinux/libselinux/src/regex.c
537 |
538 | LOCAL_STATIC_LIBRARIES := pcre log packagelistparser
539 |
540 | LOCAL_EXPORT_C_INCLUDE_DIRS := \
541 | src/external/selinux/libselinux/include
542 |
543 | LOCAL_WHOLE_STATIC_LIBRARIES := packagelistparser
544 |
545 | include $(BUILD_STATIC_LIBRARY)
546 |
547 | ##############################################################################
548 | # libfstab
549 | ##############################################################################
550 | include $(CLEAR_VARS)
551 |
552 | LOCAL_MODULE := libfstab
553 |
554 | LOCAL_C_INCLUDES := \
555 | src/system/core/fs_mgr/include \
556 | src/system/core/fs_mgr/include_fstab \
557 | src/system/libbase/include \
558 | src/system/gsid/include
559 |
560 | LOCAL_CFLAGS := \
561 | -Wall \
562 | -Werror \
563 | -DNO_SKIP_MOUNT
564 |
565 | LOCAL_CXXFLAGS := \
566 | -std=c++17
567 |
568 | LOCAL_SRC_FILES := \
569 | src/system/core/fs_mgr/fs_mgr_fstab.cpp \
570 | src/system/core/fs_mgr/fs_mgr_boot_config.cpp \
571 | src/system/core/fs_mgr/fs_mgr_slotselect.cpp
572 |
573 | LOCAL_EXPORT_C_INCLUDE_DIRS := \
574 | src/system/core/fs_mgr/include_fstab
575 |
576 | include $(BUILD_STATIC_LIBRARY)
577 |
578 | ##############################################################################
579 | # libprotobuf-cpp-full
580 | ##############################################################################
581 | include $(CLEAR_VARS)
582 |
583 | LOCAL_MODULE := libprotobuf-cpp-full
584 |
585 | LOCAL_C_INCLUDES := \
586 | src/external/protobuf/android \
587 | src/external/protobuf/src
588 |
589 | LOCAL_CFLAGS := \
590 | -DHAVE_ZLIB=1 \
591 | -Wall \
592 | -Werror \
593 | -Wno-unused-function \
594 | -Wno-sign-compare \
595 | -Wno-unused-parameter \
596 | -Wno-sign-promo \
597 | -Wno-inconsistent-missing-override
598 |
599 | LOCAL_CXXFLAGS := \
600 | -std=c++17 \
601 | -Wno-unused-const-variable \
602 | -Wno-error=user-defined-warnings
603 |
604 | LOCAL_SRC_FILES := \
605 | src/external/protobuf/src/google/protobuf/any_lite.cc \
606 | src/external/protobuf/src/google/protobuf/arena.cc \
607 | src/external/protobuf/src/google/protobuf/extension_set.cc \
608 | src/external/protobuf/src/google/protobuf/generated_enum_util.cc \
609 | src/external/protobuf/src/google/protobuf/generated_message_table_driven_lite.cc \
610 | src/external/protobuf/src/google/protobuf/generated_message_util.cc \
611 | src/external/protobuf/src/google/protobuf/implicit_weak_message.cc \
612 | src/external/protobuf/src/google/protobuf/io/coded_stream.cc \
613 | src/external/protobuf/src/google/protobuf/io/io_win32.cc \
614 | src/external/protobuf/src/google/protobuf/io/strtod.cc \
615 | src/external/protobuf/src/google/protobuf/io/zero_copy_stream.cc \
616 | src/external/protobuf/src/google/protobuf/io/zero_copy_stream_impl.cc \
617 | src/external/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.cc \
618 | src/external/protobuf/src/google/protobuf/message_lite.cc \
619 | src/external/protobuf/src/google/protobuf/parse_context.cc \
620 | src/external/protobuf/src/google/protobuf/repeated_field.cc \
621 | src/external/protobuf/src/google/protobuf/stubs/bytestream.cc \
622 | src/external/protobuf/src/google/protobuf/stubs/common.cc \
623 | src/external/protobuf/src/google/protobuf/stubs/int128.cc \
624 | src/external/protobuf/src/google/protobuf/stubs/status.cc \
625 | src/external/protobuf/src/google/protobuf/stubs/statusor.cc \
626 | src/external/protobuf/src/google/protobuf/stubs/stringpiece.cc \
627 | src/external/protobuf/src/google/protobuf/stubs/stringprintf.cc \
628 | src/external/protobuf/src/google/protobuf/stubs/structurally_valid.cc \
629 | src/external/protobuf/src/google/protobuf/stubs/strutil.cc \
630 | src/external/protobuf/src/google/protobuf/stubs/time.cc \
631 | src/external/protobuf/src/google/protobuf/wire_format_lite.cc \
632 | \
633 | src/external/protobuf/src/google/protobuf/any.cc \
634 | src/external/protobuf/src/google/protobuf/any.pb.cc \
635 | src/external/protobuf/src/google/protobuf/api.pb.cc \
636 | src/external/protobuf/src/google/protobuf/compiler/importer.cc \
637 | src/external/protobuf/src/google/protobuf/compiler/parser.cc \
638 | src/external/protobuf/src/google/protobuf/descriptor.cc \
639 | src/external/protobuf/src/google/protobuf/descriptor.pb.cc \
640 | src/external/protobuf/src/google/protobuf/descriptor_database.cc \
641 | src/external/protobuf/src/google/protobuf/duration.pb.cc \
642 | src/external/protobuf/src/google/protobuf/dynamic_message.cc \
643 | src/external/protobuf/src/google/protobuf/empty.pb.cc \
644 | src/external/protobuf/src/google/protobuf/extension_set_heavy.cc \
645 | src/external/protobuf/src/google/protobuf/field_mask.pb.cc \
646 | src/external/protobuf/src/google/protobuf/generated_message_reflection.cc \
647 | src/external/protobuf/src/google/protobuf/generated_message_table_driven.cc \
648 | src/external/protobuf/src/google/protobuf/io/gzip_stream.cc \
649 | src/external/protobuf/src/google/protobuf/io/printer.cc \
650 | src/external/protobuf/src/google/protobuf/io/tokenizer.cc \
651 | src/external/protobuf/src/google/protobuf/map_field.cc \
652 | src/external/protobuf/src/google/protobuf/message.cc \
653 | src/external/protobuf/src/google/protobuf/reflection_ops.cc \
654 | src/external/protobuf/src/google/protobuf/service.cc \
655 | src/external/protobuf/src/google/protobuf/source_context.pb.cc \
656 | src/external/protobuf/src/google/protobuf/struct.pb.cc \
657 | src/external/protobuf/src/google/protobuf/stubs/mathlimits.cc \
658 | src/external/protobuf/src/google/protobuf/stubs/substitute.cc \
659 | src/external/protobuf/src/google/protobuf/text_format.cc \
660 | src/external/protobuf/src/google/protobuf/timestamp.pb.cc \
661 | src/external/protobuf/src/google/protobuf/type.pb.cc \
662 | src/external/protobuf/src/google/protobuf/unknown_field_set.cc \
663 | src/external/protobuf/src/google/protobuf/util/delimited_message_util.cc \
664 | src/external/protobuf/src/google/protobuf/util/field_comparator.cc \
665 | src/external/protobuf/src/google/protobuf/util/field_mask_util.cc \
666 | src/external/protobuf/src/google/protobuf/util/internal/datapiece.cc \
667 | src/external/protobuf/src/google/protobuf/util/internal/default_value_objectwriter.cc \
668 | src/external/protobuf/src/google/protobuf/util/internal/error_listener.cc \
669 | src/external/protobuf/src/google/protobuf/util/internal/field_mask_utility.cc \
670 | src/external/protobuf/src/google/protobuf/util/internal/json_escaping.cc \
671 | src/external/protobuf/src/google/protobuf/util/internal/json_objectwriter.cc \
672 | src/external/protobuf/src/google/protobuf/util/internal/json_stream_parser.cc \
673 | src/external/protobuf/src/google/protobuf/util/internal/object_writer.cc \
674 | src/external/protobuf/src/google/protobuf/util/internal/proto_writer.cc \
675 | src/external/protobuf/src/google/protobuf/util/internal/protostream_objectsource.cc \
676 | src/external/protobuf/src/google/protobuf/util/internal/protostream_objectwriter.cc \
677 | src/external/protobuf/src/google/protobuf/util/internal/type_info.cc \
678 | src/external/protobuf/src/google/protobuf/util/internal/type_info_test_helper.cc \
679 | src/external/protobuf/src/google/protobuf/util/internal/utility.cc \
680 | src/external/protobuf/src/google/protobuf/util/json_util.cc \
681 | src/external/protobuf/src/google/protobuf/util/message_differencer.cc \
682 | src/external/protobuf/src/google/protobuf/util/time_util.cc \
683 | src/external/protobuf/src/google/protobuf/util/type_resolver_util.cc \
684 | src/external/protobuf/src/google/protobuf/wire_format.cc \
685 | src/external/protobuf/src/google/protobuf/wrappers.pb.cc
686 |
687 | LOCAL_STATIC_LIBRARIES := z log
688 |
689 | include $(BUILD_STATIC_LIBRARY)
690 |
691 | ##############################################################################
692 | # libsquashfs_utils
693 | ##############################################################################
694 | include $(CLEAR_VARS)
695 |
696 | LOCAL_MODULE := libsquashfs_utils
697 |
698 | LOCAL_C_INCLUDES := \
699 | src/system/extras/squashfs_utils \
700 | src/system/core/libcutils/include \
701 | src/external/squashfs-tools/squashfs-tools
702 |
703 | LOCAL_CFLAGS := \
704 | -Wall \
705 | -Werror \
706 | -D_GNU_SOURCE \
707 | -DSQUASHFS_NO_KLOG
708 |
709 | LOCAL_SRC_FILES := \
710 | src/system/extras/squashfs_utils/squashfs_utils.c
711 |
712 | LOCAL_STATIC_LIBRARIES := cutils
713 |
714 | include $(BUILD_STATIC_LIBRARY)
715 |
716 | ##############################################################################
717 | # libfec
718 | ##############################################################################
719 | include $(CLEAR_VARS)
720 |
721 | LOCAL_MODULE := libfec
722 |
723 | LOCAL_C_INCLUDES := \
724 | src/system/extras/libfec/include \
725 | src/system/extras/ext4_utils/include \
726 | src/system/extras/squashfs_utils \
727 | src/system/libbase/include \
728 | src/system/core/libcrypto_utils/include \
729 | src/boringssl/include \
730 | src/system/core/libutils/include \
731 | src/external/fec
732 |
733 | LOCAL_CFLAGS := \
734 | -Wall \
735 | -Werror \
736 | -O3 \
737 | -D_LARGEFILE64_SOURCE \
738 | -D_GNU_SOURCE \
739 | -DFEC_NO_KLOG
740 |
741 | LOCAL_SRC_FILES := \
742 | src/system/extras/libfec/fec_open.cpp \
743 | src/system/extras/libfec/fec_read.cpp \
744 | src/system/extras/libfec/fec_verity.cpp \
745 | src/system/extras/libfec/fec_process.cpp
746 |
747 | LOCAL_EXPORT_C_INCLUDE_DIRS := \
748 | src/system/extras/libfec/include
749 |
750 | LOCAL_STATIC_LIBRARIES := base crypto crypto_utils cutils ext4_utils squashfs_utils
751 |
752 | include $(BUILD_STATIC_LIBRARY)
753 |
754 | ##############################################################################
755 | # libjsonpbparse
756 | ##############################################################################
757 | include $(CLEAR_VARS)
758 |
759 | LOCAL_MODULE := libjsonpbparse
760 |
761 | LOCAL_C_INCLUDES := \
762 | src/system/extras/libjsonpb/parse/include \
763 | src/system/libbase/include \
764 | src/external/protobuf/src
765 |
766 | LOCAL_CFLAGS := \
767 | -Wall \
768 | -Werror \
769 | -Wno-unused-parameter
770 |
771 | LOCAL_CXXFLAGS := \
772 | -std=c++17
773 |
774 | LOCAL_SRC_FILES := \
775 | src/system/extras/libjsonpb/parse/jsonpb.cpp
776 |
777 | LOCAL_STATIC_LIBRARIES := base protobuf-cpp-full
778 |
779 | include $(BUILD_STATIC_LIBRARY)
780 |
781 | #############################################################################
782 | # libavb
783 | #############################################################################
784 | include $(CLEAR_VARS)
785 |
786 | LOCAL_MODULE := libavb
787 |
788 | LOCAL_C_INCLUDES := \
789 | src/external/avb/libavb/boringssl \
790 | src/boringssl/include \
791 | src/external/avb
792 |
793 | LOCAL_CFLAGS := \
794 | -D_FILE_OFFSET_BITS=64 \
795 | -D_POSIX_C_SOURCE=199309L \
796 | -Wa,--noexecstack \
797 | -Werror \
798 | -Wall \
799 | -Wextra \
800 | -Wformat=2 \
801 | -Wmissing-prototypes \
802 | -Wno-psabi \
803 | -Wno-unused-parameter \
804 | -Wno-format \
805 | -ffunction-sections \
806 | -fstack-protector-strong \
807 | -g \
808 | -DAVB_ENABLE_DEBUG \
809 | -DAVB_COMPILATION
810 |
811 | LOCAL_CPPFLAGS := \
812 | -Wnon-virtual-dtor \
813 | -fno-strict-aliasing
814 |
815 | LOCAL_SRC_FILES := \
816 | src/external/avb/libavb/avb_chain_partition_descriptor.c \
817 | src/external/avb/libavb/avb_cmdline.c \
818 | src/external/avb/libavb/avb_crc32.c \
819 | src/external/avb/libavb/avb_crypto.c \
820 | src/external/avb/libavb/avb_descriptor.c \
821 | src/external/avb/libavb/avb_footer.c \
822 | src/external/avb/libavb/avb_hash_descriptor.c \
823 | src/external/avb/libavb/avb_hashtree_descriptor.c \
824 | src/external/avb/libavb/avb_kernel_cmdline_descriptor.c \
825 | src/external/avb/libavb/avb_property_descriptor.c \
826 | src/external/avb/libavb/avb_rsa.c \
827 | src/external/avb/libavb/avb_slot_verify.c \
828 | src/external/avb/libavb/avb_util.c \
829 | src/external/avb/libavb/avb_vbmeta_image.c \
830 | src/external/avb/libavb/avb_version.c \
831 | src/external/avb/libavb/boringssl/sha.c
832 |
833 | LOCAL_STATIC_LIBRARIES := crypto
834 |
835 | include $(BUILD_STATIC_LIBRARY)
836 |
837 | #############################################################################
838 | # libfs_avb
839 | #############################################################################
840 | include $(CLEAR_VARS)
841 |
842 | LOCAL_MODULE := libfs_avb
843 |
844 | LOCAL_C_INCLUDES := \
845 | src/system/core/fs_mgr/libfs_avb/include \
846 | src/external/avb \
847 | src/system/core/fs_mgr/include_fstab \
848 | src/system/libbase/include \
849 | src/system/core/fs_mgr/libdm/include \
850 | src/system/core/libutils/include \
851 | src/external/fmtlib/include \
852 | src/system/gsid/include \
853 | src/boringssl/include
854 |
855 | LOCAL_CFLAGS := \
856 | -Wall \
857 | -Werror \
858 | -Wno-inconsistent-missing-override
859 |
860 | LOCAL_CXXFLAGS := \
861 | -std=c++17
862 |
863 | LOCAL_SRC_FILES := \
864 | src/system/core/fs_mgr/libfs_avb/avb_ops.cpp \
865 | src/system/core/fs_mgr/libfs_avb/avb_util.cpp \
866 | src/system/core/fs_mgr/libfs_avb/fs_avb.cpp \
867 | src/system/core/fs_mgr/libfs_avb/fs_avb_util.cpp \
868 | src/system/core/fs_mgr/libfs_avb/types.cpp \
869 | src/system/core/fs_mgr/libfs_avb/util.cpp
870 |
871 | LOCAL_STATIC_LIBRARIES := avb dm gsi fstab base crypto
872 |
873 | include $(BUILD_STATIC_LIBRARY)
874 |
875 | #############################################################################
876 | # libdm
877 | #############################################################################
878 | include $(CLEAR_VARS)
879 |
880 | LOCAL_MODULE := libdm
881 |
882 | LOCAL_C_INCLUDES := \
883 | src/system/core/fs_mgr/libdm/include \
884 | src/system/libbase/include \
885 | src/external/e2fsprogs/lib
886 |
887 | LOCAL_CFLAGS := \
888 | -Wall \
889 | -Werror \
890 | -Wno-inconsistent-missing-override
891 |
892 | LOCAL_CXXFLAGS := \
893 | -std=c++17
894 |
895 | LOCAL_SRC_FILES := \
896 | src/system/core/fs_mgr/libdm/dm_table.cpp \
897 | src/system/core/fs_mgr/libdm/dm_target.cpp \
898 | src/system/core/fs_mgr/libdm/dm.cpp \
899 | src/system/core/fs_mgr/libdm/loop_control.cpp \
900 | src/system/core/fs_mgr/libdm/utility.cpp
901 |
902 | LOCAL_EXPORT_C_INCLUDE_DIRS := \
903 | src/system/core/fs_mgr/libdm/include
904 |
905 | LOCAL_STATIC_LIBRARIES := ext2_uuid
906 |
907 | include $(BUILD_STATIC_LIBRARY)
908 |
909 | #############################################################################
910 | # libgsi
911 | #############################################################################
912 | include $(CLEAR_VARS)
913 |
914 | LOCAL_MODULE := libgsi
915 |
916 | LOCAL_C_INCLUDES := \
917 | src/system/gsid/include \
918 | src/system/libbase/include
919 |
920 | LOCAL_CFLAGS := \
921 | -std=c++17
922 |
923 | LOCAL_SRC_FILES := \
924 | src/system/gsid/libgsi.cpp
925 |
926 | LOCAL_STATIC_LIBRARIES := base
927 |
928 | include $(BUILD_STATIC_LIBRARY)
929 |
930 | #############################################################################
931 | # liblogwrap
932 | #############################################################################
933 | include $(CLEAR_VARS)
934 |
935 | LOCAL_MODULE := liblogwrap
936 |
937 | LOCAL_C_INCLUDES := \
938 | src/system/logging/logwrapper/include \
939 | src/system/logging/liblog/include \
940 | src/system/libbase/include \
941 | src/system/core/libcutils/include
942 |
943 | LOCAL_CFLAGS := \
944 | -Werror
945 |
946 | LOCAL_SRC_FILES := \
947 | src/system/logging/logwrapper/logwrap.cpp
948 |
949 | LOCAL_EXPORT_C_INCLUDE_DIRS := \
950 | src/system/logging/logwrapper/include
951 |
952 | LOCAL_STATIC_LIBRARIES := cutils log
953 |
954 | include $(BUILD_STATIC_LIBRARY)
955 |
956 | #############################################################################
957 | # libkeyutils
958 | #############################################################################
959 | include $(CLEAR_VARS)
960 |
961 | LOCAL_MODULE := libkeyutils
962 |
963 | LOCAL_C_INCLUDES := \
964 | src/system/core/libkeyutils/include
965 |
966 | LOCAL_CFLAGS := \
967 | -Werror
968 |
969 | LOCAL_SRC_FILES := \
970 | src/system/core/libkeyutils/keyutils.cpp
971 |
972 | LOCAL_EXPORT_C_INCLUDE_DIRS := \
973 | src/system/core/libkeyutils/include
974 |
975 | include $(BUILD_STATIC_LIBRARY)
976 |
977 | #############################################################################
978 | # libfscrypt
979 | #############################################################################
980 | include $(CLEAR_VARS)
981 |
982 | LOCAL_MODULE := libfscrypt
983 |
984 | LOCAL_C_INCLUDES := \
985 | src/system/extras/libfscrypt/include \
986 | src/system/libbase/include \
987 | src/system/core/libcutils/include \
988 | src/system/logging/logwrapper/include \
989 | src/system/core/libutils/include
990 |
991 | LOCAL_CXXFLAGS := \
992 | -std=c++17
993 |
994 | LOCAL_SRC_FILES := \
995 | src/system/extras/libfscrypt/fscrypt.cpp
996 |
997 | LOCAL_EXPORT_C_INCLUDE_DIRS := \
998 | src/system/extras/libfscrypt/include
999 |
1000 | LOCAL_STATIC_LIBRARIES := base cutils keyutils logwrap
1001 |
1002 | include $(BUILD_STATIC_LIBRARY)
1003 |
1004 | #############################################################################
1005 | # libfs_mgr
1006 | #############################################################################
1007 | include $(CLEAR_VARS)
1008 |
1009 | LOCAL_MODULE := libfs_mgr
1010 |
1011 | LOCAL_C_INCLUDES := \
1012 | src/system/core/fs_mgr/include \
1013 | src/system/vold \
1014 | src/system/core/fs_mgr/libfiemap/include \
1015 | src/system/libbase/include \
1016 | src/system/core/fs_mgr/libdm/include \
1017 | src/external/fmtlib/include \
1018 | src/system/core/fs_mgr/include_fstab \
1019 | src/system/core/libcutils/include \
1020 | src/system/extras/ext4_utils/include \
1021 | src/system/core/fs_mgr/libfs_avb/include \
1022 | src/external/avb \
1023 | src/system/extras/libfscrypt/include \
1024 | src/system/core/fs_mgr/liblp/include \
1025 | src/system/logging/liblog/include \
1026 | src/system/logging/logwrapper/include \
1027 | src/external/selinux/libselinux/include \
1028 | src/system/core/fs_mgr \
1029 | src/system/gsid/include \
1030 | src/system/core/fs_mgr/libstorage_literals
1031 |
1032 | LOCAL_CFLAGS := \
1033 | -Wall \
1034 | -Werror \
1035 | -D_FILE_OFFSET_BITS=64
1036 |
1037 | LOCAL_CPPFLAGS := \
1038 | -DALLOW_ADBD_DISABLE_VERITY=0
1039 |
1040 | LOCAL_CXXFLAGS := \
1041 | -std=c++17 \
1042 | -Wno-macro-redefined \
1043 | -Wno-inconsistent-missing-override
1044 |
1045 | LOCAL_SRC_FILES := \
1046 | src/system/core/fs_mgr/blockdev.cpp \
1047 | src/system/core/fs_mgr/file_wait.cpp \
1048 | src/system/core/fs_mgr/fs_mgr.cpp \
1049 | src/system/core/fs_mgr/fs_mgr_format.cpp \
1050 | src/system/core/fs_mgr/fs_mgr_dm_linear.cpp \
1051 | src/system/core/fs_mgr/fs_mgr_overlayfs.cpp \
1052 | src/system/core/fs_mgr/fs_mgr_roots.cpp \
1053 | src/system/core/fs_mgr/fs_mgr_vendor_overlay.cpp
1054 |
1055 | LOCAL_EXPORT_C_INCLUDE_DIRS := \
1056 | src/system/core/fs_mgr/include
1057 |
1058 | LOCAL_STATIC_LIBRARIES := base crypto crypto_utils cutils ext4_utils fec log lp selinux avb fs_avb fstab dm gsi logwrap ext2_uuid fscrypt
1059 |
1060 | LOCAL_WHOLE_STATIC_LIBRARIES := logwrap dm ext2_uuid fscrypt fstab
1061 |
1062 | include $(BUILD_STATIC_LIBRARY)
1063 |
1064 | ##############################################################################
1065 | # liblpdump
1066 | ##############################################################################
1067 | include $(CLEAR_VARS)
1068 |
1069 | LOCAL_MODULE := liblpdump
1070 |
1071 | LOCAL_C_INCLUDES := \
1072 | src/system/core/fs_mgr/include_fstab \
1073 | src/external/protobuf/src \
1074 | src/system/libbase/include \
1075 | src/system/core/include \
1076 | src/system/core/fs_mgr/include \
1077 | src/system/extras/libjsonpb/parse/include \
1078 | src/system/core/fs_mgr/liblp/include \
1079 | src/system/extras/partition_tools
1080 |
1081 | LOCAL_CFLAGS := \
1082 | -Werror \
1083 | -Wextra \
1084 | -D_FILE_OFFSET_BITS=64
1085 |
1086 | LOCAL_CXXFLAGS := \
1087 | -std=c++17
1088 |
1089 | LOCAL_SRC_FILES := \
1090 | src/system/extras/partition_tools/lpdump.cc \
1091 | src/system/extras/partition_tools/dynamic_partitions_device_info.pb.cc
1092 |
1093 | LOCAL_STATIC_LIBRARIES := base log lp cutils fs_mgr jsonpbparse protobuf-cpp-full
1094 |
1095 | include $(BUILD_STATIC_LIBRARY)
1096 |
1097 | ##############################################################################
1098 | # lpmake
1099 | ##############################################################################
1100 | include $(CLEAR_VARS)
1101 |
1102 | LOCAL_MODULE := lpmake
1103 |
1104 | LOCAL_C_INCLUDES := \
1105 | src/system/libbase/include \
1106 | src/system/core/fs_mgr/liblp/include \
1107 | src/external/fmtlib/include
1108 |
1109 | LOCAL_CFLAGS := \
1110 | -Werror \
1111 | -Wextra
1112 | -D_FILE_OFFSET_BITS=64
1113 |
1114 | LOCAL_CXXFLAGS := \
1115 | -std=c++17
1116 |
1117 | LOCAL_LDFLAGS := -fPIE -static
1118 |
1119 | LOCAL_SRC_FILES := src/system/extras/partition_tools/lpmake.cc
1120 |
1121 | LOCAL_LDLIBS := -lz
1122 |
1123 | LOCAL_STATIC_LIBRARIES := base log lp
1124 |
1125 | include $(BUILD_EXECUTABLE)
1126 |
1127 | ##############################################################################
1128 | # lpunpack
1129 | ##############################################################################
1130 | include $(CLEAR_VARS)
1131 |
1132 | LOCAL_MODULE := lpunpack
1133 |
1134 | LOCAL_C_INCLUDES := \
1135 | src/system/libbase/include \
1136 | src/system/core/fs_mgr/liblp/include \
1137 | src/system/core/libsparse/include
1138 |
1139 | LOCAL_CFLAGS := \
1140 | -Werror \
1141 | -Wextra \
1142 | -D_FILE_OFFSET_BITS=64
1143 |
1144 | LOCAL_CXXFLAGS := \
1145 | -std=c++17
1146 |
1147 | LOCAL_LDFLAGS := -fPIE -static
1148 |
1149 | LOCAL_SRC_FILES := src/system/extras/partition_tools/lpunpack.cc
1150 |
1151 | LOCAL_STATIC_LIBRARIES := sparse base log lp
1152 |
1153 | include $(BUILD_EXECUTABLE)
1154 |
1155 | ##############################################################################
1156 | # lpflash
1157 | ##############################################################################
1158 | include $(CLEAR_VARS)
1159 |
1160 | LOCAL_MODULE := lpflash
1161 |
1162 | LOCAL_C_INCLUDES := \
1163 | src/system/libbase/include \
1164 | src/system/core/fs_mgr/liblp/include
1165 |
1166 | LOCAL_CFLAGS := \
1167 | -Werror \
1168 | -Wextra \
1169 | -D_FILE_OFFSET_BITS=64
1170 |
1171 | LOCAL_CXXFLAGS := \
1172 | -std=c++17
1173 |
1174 | LOCAL_LDFLAGS := -fPIE -static
1175 |
1176 | LOCAL_SRC_FILES := src/system/extras/partition_tools/lpflash.cc
1177 |
1178 | LOCAL_STATIC_LIBRARIES := base log lp
1179 |
1180 | include $(BUILD_EXECUTABLE)
1181 |
1182 | ##############################################################################
1183 | # lpadd
1184 | ##############################################################################
1185 | include $(CLEAR_VARS)
1186 |
1187 | LOCAL_MODULE := lpadd
1188 |
1189 | LOCAL_C_INCLUDES := \
1190 | src/system/libbase/include \
1191 | src/system/core/fs_mgr/liblp/include \
1192 | src/system/core/libsparse/include
1193 |
1194 | LOCAL_CFLAGS := \
1195 | -Werror \
1196 | -Wextra \
1197 | -D_FILE_OFFSET_BITS=64
1198 |
1199 | LOCAL_CXXFLAGS := \
1200 | -std=c++17
1201 |
1202 | LOCAL_LDFLAGS := -fPIE -static
1203 |
1204 | LOCAL_SRC_FILES := src/system/extras/partition_tools/lpadd.cc
1205 |
1206 | LOCAL_STATIC_LIBRARIES := sparse base log lp
1207 |
1208 | include $(BUILD_EXECUTABLE)
1209 |
1210 | ##############################################################################
1211 | # lpdump
1212 | ##############################################################################
1213 | include $(CLEAR_VARS)
1214 |
1215 | LOCAL_MODULE := lpdump_binary
1216 |
1217 | LOCAL_MODULE_FILENAME := lpdump
1218 |
1219 | LOCAL_C_INCLUDES := \
1220 | src/system/libbase/include \
1221 | src/system/core/fs_mgr/liblp/include
1222 |
1223 | LOCAL_CFLAGS := \
1224 | -Werror \
1225 | -Wextra \
1226 | -D_FILE_OFFSET_BITS=64
1227 |
1228 | LOCAL_CXXFLAGS := \
1229 | -std=c++17
1230 |
1231 | LOCAL_LDFLAGS := -fPIE -static
1232 |
1233 | LOCAL_SRC_FILES := \
1234 | src/system/extras/partition_tools/lpdump_host.cc
1235 |
1236 | LOCAL_STATIC_LIBRARIES := base log lp lpdump jsonpbparse
1237 |
1238 | include $(BUILD_EXECUTABLE)
1239 |
1240 |
--------------------------------------------------------------------------------
/Application_partition_tools.mk:
--------------------------------------------------------------------------------
1 | APP_PLATFORM := latest
2 | APP_ABI := armeabi-v7a arm64-v8a
3 | APP_STL := c++_static
4 | APP_BUILD_SCRIPT := Android_partition_tools.mk
5 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Dynamic_partition_tools_for_android #
2 | Command-line tools for work a “super” partition image on android devices
3 |
4 | ###### How to build : ######
5 | 1. Installing the required packages : `apt install cmake automake autoconf golang-go libtool ninja-build`
6 | 2. Run script for build : `./build.sh`
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | ./01_getndk.sh
4 | ./02_getsource.sh
5 | ./03_build_libcrypto.sh
6 | ./04_build_protoc.sh
7 | ./05_build_partition_tools.sh
8 |
--------------------------------------------------------------------------------