Note that there are some explanatory texts on larger screens.

plurals
  1. POActivity Access Restriction Implementation in a Monodroid Application
    primarykey
    data
    text
    <p>I have a requirement where I need to restrict access to an activity of a Monodroid Application. Hence i tried a spike where the application <strong>IntentSayHello</strong> would have an access restricted Activity called <strong>SayHelloActivity</strong>. As the first step i defined the permission tag in the <strong>AndroidManifest.xml</strong> of the application as below:</p> <pre><code>... ... &lt;/application&gt; &lt;permission android:name="intentsayhello.permission.SAYHELLO" android:protectionLevel="signature" android:label="@string/permlbl_restricted" android:description="@string/permdesc_restricted"&gt; &lt;/permission&gt; &lt;/manifest&gt; </code></pre> <p>Please note that i'm using <strong>protectionLevel = signature</strong> which means that any other application signed with the same certificate as IntentSayHello can only access the restricted activity.</p> <p>Now i coded the SayHelloActivity as below:</p> <pre><code> [Activity(Label = "SayHelloActivity", MainLauncher = true, Icon = "@drawable/icon", Permission = "intentsayhello.permission.SAYHELLO")] [IntentFilter(new string[] { "companyXYZ.intent.sayhello.MAIN" },Categories = new string[]{Intent.CategoryDefault}, DataMimeType = "vnd.companyXYZ.say.hello/vnd.companyXYZ.activity")] public class SayHelloActivity : Activity { ..... ..... } </code></pre> <p>After this i tested with a client application by invoking SayHelloActivity of IntentSayHello through an implicit intent and i got <strong>SecurityException</strong> as expected.</p> <p><em><strong>Permission Denial: starting Intent { act=companyXYZ.intent.sayhello.MAIN typ=vnd.companyXYZ.say.hello/vnd.companyXYZ.activity cmp=IntentSayHello.IntentSayHello/intentsayhello.SayHelloActivity } from ProcessRecord{4094f850 9126:DiffKeyHello.DiffKeyHello/10097} (pid=9126, uid=10097) requires intentsayhello.permission.SAYHELLO</em></strong></p> <p>Now if i want my client Application to be given access to the SayHelloActivity of the restricted application, i'm supposed sign my client application with the same keystore (certificate) and also mention in the AndroidManifest.xml of the client application as below:</p> <pre><code>... &lt;uses-sdk android:minSdkVersion="4" /&gt; &lt;uses-permission android:name="intentsayhello.permission.SAYHELLO" /&gt; &lt;/manifest&gt; </code></pre> <p>But when i did both of this, the client application still could not invoke the SayHelloActivity and same SecurityException is thrown.</p> <p>I would like to know the directions/solution to this issue. Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload