diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1282b32 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +obj + diff --git a/README.md b/README.md index 1431d3a..1b14a1e 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ device - sd card block device e.g. /dev/block/mmcblk1 cid - new cid, must be in hex (without 0x prefix) it can be 32 chars with checksum or 30 chars without, it will be updated with new serial number if supplied, the checksum is - always recalculated + (re)calculated if not supplied or new serial applied serial - optional, can be hex (0x prefixed) or decimal and will be applied to the supplied cid before writing ``` diff --git a/jni/evoplus_cid.c b/jni/evoplus_cid.c index 925f51c..c7a3935 100644 --- a/jni/evoplus_cid.c +++ b/jni/evoplus_cid.c @@ -124,7 +124,7 @@ void main(int argc, const char **argv) { printf("cid - new cid, must be in hex (without 0x prefix)\n"); printf(" it can be 32 chars with checksum or 30 chars without, it will\n"); printf(" be updated with new serial number if supplied, the checksum is\n"); - printf(" always recalculated\n"); + printf(" (re)calculated if not supplied or new serial applied\n"); printf("serial - optional, can be hex (0x prefixed) or decimal\n"); printf(" and will be applied to the supplied cid before writing\n"); printf("\n"); @@ -152,13 +152,15 @@ void main(int argc, const char **argv) { *((int*)&cid[9]) = htonl(parse_serial(argv[3])); } - // calculate checksum - cid[15] = crc7(cid, 15); + // calculate checksum if required + if (len != 32 || argc == 4) { + cid[15] = crc7(cid, 15); + } // open device fd = open(argv[1], O_RDWR); if(fd < 0){ - printf("[-] wtf\n"); + printf("Unable to open device %s\n", argv[1]); return; } diff --git a/libs/.gitignore b/libs/.gitignore new file mode 100644 index 0000000..bbbcd59 --- /dev/null +++ b/libs/.gitignore @@ -0,0 +1,4 @@ +* +!.gitignore +!armeabi + diff --git a/libs/armeabi/evoplus_cid b/libs/armeabi/evoplus_cid old mode 100644 new mode 100755 index f790895..f01df77 Binary files a/libs/armeabi/evoplus_cid and b/libs/armeabi/evoplus_cid differ