Android识别NFC芯片制造商的方法是什么
发表于:2025-01-18 作者:千家信息网编辑
千家信息网最后更新 2025年01月18日,本篇文章为大家展示了Android识别NFC芯片制造商的方法是什么,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。如何识别?通过NFC模块的Serial Num
千家信息网最后更新 2025年01月18日Android识别NFC芯片制造商的方法是什么
本篇文章为大家展示了Android识别NFC芯片制造商的方法是什么,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。
如何识别?
通过NFC模块的Serial Number即UID,用户访问权限为R只读,每颗NFC芯片独有序列号(UID),在出厂时写入,用户不能改写。
Android如何实现?
通过Intent获取UID
/** * 读取nfcUID 返回String类型大写的UID * * 这个测试顺便加上的,下面用不到,做个笔记~~ * */ public static String readUID(Intent intent) throws UnsupportedEncodingException { Tag tagFromIntent = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG); byte[] uid = tagFromIntent != null ? tagFromIntent.getId() : null; return HexUtil.encodeHexStr(uid, false); } /** * 读取nfcUID 返回byte[]数组 * */ public static byte[] readUID(Intent intent) throws UnsupportedEncodingException { Tag tagFromIntent = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG); return tagFromIntent.getId(); }
HexUtil工具类:
public class HexUtil { /** * 用于建立十六进制字符的输出的小写字符数组 */ private static final char[] DIGITS_LOWER = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; /** * 用于建立十六进制字符的输出的大写字符数组 */ private static final char[] DIGITS_UPPER = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; /** * 将字节数组转换为十六进制字符数组 * * @param data byte[] * @param toDigits 用于控制输出的char[] * @return 十六进制char[] */ protected static char[] encodeHex(byte[] data, char[] toDigits) { int l = data.length; char[] out = new char[l << 1]; // two characters form the hex value. for (int i = 0, j = 0; i < l; i++) { out[j++] = toDigits[(0xF0 & data[i]) >>> 4]; out[j++] = toDigits[0x0F & data[i]]; } return out; } /** * 将字节数组转换为十六进制字符串 * * @param data byte[] * @param toLowerCasetrue
传换成小写格式 ,false
传换成大写格式 * @return 十六进制String */ public static String encodeHexStr(byte[] data, boolean toLowerCase) { return encodeHexStr(data, toLowerCase ? DIGITS_LOWER : DIGITS_UPPER); } /** * 将字节数组转换为十六进制字符串 * * @param data byte[] * @param toDigits 用于控制输出的char[] * @return 十六进制String */ protected static String encodeHexStr(byte[] data, char[] toDigits) { if (data == null) { return ""; } return new String(encodeHex(data, toDigits)); }}
通过UID去查询厂商
public class Manufacturer { private static final String MNF_UNKNOWN = "Unknown Manufacture"; public static final MapManufacturerName; static { ManufacturerName = new HashMap<>(); ManufacturerName.put((byte)1, "Motorola"); ManufacturerName.put((byte)2, "STMicroelectronics SA "); ManufacturerName.put((byte)3, "Hitachi, Ltd"); ManufacturerName.put((byte)4, "NXP Semiconductors"); ManufacturerName.put((byte)5, "Infineon Technologies AG "); ManufacturerName.put((byte)6, "Cylink"); ManufacturerName.put((byte)7, "Texas Instrument"); ManufacturerName.put((byte)8, "Fujitsu Limited"); ManufacturerName.put((byte)9, "Matsushita Electronics Corporation, Semiconductor Company"); ManufacturerName.put((byte)10, "NEC"); ManufacturerName.put((byte)11, "Oki Electric Industry Co. Ltd"); ManufacturerName.put((byte)12, "Toshiba Corp"); ManufacturerName.put((byte)13, "Mitsubishi Electric Corp"); ManufacturerName.put((byte)14, "Samsung Electronics Co. Ltd"); ManufacturerName.put((byte)15, "Hynix"); ManufacturerName.put((byte)16, "LG-Semiconductors Co. Ltd"); ManufacturerName.put((byte)17, "Emosyn-EM Microelectronics"); ManufacturerName.put((byte)18, "INSIDE Technology"); ManufacturerName.put((byte)19, "ORGA Kartensysteme GmbH"); ManufacturerName.put((byte)20, "SHARP Corporation"); ManufacturerName.put((byte)21, "ATMEL"); ManufacturerName.put((byte)22, "EM Microelectronic-Marin SA"); ManufacturerName.put((byte)23, "SMARTRAC TECHNOLOGY GmbH "); ManufacturerName.put((byte)24, "ZMD AG"); ManufacturerName.put((byte)25, "XICOR, Inc"); ManufacturerName.put((byte)26, "Sony Corporation"); ManufacturerName.put((byte)27, "Malaysia Microelectronic Solutions Sdn. Bhd"); ManufacturerName.put((byte)28, "Emosyn"); ManufacturerName.put((byte)29, "Shanghai Fudan Microelectronics Co. Ltd"); ManufacturerName.put((byte)30, "Magellan Technology Pty Limited"); ManufacturerName.put((byte)31, "Melexis NV BO"); ManufacturerName.put((byte)32, "Renesas Technology Corp"); ManufacturerName.put((byte)33, "TAGSYS"); ManufacturerName.put((byte)34, "Transcore"); ManufacturerName.put((byte)35, "Shanghai belling corp., ltd"); ManufacturerName.put((byte)36, "Masktech Germany Gmbh"); ManufacturerName.put((byte)37, "Innovision Research and Technology Plc"); ManufacturerName.put((byte)38, "Hitachi ULSI Systems Co., Ltd"); ManufacturerName.put((byte)39, "Yubico AB "); ManufacturerName.put((byte)40, "Ricoh"); ManufacturerName.put((byte)41, "ASK"); ManufacturerName.put((byte)42, "Unicore Microsystems, LLC"); ManufacturerName.put((byte)43, "Dallas Semiconductor/Maxim"); ManufacturerName.put((byte)44, "Impinj, Inc"); ManufacturerName.put((byte)45, "RightPlug Alliance"); ManufacturerName.put((byte)46, "Broadcom Corporation"); ManufacturerName.put((byte)47, "MStar Semiconductor, Inc"); ManufacturerName.put((byte)48, "BeeDar Technology Inc"); ManufacturerName.put((byte)49, "RFIDsec"); ManufacturerName.put((byte)50, "Schweizer Electronic AG "); ManufacturerName.put((byte)51, "AMIC Technology Corp"); ManufacturerName.put((byte)52, "Mikron JSC"); ManufacturerName.put((byte)53, "Fraunhofer Institute for Photonic Microsystems"); ManufacturerName.put((byte)54, "IDS Microchip AG"); ManufacturerName.put((byte)55, "Kovio"); ManufacturerName.put((byte)56, "HMT Microelectronic Ltd"); ManufacturerName.put((byte)57, "Silicon Craft Technology"); ManufacturerName.put((byte)58, "Advanced Film Device Inc"); ManufacturerName.put((byte)59, "Nitecrest Ltd"); ManufacturerName.put((byte)60, "Verayo Inc"); ManufacturerName.put((byte)61, "HID Global"); ManufacturerName.put((byte)62, "Productivity Engineering Gmbh"); ManufacturerName.put((byte)63, "Austriamicrosystems AG (reserved)"); ManufacturerName.put((byte)64, "Gemalto SA"); ManufacturerName.put((byte)65, "Renesas Electronics Corporation"); ManufacturerName.put((byte)66, "3Alogics Inc"); ManufacturerName.put((byte)67, "Top TroniQ Asia Limited"); ManufacturerName.put((byte)68, "Gentag Inc (USA)"); ManufacturerName.put((byte)69, "Invengo Information Technology Co.Ltd "); ManufacturerName.put((byte)70, "Guangzhou Sysur Microelectronics, Inc"); ManufacturerName.put((byte)71, "CEITEC S.A"); ManufacturerName.put((byte)72, "Shanghai Quanray Electronics Co. Ltd"); ManufacturerName.put((byte)73, "MediaTek Inc"); ManufacturerName.put((byte)74, "Angstrem PJSC"); ManufacturerName.put((byte)75, "Celisic Semiconductor (Hong Kong) Limited"); ManufacturerName.put((byte)76, "LEGIC Identsystems AG"); ManufacturerName.put((byte)77, "Balluff GmbH"); ManufacturerName.put((byte)78, "Oberthur Technologies "); ManufacturerName.put((byte)79, "Silterra Malaysia Sdn. Bhd"); ManufacturerName.put((byte)80, "DELTA Danish Electronics, Light & Acoustics "); ManufacturerName.put((byte)81, "Giesecke & Devrient GmbH"); ManufacturerName.put((byte)82, "Shenzhen China Vision Microelectronics Co., Ltd"); ManufacturerName.put((byte)83, "Shanghai Feiju Microelectronics Co. Ltd"); ManufacturerName.put((byte)84, "Intel Corporation"); ManufacturerName.put((byte)85, "Microsensys GmbH"); ManufacturerName.put((byte)86, "Sonix Technology Co., Ltd"); ManufacturerName.put((byte)87, "Qualcomm Technologies Inc"); ManufacturerName.put((byte)88, "Realtek Semiconductor Corp"); ManufacturerName.put((byte)89, "Freevision Technologies Co. Ltd"); ManufacturerName.put((byte)90, "Giantec Semiconductor Inc"); ManufacturerName.put((byte)91, "JSC Angstrem-T"); ManufacturerName.put((byte)92, "STARCHIP"); ManufacturerName.put((byte)93, "SPIRTECH"); ManufacturerName.put((byte)94, "GANTNER Electronic GmbH"); ManufacturerName.put((byte)95, "Nordic Semiconductor"); ManufacturerName.put((byte)96, "Verisiti Inc"); ManufacturerName.put((byte)97, "Wearlinks Technology Inc"); ManufacturerName.put((byte)98, "Userstar Information Systems Co., Ltd"); ManufacturerName.put((byte)99, "Pragmatic Printing Ltd"); ManufacturerName.put((byte)100, "Associado Laboratde Sistemas IntegrTecnolLSI-TEC"); ManufacturerName.put((byte)101, "Tendyron Corporation"); ManufacturerName.put((byte)102, "MUTO Smart Co., Ltd"); ManufacturerName.put((byte)103, "ON Semiconductor"); ManufacturerName.put((byte)104, "TÜBİTAK BİLGEM"); ManufacturerName.put((byte)105, "Huada Semiconductor Co., Ltd"); ManufacturerName.put((byte)106, "SEVENEY"); ManufacturerName.put((byte)107, "ISSM"); ManufacturerName.put((byte)108, "Wisesec Ltd"); ManufacturerName.put((byte)126, "Holtek"); ManufacturerName.put((byte)-112, "Shanghai Fudan Microelectronics Co. Ltd"); } /** * 通过UID/Serial Number获取芯片制造商名字 * @param paramArrayOfByte UID/Serial Number * @return 制造商名字 */ public static String getManufacturerByUid(byte[] paramArrayOfByte) { if (paramArrayOfByte != null) try { if (paramArrayOfByte.length == 8) { byte[] arrayOfByte = new byte[3]; System.arraycopy(paramArrayOfByte, paramArrayOfByte.length - 3, arrayOfByte, 0, 3); return Arrays.equals(arrayOfByte, new byte[] { 29, 4, -32 }) ? ManufacturerName.get((byte)29) : (Arrays.equals(arrayOfByte, new byte[] { -95, 4, -32 }) ? ManufacturerName.get((byte)29) : (Arrays.equals(arrayOfByte, new byte[] { -94, 4, -32 }) ? ManufacturerName.get((byte)29) : ManufacturerName.get(paramArrayOfByte[6]))); } if (paramArrayOfByte.length == 7) return ManufacturerName.get(paramArrayOfByte[0]); } catch (Exception exception) { exception.printStackTrace(); } return MNF_UNKNOWN; }
上述内容就是Android识别NFC芯片制造商的方法是什么,你们学到知识或技能了吗?如果还想学到更多技能或者丰富自己的知识储备,欢迎关注行业资讯频道。
十六进制
字符
数组
制造商
芯片
制造
输出
大写
字节
方法
内容
名字
字符串
小写
技能
格式
用户
知识
控制
简明
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
绍兴手机游戏软件开发地址
数据库 分表分库
个人信息信用数据库变动后
哪里找软件开发的
雨课堂计算机网络技术第五章
缓冲区溢出可以保护网络安全吗
小白网络技术科普课动画2
计算机网络技术最好的专科
湖南学电脑软件开发工资
杨浦区电话软件开发供应商简介
通关后的奖励发放由服务器处理吗
电脑弹出服务器运行
数据库时间datetime
网络安全前沿进展
互联网 科技创业竞赛
微博系统数据库
电脑查看安卓短信数据库
宝塔面板 数据库 表损坏
如何注册申请阿里服务器
蛮王柯南建服务器
携程软件开发待遇
网络安全课 微信
网易云邮箱显示对方服务器未响应
数据库安全性控制常用的方法
服务器不能开远程
html接入数据库变量
国内机械软件开发公司
硕博士论文英文数据库
王树彤谈互联网科技
网络安全周知识宣传手册