- सिंटैक्स:
<permission android:description="string resource" android:icon="drawable resource" android:label="string resource" android:name="string" android:permissionGroup="string" android:protectionLevel=["normal" | "dangerous" | "signature" | ...] />
- इसमें शामिल है:
<manifest>
- विवरण:
- ऐसी सुरक्षा अनुमति के बारे में बताता है जिसका इस्तेमाल इन कामों के लिए किया जाता है इस या अन्य ऐप्लिकेशन के खास कॉम्पोनेंट या सुविधाओं के ऐक्सेस को सीमित करेगा. अनुमतियां कैसे काम करती हैं, इस बारे में ज़्यादा जानकारी के लिए, ऐप्लिकेशन मेनिफ़ेस्ट की खास जानकारी में अनुमतियां सेक्शन और सुरक्षा से जुड़ी सलाह देखें.
- विशेषताएं:
android:description
- इस अनुमति के बारे में ऐसी जानकारी, जिसे उपयोगकर्ता आसानी से पढ़ सकते हैं. यह जानकारी ज़्यादा लंबी होती है और कई तरह की होती है
लेबल से ज़्यादा जानकारी देने वाला. उदाहरण के लिए, यह
उपयोगकर्ता से पूछे जाने पर उपयोगकर्ता की अनुमति
किसी अन्य ऐप्लिकेशन को अनुमति देने के लिए.
यह एट्रिब्यूट, स्ट्रिंग रिसॉर्स के रेफ़रंस के तौर पर सेट है.
label
एट्रिब्यूट के उलट, यह कोई रॉ स्ट्रिंग नहीं हो सकती. android:icon
- ऐसे आइकॉन के लिए ड्रॉ करने लायक संसाधन का रेफ़रंस जो अनुमति.
android:label
- अनुमति के लिए उपयोगकर्ता द्वारा पढ़ने लायक नाम.
सुविधा के लिए, लेबल को सीधे सेट किया जा सकता है रॉ स्ट्रिंग की तरह इस्तेमाल करें. हालांकि, जब ऐप्लिकेशन प्रकाशित करने के लिए तैयार हो, तो उसे में एक स्ट्रिंग संसाधन का संदर्भ शामिल हो, ताकि उसका स्थानीय भाषा में अनुवाद किया जा सके. स्ट्रिंग होती हैं.
android:name
- इसमें इस्तेमाल किया जाने वाला नाम
का संदर्भ देता है, जैसे कि
<uses-permission>
एलिमेंट या ऐप्लिकेशन के कॉम्पोनेंट कीpermission
विशेषताएं.ध्यान दें: सिस्टम एक से ज़्यादा पैकेज के बारे में एलान नहीं करने देता समान नाम की अनुमति जब तक कि सभी पैकेज को वही प्रमाणपत्र. अगर कोई पैकेज किसी अनुमति का एलान करता है, तो सिस्टम अनुमति नहीं देता उपयोगकर्ता को उसी नाम की अनुमति वाले अन्य पैकेज इंस्टॉल करने हों, जब तक कि वे पैकेज, पहले पैकेज वाले सर्टिफ़िकेट से साइन किए गए हों.
इस वजह से, Google सुझाव देता है कि ऐप्लिकेशन के पैकेज के नाम के साथ अनुमतियों को प्रीफ़िक्स के तौर पर जोड़ें. का इस्तेमाल करें.
.permission.
के साथ यह प्रीफ़िक्स डालें और फिर क्षमता होती है जिसके बारे में अनुमति अपर SNAKE_CASE में दिखाती है. जैसे:com.example.myapp.permission.ENGAGE_HYPERSPACE
.इस सुझाव के बाद, टकरावों से बचा जा सकता है. साथ ही, मालिक को साफ़ तौर पर पहचानने में मदद मिलती है के मुताबिक करना है.
android:permissionGroup
- यह अनुमति किसी समूह को असाइन करता है. इस एट्रिब्यूट की वैल्यू
समूह का नाम, जिसे
इसमें
<permission-group>
एलिमेंट है या किसी अन्य ऐप्लिकेशन का इस्तेमाल करने की अनुमति है. अगर यह एट्रिब्यूट सेट नहीं है, तो अनुमति किसी ग्रुप से नहीं जुड़ा है. android:protectionLevel
-
अनुमति में शामिल संभावित जोखिम की जानकारी देता है और यह पता लगाने के लिए सिस्टम की उस प्रक्रिया को दिखाता है जिसका पालन करना है कि ऐप्लिकेशन के लिए इसका अनुरोध करने की अनुमति दी जाए या नहीं.
सुरक्षा के हर लेवल में बुनियादी अनुमति का टाइप और शून्य या उससे ज़्यादा अनुमति शामिल होती है फ़्लैग. उदाहरण के लिए,
"dangerous"
में सुरक्षा के लेवल में कोई फ़्लैग. इसके उलट, सुरक्षा का लेवल"signature|privileged"
इसमें"signature"
की बुनियादी अनुमति और"privileged"
फ़्लैग.नीचे दी गई टेबल में, सभी तरह की बुनियादी अनुमतियां दिखाई गई हैं. फ़्लैग की सूची के लिए, देखें
protectionLevel
.वैल्यू मतलब "normal"
डिफ़ॉल्ट वैल्यू. कम जोखिम वाली अनुमति, जो अनुरोध करने की सुविधा देती है साथ ही, अलग-अलग ऐप्लिकेशन लेवल की सुविधाओं को ऐक्सेस करने के लिए, अन्य ऐप्लिकेशन, सिस्टम या उपयोगकर्ता को किसी तरह का जोखिम नहीं होगा. सिस्टम अपने-आप इस टाइप की अनुमति दे देता है को इंस्टॉल करते समय, अनुरोध करने वाले ऐप्लिकेशन को साफ़ तौर पर उपयोगकर्ता की अनुमति मांगते हों. हालांकि, उपयोगकर्ता हमेशा के पास इंस्टॉल करने से पहले इन अनुमतियों की समीक्षा करने का विकल्प होता है. "dangerous"
ज़्यादा जोखिम वाली अनुमति, जो अनुरोध करने वाला ऐप्लिकेशन देती है उपयोगकर्ता के निजी डेटा को ऐक्सेस करना या ऐसे डिवाइस को कंट्रोल करना जो उपयोगकर्ता पर बुरा असर पड़ता है. क्योंकि इस तरह की अनुमति संभावित जोखिम होता है, इसलिए हो सकता है कि सिस्टम अपने-आप काम न करे उसे अनुरोध करने वाले ऐप्लिकेशन को दें. उदाहरण के लिए, किसी भी खतरनाक किसी ऐप्लिकेशन द्वारा अनुरोधित अनुमतियां और आगे बढ़ने से पहले पुष्टि करना ज़रूरी है या कुछ और उपयोगकर्ता की ओर से अपने-आप अनुमति न देने का विकल्प चुना जा सकता है. जानकारी इस्तेमाल करने के दौरान किया जा सकता है. "signature"
एक ऐसी अनुमति जो सिस्टम सिर्फ़ तब देता है, जब ऐप्लिकेशन पर उसी प्रमाणपत्र से हस्ताक्षर किया गया है जिससे ऐप्लिकेशन पर हस्ताक्षर किया गया है जिसने अनुमति का एलान किया. अगर सर्टिफ़िकेट मेल खाते हैं, तो सिस्टम उपयोगकर्ता को सूचित किए बिना अपने-आप अनुमति दे देता है या साफ़ तौर पर अनुमति मांगने के लिए. "knownSigner"
एक ऐसी अनुमति जो सिस्टम सिर्फ़ तब देता है, जब ऐप्लिकेशन इससे साइन किया गया है अनुमति है सर्टिफ़िकेट. अगर अनुरोध करने वाले व्यक्ति का सर्टिफ़िकेट, सूची में मौजूद है, तो सिस्टम उपयोगकर्ता को सूचित किए बिना अपने-आप अनुमति दे देता है या साफ़ तौर पर अनुमति मांगने के लिए. "signatureOrSystem"
"signature|privileged"
के लिए पुराना समानार्थी शब्द. एपीआई में काम नहीं करता लेवल 23 है.एक ऐसी अनुमति जो सिस्टम सिर्फ़ उन ऐप्लिकेशन को देता है जो जो Android सिस्टम इमेज पर किसी खास फ़ोल्डर में सेव किए गए हों या उसी प्रमाणपत्र से हस्ताक्षर किया गया हो जिससे यह एलान किया गया था कि अनुमति.
"signature"
के तौर पर इस विकल्प का इस्तेमाल करने से बचें सुरक्षा का लेवल, ज़्यादातर ज़रूरतों और काम को पूरा करने के लिए काफ़ी होता है, भले ही ऐप्लिकेशन इंस्टॉल किए गए हैं.कॉन्टेंट बनाने
"signatureOrSystem"
अनुमति का इस्तेमाल किसी खास काम के लिए किया जाता है ऐसी स्थितियां जहां एक से ज़्यादा वेंडर के ऐप्लिकेशन, सिस्टम में पहले से मौजूद होते हैं इमेज है और उसे खास तौर पर कुछ सुविधाओं को शेयर करना होगा, क्योंकि जो साथ मिलकर बनाए जा रहे हैं.
- इसमें पेश किया गया:
- एपीआई लेवल 1
- यह भी देखें:
<uses-permission>
<permission-tree>
<permission-group>
<अनुमति>
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, Oracle और/या इससे जुड़ी हुई कंपनियों के ट्रेडमार्क या रजिस्टर किए हुए ट्रेडमार्क हैं.
आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया.
[[["समझने में आसान है","easyToUnderstand","thumb-up"],["मेरी समस्या हल हो गई","solvedMyProblem","thumb-up"],["अन्य","otherUp","thumb-up"]],[["वह जानकारी मौजूद नहीं है जो मुझे चाहिए","missingTheInformationINeed","thumb-down"],["बहुत मुश्किल है / बहुत सारे चरण हैं","tooComplicatedTooManySteps","thumb-down"],["पुराना","outOfDate","thumb-down"],["अनुवाद से जुड़ी समस्या","translationIssue","thumb-down"],["सैंपल / कोड से जुड़ी समस्या","samplesCodeIssue","thumb-down"],["अन्य","otherDown","thumb-down"]],["आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया."],[],[],null,["# <permission\u003e\n\nsyntax:\n:\n\n ```xml\n \u003cpermission android:description=\"string resource\"\n android:icon=\"drawable resource\"\n android:label=\"string resource\"\n android:name=\"string\"\n android:permissionGroup=\"string\"\n android:protectionLevel=[\"normal\" | \"dangerous\" |\n \"signature\" | ...] /\u003e\n ```\n\ncontained in:\n: [\u003cmanifest\u003e](/guide/topics/manifest/manifest-element)\n\ndescription:\n: Declares a security permission used to\n limit access to specific components or features of this or other applications.\n For more information about how permissions work, see the [Permissions](/guide/topics/manifest/manifest-intro#perms) section in the app manifest overview and [Security tips](/guide/topics/security/security).\n\nattributes:\n:\n\n `android:description`\n\n : A user-readable description of the permission that is longer and more informative than the label. It might display, for example, to explain the permission to the user when the user is asked to grant the permission to another application.\u003cbr /\u003e\n\n\n This attribute is set as a reference to a string resource.\n Unlike the `label` attribute, it can't be a raw string.\n\n `android:icon`\n : A reference to a drawable resource for an icon that represents the\n permission.\n\n `android:label`\n\n : A user-readable name for the permission.\u003cbr /\u003e\n\n\n As a convenience, the label can be directly set\n as a raw string while you're developing the application. However,\n when the application is ready to publish, set it as a\n reference to a string resource, so that it can be localized like other\n strings in the user interface.\n\n `android:name`\n : The name to be used in\n code to refer to the permission, such as in a\n [\u003cuses-permission\u003e](/guide/topics/manifest/uses-permission-element) element or the\n `permission` attributes of application components.\n\n\n **Note:** The system doesn't let multiple packages declare\n a permission with the same name unless all the packages are signed with the\n same certificate. If a package declares a permission, the system doesn't permit\n the user to install other packages with the same permission name, unless\n those packages are signed with the same certificate as the first package.\n\n For this reason, Google recommends prefixing permissions with the app's package name,\n using reverse-domain-style naming.\n Follow this prefix with `.permission.` and then a description of the\n capability that the permission represents in upper SNAKE_CASE. For example:\n `com.example.myapp.permission.ENGAGE_HYPERSPACE`.\n\n Following this recommendation avoids naming collisions and helps clearly identify the owner\n and intention of a custom permission.\n\n `android:permissionGroup`\n : Assigns this permission to a group. The value of this attribute is\n the name of the group, which is declared with the\n [\u003cpermission-group\u003e](/guide/topics/manifest/permission-group-element) element in this\n or another application. If this attribute isn't set, the permission\n doesn't belong to a group.\n\n `android:protectionLevel`\n\n :\n Characterizes the potential risk implied in the permission and\n indicates the procedure for the system to follow when determining\n whether to grant the permission to an application requesting it.\n\n\n Each protection level consists of a base permission type and zero or more\n flags. For example, the `\"dangerous\"` protection level has no\n flags. In contrast, the protection level `\"signature|privileged\"`\n is a combination of the `\"signature\"` base permission type and the\n `\"privileged\"` flag.\n\n\n The following table shows all base permission types. For a list of flags, see\n [protectionLevel](/reference/android/R.attr#protectionLevel).\n\n | Value | Meaning |\n |-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | `\"normal\"` | The default value. A lower-risk permission that gives requesting applications access to isolated application-level features with minimal risk to other applications, the system, or the user. The system automatically grants this type of permission to a requesting application at installation, without asking for the user's explicit approval, though the user always has the option to review these permissions before installing. |\n | `\"dangerous\"` | A higher-risk permission that gives a requesting application access to private user data or control over the device that can negatively impact the user. Because this type of permission introduces potential risk, the system might not automatically grant it to the requesting application. For example, any dangerous permissions requested by an application might be displayed to the user and require confirmation before proceeding, or some other approach might be taken to avoid the user automatically granting the use of such facilities. |\n | `\"signature\"` | A permission that the system grants only if the requesting application is signed with the same certificate as the application that declared the permission. If the certificates match, the system automatically grants the permission without notifying the user or asking for the user's explicit approval. |\n | `\"knownSigner\"` | A permission that the system grants only if the requesting application is signed with [an allowed certificate](/guide/topics/permissions/defining#grant-signature-permissions). If the requester's certificate is listed, the system automatically grants the permission without notifying the user or asking for the user's explicit approval. |\n | `\"signatureOrSystem\"` | *Old synonym for `\"signature|privileged\"`. Deprecated in API level 23.* A permission that the system grants only to applications that are in a dedicated folder on the Android system image *or* that are signed with the same certificate as the application that declared the permission. Avoid using this option, as the `\"signature\"` protection level is sufficient for most needs and works regardless of where apps are installed. The `\"signatureOrSystem\"` permission is used for certain special situations where multiple vendors have applications built into a system image and need to share specific features explicitly because they are being built together. |\n\nintroduced in:\n: API level 1\n\nsee also:\n: [\u003cuses-permission\u003e](/guide/topics/manifest/uses-permission-element)\n\n [\u003cpermission-tree\u003e](/guide/topics/manifest/permission-tree-element)\n\n [\u003cpermission-group\u003e](/guide/topics/manifest/permission-group-element)"]]