I'm trying to develop an app with login and providing OTP(one time password) with connection to a web service, but while testing I was able to starting the activities through adb shell in the emulator even without logging in, i.e. by using fully specified path and passing intents. this leaves the app venerable to be opened by other apps with out logging in. is it possible to protect the activities from starting through intents outside the app.
below is the piece of manifest code.
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".LoginActivity"
android:label="@string/login" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".The1Activity" >
</activity>
<activity android:name=".The2Activity" >
</activity>
Your day saver is -
Documentation says -