0

I want to make a file device dependent, such that it works only on the device it's directly downloaded unto but becomes corrupt and rendered useless if same file is copied to another phone or device. Is this possible?

Dave
  • 17
  • 2

1 Answers1

1

For files like (photos, videos, documents .. etc) it is not possible,,

But it can be applied for applications,, the app can get devices IMEI number, which is a unique and unchangeable number for each device then store in a strings, each time the app is run, it matches the stored IMEI withe devices IMEI..

This method can be used to get devices IMEI in Android

public String getIMEI(Context context){
 TelephonyManager mngr = (TelephonyManager) context.getSystemService(context.TELEPHONY_SERVICE); 
String imei = mngr.getDeviceId(); 
return imei; 
}
Kurdish Programmer
  • 403
  • 1
  • 4
  • 14
  • 1
    What about devices without a SIM card slot? They don't have an IMEI, so this method will not work! If you don't care about tablets or other devices without a SIM card slot and you want to implement this method, don't forget to add the `android.permission.READ_PHONE_STATE` permission to the manifest – Chris Mar 26 '16 at 23:01
  • Yes, you are right, this is for sim holder devices,, – Kurdish Programmer Mar 26 '16 at 23:06
  • But this technique can be used for other non-sim devices http://stackoverflow.com/a/2785493/2202452 – Kurdish Programmer Mar 26 '16 at 23:07
  • What if each download request is unique and a key-pair is embedded in each downloaded file, such that a key is kept on the device and one in the file? This means when the file is copied to another device the file would not work cos the device-key is missing. How plausible is that scenario? – Dave Mar 26 '16 at 23:13
  • By file, do you mean applications or other files like images videos .. etc? – Kurdish Programmer Mar 26 '16 at 23:36
  • Files like images, audio and video. – Dave Mar 28 '16 at 12:27