From 38012a9611aa740a2f01e3c5f61356c9183e9c5d Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Mon, 19 Aug 2019 19:26:27 +0200 Subject: [PATCH] Patcher: check for supported dalvikvm options --- patcher/CommonPatcher | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/patcher/CommonPatcher b/patcher/CommonPatcher index da17387..238e9a4 100644 --- a/patcher/CommonPatcher +++ b/patcher/CommonPatcher @@ -347,8 +347,16 @@ call_dalvikvm () { BOOTCLASSES=${BOOTCLASSES}:${jar} done - DALVIKVM_OPTS="-verbose:gc -verbose:jit -verbose:jni \ - -verbose:class -Xnodex2oat -Xnoimage-dex2oat" + supported_opts=$(dalvikvm --help 2>&1) + + DALVIKVM_OPTS="" + + [[ "${supported_opts}" == *\[no\]dex2oat* ]] && DALVIKVM_OPTS="${DALVIKVM_OPTS} -Xnodex2oat" + [[ "${supported_opts}" == *\[no\]image-dex2oat* ]] && DALVIKVM_OPTS="${DALVIKVM_OPTS} -Xnoimage-dex2oat" + [[ "${supported_opts}" == *verbose:*gc* ]] && DALVIKVM_OPTS="${DALVIKVM_OPTS} -verbose:gc" + [[ "${supported_opts}" == *verbose:*jit* ]] && DALVIKVM_OPTS="${DALVIKVM_OPTS} -verbose:jit" + [[ "${supported_opts}" == *verbose:*jni* ]] && DALVIKVM_OPTS="${DALVIKVM_OPTS} -verbose:jni" + [[ "${supported_opts}" == *verbose:*class* ]] && DALVIKVM_OPTS="${DALVIKVM_OPTS} -verbose:class" if [ "${ROM_DEX_STATUS}" = "DEODEX" ]; then /system/bin/dalvikvm \