1
votes

I'm working on old project of android which is in eclipse. For this i'm trying to protect the code while doing reverse engineering (I know 100% obfuscation is not possible but trying to give some protection for the source code). To do this i've implemented like this

project.properties

proguard.config=${sdk.dir}/tools/proguard/proguard-project.txt

proguard-project.txt

-dontwarn org.simpleframework.xml.stream.**
-dontwarn roboguice.**
-ignorewarnings
-dontshrink
-dontoptimize

After using this i'm exporting the signed APK file but i'm able to extract the source code from apk file by using these online tools (tool1, tool2). Can anyone give the thought to protect code by using Proguard in Eclipse

2
use allotri for code obfuscation. - Atif AbbAsi

2 Answers

1
votes

Remove the

-dontshrink
-dontoptimize

You want your code to be shrinked and optimized!

-dontwarn org.simpleframework.xml.stream.**
-dontwarn roboguice.**
-ignorewarnings

Afterwards most possibly the apk won't work on a device or emulator so you need some extra rules for it to run.

This is something that you have to figure out depending on your code and the libraries that you are using. I found this nice article about it, you can ignore what refers to android studio and just use the proguard rules at your proguard-project.txt https://guides.codepath.com/android/Configuring-ProGuard

Keep testing the release apk and googing for each library or crash your face in order to achieve maximum obfuscation in your app!

0
votes

100% obfuscation is not possible but we can give some protection as below

Eclipse

Open build.graddle

It'll be in following location in eclipse

enter image description here

And mention

buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

It will be inside of android as mentioned here

Android Studio

Open build.graddle (App level not project level)

enter image description here

Mention minifyEnabled true as said in eclipse