-1

I would like to know how it is possible to protect an Android application from illegal copies not going through the Android market.

I know I can protect the code against reverse-engineering using ProGuard.

I am wondering if there is a good solution to avoid anyone to copy the apk file to another device and install the app. Since I will have full control of all the devices where the application will be installed (it is a company internal app), would it be possible to link the app to the device serial number? In that case the app will run only on those devices which serial number is in a list of allowed ones.

I am not looking for hyper security, I just want to keep the casual pirate away. I understand a professional hacker would hack it anyway if he wanted to.

Any suggestion??

Many Thanks

Paranoid Android
  • 4,672
  • 11
  • 54
  • 73

1 Answers1

1

You could use a whitelist of IMEI numbers and quit the application with an error if the number is not in the list.

It is possible to access the IMEI through TelephonyManager. You need the READ_PHONE_STATE permission for that.

Please also have a look at How to programmatically get the devices IMEI/ESN in Android

Community
  • 1
  • 1
  • Forgot to mention I am developing on a tablet device! I do not have any IMEI – Paranoid Android Sep 13 '12 at 16:03
  • Serial Number: Since Android 2.3 (“Gingerbread”) this is available via android.os.Build.SERIAL. Devices without telephony are required to report a unique device ID here; some phones may do so also. – Paranoid Android Sep 13 '12 at 16:11