Skip to content

Commit

Permalink
merged with master
Browse files Browse the repository at this point in the history
  • Loading branch information
chame1eon committed Jul 31, 2019
2 parents df2355c + 2029441 commit 6fe0b38
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
8 changes: 6 additions & 2 deletions jnitrace/src/jni/jni_env_interceptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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") {
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 6fe0b38

Please sign in to comment.