Commit 85140420 authored by topjohnwu's avatar topjohnwu

Update NDK to r21e

parent 117ae710
...@@ -405,34 +405,33 @@ def setup_ndk(args): ...@@ -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 ...@@ -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
...@@ -253,9 +253,10 @@ LOCAL_EXPORT_C_INCLUDES := $(LIBSELINUX) ...@@ -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 \
......
Subproject commit 6e22deb3006f5ab49d50b1840540a64ae6eb4a34 Subproject commit 76822933adc85c853daa6743d93433461f620849
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment