3

I am trying to re-build an unpacked apk, because it was unpacked the required libraries are already included, deleting the prepacked libraries would be feasible if it weren't for the fact that some of the dependencies seem to be missing when I build with them deleted. I could individually sort through and pick out only the ones that aren't added on build and delete the rest, but it seems like it would be easier to exclude the android support libraries from being included at all. Can/how can this be done in Android Studio/with Gradle?

Aidan
  • 413
  • 3
  • 22

1 Answers1

0

If it is possible it is probably not documented because it goes against usual ownership securities. If this APK is yours, you can do this operation from the sources. If it is not, you should not be doing this operation.

However, you can exclude the desired libraries from the rebuild by avoiding to depend on them, or by excluding them explicitly, like here.

configurations {
  runtime.exclude group: "...", module: "..."
  ...
}
Victor Paléologue
  • 2,025
  • 1
  • 17
  • 27
  • Can I ask why I should not be doing it if it is not mine? – Aidan Dec 18 '21 at 10:13
  • Usually it is because the APK is provided with a proprietary license that forbids you to produce derived works using the contents of the software. It all depends on the license of the app. – Victor Paléologue Dec 19 '21 at 11:04
  • No, generally it prohibits the redistribution of the app and distribution of derivative works. Writing in a book is distinct from republishing a book you annotated. – Aidan Dec 23 '21 at 17:18
  • And, what would I exclude, to exclude all android support libraries? – Aidan Dec 23 '21 at 17:33
  • The list is pretty long, and I do not know them like that. In your place I would find them by trial and error... It is long but you only have to do it once. – Victor Paléologue Jan 15 '22 at 07:43
  • Oh I see, so there is no way to exclude all support libraries? – Aidan Jan 17 '22 at 07:57
  • You could try with `exclude group: "com.android.support"`, but it is possible that it excludes too much. – Victor Paléologue Jan 17 '22 at 16:53