[[["わかりやすい","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"]],["最終更新日 2024-02-23 UTC。"],[],[],null,["# Run embedded DEX code directly from APK\n\nOn 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\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)"]]