android:exported
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
دسته OWASP: MASVS-PLATFORM: پلتفرم تعامل
نمای کلی
ویژگی android:exported
تعیین میکند که آیا یک مؤلفه (فعالیت، سرویس، گیرنده پخش و غیره) میتواند توسط مؤلفههای سایر برنامهها راهاندازی شود یا خیر:
- اگر
true
، هر برنامه ای می تواند به فعالیت دسترسی داشته باشد و آن را با نام دقیق کلاس خود راه اندازی کند. - اگر
false
باشد، فقط مؤلفههای همان برنامه، برنامههایی با شناسه کاربری یکسان یا مؤلفههای سیستم دارای امتیاز میتوانند فعالیت را راهاندازی کنند.
منطق پشت مقدار پیشفرض این ویژگی در طول زمان تغییر کرد و بسته به انواع مؤلفه و نسخههای اندروید متفاوت بود. به عنوان مثال، در سطح API 16 (Android 4.1.1) یا مقدار کمتر برای عناصر <provider>
به طور پیش فرض روی true
تنظیم شده است. تنظیم نکردن این ویژگی به طور صریح خطر وجود مقادیر پیشفرض متفاوت بین برخی دستگاهها را به همراه دارد.
تاثیر
وضعیت با مقادیر مختلف پیشفرض به این معنی است که میتوانید به طور تصادفی اجزای برنامه داخلی را در معرض دید قرار دهید. چند نمونه از پیامدها می تواند به شرح زیر باشد:
حملات انکار سرویس دسترسی نامناسب سایر برنامه ها به اجزای داخلی برای تغییر عملکرد داخلی برنامه شما. نشت داده های حساس اجرای کد در زمینه برنامه آسیب پذیر.
اقدامات کاهشی
همیشه مشخصه android:exported
به صراحت تنظیم کنید. این هیچ جایی برای تفسیر باقی نمی گذارد و به وضوح قصد شما را در مورد دید یک جزء نشان می دهد.
{% کلمه به کلمه %}
{% آخر کلمه %} برای شما توصیه می شود
{% کلمه به کلمه %} {% آخر کلمه %}
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# android:exported\n\n\u003cbr /\u003e\n\n**OWASP category:** [MASVS-PLATFORM: Platform Interaction](https://mas.owasp.org/MASVS/09-MASVS-PLATFORM)\n\nOverview\n--------\n\nThe `android:exported` [attribute](/guide/topics/manifest/activity-element#exported) sets whether a component (activity, service, broadcast receiver, etc.) can be launched by components of other applications:\n\n- If `true`, any app can access the activity and launch it by its exact class name.\n- If `false`, only components of the same application, applications with the same user ID, or privileged system components can launch the activity.\n\nThe logic behind the default value of this attribute changed over time and was different depending on the component types and Android versions. For example, on API level 16 (Android 4.1.1) or lower the value for `\u003cprovider\u003e` elements is set to `true` by default. Not setting this attribute explicitly carries the risk of having different default values between some devices.\n\nImpact\n------\n\nThe situation with different default values means you could accidentally expose internal application components. A few examples of the consequences could be the following:\n\nDenial of service attacks.\nOther apps inappropriately accessing internal components to modify your app's internal functionality.\nLeaking of sensitive data.\nCode execution in the context of the vulnerable application.\n\nMitigations\n-----------\n\nAlways explicitly set the `android:exported` attribute. This will leave no room for interpretation and clearly signal your intention with regard to a component's visibility.\n\nRecommended for you\n-------------------\n\n- Note: link text is displayed when JavaScript is off\n- [# Key management {:#key-management}](/topic/security/data)\n- [Run embedded DEX code directly from APK](/topic/security/dex)\n- [Tapjacking](/topic/security/risks/tapjacking)"]]