From 502d9216971c8e38f49b219abf3db098383c92bd Mon Sep 17 00:00:00 2001 From: noobpk Date: Thu, 17 Mar 2022 11:16:36 +0700 Subject: [PATCH] optimize for androidhook --- CHANGELOG.md | 7 +++++++ frida-android-hook/androidhook | 15 ++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0541997..a3e084a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Frida Android Hook ChangeLog +## [Unrelease] - 2022-03-17 + +### Added + +### Changed +- Update androidhook. Check python3 command exists + ## [Unrelease] - 2022-01-24 ### Added diff --git a/frida-android-hook/androidhook b/frida-android-hook/androidhook index befe948..58a33f7 100755 --- a/frida-android-hook/androidhook +++ b/frida-android-hook/androidhook @@ -7,7 +7,16 @@ versions of setuptools happy import subprocess import shlex import sys +from shutil import which -command = shlex.split("python3 " +"core/hook.py") -command.extend(sys.argv[1:]) -subprocess.call(command) \ No newline at end of file +try: + if(which('python3') is not None): + command = shlex.split("python3 " +"core/hook.py") + else: + command = shlex.split("python " +"core/hook.py") + + command.extend(sys.argv[1:]) + subprocess.call(command) + +except Exception as e: + raise e \ No newline at end of file