Skip to content

Instantly share code, notes, and snippets.

View ExportedActivityDetector.kt
class ExportedActivityDetector : Detector(), Detector.XmlScanner {
override fun getApplicableAttributes() = listOf("exported")
override fun visitAttribute(context: XmlContext, attribute: Attr) {
if (attribute.isParentActivity() && attribute.value == "true") {
val location = context.getLocation(attribute)
context.report(
issue = ISSUE_EXPORTED_ACTIVITY,
scope = attribute,
View ExportedActivityDetectorTest.kt
class ExportedActivityDetectorTest {
private val validXmlFile = xml(
"AndroidManifest.xml",
"""
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="co.infinum.lint">
<application
android:allowBackup="true"
View Main.cpp
int main(int argc, char** argv) {
Point * p = new Point(1, 42);
cout << *p << endl;
return 0;
}
You can’t perform that action at this time.