<activity>
tag in the AndroidManifest.xml
file. It describes which Task an Activity prefers to join.
By default, every activity has the same affinity as the package name.launchMode
attribute specifies an instruction on how the activity should be launched into a task.
There are four different Launch Modes:singleTask
, the Android system evaluates three possibilities and one of them is the reason why our attack is possible. Here they are -taskAffinity=""
can be a quick fix for this issue. The launch mode can also be set to singleInstance if the app does not want other activities to join tasks belonging to it. A custom onBackPressed() function can also be added, to override the default behaviour.