Answer the question
In order to leave comments, you need to log in
What should be the proguard-rules file with the following project structure?
Good day!
I have the following structure in com.user.main:
public abstract class BaseActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {
}
public class MainActivity/SecondActivity extends BaseActivity {
}
public class MainFragment/SecondFragment extends Fragment {
}
public class MainRecyclerAdapter extends RecyclerView.Adapter<MainRecyclerAdapter.ViewHolder> {
public static class ViewHolder extends RecyclerView.ViewHolder{
}
}
public class Items{}
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
repositories {
mavenCentral()
}
defaultConfig {
applicationId "com.user.main"
minSdkVersion 16
targetSdkVersion 23
versionCode 13
versionName "1.2.7"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
Answer the question
In order to leave comments, you need to log in
You don't need to write anything extra. After the .apk build , the code will be automatically obfuscated. "proguard-rules.pro" , needed to prevent ProGuard from breaking some things that might throw a ClassNotFoundException . Example: -keep public class , or -dontwarn com.example.something if ProGuard is on something swears.
You can also specify obfuscation parameters in this file, but they are not required.
names were not obfuscated because they are specified in the manifest . So, you got it right.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question