Return to site

Change sd card serial number

broken image
broken image

I tested this by running a test app on a new Alcatel A30 GSM (Android 7.0), and in fact the above approach fails with a permission error: java.io.FileNotFoundException: /sys/block/mmcblk0/device/serial (Permission denied)Īt java.io.FileInputStream.open(Native Method)įor future reference, we (testing from an adb shell) have permissions to ls -ld the following:

broken image
broken image

In my testing this has worked pretty reliably, as long as the SD card is inserted in a built-in SD card slot (not mounted via USB adapter).īut as of Android 7.0 Nougat, the OS is said to be blocking access to this information, at least on some devices. by reading the contents of /sys/class/mmc_host/mmc0/mmc0:0001/serial or /sys/block/mmcblk0/device/serial (specific numbers may vary). In some versions of Android, and other variants of Linux, it's possible to get the serial number of a mounted SD card, e.g.