• 廣東明創智慧科技有限公司是中國專業的身份證閱讀器供應商,
  • 專注身份證閱讀器、指紋采集儀、社??ㄗx卡器、IC卡讀寫器的一家身份證應用服務平臺
服務熱線:400-0020-908 官方微信 產品標簽 網站地圖 EN

明創智慧

當前位置: 首頁 > 服務支持專區 > SDK開發包 > 正文

明創IDR-100YB云解碼藍牙身份證閱讀器Android開發包

來源:www.mingcreate.cn   標簽:云解碼 藍牙 IDR-100YB DK309   最近更新:2022-2-19

111.jpg

本開發包支持明創云解碼藍牙身份證閱讀器,支持型號IDR-100YB、DK309系列云解碼讀卡器。

點擊這里下載↓



public class IDCardData {

    public final static int ID_TYPE_CN = 1;       //身份證類型-居民身份證

    public final static int ID_TYPE_GAT = 2;      //身份證類型-港澳臺居民身份證

    public final static int ID_TYPE_FOREIGN = 3;  //身份證類型-外國人永久居留身份證


    public String Name = null;                   // 姓名

    public String Sex = null;                    //性別

    public String Nation = null;                 //名族

    public String Born = null;                   //出生

    public String Address = null;                //住址

    public String IDCardNo = null;               //身份證號

    public String GrantDept = null;              //簽發機關

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

    public String UserLifeEnd = null;            //有效期結束日期

    public String passport = null;               //通行證號碼

    public String issueNumber = null;            //簽發次數


    public Bitmap PhotoBmp = null;

    public byte[] fingerprintBytes = null;       //指紋數據

    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);   //指紋長度

                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);

            }


            //判斷身份證的類型是否為港澳臺身份證

            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();

            }


            //身份證號

            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();

            }


            //簽發機關

            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();

            }


            //有效結束日期

            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();

            }


            //港澳臺身份證

            if (type == ID_TYPE_GAT) {

                //通行證號碼

                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();

                }


                //簽發次數

                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 "東鄉";

            case 27:  return "納西";

            case 28:  return "景頗";

            case 29:  return "柯爾克孜";

            case 30:  return "土";

            case 31:  return "達斡爾";

            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 "獨龍";

            case 52:  return "鄂倫春";

            case 53:  return "赫哲";

            case 54:  return "門巴";

            case 55:  return "珞巴";

            case 56:  return "基諾";

            case 97:  return "其他";

            case 98:  return "外國血統中國籍人士";

            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身份 證號:" + IDCardNo

                    + "\r\n簽發 機關:" + GrantDept

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

                    + "\r\n通行 證號:" + passport

                    + "\r\n簽發 次數:" + issueNumber;

        }

        else {

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

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

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

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

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

                    + "\r\n身份 證號:" + IDCardNo

                    + "\r\n簽發 機關:" + GrantDept

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

        }

    }

}






(*由于產品升級或其他原因,明創IDR-100YB云解碼藍牙身份證閱讀器Android開發包產品實際參數有可能變更,以實際產品為準。本文中的所有陳述、信息和建議也不構成任何明示或暗示的擔保)

主站蜘蛛池模板: 武汉印刷厂_为企业提供宣传单页彩页印刷_武汉折页印刷_海报设计印刷与制作 - 武汉泽雅印刷公司 | 呼吸家官网|肺功能检测仪生产厂家|国产肺功能仪知名品牌|肺功能检测仪|肺功能测试仪|婴幼儿肺功能仪|弥散残气肺功能仪|肺功能测试系统|广州红象医疗科技有限公司|便携式肺功能仪|大肺功能仪|呼吸康复一体机|儿童肺功能仪|肺活量计|医用简易肺功能仪|呼吸康复系统|肺功能仪|弥散肺功能仪(大肺)|便携式肺功能检测仪|肺康复|呼吸肌力测定肺功能仪|肺功能测定仪|呼吸神经肌肉刺激仪|便携式肺功能 | 蒸汽发生器-电加热蒸汽发生器、燃油蒸汽发生器、燃气蒸汽发生器设备厂家-诺贝思蒸汽发生器 | 制冷设备|冷库|空调|配件【制冷通】国内领先的制冷服务平台 | 新东方大学考试官网_考研/英语/雅思/托福/四六级/日语/韩语/教资在线网课官网 | 耐磨锤头|合金锤头|高铬耐磨锤头|破碎机锤头|双金属双液复合锤头_巩义东辰实业 合金耐磨锤头铸造厂 | 消防水电施工,消防水电安装,消防水电施工公司,消防水电改造-亿杰北京消防工程公司 | 山东正奇塑料机械有限公司,山东塑料机械,水带机组,塑料管材机,山东吹膜机组厂家,山东农膜机厂家 山东长青石油液压机械有限公司-致力于石油机械设备的研发制造,提供定制服务 | 深圳LED显示屏厂家_室内户外LED显示屏_彩屏电子有限公司 | 新东方大学考试官网_考研/英语/雅思/托福/四六级/日语/韩语/教资在线网课官网 | 宿迁代账公司,专业会计查账,代理工商注册,商标注册,专利申请,公司注册哪家好-中方会计事务所 | 柱塞泥浆泵|压滤机专用泵|陶瓷泥浆泵_咸阳华星泵业有限公司 | 萍乡市德一防水工程有限公司| 深圳沃亚游学官网丨国外游学丨国际夏冬令营丨美国游学线路丨出国短期游学丨亲子海外游丨游学咨询: 0755-83843308 | 在线播放国产精品|哔咔漫画破解版永久vip兑换码|免费黄漫画|女被黄漫扒衣服软件|91精品麻豆 | 合肥环氧地坪-合肥固化地坪施工-安徽地宽建筑装饰工程有限公司 | 兰舍硅藻泥 -- 深圳硅藻泥|深圳兰舍硅藻泥|深圳硅藻泥品牌|深圳硅藻泥价格|深圳硅藻泥厂家|深圳硅藻泥施工| | 每天一篇励志文章,每晚一个励志故事—励志人生网 | 上海五相仪器仪表有限公司-鼓风干燥箱-拍击式无菌均质器生产厂家 | 上海商标注册,上海注册商标,上海商标代理,国际商标注册,版权登记-上海律点知识产权代理有限公司 上海山田机械有限公司 | 真空机器人维修_晶圆机械手保养_半导体机械臂维修_面板机器人保养_AMHS改造-广州市广科智能技术有限公司 | 上饶环亚电脑会计培训学校--电脑学校|上饶电脑学校|上饶电脑培训|会计培训|上饶会计培训|上饶县会计培训|广丰会计培训|玉山会计培训|横峰会计培训|上饶网店培训 上进电缆(嘉兴)股份有限公司官网 - 光伏电缆|防火电缆|电力电缆|铝合金电缆专业生产厂家 | 天津网站制作|网站建设|营销型网站建设|筑美网络---天津做网站公司 | 生活污水处理工程安装承包-江苏富瑞源环境工程有限公司 | 注册公司计|代理记账|临港招商_上海临港商盟官网| 尾矿干排_机制砂尾矿干排_带式压滤机|山东森鹏环保科技有限公司 潍坊卓瑞机械有限公司,输送设备,石灰消化设备,餐厨垃圾设备,化机浆设备,污泥脱水 | 铸铁平台-焊接平台-划线平台-三维焊接平台厂家-泊头市溪海冶金机械设备有限公司 | 纸箱包装,济南纸箱,济南包装盒-济南佳琦包装有限公司 | 九江市东鸿气体有限公司 | 专利申请|知识产权贯标|商标提异议|国外专利申请-润平知识产权 | 石家庄华龙鼎电动门,石家庄电动门电话,石家庄电动门配件,石家庄电动门维修电话,石家庄电动门安装电话,石家庄华龙电动门 | 激光切管机_等离子切管机_相贯线切管机厂家|服务为先-山东美峰智能设备有限公司 | 食品厂净化工程-无尘车间装修改造-净化工程-洁净工程-苏州远盈净化公司 | 全自动贴标机厂家-深圳市优斯迪自动贴标机官网 | 装盒机_全自动装盒机-温州凯祥包装机械有限公司 | 屋顶式恒温恒湿机,新风管道除湿机|上海众有实业百科 | 液压升降货梯_导轨式升降机_往复式提升机_济南宇轩机械厂家 | 轻质隔墙板厂家-加气隔墙板_grc轻质隔墙板_空心实心复合隔墙板_水泥混凝土轻质隔墙板批发价格 | 深圳浪琴维修服务中心_浪琴售后保养服务网点_地址 | 生物除臭_废气处理_玻璃钢风机_布袋除尘_脱硫脱硝_催化燃烧_生物滤池_广东正州环保科技股份有限公司 | 气动隔膜调节阀,气动比例调节隔膜阀|川熙流体设备百科 |