WIP tests

This commit is contained in:
Jean-Marie Mineau 2025-04-17 16:45:21 +02:00
parent 83fd9d387a
commit 7f46d6c12f
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
3 changed files with 21 additions and 3 deletions

View file

@ -106,6 +106,12 @@ def main():
the package. (static x86_64 linux build with musl optimized for binary size instead of speed)",
type=Path,
)
parser.add_argument(
"--runner-script",
required=False,
help="Script to run to test the application. Must be a .py (python) or .sh (bash).",
type=Path,
)
args = parser.parse_args()
if args.zipalign is None:
@ -121,6 +127,12 @@ def main():
else:
keytool = args.keytool
runner_f = None
if args.runner_script is not None and args.runner_script.name.endswith(".py"):
runner_f = lambda: subprocess.run(["python3", str(args.runner_script)])
elif args.runner_script is not None and args.runner_script.name.endswith(".sh"):
runner_f = lambda: subprocess.run(["bash", str(args.runner_script)])
if zipalign is None:
print(
"Could not find zipalign, please install an android build-tools package. "
@ -158,6 +170,7 @@ def main():
file_storage=tmpd / "dex",
output=fp,
android_sdk_path=get_android_sdk_path(),
apk_explorer=runner_f,
)
patch_apk(
runtime_data=tmpd / "runtime.json",

View file

@ -21,6 +21,6 @@ pip install "${FOLDER}/dist/theseus_autopatcher-0.1.0-py3-none-any.whl[grodd]"
adb wait-for-device
#theseus-autopatch -a "${FOLDER}/../test_apks/dynloading/build/test_dynloading.apk" -o /tmp/patched_dynloading.apk -k "${FOLDER}/../test_apks/dynloading/ToyKey.keystore"
theseus-autopatch -a "${FOLDER}/../test_apks/dynloading/build/test_dynloading.apk" -o /tmp/patched_dynloading.apk -k /tmp/kstore.keystore -kp 'P@ssw0rd!'
theseus-autopatch -a "${FOLDER}/../test_apks/dyn_and_ref/build/test_dyn_and_ref.apk" -o /tmp/patched_dynloading.apk -k /tmp/kstore.keystore -kp 'P@ssw0rd!' --runner-script "${FOLDER}/../test_apks/dyn_and_ref/tests/test_apk.py"
rm -rf "${TMP}"