2
0
mirror of https://github.com/topjohnwu/Magisk synced 2025-08-31 06:55:13 +00:00

Copy stub APK into output directory

This commit is contained in:
topjohnwu
2022-12-26 15:23:06 -08:00
committed by John Wu
parent ad0e6511e1
commit 7ce4bd3330
2 changed files with 24 additions and 8 deletions

View File

@@ -425,6 +425,19 @@ def build_app(args):
header('* Building the Magisk app')
build_apk(args, 'app')
# Stub building is directly integrated into the main app
# build process. Copy the stub APK into output directory.
build_type = 'release' if args.release else 'debug'
apk = f'stub-{build_type}.apk'
source = op.join('app', 'src', 'main', 'assets', 'stub.apk')
target = op.join(config['outdir'], apk)
cp(source, target)
def build_stub(args):
header('* Building the stub app')
build_apk(args, 'stub')
def cleanup(args):
support_targets = {'native', 'java'}
@@ -444,6 +457,7 @@ def cleanup(args):
if 'java' in args.target:
header('* Cleaning java')
execv([gradlew, 'app:clean', 'app:shared:clean', 'stub:clean'])
rm_rf(op.join('app', 'src', 'main', 'assets'))
def setup_ndk(args):
@@ -570,6 +584,9 @@ binary_parser.set_defaults(func=build_binary)
app_parser = subparsers.add_parser('app', help='build the Magisk app')
app_parser.set_defaults(func=build_app)
stub_parser = subparsers.add_parser('stub', help='build the stub app')
stub_parser.set_defaults(func=build_stub)
avd_parser = subparsers.add_parser(
'emulator', help='setup AVD for development')
avd_parser.add_argument('-s', '--skip', action='store_true',