1

there. Like more peoples, I need to customize my android app behaviour using "something" external like plugin. My idea is to download some APK file (not jar) and dinamically load a class from it to do some operation. I'm searching over the web but never found useful information about:

1) convert an APK without activities that exposes my required classes in something "agregate" useful for dexclassloader

2) how load and invoke it at runtime from my app

3) acquire know how about dexclassloader trouble related to different android versions. Note that I'm working with jeallybean and nougat too.

I found some (incomplete) post that not include all informations needed, post related to JAR insthead APK like this:

http://www.marioalmeida.eu/2015/01/27/how-to-easy-way-load-apk-classes-using-dexclassloader/

Note that I need APK insthad JAR about using Sqlite database on devices and other things like NFC.

But, I hope in my open mind. So, if some people has alternative ideas, I 'll evalutate.

TIA.

CN

cray 9000
  • 11
  • 1
  • 1
  • Bear in mind that what you describe violates [the Play Store's distribution rules](https://play.google.com/about/privacy-security-deception/malicious-behavior/), because it is difficult to secure. – CommonsWare Jan 09 '18 at 13:38
  • Hi. Thanks for your answer. I've a STRONG NDA, so I can't explain all, but my company doesnt use playstore about this specific app. – cray 9000 Jan 09 '18 at 13:40
  • That does not change the security issues. Also note that DEX content loaded dynamically cannot request new permissions or create new manifest-registered components (activities, services, etc.). So, for example, you would have to request the NFC permissions in the main app. – CommonsWare Jan 09 '18 at 13:49
  • I agree with you about security issue and, my company has not trouble about publishing dex on playstore Also, note that this app has as a default permission about NFC and other services. – cray 9000 Jan 09 '18 at 14:17
  • The answer to "1)" is that there is nothing that you need to do. The answer to "2)" is shown in the blog post that you link to, where it demonstrates how to use `DexClassLoader` with an APK. The answer to "3)" is `¯\_(ツ)_/¯`, as you have not demonstrated any such problem. – CommonsWare Jan 09 '18 at 14:22

0 Answers0