이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2023-12-08(UTC)
[null,null,["최종 업데이트: 2023-12-08(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)"]]