22 lines
587 B
Python
Executable File
22 lines
587 B
Python
Executable File
#!/usr/bin/env python3
|
|
"""Adapt AGP's map argument to the pinned native ARM64 AAPT2 syntax."""
|
|
import os
|
|
from pathlib import Path
|
|
import sys
|
|
|
|
|
|
def arguments(args):
|
|
result = []
|
|
for arg in args:
|
|
if arg.startswith("--resource-path-shortening-map="):
|
|
option, value = arg.split("=", 1)
|
|
result.extend((option, value))
|
|
else:
|
|
result.append(arg)
|
|
return result
|
|
|
|
|
|
if __name__ == "__main__":
|
|
binary = Path(os.environ["ANDROID_HOME"]) / "native-arm64/build-tools/aapt2"
|
|
os.execv(binary, [str(binary), *arguments(sys.argv[1:])])
|