question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android Trace Issue

See original GitHub issue

Hello, I am using raptor_frida_android_trace.js and I am getting an error upon the app being spawned.

Spawned APP. Resuming main thread! [DEVICE::APP]-> TypeError: cannot read property 1 of null at [anon] (duk_hobject_props.c:2385) at [anon] (repl1.js:46) at frida/node_modules/frida-java/index.js:190 at forEach (native) at d (java.js:2216) at frida/node_modules/frida-java/index.js:120 at trace (repl1.js:51) at [anon] (repl1.js:174) at frida/node_modules/frida-java/lib/vm.js:39 at v (frida/node_modules/frida-java/index.js:338) at frida/node_modules/frida-java/index.js:309 [...]

It looks like the issue is on line 46: var className = aClass.match(/[L](.*);/)[1].replace(/\//g, ".");

Is there an easy fix like a null check? Could this issue be caused by obfuscation?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
h3rb0commented, Jun 28, 2019

I guess the code var className = aClass.match(/[L](.*);/)[1].replace(/\//g, "."); is just used for extract the class name from aClass “Lcom.example.app;”. but in my case, the value of aClass is “com.example.app”. Therefor , just
var className = aClase;

0reactions
leoandrade20commented, Jan 21, 2021

Hello, I’m trying to display a Toast message through Frida with this code:

Java.perform(() => {
     var context = Java.use("android.app.ActivityThread").currentApplication().getApplicationContext();
     
     Java.scheduleOnMainThread(function() {
          var toast = Java.use("android.widget.Toast");
          toast.makeText(context, Java.use("java.lang.String").$new("Hellooo !!"), 1).show();
    });
});

However, I still get the error: TypeError: cannot read property 'getApplicationContext' of null

Read more comments on GitHub >

github_iconTop Results From Across the Web

Capture a system trace on a device - Android Developers
Complete a system trace recording · Tap the System Tracing tile, which has the label "Record trace". · Perform the actions in your...
Read more >
Cannot open trace files generated with Debug ... - Issue Tracker
Issue occurs with Android Studio 3.2, 3.3.1 or 3.4b5. ... Error Message: Failed to open file: The profiler was unable to open the...
Read more >
Debugging Exceptions within your App - CodePath Cliffnotes
Find the final exception stack trace within the Android Monitor (logcat) · Identify the exception type, message, and file with line number ·...
Read more >
Android Debug Tracing problem - Stack Overflow
According to http://developer.android.com/guide/developing/debugging/debugging-tracing.html#knownissues, there are known issues with ...
Read more >
Get Thee To a Stack Trace - CommonsWare
Android 5.0 App Crash Dialog Android 9.0 Dialog After Repeated Crashes. In this chapter, we will cover a few tips on how to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found