简体   繁体   English

Crashlytics 崩溃报告提到 XposedBridge

[英]Crashlytics crash report mentions XposedBridge

I released an update to an Android app yesterday, and today I am seeing a few crash logs in Crashlytics:我昨天发布了一个 Android 应用程序的更新,今天我在 Crashlytics 中看到了一些崩溃日志:

   Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapp/com.example.myapp.MyWebViewActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
          at android.app.ActivityThread.-wrap12(ActivityThread.java)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
          at android.os.Handler.dispatchMessage(Handler.java:102)
          at android.os.Looper.loop(Looper.java:154)
          at android.app.ActivityThread.main(ActivityThread.java:6119)
          at java.lang.reflect.Method.invoke(Method.java)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
          at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:107)

   Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
          at com.example.myapp.MyWebViewActivity.onCreate(MyWebViewActivity.java:77)
          at android.app.Activity.performCreate(Activity.java:6679)
          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
          at android.app.ActivityThread.-wrap12(ActivityThread.java)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
          at android.os.Handler.dispatchMessage(Handler.java:102)
          at android.os.Looper.loop(Looper.java:154)
          at android.app.ActivityThread.main(ActivityThread.java:6119)
          at java.lang.reflect.Method.invoke(Method.java)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
          at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:107) 

At the bottom this report mentions XposedBridge, which I find kind of odd.这份报告的底部提到了 XposedBridge,我觉得这有点奇怪。 Is this caused by someone experimenting with my app using the Xposed framework?这是由于有人使用 Xposed 框架试验我的应用程序造成的吗? Or could this happen to a "normal user"?或者这会发生在“普通用户”身上吗? Crashlytics says the issue has affected 3 users so far, but I'm skeptical since they all have the exact same phone model and Android version (Motorola Nexus 6, Android 7.1.1) and happened within 10 minutes of each other. Crashlytics 表示,到目前为止,该问题已经影响了 3 位用户,但我持怀疑态度,因为他们都拥有完全相同的手机型号和 Android 版本(摩托罗拉 Nexus 6、Android 7.1.1),并且发生在 10 分钟内。

The NPE is caused by getIntent().getStringExtra("some_string").equals("another_string") in an onCreate method, even though I am setting the "some_string" in all places where I'm creating this activity. NPE 是由onCreate方法中的getIntent().getStringExtra("some_string").equals("another_string")的,即使我在创建此活动的所有地方都设置了“some_string”。

So what I'm wondering is if this sort of crash could be the result of anything other than a user who is experimenting with Xposed?所以我想知道的是,这种崩溃是否可能是由于用户尝试使用 Xposed 以外的其他原因造成的? Ie should I take it seriously or not?即我应该认真对待它吗?

In general having the XposedBridge in the stack trace just means that the app runs on an device with XPosed installed.通常,在堆栈跟踪中包含XposedBridge仅意味着应用程序在安装了 XPosed 的设备上运行。 XPosed changes the Dalvik VM system wide, even if your app isn't modified by any XPosed module. XPosed 会更改 Dalvik VM 系统范围,即使您的应用程序没有被任何 XPosed 模块修改。

I don't have much experience with Crashlytics, however the "3 users" I would interpret as one user having cleared the app data two times.我对 Crashlytics 没有太多经验,但是我将“3 个用户”解释为一个用户两次清除了应用程序数据。

Anyway I would always use safe coding, therefore your call无论如何,我将始终使用安全编码,因此您的电话

getIntent().getStringExtra("some_string").equals("another_string")

should be reformulated to:应重新表述为:

"another_string".equals(getIntent().getStringExtra("some_string"))

This way is may be a bit unfamiliar to read, but it is safe against NullPointerException in case the current Intent does not has the "some_string" value.这种方式读起来可能有点陌生,但如果当前的 Intent 没有“some_string”值,它对 NullPointerException 是安全的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM