syncthing-android icon indicating copy to clipboard operation
syncthing-android copied to clipboard

Intent resolving bugs

Open AssassinRain opened this issue 5 years ago • 0 comments

Hello, we find several bugs in the code of 1 activity in version 1.2.1 Because this activity is exported one, i.e., be exposed to outside, they may receive unfriendly commands and then lead to app crash. We believe that fixing these bugs will further improve the robustness of this app.

1.com.nutomic.syncthingandroid.activities.ShareActivity

The exception trace is: FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nutomic.syncthingandroid/com.nutomic.syncthingandroid.activities.ShareActivity}: 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:2957) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6944) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) 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.nutomic.syncthingandroid.activities.ShareActivity.onCreate(ShareActivity.java:122) at android.app.Activity.performCreate(Activity.java:7183) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2910) ... 9 more

The command to trigger it is: adb shell am start -n com.nutomic.syncthingandroid/com.nutomic.syncthingandroid.activities.ShareActivity

2.com.nutomic.syncthingandroid.activities.ShareActivity

The exception trace is: FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nutomic.syncthingandroid/com.nutomic.syncthingandroid.activities.ShareActivity}: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.easter.test.MyParcelable at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2957) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6944) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) Caused by: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.easter.test.MyParcelable at android.os.Parcel.readParcelableCreator(Parcel.java:2871) at android.os.Parcel.readParcelable(Parcel.java:2797) at android.os.Parcel.readValue(Parcel.java:2700) at android.os.Parcel.readArrayMapInternal(Parcel.java:3067) at android.os.BaseBundle.unparcel(BaseBundle.java:257) at android.os.Bundle.getParcelable(Bundle.java:888) at android.content.Intent.getParcelableExtra(Intent.java:7734) at com.nutomic.syncthingandroid.activities.ShareActivity.onCreate(ShareActivity.java:123) at android.app.Activity.performCreate(Activity.java:7183) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2910) ... 9 more

And there are the parameters of our Intent: action: android.intent.action.SEND;; category: null;; data: null;; type: null;; Extra-data: Parcelable->android.intent.extra.STREAM->ParcelableObj

AssassinRain avatar Aug 16 '19 14:08 AssassinRain