idanr1986 / droidmon

Dalvik Monitoring Framework for CuckooDroid
Other
91 stars 49 forks source link

NullPointerException in MethodHookImpl.java #2

Closed melonaerial closed 8 years ago

melonaerial commented 8 years ago

Hello! https://github.com/idanr1986/droidmon/blob/master/src/com/cuckoodroid/droidmon/MethodHookImpl.java this file in line 43 always throws NullPointerException and Hooks doesn't work. So i have patched you application using apktool(i'm new in Android and i have problems to make you application build in IDEA Studio) and i have deleted that if and it works great! So please fix the problem, cause CuckooDroid framework doesn't work without this app. cause most interesting part of CuckooDroid it is API Calls for me.

idanr1986 commented 8 years ago

ill check it thanks

On 12 Oct 2015, at 2:52 PM, Mike R notifications@github.com wrote:

Hello! https://github.com/idanr1986/droidmon/blob/master/src/com/cuckoodroid/droidmon/MethodHookImpl.java https://github.com/idanr1986/droidmon/blob/master/src/com/cuckoodroid/droidmon/MethodHookImpl.java this file in line 43 always throws NullPointerException and Hooks doesn't work. So i have patched you application using apktool(i'm new in Android and i have problems to make you application build in IDEA Studio) and i have deleted that if and it works great! So please fix the problem, cause CuckooDroid framework doesn't work without this app. cause most interesting part of CuckooDroid it is API Calls for me.

— Reply to this email directly or view it on GitHub https://github.com/idanr1986/droidmon/issues/2.

berii commented 8 years ago

There is a missing attribute in the hooks.json called trace (as you said line 43 in MethodHookImpl.java). So the hooks.json should look like: { "hookConfigs": [ { "class_name": "android.telephony.TelephonyManager", "method": "getDeviceId", "thisObject": false, "type": "fingerprint" }, { "class_name": "android.telephony.TelephonyManager", "method": "getSubscriberId", "thisObject": false, "type": "fingerprint" } ], "trace":false }

melonaerial commented 8 years ago

Yep! This problem is because of this line of code: https://github.com/idanr1986/droidmon/blob/master/src/com/cuckoodroid/droidmon/InstrumentationManager.java#L83 . I think developers should add check for TRACE == null, and if so set it to false as in default static constructor. Or add "trace" parameter to documentation, as u said.

idanr1986 commented 8 years ago

fixed the example in the README and added hooks.json example file