-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbootstrap.py
More file actions
19 lines (16 loc) · 837 Bytes
/
bootstrap.py
File metadata and controls
19 lines (16 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from urllib.request import urlretrieve
import lzma
from asthook.conf import PACKAGE_PATH, VERSION_FRIDA
import tempfile
def main():
with tempfile.TemporaryDirectory() as tmpdirname:
for _type, _ext in [("server", ""), ("gadget", ".so")]:
for abi in ["x86", "x86_64", "arm", "arm64"]:
print(f"Install frida {_type} for {abi}")
url = f"https://github.com/frida/frida/releases/download/{VERSION_FRIDA}/frida-{_type}-{VERSION_FRIDA}-android-{abi}{_ext}.xz"
urlretrieve(url, f"{tmpdirname}/frida-{_type}{_ext}.xz")
with open(f"{PACKAGE_PATH}/bin/frida-{_type}_{abi}{_ext}", "wb") as fw:
with lzma.open(f"{tmpdirname}/frida-{_type}{_ext}.xz") as fr:
fw.write(fr.read())
if __name__ == "__main__":
main()