Proguard Flashcards
How Proguard works?
Proguard is a way to obfuscate the code to make it difficult to reverse engineer the code and also reduce the APK size via tree shrinking.
Obfuscating the code is a process to modify the code in a way that it’s no longer useful to the hacker. Proguard modifies the code with short names like with alphabets. If you try to decode the APK you would understand it. By using short names instead of full-length class and variable names it’ll reduce the APK size and obfuscate the code simultaneously.
What is the mapping file with regard to proguard?
Obfuscating the code is a great way to secure the code. We know that obfuscation means modifying the code, this will make it difficult for developers to decode the crash reports. Fortunately, R8 creates a mapping.txt file each time it runs, which contains the obfuscated class, method, and field names mapped to the original names.
We need to upload this mapping file to the play console or any analytics tool that you use like Sentry to understand the crash or analytics report.
Differences between proguard and dexguard?
- ProGuard is a generic optimizer for Java bytecode, whereas DexGuard is a specialized tool for the protection of Android applications.
- ProGuard provides minimal obfuscation, whereas DexGuard applies multiple layers of encryption and obfuscation.
- ProGuard is an open-source tool, whereas DexGuard is a commercial, enterprise-grade product.