Skip to content

Instantly share code, notes, and snippets.

@valokafor
Created October 24, 2014 19:55
Show Gist options
  • Save valokafor/5c633cd8e77fe96c000c to your computer and use it in GitHub Desktop.
Save valokafor/5c633cd8e77fe96c000c to your computer and use it in GitHub Desktop.
DangerousAppManifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="course.labs.dangerousapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="18" />
<!--
TODO - Using a permission element,
define a custom permission with name
"course.labs.permissions.DANGEROUS_ACTIVITY_PERM"
and "dangerous" protection level.
-->
<permission
android:name="course.labs.permissions.DANGEROUS_ACTIVITY_PERM"
android:protectionLevel="dangerous"
android:description="@string/app_name"
android:label="@string/hello_world"></permission>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<!-- TODO - enforce the custom permission on this Activity -->
<activity
android:name=".DangerousActivity"
android:label="@string/app_name"
android:permission="course.labs.permissions.DANGEROUS_ACTIVITY_PERM"
>
<!--
TODO - add additional intent filter info so that this Activity
will respond to an Implicit Intent with the action
"course.labs.permissions.DANGEROUS_ACTIVITY"
-->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="course.labs.permissions.DANGEROUS_ACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment