mirror of
https://github.com/topjohnwu/Magisk
synced 2024-11-13 20:54:12 +01:00
Update NDK to r21e
This commit is contained in:
parent
117ae71025
commit
851404205b
41
build.py
41
build.py
@ -405,34 +405,33 @@ def setup_ndk(args):
|
|||||||
rm_rf(ndk_path)
|
rm_rf(ndk_path)
|
||||||
with zipfile.ZipFile(ndk_zip, 'r') as zf:
|
with zipfile.ZipFile(ndk_zip, 'r') as zf:
|
||||||
for info in zf.infolist():
|
for info in zf.infolist():
|
||||||
|
print(f'Extracting {info.filename}')
|
||||||
|
if info.external_attr == 2716663808: # symlink
|
||||||
|
src = zf.read(info).decode("utf-8")
|
||||||
|
dest = op.join(ndk_root, info.filename)
|
||||||
|
os.symlink(src, dest)
|
||||||
|
continue
|
||||||
extracted_path = zf.extract(info, ndk_root)
|
extracted_path = zf.extract(info, ndk_root)
|
||||||
vprint(f'Extracting {info.filename}')
|
|
||||||
if info.create_system == 3: # ZIP_UNIX_SYSTEM = 3
|
if info.create_system == 3: # ZIP_UNIX_SYSTEM = 3
|
||||||
unix_attributes = info.external_attr >> 16
|
unix_attributes = info.external_attr >> 16
|
||||||
if unix_attributes:
|
if unix_attributes:
|
||||||
os.chmod(extracted_path, unix_attributes)
|
os.chmod(extracted_path, unix_attributes)
|
||||||
mv(op.join(ndk_root, f'android-ndk-r{ndk_ver}'), ndk_path)
|
mv(op.join(ndk_root, f'android-ndk-r{ndk_ver}'), ndk_path)
|
||||||
|
|
||||||
header('* Removing unnecessary files')
|
header('* Patching static libs')
|
||||||
for dirname, subdirs, _ in os.walk(op.join(ndk_path, 'platforms')):
|
for api in ['16', '21']:
|
||||||
for plats in subdirs:
|
for target in ['aarch64-linux-android', 'arm-linux-androideabi',
|
||||||
pp = op.join(dirname, plats)
|
'i686-linux-android', 'x86_64-linux-android']:
|
||||||
rm_rf(pp)
|
arch = target.split('-')[0]
|
||||||
mkdir(pp)
|
lib_dir = op.join(
|
||||||
subdirs.clear()
|
ndk_path, 'toolchains', 'llvm', 'prebuilt', f'{os_name}-x86_64',
|
||||||
rm_rf(op.join(ndk_path, 'sysroot'))
|
'sysroot', 'usr', 'lib', f'{target}', api)
|
||||||
|
if not op.exists(lib_dir):
|
||||||
header('* Replacing API-16 static libs')
|
continue
|
||||||
for target in ['arm-linux-androideabi', 'i686-linux-android']:
|
src_dir = op.join('tools', 'ndk-bins', api, arch)
|
||||||
arch = target.split('-')[0]
|
rm(op.join(src_dir, '.DS_Store'))
|
||||||
lib_dir = op.join(
|
for path in copy_tree(src_dir, lib_dir):
|
||||||
ndk_path, 'toolchains', 'llvm', 'prebuilt', f'{os_name}-x86_64',
|
vprint(f'Replaced {path}')
|
||||||
'sysroot', 'usr', 'lib', f'{target}', '16')
|
|
||||||
src_dir = op.join('tools', 'ndk-bins', arch)
|
|
||||||
# Remove stupid macOS crap
|
|
||||||
rm(op.join(src_dir, '.DS_Store'))
|
|
||||||
for path in copy_tree(src_dir, lib_dir):
|
|
||||||
vprint(f'Replaced {path}')
|
|
||||||
|
|
||||||
|
|
||||||
def build_all(args):
|
def build_all(args):
|
||||||
|
@ -29,5 +29,5 @@ kapt.incremental.apt=true
|
|||||||
# Magisk
|
# Magisk
|
||||||
magisk.stubVersion=18
|
magisk.stubVersion=18
|
||||||
magisk.versionCode=22001
|
magisk.versionCode=22001
|
||||||
magisk.ndkVersion=21d
|
magisk.ndkVersion=21e
|
||||||
magisk.fullNdkVersion=21.3.6528147
|
magisk.fullNdkVersion=21.4.7075529
|
||||||
|
5
native/jni/external/Android.mk
vendored
5
native/jni/external/Android.mk
vendored
@ -253,9 +253,10 @@ LOCAL_EXPORT_C_INCLUDES := $(LIBSELINUX)
|
|||||||
LOCAL_STATIC_LIBRARIES := libpcre2
|
LOCAL_STATIC_LIBRARIES := libpcre2
|
||||||
LOCAL_CFLAGS := \
|
LOCAL_CFLAGS := \
|
||||||
-Wno-implicit-function-declaration -Wno-int-conversion -Wno-unused-function \
|
-Wno-implicit-function-declaration -Wno-int-conversion -Wno-unused-function \
|
||||||
-D_GNU_SOURCE -DUSE_PCRE2 \
|
-Wno-macro-redefined -D_GNU_SOURCE -DUSE_PCRE2 \
|
||||||
-DNO_PERSISTENTLY_STORED_PATTERNS -DDISABLE_SETRANS -DDISABLE_BOOL \
|
-DNO_PERSISTENTLY_STORED_PATTERNS -DDISABLE_SETRANS -DDISABLE_BOOL \
|
||||||
-DNO_MEDIA_BACKEND -DNO_X_BACKEND -DNO_DB_BACKEND -DNO_ANDROID_BACKEND
|
-DNO_MEDIA_BACKEND -DNO_X_BACKEND -DNO_DB_BACKEND -DNO_ANDROID_BACKEND \
|
||||||
|
-Dfgets_unlocked=fgets -D'__fsetlocking(...)='
|
||||||
LOCAL_SRC_FILES := \
|
LOCAL_SRC_FILES := \
|
||||||
selinux/libselinux/src/avc.c \
|
selinux/libselinux/src/avc.c \
|
||||||
selinux/libselinux/src/avc_internal.c \
|
selinux/libselinux/src/avc_internal.c \
|
||||||
|
2
native/jni/external/busybox
vendored
2
native/jni/external/busybox
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 6e22deb3006f5ab49d50b1840540a64ae6eb4a34
|
Subproject commit 76822933adc85c853daa6743d93433461f620849
|
BIN
tools/ndk-bins/21/aarch64/crtbegin_dynamic.o
Normal file
BIN
tools/ndk-bins/21/aarch64/crtbegin_dynamic.o
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/aarch64/crtbegin_so.o
Normal file
BIN
tools/ndk-bins/21/aarch64/crtbegin_so.o
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/aarch64/crtbegin_static.o
Normal file
BIN
tools/ndk-bins/21/aarch64/crtbegin_static.o
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/aarch64/crtend_android.o
Normal file
BIN
tools/ndk-bins/21/aarch64/crtend_android.o
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/aarch64/crtend_so.o
Normal file
BIN
tools/ndk-bins/21/aarch64/crtend_so.o
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/aarch64/libc.a
Normal file
BIN
tools/ndk-bins/21/aarch64/libc.a
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/aarch64/libm.a
Normal file
BIN
tools/ndk-bins/21/aarch64/libm.a
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/aarch64/libstdc++.a
Normal file
BIN
tools/ndk-bins/21/aarch64/libstdc++.a
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/aarch64/libz.a
Normal file
BIN
tools/ndk-bins/21/aarch64/libz.a
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/arm/crtbegin_dynamic.o
Normal file
BIN
tools/ndk-bins/21/arm/crtbegin_dynamic.o
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/arm/crtbegin_so.o
Normal file
BIN
tools/ndk-bins/21/arm/crtbegin_so.o
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/arm/crtbegin_static.o
Normal file
BIN
tools/ndk-bins/21/arm/crtbegin_static.o
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/arm/crtend_android.o
Normal file
BIN
tools/ndk-bins/21/arm/crtend_android.o
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/arm/crtend_so.o
Normal file
BIN
tools/ndk-bins/21/arm/crtend_so.o
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/arm/libc.a
Normal file
BIN
tools/ndk-bins/21/arm/libc.a
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/arm/libm.a
Normal file
BIN
tools/ndk-bins/21/arm/libm.a
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/arm/libstdc++.a
Normal file
BIN
tools/ndk-bins/21/arm/libstdc++.a
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/arm/libz.a
Normal file
BIN
tools/ndk-bins/21/arm/libz.a
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/i686/crtbegin_dynamic.o
Normal file
BIN
tools/ndk-bins/21/i686/crtbegin_dynamic.o
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/i686/crtbegin_so.o
Normal file
BIN
tools/ndk-bins/21/i686/crtbegin_so.o
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/i686/crtbegin_static.o
Normal file
BIN
tools/ndk-bins/21/i686/crtbegin_static.o
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/i686/crtend_android.o
Normal file
BIN
tools/ndk-bins/21/i686/crtend_android.o
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/i686/crtend_so.o
Normal file
BIN
tools/ndk-bins/21/i686/crtend_so.o
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/i686/libc.a
Normal file
BIN
tools/ndk-bins/21/i686/libc.a
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/i686/libm.a
Normal file
BIN
tools/ndk-bins/21/i686/libm.a
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/i686/libstdc++.a
Normal file
BIN
tools/ndk-bins/21/i686/libstdc++.a
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/i686/libz.a
Normal file
BIN
tools/ndk-bins/21/i686/libz.a
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/x86_64/crtbegin_dynamic.o
Normal file
BIN
tools/ndk-bins/21/x86_64/crtbegin_dynamic.o
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/x86_64/crtbegin_so.o
Normal file
BIN
tools/ndk-bins/21/x86_64/crtbegin_so.o
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/x86_64/crtbegin_static.o
Normal file
BIN
tools/ndk-bins/21/x86_64/crtbegin_static.o
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/x86_64/crtend_android.o
Normal file
BIN
tools/ndk-bins/21/x86_64/crtend_android.o
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/x86_64/crtend_so.o
Normal file
BIN
tools/ndk-bins/21/x86_64/crtend_so.o
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/x86_64/libc.a
Normal file
BIN
tools/ndk-bins/21/x86_64/libc.a
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/x86_64/libm.a
Normal file
BIN
tools/ndk-bins/21/x86_64/libm.a
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/x86_64/libstdc++.a
Normal file
BIN
tools/ndk-bins/21/x86_64/libstdc++.a
Normal file
Binary file not shown.
BIN
tools/ndk-bins/21/x86_64/libz.a
Normal file
BIN
tools/ndk-bins/21/x86_64/libz.a
Normal file
Binary file not shown.
@ -1,4 +1,8 @@
|
|||||||
## Prebuilt Static Libraries
|
## Prebuilt Static Libraries
|
||||||
|
|
||||||
These binaries are copied straight from Google NDK r10e (`android-ndk-r10e/platforms/android-16`).
|
These binaries are extracted straight from [Google NDK r10e](https://dl.google.com/android/repository/android-ndk-r10e-linux-x86_64.zip).
|
||||||
The reason why Magisk prefer to use these static libs is because they yield significantly smaller binaries.
|
API `16` contains the Bionic libc as old as Android Cupcake (!!). API `21` contains the Bionic libc from Lollipop (minimal API with 64-bit support).
|
||||||
|
|
||||||
|
Over the years, Bionic has slowly become more and more gigantic as devices became more powerful and Google kept adding new features.
|
||||||
|
These are the oldest, which also means smallest, Bionic libc Google had ever offered.
|
||||||
|
We prefer to use these static libs because they yield significantly smaller static executables.
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user