• 廣東明創(chuàng)智慧科技有限公司是中國(guó)專(zhuān)業(yè)的身份證閱讀器供應(yīng)商
  • 專(zhuān)注身份證閱讀器
    、指紋采集儀、社?div id="m50uktp" class="box-center"> ?ㄗx卡器、IC卡讀寫(xiě)器的一家身份證應(yīng)用服務(wù)平臺(tái)

明創(chuàng)智慧

,啟用訪客管理系統(tǒng)" class="navAtwo"> 廣州富力中心“煥彩”行動(dòng),啟用訪客管理系統(tǒng) 明創(chuàng)訪客系統(tǒng)成功入駐廣州中鐵諾德中心
,為部隊(duì)更安全的出入管理" class="navAtwo"> 明創(chuàng)訪客系統(tǒng)走進(jìn)軍區(qū),為部隊(duì)更安全的出入管理 長(zhǎng)江存儲(chǔ)科技上線明創(chuàng)自助立式訪客機(jī) 廣州市第二中學(xué)攜手明創(chuàng)訪客機(jī)守護(hù)校 廣州南武中學(xué)啟用明創(chuàng)訪客系統(tǒng) 廊坊市鑫達(dá)順石油化工有限公司啟用明創(chuàng)測(cè)溫訪客機(jī)
  • 行業(yè)分類(lèi)

    公安 人社 醫(yī)療衛(wèi)生 公檢法司 企業(yè)工廠 金融銀行 電信 軌道交通 教育 建筑 民航 物流快遞
  • 服務(wù)中心
  • 新聞資訊
  • 走進(jìn)明創(chuàng)
  • 當(dāng)前位置: 首頁(yè) > 服務(wù)支持專(zhuān)區(qū) > SDK開(kāi)發(fā)包 > 正文

    明創(chuàng)IDR-100YB云解碼藍(lán)牙身份證閱讀器Android開(kāi)發(fā)包

    來(lái)源:www.mingcreate.cn   標(biāo)簽:云解碼 藍(lán)牙 IDR-100YB DK309   最近更新:2022-2-19

    111.jpg

    本開(kāi)發(fā)包支持明創(chuàng)云解碼藍(lán)牙身份證閱讀器

    ,支持型號(hào)IDR-100YB、DK309系列云解碼讀卡器

    點(diǎn)擊這里下載↓



    public class IDCardData {

        public final static int ID_TYPE_CN = 1;       //身份證類(lèi)型-居民身份證

        public final static int ID_TYPE_GAT = 2;      //身份證類(lèi)型-港澳臺(tái)居民身份證

        public final static int ID_TYPE_FOREIGN = 3;  //身份證類(lèi)型-外國(guó)人永久居留身份證


        public String Name = null;                   // 姓名

        public String Sex = null;                    //性別

        public String Nation = null;                 //名族

        public String Born = null;                   //出生

        public String Address = null;                //住址

        public String IDCardNo = null;               //身份證號(hào)

        public String GrantDept = null;              //簽發(fā)機(jī)關(guān)

        public String UserLifeBegin = null;          //有效期起始日期

        public String UserLifeEnd = null;            //有效期結(jié)束日期

        public String passport = null;               //通行證號(hào)碼

        public String issueNumber = null;            //簽發(fā)次數(shù)


        public Bitmap PhotoBmp = null;

        public byte[] fingerprintBytes = null;       //指紋數(shù)據(jù)

        public int type = 0;


        public IDCardData(byte[] idCardBytes){


            if (idCardBytes.length < 1295) {

                return;

            }


            if ( (idCardBytes[0] == (byte)0xaa)

                    && (idCardBytes[1] == (byte)0xaa)

                    && (idCardBytes[2] == (byte)0xaa)

                    && (idCardBytes[3] == (byte)0x96)

                    && (idCardBytes[4] == (byte)0x69)) {


                //int totalLen = ((idCardBytes[5] & 0xff) << 8) | (idCardBytes[6] & 0xff);

                int wordMsgBytesLen = ((idCardBytes[10] & 0xff) << 8) | (idCardBytes[11] & 0xff);

                int photoMsgBytesLen = ((idCardBytes[12] & 0xff) << 8) | (idCardBytes[13] & 0xff);


                byte[] wordMsgBytes = new byte[wordMsgBytesLen];

                byte[] photoMsgBytes = new byte[photoMsgBytesLen];


                if (idCardBytes.length == 1295) {   //不帶指紋

                    System.arraycopy(idCardBytes, 14, wordMsgBytes, 0, wordMsgBytesLen);

                    System.arraycopy(idCardBytes, 14 + wordMsgBytesLen, photoMsgBytes, 0, photoMsgBytesLen);

                }

                else {   //帶指紋

                    int fingerprintBytesLen = ((idCardBytes[14] & 0xff) << 8) | (idCardBytes[15] & 0xff);   //指紋長(zhǎng)度

                    fingerprintBytes = new byte[fingerprintBytesLen];

                    System.arraycopy(idCardBytes, 16, wordMsgBytes, 0, wordMsgBytesLen);

                    System.arraycopy(idCardBytes, 16 + wordMsgBytesLen, photoMsgBytes, 0, photoMsgBytesLen);

                    System.arraycopy(idCardBytes, 16 + wordMsgBytesLen + photoMsgBytesLen, fingerprintBytes, 0, fingerprintBytesLen);

                }


                //判斷身份證的類(lèi)型是否為港澳臺(tái)身份證

                if (wordMsgBytes[248] == 'J') {

                    type = ID_TYPE_GAT;

                }

                else if (wordMsgBytes[248] == 'I') {

                    type = ID_TYPE_FOREIGN;

                }

                else {

                    type = ID_TYPE_CN;

                }


                byte[] bytes;

                String str;

                int index = 0;


                //姓名

                bytes = new byte[30];

                System.arraycopy(wordMsgBytes, index, bytes, 0, bytes.length);

                index += bytes.length;

                try {

                    Name = new String(bytes, "UTF_16LE");

                } catch (UnsupportedEncodingException e) {

                    e.printStackTrace();

                }


                //性別

                if (wordMsgBytes[30] == 0x31) {

                    Sex = "男";

                }

                else {

                    Sex = "女";

                }

                index += 2;


                //名族

                if (type == ID_TYPE_CN) {

                    bytes = new byte[4];

                    System.arraycopy(wordMsgBytes, index, bytes, 0, bytes.length);

                    try {

                        str = new String(bytes, "UTF_16LE");

                        if (str.length() == 2) {

                            int nationCode = Integer.valueOf(str, 10);

                            Nation = getNation(nationCode);

                        }

                    } catch (Exception e) {

                        e.printStackTrace();

                    }

                }

                index += 4;


                //出生

                bytes = new byte[16];

                System.arraycopy(wordMsgBytes, index, bytes, 0, bytes.length);

                index += bytes.length;

                try {

                    Born = new String(bytes, "UTF_16LE");

                } catch (UnsupportedEncodingException e) {

                    e.printStackTrace();

                }


                //住址

                bytes = new byte[70];

                System.arraycopy(wordMsgBytes, index, bytes, 0, bytes.length);

                index += bytes.length;

                try {

                    Address = new String(bytes, "UTF_16LE");

                } catch (UnsupportedEncodingException e) {

                    e.printStackTrace();

                }


                //身份證號(hào)

                bytes = new byte[36];

                System.arraycopy(wordMsgBytes, index, bytes, 0, bytes.length);

                index += bytes.length;

                try {

                    IDCardNo = new String(bytes, "UTF_16LE");

                } catch (UnsupportedEncodingException e) {

                    e.printStackTrace();

                }


                //簽發(fā)機(jī)關(guān)

                bytes = new byte[30];

                System.arraycopy(wordMsgBytes, index, bytes, 0, bytes.length);

                index += bytes.length;

                try {

                    GrantDept = new String(bytes, "UTF_16LE");

                } catch (UnsupportedEncodingException e) {

                    e.printStackTrace();

                }


                //有效起始日期

                bytes = new byte[16];

                System.arraycopy(wordMsgBytes, index, bytes, 0, bytes.length);

                index += bytes.length;

                try {

                    UserLifeBegin = new String(bytes, "UTF_16LE");

                } catch (UnsupportedEncodingException e) {

                    e.printStackTrace();

                }


                //有效結(jié)束日期

                bytes = new byte[16];

                System.arraycopy(wordMsgBytes, index, bytes, 0, bytes.length);

                index += bytes.length;

                try {

                    UserLifeEnd = new String(bytes, "UTF_16LE");

                } catch (UnsupportedEncodingException e) {

                    e.printStackTrace();

                }


                //港澳臺(tái)身份證

                if (type == ID_TYPE_GAT) {

                    //通行證號(hào)碼

                    bytes = new byte[18];

                    System.arraycopy(wordMsgBytes, index, bytes, 0, bytes.length);

                    index += bytes.length;

                    try {

                        passport = new String(bytes, "UTF_16LE");

                    } catch (UnsupportedEncodingException e) {

                        e.printStackTrace();

                    }


                    //簽發(fā)次數(shù)

                    bytes = new byte[4];

                    System.arraycopy(wordMsgBytes, index, bytes, 0, bytes.length);

                    index += bytes.length;

                    try {

                        issueNumber = new String(bytes, "UTF_16LE");

                    } catch (UnsupportedEncodingException e) {

                        e.printStackTrace();

                    }

                }


                //照片解碼

                if (photoMsgBytesLen > 0) {

                    try {

                        byte[] buf=new byte[Wlt2Bitmap.IMG_LENGTH];

                        if (1 == Wlt2Bitmap.wlt2Bmp (photoMsgBytes, buf)) {

                            PhotoBmp = Wlt2Bitmap.Bgr2Bitmap (buf);

                        }

                    } catch (Exception e) {

                        e.printStackTrace();

                    }

                }

            }

        }


        String getNation(int code){

            switch(code){

                case 01:  return "漢";

                case 02:  return "蒙古";

                case 03:  return "回";

                case 04:  return "藏";

                case 05:  return "維吾爾";

                case 06:  return "苗";

                case 07:  return "彝";

                case 8:   return "壯";

                case 9:   return "布依";

                case 10:  return "朝鮮";

                case 11:  return "滿";

                case 12:  return "侗";

                case 13:  return "瑤";

                case 14:  return "白";

                case 15:  return "土家";

                case 16:  return "哈尼";

                case 17:  return "哈薩克";

                case 18:  return "傣";

                case 19:  return "黎";

                case 20:  return "傈僳";

                case 21:  return "佤";

                case 22:  return "畬";

                case 23:  return "高山";

                case 24:  return "拉祜";

                case 25:  return "水";

                case 26:  return "東鄉(xiāng)";

                case 27:  return "納西";

                case 28:  return "景頗";

                case 29:  return "柯?tīng)柨俗?quot;;

                case 30:  return "土";

                case 31:  return "達(dá)斡爾";

                case 32:  return "仫佬";

                case 33:  return "羌";

                case 34:  return "布朗";

                case 35:  return "撒拉";

                case 36:  return "毛南";

                case 37:  return "仡佬";

                case 38:  return "錫伯";

                case 39:  return "阿昌";

                case 40:  return "普米";

                case 41:  return "塔吉克";

                case 42:  return "怒";

                case 43:  return "烏孜別克";

                case 44:  return "俄羅斯";

                case 45:  return "鄂溫克";

                case 46:  return "德昂";

                case 47:  return "保安";

                case 48:  return "裕固";

                case 49:  return "京";

                case 50:  return "塔塔爾";

                case 51:  return "獨(dú)龍";

                case 52:  return "鄂倫春";

                case 53:  return "赫哲";

                case 54:  return "門(mén)巴";

                case 55:  return "珞巴";

                case 56:  return "基諾";

                case 97:  return "其他";

                case 98:  return "外國(guó)血統(tǒng)中國(guó)籍人士";

                default : return "";

            }

        }


        public String toString() {

            if (type == ID_TYPE_GAT) {

                return "\r\n姓        名:" + Name

                        + "\r\n性        別:" + Sex

                        + "\r\n出生日期:" + Born

                        + "\r\n住        址:" + Address

                        + "\r\n身份 證號(hào):" + IDCardNo

                        + "\r\n簽發(fā) 機(jī)關(guān):" + GrantDept

                        + "\r\n有  效  期:" + UserLifeBegin + "-" + UserLifeEnd

                        + "\r\n通行 證號(hào):" + passport

                        + "\r\n簽發(fā) 次數(shù):" + issueNumber;

            }

            else {

                return "\r\n姓        名:" + Name

                        + "\r\n性        別:" + Sex

                        + "\r\n名        族:" + Nation

                        + "\r\n出生日期:" + Born

                        + "\r\n住        址:" + Address

                        + "\r\n身份 證號(hào):" + IDCardNo

                        + "\r\n簽發(fā) 機(jī)關(guān):" + GrantDept

                        + "\r\n有  效  期:" + UserLifeBegin + "-" + UserLifeEnd;

            }

        }

    }






    (*由于產(chǎn)品升級(jí)或其他原因

    ,明創(chuàng)IDR-100YB云解碼藍(lán)牙身份證閱讀器Android開(kāi)發(fā)包產(chǎn)品實(shí)際參數(shù)有可能變更
    ,以實(shí)際產(chǎn)品為準(zhǔn)。本文中的所有陳述
    、信息和建議也不構(gòu)成任何明示或暗示的擔(dān)保)

    ?ㄗx卡器 指紋采集儀
  • 解決方案

    公安 人社 醫(yī)療 銀行
  • 行業(yè)應(yīng)用

    公安 人社 醫(yī)療 銀行
  • 服務(wù)中心

    SDK開(kāi)發(fā)包 產(chǎn)品文檔下載 常見(jiàn)問(wèn)題 服務(wù)公告
  • 微信掃碼咨詢
    項(xiàng)目合作
    微信掃碼咨詢
    批發(fā)代理

    服務(wù)熱線

    400-0020-908 總部:廣州市天河區(qū)石牌東路82號(hào)四樓
    手機(jī):13928876906
    手機(jī):020-29078850
    郵箱:mingcreate@qq.com
    ?2022 廣東明創(chuàng)智慧科技有限公司 粵ICP備2021108479號(hào)-3