* 출처
: https://android-developers.googleblog.com/2018/11/r8-new-code-shrinker-from-google-is.html
: https://www.slideshare.net/NaverEngineering/16obfuscation-101-r8-api
Obfuscation 101 난독화, 프로가드, R8, 트랜스포머 API-kimyonguk3-181101045441_compressed.pdf
R8, the new code shrinker from Google, is available in Android studio 3.3 beta
Posted by Leo Sei, Product Manager on Android Studio and R8
Android developers know that APK size is an important factor in user engagement. Code shrinking helps reduce the size of your APK by getting rid of unused code and resources as well as making your actual code take less space (also known as minification or obfuscation).
That's why we're investing in improving code shrinking to make it faster and more efficient. We're excited to announce that the next generation code shrinker, R8, is available for preview as part of Android Studio 3.3 beta.
R8 does all of shrinking, desugaring and dexing in one step. When comparing to the current code shrinking solution, Proguard, R8 shrinks the code faster while improving the output size.
The following data comes from benchmark on the Santa Tracker app, you can find the project with benchmark details on this GitHub repository.
How to try it
R8 is available with Android Studio 3.3 beta and works with Proguard rules. To try it, set the following in your project's gradle.properties file:
android.enableR8=true
For the more adventurous, R8 also has full mode that is not directly compatible with Proguard. In order to try that out you can additionally set the following in your gradle.properties file:
android.enableR8.fullMode=true
This turns on more optimizations, that can further reduce app size. However, you might need a few extra keep rules to make it work.
We have tested R8 correctness and performances on a number of apps and the results are promising so we plan to switch R8 as the default shrinker in Android studio soon.
Please give R8 a try and we would love to hear your feedback. You can file a bug report using this link.
'IT_Programming > Dev Tools' 카테고리의 다른 글
[펌][Android Studio] The version of Gradle you are using (3.3) does not support the forTasks() method on BuildActionExecuter. (0) | 2017.12.26 |
---|---|
[펌] Android Weekly #281 : Migrate to Android Plugin for Gradle 3.0.0 (0) | 2017.12.11 |
[펌] 쉘 스크립트를 만드는 당신, ShellCheck을 써라! (0) | 2017.05.19 |
[Android Studio] 이클립스에서의 Formatter -> Android Studio 적용하기 (0) | 2016.09.09 |
Android Gradle Build Setting 정리 (0) | 2016.08.12 |