For our android mobile app , we have to choose an obfuscation tool so that our app will pass penetration test cases. Is Proguard enough for the same or we should use Dexguard?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
ProGuard is a generic optimizer for Java bytecode. DexGuard is a specialized tool for the protection of Android applications.
ProGuard offers basic protection against static analysis. DexGuard protects applications against static and dynamic analysis.
ProGuard provides minimal obfuscation. DexGuard applies multiple layers of encryption and obfuscation.
ProGuard focuses on the bytecode. DexGuard processes all the components of an application.
Source: DexGuard vs. ProGuard
Obfuscation is NOT enough to pass a penetration test
A proper penetration test will analyze both static and runtime behavior of your app, so the runtime behavior will not be covered at all only through obfuscation
But also considering exclusively the static analysis that you will undergo you are far from being secure
I'll make you a practical easy example because the differences between the two tools you suggested are already reported in another answer
Say that you have an original unobfuscated
MainActivity
given by:where:
These are the coounterparts obfuscated by ProGuard and taken through an online Java decompiler
Conclusions:
1) as you can see - despite the proguard obfuscation - you are in a position where an attacker can easily modify the code flow [e.g. turning
if (!this.f2293p)
intoif (this.f2293p)
] and easily understand what you have to do to modify a value in your app, despite obfuscation. In this case it was a simple stupid "isAppInstalled" preference but of course it could have been something more sensitive like:PS storing unencrypted Shared Preferences [especially if containing sensitive data] is a very bad practice, this is just a quick example for demonstrational purposes. In rooted devices retrieving this file is just equal to browse to a system folder and search for an xml file
2) moreover in general this pure obfuscation will not hide anything which is hardcoded. We already saw that:
was transformed in:
Another simple example can be:
becoming after obfuscation:
Such strings are cheeky hints for people whose purpose is breaking your purely obfuscated app. For example your endpoints strings would be available to anyone
So you need a tool like DexGuard or other commercial solutions able to produce something more complex than simple obfuscation
This is an example of the final result from ProGuard + third-party security tool [I do not have DexGuard, I use another one where protection is automatically applied through a drag'n'drop of the original unprotected apk]
This is the new
onCreate()
method:while this is the second example with hardcoded strings that have been totally hidden from the hacker view:
This is the degree of protection you need to pass the penetration test
Finally - as an additional safety measure - this kind of professional tools may also able to detect modifications in the protected "unreadable" code and stop the app execution if a tampering action on the protected version is detected. And also, unlike the simple [but beautiful] ProGuard, implement the detection for emulators, rooted devices and other potentially dangerous scenarios
Please note how the code was hardened through these steps. No one is 100% safe from being hacked. Your job is only making it as difficult as possible, that's it