2
0
mirror of https://github.com/topjohnwu/Magisk synced 2025-08-31 11:25:11 +00:00

Update snet extension

This commit is contained in:
topjohnwu
2019-08-08 04:18:32 -07:00
parent f2494374f8
commit a797d5d396
11 changed files with 74 additions and 132 deletions

View File

@@ -283,12 +283,11 @@ def build_snet(args):
error('Build snet extention failed!')
source = os.path.join('snet', 'build', 'outputs', 'apk',
'release', 'snet-release-unsigned.apk')
target = os.path.join(config['outdir'], 'snet.apk')
# Re-compress the whole APK for smaller size
target = os.path.join(config['outdir'], 'snet.jar')
# Extract classes.dex
with zipfile.ZipFile(target, 'w', compression=zipfile.ZIP_DEFLATED, allowZip64=False) as zout:
with zipfile.ZipFile(source) as zin:
for item in zin.infolist():
zout.writestr(item.filename, zin.read(item))
zout.writestr('classes.dex', zin.read('classes.dex'))
rm(source)
header('Output: ' + target)