SimpleMobileTools / Simple-Music-Player

A clean music player with a customizable widget, stylish interface and no ads.
https://www.simplemobiletools.com
GNU General Public License v3.0
1.29k stars 408 forks source link

Found Fatal Exception Crashes from Testing #635

Open Mai-hh opened 5 months ago

Mai-hh commented 5 months ago

Hi! I'm a student researcher currently working on a project in the area of Android app analysis. As a part of the work centered around Intents, I found a bug that resulted in crashes after analyzing logs/execution traces. Below are the relevant activities, traces, and adb commands that triggered the crashes.

These bugs may be hidden in unexposed Receiver, but they are worth investigating into to prevent potential issues down the line and addressing to improve the overall robustness and quality. If anyone can be confirm these to be valid bugs first, I would appreciate it, and I can help provide more information as needed.

com.simplemobiletools.musicplayer.helpers.MyWidgetProvider

Execution trace:

01-22 09:00:12.177 18231 18231 E AndroidRuntime: FATAL EXCEPTION: main
01-22 09:00:12.177 18231 18231 E AndroidRuntime: Process: com.simplemobiletools.musicplayer, PID: 18231
01-22 09:00:12.177 18231 18231 E AndroidRuntime: java.lang.RuntimeException: Unable to start receiver com.simplemobiletools.musicplayer.helpers.MyWidgetProvider: android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
01-22 09:00:12.177 18231 18231 E AndroidRuntime:    at android.app.ActivityThread.handleReceiver(ActivityThread.java:4357)
01-22 09:00:12.177 18231 18231 E AndroidRuntime:    at android.app.ActivityThread.access$1600(ActivityThread.java:256)
01-22 09:00:12.177 18231 18231 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2101)
01-22 09:00:12.177 18231 18231 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:106)
01-22 09:00:12.177 18231 18231 E AndroidRuntime:    at android.os.Looper.loopOnce(Looper.java:201)
01-22 09:00:12.177 18231 18231 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:288)
01-22 09:00:12.177 18231 18231 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:7842)
01-22 09:00:12.177 18231 18231 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
01-22 09:00:12.177 18231 18231 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
01-22 09:00:12.177 18231 18231 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
01-22 09:00:12.177 18231 18231 E AndroidRuntime: Caused by: android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
01-22 09:00:12.177 18231 18231 E AndroidRuntime:    at android.app.ContextImpl.startActivity(ContextImpl.java:1080)
01-22 09:00:12.177 18231 18231 E AndroidRuntime:    at android.app.ContextImpl.startActivity(ContextImpl.java:1056)
01-22 09:00:12.177 18231 18231 E AndroidRuntime:    at android.content.ContextWrapper.startActivity(ContextWrapper.java:411)
01-22 09:00:12.177 18231 18231 E AndroidRuntime:    at android.content.ContextWrapper.startActivity(ContextWrapper.java:411)
01-22 09:00:12.177 18231 18231 E AndroidRuntime:    at com.simplemobiletools.musicplayer.helpers.MyWidgetProvider.c(SourceFile:22)
01-22 09:00:12.177 18231 18231 E AndroidRuntime:    at com.simplemobiletools.musicplayer.helpers.MyWidgetProvider.onReceive(SourceFile:78)
01-22 09:00:12.177 18231 18231 E AndroidRuntime:    at android.app.ActivityThread.handleReceiver(ActivityThread.java:4348)
01-22 09:00:12.177 18231 18231 E AndroidRuntime:    ... 9 more

adb command that triggers it:

#!/bin/bash

adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" 
echo adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" 
sleep 3.0
adb shell am force-stop com.simplemobiletools.musicplayer
sleep 2.0
#!/bin/bash

adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" 
echo adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" 
sleep 3.0
adb shell am force-stop com.simplemobiletools.musicplayer
sleep 2.0
adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider"  -a "android.content.Intent"
sleep 3.0
adb shell am force-stop com.simplemobiletools.musicplayer
sleep 2.0
#!/bin/bash

adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" 
echo adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" 
sleep 3.0
adb shell am force-stop com.simplemobiletools.musicplayer
sleep 2.0
adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider"  -a "TRACK_CHANGED"
sleep 3.0
adb shell am force-stop com.simplemobiletools.musicplayer
sleep 2.0
#!/bin/bash

adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" 
echo adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" 
sleep 3.0
adb shell am force-stop com.simplemobiletools.musicplayer
sleep 2.0
adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider"  -a "TRACK_CHANGED"
sleep 3.0
adb shell am force-stop com.simplemobiletools.musicplayer
sleep 2.0
#!/bin/bash

adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" --ez IS_PLAYING false 
echo adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" --ez IS_PLAYING false 
sleep 3.0
adb shell am force-stop com.simplemobiletools.musicplayer
sleep 2.0
adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" --ez IS_PLAYING false  -a "TRACK_STATE_CHANGED"
sleep 3.0
adb shell am force-stop com.simplemobiletools.musicplayer
sleep 2.0
#!/bin/bash

adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" --ez IS_PLAYING true 
echo adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" --ez IS_PLAYING true 
sleep 3.0
adb shell am force-stop com.simplemobiletools.musicplayer
sleep 2.0
adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" --ez IS_PLAYING true  -a "TRACK_STATE_CHANGED"
sleep 3.0
adb shell am force-stop com.simplemobiletools.musicplayer
sleep 2.0
#!/bin/bash

adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" --ez IS_PLAYING true 
echo adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" --ez IS_PLAYING true 
sleep 3.0
adb shell am force-stop com.simplemobiletools.musicplayer
sleep 2.0
adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" --ez IS_PLAYING true  -a "TRACK_STATE_CHANGED"
sleep 3.0
adb shell am force-stop com.simplemobiletools.musicplayer
sleep 2.0
#!/bin/bash

adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" 
echo adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" 
sleep 3.0
adb shell am force-stop com.simplemobiletools.musicplayer
sleep 2.0
adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider"  -a "com.simplemobiletools.musicplayer.action.NEXT"
sleep 3.0
adb shell am force-stop com.simplemobiletools.musicplayer
sleep 2.0
#!/bin/bash

adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" 
echo adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" 
sleep 3.0
adb shell am force-stop com.simplemobiletools.musicplayer
sleep 2.0
adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider"  -a "com.simplemobiletools.musicplayer.action.PLAYPAUSE"
sleep 3.0
adb shell am force-stop com.simplemobiletools.musicplayer
sleep 2.0
#!/bin/bash

adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" 
echo adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" 
sleep 3.0
adb shell am force-stop com.simplemobiletools.musicplayer
sleep 2.0
adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider"  -a "com.simplemobiletools.musicplayer.action.PREVIOUS"
sleep 3.0
adb shell am force-stop com.simplemobiletools.musicplayer
sleep 2.0
#!/bin/bash

adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" 
echo adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider" 
sleep 3.0
adb shell am force-stop com.simplemobiletools.musicplayer
sleep 2.0
adb shell su 0 am broadcast -n "com.simplemobiletools.musicplayer/com.simplemobiletools.musicplayer.helpers.MyWidgetProvider"  -a ""
sleep 3.0
adb shell am force-stop com.simplemobiletools.musicplayer
sleep 2.0
Maxitendo1 commented 4 months ago

@Mai-hh SimpleMobileTools apps were sold to ad and spyware company. Fork is here:

https://github.com/FossifyOrg