Today we announce that AppCAMO, an app obfuscation solution, offers compatibility with ProGuard and R8, which optimizes code and reduces app size. In the meantime, Google has recommended basic obfuscation and app optimization functions through ProGuard. Starting with Android Gradle plugin 3.4.0 and higher, ProGuard can no longer be used and it is recommended that you build your project using the R8 compiler.
Therefore, we have made it possible to apply AppCAMO not only to mobile apps that use ProGuard but also to mobile apps that use R8 compiler, allowing them to use app minification, optimization, and obfuscation.
Shrink, obfuscate, and optimize your app
To make the app as small as possible, you can remove unused code and resources with R8's shrinking, and with its obfuscation, replace class names, method names, and field names with short characters such as a, b, c, etc. You can reduce the size of the app as much as possible along with optimization that further reduces the size.
If you build your project using the Android Gradle plugin 3.4.0 or later, the plugin no longer uses ProGuard to optimize your code, but instead handles the following compilation tasks with the R8 compiler:
Code shrinking (or Tree Shaking): detects and safely remove unused classes, fields, methods, attributes, etc. from your app and its libraries. For example, if you uses only a few APIs of a library dependency, code shrinking can identify library code that your app doesn't use and remove only that code from your app.
Resource shrinking: removes unused resources from your packaged app, including unused resources from libraries. Resource shrinking can be used in conjunction with code shrinking to remove unused code and similarly safely remove resources that are no longer referenced.
Obfuscation: reduces the DEX file size by changing class names, method names, field names, etc. to letters such as a, b, c, etc.
Optimization: Inspect and rewrite your code to further reduce the size of your app DEX file. For example, if R8 detects that the else {} branch of a given if/else statement is never used, R8 will discard the else {} branch code.
When building the release version of your app, R8 can be configured to perform the compile-time tasks described above for you. You can also disable certain tasks or customize R8's behavior through ProGuard rules files. In fact, R8 works with all of your existing ProGuard rules files, so updating the Android Gradle plugin to use R8 should not require you to change your existing rules.
Enable R8
If you use Android Studio 3.4 or Android Gradle plugin 3.4.0 or higher, R8 is the default compiler that converts your project's Java bytecode to DEX format that runs on the Android platform. However, when you create a new project using Android Studio, R8's code/library shrinking, obfuscation, and optimization features are not enabled by default. Therefore, it is best to turn on these R8 features when building the final version of your app before deployment.
To use R8 features, include the settings below in your build.gradle file.
Fig.1 Groovy
Fig. 2 Kotlin
To summarize, it is as follows.
If minifyEnabled is True, unused code is removed, and optimization and obfuscation functions are performed.
If ShrinkingResources is True, unused libraries are removed.
ProguardFiles sets rules to exclude class names, method names, field names, etc. from obfuscation.
For more details, please refer to the URL below.
https://developer.android.com/studio/build/shrink-code
AppCAMO, an app obfuscation and anti-tampering solution, was developed to be compatible with these R8 features, so you can still use R8's unused code/library shrinking, optimization, and obfuscation features.
By using AppCAMO's diverse and powerful app security technologies(Code Hardening & RASP) together with R8's useful features, you can not only optimize code and reduce app size, but also enable strong app security.
"App security solution AppCAMO provides multi-layered protection technology that strongly blocks app hacking, and has world-class app security technology by providing app hacking detection and prevention technology even at runtime. We are expanding our sales not only in Korea, but also in overseas markets such as Southeast Asia and the United States."
If you are interested in this solution or have any questions, please feel free to contact us below.
Email : appcamo@appcamo.com
Phone : +82-2-6951-3296
www.appcamo.com

No comments:
Post a Comment