sensepost / sensepost/objection

Error: java.lang.ClassNotFoundException:

Open
#405 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

✨enhancement 🐛bug
Dominant language
Python
Stars
9.4k
Forks
1k
Avg merge
14d 5h
Merged PRs (30d)
1

Description

in Android 9.0 , I try to list method of com.yy.leopard.http.AppNetHelper . use cmd string “ndroid hooking watch class_method com.yy.leopard.http.AppNetHelper --dump-args --dump-backtrace --dump-return ”。、
An error occurred。

“- [incoming message] ------------------
{
  "payload": "Attempting to watch class \u001b[32mcom.yy.leopard.http\u001b[39m and method \u001b[32mAppNetHelper\u001b[39m.",
  "type": "send"
}
- [./incoming message] ----------------
(agent) Attempting to watch class com.yy.leopard.http and method AppNetHelper.
A Frida agent exception has occurred.
Error: java.lang.ClassNotFoundException: Didn't find class "com.yy.leopard.http" on path: DexPathList[[dex file "InMemoryDexFile[cookie=[0, 3901508128]]", zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.yobolove.tcyyh2-o7dLH6qNQHSPZEPsZnrPFQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.yobolove.tcyyh2-o7dLH6qNQHSPZEPsZnrPFQ==/lib/arm, /data/app/com.yobolove.tcyyh2-o7dLH6qNQHSPZEPsZnrPFQ==/base.apk!/lib/armeabi-v7a, /system/lib]]
    at frida/node_modules/frida-java-bridge/lib/env.js:126
    at frida/node_modules/frida-java-bridge/lib/class-factory.js:459
    at frida/node_modules/frida-java-bridge/lib/class-factory.js:840
    at frida/node_modules/frida-java-bridge/lib/class-factory.js:128
    at frida/node_modules/frida-java-bridge/lib/class-factory.js:83
    at src/android/hooking.ts:116
    at src/android/lib/libjava.ts:9
    at frida/node_modules/frida-java-bridge/lib/vm.js:11
    at frida/node_modules/frida-java-bridge/index.js:358
”
but 。 use js Scripts 
“ Java.perform(function (){
        Java.enumerateClassLoaders({
            onMatch: function (loader) {
                if (loader.toString().indexOf("zip") > -1) {
                    Java.classFactory.loader = loader;
                    var AppNetHelper = Java.use("com.yy.leopard.http.AppNetHelper");
                    console.log("AppNetHelper.getPlatformInfo:" + AppNetHelper.getPlatformInfo());
                }
            },
            onComplete: function () {
            }
        });
      });”

it can work sucessfully.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/android/hooking.ts:116 and src/android/lib/libjava.ts:9, then compare the failing class lookup with the Java.enumerateClassLoaders script shown in the issue. Reproduce the class_method command on Android 9.0 and identify why the command cannot resolve the class while the script can; done means the command handles this loader scenario without the reported ClassNotFoundException.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java, javascript
Domain
mobile-dev, reverse-engineering
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.