Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Uncatchable NullPointerException Crashes Target Process

未关闭
#375 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
android, java, javascript

调研方向

唯一提供的入口点是 script.js;首先使用 Frida 16.2.1 在 Android 6 上运行复现,并通过 Java bridge 跟踪带有 null 参数的调用。确认 null 解引用不再终止目标进程,并确认 try-catch 路径收到一个 Exception。

由索引模型根据 Issue 内容生成。

描述

Description

When hooking Java methods using frida-java-bridge, calling methods on null parameters causes the target process to crash, even when the code is wrapped in a try-catch block. This is unexpected behavior for JavaScript developers and causes production apps to terminate silently.

Reproduction
Java.perform(function () {
    const ArrayList = Java.use("java.util.ArrayList");
    
    ArrayList.add.overload('java.lang.Object').implementation = function (value) {
        try {
            // This crashes the process when value is null
            var className = value.getClass().getName();
            console.log("Class:", className);
        } catch (e) {
            console.log("Exception caught:", e); // Never executed
        }
        return this.add(value);
    };
});
Command:
frida -UF -l script.js
Expected Behavior

The try-catch block should catch the NullPointerException when value is null, log the error message, and allow the application to continue running.

Actual Behavior

The target process terminates immediately:

Process terminated

The exception is never caught, and no error message appears in the console.

Environment
Frida version: 16.2.1
Target platform: Android 6
Script language: JavaScript
主要语言
JavaScript
星标
414
派生
174
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

frida/frida-java-bridge 的其他 Issue

查看 frida/frida-java-bridge 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。