تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
على الأجهزة التي تعمل بالإصدار 10 من نظام التشغيل Android (المستوى 29 لواجهة برمجة التطبيقات) والإصدارات الأحدث، يمكنك إخبار النظام الأساسي بتشغيل رمز DEX المضمّن مباشرةً من ملف APK الخاص بتطبيقك. يمكن أن يساعد هذا الخيار في منع حدوث هجوم إذا تمكّن أحد المهاجمين من التلاعب بالرمز البرمجي الذي تم تجميعه محليًا على الجهاز.
إذا كنت تستخدم نظام الإصدار Gradle، اتّبِع الخطوات التالية لتفعيل هذه الميزة:
اضبط السمة android::useEmbeddedDex على
true في العنصر
<application>
في ملف بيان تطبيقك.
اضبط قيمة useLegacyPackaging على false في ملف build.gradle.kts على مستوى الوحدة (ملف build.gradle إذا كنت تستخدم Groovy).
Kotlin
packagingOptions{dex{useLegacyPackaging=false}}
Groovy
packagingOptions{dex{useLegacyPackagingfalse}}
إذا كنت تستخدم نظام الإنشاء Bazel، لتفعيل هذه الميزة، اضبط السمة android:useEmbeddedDex على true في العنصر <application> من ملف بيان تطبيقك، واترك ملفات DEX غير مضغوطة:
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-08-27 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-08-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["On devices running Android 10 (API level 29) and higher you can tell the platform to run\nembedded DEX code directly from your app's APK file. This option can help\nprevent an attack if an attacker ever managed to tamper with the locally\ncompiled code on the device.\n| **Note:** Enabling this feature could possibly affect your app's performance because ART must use the [JIT compiler](https://source.android.com/devices/tech/dalvik/jit-compiler) when the app is started (instead of reading native code that was compiled ahead of time). We recommend testing your app's performance before you decide whether or not to enable this feature in your published apps.\n\nIf you're using the Gradle build system, to enable this feature do the\nfollowing:\n\n- Set the `android::useEmbeddedDex` attribute to\n `true` in the\n [\u003capplication\u003e](/guide/topics/manifest/application-element)\n element of your app's manifest file.\n\n- Set `useLegacyPackaging` to `false` in the\n module-level `build.gradle.kts` file (`build.gradle`\n file if you're using Groovy).\n\n **Note:** Don't set the `useLegacyPackaging` option if you're using a version of AGP lower than 4.2. \n\n Kotlin \n\n ```kotlin\n packagingOptions {\n dex {\n useLegacyPackaging = false\n }\n }\n \n ```\n\n Groovy \n\n ```groovy\n packagingOptions {\n dex {\n useLegacyPackaging false\n }\n }\n \n ```\n\nIf you're using the Bazel build system, to enable this feature set the\n`android:useEmbeddedDex` attribute to `true` in the `\u003capplication\u003e` element of\nyour app's manifest file and leave DEX files uncompressed: \n\n```\nandroid_binary(\n ...\n nocompress_extensions = [\".dex\"],\n)\n```\n\nRecommended for you\n\n- Note: link text is displayed when JavaScript is off\n- [Tapjacking](/topic/security/risks/tapjacking)\n- [android:exported](/topic/security/risks/android-exported)\n- [# Key management {:#key-management}](/topic/security/data)"]]