当前位置: 首页 > news >正文

青岛网站的优化现在学做网站赚钱吗

青岛网站的优化,现在学做网站赚钱吗,有自己的域名怎么建设网站,域名注册最好的网站背景 在编写CarrierConfig的时候经常出现配置不生效的情况#xff0c;比如运营商支持大范围的imsi#xff0c;或者是测试人员写卡位数的问题等等#xff0c;因此就需要模式匹配#xff08;包含但不限于正则表达式#xff09;。 基本概念: 模式匹配涉及定义一个“模式”比如运营商支持大范围的imsi或者是测试人员写卡位数的问题等等因此就需要模式匹配包含但不限于正则表达式。 基本概念: 模式匹配涉及定义一个“模式”该模式可以是一个字符串、正则表达式或其他结构。系统将此模式应用于目标数据找出符合该模式的部分。 应用场景: 字符串匹配: 查找特定字符序列或模式例如在文本中查找单词或短语。数据解析: 分析和提取数据例如从 JSON 或 XML 文档中提取信息。正则表达式: 使用正则表达式进行复杂的字符串匹配和替换操作。逻辑匹配: 例如在函数式编程中使用模式匹配来简化条件语句。 编程语言中的模式匹配实现: 很多编程语言都支持模式匹配的特性例如 Haskell: 强大的模式匹配功能可用于列表、元组等数据结构。        Scala: 提供内置的模式匹配语法用于匹配类型和结构。Java: 使用 Pattern 和 Matcher 类进行正则表达式匹配。Python: 使用 re 模块进行正则表达式匹配。 解析逻辑 packages/apps/CarrierConfig/src/com/android/carrierconfig/DefaultCarrierConfigService.java 详细代码 参数解析: xmlImsi: 这是从 XML 资源中获取的 IMSI 表达式它可能是一个正则表达式。id: 这是一个 CarrierIdentifier 对象提供了当前的 IMSI。 获取当前 IMSI: String currentImsi id.getImsi();: 该行代码从 CarrierIdentifier 对象中获取当前的 IMSI 字符串。 正则表达式匹配: Pattern imsiPattern Pattern.compile(xmlImsi, Pattern.CASE_INSENSITIVE);: 这行代码将 XML 中的 IMSI 表达式编译成正则表达式模式并设置为不区分大小写尽管在 IMSI 字符串中通常不涉及大小写问题。Matcher matcher imsiPattern.matcher(currentImsi);: 这行代码创建一个 Matcher 对象用于比较当前 IMSI。 执行匹配: matchFound matcher.matches();: 这个方法检查当前 IMSI 是否与正则表达式匹配。 参数检查  checkFilters检查的参数包含 如下代码可见支持正则匹配的只有imsi和sp。 /*** Checks to see if an XML node matches carrier filters.** pThis iterates over the attributes of the current tag pointed to by {code parser} and* checks each one against {code id} or {link Build.DEVICE} or {link R.string#sku_filter} or* {link Build.BOARD}. Attributes that are not specified in the node will not be checked, so a* node with no attributes will always return true. The supported filter attributes are,* ul* limcc: {link CarrierIdentifier#getMcc}/li* limnc: {link CarrierIdentifier#getMnc}/li* ligid1: {link CarrierIdentifier#getGid1}/li* ligid2: {link CarrierIdentifier#getGid2}/li* lispn: {link CarrierIdentifier#getSpn}/li* liimsi: {link CarrierIdentifier#getImsi}/li* lidevice: {link Build.DEVICE}/li* livendorSku: {link SystemConfig.VENDOR_SKU_PROPERTY}/li* lihardwareSku: {link SystemConfig.SKU_PROPERTY}/li* liboard: {link Build.BOARD}/li* licid: {link CarrierIdentifier#getCarrierId()}* or {link CarrierIdentifier#getSpecificCarrierId()}/li* lisku: {link R.string#sku_filter} sku_filter that OEM customizable filter/li* /ul* /p** p* The attributes imsi and spn can be expressed as regexp to filter on patterns.* The spn attribute can be set to the string null to allow matching against a SIM* with no spn set.* /p** param parser an XmlPullParser pointing at a START_TAG with the attributes to check.* param id the carrier details to check against.* param sku a filter to be customizable.* return false if any XML attribute does not match the corresponding value.*/static boolean checkFilters(XmlPullParser parser, Nullable CarrierIdentifier id, String sku) {String vendorSkuProperty SystemProperties.get(ro.boot.product.vendor.sku, );String hardwareSkuProperty SystemProperties.get(ro.boot.product.hardware.sku, );for (int i 0; i parser.getAttributeCount(); i) {boolean result true;String attribute parser.getAttributeName(i);String value parser.getAttributeValue(i);switch (attribute) {case mcc:result (id null) || value.equals(id.getMcc());break;case mnc:result (id null) || value.equals(id.getMnc());break;case gid1:result (id null) || value.equalsIgnoreCase(id.getGid1());break;case gid2:result (id null) || value.equalsIgnoreCase(id.getGid2());break;case spn:result (id null) || matchOnSP(value, id);break;case imsi:result (id null) || matchOnImsi(value, id);break;case device:result value.equalsIgnoreCase(Build.DEVICE);break;case vendorSku:result value.equalsIgnoreCase(vendorSkuProperty);break;case hardwareSku:result value.equalsIgnoreCase(hardwareSkuProperty);break;case board:result value.equalsIgnoreCase(Build.BOARD);break;case cid:result (id null) || (Integer.parseInt(value) id.getCarrierId())|| (Integer.parseInt(value) id.getSpecificCarrierId());break;case name:// name is used together with cid for readability. ignore for filter.break;case sku:result value.equalsIgnoreCase(sku);break;default:Log.e(TAG, Unknown attribute attribute value);result false;break;}if (!result) {return false;}}return true;} IMSI的匹配逻辑 参数解析: xmlImsi: 这是从 XML 资源中获取的 IMSI 表达式它可能是一个正则表达式。id: 这是一个 CarrierIdentifier 对象提供了当前的 IMSI。 获取当前 IMSI: String currentImsi id.getImsi();: 该行代码从 CarrierIdentifier 对象中获取当前的 IMSI 字符串。 正则表达式匹配: Pattern imsiPattern Pattern.compile(xmlImsi, Pattern.CASE_INSENSITIVE);: 这行代码将 XML 中的 IMSI 表达式编译成正则表达式模式并设置为不区分大小写尽管在 IMSI 字符串中通常不涉及大小写问题。Matcher matcher imsiPattern.matcher(currentImsi);: 这行代码创建一个 Matcher 对象用于比较当前 IMSI。 执行匹配: matchFound matcher.matches();: 这个方法检查当前 IMSI 是否与正则表达式匹配。 /*** Check to see if the IMSI expression from the XML matches the IMSI of the* Carrier.** param xmlImsi IMSI expression fetched from the resource XML* param id Id of the evaluated CarrierIdentifier* return true if the XML IMSI matches the IMSI of CarrierIdentifier, false* otherwise.*/static boolean matchOnImsi(String xmlImsi, CarrierIdentifier id) {boolean matchFound false;String currentImsi id.getImsi();// If we were able to retrieve current IMSI, see if it matches.if (currentImsi ! null) {//使用 Pattern 和 Matcher 接口//使用正则表达式来匹配 xmlImsi 与 currentImsi。//这允许 xmlImsi 采用正则表达式的形式从而支持更复杂的匹配逻辑比如匹配特定模式的 IMSI 字符串。Pattern imsiPattern Pattern.compile(xmlImsi, Pattern.CASE_INSENSITIVE);Matcher matcher imsiPattern.matcher(currentImsi);matchFound matcher.matches();}return matchFound;} 资料 展讯平台参考CarrierConfig配置使用和加载流程简介-CSDN博客AOSP【Telephony】CarrierConfig加载流程解析运营商ims配置增删查改(AOSP)-CSDN博客
http://www.sczhlp.com/news/174372/

相关文章:

  • 娱乐网站开发wordpress链接提交
  • 朝阳网站建设是什么意思wordpress登录无反应
  • 网站更新和维护怎么做河南企业网站优化
  • 织梦搭建网站有了源码怎么做软件
  • 东阳网站制作wordpress 建app
  • 一键查询注册过的网站婚恋网站女孩子都是做美容
  • 域名和网站不是一家怎么办小米路由器3做网站
  • 公司网站建设怎么深圳市龙华区民治街道
  • 加强网站和新媒体建设管理的意义深圳网站建设公司联系
  • wordpress企业网站seo东莞最新确诊病例在哪里
  • 湖北现代城市建设集团网站国家企业信息查询平台官网
  • 山东天成建设工程有限公司网站怎么在服务器里面建设网站
  • ae模板陕西seo关键词优化外包
  • 搜索网站建设网站开发的硬件设备
  • 做赌场网站犯法么网站建设和管理是教什么
  • 网站代码加密了怎么做莱芜网站快排
  • 重庆建设网站公司南京自助网站建设
  • 做网站前期工作网站开发什么比较有创意
  • 东莞市官网网站建设公司大连seo推广优化
  • 泉州做网站的企业网页版微信无法登陆
  • 郑州网站建设与设计网站htm建设
  • 做网站开发商淘软件
  • 做软件下载网站违法吗wordpress 盒模型大学
  • 网站建设哪家好首选万维科技北京企业建站技术
  • 嘉定网站设计开发没有版权的图片网站
  • 温州文成县高端网站设计成都网站建设 3e网络
  • 网站 wordpress 公众号网站建设的项目总结
  • 长沙网站优化诊断建设网站有几种渠道
  • 美橙网站建设学习教程做一个同城app得多少钱
  • 石家庄手机网站制作多少钱网站开发项目经验和教训