mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Java: Add support and tests for implicitly exported activity aliases
This commit is contained in:
@@ -52,7 +52,34 @@
|
||||
android:exported="true"
|
||||
android:label="@string/app_name"
|
||||
android:targetActivity="com.example.myapplication.AnotherActivity"></activity-alias>
|
||||
<activity
|
||||
android:name=".ExampleActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/app_name"
|
||||
></activity>
|
||||
|
||||
<activity-alias
|
||||
android:name=".ExampleAlias"
|
||||
android:exported="true"
|
||||
android:label="@string/app_name"
|
||||
android:targetActivity=".ExampleActivity">
|
||||
</activity-alias>
|
||||
|
||||
<activity
|
||||
android:name=".Example2Activity"
|
||||
android:exported="false"
|
||||
android:label="@string/app_name">
|
||||
</activity>
|
||||
|
||||
<activity-alias
|
||||
android:name=".Example2Alias"
|
||||
android:label="@string/app_name"
|
||||
android:targetActivity=".Example2Activity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"></action>
|
||||
<action android:name="android.intent.category.LAUNCHER"></action>
|
||||
</intent-filter>
|
||||
</activity-alias>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.example.myapplication;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
public class Example2Activity extends Activity {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.example.myapplication;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
public class ExampleActivity extends Activity {
|
||||
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
| .AnotherAlias | .AnotherActivity |
|
||||
| .Example2Alias | .Example2Activity |
|
||||
| .ExampleAlias | .ExampleActivity |
|
||||
| .MainAlias | .MainActivity |
|
||||
| .SecondAlias | .MainActivity |
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
| Example2Activity.java:5:14:5:29 | Example2Activity | AndroidManifest.xml:68:9:72:20 | activity |
|
||||
| Example2Activity.java:5:14:5:29 | Example2Activity | AndroidManifest.xml:74:9:82:26 | activity-alias |
|
||||
| ExampleActivity.java:5:14:5:28 | ExampleActivity | AndroidManifest.xml:55:9:59:25 | activity |
|
||||
| ExampleActivity.java:5:14:5:28 | ExampleActivity | AndroidManifest.xml:61:9:66:26 | activity-alias |
|
||||
@@ -0,0 +1,6 @@
|
||||
import java
|
||||
import semmle.code.java.frameworks.android.Android
|
||||
|
||||
from ExportableAndroidComponent component
|
||||
where component.isExported()
|
||||
select component, component.getAndroidComponentXmlElement()
|
||||
@@ -0,0 +1 @@
|
||||
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../../stubs/google-android-9.0.0/
|
||||
Reference in New Issue
Block a user