-3

I need to remove some particular packages classes from release apk. I am looking for some kind of option of proguard or gradle which can help. these classes are part of my project (code does not compile without it) but I want to remove these classes from apk. Actually I need two build flavours one is with removed packages, in that i will handle class not found exception in code.

Phani
  • 1
  • 2

1 Answers1

0

Ideally if your code will not compile without a class you should not be removing it.

In a traditional way clear all dependencies on the classes you want to remove and then remove them from your code and rebuild your application.

If at all you want to remove anything from your apk, you will have to go reverse engineering route.

Rahul Tiwari
  • 6,851
  • 3
  • 49
  • 78
  • Actually I need two build flavours one is with removed packages, in that i will handle class not found exception in code. – Phani Sep 24 '15 at 12:35
  • what you are trying to achieve can be better managed using a version control system like `git` or `svn`. All you need to do is manage different branches for different flavours. alternatively instead of planning to handle class not found exception you can plan to have a constant flag to turn on-off any functionality at build time. – Rahul Tiwari Sep 24 '15 at 14:13
  • Thanks for reply ,In one of my build flavour i need not use login stuff so i want to remove those packages from apk in this way i able to reduce the apk size. – Phani Sep 25 '15 at 06:42
  • @Phani then your best bet will be to go with version control. you have to create branches for various flavours. – Rahul Tiwari Sep 25 '15 at 06:55