diff --git a/CHANGELOG.md b/CHANGELOG.md index 56253e8..f9c64a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # jnitrace Change Log +## 1.3.3 +- Bug fix - Checked whether the this context exists before using it + ## 1.3.2 - Bug fix - Use Process.findRangeByAddress instead of Process.findModuleByAddress for checking the validity of the stack pointer diff --git a/jnitrace/src/jni/jni_env_interceptor.js b/jnitrace/src/jni/jni_env_interceptor.js index 2341051..9cc222e 100644 --- a/jnitrace/src/jni/jni_env_interceptor.js +++ b/jnitrace/src/jni/jni_env_interceptor.js @@ -37,9 +37,13 @@ JNIEnvInterceptor.prototype.createJNIIntercept = function(id, methodAddr) { var nativeFunction = new NativeFunction(methodAddr, fridaRet, fridaArgs); var nativeCallback = new NativeCallback(function() { - var threadId = this.threadId; + var threadId = Process.getCurrentThreadId(); var localArgs = [].slice.call(arguments); var jniEnv = self.threads.getJNIEnv(threadId); + var context = null; + if (this) { + context = this.context; + } localArgs[0] = jniEnv; @@ -62,7 +66,7 @@ JNIEnvInterceptor.prototype.createJNIIntercept = function(id, methodAddr) { } } - self.transport.trace(method, localArgs, ret, this.context, add); + self.transport.trace(method, localArgs, ret, context, add); if (method.name === "GetMethodID" || method.name === "GetStaticMethodID") { diff --git a/setup.py b/setup.py index f5ddb15..0a78f0a 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( name='jnitrace', - version='1.3.2', + version='1.3.3', description='A tool for tracing use of the JNI in Android apps', long_description=long_description, long_description_content_type='text/markdown',