Hi,
Kindly provide me the steps to obfuscate an Android application from Eclipse IDE. Is Proguard jar best for this obfuscation purpose or do we have better obfuscator?
Warm Regards,
CB
Hi,
Kindly provide me the steps to obfuscate an Android application from Eclipse IDE. Is Proguard jar best for this obfuscation purpose or do we have better obfuscator?
Warm Regards,
CB
As the code is compiled into bytecode, you don't need to obfuscate the code itself. Your obfuscated code can be also decompiled like any other code and the result will be nearly exactly the same: obfuscated...
[update] APK file before test: 254264 Bytes
Test 1:
I have made a short test by adding 5000 LOC with this:
int myVarhkjdsfhgcsdfjhgcnsdfhgcsnfdhgcnsdfiughcndsfgcnfdsghcnfdsghcsdfhcndsfkgchsd = 1;
myVarhkjdsfhgcsdfjhgcnsdfhgcsnfdhgcnsdfiughcndsfgcnfdsghcnfdsghcsdfhcndsfkgchsd++;
// up to 5000LOC
APK file size: 254571 (307 Bytes more than the basic apk)
Test 2:
Removed the spaces done for codeformating (8 spaces a line)
APK file size: 254571 (no changes to test 1)
Test 3:
Renamed the var into a shorter one
int test = 1;
test++;
// up to 5000LOC
APK file size: 254512 (248 Bytes more)
Testresult:
Byte code is a highly optimized code, I doubt you really need to obfuscate your code to improve the file size. The best way to do that is to write negative code (search on SO if you don't know what it is)
Just in the last couple days, they've given instructions on how to do this in the Android Developers Blog: http://android-developers.blogspot.com/2010/09/proguard-android-and-licensing-server.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+blogspot%2FhsDu+%28Android+Developers+Blog%29