Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent the easy extraction of APK app installed on the phone

Is very easy extract the apk app from the phone through application managers (like Astro).

Google had a base protection that has been abandoned in favor of the more effective license managing, however the old protection made more complicate the indiscriminate share of the apk outside the Google Play market.

The LVL has an opensource library, but I haven't find anything about the implementation of the GooglePlay base anti-apk-copy protection.

Would be useful a similar solution in addition to the license managing protection.

I have seen that some apps still prevent the apk copy in the same way of the old Google Play protection.

Is there somebody that know how the anti-apk-copy works, or if there is a similar open source protection library?

Somebody have asked what should be the reason for this kind of operation.

The reasons are many:

-Avoid the indiscriminate diffusion of APK through unauthorized channels

-Avoid that the first noob simply opening your APK with winzip could extract all resources (as PNG images, buttons, textures, DB etc.) for his use easily

-Improve the general security

PS

I know that for every protection there is always a workaround to break it, however this doesn't mean that leave very easy ways to abuse of your work is always the best choice.

like image 564
Silverstorm Avatar asked Dec 17 '12 03:12

Silverstorm


1 Answers

I think it's difficult to prevent someone from copying files out of the device. But why do you want to achieve this? If you are only for secure reasons, there are some other methods.

Basicly you can take proguard to obscure the code. If this is not enough, I know in java, there is a mechanism that could encrypt .jar files and use custom ClassLoader to decrypt the file and load class.

This could also be used in android.

  1. Use c and jni to provide encrypt/decrypt apis. (decompiling .so files is more complicated.)
  2. Package the core to a jar file. Encrypt the jar and put it in the assets/.
  3. Use a new DexClassLoader to replace the default one. Try to decrypt the .jar file and load class.
like image 175
faylon Avatar answered Nov 08 '22 08:11

faylon