6

While running a apk file (AllSeenValidation14.12.00b.02.apk) in adb shell, I am getting this eror message:

Command to run : adb shell am start org.alljoyn.validation.validation_tests.validation_tests_it/org.alljoyn.validation.testing.instrument.ValidationInstrumentationTestActivity

Error:

"Permission Denial: starting Intent { flg=0x10000000 > cmp=org.alljoyn.validation.validation_tests.validation_tests_it/org.alljoyn.validation.testing.instrument.ValidationInstrumentationTestActivity } from null (pid=30992, uid=2000) not exported from  uid 10142 "   error.

Note: I don't have the source code of apk file (AllSeenValidation14.12.00b.02.apk)

Tim
  • 41,901
  • 18
  • 127
  • 145
Naresh Reddy
  • 179
  • 1
  • 7
  • 4
    You can't run an Activity not listed in the Manifest except from the app's user id. Probably you weren't supposed to do this, or else the author got it wrong. If it is a debug apk you can try run-as. I don't know if it would work on a rooted device or emulator, as it is Android and not Linux doing the enforcing, but you could try. – Chris Stratton May 02 '15 at 11:43
  • This Activity(ValidationInstrumentationTestActivity) is listed in Manifest. – Naresh Reddy May 04 '15 at 09:35
  • 1
    Possible duplicate of [android-permission-denied-error-when-changing-launcher-activity](http://stackoverflow.com/questions/11056214/android-permission-denied-error-when-changing-launcher-activity) – asgs May 04 '15 at 09:41
  • which permission caused the exception? – Naresh Reddy May 04 '15 at 10:00
  • I don't have source code here different scenario from [android-permission-denied-error-when-changing-launcher-activity] @ asgs – Naresh Reddy May 04 '15 at 12:35
  • If you don't have the source, how do you know for a fact that it is in the manifest? It seems your question is incomplete without that evidence. – Chris Stratton May 04 '15 at 12:42
  • By using "aapt dump xmltree AndroidManifest.xml" this command i got to know the Manifest file. One of the line in Manifest file: E: activity (line=38) A: android:name(0x01010003)="org.alljoyn.validation.testing.instrument.ValidationInstrumentationTestActivity" (Raw: "org.alljoyn.validation.testing.instrument.ValidationInstrumentationTestActivity") @chris stratton – Naresh Reddy May 04 '15 at 13:13
  • 2
    But does it have an intent filter? If it lacks that or anything *explicitly* exporting it, you cannot launch it directly in the manner of a "deep link" but must rather launch something else which is exported first. I continue to suspect that you are either not using this as intended, or else the author made a mistake. – Chris Stratton May 04 '15 at 13:59
  • Yes you are correct author made a mistake. I tried with previous version of APK it is working fine. Thank you Chris Stratton – Naresh Reddy May 14 '15 at 09:08

1 Answers1

5

Here Notice android:exported="true" this allowed activity to access outside of application example other app Or you can put Intent Filter in same activity that need to access

 <intent-filter>
        <action android:name="android.intent.action.MAIN" />
         <category android:name="android.intent.category.LAUNCHER" />
 </intent-filter>

This allow to open the

 <activity
            android:name=".activity.LoginActivity"
            android:hardwareAccelerated="false"
            android:exported="true"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="stateHidden" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity> 

In your example ValidationInstrumentationTestActivity Activity doesn't have android:exported=true or intent-filter thats why you get "Permission Denial: starting Intent exception

I know this is not the answer but it help you to get what you want

Sushant Gosavi
  • 3,647
  • 3
  • 35
  • 55