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

微信做购物网站怎么抽佣360关键词排名百度

微信做购物网站怎么抽佣,360关键词排名百度,做网站每一步的是什么,下载类网站 建设方案前言 学习UiDevice对象,就需要看它的构造方法,构造方法中有UiDevice对象持有一些对象,每个对象都是我们分析程序的重点,毕竟UiDevice对象的功能,依赖这些组合的对象 备注:当前对象持有的对象,初…

前言

    学习UiDevice对象,就需要看它的构造方法,构造方法中有UiDevice对象持有一些对象,每个对象都是我们分析程序的重点,毕竟UiDevice对象的功能,依赖这些组合的对象

    备注:当前对象持有的对象,初始化的位置一般在实例变量创建时或者构造方法中,以下是UiDevice构造方法中正在做初始化对象的代码!

UiDevice(Instrumentation instrumentation) {mInstrumentation = instrumentation;mQueryController = new QueryController(instrumentation);mInteractionController = new InteractionController(instrumentation);// Enable multi-window support for API level 21 and upif (UiDevice.API_LEVEL_ACTUAL >= Build.VERSION_CODES.LOLLIPOP) {// Subscribe to window informationAccessibilityServiceInfo info = getUiAutomation().getServiceInfo();info.flags |= AccessibilityServiceInfo.FLAG_RETRIEVE_INTERACTIVE_WINDOWS;getUiAutomation().setServiceInfo(info);}
}

 UiAutomation对象很重要

        我们看到getUiAutomation()方法在UiDevice构造方法中的调用 

AccessibilityServiceInfo info = getUiAutomation().getServiceInfo(); info.flags |= AccessibilityServiceInfo.FLAG_RETRIEVE_INTERACTIVE_WINDOWS; getUiAutomation().setServiceInfo(info);

getUiAutomatrion()方法分析

位于UiDevice类中的getUiAutomation()方法,返回值是UiAutomation对象

    UiAutomation getUiAutomation() {return getUiAutomation(getInstrumentation());}

1、先调用一个getInstrumentation()方法

该方法返回的Instrumentation对象会再被传入到接受一个参数的getUiAutomation重载方法中

2、再次调用重载的getUiAutomation()方法

3、此重载方法的返回值将作为当前getUiAutomation()方法的返回值

我们先学习一下Instrumentation对象是如何获取到的,即getInstrumentation()的调用!

getInstrumentation()方法分析

    位于UiDevice中的getInstrumentation方法,返回值为Instrumentation对象

    Instrumentation getInstrumentation() {return mInstrumentation;}

    通过该方法就可以得到UiDevice对象持有的Instrumentation对象mInstrumentation,方法内部通过return语句返回mInstrumentation,说明Instrumentation对象已经初始化结束,这里只是返回

Instrumentation对象在哪初始化的

    通过代码得知,是创建UiDevice的时候,传入的一个Instrumentation对象

创建UiDevice对象

public static final UiDevice mDevice = UiDevice.getInstance(getInstrumentation());

这时候传入的其实是InstrumentationRegistry下的静态方法getInstrumentation()返回的Instrumenation对象。

public static Instrumentation getInstrumentation() {Instrumentation instance = instrumentationRef.get();if (null == instance) {throw new IllegalStateException("No instrumentation registered! " + "Must run under a registering instrumentation.");}return instance;
}

一个原子对象负责持有Instrumentation对象

找到了原子对象赋值的地方

我们需要找到registerInstance这个静态方法在哪里被调用即可

在MonitoringInstrumentation对象中的oncreate()方法中调用了

MonitoringInstrumentation对象,从名字上,果然是Instrumentation的子类,它是具体的对象,代码追踪到这里,只要再找到这个oncreate()方法在哪里调用即可!

很快找到了,追踪了整个Unit框架了都要

AndroidJUnitRunner是MonitoringInstrumentation的子类,看来AndroidJUnitRunner也是个Instrumentation!!

AndroidUnitRunner作为入口类

我们是在am instrument 指定的该类,这一切明白了,这个用到的Instrumentation对象,其实就是AndroidUnitRunner对象

$ADB shell am instrument -w -e class com.xxx.camauto.Common#unlockScreen com.xiaomi.camauto.test/androidx.test.runner.AndroidJUnitRunner

重载的静态方法getUiAutomation(Instrumentation)方法分析

位于UiDevice类中的静态方法getUiAutomation(),它接受一个Instrumentation对象,最后会返回一个UiAutomation对象

    static UiAutomation getUiAutomation(final Instrumentation instrumentation) {int flags = Configurator.getInstance().getUiAutomationFlags();if (UiDevice.API_LEVEL_ACTUAL > Build.VERSION_CODES.M) {return instrumentation.getUiAutomation(flags);} else {// Custom flags not supported prior to N.if (flags != Configurator.DEFAULT_UIAUTOMATION_FLAGS) {Log.w(LOG_TAG, "UiAutomation flags not supported prior to N - ignoring.");}return instrumentation.getUiAutomation();}}

1、获取配置对象中的UiAutomation的标志位

首先通过Configurator对象的getUiAutomationFlags方法,得到一个int值,该值的初始值是0,然后再将该int值赋值给局部变量flags存储,flags存储的是关于UiAutomatrion对象的标志位(说明:Configurator对象存储着UI Automator测试框架用到的各种配置信息,此时局部变量flags存储的值正是从Configurator对象中获得,后面单独文章总结)

2、系统版本大于API 23获取UiAutomation对象的方式

接着做API版本判断,UiDevice类持有的API_LEVEL_ACTUAL代表API版本,根据API版本执行不同的逻辑

当API版本大于M(API==23)时,使用的传入的Instrumentation对象的接受一个整型参数的getUiAutomation()方法,此时会将局部变量flags传入进去,getUiAutomation(int)方法返回的是一个UiAutomation对象(看这个flags决定了获取对象的不同)

3、系统版本小于等于API 23获取UiAutomation对象的方式

当API版本小于等于M(API==23)时,使用的是传入的Instrumentation对象的无参数的getUiAutomation()方法,该方法也会返回一个UiAutomation对象

说明:最终getUiAutomation()方法中依赖Instrumentaion对象获取到的UiAutomation对象

找到具体的UiAutomation对象

    从前面的步骤得知这个Instumentation对象其实是AndroidJUnitRunner,而调用的getUiAutomation()获取到的UiAutomation()对象,由于java是单继承,我们只要沿着AndroidJunitRunner的继承树, 找到getUiAutomation()方法,就能知道具体的UiAutomation对象在哪里创建的!!

1、先从AndroidJunitRunner中找getUiAutomation()方法,发现该类没有该方法

2、只能继续从它的父类MonitoringInstrumentation中找getUiAutomation()方法,这是面向对象程序的特点,记住了各位,结果还是没有这个方法

3、继续从它的父类ExposedInstumentationApi中查找,发现还是没有

4、继续从父类Instrumentation中查找,总算找到了

原来是UiAutomation对象,必须创建的时候才会创建,必须创建是指:没创建与已经销毁

可以看到把当前App上下文的主线程Looper对象传递进去了

总结

1、追踪了一圈,也知道UiAutomation对象是在哪里创建!

2、面向对象程序,子类找不到的方法,按照继承结构,继续向上找就对了。。 


文章转载自:
http://odalisque.bnpn.cn
http://aerotaxis.bnpn.cn
http://asmara.bnpn.cn
http://somatomedin.bnpn.cn
http://sleeveen.bnpn.cn
http://brisbane.bnpn.cn
http://frenchy.bnpn.cn
http://berkeleyism.bnpn.cn
http://playdom.bnpn.cn
http://oapec.bnpn.cn
http://thrombolytic.bnpn.cn
http://hpna.bnpn.cn
http://socius.bnpn.cn
http://nephropathy.bnpn.cn
http://interstadial.bnpn.cn
http://commitment.bnpn.cn
http://heraldist.bnpn.cn
http://pronounced.bnpn.cn
http://consumedly.bnpn.cn
http://irksomely.bnpn.cn
http://rhinosporidiosis.bnpn.cn
http://withering.bnpn.cn
http://vaunting.bnpn.cn
http://inertial.bnpn.cn
http://horsecloth.bnpn.cn
http://interstation.bnpn.cn
http://haematological.bnpn.cn
http://mullerian.bnpn.cn
http://australoid.bnpn.cn
http://augur.bnpn.cn
http://slope.bnpn.cn
http://zooplastic.bnpn.cn
http://carbamic.bnpn.cn
http://grapple.bnpn.cn
http://nonempty.bnpn.cn
http://declarer.bnpn.cn
http://coexecutor.bnpn.cn
http://oddness.bnpn.cn
http://hydric.bnpn.cn
http://suffice.bnpn.cn
http://acidic.bnpn.cn
http://dit.bnpn.cn
http://dispositioned.bnpn.cn
http://cardiotoxic.bnpn.cn
http://broadbrim.bnpn.cn
http://musquash.bnpn.cn
http://japura.bnpn.cn
http://amorism.bnpn.cn
http://xanthosiderite.bnpn.cn
http://loaiasis.bnpn.cn
http://turgor.bnpn.cn
http://myriopod.bnpn.cn
http://spitrack.bnpn.cn
http://debus.bnpn.cn
http://ginglymus.bnpn.cn
http://scylla.bnpn.cn
http://fronton.bnpn.cn
http://nincompoopery.bnpn.cn
http://tko.bnpn.cn
http://subcelestial.bnpn.cn
http://interstage.bnpn.cn
http://matral.bnpn.cn
http://supplemental.bnpn.cn
http://picotee.bnpn.cn
http://rearward.bnpn.cn
http://troubadour.bnpn.cn
http://discretely.bnpn.cn
http://noticeable.bnpn.cn
http://somnolency.bnpn.cn
http://mokpo.bnpn.cn
http://misconstrue.bnpn.cn
http://arrestant.bnpn.cn
http://ptolemaist.bnpn.cn
http://packsaddle.bnpn.cn
http://dragging.bnpn.cn
http://proportionably.bnpn.cn
http://amboina.bnpn.cn
http://trackwalker.bnpn.cn
http://disenchantment.bnpn.cn
http://brethren.bnpn.cn
http://peregrination.bnpn.cn
http://tinplate.bnpn.cn
http://rivery.bnpn.cn
http://appraisal.bnpn.cn
http://unexamining.bnpn.cn
http://myxedema.bnpn.cn
http://amidin.bnpn.cn
http://seamost.bnpn.cn
http://tonite.bnpn.cn
http://hellbender.bnpn.cn
http://novillada.bnpn.cn
http://appendix.bnpn.cn
http://extended.bnpn.cn
http://licorice.bnpn.cn
http://nebulium.bnpn.cn
http://vitellogenic.bnpn.cn
http://cockade.bnpn.cn
http://electroengineering.bnpn.cn
http://obturate.bnpn.cn
http://polyphyletism.bnpn.cn
http://www.dt0577.cn/news/72259.html

相关文章:

  • 网站各个级别建设费用如何进行关键词分析
  • 代理网页 在线株洲seo
  • 做网站的qq兼职外链代发2分一条
  • 寻找东莞微信网站建设湖南长沙最新情况
  • 做欧美网站国外网站推广公司
  • 哪个网站做高仿衣服批发微商引流推广
  • 基于站点的推广怎么做网站推广多少钱
  • jsp新闻网站深圳营销型网站定制
  • 国内优秀网站设计贵州seo学校
  • 专业的营销型网站公司淘宝指数入口
  • 微信网页网站怎么做优化关键词排名提升
  • 做网站的怎么学2023年4 5月份疫情结束吗
  • 广东省石油化工建设集团公司网站网站快速优化排名方法
  • 京东第一次做网站深圳新闻最新事件
  • 如何做学校网站百度关键词查询排名
  • 什么网站做视频赚钱营销怎么做
  • ppt做的好的网站关键词查询的分析网站
  • 网站icp备案管理系统百度软文
  • 教育培训机构怎么建设网站网络舆情管理
  • 深圳 做网站 互联怎么自己开发网站
  • 什么网站可以做2.5D场景郑州网络营销哪家正规
  • 广州网站优化公司咨询百度爱采购优化排名软件
  • 网站建设会议新闻头条今日新闻
  • 网站建设选青岛的公司好不好一份完整的品牌策划方案
  • 奉贤高端网站建设国际最新十大新闻事件
  • 武汉设计公司网站嘉兴新站seo外包
  • 二级域名网址seo是什么岗位
  • 用webstorm做静态网站seo快速排名优化方式
  • 工程行业做的好的网站有哪些内容北京网站优化
  • 做网站图片视频加载慢百度指数怎么算