mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-04-18 22:51:27 +00:00
Rename module core to native
This commit is contained in:
parent
b6f735a8f6
commit
328fc44194
32
.gitmodules
vendored
32
.gitmodules
vendored
@ -1,27 +1,27 @@
|
|||||||
[submodule "jni/selinux"]
|
[submodule "selinux"]
|
||||||
path = core/jni/external/selinux
|
path = native/jni/external/selinux
|
||||||
url = https://github.com/topjohnwu/selinux.git
|
url = https://github.com/topjohnwu/selinux.git
|
||||||
[submodule "jni/su"]
|
[submodule "su"]
|
||||||
path = core/jni/su
|
path = native/jni/su
|
||||||
url = https://github.com/topjohnwu/MagiskSU.git
|
url = https://github.com/topjohnwu/MagiskSU.git
|
||||||
[submodule "jni/magiskpolicy"]
|
[submodule "magiskpolicy"]
|
||||||
path = core/jni/magiskpolicy
|
path = native/jni/magiskpolicy
|
||||||
url = https://github.com/topjohnwu/magiskpolicy.git
|
url = https://github.com/topjohnwu/magiskpolicy.git
|
||||||
[submodule "MagiskManager"]
|
[submodule "MagiskManager"]
|
||||||
path = app
|
path = app
|
||||||
url = https://github.com/topjohnwu/MagiskManager.git
|
url = https://github.com/topjohnwu/MagiskManager.git
|
||||||
[submodule "jni/busybox"]
|
[submodule "busybox"]
|
||||||
path = core/jni/external/busybox
|
path = native/jni/external/busybox
|
||||||
url = https://github.com/topjohnwu/ndk-busybox.git
|
url = https://github.com/topjohnwu/ndk-busybox.git
|
||||||
[submodule "jni/external/dtc"]
|
[submodule "dtc"]
|
||||||
path = core/jni/external/dtc
|
path = native/jni/external/dtc
|
||||||
url = https://github.com/dgibson/dtc
|
url = https://github.com/dgibson/dtc
|
||||||
[submodule "jni/external/lz4"]
|
[submodule "lz4"]
|
||||||
path = core/jni/external/lz4
|
path = native/jni/external/lz4
|
||||||
url = https://github.com/lz4/lz4.git
|
url = https://github.com/lz4/lz4.git
|
||||||
[submodule "jni/external/bzip2"]
|
[submodule "bzip2"]
|
||||||
path = core/jni/external/bzip2
|
path = native/jni/external/bzip2
|
||||||
url = https://github.com/nemequ/bzip2.git
|
url = https://github.com/nemequ/bzip2.git
|
||||||
[submodule "jni/external/xz"]
|
[submodule "xz"]
|
||||||
path = core/jni/external/xz
|
path = native/jni/external/xz
|
||||||
url = https://github.com/xz-mirror/xz.git
|
url = https://github.com/xz-mirror/xz.git
|
||||||
|
14
build.py
14
build.py
@ -82,13 +82,13 @@ def build_binary(args):
|
|||||||
header('* Building Magisk binaries')
|
header('* Building Magisk binaries')
|
||||||
|
|
||||||
# Force update logging.h timestamp to trigger recompilation
|
# Force update logging.h timestamp to trigger recompilation
|
||||||
os.utime(os.path.join('core', 'jni', 'include', 'logging.h'))
|
os.utime(os.path.join('native', 'jni', 'include', 'logging.h'))
|
||||||
|
|
||||||
debug_flag = '' if args.release else '-DMAGISK_DEBUG'
|
debug_flag = '' if args.release else '-DMAGISK_DEBUG'
|
||||||
cflag = 'MAGISK_FLAGS=\"-DMAGISK_VERSION=\\\"{}\\\" -DMAGISK_VER_CODE={} {}\"'.format(args.versionString, args.versionCode, debug_flag)
|
cflag = 'MAGISK_FLAGS=\"-DMAGISK_VERSION=\\\"{}\\\" -DMAGISK_VER_CODE={} {}\"'.format(args.versionString, args.versionCode, debug_flag)
|
||||||
|
|
||||||
# Prebuild
|
# Prebuild
|
||||||
proc = subprocess.run('{} -C core PRECOMPILE=true {} -j{}'.format(ndk_build, cflag, multiprocessing.cpu_count()), shell=True)
|
proc = subprocess.run('{} -C native PRECOMPILE=true {} -j{}'.format(ndk_build, cflag, multiprocessing.cpu_count()), shell=True)
|
||||||
if proc.returncode != 0:
|
if proc.returncode != 0:
|
||||||
error('Build Magisk binary failed!')
|
error('Build Magisk binary failed!')
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ def build_binary(args):
|
|||||||
mkdir_p(os.path.join('out', arch))
|
mkdir_p(os.path.join('out', arch))
|
||||||
with open(os.path.join('out', arch, 'dump.h'), 'w') as dump:
|
with open(os.path.join('out', arch, 'dump.h'), 'w') as dump:
|
||||||
dump.write('#include "stdlib.h"\n')
|
dump.write('#include "stdlib.h"\n')
|
||||||
mv(os.path.join('core', 'libs', arch, 'magisk'), os.path.join('out', arch, 'magisk'))
|
mv(os.path.join('native', 'libs', arch, 'magisk'), os.path.join('out', arch, 'magisk'))
|
||||||
with open(os.path.join('out', arch, 'magisk'), 'rb') as bin:
|
with open(os.path.join('out', arch, 'magisk'), 'rb') as bin:
|
||||||
dump.write('const uint8_t magisk_dump[] = "')
|
dump.write('const uint8_t magisk_dump[] = "')
|
||||||
dump.write(''.join("\\x{:02X}".format(c) for c in lzma.compress(bin.read(), preset=9)))
|
dump.write(''.join("\\x{:02X}".format(c) for c in lzma.compress(bin.read(), preset=9)))
|
||||||
@ -105,7 +105,7 @@ def build_binary(args):
|
|||||||
|
|
||||||
print('')
|
print('')
|
||||||
|
|
||||||
proc = subprocess.run('{} -C core {} -j{}'.format(ndk_build, cflag, multiprocessing.cpu_count()), shell=True)
|
proc = subprocess.run('{} -C native {} -j{}'.format(ndk_build, cflag, multiprocessing.cpu_count()), shell=True)
|
||||||
if proc.returncode != 0:
|
if proc.returncode != 0:
|
||||||
error('Build Magisk binary failed!')
|
error('Build Magisk binary failed!')
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ def build_binary(args):
|
|||||||
for arch in ['arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64']:
|
for arch in ['arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64']:
|
||||||
for binary in ['magiskinit', 'magiskboot', 'b64xz', 'busybox']:
|
for binary in ['magiskinit', 'magiskboot', 'b64xz', 'busybox']:
|
||||||
try:
|
try:
|
||||||
mv(os.path.join('core', 'libs', arch, binary), os.path.join('out', arch, binary))
|
mv(os.path.join('native', 'libs', arch, binary), os.path.join('out', arch, binary))
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -342,8 +342,8 @@ def cleanup(args):
|
|||||||
|
|
||||||
if 'binary' in args.target:
|
if 'binary' in args.target:
|
||||||
header('* Cleaning binaries')
|
header('* Cleaning binaries')
|
||||||
subprocess.run(ndk_build + ' -C core PRECOMPILE=true clean', shell=True)
|
subprocess.run(ndk_build + ' -C native PRECOMPILE=true clean', shell=True)
|
||||||
subprocess.run(ndk_build + ' -C core clean', shell=True)
|
subprocess.run(ndk_build + ' -C native clean', shell=True)
|
||||||
for arch in ['arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64']:
|
for arch in ['arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64']:
|
||||||
shutil.rmtree(os.path.join('out', arch), ignore_errors=True)
|
shutil.rmtree(os.path.join('out', arch), ignore_errors=True)
|
||||||
|
|
||||||
|
0
core/.gitignore → native/.gitignore
vendored
0
core/.gitignore → native/.gitignore
vendored
@ -1 +1 @@
|
|||||||
include ':app', ':core', ':utils', ':snet'
|
include ':app', ':native', ':utils', ':snet'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user